From 2c836f4991067dbeb2cefd318182dc879aac9964 Mon Sep 17 00:00:00 2001 From: BrianTee Date: Sat, 4 Jan 2025 23:59:26 -0700 Subject: [PATCH 1/4] RegistrySettings static class for AOG --- SourceCode/AgIO/Source/Classes/CSettings.cs | 8 +- .../AgIO/Source/Forms/Controls.Designer.cs | 2 +- SourceCode/AgIO/Source/Forms/FormLoop.cs | 2 +- SourceCode/GPS/Classes/CSettings.cs | 212 +++++++++++++++++- SourceCode/GPS/Forms/Controls.Designer.cs | 10 +- SourceCode/GPS/Forms/Field/FormBoundary.cs | 4 +- SourceCode/GPS/Forms/Field/FormFieldDir.cs | 2 +- .../GPS/Forms/Field/FormFieldExisting.cs | 10 +- SourceCode/GPS/Forms/Field/FormFieldISOXML.cs | 6 +- SourceCode/GPS/Forms/Field/FormFieldKML.cs | 6 +- SourceCode/GPS/Forms/Field/FormJob.cs | 6 +- SourceCode/GPS/Forms/FormGPS.cs | 54 +---- SourceCode/GPS/Forms/FormMap.cs | 4 +- SourceCode/GPS/Forms/GUI.Designer.cs | 4 +- .../GPS/Forms/Guidance/FormBuildTracks.cs | 2 +- .../GPS/Forms/Pickers/FormDrivePicker.cs | 2 +- .../GPS/Forms/Pickers/FormFilePicker.cs | 12 +- .../GPS/Forms/Pickers/FormRecordPicker.cs | 8 +- SourceCode/GPS/Forms/SaveOpen.Designer.cs | 100 ++++----- .../GPS/Forms/Settings/ConfigMenu.Designer.cs | 2 +- .../Forms/Settings/ConfigVehicle.Designer.cs | 30 +-- .../GPS/Forms/Settings/FormAllSettings.cs | 4 +- SourceCode/GPS/Forms/Settings/FormConfig.cs | 2 +- SourceCode/GPS/Forms/Settings/FormSteer.cs | 4 +- SourceCode/GPS/Forms/Settings/FormSteerWiz.cs | 4 +- SourceCode/GPS/Program.cs | 105 +-------- 26 files changed, 347 insertions(+), 258 deletions(-) diff --git a/SourceCode/AgIO/Source/Classes/CSettings.cs b/SourceCode/AgIO/Source/Classes/CSettings.cs index fb3f453d6..040c4dc94 100644 --- a/SourceCode/AgIO/Source/Classes/CSettings.cs +++ b/SourceCode/AgIO/Source/Classes/CSettings.cs @@ -66,7 +66,7 @@ public static class RegistrySettings public static string culture = "en"; public static string profileDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "AgOpenGPS", "AgIO"); - public static string LogsDirectory = + public static string logsDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "AgOpenGPS", "Logs"); public static string profileName = "Default Profile"; @@ -77,9 +77,9 @@ public static void Load() try { //create Logs directory if not exist - if (!string.IsNullOrEmpty(LogsDirectory) && !Directory.Exists(LogsDirectory)) + if (!string.IsNullOrEmpty(logsDirectory) && !Directory.Exists(logsDirectory)) { - Directory.CreateDirectory(LogsDirectory); + Directory.CreateDirectory(logsDirectory); Log.EventWriter("Logs Dir Created\r"); } } @@ -89,7 +89,7 @@ public static void Load() } //keep below 500 kb - Log.CheckLogSize(Path.Combine(LogsDirectory, "AgIO_Events_Log.txt"), 500000); + Log.CheckLogSize(Path.Combine(logsDirectory, "AgIO_Events_Log.txt"), 500000); try { diff --git a/SourceCode/AgIO/Source/Forms/Controls.Designer.cs b/SourceCode/AgIO/Source/Forms/Controls.Designer.cs index c819bc620..e94f190a5 100644 --- a/SourceCode/AgIO/Source/Forms/Controls.Designer.cs +++ b/SourceCode/AgIO/Source/Forms/Controls.Designer.cs @@ -218,7 +218,7 @@ private void cboxIsIMUModule_Click(object sender, EventArgs e) private void toolStripLogViewer_Click(object sender, EventArgs e) { - Form form = new FormEventViewer(Path.Combine(RegistrySettings.LogsDirectory, "AgIO_Events_Log.txt")); + Form form = new FormEventViewer(Path.Combine(RegistrySettings.logsDirectory, "AgIO_Events_Log.txt")); form.Show(this); this.Activate(); } diff --git a/SourceCode/AgIO/Source/Forms/FormLoop.cs b/SourceCode/AgIO/Source/Forms/FormLoop.cs index 0ea6743a3..00771841d 100644 --- a/SourceCode/AgIO/Source/Forms/FormLoop.cs +++ b/SourceCode/AgIO/Source/Forms/FormLoop.cs @@ -340,7 +340,7 @@ private void FormLoop_FormClosing(object sender, FormClosingEventArgs e) public void FileSaveSystemEvents() { - using (StreamWriter writer = new StreamWriter(Path.Combine(RegistrySettings.LogsDirectory, "AgIO_Events_Log.txt"), true)) + using (StreamWriter writer = new StreamWriter(Path.Combine(RegistrySettings.logsDirectory, "AgIO_Events_Log.txt"), true)) { writer.Write(Log.sbEvent); Log.sbEvent.Clear(); diff --git a/SourceCode/GPS/Classes/CSettings.cs b/SourceCode/GPS/Classes/CSettings.cs index c0dc462b4..be8a60429 100644 --- a/SourceCode/GPS/Classes/CSettings.cs +++ b/SourceCode/GPS/Classes/CSettings.cs @@ -1,4 +1,7 @@ -using System; +using AgOpenGPS.Properties; +using Microsoft.Win32; +using OpenTK.Input; +using System; using System.Configuration; using System.IO; using System.Linq; @@ -255,4 +258,211 @@ internal static bool ImportAll(string settingsFilePath) } } } + + public static class RegistrySettings + { + public static string culture = "en"; + public static string vehiclesDirectory = + Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "AgOpenGPS", "Vehicles"); + public static string logsDirectory = + Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "AgOpenGPS", "Logs"); + public static string vehicleFileName = "Default Vehicle"; + public static string workingDirectory = "Default"; + public static string baseDirectory = workingDirectory; + public static string fieldsDirectory = workingDirectory; + + public static void Load() + { + try + { + //opening the subkey + RegistryKey regKey = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\AgOpenGPS"); + + ////create default keys if not existing + if (regKey == null) + { + RegistryKey Key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\AgOpenGPS"); + + //storing the values + Key.SetValue("Language", "en"); + Key.SetValue("VehicleFileName", "Default Vehicle"); + Key.SetValue("WorkingDirectory", "Default"); + Key.Close(); + } + + //Base Directory Registry Key + regKey = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\AgOpenGPS"); + + if (regKey.GetValue("WorkingDirectory") == null || regKey.GetValue("WorkingDirectory").ToString() == "") + { + RegistryKey key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\AgOpenGPS"); + key.SetValue("WorkingDirectory", "Default"); + key.Close(); + } + workingDirectory = regKey.GetValue("WorkingDirectory").ToString(); + + if (workingDirectory == "Default") + { + baseDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "AgOpenGPS"); + } + else //user set to other + { + baseDirectory = Path.Combine(workingDirectory, "AgOpenGPS"); + } + + //Vehicle File Name Registry Key + if (regKey.GetValue("VehicleFileName") == null || regKey.GetValue("VehicleFileName").ToString() == "") + { + RegistryKey key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\AgOpenGPS"); + key.SetValue("VehicleFileName", "Default Vehicle"); + key.Close(); + } + + vehicleFileName = regKey.GetValue("VehicleFileName").ToString(); + + //Language Registry Key + if (regKey.GetValue("Language") == null || regKey.GetValue("Language").ToString() == "") + { + RegistryKey key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\AgOpenGPS"); + key.SetValue("Language", "en"); + key.Close(); + } + + culture = regKey.GetValue("Language").ToString(); + + //close registry + regKey.Close(); + } + catch (Exception ex) + { + Log.EventWriter("Registry -> Catch, Serious Problem Creating Registry keys: " + ex.ToString()); + Reset(); + } + + //get the vehicles directory, if not exist, create + try + { + vehiclesDirectory = Path.Combine(baseDirectory, "Vehicles"); + if (!string.IsNullOrEmpty(vehiclesDirectory) && !Directory.Exists(vehiclesDirectory)) + { + Directory.CreateDirectory(vehiclesDirectory); + } + } + catch (Exception ex) + { + Log.EventWriter("Catch, Serious Problem Making Vehicles Directory: " + ex.ToString()); + } + + //get the fields directory, if not exist, create + try + { + fieldsDirectory = Path.Combine(baseDirectory, "Fields"); + if (!string.IsNullOrEmpty(fieldsDirectory) && !Directory.Exists(fieldsDirectory)) + { + Directory.CreateDirectory(fieldsDirectory); + Log.EventWriter("Fields Dir Created"); + } + } + catch (Exception ex) + { + Log.EventWriter("Catch, Serious Problem Making Fields Directory: " + ex.ToString()); + } + + //get the logs directory, if not exist, create + try + { + logsDirectory = Path.Combine(baseDirectory, "Logs"); + if (!string.IsNullOrEmpty(logsDirectory) && !Directory.Exists(logsDirectory)) + { + Directory.CreateDirectory(logsDirectory); + Log.EventWriter("Logs Dir Created"); + } + } + catch (Exception ex) + { + Log.EventWriter("Catch, Serious Problem Making Logs Directory: " + ex.ToString()); + } + + //keep below 500 kb + Log.CheckLogSize(Path.Combine(logsDirectory, "AgIO_Events_Log.txt"), 500000); + + //what's in the vehicle directory + try + { + DirectoryInfo dinfo = new DirectoryInfo(RegistrySettings.vehiclesDirectory); + FileInfo[] vehicleFiles = dinfo.GetFiles("*.xml"); + + bool isVehicleExist = false; + + foreach (FileInfo file in vehicleFiles) + { + string temp = Path.GetFileNameWithoutExtension(file.Name).Trim(); + + if (temp == vehicleFileName) + { + isVehicleExist = true; + } + } + + //does current vehicle exist? + if (isVehicleExist && vehicleFileName != "Default Vehicle") + { + SettingsIO.ImportAll(Path.Combine(RegistrySettings.vehiclesDirectory, vehicleFileName + ".XML")); + } + else + { + vehicleFileName = "Default Vehicle"; + Log.EventWriter("Vehicle file does not exist or is Default, Default Vehicle selected"); + } + } + catch (Exception ex) + { + Log.EventWriter("Registry -> Catch, Serious Problem Loading Profile, Doing Registry Reset: " + ex.ToString()); + Reset(); + + //reset to Default Profile and save + Settings.Default.Reset(); + Settings.Default.Save(); + } + } + + public static void Save() + { + RegistryKey key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\AgIO"); + try + { + key.SetValue("ProfileName", vehicleFileName); + Log.EventWriter(vehicleFileName + " Saved to registry key"); + } + catch (Exception ex) + { + Log.EventWriter("Registry -> Catch, Serious Problem Saving keys: " + ex.ToString()); + } + key.Close(); + + //if (RegistrySettings.vehicleFileName != "Default Profile") + // SettingsIO.ExportSettings(Path.Combine(RegistrySettings.vehiclesDirectory, RegistrySettings.vehicleFileName + ".xml")); + } + + public static void Reset() + { + try + { + Registry.CurrentUser.DeleteSubKeyTree(@"SOFTWARE\AgOpenGPS"); + + //create all new key + RegistryKey key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\AgOpenGPS"); + key.SetValue("Language", "en"); + key.SetValue("VehicleFileName", "Default Vehicle"); + key.SetValue("WorkingDirectory", "Default"); + key.Close(); + + Log.EventWriter("Registry -> Resetting Registry SubKey Tree"); + } + catch (Exception ex) + { + Log.EventWriter("\"Registry -> Catch, Serious Problem Resetting Registry keys: " + ex.ToString()); + } + } + } } \ No newline at end of file diff --git a/SourceCode/GPS/Forms/Controls.Designer.cs b/SourceCode/GPS/Forms/Controls.Designer.cs index 807aef016..457731d51 100644 --- a/SourceCode/GPS/Forms/Controls.Designer.cs +++ b/SourceCode/GPS/Forms/Controls.Designer.cs @@ -1546,7 +1546,7 @@ private void resetALLToolStripMenuItem_Click(object sender, EventArgs e) Key.SetValue("WorkingDirectory", "Default"); Key.Close(); - vehicleFileName = "Default Vehicle"; + RegistrySettings.vehicleFileName = "Default Vehicle"; Settings.Default.Reset(); Settings.Default.Save(); @@ -1631,7 +1631,7 @@ private void colorsToolStripMenuItem_Click(object sender, EventArgs e) { form.ShowDialog(this); } - SettingsIO.ExportAll(Path.Combine(vehiclesDirectory, vehicleFileName + ".XML")); + SettingsIO.ExportAll(Path.Combine(RegistrySettings.vehiclesDirectory, RegistrySettings.vehicleFileName + ".XML")); } private void colorsSectionToolStripMenuItem_Click(object sender, EventArgs e) { @@ -1641,7 +1641,7 @@ private void colorsSectionToolStripMenuItem_Click(object sender, EventArgs e) { form.ShowDialog(this); } - SettingsIO.ExportAll(Path.Combine(vehiclesDirectory, vehicleFileName + ".XML")); + SettingsIO.ExportAll(Path.Combine(RegistrySettings.vehiclesDirectory, RegistrySettings.vehicleFileName + ".XML")); } else { @@ -2205,7 +2205,7 @@ private void xTEChartToolStripMenuItem_Click(object sender, EventArgs e) } private void eventViewerToolStripMenuItem_Click(object sender, EventArgs e) { - Form form = new FormEventViewer(Path.Combine(logsDirectory, "AgOpenGPS_Events_Log.txt")); + Form form = new FormEventViewer(Path.Combine(RegistrySettings.logsDirectory, "AgOpenGPS_Events_Log.txt")); form.Show(this); this.Activate(); } @@ -2372,7 +2372,7 @@ private void googleEarthOpenGLContextMenu_Click(object sender, EventArgs e) FileSaveSingleFlagKML(flagNumberPicked); //Process.Start(@"C:\Program Files (x86)\Google\Google Earth\client\googleearth", workingDirectory + currentFieldDirectory + "\\Flags.KML"); - Process.Start(Path.Combine(fieldsDirectory, currentFieldDirectory, "Flag.KML")); + Process.Start(Path.Combine(RegistrySettings.fieldsDirectory, currentFieldDirectory, "Flag.KML")); } } diff --git a/SourceCode/GPS/Forms/Field/FormBoundary.cs b/SourceCode/GPS/Forms/Field/FormBoundary.cs index b0d00d3cd..300c4494d 100644 --- a/SourceCode/GPS/Forms/Field/FormBoundary.cs +++ b/SourceCode/GPS/Forms/Field/FormBoundary.cs @@ -249,7 +249,7 @@ private void btnOpenGoogleEarth_Click(object sender, EventArgs e) //save new copy of kml with selected flag and view in GoogleEarth mf.FileMakeKMLFromCurrentPosition(mf.pn.latitude, mf.pn.longitude); - System.Diagnostics.Process.Start(Path.Combine(mf.fieldsDirectory, mf.currentFieldDirectory, "CurrentPosition.KML")); + System.Diagnostics.Process.Start(Path.Combine(RegistrySettings.fieldsDirectory, mf.currentFieldDirectory, "CurrentPosition.KML")); isClosing = true; Close(); } @@ -319,7 +319,7 @@ private void btnLoadBoundaryFromGE_Click(object sender, EventArgs e) Filter = "KML files (*.KML)|*.KML", //the initial directory, fields, for the open dialog - InitialDirectory = Path.Combine(mf.fieldsDirectory, mf.currentFieldDirectory) + InitialDirectory = Path.Combine(RegistrySettings.fieldsDirectory, mf.currentFieldDirectory) }; //was a file selected diff --git a/SourceCode/GPS/Forms/Field/FormFieldDir.cs b/SourceCode/GPS/Forms/Field/FormFieldDir.cs index 95a0cf332..28bf1e375 100644 --- a/SourceCode/GPS/Forms/Field/FormFieldDir.cs +++ b/SourceCode/GPS/Forms/Field/FormFieldDir.cs @@ -81,7 +81,7 @@ private void btnSave_Click(object sender, EventArgs e) mf.currentFieldDirectory = tboxFieldName.Text.Trim(); //get the directory and make sure it exists, create if not - DirectoryInfo dirNewField = new DirectoryInfo(Path.Combine(mf.fieldsDirectory, mf.currentFieldDirectory)); + DirectoryInfo dirNewField = new DirectoryInfo(Path.Combine(RegistrySettings.fieldsDirectory, mf.currentFieldDirectory)); mf.menustripLanguage.Enabled = false; //if no template set just make a new file. diff --git a/SourceCode/GPS/Forms/Field/FormFieldExisting.cs b/SourceCode/GPS/Forms/Field/FormFieldExisting.cs index 6ddac79b7..c0bb866cd 100644 --- a/SourceCode/GPS/Forms/Field/FormFieldExisting.cs +++ b/SourceCode/GPS/Forms/Field/FormFieldExisting.cs @@ -38,7 +38,7 @@ private void FormFieldExisting_Load(object sender, EventArgs e) timer1.Enabled = true; ListViewItem itm; - string[] dirs = Directory.GetDirectories(mf.fieldsDirectory); + string[] dirs = Directory.GetDirectories(RegistrySettings.fieldsDirectory); if (dirs == null || dirs.Length < 1) { @@ -278,7 +278,7 @@ private void btnSave_Click(object sender, EventArgs e) return; } - string fileStr = Path.Combine(mf.fieldsDirectory, lblTemplateChosen.Text, "Field.txt"); + string fileStr = Path.Combine(RegistrySettings.fieldsDirectory, lblTemplateChosen.Text, "Field.txt"); if (!File.Exists(fileStr)) { @@ -289,7 +289,7 @@ private void btnSave_Click(object sender, EventArgs e) if (mf.isJobStarted) mf.FileSaveEverythingBeforeClosingField(); //get the directory and make sure it exists, create if not - string directoryName = Path.Combine(mf.fieldsDirectory, tboxFieldName.Text.Trim()); + string directoryName = Path.Combine(RegistrySettings.fieldsDirectory, tboxFieldName.Text.Trim()); // create from template if (Directory.Exists(directoryName)) @@ -356,7 +356,7 @@ private void btnSave_Click(object sender, EventArgs e) } //create txt file copies - string templateDirectoryName = Path.Combine(mf.fieldsDirectory, lblTemplateChosen.Text); + string templateDirectoryName = Path.Combine(RegistrySettings.fieldsDirectory, lblTemplateChosen.Text); string fileToCopy = ""; string destinationDirectory = ""; @@ -515,7 +515,7 @@ private void btnAddTime_Click(object sender, EventArgs e) private void btnAddVehicleName_Click(object sender, EventArgs e) { - tboxFieldName.Text += " " + mf.vehicleFileName; + tboxFieldName.Text += " " + RegistrySettings.vehicleFileName; } private void btnSort_Click(object sender, EventArgs e) diff --git a/SourceCode/GPS/Forms/Field/FormFieldISOXML.cs b/SourceCode/GPS/Forms/Field/FormFieldISOXML.cs index 704eea850..cb3732f3e 100644 --- a/SourceCode/GPS/Forms/Field/FormFieldISOXML.cs +++ b/SourceCode/GPS/Forms/Field/FormFieldISOXML.cs @@ -51,7 +51,7 @@ private void FormFieldISOXML_Load(object sender, EventArgs e) Filter = "XML files (*.XML)|*.XML", //the initial directory, fields, for the open dialog - InitialDirectory = mf.fieldsDirectory + InitialDirectory = RegistrySettings.fieldsDirectory }; //was a file selected @@ -205,7 +205,7 @@ private void tree_AfterSelect(object sender, TreeViewEventArgs e) private void btnBuildFields_Click(object sender, EventArgs e) { mf.currentFieldDirectory = tboxFieldName.Text.Trim(); - string directoryName = Path.Combine(mf.fieldsDirectory, mf.currentFieldDirectory); + string directoryName = Path.Combine(RegistrySettings.fieldsDirectory, mf.currentFieldDirectory); //create new field files. if ((!string.IsNullOrEmpty(directoryName)) && (Directory.Exists(directoryName))) @@ -320,7 +320,7 @@ private void btnBuildFields_Click(object sender, EventArgs e) string myFileName; //get the directory and make sure it exists, create if not - directoryName = Path.Combine(mf.fieldsDirectory, mf.currentFieldDirectory); + directoryName = Path.Combine(RegistrySettings.fieldsDirectory, mf.currentFieldDirectory); if ((directoryName.Length > 0) && (!Directory.Exists(directoryName))) { Directory.CreateDirectory(directoryName); } diff --git a/SourceCode/GPS/Forms/Field/FormFieldKML.cs b/SourceCode/GPS/Forms/Field/FormFieldKML.cs index 0631f8179..dd9300052 100644 --- a/SourceCode/GPS/Forms/Field/FormFieldKML.cs +++ b/SourceCode/GPS/Forms/Field/FormFieldKML.cs @@ -86,7 +86,7 @@ private void btnLoadKML_Click(object sender, EventArgs e) Filter = "KML files (*.KML)|*.KML", //the initial directory, fields, for the open dialog - InitialDirectory = mf.fieldsDirectory + InitialDirectory = RegistrySettings.fieldsDirectory }; //was a file selected @@ -314,7 +314,7 @@ private void CreateNewField() mf.currentFieldDirectory = tboxFieldName.Text.Trim(); //get the directory and make sure it exists, create if not - string directoryName = Path.Combine(mf.fieldsDirectory, mf.currentFieldDirectory); + string directoryName = Path.Combine(RegistrySettings.fieldsDirectory, mf.currentFieldDirectory); mf.menustripLanguage.Enabled = false; //if no template set just make a new file. @@ -362,7 +362,7 @@ private void CreateNewField() string myFileName; //get the directory and make sure it exists, create if not - directoryName = Path.Combine(mf.fieldsDirectory, mf.currentFieldDirectory); + directoryName = Path.Combine(RegistrySettings.fieldsDirectory, mf.currentFieldDirectory); if ((directoryName.Length > 0) && (!Directory.Exists(directoryName))) { Directory.CreateDirectory(directoryName); } diff --git a/SourceCode/GPS/Forms/Field/FormJob.cs b/SourceCode/GPS/Forms/Field/FormJob.cs index cf95f69c9..7f74f98f9 100644 --- a/SourceCode/GPS/Forms/Field/FormJob.cs +++ b/SourceCode/GPS/Forms/Field/FormJob.cs @@ -34,7 +34,7 @@ private void FormJob_Load(object sender, EventArgs e) { //check if directory and file exists, maybe was deleted etc if (String.IsNullOrEmpty(mf.currentFieldDirectory)) btnJobResume.Enabled = false; - string directoryName = Path.Combine(mf.fieldsDirectory, mf.currentFieldDirectory); + string directoryName = Path.Combine(RegistrySettings.fieldsDirectory, mf.currentFieldDirectory); string fileAndDirectory = Path.Combine(directoryName, "Field.txt"); @@ -123,7 +123,7 @@ private void btnInField_Click(object sender, EventArgs e) string infieldList = ""; int numFields = 0; - string[] dirs = Directory.GetDirectories(mf.fieldsDirectory); + string[] dirs = Directory.GetDirectories(RegistrySettings.fieldsDirectory); foreach (string dir in dirs) { @@ -199,7 +199,7 @@ private void btnInField_Click(object sender, EventArgs e) } else // 1 field found { - mf.filePickerFileAndDirectory = Path.Combine(mf.fieldsDirectory, infieldList, "Field.txt"); + mf.filePickerFileAndDirectory = Path.Combine(RegistrySettings.fieldsDirectory, infieldList, "Field.txt"); mf.FileOpenField(mf.filePickerFileAndDirectory); Close(); } diff --git a/SourceCode/GPS/Forms/FormGPS.cs b/SourceCode/GPS/Forms/FormGPS.cs index b6e4a72ee..3d7f42e25 100644 --- a/SourceCode/GPS/Forms/FormGPS.cs +++ b/SourceCode/GPS/Forms/FormGPS.cs @@ -45,14 +45,8 @@ public partial class FormGPS : Form //How many headlands allowed public const int MAXHEADS = 6; - //The base directory where AgOpenGPS will be stored and fields and vehicles branch from - public string baseDirectory; - - //current directory of vehicle - public string vehiclesDirectory, vehicleFileName = "", logsDirectory; - - //current fields and field directory - public string fieldsDirectory, currentFieldDirectory, displayFieldName; + //current fields + public string currentFieldDirectory, displayFieldName; private bool leftMouseDownOnOpenGL; //mousedown event in opengl window public int flagNumberPicked = 0; @@ -388,11 +382,14 @@ private void FormGPS_Load(object sender, EventArgs e) Log.EventWriter("Terms Not Accepted"); Close(); } + else + { + Log.EventWriter("Terms Accepted"); + } } } } - this.MouseWheel += ZoomByMouseWheel; Log.EventWriter("Program Started: " @@ -420,39 +417,12 @@ private void FormGPS_Load(object sender, EventArgs e) //set the language to last used SetLanguage(Settings.Default.setF_culture, false); - string workingDirectory = Settings.Default.setF_workingDirectory == "Default" - ? Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) - : Settings.Default.setF_workingDirectory; - - baseDirectory = Path.Combine(workingDirectory, "AgOpenGPS"); - - //get the fields directory, if not exist, create - fieldsDirectory = Path.Combine(baseDirectory, "Fields"); - if (!string.IsNullOrEmpty(fieldsDirectory) && !Directory.Exists(fieldsDirectory)) { Directory.CreateDirectory(fieldsDirectory); - Log.EventWriter("Fields Dir Created"); - } - - //get the fields directory, if not exist, create - vehiclesDirectory = Path.Combine(baseDirectory, "Vehicles"); - if (!string.IsNullOrEmpty(vehiclesDirectory) && !Directory.Exists(vehiclesDirectory)) { Directory.CreateDirectory(vehiclesDirectory); - Log.EventWriter("Vehicles Dir Created"); - } - - //get the fields directory, if not exist, create - logsDirectory = Path.Combine(baseDirectory, "Logs"); - if (!string.IsNullOrEmpty(logsDirectory) && !Directory.Exists(logsDirectory)) { Directory.CreateDirectory(logsDirectory); - Log.EventWriter("Logs Dir Created"); - } - - //keep below 500 kb - Log.CheckLogSize(Path.Combine(logsDirectory, "AgOpenGPS_Events_Log.txt"), 500000); - //make sure current field directory exists, null if not currentFieldDirectory = Settings.Default.setF_CurrentDir; if (currentFieldDirectory != "") { - string dir = Path.Combine(fieldsDirectory, currentFieldDirectory); + string dir = Path.Combine(RegistrySettings.fieldsDirectory, currentFieldDirectory); if (!string.IsNullOrEmpty(dir) && !Directory.Exists(dir)) { currentFieldDirectory = ""; @@ -463,7 +433,7 @@ private void FormGPS_Load(object sender, EventArgs e) } Log.EventWriter("Program Directory: " + Application.StartupPath); - Log.EventWriter("Fields Directory: " + (fieldsDirectory)); + Log.EventWriter("Fields Directory: " + (RegistrySettings.fieldsDirectory)); if (isBrightnessOn) { @@ -505,7 +475,7 @@ private void FormGPS_Load(object sender, EventArgs e) oglZoom.Left = 100; oglZoom.Top = 100; - if (vehicleFileName != "Default Vehicle" && Properties.Settings.Default.setDisplay_isAutoStartAgIO) + if (RegistrySettings.vehicleFileName != "Default Vehicle" && Properties.Settings.Default.setDisplay_isAutoStartAgIO) { //Start AgIO process Process[] processName = Process.GetProcessesByName("AgIO"); @@ -581,14 +551,14 @@ private void FormGPS_Load(object sender, EventArgs e) Log.EventWriter("Terms Accepted"); - if (vehicleFileName == "Default Vehicle") + if (RegistrySettings.vehicleFileName == "Default Vehicle") { Log.EventWriter("Using Default Vehicle At Start Warning"); YesMessageBox("Using Default Vehicle" + "\r\n\r\n" + "Load Existing Vehicle or Save As a New One !!!" + "\r\n\r\n" + "Changes will NOT be Saved for Default Vehicle"); - SettingsIO.ExportAll(Path.Combine(vehiclesDirectory, "Default Vehicle.xml")); + SettingsIO.ExportAll(Path.Combine(RegistrySettings.vehiclesDirectory, "Default Vehicle.xml")); RegistryKey key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\AgOpenGPS"); key.SetValue("VehicleFileName", Properties.Settings.Default.setVehicle_vehicleName); @@ -674,7 +644,7 @@ private void FormGPS_FormClosing(object sender, FormClosingEventArgs e) FileSaveSystemEvents(); //save current vehicle - SettingsIO.ExportAll(Path.Combine(vehiclesDirectory, vehicleFileName + ".XML")); + SettingsIO.ExportAll(Path.Combine(RegistrySettings.vehiclesDirectory, RegistrySettings.vehicleFileName + ".XML")); RegistryKey key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\AgOpenGPS"); key.SetValue("VehicleFileName", Properties.Settings.Default.setVehicle_vehicleName); diff --git a/SourceCode/GPS/Forms/FormMap.cs b/SourceCode/GPS/Forms/FormMap.cs index 6ba167a9d..e7f219df5 100644 --- a/SourceCode/GPS/Forms/FormMap.cs +++ b/SourceCode/GPS/Forms/FormMap.cs @@ -371,7 +371,7 @@ private void ResetMapGrid() GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, 9729); } - string fileAndDirectory = Path.Combine(mf.fieldsDirectory, mf.currentFieldDirectory, "BackPic.png"); + string fileAndDirectory = Path.Combine(RegistrySettings.fieldsDirectory, mf.currentFieldDirectory, "BackPic.png"); try { if (File.Exists(fileAndDirectory)) @@ -457,7 +457,7 @@ private void SaveBackgroundImage() bitmap = glm.MakeGrayscale3(bitmap); } - string fileAndDirectory = Path.Combine(mf.fieldsDirectory, mf.currentFieldDirectory, "BackPic.png"); + string fileAndDirectory = Path.Combine(RegistrySettings.fieldsDirectory, mf.currentFieldDirectory, "BackPic.png"); try { if (File.Exists(fileAndDirectory)) diff --git a/SourceCode/GPS/Forms/GUI.Designer.cs b/SourceCode/GPS/Forms/GUI.Designer.cs index 0f164e5c2..33f2920a2 100644 --- a/SourceCode/GPS/Forms/GUI.Designer.cs +++ b/SourceCode/GPS/Forms/GUI.Designer.cs @@ -206,7 +206,7 @@ private void tmrWatchdog_tick(object sender, EventArgs e) switch (currentFieldTextCounter) { case 0: - lblCurrentField.Text = (tool.width * m2FtOrM).ToString("N2") + unitsFtM + " - " + vehicleFileName; + lblCurrentField.Text = (tool.width * m2FtOrM).ToString("N2") + unitsFtM + " - " + RegistrySettings.vehicleFileName; break; case 1: @@ -632,7 +632,7 @@ public void LoadSettings() string directoryName = Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location); //grab the current vehicle filename - make sure it exists - vehicleFileName = Settings.Default.setVehicle_vehicleName; + RegistrySettings.vehicleFileName = Settings.Default.setVehicle_vehicleName; simulatorOnToolStripMenuItem.Checked = Settings.Default.setMenu_isSimulatorOn; if (simulatorOnToolStripMenuItem.Checked) diff --git a/SourceCode/GPS/Forms/Guidance/FormBuildTracks.cs b/SourceCode/GPS/Forms/Guidance/FormBuildTracks.cs index 6745f9472..d1fe9f128 100644 --- a/SourceCode/GPS/Forms/Guidance/FormBuildTracks.cs +++ b/SourceCode/GPS/Forms/Guidance/FormBuildTracks.cs @@ -980,7 +980,7 @@ private void btnLoadABFromKML_Click(object sender, EventArgs e) Filter = "KML files (*.KML)|*.KML", //the initial directory, fields, for the open dialog - InitialDirectory = Path.Combine(mf.fieldsDirectory, mf.currentFieldDirectory) + InitialDirectory = Path.Combine(RegistrySettings.fieldsDirectory, mf.currentFieldDirectory) }; //was a file selected diff --git a/SourceCode/GPS/Forms/Pickers/FormDrivePicker.cs b/SourceCode/GPS/Forms/Pickers/FormDrivePicker.cs index ea7266019..9c981f74f 100644 --- a/SourceCode/GPS/Forms/Pickers/FormDrivePicker.cs +++ b/SourceCode/GPS/Forms/Pickers/FormDrivePicker.cs @@ -34,7 +34,7 @@ private void btnOpenExistingLv_Click(object sender, EventArgs e) int count = lvLines.SelectedItems.Count; if (count > 0) { - mf.filePickerFileAndDirectory = Path.Combine(mf.fieldsDirectory, lvLines.SelectedItems[0].SubItems[0].Text, "Field.txt"); + mf.filePickerFileAndDirectory = Path.Combine(RegistrySettings.fieldsDirectory, lvLines.SelectedItems[0].SubItems[0].Text, "Field.txt"); Close(); } } diff --git a/SourceCode/GPS/Forms/Pickers/FormFilePicker.cs b/SourceCode/GPS/Forms/Pickers/FormFilePicker.cs index e1dee0ae7..8f9ab2868 100644 --- a/SourceCode/GPS/Forms/Pickers/FormFilePicker.cs +++ b/SourceCode/GPS/Forms/Pickers/FormFilePicker.cs @@ -31,7 +31,7 @@ private void FormFilePicker_Load(object sender, EventArgs e) timer1.Enabled = true; ListViewItem itm; - string[] dirs = Directory.GetDirectories(mf.fieldsDirectory); + string[] dirs = Directory.GetDirectories(RegistrySettings.fieldsDirectory); //fileList?.Clear(); @@ -310,9 +310,9 @@ private void btnOpenExistingLv_Click(object sender, EventArgs e) else { if (order == 0) mf.filePickerFileAndDirectory = - Path.Combine(mf.fieldsDirectory, lvLines.SelectedItems[0].SubItems[0].Text, "Field.txt"); + Path.Combine(RegistrySettings.fieldsDirectory, lvLines.SelectedItems[0].SubItems[0].Text, "Field.txt"); else mf.filePickerFileAndDirectory = - Path.Combine(mf.fieldsDirectory, lvLines.SelectedItems[0].SubItems[1].Text, "Field.txt"); + Path.Combine(RegistrySettings.fieldsDirectory, lvLines.SelectedItems[0].SubItems[1].Text, "Field.txt"); Close(); } } @@ -330,9 +330,9 @@ private void btnDeleteField_Click(object sender, EventArgs e) if (count > 0) { if (order == 0) - dir2Delete = Path.Combine(mf.fieldsDirectory, lvLines.SelectedItems[0].SubItems[0].Text); + dir2Delete = Path.Combine(RegistrySettings.fieldsDirectory, lvLines.SelectedItems[0].SubItems[0].Text); else - dir2Delete = Path.Combine(mf.fieldsDirectory, lvLines.SelectedItems[0].SubItems[1].Text); + dir2Delete = Path.Combine(RegistrySettings.fieldsDirectory, lvLines.SelectedItems[0].SubItems[1].Text); DialogResult result3 = MessageBox.Show( dir2Delete, @@ -350,7 +350,7 @@ private void btnDeleteField_Click(object sender, EventArgs e) ListViewItem itm; - string[] dirs = Directory.GetDirectories(mf.fieldsDirectory); + string[] dirs = Directory.GetDirectories(RegistrySettings.fieldsDirectory); fileList?.Clear(); diff --git a/SourceCode/GPS/Forms/Pickers/FormRecordPicker.cs b/SourceCode/GPS/Forms/Pickers/FormRecordPicker.cs index 0b18652d6..8bef5e76e 100644 --- a/SourceCode/GPS/Forms/Pickers/FormRecordPicker.cs +++ b/SourceCode/GPS/Forms/Pickers/FormRecordPicker.cs @@ -30,7 +30,7 @@ private void LoadList() { ListViewItem itm; - string fieldDir = Path.Combine(mf.fieldsDirectory, mf.currentFieldDirectory); + string fieldDir = Path.Combine(RegistrySettings.fieldsDirectory, mf.currentFieldDirectory); string[] files = Directory.GetFiles(fieldDir); @@ -64,11 +64,11 @@ private void btnOpenExistingLv_Click(object sender, EventArgs e) if (count > 0) { string selectedRecord = lvLines.SelectedItems[0].SubItems[0].Text; - string selectedRecordPath = Path.Combine(mf.fieldsDirectory, mf.currentFieldDirectory, selectedRecord + ".rec"); + string selectedRecordPath = Path.Combine(RegistrySettings.fieldsDirectory, mf.currentFieldDirectory, selectedRecord + ".rec"); // Copy the selected record file to the original record name inside the field dir: // ( this will load the last selected path automatically when this field is opened again) - File.Copy(selectedRecordPath, Path.Combine(mf.fieldsDirectory, mf.currentFieldDirectory, "RecPath.txt"), true); + File.Copy(selectedRecordPath, Path.Combine(RegistrySettings.fieldsDirectory, mf.currentFieldDirectory, "RecPath.txt"), true); // and load the selected path into the recPath object: string line; if (File.Exists(selectedRecordPath)) @@ -118,7 +118,7 @@ private void btnDeleteField_Click(object sender, EventArgs e) if (count > 0) { string selectedRecord = lvLines.SelectedItems[0].SubItems[0].Text; - dir2Delete = Path.Combine(mf.fieldsDirectory, mf.currentFieldDirectory, selectedRecord + ".rec"); + dir2Delete = Path.Combine(RegistrySettings.fieldsDirectory, mf.currentFieldDirectory, selectedRecord + ".rec"); DialogResult result3 = MessageBox.Show( dir2Delete, diff --git a/SourceCode/GPS/Forms/SaveOpen.Designer.cs b/SourceCode/GPS/Forms/SaveOpen.Designer.cs index efe875a77..e201ae5ee 100644 --- a/SourceCode/GPS/Forms/SaveOpen.Designer.cs +++ b/SourceCode/GPS/Forms/SaveOpen.Designer.cs @@ -27,7 +27,7 @@ public void ExportFieldAs_ISOXMLv3() //if (bnd.bndList.Count < 1) return;//If no Bnd, Quit //get the directory and make sure it exists, create if not - string directoryName = Path.Combine(fieldsDirectory, currentFieldDirectory, "zISOXML", "v3"); + string directoryName = Path.Combine(RegistrySettings.fieldsDirectory, currentFieldDirectory, "zISOXML", "v3"); if ((directoryName.Length > 0) && (!Directory.Exists(directoryName))) { Directory.CreateDirectory(directoryName); } @@ -222,7 +222,7 @@ public void ExportFieldAs_ISOXMLv4() int lineCounter = 0; //get the directory and make sure it exists, create if not - string directoryName = Path.Combine(fieldsDirectory, currentFieldDirectory, "zISOXML", "v4"); + string directoryName = Path.Combine(RegistrySettings.fieldsDirectory, currentFieldDirectory, "zISOXML", "v4"); if ((directoryName.Length > 0) && (!Directory.Exists(directoryName))) { Directory.CreateDirectory(directoryName); } @@ -469,7 +469,7 @@ public void ExportFieldAs_ISOXMLv4() public void FileSaveHeadLines() { - string directoryName = Path.Combine(fieldsDirectory, currentFieldDirectory); + string directoryName = Path.Combine(RegistrySettings.fieldsDirectory, currentFieldDirectory); if (!string.IsNullOrEmpty(directoryName) && (!Directory.Exists(directoryName))) { Directory.CreateDirectory(directoryName); } @@ -534,7 +534,7 @@ public void FileLoadHeadLines() hdl.tracksArr?.Clear(); //get the directory and make sure it exists, create if not - string directoryName = Path.Combine(fieldsDirectory, currentFieldDirectory); + string directoryName = Path.Combine(RegistrySettings.fieldsDirectory, currentFieldDirectory); if ((directoryName.Length > 0) && (!Directory.Exists(directoryName))) { Directory.CreateDirectory(directoryName); } @@ -620,7 +620,7 @@ public void FileLoadHeadLines() TimedMessageBox(2000, "Headline Error", "Lines Deleted"); - directoryName = Path.Combine(fieldsDirectory, currentFieldDirectory); + directoryName = Path.Combine(RegistrySettings.fieldsDirectory, currentFieldDirectory); if (!string.IsNullOrEmpty(directoryName) && (!Directory.Exists(directoryName))) { Directory.CreateDirectory(directoryName); } @@ -647,7 +647,7 @@ public void FileLoadHeadLines() public void FileSaveTracks() { - string directoryName = Path.Combine(fieldsDirectory, currentFieldDirectory); + string directoryName = Path.Combine(RegistrySettings.fieldsDirectory, currentFieldDirectory); if (!string.IsNullOrEmpty(directoryName) && (!Directory.Exists(directoryName))) { Directory.CreateDirectory(directoryName); } @@ -725,7 +725,7 @@ public void FileLoadTracks() trk.gArr?.Clear(); //get the directory and make sure it exists, create if not - string directoryName = Path.Combine(fieldsDirectory, currentFieldDirectory); + string directoryName = Path.Combine(RegistrySettings.fieldsDirectory, currentFieldDirectory); if ((directoryName.Length > 0) && (!Directory.Exists(directoryName))) { Directory.CreateDirectory(directoryName); } @@ -825,7 +825,7 @@ public void FileLoadTracks() public void FileSaveCurveLines() { - string directoryName = Path.Combine(fieldsDirectory, currentFieldDirectory); + string directoryName = Path.Combine(RegistrySettings.fieldsDirectory, currentFieldDirectory); if (!string.IsNullOrEmpty(directoryName) && (!Directory.Exists(directoryName))) { Directory.CreateDirectory(directoryName); } @@ -882,7 +882,7 @@ public void FileSaveCurveLines() public void FileLoadCurveLines() { //get the directory and make sure it exists, create if not - string directoryName = Path.Combine(fieldsDirectory, currentFieldDirectory); + string directoryName = Path.Combine(RegistrySettings.fieldsDirectory, currentFieldDirectory); if ((directoryName.Length > 0) && (!Directory.Exists(directoryName))) { Directory.CreateDirectory(directoryName); } @@ -989,7 +989,7 @@ public void FileLoadCurveLines() public void FileSaveABLines() { //make sure at least a global blank AB Line file exists - string directoryName = Path.Combine(fieldsDirectory, currentFieldDirectory); + string directoryName = Path.Combine(RegistrySettings.fieldsDirectory, currentFieldDirectory); //get the file of previous AB Lines if (!string.IsNullOrEmpty(directoryName) && (!Directory.Exists(directoryName))) @@ -1023,7 +1023,7 @@ public void FileSaveABLines() public void FileLoadABLines() { //make sure at least a global blank AB Line file exists - string directoryName = Path.Combine(fieldsDirectory, currentFieldDirectory); + string directoryName = Path.Combine(RegistrySettings.fieldsDirectory, currentFieldDirectory); if (!string.IsNullOrEmpty(directoryName) && (!Directory.Exists(directoryName))) { Directory.CreateDirectory(directoryName); } @@ -1105,7 +1105,7 @@ public void FileOpenField(string _openType) case "Resume": { //Either exit or update running save - fileAndDirectory = Path.Combine(fieldsDirectory, currentFieldDirectory, "Field.txt"); + fileAndDirectory = Path.Combine(RegistrySettings.fieldsDirectory, currentFieldDirectory, "Field.txt"); if (!File.Exists(fileAndDirectory)) fileAndDirectory = "Cancel"; break; } @@ -1116,7 +1116,7 @@ public void FileOpenField(string _openType) OpenFileDialog ofd = new OpenFileDialog(); //the initial directory, fields, for the open dialog - ofd.InitialDirectory = fieldsDirectory; + ofd.InitialDirectory = RegistrySettings.fieldsDirectory; //When leaving dialog put windows back where it was ofd.RestoreDirectory = true; @@ -1223,7 +1223,7 @@ public void FileOpenField(string _openType) //section patches - fileAndDirectory = Path.Combine(fieldsDirectory, currentFieldDirectory, "Sections.txt"); + fileAndDirectory = Path.Combine(RegistrySettings.fieldsDirectory, currentFieldDirectory, "Sections.txt"); if (!File.Exists(fileAndDirectory)) { TimedMessageBox(2000, gStr.gsMissingSectionFile, gStr.gsButFieldIsLoaded); @@ -1298,7 +1298,7 @@ public void FileOpenField(string _openType) if (isv3) { //Append the current list to the field file - using (StreamWriter writer = new StreamWriter(Path.Combine(fieldsDirectory, currentFieldDirectory, "Sections.txt"), false)) + using (StreamWriter writer = new StreamWriter(Path.Combine(RegistrySettings.fieldsDirectory, currentFieldDirectory, "Sections.txt"), false)) { } } @@ -1306,7 +1306,7 @@ public void FileOpenField(string _openType) // Contour points ---------------------------------------------------------------------------- - fileAndDirectory = Path.Combine(fieldsDirectory, currentFieldDirectory, "Contour.txt"); + fileAndDirectory = Path.Combine(RegistrySettings.fieldsDirectory, currentFieldDirectory, "Contour.txt"); if (!File.Exists(fileAndDirectory)) { TimedMessageBox(2000, gStr.gsMissingContourFile, gStr.gsButFieldIsLoaded); @@ -1361,7 +1361,7 @@ public void FileOpenField(string _openType) // Flags ------------------------------------------------------------------------------------------------- //Either exit or update running save - fileAndDirectory = Path.Combine(fieldsDirectory, currentFieldDirectory, "Flags.txt"); + fileAndDirectory = Path.Combine(RegistrySettings.fieldsDirectory, currentFieldDirectory, "Flags.txt"); if (!File.Exists(fileAndDirectory)) { TimedMessageBox(2000, gStr.gsMissingFlagsFile, gStr.gsButFieldIsLoaded); @@ -1437,7 +1437,7 @@ public void FileOpenField(string _openType) //Boundaries //Either exit or update running save - fileAndDirectory = Path.Combine(fieldsDirectory, currentFieldDirectory, "Boundary.txt"); + fileAndDirectory = Path.Combine(RegistrySettings.fieldsDirectory, currentFieldDirectory, "Boundary.txt"); if (!File.Exists(fileAndDirectory)) { TimedMessageBox(2000, gStr.gsMissingBoundaryFile, gStr.gsButFieldIsLoaded); @@ -1531,7 +1531,7 @@ public void FileOpenField(string _openType) } // Headland ------------------------------------------------------------------------------------------------- - fileAndDirectory = Path.Combine(fieldsDirectory, currentFieldDirectory, "Headland.txt"); + fileAndDirectory = Path.Combine(RegistrySettings.fieldsDirectory, currentFieldDirectory, "Headland.txt"); if (File.Exists(fileAndDirectory)) { @@ -1599,7 +1599,7 @@ public void FileOpenField(string _openType) btnHydLift.Visible = (((sett & 2) == 2) && bnd.isHeadlandOn); //trams --------------------------------------------------------------------------------- - fileAndDirectory = Path.Combine(fieldsDirectory, currentFieldDirectory, "Tram.txt"); + fileAndDirectory = Path.Combine(RegistrySettings.fieldsDirectory, currentFieldDirectory, "Tram.txt"); tram.tramBndOuterArr?.Clear(); tram.tramBndInnerArr?.Clear(); @@ -1696,16 +1696,16 @@ public void FileOpenField(string _openType) } } - //if (Directory.Exists(fieldsDirectory + currentFieldDirectory)) + //if (Directory.Exists(RegistrySettings.fieldsDirectory + currentFieldDirectory)) //{ - // foreach (string file in Directory.GetFiles(fieldsDirectory + currentFieldDirectory, "*.shp", SearchOption.TopDirectoryOnly)) + // foreach (string file in Directory.GetFiles(RegistrySettings.fieldsDirectory + currentFieldDirectory, "*.shp", SearchOption.TopDirectoryOnly)) // { - // shape.Main(fieldsDirectory + currentFieldDirectory + "\\" + Path.GetFileNameWithoutExtension(file)); + // shape.Main(RegistrySettings.fieldsDirectory + currentFieldDirectory + "\\" + Path.GetFileNameWithoutExtension(file)); // } //} //Recorded Path - fileAndDirectory = Path.Combine(fieldsDirectory, currentFieldDirectory, "RecPath.txt"); + fileAndDirectory = Path.Combine(RegistrySettings.fieldsDirectory, currentFieldDirectory, "RecPath.txt"); if (File.Exists(fileAndDirectory)) { using (StreamReader reader = new StreamReader(fileAndDirectory)) @@ -1752,7 +1752,7 @@ public void FileOpenField(string _openType) worldGrid.isGeoMap = false; //Back Image - fileAndDirectory = Path.Combine(fieldsDirectory, currentFieldDirectory, "BackPic.txt"); + fileAndDirectory = Path.Combine(RegistrySettings.fieldsDirectory, currentFieldDirectory, "BackPic.txt"); if (File.Exists(fileAndDirectory)) { using (StreamReader reader = new StreamReader(fileAndDirectory)) @@ -1781,7 +1781,7 @@ public void FileOpenField(string _openType) if (worldGrid.isGeoMap) { - fileAndDirectory = Path.Combine(fieldsDirectory, currentFieldDirectory, "BackPic.png"); + fileAndDirectory = Path.Combine(RegistrySettings.fieldsDirectory, currentFieldDirectory, "BackPic.png"); if (File.Exists(fileAndDirectory)) { var bitmap = new Bitmap(Image.FromFile(fileAndDirectory)); @@ -1824,7 +1824,7 @@ public void FileCreateField() string myFileName; //get the directory and make sure it exists, create if not - string directoryName = Path.Combine(fieldsDirectory, currentFieldDirectory); + string directoryName = Path.Combine(RegistrySettings.fieldsDirectory, currentFieldDirectory); if ((directoryName.Length > 0) && (!Directory.Exists(directoryName))) { Directory.CreateDirectory(directoryName); } @@ -1869,7 +1869,7 @@ public void FileCreateElevation() string myFileName; //get the directory and make sure it exists, create if not - string directoryName = Path.Combine(fieldsDirectory, currentFieldDirectory); + string directoryName = Path.Combine(RegistrySettings.fieldsDirectory, currentFieldDirectory); if ((directoryName.Length > 0) && (!Directory.Exists(directoryName))) { Directory.CreateDirectory(directoryName); } @@ -1905,7 +1905,7 @@ public void FileSaveSections() if (patchSaveList.Count() > 0) { //Append the current list to the field file - using (StreamWriter writer = new StreamWriter(Path.Combine(fieldsDirectory, currentFieldDirectory, "Sections.txt"), true)) + using (StreamWriter writer = new StreamWriter(Path.Combine(RegistrySettings.fieldsDirectory, currentFieldDirectory, "Sections.txt"), true)) { //for each patch, write out the list of triangles to the file foreach (var triList in patchSaveList) @@ -1933,7 +1933,7 @@ public void FileCreateSections() //10.1728031317344,0.723157039771303 -easting, northing //get the directory and make sure it exists, create if not - string directoryName = Path.Combine(fieldsDirectory, currentFieldDirectory); + string directoryName = Path.Combine(RegistrySettings.fieldsDirectory, currentFieldDirectory); if ((directoryName.Length > 0) && (!Directory.Exists(directoryName))) { Directory.CreateDirectory(directoryName); } @@ -1955,7 +1955,7 @@ public void FileCreateBoundary() //10.1728031317344,0.723157039771303 -easting, northing //get the directory and make sure it exists, create if not - string directoryName = Path.Combine(fieldsDirectory, currentFieldDirectory); + string directoryName = Path.Combine(RegistrySettings.fieldsDirectory, currentFieldDirectory); if ((directoryName.Length > 0) && (!Directory.Exists(directoryName))) { Directory.CreateDirectory(directoryName); } @@ -1978,7 +1978,7 @@ public void FileCreateFlags() //10.1728031317344,0.723157039771303 -easting, northing //get the directory and make sure it exists, create if not - string directoryName = Path.Combine(fieldsDirectory, currentFieldDirectory); + string directoryName = Path.Combine(RegistrySettings.fieldsDirectory, currentFieldDirectory); if ((directoryName.Length > 0) && (!Directory.Exists(directoryName))) { Directory.CreateDirectory(directoryName); } @@ -2000,7 +2000,7 @@ public void FileCreateContour() //64.697,0.168,-21.654,0 - east, heading, north, altitude //get the directory and make sure it exists, create if not - string directoryName = Path.Combine(fieldsDirectory, currentFieldDirectory); + string directoryName = Path.Combine(RegistrySettings.fieldsDirectory, currentFieldDirectory); if ((directoryName.Length > 0) && (!Directory.Exists(directoryName))) { Directory.CreateDirectory(directoryName); } @@ -2024,7 +2024,7 @@ public void FileSaveContour() if (contourSaveList.Count() > 0) { //Append the current list to the field file - using (StreamWriter writer = new StreamWriter(Path.Combine(fieldsDirectory, currentFieldDirectory, "Contour.txt"), true)) + using (StreamWriter writer = new StreamWriter(Path.Combine(RegistrySettings.fieldsDirectory, currentFieldDirectory, "Contour.txt"), true)) { //for every new chunk of patch in the whole section @@ -2052,7 +2052,7 @@ public void FileSaveContour() public void FileSaveBoundary() { //get the directory and make sure it exists, create if not - string directoryName = Path.Combine(fieldsDirectory, currentFieldDirectory); + string directoryName = Path.Combine(RegistrySettings.fieldsDirectory, currentFieldDirectory); if ((directoryName.Length > 0) && (!Directory.Exists(directoryName))) { Directory.CreateDirectory(directoryName); } @@ -2082,7 +2082,7 @@ public void FileSaveBoundary() public void FileSaveTram() { //get the directory and make sure it exists, create if not - string directoryName = Path.Combine(fieldsDirectory, currentFieldDirectory); + string directoryName = Path.Combine(RegistrySettings.fieldsDirectory, currentFieldDirectory); if ((directoryName.Length > 0) && (!Directory.Exists(directoryName))) { Directory.CreateDirectory(directoryName); } @@ -2140,7 +2140,7 @@ public void FileSaveTram() public void FileSaveBackPic() { //get the directory and make sure it exists, create if not - string directoryName = Path.Combine(fieldsDirectory, currentFieldDirectory); + string directoryName = Path.Combine(RegistrySettings.fieldsDirectory, currentFieldDirectory); if ((directoryName.Length > 0) && (!Directory.Exists(directoryName))) { Directory.CreateDirectory(directoryName); } @@ -2173,7 +2173,7 @@ public void FileSaveBackPic() public void FileSaveHeadland() { //get the directory and make sure it exists, create if not - string directoryName = Path.Combine(fieldsDirectory, currentFieldDirectory); + string directoryName = Path.Combine(RegistrySettings.fieldsDirectory, currentFieldDirectory); if ((directoryName.Length > 0) && (!Directory.Exists(directoryName))) { Directory.CreateDirectory(directoryName); } @@ -2204,7 +2204,7 @@ public void FileSaveHeadland() public void FileCreateRecPath() { //get the directory and make sure it exists, create if not - string directoryName = Path.Combine(fieldsDirectory, currentFieldDirectory); + string directoryName = Path.Combine(RegistrySettings.fieldsDirectory, currentFieldDirectory); if ((directoryName.Length > 0) && (!Directory.Exists(directoryName))) { Directory.CreateDirectory(directoryName); } @@ -2224,12 +2224,12 @@ public void FileCreateRecPath() public void FileSaveRecPath(string name = "RecPath.Txt") { //get the directory and make sure it exists, create if not - string directoryName = Path.Combine(fieldsDirectory, currentFieldDirectory); + string directoryName = Path.Combine(RegistrySettings.fieldsDirectory, currentFieldDirectory); if ((directoryName.Length > 0) && (!Directory.Exists(directoryName))) { Directory.CreateDirectory(directoryName); } - //string fileAndDirectory = fieldsDirectory + currentFieldDirectory + "\\RecPath.txt"; + //string fileAndDirectory = RegistrySettings.fieldsDirectory + currentFieldDirectory + "\\RecPath.txt"; //if (!File.Exists(fileAndDirectory)) FileCreateRecPath(); //write out the file @@ -2258,7 +2258,7 @@ public void FileLoadRecPath() { string line; //Recorded Path - string fileAndDirectory = Path.Combine(fieldsDirectory, currentFieldDirectory, "RecPath.txt"); + string fileAndDirectory = Path.Combine(RegistrySettings.fieldsDirectory, currentFieldDirectory, "RecPath.txt"); if (File.Exists(fileAndDirectory)) { using (StreamReader reader = new StreamReader(fileAndDirectory)) @@ -2310,7 +2310,7 @@ public void FileSaveFlags() //533172,5927719,12 - offset easting, northing, zone //get the directory and make sure it exists, create if not - string directoryName = Path.Combine(fieldsDirectory, currentFieldDirectory); + string directoryName = Path.Combine(RegistrySettings.fieldsDirectory, currentFieldDirectory); if ((directoryName.Length > 0) && (!Directory.Exists(directoryName))) { Directory.CreateDirectory(directoryName); } @@ -2350,7 +2350,7 @@ public void FileSaveFlags() public void FileSaveSystemEvents() { - using (StreamWriter writer = new StreamWriter(Path.Combine(logsDirectory, "AgOpenGPS_Events_Log.txt"), true)) + using (StreamWriter writer = new StreamWriter(Path.Combine(RegistrySettings.logsDirectory, "AgOpenGPS_Events_Log.txt"), true)) { writer.Write(Log.sbEvents); } @@ -2368,7 +2368,7 @@ public void FileSaveSystemEvents() //save nmea sentences public void FileSaveElevation() { - using (StreamWriter writer = new StreamWriter(Path.Combine(fieldsDirectory, currentFieldDirectory, "Elevation.txt"), true)) + using (StreamWriter writer = new StreamWriter(Path.Combine(RegistrySettings.fieldsDirectory, currentFieldDirectory, "Elevation.txt"), true)) { writer.Write(sbGrid.ToString()); } @@ -2384,7 +2384,7 @@ public void FileSaveSingleFlagKML2(int flagNumber) pn.ConvertLocalToWGS84(flagPts[flagNumber - 1].northing, flagPts[flagNumber - 1].easting, out lat, out lon); //get the directory and make sure it exists, create if not - string directoryName = Path.Combine(fieldsDirectory, currentFieldDirectory); + string directoryName = Path.Combine(RegistrySettings.fieldsDirectory, currentFieldDirectory); if ((directoryName.Length > 0) && (!Directory.Exists(directoryName))) { Directory.CreateDirectory(directoryName); } @@ -2429,7 +2429,7 @@ public void FileSaveSingleFlagKML(int flagNumber) { //get the directory and make sure it exists, create if not - string directoryName = Path.Combine(fieldsDirectory, currentFieldDirectory); + string directoryName = Path.Combine(RegistrySettings.fieldsDirectory, currentFieldDirectory); if ((directoryName.Length > 0) && (!Directory.Exists(directoryName))) { Directory.CreateDirectory(directoryName); } @@ -2472,7 +2472,7 @@ public void FileSaveSingleFlagKML(int flagNumber) public void FileMakeKMLFromCurrentPosition(double lat, double lon) { //get the directory and make sure it exists, create if not - string directoryName = Path.Combine(fieldsDirectory, currentFieldDirectory); + string directoryName = Path.Combine(RegistrySettings.fieldsDirectory, currentFieldDirectory); if ((directoryName.Length > 0) && (!Directory.Exists(directoryName))) { Directory.CreateDirectory(directoryName); } @@ -2507,7 +2507,7 @@ public void FileMakeKMLFromCurrentPosition(double lat, double lon) public void ExportFieldAs_KML() { //get the directory and make sure it exists, create if not - string directoryName = Path.Combine(fieldsDirectory, currentFieldDirectory); + string directoryName = Path.Combine(RegistrySettings.fieldsDirectory, currentFieldDirectory); if ((directoryName.Length > 0) && (!Directory.Exists(directoryName))) { Directory.CreateDirectory(directoryName); } @@ -2823,7 +2823,7 @@ private void FileUpdateAllFieldsKML() { //get the directory and make sure it exists, create if not - string directoryName = fieldsDirectory; + string directoryName = RegistrySettings.fieldsDirectory; if ((directoryName.Length > 0) && (!Directory.Exists(directoryName))) { diff --git a/SourceCode/GPS/Forms/Settings/ConfigMenu.Designer.cs b/SourceCode/GPS/Forms/Settings/ConfigMenu.Designer.cs index f50f37a6a..a4fc9329e 100644 --- a/SourceCode/GPS/Forms/Settings/ConfigMenu.Designer.cs +++ b/SourceCode/GPS/Forms/Settings/ConfigMenu.Designer.cs @@ -72,7 +72,7 @@ private void UpdateSummary() lblNudgeDistance.Text = snapDist + mf.unitsInCm.ToString(); lblUnits.Text = mf.isMetric ? "Metric" : "Imperial"; - lblCurrentVehicle.Text = gStr.gsCurrent + ": "+ mf.vehicleFileName; + lblCurrentVehicle.Text = gStr.gsCurrent + ": "+ RegistrySettings.vehicleFileName; lblSummaryVehicleName.Text = lblCurrentVehicle.Text; lblTramWidth.Text = mf.isMetric ? diff --git a/SourceCode/GPS/Forms/Settings/ConfigVehicle.Designer.cs b/SourceCode/GPS/Forms/Settings/ConfigVehicle.Designer.cs index b83552e3a..f963a941a 100644 --- a/SourceCode/GPS/Forms/Settings/ConfigVehicle.Designer.cs +++ b/SourceCode/GPS/Forms/Settings/ConfigVehicle.Designer.cs @@ -24,7 +24,7 @@ private void btnVehicleLoad_Click(object sender, EventArgs e) if (!mf.isJobStarted) { //save current vehicle - SettingsIO.ExportAll(Path.Combine(mf.vehiclesDirectory, mf.vehicleFileName + ".XML")); + SettingsIO.ExportAll(Path.Combine(RegistrySettings.vehiclesDirectory, RegistrySettings.vehicleFileName + ".XML")); if (lvVehicles.SelectedItems.Count > 0) { @@ -37,11 +37,11 @@ private void btnVehicleLoad_Click(object sender, EventArgs e) if (result3 == DialogResult.Yes) { - bool success = SettingsIO.ImportAll(Path.Combine(mf.vehiclesDirectory, lvVehicles.SelectedItems[0].SubItems[0].Text + ".XML")); + bool success = SettingsIO.ImportAll(Path.Combine(RegistrySettings.vehiclesDirectory, lvVehicles.SelectedItems[0].SubItems[0].Text + ".XML")); if (!success) return; - mf.vehicleFileName = lvVehicles.SelectedItems[0].SubItems[0].Text; - Properties.Settings.Default.setVehicle_vehicleName = mf.vehicleFileName; + RegistrySettings.vehicleFileName = lvVehicles.SelectedItems[0].SubItems[0].Text; + Properties.Settings.Default.setVehicle_vehicleName = RegistrySettings.vehicleFileName; Properties.Settings.Default.Save(); RegistryKey key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\AgOpenGPS"); @@ -109,7 +109,7 @@ private void btnVehicleLoad_Click(object sender, EventArgs e) ///Remind the user mf.TimedMessageBox(2500, "Steer and Machine Settings Sent", "Were Modules Connected?"); - Log.EventWriter("Vehicle Loaded: " + mf.vehicleFileName + ".XML"); + Log.EventWriter("Vehicle Loaded: " + RegistrySettings.vehicleFileName + ".XML"); } UpdateVehicleListView(); @@ -132,7 +132,7 @@ private void btnVehicleDelete_Click(object sender, EventArgs e) if (lvVehicles.SelectedItems[0].SubItems[0].Text.Trim() != "Default Vehicle") { - if (lvVehicles.SelectedItems[0].SubItems[0].Text != mf.vehicleFileName) + if (lvVehicles.SelectedItems[0].SubItems[0].Text != RegistrySettings.vehicleFileName) { DialogResult result3 = MessageBox.Show( "Delete: " + lvVehicles.SelectedItems[0].SubItems[0].Text + ".XML", @@ -142,7 +142,7 @@ private void btnVehicleDelete_Click(object sender, EventArgs e) MessageBoxDefaultButton.Button2); if (result3 == DialogResult.Yes) { - File.Delete(Path.Combine(mf.vehiclesDirectory, lvVehicles.SelectedItems[0].SubItems[0].Text + ".XML")); + File.Delete(Path.Combine(RegistrySettings.vehiclesDirectory, lvVehicles.SelectedItems[0].SubItems[0].Text + ".XML")); } } else @@ -172,10 +172,10 @@ private void btnVehicleSave_Click(object sender, EventArgs e) if (tboxVehicleNameSave.Text.Trim().Length > 0) { - SettingsIO.ExportAll(Path.Combine(mf.vehiclesDirectory, tboxVehicleNameSave.Text.Trim() + ".XML")); + SettingsIO.ExportAll(Path.Combine(RegistrySettings.vehiclesDirectory, tboxVehicleNameSave.Text.Trim() + ".XML")); - mf.vehicleFileName = tboxVehicleNameSave.Text.Trim(); - Properties.Settings.Default.setVehicle_vehicleName = mf.vehicleFileName; + RegistrySettings.vehicleFileName = tboxVehicleNameSave.Text.Trim(); + Properties.Settings.Default.setVehicle_vehicleName = RegistrySettings.vehicleFileName; Properties.Settings.Default.Save(); RegistryKey key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\AgOpenGPS"); @@ -299,7 +299,7 @@ private void btnVehicleNewSave_Click(object sender, EventArgs e) if (tboxCreateNewVehicle.Text.Trim().Length > 0) { - SettingsIO.ExportAll(Path.Combine(mf.vehiclesDirectory, mf.vehicleFileName + ".XML")); + SettingsIO.ExportAll(Path.Combine(RegistrySettings.vehiclesDirectory, RegistrySettings.vehicleFileName + ".XML")); Settings.Default.Reset(); Settings.Default.Save(); @@ -308,7 +308,7 @@ private void btnVehicleNewSave_Click(object sender, EventArgs e) Properties.Settings.Default.Save(); - lblCurrentVehicle.Text = mf.vehicleFileName = Properties.Settings.Default.setVehicle_vehicleName; + lblCurrentVehicle.Text = RegistrySettings.vehicleFileName = Properties.Settings.Default.setVehicle_vehicleName; tboxCreateNewVehicle.Text = ""; LoadBrandImage(); @@ -372,9 +372,9 @@ private void btnVehicleNewSave_Click(object sender, EventArgs e) ///Remind the user mf.TimedMessageBox(2500, "Steer and Machine Settings Sent", "Were Modules Connected?"); - Log.EventWriter("New Vehicle Loaded: " + mf.vehicleFileName + ".XML"); + Log.EventWriter("New Vehicle Loaded: " + RegistrySettings.vehicleFileName + ".XML"); - SettingsIO.ExportAll(Path.Combine(mf.vehiclesDirectory, mf.vehicleFileName + ".XML")); + SettingsIO.ExportAll(Path.Combine(RegistrySettings.vehiclesDirectory, RegistrySettings.vehicleFileName + ".XML")); RegistryKey key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\AgOpenGPS"); key.SetValue("VehicleFileName", Properties.Settings.Default.setVehicle_vehicleName); @@ -393,7 +393,7 @@ public static string SanitizeFileName(string fileName) private void UpdateVehicleListView() { - DirectoryInfo dinfo = new DirectoryInfo(mf.vehiclesDirectory); + DirectoryInfo dinfo = new DirectoryInfo(RegistrySettings.vehiclesDirectory); FileInfo[] Files = dinfo.GetFiles("*.XML"); //load the listbox diff --git a/SourceCode/GPS/Forms/Settings/FormAllSettings.cs b/SourceCode/GPS/Forms/Settings/FormAllSettings.cs index 8001eb9f5..8e6bb24c0 100644 --- a/SourceCode/GPS/Forms/Settings/FormAllSettings.cs +++ b/SourceCode/GPS/Forms/Settings/FormAllSettings.cs @@ -167,8 +167,8 @@ private void btnCreatePNG_Click(object sender, EventArgs e) { Bitmap bm = new Bitmap(this.Width, this.Height); this.DrawToBitmap(bm, new Rectangle(0, 0, this.Width, this.Height)); - bm.Save(Path.Combine(mf.baseDirectory, "AllSet.PNG"), ImageFormat.Png); - System.Diagnostics.Process.Start("explorer.exe", mf.baseDirectory); + bm.Save(Path.Combine(RegistrySettings.baseDirectory, "AllSet.PNG"), ImageFormat.Png); + System.Diagnostics.Process.Start("explorer.exe", RegistrySettings.baseDirectory); Log.EventWriter("View All Settings to PNG"); Close(); } diff --git a/SourceCode/GPS/Forms/Settings/FormConfig.cs b/SourceCode/GPS/Forms/Settings/FormConfig.cs index d27b738ee..de8cadee1 100644 --- a/SourceCode/GPS/Forms/Settings/FormConfig.cs +++ b/SourceCode/GPS/Forms/Settings/FormConfig.cs @@ -137,7 +137,7 @@ private void FormConfig_FormClosing(object sender, FormClosingEventArgs e) mf.LoadSettings(); //save current vehicle - SettingsIO.ExportAll(Path.Combine(mf.vehiclesDirectory, mf.vehicleFileName + ".XML")); + SettingsIO.ExportAll(Path.Combine(RegistrySettings.vehiclesDirectory, RegistrySettings.vehicleFileName + ".XML")); } private void FixMinMaxSpinners() diff --git a/SourceCode/GPS/Forms/Settings/FormSteer.cs b/SourceCode/GPS/Forms/Settings/FormSteer.cs index 0e9cd369b..59617350a 100644 --- a/SourceCode/GPS/Forms/Settings/FormSteer.cs +++ b/SourceCode/GPS/Forms/Settings/FormSteer.cs @@ -309,7 +309,7 @@ private void FormSteer_FormClosing(object sender, FormClosingEventArgs e) Properties.Settings.Default.Save(); //save current vehicle - SettingsIO.ExportAll(Path.Combine(mf.vehiclesDirectory, mf.vehicleFileName + ".XML")); + SettingsIO.ExportAll(Path.Combine(RegistrySettings.vehiclesDirectory, RegistrySettings.vehicleFileName + ".XML")); } private void Timer1_Tick(object sender, EventArgs e) @@ -1188,7 +1188,7 @@ private void btnVehicleReset_Click(object sender, EventArgs e) Properties.Settings.Default.Save(); //save current vehicle - SettingsIO.ExportAll(Path.Combine(mf.vehiclesDirectory, mf.vehicleFileName + ".XML")); + SettingsIO.ExportAll(Path.Combine(RegistrySettings.vehiclesDirectory, RegistrySettings.vehicleFileName + ".XML")); mf.vehicle = new CVehicle(mf); diff --git a/SourceCode/GPS/Forms/Settings/FormSteerWiz.cs b/SourceCode/GPS/Forms/Settings/FormSteerWiz.cs index 0005aed17..41d5e1958 100644 --- a/SourceCode/GPS/Forms/Settings/FormSteerWiz.cs +++ b/SourceCode/GPS/Forms/Settings/FormSteerWiz.cs @@ -246,7 +246,7 @@ private void FormSteer_FormClosing(object sender, FormClosingEventArgs e) Properties.Settings.Default.Save(); //save current vehicle - SettingsIO.ExportAll(Path.Combine(mf.vehiclesDirectory, mf.vehicleFileName + ".XML")); + SettingsIO.ExportAll(Path.Combine(RegistrySettings.vehiclesDirectory, RegistrySettings.vehicleFileName + ".XML")); } private void Timer1_Tick(object sender, EventArgs e) @@ -597,7 +597,7 @@ private void btnLoadDefaults_Click(object sender, EventArgs e) counter251 = 2; //save current vehicle - SettingsIO.ExportAll(Path.Combine(mf.vehiclesDirectory, mf.vehicleFileName + ".XML")); + SettingsIO.ExportAll(Path.Combine(RegistrySettings.vehiclesDirectory, RegistrySettings.vehicleFileName + ".XML")); FormSteer_Load(this, e); } diff --git a/SourceCode/GPS/Program.cs b/SourceCode/GPS/Program.cs index aa4c93fce..37bba026a 100644 --- a/SourceCode/GPS/Program.cs +++ b/SourceCode/GPS/Program.cs @@ -18,112 +18,21 @@ internal static class Program [STAThread] private static void Main() { - //opening the subkey - RegistryKey regKey = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\AgOpenGPS"); - - ////create default keys if not existing - if (regKey == null) - { - RegistryKey Key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\AgOpenGPS"); - - //storing the values - Key.SetValue("Language", "en"); - Key.SetValue("VehicleFileName", "Default Vehicle"); - Key.SetValue("WorkingDirectory", "Default"); - Key.Close(); - } - - //Base Directory Registry Key - regKey = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\AgOpenGPS"); - - if (regKey.GetValue("WorkingDirectory") == null) - { - RegistryKey key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\AgOpenGPS"); - key.SetValue("WorkingDirectory", "Default"); - key.Close(); - } - string workingDirectory = regKey.GetValue("WorkingDirectory").ToString(); - string baseDirectory; - - - if (workingDirectory == "Default") - { - baseDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "AgOpenGPS"); - } - else //user set to other - { - baseDirectory = Path.Combine(workingDirectory, "AgOpenGPS"); - } - - //Vehicle File Name Registry Key - if (regKey.GetValue("VehicleFileName") == null) - { - RegistryKey key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\AgOpenGPS"); - key.SetValue("VehicleFileName", "Default Vehicle"); - key.Close(); - } - - string vehicleFileName = regKey.GetValue("VehicleFileName").ToString(); - - //Language Registry Key - if (regKey.GetValue("Language") == null) - { - RegistryKey key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\AgOpenGPS"); - key.SetValue("Language", "en"); - key.Close(); - } - - string language = regKey.GetValue("Language").ToString(); - - regKey.Close(); - - //get the fields directory, if not exist, create - string vehiclesDirectory = Path.Combine(baseDirectory, "Vehicles"); - if (!string.IsNullOrEmpty(vehiclesDirectory) && !Directory.Exists(vehiclesDirectory)) - { - Directory.CreateDirectory(vehiclesDirectory); - } - //reset to default Vehicle and save Settings.Default.Reset(); Settings.Default.Save(); + + RegistrySettings.Load(); - //what's in the vehicle directory - DirectoryInfo dinfo = new DirectoryInfo(vehiclesDirectory); - FileInfo[] vehicleFiles = dinfo.GetFiles("*.xml"); - - bool isVehicleExist = false; - - foreach (FileInfo file in vehicleFiles) - { - string temp = Path.GetFileNameWithoutExtension(file.Name).Trim(); - - if (temp == vehicleFileName) - { - isVehicleExist = true; - } - } - - //does current vehicle exist? - if (isVehicleExist && vehicleFileName != "Default Vehicle") - { - SettingsIO.ImportAll(Path.Combine(vehiclesDirectory, vehicleFileName + ".XML")); - } - else - { - vehicleFileName = "Default Vehicle"; - Log.EventWriter("Vehicle file does not exist, Default Vehicle selected"); - } - - Properties.Settings.Default.setF_culture = language; - Properties.Settings.Default.setF_workingDirectory = workingDirectory; - Properties.Settings.Default.setVehicle_vehicleName = vehicleFileName; + Properties.Settings.Default.setF_culture = RegistrySettings.culture; + Properties.Settings.Default.setF_workingDirectory = RegistrySettings.workingDirectory; + Properties.Settings.Default.setVehicle_vehicleName = RegistrySettings.vehicleFileName; Properties.Settings.Default.Save(); if (Mutex.WaitOne(TimeSpan.Zero, true)) { - Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(language); - Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(language); + Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(RegistrySettings.culture); + Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(RegistrySettings.culture); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new FormGPS()); From b6ddf9787a6c01b085216686e285caf39dc99c8e Mon Sep 17 00:00:00 2001 From: BrianTee Date: Sun, 5 Jan 2025 14:07:19 -0700 Subject: [PATCH 2/4] Registry Settings AOG --- SourceCode/AgIO/Source/Classes/CSettings.cs | 3 + SourceCode/GPS/Classes/CSettings.cs | 142 +++++++++++------- SourceCode/GPS/Forms/Controls.Designer.cs | 50 +++--- SourceCode/GPS/Forms/FormGPS.cs | 20 +-- SourceCode/GPS/Forms/Inputs/FormKeyboard.cs | 3 +- SourceCode/GPS/Forms/SaveOpen.Designer.cs | 1 + .../Forms/Settings/ConfigVehicle.Designer.cs | 32 ++-- .../GPS/Forms/Settings/FormAllSettings.cs | 2 +- SourceCode/GPS/Forms/Settings/FormConfig.cs | 2 +- SourceCode/GPS/Forms/Settings/FormSteer.cs | 4 +- SourceCode/GPS/Forms/Settings/FormSteerWiz.cs | 4 +- 11 files changed, 141 insertions(+), 122 deletions(-) diff --git a/SourceCode/AgIO/Source/Classes/CSettings.cs b/SourceCode/AgIO/Source/Classes/CSettings.cs index 040c4dc94..bf51dd12b 100644 --- a/SourceCode/AgIO/Source/Classes/CSettings.cs +++ b/SourceCode/AgIO/Source/Classes/CSettings.cs @@ -212,10 +212,13 @@ public static void Save() public static void Reset() { + Registry.CurrentUser.DeleteSubKeyTree(@"SOFTWARE\AgIO"); + RegistryKey key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\AgIO"); try { key.SetValue("ProfileName", "Default Profile"); + key.SetValue("Language", "en"); Log.EventWriter("Registry -> Resetting Registry keys"); } catch (Exception ex) diff --git a/SourceCode/GPS/Classes/CSettings.cs b/SourceCode/GPS/Classes/CSettings.cs index be8a60429..30026bd86 100644 --- a/SourceCode/GPS/Classes/CSettings.cs +++ b/SourceCode/GPS/Classes/CSettings.cs @@ -339,57 +339,16 @@ public static void Load() Reset(); } - //get the vehicles directory, if not exist, create - try - { - vehiclesDirectory = Path.Combine(baseDirectory, "Vehicles"); - if (!string.IsNullOrEmpty(vehiclesDirectory) && !Directory.Exists(vehiclesDirectory)) - { - Directory.CreateDirectory(vehiclesDirectory); - } - } - catch (Exception ex) - { - Log.EventWriter("Catch, Serious Problem Making Vehicles Directory: " + ex.ToString()); - } - - //get the fields directory, if not exist, create - try - { - fieldsDirectory = Path.Combine(baseDirectory, "Fields"); - if (!string.IsNullOrEmpty(fieldsDirectory) && !Directory.Exists(fieldsDirectory)) - { - Directory.CreateDirectory(fieldsDirectory); - Log.EventWriter("Fields Dir Created"); - } - } - catch (Exception ex) - { - Log.EventWriter("Catch, Serious Problem Making Fields Directory: " + ex.ToString()); - } - - //get the logs directory, if not exist, create - try - { - logsDirectory = Path.Combine(baseDirectory, "Logs"); - if (!string.IsNullOrEmpty(logsDirectory) && !Directory.Exists(logsDirectory)) - { - Directory.CreateDirectory(logsDirectory); - Log.EventWriter("Logs Dir Created"); - } - } - catch (Exception ex) - { - Log.EventWriter("Catch, Serious Problem Making Logs Directory: " + ex.ToString()); - } + //make sure directories exist and are in right place if not default workingDir + CreateDirectories(); //keep below 500 kb - Log.CheckLogSize(Path.Combine(logsDirectory, "AgIO_Events_Log.txt"), 500000); + Log.CheckLogSize(Path.Combine(logsDirectory, "AgOpenGPS_Events_Log.txt"), 500000); //what's in the vehicle directory try { - DirectoryInfo dinfo = new DirectoryInfo(RegistrySettings.vehiclesDirectory); + DirectoryInfo dinfo = new DirectoryInfo(vehiclesDirectory); FileInfo[] vehicleFiles = dinfo.GetFiles("*.xml"); bool isVehicleExist = false; @@ -417,10 +376,10 @@ public static void Load() } catch (Exception ex) { - Log.EventWriter("Registry -> Catch, Serious Problem Loading Profile, Doing Registry Reset: " + ex.ToString()); + Log.EventWriter("Registry -> Catch, Serious Problem Loading Vehicle, Doing Registry Reset: " + ex.ToString()); Reset(); - //reset to Default Profile and save + //reset to Default Vehicle and save Settings.Default.Reset(); Settings.Default.Save(); } @@ -428,10 +387,13 @@ public static void Load() public static void Save() { - RegistryKey key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\AgIO"); + RegistryKey key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\AgOpenGPS"); try { - key.SetValue("ProfileName", vehicleFileName); + key.SetValue("VehicleFileName", vehicleFileName); + key.SetValue("Language", culture); + key.SetValue("WorkingDirectory", workingDirectory); + Log.EventWriter(vehicleFileName + " Saved to registry key"); } catch (Exception ex) @@ -440,8 +402,22 @@ public static void Save() } key.Close(); - //if (RegistrySettings.vehicleFileName != "Default Profile") - // SettingsIO.ExportSettings(Path.Combine(RegistrySettings.vehiclesDirectory, RegistrySettings.vehicleFileName + ".xml")); + try + { + if (vehicleFileName != "Default Vehicle") + { + SettingsIO.ExportAll(Path.Combine(vehiclesDirectory, vehicleFileName + ".xml")); + //Log.EventWriter(vehicleFileName + ".XML Saved to Vehicles"); + } + else + { + //Log.EventWriter("Default Vehicle Not saved to Vehicles"); + } + } + catch (Exception ex) + { + Log.EventWriter("Registry -> Catch, Unable to save Vehicle FileName: " + ex.ToString()); + } } public static void Reset() @@ -457,12 +433,74 @@ public static void Reset() key.SetValue("WorkingDirectory", "Default"); key.Close(); - Log.EventWriter("Registry -> Resetting Registry SubKey Tree"); + Log.EventWriter("Registry -> Resetting Registry SubKey Tree and Full Default Reset"); + + culture = "en"; + vehiclesDirectory = + Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "AgOpenGPS", "Vehicles"); + logsDirectory = + Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "AgOpenGPS", "Logs"); + vehicleFileName = "Default Vehicle"; + workingDirectory = "Default"; + baseDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "AgOpenGPS"); + fieldsDirectory = Path.Combine(baseDirectory, "Fields"); + + CreateDirectories(); + + + } catch (Exception ex) { Log.EventWriter("\"Registry -> Catch, Serious Problem Resetting Registry keys: " + ex.ToString()); } } + + public static void CreateDirectories() + { + //get the vehicles directory, if not exist, create + try + { + vehiclesDirectory = Path.Combine(baseDirectory, "Vehicles"); + if (!string.IsNullOrEmpty(vehiclesDirectory) && !Directory.Exists(vehiclesDirectory)) + { + Directory.CreateDirectory(vehiclesDirectory); + Log.EventWriter("Vehicles Dir Created"); + } + } + catch (Exception ex) + { + Log.EventWriter("Catch, Serious Problem Making Vehicles Directory: " + ex.ToString()); + } + + //get the fields directory, if not exist, create + try + { + fieldsDirectory = Path.Combine(baseDirectory, "Fields"); + if (!string.IsNullOrEmpty(fieldsDirectory) && !Directory.Exists(fieldsDirectory)) + { + Directory.CreateDirectory(fieldsDirectory); + Log.EventWriter("Fields Dir Created"); + } + } + catch (Exception ex) + { + Log.EventWriter("Catch, Serious Problem Making Fields Directory: " + ex.ToString()); + } + + //get the logs directory, if not exist, create + try + { + if (!string.IsNullOrEmpty(logsDirectory) && !Directory.Exists(logsDirectory)) + { + Directory.CreateDirectory(logsDirectory); + Log.EventWriter("Logs Dir Created"); + } + } + catch (Exception ex) + { + Log.EventWriter("Catch, Serious Problem Making Logs Directory: " + ex.ToString()); + } + } } } \ No newline at end of file diff --git a/SourceCode/GPS/Forms/Controls.Designer.cs b/SourceCode/GPS/Forms/Controls.Designer.cs index 457731d51..6eb1d75dc 100644 --- a/SourceCode/GPS/Forms/Controls.Designer.cs +++ b/SourceCode/GPS/Forms/Controls.Designer.cs @@ -731,7 +731,7 @@ private void btnJobMenu_Click(object sender, EventArgs e) } Log.EventWriter("** Opened ** " + currentFieldDirectory + " " - + (DateTime.Now.ToString("f", CultureInfo.CreateSpecificCulture(Settings.Default.setF_culture)))); + + (DateTime.Now.ToString("f", CultureInfo.CreateSpecificCulture(RegistrySettings.culture)))); } } @@ -780,7 +780,7 @@ public void FileSaveEverythingBeforeClosingField() ExportFieldAs_ISOXMLv4(); Log.EventWriter("** Closed ** " + currentFieldDirectory + " " - + DateTime.Now.ToString("f", CultureInfo.CreateSpecificCulture(Settings.Default.setF_culture))); + + DateTime.Now.ToString("f", CultureInfo.CreateSpecificCulture(RegistrySettings.culture))); Settings.Default.setF_CurrentDir = currentFieldDirectory; Settings.Default.Save(); @@ -1432,16 +1432,19 @@ private void setWorkingDirectoryToolStripMenuItem_Click(object sender, EventArgs if (fbd.SelectedPath != Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)) { Settings.Default.setF_workingDirectory = fbd.SelectedPath; + RegistrySettings.workingDirectory = Settings.Default.setF_workingDirectory; + RegistrySettings.baseDirectory = Path.Combine(RegistrySettings.workingDirectory, "AgOpenGPS"); + RegistrySettings.fieldsDirectory = Path.Combine(RegistrySettings.workingDirectory, "AgOpenGPS", "Fields"); + RegistrySettings.CreateDirectories(); } else { Settings.Default.setF_workingDirectory = "Default"; + RegistrySettings.workingDirectory = "Default"; } Settings.Default.Save(); - RegistryKey key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\AgOpenGPS"); - key.SetValue("WorkingDirectory", Settings.Default.setF_workingDirectory); - key.Close(); + RegistrySettings.Save(); //restart program MessageBox.Show(gStr.gsProgramWillExitPleaseRestart); @@ -1538,20 +1541,6 @@ private void resetALLToolStripMenuItem_Click(object sender, EventArgs e) if (result2 == DialogResult.Yes) { - RegistryKey Key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\AgOpenGPS"); - - //storing the values - Key.SetValue("Language", "en"); - Key.SetValue("VehicleFileName", "Default Vehicle"); - Key.SetValue("WorkingDirectory", "Default"); - Key.Close(); - - RegistrySettings.vehicleFileName = "Default Vehicle"; - - Settings.Default.Reset(); - Settings.Default.Save(); - - //save events this sessiom FileSaveSystemEvents(); Log.sbEvents.Clear(); @@ -1561,8 +1550,13 @@ private void resetALLToolStripMenuItem_Click(object sender, EventArgs e) Log.EventWriter("*****"); FileSaveSystemEvents(); + RegistrySettings.Reset(); + + Settings.Default.Reset(); + Settings.Default.Save(); + MessageBox.Show(gStr.gsProgramWillExitPleaseRestart); - System.Environment.Exit(1); + Close(); } } } @@ -1631,7 +1625,7 @@ private void colorsToolStripMenuItem_Click(object sender, EventArgs e) { form.ShowDialog(this); } - SettingsIO.ExportAll(Path.Combine(RegistrySettings.vehiclesDirectory, RegistrySettings.vehicleFileName + ".XML")); + RegistrySettings.Save(); } private void colorsSectionToolStripMenuItem_Click(object sender, EventArgs e) { @@ -1641,7 +1635,7 @@ private void colorsSectionToolStripMenuItem_Click(object sender, EventArgs e) { form.ShowDialog(this); } - SettingsIO.ExportAll(Path.Combine(RegistrySettings.vehiclesDirectory, RegistrySettings.vehicleFileName + ".XML")); + RegistrySettings.Save(); } else { @@ -1842,16 +1836,10 @@ private void SetLanguage(string lang, bool Restart) break; } - Settings.Default.setF_culture = lang; - Settings.Default.Save(); - - //adding or editing "Language" subkey to the "SOFTWARE" subkey - RegistryKey key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\AgOpenGPS"); - - //storing the values - key.SetValue("Language", lang); - key.Close(); + RegistrySettings.culture = lang; + RegistrySettings.Save(); + if (Restart) { MessageBox.Show(gStr.gsProgramWillExitPleaseRestart); diff --git a/SourceCode/GPS/Forms/FormGPS.cs b/SourceCode/GPS/Forms/FormGPS.cs index 3d7f42e25..61f07ec22 100644 --- a/SourceCode/GPS/Forms/FormGPS.cs +++ b/SourceCode/GPS/Forms/FormGPS.cs @@ -393,7 +393,7 @@ private void FormGPS_Load(object sender, EventArgs e) this.MouseWheel += ZoomByMouseWheel; Log.EventWriter("Program Started: " - + DateTime.Now.ToString("f", CultureInfo.CreateSpecificCulture(Settings.Default.setF_culture))); + + DateTime.Now.ToString("f", CultureInfo.CreateSpecificCulture(RegistrySettings.culture))); Log.EventWriter("AOG Version: " + Application.ProductVersion.ToString(CultureInfo.InvariantCulture)); //The way we subscribe to the System Event to check when Power Mode has changed. @@ -415,7 +415,7 @@ private void FormGPS_Load(object sender, EventArgs e) panelSim.Top = Height - 60; //set the language to last used - SetLanguage(Settings.Default.setF_culture, false); + SetLanguage(RegistrySettings.culture, false); //make sure current field directory exists, null if not currentFieldDirectory = Settings.Default.setF_CurrentDir; @@ -558,11 +558,8 @@ private void FormGPS_Load(object sender, EventArgs e) YesMessageBox("Using Default Vehicle" + "\r\n\r\n" + "Load Existing Vehicle or Save As a New One !!!" + "\r\n\r\n" + "Changes will NOT be Saved for Default Vehicle"); - SettingsIO.ExportAll(Path.Combine(RegistrySettings.vehiclesDirectory, "Default Vehicle.xml")); - - RegistryKey key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\AgOpenGPS"); - key.SetValue("VehicleFileName", Properties.Settings.Default.setVehicle_vehicleName); - key.Close(); + //Doesn't save Default Vehicle + RegistrySettings.Save(); using (FormConfig form = new FormConfig(this)) { @@ -638,18 +635,13 @@ private void FormGPS_FormClosing(object sender, FormClosingEventArgs e) Log.EventWriter("Missed Sentence Counter Total: " + missedSentenceCount.ToString()); - Log.EventWriter("Program Exit: " + DateTime.Now.ToString("f", CultureInfo.CreateSpecificCulture(Settings.Default.setF_culture)) + "\r"); + Log.EventWriter("Program Exit: " + DateTime.Now.ToString("f", CultureInfo.CreateSpecificCulture(RegistrySettings.culture)) + "\r"); //write the log file FileSaveSystemEvents(); //save current vehicle - SettingsIO.ExportAll(Path.Combine(RegistrySettings.vehiclesDirectory, RegistrySettings.vehicleFileName + ".XML")); - - RegistryKey key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\AgOpenGPS"); - key.SetValue("VehicleFileName", Properties.Settings.Default.setVehicle_vehicleName); - key.SetValue("WorkingDirectory", Properties.Settings.Default.setF_workingDirectory); - key.Close(); + RegistrySettings.Save(); if (displayBrightness.isWmiMonitor) displayBrightness.SetBrightness(Settings.Default.setDisplay_brightnessSystem); diff --git a/SourceCode/GPS/Forms/Inputs/FormKeyboard.cs b/SourceCode/GPS/Forms/Inputs/FormKeyboard.cs index fc67af542..3957bbe85 100644 --- a/SourceCode/GPS/Forms/Inputs/FormKeyboard.cs +++ b/SourceCode/GPS/Forms/Inputs/FormKeyboard.cs @@ -24,8 +24,7 @@ private void FormKeyboard_Load(object sender, EventArgs e) keyboardString.SelectionLength = 0; keyboard1.Focus(); - string language = Properties.Settings.Default.setF_culture; - if (language == "fr") + if (RegistrySettings.culture == "fr") { this.Height = 575; } diff --git a/SourceCode/GPS/Forms/SaveOpen.Designer.cs b/SourceCode/GPS/Forms/SaveOpen.Designer.cs index e201ae5ee..9b21d3c18 100644 --- a/SourceCode/GPS/Forms/SaveOpen.Designer.cs +++ b/SourceCode/GPS/Forms/SaveOpen.Designer.cs @@ -2353,6 +2353,7 @@ public void FileSaveSystemEvents() using (StreamWriter writer = new StreamWriter(Path.Combine(RegistrySettings.logsDirectory, "AgOpenGPS_Events_Log.txt"), true)) { writer.Write(Log.sbEvents); + Log.sbEvents.Clear(); } } diff --git a/SourceCode/GPS/Forms/Settings/ConfigVehicle.Designer.cs b/SourceCode/GPS/Forms/Settings/ConfigVehicle.Designer.cs index f963a941a..a278b58c8 100644 --- a/SourceCode/GPS/Forms/Settings/ConfigVehicle.Designer.cs +++ b/SourceCode/GPS/Forms/Settings/ConfigVehicle.Designer.cs @@ -24,12 +24,12 @@ private void btnVehicleLoad_Click(object sender, EventArgs e) if (!mf.isJobStarted) { //save current vehicle - SettingsIO.ExportAll(Path.Combine(RegistrySettings.vehiclesDirectory, RegistrySettings.vehicleFileName + ".XML")); + RegistrySettings.Save(); if (lvVehicles.SelectedItems.Count > 0) { DialogResult result3 = MessageBox.Show( - "Load: " + lvVehicles.SelectedItems[0].SubItems[0].Text + ".XML", + "Open: " + lvVehicles.SelectedItems[0].SubItems[0].Text + ".XML ?", gStr.gsSaveAndReturn, MessageBoxButtons.YesNo, MessageBoxIcon.Question, @@ -44,9 +44,7 @@ private void btnVehicleLoad_Click(object sender, EventArgs e) Properties.Settings.Default.setVehicle_vehicleName = RegistrySettings.vehicleFileName; Properties.Settings.Default.Save(); - RegistryKey key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\AgOpenGPS"); - key.SetValue("VehicleFileName", Properties.Settings.Default.setVehicle_vehicleName); - key.Close(); + RegistrySettings.Save(); LoadBrandImage(); @@ -110,6 +108,7 @@ private void btnVehicleLoad_Click(object sender, EventArgs e) mf.TimedMessageBox(2500, "Steer and Machine Settings Sent", "Were Modules Connected?"); Log.EventWriter("Vehicle Loaded: " + RegistrySettings.vehicleFileName + ".XML"); + } UpdateVehicleListView(); @@ -168,19 +167,23 @@ private void btnVehicleSave_Click(object sender, EventArgs e) btnVehicleSave.BackColor = Color.Transparent; btnVehicleSave.Enabled = false; + Settings.Default.Save(); + + //save current vehicle + RegistrySettings.Save(); + tboxVehicleNameSave.Text = SanitizeFileName(tboxVehicleNameSave.Text.Trim()); if (tboxVehicleNameSave.Text.Trim().Length > 0) { - SettingsIO.ExportAll(Path.Combine(RegistrySettings.vehiclesDirectory, tboxVehicleNameSave.Text.Trim() + ".XML")); + Properties.Settings.Default.Save(); + RegistrySettings.Save(); RegistrySettings.vehicleFileName = tboxVehicleNameSave.Text.Trim(); Properties.Settings.Default.setVehicle_vehicleName = RegistrySettings.vehicleFileName; Properties.Settings.Default.Save(); - - RegistryKey key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\AgOpenGPS"); - key.SetValue("VehicleFileName", Properties.Settings.Default.setVehicle_vehicleName); - key.Close(); + + RegistrySettings.Save(); tboxVehicleNameSave.Text = ""; @@ -195,7 +198,6 @@ private void btnVehicleSave_Click(object sender, EventArgs e) SectionFeetInchesTotalWidthLabelUpdate(); } - UpdateVehicleListView(); UpdateSummary(); } @@ -299,7 +301,7 @@ private void btnVehicleNewSave_Click(object sender, EventArgs e) if (tboxCreateNewVehicle.Text.Trim().Length > 0) { - SettingsIO.ExportAll(Path.Combine(RegistrySettings.vehiclesDirectory, RegistrySettings.vehicleFileName + ".XML")); + RegistrySettings.Save(); Settings.Default.Reset(); Settings.Default.Save(); @@ -374,11 +376,7 @@ private void btnVehicleNewSave_Click(object sender, EventArgs e) Log.EventWriter("New Vehicle Loaded: " + RegistrySettings.vehicleFileName + ".XML"); - SettingsIO.ExportAll(Path.Combine(RegistrySettings.vehiclesDirectory, RegistrySettings.vehicleFileName + ".XML")); - - RegistryKey key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\AgOpenGPS"); - key.SetValue("VehicleFileName", Properties.Settings.Default.setVehicle_vehicleName); - key.Close(); + RegistrySettings.Save(); } UpdateVehicleListView(); diff --git a/SourceCode/GPS/Forms/Settings/FormAllSettings.cs b/SourceCode/GPS/Forms/Settings/FormAllSettings.cs index 8e6bb24c0..dfef69796 100644 --- a/SourceCode/GPS/Forms/Settings/FormAllSettings.cs +++ b/SourceCode/GPS/Forms/Settings/FormAllSettings.cs @@ -58,7 +58,7 @@ private void LoadLabels() label56.Text = Properties.Settings.Default.setDisplay_isAutoStartAgIO.ToString(); label58.Text = Properties.Settings.Default.setDisplay_isAutoOffAgIO.ToString(); - label60.Text = Properties.Settings.Default.setF_culture; + label60.Text = RegistrySettings.culture; label62.Text = Properties.Settings.Default.setF_CurrentDir; label64.Text = Properties.Settings.Default.setF_isRemoteWorkSystemOn.ToString(); label66.Text = Properties.Settings.Default.setF_isSteerWorkSwitchEnabled.ToString(); diff --git a/SourceCode/GPS/Forms/Settings/FormConfig.cs b/SourceCode/GPS/Forms/Settings/FormConfig.cs index de8cadee1..8289b87ab 100644 --- a/SourceCode/GPS/Forms/Settings/FormConfig.cs +++ b/SourceCode/GPS/Forms/Settings/FormConfig.cs @@ -137,7 +137,7 @@ private void FormConfig_FormClosing(object sender, FormClosingEventArgs e) mf.LoadSettings(); //save current vehicle - SettingsIO.ExportAll(Path.Combine(RegistrySettings.vehiclesDirectory, RegistrySettings.vehicleFileName + ".XML")); + RegistrySettings.Save(); } private void FixMinMaxSpinners() diff --git a/SourceCode/GPS/Forms/Settings/FormSteer.cs b/SourceCode/GPS/Forms/Settings/FormSteer.cs index 59617350a..539b4a00e 100644 --- a/SourceCode/GPS/Forms/Settings/FormSteer.cs +++ b/SourceCode/GPS/Forms/Settings/FormSteer.cs @@ -309,7 +309,7 @@ private void FormSteer_FormClosing(object sender, FormClosingEventArgs e) Properties.Settings.Default.Save(); //save current vehicle - SettingsIO.ExportAll(Path.Combine(RegistrySettings.vehiclesDirectory, RegistrySettings.vehicleFileName + ".XML")); + RegistrySettings.Save(); } private void Timer1_Tick(object sender, EventArgs e) @@ -1188,7 +1188,7 @@ private void btnVehicleReset_Click(object sender, EventArgs e) Properties.Settings.Default.Save(); //save current vehicle - SettingsIO.ExportAll(Path.Combine(RegistrySettings.vehiclesDirectory, RegistrySettings.vehicleFileName + ".XML")); + RegistrySettings.Save(); mf.vehicle = new CVehicle(mf); diff --git a/SourceCode/GPS/Forms/Settings/FormSteerWiz.cs b/SourceCode/GPS/Forms/Settings/FormSteerWiz.cs index 41d5e1958..0bd3a6f5a 100644 --- a/SourceCode/GPS/Forms/Settings/FormSteerWiz.cs +++ b/SourceCode/GPS/Forms/Settings/FormSteerWiz.cs @@ -246,7 +246,7 @@ private void FormSteer_FormClosing(object sender, FormClosingEventArgs e) Properties.Settings.Default.Save(); //save current vehicle - SettingsIO.ExportAll(Path.Combine(RegistrySettings.vehiclesDirectory, RegistrySettings.vehicleFileName + ".XML")); + RegistrySettings.Save(); } private void Timer1_Tick(object sender, EventArgs e) @@ -597,7 +597,7 @@ private void btnLoadDefaults_Click(object sender, EventArgs e) counter251 = 2; //save current vehicle - SettingsIO.ExportAll(Path.Combine(RegistrySettings.vehiclesDirectory, RegistrySettings.vehicleFileName + ".XML")); + RegistrySettings.Save(); FormSteer_Load(this, e); } From 6940c0da7bfca029c32b406784b57d61a1b695b8 Mon Sep 17 00:00:00 2001 From: BrianTee Date: Sun, 5 Jan 2025 14:55:37 -0700 Subject: [PATCH 3/4] min turn radius confusion --- SourceCode/GPS/Classes/CDubins.cs | 2 +- SourceCode/GPS/Forms/Settings/FormAllSettings.Designer.cs | 4 ++-- SourceCode/GPS/Forms/Settings/FormAllSettings.cs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/SourceCode/GPS/Classes/CDubins.cs b/SourceCode/GPS/Classes/CDubins.cs index 1f35771c0..3af9c8c2f 100644 --- a/SourceCode/GPS/Classes/CDubins.cs +++ b/SourceCode/GPS/Classes/CDubins.cs @@ -19,7 +19,7 @@ public class CDubins public static readonly double driveDistance = 0.05; //The radius the car can turn 360 degrees with - public static double turningRadius = Properties.Settings.Default.setVehicle_minTurningRadius; + public static double turningRadius = Properties.Settings.Default.set_youTurnRadius; //Position, Heading is in radians private vec2 startPos, goalPos; diff --git a/SourceCode/GPS/Forms/Settings/FormAllSettings.Designer.cs b/SourceCode/GPS/Forms/Settings/FormAllSettings.Designer.cs index 412fe8058..239a82eb0 100644 --- a/SourceCode/GPS/Forms/Settings/FormAllSettings.Designer.cs +++ b/SourceCode/GPS/Forms/Settings/FormAllSettings.Designer.cs @@ -1883,9 +1883,9 @@ private void InitializeComponent() this.label139.ForeColor = System.Drawing.Color.DimGray; this.label139.Location = new System.Drawing.Point(466, 114); this.label139.Name = "label139"; - this.label139.Size = new System.Drawing.Size(191, 22); + this.label139.Size = new System.Drawing.Size(169, 22); this.label139.TabIndex = 735; - this.label139.Text = "Min Turning Radius"; + this.label139.Text = "Min Uturn Radius"; this.label139.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // label140 diff --git a/SourceCode/GPS/Forms/Settings/FormAllSettings.cs b/SourceCode/GPS/Forms/Settings/FormAllSettings.cs index dfef69796..bc28c1b7d 100644 --- a/SourceCode/GPS/Forms/Settings/FormAllSettings.cs +++ b/SourceCode/GPS/Forms/Settings/FormAllSettings.cs @@ -97,7 +97,7 @@ private void LoadLabels() label134.Text = Properties.Settings.Default.setVehicle_isStanleyUsed.ToString(); label136.Text = Properties.Settings.Default.setVehicle_isSteerAxleAhead.ToString(); label138.Text = Properties.Settings.Default.setVehicle_maxAngularVelocity.ToString(); - label140.Text = Properties.Settings.Default.setVehicle_minTurningRadius.ToString(); + label140.Text = Properties.Settings.Default.set_youTurnRadius.ToString(); label142.Text = Properties.Settings.Default.setVehicle_numSections.ToString(); label144.Text = Properties.Settings.Default.setVehicle_slowSpeedCutoff.ToString(); label146.Text = Properties.Settings.Default.setVehicle_tankTrailingHitchLength.ToString(); From a71ea22b975acdf53a48c68712a56eab8e284337 Mon Sep 17 00:00:00 2001 From: BrianTee Date: Mon, 6 Jan 2025 06:50:13 -0700 Subject: [PATCH 4/4] Clean up gui --- SourceCode/GPS/AgOpenGPS.csproj | 19 - SourceCode/GPS/Classes/CNozzle.cs | 177 ---- SourceCode/GPS/Forms/Controls.Designer.cs | 174 +--- SourceCode/GPS/Forms/FormGPS.Designer.cs | 362 +------- SourceCode/GPS/Forms/FormGPS.cs | 19 - SourceCode/GPS/Forms/GUI.Designer.cs | 135 +-- SourceCode/GPS/Forms/OpenGL.Designer.cs | 6 - SourceCode/GPS/Forms/PGN.Designer.cs | 72 -- SourceCode/GPS/Forms/Sections.Designer.cs | 6 - .../GPS/Forms/Settings/FormAllSettings.cs | 1 - .../Forms/Settings/FormNozConfig.Designer.cs | 866 ------------------ .../GPS/Forms/Settings/FormNozConfig.cs | 254 ----- .../GPS/Forms/Settings/FormNozConfig.resx | 126 --- .../Settings/FormNozSettings.Designer.cs | 586 ------------ .../GPS/Forms/Settings/FormNozSettings.cs | 213 ----- .../GPS/Forms/Settings/FormNozSettings.resx | 126 --- SourceCode/GPS/Forms/UDPComm.Designer.cs | 20 - .../GPS/Properties/Settings.Designer.cs | 23 - SourceCode/GPS/Properties/Settings.settings | 6 - SourceCode/GPS/app.config | 12 - .../ModSim/Source/Forms/FormSim.Designer.cs | 138 +-- .../ModSim/Source/Forms/UDP.designer.cs | 53 -- 22 files changed, 42 insertions(+), 3352 deletions(-) delete mode 100644 SourceCode/GPS/Classes/CNozzle.cs delete mode 100644 SourceCode/GPS/Forms/Settings/FormNozConfig.Designer.cs delete mode 100644 SourceCode/GPS/Forms/Settings/FormNozConfig.cs delete mode 100644 SourceCode/GPS/Forms/Settings/FormNozConfig.resx delete mode 100644 SourceCode/GPS/Forms/Settings/FormNozSettings.Designer.cs delete mode 100644 SourceCode/GPS/Forms/Settings/FormNozSettings.cs delete mode 100644 SourceCode/GPS/Forms/Settings/FormNozSettings.resx diff --git a/SourceCode/GPS/AgOpenGPS.csproj b/SourceCode/GPS/AgOpenGPS.csproj index 5a189ad4f..1fc33f95e 100644 --- a/SourceCode/GPS/AgOpenGPS.csproj +++ b/SourceCode/GPS/AgOpenGPS.csproj @@ -135,7 +135,6 @@ - @@ -471,18 +470,6 @@ FormSaveOrNot.cs - - Form - - - FormNozConfig.cs - - - Form - - - FormNozSettings.cs - Form @@ -819,12 +806,6 @@ FormSaveOrNot.cs - - FormNozConfig.cs - - - FormNozSettings.cs - FormSimCoords.cs diff --git a/SourceCode/GPS/Classes/CNozzle.cs b/SourceCode/GPS/Classes/CNozzle.cs deleted file mode 100644 index e1f2cdf8a..000000000 --- a/SourceCode/GPS/Classes/CNozzle.cs +++ /dev/null @@ -1,177 +0,0 @@ -using OpenTK.Platform.Windows; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace AgOpenGPS -{ - public class CNozzle - { - //pointers to mainform controls Nozzz - private readonly FormGPS mf; - - public double currentSectionsWidthMeters = 0; - - public double volumePerAreaSetSelected = 0; - public double volumePerAreaSet1 = 0; - public double volumePerAreaSet2 = 0; - public double volumePerAreaActualFiltered = 0; - - public int volumePerMinuteSet = 0; - public int volumePerMinuteActual = 0; - - public int pressureActual = 0; - - public int isFlowingFlag = 0; - - public int pressureMax = 200; - public int pressureMin = 0; - public int pwmDriveActual = 0; - public bool isSprayAutoMode = true; - public bool isBypass = false; - - public double volumeApplied = 0; - public double volumeAppliedLast = 0; - public int volumeTankStart = 0; - - public string unitsApplied = "Gallons"; - public string unitsPerArea = "GPA"; - - public bool isAppliedUnitsNotTankDisplayed = true; - - public double rateNudge; - - public int percentWidthBypass = 1; - - public double rateAlarmPercent = 0.1; - - public bool isSectionValve3Wire = true; - - - public CNozzle(FormGPS _f) - { - //constructor - mf = _f; - volumePerAreaSet1 = Properties.Settings.Default.setNozzleSettings.volumePerAreaSet1; - volumePerAreaSet2 = Properties.Settings.Default.setNozzleSettings.volumePerAreaSet2; - volumePerAreaSetSelected = volumePerAreaSet1; - pressureMax = Properties.Settings.Default.setNozzleSettings.pressureMax; - pressureMin = Properties.Settings.Default.setNozzleSettings.pressureMin; - - volumeApplied = Properties.Settings.Default.setNozzleSettings.volumeApplied; - volumeTankStart = Properties.Settings.Default.setNozzleSettings.volumeTankStart; - - isBypass = Properties.Settings.Default.setNozzleSettings.isBypass; - - rateNudge = Properties.Settings.Default.setNozzleSettings.rateNudge; - - rateAlarmPercent = Properties.Settings.Default.setNozzleSettings.rateAlarmPercent; - - //units - unitsApplied = Properties.Settings.Default.setNozzleSettings.unitsApplied; - unitsPerArea = Properties.Settings.Default.setNozzleSettings.unitsPerArea; - - isAppliedUnitsNotTankDisplayed = Properties.Settings.Default.setNozzleSettings.isAppliedUnitsNotTankDisplayed; - - isSectionValve3Wire = Properties.Settings.Default.setNozzleSettings.isSectionValve3Wire; - } - - public void BuildRatePGN() - { - mf.nozz.volumePerMinuteSet = 0; - mf.nozz.currentSectionsWidthMeters = 0; - - for (int i = 0; i < mf.tool.numOfSections; i++) - { - //calculate gallons per minute - GPM = GPA X MPH X Width (in inches)/ 5,940 - if (mf.section[i].isSectionOn) - { - mf.nozz.currentSectionsWidthMeters += mf.section[i].sectionWidth; - } - } - - mf.nozz.percentWidthBypass = (int)(mf.nozz.currentSectionsWidthMeters / mf.tool.width * 100); - - if (isBypass) - { - mf.nozz.currentSectionsWidthMeters = mf.tool.width; - } - - if (mf.nozz.currentSectionsWidthMeters != 0) - { - if (mf.isMetric) - { - //Liters * 0.00167 𝑥 𝑠𝑤𝑎𝑡ℎ 𝑤𝑖𝑑𝑡ℎ 𝑥 𝐾mh * ( to send as integer 100) - mf.nozz.volumePerMinuteSet = - (int)(mf.nozz.volumePerAreaSetSelected * 0.167 * mf.nozz.currentSectionsWidthMeters * mf.avgSpeed); - } - else - { - mf.nozz.volumePerMinuteSet = (int)(mf.nozz.volumePerAreaSetSelected * - (mf.avgSpeed * 0.621) * mf.nozz.currentSectionsWidthMeters * 39.3701 / 5940 * 100); - } - - mf.p_227.pgn[mf.p_227.volumePerMinuteSetLo] = (byte)(mf.nozz.volumePerMinuteSet); - mf.p_227.pgn[mf.p_227.volumePerMinuteSetHi] = unchecked((byte)((mf.nozz.volumePerMinuteSet) >> 8)); - mf.p_227.pgn[mf.p_227.percentWidthBypass] = (byte)(mf.nozz.percentWidthBypass); - } - else - { - mf.nozz.volumePerMinuteSet = 0; - - mf.p_227.pgn[mf.p_227.volumePerMinuteSetLo] = 0; - mf.p_227.pgn[mf.p_227.volumePerMinuteSetHi] = 0; - mf.p_227.pgn[mf.p_227.percentWidthBypass] = 0; - } - - mf.p_227.pgn[mf.p_227.sec1to8] = mf.p_254.pgn[mf.p_254.sc1to8]; - mf.p_227.pgn[mf.p_227.sec9to16] = mf.p_254.pgn[mf.p_254.sc9to16]; - - mf.SendPgnToLoop(mf.p_227.pgn); - } - } - - public class CNozzleSettings - { - //used in Properties.settings.settings - public CNozzleSettings() { } - - public double volumePerAreaSet1 = 6; - public double volumePerAreaSet2 = 12; - - public int pressureMax = 100; - public int pressureMin = 10; - - public int flowCal = 200; - public int pressureCal = 1; - - public byte Kp = 60; - public byte Ki = 100; - - public byte fastPWM = 100; - public byte slowPWM = 50; - - //these are entered as 0.2 and 1.0 - public byte deadbandError = 20; - public byte switchAtFlowError = 100; - - public double rateAlarmPercent = 0.1; - - public bool isBypass = false; - - public double volumeApplied = 0; - public int volumeTankStart = 0; - - public string unitsApplied = "Gallons"; - public string unitsPerArea = "GPA"; - - public bool isAppliedUnitsNotTankDisplayed = true; - - public double rateNudge = 1; - - public bool isSectionValve3Wire = true; - } -} - diff --git a/SourceCode/GPS/Forms/Controls.Designer.cs b/SourceCode/GPS/Forms/Controls.Designer.cs index 6eb1d75dc..123872056 100644 --- a/SourceCode/GPS/Forms/Controls.Designer.cs +++ b/SourceCode/GPS/Forms/Controls.Designer.cs @@ -20,137 +20,6 @@ namespace AgOpenGPS { public partial class FormGPS { - #region Nozzzle - private void cboxRate1Rate2Select_Click(object sender, EventArgs e) - { - if (cboxRate1Rate2Select.Checked) - { - nozz.volumePerAreaSetSelected = Properties.Settings.Default.setNozzleSettings.volumePerAreaSet2; - } - else - { - nozz.volumePerAreaSetSelected = Properties.Settings.Default.setNozzleSettings.volumePerAreaSet1; - } - - cboxRate1Rate2Select.Text = nozz.volumePerAreaSetSelected + nozz.unitsPerArea; - } - - private void cboxSprayAutoManual_Click(object sender, EventArgs e) - { - if (cboxSprayAutoManual.Checked) - { - cboxSprayAutoManual.Text = "Auto"; - nozz.isSprayAutoMode = true; - - p_225.pgn[p_225.auto] = 1; - } - else - { - cboxSprayAutoManual.Text = "Manual"; - nozz.isSprayAutoMode = false; - - //manual mode - p_225.pgn[p_225.auto] = 0; - } - - SendPgnToLoop(p_225.pgn); - } - - private void btnSprayVolumeTotal_Click(object sender, EventArgs e) - { - nozz.isAppliedUnitsNotTankDisplayed = !nozz.isAppliedUnitsNotTankDisplayed; - if (!nozz.isAppliedUnitsNotTankDisplayed) - lbl_Volume.Text = "Tank " + nozz.unitsApplied; - else - lbl_Volume.Text = "App " + nozz.unitsApplied; - } - - private void btnSprayRate_Click(object sender, EventArgs e) - { - using (var form = new FormNozSettings(this)) - { - form.ShowDialog(this); - } - - if (cboxRate1Rate2Select.Checked) - { - nozz.volumePerAreaSetSelected = Properties.Settings.Default.setNozzleSettings.volumePerAreaSet2; - } - else - { - nozz.volumePerAreaSetSelected = Properties.Settings.Default.setNozzleSettings.volumePerAreaSet1; - } - - cboxRate1Rate2Select.Text = nozz.volumePerAreaSetSelected + nozz.unitsPerArea; - } - - private void btnNozConfig_Click(object sender, EventArgs e) - { - Form f = Application.OpenForms["FormNozConfig"]; - - if (f != null) - { - f.Focus(); - return; - } - - Form form = new FormNozConfig(this); - form.Show(this); - } - - - private void btnSprayFlyout_Click(object sender, EventArgs e) - { - Form f = Application.OpenForms["FormNozConfig"]; - - if (f != null) - { - f.Focus(); - return; - } - - Form form = new FormNozConfig(this); - form.Show(this); - } - - private void btnSprayRateDn_Click(object sender, EventArgs e) - { - if (!nozz.isSprayAutoMode) - { - p_225.pgn[p_225.dn] = 1; - - SendPgnToLoop(p_225.pgn); - - p_225.pgn[p_225.dn] = 0; - } - else - { - nozz.volumePerAreaSetSelected -= nozz.rateNudge; - if (nozz.volumePerAreaSetSelected < 2) nozz.volumePerAreaSetSelected = 2; - cboxRate1Rate2Select.Text = nozz.volumePerAreaSetSelected.ToString("N1") + nozz.unitsPerArea; - } - } - - private void btnSprayRateUp_Click(object sender, EventArgs e) - { - if (!nozz.isSprayAutoMode) - { - p_225.pgn[p_225.up] = 1; - - SendPgnToLoop(p_225.pgn); - - p_225.pgn[p_225.up] = 0; - } - else - { - nozz.volumePerAreaSetSelected += nozz.rateNudge; - cboxRate1Rate2Select.Text = nozz.volumePerAreaSetSelected.ToString("N1") + nozz.unitsPerArea; - } - } - - #endregion - - #region Right Menu public bool isABCyled = false; private void btnContour_Click(object sender, EventArgs e) @@ -1102,9 +971,7 @@ private void btnNavigationSettings_Click(object sender, EventArgs e) f1.Close(); } - //Nozzz - if (isNozzleApp) panelNavigation.Location = new System.Drawing.Point(250, 100); - else panelNavigation.Location = new System.Drawing.Point(90, 100); + panelNavigation.Location = new System.Drawing.Point(90, 100); if (panelNavigation.Visible) { @@ -1289,9 +1156,9 @@ private void btnFieldStats_Click(object sender, EventArgs e) form.Top = this.Top + this.Height / 2 - GPSDataWindowTopOffset; if (isPanelBottomHidden) - form.Left = this.Left + 5 + (isNozzleApp?tlpNozzle.Width:0); + form.Left = this.Left + 5 ; else - form.Left = this.Left + GPSDataWindowLeft + 5 + (isNozzleApp ? tlpNozzle.Width : 0); + form.Left = this.Left + GPSDataWindowLeft + 5; Form ff = Application.OpenForms["FormGPS"]; @@ -1325,9 +1192,9 @@ private void btnGPSData_Click(object sender, EventArgs e) form.Top = this.Top + this.Height / 2 - GPSDataWindowTopOffset; if (isPanelBottomHidden) - form.Left = this.Left + 5 + (isNozzleApp ? tlpNozzle.Width : 0); + form.Left = this.Left + 5; else - form.Left = this.Left + GPSDataWindowLeft + 5 + (isNozzleApp ? tlpNozzle.Width : 0); + form.Left = this.Left + GPSDataWindowLeft + 5; Form ff = Application.OpenForms["FormGPS"]; ff.Focus(); @@ -1473,37 +1340,6 @@ private void aboutToolStripMenuItem_Click(object sender, EventArgs e) } } - private void nozzleAppToolStripMenuItem_Click(object sender, EventArgs e) - { - if (isJobStarted) - { - TimedMessageBox(2000, gStr.gsFieldIsOpen, gStr.gsCloseFieldFirst); - Log.EventWriter("Turning Nozzle on or off while open field"); - return; - } - - isNozzleApp = !isNozzleApp; - - if (isNozzleApp) - { - TimedMessageBox(2000, "", "Nozzle App On"); - Log.EventWriter("Turning Nozzle App On"); - } - else - { - TimedMessageBox(2000, "", "Nozzle App Off"); - Log.EventWriter("Turning Nozzle App Off"); - } - - nozzleAppToolStripMenuItem.Checked = isNozzleApp; - Settings.Default.setApp_isNozzleApp = isNozzleApp; - Settings.Default.Save(); - - LoadSettings(); - - PanelsAndOGLSize(); - } - private void kioskModeToolStrip_Click(object sender, EventArgs e) { isKioskMode = !isKioskMode; diff --git a/SourceCode/GPS/Forms/FormGPS.Designer.cs b/SourceCode/GPS/Forms/FormGPS.Designer.cs index f00321c3d..e4ea1d473 100644 --- a/SourceCode/GPS/Forms/FormGPS.Designer.cs +++ b/SourceCode/GPS/Forms/FormGPS.Designer.cs @@ -65,7 +65,6 @@ private void InitializeComponent() this.resetEverythingToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.helpMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.nozzleAppToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.tmrWatchdog = new System.Windows.Forms.Timer(this.components); this.contextMenuStripFlag = new System.Windows.Forms.ContextMenuStrip(this.components); this.toolStripMenuItemFlagRed = new System.Windows.Forms.ToolStripMenuItem(); @@ -213,19 +212,6 @@ private void InitializeComponent() this.btnMinimizeMainForm = new System.Windows.Forms.Button(); this.btnFieldStats = new System.Windows.Forms.Button(); this.lblHardwareMessage = new System.Windows.Forms.Label(); - this.tlpNozzle = new System.Windows.Forms.TableLayoutPanel(); - this.btnSprayGalPerMinActual = new System.Windows.Forms.Button(); - this.btnSprayPSI = new System.Windows.Forms.Button(); - this.lblPressure = new System.Windows.Forms.Label(); - this.btnSprayVolumeTotal = new System.Windows.Forms.Button(); - this.lbl_Volume = new System.Windows.Forms.Label(); - this.btnSprayGalPerAcre = new System.Windows.Forms.Button(); - this.cboxSprayAutoManual = new System.Windows.Forms.CheckBox(); - this.cboxRate1Rate2Select = new System.Windows.Forms.CheckBox(); - this.btnSprayRateUp = new System.Windows.Forms.Button(); - this.btnSprayRateDn = new System.Windows.Forms.Button(); - this.btnNozConfig = new System.Windows.Forms.Button(); - this.lblGPM_Set = new System.Windows.Forms.Label(); this.contextMenuStripOpenGL.SuspendLayout(); this.menuStrip1.SuspendLayout(); this.contextMenuStripFlag.SuspendLayout(); @@ -240,7 +226,6 @@ private void InitializeComponent() this.panelBottom.SuspendLayout(); this.panelRight.SuspendLayout(); this.panelControlBox.SuspendLayout(); - this.tlpNozzle.SuspendLayout(); this.SuspendLayout(); // // contextMenuStripOpenGL @@ -297,8 +282,7 @@ private void InitializeComponent() this.kioskModeToolStrip, this.resetALLToolStripMenuItem, this.aboutToolStripMenuItem, - this.helpMenuItem, - this.nozzleAppToolStripMenuItem}); + this.helpMenuItem}); this.fileToolStripMenuItem.Font = new System.Drawing.Font("Tahoma", 27.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.fileToolStripMenuItem.Image = global::AgOpenGPS.Properties.Resources.fileMenu; this.fileToolStripMenuItem.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -538,14 +522,6 @@ private void InitializeComponent() this.helpMenuItem.Text = "Help"; this.helpMenuItem.Click += new System.EventHandler(this.helpMenuItem_Click); // - // nozzleAppToolStripMenuItem - // - this.nozzleAppToolStripMenuItem.Name = "nozzleAppToolStripMenuItem"; - this.nozzleAppToolStripMenuItem.Size = new System.Drawing.Size(382, 50); - this.nozzleAppToolStripMenuItem.Text = "Nozzle App"; - this.nozzleAppToolStripMenuItem.Visible = false; - this.nozzleAppToolStripMenuItem.Click += new System.EventHandler(this.nozzleAppToolStripMenuItem_Click); - // // tmrWatchdog // this.tmrWatchdog.Interval = 250; @@ -1296,7 +1272,7 @@ private void InitializeComponent() this.panelSim.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); this.panelSim.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 75F)); this.panelSim.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); - this.panelSim.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 72F)); + this.panelSim.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 76F)); this.panelSim.Controls.Add(this.btnSpeedDn, 5, 0); this.panelSim.Controls.Add(this.btnSimSpeedUp, 7, 0); this.panelSim.Controls.Add(this.btnResetSim, 0, 0); @@ -1321,7 +1297,7 @@ private void InitializeComponent() this.btnSpeedDn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnSpeedDn.Location = new System.Drawing.Point(342, 4); this.btnSpeedDn.Name = "btnSpeedDn"; - this.btnSpeedDn.Size = new System.Drawing.Size(56, 34); + this.btnSpeedDn.Size = new System.Drawing.Size(54, 34); this.btnSpeedDn.TabIndex = 533; this.btnSpeedDn.UseVisualStyleBackColor = false; this.btnSpeedDn.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btnSpeedDn_MouseDown); @@ -1334,9 +1310,9 @@ private void InitializeComponent() this.btnSimSpeedUp.Dock = System.Windows.Forms.DockStyle.Fill; this.btnSimSpeedUp.FlatAppearance.BorderSize = 0; this.btnSimSpeedUp.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btnSimSpeedUp.Location = new System.Drawing.Point(481, 4); + this.btnSimSpeedUp.Location = new System.Drawing.Point(479, 4); this.btnSimSpeedUp.Name = "btnSimSpeedUp"; - this.btnSimSpeedUp.Size = new System.Drawing.Size(56, 34); + this.btnSimSpeedUp.Size = new System.Drawing.Size(54, 34); this.btnSimSpeedUp.TabIndex = 532; this.btnSimSpeedUp.UseVisualStyleBackColor = false; this.btnSimSpeedUp.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btnSimSpeedUp_MouseDown); @@ -1350,7 +1326,7 @@ private void InitializeComponent() this.btnSimSetSpeedToZero.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnSimSetSpeedToZero.Font = new System.Drawing.Font("Tahoma", 9.75F); this.btnSimSetSpeedToZero.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.btnSimSetSpeedToZero.Location = new System.Drawing.Point(405, 4); + this.btnSimSetSpeedToZero.Location = new System.Drawing.Point(403, 4); this.btnSimSetSpeedToZero.Name = "btnSimSetSpeedToZero"; this.btnSimSetSpeedToZero.Size = new System.Drawing.Size(69, 34); this.btnSimSetSpeedToZero.TabIndex = 453; @@ -1367,7 +1343,7 @@ private void InitializeComponent() this.btnSimReverseDirection.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnSimReverseDirection.Font = new System.Drawing.Font("Tahoma", 9.75F); this.btnSimReverseDirection.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.btnSimReverseDirection.Location = new System.Drawing.Point(560, 4); + this.btnSimReverseDirection.Location = new System.Drawing.Point(558, 4); this.btnSimReverseDirection.Name = "btnSimReverseDirection"; this.btnSimReverseDirection.Size = new System.Drawing.Size(35, 34); this.btnSimReverseDirection.TabIndex = 537; @@ -1899,7 +1875,7 @@ private void InitializeComponent() // this.toolStripConfig.Image = global::AgOpenGPS.Properties.Resources.Settings48; this.toolStripConfig.Name = "toolStripConfig"; - this.toolStripConfig.Size = new System.Drawing.Size(463, 66); + this.toolStripConfig.Size = new System.Drawing.Size(419, 44); this.toolStripConfig.Text = "Configuration"; this.toolStripConfig.Click += new System.EventHandler(this.btnConfig_Click); // @@ -1907,7 +1883,7 @@ private void InitializeComponent() // this.toolStripSteerSettings.Image = global::AgOpenGPS.Properties.Resources.AutoSteerOff; this.toolStripSteerSettings.Name = "toolStripSteerSettings"; - this.toolStripSteerSettings.Size = new System.Drawing.Size(463, 66); + this.toolStripSteerSettings.Size = new System.Drawing.Size(419, 44); this.toolStripSteerSettings.Text = "Auto Steer"; this.toolStripSteerSettings.Click += new System.EventHandler(this.btnAutoSteerConfig_Click); // @@ -1915,7 +1891,7 @@ private void InitializeComponent() // this.toolStripAllSettings.Image = global::AgOpenGPS.Properties.Resources.ScreenShot; this.toolStripAllSettings.Name = "toolStripAllSettings"; - this.toolStripAllSettings.Size = new System.Drawing.Size(463, 66); + this.toolStripAllSettings.Size = new System.Drawing.Size(419, 44); this.toolStripAllSettings.Text = "View All Settings"; this.toolStripAllSettings.Click += new System.EventHandler(this.allSettingsMenuItem_Click); // @@ -1923,7 +1899,7 @@ private void InitializeComponent() // this.toolStripWorkingDirectories.Image = global::AgOpenGPS.Properties.Resources.FileOpen; this.toolStripWorkingDirectories.Name = "toolStripWorkingDirectories"; - this.toolStripWorkingDirectories.Size = new System.Drawing.Size(463, 66); + this.toolStripWorkingDirectories.Size = new System.Drawing.Size(419, 44); this.toolStripWorkingDirectories.Text = "Directories"; this.toolStripWorkingDirectories.Click += new System.EventHandler(this.setWorkingDirectoryToolStripMenuItem_Click); // @@ -1931,7 +1907,7 @@ private void InitializeComponent() // this.toolStripGPSData.Image = global::AgOpenGPS.Properties.Resources.GPSQuality; this.toolStripGPSData.Name = "toolStripGPSData"; - this.toolStripGPSData.Size = new System.Drawing.Size(463, 66); + this.toolStripGPSData.Size = new System.Drawing.Size(419, 44); this.toolStripGPSData.Text = "GPS Data"; this.toolStripGPSData.Click += new System.EventHandler(this.btnGPSData_Click); // @@ -1939,7 +1915,7 @@ private void InitializeComponent() // this.toolStripColors.Image = global::AgOpenGPS.Properties.Resources.ColourPick; this.toolStripColors.Name = "toolStripColors"; - this.toolStripColors.Size = new System.Drawing.Size(463, 66); + this.toolStripColors.Size = new System.Drawing.Size(419, 44); this.toolStripColors.Text = "Colors"; this.toolStripColors.Click += new System.EventHandler(this.colorsToolStripMenuItem_Click); // @@ -1947,7 +1923,7 @@ private void InitializeComponent() // this.toolStripSectionColors.Image = global::AgOpenGPS.Properties.Resources.SectionMapping; this.toolStripSectionColors.Name = "toolStripSectionColors"; - this.toolStripSectionColors.Size = new System.Drawing.Size(463, 66); + this.toolStripSectionColors.Size = new System.Drawing.Size(419, 44); this.toolStripSectionColors.Text = "Multi-Section Colors"; this.toolStripSectionColors.Click += new System.EventHandler(this.colorsSectionToolStripMenuItem_Click); // @@ -1955,7 +1931,7 @@ private void InitializeComponent() // this.toolStripHotkeys.Image = global::AgOpenGPS.Properties.Resources.ConD_KeyBoard; this.toolStripHotkeys.Name = "toolStripHotkeys"; - this.toolStripHotkeys.Size = new System.Drawing.Size(463, 66); + this.toolStripHotkeys.Size = new System.Drawing.Size(419, 44); this.toolStripHotkeys.Text = "HotKeys"; this.toolStripHotkeys.Click += new System.EventHandler(this.hotKeysToolStripMenuItem_Click); // @@ -3037,298 +3013,6 @@ private void InitializeComponent() this.lblHardwareMessage.Visible = false; this.lblHardwareMessage.Click += new System.EventHandler(this.lblHardwareMessage_Click); // - // tlpNozzle - // - this.tlpNozzle.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left))); - this.tlpNozzle.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(25)))), ((int)(((byte)(40))))); - this.tlpNozzle.ColumnCount = 4; - this.tlpNozzle.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 12F)); - this.tlpNozzle.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50.625F)); - this.tlpNozzle.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 49.375F)); - this.tlpNozzle.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 12F)); - this.tlpNozzle.Controls.Add(this.btnSprayGalPerMinActual, 2, 0); - this.tlpNozzle.Controls.Add(this.btnSprayPSI, 1, 1); - this.tlpNozzle.Controls.Add(this.lblPressure, 1, 2); - this.tlpNozzle.Controls.Add(this.btnSprayVolumeTotal, 1, 3); - this.tlpNozzle.Controls.Add(this.lbl_Volume, 1, 4); - this.tlpNozzle.Controls.Add(this.btnSprayGalPerAcre, 1, 5); - this.tlpNozzle.Controls.Add(this.cboxSprayAutoManual, 1, 8); - this.tlpNozzle.Controls.Add(this.cboxRate1Rate2Select, 1, 6); - this.tlpNozzle.Controls.Add(this.btnSprayRateUp, 2, 7); - this.tlpNozzle.Controls.Add(this.btnSprayRateDn, 1, 7); - this.tlpNozzle.Controls.Add(this.btnNozConfig, 1, 9); - this.tlpNozzle.Controls.Add(this.lblGPM_Set, 0, 0); - this.tlpNozzle.Location = new System.Drawing.Point(78, 50); - this.tlpNozzle.Name = "tlpNozzle"; - this.tlpNozzle.RowCount = 10; - this.tlpNozzle.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 5.175529F)); - this.tlpNozzle.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 8.535604F)); - this.tlpNozzle.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 5.25268F)); - this.tlpNozzle.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10.01292F)); - this.tlpNozzle.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 4.02959F)); - this.tlpNozzle.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 12.94353F)); - this.tlpNozzle.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 12.69931F)); - this.tlpNozzle.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 16.7289F)); - this.tlpNozzle.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 12.31096F)); - this.tlpNozzle.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 12.31096F)); - this.tlpNozzle.Size = new System.Drawing.Size(197, 601); - this.tlpNozzle.TabIndex = 545; - // - // btnSprayGalPerMinActual - // - this.btnSprayGalPerMinActual.BackColor = System.Drawing.Color.Transparent; - this.btnSprayGalPerMinActual.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; - this.tlpNozzle.SetColumnSpan(this.btnSprayGalPerMinActual, 2); - this.btnSprayGalPerMinActual.Dock = System.Windows.Forms.DockStyle.Fill; - this.btnSprayGalPerMinActual.FlatAppearance.BorderColor = System.Drawing.Color.RoyalBlue; - this.btnSprayGalPerMinActual.FlatAppearance.BorderSize = 0; - this.btnSprayGalPerMinActual.FlatAppearance.CheckedBackColor = System.Drawing.Color.Transparent; - this.btnSprayGalPerMinActual.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; - this.btnSprayGalPerMinActual.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; - this.btnSprayGalPerMinActual.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btnSprayGalPerMinActual.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnSprayGalPerMinActual.ForeColor = System.Drawing.Color.Yellow; - this.btnSprayGalPerMinActual.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.btnSprayGalPerMinActual.Location = new System.Drawing.Point(99, 0); - this.btnSprayGalPerMinActual.Margin = new System.Windows.Forms.Padding(0); - this.btnSprayGalPerMinActual.Name = "btnSprayGalPerMinActual"; - this.btnSprayGalPerMinActual.Size = new System.Drawing.Size(98, 31); - this.btnSprayGalPerMinActual.TabIndex = 613; - this.btnSprayGalPerMinActual.Text = "10.9"; - this.btnSprayGalPerMinActual.UseVisualStyleBackColor = false; - // - // btnSprayPSI - // - this.btnSprayPSI.Anchor = System.Windows.Forms.AnchorStyles.Bottom; - this.btnSprayPSI.BackColor = System.Drawing.Color.Transparent; - this.btnSprayPSI.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; - this.tlpNozzle.SetColumnSpan(this.btnSprayPSI, 2); - this.btnSprayPSI.FlatAppearance.BorderColor = System.Drawing.Color.RoyalBlue; - this.btnSprayPSI.FlatAppearance.BorderSize = 0; - this.btnSprayPSI.FlatAppearance.CheckedBackColor = System.Drawing.Color.Transparent; - this.btnSprayPSI.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; - this.btnSprayPSI.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; - this.btnSprayPSI.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btnSprayPSI.Font = new System.Drawing.Font("Tahoma", 27.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnSprayPSI.ForeColor = System.Drawing.Color.Yellow; - this.btnSprayPSI.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.btnSprayPSI.Location = new System.Drawing.Point(24, 34); - this.btnSprayPSI.Name = "btnSprayPSI"; - this.btnSprayPSI.Size = new System.Drawing.Size(147, 45); - this.btnSprayPSI.TabIndex = 554; - this.btnSprayPSI.Text = "10.7"; - this.btnSprayPSI.TextAlign = System.Drawing.ContentAlignment.BottomCenter; - this.btnSprayPSI.UseVisualStyleBackColor = false; - // - // lblPressure - // - this.lblPressure.Anchor = System.Windows.Forms.AnchorStyles.Top; - this.lblPressure.BackColor = System.Drawing.Color.Transparent; - this.tlpNozzle.SetColumnSpan(this.lblPressure, 2); - this.lblPressure.Font = new System.Drawing.Font("Arial", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblPressure.ForeColor = System.Drawing.Color.White; - this.lblPressure.Location = new System.Drawing.Point(29, 82); - this.lblPressure.Name = "lblPressure"; - this.lblPressure.Size = new System.Drawing.Size(138, 19); - this.lblPressure.TabIndex = 553; - this.lblPressure.Text = "Pressure"; - this.lblPressure.TextAlign = System.Drawing.ContentAlignment.TopCenter; - // - // btnSprayVolumeTotal - // - this.btnSprayVolumeTotal.Anchor = System.Windows.Forms.AnchorStyles.Bottom; - this.btnSprayVolumeTotal.BackColor = System.Drawing.Color.Transparent; - this.btnSprayVolumeTotal.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; - this.tlpNozzle.SetColumnSpan(this.btnSprayVolumeTotal, 2); - this.btnSprayVolumeTotal.FlatAppearance.BorderColor = System.Drawing.Color.Olive; - this.btnSprayVolumeTotal.FlatAppearance.CheckedBackColor = System.Drawing.Color.Transparent; - this.btnSprayVolumeTotal.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; - this.btnSprayVolumeTotal.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; - this.btnSprayVolumeTotal.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btnSprayVolumeTotal.Font = new System.Drawing.Font("Tahoma", 27.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnSprayVolumeTotal.ForeColor = System.Drawing.Color.Aqua; - this.btnSprayVolumeTotal.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.btnSprayVolumeTotal.Location = new System.Drawing.Point(15, 120); - this.btnSprayVolumeTotal.Margin = new System.Windows.Forms.Padding(0); - this.btnSprayVolumeTotal.Name = "btnSprayVolumeTotal"; - this.btnSprayVolumeTotal.Size = new System.Drawing.Size(166, 53); - this.btnSprayVolumeTotal.TabIndex = 552; - this.btnSprayVolumeTotal.Text = "9999.9"; - this.btnSprayVolumeTotal.TextAlign = System.Drawing.ContentAlignment.BottomCenter; - this.btnSprayVolumeTotal.UseVisualStyleBackColor = false; - this.btnSprayVolumeTotal.Click += new System.EventHandler(this.btnSprayVolumeTotal_Click); - // - // lbl_Volume - // - this.lbl_Volume.Anchor = System.Windows.Forms.AnchorStyles.Top; - this.lbl_Volume.BackColor = System.Drawing.Color.Transparent; - this.tlpNozzle.SetColumnSpan(this.lbl_Volume, 2); - this.lbl_Volume.Font = new System.Drawing.Font("Arial", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lbl_Volume.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(240)))), ((int)(((byte)(255))))); - this.lbl_Volume.Location = new System.Drawing.Point(29, 173); - this.lbl_Volume.Name = "lbl_Volume"; - this.lbl_Volume.Size = new System.Drawing.Size(138, 24); - this.lbl_Volume.TabIndex = 551; - this.lbl_Volume.Text = "Tank Gallons"; - this.lbl_Volume.TextAlign = System.Drawing.ContentAlignment.TopCenter; - // - // btnSprayGalPerAcre - // - this.btnSprayGalPerAcre.Anchor = System.Windows.Forms.AnchorStyles.Bottom; - this.btnSprayGalPerAcre.BackColor = System.Drawing.Color.Transparent; - this.btnSprayGalPerAcre.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; - this.tlpNozzle.SetColumnSpan(this.btnSprayGalPerAcre, 2); - this.btnSprayGalPerAcre.FlatAppearance.BorderColor = System.Drawing.Color.Olive; - this.btnSprayGalPerAcre.FlatAppearance.CheckedBackColor = System.Drawing.Color.Transparent; - this.btnSprayGalPerAcre.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; - this.btnSprayGalPerAcre.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; - this.btnSprayGalPerAcre.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btnSprayGalPerAcre.Font = new System.Drawing.Font("Tahoma", 36F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnSprayGalPerAcre.ForeColor = System.Drawing.Color.White; - this.btnSprayGalPerAcre.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.btnSprayGalPerAcre.Location = new System.Drawing.Point(12, 205); - this.btnSprayGalPerAcre.Margin = new System.Windows.Forms.Padding(0); - this.btnSprayGalPerAcre.Name = "btnSprayGalPerAcre"; - this.btnSprayGalPerAcre.Size = new System.Drawing.Size(171, 69); - this.btnSprayGalPerAcre.TabIndex = 546; - this.btnSprayGalPerAcre.Text = "999.9"; - this.btnSprayGalPerAcre.TextAlign = System.Drawing.ContentAlignment.TopCenter; - this.btnSprayGalPerAcre.UseVisualStyleBackColor = false; - this.btnSprayGalPerAcre.Click += new System.EventHandler(this.btnSprayRate_Click); - // - // cboxSprayAutoManual - // - this.cboxSprayAutoManual.Anchor = System.Windows.Forms.AnchorStyles.None; - this.cboxSprayAutoManual.Appearance = System.Windows.Forms.Appearance.Button; - this.cboxSprayAutoManual.BackColor = System.Drawing.Color.DarkRed; - this.cboxSprayAutoManual.Checked = true; - this.cboxSprayAutoManual.CheckState = System.Windows.Forms.CheckState.Checked; - this.tlpNozzle.SetColumnSpan(this.cboxSprayAutoManual, 2); - this.cboxSprayAutoManual.FlatAppearance.BorderColor = System.Drawing.Color.Olive; - this.cboxSprayAutoManual.FlatAppearance.CheckedBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(50)))), ((int)(((byte)(20))))); - this.cboxSprayAutoManual.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.cboxSprayAutoManual.Font = new System.Drawing.Font("Tahoma", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.cboxSprayAutoManual.ForeColor = System.Drawing.Color.White; - this.cboxSprayAutoManual.Location = new System.Drawing.Point(29, 459); - this.cboxSprayAutoManual.Name = "cboxSprayAutoManual"; - this.cboxSprayAutoManual.RightToLeft = System.Windows.Forms.RightToLeft.Yes; - this.cboxSprayAutoManual.Size = new System.Drawing.Size(138, 55); - this.cboxSprayAutoManual.TabIndex = 582; - this.cboxSprayAutoManual.Text = "Auto"; - this.cboxSprayAutoManual.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - this.cboxSprayAutoManual.UseVisualStyleBackColor = false; - this.cboxSprayAutoManual.Click += new System.EventHandler(this.cboxSprayAutoManual_Click); - // - // cboxRate1Rate2Select - // - this.cboxRate1Rate2Select.Anchor = System.Windows.Forms.AnchorStyles.Bottom; - this.cboxRate1Rate2Select.Appearance = System.Windows.Forms.Appearance.Button; - this.cboxRate1Rate2Select.BackColor = System.Drawing.Color.Transparent; - this.tlpNozzle.SetColumnSpan(this.cboxRate1Rate2Select, 2); - this.cboxRate1Rate2Select.FlatAppearance.BorderColor = System.Drawing.Color.Olive; - this.cboxRate1Rate2Select.FlatAppearance.CheckedBackColor = System.Drawing.Color.Transparent; - this.cboxRate1Rate2Select.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; - this.cboxRate1Rate2Select.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; - this.cboxRate1Rate2Select.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.cboxRate1Rate2Select.Font = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.cboxRate1Rate2Select.ForeColor = System.Drawing.Color.White; - this.cboxRate1Rate2Select.Location = new System.Drawing.Point(28, 301); - this.cboxRate1Rate2Select.Margin = new System.Windows.Forms.Padding(0); - this.cboxRate1Rate2Select.Name = "cboxRate1Rate2Select"; - this.cboxRate1Rate2Select.Size = new System.Drawing.Size(139, 49); - this.cboxRate1Rate2Select.TabIndex = 602; - this.cboxRate1Rate2Select.Text = "Rate: 1"; - this.cboxRate1Rate2Select.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - this.cboxRate1Rate2Select.UseVisualStyleBackColor = false; - this.cboxRate1Rate2Select.Click += new System.EventHandler(this.cboxRate1Rate2Select_Click); - // - // btnSprayRateUp - // - this.btnSprayRateUp.Anchor = System.Windows.Forms.AnchorStyles.None; - this.btnSprayRateUp.BackColor = System.Drawing.Color.Transparent; - this.btnSprayRateUp.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.btnSprayRateUp.FlatAppearance.BorderColor = System.Drawing.Color.Olive; - this.btnSprayRateUp.FlatAppearance.CheckedBackColor = System.Drawing.Color.Transparent; - this.btnSprayRateUp.FlatAppearance.MouseDownBackColor = System.Drawing.Color.PowderBlue; - this.btnSprayRateUp.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; - this.btnSprayRateUp.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btnSprayRateUp.Font = new System.Drawing.Font("Tahoma", 36F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnSprayRateUp.ForeColor = System.Drawing.Color.Black; - this.btnSprayRateUp.Image = global::AgOpenGPS.Properties.Resources.UpArrow64; - this.btnSprayRateUp.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.btnSprayRateUp.Location = new System.Drawing.Point(110, 369); - this.btnSprayRateUp.Margin = new System.Windows.Forms.Padding(0); - this.btnSprayRateUp.Name = "btnSprayRateUp"; - this.btnSprayRateUp.RightToLeft = System.Windows.Forms.RightToLeft.No; - this.btnSprayRateUp.Size = new System.Drawing.Size(62, 62); - this.btnSprayRateUp.TabIndex = 615; - this.btnSprayRateUp.TextAlign = System.Drawing.ContentAlignment.TopCenter; - this.btnSprayRateUp.UseVisualStyleBackColor = false; - this.btnSprayRateUp.Click += new System.EventHandler(this.btnSprayRateUp_Click); - // - // btnSprayRateDn - // - this.btnSprayRateDn.Anchor = System.Windows.Forms.AnchorStyles.None; - this.btnSprayRateDn.BackColor = System.Drawing.Color.Transparent; - this.btnSprayRateDn.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.btnSprayRateDn.FlatAppearance.BorderColor = System.Drawing.Color.Olive; - this.btnSprayRateDn.FlatAppearance.CheckedBackColor = System.Drawing.Color.Transparent; - this.btnSprayRateDn.FlatAppearance.MouseDownBackColor = System.Drawing.Color.PowderBlue; - this.btnSprayRateDn.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; - this.btnSprayRateDn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btnSprayRateDn.Font = new System.Drawing.Font("Tahoma", 36F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnSprayRateDn.ForeColor = System.Drawing.Color.Black; - this.btnSprayRateDn.Image = global::AgOpenGPS.Properties.Resources.DnArrow64; - this.btnSprayRateDn.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.btnSprayRateDn.Location = new System.Drawing.Point(24, 369); - this.btnSprayRateDn.Margin = new System.Windows.Forms.Padding(0); - this.btnSprayRateDn.Name = "btnSprayRateDn"; - this.btnSprayRateDn.RightToLeft = System.Windows.Forms.RightToLeft.No; - this.btnSprayRateDn.Size = new System.Drawing.Size(62, 62); - this.btnSprayRateDn.TabIndex = 616; - this.btnSprayRateDn.TextAlign = System.Drawing.ContentAlignment.TopCenter; - this.btnSprayRateDn.UseVisualStyleBackColor = false; - this.btnSprayRateDn.Click += new System.EventHandler(this.btnSprayRateDn_Click); - // - // btnNozConfig - // - this.btnNozConfig.Anchor = System.Windows.Forms.AnchorStyles.None; - this.btnNozConfig.BackColor = System.Drawing.Color.Transparent; - this.btnNozConfig.BackgroundImage = global::AgOpenGPS.Properties.Resources.SpecialFunctions; - this.btnNozConfig.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; - this.tlpNozzle.SetColumnSpan(this.btnNozConfig, 2); - this.btnNozConfig.FlatAppearance.BorderColor = System.Drawing.Color.Olive; - this.btnNozConfig.FlatAppearance.CheckedBackColor = System.Drawing.Color.Transparent; - this.btnNozConfig.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; - this.btnNozConfig.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; - this.btnNozConfig.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btnNozConfig.Font = new System.Drawing.Font("Tahoma", 27.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnNozConfig.ForeColor = System.Drawing.Color.Aqua; - this.btnNozConfig.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.btnNozConfig.Location = new System.Drawing.Point(56, 538); - this.btnNozConfig.Name = "btnNozConfig"; - this.btnNozConfig.Size = new System.Drawing.Size(84, 48); - this.btnNozConfig.TabIndex = 553; - this.btnNozConfig.TextAlign = System.Drawing.ContentAlignment.BottomCenter; - this.btnNozConfig.UseVisualStyleBackColor = false; - this.btnNozConfig.Click += new System.EventHandler(this.btnNozConfig_Click); - // - // lblGPM_Set - // - this.lblGPM_Set.BackColor = System.Drawing.Color.Transparent; - this.tlpNozzle.SetColumnSpan(this.lblGPM_Set, 2); - this.lblGPM_Set.Dock = System.Windows.Forms.DockStyle.Fill; - this.lblGPM_Set.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblGPM_Set.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(70)))), ((int)(((byte)(220)))), ((int)(((byte)(70))))); - this.lblGPM_Set.Location = new System.Drawing.Point(0, 0); - this.lblGPM_Set.Margin = new System.Windows.Forms.Padding(0); - this.lblGPM_Set.Name = "lblGPM_Set"; - this.lblGPM_Set.Size = new System.Drawing.Size(99, 31); - this.lblGPM_Set.TabIndex = 612; - this.lblGPM_Set.Text = "Flow"; - this.lblGPM_Set.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // // FormGPS // this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); @@ -3375,7 +3059,6 @@ private void InitializeComponent() this.Controls.Add(this.lblCurrentField); this.Controls.Add(this.lblGuidanceLine); this.Controls.Add(this.lblHardwareMessage); - this.Controls.Add(this.tlpNozzle); this.DoubleBuffered = true; this.Font = new System.Drawing.Font("Tahoma", 12F); this.ForeColor = System.Drawing.SystemColors.ActiveCaptionText; @@ -3408,7 +3091,6 @@ private void InitializeComponent() this.panelBottom.ResumeLayout(false); this.panelRight.ResumeLayout(false); this.panelControlBox.ResumeLayout(false); - this.tlpNozzle.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); @@ -3594,20 +3276,6 @@ private void InitializeComponent() private System.Windows.Forms.Label lblHardwareMessage; private System.Windows.Forms.ToolStripMenuItem eventViewerToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem guidelinesToolStripMenuItem; - private System.Windows.Forms.TableLayoutPanel tlpNozzle; - public System.Windows.Forms.Button btnSprayGalPerMinActual; - private System.Windows.Forms.Label lblGPM_Set; - public System.Windows.Forms.Button btnSprayPSI; - private System.Windows.Forms.Label lblPressure; - public System.Windows.Forms.Button btnSprayVolumeTotal; - public System.Windows.Forms.Label lbl_Volume; - public System.Windows.Forms.Button btnSprayGalPerAcre; - private System.Windows.Forms.CheckBox cboxSprayAutoManual; - private System.Windows.Forms.CheckBox cboxRate1Rate2Select; - public System.Windows.Forms.Button btnSprayRateUp; - public System.Windows.Forms.Button btnSprayRateDn; - public System.Windows.Forms.Button btnNozConfig; - private System.Windows.Forms.ToolStripMenuItem nozzleAppToolStripMenuItem; } } diff --git a/SourceCode/GPS/Forms/FormGPS.cs b/SourceCode/GPS/Forms/FormGPS.cs index 61f07ec22..b2e033d04 100644 --- a/SourceCode/GPS/Forms/FormGPS.cs +++ b/SourceCode/GPS/Forms/FormGPS.cs @@ -231,12 +231,6 @@ public partial class FormGPS : Form /// public CWindowsSettingsBrightnessController displayBrightness; - /// - /// Nozzle class - /// - public CNozzle nozz; - - #endregion // Class Props and instances //The method assigned to the PowerModeChanged event call @@ -281,8 +275,6 @@ public FormGPS() CheckSettingsNotNull(); - CheckNozzleSettingsNotNull(); - //time keeper secondsSinceStart = (DateTime.Now - Process.GetCurrentProcess().StartTime).TotalSeconds; @@ -364,9 +356,6 @@ public FormGPS() //brightness object class displayBrightness = new CWindowsSettingsBrightnessController(Properties.Settings.Default.setDisplay_isBrightnessOn); - - //Application rate controller - nozz = new CNozzle(this); } private void FormGPS_Load(object sender, EventArgs e) @@ -772,14 +761,6 @@ public void CheckSettingsNotNull() } } - public void CheckNozzleSettingsNotNull() - { - if (Settings.Default.setNozzleSettings == null) - { - Settings.Default.setNozzleSettings = new CNozzleSettings(); - } - } - public enum textures : uint { Floor, Font, diff --git a/SourceCode/GPS/Forms/GUI.Designer.cs b/SourceCode/GPS/Forms/GUI.Designer.cs index 33f2920a2..763ea4b2f 100644 --- a/SourceCode/GPS/Forms/GUI.Designer.cs +++ b/SourceCode/GPS/Forms/GUI.Designer.cs @@ -74,7 +74,6 @@ public partial class FormGPS public bool isPanelBottomHidden = false; public bool isKioskMode = false; - public bool isNozzleApp = false; public int makeUTurnCounter = 0; //makes nav panel disappear after 6 seconds @@ -361,68 +360,6 @@ private void tmrWatchdog_tick(object sender, EventArgs e) lblSpeed.Text = SpeedMPH; //btnContour.Text = InchXTE; //cross track error } - - //Nozzz - if (isNozzleApp) - { - //nozz.tankVolumeTotal += 1; - if (nozz.isAppliedUnitsNotTankDisplayed) - btnSprayVolumeTotal.Text = nozz.volumeApplied.ToString("N1"); - else - btnSprayVolumeTotal.Text = (nozz.volumeTankStart - nozz.volumeApplied).ToString("N1"); - - //pressure reading - btnSprayPSI.Text = nozz.pressureActual.ToString(); - - //volume per minute displays at top of panel - lblGPM_Set.Text = ((double)(nozz.volumePerMinuteSet) * 0.01).ToString("N1"); - btnSprayGalPerMinActual.Text = (((double)(nozz.volumePerMinuteActual)) * 0.01).ToString("N2"); - - //the main GPA display and button - if (nozz.currentSectionsWidthMeters < 0.2) - { - btnSprayGalPerAcre.Text = "Off"; - btnSprayGalPerAcre.BackColor = Color.Transparent; - } - else - { - //volume per area calcs - GPM and L/Ha - if (isMetric) - { - //Liters * 0.00167 𝑥 𝑠𝑤𝑎𝑡ℎ 𝑤𝑖𝑑𝑡ℎ 𝑥 𝐾mh - nozz.volumePerAreaActualFiltered = (nozz.volumePerAreaActualFiltered * 0.6) + - (nozz.volumePerMinuteActual * 6) / (nozz.currentSectionsWidthMeters * avgSpeed + 0.01) * 0.6; - } - else - { - //(GPM x 5,940) / (MPH x Width in inches) - nozz.volumePerAreaActualFiltered = (nozz.volumePerAreaActualFiltered * 0.6) - + ((nozz.volumePerMinuteActual * 59.4) / (nozz.currentSectionsWidthMeters * 39.3701 * avgSpeed * 0.621 + 0.01) * 0.4); - } - - //display actual rate - if (nozz.volumePerAreaActualFiltered < 100) - btnSprayGalPerAcre.Text = (nozz.volumePerAreaActualFiltered).ToString("N1"); - else - btnSprayGalPerAcre.Text = (nozz.volumePerAreaActualFiltered).ToString("N0"); - - //flow error alarm - if ((Math.Abs(nozz.volumePerAreaSetSelected - nozz.volumePerAreaActualFiltered)) > (nozz.volumePerAreaSetSelected * nozz.rateAlarmPercent)) - { - if (isFlashOnOff) btnSprayGalPerAcre.BackColor = Color.DarkRed; - else btnSprayGalPerAcre.BackColor = Color.Transparent; - } - else - { - btnSprayGalPerAcre.BackColor = Color.DarkGreen; - } - - //flow error - //lblFlowError.Text = (((double)(nozz.volumePerMinuteSet - nozz.volumePerMinuteActual) - // / (double)(nozz.volumePerMinuteSet)) * 100).ToString("N0") + "%"; - } - } - } //end every 1/2 second //every fourth second update /////////////////////////// Fourth //////////////////////////// @@ -511,58 +448,6 @@ public void LoadSettings() unitsFtM = " ft"; } - //Nozzz - //Nozzle Spray Controller - - CheckNozzleSettingsNotNull(); - - isNozzleApp = Properties.Settings.Default.setApp_isNozzleApp; - nozzleAppToolStripMenuItem.Checked = isNozzleApp; - tlpNozzle.Visible = isNozzleApp; - - if (isNozzleApp) - { - p_226.pgn[p_226.flowCalHi] = unchecked((byte)(Properties.Settings.Default.setNozzleSettings.flowCal >> 8)); ; - p_226.pgn[p_226.flowCaLo] = unchecked((byte)(Properties.Settings.Default.setNozzleSettings.flowCal)); - p_226.pgn[p_226.pressureCalHi] = unchecked((byte)(Properties.Settings.Default.setNozzleSettings.pressureCal >> 8)); - p_226.pgn[p_226.pressureCalLo] = unchecked((byte)(Properties.Settings.Default.setNozzleSettings.pressureCal)); - p_226.pgn[p_226.Kp] = Properties.Settings.Default.setNozzleSettings.Kp; - p_226.pgn[p_226.Ki] = Properties.Settings.Default.setNozzleSettings.Ki; - p_226.pgn[p_226.minPressure] = unchecked((byte)(Properties.Settings.Default.setNozzleSettings.pressureMin)); - p_226.pgn[p_226.fastPWM] = Properties.Settings.Default.setNozzleSettings.fastPWM; - p_226.pgn[p_226.slowPWM] = Properties.Settings.Default.setNozzleSettings.slowPWM; - p_226.pgn[p_226.deadbandError] = Properties.Settings.Default.setNozzleSettings.deadbandError; - p_226.pgn[p_226.switchAtFlowError] = Properties.Settings.Default.setNozzleSettings.switchAtFlowError; - - if (Properties.Settings.Default.setNozzleSettings.isBypass) - p_226.pgn[p_226.isBypass] = 1; - else - p_226.pgn[p_226.isBypass] = 0; - - - tlpNozzle.Width = 175; - - //units - if (cboxRate1Rate2Select.Checked) - { - cboxRate1Rate2Select.Text = Properties.Settings.Default.setNozzleSettings.volumePerAreaSet2 + nozz.unitsPerArea; - nozz.volumePerAreaSetSelected = Properties.Settings.Default.setNozzleSettings.volumePerAreaSet2; - } - else - { - cboxRate1Rate2Select.Text = Properties.Settings.Default.setNozzleSettings.volumePerAreaSet1 + nozz.unitsPerArea; - nozz.volumePerAreaSetSelected = Properties.Settings.Default.setNozzleSettings.volumePerAreaSet1; - } - - btnSprayVolumeTotal.Text = nozz.volumeApplied.ToString(); - - if (!nozz.isAppliedUnitsNotTankDisplayed) - lbl_Volume.Text = "Tank " + nozz.unitsApplied; - else - lbl_Volume.Text = "App " + nozz.unitsApplied; - } - - udpWatchLimit = Properties.Settings.Default.SetGPS_udpWatchMsec; pn.headingTrueDualOffset = Properties.Settings.Default.setGPS_dualHeadingOffset; dualReverseDetectionDistance = Properties.Settings.Default.setGPS_dualReverseDetectionDistance; @@ -1047,21 +932,17 @@ public void PanelSizeRightAndBottom() private void PanelsAndOGLSize() { - // Nozzz if (!isJobStarted) { panelBottom.Visible = false; panelRight.Visible = false; - tlpNozzle.Visible = false; oglMain.Left = 80; oglMain.Width = this.Width - statusStripLeft.Width - 22; //22 oglMain.Height = this.Height - 60; - tlpNozzle.Height = oglMain.Height; } else { - tlpNozzle.Visible = isNozzleApp; if (isPanelBottomHidden) { @@ -1069,14 +950,9 @@ private void PanelsAndOGLSize() panelLeft.Visible = false; oglMain.Left = 20; - if (tlpNozzle.Visible) - { - oglMain.Left = 20 + tlpNozzle.Width; - tlpNozzle.Left = 20; - } + oglMain.Width = this.Width - 98; //22 - if (tlpNozzle.Visible) oglMain.Width -= tlpNozzle.Width; oglMain.Height = this.Height - 62; } @@ -1087,19 +963,10 @@ private void PanelsAndOGLSize() panelLeft.Visible = true; oglMain.Left = 80; - if (tlpNozzle.Visible) - { - oglMain.Left = 80 + tlpNozzle.Width; - tlpNozzle.Left = 80; - } - oglMain.Width = this.Width - statusStripLeft.Width - 92; //22 - if (tlpNozzle.Visible) oglMain.Width -= tlpNozzle.Width; oglMain.Height = this.Height - 118; } - - tlpNozzle.Height = oglMain.Height; } PanelSizeRightAndBottom(); diff --git a/SourceCode/GPS/Forms/OpenGL.Designer.cs b/SourceCode/GPS/Forms/OpenGL.Designer.cs index 4c622f37b..5766eeeb1 100644 --- a/SourceCode/GPS/Forms/OpenGL.Designer.cs +++ b/SourceCode/GPS/Forms/OpenGL.Designer.cs @@ -1376,12 +1376,6 @@ private void oglBack_Paint(object sender, PaintEventArgs e) //send the byte out to section machines BuildMachineByte(); - //Nozzz - if (isNozzleApp) - { - nozz.BuildRatePGN(); - } - ////Paint to context for troubleshooting //oglBack.MakeCurrent(); //oglBack.SwapBuffers(); diff --git a/SourceCode/GPS/Forms/PGN.Designer.cs b/SourceCode/GPS/Forms/PGN.Designer.cs index 8797d3cb5..d55398382 100644 --- a/SourceCode/GPS/Forms/PGN.Designer.cs +++ b/SourceCode/GPS/Forms/PGN.Designer.cs @@ -444,61 +444,6 @@ public class CPGN_E4 //public int = 12; } - //Spray Data - public class CPGN_227_E3 - { - public byte[] pgn = new byte[] { 0x80, 0x81, 0x7f, 0xE3, 5, 0, 0, 0, 0, 0, 0xCC }; - public int sec1to8 = 5; - public int sec9to16 = 6; - public int volumePerMinuteSetLo = 7; - public int volumePerMinuteSetHi = 8; - public int percentWidthBypass = 9; - - } - - //Spray Settings - public class CPGN_226_E2 - { - public byte[] pgn = new byte[] { 0x80, 0x81, 0x7f, 0xE2, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xCC }; - public int flowCaLo = 5; - public int flowCalHi = 6; - public int pressureCalLo = 7; - public int pressureCalHi = 8; - public int Kp = 9; - public int Ki = 10; - public int minPressure = 11; - public int fastPWM = 12; - public int slowPWM = 13; - public int deadbandError = 14; - public int switchAtFlowError = 15; - public int isBypass = 16; - public int isSectionValve3Wire = 17; - - } - - //Spray Functions - public class CPGN_225_E1 - { - public byte[] pgn = new byte[] { 0x80, 0x81, 0x7f, 0xE1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0xCC }; - - public int zeroTankVolumeLo = 5; - public int zeroTankVolumeHi = 6; - public int auto = 7; - public int up = 8; - public int dn = 9; - - public CPGN_225_E1() - { - pgn[zeroTankVolumeLo] = 0; - pgn[zeroTankVolumeHi] = 0; - pgn[auto] = 1; - pgn[up] = 0; - pgn[dn] = 0; - } - } - - - //pgn instances /// @@ -546,23 +491,6 @@ public CPGN_225_E1() /// public CPGN_E5 p_229 = new CPGN_E5(); - //Spray PGNS - /// - /// Spray Data PGN - 227 - E3 - /// - public CPGN_227_E3 p_227 = new CPGN_227_E3(); - - /// - /// Spray Settings PGN - 226 - E2 - /// - public CPGN_226_E2 p_226 = new CPGN_226_E2(); - - /// - /// Spray Functions PGN - 225 - E1 - /// - public CPGN_225_E1 p_225 = new CPGN_225_E1(); - - /// /// LatitudeLongitude - D0 - /// diff --git a/SourceCode/GPS/Forms/Sections.Designer.cs b/SourceCode/GPS/Forms/Sections.Designer.cs index f11930983..e38b5c6cc 100644 --- a/SourceCode/GPS/Forms/Sections.Designer.cs +++ b/SourceCode/GPS/Forms/Sections.Designer.cs @@ -327,9 +327,6 @@ public void LineUpIndividualSectionBtns() int oglCenter = isPanelBottomHidden ? oglCenter = oglMain.Width / 2 + 30 : statusStripLeft.Width + oglMain.Width / 2; - //Nozzz - if (tlpNozzle.Visible) oglCenter += tlpNozzle.Width; - int top = 140; int buttonMaxWidth = 360, buttonHeight = 35; @@ -512,9 +509,6 @@ public void LineUpAllZoneButtons() int oglCenter = isPanelBottomHidden ? oglCenter = oglMain.Width / 2 + 30 : statusStripLeft.Width + oglMain.Width / 2; - //Nozzz - if (tlpNozzle.Visible) oglCenter += tlpNozzle.Width; - int top = 130; int buttonMaxWidth = 400, buttonHeight = 30; diff --git a/SourceCode/GPS/Forms/Settings/FormAllSettings.cs b/SourceCode/GPS/Forms/Settings/FormAllSettings.cs index bc28c1b7d..03b21ce3e 100644 --- a/SourceCode/GPS/Forms/Settings/FormAllSettings.cs +++ b/SourceCode/GPS/Forms/Settings/FormAllSettings.cs @@ -16,7 +16,6 @@ public partial class FormAllSettings : Form //class variables private readonly FormGPS mf = null; - //Nozzz constructor public FormAllSettings(Form callingForm) { //get copy of the calling main form diff --git a/SourceCode/GPS/Forms/Settings/FormNozConfig.Designer.cs b/SourceCode/GPS/Forms/Settings/FormNozConfig.Designer.cs deleted file mode 100644 index 9c42eeb5c..000000000 --- a/SourceCode/GPS/Forms/Settings/FormNozConfig.Designer.cs +++ /dev/null @@ -1,866 +0,0 @@ -namespace AgOpenGPS -{ - partial class FormNozConfig - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); - System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.Series series2 = new System.Windows.Forms.DataVisualization.Charting.Series(); - this.timer1 = new System.Windows.Forms.Timer(this.components); - this.label9 = new System.Windows.Forms.Label(); - this.label8 = new System.Windows.Forms.Label(); - this.label1 = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); - this.label4 = new System.Windows.Forms.Label(); - this.label6 = new System.Windows.Forms.Label(); - this.label11 = new System.Windows.Forms.Label(); - this.cboxBypass = new System.Windows.Forms.CheckBox(); - this.label2 = new System.Windows.Forms.Label(); - this.btnSprayAcres = new System.Windows.Forms.Button(); - this.label12 = new System.Windows.Forms.Label(); - this.label5 = new System.Windows.Forms.Label(); - this.tboxUnitsPerArea = new System.Windows.Forms.TextBox(); - this.label7 = new System.Windows.Forms.Label(); - this.tboxUnitsApplied = new System.Windows.Forms.TextBox(); - this.label10 = new System.Windows.Forms.Label(); - this.cboxSectionValve3Wire = new System.Windows.Forms.CheckBox(); - this.label13 = new System.Windows.Forms.Label(); - this.label14 = new System.Windows.Forms.Label(); - this.tabControl1 = new System.Windows.Forms.TabControl(); - this.tabFlow = new System.Windows.Forms.TabPage(); - this.label20 = new System.Windows.Forms.Label(); - this.label18 = new System.Windows.Forms.Label(); - this.tabUnits = new System.Windows.Forms.TabPage(); - this.tabGain = new System.Windows.Forms.TabPage(); - this.unoChart = new System.Windows.Forms.DataVisualization.Charting.Chart(); - this.lblUnitsActual = new System.Windows.Forms.Label(); - this.lblUnitsSet = new System.Windows.Forms.Label(); - this.label15 = new System.Windows.Forms.Label(); - this.label16 = new System.Windows.Forms.Label(); - this.nudSlowPWM = new AgOpenGPS.NudlessNumericUpDown(); - this.nudFastPWM = new AgOpenGPS.NudlessNumericUpDown(); - this.nudSwitchAtFlowError = new AgOpenGPS.NudlessNumericUpDown(); - this.nudSprayKp = new AgOpenGPS.NudlessNumericUpDown(); - this.nudDeadbandError = new AgOpenGPS.NudlessNumericUpDown(); - this.nudSprayPressureCal = new AgOpenGPS.NudlessNumericUpDown(); - this.nudSprayFlowCal = new AgOpenGPS.NudlessNumericUpDown(); - this.nudMaxHz = new AgOpenGPS.NudlessNumericUpDown(); - this.nudMinHz = new AgOpenGPS.NudlessNumericUpDown(); - this.tabControl1.SuspendLayout(); - this.tabFlow.SuspendLayout(); - this.tabUnits.SuspendLayout(); - this.tabGain.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.unoChart)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudSlowPWM)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudFastPWM)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudSwitchAtFlowError)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudSprayKp)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudDeadbandError)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudSprayPressureCal)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudSprayFlowCal)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudMaxHz)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudMinHz)).BeginInit(); - this.SuspendLayout(); - // - // timer1 - // - this.timer1.Enabled = true; - this.timer1.Interval = 333; - this.timer1.Tick += new System.EventHandler(this.timer1_Tick); - // - // label9 - // - this.label9.BackColor = System.Drawing.Color.Transparent; - this.label9.Font = new System.Drawing.Font("Arial", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label9.ForeColor = System.Drawing.Color.White; - this.label9.Location = new System.Drawing.Point(202, 149); - this.label9.Name = "label9"; - this.label9.Size = new System.Drawing.Size(166, 29); - this.label9.TabIndex = 586; - this.label9.Text = "P Gain"; - this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // label8 - // - this.label8.BackColor = System.Drawing.Color.Transparent; - this.label8.Font = new System.Drawing.Font("Arial", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label8.ForeColor = System.Drawing.Color.White; - this.label8.Location = new System.Drawing.Point(18, 244); - this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(137, 29); - this.label8.TabIndex = 585; - this.label8.Text = "Pressure Cal"; - this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // label1 - // - this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.Font = new System.Drawing.Font("Arial", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label1.ForeColor = System.Drawing.Color.White; - this.label1.Location = new System.Drawing.Point(7, 155); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(163, 29); - this.label1.TabIndex = 580; - this.label1.Text = "Cal Factor x10"; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // label3 - // - this.label3.BackColor = System.Drawing.Color.Transparent; - this.label3.Font = new System.Drawing.Font("Arial", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label3.ForeColor = System.Drawing.Color.White; - this.label3.Location = new System.Drawing.Point(10, 64); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(166, 29); - this.label3.TabIndex = 592; - this.label3.Text = "Fast PWM %"; - this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // label4 - // - this.label4.BackColor = System.Drawing.Color.Transparent; - this.label4.Font = new System.Drawing.Font("Arial", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label4.ForeColor = System.Drawing.Color.White; - this.label4.Location = new System.Drawing.Point(10, 150); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(166, 29); - this.label4.TabIndex = 594; - this.label4.Text = "Slow PWM %"; - this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // label6 - // - this.label6.BackColor = System.Drawing.Color.Transparent; - this.label6.Font = new System.Drawing.Font("Arial", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label6.ForeColor = System.Drawing.Color.White; - this.label6.Location = new System.Drawing.Point(204, 60); - this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(166, 29); - this.label6.TabIndex = 597; - this.label6.Text = "Deadband %"; - this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // label11 - // - this.label11.BackColor = System.Drawing.Color.Transparent; - this.label11.Font = new System.Drawing.Font("Arial", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label11.ForeColor = System.Drawing.Color.White; - this.label11.Location = new System.Drawing.Point(10, 247); - this.label11.Name = "label11"; - this.label11.Size = new System.Drawing.Size(166, 29); - this.label11.TabIndex = 599; - this.label11.Text = "Fast > Slow %"; - this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // cboxBypass - // - this.cboxBypass.Appearance = System.Windows.Forms.Appearance.Button; - this.cboxBypass.BackColor = System.Drawing.Color.White; - this.cboxBypass.FlatAppearance.BorderColor = System.Drawing.Color.Black; - this.cboxBypass.FlatAppearance.CheckedBackColor = System.Drawing.Color.PaleGreen; - this.cboxBypass.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.cboxBypass.Font = new System.Drawing.Font("Tahoma", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.cboxBypass.ForeColor = System.Drawing.SystemColors.ControlText; - this.cboxBypass.Location = new System.Drawing.Point(220, 17); - this.cboxBypass.Name = "cboxBypass"; - this.cboxBypass.Size = new System.Drawing.Size(137, 46); - this.cboxBypass.TabIndex = 601; - this.cboxBypass.Text = "Normal"; - this.cboxBypass.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - this.cboxBypass.UseVisualStyleBackColor = false; - this.cboxBypass.Click += new System.EventHandler(this.cboxBypass_Click); - // - // label2 - // - this.label2.BackColor = System.Drawing.Color.Transparent; - this.label2.Font = new System.Drawing.Font("Arial", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label2.ForeColor = System.Drawing.Color.White; - this.label2.Location = new System.Drawing.Point(220, 60); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(137, 30); - this.label2.TabIndex = 602; - this.label2.Text = "Section Mode"; - this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // btnSprayAcres - // - this.btnSprayAcres.BackColor = System.Drawing.Color.Transparent; - this.btnSprayAcres.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; - this.btnSprayAcres.FlatAppearance.BorderColor = System.Drawing.Color.RoyalBlue; - this.btnSprayAcres.FlatAppearance.BorderSize = 0; - this.btnSprayAcres.FlatAppearance.CheckedBackColor = System.Drawing.Color.Transparent; - this.btnSprayAcres.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; - this.btnSprayAcres.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; - this.btnSprayAcres.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btnSprayAcres.Font = new System.Drawing.Font("Tahoma", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnSprayAcres.ForeColor = System.Drawing.Color.White; - this.btnSprayAcres.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.btnSprayAcres.Location = new System.Drawing.Point(235, 195); - this.btnSprayAcres.Name = "btnSprayAcres"; - this.btnSprayAcres.Size = new System.Drawing.Size(104, 44); - this.btnSprayAcres.TabIndex = 614; - this.btnSprayAcres.Text = "-127"; - this.btnSprayAcres.UseVisualStyleBackColor = false; - // - // label12 - // - this.label12.BackColor = System.Drawing.Color.Transparent; - this.label12.Font = new System.Drawing.Font("Arial", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label12.ForeColor = System.Drawing.Color.White; - this.label12.Location = new System.Drawing.Point(239, 242); - this.label12.Name = "label12"; - this.label12.Size = new System.Drawing.Size(88, 19); - this.label12.TabIndex = 613; - this.label12.Text = "PWM"; - this.label12.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // label5 - // - this.label5.BackColor = System.Drawing.Color.Transparent; - this.label5.Font = new System.Drawing.Font("Arial", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label5.ForeColor = System.Drawing.Color.White; - this.label5.Location = new System.Drawing.Point(220, 159); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(137, 29); - this.label5.TabIndex = 616; - this.label5.Text = "Metering Units"; - this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // tboxUnitsPerArea - // - this.tboxUnitsPerArea.Font = new System.Drawing.Font("Tahoma", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.tboxUnitsPerArea.Location = new System.Drawing.Point(233, 200); - this.tboxUnitsPerArea.MaxLength = 5; - this.tboxUnitsPerArea.Name = "tboxUnitsPerArea"; - this.tboxUnitsPerArea.Size = new System.Drawing.Size(111, 46); - this.tboxUnitsPerArea.TabIndex = 617; - this.tboxUnitsPerArea.Text = "L/Ha"; - this.tboxUnitsPerArea.TextChanged += new System.EventHandler(this.tboxUnitsPerArea_TextChanged); - // - // label7 - // - this.label7.BackColor = System.Drawing.Color.Transparent; - this.label7.Font = new System.Drawing.Font("Arial", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label7.ForeColor = System.Drawing.Color.White; - this.label7.Location = new System.Drawing.Point(220, 244); - this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(137, 29); - this.label7.TabIndex = 618; - this.label7.Text = "Rate Units"; - this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // tboxUnitsApplied - // - this.tboxUnitsApplied.Font = new System.Drawing.Font("Tahoma", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.tboxUnitsApplied.Location = new System.Drawing.Point(220, 114); - this.tboxUnitsApplied.MaxLength = 10; - this.tboxUnitsApplied.Name = "tboxUnitsApplied"; - this.tboxUnitsApplied.Size = new System.Drawing.Size(137, 46); - this.tboxUnitsApplied.TabIndex = 619; - this.tboxUnitsApplied.Text = "Gallons"; - this.tboxUnitsApplied.TextChanged += new System.EventHandler(this.tboxUnitsApplied_TextChanged); - // - // label10 - // - this.label10.BackColor = System.Drawing.Color.Transparent; - this.label10.Font = new System.Drawing.Font("Arial", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label10.ForeColor = System.Drawing.Color.White; - this.label10.Location = new System.Drawing.Point(21, 62); - this.label10.Name = "label10"; - this.label10.Size = new System.Drawing.Size(133, 29); - this.label10.TabIndex = 621; - this.label10.Text = "Section Style"; - this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // cboxSectionValve3Wire - // - this.cboxSectionValve3Wire.Appearance = System.Windows.Forms.Appearance.Button; - this.cboxSectionValve3Wire.BackColor = System.Drawing.Color.White; - this.cboxSectionValve3Wire.Checked = true; - this.cboxSectionValve3Wire.CheckState = System.Windows.Forms.CheckState.Checked; - this.cboxSectionValve3Wire.FlatAppearance.BorderColor = System.Drawing.Color.Black; - this.cboxSectionValve3Wire.FlatAppearance.CheckedBackColor = System.Drawing.Color.PaleGreen; - this.cboxSectionValve3Wire.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.cboxSectionValve3Wire.Font = new System.Drawing.Font("Tahoma", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.cboxSectionValve3Wire.ForeColor = System.Drawing.SystemColors.ControlText; - this.cboxSectionValve3Wire.Location = new System.Drawing.Point(17, 18); - this.cboxSectionValve3Wire.Name = "cboxSectionValve3Wire"; - this.cboxSectionValve3Wire.Size = new System.Drawing.Size(137, 46); - this.cboxSectionValve3Wire.TabIndex = 620; - this.cboxSectionValve3Wire.Text = "3 Wire "; - this.cboxSectionValve3Wire.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - this.cboxSectionValve3Wire.UseVisualStyleBackColor = false; - this.cboxSectionValve3Wire.Click += new System.EventHandler(this.cboxSectionValve3Wire_Click); - // - // label13 - // - this.label13.BackColor = System.Drawing.Color.Transparent; - this.label13.Font = new System.Drawing.Font("Arial", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label13.ForeColor = System.Drawing.Color.White; - this.label13.Location = new System.Drawing.Point(211, 63); - this.label13.Name = "label13"; - this.label13.Size = new System.Drawing.Size(166, 29); - this.label13.TabIndex = 623; - this.label13.Text = "Max Hz"; - this.label13.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // label14 - // - this.label14.BackColor = System.Drawing.Color.Transparent; - this.label14.Font = new System.Drawing.Font("Arial", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label14.ForeColor = System.Drawing.Color.White; - this.label14.Location = new System.Drawing.Point(8, 63); - this.label14.Name = "label14"; - this.label14.Size = new System.Drawing.Size(166, 29); - this.label14.TabIndex = 625; - this.label14.Text = "Min Hz"; - this.label14.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // tabControl1 - // - this.tabControl1.Appearance = System.Windows.Forms.TabAppearance.Buttons; - this.tabControl1.Controls.Add(this.tabFlow); - this.tabControl1.Controls.Add(this.tabUnits); - this.tabControl1.Controls.Add(this.tabGain); - this.tabControl1.Dock = System.Windows.Forms.DockStyle.Bottom; - this.tabControl1.Font = new System.Drawing.Font("Tahoma", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.tabControl1.ItemSize = new System.Drawing.Size(126, 48); - this.tabControl1.Location = new System.Drawing.Point(0, 88); - this.tabControl1.Margin = new System.Windows.Forms.Padding(4); - this.tabControl1.Multiline = true; - this.tabControl1.Name = "tabControl1"; - this.tabControl1.SelectedIndex = 0; - this.tabControl1.Size = new System.Drawing.Size(392, 348); - this.tabControl1.SizeMode = System.Windows.Forms.TabSizeMode.Fixed; - this.tabControl1.TabIndex = 626; - // - // tabFlow - // - this.tabFlow.BackColor = System.Drawing.Color.Black; - this.tabFlow.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; - this.tabFlow.Controls.Add(this.label20); - this.tabFlow.Controls.Add(this.label18); - this.tabFlow.Controls.Add(this.nudSlowPWM); - this.tabFlow.Controls.Add(this.label3); - this.tabFlow.Controls.Add(this.label4); - this.tabFlow.Controls.Add(this.label11); - this.tabFlow.Controls.Add(this.btnSprayAcres); - this.tabFlow.Controls.Add(this.label12); - this.tabFlow.Controls.Add(this.nudFastPWM); - this.tabFlow.Controls.Add(this.nudSwitchAtFlowError); - this.tabFlow.Controls.Add(this.nudSprayKp); - this.tabFlow.Controls.Add(this.nudDeadbandError); - this.tabFlow.Controls.Add(this.label9); - this.tabFlow.Controls.Add(this.label6); - this.tabFlow.ForeColor = System.Drawing.Color.Black; - this.tabFlow.ImageIndex = 3; - this.tabFlow.Location = new System.Drawing.Point(4, 52); - this.tabFlow.Name = "tabFlow"; - this.tabFlow.Size = new System.Drawing.Size(384, 292); - this.tabFlow.TabIndex = 16; - this.tabFlow.Text = "Gain"; - // - // label20 - // - this.label20.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label20.ForeColor = System.Drawing.SystemColors.ButtonFace; - this.label20.Location = new System.Drawing.Point(579, 228); - this.label20.Name = "label20"; - this.label20.Size = new System.Drawing.Size(204, 30); - this.label20.TabIndex = 302; - this.label20.Text = "Look Ahead Min"; - this.label20.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // label18 - // - this.label18.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label18.ForeColor = System.Drawing.SystemColors.ButtonFace; - this.label18.Location = new System.Drawing.Point(561, 13); - this.label18.Name = "label18"; - this.label18.Size = new System.Drawing.Size(204, 30); - this.label18.TabIndex = 300; - this.label18.Text = "Look Ahead"; - this.label18.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // tabUnits - // - this.tabUnits.BackColor = System.Drawing.Color.Black; - this.tabUnits.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; - this.tabUnits.Controls.Add(this.tboxUnitsPerArea); - this.tabUnits.Controls.Add(this.cboxBypass); - this.tabUnits.Controls.Add(this.cboxSectionValve3Wire); - this.tabUnits.Controls.Add(this.tboxUnitsApplied); - this.tabUnits.Controls.Add(this.label5); - this.tabUnits.Controls.Add(this.label7); - this.tabUnits.Controls.Add(this.label10); - this.tabUnits.Controls.Add(this.label8); - this.tabUnits.Controls.Add(this.label2); - this.tabUnits.Controls.Add(this.label1); - this.tabUnits.Controls.Add(this.nudSprayPressureCal); - this.tabUnits.Controls.Add(this.nudSprayFlowCal); - this.tabUnits.ImageIndex = 2; - this.tabUnits.Location = new System.Drawing.Point(4, 52); - this.tabUnits.Name = "tabUnits"; - this.tabUnits.Size = new System.Drawing.Size(384, 292); - this.tabUnits.TabIndex = 15; - this.tabUnits.Text = "Cal"; - // - // tabGain - // - this.tabGain.AutoScroll = true; - this.tabGain.BackColor = System.Drawing.Color.Black; - this.tabGain.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; - this.tabGain.Controls.Add(this.nudMaxHz); - this.tabGain.Controls.Add(this.nudMinHz); - this.tabGain.Controls.Add(this.label13); - this.tabGain.Controls.Add(this.label14); - this.tabGain.ImageIndex = 1; - this.tabGain.Location = new System.Drawing.Point(4, 52); - this.tabGain.Name = "tabGain"; - this.tabGain.Size = new System.Drawing.Size(384, 292); - this.tabGain.TabIndex = 13; - this.tabGain.Text = "Limits"; - // - // unoChart - // - this.unoChart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.unoChart.AntiAliasing = System.Windows.Forms.DataVisualization.Charting.AntiAliasingStyles.None; - this.unoChart.BackColor = System.Drawing.Color.Black; - chartArea1.AxisX.LabelAutoFitMaxFontSize = 8; - chartArea1.AxisX.MajorGrid.LineColor = System.Drawing.Color.DimGray; - chartArea1.AxisY.LineWidth = 2; - chartArea1.AxisY.MajorGrid.LineColor = System.Drawing.Color.DimGray; - chartArea1.BackColor = System.Drawing.Color.Black; - chartArea1.BorderWidth = 0; - chartArea1.Name = "ChartArea1"; - chartArea1.Position.Auto = false; - chartArea1.Position.Height = 100F; - chartArea1.Position.Width = 100F; - this.unoChart.ChartAreas.Add(chartArea1); - this.unoChart.Location = new System.Drawing.Point(-35, 9); - this.unoChart.Margin = new System.Windows.Forms.Padding(0); - this.unoChart.Name = "unoChart"; - this.unoChart.Palette = System.Windows.Forms.DataVisualization.Charting.ChartColorPalette.None; - series1.BackSecondaryColor = System.Drawing.Color.White; - series1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(255))))); - series1.BorderWidth = 2; - series1.ChartArea = "ChartArea1"; - series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.StepLine; - series1.Color = System.Drawing.Color.LightSalmon; - series1.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - series1.Legend = "Legend1"; - series1.MarkerBorderWidth = 2; - series1.Name = "S"; - series2.BorderWidth = 2; - series2.ChartArea = "ChartArea1"; - series2.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.StepLine; - series2.Color = System.Drawing.Color.Lime; - series2.IsVisibleInLegend = false; - series2.Legend = "Legend1"; - series2.Name = "PWM"; - this.unoChart.Series.Add(series1); - this.unoChart.Series.Add(series2); - this.unoChart.Size = new System.Drawing.Size(431, 97); - this.unoChart.TabIndex = 627; - this.unoChart.TextAntiAliasingQuality = System.Windows.Forms.DataVisualization.Charting.TextAntiAliasingQuality.SystemDefault; - // - // lblUnitsActual - // - this.lblUnitsActual.AutoSize = true; - this.lblUnitsActual.BackColor = System.Drawing.Color.Transparent; - this.lblUnitsActual.Font = new System.Drawing.Font("Arial", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblUnitsActual.ForeColor = System.Drawing.Color.Lime; - this.lblUnitsActual.Location = new System.Drawing.Point(43, -1); - this.lblUnitsActual.Name = "lblUnitsActual"; - this.lblUnitsActual.Size = new System.Drawing.Size(54, 22); - this.lblUnitsActual.TabIndex = 615; - this.lblUnitsActual.Text = "2700"; - this.lblUnitsActual.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // lblUnitsSet - // - this.lblUnitsSet.AutoSize = true; - this.lblUnitsSet.BackColor = System.Drawing.Color.Transparent; - this.lblUnitsSet.Font = new System.Drawing.Font("Arial", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblUnitsSet.ForeColor = System.Drawing.Color.LightSalmon; - this.lblUnitsSet.Location = new System.Drawing.Point(159, -1); - this.lblUnitsSet.Name = "lblUnitsSet"; - this.lblUnitsSet.Size = new System.Drawing.Size(54, 22); - this.lblUnitsSet.TabIndex = 628; - this.lblUnitsSet.Text = "0300"; - this.lblUnitsSet.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // label15 - // - this.label15.AutoSize = true; - this.label15.BackColor = System.Drawing.Color.Transparent; - this.label15.Font = new System.Drawing.Font("Arial", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label15.ForeColor = System.Drawing.Color.LightSalmon; - this.label15.Location = new System.Drawing.Point(120, -1); - this.label15.Name = "label15"; - this.label15.Size = new System.Drawing.Size(47, 22); - this.label15.TabIndex = 629; - this.label15.Text = "Set:"; - this.label15.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // label16 - // - this.label16.AutoSize = true; - this.label16.BackColor = System.Drawing.Color.Transparent; - this.label16.Font = new System.Drawing.Font("Arial", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label16.ForeColor = System.Drawing.Color.Lime; - this.label16.Location = new System.Drawing.Point(1, -1); - this.label16.Name = "label16"; - this.label16.Size = new System.Drawing.Size(47, 22); - this.label16.TabIndex = 630; - this.label16.Text = "Act:"; - this.label16.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // nudSlowPWM - // - this.nudSlowPWM.BackColor = System.Drawing.Color.White; - this.nudSlowPWM.Font = new System.Drawing.Font("Tahoma", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.nudSlowPWM.ForeColor = System.Drawing.SystemColors.ActiveCaptionText; - this.nudSlowPWM.Location = new System.Drawing.Point(16, 108); - this.nudSlowPWM.Minimum = new decimal(new int[] { - 10, - 0, - 0, - 0}); - this.nudSlowPWM.Name = "nudSlowPWM"; - this.nudSlowPWM.ReadOnly = true; - this.nudSlowPWM.Size = new System.Drawing.Size(155, 46); - this.nudSlowPWM.TabIndex = 595; - this.nudSlowPWM.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - this.nudSlowPWM.Value = new decimal(new int[] { - 45, - 0, - 0, - 0}); - this.nudSlowPWM.Click += new System.EventHandler(this.nudSlowPWM_Click); - // - // nudFastPWM - // - this.nudFastPWM.BackColor = System.Drawing.Color.White; - this.nudFastPWM.Font = new System.Drawing.Font("Tahoma", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.nudFastPWM.ForeColor = System.Drawing.SystemColors.ActiveCaptionText; - this.nudFastPWM.Location = new System.Drawing.Point(16, 22); - this.nudFastPWM.Minimum = new decimal(new int[] { - 10, - 0, - 0, - 0}); - this.nudFastPWM.Name = "nudFastPWM"; - this.nudFastPWM.ReadOnly = true; - this.nudFastPWM.Size = new System.Drawing.Size(155, 46); - this.nudFastPWM.TabIndex = 593; - this.nudFastPWM.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - this.nudFastPWM.Value = new decimal(new int[] { - 65, - 0, - 0, - 0}); - this.nudFastPWM.Click += new System.EventHandler(this.nudFastPWM_Click); - // - // nudSwitchAtFlowError - // - this.nudSwitchAtFlowError.BackColor = System.Drawing.Color.White; - this.nudSwitchAtFlowError.Font = new System.Drawing.Font("Tahoma", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.nudSwitchAtFlowError.ForeColor = System.Drawing.SystemColors.ActiveCaptionText; - this.nudSwitchAtFlowError.Location = new System.Drawing.Point(16, 205); - this.nudSwitchAtFlowError.Minimum = new decimal(new int[] { - 1, - 0, - 0, - 0}); - this.nudSwitchAtFlowError.Name = "nudSwitchAtFlowError"; - this.nudSwitchAtFlowError.ReadOnly = true; - this.nudSwitchAtFlowError.Size = new System.Drawing.Size(155, 46); - this.nudSwitchAtFlowError.TabIndex = 600; - this.nudSwitchAtFlowError.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - this.nudSwitchAtFlowError.Value = new decimal(new int[] { - 25, - 0, - 0, - 0}); - this.nudSwitchAtFlowError.Click += new System.EventHandler(this.nudSwitchAtFlowError_Click); - // - // nudSprayKp - // - this.nudSprayKp.BackColor = System.Drawing.Color.White; - this.nudSprayKp.Font = new System.Drawing.Font("Tahoma", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.nudSprayKp.ForeColor = System.Drawing.SystemColors.ActiveCaptionText; - this.nudSprayKp.Location = new System.Drawing.Point(208, 107); - this.nudSprayKp.Maximum = new decimal(new int[] { - 200, - 0, - 0, - 0}); - this.nudSprayKp.Minimum = new decimal(new int[] { - 10, - 0, - 0, - 0}); - this.nudSprayKp.Name = "nudSprayKp"; - this.nudSprayKp.ReadOnly = true; - this.nudSprayKp.Size = new System.Drawing.Size(155, 46); - this.nudSprayKp.TabIndex = 587; - this.nudSprayKp.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - this.nudSprayKp.Value = new decimal(new int[] { - 60, - 0, - 0, - 0}); - this.nudSprayKp.Click += new System.EventHandler(this.nudSprayKpClick); - // - // nudDeadbandError - // - this.nudDeadbandError.BackColor = System.Drawing.Color.White; - this.nudDeadbandError.Font = new System.Drawing.Font("Tahoma", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.nudDeadbandError.ForeColor = System.Drawing.SystemColors.ActiveCaptionText; - this.nudDeadbandError.Location = new System.Drawing.Point(210, 18); - this.nudDeadbandError.Minimum = new decimal(new int[] { - 1, - 0, - 0, - 0}); - this.nudDeadbandError.Name = "nudDeadbandError"; - this.nudDeadbandError.ReadOnly = true; - this.nudDeadbandError.Size = new System.Drawing.Size(155, 46); - this.nudDeadbandError.TabIndex = 598; - this.nudDeadbandError.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - this.nudDeadbandError.Value = new decimal(new int[] { - 8, - 0, - 0, - 0}); - this.nudDeadbandError.Click += new System.EventHandler(this.nudDeadbandError_Click); - // - // nudSprayPressureCal - // - this.nudSprayPressureCal.BackColor = System.Drawing.Color.White; - this.nudSprayPressureCal.Font = new System.Drawing.Font("Tahoma", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.nudSprayPressureCal.ForeColor = System.Drawing.SystemColors.ActiveCaptionText; - this.nudSprayPressureCal.Location = new System.Drawing.Point(17, 201); - this.nudSprayPressureCal.Maximum = new decimal(new int[] { - 200, - 0, - 0, - 0}); - this.nudSprayPressureCal.Minimum = new decimal(new int[] { - 1, - 0, - 0, - 0}); - this.nudSprayPressureCal.Name = "nudSprayPressureCal"; - this.nudSprayPressureCal.ReadOnly = true; - this.nudSprayPressureCal.Size = new System.Drawing.Size(137, 46); - this.nudSprayPressureCal.TabIndex = 584; - this.nudSprayPressureCal.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - this.nudSprayPressureCal.Value = new decimal(new int[] { - 2, - 0, - 0, - 0}); - this.nudSprayPressureCal.Click += new System.EventHandler(this.nudSprayPressureCal_Click); - // - // nudSprayFlowCal - // - this.nudSprayFlowCal.BackColor = System.Drawing.Color.White; - this.nudSprayFlowCal.Font = new System.Drawing.Font("Tahoma", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.nudSprayFlowCal.Location = new System.Drawing.Point(17, 111); - this.nudSprayFlowCal.Maximum = new decimal(new int[] { - 20000, - 0, - 0, - 0}); - this.nudSprayFlowCal.Minimum = new decimal(new int[] { - 100, - 0, - 0, - 0}); - this.nudSprayFlowCal.Name = "nudSprayFlowCal"; - this.nudSprayFlowCal.ReadOnly = true; - this.nudSprayFlowCal.Size = new System.Drawing.Size(137, 46); - this.nudSprayFlowCal.TabIndex = 579; - this.nudSprayFlowCal.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - this.nudSprayFlowCal.Value = new decimal(new int[] { - 1000, - 0, - 0, - 0}); - this.nudSprayFlowCal.Click += new System.EventHandler(this.nudSprayFlowCal_Click); - // - // nudMaxHz - // - this.nudMaxHz.BackColor = System.Drawing.Color.White; - this.nudMaxHz.Font = new System.Drawing.Font("Tahoma", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.nudMaxHz.ForeColor = System.Drawing.SystemColors.ActiveCaptionText; - this.nudMaxHz.Location = new System.Drawing.Point(217, 21); - this.nudMaxHz.Maximum = new decimal(new int[] { - 200, - 0, - 0, - 0}); - this.nudMaxHz.Minimum = new decimal(new int[] { - 10, - 0, - 0, - 0}); - this.nudMaxHz.Name = "nudMaxHz"; - this.nudMaxHz.ReadOnly = true; - this.nudMaxHz.Size = new System.Drawing.Size(155, 46); - this.nudMaxHz.TabIndex = 622; - this.nudMaxHz.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - this.nudMaxHz.Value = new decimal(new int[] { - 30, - 0, - 0, - 0}); - // - // nudMinHz - // - this.nudMinHz.BackColor = System.Drawing.Color.White; - this.nudMinHz.Font = new System.Drawing.Font("Tahoma", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.nudMinHz.ForeColor = System.Drawing.SystemColors.ActiveCaptionText; - this.nudMinHz.Location = new System.Drawing.Point(14, 21); - this.nudMinHz.Maximum = new decimal(new int[] { - 200, - 0, - 0, - 0}); - this.nudMinHz.Minimum = new decimal(new int[] { - 10, - 0, - 0, - 0}); - this.nudMinHz.Name = "nudMinHz"; - this.nudMinHz.ReadOnly = true; - this.nudMinHz.Size = new System.Drawing.Size(155, 46); - this.nudMinHz.TabIndex = 624; - this.nudMinHz.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - this.nudMinHz.Value = new decimal(new int[] { - 10, - 0, - 0, - 0}); - // - // FormNozConfig - // - this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; - this.AutoScroll = true; - this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(25)))), ((int)(((byte)(45))))); - this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; - this.ClientSize = new System.Drawing.Size(392, 436); - this.Controls.Add(this.lblUnitsSet); - this.Controls.Add(this.label15); - this.Controls.Add(this.label16); - this.Controls.Add(this.lblUnitsActual); - this.Controls.Add(this.tabControl1); - this.Controls.Add(this.unoChart); - this.DoubleBuffered = true; - this.Font = new System.Drawing.Font("Tahoma", 9.75F); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow; - this.Margin = new System.Windows.Forms.Padding(4); - this.MaximizeBox = false; - this.MaximumSize = new System.Drawing.Size(408, 768); - this.MinimizeBox = false; - this.MinimumSize = new System.Drawing.Size(408, 449); - this.Name = "FormNozConfig"; - this.ShowInTaskbar = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Controller Configuration"; - this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FormNozConfig_FormClosing); - this.Load += new System.EventHandler(this.FormDisplaySettings_Load); - this.tabControl1.ResumeLayout(false); - this.tabFlow.ResumeLayout(false); - this.tabUnits.ResumeLayout(false); - this.tabUnits.PerformLayout(); - this.tabGain.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.unoChart)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudSlowPWM)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudFastPWM)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudSwitchAtFlowError)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudSprayKp)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudDeadbandError)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudSprayPressureCal)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudSprayFlowCal)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudMaxHz)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudMinHz)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - private System.Windows.Forms.Timer timer1; - private NudlessNumericUpDown nudSprayKp; - private System.Windows.Forms.Label label9; - private System.Windows.Forms.Label label8; - private NudlessNumericUpDown nudSprayPressureCal; - private System.Windows.Forms.Label label1; - private NudlessNumericUpDown nudSprayFlowCal; - private NudlessNumericUpDown nudFastPWM; - private System.Windows.Forms.Label label3; - private NudlessNumericUpDown nudSlowPWM; - private System.Windows.Forms.Label label4; - private NudlessNumericUpDown nudDeadbandError; - private System.Windows.Forms.Label label6; - private NudlessNumericUpDown nudSwitchAtFlowError; - private System.Windows.Forms.Label label11; - private System.Windows.Forms.CheckBox cboxBypass; - private System.Windows.Forms.Label label2; - public System.Windows.Forms.Button btnSprayAcres; - private System.Windows.Forms.Label label12; - private System.Windows.Forms.Label label5; - private System.Windows.Forms.TextBox tboxUnitsPerArea; - private System.Windows.Forms.Label label7; - private System.Windows.Forms.TextBox tboxUnitsApplied; - private System.Windows.Forms.Label label10; - private System.Windows.Forms.CheckBox cboxSectionValve3Wire; - private NudlessNumericUpDown nudMaxHz; - private System.Windows.Forms.Label label13; - private System.Windows.Forms.Label label14; - private NudlessNumericUpDown nudMinHz; - private System.Windows.Forms.TabControl tabControl1; - private System.Windows.Forms.TabPage tabFlow; - private System.Windows.Forms.Label label20; - private System.Windows.Forms.Label label18; - private System.Windows.Forms.TabPage tabUnits; - private System.Windows.Forms.TabPage tabGain; - private System.Windows.Forms.DataVisualization.Charting.Chart unoChart; - private System.Windows.Forms.Label lblUnitsActual; - private System.Windows.Forms.Label lblUnitsSet; - private System.Windows.Forms.Label label15; - private System.Windows.Forms.Label label16; - } -} \ No newline at end of file diff --git a/SourceCode/GPS/Forms/Settings/FormNozConfig.cs b/SourceCode/GPS/Forms/Settings/FormNozConfig.cs deleted file mode 100644 index c4f29e504..000000000 --- a/SourceCode/GPS/Forms/Settings/FormNozConfig.cs +++ /dev/null @@ -1,254 +0,0 @@ -//Please, if you use this, share the improvements - -using AgOpenGPS.Properties; -using System; -using System.Drawing; -using System.Globalization; -using System.Windows.Forms; -using System.Windows.Forms.DataVisualization.Charting; - -namespace AgOpenGPS -{ - public partial class FormNozConfig : Form - { - //class variables - private readonly FormGPS mf = null; - - private string unitsSet = "10"; - private string unitsActual = "0"; - - - //Nozzz constructor - public FormNozConfig(Form callingForm) - { - //get copy of the calling main form - mf = callingForm as FormGPS; - InitializeComponent(); - - //Language keys - this.Text = "Controller Configuration"; - } - - private void FormDisplaySettings_Load(object sender, EventArgs e) - { - nudSprayFlowCal.Value = (decimal)(Properties.Settings.Default.setNozzleSettings.flowCal); - nudSprayPressureCal.Value = (decimal)(Properties.Settings.Default.setNozzleSettings.pressureCal); - - nudSprayKp.Value = Properties.Settings.Default.setNozzleSettings.Kp; - //nudSprayKi.Value = Properties.Settings.Default.setNozzleSettings.Ki; - - nudFastPWM.Value = Properties.Settings.Default.setNozzleSettings.fastPWM; - nudSlowPWM.Value = Properties.Settings.Default.setNozzleSettings.slowPWM; - nudDeadbandError.Value = (decimal)(Properties.Settings.Default.setNozzleSettings.deadbandError) * 0.01M; - nudSwitchAtFlowError.Value = (decimal)(Properties.Settings.Default.setNozzleSettings.switchAtFlowError) * 0.01M; - - cboxBypass.Checked = Properties.Settings.Default.setNozzleSettings.isBypass; - if (cboxBypass.Checked) - { - cboxBypass.Text = "Bypass"; - } - else - { - cboxBypass.Text = "Closed"; - } - - tboxUnitsApplied.Text = mf.nozz.unitsApplied.Trim(); - tboxUnitsPerArea.Text = mf.nozz.unitsPerArea.Trim(); - - cboxSectionValve3Wire.Checked = Properties.Settings.Default.setNozzleSettings.isSectionValve3Wire; - if (cboxSectionValve3Wire.Checked) - { - cboxSectionValve3Wire.Text = "3 Wire"; - } - else - { - cboxSectionValve3Wire.Text = "Reverse"; - } - - - } - - private void nudSprayFlowCal_Click(object sender, EventArgs e) - { - mf.KeypadToNUD((NudlessNumericUpDown)sender, this); - - Properties.Settings.Default.setNozzleSettings.flowCal = (int)nudSprayFlowCal.Value; - Settings.Default.Save(); - - mf.p_226.pgn[mf.p_226.flowCalHi] = unchecked((byte)(Properties.Settings.Default.setNozzleSettings.flowCal >> 8)); ; - mf.p_226.pgn[mf.p_226.flowCaLo] = unchecked((byte)(Properties.Settings.Default.setNozzleSettings.flowCal)); - - mf.SendPgnToLoop(mf.p_226.pgn); - } - - private void nudSprayPressureCal_Click(object sender, EventArgs e) - { - mf.KeypadToNUD((NudlessNumericUpDown)sender, this); - - Properties.Settings.Default.setNozzleSettings.pressureCal = (int)nudSprayPressureCal.Value; - Settings.Default.Save(); - - mf.p_226.pgn[mf.p_226.pressureCalHi] = unchecked((byte)(Properties.Settings.Default.setNozzleSettings.pressureCal >> 8)); ; - mf.p_226.pgn[mf.p_226.pressureCalLo] = unchecked((byte)(Properties.Settings.Default.setNozzleSettings.pressureCal)); - - mf.SendPgnToLoop(mf.p_226.pgn); - } - - private void nudFastPWM_Click(object sender, EventArgs e) - { - mf.KeypadToNUD((NudlessNumericUpDown)sender, this); - - Properties.Settings.Default.setNozzleSettings.fastPWM = (byte)nudFastPWM.Value; - Settings.Default.Save(); - - mf.p_226.pgn[mf.p_226.fastPWM] = unchecked((byte)(Properties.Settings.Default.setNozzleSettings.fastPWM)); - - mf.SendPgnToLoop(mf.p_226.pgn); - } - - private void nudSlowPWM_Click(object sender, EventArgs e) - { - mf.KeypadToNUD((NudlessNumericUpDown)sender, this); - - Properties.Settings.Default.setNozzleSettings.slowPWM = (byte)nudSlowPWM.Value; - Settings.Default.Save(); - - mf.p_226.pgn[mf.p_226.slowPWM] = unchecked((byte)(Properties.Settings.Default.setNozzleSettings.slowPWM)); - - mf.SendPgnToLoop(mf.p_226.pgn); - } - - private void nudDeadbandError_Click(object sender, EventArgs e) - { - mf.KeypadToNUD((NudlessNumericUpDown)sender, this); - - Properties.Settings.Default.setNozzleSettings.deadbandError = (byte)(nudDeadbandError.Value * 100); - Settings.Default.Save(); - - mf.p_226.pgn[mf.p_226.deadbandError] = unchecked((byte)(Properties.Settings.Default.setNozzleSettings.deadbandError)); - - mf.SendPgnToLoop(mf.p_226.pgn); - } - - private void nudSwitchAtFlowError_Click(object sender, EventArgs e) - { - mf.KeypadToNUD((NudlessNumericUpDown)sender, this); - - Properties.Settings.Default.setNozzleSettings.switchAtFlowError = (byte)(nudSwitchAtFlowError.Value * 100); - Settings.Default.Save(); - - mf.p_226.pgn[mf.p_226.switchAtFlowError] = unchecked((byte)(Properties.Settings.Default.setNozzleSettings.switchAtFlowError)); - - mf.SendPgnToLoop(mf.p_226.pgn); - } - - private void nudSprayKpClick(object sender, EventArgs e) - { - mf.KeypadToNUD((NudlessNumericUpDown)sender, this); - - Properties.Settings.Default.setNozzleSettings.Kp = (byte)nudSprayKp.Value; - Settings.Default.Save(); - - mf.p_226.pgn[mf.p_226.Kp] = unchecked((byte)(Properties.Settings.Default.setNozzleSettings.Kp)); - - mf.SendPgnToLoop(mf.p_226.pgn); - } - - private void cboxSectionValve3Wire_Click(object sender, EventArgs e) - { - if (cboxSectionValve3Wire.Checked) - { - cboxSectionValve3Wire.Text = "3 Wire"; - mf.nozz.isSectionValve3Wire = true; - mf.p_226.pgn[mf.p_226.isSectionValve3Wire] = 1; - } - else - { - cboxSectionValve3Wire.Text = "Reverse"; - mf.nozz.isSectionValve3Wire = false; - mf.p_226.pgn[mf.p_226.isSectionValve3Wire] = 0; - } - - Properties.Settings.Default.setNozzleSettings.isSectionValve3Wire = mf.nozz.isSectionValve3Wire; - - mf.SendPgnToLoop(mf.p_226.pgn); - } - - private void cboxBypass_Click(object sender, EventArgs e) - { - if (cboxBypass.Checked) - { - cboxBypass.Text = "Bypass"; - mf.nozz.isBypass = true; - mf.p_226.pgn[mf.p_226.isBypass] = 1; - } - else - { - cboxBypass.Text = "Closed"; - mf.nozz.isBypass = false; - mf.p_226.pgn[mf.p_226.isBypass] = 0; - } - - Properties.Settings.Default.setNozzleSettings.isBypass = mf.nozz.isBypass; - - mf.SendPgnToLoop(mf.p_226.pgn); - } - - private void timer1_Tick(object sender, EventArgs e) - { - btnSprayAcres.Text = mf.nozz.pwmDriveActual.ToString(); - DrawChart(); - } - - private void DrawChart() - { - unitsSet = lblUnitsSet.Text = mf.nozz.volumePerMinuteSet.ToString(); - unitsActual = lblUnitsActual.Text = mf.nozz.volumePerMinuteActual.ToString(); - //chart data - Series s = unoChart.Series["S"]; - Series w = unoChart.Series["PWM"]; - - double nextX = 1; - double nextX5 = 1; - - if (s.Points.Count > 0) nextX = s.Points[s.Points.Count - 1].XValue + 1; - if (w.Points.Count > 0) nextX5 = w.Points[w.Points.Count - 1].XValue + 1; - - unoChart.Series["S"].Points.AddXY(nextX, unitsSet); - unoChart.Series["PWM"].Points.AddXY(nextX5, unitsActual); - - while (s.Points.Count > 100) - { - s.Points.RemoveAt(0); - } - while (w.Points.Count > 100) - { - w.Points.RemoveAt(0); - } - unoChart.ChartAreas[0].RecalculateAxesScale(); - } - - - private void tboxUnitsApplied_TextChanged(object sender, EventArgs e) - { - mf.nozz.unitsApplied = " " + tboxUnitsApplied.Text.Trim(); - Properties.Settings.Default.setNozzleSettings.unitsApplied = mf.nozz.unitsApplied; - } - - private void tboxUnitsPerArea_TextChanged(object sender, EventArgs e) - { - mf.nozz.unitsPerArea = " " + tboxUnitsPerArea.Text.Trim(); - Properties.Settings.Default.setNozzleSettings.unitsPerArea = mf.nozz.unitsPerArea; - } - - private void FormNozConfig_FormClosing(object sender, FormClosingEventArgs e) - { - if (!mf.nozz.isAppliedUnitsNotTankDisplayed) - mf.lbl_Volume.Text = "Tank " + mf.nozz.unitsApplied; - else - mf.lbl_Volume.Text = "App " + mf.nozz.unitsApplied; - - Settings.Default.Save(); - } - } -} \ No newline at end of file diff --git a/SourceCode/GPS/Forms/Settings/FormNozConfig.resx b/SourceCode/GPS/Forms/Settings/FormNozConfig.resx deleted file mode 100644 index e2a4ce32f..000000000 --- a/SourceCode/GPS/Forms/Settings/FormNozConfig.resx +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 17, 17 - - - 35 - - \ No newline at end of file diff --git a/SourceCode/GPS/Forms/Settings/FormNozSettings.Designer.cs b/SourceCode/GPS/Forms/Settings/FormNozSettings.Designer.cs deleted file mode 100644 index a6cc86fb7..000000000 --- a/SourceCode/GPS/Forms/Settings/FormNozSettings.Designer.cs +++ /dev/null @@ -1,586 +0,0 @@ -namespace AgOpenGPS -{ - partial class FormNozSettings - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.bntOK = new System.Windows.Forms.Button(); - this.label10 = new System.Windows.Forms.Label(); - this.lblRateSet1 = new System.Windows.Forms.Label(); - this.label7 = new System.Windows.Forms.Label(); - this.lblVolumeTank = new System.Windows.Forms.Label(); - this.lblVolumeApplied = new System.Windows.Forms.Label(); - this.label14 = new System.Windows.Forms.Label(); - this.lblTankRemain = new System.Windows.Forms.Label(); - this.label16 = new System.Windows.Forms.Label(); - this.lblAcresAvailable = new System.Windows.Forms.Label(); - this.lblStatArea = new System.Windows.Forms.Label(); - this.lblRateSet2 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); - this.label1 = new System.Windows.Forms.Label(); - this.btnZeroVolume = new System.Windows.Forms.Button(); - this.lblRateSet = new System.Windows.Forms.Label(); - this.label4 = new System.Windows.Forms.Label(); - this.nudTankVolume = new AgOpenGPS.NudlessNumericUpDown(); - this.nudZeroVolume = new AgOpenGPS.NudlessNumericUpDown(); - this.nudSprayRateSet2 = new AgOpenGPS.NudlessNumericUpDown(); - this.nudSprayMinPressure = new AgOpenGPS.NudlessNumericUpDown(); - this.nudSprayRateSet1 = new AgOpenGPS .NudlessNumericUpDown(); - this.timer1 = new System.Windows.Forms.Timer(this.components); - this.nudNudge = new AgOpenGPS.NudlessNumericUpDown(); - this.label5 = new System.Windows.Forms.Label(); - this.nudRateAlarmPercent = new AgOpenGPS.NudlessNumericUpDown(); - this.label6 = new System.Windows.Forms.Label(); - ((System.ComponentModel.ISupportInitialize)(this.nudTankVolume)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudZeroVolume)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudSprayRateSet2)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudSprayMinPressure)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudSprayRateSet1)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudNudge)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudRateAlarmPercent)).BeginInit(); - this.SuspendLayout(); - // - // bntOK - // - this.bntOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.bntOK.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; - this.bntOK.FlatAppearance.BorderSize = 0; - this.bntOK.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.bntOK.Font = new System.Drawing.Font("Tahoma", 14.25F); - this.bntOK.Image = global::AgOpenGPS.Properties.Resources.OK64; - this.bntOK.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.bntOK.Location = new System.Drawing.Point(576, 420); - this.bntOK.Name = "bntOK"; - this.bntOK.Size = new System.Drawing.Size(166, 65); - this.bntOK.TabIndex = 0; - this.bntOK.TextAlign = System.Drawing.ContentAlignment.TopLeft; - this.bntOK.UseVisualStyleBackColor = true; - this.bntOK.Click += new System.EventHandler(this.bntOK_Click); - // - // label10 - // - this.label10.BackColor = System.Drawing.Color.Transparent; - this.label10.Font = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label10.ForeColor = System.Drawing.Color.White; - this.label10.Location = new System.Drawing.Point(29, 150); - this.label10.Name = "label10"; - this.label10.Size = new System.Drawing.Size(166, 28); - this.label10.TabIndex = 590; - this.label10.Text = "Min Pressure"; - this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // lblRateSet1 - // - this.lblRateSet1.BackColor = System.Drawing.Color.Transparent; - this.lblRateSet1.Font = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblRateSet1.ForeColor = System.Drawing.Color.White; - this.lblRateSet1.Location = new System.Drawing.Point(551, 143); - this.lblRateSet1.Name = "lblRateSet1"; - this.lblRateSet1.Size = new System.Drawing.Size(166, 28); - this.lblRateSet1.TabIndex = 578; - this.lblRateSet1.Text = " Gal / Acre"; - this.lblRateSet1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // label7 - // - this.label7.BackColor = System.Drawing.Color.Transparent; - this.label7.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label7.ForeColor = System.Drawing.Color.White; - this.label7.Location = new System.Drawing.Point(32, 12); - this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(77, 19); - this.label7.TabIndex = 603; - this.label7.Text = "Tank"; - this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // lblVolumeTank - // - this.lblVolumeTank.BackColor = System.Drawing.Color.Transparent; - this.lblVolumeTank.Font = new System.Drawing.Font("Arial", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblVolumeTank.ForeColor = System.Drawing.Color.White; - this.lblVolumeTank.Location = new System.Drawing.Point(20, 31); - this.lblVolumeTank.Name = "lblVolumeTank"; - this.lblVolumeTank.Size = new System.Drawing.Size(101, 38); - this.lblVolumeTank.TabIndex = 604; - this.lblVolumeTank.Text = "1200"; - this.lblVolumeTank.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // lblVolumeApplied - // - this.lblVolumeApplied.BackColor = System.Drawing.Color.Transparent; - this.lblVolumeApplied.Font = new System.Drawing.Font("Arial", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblVolumeApplied.ForeColor = System.Drawing.Color.White; - this.lblVolumeApplied.Location = new System.Drawing.Point(121, 31); - this.lblVolumeApplied.Name = "lblVolumeApplied"; - this.lblVolumeApplied.Size = new System.Drawing.Size(101, 38); - this.lblVolumeApplied.TabIndex = 606; - this.lblVolumeApplied.Text = "200"; - this.lblVolumeApplied.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // label14 - // - this.label14.BackColor = System.Drawing.Color.Transparent; - this.label14.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label14.ForeColor = System.Drawing.Color.White; - this.label14.Location = new System.Drawing.Point(133, 12); - this.label14.Name = "label14"; - this.label14.Size = new System.Drawing.Size(77, 19); - this.label14.TabIndex = 605; - this.label14.Text = "Applied"; - this.label14.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // lblTankRemain - // - this.lblTankRemain.BackColor = System.Drawing.Color.Transparent; - this.lblTankRemain.Font = new System.Drawing.Font("Arial", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblTankRemain.ForeColor = System.Drawing.Color.White; - this.lblTankRemain.Location = new System.Drawing.Point(222, 31); - this.lblTankRemain.Name = "lblTankRemain"; - this.lblTankRemain.Size = new System.Drawing.Size(101, 38); - this.lblTankRemain.TabIndex = 608; - this.lblTankRemain.Text = "1000"; - this.lblTankRemain.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // label16 - // - this.label16.BackColor = System.Drawing.Color.Transparent; - this.label16.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label16.ForeColor = System.Drawing.Color.White; - this.label16.Location = new System.Drawing.Point(234, 12); - this.label16.Name = "label16"; - this.label16.Size = new System.Drawing.Size(77, 19); - this.label16.TabIndex = 607; - this.label16.Text = "Remain"; - this.label16.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // lblAcresAvailable - // - this.lblAcresAvailable.BackColor = System.Drawing.Color.Transparent; - this.lblAcresAvailable.Font = new System.Drawing.Font("Arial", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblAcresAvailable.ForeColor = System.Drawing.Color.White; - this.lblAcresAvailable.Location = new System.Drawing.Point(323, 31); - this.lblAcresAvailable.Name = "lblAcresAvailable"; - this.lblAcresAvailable.Size = new System.Drawing.Size(101, 38); - this.lblAcresAvailable.TabIndex = 610; - this.lblAcresAvailable.Text = "85.2"; - this.lblAcresAvailable.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // lblStatArea - // - this.lblStatArea.BackColor = System.Drawing.Color.Transparent; - this.lblStatArea.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblStatArea.ForeColor = System.Drawing.Color.White; - this.lblStatArea.Location = new System.Drawing.Point(335, 12); - this.lblStatArea.Name = "lblStatArea"; - this.lblStatArea.Size = new System.Drawing.Size(77, 19); - this.lblStatArea.TabIndex = 609; - this.lblStatArea.Text = "Ac"; - this.lblStatArea.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // lblRateSet2 - // - this.lblRateSet2.BackColor = System.Drawing.Color.Transparent; - this.lblRateSet2.Font = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblRateSet2.ForeColor = System.Drawing.Color.White; - this.lblRateSet2.Location = new System.Drawing.Point(551, 283); - this.lblRateSet2.Name = "lblRateSet2"; - this.lblRateSet2.Size = new System.Drawing.Size(166, 28); - this.lblRateSet2.TabIndex = 612; - this.lblRateSet2.Text = " Gal / Acre"; - this.lblRateSet2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // label2 - // - this.label2.BackColor = System.Drawing.Color.Transparent; - this.label2.Font = new System.Drawing.Font("Arial", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label2.ForeColor = System.Drawing.Color.White; - this.label2.Location = new System.Drawing.Point(497, 96); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(57, 33); - this.label2.TabIndex = 613; - this.label2.Text = "1:"; - this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // label3 - // - this.label3.BackColor = System.Drawing.Color.Transparent; - this.label3.Font = new System.Drawing.Font("Arial", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label3.ForeColor = System.Drawing.Color.White; - this.label3.Location = new System.Drawing.Point(497, 236); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(57, 33); - this.label3.TabIndex = 614; - this.label3.Text = "2:"; - this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // label1 - // - this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.Font = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label1.ForeColor = System.Drawing.Color.White; - this.label1.Location = new System.Drawing.Point(276, 433); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(166, 28); - this.label1.TabIndex = 618; - this.label1.Text = "Zero Applied"; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // btnZeroVolume - // - this.btnZeroVolume.BackColor = System.Drawing.Color.White; - this.btnZeroVolume.BackgroundImage = global::AgOpenGPS.Properties.Resources.SteerZero; - this.btnZeroVolume.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; - this.btnZeroVolume.FlatAppearance.BorderColor = System.Drawing.SystemColors.AppWorkspace; - this.btnZeroVolume.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btnZeroVolume.Font = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnZeroVolume.ForeColor = System.Drawing.Color.White; - this.btnZeroVolume.Location = new System.Drawing.Point(285, 366); - this.btnZeroVolume.Name = "btnZeroVolume"; - this.btnZeroVolume.Size = new System.Drawing.Size(149, 65); - this.btnZeroVolume.TabIndex = 617; - this.btnZeroVolume.UseVisualStyleBackColor = false; - this.btnZeroVolume.Click += new System.EventHandler(this.btnZeroVolume_Click); - // - // lblRateSet - // - this.lblRateSet.BackColor = System.Drawing.Color.Transparent; - this.lblRateSet.Font = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblRateSet.ForeColor = System.Drawing.Color.White; - this.lblRateSet.Location = new System.Drawing.Point(276, 290); - this.lblRateSet.Name = "lblRateSet"; - this.lblRateSet.Size = new System.Drawing.Size(166, 28); - this.lblRateSet.TabIndex = 616; - this.lblRateSet.Text = "Applied"; - this.lblRateSet.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // label4 - // - this.label4.BackColor = System.Drawing.Color.Transparent; - this.label4.Font = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label4.ForeColor = System.Drawing.Color.White; - this.label4.Location = new System.Drawing.Point(276, 149); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(166, 28); - this.label4.TabIndex = 620; - this.label4.Text = "Tank Volume"; - this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // nudTankVolume - // - this.nudTankVolume.BackColor = System.Drawing.Color.White; - this.nudTankVolume.Font = new System.Drawing.Font("Tahoma", 36F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.nudTankVolume.Location = new System.Drawing.Point(259, 84); - this.nudTankVolume.Maximum = new decimal(new int[] { - 10000, - 0, - 0, - 0}); - this.nudTankVolume.Name = "nudTankVolume"; - this.nudTankVolume.ReadOnly = true; - this.nudTankVolume.Size = new System.Drawing.Size(201, 65); - this.nudTankVolume.TabIndex = 619; - this.nudTankVolume.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - this.nudTankVolume.Value = new decimal(new int[] { - 0, - 0, - 0, - 0}); - this.nudTankVolume.Click += new System.EventHandler(this.nudTankVolume_Click); - // - // nudZeroVolume - // - this.nudZeroVolume.BackColor = System.Drawing.Color.White; - this.nudZeroVolume.Font = new System.Drawing.Font("Tahoma", 36F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.nudZeroVolume.Location = new System.Drawing.Point(259, 225); - this.nudZeroVolume.Maximum = new decimal(new int[] { - 10000, - 0, - 0, - 0}); - this.nudZeroVolume.Name = "nudZeroVolume"; - this.nudZeroVolume.ReadOnly = true; - this.nudZeroVolume.Size = new System.Drawing.Size(201, 65); - this.nudZeroVolume.TabIndex = 615; - this.nudZeroVolume.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - this.nudZeroVolume.Value = new decimal(new int[] { - 0, - 0, - 0, - 0}); - this.nudZeroVolume.Click += new System.EventHandler(this.nudZeroVolume_Click); - // - // nudSprayRateSet2 - // - this.nudSprayRateSet2.BackColor = System.Drawing.Color.PaleGreen; - this.nudSprayRateSet2.DecimalPlaces = 1; - this.nudSprayRateSet2.Font = new System.Drawing.Font("Tahoma", 36F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.nudSprayRateSet2.Location = new System.Drawing.Point(541, 222); - this.nudSprayRateSet2.Maximum = new decimal(new int[] { - 2000, - 0, - 0, - 0}); - this.nudSprayRateSet2.Minimum = new decimal(new int[] { - 3, - 0, - 0, - 0}); - this.nudSprayRateSet2.Name = "nudSprayRateSet2"; - this.nudSprayRateSet2.ReadOnly = true; - this.nudSprayRateSet2.Size = new System.Drawing.Size(186, 65); - this.nudSprayRateSet2.TabIndex = 611; - this.nudSprayRateSet2.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - this.nudSprayRateSet2.Value = new decimal(new int[] { - 9999, - 0, - 0, - 65536}); - this.nudSprayRateSet2.Click += new System.EventHandler(this.nudSprayRateSet2_Click); - // - // nudSprayMinPressure - // - this.nudSprayMinPressure.BackColor = System.Drawing.Color.White; - this.nudSprayMinPressure.Font = new System.Drawing.Font("Tahoma", 36F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.nudSprayMinPressure.ForeColor = System.Drawing.SystemColors.ActiveCaptionText; - this.nudSprayMinPressure.Location = new System.Drawing.Point(37, 84); - this.nudSprayMinPressure.Minimum = new decimal(new int[] { - 1, - 0, - 0, - 0}); - this.nudSprayMinPressure.Name = "nudSprayMinPressure"; - this.nudSprayMinPressure.ReadOnly = true; - this.nudSprayMinPressure.Size = new System.Drawing.Size(150, 65); - this.nudSprayMinPressure.TabIndex = 591; - this.nudSprayMinPressure.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - this.nudSprayMinPressure.Value = new decimal(new int[] { - 9, - 0, - 0, - 0}); - this.nudSprayMinPressure.Click += new System.EventHandler(this.nudSprayMinPressure_Click); - // - // nudSprayRateSet1 - // - this.nudSprayRateSet1.BackColor = System.Drawing.Color.PaleGreen; - this.nudSprayRateSet1.DecimalPlaces = 1; - this.nudSprayRateSet1.Font = new System.Drawing.Font("Tahoma", 36F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.nudSprayRateSet1.Location = new System.Drawing.Point(541, 82); - this.nudSprayRateSet1.Maximum = new decimal(new int[] { - 2000, - 0, - 0, - 0}); - this.nudSprayRateSet1.Minimum = new decimal(new int[] { - 3, - 0, - 0, - 0}); - this.nudSprayRateSet1.Name = "nudSprayRateSet1"; - this.nudSprayRateSet1.ReadOnly = true; - this.nudSprayRateSet1.Size = new System.Drawing.Size(186, 65); - this.nudSprayRateSet1.TabIndex = 577; - this.nudSprayRateSet1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - this.nudSprayRateSet1.Value = new decimal(new int[] { - 9999, - 0, - 0, - 65536}); - this.nudSprayRateSet1.Click += new System.EventHandler(this.nudSprayRateSet1_Click); - // - // timer1 - // - this.timer1.Enabled = true; - this.timer1.Interval = 1000; - this.timer1.Tick += new System.EventHandler(this.timer1_Tick); - // - // nudNudge - // - this.nudNudge.BackColor = System.Drawing.Color.White; - this.nudNudge.DecimalPlaces = 1; - this.nudNudge.Font = new System.Drawing.Font("Tahoma", 36F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.nudNudge.ForeColor = System.Drawing.SystemColors.ActiveCaptionText; - this.nudNudge.Location = new System.Drawing.Point(37, 366); - this.nudNudge.Maximum = new decimal(new int[] { - 30, - 0, - 0, - 0}); - this.nudNudge.Minimum = new decimal(new int[] { - 1, - 0, - 0, - 65536}); - this.nudNudge.Name = "nudNudge"; - this.nudNudge.ReadOnly = true; - this.nudNudge.Size = new System.Drawing.Size(150, 65); - this.nudNudge.TabIndex = 623; - this.nudNudge.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - this.nudNudge.Value = new decimal(new int[] { - 10, - 0, - 0, - 0}); - this.nudNudge.Click += new System.EventHandler(this.nudNudge_Click); - // - // label5 - // - this.label5.BackColor = System.Drawing.Color.Transparent; - this.label5.Font = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label5.ForeColor = System.Drawing.Color.White; - this.label5.Location = new System.Drawing.Point(29, 435); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(166, 28); - this.label5.TabIndex = 622; - this.label5.Text = "Rate Nudge"; - this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // nudRateAlarmPercent - // - this.nudRateAlarmPercent.BackColor = System.Drawing.Color.White; - this.nudRateAlarmPercent.Font = new System.Drawing.Font("Tahoma", 36F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.nudRateAlarmPercent.ForeColor = System.Drawing.SystemColors.ActiveCaptionText; - this.nudRateAlarmPercent.Location = new System.Drawing.Point(37, 222); - this.nudRateAlarmPercent.Minimum = new decimal(new int[] { - 1, - 0, - 0, - 0}); - this.nudRateAlarmPercent.Name = "nudRateAlarmPercent"; - this.nudRateAlarmPercent.ReadOnly = true; - this.nudRateAlarmPercent.Size = new System.Drawing.Size(150, 65); - this.nudRateAlarmPercent.TabIndex = 625; - this.nudRateAlarmPercent.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - this.nudRateAlarmPercent.Value = new decimal(new int[] { - 7, - 0, - 0, - 0}); - this.nudRateAlarmPercent.Click += new System.EventHandler(this.nudRateAlarmPercent_Click); - // - // label6 - // - this.label6.BackColor = System.Drawing.Color.Transparent; - this.label6.Font = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label6.ForeColor = System.Drawing.Color.White; - this.label6.Location = new System.Drawing.Point(29, 288); - this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(166, 28); - this.label6.TabIndex = 624; - this.label6.Text = "Rate Alarm %"; - this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // FormNozSettings - // - this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; - this.AutoScroll = true; - this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(25)))), ((int)(((byte)(45))))); - this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; - this.ClientSize = new System.Drawing.Size(752, 498); - this.ControlBox = false; - this.Controls.Add(this.nudRateAlarmPercent); - this.Controls.Add(this.label6); - this.Controls.Add(this.nudNudge); - this.Controls.Add(this.label5); - this.Controls.Add(this.nudTankVolume); - this.Controls.Add(this.label4); - this.Controls.Add(this.label1); - this.Controls.Add(this.btnZeroVolume); - this.Controls.Add(this.nudZeroVolume); - this.Controls.Add(this.lblRateSet); - this.Controls.Add(this.nudSprayRateSet2); - this.Controls.Add(this.lblRateSet2); - this.Controls.Add(this.lblAcresAvailable); - this.Controls.Add(this.lblStatArea); - this.Controls.Add(this.lblTankRemain); - this.Controls.Add(this.label16); - this.Controls.Add(this.lblVolumeApplied); - this.Controls.Add(this.label14); - this.Controls.Add(this.lblVolumeTank); - this.Controls.Add(this.label7); - this.Controls.Add(this.nudSprayMinPressure); - this.Controls.Add(this.label10); - this.Controls.Add(this.nudSprayRateSet1); - this.Controls.Add(this.bntOK); - this.Controls.Add(this.lblRateSet1); - this.Controls.Add(this.label2); - this.Controls.Add(this.label3); - this.DoubleBuffered = true; - this.Font = new System.Drawing.Font("Tahoma", 9.75F); - this.Margin = new System.Windows.Forms.Padding(4); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "FormNozSettings"; - this.ShowInTaskbar = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Nozzle Configuration"; - this.Load += new System.EventHandler(this.FormDisplaySettings_Load); - ((System.ComponentModel.ISupportInitialize)(this.nudTankVolume)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudZeroVolume)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudSprayRateSet2)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudSprayMinPressure)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudSprayRateSet1)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudNudge)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudRateAlarmPercent)).EndInit(); - this.ResumeLayout(false); - - } - - #endregion - private System.Windows.Forms.Button bntOK; - private NudlessNumericUpDown nudSprayMinPressure; - private System.Windows.Forms.Label label10; - private System.Windows.Forms.Label lblRateSet1; - private NudlessNumericUpDown nudSprayRateSet1; - private System.Windows.Forms.Label label7; - private System.Windows.Forms.Label lblVolumeTank; - private System.Windows.Forms.Label lblVolumeApplied; - private System.Windows.Forms.Label label14; - private System.Windows.Forms.Label lblTankRemain; - private System.Windows.Forms.Label label16; - private System.Windows.Forms.Label lblAcresAvailable; - private System.Windows.Forms.Label lblStatArea; - private NudlessNumericUpDown nudSprayRateSet2; - private System.Windows.Forms.Label lblRateSet2; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label label3; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Button btnZeroVolume; - private NudlessNumericUpDown nudZeroVolume; - private System.Windows.Forms.Label lblRateSet; - private NudlessNumericUpDown nudTankVolume; - private System.Windows.Forms.Label label4; - private System.Windows.Forms.Timer timer1; - private NudlessNumericUpDown nudNudge; - private System.Windows.Forms.Label label5; - private NudlessNumericUpDown nudRateAlarmPercent; - private System.Windows.Forms.Label label6; - } -} \ No newline at end of file diff --git a/SourceCode/GPS/Forms/Settings/FormNozSettings.cs b/SourceCode/GPS/Forms/Settings/FormNozSettings.cs deleted file mode 100644 index 572543d89..000000000 --- a/SourceCode/GPS/Forms/Settings/FormNozSettings.cs +++ /dev/null @@ -1,213 +0,0 @@ -//Please, if you use this, share the improvements - -using AgOpenGPS.Properties; -using System; -using System.Drawing; -using System.Globalization; -using System.Windows.Forms; - -namespace AgOpenGPS -{ - public partial class FormNozSettings : Form - { - //class variables - private readonly FormGPS mf = null; - - //Nozzz constructor - public FormNozSettings(Form callingForm) - { - //get copy of the calling main form - mf = callingForm as FormGPS; - InitializeComponent(); - - //Language keys - this.Text = "Sprayer Settings"; - } - - private void FormDisplaySettings_Load(object sender, EventArgs e) - { - nudSprayRateSet1.Value = (decimal)(Properties.Settings.Default.setNozzleSettings.volumePerAreaSet1); - nudSprayRateSet2.Value = (decimal)(Properties.Settings.Default.setNozzleSettings.volumePerAreaSet2); - nudSprayMinPressure.Value = Properties.Settings.Default.setNozzleSettings.pressureMin; - - if (mf.isMetric) - { - lblRateSet1.Text = mf.nozz.unitsPerArea; - lblRateSet2.Text = mf.nozz.unitsPerArea; - nudSprayRateSet1.Maximum = 999M; - nudSprayRateSet1.Minimum = 5M; - nudSprayRateSet1.DecimalPlaces = 0; - nudSprayRateSet2.Maximum = 999M; - nudSprayRateSet2.Minimum = 5M; - nudSprayRateSet2.DecimalPlaces = 0; - - lblVolumeTank.Text = mf.nozz.volumeTankStart.ToString(); - lblVolumeApplied.Text = mf.nozz.volumeApplied.ToString(); - lblRateSet.Text = mf.nozz.unitsApplied + " Applied"; - lblStatArea.Text = "Ha"; - } - else - { - lblRateSet1.Text = mf.nozz.unitsPerArea; - lblRateSet2.Text = mf.nozz.unitsPerArea; - nudSprayRateSet1.Maximum = 99.9M; - nudSprayRateSet1.Minimum = 1M; - nudSprayRateSet1.DecimalPlaces = 1; - nudSprayRateSet2.Maximum = 99.9M; - nudSprayRateSet2.Minimum = 1M; - nudSprayRateSet2.DecimalPlaces = 1; - lblRateSet.Text = mf.nozz.unitsApplied + "Applied"; - lblStatArea.Text = "Acre"; - } - - nudTankVolume.Value = Properties.Settings.Default.setNozzleSettings.volumeTankStart; - nudZeroVolume.Value = (decimal)mf.nozz.volumeApplied; - - lblVolumeTank.Text = mf.nozz.volumeTankStart.ToString(); - lblVolumeApplied.Text = mf.nozz.volumeApplied.ToString("N1"); - lblTankRemain.Text = (mf.nozz.volumeTankStart - mf.nozz.volumeApplied).ToString("N1"); - lblAcresAvailable.Text = ((mf.nozz.volumeTankStart - mf.nozz.volumeApplied) / mf.nozz.volumePerAreaSetSelected).ToString("N1"); - - nudNudge.Value = (decimal)Properties.Settings.Default.setNozzleSettings.rateNudge; - nudRateAlarmPercent.Value = (int)(mf.nozz.rateAlarmPercent * 100); - } - - private void nudSprayRateSet1_Click(object sender, EventArgs e) - { - if (mf.KeypadToNUD((NudlessNumericUpDown)sender, this)) - { - if (mf.isMetric) - { - nudSprayRateSet1.Value = Math.Round(nudSprayRateSet1.Value, 0); - } - mf.nozz.volumePerAreaSet1 = (double)nudSprayRateSet1.Value; - - Properties.Settings.Default.setNozzleSettings.volumePerAreaSet1 = (double)nudSprayRateSet1.Value; - Settings.Default.Save(); - } - } - private void nudSprayRateSet2_Click(object sender, EventArgs e) - { - if (mf.KeypadToNUD((NudlessNumericUpDown)sender, this)) - { - if (mf.isMetric) - { - nudSprayRateSet2.Value = Math.Round(nudSprayRateSet2.Value, 0); - } - - mf.nozz.volumePerAreaSet2 = (double)nudSprayRateSet2.Value; - Properties.Settings.Default.setNozzleSettings.volumePerAreaSet2 = (double)nudSprayRateSet2.Value; - Settings.Default.Save(); - } - } - - private void nudSprayMinPressure_Click(object sender, EventArgs e) - { - mf.KeypadToNUD((NudlessNumericUpDown)sender, this); - - Properties.Settings.Default.setNozzleSettings.pressureMin = (int)nudSprayMinPressure.Value; - Settings.Default.Save(); - - mf.p_226.pgn[mf.p_226.minPressure] = unchecked((byte)(Properties.Settings.Default.setNozzleSettings.pressureMin)); - - mf.SendPgnToLoop(mf.p_226.pgn); - } - - private void bntOK_Click(object sender, EventArgs e) - { - mf.p_225.pgn[mf.p_225.zeroTankVolumeLo] = 0; - mf.p_225.pgn[mf.p_225.zeroTankVolumeHi] = 0; - - Settings.Default.Save(); - Close(); - } - - private void nudTankVolume_Click(object sender, EventArgs e) - { - if (mf.KeypadToNUD((NudlessNumericUpDown)sender, this)) - { - mf.nozz.volumeTankStart = (int)nudTankVolume.Value; - Properties.Settings.Default.setNozzleSettings.volumeTankStart = mf.nozz.volumeTankStart; - } - } - - private void nudZeroVolume_Click(object sender, EventArgs e) - { - if (mf.KeypadToNUD((NudlessNumericUpDown)sender, this)) - { - if (nudZeroVolume.Value < 2) - { - mf.nozz.volumeApplied = 0; - - mf.p_225.pgn[mf.p_225.zeroTankVolumeLo] = 1; - mf.p_225.pgn[mf.p_225.zeroTankVolumeHi] = 0; - - mf.SendPgnToLoop(mf.p_225.pgn); - - mf.p_225.pgn[mf.p_225.zeroTankVolumeLo] = 0; - mf.p_225.pgn[mf.p_225.zeroTankVolumeHi] = 0; - } - else - { - mf.nozz.volumeApplied = (double)nudZeroVolume.Value; - - int vol = (int)nudZeroVolume.Value; - - mf.p_226.pgn[mf.p_226.flowCalHi] = unchecked((byte)(vol >> 8)); - mf.p_226.pgn[mf.p_226.flowCaLo] = unchecked((byte)(vol)); - - - mf.p_225.pgn[mf.p_225.zeroTankVolumeLo] = 1; - mf.p_225.pgn[mf.p_225.zeroTankVolumeHi] = 0; - - mf.SendPgnToLoop(mf.p_225.pgn); - - mf.p_225.pgn[mf.p_225.zeroTankVolumeLo] = 0; - mf.p_225.pgn[mf.p_225.zeroTankVolumeHi] = 0; - } - } - } - - private void btnZeroVolume_Click(object sender, EventArgs e) - { - mf.nozz.volumeApplied = 0; - nudZeroVolume.Value = 0; - - mf.p_225.pgn[mf.p_225.zeroTankVolumeLo] = 1; - mf.p_225.pgn[mf.p_225.zeroTankVolumeHi] = 0; - - mf.SendPgnToLoop(mf.p_225.pgn); - - mf.p_225.pgn[mf.p_225.zeroTankVolumeLo] = 0; - mf.p_225.pgn[mf.p_225.zeroTankVolumeHi] = 0; - } - - private void timer1_Tick(object sender, EventArgs e) - { - lblVolumeTank.Text = mf.nozz.volumeTankStart.ToString(); - lblVolumeApplied.Text = mf.nozz.volumeApplied.ToString("N1"); - lblTankRemain.Text = (mf.nozz.volumeTankStart - mf.nozz.volumeApplied).ToString("N1"); - lblAcresAvailable.Text = ((mf.nozz.volumeTankStart - mf.nozz.volumeApplied) / mf.nozz.volumePerAreaSetSelected).ToString("N1"); - } - - private void nudNudge_Click(object sender, EventArgs e) - { - if (mf.KeypadToNUD((NudlessNumericUpDown)sender, this)) - { - Properties.Settings.Default.setNozzleSettings.rateNudge = (double)nudNudge.Value; - Settings.Default.Save(); - mf.nozz.rateNudge = (double)nudNudge.Value; - } - } - - private void nudRateAlarmPercent_Click(object sender, EventArgs e) - { - if (mf.KeypadToNUD((NudlessNumericUpDown)sender, this)) - { - mf.nozz.rateAlarmPercent = (double)nudRateAlarmPercent.Value * 0.01; - Properties.Settings.Default.setNozzleSettings.rateAlarmPercent = mf.nozz.rateAlarmPercent; - Settings.Default.Save(); - } - } - } -} \ No newline at end of file diff --git a/SourceCode/GPS/Forms/Settings/FormNozSettings.resx b/SourceCode/GPS/Forms/Settings/FormNozSettings.resx deleted file mode 100644 index e2a4ce32f..000000000 --- a/SourceCode/GPS/Forms/Settings/FormNozSettings.resx +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 17, 17 - - - 35 - - \ No newline at end of file diff --git a/SourceCode/GPS/Forms/UDPComm.Designer.cs b/SourceCode/GPS/Forms/UDPComm.Designer.cs index 7cbf983c4..7ce5485b5 100644 --- a/SourceCode/GPS/Forms/UDPComm.Designer.cs +++ b/SourceCode/GPS/Forms/UDPComm.Designer.cs @@ -270,26 +270,6 @@ private void ReceiveFromAgIO(byte[] data) break; } - //back from spray controller - case 224: - { - nozz.volumeApplied = (Int16)((data[6] << 8) + data[5]); - nozz.volumeApplied *= 0.1; - - //times 100 - nozz.volumePerMinuteActual = (Int16)((data[8] << 8) + data[7]); - - nozz.pressureActual = data[9]; - - nozz.isFlowingFlag = data[10]; - - nozz.pwmDriveActual = data[11]; - if (data[12] == 0) nozz.pwmDriveActual *= -1; - - break; - } - - #region Remote Switches case 234://MTZ8302 Feb 2020 { diff --git a/SourceCode/GPS/Properties/Settings.Designer.cs b/SourceCode/GPS/Properties/Settings.Designer.cs index 5bf68e93d..ec3ec6f6a 100644 --- a/SourceCode/GPS/Properties/Settings.Designer.cs +++ b/SourceCode/GPS/Properties/Settings.Designer.cs @@ -3108,29 +3108,6 @@ public int setAS_deadZoneDelay { } } - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public global::AgOpenGPS.CNozzleSettings setNozzleSettings { - get { - return ((global::AgOpenGPS.CNozzleSettings)(this["setNozzleSettings"])); - } - set { - this["setNozzleSettings"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool setApp_isNozzleApp { - get { - return ((bool)(this["setApp_isNozzleApp"])); - } - set { - this["setApp_isNozzleApp"] = value; - } - } - [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("0.8")] diff --git a/SourceCode/GPS/Properties/Settings.settings b/SourceCode/GPS/Properties/Settings.settings index a90864ab7..86d463c0d 100644 --- a/SourceCode/GPS/Properties/Settings.settings +++ b/SourceCode/GPS/Properties/Settings.settings @@ -773,12 +773,6 @@ 5 - - - - - False - 0.8 diff --git a/SourceCode/GPS/app.config b/SourceCode/GPS/app.config index c8c0db945..19d4e0a58 100644 --- a/SourceCode/GPS/app.config +++ b/SourceCode/GPS/app.config @@ -316,9 +316,6 @@ -62208,-12299010,-16190712,-1505559,-3621034,-16712458,-7330570,-1546731,-24406,-3289866,-2756674,-538377,-134768,-4457734,-1848839,-530985 - - AGOpenGPS - True @@ -646,12 +643,6 @@ 0 - - AgOpenGPS - - - AgOpenGPS - 0.06 @@ -775,9 +766,6 @@ 5 - - False - 0.8 diff --git a/SourceCode/ModSim/Source/Forms/FormSim.Designer.cs b/SourceCode/ModSim/Source/Forms/FormSim.Designer.cs index 666a329c0..8c319c4ed 100644 --- a/SourceCode/ModSim/Source/Forms/FormSim.Designer.cs +++ b/SourceCode/ModSim/Source/Forms/FormSim.Designer.cs @@ -37,6 +37,7 @@ private void InitializeComponent() this.lbl9To16 = new System.Windows.Forms.Label(); this.btnSteerButtonRemote = new System.Windows.Forms.Button(); this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.label6 = new System.Windows.Forms.Label(); this.lblScanReply = new System.Windows.Forms.Label(); this.lblSteerSwitchStatus = new System.Windows.Forms.Label(); this.label20 = new System.Windows.Forms.Label(); @@ -87,12 +88,6 @@ private void InitializeComponent() this.lblSingleInputWAS = new System.Windows.Forms.Label(); this.lblRelayActHigh = new System.Windows.Forms.Label(); this.lblMotorDirection = new System.Windows.Forms.Label(); - this.lblBypassPercent = new System.Windows.Forms.Label(); - this.label12 = new System.Windows.Forms.Label(); - this.lblTotalVolume = new System.Windows.Forms.Label(); - this.label10 = new System.Windows.Forms.Label(); - this.lblSetGPM = new System.Windows.Forms.Label(); - this.label8 = new System.Windows.Forms.Label(); this.cboxKSXT = new System.Windows.Forms.CheckBox(); this.cboxNDA = new System.Windows.Forms.CheckBox(); this.lblWAS = new System.Windows.Forms.Label(); @@ -154,7 +149,6 @@ private void InitializeComponent() this.lblZone6 = new System.Windows.Forms.Label(); this.lblZone7 = new System.Windows.Forms.Label(); this.lblZone8 = new System.Windows.Forms.Label(); - this.label6 = new System.Windows.Forms.Label(); this.groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.tbarSteerAngleWAS)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tbarSpeed)).BeginInit(); @@ -290,6 +284,17 @@ private void InitializeComponent() this.groupBox1.TabStop = false; this.groupBox1.Text = "Steer Module"; // + // label6 + // + this.label6.AutoSize = true; + this.label6.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label6.Location = new System.Drawing.Point(6, 444); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(60, 19); + this.label6.TabIndex = 562; + this.label6.Text = "SubNet"; + this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // lblScanReply // this.lblScanReply.BackColor = System.Drawing.Color.Transparent; @@ -939,84 +944,6 @@ private void InitializeComponent() this.lblMotorDirection.TabIndex = 540; this.lblMotorDirection.Text = "."; // - // lblBypassPercent - // - this.lblBypassPercent.AutoSize = true; - this.lblBypassPercent.BackColor = System.Drawing.Color.SeaShell; - this.lblBypassPercent.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblBypassPercent.ForeColor = System.Drawing.Color.Black; - this.lblBypassPercent.Location = new System.Drawing.Point(232, 489); - this.lblBypassPercent.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.lblBypassPercent.Name = "lblBypassPercent"; - this.lblBypassPercent.Size = new System.Drawing.Size(14, 19); - this.lblBypassPercent.TabIndex = 566; - this.lblBypassPercent.Text = "."; - // - // label12 - // - this.label12.AutoSize = true; - this.label12.BackColor = System.Drawing.Color.Transparent; - this.label12.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label12.ForeColor = System.Drawing.Color.Black; - this.label12.Location = new System.Drawing.Point(154, 489); - this.label12.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label12.Name = "label12"; - this.label12.Size = new System.Drawing.Size(78, 19); - this.label12.TabIndex = 565; - this.label12.Text = "Bypass %"; - // - // lblTotalVolume - // - this.lblTotalVolume.AutoSize = true; - this.lblTotalVolume.BackColor = System.Drawing.Color.SeaShell; - this.lblTotalVolume.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblTotalVolume.ForeColor = System.Drawing.Color.Black; - this.lblTotalVolume.Location = new System.Drawing.Point(90, 510); - this.lblTotalVolume.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.lblTotalVolume.Name = "lblTotalVolume"; - this.lblTotalVolume.Size = new System.Drawing.Size(14, 19); - this.lblTotalVolume.TabIndex = 564; - this.lblTotalVolume.Text = "."; - // - // label10 - // - this.label10.AutoSize = true; - this.label10.BackColor = System.Drawing.Color.Transparent; - this.label10.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label10.ForeColor = System.Drawing.Color.Black; - this.label10.Location = new System.Drawing.Point(28, 510); - this.label10.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label10.Name = "label10"; - this.label10.Size = new System.Drawing.Size(63, 19); - this.label10.TabIndex = 563; - this.label10.Text = "Volume"; - // - // lblSetGPM - // - this.lblSetGPM.AutoSize = true; - this.lblSetGPM.BackColor = System.Drawing.Color.SeaShell; - this.lblSetGPM.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblSetGPM.ForeColor = System.Drawing.Color.Black; - this.lblSetGPM.Location = new System.Drawing.Point(90, 489); - this.lblSetGPM.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.lblSetGPM.Name = "lblSetGPM"; - this.lblSetGPM.Size = new System.Drawing.Size(14, 19); - this.lblSetGPM.TabIndex = 562; - this.lblSetGPM.Text = "."; - // - // label8 - // - this.label8.AutoSize = true; - this.label8.BackColor = System.Drawing.Color.Transparent; - this.label8.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label8.ForeColor = System.Drawing.Color.Black; - this.label8.Location = new System.Drawing.Point(22, 489); - this.label8.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(69, 19); - this.label8.TabIndex = 561; - this.label8.Text = "Set Flow"; - // // cboxKSXT // this.cboxKSXT.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); @@ -1716,7 +1643,7 @@ private void InitializeComponent() this.lblZone1.BackColor = System.Drawing.Color.Transparent; this.lblZone1.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblZone1.ForeColor = System.Drawing.Color.Black; - this.lblZone1.Location = new System.Drawing.Point(4, 542); + this.lblZone1.Location = new System.Drawing.Point(4, 498); this.lblZone1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lblZone1.Name = "lblZone1"; this.lblZone1.Size = new System.Drawing.Size(88, 18); @@ -1730,7 +1657,7 @@ private void InitializeComponent() this.lblZone2.BackColor = System.Drawing.Color.Transparent; this.lblZone2.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblZone2.ForeColor = System.Drawing.Color.Black; - this.lblZone2.Location = new System.Drawing.Point(92, 542); + this.lblZone2.Location = new System.Drawing.Point(92, 498); this.lblZone2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lblZone2.Name = "lblZone2"; this.lblZone2.Size = new System.Drawing.Size(88, 18); @@ -1744,7 +1671,7 @@ private void InitializeComponent() this.lblZone3.BackColor = System.Drawing.Color.Transparent; this.lblZone3.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblZone3.ForeColor = System.Drawing.Color.Black; - this.lblZone3.Location = new System.Drawing.Point(180, 542); + this.lblZone3.Location = new System.Drawing.Point(180, 498); this.lblZone3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lblZone3.Name = "lblZone3"; this.lblZone3.Size = new System.Drawing.Size(88, 18); @@ -1758,7 +1685,7 @@ private void InitializeComponent() this.lblZone4.BackColor = System.Drawing.Color.Transparent; this.lblZone4.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblZone4.ForeColor = System.Drawing.Color.Black; - this.lblZone4.Location = new System.Drawing.Point(268, 542); + this.lblZone4.Location = new System.Drawing.Point(268, 498); this.lblZone4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lblZone4.Name = "lblZone4"; this.lblZone4.Size = new System.Drawing.Size(88, 18); @@ -1772,7 +1699,7 @@ private void InitializeComponent() this.lblZone5.BackColor = System.Drawing.Color.Transparent; this.lblZone5.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblZone5.ForeColor = System.Drawing.Color.Black; - this.lblZone5.Location = new System.Drawing.Point(356, 542); + this.lblZone5.Location = new System.Drawing.Point(356, 498); this.lblZone5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lblZone5.Name = "lblZone5"; this.lblZone5.Size = new System.Drawing.Size(88, 18); @@ -1786,7 +1713,7 @@ private void InitializeComponent() this.lblZone6.BackColor = System.Drawing.Color.Transparent; this.lblZone6.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblZone6.ForeColor = System.Drawing.Color.Black; - this.lblZone6.Location = new System.Drawing.Point(444, 542); + this.lblZone6.Location = new System.Drawing.Point(444, 498); this.lblZone6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lblZone6.Name = "lblZone6"; this.lblZone6.Size = new System.Drawing.Size(88, 18); @@ -1800,7 +1727,7 @@ private void InitializeComponent() this.lblZone7.BackColor = System.Drawing.Color.Transparent; this.lblZone7.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblZone7.ForeColor = System.Drawing.Color.Black; - this.lblZone7.Location = new System.Drawing.Point(532, 542); + this.lblZone7.Location = new System.Drawing.Point(532, 498); this.lblZone7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lblZone7.Name = "lblZone7"; this.lblZone7.Size = new System.Drawing.Size(88, 18); @@ -1814,42 +1741,25 @@ private void InitializeComponent() this.lblZone8.BackColor = System.Drawing.Color.Transparent; this.lblZone8.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblZone8.ForeColor = System.Drawing.Color.Black; - this.lblZone8.Location = new System.Drawing.Point(620, 542); + this.lblZone8.Location = new System.Drawing.Point(620, 498); this.lblZone8.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.lblZone8.Name = "lblZone8"; this.lblZone8.Size = new System.Drawing.Size(88, 18); this.lblZone8.TabIndex = 597; this.lblZone8.Text = "00000000"; // - // label6 - // - this.label6.AutoSize = true; - this.label6.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label6.Location = new System.Drawing.Point(6, 444); - this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(60, 19); - this.label6.TabIndex = 562; - this.label6.Text = "SubNet"; - this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // // FormSim // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 18F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.WhiteSmoke; this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; - this.ClientSize = new System.Drawing.Size(713, 564); - this.Controls.Add(this.lblBypassPercent); + this.ClientSize = new System.Drawing.Size(713, 520); this.Controls.Add(this.lblZone8); - this.Controls.Add(this.label12); this.Controls.Add(this.lblZone7); - this.Controls.Add(this.lblTotalVolume); this.Controls.Add(this.lblZone6); - this.Controls.Add(this.label10); this.Controls.Add(this.lblZone5); - this.Controls.Add(this.lblSetGPM); this.Controls.Add(this.lblZone4); - this.Controls.Add(this.label8); this.Controls.Add(this.lblZone3); this.Controls.Add(this.lblZone2); this.Controls.Add(this.lblZone1); @@ -2027,12 +1937,6 @@ private void InitializeComponent() private System.Windows.Forms.Label lblZone6; private System.Windows.Forms.Label lblZone7; private System.Windows.Forms.Label lblZone8; - private System.Windows.Forms.Label lblSetGPM; - private System.Windows.Forms.Label label8; - private System.Windows.Forms.Label lblTotalVolume; - private System.Windows.Forms.Label label10; - private System.Windows.Forms.Label lblBypassPercent; - private System.Windows.Forms.Label label12; private System.Windows.Forms.Label lblScanReply; private System.Windows.Forms.Label label6; } diff --git a/SourceCode/ModSim/Source/Forms/UDP.designer.cs b/SourceCode/ModSim/Source/Forms/UDP.designer.cs index f848ba70e..a23a2c580 100644 --- a/SourceCode/ModSim/Source/Forms/UDP.designer.cs +++ b/SourceCode/ModSim/Source/Forms/UDP.designer.cs @@ -209,13 +209,6 @@ private void ReceiveDataUDPAsync(IAsyncResult asyncResult) int relayLoM = 0; int relayHiM = 0; - //Spray Controller - static byte[] PGN_224 = { 0x80, 0x81, 0x7f, 224, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0xCC }; - int PGN_224_Size = PGN_224.Length - 1; - double volumePerMinuteSet=0; - double totalVolume = 0; - double sectionPercent = 1; - private void ReceiveFromUDP(byte[] data) { try @@ -225,52 +218,6 @@ private void ReceiveFromUDP(byte[] data) { switch (data[3]) { - case 227: - { - volumePerMinuteSet = ((double)(data[7] | data[8] << 8)) * 0.01; - lblSetGPM.Text = (Math.Round(volumePerMinuteSet,2)).ToString(); - - sectionPercent = (double)(data[9]); - lblBypassPercent.Text = (sectionPercent).ToString(); - sectionPercent *= 0.01; - - //send back 224 - totalVolume += ((volumePerMinuteSet / 300) * sectionPercent); - lblTotalVolume.Text = totalVolume.ToString("N1"); - int sa = (int)((totalVolume) * 10); - - //total volume - PGN_224[5] = unchecked((byte)((int)(sa))); - PGN_224[6] = unchecked((byte)((int)(sa) >> 8)); - - //gpm actual - sa = (int)((volumePerMinuteSet * 1.01) * 100); - PGN_224[7] = unchecked((byte)((int)(sa))); - PGN_224[8] = unchecked((byte)((int)(sa) >> 8)); - - //pressure - PGN_224[9] = unchecked((byte)((int)(52))); - - - //isFlowing - PGN_224[10] = unchecked((byte)((int)(1) >> 8)); - - //PWM +13 - PGN_224[11] = (byte)13; - PGN_224[12] = (byte)1; - - //checksum - int CK_A = 0; - for (int i = 2; i < PGN_224_Size; i++) - CK_A = (CK_A + PGN_224[i]); - - PGN_224[PGN_224_Size] = unchecked((byte)((int)(CK_A))); - - SendUDPMessage(PGN_224); - - break; - } - case 254: { gpsSpeed = ((double)(data[5] | data[6] << 8)) * 0.1;