Skip to content

Commit

Permalink
Do not refresh params after change if vehicle is armed.
Browse files Browse the repository at this point in the history
  • Loading branch information
EosBandi authored and meee1 committed Mar 4, 2024
1 parent 93fe344 commit cd16a4c
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions GCSViews/ConfigurationView/ConfigRawParams.cs
Original file line number Diff line number Diff line change
Expand Up @@ -263,15 +263,9 @@ private void BUT_writePIDS_Click(object sender, EventArgs e)

bool enable = temp.Any(a => a.EndsWith("_ENABLE"));

//if (enable)
//{
// CustomMessageBox.Show(
// "You have changed an Enable parameter. You may need to do a full param refresh to show all params",
// "Params");
//}

int error = 0;
bool reboot = false;

foreach (string value in temp)
{
try
Expand Down Expand Up @@ -329,19 +323,28 @@ private void BUT_writePIDS_Click(object sender, EventArgs e)
CustomMessageBox.Show("Not all parameters successfully saved.", "Saved");
else
CustomMessageBox.Show("Parameters successfully saved.", "Saved");

//Check if reboot is required
if (reboot)
{
CustomMessageBox.Show("Reboot is required for some parameters to take effect.", "Reboot Required");
}

if (MainV2.comPort.MAV.param.TotalReceived != MainV2.comPort.MAV.param.TotalReported)
if (MainV2.comPort.MAV.param.TotalReceived != MainV2.comPort.MAV.param.TotalReported )
{
CustomMessageBox.Show("The number of available parameters changed. A full param refresh will be done to show all params.", "Params");
//Click on refresh button
BUT_rerequestparams_Click(BUT_rerequestparams, null);
if (MainV2.comPort.MAV.cs.armed)
{
CustomMessageBox.Show("The number of available parameters changed, until full param refresh is done, some parameters will not be available.", "Params");
//Hack the number of reported params to keep params list available
MainV2.comPort.MAV.param.TotalReported = MainV2.comPort.MAV.param.TotalReceived;
}
else
{
CustomMessageBox.Show("The number of available parameters changed. A full param refresh will be done to show all params.", "Params");
//Click on refresh button
BUT_rerequestparams_Click(BUT_rerequestparams, null);
}
}

}

private void BUT_compare_Click(object sender, EventArgs e)
Expand Down

0 comments on commit cd16a4c

Please sign in to comment.