2023-06-13 18:15:22 +00:00
|
|
|
|
|
|
|
import bpy
|
|
|
|
from cam.ui_panels.buttons_panel import CAMButtonsPanel
|
|
|
|
|
|
|
|
|
|
|
|
class CAM_GCODE_Panel(CAMButtonsPanel, bpy.types.Panel):
|
|
|
|
"""CAM operation g-code options panel"""
|
|
|
|
bl_label = "CAM g-code options "
|
|
|
|
bl_idname = "WORLD_PT_CAM_GCODE"
|
2023-06-14 09:33:08 +00:00
|
|
|
panel_interface_level = 1
|
2023-06-13 18:15:22 +00:00
|
|
|
|
2023-06-21 16:45:50 +00:00
|
|
|
prop_level = {
|
2023-07-04 17:16:13 +00:00
|
|
|
'draw_output_header': 1,
|
|
|
|
'draw_output_trailer': 1,
|
|
|
|
'draw_enable_dust': 1,
|
|
|
|
'draw_enable_hold': 1,
|
|
|
|
'draw_enable_mist': 1
|
2023-06-21 16:45:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
def draw_output_header(self):
|
2023-07-04 17:16:13 +00:00
|
|
|
if not self.has_correct_level(): return
|
2023-06-21 16:45:50 +00:00
|
|
|
self.layout.prop(self.op, 'output_header')
|
|
|
|
if self.op.output_header:
|
|
|
|
self.layout.prop(self.op, 'gcode_header')
|
|
|
|
|
|
|
|
def draw_output_trailer(self):
|
2023-07-04 17:16:13 +00:00
|
|
|
if not self.has_correct_level(): return
|
2023-06-21 16:45:50 +00:00
|
|
|
self.layout.prop(self.op, 'output_trailer')
|
|
|
|
if self.op.output_trailer:
|
|
|
|
self.layout.prop(self.op, 'gcode_trailer')
|
|
|
|
|
|
|
|
def draw_enable_dust(self):
|
2023-07-04 17:16:13 +00:00
|
|
|
if not self.has_correct_level(): return
|
2023-06-21 16:45:50 +00:00
|
|
|
self.layout.prop(self.op, 'enable_dust')
|
|
|
|
if self.op.enable_dust:
|
|
|
|
self.layout.prop(self.op, 'gcode_start_dust_cmd')
|
|
|
|
self.layout.prop(self.op, 'gcode_stop_dust_cmd')
|
|
|
|
|
|
|
|
def draw_enable_hold(self):
|
2023-07-04 17:16:13 +00:00
|
|
|
if not self.has_correct_level(): return
|
2023-06-21 16:45:50 +00:00
|
|
|
self.layout.prop(self.op, 'enable_hold')
|
|
|
|
if self.op.enable_hold:
|
|
|
|
self.layout.prop(self.op, 'gcode_start_hold_cmd')
|
|
|
|
self.layout.prop(self.op, 'gcode_stop_hold_cmd')
|
|
|
|
|
|
|
|
def draw_enable_mist(self):
|
2023-07-04 17:16:13 +00:00
|
|
|
if not self.has_correct_level(): return
|
2023-06-21 16:45:50 +00:00
|
|
|
self.layout.prop(self.op, 'enable_mist')
|
|
|
|
if self.op.enable_mist:
|
|
|
|
self.layout.prop(self.op, 'gcode_start_mist_cmd')
|
|
|
|
self.layout.prop(self.op, 'gcode_stop_mist_cmd')
|
2023-06-13 18:15:22 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
2023-06-21 16:45:50 +00:00
|
|
|
self.context = context
|
2023-06-13 18:15:22 +00:00
|
|
|
|
2023-06-21 16:45:50 +00:00
|
|
|
self.draw_output_header()
|
|
|
|
self.draw_output_trailer()
|
|
|
|
self.draw_enable_dust()
|
|
|
|
self.draw_enable_hold()
|
|
|
|
self.draw_enable_mist()
|