From f7f88a34be5417115b117ef69267c01b1b95e8d4 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Fri, 18 Feb 2022 13:21:20 +0200 Subject: [PATCH] - completed the refactoring of object `options` property to `obj_options` in preprocessors too --- CHANGELOG.md | 4 ++++ preprocessors/Berta_CNC.py | 22 +++++++++++----------- preprocessors/Check_points.py | 18 +++++++++--------- preprocessors/Default_no_M6.py | 18 +++++++++--------- preprocessors/GRBL_11.py | 18 +++++++++--------- preprocessors/GRBL_11_no_M6.py | 18 +++++++++--------- preprocessors/GRBL_laser.py | 10 +++++----- preprocessors/GRBL_laser_z.py | 10 +++++----- preprocessors/ISEL_CNC.py | 18 +++++++++--------- preprocessors/ISEL_ICP_CNC.py | 20 ++++++++++---------- preprocessors/Line_xyz.py | 20 ++++++++++---------- preprocessors/Marlin.py | 18 +++++++++--------- preprocessors/Marlin_laser_FAN_pin.py | 10 +++++----- preprocessors/Marlin_laser_Spindle_pin.py | 10 +++++----- preprocessors/Marlin_laser_z.py | 12 ++++++------ preprocessors/NCCAD9.py | 18 +++++++++--------- preprocessors/Paste_1.py | 10 +++++----- preprocessors/Repetier.py | 18 +++++++++--------- preprocessors/Toolchange_Manual.py | 18 +++++++++--------- preprocessors/Toolchange_Probe_MACH3.py | 18 +++++++++--------- preprocessors/default.py | 18 +++++++++--------- preprocessors/default_laser.py | 10 +++++----- preprocessors/grbl_laser_eleks_drd.py | 14 +++++++------- 23 files changed, 177 insertions(+), 173 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 12d0fe57..7135e24b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ CHANGELOG for FlatCAM beta ================================================= +18.02.2022 + +- completed the refactoring of object `options` property to `obj_options` in preprocessors too + 16.02.2022 - refactoring all the references to object `options` property to `obj_options` to make a difference with the application `options` property diff --git a/preprocessors/Berta_CNC.py b/preprocessors/Berta_CNC.py index 5828c1e9..11e02177 100644 --- a/preprocessors/Berta_CNC.py +++ b/preprocessors/Berta_CNC.py @@ -25,18 +25,18 @@ class Berta_CNC(PreProc): end_coords_xy = p['xy_end'] gcode = '(This preprocessor is used with a BERTA CNC router.)\n\n' - xmin = '%.*f' % (p.coords_decimals, p['options']['xmin']) - xmax = '%.*f' % (p.coords_decimals, p['options']['xmax']) - ymin = '%.*f' % (p.coords_decimals, p['options']['ymin']) - ymax = '%.*f' % (p.coords_decimals, p['options']['ymax']) + xmin = '%.*f' % (p.coords_decimals, p['obj_options']['xmin']) + xmax = '%.*f' % (p.coords_decimals, p['obj_options']['xmax']) + ymin = '%.*f' % (p.coords_decimals, p['obj_options']['ymin']) + ymax = '%.*f' % (p.coords_decimals, p['obj_options']['ymax']) - if str(p['options']['type']) == 'Geometry': - gcode += '(TOOL DIAMETER: ' + str(p['options']['tool_dia']) + units + ')\n' + if str(p['obj_options']['type']) == 'Geometry': + gcode += '(TOOL DIAMETER: ' + str(p['obj_options']['tool_dia']) + units + ')\n' gcode += '(Feedrate: ' + str(p['feedrate']) + units + '/min' + ')\n' - if str(p['options']['type']) == 'Geometry': - gcode += '(TOOL DIAMETER: ' + str(p['options']['tool_dia']) + units + ')\n' + if str(p['obj_options']['type']) == 'Geometry': + gcode += '(TOOL DIAMETER: ' + str(p['obj_options']['tool_dia']) + units + ')\n' gcode += '(Feedrate_XY: ' + str(p['feedrate']) + units + '/min' + ')\n' gcode += '(Feedrate_Z: ' + str(p['z_feedrate']) + units + '/min' + ')\n' gcode += '(Feedrate rapids ' + str(p['feedrate_rapid']) + units + '/min' + ')\n' + '\n' @@ -46,7 +46,7 @@ class Berta_CNC(PreProc): str(math.ceil(abs(p['z_cut']) / p['z_depthpercut'])) + ' passes' + ')\n' gcode += '(Z_Move: ' + str(p['z_move']) + units + ')\n' - elif str(p['options']['type']) == 'Excellon' and p['use_ui'] is True: + elif str(p['obj_options']['type']) == 'Excellon' and p['use_ui'] is True: gcode += '\n(TOOLS DIAMETER: )\n' for tool, val in p['tools'].items(): gcode += '(Tool: %s -> ' % str(tool) + 'Dia: %s' % str(val["tooldia"]) + ')\n' @@ -100,7 +100,7 @@ class Berta_CNC(PreProc): gcode += '(Steps per circle: ' + str(p['steps_per_circle']) + ')\n' gcode += '(Steps per circle: ' + str(p['steps_per_circle']) + ')\n' - if str(p['options']['type']) == 'Excellon' or str(p['options']['type']) == 'Excellon Geometry': + if str(p['obj_options']['type']) == 'Excellon' or str(p['obj_options']['type']) == 'Excellon Geometry': gcode += '(Preprocessor Excellon: ' + str(p['pp_excellon_name']) + ')\n' + '\n' else: gcode += '(Preprocessor Geometry: ' + str(p['pp_geometry_name']) + ')\n' + '\n' @@ -157,7 +157,7 @@ class Berta_CNC(PreProc): toolC_formatted = '%.*f' % (p.decimals, p.toolC) - if str(p['options']['type']) == 'Excellon': + if str(p['obj_options']['type']) == 'Excellon': no_drills = p['tools'][int(p['tool'])]['nr_drills'] if toolchangexy is not None: diff --git a/preprocessors/Check_points.py b/preprocessors/Check_points.py index dcc3b2f9..ea5d9dec 100644 --- a/preprocessors/Check_points.py +++ b/preprocessors/Check_points.py @@ -23,13 +23,13 @@ class Check_points(PreProc): gcode += '(by moving a probe - possible a fine drill bit - to custom locations)\n' gcode += '(and wait for user interaction in order to continue to the next point.)\n\n' - xmin = '%.*f' % (p.coords_decimals, p['options']['xmin']) - xmax = '%.*f' % (p.coords_decimals, p['options']['xmax']) - ymin = '%.*f' % (p.coords_decimals, p['options']['ymin']) - ymax = '%.*f' % (p.coords_decimals, p['options']['ymax']) + xmin = '%.*f' % (p.coords_decimals, p['obj_options']['xmin']) + xmax = '%.*f' % (p.coords_decimals, p['obj_options']['xmax']) + ymin = '%.*f' % (p.coords_decimals, p['obj_options']['ymin']) + ymax = '%.*f' % (p.coords_decimals, p['obj_options']['ymax']) - if str(p['options']['type']) == 'Geometry': - gcode += '(TOOL DIAMETER: ' + str(p['options']['tool_dia']) + units + ')\n' + if str(p['obj_options']['type']) == 'Geometry': + gcode += '(TOOL DIAMETER: ' + str(p['obj_options']['tool_dia']) + units + ')\n' gcode += '(Feedrate_XY: ' + str(p['feedrate']) + units + '/min' + ')\n' gcode += '(Feedrate_Z: ' + str(p['z_feedrate']) + units + '/min' + ')\n' gcode += '(Feedrate rapids ' + str(p['feedrate_rapid']) + units + '/min' + ')\n' + '\n' @@ -39,7 +39,7 @@ class Check_points(PreProc): str(math.ceil(abs(p['z_cut']) / p['z_depthpercut'])) + ' passes' + ')\n' gcode += '(Z_Move: ' + str(p['z_move']) + units + ')\n' - elif str(p['options']['type']) == 'Excellon' and p['use_ui'] is True: + elif str(p['obj_options']['type']) == 'Excellon' and p['use_ui'] is True: gcode += '\n(TOOLS DIAMETER: )\n' for tool, val in p['tools'].items(): gcode += '(Tool: %s -> ' % str(tool) + 'Dia: %s' % str(val["tooldia"]) + ')\n' @@ -92,7 +92,7 @@ class Check_points(PreProc): gcode += '(X,Y End: ' + "None" + units + ')\n' gcode += '(Steps per circle: ' + str(p['steps_per_circle']) + ')\n' - if str(p['options']['type']) == 'Excellon' or str(p['options']['type']) == 'Excellon Geometry': + if str(p['obj_options']['type']) == 'Excellon' or str(p['obj_options']['type']) == 'Excellon Geometry': gcode += '(Preprocessor Excellon: ' + str(p['pp_excellon_name']) + ')\n' + '\n' else: gcode += '(Preprocessor Geometry: ' + str(p['pp_geometry_name']) + ')\n' + '\n' @@ -140,7 +140,7 @@ class Check_points(PreProc): if int(p.tool) == 1 and p.startz is not None: z_toolchange = p.startz - if str(p['options']['type']) == 'Excellon': + if str(p['obj_options']['type']) == 'Excellon': if toolchangexy is not None: gcode = """ M5 diff --git a/preprocessors/Default_no_M6.py b/preprocessors/Default_no_M6.py index 1b0727f6..61b8c2d5 100644 --- a/preprocessors/Default_no_M6.py +++ b/preprocessors/Default_no_M6.py @@ -22,13 +22,13 @@ class Default_no_M6(PreProc): gcode = '(This preprocessor is the default preprocessor used by FlatCAM.)\n' gcode += '(It is made to work with MACH3 compatible motion controllers and has no M6 coommand)\n\n' - xmin = '%.*f' % (p.coords_decimals, p['options']['xmin']) - xmax = '%.*f' % (p.coords_decimals, p['options']['xmax']) - ymin = '%.*f' % (p.coords_decimals, p['options']['ymin']) - ymax = '%.*f' % (p.coords_decimals, p['options']['ymax']) + xmin = '%.*f' % (p.coords_decimals, p['obj_options']['xmin']) + xmax = '%.*f' % (p.coords_decimals, p['obj_options']['xmax']) + ymin = '%.*f' % (p.coords_decimals, p['obj_options']['ymin']) + ymax = '%.*f' % (p.coords_decimals, p['obj_options']['ymax']) - if str(p['options']['type']) == 'Geometry': - gcode += '(TOOL DIAMETER: ' + str(p['options']['tool_dia']) + units + ')\n' + if str(p['obj_options']['type']) == 'Geometry': + gcode += '(TOOL DIAMETER: ' + str(p['obj_options']['tool_dia']) + units + ')\n' gcode += '(Feedrate_XY: ' + str(p['feedrate']) + units + '/min' + ')\n' gcode += '(Feedrate_Z: ' + str(p['z_feedrate']) + units + '/min' + ')\n' gcode += '(Feedrate rapids ' + str(p['feedrate_rapid']) + units + '/min' + ')\n' + '\n' @@ -38,7 +38,7 @@ class Default_no_M6(PreProc): str(math.ceil(abs(p['z_cut']) / p['z_depthpercut'])) + ' passes' + ')\n' gcode += '(Z_Move: ' + str(p['z_move']) + units + ')\n' - elif str(p['options']['type']) == 'Excellon' and p['use_ui'] is True: + elif str(p['obj_options']['type']) == 'Excellon' and p['use_ui'] is True: gcode += '\n(TOOLS DIAMETER: )\n' for tool, val in p['tools'].items(): gcode += '(Tool: %s -> ' % str(tool) + 'Dia: %s' % str(val["tooldia"]) + ')\n' @@ -91,7 +91,7 @@ class Default_no_M6(PreProc): gcode += '(X,Y End: ' + "None" + units + ')\n' gcode += '(Steps per circle: ' + str(p['steps_per_circle']) + ')\n' - if str(p['options']['type']) == 'Excellon' or str(p['options']['type']) == 'Excellon Geometry': + if str(p['obj_options']['type']) == 'Excellon' or str(p['obj_options']['type']) == 'Excellon Geometry': gcode += '(Preprocessor Excellon: ' + str(p['pp_excellon_name']) + ')\n' + '\n' else: gcode += '(Preprocessor Geometry: ' + str(p['pp_geometry_name']) + ')\n' + '\n' @@ -138,7 +138,7 @@ class Default_no_M6(PreProc): toolC_formatted = '%.*f' % (p.decimals, p.toolC) - if str(p['options']['type']) == 'Excellon': + if str(p['obj_options']['type']) == 'Excellon': no_drills = p['tools'][int(p['tool'])]['nr_drills'] if toolchangexy is not None: diff --git a/preprocessors/GRBL_11.py b/preprocessors/GRBL_11.py index 53b61c3e..d7e1f496 100644 --- a/preprocessors/GRBL_11.py +++ b/preprocessors/GRBL_11.py @@ -22,13 +22,13 @@ class GRBL_11(PreProc): gcode = '(This preprocessor is used with a motion controller loaded with GRBL firmware.)\n' gcode += '(It is configured to be compatible with almost any version of GRBL firmware.)\n\n' - xmin = '%.*f' % (p.coords_decimals, p['options']['xmin']) - xmax = '%.*f' % (p.coords_decimals, p['options']['xmax']) - ymin = '%.*f' % (p.coords_decimals, p['options']['ymin']) - ymax = '%.*f' % (p.coords_decimals, p['options']['ymax']) + xmin = '%.*f' % (p.coords_decimals, p['obj_options']['xmin']) + xmax = '%.*f' % (p.coords_decimals, p['obj_options']['xmax']) + ymin = '%.*f' % (p.coords_decimals, p['obj_options']['ymin']) + ymax = '%.*f' % (p.coords_decimals, p['obj_options']['ymax']) - if str(p['options']['type']) == 'Geometry': - gcode += '(TOOL DIAMETER: ' + str(p['options']['tool_dia']) + units + ')\n' + if str(p['obj_options']['type']) == 'Geometry': + gcode += '(TOOL DIAMETER: ' + str(p['obj_options']['tool_dia']) + units + ')\n' gcode += '(Feedrate_XY: ' + str(p['feedrate']) + units + '/min' + ')\n' gcode += '(Feedrate_Z: ' + str(p['z_feedrate']) + units + '/min' + ')\n' gcode += '(Feedrate rapids ' + str(p['feedrate_rapid']) + units + '/min' + ')\n' + '\n' @@ -38,7 +38,7 @@ class GRBL_11(PreProc): str(math.ceil(abs(p['z_cut']) / p['z_depthpercut'])) + ' passes' + ')\n' gcode += '(Z_Move: ' + str(p['z_move']) + units + ')\n' - elif str(p['options']['type']) == 'Excellon' and p['use_ui'] is True: + elif str(p['obj_options']['type']) == 'Excellon' and p['use_ui'] is True: gcode += '\n(TOOLS DIAMETER: )\n' for tool, val in p['tools'].items(): gcode += '(Tool: %s -> ' % str(tool) + 'Dia: %s' % str(val["tooldia"]) + ')\n' @@ -91,7 +91,7 @@ class GRBL_11(PreProc): gcode += '(X,Y End: ' + "None" + units + ')\n' gcode += '(Steps per circle: ' + str(p['steps_per_circle']) + ')\n' - if str(p['options']['type']) == 'Excellon' or str(p['options']['type']) == 'Excellon Geometry': + if str(p['obj_options']['type']) == 'Excellon' or str(p['obj_options']['type']) == 'Excellon Geometry': gcode += '(Preprocessor Excellon: ' + str(p['pp_excellon_name']) + ')\n' + '\n' else: gcode += '(Preprocessor Geometry: ' + str(p['pp_geometry_name']) + ')\n' + '\n' @@ -139,7 +139,7 @@ class GRBL_11(PreProc): toolC_formatted = '%.*f' % (p.decimals, p.toolC) - if str(p['options']['type']) == 'Excellon': + if str(p['obj_options']['type']) == 'Excellon': no_drills = p['tools'][int(p['tool'])]['nr_drills'] if toolchangexy is not None: diff --git a/preprocessors/GRBL_11_no_M6.py b/preprocessors/GRBL_11_no_M6.py index fc569311..b474c746 100644 --- a/preprocessors/GRBL_11_no_M6.py +++ b/preprocessors/GRBL_11_no_M6.py @@ -22,13 +22,13 @@ class GRBL_11_no_M6(PreProc): gcode = '(This preprocessor is used with a motion controller loaded with GRBL firmware.)\n' gcode += '(It is configured to be compatible with almost any version of GRBL firmware. No M6 command.)\n\n' - xmin = '%.*f' % (p.coords_decimals, p['options']['xmin']) - xmax = '%.*f' % (p.coords_decimals, p['options']['xmax']) - ymin = '%.*f' % (p.coords_decimals, p['options']['ymin']) - ymax = '%.*f' % (p.coords_decimals, p['options']['ymax']) + xmin = '%.*f' % (p.coords_decimals, p['obj_options']['xmin']) + xmax = '%.*f' % (p.coords_decimals, p['obj_options']['xmax']) + ymin = '%.*f' % (p.coords_decimals, p['obj_options']['ymin']) + ymax = '%.*f' % (p.coords_decimals, p['obj_options']['ymax']) - if str(p['options']['type']) == 'Geometry': - gcode += '(TOOL DIAMETER: ' + str(p['options']['tool_dia']) + units + ')\n' + if str(p['obj_options']['type']) == 'Geometry': + gcode += '(TOOL DIAMETER: ' + str(p['obj_options']['tool_dia']) + units + ')\n' gcode += '(Feedrate_XY: ' + str(p['feedrate']) + units + '/min' + ')\n' gcode += '(Feedrate_Z: ' + str(p['z_feedrate']) + units + '/min' + ')\n' gcode += '(Feedrate rapids ' + str(p['feedrate_rapid']) + units + '/min' + ')\n' + '\n' @@ -38,7 +38,7 @@ class GRBL_11_no_M6(PreProc): str(math.ceil(abs(p['z_cut']) / p['z_depthpercut'])) + ' passes' + ')\n' gcode += '(Z_Move: ' + str(p['z_move']) + units + ')\n' - elif str(p['options']['type']) == 'Excellon' and p['use_ui'] is True: + elif str(p['obj_options']['type']) == 'Excellon' and p['use_ui'] is True: gcode += '\n(TOOLS DIAMETER: )\n' for tool, val in p['tools'].items(): gcode += '(Tool: %s -> ' % str(tool) + 'Dia: %s' % str(val["tooldia"]) + ')\n' @@ -92,7 +92,7 @@ class GRBL_11_no_M6(PreProc): gcode += '(Steps per circle: ' + str(p['steps_per_circle']) + ')\n' gcode += '(Steps per circle: ' + str(p['steps_per_circle']) + ')\n' - if str(p['options']['type']) == 'Excellon' or str(p['options']['type']) == 'Excellon Geometry': + if str(p['obj_options']['type']) == 'Excellon' or str(p['obj_options']['type']) == 'Excellon Geometry': gcode += '(Preprocessor Excellon: ' + str(p['pp_excellon_name']) + ')\n' + '\n' else: gcode += '(Preprocessor Geometry: ' + str(p['pp_geometry_name']) + ')\n' + '\n' @@ -140,7 +140,7 @@ class GRBL_11_no_M6(PreProc): toolC_formatted = '%.*f' % (p.decimals, p.toolC) - if str(p['options']['type']) == 'Excellon': + if str(p['obj_options']['type']) == 'Excellon': no_drills = p['tools'][int(p['tool'])]['nr_drills'] if toolchangexy is not None: diff --git a/preprocessors/GRBL_laser.py b/preprocessors/GRBL_laser.py index 6ecea386..b559f510 100644 --- a/preprocessors/GRBL_laser.py +++ b/preprocessors/GRBL_laser.py @@ -27,15 +27,15 @@ class GRBL_laser(PreProc): '(It assumes a manually focused laser.)\n' \ '(The laser is started with M3 command and stopped with the M5 command.)\n\n' - xmin = '%.*f' % (p.coords_decimals, p['options']['xmin']) - xmax = '%.*f' % (p.coords_decimals, p['options']['xmax']) - ymin = '%.*f' % (p.coords_decimals, p['options']['ymin']) - ymax = '%.*f' % (p.coords_decimals, p['options']['ymax']) + xmin = '%.*f' % (p.coords_decimals, p['obj_options']['xmin']) + xmax = '%.*f' % (p.coords_decimals, p['obj_options']['xmax']) + ymin = '%.*f' % (p.coords_decimals, p['obj_options']['ymin']) + ymax = '%.*f' % (p.coords_decimals, p['obj_options']['ymax']) gcode += '(Feedrate: ' + str(p['feedrate']) + units + '/min' + ')\n' gcode += '(Steps per circle: ' + str(p['steps_per_circle']) + ')\n' - if str(p['options']['type']) == 'Excellon' or str(p['options']['type']) == 'Excellon Geometry': + if str(p['obj_options']['type']) == 'Excellon' or str(p['obj_options']['type']) == 'Excellon Geometry': gcode += '(Preprocessor Excellon: ' + str(p['pp_excellon_name']) + ')\n' else: gcode += '(Preprocessor Geometry: ' + str(p['pp_geometry_name']) + ')\n' + '\n' diff --git a/preprocessors/GRBL_laser_z.py b/preprocessors/GRBL_laser_z.py index e44074ea..608bf43b 100644 --- a/preprocessors/GRBL_laser_z.py +++ b/preprocessors/GRBL_laser_z.py @@ -26,10 +26,10 @@ class GRBL_laser_z(PreProc): gcode += '(It is for the case when it is used together with a LASER connected on the SPINDLE connector.)\n' gcode += '(On toolchange event the laser will move to a defined Z height to change the laser dot size.)\n\n' - xmin = '%.*f' % (p.coords_decimals, p['options']['xmin']) - xmax = '%.*f' % (p.coords_decimals, p['options']['xmax']) - ymin = '%.*f' % (p.coords_decimals, p['options']['ymin']) - ymax = '%.*f' % (p.coords_decimals, p['options']['ymax']) + xmin = '%.*f' % (p.coords_decimals, p['obj_options']['xmin']) + xmax = '%.*f' % (p.coords_decimals, p['obj_options']['xmax']) + ymin = '%.*f' % (p.coords_decimals, p['obj_options']['ymin']) + ymax = '%.*f' % (p.coords_decimals, p['obj_options']['ymax']) if p['use_ui'] is True and p['multigeo']: gcode += '\n(TOOLS DIAMETER: )\n' @@ -58,7 +58,7 @@ class GRBL_laser_z(PreProc): gcode += '(Z End: ' + str(p['z_end']) + units + ')\n' gcode += '(Steps per circle: ' + str(p['steps_per_circle']) + ')\n' - if str(p['options']['type']) == 'Excellon' or str(p['options']['type']) == 'Excellon Geometry': + if str(p['obj_options']['type']) == 'Excellon' or str(p['obj_options']['type']) == 'Excellon Geometry': gcode += '(Preprocessor Excellon: ' + str(p['pp_excellon_name']) + ')\n' else: gcode += '(Preprocessor Geometry: ' + str(p['pp_geometry_name']) + ')\n' + '\n' diff --git a/preprocessors/ISEL_CNC.py b/preprocessors/ISEL_CNC.py index b3f04599..5668a222 100644 --- a/preprocessors/ISEL_CNC.py +++ b/preprocessors/ISEL_CNC.py @@ -20,13 +20,13 @@ class ISEL_CNC(PreProc): end_coords_xy = p['xy_end'] gcode = '(This preprocessor is used with a ISEL CNC router.)\n\n' - xmin = '%.*f' % (p.coords_decimals, p['options']['xmin']) - xmax = '%.*f' % (p.coords_decimals, p['options']['xmax']) - ymin = '%.*f' % (p.coords_decimals, p['options']['ymin']) - ymax = '%.*f' % (p.coords_decimals, p['options']['ymax']) + xmin = '%.*f' % (p.coords_decimals, p['obj_options']['xmin']) + xmax = '%.*f' % (p.coords_decimals, p['obj_options']['xmax']) + ymin = '%.*f' % (p.coords_decimals, p['obj_options']['ymin']) + ymax = '%.*f' % (p.coords_decimals, p['obj_options']['ymax']) - if str(p['options']['type']) == 'Geometry': - gcode += '(TOOL DIAMETER: ' + str(p['options']['tool_dia']) + units + ')\n' + if str(p['obj_options']['type']) == 'Geometry': + gcode += '(TOOL DIAMETER: ' + str(p['obj_options']['tool_dia']) + units + ')\n' gcode += '(Feedrate_XY: ' + str(p['feedrate']) + units + '/min' + ')\n' gcode += '(Feedrate_Z: ' + str(p['z_feedrate']) + units + '/min' + ')\n' gcode += '(Feedrate rapids ' + str(p['feedrate_rapid']) + units + '/min' + ')\n' + '\n' @@ -36,7 +36,7 @@ class ISEL_CNC(PreProc): str(math.ceil(abs(p['z_cut']) / p['z_depthpercut'])) + ' passes' + ')\n' gcode += '(Z_Move: ' + str(p['z_move']) + units + ')\n' - elif str(p['options']['type']) == 'Excellon' and p['use_ui'] is True: + elif str(p['obj_options']['type']) == 'Excellon' and p['use_ui'] is True: gcode += '\n(TOOLS DIAMETER: )\n' for tool, val in p['tools'].items(): gcode += '(Tool: %s -> ' % str(tool) + 'Dia: %s' % str(val["tooldia"]) + ')\n' @@ -90,7 +90,7 @@ class ISEL_CNC(PreProc): gcode += '(Steps per circle: ' + str(p['steps_per_circle']) + ')\n' gcode += '(Steps per circle: ' + str(p['steps_per_circle']) + ')\n' - if str(p['options']['type']) == 'Excellon' or str(p['options']['type']) == 'Excellon Geometry': + if str(p['obj_options']['type']) == 'Excellon' or str(p['obj_options']['type']) == 'Excellon Geometry': gcode += '(Preprocessor Excellon: ' + str(p['pp_excellon_name']) + ')\n' + '\n' else: gcode += '(Preprocessor Geometry: ' + str(p['pp_geometry_name']) + ')\n' + '\n' @@ -124,7 +124,7 @@ class ISEL_CNC(PreProc): toolC_formatted = '%.*f' % (p.decimals, p.toolC) - if str(p['options']['type']) == 'Excellon': + if str(p['obj_options']['type']) == 'Excellon': no_drills = p['tools'][int(p['tool'])]['nr_drills'] gcode = """ diff --git a/preprocessors/ISEL_ICP_CNC.py b/preprocessors/ISEL_ICP_CNC.py index 5912b03a..604b9690 100644 --- a/preprocessors/ISEL_ICP_CNC.py +++ b/preprocessors/ISEL_ICP_CNC.py @@ -18,15 +18,15 @@ class ISEL_ICP_CNC(PreProc): end_coords_xy = p['xy_end'] gcode = '; This preprocessor is used with a ISEL ICP CNC router.\n\n' - xmin = '%.*f' % (p.coords_decimals, p['options']['xmin']) - xmax = '%.*f' % (p.coords_decimals, p['options']['xmax']) - ymin = '%.*f' % (p.coords_decimals, p['options']['ymin']) - ymax = '%.*f' % (p.coords_decimals, p['options']['ymax']) + xmin = '%.*f' % (p.coords_decimals, p['obj_options']['xmin']) + xmax = '%.*f' % (p.coords_decimals, p['obj_options']['xmax']) + ymin = '%.*f' % (p.coords_decimals, p['obj_options']['ymin']) + ymax = '%.*f' % (p.coords_decimals, p['obj_options']['ymax']) gcode += 'IMF_PBL flatcam\n\n' - if str(p['options']['type']) == 'Geometry': - gcode += ';TOOL DIAMETER: ' + str(p['options']['tool_dia']) + units + '\n' + if str(p['obj_options']['type']) == 'Geometry': + gcode += ';TOOL DIAMETER: ' + str(p['obj_options']['tool_dia']) + units + '\n' gcode += ';Feedrate_XY: ' + str(p['feedrate']) + units + '/min' + '\n' gcode += ';Feedrate_Z: ' + str(p['z_feedrate']) + units + '/min' + '\n' gcode += ';Feedrate rapids ' + str(p['feedrate_rapid']) + units + '/min' + '\n' + '\n' @@ -36,7 +36,7 @@ class ISEL_ICP_CNC(PreProc): str(math.ceil(abs(p['z_cut']) / p['z_depthpercut'])) + ' passes' + '\n' gcode += ';Z_Move: ' + str(p['z_move']) + units + '\n' - elif str(p['options']['type']) == 'Excellon' and p['use_ui'] is True: + elif str(p['obj_options']['type']) == 'Excellon' and p['use_ui'] is True: gcode += '\n;TOOLS DIAMETER: \n' for tool, val in p['tools'].items(): gcode += ';Tool: %s -> ' % str(tool) + 'Dia: %s' % str(val["tooldia"]) + '\n' @@ -90,7 +90,7 @@ class ISEL_ICP_CNC(PreProc): gcode += '(Steps per circle: ' + str(p['steps_per_circle']) + ')\n' gcode += ';Steps per circle: ' + str(p['steps_per_circle']) + '\n' - if str(p['options']['type']) == 'Excellon' or str(p['options']['type']) == 'Excellon Geometry': + if str(p['obj_options']['type']) == 'Excellon' or str(p['obj_options']['type']) == 'Excellon Geometry': gcode += ';Preprocessor Excellon: ' + str(p['pp_excellon_name']) + '\n' + '\n' else: gcode += ';Preprocessor Geometry: ' + str(p['pp_geometry_name']) + '\n' + '\n' @@ -120,8 +120,8 @@ class ISEL_ICP_CNC(PreProc): toolC_formatted = '%.*f' % (p.decimals, p.toolC) - if str(p['options']['type']) == 'Excellon': - for i in p['options']['Tools_in_use']: + if str(p['obj_options']['type']) == 'Excellon': + for i in p['obj_options']['Tools_in_use']: if i[0] == p.tool: no_drills = i[2] diff --git a/preprocessors/Line_xyz.py b/preprocessors/Line_xyz.py index 3b2b793e..28345d2f 100644 --- a/preprocessors/Line_xyz.py +++ b/preprocessors/Line_xyz.py @@ -21,13 +21,13 @@ class Line_xyz(PreProc): end_coords_xy = p['end_xy'] gcode = '(This preprocessor has all the coordinates on the same line: X, Y, Z.)\n\n' - xmin = '%.*f' % (p.coords_decimals, p['options']['xmin']) - xmax = '%.*f' % (p.coords_decimals, p['options']['xmax']) - ymin = '%.*f' % (p.coords_decimals, p['options']['ymin']) - ymax = '%.*f' % (p.coords_decimals, p['options']['ymax']) + xmin = '%.*f' % (p.coords_decimals, p['obj_options']['xmin']) + xmax = '%.*f' % (p.coords_decimals, p['obj_options']['xmax']) + ymin = '%.*f' % (p.coords_decimals, p['obj_options']['ymin']) + ymax = '%.*f' % (p.coords_decimals, p['obj_options']['ymax']) - if str(p['options']['type']) == 'Geometry': - gcode += '(TOOL DIAMETER: ' + str(p['options']['tool_dia']) + units + ')\n' + if str(p['obj_options']['type']) == 'Geometry': + gcode += '(TOOL DIAMETER: ' + str(p['obj_options']['tool_dia']) + units + ')\n' gcode += '(Feedrate_XY: ' + str(p['feedrate']) + units + '/min' + ')\n' gcode += '(Feedrate_Z: ' + str(p['z_feedrate']) + units + '/min' + ')\n' gcode += '(Feedrate rapids ' + str(p['feedrate_rapid']) + units + '/min' + ')\n' + '\n' @@ -37,7 +37,7 @@ class Line_xyz(PreProc): str(math.ceil(abs(p['z_cut']) / p['z_depthpercut'])) + ' passes' + ')\n' gcode += '(Z_Move: ' + str(p['z_move']) + units + ')\n' - elif str(p['options']['type']) == 'Excellon' and p['use_ui'] is True: + elif str(p['obj_options']['type']) == 'Excellon' and p['use_ui'] is True: gcode += '\n(TOOLS DIAMETER: )\n' for tool, val in p['tools'].items(): gcode += '(Tool: %s -> ' % str(tool) + 'Dia: %s' % str(val["tooldia"]) + ')\n' @@ -91,7 +91,7 @@ class Line_xyz(PreProc): gcode += '(Steps per circle: ' + str(p['steps_per_circle']) + ')\n' gcode += '(Steps per circle: ' + str(p['steps_per_circle']) + ')\n' - if str(p['options']['type']) == 'Excellon' or str(p['options']['type']) == 'Excellon Geometry': + if str(p['obj_options']['type']) == 'Excellon' or str(p['obj_options']['type']) == 'Excellon Geometry': gcode += '(Preprocessor Excellon: ' + str(p['pp_excellon_name']) + ')\n' + '\n' else: gcode += '(Preprocessor Geometry: ' + str(p['pp_geometry_name']) + ')\n' + '\n' @@ -137,7 +137,7 @@ class Line_xyz(PreProc): x_toolchange = xy_toolchange[0] y_toolchange = xy_toolchange[1] else: - if str(p['options']['type']) == 'Excellon': + if str(p['obj_options']['type']) == 'Excellon': x_toolchange = p.oldx y_toolchange = p.oldy else: @@ -151,7 +151,7 @@ class Line_xyz(PreProc): toolC_formatted = '%.*f' % (p.decimals, p.toolC) - if str(p['options']['type']) == 'Excellon': + if str(p['obj_options']['type']) == 'Excellon': no_drills = p['tools'][int(p['tool'])]['nr_drills'] gcode = """ diff --git a/preprocessors/Marlin.py b/preprocessors/Marlin.py index 610ede36..974aa296 100644 --- a/preprocessors/Marlin.py +++ b/preprocessors/Marlin.py @@ -22,13 +22,13 @@ class Marlin(PreProc): end_coords_xy = p['xy_end'] gcode = ';This preprocessor works with controllers with Marlin firmware.' - xmin = '%.*f' % (p.coords_decimals, p['options']['xmin']) - xmax = '%.*f' % (p.coords_decimals, p['options']['xmax']) - ymin = '%.*f' % (p.coords_decimals, p['options']['ymin']) - ymax = '%.*f' % (p.coords_decimals, p['options']['ymax']) + xmin = '%.*f' % (p.coords_decimals, p['obj_options']['xmin']) + xmax = '%.*f' % (p.coords_decimals, p['obj_options']['xmax']) + ymin = '%.*f' % (p.coords_decimals, p['obj_options']['ymin']) + ymax = '%.*f' % (p.coords_decimals, p['obj_options']['ymax']) - if str(p['options']['type']) == 'Geometry': - gcode += ';TOOL DIAMETER: ' + str(p['options']['tool_dia']) + units + '\n' + if str(p['obj_options']['type']) == 'Geometry': + gcode += ';TOOL DIAMETER: ' + str(p['obj_options']['tool_dia']) + units + '\n' gcode += ';Feedrate_XY: ' + str(p['feedrate']) + units + '/min' + '\n' gcode += ';Feedrate_Z: ' + str(p['z_feedrate']) + units + '/min' + '\n' gcode += ';Feedrate rapids ' + str(p['feedrate_rapid']) + units + '/min' + '\n' + '\n' @@ -38,7 +38,7 @@ class Marlin(PreProc): str(math.ceil(abs(p['z_cut']) / p['z_depthpercut'])) + ' passes' + '\n' gcode += ';Z_Move: ' + str(p['z_move']) + units + '\n' - elif str(p['options']['type']) == 'Excellon' and p['use_ui'] is True: + elif str(p['obj_options']['type']) == 'Excellon' and p['use_ui'] is True: gcode += '\n;TOOLS DIAMETER: \n' for tool, val in p['tools'].items(): gcode += ';Tool: %s -> ' % str(tool) + 'Dia: %s' % str(val["tooldia"]) + '\n' @@ -92,7 +92,7 @@ class Marlin(PreProc): gcode += ';Steps per circle: ' + str(p['steps_per_circle']) + '\n' gcode += ';Steps per circle: ' + str(p['steps_per_circle']) + '\n' - if str(p['options']['type']) == 'Excellon' or str(p['options']['type']) == 'Excellon Geometry': + if str(p['obj_options']['type']) == 'Excellon' or str(p['obj_options']['type']) == 'Excellon Geometry': gcode += ';Preprocessor Excellon: ' + str(p['pp_excellon_name']) + '\n' + '\n' else: gcode += ';Preprocessor Geometry: ' + str(p['pp_geometry_name']) + '\n' + '\n' @@ -137,7 +137,7 @@ class Marlin(PreProc): toolC_formatted = '%.*f' % (p.decimals, p.toolC) - if str(p['options']['type']) == 'Excellon': + if str(p['obj_options']['type']) == 'Excellon': no_drills = p['tools'][int(p['tool'])]['nr_drills'] if toolchangexy is not None: diff --git a/preprocessors/Marlin_laser_FAN_pin.py b/preprocessors/Marlin_laser_FAN_pin.py index 400a90b1..2eb23120 100644 --- a/preprocessors/Marlin_laser_FAN_pin.py +++ b/preprocessors/Marlin_laser_FAN_pin.py @@ -25,10 +25,10 @@ class Marlin_laser_FAN_pin(PreProc): ';It assumes a manually focused laser.\n' \ ';The laser is started with M3 command and stopped with the M5 command.\n\n' - xmin = '%.*f' % (p.coords_decimals, p['options']['xmin']) - xmax = '%.*f' % (p.coords_decimals, p['options']['xmax']) - ymin = '%.*f' % (p.coords_decimals, p['options']['ymin']) - ymax = '%.*f' % (p.coords_decimals, p['options']['ymax']) + xmin = '%.*f' % (p.coords_decimals, p['obj_options']['xmin']) + xmax = '%.*f' % (p.coords_decimals, p['obj_options']['xmax']) + ymin = '%.*f' % (p.coords_decimals, p['obj_options']['ymin']) + ymax = '%.*f' % (p.coords_decimals, p['obj_options']['ymax']) gcode += ';Feedrate: ' + str(p['feedrate']) + units + '/min' + '\n' gcode += ';Feedrate rapids: ' + str(p['feedrate_rapid']) + units + '/min' + '\n\n' @@ -37,7 +37,7 @@ class Marlin_laser_FAN_pin(PreProc): gcode += ';Steps per circle: ' + str(p['steps_per_circle']) + '\n' - if str(p['options']['type']) == 'Excellon' or str(p['options']['type']) == 'Excellon Geometry': + if str(p['obj_options']['type']) == 'Excellon' or str(p['obj_options']['type']) == 'Excellon Geometry': gcode += ';Preprocessor Excellon: ' + str(p['pp_excellon_name']) + '\n' else: gcode += ';Preprocessor Geometry: ' + str(p['pp_geometry_name']) + '\n' diff --git a/preprocessors/Marlin_laser_Spindle_pin.py b/preprocessors/Marlin_laser_Spindle_pin.py index 7c92f9ff..c028266f 100644 --- a/preprocessors/Marlin_laser_Spindle_pin.py +++ b/preprocessors/Marlin_laser_Spindle_pin.py @@ -25,10 +25,10 @@ class Marlin_laser_Spindle_pin(PreProc): ';It assumes a manually focused laser.\n' \ ';The laser is started with M3 command and stopped with the M5 command.\n\n' - xmin = '%.*f' % (p.coords_decimals, p['options']['xmin']) - xmax = '%.*f' % (p.coords_decimals, p['options']['xmax']) - ymin = '%.*f' % (p.coords_decimals, p['options']['ymin']) - ymax = '%.*f' % (p.coords_decimals, p['options']['ymax']) + xmin = '%.*f' % (p.coords_decimals, p['obj_options']['xmin']) + xmax = '%.*f' % (p.coords_decimals, p['obj_options']['xmax']) + ymin = '%.*f' % (p.coords_decimals, p['obj_options']['ymin']) + ymax = '%.*f' % (p.coords_decimals, p['obj_options']['ymax']) gcode += ';Feedrate: ' + str(p['feedrate']) + units + '/min' + '\n' gcode += ';Feedrate rapids: ' + str(p['feedrate_rapid']) + units + '/min' + '\n' + '\n' @@ -37,7 +37,7 @@ class Marlin_laser_Spindle_pin(PreProc): gcode += ';Steps per circle: ' + str(p['steps_per_circle']) + '\n' - if str(p['options']['type']) == 'Excellon' or str(p['options']['type']) == 'Excellon Geometry': + if str(p['obj_options']['type']) == 'Excellon' or str(p['obj_options']['type']) == 'Excellon Geometry': gcode += ';Preprocessor Excellon: ' + str(p['pp_excellon_name']) + '\n' else: gcode += ';Preprocessor Geometry: ' + str(p['pp_geometry_name']) + '\n' diff --git a/preprocessors/Marlin_laser_z.py b/preprocessors/Marlin_laser_z.py index 242e6e62..121f6d5f 100644 --- a/preprocessors/Marlin_laser_z.py +++ b/preprocessors/Marlin_laser_z.py @@ -24,10 +24,10 @@ class Marlin_laser_z(PreProc): gcode += ';It is for the case when it is used together with a LASER connected on the SPINDLE connector.\n' \ ';On toolchange event the laser will move to a defined Z height to change the laser dot size.\n\n' - xmin = '%.*f' % (p.coords_decimals, p['options']['xmin']) - xmax = '%.*f' % (p.coords_decimals, p['options']['xmax']) - ymin = '%.*f' % (p.coords_decimals, p['options']['ymin']) - ymax = '%.*f' % (p.coords_decimals, p['options']['ymax']) + xmin = '%.*f' % (p.coords_decimals, p['obj_options']['xmin']) + xmax = '%.*f' % (p.coords_decimals, p['obj_options']['xmax']) + ymin = '%.*f' % (p.coords_decimals, p['obj_options']['ymin']) + ymax = '%.*f' % (p.coords_decimals, p['obj_options']['ymax']) if p['use_ui'] is True and p['multigeo']: gcode += '\n;TOOLS DIAMETER: \n' @@ -51,7 +51,7 @@ class Marlin_laser_z(PreProc): str(val['data']["tools_mill_spindlespeed"]) + '\n' gcode += '\n;LASER MIN POWER: \n' for tool, val in p['tools'].items(): - if str(p['options']['type']) == 'Excellon': + if str(p['obj_options']['type']) == 'Excellon': gcode += ';Tool: %s -> ' % str(tool) + 'Power: %s' % \ str(val['data']["tools_drill_min_power"]) + '\n' else: @@ -78,7 +78,7 @@ class Marlin_laser_z(PreProc): gcode += ';Z End: ' + str(p['z_end']) + units + '\n' gcode += ';Steps per circle: ' + str(p['steps_per_circle']) + '\n' - if str(p['options']['type']) == 'Excellon' or str(p['options']['type']) == 'Excellon Geometry': + if str(p['obj_options']['type']) == 'Excellon' or str(p['obj_options']['type']) == 'Excellon Geometry': gcode += ';Preprocessor Excellon: ' + str(p['pp_excellon_name']) + '\n' else: gcode += ';Preprocessor Geometry: ' + str(p['pp_geometry_name']) + '\n' diff --git a/preprocessors/NCCAD9.py b/preprocessors/NCCAD9.py index e5400e0c..6164cbb7 100644 --- a/preprocessors/NCCAD9.py +++ b/preprocessors/NCCAD9.py @@ -26,13 +26,13 @@ class NCCAD9(PreProc): end_coords_xy = p['xy_end'] gcode = ';This preprocessor outputs GCode suitable for the Max Computer GmbH nccad9 Computer Numeric Control.\n' - xmin = '%.*f' % (p.coords_decimals, p['options']['xmin']) - xmax = '%.*f' % (p.coords_decimals, p['options']['xmax']) - ymin = '%.*f' % (p.coords_decimals, p['options']['ymin']) - ymax = '%.*f' % (p.coords_decimals, p['options']['ymax']) + xmin = '%.*f' % (p.coords_decimals, p['obj_options']['xmin']) + xmax = '%.*f' % (p.coords_decimals, p['obj_options']['xmax']) + ymin = '%.*f' % (p.coords_decimals, p['obj_options']['ymin']) + ymax = '%.*f' % (p.coords_decimals, p['obj_options']['ymax']) - if str(p['options']['type']) == 'Geometry': - gcode += ';TOOL DIAMETER: ' + str(p['options']['tool_dia']) + units + '\n' + if str(p['obj_options']['type']) == 'Geometry': + gcode += ';TOOL DIAMETER: ' + str(p['obj_options']['tool_dia']) + units + '\n' gcode += ';Feedrate_XY: ' + str(p['feedrate']) + units + '/min' + '\n' gcode += ';Feedrate_Z: ' + str(p['z_feedrate']) + units + '/min' + '\n' gcode += ';Feedrate rapids ' + str(p['feedrate_rapid']) + units + '/min' + '\n' + '\n' @@ -42,7 +42,7 @@ class NCCAD9(PreProc): str(math.ceil(abs(p['z_cut']) / p['z_depthpercut'])) + ' passes' + '\n' gcode += ';Z_Move: ' + str(p['z_move']) + units + '\n' - elif str(p['options']['type']) == 'Excellon' and p['use_ui'] is True: + elif str(p['obj_options']['type']) == 'Excellon' and p['use_ui'] is True: gcode += '\n;TOOLS DIAMETER: \n' for tool, val in p['tools'].items(): gcode += ';Tool: %s -> ' % str(tool) + 'Dia: %s' % str(val["tooldia"]) + '\n' @@ -96,7 +96,7 @@ class NCCAD9(PreProc): gcode += ';Steps per circle: ' + str(p['steps_per_circle']) + '\n' - if str(p['options']['type']) == 'Excellon' or str(p['options']['type']) == 'Excellon Geometry': + if str(p['obj_options']['type']) == 'Excellon' or str(p['obj_options']['type']) == 'Excellon Geometry': gcode += ';Preprocessor Excellon: ' + str(p['pp_excellon_name']) + '\n' + '\n' else: gcode += ';Preprocessor Geometry: ' + str(p['pp_geometry_name']) + '\n' + '\n' @@ -143,7 +143,7 @@ class NCCAD9(PreProc): toolC_formatted = '%.*f' % (p.decimals, p.toolC) - if str(p['options']['type']) == 'Excellon': + if str(p['obj_options']['type']) == 'Excellon': no_drills = p['tools'][int(p['tool'])]['nr_drills'] if toolchangexy is not None and x_toolchange !=0.0 and y_toolchange != 0.0: diff --git a/preprocessors/Paste_1.py b/preprocessors/Paste_1.py index 8feb781b..e295048d 100644 --- a/preprocessors/Paste_1.py +++ b/preprocessors/Paste_1.py @@ -24,12 +24,12 @@ class Paste_1(AppPreProcTools): coords_xy = p['xy_toolchange'] gcode = '(This preprocessor is to be used only with the SolderPaste Plugin.)\n\n' - xmin = '%.*f' % (p.coords_decimals, p['options']['xmin']) - xmax = '%.*f' % (p.coords_decimals, p['options']['xmax']) - ymin = '%.*f' % (p.coords_decimals, p['options']['ymin']) - ymax = '%.*f' % (p.coords_decimals, p['options']['ymax']) + xmin = '%.*f' % (p.coords_decimals, p['obj_options']['xmin']) + xmax = '%.*f' % (p.coords_decimals, p['obj_options']['xmax']) + ymin = '%.*f' % (p.coords_decimals, p['obj_options']['ymin']) + ymax = '%.*f' % (p.coords_decimals, p['obj_options']['ymax']) - gcode += '(TOOL DIAMETER: ' + str(p['options']['tool_dia']) + units + ')\n' + gcode += '(TOOL DIAMETER: ' + str(p['obj_options']['tool_dia']) + units + ')\n' gcode += '(Feedrate_XY: ' + str(p['frxy']) + units + '/min' + ')\n' gcode += '(Feedrate_Z: ' + str(p['frz']) + units + '/min' + ')\n' gcode += '(Feedrate_Z_Dispense: ' + str(p['frz_dispense']) + units + '/min' + ')\n' diff --git a/preprocessors/Repetier.py b/preprocessors/Repetier.py index e271e177..48fef768 100644 --- a/preprocessors/Repetier.py +++ b/preprocessors/Repetier.py @@ -22,13 +22,13 @@ class Repetier(PreProc): end_coords_xy = p['xy_end'] gcode = ';This preprocessor is used with a motion controller loaded with REPETIER firmware.\n\n' - xmin = '%.*f' % (p.coords_decimals, p['options']['xmin']) - xmax = '%.*f' % (p.coords_decimals, p['options']['xmax']) - ymin = '%.*f' % (p.coords_decimals, p['options']['ymin']) - ymax = '%.*f' % (p.coords_decimals, p['options']['ymax']) + xmin = '%.*f' % (p.coords_decimals, p['obj_options']['xmin']) + xmax = '%.*f' % (p.coords_decimals, p['obj_options']['xmax']) + ymin = '%.*f' % (p.coords_decimals, p['obj_options']['ymin']) + ymax = '%.*f' % (p.coords_decimals, p['obj_options']['ymax']) - if str(p['options']['type']) == 'Geometry': - gcode += ';TOOL DIAMETER: ' + str(p['options']['tool_dia']) + units + '\n' + if str(p['obj_options']['type']) == 'Geometry': + gcode += ';TOOL DIAMETER: ' + str(p['obj_options']['tool_dia']) + units + '\n' gcode += ';Feedrate_XY: ' + str(p['feedrate']) + units + '/min' + '\n' gcode += ';Feedrate_Z: ' + str(p['z_feedrate']) + units + '/min' + '\n' gcode += ';Feedrate rapids ' + str(p['feedrate_rapid']) + units + '/min' + '\n' + '\n' @@ -38,7 +38,7 @@ class Repetier(PreProc): str(math.ceil(abs(p['z_cut']) / p['z_depthpercut'])) + ' passes' + '\n' gcode += ';Z_Move: ' + str(p['z_move']) + units + '\n' - elif str(p['options']['type']) == 'Excellon' and p['use_ui'] is True: + elif str(p['obj_options']['type']) == 'Excellon' and p['use_ui'] is True: gcode += '\n;TOOLS DIAMETER: \n' for tool, val in p['tools'].items(): gcode += ';Tool: %s -> ' % str(tool) + 'Dia: %s' % str(val["tooldia"]) + '\n' @@ -91,7 +91,7 @@ class Repetier(PreProc): gcode += ';X,Y End: ' + "None" + units + '\n' gcode += ';Steps per circle: ' + str(p['steps_per_circle']) + '\n' - if str(p['options']['type']) == 'Excellon' or str(p['options']['type']) == 'Excellon Geometry': + if str(p['obj_options']['type']) == 'Excellon' or str(p['obj_options']['type']) == 'Excellon Geometry': gcode += ';Preprocessor Excellon: ' + str(p['pp_excellon_name']) + '\n' + '\n' else: gcode += ';Preprocessor Geometry: ' + str(p['pp_geometry_name']) + '\n' + '\n' @@ -138,7 +138,7 @@ class Repetier(PreProc): toolC_formatted = '%.*f' % (p.decimals, p.toolC) - if str(p['options']['type']) == 'Excellon': + if str(p['obj_options']['type']) == 'Excellon': no_drills = p['tools'][int(p['tool'])]['nr_drills'] if toolchangexy is not None: diff --git a/preprocessors/Toolchange_Manual.py b/preprocessors/Toolchange_Manual.py index f311d189..936e0b07 100644 --- a/preprocessors/Toolchange_Manual.py +++ b/preprocessors/Toolchange_Manual.py @@ -22,13 +22,13 @@ class Toolchange_Manual(PreProc): gcode = '(This preprocessor has a special sequence when doing a toolchange.)\n' gcode += '(Compatible with MACH3.)\n\n' - xmin = '%.*f' % (p.coords_decimals, p['options']['xmin']) - xmax = '%.*f' % (p.coords_decimals, p['options']['xmax']) - ymin = '%.*f' % (p.coords_decimals, p['options']['ymin']) - ymax = '%.*f' % (p.coords_decimals, p['options']['ymax']) + xmin = '%.*f' % (p.coords_decimals, p['obj_options']['xmin']) + xmax = '%.*f' % (p.coords_decimals, p['obj_options']['xmax']) + ymin = '%.*f' % (p.coords_decimals, p['obj_options']['ymin']) + ymax = '%.*f' % (p.coords_decimals, p['obj_options']['ymax']) - if str(p['options']['type']) == 'Geometry': - gcode += '(TOOL DIAMETER: ' + str(p['options']['tool_dia']) + units + ')\n' + if str(p['obj_options']['type']) == 'Geometry': + gcode += '(TOOL DIAMETER: ' + str(p['obj_options']['tool_dia']) + units + ')\n' gcode += '(Feedrate_XY: ' + str(p['feedrate']) + units + '/min' + ')\n' gcode += '(Feedrate_Z: ' + str(p['z_feedrate']) + units + '/min' + ')\n' gcode += '(Feedrate rapids ' + str(p['feedrate_rapid']) + units + '/min' + ')\n' + '\n' @@ -38,7 +38,7 @@ class Toolchange_Manual(PreProc): str(math.ceil(abs(p['z_cut']) / p['z_depthpercut'])) + ' passes' + ')\n' gcode += '(Z_Move: ' + str(p['z_move']) + units + ')\n' - elif str(p['options']['type']) == 'Excellon' and p['use_ui'] is True: + elif str(p['obj_options']['type']) == 'Excellon' and p['use_ui'] is True: gcode += '\n(TOOLS DIAMETER: )\n' for tool, val in p['tools'].items(): gcode += '(Tool: %s -> ' % str(tool) + 'Dia: %s' % str(val["tooldia"]) + ')\n' @@ -91,7 +91,7 @@ class Toolchange_Manual(PreProc): gcode += '(X,Y End: ' + "None" + units + ')\n' gcode += '(Steps per circle: ' + str(p['steps_per_circle']) + ')\n' - if str(p['options']['type']) == 'Excellon' or str(p['options']['type']) == 'Excellon Geometry': + if str(p['obj_options']['type']) == 'Excellon' or str(p['obj_options']['type']) == 'Excellon Geometry': gcode += '(Preprocessor Excellon: ' + str(p['pp_excellon_name']) + ')\n' + '\n' else: gcode += '(Preprocessor Geometry: ' + str(p['pp_geometry_name']) + ')\n' + '\n' @@ -139,7 +139,7 @@ class Toolchange_Manual(PreProc): toolC_formatted = '%.*f' % (p.decimals, p.toolC) - if str(p['options']['type']) == 'Excellon': + if str(p['obj_options']['type']) == 'Excellon': no_drills = p['tools'][int(p['tool'])]['nr_drills'] if toolchangexy is not None: diff --git a/preprocessors/Toolchange_Probe_MACH3.py b/preprocessors/Toolchange_Probe_MACH3.py index fdbbc6a1..039a2085 100644 --- a/preprocessors/Toolchange_Probe_MACH3.py +++ b/preprocessors/Toolchange_Probe_MACH3.py @@ -21,13 +21,13 @@ class Toolchange_Probe_MACH3(PreProc): end_coords_xy = p['xy_end'] gcode = '(This preprocessor is used with MACH3 with probing height.)\n\n' - xmin = '%.*f' % (p.coords_decimals, p['options']['xmin']) - xmax = '%.*f' % (p.coords_decimals, p['options']['xmax']) - ymin = '%.*f' % (p.coords_decimals, p['options']['ymin']) - ymax = '%.*f' % (p.coords_decimals, p['options']['ymax']) + xmin = '%.*f' % (p.coords_decimals, p['obj_options']['xmin']) + xmax = '%.*f' % (p.coords_decimals, p['obj_options']['xmax']) + ymin = '%.*f' % (p.coords_decimals, p['obj_options']['ymin']) + ymax = '%.*f' % (p.coords_decimals, p['obj_options']['ymax']) - if str(p['options']['type']) == 'Geometry': - gcode += '(TOOL DIAMETER: ' + str(p['options']['tool_dia']) + units + ')\n' + if str(p['obj_options']['type']) == 'Geometry': + gcode += '(TOOL DIAMETER: ' + str(p['obj_options']['tool_dia']) + units + ')\n' gcode += '(Feedrate_XY: ' + str(p['feedrate']) + units + '/min' + ')\n' gcode += '(Feedrate_Z: ' + str(p['z_feedrate']) + units + '/min' + ')\n' gcode += '(Feedrate rapids ' + str(p['feedrate_rapid']) + units + '/min' + ')\n' + '\n' @@ -37,7 +37,7 @@ class Toolchange_Probe_MACH3(PreProc): str(math.ceil(abs(p['z_cut']) / p['z_depthpercut'])) + ' passes' + ')\n' gcode += '(Z_Move: ' + str(p['z_move']) + units + ')\n' - elif str(p['options']['type']) == 'Excellon' and p['use_ui'] is True: + elif str(p['obj_options']['type']) == 'Excellon' and p['use_ui'] is True: gcode += '\n(TOOLS DIAMETER: )\n' for tool, val in p['tools'].items(): gcode += '(Tool: %s -> ' % str(tool) + 'Dia: %s' % str(val["tooldia"]) + ')\n' @@ -90,7 +90,7 @@ class Toolchange_Probe_MACH3(PreProc): gcode += '(X,Y End: ' + "None" + units + ')\n' gcode += '(Steps per circle: ' + str(p['steps_per_circle']) + ')\n' - if str(p['options']['type']) == 'Excellon' or str(p['options']['type']) == 'Excellon Geometry': + if str(p['obj_options']['type']) == 'Excellon' or str(p['obj_options']['type']) == 'Excellon Geometry': gcode += '(Preprocessor Excellon: ' + str(p['pp_excellon_name']) + ')\n' + '\n' else: gcode += '(Preprocessor Geometry: ' + str(p['pp_geometry_name']) + ')\n' + '\n' @@ -138,7 +138,7 @@ class Toolchange_Probe_MACH3(PreProc): toolC_formatted = '%.*f' % (p.decimals, p.toolC) - if str(p['options']['type']) == 'Excellon': + if str(p['obj_options']['type']) == 'Excellon': no_drills = p['tools'][int(p['tool'])]['nr_drills'] if toolchangexy is not None: diff --git a/preprocessors/default.py b/preprocessors/default.py index 97b7ef10..0c4e7f42 100644 --- a/preprocessors/default.py +++ b/preprocessors/default.py @@ -22,13 +22,13 @@ class default(PreProc): gcode = '(This preprocessor is the default preprocessor.)\n' gcode += '(It is made to work with MACH3 compatible motion controllers.)\n\n' - xmin = '%.*f' % (p.coords_decimals, p['options']['xmin']) - xmax = '%.*f' % (p.coords_decimals, p['options']['xmax']) - ymin = '%.*f' % (p.coords_decimals, p['options']['ymin']) - ymax = '%.*f' % (p.coords_decimals, p['options']['ymax']) + xmin = '%.*f' % (p.coords_decimals, p['obj_options']['xmin']) + xmax = '%.*f' % (p.coords_decimals, p['obj_options']['xmax']) + ymin = '%.*f' % (p.coords_decimals, p['obj_options']['ymin']) + ymax = '%.*f' % (p.coords_decimals, p['obj_options']['ymax']) - if str(p['options']['type']) == 'Geometry': - gcode += '(TOOL DIAMETER: ' + str(p['options']['tool_dia']) + units + ')\n' + if str(p['obj_options']['type']) == 'Geometry': + gcode += '(TOOL DIAMETER: ' + str(p['obj_options']['tool_dia']) + units + ')\n' gcode += '(Feedrate_XY: ' + str(p['feedrate']) + units + '/min' + ')\n' gcode += '(Feedrate_Z: ' + str(p['z_feedrate']) + units + '/min' + ')\n' gcode += '(Feedrate rapids ' + str(p['feedrate_rapid']) + units + '/min' + ')\n' + '\n' @@ -38,7 +38,7 @@ class default(PreProc): str(math.ceil(abs(p['z_cut']) / p['z_depthpercut'])) + ' passes' + ')\n' gcode += '(Z_Move: ' + str(p['z_move']) + units + ')\n' - elif str(p['options']['type']) == 'Excellon' and p['use_ui'] is True: + elif str(p['obj_options']['type']) == 'Excellon' and p['use_ui'] is True: gcode += '\n(TOOLS DIAMETER: )\n' for tool, val in p['tools'].items(): gcode += '(Tool: %s -> ' % str(tool) + 'Dia: %s' % str(val["tooldia"]) + ')\n' @@ -91,7 +91,7 @@ class default(PreProc): gcode += '(X,Y End: ' + "None" + units + ')\n' gcode += '(Steps per circle: ' + str(p['steps_per_circle']) + ')\n' - if str(p['options']['type']) == 'Excellon' or str(p['options']['type']) == 'Excellon Geometry': + if str(p['obj_options']['type']) == 'Excellon' or str(p['obj_options']['type']) == 'Excellon Geometry': gcode += '(Preprocessor Excellon: ' + str(p['pp_excellon_name']) + ')\n' + '\n' else: gcode += '(Preprocessor Geometry: ' + str(p['pp_geometry_name']) + ')\n' + '\n' @@ -145,7 +145,7 @@ class default(PreProc): toolC_formatted = '%.*f' % (p.decimals, p.toolC) - if str(p['options']['type']) == 'Excellon': + if str(p['obj_options']['type']) == 'Excellon': no_drills = p['tools'][int(p['tool'])]['nr_drills'] if toolchangexy is not None: diff --git a/preprocessors/default_laser.py b/preprocessors/default_laser.py index 4abb8861..d0f48104 100644 --- a/preprocessors/default_laser.py +++ b/preprocessors/default_laser.py @@ -25,15 +25,15 @@ class default_laser(PreProc): '(It assumes a manually focused laser.)\n' \ '(The laser is started with M3 command and stopped with the M5 command.)\n\n' - xmin = '%.*f' % (p.coords_decimals, p['options']['xmin']) - xmax = '%.*f' % (p.coords_decimals, p['options']['xmax']) - ymin = '%.*f' % (p.coords_decimals, p['options']['ymin']) - ymax = '%.*f' % (p.coords_decimals, p['options']['ymax']) + xmin = '%.*f' % (p.coords_decimals, p['obj_options']['xmin']) + xmax = '%.*f' % (p.coords_decimals, p['obj_options']['xmax']) + ymin = '%.*f' % (p.coords_decimals, p['obj_options']['ymin']) + ymax = '%.*f' % (p.coords_decimals, p['obj_options']['ymax']) gcode += '(Feedrate: ' + str(p['feedrate']) + units + '/min' + ')\n' gcode += '(Steps per circle: ' + str(p['steps_per_circle']) + ')\n' - if str(p['options']['type']) == 'Excellon' or str(p['options']['type']) == 'Excellon Geometry': + if str(p['obj_options']['type']) == 'Excellon' or str(p['obj_options']['type']) == 'Excellon Geometry': gcode += '(Preprocessor Excellon: ' + str(p['pp_excellon_name']) + ')\n' else: gcode += '(Preprocessor Geometry: ' + str(p['pp_geometry_name']) + ')\n' + '\n' diff --git a/preprocessors/grbl_laser_eleks_drd.py b/preprocessors/grbl_laser_eleks_drd.py index 99242cfe..f065fccc 100644 --- a/preprocessors/grbl_laser_eleks_drd.py +++ b/preprocessors/grbl_laser_eleks_drd.py @@ -31,14 +31,14 @@ class grbl_laser_eleks_drd(PreProc): gcode += '(The moves are only on horizontal plane X-Y. There are no Z moves.)\n' gcode += '(Assumes manual laser focussing.)\n\n' - xmin = '%.*f' % (p.coords_decimals, p['options']['xmin']) - xmax = '%.*f' % (p.coords_decimals, p['options']['xmax']) - ymin = '%.*f' % (p.coords_decimals, p['options']['ymin']) - ymax = '%.*f' % (p.coords_decimals, p['options']['ymax']) + xmin = '%.*f' % (p.coords_decimals, p['obj_options']['xmin']) + xmax = '%.*f' % (p.coords_decimals, p['obj_options']['xmax']) + ymin = '%.*f' % (p.coords_decimals, p['obj_options']['ymin']) + ymax = '%.*f' % (p.coords_decimals, p['obj_options']['ymax']) gcode += '(Feedrate: ' + str(p['feedrate']) + units + '/min' + ')\n' gcode += '(Feedrate rapids ' + str(p['feedrate_rapid']) + units + '/min' + ')\n' gcode += '(Steps per circle: ' + str(p['steps_per_circle']) + ')\n' - if str(p['options']['type']) == 'Excellon' or str(p['options']['type']) == 'Excellon Geometry': + if str(p['obj_options']['type']) == 'Excellon' or str(p['obj_options']['type']) == 'Excellon Geometry': gcode += '(Preprocessor Excellon: ' + str(p['pp_excellon_name']) + ')\n' else: gcode += '(Preprocessor Geometry: ' + str(p['pp_geometry_name']) + ')\n' @@ -75,7 +75,7 @@ class grbl_laser_eleks_drd(PreProc): else: gcode = 'M03' gcode += ';down' - if str(p['options']['type']) == 'Excellon' or str(p['options']['type']) == 'Excellon Geometry': + if str(p['obj_options']['type']) == 'Excellon' or str(p['obj_options']['type']) == 'Excellon Geometry': gcode += '\n' gcode += 'G02 ' # Draw Top Little Arc gcode += ('X' + self.coordinate_format + ' Y' + self.coordinate_format) % \ @@ -136,7 +136,7 @@ class grbl_laser_eleks_drd(PreProc): def rapid_code(self, p): gcode = 'G00 ' - if str(p['options']['type']) == 'Excellon' or str(p['options']['type']) == 'Excellon Geometry': + if str(p['obj_options']['type']) == 'Excellon' or str(p['obj_options']['type']) == 'Excellon Geometry': gcode += (self.position_ldos_code(p)).format(**p) else: gcode += (self.position_code(p)).format(**p)