HEADER_TEMPLATE = ''';Header Start
;header_type: cnc
;tool_head: standardPcbDrill
;machine: {device_name}
;renderMethod: line
;file_total_lines: {lines}
;estimated_time(s): {time:.3f}
;is_rotate: false
;diameter: {drill_diameter}
;max_x(mm): {max_x}
;max_y(mm): {max_y}
;max_z(mm): {max_z}
;max_b(mm): 0
;min_x(mm): {min_x}
;min_y(mm): {min_y}
;min_b(mm): 0
;min_z(mm): {min_z}
;work_speed(mm/minute): {drill_speed_z}
;jog_speed(mm/minute): {travel_speed_xy}
;power(%): {spindle_power}
;work_size_x: {work_area_x}
;work_size_y: {work_area_y}
;origin: center
;thumbnail: data:image/png;base64,{thumbnail}
;Header End

; G-code for PCB hole drilling on snapmaker devices
; generated by drill_with_snap: https://github.com/mjleehh/drill4snap
; G-code START <<<

; use absolute coordinates
G90
; use mm as units
G21
; raise to travel height first
G1 Z{travel_height} {travel_speed_z}
; start spindle
M3 P{spindle_power}
'''

FOOTER_TEMPLATE = '''; final retract
G1 Z{travel_height} F{travel_speed_z}
; power off spindle
M5
; end of program
M2
'''

DRILL_TEMPLATE='''G1 F{travel_speed_xy} X{x} Y{y}
G1 F{drill_speed_z} Z-{drill_depth}
G1 F{drill_speed_z} Z{travel_height}
'''
