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"; }
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; }
public OutputHandler(ComController controller) { this.controller = controller; }