Skip to content

Commit

Permalink
GridUI: fix config load bugs (ArduPilot#3200)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertlong13 authored Nov 28, 2023
1 parent f6c9042 commit 5a6d4f9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Grid/GridUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ public void SaveGrid()

var griddata = savegriddata();

// Save config too
savesettings();

using (SaveFileDialog sfd = new SaveFileDialog())
{
sfd.Filter = "*.grid|*.grid";
Expand Down Expand Up @@ -334,7 +337,8 @@ void loadsettings()
loadsetting("grid_dist", NUM_Distance);
loadsetting("grid_overshoot1", NUM_overshoot);
loadsetting("grid_overshoot2", NUM_overshoot2);
loadsetting("grid_leadin", NUM_leadin);
loadsetting("grid_leadin1", NUM_leadin);
loadsetting("grid_leadin2", NUM_leadin2);
loadsetting("grid_startfrom", CMB_startfrom);
loadsetting("grid_overlap", num_overlap);
loadsetting("grid_sidelap", num_sidelap);
Expand Down Expand Up @@ -410,11 +414,13 @@ void savesettings()
plugin.Host.config["grid_camdir"] = CHK_camdirection.Checked.ToString();

plugin.Host.config["grid_usespeed"] = CHK_usespeed.Checked.ToString();
plugin.Host.config["grid_speed"] = NUM_UpDownFlySpeed.Value.ToString();

plugin.Host.config["grid_dist"] = NUM_Distance.Value.ToString();
plugin.Host.config["grid_overshoot1"] = NUM_overshoot.Value.ToString();
plugin.Host.config["grid_overshoot2"] = NUM_overshoot2.Value.ToString();
plugin.Host.config["grid_leadin"] = NUM_leadin.Value.ToString();
plugin.Host.config["grid_leadin1"] = NUM_leadin.Value.ToString();
plugin.Host.config["grid_leadin2"] = NUM_leadin2.Value.ToString();
plugin.Host.config["grid_overlap"] = num_overlap.Value.ToString();
plugin.Host.config["grid_sidelap"] = num_sidelap.Value.ToString();
plugin.Host.config["grid_spacing"] = NUM_spacing.Value.ToString();
Expand Down

0 comments on commit 5a6d4f9

Please sign in to comment.