public Setup() { InitializeComponent(); if (MainV2.comPort.BaseStream.IsOpen) { this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigRadioInput(), "Radio Calibration")); this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigFlightModes(), "Flight Modes")); this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigHardwareOptions(), "Hardware Options")); this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigBatteryMonitoring(), "Battery Monitor")); /******************************HELI **************************/ if (MainV2.comPort.param["H_GYR_ENABLE"] != null) // heli { this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigAccelerometerCalibrationQuad(), "ArduCopter Level")); this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigTradHeli(), "Heli Setup")); var configpanel = new Controls.ConfigPanel(); configpanel.LoadXML("ArduCopterConfig.xml"); this.backstageView.AddPage(new BackstageView.BackstageViewPage(configpanel, "ArduCopter Pids")); this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigArducopter(), "OLD ArduCopter Config")); } /****************************** ArduCopter **************************/ else if (MainV2.cs.firmware == MainV2.Firmwares.ArduCopter2) { this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigAccelerometerCalibrationQuad(), "ArduCopter Level")); var configpanel = new Controls.ConfigPanel(); configpanel.LoadXML("ArduCopterConfig.xml"); this.backstageView.AddPage(new BackstageView.BackstageViewPage(configpanel, "ArduCopter Pids")); this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigArducopter(), "OLD ArduCopter Config")); } /****************************** ArduPlane **************************/ else if (MainV2.cs.firmware == MainV2.Firmwares.ArduPlane) { this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigAccelerometerCalibrationPlane(), "ArduPlane Level")); this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigArduplane(), "ArduPlane Pids")); } this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigFriendlyParams { ParameterMode = ParameterMetaDataConstants.Standard }, "Standard Params")); this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigFriendlyParams { ParameterMode = ParameterMetaDataConstants.Advanced }, "Advanced Params")); this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigRawParams(), "Parameter List")); } this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ArdupilotMega._3DRradio(), "3DR Radio")); this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ArdupilotMega.Antenna.Tracker(), "Antenna Tracker")); this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigPlanner(), "Planner")); this.backstageView.ActivatePage(backstageView.Pages[0]); if (!MainV2.comPort.BaseStream.IsOpen) { CustomMessageBox.Show("Please connect (click Connect Button) before using setup!!"); } }
// Add the pages that can only be shown when we are connected to an APM private void AddPagesForConnectedState() { /****************************** Common **************************/ AddBackstageViewPage(new ConfigRadioInput(), "Radio Calibration"); AddBackstageViewPage(new ConfigFlightModes(), "Flight Modes"); AddBackstageViewPage(new ConfigFailSafe(), "FailSafe"); hardware = AddBackstageViewPage(new ConfigHardwareOptions(), "Hardware Options"); AddBackstageViewPage(new ConfigBatteryMonitoring(), "Battery Monitor", hardware); BackstageView.BackstageViewPage tunningpage = AddBackstageViewPage(new ConfigFriendlyParams { ParameterMode = ParameterMetaDataConstants.Standard }, "Standard Params"); AddBackstageViewPage(new ConfigFriendlyParams { ParameterMode = ParameterMetaDataConstants.Advanced }, "Advanced Params", tunningpage); AddBackstageViewPage(new ConfigRawParams(), "Adv Parameter List", tunningpage); // AddBackstageViewPage(new ConfigParamParams() { ParameterMode = ParameterMetaDataConstants.Standard }, "Camera Gimbal Adv"); /******************************HELI **************************/ if (MainV2.comPort.param["H_GYR_ENABLE"] != null) // heli { AddBackstageViewPage(new ConfigMount(), "Camera Gimbal", hardware); AddBackstageViewPage(new ConfigAccelerometerCalibrationQuad(), "ArduCopter Level"); AddBackstageViewPage(new ConfigTradHeli(), "Heli Setup"); var configpanel = new Controls.ConfigPanel(Application.StartupPath + System.IO.Path.DirectorySeparatorChar + "ArduCopterConfig.xml"); AddBackstageViewPage(configpanel, "ArduCopter Pids", tunningpage); AddBackstageViewPage(new ConfigArducopter(), "ArduCopter Config", tunningpage); // AddBackstageViewPage(new ConfigAP_Limits(), "GeoFence"); } /****************************** ArduCopter **************************/ else if (MainV2.cs.firmware == MainV2.Firmwares.ArduCopter2) { AddBackstageViewPage(new ConfigMount(), "Camera Gimbal", hardware); AddBackstageViewPage(new ConfigAccelerometerCalibrationQuad(), "ArduCopter Level"); var configpanel = new Controls.ConfigPanel(Application.StartupPath + System.IO.Path.DirectorySeparatorChar + "ArduCopterConfig.xml"); AddBackstageViewPage(configpanel, "ArduCopter Pids", tunningpage); AddBackstageViewPage(new ConfigArducopter(), "ArduCopter Config", tunningpage); // AddBackstageViewPage(new ConfigAP_Limits(), "GeoFence"); } /****************************** ArduPlane **************************/ else if (MainV2.cs.firmware == MainV2.Firmwares.ArduPlane) { AddBackstageViewPage(new ConfigMount(), "Camera Gimbal", hardware); AddBackstageViewPage(new ConfigAccelerometerCalibrationPlane(), "ArduPlane Level"); AddBackstageViewPage(new ConfigArduplane(), "ArduPlane Pids", tunningpage); } /****************************** ArduRover **************************/ else if (MainV2.cs.firmware == MainV2.Firmwares.ArduRover) { //AddBackstageViewPage(new ConfigAccelerometerCalibrationPlane(), "ArduRover Level")); AddBackstageViewPage(new ConfigArdurover(), "ArduRover Pids", tunningpage); } }
// Add the pages that can only be shown when we are connected to an APM private void AddPagesForConnectedState() { /****************************** Common **************************/ if ((MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduCopter2) || (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduPlane) || (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduRover)) { AddBackstageViewPage(new ConfigRadioInput(), "Radio Calibration"); AddBackstageViewPage(new ConfigFlightModes(), "Flight Modes"); AddBackstageViewPage(new ConfigFailSafe(), "FailSafe"); hardware = AddBackstageViewPage(new ConfigHardwareOptions(), "Hardware Options"); AddBackstageViewPage(new ConfigBatteryMonitoring(), "Battery Monitor", hardware); } if ((MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduCopter2) || (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduPlane) || (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduRover)) { standardpage = AddBackstageViewPage(new ConfigFriendlyParams { ParameterMode = ParameterMetaDataConstants.Standard }, "Standard Params"); advancedpage = AddBackstageViewPage(new ConfigFriendlyParams { ParameterMode = ParameterMetaDataConstants.Advanced }, "Advanced Params"); } AddBackstageViewPage(new ConfigRawParams(), "Adv Parameter List", advancedpage); /******************************HELI **************************/ if (MainV2.comPort.MAV.param["H_GYR_ENABLE"] != null) // heli { // AddBackstageViewPage(new ConfigSignalization(), "Signalization", hardware); AddBackstageViewPage(new ConfigMount(), "Camera Gimbal", hardware); AddBackstageViewPage(new ConfigAccelerometerCalibrationQuad(), "ArduCopter Level"); AddBackstageViewPage(new ConfigTradHeli(), "Heli Setup"); var configpanel = new Controls.ConfigPanel(Application.StartupPath + System.IO.Path.DirectorySeparatorChar + "ArduCopterConfig.xml"); AddBackstageViewPage(configpanel, "ArduCopter Pids", standardpage); AddBackstageViewPage(new ConfigArducopter(), "ArduCopter Config", standardpage); // AddBackstageViewPage(new ConfigAP_Limits(), "GeoFence"); } /****************************** ArduCopter **************************/ else if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduCopter2) { // AddBackstageViewPage(new ConfigSignalization(), "Signalization", hardware); AddBackstageViewPage(new ConfigMount(), "Camera Gimbal", hardware); AddBackstageViewPage(new ConfigAccelerometerCalibrationQuad(), "ArduCopter Level"); var configpanel = new Controls.ConfigPanel(Application.StartupPath + System.IO.Path.DirectorySeparatorChar + "ArduCopterConfig.xml"); AddBackstageViewPage(configpanel, "ArduCopter Pids", standardpage); AddBackstageViewPage(new ConfigArducopter(), "ArduCopter Config", standardpage); AddBackstageViewPage(new ConfigAP_Limits(), "GeoFence"); } /****************************** ArduPlane **************************/ else if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduPlane) { AddBackstageViewPage(new ConfigMount(), "Camera Gimbal", hardware); AddBackstageViewPage(new ConfigAccelerometerCalibrationPlane(), "ArduPlane Level"); AddBackstageViewPage(new ConfigArduplane(), "ArduPlane Pids", standardpage); } /****************************** ArduRover **************************/ else if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.ArduRover) { //AddBackstageViewPage(new ConfigAccelerometerCalibrationPlane(), "ArduRover Level")); AddBackstageViewPage(new ConfigArdurover(), "ArduRover Pids", standardpage); } else if (MainV2.comPort.MAV.cs.firmware == MainV2.Firmwares.Ateryx) { AddBackstageViewPage(new ConfigAteryxSensors(), "Ateryx Zero Sensors"); AddBackstageViewPage(new ConfigAteryx(), "Ateryx Pids", standardpage); } }
public Setup() { InitializeComponent(); if (MainV2.comPort.BaseStream.IsOpen) { this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigRadioInput(), "Radio Calibration")); this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigFlightModes(), "Flight Modes")); this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigHardwareOptions(), "Hardware Options")); this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigBatteryMonitoring(), "Battery Monitor")); /******************************HELI **************************/ if (MainV2.comPort.param["H_GYR_ENABLE"] != null) // heli { this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigAccelerometerCalibrationQuad(), "ArduCopter Level")); this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigTradHeli(), "Heli Setup")); var configpanel = new Controls.ConfigPanel(); configpanel.LoadXML("ArduCopterConfig.xml"); this.backstageView.AddPage(new BackstageView.BackstageViewPage(configpanel, "ArduCopter Pids")); this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigArducopter(), "ArduCopter Config")); } /****************************** ArduCopter **************************/ else if (MainV2.cs.firmware == MainV2.Firmwares.ArduCopter2) { this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigAccelerometerCalibrationQuad(), "ArduCopter Level")); var configpanel = new Controls.ConfigPanel(); configpanel.LoadXML("ArduCopterConfig.xml"); this.backstageView.AddPage(new BackstageView.BackstageViewPage(configpanel, "ArduCopter Pids")); this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigArducopter(), "ArduCopter Config")); } /****************************** ArduPlane **************************/ else if (MainV2.cs.firmware == MainV2.Firmwares.ArduPlane) { this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigAccelerometerCalibrationPlane(), "ArduPlane Level")); this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigArduplane(), "ArduPlane Pids")); } /****************************** ArduRover **************************/ else if (MainV2.cs.firmware == MainV2.Firmwares.ArduRover) { //this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigAccelerometerCalibrationPlane(), "ArduRover Level")); this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigArdurover(), "ArduRover Pids")); } this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigFriendlyParams { ParameterMode = ParameterMetaDataConstants.Standard }, "Standard Params")); this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigFriendlyParams { ParameterMode = ParameterMetaDataConstants.Advanced }, "Advanced Params")); this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigRawParams(), "Parameter List")); } this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ArdupilotMega._3DRradio(), "3DR Radio")); this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ArdupilotMega.Antenna.Tracker(), "Antenna Tracker")); this.backstageView.AddPage(new BackstageView.BackstageViewPage(new ConfigPlanner(), "Planner")); this.backstageView.ActivatePage(backstageView.Pages[0]); if (!MainV2.comPort.BaseStream.IsOpen) { Common.MessageShowAgain("Config Connect", "Please connect (click Connect Button) before using setup!!"); } }