- solved more Shapely 2.0 deprecation warnings
- in Isolation Plugin and NCC Plugin changed the UI and the Preferences for those Plugins
This commit is contained in:
@@ -882,8 +882,8 @@ class CornersUI:
|
||||
self.tools_box.addWidget(par_frame)
|
||||
|
||||
# ## Grid Layout
|
||||
grid_par = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
par_frame.setLayout(grid_par)
|
||||
par_grid = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
par_frame.setLayout(par_grid)
|
||||
|
||||
# Type of Marker
|
||||
self.type_label = FCLabel('%s:' % _("Type"))
|
||||
@@ -896,8 +896,8 @@ class CornersUI:
|
||||
{"label": _("Cross"), "value": "c"},
|
||||
])
|
||||
|
||||
grid_par.addWidget(self.type_label, 2, 0)
|
||||
grid_par.addWidget(self.type_radio, 2, 1)
|
||||
par_grid.addWidget(self.type_label, 2, 0)
|
||||
par_grid.addWidget(self.type_radio, 2, 1)
|
||||
|
||||
# Thickness #
|
||||
self.thick_label = FCLabel('%s:' % _("Thickness"))
|
||||
@@ -910,8 +910,8 @@ class CornersUI:
|
||||
self.thick_entry.setWrapping(True)
|
||||
self.thick_entry.setSingleStep(10 ** -self.decimals)
|
||||
|
||||
grid_par.addWidget(self.thick_label, 4, 0)
|
||||
grid_par.addWidget(self.thick_entry, 4, 1)
|
||||
par_grid.addWidget(self.thick_label, 4, 0)
|
||||
par_grid.addWidget(self.thick_entry, 4, 1)
|
||||
|
||||
# Length #
|
||||
self.l_label = FCLabel('%s:' % _("Length"))
|
||||
@@ -923,8 +923,8 @@ class CornersUI:
|
||||
self.l_entry.set_precision(self.decimals)
|
||||
self.l_entry.setSingleStep(10 ** -self.decimals)
|
||||
|
||||
grid_par.addWidget(self.l_label, 6, 0)
|
||||
grid_par.addWidget(self.l_entry, 6, 1)
|
||||
par_grid.addWidget(self.l_label, 6, 0)
|
||||
par_grid.addWidget(self.l_entry, 6, 1)
|
||||
|
||||
# Margin #
|
||||
self.margin_label = FCLabel('%s:' % _("Margin"))
|
||||
@@ -936,8 +936,8 @@ class CornersUI:
|
||||
self.margin_entry.set_precision(self.decimals)
|
||||
self.margin_entry.setSingleStep(0.1)
|
||||
|
||||
grid_par.addWidget(self.margin_label, 8, 0)
|
||||
grid_par.addWidget(self.margin_entry, 8, 1)
|
||||
par_grid.addWidget(self.margin_label, 8, 0)
|
||||
par_grid.addWidget(self.margin_entry, 8, 1)
|
||||
|
||||
# #############################################################################################################
|
||||
# Locations Frame
|
||||
@@ -1050,7 +1050,7 @@ class CornersUI:
|
||||
grid_drill.addWidget(self.drill_dia_label, 0, 0)
|
||||
grid_drill.addWidget(self.drill_dia_entry, 0, 1)
|
||||
|
||||
FCGridLayout.set_common_column_size([grid_sel, grid_par, grid_loc, grid_drill], 0)
|
||||
FCGridLayout.set_common_column_size([grid_sel, par_grid, grid_loc, grid_drill], 0)
|
||||
|
||||
# ## Create an Excellon object
|
||||
self.drill_button = FCButton(_("Create Excellon Object"))
|
||||
|
||||
@@ -2301,8 +2301,8 @@ class DrillingUI:
|
||||
self.tools_box.addWidget(self.obj_combo_label)
|
||||
|
||||
# Grid Layout
|
||||
grid0 = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
self.tools_box.addLayout(grid0)
|
||||
obj_grid = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
self.tools_box.addLayout(obj_grid)
|
||||
|
||||
# ################################################
|
||||
# ##### The object to be drilled #################
|
||||
@@ -2313,12 +2313,12 @@ class DrillingUI:
|
||||
# self.object_combo.setCurrentIndex(1)
|
||||
self.object_combo.is_last = True
|
||||
|
||||
grid0.addWidget(self.object_combo, 0, 0, 1, 2)
|
||||
obj_grid.addWidget(self.object_combo, 0, 0, 1, 2)
|
||||
|
||||
# separator_line = QtWidgets.QFrame()
|
||||
# separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
|
||||
# separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
|
||||
# grid0.addWidget(separator_line, 2, 0, 1, 2)
|
||||
# obj_grid.addWidget(separator_line, 2, 0, 1, 2)
|
||||
|
||||
# #############################################################################################################
|
||||
# Excellon Tool Table Frame
|
||||
@@ -2331,11 +2331,12 @@ class DrillingUI:
|
||||
self.tools_box.addWidget(tt_frame)
|
||||
|
||||
# Grid Layout
|
||||
grid1 = FCGridLayout(v_spacing=5, h_spacing=3, c_stretch=[0, 0])
|
||||
tt_frame.setLayout(grid1)
|
||||
tool_grid = FCGridLayout(v_spacing=5, h_spacing=3, c_stretch=[0, 0])
|
||||
tt_frame.setLayout(tool_grid)
|
||||
|
||||
# Tools Table
|
||||
self.tools_table = FCTable(drag_drop=True)
|
||||
grid1.addWidget(self.tools_table, 0, 0, 1, 2)
|
||||
tool_grid.addWidget(self.tools_table, 0, 0, 1, 2)
|
||||
|
||||
self.tools_table.setColumnCount(5)
|
||||
self.tools_table.setColumnHidden(3, True)
|
||||
@@ -2369,8 +2370,8 @@ class DrillingUI:
|
||||
self.order_combo = FCComboBox2()
|
||||
self.order_combo.addItems([_('Default'), _('Forward'), _('Reverse')])
|
||||
|
||||
grid1.addWidget(self.order_label, 2, 0)
|
||||
grid1.addWidget(self.order_combo, 2, 1)
|
||||
tool_grid.addWidget(self.order_label, 2, 0)
|
||||
tool_grid.addWidget(self.order_combo, 2, 1)
|
||||
|
||||
# Manual Load of Tools from DB
|
||||
self.search_load_db_btn = FCButton(_("Search DB"))
|
||||
@@ -2380,7 +2381,7 @@ class DrillingUI:
|
||||
"with tools from DB that have a close diameter value.")
|
||||
)
|
||||
|
||||
grid1.addWidget(self.search_load_db_btn, 4, 0, 1, 2)
|
||||
tool_grid.addWidget(self.search_load_db_btn, 4, 0, 1, 2)
|
||||
|
||||
# #############################################################################################################
|
||||
# ALL Parameters Frame
|
||||
@@ -2410,8 +2411,8 @@ class DrillingUI:
|
||||
self.exc_tools_box.addWidget(tp_frame)
|
||||
|
||||
# Grid Layout
|
||||
grid2 = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
tp_frame.setLayout(grid2)
|
||||
param_grid = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
tp_frame.setLayout(param_grid)
|
||||
|
||||
# Cut Z
|
||||
self.cutzlabel = FCLabel('%s:' % _('Cut Z'))
|
||||
@@ -2427,8 +2428,8 @@ class DrillingUI:
|
||||
self.cutz_entry.setSingleStep(0.1)
|
||||
self.cutz_entry.setObjectName("e_cutz")
|
||||
|
||||
grid2.addWidget(self.cutzlabel, 4, 0)
|
||||
grid2.addWidget(self.cutz_entry, 4, 1)
|
||||
param_grid.addWidget(self.cutzlabel, 4, 0)
|
||||
param_grid.addWidget(self.cutz_entry, 4, 1)
|
||||
|
||||
# Multi-Depth
|
||||
self.mpass_cb = FCCheckBox('%s:' % _("Multi-Depth"))
|
||||
@@ -2452,8 +2453,8 @@ class DrillingUI:
|
||||
|
||||
self.mis_mpass_geo = OptionalInputSection(self.mpass_cb, [self.maxdepth_entry])
|
||||
|
||||
grid2.addWidget(self.mpass_cb, 5, 0)
|
||||
grid2.addWidget(self.maxdepth_entry, 5, 1)
|
||||
param_grid.addWidget(self.mpass_cb, 5, 0)
|
||||
param_grid.addWidget(self.maxdepth_entry, 5, 1)
|
||||
|
||||
# Travel Z (z_move)
|
||||
self.travelzlabel = FCLabel('%s:' % _('Travel Z'))
|
||||
@@ -2469,8 +2470,8 @@ class DrillingUI:
|
||||
self.travelz_entry.setSingleStep(0.1)
|
||||
self.travelz_entry.setObjectName("e_travelz")
|
||||
|
||||
grid2.addWidget(self.travelzlabel, 6, 0)
|
||||
grid2.addWidget(self.travelz_entry, 6, 1)
|
||||
param_grid.addWidget(self.travelzlabel, 6, 0)
|
||||
param_grid.addWidget(self.travelz_entry, 6, 1)
|
||||
|
||||
# Excellon Feedrate Z
|
||||
self.frzlabel = FCLabel('%s:' % _('Feedrate Z'))
|
||||
@@ -2486,8 +2487,8 @@ class DrillingUI:
|
||||
self.feedrate_z_entry.setSingleStep(0.1)
|
||||
self.feedrate_z_entry.setObjectName("e_feedratez")
|
||||
|
||||
grid2.addWidget(self.frzlabel, 14, 0)
|
||||
grid2.addWidget(self.feedrate_z_entry, 14, 1)
|
||||
param_grid.addWidget(self.frzlabel, 14, 0)
|
||||
param_grid.addWidget(self.feedrate_z_entry, 14, 1)
|
||||
|
||||
# Excellon Rapid Feedrate
|
||||
self.feedrate_rapid_label = FCLabel('%s:' % _('Feedrate Rapids'))
|
||||
@@ -2504,8 +2505,8 @@ class DrillingUI:
|
||||
self.feedrate_rapid_entry.setSingleStep(0.1)
|
||||
self.feedrate_rapid_entry.setObjectName("e_fr_rapid")
|
||||
|
||||
grid2.addWidget(self.feedrate_rapid_label, 16, 0)
|
||||
grid2.addWidget(self.feedrate_rapid_entry, 16, 1)
|
||||
param_grid.addWidget(self.feedrate_rapid_label, 16, 0)
|
||||
param_grid.addWidget(self.feedrate_rapid_entry, 16, 1)
|
||||
|
||||
# default values is to hide
|
||||
self.feedrate_rapid_label.hide()
|
||||
@@ -2523,8 +2524,8 @@ class DrillingUI:
|
||||
self.spindlespeed_entry.set_step(100)
|
||||
self.spindlespeed_entry.setObjectName("e_spindlespeed")
|
||||
|
||||
grid2.addWidget(self.spindle_label, 19, 0)
|
||||
grid2.addWidget(self.spindlespeed_entry, 19, 1)
|
||||
param_grid.addWidget(self.spindle_label, 19, 0)
|
||||
param_grid.addWidget(self.spindlespeed_entry, 19, 1)
|
||||
|
||||
# Dwell
|
||||
self.dwell_cb = FCCheckBox('%s:' % _('Dwell'))
|
||||
@@ -2545,8 +2546,8 @@ class DrillingUI:
|
||||
)
|
||||
self.dwelltime_entry.setObjectName("e_dwelltime")
|
||||
|
||||
grid2.addWidget(self.dwell_cb, 20, 0)
|
||||
grid2.addWidget(self.dwelltime_entry, 20, 1)
|
||||
param_grid.addWidget(self.dwell_cb, 20, 0)
|
||||
param_grid.addWidget(self.dwelltime_entry, 20, 1)
|
||||
|
||||
self.ois_dwell = OptionalInputSection(self.dwell_cb, [self.dwelltime_entry])
|
||||
|
||||
@@ -2563,8 +2564,8 @@ class DrillingUI:
|
||||
self.offset_entry.set_range(-10000.0000, 10000.0000)
|
||||
self.offset_entry.setObjectName("e_offset")
|
||||
|
||||
grid2.addWidget(self.tool_offset_label, 25, 0)
|
||||
grid2.addWidget(self.offset_entry, 25, 1)
|
||||
param_grid.addWidget(self.tool_offset_label, 25, 0)
|
||||
param_grid.addWidget(self.offset_entry, 25, 1)
|
||||
|
||||
# Drill slots
|
||||
self.drill_slots_cb = FCCheckBox('%s' % _('Drill slots'))
|
||||
@@ -2572,7 +2573,7 @@ class DrillingUI:
|
||||
_("If the selected tool has slots then they will be drilled.")
|
||||
)
|
||||
self.drill_slots_cb.setObjectName("e_drill_slots")
|
||||
grid2.addWidget(self.drill_slots_cb, 27, 0, 1, 2)
|
||||
param_grid.addWidget(self.drill_slots_cb, 27, 0, 1, 2)
|
||||
|
||||
# Drill Overlap
|
||||
self.drill_overlap_label = FCLabel('%s:' % _('Overlap'))
|
||||
@@ -2587,8 +2588,8 @@ class DrillingUI:
|
||||
|
||||
self.drill_overlap_entry.setObjectName("e_drill_slots_overlap")
|
||||
|
||||
grid2.addWidget(self.drill_overlap_label, 28, 0)
|
||||
grid2.addWidget(self.drill_overlap_entry, 28, 1)
|
||||
param_grid.addWidget(self.drill_overlap_label, 28, 0)
|
||||
param_grid.addWidget(self.drill_overlap_entry, 28, 1)
|
||||
|
||||
# Last drill in slot
|
||||
self.last_drill_cb = FCCheckBox('%s' % _('Last drill'))
|
||||
@@ -2597,7 +2598,7 @@ class DrillingUI:
|
||||
"add a drill hole on the slot end point.")
|
||||
)
|
||||
self.last_drill_cb.setObjectName("e_drill_last_drill")
|
||||
grid2.addWidget(self.last_drill_cb, 30, 0, 1, 2)
|
||||
param_grid.addWidget(self.last_drill_cb, 30, 0, 1, 2)
|
||||
|
||||
self.drill_overlap_label.hide()
|
||||
self.drill_overlap_entry.hide()
|
||||
@@ -2633,8 +2634,8 @@ class DrillingUI:
|
||||
gp_frame = FCFrame()
|
||||
self.exc_tools_box.addWidget(gp_frame)
|
||||
|
||||
grid3 = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
gp_frame.setLayout(grid3)
|
||||
all_par_grid = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
gp_frame.setLayout(all_par_grid)
|
||||
|
||||
# Tool change
|
||||
self.toolchange_cb = FCCheckBox('%s:' % _("Tool change Z"))
|
||||
@@ -2656,8 +2657,8 @@ class DrillingUI:
|
||||
|
||||
self.toolchangez_entry.setSingleStep(0.1)
|
||||
|
||||
grid3.addWidget(self.toolchange_cb, 0, 0)
|
||||
grid3.addWidget(self.toolchangez_entry, 0, 1)
|
||||
all_par_grid.addWidget(self.toolchange_cb, 0, 0)
|
||||
all_par_grid.addWidget(self.toolchangez_entry, 0, 1)
|
||||
|
||||
# Tool change X-Y
|
||||
self.toolchange_xy_label = FCLabel('%s:' % _('Toolchange X-Y'))
|
||||
@@ -2667,8 +2668,8 @@ class DrillingUI:
|
||||
self.toolchangexy_entry = NumericalEvalTupleEntry(border_color='#0069A9')
|
||||
self.toolchangexy_entry.setObjectName("e_toolchangexy")
|
||||
|
||||
grid3.addWidget(self.toolchange_xy_label, 2, 0)
|
||||
grid3.addWidget(self.toolchangexy_entry, 2, 1)
|
||||
all_par_grid.addWidget(self.toolchange_xy_label, 2, 0)
|
||||
all_par_grid.addWidget(self.toolchangexy_entry, 2, 1)
|
||||
|
||||
self.ois_tcz_e = OptionalInputSection(self.toolchange_cb,
|
||||
[
|
||||
@@ -2686,8 +2687,8 @@ class DrillingUI:
|
||||
self.estartz_entry = NumericalEvalEntry(border_color='#0069A9')
|
||||
self.estartz_entry.setObjectName("e_startz")
|
||||
|
||||
grid3.addWidget(self.estartz_label, 4, 0)
|
||||
grid3.addWidget(self.estartz_entry, 4, 1)
|
||||
all_par_grid.addWidget(self.estartz_label, 4, 0)
|
||||
all_par_grid.addWidget(self.estartz_entry, 4, 1)
|
||||
|
||||
# End move Z:
|
||||
self.endz_label = FCLabel('%s:' % _("End move Z"))
|
||||
@@ -2702,8 +2703,8 @@ class DrillingUI:
|
||||
|
||||
self.endz_entry.setSingleStep(0.1)
|
||||
|
||||
grid3.addWidget(self.endz_label, 6, 0)
|
||||
grid3.addWidget(self.endz_entry, 6, 1)
|
||||
all_par_grid.addWidget(self.endz_label, 6, 0)
|
||||
all_par_grid.addWidget(self.endz_entry, 6, 1)
|
||||
|
||||
# End Move X,Y
|
||||
self.endmove_xy_label = FCLabel('%s:' % _('End move X,Y'))
|
||||
@@ -2716,8 +2717,8 @@ class DrillingUI:
|
||||
self.endxy_entry.setPlaceholderText(_("X,Y coordinates"))
|
||||
self.endxy_entry.setObjectName("e_endxy")
|
||||
|
||||
grid3.addWidget(self.endmove_xy_label, 8, 0)
|
||||
grid3.addWidget(self.endxy_entry, 8, 1)
|
||||
all_par_grid.addWidget(self.endmove_xy_label, 8, 0)
|
||||
all_par_grid.addWidget(self.endxy_entry, 8, 1)
|
||||
|
||||
# Probe depth
|
||||
self.pdepth_label = FCLabel('%s:' % _("Probe Z depth"))
|
||||
@@ -2732,8 +2733,8 @@ class DrillingUI:
|
||||
self.pdepth_entry.setSingleStep(0.1)
|
||||
self.pdepth_entry.setObjectName("e_depth_probe")
|
||||
|
||||
grid3.addWidget(self.pdepth_label, 10, 0)
|
||||
grid3.addWidget(self.pdepth_entry, 10, 1)
|
||||
all_par_grid.addWidget(self.pdepth_label, 10, 0)
|
||||
all_par_grid.addWidget(self.pdepth_entry, 10, 1)
|
||||
|
||||
self.pdepth_label.hide()
|
||||
self.pdepth_entry.setVisible(False)
|
||||
@@ -2750,8 +2751,8 @@ class DrillingUI:
|
||||
self.feedrate_probe_entry.setSingleStep(0.1)
|
||||
self.feedrate_probe_entry.setObjectName("e_fr_probe")
|
||||
|
||||
grid3.addWidget(self.feedrate_probe_label, 12, 0)
|
||||
grid3.addWidget(self.feedrate_probe_entry, 12, 1)
|
||||
all_par_grid.addWidget(self.feedrate_probe_label, 12, 0)
|
||||
all_par_grid.addWidget(self.feedrate_probe_entry, 12, 1)
|
||||
|
||||
self.feedrate_probe_label.hide()
|
||||
self.feedrate_probe_entry.setVisible(False)
|
||||
@@ -2766,8 +2767,8 @@ class DrillingUI:
|
||||
self.pp_excellon_name_cb.setFocusPolicy(QtCore.Qt.FocusPolicy.StrongFocus)
|
||||
self.pp_excellon_name_cb.setObjectName("e_pp")
|
||||
|
||||
grid3.addWidget(pp_excellon_label, 14, 0)
|
||||
grid3.addWidget(self.pp_excellon_name_cb, 14, 1)
|
||||
all_par_grid.addWidget(pp_excellon_label, 14, 0)
|
||||
all_par_grid.addWidget(self.pp_excellon_name_cb, 14, 1)
|
||||
|
||||
# ------------------------------------------------------------------------------------------------------------
|
||||
# ------------------------- EXCLUSION AREAS ------------------------------------------------------------------
|
||||
@@ -2783,11 +2784,11 @@ class DrillingUI:
|
||||
))
|
||||
self.exclusion_cb.setObjectName("e_area_exclusion")
|
||||
|
||||
grid3.addWidget(self.exclusion_cb, 16, 0, 1, 2)
|
||||
all_par_grid.addWidget(self.exclusion_cb, 16, 0, 1, 2)
|
||||
|
||||
self.exclusion_frame = QtWidgets.QFrame()
|
||||
self.exclusion_frame.setContentsMargins(0, 0, 0, 0)
|
||||
grid3.addWidget(self.exclusion_frame, 18, 0, 1, 2)
|
||||
all_par_grid.addWidget(self.exclusion_frame, 18, 0, 1, 2)
|
||||
|
||||
self.exclusion_box = QtWidgets.QVBoxLayout()
|
||||
self.exclusion_box.setContentsMargins(0, 0, 0, 0)
|
||||
@@ -2812,8 +2813,8 @@ class DrillingUI:
|
||||
|
||||
self.exclusion_table.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectionBehavior.SelectRows)
|
||||
|
||||
grid_a1 = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
self.exclusion_box.addLayout(grid_a1)
|
||||
exclud_grid = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
self.exclusion_box.addLayout(exclud_grid)
|
||||
|
||||
# Chose Strategy
|
||||
self.strategy_label = FCLabel('%s:' % _("Strategy"))
|
||||
@@ -2825,8 +2826,8 @@ class DrillingUI:
|
||||
{'label': _('Around'), 'value': 'around'}])
|
||||
self.strategy_radio.setObjectName("e_area_strategy")
|
||||
|
||||
grid_a1.addWidget(self.strategy_label, 1, 0)
|
||||
grid_a1.addWidget(self.strategy_radio, 1, 1)
|
||||
exclud_grid.addWidget(self.strategy_label, 1, 0)
|
||||
exclud_grid.addWidget(self.strategy_radio, 1, 1)
|
||||
|
||||
# Over Z
|
||||
self.over_z_label = FCLabel('%s:' % _("Over Z"))
|
||||
@@ -2837,8 +2838,8 @@ class DrillingUI:
|
||||
self.over_z_entry.set_precision(self.decimals)
|
||||
self.over_z_entry.setObjectName("e_area_overz")
|
||||
|
||||
grid_a1.addWidget(self.over_z_label, 2, 0)
|
||||
grid_a1.addWidget(self.over_z_entry, 2, 1)
|
||||
exclud_grid.addWidget(self.over_z_label, 2, 0)
|
||||
exclud_grid.addWidget(self.over_z_entry, 2, 1)
|
||||
|
||||
# Button Add Area
|
||||
self.add_area_button = QtWidgets.QPushButton(_('Add Area:'))
|
||||
@@ -2852,8 +2853,8 @@ class DrillingUI:
|
||||
)
|
||||
self.area_shape_radio.setObjectName("e_area_shape")
|
||||
|
||||
grid_a1.addWidget(self.add_area_button, 4, 0)
|
||||
grid_a1.addWidget(self.area_shape_radio, 4, 1)
|
||||
exclud_grid.addWidget(self.add_area_button, 4, 0)
|
||||
exclud_grid.addWidget(self.area_shape_radio, 4, 1)
|
||||
|
||||
h_lay_1 = QtWidgets.QHBoxLayout()
|
||||
self.exclusion_box.addLayout(h_lay_1)
|
||||
@@ -2876,9 +2877,9 @@ class DrillingUI:
|
||||
# separator_line = QtWidgets.QFrame()
|
||||
# separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
|
||||
# separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
|
||||
# grid3.addWidget(separator_line, 25, 0, 1, 2)
|
||||
# all_par_grid.addWidget(separator_line, 25, 0, 1, 2)
|
||||
|
||||
FCGridLayout.set_common_column_size([grid0, grid1, grid2, grid3], 0)
|
||||
FCGridLayout.set_common_column_size([obj_grid, tool_grid, param_grid, all_par_grid], 0)
|
||||
|
||||
self.generate_cnc_button = QtWidgets.QPushButton(_('Generate CNCJob object'))
|
||||
self.generate_cnc_button.setIcon(QtGui.QIcon(self.app.resource_location + '/cnc16.png'))
|
||||
|
||||
@@ -324,7 +324,7 @@ class ToolIsolation(AppTool, Gerber):
|
||||
self.on_type_excobj_index_changed(val="gerber")
|
||||
self.on_reference_combo_changed()
|
||||
|
||||
self.ui.order_radio.set_value(self.app.defaults["tools_iso_order"])
|
||||
self.ui.iso_order_combo.set_value(self.app.defaults["tools_iso_order"])
|
||||
self.ui.tool_shape_combo.set_value(self.app.defaults["tools_iso_tool_shape"])
|
||||
self.ui.passes_entry.set_value(self.app.defaults["tools_iso_passes"])
|
||||
self.ui.pad_passes_entry.set_value(self.app.defaults["tools_iso_pad_passes"])
|
||||
@@ -661,7 +661,7 @@ class ToolIsolation(AppTool, Gerber):
|
||||
current_widget.currentIndexChanged.connect(self.form_to_storage)
|
||||
|
||||
self.ui.rest_cb.stateChanged.connect(self.on_rest_machining_check)
|
||||
self.ui.order_radio.activated_custom[str].connect(self.on_order_changed)
|
||||
self.ui.iso_order_combo.currentIndexChanged.connect(self.on_order_changed)
|
||||
|
||||
def ui_disconnect(self):
|
||||
|
||||
@@ -710,20 +710,20 @@ class ToolIsolation(AppTool, Gerber):
|
||||
except (TypeError, ValueError):
|
||||
pass
|
||||
try:
|
||||
self.ui.order_radio.activated_custom[str].disconnect()
|
||||
self.ui.iso_order_combo.currentIndexChanged.disconnect()
|
||||
except (TypeError, ValueError):
|
||||
pass
|
||||
|
||||
def sort_iso_tools(self):
|
||||
order = self.ui.order_radio.get_value()
|
||||
if order == 'no':
|
||||
order = self.ui.iso_order_combo.get_value()
|
||||
if order == 0: # "Default"
|
||||
return
|
||||
|
||||
# sort the tools dictionary having the 'tooldia' as sorting key
|
||||
new_tools_list = []
|
||||
if order == 'fwd':
|
||||
if order == 1: # "Forward"
|
||||
new_tools_list = deepcopy(sorted(self.iso_tools.items(), key=lambda x: x[1]['tooldia'], reverse=False))
|
||||
elif order == 'rev':
|
||||
elif order == 2: # "Reverse"
|
||||
new_tools_list = deepcopy(sorted(self.iso_tools.items(), key=lambda x: x[1]['tooldia'], reverse=True))
|
||||
|
||||
# clear the tools dictionary
|
||||
@@ -991,9 +991,9 @@ class ToolIsolation(AppTool, Gerber):
|
||||
|
||||
def on_rest_machining_check(self, state):
|
||||
if state:
|
||||
self.ui.order_radio.set_value('rev')
|
||||
self.ui.iso_order_combo.set_value(2) # "Reverse"
|
||||
self.ui.order_label.setDisabled(True)
|
||||
self.ui.order_radio.setDisabled(True)
|
||||
self.ui.iso_order_combo.setDisabled(True)
|
||||
|
||||
self.old_combine_state = self.ui.combine_passes_cb.get_value()
|
||||
self.ui.combine_passes_cb.set_value(True)
|
||||
@@ -1002,7 +1002,7 @@ class ToolIsolation(AppTool, Gerber):
|
||||
self.ui.forced_rest_iso_cb.setDisabled(False)
|
||||
else:
|
||||
self.ui.order_label.setDisabled(False)
|
||||
self.ui.order_radio.setDisabled(False)
|
||||
self.ui.iso_order_combo.setDisabled(False)
|
||||
|
||||
self.ui.combine_passes_cb.set_value(self.old_combine_state)
|
||||
self.ui.combine_passes_cb.setDisabled(False)
|
||||
@@ -1854,10 +1854,10 @@ class ToolIsolation(AppTool, Gerber):
|
||||
self.app.inform.emit('[ERROR_NOTCL] %s' % _("There are no tools selected in the Tool Table."))
|
||||
return 'fail'
|
||||
|
||||
order = self.ui.order_radio.get_value()
|
||||
if order == 'fwd':
|
||||
order = self.ui.iso_order_combo.get_value()
|
||||
if order == 1: # "Forward"
|
||||
sorted_tools.sort(reverse=False)
|
||||
elif order == 'rev':
|
||||
elif order == 2: # "Reverse"
|
||||
sorted_tools.sort(reverse=True)
|
||||
else:
|
||||
pass
|
||||
@@ -2087,10 +2087,11 @@ class ToolIsolation(AppTool, Gerber):
|
||||
if iso_geo == 'fail':
|
||||
self.app.inform.emit('[ERROR_NOTCL] %s' % _("Isolation geometry could not be generated."))
|
||||
continue
|
||||
try:
|
||||
for geo in iso_geo:
|
||||
|
||||
if isinstance(iso_geo, (MultiLineString, MultiPolygon)):
|
||||
for geo in iso_geo.geoms:
|
||||
solid_geo.append(geo)
|
||||
except TypeError:
|
||||
else:
|
||||
solid_geo.append(iso_geo)
|
||||
|
||||
# ############################################################
|
||||
@@ -2893,12 +2894,17 @@ class ToolIsolation(AppTool, Gerber):
|
||||
"""
|
||||
|
||||
try:
|
||||
geom = self.grb_obj.isolation_geometry(offset, geometry=geometry, iso_type=env_iso_type,
|
||||
passes=nr_passes, prog_plot=prog_plot)
|
||||
geom_shp = self.grb_obj.isolation_geometry(offset, geometry=geometry, iso_type=env_iso_type,
|
||||
passes=nr_passes, prog_plot=prog_plot)
|
||||
except Exception as e:
|
||||
log.error('ToolIsolation.generate_envelope() --> %s' % str(e))
|
||||
return 'fail'
|
||||
|
||||
if isinstance(geom_shp, (MultiPolygon, MultiLineString)):
|
||||
geom = geom_shp.geoms
|
||||
else:
|
||||
geom = geom_shp
|
||||
|
||||
if invert:
|
||||
try:
|
||||
pl = []
|
||||
@@ -3025,21 +3031,22 @@ class ToolIsolation(AppTool, Gerber):
|
||||
else:
|
||||
not_isolated_geo.append(geo)
|
||||
|
||||
work_geo_shp = work_geo.geoms if isinstance(work_geo, MultiPolygon) else work_geo
|
||||
if invert:
|
||||
try:
|
||||
pl = []
|
||||
for p in work_geo:
|
||||
for p in work_geo_shp:
|
||||
if p is not None:
|
||||
if isinstance(p, Polygon):
|
||||
pl.append(Polygon(p.exterior.coords[::-1], p.interiors))
|
||||
elif isinstance(p, LinearRing):
|
||||
pl.append(Polygon(p.coords[::-1]))
|
||||
work_geo = MultiPolygon(pl)
|
||||
work_geo_shp = MultiPolygon(pl)
|
||||
except TypeError:
|
||||
if isinstance(work_geo, Polygon) and work_geo is not None:
|
||||
work_geo = [Polygon(work_geo.exterior.coords[::-1], work_geo.interiors)]
|
||||
elif isinstance(work_geo, LinearRing) and work_geo is not None:
|
||||
work_geo = [Polygon(work_geo.coords[::-1])]
|
||||
if isinstance(work_geo_shp, Polygon) and work_geo_shp is not None:
|
||||
work_geo_shp = [Polygon(work_geo_shp.exterior.coords[::-1], work_geo_shp.interiors)]
|
||||
elif isinstance(work_geo_shp, LinearRing) and work_geo_shp is not None:
|
||||
work_geo_shp = [Polygon(work_geo_shp.coords[::-1])]
|
||||
else:
|
||||
log.debug("ToolIsolation.generate_rest_geometry() Error --> Unexpected Geometry %s" %
|
||||
type(work_geo))
|
||||
@@ -3047,14 +3054,15 @@ class ToolIsolation(AppTool, Gerber):
|
||||
log.error("ToolIsolation.generate_rest_geometry() Error --> %s" % str(e))
|
||||
return 'fail', 'fail'
|
||||
|
||||
actual_geo = work_geo_shp.geoms if isinstance(work_geo, MultiPolygon) else work_geo_shp
|
||||
if env_iso_type == 0: # exterior
|
||||
for geo in work_geo:
|
||||
for geo in actual_geo:
|
||||
isolated_geo.append(geo.exterior)
|
||||
elif env_iso_type == 1: # interiors
|
||||
for geo in work_geo:
|
||||
for geo in actual_geo:
|
||||
isolated_geo += [interior for interior in geo.interiors]
|
||||
else: # exterior + interiors
|
||||
for geo in work_geo:
|
||||
for geo in actual_geo:
|
||||
isolated_geo += [geo.exterior] + [interior for interior in geo.interiors]
|
||||
|
||||
return isolated_geo, not_isolated_geo
|
||||
@@ -3189,11 +3197,11 @@ class IsoUI:
|
||||
self.tools_box.addWidget(tt_frame)
|
||||
|
||||
# Grid Layout
|
||||
grid1 = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
tt_frame.setLayout(grid1)
|
||||
tool_grid = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
tt_frame.setLayout(tool_grid)
|
||||
|
||||
self.tools_table = FCTable(drag_drop=True)
|
||||
grid1.addWidget(self.tools_table, 0, 0, 1, 2)
|
||||
tool_grid.addWidget(self.tools_table, 0, 0, 1, 2)
|
||||
|
||||
self.tools_table.setColumnCount(4)
|
||||
# 3rd column is reserved (and hidden) for the tool ID
|
||||
@@ -3224,41 +3232,37 @@ class IsoUI:
|
||||
"WARNING: using rest machining will automatically set the order\n"
|
||||
"in reverse and disable this control."))
|
||||
|
||||
self.order_radio = RadioSet([{'label': _('No'), 'value': 'no'},
|
||||
{'label': _('Forward'), 'value': 'fwd'},
|
||||
{'label': _('Reverse'), 'value': 'rev'}])
|
||||
self.iso_order_combo = FCComboBox2()
|
||||
self.iso_order_combo.addItems([_('Default'), _('Forward'), _('Reverse')])
|
||||
|
||||
grid1.addWidget(self.order_label, 2, 0)
|
||||
grid1.addWidget(self.order_radio, 2, 1)
|
||||
tool_grid.addWidget(self.order_label, 2, 0)
|
||||
tool_grid.addWidget(self.iso_order_combo, 2, 1)
|
||||
|
||||
# #############################################################
|
||||
# ############### Tool adding #################################
|
||||
# #############################################################
|
||||
self.add_tool_frame = QtWidgets.QFrame()
|
||||
self.add_tool_frame.setContentsMargins(0, 0, 0, 0)
|
||||
grid1.addWidget(self.add_tool_frame, 6, 0, 1, 2)
|
||||
tool_grid.addWidget(self.add_tool_frame, 4, 0, 1, 2)
|
||||
|
||||
grid_add_tool = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
grid_add_tool.setContentsMargins(0, 0, 0, 0)
|
||||
self.add_tool_frame.setLayout(grid_add_tool)
|
||||
new_tool_grid = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
new_tool_grid.setContentsMargins(0, 0, 0, 0)
|
||||
self.add_tool_frame.setLayout(new_tool_grid)
|
||||
|
||||
separator_line = QtWidgets.QFrame()
|
||||
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
|
||||
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
|
||||
grid_add_tool.addWidget(separator_line, 0, 0, 1, 2)
|
||||
new_tool_grid.addWidget(separator_line, 0, 0, 1, 3)
|
||||
|
||||
self.tool_sel_label = FCLabel('<b>%s</b>' % _('Add from DB'))
|
||||
grid_add_tool.addWidget(self.tool_sel_label, 2, 0, 1, 2)
|
||||
new_tool_grid.addWidget(self.tool_sel_label, 2, 0, 1, 3)
|
||||
|
||||
# ### Tool Diameter ####
|
||||
self.new_tooldia_lbl = FCLabel('%s: ' % _('Tool Dia'))
|
||||
self.new_tooldia_lbl.setToolTip(
|
||||
_("Diameter for the new tool")
|
||||
)
|
||||
grid_add_tool.addWidget(self.new_tooldia_lbl, 4, 0)
|
||||
|
||||
new_tool_lay = QtWidgets.QHBoxLayout()
|
||||
grid_add_tool.addLayout(new_tool_lay, 4, 1)
|
||||
new_tool_grid.addWidget(self.new_tooldia_lbl, 4, 0)
|
||||
|
||||
# Tool diameter entry
|
||||
self.new_tooldia_entry = FCDoubleSpinner(callback=self.confirmation_message)
|
||||
@@ -3276,16 +3280,14 @@ class IsoUI:
|
||||
"to do a complete isolation.")
|
||||
)
|
||||
|
||||
new_tool_lay.addWidget(self.new_tooldia_entry)
|
||||
new_tool_lay.addWidget(self.find_optimal_button)
|
||||
new_tool_grid.addWidget(self.new_tooldia_entry, 4, 1)
|
||||
new_tool_grid.addWidget(self.find_optimal_button, 4, 2)
|
||||
|
||||
# #############################################################################################################
|
||||
# ################################ Button Grid ###########################################################
|
||||
# #############################################################################################################
|
||||
button_grid = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
button_grid.setColumnStretch(0, 1)
|
||||
button_grid.setColumnStretch(1, 0)
|
||||
grid_add_tool.addLayout(button_grid, 6, 0, 1, 2)
|
||||
button_grid = FCGridLayout(v_spacing=5, h_spacing=3, c_stretch=[1, 0])
|
||||
new_tool_grid.addLayout(button_grid, 6, 0, 1, 3)
|
||||
|
||||
self.search_and_add_btn = FCButton(_('Search and Add'))
|
||||
self.search_and_add_btn.setIcon(QtGui.QIcon(self.app.resource_location + '/plus16.png'))
|
||||
@@ -3350,8 +3352,8 @@ class IsoUI:
|
||||
self.tool_params_box.addWidget(tp_frame)
|
||||
|
||||
# Grid Layout
|
||||
grid2 = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
tp_frame.setLayout(grid2)
|
||||
tool_param_grid = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
tp_frame.setLayout(tool_param_grid)
|
||||
|
||||
# Tool Type
|
||||
self.tool_shape_label = FCLabel('%s:' % _('Shape'))
|
||||
@@ -3374,8 +3376,8 @@ class IsoUI:
|
||||
else:
|
||||
self.tool_shape_combo.setCurrentIndex(idx)
|
||||
|
||||
grid2.addWidget(self.tool_shape_label, 0, 0)
|
||||
grid2.addWidget(self.tool_shape_combo, 0, 1)
|
||||
tool_param_grid.addWidget(self.tool_shape_label, 0, 0)
|
||||
tool_param_grid.addWidget(self.tool_shape_combo, 0, 1)
|
||||
|
||||
# Passes
|
||||
passlabel = FCLabel('%s:' % _('Passes'))
|
||||
@@ -3387,8 +3389,8 @@ class IsoUI:
|
||||
self.passes_entry.set_range(1, 999)
|
||||
self.passes_entry.setObjectName("i_passes")
|
||||
|
||||
grid2.addWidget(passlabel, 2, 0)
|
||||
grid2.addWidget(self.passes_entry, 2, 1)
|
||||
tool_param_grid.addWidget(passlabel, 2, 0)
|
||||
tool_param_grid.addWidget(self.passes_entry, 2, 1)
|
||||
|
||||
# Pad Passes
|
||||
padpasslabel = FCLabel('%s:' % _('Pad Passes'))
|
||||
@@ -3400,8 +3402,8 @@ class IsoUI:
|
||||
self.pad_passes_entry.set_range(0, 999)
|
||||
self.pad_passes_entry.setObjectName("i_pad_passes")
|
||||
|
||||
grid2.addWidget(padpasslabel, 4, 0)
|
||||
grid2.addWidget(self.pad_passes_entry, 4, 1, 1, 2)
|
||||
tool_param_grid.addWidget(padpasslabel, 4, 0)
|
||||
tool_param_grid.addWidget(self.pad_passes_entry, 4, 1)
|
||||
|
||||
# Overlap Entry
|
||||
overlabel = FCLabel('%s:' % _('Overlap'))
|
||||
@@ -3415,8 +3417,8 @@ class IsoUI:
|
||||
self.iso_overlap_entry.setSingleStep(0.1)
|
||||
self.iso_overlap_entry.setObjectName("i_overlap")
|
||||
|
||||
grid2.addWidget(overlabel, 6, 0)
|
||||
grid2.addWidget(self.iso_overlap_entry, 6, 1)
|
||||
tool_param_grid.addWidget(overlabel, 6, 0)
|
||||
tool_param_grid.addWidget(self.iso_overlap_entry, 6, 1)
|
||||
|
||||
# Milling Type Radio Button
|
||||
self.milling_type_label = FCLabel('%s:' % _('Milling Type'))
|
||||
@@ -3435,8 +3437,8 @@ class IsoUI:
|
||||
)
|
||||
self.milling_type_radio.setObjectName("i_milling_type")
|
||||
|
||||
grid2.addWidget(self.milling_type_label, 8, 0)
|
||||
grid2.addWidget(self.milling_type_radio, 8, 1)
|
||||
tool_param_grid.addWidget(self.milling_type_label, 8, 0)
|
||||
tool_param_grid.addWidget(self.milling_type_radio, 8, 1)
|
||||
|
||||
# Isolation Type
|
||||
self.iso_type_label = FCLabel('%s:' % _('Isolation Type'))
|
||||
@@ -3455,8 +3457,8 @@ class IsoUI:
|
||||
{'label': _('Int'), 'value': 'int'}])
|
||||
self.iso_type_radio.setObjectName("i_iso_type")
|
||||
|
||||
grid2.addWidget(self.iso_type_label, 10, 0)
|
||||
grid2.addWidget(self.iso_type_radio, 10, 1)
|
||||
tool_param_grid.addWidget(self.iso_type_label, 10, 0)
|
||||
tool_param_grid.addWidget(self.iso_type_radio, 10, 1)
|
||||
|
||||
# ##############################################################################################################
|
||||
# Apply to All Parameters Button
|
||||
@@ -3482,8 +3484,8 @@ class IsoUI:
|
||||
gp_frame = FCFrame()
|
||||
self.tool_params_box.addWidget(gp_frame)
|
||||
|
||||
grid3 = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
gp_frame.setLayout(grid3)
|
||||
gen_grid = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
gp_frame.setLayout(gen_grid)
|
||||
|
||||
# Rest Machining
|
||||
self.rest_cb = FCCheckBox('%s' % _("Rest"))
|
||||
@@ -3498,7 +3500,7 @@ class IsoUI:
|
||||
"If not checked, use the standard algorithm.")
|
||||
)
|
||||
|
||||
grid3.addWidget(self.rest_cb, 0, 0)
|
||||
gen_grid.addWidget(self.rest_cb, 0, 0)
|
||||
|
||||
# Force isolation even if the interiors are not isolated
|
||||
self.forced_rest_iso_cb = FCCheckBox(_("Forced Rest"))
|
||||
@@ -3508,7 +3510,7 @@ class IsoUI:
|
||||
"Works when 'rest machining' is used.")
|
||||
)
|
||||
|
||||
grid3.addWidget(self.forced_rest_iso_cb, 0, 1)
|
||||
gen_grid.addWidget(self.forced_rest_iso_cb, 0, 1)
|
||||
|
||||
# Combine All Passes
|
||||
self.combine_passes_cb = FCCheckBox(label=_('Combine'))
|
||||
@@ -3517,7 +3519,7 @@ class IsoUI:
|
||||
)
|
||||
self.combine_passes_cb.setObjectName("i_combine")
|
||||
|
||||
grid3.addWidget(self.combine_passes_cb, 2, 0, 1, 2)
|
||||
gen_grid.addWidget(self.combine_passes_cb, 2, 0, 1, 2)
|
||||
|
||||
# Check Tool validity
|
||||
self.valid_cb = FCCheckBox(label=_('Check validity'))
|
||||
@@ -3527,7 +3529,7 @@ class IsoUI:
|
||||
)
|
||||
self.valid_cb.setObjectName("i_check")
|
||||
|
||||
grid3.addWidget(self.valid_cb, 4, 0, 1, 2)
|
||||
gen_grid.addWidget(self.valid_cb, 4, 0, 1, 2)
|
||||
|
||||
# Exception Areas
|
||||
self.except_cb = FCCheckBox(label=_('Except'))
|
||||
@@ -3535,7 +3537,7 @@ class IsoUI:
|
||||
"by checking this, the area of the object below\n"
|
||||
"will be subtracted from the isolation geometry."))
|
||||
self.except_cb.setObjectName("i_except")
|
||||
grid3.addWidget(self.except_cb, 6, 0)
|
||||
gen_grid.addWidget(self.except_cb, 6, 0)
|
||||
|
||||
# Type of object to be excepted
|
||||
self.type_excobj_radio = RadioSet([{'label': _("Geometry"), 'value': 'geometry'},
|
||||
@@ -3547,7 +3549,7 @@ class IsoUI:
|
||||
"of objects that will populate the 'Object' combobox.")
|
||||
)
|
||||
|
||||
grid3.addWidget(self.type_excobj_radio, 6, 1)
|
||||
gen_grid.addWidget(self.type_excobj_radio, 6, 1)
|
||||
|
||||
# The object to be excepted
|
||||
self.exc_obj_combo = FCComboBox()
|
||||
@@ -3559,7 +3561,7 @@ class IsoUI:
|
||||
self.exc_obj_combo.is_last = True
|
||||
self.exc_obj_combo.obj_type = "gerber"
|
||||
|
||||
grid3.addWidget(self.exc_obj_combo, 8, 0, 1, 2)
|
||||
gen_grid.addWidget(self.exc_obj_combo, 8, 0, 1, 2)
|
||||
|
||||
self.e_ois = OptionalInputSection(self.except_cb,
|
||||
[
|
||||
@@ -3582,8 +3584,8 @@ class IsoUI:
|
||||
)
|
||||
self.select_combo.setObjectName("i_selection")
|
||||
|
||||
grid3.addWidget(self.select_label, 10, 0)
|
||||
grid3.addWidget(self.select_combo, 10, 1)
|
||||
gen_grid.addWidget(self.select_label, 10, 0)
|
||||
gen_grid.addWidget(self.select_combo, 10, 1)
|
||||
|
||||
# Reference Type
|
||||
self.reference_combo_type_label = FCLabel('%s:' % _("Type"))
|
||||
@@ -3591,15 +3593,15 @@ class IsoUI:
|
||||
self.reference_combo_type = FCComboBox2()
|
||||
self.reference_combo_type.addItems([_("Gerber"), _("Excellon"), _("Geometry")])
|
||||
|
||||
grid3.addWidget(self.reference_combo_type_label, 12, 0)
|
||||
grid3.addWidget(self.reference_combo_type, 12, 1)
|
||||
gen_grid.addWidget(self.reference_combo_type_label, 12, 0)
|
||||
gen_grid.addWidget(self.reference_combo_type, 12, 1)
|
||||
|
||||
self.reference_combo = FCComboBox()
|
||||
self.reference_combo.setModel(self.app.collection)
|
||||
self.reference_combo.setRootModelIndex(self.app.collection.index(0, 0, QtCore.QModelIndex()))
|
||||
self.reference_combo.is_last = True
|
||||
|
||||
grid3.addWidget(self.reference_combo, 14, 0, 1, 2)
|
||||
gen_grid.addWidget(self.reference_combo, 14, 0, 1, 2)
|
||||
|
||||
self.reference_combo.hide()
|
||||
self.reference_combo_type.hide()
|
||||
@@ -3612,7 +3614,7 @@ class IsoUI:
|
||||
"(holes in the polygon).")
|
||||
)
|
||||
|
||||
grid3.addWidget(self.poly_int_cb, 16, 0)
|
||||
gen_grid.addWidget(self.poly_int_cb, 16, 0)
|
||||
|
||||
self.poly_int_cb.hide()
|
||||
|
||||
@@ -3636,7 +3638,7 @@ class IsoUI:
|
||||
|
||||
sel_hlay.addWidget(self.sel_all_btn)
|
||||
sel_hlay.addWidget(self.clear_all_btn)
|
||||
grid3.addLayout(sel_hlay, 18, 0, 1, 2)
|
||||
gen_grid.addLayout(sel_hlay, 18, 0, 1, 2)
|
||||
|
||||
# Area Selection shape
|
||||
self.area_shape_label = FCLabel('%s:' % _("Shape"))
|
||||
@@ -3647,12 +3649,14 @@ class IsoUI:
|
||||
self.area_shape_radio = RadioSet([{'label': _("Square"), 'value': 'square'},
|
||||
{'label': _("Polygon"), 'value': 'polygon'}])
|
||||
|
||||
grid3.addWidget(self.area_shape_label, 20, 0)
|
||||
grid3.addWidget(self.area_shape_radio, 20, 1)
|
||||
gen_grid.addWidget(self.area_shape_label, 20, 0)
|
||||
gen_grid.addWidget(self.area_shape_radio, 20, 1)
|
||||
|
||||
self.area_shape_label.hide()
|
||||
self.area_shape_radio.hide()
|
||||
|
||||
FCGridLayout.set_common_column_size([tool_grid, new_tool_grid, tool_param_grid, gen_grid], 0)
|
||||
|
||||
# #############################################################################################################
|
||||
# Generate Geometry object
|
||||
# #############################################################################################################
|
||||
|
||||
@@ -254,7 +254,7 @@ class NonCopperClear(AppTool, Gerber):
|
||||
self.ui.select_combo.currentIndexChanged.connect(self.ui.on_toggle_reference)
|
||||
|
||||
self.ui.ncc_rest_cb.stateChanged.connect(self.ui.on_rest_machining_check)
|
||||
self.ui.ncc_order_radio.activated_custom[str].connect(self.on_order_changed)
|
||||
self.ui.ncc_order_combo.currentIndexChanged.connect(self.on_order_changed)
|
||||
|
||||
self.ui.type_obj_radio.activated_custom.connect(self.on_type_obj_index_changed)
|
||||
self.ui.apply_param_to_all.clicked.connect(self.on_apply_param_to_all_clicked)
|
||||
@@ -326,7 +326,7 @@ class NonCopperClear(AppTool, Gerber):
|
||||
self.on_reference_combo_changed()
|
||||
|
||||
self.ui.op_radio.set_value(self.app.defaults["tools_ncc_operation"])
|
||||
self.ui.ncc_order_radio.set_value(self.app.defaults["tools_ncc_order"])
|
||||
self.ui.ncc_order_combo.set_value(self.app.defaults["tools_ncc_order"])
|
||||
self.ui.ncc_overlap_entry.set_value(self.app.defaults["tools_ncc_overlap"])
|
||||
self.ui.ncc_margin_entry.set_value(self.app.defaults["tools_ncc_margin"])
|
||||
self.ui.ncc_method_combo.set_value(self.app.defaults["tools_ncc_method"])
|
||||
@@ -803,10 +803,10 @@ class NonCopperClear(AppTool, Gerber):
|
||||
else:
|
||||
sorted_tools.append(float('%.*f' % (self.decimals, float(v['tooldia']))))
|
||||
|
||||
order = self.ui.ncc_order_radio.get_value()
|
||||
if order == 'fwd':
|
||||
order = self.ui.ncc_order_combo.get_value()
|
||||
if order == 1: # "Forward"
|
||||
sorted_tools.sort(reverse=False)
|
||||
elif order == 'rev':
|
||||
elif order == 2: # "Reverse"
|
||||
sorted_tools.sort(reverse=True)
|
||||
else:
|
||||
pass
|
||||
@@ -903,7 +903,7 @@ class NonCopperClear(AppTool, Gerber):
|
||||
current_widget.currentIndexChanged.connect(self.form_to_storage)
|
||||
|
||||
self.ui.ncc_rest_cb.stateChanged.connect(self.ui.on_rest_machining_check)
|
||||
self.ui.ncc_order_radio.activated_custom[str].connect(self.on_order_changed)
|
||||
self.ui.ncc_order_combo.currentIndexChanged.connect(self.on_order_changed)
|
||||
|
||||
def ui_disconnect(self):
|
||||
|
||||
@@ -948,7 +948,7 @@ class NonCopperClear(AppTool, Gerber):
|
||||
except (TypeError, ValueError):
|
||||
pass
|
||||
try:
|
||||
self.ui.ncc_order_radio.activated_custom[str].disconnect(self.on_order_changed)
|
||||
self.ui.ncc_order_combo.currentIndexChanged.disconnect(self.on_order_changed)
|
||||
except (TypeError, ValueError):
|
||||
pass
|
||||
|
||||
@@ -969,7 +969,7 @@ class NonCopperClear(AppTool, Gerber):
|
||||
self.ui.reference_combo.obj_type = {0: "Gerber", 1: "Excellon", 2: "Geometry"}[obj_type]
|
||||
|
||||
def on_order_changed(self, order):
|
||||
if order != 'no':
|
||||
if order != 0: # "Default"
|
||||
self.build_ui()
|
||||
|
||||
def on_tooltable_cellwidget_change(self):
|
||||
@@ -1016,8 +1016,8 @@ class NonCopperClear(AppTool, Gerber):
|
||||
|
||||
min_dict = {}
|
||||
idx = 1
|
||||
for geo in total_geo:
|
||||
for s_geo in total_geo[idx:]:
|
||||
for geo in total_geo.geoms:
|
||||
for s_geo in total_geo.geoms[idx:]:
|
||||
# minimize the number of distances by not taking into considerations
|
||||
# those that are too small
|
||||
dist = geo.distance(s_geo)
|
||||
@@ -1161,8 +1161,8 @@ class NonCopperClear(AppTool, Gerber):
|
||||
|
||||
min_dict = {}
|
||||
idx = 1
|
||||
for geo in total_geo:
|
||||
for s_geo in total_geo[idx:]:
|
||||
for geo in total_geo.geoms:
|
||||
for s_geo in total_geo.geoms[idx:]:
|
||||
if self.app.abort_flag:
|
||||
# graceful abort requested by the user
|
||||
raise grace
|
||||
@@ -2330,7 +2330,7 @@ class NonCopperClear(AppTool, Gerber):
|
||||
# ######################################################################################################
|
||||
|
||||
units = self.app.defaults['units']
|
||||
order = order if order else self.ui.ncc_order_radio.get_value()
|
||||
order = order if order else self.ui.ncc_order_combo.get_value()
|
||||
ncc_select = self.ui.select_combo.get_value()
|
||||
rest_machining_choice = self.ui.ncc_rest_cb.get_value()
|
||||
|
||||
@@ -2368,9 +2368,9 @@ class NonCopperClear(AppTool, Gerber):
|
||||
|
||||
tool = None
|
||||
|
||||
if order == 'fwd':
|
||||
if order == 1: # "Forward"
|
||||
sorted_clear_tools.sort(reverse=False)
|
||||
elif order == 'rev':
|
||||
elif order == 2: # "Reverse"
|
||||
sorted_clear_tools.sort(reverse=True)
|
||||
else:
|
||||
pass
|
||||
@@ -2845,9 +2845,9 @@ class NonCopperClear(AppTool, Gerber):
|
||||
def job_thread(a_obj):
|
||||
try:
|
||||
if rest_machining_choice is True:
|
||||
a_obj.app_obj.new_object("geometry", name, gen_clear_area_rest)
|
||||
a_obj.app_obj.new_object("geometry", name, gen_clear_area_rest, autoselected=False)
|
||||
else:
|
||||
a_obj.app_obj.new_object("geometry", name, gen_clear_area)
|
||||
a_obj.app_obj.new_object("geometry", name, gen_clear_area, autoselected=False)
|
||||
except grace:
|
||||
if run_threaded:
|
||||
proc.done()
|
||||
@@ -2864,7 +2864,7 @@ class NonCopperClear(AppTool, Gerber):
|
||||
a_obj.proc_container.view.set_idle()
|
||||
|
||||
# focus on Properties Tab
|
||||
self.app.ui.notebook.setCurrentWidget(self.app.ui.properties_tab)
|
||||
# self.app.ui.notebook.setCurrentWidget(self.app.ui.properties_tab)
|
||||
|
||||
if run_threaded:
|
||||
# Promise object with the new name
|
||||
@@ -3050,9 +3050,9 @@ class NonCopperClear(AppTool, Gerber):
|
||||
# will store the number of tools for which the isolation is broken
|
||||
warning_flag = 0
|
||||
|
||||
if order == 'fwd':
|
||||
if order == 1: # "Forward"
|
||||
sorted_tools.sort(reverse=False)
|
||||
elif order == 'rev':
|
||||
elif order == 2: # "Reverse"
|
||||
sorted_tools.sort(reverse=True)
|
||||
else:
|
||||
pass
|
||||
@@ -4121,8 +4121,8 @@ class NccUI:
|
||||
self.tools_box.addWidget(obj_frame)
|
||||
|
||||
# Grid Layout
|
||||
grid0 = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
obj_frame.setLayout(grid0)
|
||||
obj_grid = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
obj_frame.setLayout(obj_grid)
|
||||
|
||||
# #############################################################################################################
|
||||
# Type of object to be painted
|
||||
@@ -4139,8 +4139,8 @@ class NccUI:
|
||||
self.type_obj_radio = RadioSet([{'label': _("Geometry"), 'value': 'geometry'},
|
||||
{'label': _("Gerber"), 'value': 'gerber'}])
|
||||
|
||||
grid0.addWidget(self.type_obj_combo_label, 0, 0)
|
||||
grid0.addWidget(self.type_obj_radio, 0, 1)
|
||||
obj_grid.addWidget(self.type_obj_combo_label, 0, 0)
|
||||
obj_grid.addWidget(self.type_obj_radio, 0, 1)
|
||||
|
||||
# #############################################################################################################
|
||||
# The object to be copper cleared
|
||||
@@ -4150,12 +4150,12 @@ class NccUI:
|
||||
self.object_combo.setRootModelIndex(self.app.collection.index(0, 0, QtCore.QModelIndex()))
|
||||
self.object_combo.is_last = True
|
||||
|
||||
grid0.addWidget(self.object_combo, 2, 0, 1, 2)
|
||||
obj_grid.addWidget(self.object_combo, 2, 0, 1, 2)
|
||||
|
||||
# separator_line = QtWidgets.QFrame()
|
||||
# separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
|
||||
# separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
|
||||
# grid0.addWidget(separator_line, 4, 0, 1, 2)
|
||||
# obj_grid.addWidget(separator_line, 4, 0, 1, 2)
|
||||
|
||||
# #############################################################################################################
|
||||
# Tool Table Frame
|
||||
@@ -4171,13 +4171,13 @@ class NccUI:
|
||||
tt_frame = FCFrame()
|
||||
self.tools_box.addWidget(tt_frame)
|
||||
|
||||
# Grid Layout
|
||||
grid1 = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
tt_frame.setLayout(grid1)
|
||||
tool_grid = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
tt_frame.setLayout(tool_grid)
|
||||
|
||||
# Tools Table
|
||||
self.tools_table = FCTable(drag_drop=True)
|
||||
# self.tools_table.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)
|
||||
grid1.addWidget(self.tools_table, 2, 0, 1, 2)
|
||||
tool_grid.addWidget(self.tools_table, 0, 0, 1, 2)
|
||||
|
||||
self.tools_table.setColumnCount(4)
|
||||
# 3rd column is reserved (and hidden) for the tool ID
|
||||
@@ -4214,25 +4214,21 @@ class NccUI:
|
||||
"WARNING: using rest machining will automatically set the order\n"
|
||||
"in reverse and disable this control."))
|
||||
|
||||
self.ncc_order_radio = RadioSet([{'label': _('No'), 'value': 'no'},
|
||||
{'label': _('Forward'), 'value': 'fwd'},
|
||||
{'label': _('Reverse'), 'value': 'rev'}])
|
||||
self.ncc_order_radio.setToolTip(_("This set the way that the tools in the tools table are used.\n"
|
||||
"'No' --> means that the used order is the one in the tool table\n"
|
||||
"'Forward' --> means that the tools will be ordered from small to big\n"
|
||||
"'Reverse' --> means that the tools will ordered from big to small\n\n"
|
||||
"WARNING: using rest machining will automatically set the order\n"
|
||||
"in reverse and disable this control."))
|
||||
# self.ncc_order_combo = RadioSet([{'label': _('No'), 'value': 'no'},
|
||||
# {'label': _('Forward'), 'value': 'fwd'},
|
||||
# {'label': _('Reverse'), 'value': 'rev'}])
|
||||
self.ncc_order_combo = FCComboBox2()
|
||||
self.ncc_order_combo.addItems([_('Default'), _('Forward'), _('Reverse')])
|
||||
|
||||
grid1.addWidget(self.ncc_order_label, 4, 0)
|
||||
grid1.addWidget(self.ncc_order_radio, 4, 1)
|
||||
tool_grid.addWidget(self.ncc_order_label, 4, 0)
|
||||
tool_grid.addWidget(self.ncc_order_combo, 4, 1)
|
||||
|
||||
# ##############################################################################
|
||||
# ###################### ADD A NEW TOOL ########################################
|
||||
# ##############################################################################
|
||||
self.add_tool_frame = QtWidgets.QFrame()
|
||||
self.add_tool_frame.setContentsMargins(0, 0, 0, 0)
|
||||
grid1.addWidget(self.add_tool_frame, 6, 0, 1, 2)
|
||||
tool_grid.addWidget(self.add_tool_frame, 6, 0, 1, 2)
|
||||
|
||||
new_tool_grid = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
new_tool_grid.setContentsMargins(0, 0, 0, 0)
|
||||
@@ -4241,13 +4237,13 @@ class NccUI:
|
||||
separator_line = QtWidgets.QFrame()
|
||||
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
|
||||
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
|
||||
new_tool_grid.addWidget(separator_line, 0, 0, 1, 2)
|
||||
new_tool_grid.addWidget(separator_line, 0, 0, 1, 3)
|
||||
|
||||
# #############################################################
|
||||
# ############### Tool selection ##############################
|
||||
# #############################################################
|
||||
self.tool_sel_label = FCLabel('<b>%s</b>' % _('Add from DB'))
|
||||
new_tool_grid.addWidget(self.tool_sel_label, 2, 0, 1, 2)
|
||||
new_tool_grid.addWidget(self.tool_sel_label, 2, 0, 1, 3)
|
||||
|
||||
# ### Tool Diameter ####
|
||||
self.new_tooldia_lbl = FCLabel('%s:' % _('Tool Dia'))
|
||||
@@ -4256,14 +4252,16 @@ class NccUI:
|
||||
)
|
||||
new_tool_grid.addWidget(self.new_tooldia_lbl, 4, 0)
|
||||
|
||||
new_tool_lay = QtWidgets.QHBoxLayout()
|
||||
# nt_grid = FCGridLayout(v_spacing=5, h_spacing=3, c_stretch=[1, 0])
|
||||
# nt_grid.setContentsMargins(0, 0, 0, 0)
|
||||
# new_tool_grid.addLayout(nt_grid, 4, 1)
|
||||
|
||||
self.new_tooldia_entry = FCDoubleSpinner(callback=self.confirmation_message)
|
||||
self.new_tooldia_entry.set_precision(self.decimals)
|
||||
self.new_tooldia_entry.set_range(-10000.0000, 10000.0000)
|
||||
self.new_tooldia_entry.setObjectName(_("Tool Dia"))
|
||||
|
||||
new_tool_lay.addWidget(self.new_tooldia_entry)
|
||||
new_tool_grid.addWidget(self.new_tooldia_entry, 4, 1)
|
||||
|
||||
# Find Optimal Tooldia
|
||||
self.find_optimal_button = QtWidgets.QToolButton()
|
||||
@@ -4274,9 +4272,7 @@ class NccUI:
|
||||
_("Find a tool diameter that is guaranteed\n"
|
||||
"to do a complete isolation.")
|
||||
)
|
||||
new_tool_lay.addWidget(self.find_optimal_button)
|
||||
|
||||
new_tool_grid.addLayout(new_tool_lay, 4, 1)
|
||||
new_tool_grid.addWidget(self.find_optimal_button, 4, 2)
|
||||
|
||||
# #############################################################################################################
|
||||
# ################################ Button Grid ###########################################################
|
||||
@@ -4284,7 +4280,7 @@ class NccUI:
|
||||
button_grid = FCGridLayout(v_spacing=5, h_spacing=3)
|
||||
button_grid.setColumnStretch(0, 1)
|
||||
button_grid.setColumnStretch(1, 0)
|
||||
new_tool_grid.addLayout(button_grid, 6, 0, 1, 2)
|
||||
new_tool_grid.addLayout(button_grid, 6, 0, 1, 3)
|
||||
|
||||
self.search_and_add_btn = FCButton(_('Search and Add'))
|
||||
self.search_and_add_btn.setIcon(QtGui.QIcon(self.app.resource_location + '/plus16.png'))
|
||||
@@ -4325,10 +4321,8 @@ class NccUI:
|
||||
self.tool_data_label = FCLabel(
|
||||
"<b>%s: <font color='#0000FF'>%s %d</font></b>" % (_('Parameters for'), _("Tool"), int(1)))
|
||||
self.tool_data_label.setToolTip(
|
||||
_(
|
||||
"The data used for creating GCode.\n"
|
||||
"Each tool store it's own set of such data."
|
||||
)
|
||||
_("The data used for creating GCode.\n"
|
||||
"Each tool store it's own set of such data.")
|
||||
)
|
||||
self.tools_box.addWidget(self.tool_data_label)
|
||||
|
||||
@@ -4595,9 +4589,10 @@ class NccUI:
|
||||
"- 'Area Selection' - left mouse click to start selection of the area to be processed.\n"
|
||||
"- 'Reference Object' - will process the area specified by another object.")
|
||||
)
|
||||
gen_grid.addWidget(self.select_label, 8, 0, )
|
||||
gen_grid.addWidget(self.select_label, 8, 0)
|
||||
gen_grid.addWidget(self.select_combo, 8, 1)
|
||||
|
||||
# Reference Type
|
||||
self.reference_combo_type_label = FCLabel('%s:' % _("Type"))
|
||||
self.reference_combo_type_label.setToolTip(
|
||||
_("The type of FlatCAM object to be used as non copper clearing reference.\n"
|
||||
@@ -4606,7 +4601,7 @@ class NccUI:
|
||||
self.reference_combo_type = FCComboBox2()
|
||||
self.reference_combo_type.addItems([_("Gerber"), _("Excellon"), _("Geometry")])
|
||||
|
||||
gen_grid.addWidget(self.reference_combo_type_label, 10, 0, )
|
||||
gen_grid.addWidget(self.reference_combo_type_label, 10, 0)
|
||||
gen_grid.addWidget(self.reference_combo_type, 10, 1)
|
||||
|
||||
self.reference_combo = FCComboBox()
|
||||
@@ -4645,6 +4640,8 @@ class NccUI:
|
||||
|
||||
gen_grid.addWidget(self.valid_cb, 16, 0, 1, 2)
|
||||
|
||||
FCGridLayout.set_common_column_size([obj_grid, tool_grid, new_tool_grid, par_grid, gen_grid], 0)
|
||||
|
||||
# #############################################################################################################
|
||||
# Generate NCC Geometry Button
|
||||
# #############################################################################################################
|
||||
@@ -4744,9 +4741,9 @@ class NccUI:
|
||||
|
||||
def on_rest_machining_check(self, state):
|
||||
if state:
|
||||
self.ncc_order_radio.set_value('rev')
|
||||
self.ncc_order_combo.set_value(2) # "Reverse"
|
||||
self.ncc_order_label.setDisabled(True)
|
||||
self.ncc_order_radio.setDisabled(True)
|
||||
self.ncc_order_combo.setDisabled(True)
|
||||
|
||||
self.nccmarginlabel.hide()
|
||||
self.ncc_margin_entry.hide()
|
||||
@@ -4764,7 +4761,7 @@ class NccUI:
|
||||
|
||||
else:
|
||||
self.ncc_order_label.setDisabled(False)
|
||||
self.ncc_order_radio.setDisabled(False)
|
||||
self.ncc_order_combo.setDisabled(False)
|
||||
|
||||
self.nccmarginlabel.show()
|
||||
self.ncc_margin_entry.show()
|
||||
|
||||
Reference in New Issue
Block a user