private void btnOK_Click(object sender, EventArgs e) { //Vehicle settings ------------------------------------------------------------------------------- if (!isPivotBehindAntenna) { antennaPivot *= -1; } mf.vehicle.antennaPivot = antennaPivot; Properties.Vehicle.Default.setVehicle_antennaPivot = mf.vehicle.antennaPivot; mf.vehicle.isPivotBehindAntenna = isPivotBehindAntenna; Properties.Vehicle.Default.setVehicle_isPivotBehindAntenna = mf.vehicle.isPivotBehindAntenna; if (!isSteerAxleAhead) { wheelbase *= -1; } mf.vehicle.wheelbase = wheelbase; Properties.Vehicle.Default.setVehicle_wheelbase = wheelbase; mf.vehicle.isSteerAxleAhead = isSteerAxleAhead; Properties.Vehicle.Default.setVehicle_isSteerAxleAhead = mf.vehicle.isSteerAxleAhead; mf.vehicle.antennaHeight = antennaHeight; Properties.Vehicle.Default.setVehicle_antennaHeight = mf.vehicle.antennaHeight; //Tool ------------------------------------------------------------------------------------------ //trailing hitch is always behind toolTrailingHitchLength *= -1; mf.vehicle.toolTrailingHitchLength = toolTrailingHitchLength; Properties.Vehicle.Default.setVehicle_toolTrailingHitchLength = mf.vehicle.toolTrailingHitchLength; tankTrailingHitchLength *= -1; mf.vehicle.tankTrailingHitchLength = tankTrailingHitchLength; Properties.Vehicle.Default.setVehicle_tankTrailingHitchLength = mf.vehicle.tankTrailingHitchLength; mf.vehicle.toolLookAhead = toolLookAhead; Properties.Vehicle.Default.setVehicle_lookAhead = mf.vehicle.toolLookAhead; mf.vehicle.toolOverlap = toolOverlap; Properties.Vehicle.Default.setVehicle_toolOverlap = mf.vehicle.toolOverlap; mf.vehicle.toolTurnOffDelay = toolTurnOffDelay; Properties.Vehicle.Default.setVehicle_turnOffDelay = mf.vehicle.toolTurnOffDelay; mf.vehicle.toolOffset = toolOffset; Properties.Vehicle.Default.setVehicle_toolOffset = mf.vehicle.toolOffset; mf.vehicle.isToolTrailing = isToolTrailing; Properties.Vehicle.Default.setVehicle_isToolTrailing = mf.vehicle.isToolTrailing; mf.vehicle.isToolBehindPivot = isToolBehindPivot; Properties.Vehicle.Default.setVehicle_isToolBehindPivot = mf.vehicle.isToolBehindPivot; if (isToolBehindPivot) { hitchLength *= -1; } mf.vehicle.hitchLength = hitchLength; Properties.Vehicle.Default.setVehicle_hitchLength = mf.vehicle.hitchLength; //Sections ------------------------------------------------------------------------------------------ mf.vehicle.numOfSections = numberOfSections; mf.vehicle.numSuperSection = numberOfSections + 1; Properties.Vehicle.Default.setVehicle_numSections = mf.vehicle.numOfSections; //take the section widths and convert to meters and positions along tool. CalculateSectionPositions(); //save the values in each spinner for section position widths in settings Properties.Vehicle.Default.setSection_position1 = sectionPosition1; Properties.Vehicle.Default.setSection_position2 = sectionPosition2; Properties.Vehicle.Default.setSection_position3 = sectionPosition3; Properties.Vehicle.Default.setSection_position4 = sectionPosition4; Properties.Vehicle.Default.setSection_position5 = sectionPosition5; Properties.Vehicle.Default.setSection_position6 = sectionPosition6; Properties.Vehicle.Default.setSection_position7 = sectionPosition7; Properties.Vehicle.Default.setSection_position8 = sectionPosition8; Properties.Vehicle.Default.setSection_position9 = sectionPosition9; //line up manual buttons based on # of sections mf.LineUpManualBtns(); //update the sections to newly configured widths and positions in main mf.SectionSetPosition(); //update the widths of sections and tool width in main mf.SectionCalcWidths(); //update toolwidth in mainform Properties.Vehicle.Default.setVehicle_toolWidth = mf.vehicle.toolWidth; ////Display ---load the delay slides -------------------------------------------------------------------- mf.isHeadingFromFix = isHeadingFromFix; Properties.Settings.Default.setHeading_isFromPosition = isHeadingFromFix; mf.boundaryTriggerDistance = (double)boundaryDistance; Properties.Settings.Default.setF_boundaryTriggerDistance = mf.boundaryTriggerDistance; mf.camera.triangleResolution = (double)triResolution; Properties.Settings.Default.setDisplay_triangleResolution = mf.camera.triangleResolution; mf.minFixStepDist = (double)minFixStepDistance; Properties.Settings.Default.setF_minFixStep = mf.minFixStepDist; mf.mc.isWorkSwitchActiveLow = isWorkSwActiveLow; Properties.Settings.Default.setF_IsWorkSwitchActiveLow = isWorkSwActiveLow; mf.mc.isWorkSwitchEnabled = isWorkSwEn; Properties.Settings.Default.setF_IsWorkSwitchEnabled = isWorkSwEn; Properties.Vehicle.Default.setVehicle_slowSpeedCutoff = cutoffSpeed * cutoffMetricImperial; mf.vehicle.slowSpeedCutoff = cutoffSpeed * cutoffMetricImperial; Properties.Settings.Default.setIMU_UID = tboxTinkerUID.Text.Trim(); Properties.Settings.Default.setIMU_isHeadingFromBNO = isHeadingBNO; Properties.Settings.Default.setIMU_isHeadingFromBrick = isHeadingBrick; Properties.Settings.Default.setIMU_isRollFromDogs = isRollDogs; mf.ahrs.isRollDogs = isRollDogs; Properties.Settings.Default.setIMU_isRollFromBrick = isRollBrick; mf.ahrs.isRollBrick = isRollBrick; Properties.Settings.Default.setIMU_isRollFromPAOGI = isRollPAOGI; Properties.Settings.Default.setIMU_isHeadingFromPAOGI = isHeadingPAOGI; Properties.Settings.Default.setDisplay_lightbarCmPerPixel = lightbarCmPerPixie; mf.lightbarCmPerPixel = lightbarCmPerPixie; Properties.Settings.Default.Save(); Properties.Vehicle.Default.Save(); //back to FormGPS DialogResult = DialogResult.OK; Close(); }
private void btnOK_Click(object sender, EventArgs e) { //Vehicle settings ------------------------------------------------------------------------------- if (!isPivotBehindAntenna) { antennaPivot *= -1; } mf.vehicle.antennaPivot = antennaPivot; Properties.Vehicle.Default.setVehicle_antennaPivot = mf.vehicle.antennaPivot; mf.vehicle.isPivotBehindAntenna = isPivotBehindAntenna; Properties.Vehicle.Default.setVehicle_isPivotBehindAntenna = mf.vehicle.isPivotBehindAntenna; if (!isSteerAxleAhead) { wheelbase *= -1; } mf.vehicle.wheelbase = wheelbase; Properties.Vehicle.Default.setVehicle_wheelbase = wheelbase; mf.vehicle.isSteerAxleAhead = isSteerAxleAhead; Properties.Vehicle.Default.setVehicle_isSteerAxleAhead = mf.vehicle.isSteerAxleAhead; mf.vehicle.antennaHeight = antennaHeight; Properties.Vehicle.Default.setVehicle_antennaHeight = mf.vehicle.antennaHeight; //Tool ------------------------------------------------------------------------------------------ //trailing hitch is always behind toolTrailingHitchLength *= -1; mf.vehicle.toolTrailingHitchLength = toolTrailingHitchLength; Properties.Vehicle.Default.setVehicle_toolTrailingHitchLength = mf.vehicle.toolTrailingHitchLength; tankTrailingHitchLength *= -1; mf.vehicle.tankTrailingHitchLength = tankTrailingHitchLength; Properties.Vehicle.Default.setVehicle_tankTrailingHitchLength = mf.vehicle.tankTrailingHitchLength; mf.vehicle.toolLookAhead = toolLookAhead; Properties.Vehicle.Default.setVehicle_lookAhead = mf.vehicle.toolLookAhead; mf.vehicle.toolOverlap = toolOverlap; Properties.Vehicle.Default.setVehicle_toolOverlap = mf.vehicle.toolOverlap; mf.vehicle.toolTurnOffDelay = toolTurnOffDelay; Properties.Vehicle.Default.setVehicle_turnOffDelay = mf.vehicle.toolTurnOffDelay; mf.vehicle.toolOffset = toolOffset; Properties.Vehicle.Default.setVehicle_toolOffset = mf.vehicle.toolOffset; mf.vehicle.isToolTrailing = isToolTrailing; Properties.Vehicle.Default.setVehicle_isToolTrailing = mf.vehicle.isToolTrailing; mf.vehicle.isToolBehindPivot = isToolBehindPivot; Properties.Vehicle.Default.setVehicle_isToolBehindPivot = mf.vehicle.isToolBehindPivot; if (isToolBehindPivot) { hitchLength *= -1; } mf.vehicle.hitchLength = hitchLength; Properties.Vehicle.Default.setVehicle_hitchLength = mf.vehicle.hitchLength; //Sections ------------------------------------------------------------------------------------------ mf.vehicle.numOfSections = numberOfSections; mf.vehicle.numSuperSection = numberOfSections + 1; Properties.Vehicle.Default.setVehicle_numSections = mf.vehicle.numOfSections; //take the section widths and convert to meters and positions along tool. CalculateSectionPositions(); //save the values in each spinner for section position widths in settings Properties.Vehicle.Default.setSection_position1 = sectionPosition1; Properties.Vehicle.Default.setSection_position2 = sectionPosition2; Properties.Vehicle.Default.setSection_position3 = sectionPosition3; Properties.Vehicle.Default.setSection_position4 = sectionPosition4; Properties.Vehicle.Default.setSection_position5 = sectionPosition5; Properties.Vehicle.Default.setSection_position6 = sectionPosition6; Properties.Vehicle.Default.setSection_position7 = sectionPosition7; Properties.Vehicle.Default.setSection_position8 = sectionPosition8; Properties.Vehicle.Default.setSection_position9 = sectionPosition9; //line up manual buttons based on # of sections mf.LineUpManualBtns(); //update the sections to newly configured widths and positions in main mf.SectionSetPosition(); //update the widths of sections and tool width in main mf.SectionCalcWidths(); //update toolwidth in mainform Properties.Vehicle.Default.setVehicle_toolWidth = mf.vehicle.toolWidth; mf.mc.isWorkSwitchActiveLow = isWorkSwActiveLow; Properties.Settings.Default.setF_IsWorkSwitchActiveLow = isWorkSwActiveLow; mf.mc.isWorkSwitchEnabled = isWorkSwEn; Properties.Settings.Default.setF_IsWorkSwitchEnabled = isWorkSwEn; Properties.Vehicle.Default.setVehicle_slowSpeedCutoff = cutoffSpeed * cutoffMetricImperial; mf.vehicle.slowSpeedCutoff = cutoffSpeed * cutoffMetricImperial; Properties.Settings.Default.Save(); Properties.Vehicle.Default.Save(); //back to FormGPS DialogResult = DialogResult.OK; Close(); }
private void btnOK_Click(object sender, EventArgs e) { //Vehicle settings ------------------------------------------------------------------------------- if (!isPivotBehindAntenna) { antennaPivot *= -1; } mf.vehicle.antennaPivot = antennaPivot; Properties.Settings.Default.setVehicle_antennaPivot = mf.vehicle.antennaPivot; if (isPivotBehindAntenna) { mf.vehicle.isPivotBehindAntenna = true; } else { mf.vehicle.isPivotBehindAntenna = false; } Properties.Settings.Default.setVehicle_isPivotBehindAntenna = mf.vehicle.isPivotBehindAntenna; if (!isSteerAxleAhead) { wheelbase *= -1; } mf.vehicle.wheelbase = wheelbase; Properties.Settings.Default.setVehicle_wheelbase = wheelbase; if (isSteerAxleAhead) { mf.vehicle.isSteerAxleAhead = true; } else { mf.vehicle.isSteerAxleAhead = false; } Properties.Settings.Default.setVehicle_isSteerAxleAhead = mf.vehicle.isSteerAxleAhead; mf.vehicle.antennaHeight = antennaHeight; Properties.Settings.Default.setVehicle_antennaHeight = mf.vehicle.antennaHeight; //Tool ------------------------------------------------------------------------------------------ //trailing hitch is always behind toolTrailingHitchLength *= -1; mf.vehicle.toolTrailingHitchLength = toolTrailingHitchLength; Properties.Settings.Default.setVehicle_toolTrailingHitchLength = mf.vehicle.toolTrailingHitchLength; mf.vehicle.toolLookAhead = toolLookAhead; Properties.Settings.Default.setVehicle_lookAhead = mf.vehicle.toolLookAhead; mf.vehicle.toolOverlap = toolOverlap; Properties.Settings.Default.setVehicle_toolOverlap = mf.vehicle.toolOverlap; mf.vehicle.toolTurnOffDelay = toolTurnOffDelay; Properties.Settings.Default.setVehicle_turnOffDelay = mf.vehicle.toolTurnOffDelay; mf.vehicle.toolOffset = toolOffset; Properties.Settings.Default.setVehicle_toolOffset = mf.vehicle.toolOffset; if (isToolTrailing) { mf.vehicle.isToolTrailing = true; } else { mf.vehicle.isToolTrailing = false; } Properties.Settings.Default.setVehicle_isToolTrailing = mf.vehicle.isToolTrailing; if (isToolBehindPivot) { mf.vehicle.isToolBehindPivot = true; } else { mf.vehicle.isToolBehindPivot = false; } Properties.Settings.Default.setVehicle_isToolBehindPivot = mf.vehicle.isToolBehindPivot; if (isToolBehindPivot) { hitchLength *= -1; } mf.vehicle.hitchLength = hitchLength; Properties.Settings.Default.setVehicle_hitchLength = mf.vehicle.hitchLength; //Sections ------------------------------------------------------------------------------------------ mf.vehicle.numberOfSections = numberOfSections; Properties.Settings.Default.setVehicle_numSections = mf.vehicle.numberOfSections; //take the section widths and convert to meters and positions along tool. CalculateSectionPositions(); //save the values in each spinner for section position widths in settings Properties.Settings.Default.setSection_position1 = sectionPosition1; Properties.Settings.Default.setSection_position2 = sectionPosition2; Properties.Settings.Default.setSection_position3 = sectionPosition3; Properties.Settings.Default.setSection_position4 = sectionPosition4; Properties.Settings.Default.setSection_position5 = sectionPosition5; Properties.Settings.Default.setSection_position6 = sectionPosition6; //line up manual buttons based on # of sections mf.LineUpManualBtns(); //update the sections to newly configured widths and positions in main mf.SectionSetPosition(); //update the widths of sections and tool width in main mf.SectionCalcWidths(); //update toolwidth in mainform Properties.Settings.Default.setVehicle_toolWidth = mf.vehicle.toolWidth; ////Display ---load the delay slides -------------------------------------------------------------------- mf.delayCameraPrev = displayCameraDelay; Properties.Settings.Default.setDisplay_delayCameraPrev = displayCameraDelay; mf.delayFixPrev = displayFixDelay; Properties.Settings.Default.setDisplay_delayFixPrev = displayFixDelay; mf.isAtanCam = isAtanCamera; Properties.Settings.Default.setCam_isAtanCam = isAtanCamera; mf.triangleResolution = (double)triResolution; Properties.Settings.Default.setDisplay_triangleResolution = mf.triangleResolution; mf.modcom.isWorkSwitchActiveLow = isWorkSwActiveLow; Properties.Settings.Default.setIsWorkSwitchActiveLow = isWorkSwActiveLow; mf.modcom.isWorkSwitchEnabled = isWorkSwEn; Properties.Settings.Default.setIsWorkSwitchEnabled = isWorkSwEn; Properties.Settings.Default.Save(); //back to FormGPS DialogResult = DialogResult.OK; Close(); }