Advertisement
Guest User

Untitled

a guest
Jun 27th, 2014
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.49 KB | None | 0 0
  1. function OnAbout(event)
  2. ctrl = event:GetTextCtrl()
  3. ctrl:AppendText("EMC plasma post processor\n")
  4. ctrl:AppendText("\n")
  5. ctrl:AppendText("Modal G-codes and coordinates\n")
  6. ctrl:AppendText("Comments enclosed with ( and )\n")
  7. ctrl:AppendText("Incremental IJ\n")
  8. ctrl:AppendText("uses G43 tool length offsets\n")
  9. end
  10.  
  11.  
  12. -- revision 3/2/07
  13. -- Removed final safety move. This is now done in SheetCam
  14.  
  15. -- revision 7/10/04
  16. -- Added new arc handling
  17.  
  18. -- Created 30/3/2005
  19. -- based on Mach2.post
  20.  
  21.  
  22.  
  23. function OnInit()
  24. post.SetCommentChars ("()", "[]") --make sure ( and ) characters do not appear in system text
  25. post.Text (" (Filename: ", fileName, ")\n")
  26. post.Text (" (Post processor: ", postName, ")\n")
  27. post.Text (" (Date: ", date, ")\n")
  28. if(scale == metric) then
  29. post.Text (" G21 (Units: Metric)\n") --metric mode
  30. else
  31. post.Text (" G20 (Units: Inches)\n") --inch mode
  32. end
  33. post.Text (" G40 G90\n F1 S1\n")
  34. bigArcs = 1 --stitch arc segments together
  35. minArcSize = 0.05 --arcs smaller than this are converted to moves
  36. end
  37.  
  38. function OnNewLine()
  39. post.Text ("N")
  40. post.Number (lineNumber, "0000")
  41. lineNumber = lineNumber + 10
  42. end
  43.  
  44.  
  45. function OnFinish()
  46. post.Text (" M05 M30\n")
  47. end
  48.  
  49. function OnRapid()
  50. post.ModalText (" G00")
  51. post.ModalNumber (" X", endX * scale, "0.0000")
  52. post.ModalNumber (" Y", endY * scale, "0.0000")
  53. post.ModalNumber (" Z", (endZ + toolOffset) * scale, "0.0000")
  54. post.Eol()
  55. end
  56.  
  57. function OnMove()
  58. post.ModalText (" G01")
  59. post.ModalNumber (" X", endX * scale, "0.0000")
  60. post.ModalNumber (" Y", endY * scale, "0.0000")
  61. post.ModalNumber (" Z", (endZ + toolOffset) * scale, "0.0000")
  62. post.ModalNumber (" F", feedRate * scale, "0.###")
  63. post.Eol()
  64. end
  65.  
  66. function OnArc()
  67. if(arcAngle <0) then
  68. post.ModalText (" G03")
  69. else
  70. post.ModalText (" G02")
  71. end
  72. post.NonModalNumber (" X", endX * scale, "0.0000")
  73. post.NonModalNumber (" Y", endY * scale, "0.0000")
  74. post.ModalNumber (" Z", (endZ + toolOffset) * scale, "0.0000")
  75. post.Text (" I")
  76. post.Number ((arcCentreX - currentX) * scale, "0.0000")
  77. post.Text (" J")
  78. post.Number ((arcCentreY - currentY) * scale, "0.0000")
  79. post.ModalNumber (" F", feedRate * scale, "0.0###")
  80. post.Eol()
  81. end
  82.  
  83.  
  84. function OnPenDown()
  85. if (preheat > 0.001) then
  86. post.ModalText (" G00")
  87. post.ModalNumber (" Z", cutHeight * scale, "0.0000")
  88. post.Text ("\n G04 P")
  89. post.Number (preheat,"0.###")
  90. post.Eol()
  91. end
  92. post.ModalText (" G00")
  93. post.ModalNumber (" Z", pierceHeight * scale, "0.0000")
  94. post.Text ("\n M03\n")
  95. if (pierceDelay > 0.001) then
  96. post.Text (" G04 P")
  97. post.Number (pierceDelay,"0.###")
  98. post.Eol()
  99. end
  100. end
  101.  
  102.  
  103. function OnPenUp()
  104. post.Text (" M05\n")
  105. if (endDelay > 0) then
  106. post.Text (" G04 P")
  107. post.Number (endDelay,"0.###")
  108. post.Eol()
  109. end
  110. end
  111.  
  112. function OnNewOperation()
  113. post.Text (" (Operation: ", operationName, ")\n")
  114. if (plungeRate <= 0) then
  115. post.Warning("WARNING: Plunge rate is zero")
  116. end
  117. if (feedRate <= 0) then
  118. post.Warning("WARNING: Feed rate is zero")
  119. end
  120. end
  121.  
  122. function OnComment()
  123. post.Text(" (",commentText,")\n")
  124. end
  125.  
  126.  
  127. function OnNewPart()
  128. post.Text(" (Part: ",partName,")\n");
  129. end
  130.  
  131.  
  132. function OnDrill()
  133. OnRapid()
  134. OnPenDown()
  135. endZ = drillZ
  136. OnMove()
  137. OnPenUp()
  138. endZ = safeZ
  139. OnRapid()
  140. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement