Ejemplo n.º 1
0
 public CDisplayDataYT(DisplayConfigYT settings)
 {
     this.settings = settings;
     DispType      = settings.DisplayType;
     Speed         = settings.DisplaySpeed;
     DisplayText   = string.Empty;
 }
Ejemplo n.º 2
0
 public CDisplaycommYT(DisplayConfigYT settings)
 {
     this.settings      = settings;
     port               = new SerialPort();
     port.BaudRate      = 9600;
     port.PortName      = settings.Comport;
     port.DataBits      = 8;
     port.StopBits      = StopBits.One;
     port.Parity        = Parity.None;
     port.DataReceived += new SerialDataReceivedEventHandler(DataReceived);
     _setdisplaytype    = settings.DisplayType;
     try
     {
         port.Open();
         Speed = settings.DisplaySpeed;
     }
     catch
     {
         System.Windows.Forms.MessageBox.Show("无法打开串口" + settings.Comport + "!");
     }
 }