2013-05-26 14:47:27 +00:00
|
|
|
from . import nc
|
|
|
|
|
from . import iso_modal
|
|
|
|
|
import math
|
|
|
|
|
import datetime
|
|
|
|
|
import time
|
|
|
|
|
|
|
|
|
|
now = datetime.datetime.now()
|
|
|
|
|
|
|
|
|
|
class Creator(iso_modal.Creator):
|
|
|
|
|
def __init__(self):
|
|
|
|
|
iso_modal.Creator.__init__(self)
|
2016-01-27 23:34:01 +00:00
|
|
|
self.output_block_numbers = False
|
|
|
|
|
self.output_tool_definitions = False
|
|
|
|
|
self.output_g43_on_tool_change_line = True
|
2013-05-26 14:47:27 +00:00
|
|
|
|
|
|
|
|
def SPACE(self):
|
|
|
|
|
if self.start_of_line == True:
|
|
|
|
|
self.start_of_line = False
|
|
|
|
|
return ''
|
|
|
|
|
else:
|
|
|
|
|
return ' '
|
2016-01-27 23:34:01 +00:00
|
|
|
|
|
|
|
|
def PROGRAM(self): return None
|
2016-04-07 22:52:19 +00:00
|
|
|
def PROGRAM_END(self):
|
|
|
|
|
if self.output_tool_change:
|
|
|
|
|
return( 'T0' + self.SPACE() + 'M06' + self.SPACE() + 'M02')
|
|
|
|
|
else:
|
2016-05-22 15:59:13 +00:00
|
|
|
return('M02')
|
2016-04-07 22:52:19 +00:00
|
|
|
|
2016-03-19 14:32:06 +00:00
|
|
|
def dwell(self, t):
|
|
|
|
|
self.write('\n')
|
|
|
|
|
iso_modal.Creator.dwell(self, t)
|
2013-05-26 14:47:27 +00:00
|
|
|
############################################################################
|
|
|
|
|
## Begin Program
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def program_begin(self, id, comment):
|
|
|
|
|
if (self.useCrc == False):
|
|
|
|
|
self.write( ('(Created with emc2b post processor ' + str(now.strftime("%Y/%m/%d %H:%M")) + ')' + '\n') )
|
|
|
|
|
else:
|
|
|
|
|
self.write( ('(Created with emc2b Cutter Radius Compensation post processor ' + str(now.strftime("%Y/%m/%d %H:%M")) + ')' + '\n') )
|
2016-01-27 23:34:01 +00:00
|
|
|
iso_modal.Creator.program_begin(self, id, comment)
|
2013-05-26 14:47:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
nc.creator = Creator()
|