private void JogToToolChangePosition() { GRBLProps props = GRBLMachinePlugin.Props; WaitIdle(); _preChangeX = _lastX.GetWorkOrMachinePosition(_lastType, _WCO_X, PosType.WorkCoordinates, props.ReportInInches, props.ReportInInches); _preChangeY = _lastY.GetWorkOrMachinePosition(_lastType, _WCO_Y, PosType.WorkCoordinates, props.ReportInInches, props.ReportInInches); _preChangeZ = _lastZ.GetWorkOrMachinePosition(_lastType, _WCO_Z, PosType.WorkCoordinates, props.ReportInInches, props.ReportInInches); _preChangeSpeed = _lastSpeed; _preChangeType = _lastType; ConnectionExpander.WriteCOMPort(_jogLeadIn + "G53 " + (props.ToolChangeUnits == InchMM.Inches ? "G20" : "G21") + " F4000 G90 Z" + props.ToolChangeZ.ToString(EN_US)); WaitIdle(); ConnectionExpander.WriteCOMPort("S0"); ConnectionExpander.WriteCOMPort(_jogLeadIn + "G53 " + (props.ToolChangeUnits == InchMM.Inches ? "G20" : "G21") + " F4000 G90 X" + props.ToolChangeX.ToString(EN_US) + " Y" + props.ToolChangeY.ToString(EN_US)); }
private void JogFromToolChangePosition() { GRBLProps props = GRBLMachinePlugin.Props; if (_lastZ != props.ToolChangeZ) { WaitIdle(); ConnectionExpander.WriteCOMPort(_jogLeadIn + "G53 " + (props.ToolChangeUnits == InchMM.Inches ? "G20" : "G21") + " F4000 G90 Z" + props.ToolChangeZ.ToString(EN_US)); } WaitIdle(); ConnectionExpander.WriteCOMPort(_jogLeadIn + (GRBLMachinePlugin.Props.ReportInInches == InchMM.Inches ? "G20" : "G21") + " F4000 G90 X" + _preChangeX.ToString(EN_US) + " Y" + _preChangeY.ToString(EN_US)); WaitIdle(); ConnectionExpander.WriteCOMPort("S" + _preChangeSpeed); WaitIdle(); ConnectionExpander.WriteCOMPort(_jogLeadIn + (props.ReportInInches == InchMM.Inches ? "G20" : "G21") + " F" + 4000d.GetUnitsFromReportAndDrawing(InchMM.Millimeters, props.ReportInInches).ToString("0.0000", EN_US) + " G90 Z" + (_preChangeZ + props.ToolChangePlungeDistance.GetUnitsFromReportAndDrawing(props.ToolChangeUnits, props.ReportInInches)).ToString("0.0000", EN_US)); ConnectionExpander.WriteCOMPort(_jogLeadIn + (props.ReportInInches == InchMM.Inches ? "G20" : "G21") + " F" + props.ToolChangePlungeFeed.GetUnitsFromReportAndDrawing(props.ToolChangeUnits, props.ReportInInches).ToString("0.0000", EN_US) + " G90 Z" + (_preChangeZ.ToString("0.0000", EN_US))); WaitIdle(); }