Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

suppress errors when not analog battery monitor #2804

Merged
merged 1 commit into from
Mar 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions GCSViews/ConfigurationView/ConfigBatteryMonitoring.cs
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,11 @@ private void TXT_measuredvoltage_Validated(object sender, EventArgs e)
}
catch
{
CustomMessageBox.Show("Set BATT_VOLT_MULT Failed", Strings.ERROR);
if (MainV2.comPort.MAV.param.ContainsKey("BATT_MONITOR") &&
(MainV2.comPort.MAV.param["BATT_MONITOR"].Value == 3 ||
MainV2.comPort.MAV.param["BATT_MONITOR"].Value == 4)) {
CustomMessageBox.Show("Set BATT_VOLT_MULT Failed", Strings.ERROR);
}
}
}

Expand All @@ -312,7 +316,11 @@ private void TXT_divider_Validated(object sender, EventArgs e)
}
catch
{
CustomMessageBox.Show("Set BATT_VOLT_MULT Failed", Strings.ERROR);
if (MainV2.comPort.MAV.param.ContainsKey("BATT_MONITOR") &&
(MainV2.comPort.MAV.param["BATT_MONITOR"].Value == 3 ||
MainV2.comPort.MAV.param["BATT_MONITOR"].Value == 4)) {
CustomMessageBox.Show("Set BATT_VOLT_MULT Failed", Strings.ERROR);
}
}
}

Expand All @@ -332,7 +340,11 @@ private void TXT_ampspervolt_Validated(object sender, EventArgs e)
}
catch
{
CustomMessageBox.Show("Set BATT_AMP_PERVOLT Failed", Strings.ERROR);
if (MainV2.comPort.MAV.param.ContainsKey("BATT_MONITOR") &&
(MainV2.comPort.MAV.param["BATT_MONITOR"].Value == 3 ||
MainV2.comPort.MAV.param["BATT_MONITOR"].Value == 4)) {
CustomMessageBox.Show("Set BATT_AMP_PERVOLT Failed", Strings.ERROR);
}
}
}

Expand Down Expand Up @@ -621,7 +633,11 @@ private void txt_meascurrent_Validated(object sender, EventArgs e)
}
catch
{
CustomMessageBox.Show("Set BATT_AMP_PERVOLT Failed", Strings.ERROR);
if (MainV2.comPort.MAV.param.ContainsKey("BATT_MONITOR") &&
(MainV2.comPort.MAV.param["BATT_MONITOR"].Value == 3 ||
MainV2.comPort.MAV.param["BATT_MONITOR"].Value == 4)) {
CustomMessageBox.Show("Set BATT_AMP_PERVOLT Failed", Strings.ERROR);
}
}
}
}
Expand Down