Skip to content

Commit

Permalink
added protection for height. modified some menus
Browse files Browse the repository at this point in the history
  • Loading branch information
pppalain committed Oct 30, 2023
1 parent 60cc72e commit aecdffd
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion scripts/addons/cam/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def execute(self, context):

#check for free movement height < maxz and return with error
if(o.movement.free_height < o.maxz):
self.report({'ERROR_INVALID_INPUT'}, "Free movement height is less than maximum Z height, correct and try again.")
self.report({'ERROR_INVALID_INPUT'}, "Free movement height is less than Operation depth start \n correct and try again.")
return {'CANCELLED'}

if o.computing:
Expand Down
7 changes: 5 additions & 2 deletions scripts/addons/cam/ui_panels/area.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import bpy
from cam.ui_panels.buttons_panel import CAMButtonsPanel


class CAM_AREA_Panel(CAMButtonsPanel, bpy.types.Panel):
"""CAM operation area panel"""
bl_label = "CAM operation area "
Expand Down Expand Up @@ -37,9 +38,11 @@ def draw_first_down(self, col):
def draw_maxz(self):
if not self.has_correct_level(): return
self.layout.prop(self.op, 'maxz')
self.layout.prop(self.op.movement, 'free_height')
if self.op.maxz > self.op.movement.free_height:
self.layout.prop(self.op.movement, 'free_height')
self.layout.label(text='POSSIBLE COLLISION: Depth start > Free movement')
self.layout.label(text='!ERROR! COLLISION!')
self.layout.label(text='Depth start > Free movement height')
self.layout.label(text='!ERROR! COLLISION!')

def draw_minz(self):
if not self.has_correct_level(): return
Expand Down
12 changes: 6 additions & 6 deletions scripts/addons/cam/ui_panels/machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ class CAM_MACHINE_Panel(CAMButtonsPanel, bpy.types.Panel):
'draw_presets': 1,
'draw_post_processor': 0,
'draw_split_files': 2,
'draw_system': 1,
'draw_system': 0,
'draw_position_definitions': 2,
'draw_working_area': 2,
'draw_feedrates': 2,
'draw_splindle_speeds': 2,
'draw_working_area': 0,
'draw_feedrates': 1,
'draw_splindle_speeds': 0,
'draw_tool_options': 2,
'draw_suplemental_axis': 2,
'draw_suplemental_axis': 3,
'draw_collet_size': 2,
'draw_block_numbers': 2,
'draw_hourly_rate': 2
'draw_hourly_rate': 1
}

def draw_presets(self):
Expand Down
6 changes: 6 additions & 0 deletions scripts/addons/cam/ui_panels/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ def draw_presets(self):

def draw_calculate_path(self):
if not self.has_correct_level(): return
if self.op.maxz > self.op.movement.free_height:
self.layout.label(text='!ERROR! COLLISION!')
self.layout.label(text='Depth start > Free movement height')
self.layout.label(text='!ERROR! COLLISION!')
self.layout.prop(self.op.movement, 'free_height')

if self.op.valid:
self.layout.operator("object.calculate_cam_path", text="Calculate path & export Gcode")
else:
Expand Down

0 comments on commit aecdffd

Please sign in to comment.