Beispiel #1
0
 public Algorithm(COMPort port)
 {
     parsing = new CommandParsing();
     timerTimeoutCommandsStart.Interval = TimeSpan.FromMilliseconds(10);
     timerTimeoutCommandsStart.Tick    += TimerTimeoutCommandsStart_Tick;
     timerTimeoutCommandsStart.Start();
     workerInfo.DoWork += Worker_DoWorkAskInfo;
 }
        private void BtnConnectClick(object sender, RoutedEventArgs e)
        {
            string portName = COMPortWindow.comboBoxCOMPorts.SelectedItem as string;

            port = new COMPort(portName);
            port.Connect();
            if (port.Connect())
            {
                UsbComBtn.Tag = BitmapFrame.Create(new Uri(@"pack://application:,,,/Images/usb-connect.png"));
            }
        }