- modified the Excellon GCode generation so now it can use multi depth drilling; modified the preprocessors to show the number of passes

This commit is contained in:
Marius Stanciu
2020-02-08 22:38:08 +02:00
committed by Marius
parent 48029da52b
commit d33505096c
15 changed files with 215 additions and 100 deletions

View File

@@ -3074,7 +3074,7 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI):
_("Drill depth (negative)\n"
"below the copper surface.")
)
grid2.addWidget(cutzlabel, 0, 0)
self.cutz_entry = FCDoubleSpinner()
if machinist_setting == 0:
@@ -3084,15 +3084,38 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI):
self.cutz_entry.setSingleStep(0.1)
self.cutz_entry.set_precision(self.decimals)
grid2.addWidget(cutzlabel, 0, 0)
grid2.addWidget(self.cutz_entry, 0, 1)
# Multi-Depth
self.mpass_cb = FCCheckBox('%s:' % _("Multi-Depth"))
self.mpass_cb.setToolTip(
_(
"Use multiple passes to limit\n"
"the cut depth in each pass. Will\n"
"cut multiple times until Cut Z is\n"
"reached."
)
)
self.maxdepth_entry = FCDoubleSpinner()
self.maxdepth_entry.set_precision(self.decimals)
self.maxdepth_entry.set_range(0, 9999.9999)
self.maxdepth_entry.setSingleStep(0.1)
self.maxdepth_entry.setToolTip(_("Depth of each pass (positive)."))
grid2.addWidget(self.mpass_cb, 1, 0)
grid2.addWidget(self.maxdepth_entry, 1, 1)
# Travel Z
travelzlabel = QtWidgets.QLabel('%s:' % _('Travel Z'))
travelzlabel.setToolTip(
_("Tool height when travelling\n"
"across the XY plane.")
)
grid2.addWidget(travelzlabel, 1, 0)
self.travelz_entry = FCDoubleSpinner()
self.travelz_entry.set_precision(self.decimals)
@@ -3101,7 +3124,8 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI):
else:
self.travelz_entry.set_range(-9999.9999, 9999.9999)
grid2.addWidget(self.travelz_entry, 1, 1)
grid2.addWidget(travelzlabel, 2, 0)
grid2.addWidget(self.travelz_entry, 2, 1)
# Tool change:
self.toolchange_cb = FCCheckBox('%s' % _("Tool change"))
@@ -3109,14 +3133,15 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI):
_("Include tool-change sequence\n"
"in G-Code (Pause for tool change).")
)
grid2.addWidget(self.toolchange_cb, 2, 0, 1, 2)
grid2.addWidget(self.toolchange_cb, 3, 0, 1, 2)
# Tool Change Z
toolchangezlabel = QtWidgets.QLabel('%s:' % _('Toolchange Z'))
toolchangezlabel.setToolTip(
_("Z-axis position (height) for\n"
"tool change.")
)
grid2.addWidget(toolchangezlabel, 3, 0)
self.toolchangez_entry = FCDoubleSpinner()
self.toolchangez_entry.set_precision(self.decimals)
@@ -3125,7 +3150,8 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI):
else:
self.toolchangez_entry.set_range(-9999.9999, 9999.9999)
grid2.addWidget(self.toolchangez_entry, 3, 1)
grid2.addWidget(toolchangezlabel, 4, 0)
grid2.addWidget(self.toolchangez_entry, 4, 1)
# End Move Z
endz_label = QtWidgets.QLabel('%s:' % _('End move Z'))
@@ -3141,8 +3167,8 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI):
else:
self.endz_entry.set_range(-9999.9999, 9999.9999)
grid2.addWidget(endz_label, 4, 0)
grid2.addWidget(self.endz_entry, 4, 1)
grid2.addWidget(endz_label, 5, 0)
grid2.addWidget(self.endz_entry, 5, 1)
# Feedrate Z
frlabel = QtWidgets.QLabel('%s:' % _('Feedrate Z'))
@@ -3156,8 +3182,8 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI):
self.feedrate_z_entry.set_precision(self.decimals)
self.feedrate_z_entry.set_range(0, 99999.9999)
grid2.addWidget(frlabel, 5, 0)
grid2.addWidget(self.feedrate_z_entry, 5, 1)
grid2.addWidget(frlabel, 6, 0)
grid2.addWidget(self.feedrate_z_entry, 6, 1)
# Spindle speed
spdlabel = QtWidgets.QLabel('%s:' % _('Spindle Speed'))
@@ -3165,11 +3191,13 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI):
_("Speed of the spindle\n"
"in RPM (optional)")
)
grid2.addWidget(spdlabel, 6, 0)
self.spindlespeed_entry = FCSpinner()
self.spindlespeed_entry.set_range(0, 1000000)
self.spindlespeed_entry.setSingleStep(100)
grid2.addWidget(self.spindlespeed_entry, 6, 1)
grid2.addWidget(spdlabel, 10, 0)
grid2.addWidget(self.spindlespeed_entry, 10, 1)
# Dwell
self.dwell_cb = FCCheckBox('%s' % _('Enable Dwell'))
@@ -3177,16 +3205,18 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI):
_("Pause to allow the spindle to reach its\n"
"speed before cutting.")
)
grid2.addWidget(self.dwell_cb, 7, 0, 1, 2)
grid2.addWidget(self.dwell_cb, 11, 0, 1, 2)
# Dwell Time
dwelltime = QtWidgets.QLabel('%s:' % _('Duration'))
dwelltime.setToolTip(_("Number of time units for spindle to dwell."))
self.dwelltime_entry = FCDoubleSpinner()
self.dwelltime_entry.set_precision(self.decimals)
self.dwelltime_entry.set_range(0, 99999.9999)
grid2.addWidget(dwelltime, 8, 0)
grid2.addWidget(self.dwelltime_entry, 8, 1)
grid2.addWidget(dwelltime, 12, 0)
grid2.addWidget(self.dwelltime_entry, 12, 1)
self.ois_dwell_exc = OptionalInputSection(self.dwell_cb, [self.dwelltime_entry])
@@ -3196,10 +3226,12 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI):
_("The preprocessor JSON file that dictates\n"
"Gcode output.")
)
grid2.addWidget(pp_excellon_label, 9, 0)
self.pp_excellon_name_cb = FCComboBox()
self.pp_excellon_name_cb.setFocusPolicy(Qt.StrongFocus)
grid2.addWidget(self.pp_excellon_name_cb, 9, 1)
grid2.addWidget(pp_excellon_label, 14, 0)
grid2.addWidget(self.pp_excellon_name_cb, 14, 1)
# ### Choose what to use for Gcode creation: Drills, Slots or Both
excellon_gcode_type_label = QtWidgets.QLabel('<b>%s</b>' % _('Gcode'))
@@ -3212,8 +3244,8 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI):
self.excellon_gcode_type_radio = RadioSet([{'label': 'Drills', 'value': 'drills'},
{'label': 'Slots', 'value': 'slots'},
{'label': 'Both', 'value': 'both'}])
grid2.addWidget(excellon_gcode_type_label, 10, 0)
grid2.addWidget(self.excellon_gcode_type_radio, 10, 1)
grid2.addWidget(excellon_gcode_type_label, 15, 0)
grid2.addWidget(self.excellon_gcode_type_radio, 15, 1)
# until I decide to implement this feature those remain disabled
excellon_gcode_type_label.hide()
@@ -3224,7 +3256,7 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI):
self.mill_hole_label.setToolTip(
_("Create Geometry for milling holes.")
)
grid2.addWidget(self.mill_hole_label, 11, 0, 1, 2)
grid2.addWidget(self.mill_hole_label, 16, 0, 1, 2)
tdlabel = QtWidgets.QLabel('%s:' % _('Drill Tool dia'))
tdlabel.setToolTip(
@@ -3234,8 +3266,8 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI):
self.tooldia_entry.set_precision(self.decimals)
self.tooldia_entry.set_range(0, 999.9999)
grid2.addWidget(tdlabel, 12, 0)
grid2.addWidget(self.tooldia_entry, 12, 1)
grid2.addWidget(tdlabel, 18, 0)
grid2.addWidget(self.tooldia_entry, 18, 1)
stdlabel = QtWidgets.QLabel('%s:' % _('Slot Tool dia'))
stdlabel.setToolTip(
@@ -3246,8 +3278,8 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI):
self.slot_tooldia_entry.set_precision(self.decimals)
self.slot_tooldia_entry.set_range(0, 999.9999)
grid2.addWidget(stdlabel, 13, 0)
grid2.addWidget(self.slot_tooldia_entry, 13, 1)
grid2.addWidget(stdlabel, 21, 0)
grid2.addWidget(self.slot_tooldia_entry, 21, 1)
self.layout.addStretch()