public void Activate()
        {
            if (!MainV2.comPort.BaseStream.IsOpen)
            {
                Enabled = false;
                return;
            }
            if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduRover)
            {
                Enabled = true;
            }
            else
            {
                Enabled = false;
                return;
            }

            startup = true;

            FS_THR_VALUE.setup(0, 0, 1, 1, "FS_THR_VALUE", MainV2.comPort.MAV.param);
            THR_MAX.setup(0, 0, 1, 1, "THR_MAX", MainV2.comPort.MAV.param);
            THR_MIN.setup(0, 0, 1, 1, "THR_MIN", MainV2.comPort.MAV.param);
            CRUISE_THROTTLE.setup(0, 0, 1, 1, "CRUISE_THROTTLE", MainV2.comPort.MAV.param);
            SPEED2THR_IMAX.setup(0, 0, 1, 1, "SPEED2THR_IMAX", MainV2.comPort.MAV.param);
            SPEED2THR_D.setup(0, 0, 1, 1, "SPEED2THR_D", MainV2.comPort.MAV.param);
            SPEED2THR_I.setup(0, 0, 1, 1, "SPEED2THR_I", MainV2.comPort.MAV.param);
            SPEED2THR_P.setup(0, 0, 1, 1, "SPEED2THR_P", MainV2.comPort.MAV.param);
            SPEED_TURN_DIST.setup(0, 0, 1, 1, "SPEED_TURN_DIST", MainV2.comPort.MAV.param);
            SPEED_TURN_GAIN.setup(0, 0, 1, 1, "SPEED_TURN_GAIN", MainV2.comPort.MAV.param);
            CRUISE_SPEED.setup(0, 0, 1, 1, "CRUISE_SPEED", MainV2.comPort.MAV.param);
            STEER2SRV_IMAX.setup(0, 0, 1, 1, "STEER2SRV_IMAX", MainV2.comPort.MAV.param);
            STEER2SRV_D.setup(0, 0, 1, 1, "STEER2SRV_D", MainV2.comPort.MAV.param);
            STEER2SRV_I.setup(0, 0, 1, 1, "STEER2SRV_I", MainV2.comPort.MAV.param);
            STEER2SRV_P.setup(0, 0, 1, 1, "STEER2SRV_P", MainV2.comPort.MAV.param);
            SONAR_DEBOUNCE.setup(0, 0, 1, 1, "SONAR_DEBOUNCE", MainV2.comPort.MAV.param);
            SONAR_TURN_TIME.setup(0, 0, 1, 1, "SONAR_TURN_TIME", MainV2.comPort.MAV.param);
            SONAR_TURN_ANGLE.setup(0, 0, 1, 1, "SONAR_TURN_ANGLE", MainV2.comPort.MAV.param);
            SONAR_TRIGGER_CM.setup(0, 0, 1, 1, "SONAR_TRIGGER_CM", MainV2.comPort.MAV.param);
            WP_RADIUS.setup(0, 0, 1, 1, "WP_RADIUS", MainV2.comPort.MAV.param);
            NAVL1_DAMPING.setup(0, 0, 1, 1, "NAVL1_DAMPING", MainV2.comPort.MAV.param);
            NAVL1_PERIOD.setup(0, 0, 1, 1, "NAVL1_PERIOD", MainV2.comPort.MAV.param);

            changes.Clear();

            processToScreen();

            startup = false;
        }
Exemplo n.º 2
0
        public void Activate()
        {
            if (!MainV2.comPort.BaseStream.IsOpen)
            {
                Enabled = false;
                return;
            }
            if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduRover)
            {
                Enabled = true;
            }
            else
            {
                Enabled = false;
                return;
            }

            startup = true;

            FS_THR_VALUE.setup(0, 0, 1, 1, "FS_THR_VALUE", MainV2.comPort.MAV.param);
            THR_MAX.setup(0, 0, 1, 1, "THR_MAX", MainV2.comPort.MAV.param);
            THR_MIN.setup(0, 0, 1, 1, "THR_MIN", MainV2.comPort.MAV.param);
            CRUISE_THROTTLE.setup(0, 0, 1, 1, "CRUISE_THROTTLE", MainV2.comPort.MAV.param);
            SPEED2THR_IMAX.setup(0, 0, 1, 1, "SPEED2THR_IMAX", MainV2.comPort.MAV.param);
            SPEED2THR_D.setup(0, 0, 1, 1, "SPEED2THR_D", MainV2.comPort.MAV.param);
            SPEED2THR_I.setup(0, 0, 1, 1, "SPEED2THR_I", MainV2.comPort.MAV.param);
            SPEED2THR_P.setup(0, 0, 1, 1, "SPEED2THR_P", MainV2.comPort.MAV.param);
            SPEED_TURN_DIST.setup(0, 0, 1, 1, "SPEED_TURN_DIST", MainV2.comPort.MAV.param);
            SPEED_TURN_GAIN.setup(0, 0, 1, 1, "SPEED_TURN_GAIN", MainV2.comPort.MAV.param);
            CRUISE_SPEED.setup(0, 0, 1, 1, "CRUISE_SPEED", MainV2.comPort.MAV.param);
            STEER2SRV_IMAX.setup(0, 0, 1, 1, "STEER2SRV_IMAX", MainV2.comPort.MAV.param);
            STEER2SRV_D.setup(0, 0, 1, 1, "STEER2SRV_D", MainV2.comPort.MAV.param);
            STEER2SRV_I.setup(0, 0, 1, 1, "STEER2SRV_I", MainV2.comPort.MAV.param);
            STEER2SRV_P.setup(0, 0, 1, 1, "STEER2SRV_P", MainV2.comPort.MAV.param);
            SONAR_DEBOUNCE.setup(0, 0, 1, 1, "SONAR_DEBOUNCE", MainV2.comPort.MAV.param);
            SONAR_TURN_TIME.setup(0, 0, 1, 1, "SONAR_TURN_TIME", MainV2.comPort.MAV.param);
            SONAR_TURN_ANGLE.setup(0, 0, 1, 1, "SONAR_TURN_ANGLE", MainV2.comPort.MAV.param);
            SONAR_TRIGGER_CM.setup(0, 0, 1, 1, "SONAR_TRIGGER_CM", MainV2.comPort.MAV.param);
            WP_RADIUS.setup(0, 0, 1, 1, "WP_RADIUS", MainV2.comPort.MAV.param);
            NAVL1_DAMPING.setup(0, 0, 1, 1, "NAVL1_DAMPING", MainV2.comPort.MAV.param);
            NAVL1_PERIOD.setup(0, 0, 1, 1, "NAVL1_PERIOD", MainV2.comPort.MAV.param);

            changes.Clear();

            // add tooltips to all controls
            foreach (Control control1 in Controls)
            {
                foreach (Control control2 in control1.Controls)
                {
                    if (control2 is MavlinkNumericUpDown)
                    {
                        var ParamName = ((MavlinkNumericUpDown)control2).ParamName;
                        toolTip1.SetToolTip(control2,
                                            ParameterMetaDataRepository.GetParameterMetaData(ParamName,
                                                                                             ParameterMetaDataConstants.Description, MainV2.comPort.MAV.cs.firmware.ToString()));
                    }
                    if (control2 is MavlinkComboBox)
                    {
                        var ParamName = ((MavlinkComboBox)control2).ParamName;
                        toolTip1.SetToolTip(control2,
                                            ParameterMetaDataRepository.GetParameterMetaData(ParamName,
                                                                                             ParameterMetaDataConstants.Description, MainV2.comPort.MAV.cs.firmware.ToString()));
                    }
                }
            }

            startup = false;
        }