function OnAbout(event) ctrl = event:GetTextCtrl() ctrl:AppendText("LinuxCNC plasma_TK post processor\n") ctrl:AppendText("\n") ctrl:AppendText("Modal G-codes and coordinates\n") ctrl:AppendText("Comments enclosed with ( and )\n") ctrl:AppendText("Incremental IJ\n") ctrl:AppendText("uses G43 tool length offsets\n") end -- revision 3/2/07 -- Removed final safety move. This is now done in SheetCam -- revision 7/10/04 -- Added new arc handling -- Created 30/3/2005 -- based on Mach2.post -- revision 4/1/2020 -- added touch-off to pen down function function OnInit() post.SetCommentChars ("()", "[]") --make sure ( and ) characters do not appear in system text post.Text (" (Filename: ", fileName, ")\n") post.Text (" (Post processor: ", postName, ")\n") post.Text (" (Date: ", date, ")\n") if(scale == metric) then post.Text (" G21 (Units: Metric)\n") --metric mode else post.Text (" G20 (Units: Inches)\n") --inch mode end post.Text (" G40 G90\n F1 S1\n") bigArcs = 1 --stitch arc segments together minArcSize = 0.05 --arcs smaller than this are converted to moves post.Text (" o sub\n") post.Text (" (#1 pierce height, #2 pierce delay, #3 cut height)\n") post.Text (" F10\n") post.Text (" G92 Z[#5213] (Set Z to machine position)\n") post.Text (" G38.2 Z-1.6 (Probe to find the surface)\n") post.Text (" G0 Z[#5063 + 0.22] (Move to Probe Trip point + switch hysteresis)\n") post.Text (" G92 Z0 (Set Z zero)\n") post.Text (" G1 Z#1\n") post.Text (" M3 S1\n") post.Text (" G4 P#2 (Pause for pierce delay)\n") post.Text (" F25\n") post.Text (" Z#3 (goto cut height)\n") post.Text (" o endsub\n") end function OnFinish() post.Text (" M05 M30\n") end function OnRapid() post.ModalText (" G00") post.ModalNumber (" X", endX * scale, "0.0000") post.ModalNumber (" Y", endY * scale, "0.0000") post.ModalNumber (" Z", (endZ + toolOffset) * scale, "0.0000") post.Eol() end function OnMove() post.ModalText (" G01") post.ModalNumber (" X", endX * scale, "0.0000") post.ModalNumber (" Y", endY * scale, "0.0000") post.ModalNumber (" Z", (endZ + toolOffset) * scale, "0.0000") post.ModalNumber (" F", feedRate * scale, "0.###") post.Eol() end function OnArc() if(arcAngle <0) then post.ModalText (" G03") else post.ModalText (" G02") end post.NonModalNumber (" X", endX * scale, "0.0000") post.NonModalNumber (" Y", endY * scale, "0.0000") post.ModalNumber (" Z", (endZ + toolOffset) * scale, "0.0000") post.Text (" I") post.Number ((arcCentreX - currentX) * scale, "0.0000") post.Text (" J") post.Number ((arcCentreY - currentY) * scale, "0.0000") post.ModalNumber (" F", feedRate * scale, "0.0###") post.Eol() end function OnPenDown() post.NonModalNumber("o call [" ,pierceHeight * scale ,"0.00" ) post.Text ("] ") post.NonModalNumber("[", pierceDelay * scale, "0.##") post.Text ("] ") post.NonModalNumber("[", cutHeight * scale, "0.##") post.Text ("] (Touchoff and start cutting)\n") post.NonModalNumber ("F", feedRate * scale, "0.###") post.Eol() end function OnPenUp() post.Text (" M05\n") if (endDelay > 0) then post.Text (" G04 P") post.Number (endDelay,"0.###") post.Eol() end end function OnNewOperation() post.Text (" (Operation: ", operationName, ")\n") end function OnComment() post.Text(" (",commentText,")\n") end function OnNewPart() post.Text(" (Part: ",partName,")\n"); end function OnDrill() OnRapid() OnPenDown() endZ = drillZ OnMove() OnPenUp() endZ = safeZ OnRapid() end