| 
									
										
										
										
											2019-11-15 18:13:09 +00:00
										 |  |  | from . import nc | 
					
						
							|  |  |  | from . import iso_modal | 
					
						
							|  |  |  | import math | 
					
						
							|  |  |  | import datetime | 
					
						
							|  |  |  | import time | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | now = datetime.datetime.now() | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-03-21 12:36:34 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-11-15 18:13:09 +00:00
										 |  |  | class Creator(iso_modal.Creator): | 
					
						
							|  |  |  |     def __init__(self): | 
					
						
							|  |  |  |         iso_modal.Creator.__init__(self) | 
					
						
							|  |  |  |         self.output_block_numbers = False | 
					
						
							|  |  |  |         self.output_tool_definitions = False | 
					
						
							|  |  |  |         self.output_g43_on_tool_change_line = True | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def SPACE(self): | 
					
						
							|  |  |  |         if self.start_of_line == True: | 
					
						
							|  |  |  |             self.start_of_line = False | 
					
						
							|  |  |  |             return '' | 
					
						
							|  |  |  |         else: | 
					
						
							|  |  |  |             return ' ' | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def PROGRAM(self): return None | 
					
						
							| 
									
										
										
										
											2024-03-21 12:36:34 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-11-15 18:13:09 +00:00
										 |  |  |     def PROGRAM_END(self): | 
					
						
							|  |  |  |         if self.output_tool_change: | 
					
						
							| 
									
										
										
										
											2024-03-21 12:36:34 +00:00
										 |  |  |             return('T0' + self.SPACE() + 'M06' + self.SPACE() + 'M02') | 
					
						
							| 
									
										
										
										
											2019-11-15 18:13:09 +00:00
										 |  |  |         else: | 
					
						
							|  |  |  |             return('M02') | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def dwell(self, t): | 
					
						
							| 
									
										
										
										
											2024-03-21 12:36:34 +00:00
										 |  |  |         self.write('\n') | 
					
						
							|  |  |  |         iso_modal.Creator.dwell(self, t) | 
					
						
							| 
									
										
										
										
											2019-11-15 18:13:09 +00:00
										 |  |  | ############################################################################ | 
					
						
							| 
									
										
										
										
											2024-03-21 12:36:34 +00:00
										 |  |  | # Begin Program | 
					
						
							| 
									
										
										
										
											2019-11-15 18:13:09 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def program_begin(self, id, comment): | 
					
						
							|  |  |  |         if (self.useCrc == False): | 
					
						
							| 
									
										
										
										
											2024-03-21 12:36:34 +00:00
										 |  |  |             self.write(('(Created with emc2b post processor ' + | 
					
						
							|  |  |  |                         str(now.strftime("%Y/%m/%d %H:%M")) + ')' + '\n')) | 
					
						
							| 
									
										
										
										
											2019-11-15 18:13:09 +00:00
										 |  |  |         else: | 
					
						
							| 
									
										
										
										
											2024-03-21 12:36:34 +00:00
										 |  |  |             self.write(('(Created with emc2b Cutter Radius Compensation post processor ' + | 
					
						
							|  |  |  |                         str(now.strftime("%Y/%m/%d %H:%M")) + ')' + '\n')) | 
					
						
							| 
									
										
										
										
											2019-11-15 18:13:09 +00:00
										 |  |  |         iso_modal.Creator.program_begin(self, id, comment) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | nc.creator = Creator() |