Skip to content

Commit

Permalink
FlightData: update CMB_mountmode population
Browse files Browse the repository at this point in the history
  • Loading branch information
robertlong13 authored and meee1 committed Dec 24, 2024
1 parent 4901ac9 commit d228b63
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions GCSViews/FlightData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2662,18 +2662,19 @@ private void FlightData_Load(object sender, EventArgs e)
Zoomlevel.Maximum = 24;
Zoomlevel.Value = Convert.ToDecimal(gMapControl1.Zoom);

var item1 = ParameterMetaDataRepository.GetParameterOptionsInt("MNT_MODE",
MainV2.comPort.MAV.cs.firmware.ToString());
var item2 = ParameterMetaDataRepository.GetParameterOptionsInt("MNT_DEFLT_MODE",
MainV2.comPort.MAV.cs.firmware.ToString());
if (item1.Count > 0)
CMB_mountmode.DataSource = item1;

if (item2.Count > 0)
CMB_mountmode.DataSource = item2;

CMB_mountmode.DisplayMember = "Value";
CMB_mountmode.ValueMember = "Key";

var mnt_mode_paramnames = new List<string> { "MNT1_DEFLT_MODE", "MNT_DEFLT_MODE", "MNT_MODE" };
foreach (var name in mnt_mode_paramnames)
{
var item = ParameterMetaDataRepository.GetParameterOptionsInt(name, MainV2.comPort.MAV.cs.firmware.ToString());
if (item.Count > 0)
{
CMB_mountmode.DataSource = item;
CMB_mountmode.DisplayMember = "Value";
CMB_mountmode.ValueMember = "Key";
break;
}
}

if (Settings.Instance["CHK_autopan"] != null)
CHK_autopan.Checked = Settings.Instance.GetBoolean("CHK_autopan");
Expand Down

0 comments on commit d228b63

Please sign in to comment.