public OrientationSensor() : base((byte)0x01, (byte)6) { attitudeIndicator = new AttitudeIndicator(); headingIndicator = new HeadingIndicator(); headingIndicator.Location = new System.Drawing.Point(100, 100); /*Controls.Add(attitudeIndicator); * Controls.Add(headingIndicator);*/ }
public MainForm() { //setup window InitializeComponent(); depthIndicator = new DepthIndicator() { Location = new Point(0, 100) }; attitudeIndicator = new AttitudeIndicator() { Location = new Point(100, 100) }; headingIndicator = new HeadingIndicator() { Location = new Point(600, 100) }; Controls.Add(depthIndicator); Controls.Add(attitudeIndicator); Controls.Add(headingIndicator); //setup devices BetterSerialPort port = new BetterSerialPort("COM5", 500000); port.Open(); portLabel.Text = string.Format("{0}@{1}baud", port.PortName, port.BaudRate); comms = new SerialCommunication(port); comms.Stopped += comms_Stopped; comms.Started += comms_Started; //comms.Connect(); depthSensor = new DepthSensor(); orientationSensor = new OrientationSensor(); statusSensor = new StatusSensor(); propulsionSensor = new PropulsionSensor(); versionSensor = new VersionSensor(); statusActuator = new StatusActuator(); propulsionActuator = new PropulsionActuator(); toolsActuator = new ToolsActuator(); //update displays when sensors polled orientationSensor.Updated += OrientationSensor_Updated; depthSensor.Updated += DepthSensor_Updated; //get ROV firmware version info comms.Queue.Enqueue(versionSensor); //go Fullscreen //GoFullscreen(); //do this in the designer }