MissionPlanner.SerialInjectGPS.but_save_basepos_Click C# (CSharp) Method

but_save_basepos_Click() private method

private but_save_basepos_Click ( object sender, EventArgs e ) : void
sender object
e EventArgs
return void
        private void but_save_basepos_Click(object sender, EventArgs e)
        {
            if (MainV2.comPort.MAV.cs.MovingBase == null)
            {
                CustomMessageBox.Show("No valid base position determined by gps yet", Strings.ERROR);
                return;
            }

            string location = "";
            if (InputBox.Show("Enter Location", "Enter a friendly name for this location.", ref location) ==
                DialogResult.OK)
            {
                var basepos = MainV2.comPort.MAV.cs.MovingBase;
                Settings.Instance["base_pos"] = String.Format("{0},{1},{2},{3}", basepos.Lat.ToString(CultureInfo.InvariantCulture), basepos.Lng.ToString(CultureInfo.InvariantCulture), basepos.Alt.ToString(CultureInfo.InvariantCulture),
                    location);
            }
        }
    }