//close the current job public void JobClose() { //rate control buttons if (rc.isRateControlOn) { btnRate.PerformClick(); } rc.ShutdownRateControl(); //double dam sure its off //turn auto button off autoBtnState = btnStates.Off; btnSectionOffAutoOn.Image = Properties.Resources.SectionMasterOff; //turn section buttons all OFF and zero square meters for (int j = 0; j < MAXSECTIONS; j++) { section[j].isAllowedOn = false; section[j].manBtnState = manBtn.On; } //turn manual button off manualBtnState = btnStates.Off; btnManualOffOn.Image = Properties.Resources.ManualOff; //Update the button colors and text ManualAllBtnsUpdate(); //enable disable manual buttons LineUpManualBtns(); btnSection1Man.Enabled = false; btnSection2Man.Enabled = false; btnSection3Man.Enabled = false; btnSection4Man.Enabled = false; btnSection5Man.Enabled = false; btnSection6Man.Enabled = false; btnSection7Man.Enabled = false; btnSection8Man.Enabled = false; //job is closed isJobStarted = false; //clear the section lists for (int j = 0; j < MAXSECTIONS; j++) { //clean out the lists section[j].patchList?.Clear(); section[j].triangleList?.Clear(); } //clear out the contour Lists ct.ResetContour(); //clear the flags flagPts.Clear(); btnFlag.Enabled = false; //reset the buttons btnABLine.Enabled = false; btnABCurve.Enabled = true; btnContour.Enabled = false; btnAutoSteer.Enabled = false; isAutoSteerBtnOn = false; ct.isContourBtnOn = false; ct.isContourOn = false; //change images to reflect on off btnABLine.Image = Properties.Resources.ABLineOff; btnRightYouTurn.Visible = false; btnLeftYouTurn.Visible = false; btnContour.Image = Properties.Resources.ContourOff; btnAutoSteer.Image = Properties.Resources.AutoSteerOff; //fix ManualOffOnAuto buttons btnManualOffOn.Enabled = false; manualBtnState = btnStates.Off; btnManualOffOn.Image = Properties.Resources.ManualOff; //fix auto button btnSectionOffAutoOn.Enabled = false; autoBtnState = btnStates.Off; btnSectionOffAutoOn.Image = Properties.Resources.SectionMasterOff; //reset all the ABLine stuff ABLine.ResetABLine(); //reset acre and distance counters totalSquareMeters = 0; //reset boundary boundz.ResetBoundary(); //reset headland hl.ResetHeadland(); //update the menu fieldToolStripMenuItem.Text = gStr.gsStartNewField; //turn off top level buttons btnRightYouTurn.Enabled = false; btnLeftYouTurn.Enabled = false; //auto YouTurn shutdown yt.isYouTurnBtnOn = false; yt.ResetYouTurnAndSequenceEvents(); youTurnProgressBar = 0; //turn off youturn... btnEnableAutoYouTurn.Enabled = false; yt.isYouTurnBtnOn = false; btnEnableAutoYouTurn.Image = Properties.Resources.YouTurnNo; //reset all Port Module values mc.ResetAllModuleCommValues(); }
//close the current job public void JobClose() { //turn auto button off autoBtnState = btnStates.Off; btnSectionOffAutoOn.Image = Properties.Resources.SectionMasterOff; //turn section buttons all OFF and zero square meters for (int j = 0; j < MAXSECTIONS; j++) { section[j].isAllowedOn = false; section[j].manBtnState = manBtn.On; } //turn manual button off manualBtnState = btnStates.Off; btnManualOffOn.Image = Properties.Resources.ManualOff; //Update the button colors and text ManualAllBtnsUpdate(); //enable disable manual buttons LineUpManualBtns(); btnSection1Man.Enabled = false; btnSection2Man.Enabled = false; btnSection3Man.Enabled = false; btnSection4Man.Enabled = false; btnSection5Man.Enabled = false; btnSection6Man.Enabled = false; btnSection7Man.Enabled = false; btnSection8Man.Enabled = false; //job is closed isJobStarted = false; //clear the section lists for (int j = 0; j < MAXSECTIONS; j++) { //clean out the lists section[j].patchList.Clear(); section[j].triangleList?.Clear(); } //clear out the contour Lists ct.ResetContour(); //clear the flags flagPts.Clear(); btnFlag.Enabled = false; //reset the buttons btnABLine.Enabled = false; btnContour.Enabled = false; btnAutoSteer.Enabled = false; btnSnap.Enabled = false; btnAutoYouTurn.Enabled = false; btnRightYouTurn.Enabled = false; btnLeftYouTurn.Enabled = false; ct.isContourBtnOn = false; ct.isContourOn = false; //change images to reflect on off btnABLine.Image = Properties.Resources.ABLineOff; btnRightYouTurn.Visible = false; btnLeftYouTurn.Visible = false; btnContour.Image = Properties.Resources.ContourOff; btnAutoSteer.Image = Properties.Resources.AutoSteerOff; //fix ManualOffOnAuto buttons btnManualOffOn.Enabled = false; manualBtnState = btnStates.Off; btnManualOffOn.Image = Properties.Resources.ManualOff; //fix auto button btnSectionOffAutoOn.Enabled = false; autoBtnState = btnStates.Off; btnSectionOffAutoOn.Image = Properties.Resources.SectionMasterOff; //reset all the ABLine stuff ABLine.ResetABLine(); //reset acre and distance counters totalSquareMeters = 0; //reset boundary boundary.ResetBoundary(); //update the menu fieldToolStripMenuItem.Text = "Start Field"; //rate control buttons btnRate1Select.Visible = false; btnRate2Select.Visible = false; btnRate.Image = Properties.Resources.RateControlOff; rc.ShutdownRateControl(); //auto YouTurn shutdown yt.isAutoYouTurnEnabled = false; yt.CancelYouTurn(); autoTurnInProgressBar = 0; btnAutoYouTurn.Text = "Off"; //reset all Port Module values mc.ResetAllModuleCommValues(); }