From 9574cbd2c4ba5b137e84d980d71978ca797910e6 Mon Sep 17 00:00:00 2001 From: Brian Tischler Date: Fri, 5 Nov 2021 07:57:07 -0600 Subject: [PATCH 1/4] continue if not field.txt --- SourceCode/GPS/Forms/Pickers/FormFilePicker.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/SourceCode/GPS/Forms/Pickers/FormFilePicker.cs b/SourceCode/GPS/Forms/Pickers/FormFilePicker.cs index a820cde85..bc2339b18 100644 --- a/SourceCode/GPS/Forms/Pickers/FormFilePicker.cs +++ b/SourceCode/GPS/Forms/Pickers/FormFilePicker.cs @@ -92,6 +92,7 @@ private void FormFilePicker_Load(object sender, EventArgs e) } } } + else continue; //grab the boundary area filename = dir + "\\Boundary.txt"; From 0f8e55757e4295f1231042dbff99dfe9adb77fc7 Mon Sep 17 00:00:00 2001 From: Brian Tischler Date: Fri, 5 Nov 2021 08:12:11 -0600 Subject: [PATCH 2/4] Save As Headland error --- SourceCode/GPS/Forms/SaveOpen.Designer.cs | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/SourceCode/GPS/Forms/SaveOpen.Designer.cs b/SourceCode/GPS/Forms/SaveOpen.Designer.cs index 51ebb41e9..ae203f921 100644 --- a/SourceCode/GPS/Forms/SaveOpen.Designer.cs +++ b/SourceCode/GPS/Forms/SaveOpen.Designer.cs @@ -1292,18 +1292,20 @@ public void FileSaveHeadland() using (StreamWriter writer = new StreamWriter(dirField + "Headland.Txt")) { writer.WriteLine("$Headland"); - - if (bnd.bndList[0].hdLine.Count > 0) + if (bnd.bndList.Count > 0) { - for (int i = 0; i < bnd.bndList.Count; i++) + if (bnd.bndList[0].hdLine.Count > 0) { - writer.WriteLine(bnd.bndList[i].hdLine.Count.ToString(CultureInfo.InvariantCulture)); - if (bnd.bndList[0].hdLine.Count > 0) + for (int i = 0; i < bnd.bndList.Count; i++) { - for (int j = 0; j < bnd.bndList[i].hdLine.Count; j++) - writer.WriteLine(Math.Round(bnd.bndList[i].hdLine[j].easting, 3).ToString(CultureInfo.InvariantCulture) + "," + - Math.Round(bnd.bndList[i].hdLine[j].northing, 3).ToString(CultureInfo.InvariantCulture) + "," + - Math.Round(bnd.bndList[i].hdLine[j].heading, 3).ToString(CultureInfo.InvariantCulture)); + writer.WriteLine(bnd.bndList[i].hdLine.Count.ToString(CultureInfo.InvariantCulture)); + if (bnd.bndList[0].hdLine.Count > 0) + { + for (int j = 0; j < bnd.bndList[i].hdLine.Count; j++) + writer.WriteLine(Math.Round(bnd.bndList[i].hdLine[j].easting, 3).ToString(CultureInfo.InvariantCulture) + "," + + Math.Round(bnd.bndList[i].hdLine[j].northing, 3).ToString(CultureInfo.InvariantCulture) + "," + + Math.Round(bnd.bndList[i].hdLine[j].heading, 3).ToString(CultureInfo.InvariantCulture)); + } } } } From e7ccab1160ba4f72baaf3c6e2eabbd64296a2e1e Mon Sep 17 00:00:00 2001 From: jaapvandenhandel Date: Fri, 5 Nov 2021 15:41:13 +0100 Subject: [PATCH 3/4] Changed if --- SourceCode/GPS/Forms/SaveOpen.Designer.cs | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/SourceCode/GPS/Forms/SaveOpen.Designer.cs b/SourceCode/GPS/Forms/SaveOpen.Designer.cs index ae203f921..2a8c58eac 100644 --- a/SourceCode/GPS/Forms/SaveOpen.Designer.cs +++ b/SourceCode/GPS/Forms/SaveOpen.Designer.cs @@ -1292,20 +1292,18 @@ public void FileSaveHeadland() using (StreamWriter writer = new StreamWriter(dirField + "Headland.Txt")) { writer.WriteLine("$Headland"); - if (bnd.bndList.Count > 0) + + if (bnd.bndList.Count > 0 && bnd.bndList[0].hdLine.Count > 0) { - if (bnd.bndList[0].hdLine.Count > 0) + for (int i = 0; i < bnd.bndList.Count; i++) { - for (int i = 0; i < bnd.bndList.Count; i++) + writer.WriteLine(bnd.bndList[i].hdLine.Count.ToString(CultureInfo.InvariantCulture)); + if (bnd.bndList[0].hdLine.Count > 0) { - writer.WriteLine(bnd.bndList[i].hdLine.Count.ToString(CultureInfo.InvariantCulture)); - if (bnd.bndList[0].hdLine.Count > 0) - { - for (int j = 0; j < bnd.bndList[i].hdLine.Count; j++) - writer.WriteLine(Math.Round(bnd.bndList[i].hdLine[j].easting, 3).ToString(CultureInfo.InvariantCulture) + "," + - Math.Round(bnd.bndList[i].hdLine[j].northing, 3).ToString(CultureInfo.InvariantCulture) + "," + - Math.Round(bnd.bndList[i].hdLine[j].heading, 3).ToString(CultureInfo.InvariantCulture)); - } + for (int j = 0; j < bnd.bndList[i].hdLine.Count; j++) + writer.WriteLine(Math.Round(bnd.bndList[i].hdLine[j].easting, 3).ToString(CultureInfo.InvariantCulture) + "," + + Math.Round(bnd.bndList[i].hdLine[j].northing, 3).ToString(CultureInfo.InvariantCulture) + "," + + Math.Round(bnd.bndList[i].hdLine[j].heading, 3).ToString(CultureInfo.InvariantCulture)); } } } From ef3752f4e608fd9f7adcf7afa84f32a0959fb09b Mon Sep 17 00:00:00 2001 From: Brian Tischler Date: Fri, 5 Nov 2021 10:08:18 -0600 Subject: [PATCH 4/4] Date Time check off in Save As --- SourceCode/GPS/Forms/FormSaveAs.Designer.cs | 80 +++++++++++++++++++-- SourceCode/GPS/Forms/FormSaveAs.cs | 4 +- 2 files changed, 78 insertions(+), 6 deletions(-) diff --git a/SourceCode/GPS/Forms/FormSaveAs.Designer.cs b/SourceCode/GPS/Forms/FormSaveAs.Designer.cs index 06aa9575b..4028ec13e 100644 --- a/SourceCode/GPS/Forms/FormSaveAs.Designer.cs +++ b/SourceCode/GPS/Forms/FormSaveAs.Designer.cs @@ -41,6 +41,10 @@ private void InitializeComponent() this.chkGuidanceLines = new System.Windows.Forms.CheckBox(); this.chkFlags = new System.Windows.Forms.CheckBox(); this.panel1 = new System.Windows.Forms.Panel(); + this.cboxAddTime = new System.Windows.Forms.CheckBox(); + this.cboxAddDate = new System.Windows.Forms.CheckBox(); + this.label2 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); this.panel1.SuspendLayout(); this.SuspendLayout(); // @@ -79,7 +83,7 @@ private void InitializeComponent() this.btnSerialCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnSerialCancel.Font = new System.Drawing.Font("Tahoma", 12F); this.btnSerialCancel.Image = global::AgOpenGPS.Properties.Resources.Cancel64; - this.btnSerialCancel.Location = new System.Drawing.Point(550, 262); + this.btnSerialCancel.Location = new System.Drawing.Point(550, 285); this.btnSerialCancel.Name = "btnSerialCancel"; this.btnSerialCancel.Size = new System.Drawing.Size(88, 77); this.btnSerialCancel.TabIndex = 4; @@ -123,7 +127,7 @@ private void InitializeComponent() this.btnSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnSave.Image = global::AgOpenGPS.Properties.Resources.OK64; this.btnSave.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; - this.btnSave.Location = new System.Drawing.Point(659, 262); + this.btnSave.Location = new System.Drawing.Point(659, 285); this.btnSave.Name = "btnSave"; this.btnSave.Size = new System.Drawing.Size(113, 79); this.btnSave.TabIndex = 3; @@ -224,6 +228,10 @@ private void InitializeComponent() // panel1 // this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(50)))), ((int)(((byte)(70))))); + this.panel1.Controls.Add(this.label4); + this.panel1.Controls.Add(this.label2); + this.panel1.Controls.Add(this.cboxAddTime); + this.panel1.Controls.Add(this.cboxAddDate); this.panel1.Controls.Add(this.chkHeadland); this.panel1.Controls.Add(this.label3); this.panel1.Controls.Add(this.chkFlags); @@ -235,15 +243,75 @@ private void InitializeComponent() this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; this.panel1.Location = new System.Drawing.Point(2, 2); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(797, 351); + this.panel1.Size = new System.Drawing.Size(797, 374); this.panel1.TabIndex = 261; // + // cboxAddTime + // + this.cboxAddTime.Appearance = System.Windows.Forms.Appearance.Button; + this.cboxAddTime.BackColor = System.Drawing.Color.Transparent; + this.cboxAddTime.FlatAppearance.CheckedBackColor = System.Drawing.Color.Teal; + this.cboxAddTime.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.cboxAddTime.Font = new System.Drawing.Font("Tahoma", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.cboxAddTime.ForeColor = System.Drawing.SystemColors.ButtonFace; + this.cboxAddTime.Image = global::AgOpenGPS.Properties.Resources.JobNameTime; + this.cboxAddTime.Location = new System.Drawing.Point(248, 257); + this.cboxAddTime.Name = "cboxAddTime"; + this.cboxAddTime.RightToLeft = System.Windows.Forms.RightToLeft.Yes; + this.cboxAddTime.Size = new System.Drawing.Size(90, 90); + this.cboxAddTime.TabIndex = 263; + this.cboxAddTime.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.cboxAddTime.UseVisualStyleBackColor = false; + // + // cboxAddDate + // + this.cboxAddDate.Appearance = System.Windows.Forms.Appearance.Button; + this.cboxAddDate.BackColor = System.Drawing.Color.Transparent; + this.cboxAddDate.FlatAppearance.CheckedBackColor = System.Drawing.Color.Teal; + this.cboxAddDate.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.cboxAddDate.Font = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.cboxAddDate.ForeColor = System.Drawing.SystemColors.ButtonFace; + this.cboxAddDate.Image = global::AgOpenGPS.Properties.Resources.JobNameCalendar; + this.cboxAddDate.Location = new System.Drawing.Point(114, 257); + this.cboxAddDate.Name = "cboxAddDate"; + this.cboxAddDate.RightToLeft = System.Windows.Forms.RightToLeft.Yes; + this.cboxAddDate.Size = new System.Drawing.Size(90, 90); + this.cboxAddDate.TabIndex = 262; + this.cboxAddDate.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.cboxAddDate.UseVisualStyleBackColor = false; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(50)))), ((int)(((byte)(70))))); + this.label2.Font = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label2.ForeColor = System.Drawing.SystemColors.ButtonFace; + this.label2.Location = new System.Drawing.Point(83, 291); + this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(24, 23); + this.label2.TabIndex = 264; + this.label2.Text = "+"; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(50)))), ((int)(((byte)(70))))); + this.label4.Font = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label4.ForeColor = System.Drawing.SystemColors.ButtonFace; + this.label4.Location = new System.Drawing.Point(221, 292); + this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(24, 23); + this.label4.TabIndex = 265; + this.label4.Text = "+"; + // // FormSaveAs // this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.BackColor = System.Drawing.Color.Cyan; - this.ClientSize = new System.Drawing.Size(801, 355); + this.ClientSize = new System.Drawing.Size(801, 378); this.ControlBox = false; this.Controls.Add(this.lblFilename); this.Controls.Add(this.label1); @@ -278,5 +346,9 @@ private void InitializeComponent() private System.Windows.Forms.CheckBox chkGuidanceLines; private System.Windows.Forms.CheckBox chkFlags; private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.CheckBox cboxAddTime; + private System.Windows.Forms.CheckBox cboxAddDate; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label label2; } } \ No newline at end of file diff --git a/SourceCode/GPS/Forms/FormSaveAs.cs b/SourceCode/GPS/Forms/FormSaveAs.cs index 1e6842678..5c92d43eb 100644 --- a/SourceCode/GPS/Forms/FormSaveAs.cs +++ b/SourceCode/GPS/Forms/FormSaveAs.cs @@ -73,8 +73,8 @@ private void btnSave_Click(object sender, EventArgs e) mf.currentFieldDirectory = tboxFieldName.Text.Trim() + " "; //date - mf.currentFieldDirectory += " " + DateTime.Now.ToString("MMM.dd", CultureInfo.InvariantCulture); - mf.currentFieldDirectory += " " + DateTime.Now.ToString("HH_mm", CultureInfo.InvariantCulture); + if (cboxAddDate.Checked) mf.currentFieldDirectory += " " + DateTime.Now.ToString("MMM.dd", CultureInfo.InvariantCulture); + if (cboxAddTime.Checked) mf.currentFieldDirectory += " " + DateTime.Now.ToString("HH_mm", CultureInfo.InvariantCulture); //get the directory and make sure it exists, create if not string dirNewField = mf.fieldsDirectory + mf.currentFieldDirectory + "\\";