Notifications
Clear all

VB Plugin Question

7 Posts
3 Users
0 Reactions
4,360 Views
Posts: 107
Topic starter
(@michael-sullivan)
Estimable Member
Joined: 19 years ago
[#4224]

How do I write or refresh the content in the following picture in VB.NET in my plugin.

Cheers
Michael


6 Replies
Posts: 899
(@sallz0r)
Prominent Member
Joined: 18 years ago

Do you want to change the name? If so, I remember having to override the default "ToString" method to get it outputting what I want -- I can't remember where that was displayed, though.

If that's not what you're after, can you clarify what you're trying to do?


Reply
Posts: 107
Topic starter
(@michael-sullivan)
Estimable Member
Joined: 19 years ago

When I change the port number how do I refresh or update on the form.


Reply
Posts: 899
(@sallz0r)
Prominent Member
Joined: 18 years ago

Aah, right. If I understand you correctly, the bit down the bottom isn't changing to reflect what ports you're using?

I could be mistaken here, but I believe that box is filled with data pulled from the plugins via the HardwareMap function. Basically, Vixen needs to know what type of port (serial or parallel) and what port number is being used, so it can check for conflicts, populate that box, etc.

for example, a plugin might implement that call as thus:


        public HardwareMap[] HardwareMap
        {
            get
            {
                return new HardwareMap[] { new HardwareMap("Serial", int.Parse(port.PortName.Substring(3))) };
            }
        }

Which basically says, using a "Serial" port (first argument), and an integer for the port number. The port number is pulled from the port name's 4th character -- eg. "COM3" will return 3.

Then, Vixen can use that to do it's magic, and populate that box you're looking at.

At least, that's how I *think* it works...... 😉

Let me know if that didn't answer your question.

Cheers,
Michael


Reply
Posts: 107
Topic starter
(@michael-sullivan)
Estimable Member
Joined: 19 years ago

Hi,

I get the port number to change but it does not refresh in the port configuration window unless I close and reopen the Sequence Plugin Mapping form.

Michael


Reply
Posts: 899
(@sallz0r)
Prominent Member
Joined: 18 years ago

Aah, well, that's probably a bug with Vixen, I'm guessing. I thought mine did, but if you're doing the HarwareMap thing OK, then I can't think of anything else plugin-wise that could be causing it. 🙂

Dunno, check with KC...


Reply
teberle
Posts: 641
(@teberle)
Honorable Member
Joined: 19 years ago

Here is how you I do it in my plugins and it will update the information for you.

Within Vixen there is a Vixen.Dialogs namespace. This contains built in dialogs for selecting your operating ports for example there is a SerialSetupDialog so in your plugin you can make the call to this form, setup your parameters and then you would have your hardmap look something like this.

public HardwareMap[] HardwareMap
{ get
{ return new HardwareMap[] { new HardwareMap("Serial", int.Parse(this.m_selectedPort.PortName.Substring(3))) }; }
}

and that should update the box as it does in my plugins. I can pull some data from my plugins and send it to you if you need some additional examples.


Reply
Share: