示例#1
0
 public InputHandler(ComController controller)
 {
     if (controller == null)
     {
         throw new ArgumentNullException("controller");
     }
     this.controller = controller;
     controller.DataReceived += HandleDataReceived;
     logName = "SerialReceived-" + DateTime.Now.ToString("yyyy-MM-dd-hh-mm") + ".bin";
 }
示例#2
0
 public InputHandler(ComController controller)
 {
     if (controller == null)
     {
         throw new ArgumentNullException("controller");
     }
     this.controller          = controller;
     controller.DataReceived += HandleDataReceived;
     logName = "SerialReceived-" + DateTime.Now.ToString("yyyy-MM-dd-hh-mm") + ".bin";
 }
示例#3
0
        public Form1()
        {
            InitializeComponent();

            controller = new ComController();
            ih = new InputHandler(controller);
            oh = new OutputHandler(controller);
            PortComboBox.Items.AddRange(ComController.ComPorts.Cast<object>().ToArray());
            if(PortComboBox.Items.Count > 0)
            {
                PortComboBox.SelectedIndex = 0;
            }
            RateComboBox.Items.AddRange(ComController.BaudRates.Cast<object>().ToArray());
            RateComboBox.SelectedIndex = RateComboBox.Items.Count - 1;

            ih.PacketReceived += ih_PacketReceived;
        }
示例#4
0
 public OutputHandler(ComController controller)
 {
     this.controller = controller;
 }
示例#5
0
 public OutputHandler(ComController controller)
 {
     this.controller = controller;
 }