- the application now uses only the default values from the app.options dict, the app.defaults dict holds the definitive default values
- fixed some outstanding issues from the PyQt6 port - PEP8 fixes - minor fixes - updated the saving of Preferences to update the self.options too: the `Apply` action will update the self.options but the `Save` action will save the updated preferences to the file on disk
This commit is contained in:
@@ -71,7 +71,7 @@ class SelectEditorExc(FCShapeTool):
|
||||
else:
|
||||
mod_key = None
|
||||
|
||||
if mod_key == self.draw_app.app.defaults["global_mselect_key"]:
|
||||
if mod_key == self.draw_app.app.options["global_mselect_key"]:
|
||||
pass
|
||||
else:
|
||||
self.draw_app.selected = []
|
||||
@@ -122,7 +122,7 @@ class SelectEditorExc(FCShapeTool):
|
||||
else:
|
||||
mod_key = None
|
||||
|
||||
if mod_key == self.draw_app.app.defaults["global_mselect_key"]:
|
||||
if mod_key == self.draw_app.app.options["global_mselect_key"]:
|
||||
if closest_shape in self.draw_app.selected:
|
||||
self.draw_app.selected.remove(closest_shape)
|
||||
else:
|
||||
@@ -137,7 +137,7 @@ class SelectEditorExc(FCShapeTool):
|
||||
except (TypeError, AttributeError):
|
||||
pass
|
||||
|
||||
# if mod_key == self.draw_app.app.defaults["global_mselect_key"]:
|
||||
# if mod_key == self.draw_app.app.options["global_mselect_key"]:
|
||||
# self.draw_app.ui.tools_table_exc.setSelectionMode(QtWidgets.QAbstractItemView.MultiSelection)
|
||||
self.sel_tools.clear()
|
||||
|
||||
@@ -182,7 +182,7 @@ class SelectEditorExc(FCShapeTool):
|
||||
# AppExcEditor.draw_shape_idx = (AppExcEditor.draw_shape_idx + 1) % len(over_shape_list)
|
||||
# obj_to_add = over_shape_list[int(AppExcEditor.draw_shape_idx)]
|
||||
#
|
||||
# if self.draw_app.app.defaults["global_mselect_key"] == 'Shift':
|
||||
# if self.draw_app.app.options["global_mselect_key"] == 'Shift':
|
||||
# if self.draw_app.modifiers == Qt.KeyboardModifier.ShiftModifier:
|
||||
# if obj_to_add in self.draw_app.selected:
|
||||
# self.draw_app.selected.remove(obj_to_add)
|
||||
@@ -673,7 +673,7 @@ class SlotAdd(FCShapeTool):
|
||||
self.cursor = QtGui.QCursor(QtGui.QPixmap(self.draw_app.app.resource_location + '/aero_slot.png'))
|
||||
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
|
||||
|
||||
self.steps_per_circ = self.draw_app.app.defaults["geometry_circle_steps"]
|
||||
self.steps_per_circ = self.draw_app.app.options["geometry_circle_steps"]
|
||||
|
||||
self.half_height = 0.0
|
||||
self.half_width = 0.0
|
||||
@@ -711,7 +711,7 @@ class SlotAdd(FCShapeTool):
|
||||
# updating values here allows us to change the aperture on the fly, after the Tool has been started
|
||||
self.selected_dia = self.draw_app.tool2tooldia[self.draw_app.last_tool_selected]
|
||||
self.radius = float(self.selected_dia / 2.0)
|
||||
self.steps_per_circ = self.draw_app.app.defaults["geometry_circle_steps"]
|
||||
self.steps_per_circ = self.draw_app.app.options["geometry_circle_steps"]
|
||||
|
||||
try:
|
||||
slot_length = float(self.draw_app.ui.slot_length_entry.get_value())
|
||||
@@ -887,7 +887,7 @@ class SlotArray(FCShapeTool):
|
||||
self.cursor = QtGui.QCursor(QtGui.QPixmap(self.draw_app.app.resource_location + '/aero_array.png'))
|
||||
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
|
||||
|
||||
self.steps_per_circ = self.draw_app.app.defaults["geometry_circle_steps"]
|
||||
self.steps_per_circ = self.draw_app.app.options["geometry_circle_steps"]
|
||||
|
||||
self.half_width = 0.0
|
||||
self.half_height = 0.0
|
||||
@@ -1073,7 +1073,7 @@ class SlotArray(FCShapeTool):
|
||||
# updating values here allows us to change the aperture on the fly, after the Tool has been started
|
||||
self.selected_dia = self.draw_app.tool2tooldia[self.draw_app.last_tool_selected]
|
||||
self.radius = float(self.selected_dia / 2.0)
|
||||
self.steps_per_circ = self.draw_app.app.defaults["geometry_circle_steps"]
|
||||
self.steps_per_circ = self.draw_app.app.options["geometry_circle_steps"]
|
||||
|
||||
try:
|
||||
slot_length = float(self.draw_app.ui.slot_length_entry.get_value())
|
||||
@@ -1534,7 +1534,7 @@ class MoveEditorExc(FCShapeTool):
|
||||
# self.shape_buffer = self.draw_app.shape_buffer
|
||||
self.origin = None
|
||||
self.destination = None
|
||||
self.sel_limit = self.draw_app.app.defaults["excellon_editor_sel_limit"]
|
||||
self.sel_limit = self.draw_app.app.options["excellon_editor_sel_limit"]
|
||||
self.selection_shape = self.selection_bbox()
|
||||
self.selected_dia_list = []
|
||||
|
||||
@@ -1794,9 +1794,9 @@ class AppExcEditor(QtCore.QObject):
|
||||
self.toolbar_old_state = False
|
||||
|
||||
if self.units == 'MM':
|
||||
self.tolerance = float(self.app.defaults["global_tolerance"])
|
||||
self.tolerance = float(self.app.options["global_tolerance"])
|
||||
else:
|
||||
self.tolerance = float(self.app.defaults["global_tolerance"]) / 20
|
||||
self.tolerance = float(self.app.options["global_tolerance"]) / 20
|
||||
|
||||
# VisPy Visuals
|
||||
if self.app.use_3d_engine:
|
||||
@@ -1994,24 +1994,24 @@ class AppExcEditor(QtCore.QObject):
|
||||
self.tool2tooldia[int(k)] = tool_dia
|
||||
|
||||
# Init appGUI
|
||||
self.ui.addtool_entry.set_value(float(self.app.defaults['excellon_editor_newdia']))
|
||||
self.ui.drill_array_size_entry.set_value(int(self.app.defaults['excellon_editor_array_size']))
|
||||
self.ui.drill_axis_radio.set_value(self.app.defaults['excellon_editor_lin_dir'])
|
||||
self.ui.drill_pitch_entry.set_value(float(self.app.defaults['excellon_editor_lin_pitch']))
|
||||
self.ui.linear_angle_spinner.set_value(float(self.app.defaults['excellon_editor_lin_angle']))
|
||||
self.ui.drill_array_dir_radio.set_value(self.app.defaults['excellon_editor_circ_dir'])
|
||||
self.ui.drill_angle_entry.set_value(float(self.app.defaults['excellon_editor_circ_angle']))
|
||||
self.ui.addtool_entry.set_value(float(self.app.options['excellon_editor_newdia']))
|
||||
self.ui.drill_array_size_entry.set_value(int(self.app.options['excellon_editor_array_size']))
|
||||
self.ui.drill_axis_radio.set_value(self.app.options['excellon_editor_lin_dir'])
|
||||
self.ui.drill_pitch_entry.set_value(float(self.app.options['excellon_editor_lin_pitch']))
|
||||
self.ui.linear_angle_spinner.set_value(float(self.app.options['excellon_editor_lin_angle']))
|
||||
self.ui.drill_array_dir_radio.set_value(self.app.options['excellon_editor_circ_dir'])
|
||||
self.ui.drill_angle_entry.set_value(float(self.app.options['excellon_editor_circ_angle']))
|
||||
|
||||
self.ui.slot_length_entry.set_value(float(self.app.defaults['excellon_editor_slot_length']))
|
||||
self.ui.slot_axis_radio.set_value(self.app.defaults['excellon_editor_slot_direction'])
|
||||
self.ui.slot_angle_spinner.set_value(float(self.app.defaults['excellon_editor_slot_angle']))
|
||||
self.ui.slot_length_entry.set_value(float(self.app.options['excellon_editor_slot_length']))
|
||||
self.ui.slot_axis_radio.set_value(self.app.options['excellon_editor_slot_direction'])
|
||||
self.ui.slot_angle_spinner.set_value(float(self.app.options['excellon_editor_slot_angle']))
|
||||
|
||||
self.ui.slot_array_size_entry.set_value(int(self.app.defaults['excellon_editor_slot_array_size']))
|
||||
self.ui.slot_array_axis_radio.set_value(self.app.defaults['excellon_editor_slot_lin_dir'])
|
||||
self.ui.slot_array_pitch_entry.set_value(float(self.app.defaults['excellon_editor_slot_lin_pitch']))
|
||||
self.ui.slot_array_linear_angle_spinner.set_value(float(self.app.defaults['excellon_editor_slot_lin_angle']))
|
||||
self.ui.slot_array_direction_radio.set_value(self.app.defaults['excellon_editor_slot_circ_dir'])
|
||||
self.ui.slot_array_angle_entry.set_value(float(self.app.defaults['excellon_editor_slot_circ_angle']))
|
||||
self.ui.slot_array_size_entry.set_value(int(self.app.options['excellon_editor_slot_array_size']))
|
||||
self.ui.slot_array_axis_radio.set_value(self.app.options['excellon_editor_slot_lin_dir'])
|
||||
self.ui.slot_array_pitch_entry.set_value(float(self.app.options['excellon_editor_slot_lin_pitch']))
|
||||
self.ui.slot_array_linear_angle_spinner.set_value(float(self.app.options['excellon_editor_slot_lin_angle']))
|
||||
self.ui.slot_array_direction_radio.set_value(self.app.options['excellon_editor_slot_circ_dir'])
|
||||
self.ui.slot_array_angle_entry.set_value(float(self.app.options['excellon_editor_slot_circ_angle']))
|
||||
|
||||
# make sure that th visibility of the various UI frame are updated
|
||||
# according to the set Preferences already loaded
|
||||
@@ -2025,7 +2025,7 @@ class AppExcEditor(QtCore.QObject):
|
||||
self.on_slot_array_linear_angle_radio()
|
||||
|
||||
# Show/Hide Advanced Options
|
||||
app_mode = self.app.defaults["global_app_level"]
|
||||
app_mode = self.app.options["global_app_level"]
|
||||
self.change_level(app_mode)
|
||||
|
||||
def build_ui(self, first_run=None):
|
||||
@@ -2764,52 +2764,52 @@ class AppExcEditor(QtCore.QObject):
|
||||
|
||||
self.data_defaults = {
|
||||
"name": outname + '_drill',
|
||||
"plot": self.app.defaults["excellon_plot"],
|
||||
"solid": self.app.defaults["excellon_solid"],
|
||||
"multicolored": self.app.defaults["excellon_multicolored"],
|
||||
"merge_fuse_tools": self.app.defaults["excellon_merge_fuse_tools"],
|
||||
"format_upper_in": self.app.defaults["excellon_format_upper_in"],
|
||||
"format_lower_in": self.app.defaults["excellon_format_lower_in"],
|
||||
"format_upper_mm": self.app.defaults["excellon_format_upper_mm"],
|
||||
"lower_mm": self.app.defaults["excellon_format_lower_mm"],
|
||||
"zeros": self.app.defaults["excellon_zeros"],
|
||||
"plot": self.app.options["excellon_plot"],
|
||||
"solid": self.app.options["excellon_solid"],
|
||||
"multicolored": self.app.options["excellon_multicolored"],
|
||||
"merge_fuse_tools": self.app.options["excellon_merge_fuse_tools"],
|
||||
"format_upper_in": self.app.options["excellon_format_upper_in"],
|
||||
"format_lower_in": self.app.options["excellon_format_lower_in"],
|
||||
"format_upper_mm": self.app.options["excellon_format_upper_mm"],
|
||||
"lower_mm": self.app.options["excellon_format_lower_mm"],
|
||||
"zeros": self.app.options["excellon_zeros"],
|
||||
|
||||
"tools_drill_tool_order": self.app.defaults["tools_drill_tool_order"],
|
||||
"tools_drill_cutz": self.app.defaults["tools_drill_cutz"],
|
||||
"tools_drill_multidepth": self.app.defaults["tools_drill_multidepth"],
|
||||
"tools_drill_depthperpass": self.app.defaults["tools_drill_depthperpass"],
|
||||
"tools_drill_travelz": self.app.defaults["tools_drill_travelz"],
|
||||
"tools_drill_tool_order": self.app.options["tools_drill_tool_order"],
|
||||
"tools_drill_cutz": self.app.options["tools_drill_cutz"],
|
||||
"tools_drill_multidepth": self.app.options["tools_drill_multidepth"],
|
||||
"tools_drill_depthperpass": self.app.options["tools_drill_depthperpass"],
|
||||
"tools_drill_travelz": self.app.options["tools_drill_travelz"],
|
||||
|
||||
"tools_drill_feedrate_z": self.app.defaults["tools_drill_feedrate_z"],
|
||||
"tools_drill_feedrate_rapid": self.app.defaults["tools_drill_feedrate_rapid"],
|
||||
"tools_drill_feedrate_z": self.app.options["tools_drill_feedrate_z"],
|
||||
"tools_drill_feedrate_rapid": self.app.options["tools_drill_feedrate_rapid"],
|
||||
|
||||
"tools_drill_toolchange": self.app.defaults["tools_drill_toolchange"],
|
||||
"tools_drill_toolchangez": self.app.defaults["tools_drill_toolchangez"],
|
||||
"tools_drill_toolchangexy": self.app.defaults["tools_drill_toolchangexy"],
|
||||
"tools_drill_toolchange": self.app.options["tools_drill_toolchange"],
|
||||
"tools_drill_toolchangez": self.app.options["tools_drill_toolchangez"],
|
||||
"tools_drill_toolchangexy": self.app.options["tools_drill_toolchangexy"],
|
||||
|
||||
# Drill Slots
|
||||
"tools_drill_drill_slots": self.app.defaults["tools_drill_drill_slots"],
|
||||
"tools_drill_drill_overlap": self.app.defaults["tools_drill_drill_overlap"],
|
||||
"tools_drill_last_drill": self.app.defaults["tools_drill_last_drill"],
|
||||
"tools_drill_drill_slots": self.app.options["tools_drill_drill_slots"],
|
||||
"tools_drill_drill_overlap": self.app.options["tools_drill_drill_overlap"],
|
||||
"tools_drill_last_drill": self.app.options["tools_drill_last_drill"],
|
||||
|
||||
"tools_drill_endz": self.app.defaults["tools_drill_endz"],
|
||||
"tools_drill_endxy": self.app.defaults["tools_drill_endxy"],
|
||||
"tools_drill_startz": self.app.defaults["tools_drill_startz"],
|
||||
"tools_drill_offset": self.app.defaults["tools_drill_offset"],
|
||||
"tools_drill_spindlespeed": self.app.defaults["tools_drill_spindlespeed"],
|
||||
"tools_drill_dwell": self.app.defaults["tools_drill_dwell"],
|
||||
"tools_drill_dwelltime": self.app.defaults["tools_drill_dwelltime"],
|
||||
"tools_drill_ppname_e": self.app.defaults["tools_drill_ppname_e"],
|
||||
"tools_drill_z_pdepth": self.app.defaults["tools_drill_z_pdepth"],
|
||||
"tools_drill_feedrate_probe": self.app.defaults["tools_drill_feedrate_probe"],
|
||||
"tools_drill_spindledir": self.app.defaults["tools_drill_spindledir"],
|
||||
"tools_drill_f_plunge": self.app.defaults["tools_drill_f_plunge"],
|
||||
"tools_drill_f_retract": self.app.defaults["tools_drill_f_retract"],
|
||||
"tools_drill_endz": self.app.options["tools_drill_endz"],
|
||||
"tools_drill_endxy": self.app.options["tools_drill_endxy"],
|
||||
"tools_drill_startz": self.app.options["tools_drill_startz"],
|
||||
"tools_drill_offset": self.app.options["tools_drill_offset"],
|
||||
"tools_drill_spindlespeed": self.app.options["tools_drill_spindlespeed"],
|
||||
"tools_drill_dwell": self.app.options["tools_drill_dwell"],
|
||||
"tools_drill_dwelltime": self.app.options["tools_drill_dwelltime"],
|
||||
"tools_drill_ppname_e": self.app.options["tools_drill_ppname_e"],
|
||||
"tools_drill_z_pdepth": self.app.options["tools_drill_z_pdepth"],
|
||||
"tools_drill_feedrate_probe": self.app.options["tools_drill_feedrate_probe"],
|
||||
"tools_drill_spindledir": self.app.options["tools_drill_spindledir"],
|
||||
"tools_drill_f_plunge": self.app.options["tools_drill_f_plunge"],
|
||||
"tools_drill_f_retract": self.app.options["tools_drill_f_retract"],
|
||||
|
||||
"tools_drill_area_exclusion": self.app.defaults["tools_drill_area_exclusion"],
|
||||
"tools_drill_area_shape": self.app.defaults["tools_drill_area_shape"],
|
||||
"tools_drill_area_strategy": self.app.defaults["tools_drill_area_strategy"],
|
||||
"tools_drill_area_overz": self.app.defaults["tools_drill_area_overz"],
|
||||
"tools_drill_area_exclusion": self.app.options["tools_drill_area_exclusion"],
|
||||
"tools_drill_area_shape": self.app.options["tools_drill_area_shape"],
|
||||
"tools_drill_area_strategy": self.app.options["tools_drill_area_strategy"],
|
||||
"tools_drill_area_overz": self.app.options["tools_drill_area_overz"],
|
||||
}
|
||||
|
||||
# fill in self.default_data values from self.obj_options
|
||||
@@ -2899,7 +2899,7 @@ class AppExcEditor(QtCore.QObject):
|
||||
|
||||
# add a first tool in the Tool Table but only if the Excellon Object is empty
|
||||
if not self.tool2tooldia:
|
||||
self.on_tool_add(self.dec_format(float(self.app.defaults['excellon_editor_newdia'])))
|
||||
self.on_tool_add(self.dec_format(float(self.app.options['excellon_editor_newdia'])))
|
||||
|
||||
def update_fcexcellon(self, exc_obj):
|
||||
"""
|
||||
@@ -3201,7 +3201,7 @@ class AppExcEditor(QtCore.QObject):
|
||||
|
||||
def on_row_selected(self, row, col):
|
||||
key_modifier = QtWidgets.QApplication.keyboardModifiers()
|
||||
if self.app.defaults["global_mselect_key"] == 'Control':
|
||||
if self.app.options["global_mselect_key"] == 'Control':
|
||||
modifier_to_use = Qt.KeyboardModifier.ControlModifier
|
||||
else:
|
||||
modifier_to_use = Qt.KeyboardModifier.ShiftModifier
|
||||
@@ -3277,7 +3277,7 @@ class AppExcEditor(QtCore.QObject):
|
||||
# MS: always return to the Select Tool if modifier key is not pressed
|
||||
# else return to the current tool
|
||||
key_modifier = QtWidgets.QApplication.keyboardModifiers()
|
||||
if self.app.defaults["global_mselect_key"] == 'Control':
|
||||
if self.app.options["global_mselect_key"] == 'Control':
|
||||
modifier_to_use = Qt.KeyboardModifier.ControlModifier
|
||||
else:
|
||||
modifier_to_use = Qt.KeyboardModifier.ShiftModifier
|
||||
@@ -3433,8 +3433,8 @@ class AppExcEditor(QtCore.QObject):
|
||||
|
||||
# Update cursor
|
||||
self.app.app_cursor.set_data(np.asarray([(x, y)]), symbol='++', edge_color=self.app.cursor_color_3D,
|
||||
edge_width=self.app.defaults["global_cursor_width"],
|
||||
size=self.app.defaults["global_cursor_size"])
|
||||
edge_width=self.app.options["global_cursor_width"],
|
||||
size=self.app.options["global_cursor_size"])
|
||||
|
||||
self.snap_x = x
|
||||
self.snap_y = y
|
||||
@@ -3473,8 +3473,8 @@ class AppExcEditor(QtCore.QObject):
|
||||
self.app.delete_selection_shape()
|
||||
if dx < 0:
|
||||
self.app.draw_moving_selection_shape((self.pos[0], self.pos[1]), (x, y),
|
||||
color=self.app.defaults["global_alt_sel_line"],
|
||||
face_color=self.app.defaults['global_alt_sel_fill'])
|
||||
color=self.app.options["global_alt_sel_line"],
|
||||
face_color=self.app.options['global_alt_sel_fill'])
|
||||
self.app.selection_type = False
|
||||
else:
|
||||
self.app.draw_moving_selection_shape((self.pos[0], self.pos[1]), (x, y))
|
||||
@@ -3484,8 +3484,8 @@ class AppExcEditor(QtCore.QObject):
|
||||
|
||||
# Update cursor
|
||||
self.app.app_cursor.set_data(np.asarray([(x, y)]), symbol='++', edge_color=self.app.cursor_color_3D,
|
||||
edge_width=self.app.defaults["global_cursor_width"],
|
||||
size=self.app.defaults["global_cursor_size"])
|
||||
edge_width=self.app.options["global_cursor_width"],
|
||||
size=self.app.options["global_cursor_size"])
|
||||
|
||||
def add_exc_shape(self, shape, storage):
|
||||
"""
|
||||
@@ -3594,7 +3594,7 @@ class AppExcEditor(QtCore.QObject):
|
||||
elif self.modifiers == QtCore.Qt.KeyboardModifier.ControlModifier:
|
||||
modifiers = 'Control'
|
||||
|
||||
if modifiers == self.app.defaults["global_mselect_key"]:
|
||||
if modifiers == self.app.options["global_mselect_key"]:
|
||||
for storage in self.storage_dict:
|
||||
for obj in self.storage_dict[storage].get_objects():
|
||||
if (sel_type is True and poly_selection.contains(obj.geo)) or \
|
||||
@@ -3673,7 +3673,7 @@ class AppExcEditor(QtCore.QObject):
|
||||
for sub_geo in el.geoms:
|
||||
self.tool_shape.add(
|
||||
shape=sub_geo,
|
||||
color=(self.app.defaults["global_draw_color"]),
|
||||
color=(self.app.options["global_draw_color"]),
|
||||
update=False,
|
||||
layer=0,
|
||||
tolerance=None
|
||||
@@ -3681,14 +3681,14 @@ class AppExcEditor(QtCore.QObject):
|
||||
else:
|
||||
self.tool_shape.add(
|
||||
shape=el,
|
||||
color=(self.app.defaults["global_draw_color"]),
|
||||
color=(self.app.options["global_draw_color"]),
|
||||
update=False,
|
||||
layer=0,
|
||||
tolerance=None)
|
||||
except TypeError:
|
||||
self.tool_shape.add(
|
||||
shape=util_geo,
|
||||
color=(self.app.defaults["global_draw_color"]),
|
||||
color=(self.app.options["global_draw_color"]),
|
||||
update=False,
|
||||
layer=0,
|
||||
tolerance=None)
|
||||
@@ -3714,10 +3714,10 @@ class AppExcEditor(QtCore.QObject):
|
||||
continue
|
||||
|
||||
if shape_plus in self.selected:
|
||||
self.plot_shape(geometry=shape_plus.geo, color=self.app.defaults['global_sel_draw_color'] + 'FF',
|
||||
self.plot_shape(geometry=shape_plus.geo, color=self.app.options['global_sel_draw_color'] + 'FF',
|
||||
linewidth=2)
|
||||
continue
|
||||
self.plot_shape(geometry=shape_plus.geo, color=self.app.defaults['global_draw_color'][:-2] + 'FF')
|
||||
self.plot_shape(geometry=shape_plus.geo, color=self.app.options['global_draw_color'][:-2] + 'FF')
|
||||
|
||||
for shape_form in self.utility:
|
||||
self.plot_shape(geometry=shape_form.geo, linewidth=1)
|
||||
|
||||
@@ -645,33 +645,33 @@ class PaintOptionsTool(AppTool):
|
||||
|
||||
def set_tool_ui(self):
|
||||
# Init appGUI
|
||||
if self.app.defaults["tools_paint_tooldia"]:
|
||||
self.painttooldia_entry.set_value(self.app.defaults["tools_paint_tooldia"])
|
||||
if self.app.options["tools_paint_tooldia"]:
|
||||
self.painttooldia_entry.set_value(self.app.options["tools_paint_tooldia"])
|
||||
else:
|
||||
self.painttooldia_entry.set_value(0.0)
|
||||
|
||||
if self.app.defaults["tools_paint_overlap"]:
|
||||
self.paintoverlap_entry.set_value(self.app.defaults["tools_paint_overlap"])
|
||||
if self.app.options["tools_paint_overlap"]:
|
||||
self.paintoverlap_entry.set_value(self.app.options["tools_paint_overlap"])
|
||||
else:
|
||||
self.paintoverlap_entry.set_value(0.0)
|
||||
|
||||
if self.app.defaults["tools_paint_offset"]:
|
||||
self.paintmargin_entry.set_value(self.app.defaults["tools_paint_offset"])
|
||||
if self.app.options["tools_paint_offset"]:
|
||||
self.paintmargin_entry.set_value(self.app.options["tools_paint_offset"])
|
||||
else:
|
||||
self.paintmargin_entry.set_value(0.0)
|
||||
|
||||
if self.app.defaults["tools_paint_method"]:
|
||||
self.paintmethod_combo.set_value(self.app.defaults["tools_paint_method"])
|
||||
if self.app.options["tools_paint_method"]:
|
||||
self.paintmethod_combo.set_value(self.app.options["tools_paint_method"])
|
||||
else:
|
||||
self.paintmethod_combo.set_value(_("Seed"))
|
||||
|
||||
if self.app.defaults["tools_paint_connect"]:
|
||||
self.pathconnect_cb.set_value(self.app.defaults["tools_paint_connect"])
|
||||
if self.app.options["tools_paint_connect"]:
|
||||
self.pathconnect_cb.set_value(self.app.options["tools_paint_connect"])
|
||||
else:
|
||||
self.pathconnect_cb.set_value(False)
|
||||
|
||||
if self.app.defaults["tools_paint_contour"]:
|
||||
self.paintcontour_cb.set_value(self.app.defaults["tools_paint_contour"])
|
||||
if self.app.options["tools_paint_contour"]:
|
||||
self.paintcontour_cb.set_value(self.app.options["tools_paint_contour"])
|
||||
else:
|
||||
self.paintcontour_cb.set_value(False)
|
||||
|
||||
@@ -1162,27 +1162,27 @@ class TransformEditorTool(AppTool):
|
||||
|
||||
def set_tool_ui(self):
|
||||
# Initialize form
|
||||
ref_val = self.app.defaults["tools_transform_reference"]
|
||||
ref_val = self.app.options["tools_transform_reference"]
|
||||
if ref_val == _("Object"):
|
||||
ref_val = _("Selection")
|
||||
self.ref_combo.set_value(ref_val)
|
||||
self.point_entry.set_value(self.app.defaults["tools_transform_ref_point"])
|
||||
self.rotate_entry.set_value(self.app.defaults["tools_transform_rotate"])
|
||||
self.point_entry.set_value(self.app.options["tools_transform_ref_point"])
|
||||
self.rotate_entry.set_value(self.app.options["tools_transform_rotate"])
|
||||
|
||||
self.skewx_entry.set_value(self.app.defaults["tools_transform_skew_x"])
|
||||
self.skewy_entry.set_value(self.app.defaults["tools_transform_skew_y"])
|
||||
self.skew_link_cb.set_value(self.app.defaults["tools_transform_skew_link"])
|
||||
self.skewx_entry.set_value(self.app.options["tools_transform_skew_x"])
|
||||
self.skewy_entry.set_value(self.app.options["tools_transform_skew_y"])
|
||||
self.skew_link_cb.set_value(self.app.options["tools_transform_skew_link"])
|
||||
|
||||
self.scalex_entry.set_value(self.app.defaults["tools_transform_scale_x"])
|
||||
self.scaley_entry.set_value(self.app.defaults["tools_transform_scale_y"])
|
||||
self.scale_link_cb.set_value(self.app.defaults["tools_transform_scale_link"])
|
||||
self.scalex_entry.set_value(self.app.options["tools_transform_scale_x"])
|
||||
self.scaley_entry.set_value(self.app.options["tools_transform_scale_y"])
|
||||
self.scale_link_cb.set_value(self.app.options["tools_transform_scale_link"])
|
||||
|
||||
self.offx_entry.set_value(self.app.defaults["tools_transform_offset_x"])
|
||||
self.offy_entry.set_value(self.app.defaults["tools_transform_offset_y"])
|
||||
self.offx_entry.set_value(self.app.options["tools_transform_offset_x"])
|
||||
self.offy_entry.set_value(self.app.options["tools_transform_offset_y"])
|
||||
|
||||
self.buffer_entry.set_value(self.app.defaults["tools_transform_buffer_dis"])
|
||||
self.buffer_factor_entry.set_value(self.app.defaults["tools_transform_buffer_factor"])
|
||||
self.buffer_rounded_cb.set_value(self.app.defaults["tools_transform_buffer_corner"])
|
||||
self.buffer_entry.set_value(self.app.options["tools_transform_buffer_dis"])
|
||||
self.buffer_factor_entry.set_value(self.app.options["tools_transform_buffer_factor"])
|
||||
self.buffer_rounded_cb.set_value(self.app.options["tools_transform_buffer_corner"])
|
||||
|
||||
# initial state is hidden
|
||||
self.point_label.hide()
|
||||
@@ -1568,7 +1568,7 @@ class TransformEditorTool(AppTool):
|
||||
val_box = FCInputDoubleSpinner(title=_("Rotate ..."),
|
||||
text='%s:' % _('Enter an Angle Value (degrees)'),
|
||||
min=-359.9999, max=360.0000, decimals=self.decimals,
|
||||
init_val=float(self.app.defaults['tools_transform_rotate']),
|
||||
init_val=float(self.app.options['tools_transform_rotate']),
|
||||
parent=self.app.ui)
|
||||
val_box.set_icon(QtGui.QIcon(self.app.resource_location + '/rotate.png'))
|
||||
|
||||
@@ -1586,7 +1586,7 @@ class TransformEditorTool(AppTool):
|
||||
val_box = FCInputDoubleSpinner(title=_("Offset on X axis ..."),
|
||||
text='%s: (%s)' % (_('Enter a distance Value'), str(units)),
|
||||
min=-10000.0000, max=10000.0000, decimals=self.decimals,
|
||||
init_val=float(self.app.defaults['tools_transform_offset_x']),
|
||||
init_val=float(self.app.options['tools_transform_offset_x']),
|
||||
parent=self.app.ui)
|
||||
val_box.set_icon(QtGui.QIcon(self.app.resource_location + '/offsetx32.png'))
|
||||
|
||||
@@ -1604,7 +1604,7 @@ class TransformEditorTool(AppTool):
|
||||
val_box = FCInputDoubleSpinner(title=_("Offset on Y axis ..."),
|
||||
text='%s: (%s)' % (_('Enter a distance Value'), str(units)),
|
||||
min=-10000.0000, max=10000.0000, decimals=self.decimals,
|
||||
init_val=float(self.app.defaults['tools_transform_offset_y']),
|
||||
init_val=float(self.app.options['tools_transform_offset_y']),
|
||||
parent=self.app.ui)
|
||||
val_box.set_icon(QtGui.QIcon(self.app.resource_location + '/offsety32.png'))
|
||||
|
||||
@@ -1620,7 +1620,7 @@ class TransformEditorTool(AppTool):
|
||||
val_box = FCInputDoubleSpinner(title=_("Skew on X axis ..."),
|
||||
text='%s:' % _('Enter an Angle Value (degrees)'),
|
||||
min=-359.9999, max=360.0000, decimals=self.decimals,
|
||||
init_val=float(self.app.defaults['tools_transform_skew_x']),
|
||||
init_val=float(self.app.options['tools_transform_skew_x']),
|
||||
parent=self.app.ui)
|
||||
val_box.set_icon(QtGui.QIcon(self.app.resource_location + '/skewX.png'))
|
||||
|
||||
@@ -1636,7 +1636,7 @@ class TransformEditorTool(AppTool):
|
||||
val_box = FCInputDoubleSpinner(title=_("Skew on Y axis ..."),
|
||||
text='%s:' % _('Enter an Angle Value (degrees)'),
|
||||
min=-359.9999, max=360.0000, decimals=self.decimals,
|
||||
init_val=float(self.app.defaults['tools_transform_skew_y']),
|
||||
init_val=float(self.app.options['tools_transform_skew_y']),
|
||||
parent=self.app.ui)
|
||||
val_box.set_icon(QtGui.QIcon(self.app.resource_location + '/skewY.png'))
|
||||
|
||||
@@ -2082,7 +2082,7 @@ class FCCircle(FCShapeTool):
|
||||
self.draw_app.app.jump_signal.connect(lambda x: self.draw_app.update_utility_geometry(data=x))
|
||||
|
||||
self.draw_app.app.inform.emit(_("Click on Center point ..."))
|
||||
self.steps_per_circ = self.draw_app.app.defaults["geometry_circle_steps"]
|
||||
self.steps_per_circ = self.draw_app.app.options["geometry_circle_steps"]
|
||||
|
||||
def click(self, point):
|
||||
try:
|
||||
@@ -2168,7 +2168,7 @@ class FCArc(FCShapeTool):
|
||||
|
||||
self.draw_app.app.jump_signal.connect(lambda x: self.draw_app.update_utility_geometry(data=x))
|
||||
|
||||
self.steps_per_circ = self.draw_app.app.defaults["geometry_circle_steps"]
|
||||
self.steps_per_circ = self.draw_app.app.options["geometry_circle_steps"]
|
||||
|
||||
def click(self, point):
|
||||
try:
|
||||
@@ -2685,7 +2685,7 @@ class FCSelect(DrawTool):
|
||||
else:
|
||||
mod_key = None
|
||||
|
||||
if mod_key == self.draw_app.app.defaults["global_mselect_key"]:
|
||||
if mod_key == self.draw_app.app.options["global_mselect_key"]:
|
||||
# if modifier key is pressed then we add to the selected list the current shape but if it's already
|
||||
# in the selected list, we removed it. Therefore first click selects, second deselects.
|
||||
if obj_to_add in self.draw_app.selected:
|
||||
@@ -2811,7 +2811,7 @@ class FCMove(FCShapeTool):
|
||||
|
||||
self.origin = None
|
||||
self.destination = None
|
||||
self.sel_limit = self.draw_app.app.defaults["geometry_editor_sel_limit"]
|
||||
self.sel_limit = self.draw_app.app.options["geometry_editor_sel_limit"]
|
||||
self.selection_shape = self.selection_bbox()
|
||||
|
||||
if len(self.draw_app.get_selected()) == 0:
|
||||
@@ -2949,7 +2949,7 @@ class FCMove(FCShapeTool):
|
||||
return
|
||||
|
||||
key_modifier = QtWidgets.QApplication.keyboardModifiers()
|
||||
if self.draw_app.app.defaults["global_mselect_key"] == 'Control':
|
||||
if self.draw_app.app.options["global_mselect_key"] == 'Control':
|
||||
# if CONTROL key is pressed then we add to the selected list the current shape but if it's
|
||||
# already in the selected list, we removed it. Therefore first click selects, second deselects.
|
||||
if key_modifier == Qt.KeyboardModifier.ControlModifier:
|
||||
@@ -3850,7 +3850,7 @@ class AppGeoEditor(QtCore.QObject):
|
||||
text_value = text_value.replace(',', '.')
|
||||
self.editor_options[opt] = float(text_value)
|
||||
except Exception as e:
|
||||
entry.set_value(self.app.defaults[opt])
|
||||
entry.set_value(self.app.options[opt])
|
||||
self.app.log.error("AppGeoEditor.__init__().entry2option() --> %s" % str(e))
|
||||
return
|
||||
|
||||
@@ -3880,7 +3880,7 @@ class AppGeoEditor(QtCore.QObject):
|
||||
def on_gridx_val_changed(self):
|
||||
self.grid_changed("global_gridx", self.app.ui.grid_gap_x_entry)
|
||||
# try:
|
||||
# self.app.defaults["global_gridx"] = float(self.app.ui.grid_gap_x_entry.get_value())
|
||||
# self.app.options["global_gridx"] = float(self.app.ui.grid_gap_x_entry.get_value())
|
||||
# except ValueError:
|
||||
# return
|
||||
|
||||
@@ -3910,7 +3910,7 @@ class AppGeoEditor(QtCore.QObject):
|
||||
self.geo_zoom.set_value(False)
|
||||
|
||||
# Show/Hide Advanced Options
|
||||
app_mode = self.app.defaults["global_app_level"]
|
||||
app_mode = self.app.options["global_app_level"]
|
||||
self.change_level(app_mode)
|
||||
|
||||
def build_ui(self):
|
||||
@@ -4657,11 +4657,11 @@ class AppGeoEditor(QtCore.QObject):
|
||||
|
||||
# make sure that the cursor shape is enabled/disabled, too
|
||||
if self.editor_options['grid_snap'] is True:
|
||||
self.app.defaults['global_grid_snap'] = True
|
||||
self.app.options['global_grid_snap'] = True
|
||||
self.app.inform[str, bool].emit(_("Grid Snap enabled."), False)
|
||||
self.app.app_cursor.enabled = True
|
||||
else:
|
||||
self.app.defaults['global_grid_snap'] = False
|
||||
self.app.options['global_grid_snap'] = False
|
||||
self.app.app_cursor.enabled = False
|
||||
self.app.inform[str, bool].emit(_("Grid Snap disabled."), False)
|
||||
|
||||
@@ -4693,7 +4693,7 @@ class AppGeoEditor(QtCore.QObject):
|
||||
# If the SHIFT key is pressed when LMB is clicked then the coordinates are copied to clipboard
|
||||
if modifiers == QtCore.Qt.KeyboardModifier.ShiftModifier:
|
||||
self.app.clipboard.setText(
|
||||
self.app.defaults["global_point_clipboard_format"] %
|
||||
self.app.options["global_point_clipboard_format"] %
|
||||
(self.decimals, self.pos[0], self.decimals, self.pos[1])
|
||||
)
|
||||
return
|
||||
@@ -4767,8 +4767,8 @@ class AppGeoEditor(QtCore.QObject):
|
||||
|
||||
# Update cursor
|
||||
self.app.app_cursor.set_data(np.asarray([(x, y)]), symbol='++', edge_color=self.app.cursor_color_3D,
|
||||
edge_width=self.app.defaults["global_cursor_width"],
|
||||
size=self.app.defaults["global_cursor_size"])
|
||||
edge_width=self.app.options["global_cursor_width"],
|
||||
size=self.app.options["global_cursor_size"])
|
||||
|
||||
self.snap_x = x
|
||||
self.snap_y = y
|
||||
@@ -4805,8 +4805,8 @@ class AppGeoEditor(QtCore.QObject):
|
||||
self.app.delete_selection_shape()
|
||||
if dx < 0:
|
||||
self.app.draw_moving_selection_shape((self.pos[0], self.pos[1]), (x, y),
|
||||
color=self.app.defaults["global_alt_sel_line"],
|
||||
face_color=self.app.defaults['global_alt_sel_fill'])
|
||||
color=self.app.options["global_alt_sel_line"],
|
||||
face_color=self.app.options['global_alt_sel_fill'])
|
||||
self.app.selection_type = False
|
||||
else:
|
||||
self.app.draw_moving_selection_shape((self.pos[0], self.pos[1]), (x, y))
|
||||
@@ -4913,7 +4913,7 @@ class AppGeoEditor(QtCore.QObject):
|
||||
poly_selection.intersects(obj.geo)):
|
||||
sel_objects_list.append(obj)
|
||||
|
||||
if mod_key == self.app.defaults["global_mselect_key"]:
|
||||
if mod_key == self.app.options["global_mselect_key"]:
|
||||
for obj in sel_objects_list:
|
||||
if obj in self.selected:
|
||||
self.selected.remove(obj)
|
||||
@@ -4975,7 +4975,7 @@ class AppGeoEditor(QtCore.QObject):
|
||||
for poly in el:
|
||||
self.tool_shape.add(
|
||||
shape=poly,
|
||||
color=(self.app.defaults["global_draw_color"]),
|
||||
color=(self.app.options["global_draw_color"]),
|
||||
update=False,
|
||||
layer=0,
|
||||
tolerance=None
|
||||
@@ -4984,7 +4984,7 @@ class AppGeoEditor(QtCore.QObject):
|
||||
for linestring in el:
|
||||
self.tool_shape.add(
|
||||
shape=linestring,
|
||||
color=(self.app.defaults["global_draw_color"]),
|
||||
color=(self.app.options["global_draw_color"]),
|
||||
update=False,
|
||||
layer=0,
|
||||
tolerance=None
|
||||
@@ -4992,14 +4992,14 @@ class AppGeoEditor(QtCore.QObject):
|
||||
else:
|
||||
self.tool_shape.add(
|
||||
shape=el,
|
||||
color=(self.app.defaults["global_draw_color"]),
|
||||
color=(self.app.options["global_draw_color"]),
|
||||
update=False,
|
||||
layer=0,
|
||||
tolerance=None
|
||||
)
|
||||
except TypeError:
|
||||
self.tool_shape.add(
|
||||
shape=geo.geo, color=(self.app.defaults["global_draw_color"]),
|
||||
shape=geo.geo, color=(self.app.options["global_draw_color"]),
|
||||
update=False, layer=0, tolerance=None)
|
||||
|
||||
self.tool_shape.redraw()
|
||||
@@ -5118,8 +5118,8 @@ class AppGeoEditor(QtCore.QObject):
|
||||
|
||||
self.shapes.clear(update=True)
|
||||
|
||||
draw_color = self.app.defaults['global_draw_color'][:-2] + "FF"
|
||||
sel_color = self.app.defaults['global_sel_draw_color'][:-2] + 'FF'
|
||||
draw_color = self.app.options['global_draw_color'][:-2] + "FF"
|
||||
sel_color = self.app.options['global_sel_draw_color'][:-2] + 'FF'
|
||||
|
||||
for shape in self.storage.get_objects():
|
||||
if shape.geo and not shape.geo.is_empty and shape.geo.is_valid:
|
||||
@@ -5143,7 +5143,7 @@ class AppGeoEditor(QtCore.QObject):
|
||||
except TypeError:
|
||||
geom = [self.active_tool.geometry.geo]
|
||||
|
||||
if self.app.defaults['geometry_editor_milling_type'] == 'cl':
|
||||
if self.app.options['geometry_editor_milling_type'] == 'cl':
|
||||
# reverse the geometry coordinates direction to allow creation of Gcode for climb milling
|
||||
try:
|
||||
pl = []
|
||||
@@ -5325,13 +5325,13 @@ class AppGeoEditor(QtCore.QObject):
|
||||
|
||||
self.select_tool("select")
|
||||
|
||||
if self.app.defaults['tools_mill_spindledir'] == 'CW':
|
||||
if self.app.defaults['geometry_editor_milling_type'] == 'cl':
|
||||
if self.app.options['tools_mill_spindledir'] == 'CW':
|
||||
if self.app.options['geometry_editor_milling_type'] == 'cl':
|
||||
milling_type = 1 # CCW motion = climb milling (spindle is rotating CW)
|
||||
else:
|
||||
milling_type = -1 # CW motion = conventional milling (spindle is rotating CW)
|
||||
else:
|
||||
if self.app.defaults['geometry_editor_milling_type'] == 'cl':
|
||||
if self.app.options['geometry_editor_milling_type'] == 'cl':
|
||||
milling_type = -1 # CCW motion = climb milling (spindle is rotating CCW)
|
||||
else:
|
||||
milling_type = 1 # CW motion = conventional milling (spindle is rotating CCW)
|
||||
@@ -5724,7 +5724,7 @@ class AppGeoEditor(QtCore.QObject):
|
||||
if t.geo.geom_type == 'Polygon':
|
||||
results.append(t.geo.exterior.buffer(
|
||||
buf_distance - 1e-10,
|
||||
resolution=int(int(editor_self.app.defaults["geometry_circle_steps"]) / 4),
|
||||
resolution=int(int(editor_self.app.options["geometry_circle_steps"]) / 4),
|
||||
join_style=join_style)
|
||||
)
|
||||
elif t.geo.geom_type == 'MultiLineString':
|
||||
@@ -5733,12 +5733,12 @@ class AppGeoEditor(QtCore.QObject):
|
||||
b_geo = Polygon(line)
|
||||
results.append(b_geo.buffer(
|
||||
buf_distance - 1e-10,
|
||||
resolution=int(int(editor_self.app.defaults["geometry_circle_steps"]) / 4),
|
||||
resolution=int(int(editor_self.app.options["geometry_circle_steps"]) / 4),
|
||||
join_style=join_style).exterior
|
||||
)
|
||||
results.append(b_geo.buffer(
|
||||
-buf_distance + 1e-10,
|
||||
resolution=int(int(editor_self.app.defaults["geometry_circle_steps"]) / 4),
|
||||
resolution=int(int(editor_self.app.options["geometry_circle_steps"]) / 4),
|
||||
join_style=join_style).exterior
|
||||
)
|
||||
elif t.geo.geom_type in ['LineString', 'LinearRing']:
|
||||
@@ -5746,12 +5746,12 @@ class AppGeoEditor(QtCore.QObject):
|
||||
b_geo = Polygon(t.geo)
|
||||
results.append(b_geo.buffer(
|
||||
buf_distance - 1e-10,
|
||||
resolution=int(int(editor_self.app.defaults["geometry_circle_steps"]) / 4),
|
||||
resolution=int(int(editor_self.app.options["geometry_circle_steps"]) / 4),
|
||||
join_style=join_style).exterior
|
||||
)
|
||||
results.append(b_geo.buffer(
|
||||
-buf_distance + 1e-10,
|
||||
resolution=int(int(editor_self.app.defaults["geometry_circle_steps"]) / 4),
|
||||
resolution=int(int(editor_self.app.options["geometry_circle_steps"]) / 4),
|
||||
join_style=join_style).exterior
|
||||
)
|
||||
|
||||
@@ -5800,7 +5800,7 @@ class AppGeoEditor(QtCore.QObject):
|
||||
if t.geo.geom_type == 'Polygon':
|
||||
results.append(t.geo.exterior.buffer(
|
||||
-buf_distance + 1e-10,
|
||||
resolution=int(int(editor_self.app.defaults["geometry_circle_steps"]) / 4),
|
||||
resolution=int(int(editor_self.app.options["geometry_circle_steps"]) / 4),
|
||||
join_style=join_style).exterior
|
||||
)
|
||||
elif t.geo.geom_type == 'MultiLineString':
|
||||
@@ -5809,7 +5809,7 @@ class AppGeoEditor(QtCore.QObject):
|
||||
b_geo = Polygon(line)
|
||||
results.append(b_geo.buffer(
|
||||
-buf_distance + 1e-10,
|
||||
resolution=int(int(editor_self.app.defaults["geometry_circle_steps"]) / 4),
|
||||
resolution=int(int(editor_self.app.options["geometry_circle_steps"]) / 4),
|
||||
join_style=join_style).exterior
|
||||
)
|
||||
elif t.geo.geom_type in ['LineString', 'LinearRing']:
|
||||
@@ -5817,7 +5817,7 @@ class AppGeoEditor(QtCore.QObject):
|
||||
b_geo = Polygon(t.geo)
|
||||
results.append(b_geo.buffer(
|
||||
-buf_distance + 1e-10,
|
||||
resolution=int(int(editor_self.app.defaults["geometry_circle_steps"]) / 4),
|
||||
resolution=int(int(editor_self.app.options["geometry_circle_steps"]) / 4),
|
||||
join_style=join_style).exterior
|
||||
)
|
||||
|
||||
@@ -5868,7 +5868,7 @@ class AppGeoEditor(QtCore.QObject):
|
||||
if t.geo.geom_type == 'Polygon':
|
||||
results.append(t.geo.exterior.buffer(
|
||||
buf_distance - 1e-10,
|
||||
resolution=int(int(editor_self.app.defaults["geometry_circle_steps"]) / 4),
|
||||
resolution=int(int(editor_self.app.options["geometry_circle_steps"]) / 4),
|
||||
join_style=join_style).exterior
|
||||
)
|
||||
elif t.geo.geom_type == 'MultiLineString':
|
||||
@@ -5877,7 +5877,7 @@ class AppGeoEditor(QtCore.QObject):
|
||||
b_geo = Polygon(line)
|
||||
results.append(b_geo.buffer(
|
||||
buf_distance - 1e-10,
|
||||
resolution=int(int(editor_self.app.defaults["geometry_circle_steps"]) / 4),
|
||||
resolution=int(int(editor_self.app.options["geometry_circle_steps"]) / 4),
|
||||
join_style=join_style).exterior
|
||||
)
|
||||
elif t.geo.geom_type in ['LineString', 'LinearRing']:
|
||||
@@ -5885,7 +5885,7 @@ class AppGeoEditor(QtCore.QObject):
|
||||
b_geo = Polygon(t.geo)
|
||||
results.append(b_geo.buffer(
|
||||
buf_distance - 1e-10,
|
||||
resolution=int(int(editor_self.app.defaults["geometry_circle_steps"]) / 4),
|
||||
resolution=int(int(editor_self.app.options["geometry_circle_steps"]) / 4),
|
||||
join_style=join_style).exterior
|
||||
)
|
||||
|
||||
@@ -5967,17 +5967,17 @@ class AppGeoEditor(QtCore.QObject):
|
||||
if method == _("Seed"):
|
||||
cp = Geometry.clear_polygon2(
|
||||
editor_self, polygon_to_clear=poly_buf, tooldia=tooldia,
|
||||
steps_per_circle=editor_self.app.defaults["geometry_circle_steps"],
|
||||
steps_per_circle=editor_self.app.options["geometry_circle_steps"],
|
||||
overlap=overlap, contour=contour, connect=connect)
|
||||
elif method == _("Lines"):
|
||||
cp = Geometry.clear_polygon3(
|
||||
editor_self, polygon=poly_buf, tooldia=tooldia,
|
||||
steps_per_circle=editor_self.app.defaults["geometry_circle_steps"],
|
||||
steps_per_circle=editor_self.app.options["geometry_circle_steps"],
|
||||
overlap=overlap, contour=contour, connect=connect)
|
||||
else:
|
||||
cp = Geometry.clear_polygon(
|
||||
editor_self, polygon=poly_buf, tooldia=tooldia,
|
||||
steps_per_circle=editor_self.app.defaults["geometry_circle_steps"],
|
||||
steps_per_circle=editor_self.app.options["geometry_circle_steps"],
|
||||
overlap=overlap, contour=contour, connect=connect)
|
||||
|
||||
if cp is not None:
|
||||
|
||||
@@ -228,7 +228,7 @@ class PadEditorGrb(ShapeToolEditorGrb):
|
||||
self.dont_execute = False
|
||||
|
||||
self.storage_obj = self.draw_app.storage_dict[self.draw_app.last_aperture_selected]['geometry']
|
||||
self.steps_per_circ = self.draw_app.app.defaults["geometry_circle_steps"]
|
||||
self.steps_per_circ = self.draw_app.app.options["geometry_circle_steps"]
|
||||
|
||||
# if those cause KeyError exception it means that the aperture type is not 'R'. Only 'R' type has those keys
|
||||
try:
|
||||
@@ -273,7 +273,7 @@ class PadEditorGrb(ShapeToolEditorGrb):
|
||||
# updating values here allows us to change the aperture on the fly, after the Tool has been started
|
||||
self.storage_obj = self.draw_app.storage_dict[self.draw_app.last_aperture_selected]['geometry']
|
||||
self.radius = float(self.draw_app.storage_dict[self.draw_app.last_aperture_selected]['size']) / 2
|
||||
self.steps_per_circ = self.draw_app.app.defaults["geometry_circle_steps"]
|
||||
self.steps_per_circ = self.draw_app.app.options["geometry_circle_steps"]
|
||||
|
||||
# if those cause KeyError exception it means that the aperture type is not 'R'. Only 'R' type has those keys
|
||||
try:
|
||||
@@ -438,7 +438,7 @@ class PadArrayEditorGrb(ShapeToolEditorGrb):
|
||||
QtGui.QGuiApplication.setOverrideCursor(self.cursor)
|
||||
|
||||
self.storage_obj = self.draw_app.storage_dict[self.draw_app.last_aperture_selected]['geometry']
|
||||
self.steps_per_circ = self.draw_app.app.defaults["geometry_circle_steps"]
|
||||
self.steps_per_circ = self.draw_app.app.options["geometry_circle_steps"]
|
||||
|
||||
# if those cause KeyError exception it means that the aperture type is not 'R'. Only 'R' type has those keys
|
||||
try:
|
||||
@@ -629,7 +629,7 @@ class PadArrayEditorGrb(ShapeToolEditorGrb):
|
||||
# updating values here allows us to change the aperture on the fly, after the Tool has been started
|
||||
self.storage_obj = self.draw_app.storage_dict[self.draw_app.last_aperture_selected]['geometry']
|
||||
self.radius = float(self.draw_app.storage_dict[self.draw_app.last_aperture_selected]['size']) / 2
|
||||
self.steps_per_circ = self.draw_app.app.defaults["geometry_circle_steps"]
|
||||
self.steps_per_circ = self.draw_app.app.options["geometry_circle_steps"]
|
||||
|
||||
# if those cause KeyError exception it means that the aperture type is not 'R'. Only 'R' type has those keys
|
||||
try:
|
||||
@@ -942,7 +942,7 @@ class PoligonizeEditorGrb(ShapeToolEditorGrb):
|
||||
# MS: always return to the Select Tool if modifier key is not pressed
|
||||
# else return to the current tool
|
||||
key_modifier = QtWidgets.QApplication.keyboardModifiers()
|
||||
if self.draw_app.app.defaults["global_mselect_key"] == 'Control':
|
||||
if self.draw_app.app.options["global_mselect_key"] == 'Control':
|
||||
modifier_to_use = Qt.KeyboardModifier.ControlModifier
|
||||
else:
|
||||
modifier_to_use = Qt.KeyboardModifier.ShiftModifier
|
||||
@@ -971,7 +971,7 @@ class RegionEditorGrb(ShapeToolEditorGrb):
|
||||
self.draw_app = draw_app
|
||||
self.dont_execute = False
|
||||
|
||||
self.steps_per_circle = self.draw_app.app.defaults["gerber_circle_steps"]
|
||||
self.steps_per_circle = self.draw_app.app.options["gerber_circle_steps"]
|
||||
|
||||
# try:
|
||||
# size_ap = float(self.draw_app.storage_dict[self.draw_app.last_aperture_selected]['size'])
|
||||
@@ -1337,7 +1337,7 @@ class TrackEditorGrb(ShapeToolEditorGrb):
|
||||
self.draw_app = draw_app
|
||||
self.dont_execute = False
|
||||
|
||||
self.steps_per_circle = self.draw_app.app.defaults["gerber_circle_steps"]
|
||||
self.steps_per_circle = self.draw_app.app.options["gerber_circle_steps"]
|
||||
|
||||
try:
|
||||
size_ap = float(self.draw_app.storage_dict[self.draw_app.last_aperture_selected]['size'])
|
||||
@@ -1667,7 +1667,7 @@ class DiscEditorGrb(ShapeToolEditorGrb):
|
||||
|
||||
self.draw_app.app.jump_signal.connect(lambda x: self.draw_app.update_utility_geometry(data=x))
|
||||
|
||||
self.steps_per_circ = self.draw_app.app.defaults["gerber_circle_steps"]
|
||||
self.steps_per_circ = self.draw_app.app.options["gerber_circle_steps"]
|
||||
|
||||
def click(self, point):
|
||||
self.points.append(point)
|
||||
@@ -1787,7 +1787,7 @@ class DiscSemiEditorGrb(ShapeToolEditorGrb):
|
||||
}
|
||||
self.storage_obj = self.draw_app.storage_dict[0]['geometry']
|
||||
|
||||
self.steps_per_circ = self.draw_app.app.defaults["gerber_circle_steps"]
|
||||
self.steps_per_circ = self.draw_app.app.options["gerber_circle_steps"]
|
||||
self.draw_app.app.jump_signal.connect(lambda x: self.draw_app.update_utility_geometry(data=x))
|
||||
|
||||
def click(self, point):
|
||||
@@ -2206,7 +2206,7 @@ class MoveEditorGrb(ShapeToolEditorGrb):
|
||||
|
||||
self.draw_app.app.jump_signal.connect(lambda x: self.draw_app.update_utility_geometry(data=x))
|
||||
|
||||
self.sel_limit = self.draw_app.app.defaults["gerber_editor_sel_limit"]
|
||||
self.sel_limit = self.draw_app.app.options["gerber_editor_sel_limit"]
|
||||
self.selection_shape = self.selection_bbox()
|
||||
|
||||
def set_origin(self, origin):
|
||||
@@ -2421,7 +2421,7 @@ class EraserEditorGrb(ShapeToolEditorGrb):
|
||||
|
||||
self.draw_app.app.jump_signal.connect(lambda x: self.draw_app.update_utility_geometry(data=x))
|
||||
|
||||
self.sel_limit = self.draw_app.app.defaults["gerber_editor_sel_limit"]
|
||||
self.sel_limit = self.draw_app.app.options["gerber_editor_sel_limit"]
|
||||
|
||||
def set_origin(self, origin):
|
||||
self.origin = origin
|
||||
@@ -2614,7 +2614,7 @@ class SelectEditorGrb(QtCore.QObject, DrawTool):
|
||||
else:
|
||||
mod_key = None
|
||||
|
||||
if mod_key == self.draw_app.app.defaults["global_mselect_key"]:
|
||||
if mod_key == self.draw_app.app.options["global_mselect_key"]:
|
||||
pass
|
||||
else:
|
||||
self.draw_app.selected = []
|
||||
@@ -2630,7 +2630,7 @@ class SelectEditorGrb(QtCore.QObject, DrawTool):
|
||||
else:
|
||||
mod_key = None
|
||||
|
||||
if mod_key != self.draw_app.app.defaults["global_mselect_key"]:
|
||||
if mod_key != self.draw_app.app.options["global_mselect_key"]:
|
||||
self.draw_app.selected.clear()
|
||||
self.sel_aperture.clear()
|
||||
|
||||
@@ -2903,8 +2903,8 @@ class ImportEditorGrb(QtCore.QObject, DrawTool):
|
||||
|
||||
# Update cursor
|
||||
self.app.app_cursor.set_data(np.asarray([(x, y)]), symbol='++', edge_color=self.app.cursor_color_3D,
|
||||
edge_width=self.app.defaults["global_cursor_width"],
|
||||
size=self.app.defaults["global_cursor_size"])
|
||||
edge_width=self.app.options["global_cursor_width"],
|
||||
size=self.app.options["global_cursor_size"])
|
||||
|
||||
self.snap_x = x
|
||||
self.snap_y = y
|
||||
@@ -2931,8 +2931,8 @@ class ImportEditorGrb(QtCore.QObject, DrawTool):
|
||||
self.app.delete_selection_shape()
|
||||
if dx < 0:
|
||||
self.app.draw_moving_selection_shape((self.pos[0], self.pos[1]), (x, y),
|
||||
color=self.app.defaults["global_alt_sel_line"],
|
||||
face_color=self.app.defaults['global_alt_sel_fill'])
|
||||
color=self.app.options["global_alt_sel_line"],
|
||||
face_color=self.app.options['global_alt_sel_fill'])
|
||||
self.app.selection_type = False
|
||||
else:
|
||||
self.app.draw_moving_selection_shape((self.pos[0], self.pos[1]), (x, y))
|
||||
@@ -3024,9 +3024,9 @@ class ImportEditorGrb(QtCore.QObject, DrawTool):
|
||||
if solid_geo not in self.get_selected_geos():
|
||||
shape_id = self.app.tool_shapes.add(tolerance=obj.drawing_tolerance, layer=0,
|
||||
shape=solid_geo,
|
||||
color=self.app.defaults[
|
||||
color=self.app.options[
|
||||
'global_sel_draw_color'] + 'AF',
|
||||
face_color=self.app.defaults[
|
||||
face_color=self.app.options[
|
||||
'global_sel_draw_color'
|
||||
] + 'AF',
|
||||
visible=True)
|
||||
@@ -3068,8 +3068,8 @@ class ImportEditorGrb(QtCore.QObject, DrawTool):
|
||||
|
||||
added_poly_count = 0
|
||||
|
||||
color = self.app.defaults['global_sel_draw_color'] + 'AF'
|
||||
face_color = self.app.defaults['global_sel_draw_color'] + 'AF'
|
||||
color = self.app.options['global_sel_draw_color'] + 'AF'
|
||||
face_color = self.app.options['global_sel_draw_color'] + 'AF'
|
||||
|
||||
for obj in self.app.collection.get_list():
|
||||
# only Gerber objects and only those that are active and not the edited object
|
||||
@@ -3347,7 +3347,7 @@ class AppGerberEditor(QtCore.QObject):
|
||||
# this will flag if the Editor "tools" are launched from key shortcuts (True) or from menu toolbar (False)
|
||||
self.launched_from_shortcuts = False
|
||||
|
||||
def_tol_val = float(self.app.defaults["global_tolerance"])
|
||||
def_tol_val = float(self.app.options["global_tolerance"])
|
||||
self.tolerance = def_tol_val if self.units == 'MM' else def_tol_val / 25.4
|
||||
|
||||
# options of this widget (AppGerberEditor class is a widget)
|
||||
@@ -3527,31 +3527,31 @@ class AppGerberEditor(QtCore.QObject):
|
||||
# #############################################################################################################
|
||||
# Init appGUI
|
||||
# #############################################################################################################
|
||||
self.ui.buffer_distance_entry.set_value(self.app.defaults["gerber_editor_buff_f"])
|
||||
self.ui.scale_factor_entry.set_value(self.app.defaults["gerber_editor_scale_f"])
|
||||
self.ui.ma_upper_threshold_entry.set_value(self.app.defaults["gerber_editor_ma_high"])
|
||||
self.ui.ma_lower_threshold_entry.set_value(self.app.defaults["gerber_editor_ma_low"])
|
||||
self.ui.buffer_distance_entry.set_value(self.app.options["gerber_editor_buff_f"])
|
||||
self.ui.scale_factor_entry.set_value(self.app.options["gerber_editor_scale_f"])
|
||||
self.ui.ma_upper_threshold_entry.set_value(self.app.options["gerber_editor_ma_high"])
|
||||
self.ui.ma_lower_threshold_entry.set_value(self.app.options["gerber_editor_ma_low"])
|
||||
|
||||
self.ui.apsize_entry.set_value(self.app.defaults["gerber_editor_newsize"])
|
||||
self.ui.aptype_cb.set_value(self.app.defaults["gerber_editor_newtype"])
|
||||
self.ui.apdim_entry.set_value(self.app.defaults["gerber_editor_newdim"])
|
||||
self.ui.apsize_entry.set_value(self.app.options["gerber_editor_newsize"])
|
||||
self.ui.aptype_cb.set_value(self.app.options["gerber_editor_newtype"])
|
||||
self.ui.apdim_entry.set_value(self.app.options["gerber_editor_newdim"])
|
||||
|
||||
# PAD Array
|
||||
self.ui.array_type_radio.set_value('linear') # Linear
|
||||
self.on_array_type_radio(val=self.ui.array_type_radio.get_value())
|
||||
self.ui.pad_array_size_entry.set_value(int(self.app.defaults["gerber_editor_array_size"]))
|
||||
self.ui.pad_array_size_entry.set_value(int(self.app.options["gerber_editor_array_size"]))
|
||||
|
||||
# linear array
|
||||
self.ui.pad_axis_radio.set_value('X')
|
||||
self.on_linear_angle_radio(val=self.ui.pad_axis_radio.get_value())
|
||||
self.ui.pad_axis_radio.set_value(self.app.defaults["gerber_editor_lin_axis"])
|
||||
self.ui.pad_pitch_entry.set_value(float(self.app.defaults["gerber_editor_lin_pitch"]))
|
||||
self.ui.linear_angle_spinner.set_value(self.app.defaults["gerber_editor_lin_angle"])
|
||||
self.ui.pad_axis_radio.set_value(self.app.options["gerber_editor_lin_axis"])
|
||||
self.ui.pad_pitch_entry.set_value(float(self.app.options["gerber_editor_lin_pitch"]))
|
||||
self.ui.linear_angle_spinner.set_value(self.app.options["gerber_editor_lin_angle"])
|
||||
|
||||
# circular array
|
||||
self.ui.pad_direction_radio.set_value('CW')
|
||||
self.ui.pad_direction_radio.set_value(self.app.defaults["gerber_editor_circ_dir"])
|
||||
self.ui.pad_angle_entry.set_value(float(self.app.defaults["gerber_editor_circ_angle"]))
|
||||
self.ui.pad_direction_radio.set_value(self.app.options["gerber_editor_circ_dir"])
|
||||
self.ui.pad_angle_entry.set_value(float(self.app.options["gerber_editor_circ_angle"]))
|
||||
|
||||
self.ui.geo_coords_entry.setText('')
|
||||
self.ui.geo_vertex_entry.set_value(0.0)
|
||||
@@ -3559,7 +3559,7 @@ class AppGerberEditor(QtCore.QObject):
|
||||
self.ui.geo_zoom.set_value(False)
|
||||
|
||||
# Show/Hide Advanced Options
|
||||
app_mode = self.app.defaults["global_app_level"]
|
||||
app_mode = self.app.options["global_app_level"]
|
||||
self.change_level(app_mode)
|
||||
|
||||
def build_ui(self, first_run=None):
|
||||
@@ -3724,7 +3724,7 @@ class AppGerberEditor(QtCore.QObject):
|
||||
self.ui.apcode_entry.set_value(max(self.tid2apcode.values()) + 1)
|
||||
except ValueError:
|
||||
# this means that the edited object has no apertures so we start with 10 (Gerber specifications)
|
||||
self.ui.apcode_entry.set_value(self.app.defaults["gerber_editor_newcode"])
|
||||
self.ui.apcode_entry.set_value(self.app.options["gerber_editor_newcode"])
|
||||
|
||||
def on_aperture_add(self, apcode=None):
|
||||
self.is_modified = True
|
||||
@@ -4551,7 +4551,7 @@ class AppGerberEditor(QtCore.QObject):
|
||||
else:
|
||||
self.conversion_factor = 0.0393700787401575
|
||||
|
||||
def_tol_val = float(self.app.defaults["global_tolerance"])
|
||||
def_tol_val = float(self.app.options["global_tolerance"])
|
||||
self.tolerance = def_tol_val if self.units == 'MM' else def_tol_val / 25.4
|
||||
|
||||
# Hide original geometry
|
||||
@@ -4995,7 +4995,7 @@ class AppGerberEditor(QtCore.QObject):
|
||||
def on_row_selected(self, row, col):
|
||||
# if col == 0:
|
||||
key_modifier = QtWidgets.QApplication.keyboardModifiers()
|
||||
if self.app.defaults["global_mselect_key"] == 'Control':
|
||||
if self.app.options["global_mselect_key"] == 'Control':
|
||||
modifier_to_use = Qt.KeyboardModifier.ControlModifier
|
||||
else:
|
||||
modifier_to_use = Qt.KeyboardModifier.ShiftModifier
|
||||
@@ -5188,7 +5188,7 @@ class AppGerberEditor(QtCore.QObject):
|
||||
# If the SHIFT key is pressed when LMB is clicked then the coordinates are copied to clipboard
|
||||
if modifiers == QtCore.Qt.KeyboardModifier.ShiftModifier:
|
||||
self.app.clipboard.setText(
|
||||
self.app.defaults["global_point_clipboard_format"] %
|
||||
self.app.options["global_point_clipboard_format"] %
|
||||
(self.decimals, self.pos[0], self.decimals, self.pos[1])
|
||||
)
|
||||
self.app.inform.emit('[success] %s' % _("Copied to clipboard."))
|
||||
@@ -5206,7 +5206,7 @@ class AppGerberEditor(QtCore.QObject):
|
||||
# MS: always return to the Select Tool if modifier key is not pressed
|
||||
# else return to the current tool
|
||||
key_modifier = QtWidgets.QApplication.keyboardModifiers()
|
||||
if self.app.defaults["global_mselect_key"] == 'Control':
|
||||
if self.app.options["global_mselect_key"] == 'Control':
|
||||
modifier_to_use = Qt.KeyboardModifier.ControlModifier
|
||||
else:
|
||||
modifier_to_use = Qt.KeyboardModifier.ShiftModifier
|
||||
@@ -5286,9 +5286,9 @@ class AppGerberEditor(QtCore.QObject):
|
||||
self.select_tool(self.active_tool.name)
|
||||
else:
|
||||
key_modifier = QtWidgets.QApplication.keyboardModifiers()
|
||||
if (self.app.defaults["global_mselect_key"] == 'Control' and
|
||||
if (self.app.options["global_mselect_key"] == 'Control' and
|
||||
key_modifier == Qt.KeyboardModifier.ControlModifier) or \
|
||||
(self.app.defaults["global_mselect_key"] == 'Shift' and
|
||||
(self.app.options["global_mselect_key"] == 'Shift' and
|
||||
key_modifier == Qt.KeyboardModifier.ShiftModifier):
|
||||
|
||||
self.select_tool(self.active_tool.name)
|
||||
@@ -5335,7 +5335,7 @@ class AppGerberEditor(QtCore.QObject):
|
||||
geometric_data = obj.geo['solid']
|
||||
if (sel_type is True and poly_selection.contains(geometric_data)) or \
|
||||
(sel_type is False and poly_selection.intersects(geometric_data)):
|
||||
if self.key == self.app.defaults["global_mselect_key"]:
|
||||
if self.key == self.app.options["global_mselect_key"]:
|
||||
if obj in self.selected:
|
||||
self.selected.remove(obj)
|
||||
else:
|
||||
@@ -5448,8 +5448,8 @@ class AppGerberEditor(QtCore.QObject):
|
||||
|
||||
# Update cursor
|
||||
self.app.app_cursor.set_data(np.asarray([(x, y)]), symbol='++', edge_color=self.app.cursor_color_3D,
|
||||
edge_width=self.app.defaults["global_cursor_width"],
|
||||
size=self.app.defaults["global_cursor_size"])
|
||||
edge_width=self.app.options["global_cursor_width"],
|
||||
size=self.app.options["global_cursor_size"])
|
||||
|
||||
self.snap_x = x
|
||||
self.snap_y = y
|
||||
@@ -5489,8 +5489,8 @@ class AppGerberEditor(QtCore.QObject):
|
||||
self.app.delete_selection_shape()
|
||||
if dx < 0:
|
||||
self.app.draw_moving_selection_shape((self.pos[0], self.pos[1]), (x, y),
|
||||
color=self.app.defaults["global_alt_sel_line"],
|
||||
face_color=self.app.defaults['global_alt_sel_fill'])
|
||||
color=self.app.options["global_alt_sel_line"],
|
||||
face_color=self.app.options['global_alt_sel_fill'])
|
||||
self.app.selection_type = False
|
||||
else:
|
||||
self.app.draw_moving_selection_shape((self.pos[0], self.pos[1]), (x, y))
|
||||
@@ -5516,8 +5516,8 @@ class AppGerberEditor(QtCore.QObject):
|
||||
geometric_data = el['solid']
|
||||
# Add the new utility shape
|
||||
self.tool_shape.add(
|
||||
shape=geometric_data, color=(self.app.defaults["global_draw_color"]),
|
||||
# face_color=self.app.defaults['global_alt_sel_fill'],
|
||||
shape=geometric_data, color=(self.app.options["global_draw_color"]),
|
||||
# face_color=self.app.options['global_alt_sel_fill'],
|
||||
update=False, layer=0, tolerance=None
|
||||
)
|
||||
except TypeError:
|
||||
@@ -5525,8 +5525,8 @@ class AppGerberEditor(QtCore.QObject):
|
||||
# Add the new utility shape
|
||||
self.tool_shape.add(
|
||||
shape=geometric_data,
|
||||
color=(self.app.defaults["global_draw_color"]),
|
||||
# face_color=self.app.defaults['global_alt_sel_fill'],
|
||||
color=(self.app.options["global_draw_color"]),
|
||||
# face_color=self.app.options['global_alt_sel_fill'],
|
||||
update=False, layer=0, tolerance=None
|
||||
)
|
||||
|
||||
@@ -5553,11 +5553,11 @@ class AppGerberEditor(QtCore.QObject):
|
||||
|
||||
if elem in self.selected:
|
||||
self.plot_shape(geometry=geometric_data,
|
||||
color=self.app.defaults['global_sel_draw_color'] + 'FF',
|
||||
color=self.app.options['global_sel_draw_color'] + 'FF',
|
||||
linewidth=2)
|
||||
else:
|
||||
self.plot_shape(geometry=geometric_data,
|
||||
color=self.app.defaults['global_draw_color'][:-2] + 'FF')
|
||||
color=self.app.options['global_draw_color'][:-2] + 'FF')
|
||||
|
||||
if self.utility:
|
||||
for elem in self.utility:
|
||||
@@ -6001,7 +6001,7 @@ class AppGerberEditor(QtCore.QObject):
|
||||
|
||||
if text:
|
||||
self.ma_annotation.set(text=text, pos=position, visible=True,
|
||||
font_size=self.app.defaults["cncjob_annotation_fontsize"],
|
||||
font_size=self.app.options["cncjob_annotation_fontsize"],
|
||||
color='#000000FF')
|
||||
self.app.inform.emit('[success] %s' % _("Polygons marked."))
|
||||
else:
|
||||
@@ -7159,27 +7159,27 @@ class TransformEditorTool(AppTool):
|
||||
|
||||
def set_tool_ui(self):
|
||||
# Initialize form
|
||||
ref_val = self.app.defaults["tools_transform_reference"]
|
||||
ref_val = self.app.options["tools_transform_reference"]
|
||||
if ref_val == _("Object"):
|
||||
ref_val = _("Selection")
|
||||
self.ref_combo.set_value(ref_val)
|
||||
self.point_entry.set_value(self.app.defaults["tools_transform_ref_point"])
|
||||
self.rotate_entry.set_value(self.app.defaults["tools_transform_rotate"])
|
||||
self.point_entry.set_value(self.app.options["tools_transform_ref_point"])
|
||||
self.rotate_entry.set_value(self.app.options["tools_transform_rotate"])
|
||||
|
||||
self.skewx_entry.set_value(self.app.defaults["tools_transform_skew_x"])
|
||||
self.skewy_entry.set_value(self.app.defaults["tools_transform_skew_y"])
|
||||
self.skew_link_cb.set_value(self.app.defaults["tools_transform_skew_link"])
|
||||
self.skewx_entry.set_value(self.app.options["tools_transform_skew_x"])
|
||||
self.skewy_entry.set_value(self.app.options["tools_transform_skew_y"])
|
||||
self.skew_link_cb.set_value(self.app.options["tools_transform_skew_link"])
|
||||
|
||||
self.scalex_entry.set_value(self.app.defaults["tools_transform_scale_x"])
|
||||
self.scaley_entry.set_value(self.app.defaults["tools_transform_scale_y"])
|
||||
self.scale_link_cb.set_value(self.app.defaults["tools_transform_scale_link"])
|
||||
self.scalex_entry.set_value(self.app.options["tools_transform_scale_x"])
|
||||
self.scaley_entry.set_value(self.app.options["tools_transform_scale_y"])
|
||||
self.scale_link_cb.set_value(self.app.options["tools_transform_scale_link"])
|
||||
|
||||
self.offx_entry.set_value(self.app.defaults["tools_transform_offset_x"])
|
||||
self.offy_entry.set_value(self.app.defaults["tools_transform_offset_y"])
|
||||
self.offx_entry.set_value(self.app.options["tools_transform_offset_x"])
|
||||
self.offy_entry.set_value(self.app.options["tools_transform_offset_y"])
|
||||
|
||||
self.buffer_entry.set_value(self.app.defaults["tools_transform_buffer_dis"])
|
||||
self.buffer_factor_entry.set_value(self.app.defaults["tools_transform_buffer_factor"])
|
||||
self.buffer_rounded_cb.set_value(self.app.defaults["tools_transform_buffer_corner"])
|
||||
self.buffer_entry.set_value(self.app.options["tools_transform_buffer_dis"])
|
||||
self.buffer_factor_entry.set_value(self.app.options["tools_transform_buffer_factor"])
|
||||
self.buffer_rounded_cb.set_value(self.app.options["tools_transform_buffer_corner"])
|
||||
|
||||
# initial state is hidden
|
||||
self.point_label.hide()
|
||||
@@ -7603,10 +7603,10 @@ class TransformEditorTool(AppTool):
|
||||
else:
|
||||
if 'solid' in sel_el:
|
||||
sel_el['solid'] = sel_el['solid'].buffer(
|
||||
value, resolution=self.app.defaults["gerber_circle_steps"], join_style=join)
|
||||
value, resolution=self.app.options["gerber_circle_steps"], join_style=join)
|
||||
if 'clear' in sel_el:
|
||||
sel_el['clear'] = sel_el['clear'].buffer(
|
||||
value, resolution=self.app.defaults["gerber_circle_steps"], join_style=join)
|
||||
value, resolution=self.app.options["gerber_circle_steps"], join_style=join)
|
||||
|
||||
self.draw_app.plot_all()
|
||||
|
||||
@@ -7621,7 +7621,7 @@ class TransformEditorTool(AppTool):
|
||||
val_box = FCInputDoubleSpinner(title=_("Rotate ..."),
|
||||
text='%s:' % _('Enter an Angle Value (degrees)'),
|
||||
min=-359.9999, max=360.0000, decimals=self.decimals,
|
||||
init_val=float(self.app.defaults['tools_transform_rotate']),
|
||||
init_val=float(self.app.options['tools_transform_rotate']),
|
||||
parent=self.app.ui)
|
||||
val_box.set_icon(QtGui.QIcon(self.app.resource_location + '/rotate.png'))
|
||||
|
||||
@@ -7639,7 +7639,7 @@ class TransformEditorTool(AppTool):
|
||||
val_box = FCInputDoubleSpinner(title=_("Offset on X axis ..."),
|
||||
text='%s: (%s)' % (_('Enter a distance Value'), str(units)),
|
||||
min=-10000.0000, max=10000.0000, decimals=self.decimals,
|
||||
init_val=float(self.app.defaults['tools_transform_offset_x']),
|
||||
init_val=float(self.app.options['tools_transform_offset_x']),
|
||||
parent=self.app.ui)
|
||||
val_box.setWindowIcon(QtGui.QIcon(self.app.resource_location + '/offsetx32.png'))
|
||||
|
||||
@@ -7657,7 +7657,7 @@ class TransformEditorTool(AppTool):
|
||||
val_box = FCInputDoubleSpinner(title=_("Offset on Y axis ..."),
|
||||
text='%s: (%s)' % (_('Enter a distance Value'), str(units)),
|
||||
min=-10000.0000, max=10000.0000, decimals=self.decimals,
|
||||
init_val=float(self.app.defaults['tools_transform_offset_y']),
|
||||
init_val=float(self.app.options['tools_transform_offset_y']),
|
||||
parent=self.app.ui)
|
||||
val_box.set_icon(QtGui.QIcon(self.app.resource_location + '/offsety32.png'))
|
||||
|
||||
@@ -7673,7 +7673,7 @@ class TransformEditorTool(AppTool):
|
||||
val_box = FCInputDoubleSpinner(title=_("Skew on X axis ..."),
|
||||
text='%s:' % _('Enter an Angle Value (degrees)'),
|
||||
min=-359.9999, max=360.0000, decimals=self.decimals,
|
||||
init_val=float(self.app.defaults['tools_transform_skew_x']),
|
||||
init_val=float(self.app.options['tools_transform_skew_x']),
|
||||
parent=self.app.ui)
|
||||
val_box.setWindowIcon(QtGui.QIcon(self.app.resource_location + '/skewX.png'))
|
||||
|
||||
@@ -7689,7 +7689,7 @@ class TransformEditorTool(AppTool):
|
||||
val_box = FCInputDoubleSpinner(title=_("Skew on Y axis ..."),
|
||||
text='%s:' % _('Enter an Angle Value (degrees)'),
|
||||
min=-359.9999, max=360.0000, decimals=self.decimals,
|
||||
init_val=float(self.app.defaults['tools_transform_skew_y']),
|
||||
init_val=float(self.app.options['tools_transform_skew_y']),
|
||||
parent=self.app.ui)
|
||||
val_box.setWindowIcon(QtGui.QIcon(self.app.resource_location + '/skewY.png'))
|
||||
|
||||
|
||||
@@ -253,7 +253,7 @@ class AppTextEditor(QtWidgets.QWidget):
|
||||
try:
|
||||
filename = str(FCFileSaveDialog.get_saved_filename(
|
||||
caption=_("Export Code ..."),
|
||||
directory=self.app.defaults["global_last_folder"] + '/' + str(obj_name),
|
||||
directory=self.app.options["global_last_folder"] + '/' + str(obj_name),
|
||||
ext_filter=_filter_
|
||||
)[0])
|
||||
except TypeError:
|
||||
@@ -269,8 +269,8 @@ class AppTextEditor(QtWidgets.QWidget):
|
||||
my_gcode = self.code_editor.toPlainText()
|
||||
if filename.rpartition('.')[2].lower() == 'pdf':
|
||||
page_size = (
|
||||
self.app.plotcanvas.pagesize_dict[self.app.defaults['global_workspaceT']][0] * mm,
|
||||
self.app.plotcanvas.pagesize_dict[self.app.defaults['global_workspaceT']][1] * mm
|
||||
self.app.plotcanvas.pagesize_dict[self.app.options['global_workspaceT']][0] * mm,
|
||||
self.app.plotcanvas.pagesize_dict[self.app.options['global_workspaceT']][1] * mm
|
||||
)
|
||||
|
||||
# add new line after each line
|
||||
@@ -282,15 +282,15 @@ class AppTextEditor(QtWidgets.QWidget):
|
||||
story = []
|
||||
|
||||
if self.app.app_units.lower() == 'mm':
|
||||
bmargin = self.app.defaults['global_tpdf_bmargin'] * mm
|
||||
tmargin = self.app.defaults['global_tpdf_tmargin'] * mm
|
||||
rmargin = self.app.defaults['global_tpdf_rmargin'] * mm
|
||||
lmargin = self.app.defaults['global_tpdf_lmargin'] * mm
|
||||
bmargin = self.app.options['global_tpdf_bmargin'] * mm
|
||||
tmargin = self.app.options['global_tpdf_tmargin'] * mm
|
||||
rmargin = self.app.options['global_tpdf_rmargin'] * mm
|
||||
lmargin = self.app.options['global_tpdf_lmargin'] * mm
|
||||
else:
|
||||
bmargin = self.app.defaults['global_tpdf_bmargin'] * inch
|
||||
tmargin = self.app.defaults['global_tpdf_tmargin'] * inch
|
||||
rmargin = self.app.defaults['global_tpdf_rmargin'] * inch
|
||||
lmargin = self.app.defaults['global_tpdf_lmargin'] * inch
|
||||
bmargin = self.app.options['global_tpdf_bmargin'] * inch
|
||||
tmargin = self.app.options['global_tpdf_tmargin'] * inch
|
||||
rmargin = self.app.options['global_tpdf_rmargin'] * inch
|
||||
lmargin = self.app.options['global_tpdf_lmargin'] * inch
|
||||
|
||||
doc = SimpleDocTemplate(
|
||||
filename,
|
||||
@@ -322,7 +322,7 @@ class AppTextEditor(QtWidgets.QWidget):
|
||||
return
|
||||
|
||||
# Just for adding it to the recent files list.
|
||||
if self.app.defaults["global_open_style"] is False:
|
||||
if self.app.options["global_open_style"] is False:
|
||||
self.app.file_opened.emit("cncjob", filename)
|
||||
self.app.file_saved.emit("cncjob", filename)
|
||||
self.app.inform.emit('%s: %s' % (_("Saved to"), str(filename)))
|
||||
|
||||
@@ -104,8 +104,8 @@ class AppGCodeEditor(QtCore.QObject):
|
||||
# #############################################################################################################
|
||||
# #############################################################################################################
|
||||
|
||||
self.ui.append_text.set_value(self.app.defaults["cncjob_append"])
|
||||
self.ui.prepend_text.set_value(self.app.defaults["cncjob_prepend"])
|
||||
self.ui.append_text.set_value(self.app.options["cncjob_append"])
|
||||
self.ui.prepend_text.set_value(self.app.options["cncjob_prepend"])
|
||||
|
||||
# Remove anything else in the GUI Properties Tab
|
||||
self.app.ui.properties_scroll_area.takeWidget()
|
||||
@@ -121,7 +121,7 @@ class AppGCodeEditor(QtCore.QObject):
|
||||
self.activate()
|
||||
|
||||
# Show/Hide Advanced Options
|
||||
app_mode = self.app.defaults["global_app_level"]
|
||||
app_mode = self.app.options["global_app_level"]
|
||||
self.change_level(app_mode)
|
||||
|
||||
def build_ui(self):
|
||||
|
||||
Reference in New Issue
Block a user