forked from ArduPilot/MissionPlanner
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rad2deg and deg2rad: convert to double
- Loading branch information
Showing
27 changed files
with
9,061 additions
and
9,061 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,79 +1,79 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Windows.Forms; | ||
using MissionPlanner.Controls; | ||
|
||
namespace MissionPlanner.GCSViews.ConfigurationView | ||
{ | ||
public partial class ConfigHWAirspeed : UserControl, IActivate | ||
{ | ||
private const float rad2deg = (float) (180/Math.PI); | ||
private const float deg2rad = (float) (1.0/rad2deg); | ||
private bool startup; | ||
|
||
public ConfigHWAirspeed() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
public void Activate() | ||
{ | ||
if (!MainV2.comPort.BaseStream.IsOpen) | ||
{ | ||
Enabled = false; | ||
return; | ||
} | ||
Enabled = true; | ||
|
||
startup = true; | ||
|
||
|
||
CHK_airspeeduse.setup(1, 0, "ARSPD_USE", MainV2.comPort.MAV.param); | ||
CHK_enableairspeed.setup(1, 0, "ARSPD_ENABLE", MainV2.comPort.MAV.param); | ||
|
||
var options = new List<KeyValuePair<int, string>>(); | ||
options.Add(new KeyValuePair<int, string>(0, "APM 2 analog pin 0")); | ||
options.Add(new KeyValuePair<int, string>(1, "APM 2 analog pin 1")); | ||
options.Add(new KeyValuePair<int, string>(2, "APM 2 analog pin 2")); | ||
options.Add(new KeyValuePair<int, string>(3, "APM 2 analog pin 3")); | ||
options.Add(new KeyValuePair<int, string>(4, "APM 2 analog pin 4")); | ||
options.Add(new KeyValuePair<int, string>(5, "APM 2 analog pin 5")); | ||
options.Add(new KeyValuePair<int, string>(6, "APM 2 analog pin 6")); | ||
options.Add(new KeyValuePair<int, string>(7, "APM 2 analog pin 7")); | ||
options.Add(new KeyValuePair<int, string>(8, "APM 2 analog pin 8")); | ||
options.Add(new KeyValuePair<int, string>(9, "APM 2 analog pin 9")); | ||
|
||
options.Add(new KeyValuePair<int, string>(64, "APM 1 AS Port")); | ||
|
||
options.Add(new KeyValuePair<int, string>(11, "PX4 Analog AS Port")); | ||
options.Add(new KeyValuePair<int, string>(15, "Pixhawk Analog AS Port")); | ||
options.Add(new KeyValuePair<int, string>(65, "PX4/Pixhawk EagleTree or MEAS I2C AS Sensor")); | ||
|
||
mavlinkCheckBoxAirspeed_pin.setup(options, "ARSPD_PIN", MainV2.comPort.MAV.param); | ||
|
||
|
||
startup = false; | ||
} | ||
|
||
private void CHK_enableairspeed_CheckedChanged(object sender, EventArgs e) | ||
{ | ||
if (startup) | ||
return; | ||
try | ||
{ | ||
if (MainV2.comPort.MAV.param["ARSPD_ENABLE"] == null) | ||
{ | ||
CustomMessageBox.Show(Strings.ErrorFeatureNotEnabled, Strings.ERROR); | ||
} | ||
else | ||
{ | ||
MainV2.comPort.setParam("ARSPD_ENABLE", ((CheckBox) sender).Checked ? 1 : 0); | ||
} | ||
} | ||
catch | ||
{ | ||
CustomMessageBox.Show(string.Format(Strings.ErrorSetValueFailed, "ARSPD_ENABLE"), Strings.ERROR); | ||
} | ||
} | ||
} | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Windows.Forms; | ||
using MissionPlanner.Controls; | ||
|
||
namespace MissionPlanner.GCSViews.ConfigurationView | ||
{ | ||
public partial class ConfigHWAirspeed : UserControl, IActivate | ||
{ | ||
private const double rad2deg = (float) (180/Math.PI); | ||
private const double deg2rad = (float) (1.0/rad2deg); | ||
private bool startup; | ||
|
||
public ConfigHWAirspeed() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
public void Activate() | ||
{ | ||
if (!MainV2.comPort.BaseStream.IsOpen) | ||
{ | ||
Enabled = false; | ||
return; | ||
} | ||
Enabled = true; | ||
|
||
startup = true; | ||
|
||
|
||
CHK_airspeeduse.setup(1, 0, "ARSPD_USE", MainV2.comPort.MAV.param); | ||
CHK_enableairspeed.setup(1, 0, "ARSPD_ENABLE", MainV2.comPort.MAV.param); | ||
|
||
var options = new List<KeyValuePair<int, string>>(); | ||
options.Add(new KeyValuePair<int, string>(0, "APM 2 analog pin 0")); | ||
options.Add(new KeyValuePair<int, string>(1, "APM 2 analog pin 1")); | ||
options.Add(new KeyValuePair<int, string>(2, "APM 2 analog pin 2")); | ||
options.Add(new KeyValuePair<int, string>(3, "APM 2 analog pin 3")); | ||
options.Add(new KeyValuePair<int, string>(4, "APM 2 analog pin 4")); | ||
options.Add(new KeyValuePair<int, string>(5, "APM 2 analog pin 5")); | ||
options.Add(new KeyValuePair<int, string>(6, "APM 2 analog pin 6")); | ||
options.Add(new KeyValuePair<int, string>(7, "APM 2 analog pin 7")); | ||
options.Add(new KeyValuePair<int, string>(8, "APM 2 analog pin 8")); | ||
options.Add(new KeyValuePair<int, string>(9, "APM 2 analog pin 9")); | ||
|
||
options.Add(new KeyValuePair<int, string>(64, "APM 1 AS Port")); | ||
|
||
options.Add(new KeyValuePair<int, string>(11, "PX4 Analog AS Port")); | ||
options.Add(new KeyValuePair<int, string>(15, "Pixhawk Analog AS Port")); | ||
options.Add(new KeyValuePair<int, string>(65, "PX4/Pixhawk EagleTree or MEAS I2C AS Sensor")); | ||
|
||
mavlinkCheckBoxAirspeed_pin.setup(options, "ARSPD_PIN", MainV2.comPort.MAV.param); | ||
|
||
|
||
startup = false; | ||
} | ||
|
||
private void CHK_enableairspeed_CheckedChanged(object sender, EventArgs e) | ||
{ | ||
if (startup) | ||
return; | ||
try | ||
{ | ||
if (MainV2.comPort.MAV.param["ARSPD_ENABLE"] == null) | ||
{ | ||
CustomMessageBox.Show(Strings.ErrorFeatureNotEnabled, Strings.ERROR); | ||
} | ||
else | ||
{ | ||
MainV2.comPort.setParam("ARSPD_ENABLE", ((CheckBox) sender).Checked ? 1 : 0); | ||
} | ||
} | ||
catch | ||
{ | ||
CustomMessageBox.Show(string.Format(Strings.ErrorSetValueFailed, "ARSPD_ENABLE"), Strings.ERROR); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.