Serial Port Setup D...
 
Notifications
Clear all

Serial Port Setup Dialog

5 Posts
4 Users
0 Reactions
4,228 Views
teberle
Posts: 641
Topic starter
(@teberle)
Honorable Member
Joined: 20 years ago
[#720]

All,

Instead of creating your own serial port setup dialog you can use the Vixen.Dialogs.SerialSetupDialog class. Just add a button, a click event and then instantiate the dialog. You can then get the serial port object buy calling the selectedPort accessor method. I am using this in a new plugin I am writing.

There are also several other dialogs available in the namespace Vixen.Dialogs.

Tony


4 Replies
A Marchini
Posts: 426
(@a-marchini)
Reputable Member
Joined: 19 years ago
teberle wrote:All,

Instead of creating your own serial port setup dialog you can use the Vixen.Dialogs.SerialSetupDialog class. Just add a button, a click event and then instantiate the dialog. You can then get the serial port object buy calling the selectedPort accessor method. I am using this in a new plugin I am writing.

There are also several other dialogs available in the namespace Vixen.Dialogs.

Tony

Just out of curiousity, this dialog is capable of full enumeration of serial ports. It won't just do COM1-COM4... right?

Tony M.


Reply
teberle
Posts: 641
Topic starter
(@teberle)
Honorable Member
Joined: 20 years ago

It stops at 99. That should be enough.


Reply
Posts: 57
(@flowblok)
Trusted Member
Joined: 19 years ago

Er - does it do what I did for my Serial plugins - get the active serial ports, and show only them? Because we're working with .Net, a CLI system, there is always the possibility that Vixen may become cross-platform at one point, so choosing the serial port from the .Net classes is better than just giving COM1, COM2, ... COM99.

I haven't taken a look yet (too busy with my lovely linux distro, Debian), but I'm going to take a look at it later once I've moved my development stuff across computers.

The relevant code is:


// Initialise the variable.
	string[] AvaliablePorts;

// Get the avaliable ports.
	AvaliablePorts = SerialPort.GetPortNames();

Reply
Posts: 705
 KC
(@kc)
Prominent Member
Joined: 20 years ago

No, it doesn't do that, but thanks for the code.


Reply
Share: