Exemple #1
0
        private void FormSteer_FormClosing(object sender, FormClosingEventArgs e)
        {
            mf.vehicle.ast.isInFreeDriveMode = false;

            Properties.Vehicle.Default.setVehicle_goalPointLookAhead     = mf.vehicle.goalPointLookAhead;
            Properties.Vehicle.Default.stanleyHeadingErrorGain           = mf.vehicle.stanleyHeadingErrorGain;
            Properties.Vehicle.Default.stanleyDistanceErrorGain          = mf.vehicle.stanleyDistanceErrorGain;
            Properties.Vehicle.Default.stanleyIntegralGainAB             = mf.vehicle.stanleyIntegralGainAB;
            Properties.Vehicle.Default.purePursuitIntegralGainAB         = mf.vehicle.purePursuitIntegralGain;
            Properties.Vehicle.Default.setVehicle_goalPointLookAheadMult = mf.vehicle.goalPointLookAheadMult;
            Properties.Vehicle.Default.setVehicle_maxSteerAngle          = mf.vehicle.maxSteerAngle;

            Properties.Settings.Default.setAS_countsPerDegree = mf.p_252.pgn[mf.p_252.countsPerDegree] = unchecked ((byte)hsbarCountsPerDegree.Value);
            Properties.Settings.Default.setAS_ackerman        = mf.p_252.pgn[mf.p_252.ackerman] = unchecked ((byte)hsbarAckerman.Value);

            Properties.Settings.Default.setAS_wasOffset = hsbarWasOffset.Value;
            mf.p_252.pgn[mf.p_252.wasOffsetHi]          = unchecked ((byte)(hsbarWasOffset.Value >> 8));
            mf.p_252.pgn[mf.p_252.wasOffsetLo]          = unchecked ((byte)(hsbarWasOffset.Value));

            Properties.Settings.Default.setAS_highSteerPWM = mf.p_252.pgn[mf.p_252.highPWM] = unchecked ((byte)hsbarHighSteerPWM.Value);
            Properties.Settings.Default.setAS_lowSteerPWM  = mf.p_252.pgn[mf.p_252.lowPWM] = unchecked ((byte)hsbarLowSteerPWM.Value);
            Properties.Settings.Default.setAS_Kp           = mf.p_252.pgn[mf.p_252.gainProportional] = unchecked ((byte)hsbarProportionalGain.Value);
            Properties.Settings.Default.setAS_minSteerPWM  = mf.p_252.pgn[mf.p_252.minPWM] = unchecked ((byte)hsbarMinPWM.Value);

            Properties.Settings.Default.Save();
            Properties.Vehicle.Default.Save();

            //save current vehicle
            SettingsIO.ExportAll(mf.vehiclesDirectory + mf.vehicleFileName + ".XML");
        }
Exemple #2
0
        private void FormConfig_FormClosing(object sender, FormClosingEventArgs e)
        {
            SaveDisplaySettings();

            //reload all the settings from default and user.config
            mf.LoadSettings();
            //save current vehicle
            SettingsIO.ExportAll(mf.vehiclesDirectory + mf.vehicleFileName + ".XML");
        }
Exemple #3
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (tboxName.Text.Trim().Length > 0)
     {
         //mf.FileSaveVehicle(mf.vehiclesDirectory + tboxName.Text.Trim() + ".xml");
         SettingsIO.ExportAll(mf.vehiclesDirectory + tboxName.Text.Trim() + ".XML");
         Close();
     }
 }
        private void btnVehicleSave_Click(object sender, EventArgs e)
        {
            if (tboxVehicleNameSave.Text.Trim().Length > 0)
            {
                SaveDisplaySettings();

                SettingsIO.ExportAll(mf.vehiclesDirectory + tboxVehicleNameSave.Text.Trim() + ".XML");
                UpdateVehicleListView();
                lblCurrentVehicle.Text = tboxVehicleNameSave.Text.Trim();
                Properties.Vehicle.Default.setVehicle_vehicleName = tboxVehicleNameSave.Text.Trim();
                Properties.Vehicle.Default.Save();
                tboxVehicleNameSave.Text = "";
                btnVehicleSave.Enabled   = false;
            }
        }
Exemple #5
0
        private void cboxVeh_SelectedIndexChanged(object sender, EventArgs e)
        {
            DialogResult result3 = MessageBox.Show(
                "Overwrite: " + cboxVeh.SelectedItem.ToString() + ".xml",
                gStr.gsSaveAndReturn,
                MessageBoxButtons.YesNo,
                MessageBoxIcon.Question,
                MessageBoxDefaultButton.Button2);

            if (result3 == DialogResult.Yes)
            {
                //mf.FileSaveVehicle(mf.vehiclesDirectory + cboxVeh.SelectedItem.ToString() + ".xml");
                SettingsIO.ExportAll(mf.vehiclesDirectory + cboxVeh.SelectedItem.ToString() + ".XML");
                Close();
            }
        }
 private void btnVehicleSaveAs_Click(object sender, EventArgs e)
 {
     if (lvVehicles.SelectedItems.Count > 0)
     {
         DialogResult result3 = MessageBox.Show(
             "Overwrite: " + lvVehicles.SelectedItems[0].SubItems[0].Text + ".XML",
             gStr.gsSaveAndReturn,
             MessageBoxButtons.YesNo,
             MessageBoxIcon.Question,
             MessageBoxDefaultButton.Button2);
         if (result3 == DialogResult.Yes)
         {
             SettingsIO.ExportAll(mf.vehiclesDirectory + lvVehicles.SelectedItems[0].SubItems[0].Text + ".XML");
         }
         UpdateVehicleListView();
     }
 }