- working to differentiate between temporary units change and permanent units change

This commit is contained in:
Marius Stanciu
2021-09-27 17:28:54 +03:00
committed by Marius
parent 89426e8ac3
commit 3fc0ab826f
50 changed files with 185 additions and 186 deletions

View File

@@ -1745,7 +1745,7 @@ class AppExcEditor(QtCore.QObject):
self.app = app
self.canvas = self.app.plotcanvas
self.units = self.app.defaults['units'].upper()
self.units = self.app.app_units.upper()
self.dec_format = self.app.dec_format
@@ -1961,7 +1961,7 @@ class AppExcEditor(QtCore.QObject):
def set_editor_ui(self):
# updated units
self.units = self.app.defaults['units'].upper()
self.units = self.app.app_units.upper()
self.olddia_newdia.clear()
self.tool2tooldia.clear()
@@ -2041,7 +2041,7 @@ class AppExcEditor(QtCore.QObject):
pass
# updated units
self.units = self.app.defaults['units'].upper()
self.units = self.app.app_units.upper()
# make a new name for the new Excellon object (the one with edited content)
self.edited_obj_name = self.edited_obj.options['name']
@@ -3439,7 +3439,7 @@ class AppExcEditor(QtCore.QObject):
# "%.4f    " % (self.app.dx, self.app.dy))
self.app.ui.update_location_labels(self.app.dx, self.app.dy, x, y)
units = self.app.defaults["units"].lower()
units = self.app.app_units.lower()
# self.app.plotcanvas.text_hud.text = \
# 'Dx:\t{:<.4f} [{:s}]\nDy:\t{:<.4f} [{:s}]\n\nX: \t{:<.4f} [{:s}]\nY: \t{:<.4f} [{:s}]'.format(
# self.app.dx, units, self.app.dy, units, x, units, y, units)
@@ -3971,7 +3971,7 @@ class AppExcEditorUI:
self.decimals = self.app.decimals
# ## Current application units in Upper Case
self.units = self.app.defaults['units'].upper()
self.units = self.app.app_units.upper()
self.exc_edit_widget = QtWidgets.QWidget()
# ## Box for custom widgets

View File

@@ -437,7 +437,7 @@ class TextInputTool(AppTool):
self.text_path = self.f_parse.font_to_geometry(char_string=string_to_geo, font_name=self.font_name,
font_size=font_to_geo_size,
font_type=font_to_geo_type,
units=self.app.defaults['units'].upper())
units=self.app.app_units.upper())
def font_family(self, font):
self.text_input_entry.selectAll()
@@ -1581,7 +1581,7 @@ class TransformEditorTool(AppTool):
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Rotate cancelled"))
def on_offx_key(self):
units = self.app.defaults['units'].lower()
units = self.app.app_units.lower()
val_box = FCInputDoubleSpinner(title=_("Offset on X axis ..."),
text='%s: (%s)' % (_('Enter a distance Value'), str(units)),
@@ -1599,7 +1599,7 @@ class TransformEditorTool(AppTool):
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Offset X cancelled"))
def on_offy_key(self):
units = self.app.defaults['units'].lower()
units = self.app.app_units.lower()
val_box = FCInputDoubleSpinner(title=_("Offset on Y axis ..."),
text='%s: (%s)' % (_('Enter a distance Value'), str(units)),
@@ -3401,7 +3401,7 @@ class AppGeoEditor(QtCore.QObject):
self.app = app
self.canvas = app.plotcanvas
self.decimals = app.decimals
self.units = self.app.defaults['units']
self.units = self.app.app_units
# when True the Editor can't do selection due of an ongoing process
self.interdict_selection = False
@@ -3889,7 +3889,7 @@ class AppGeoEditor(QtCore.QObject):
def set_editor_ui(self):
# updated units
self.units = self.app.defaults['units'].upper()
self.units = self.app.app_units.upper()
self.decimals = self.app.decimals
# Remove anything else in the GUI Selected Tab
@@ -4788,7 +4788,7 @@ class AppGeoEditor(QtCore.QObject):
# "%.4f&nbsp;&nbsp;&nbsp;&nbsp;" % (self.app.dx, self.app.dy))
self.app.ui.update_location_labels(self.app.dx, self.app.dy, x, y)
units = self.app.defaults["units"].lower()
units = self.app.app_units.lower()
# self.app.plotcanvas.text_hud.text = \
# 'Dx:\t{:<.4f} [{:s}]\nDy:\t{:<.4f} [{:s}]\n\nX: \t{:<.4f} [{:s}]\nY: \t{:<.4f} [{:s}]'.format(
# self.app.dx, units, self.app.dy, units, x, units, y, units)
@@ -5314,7 +5314,7 @@ class AppGeoEditor(QtCore.QObject):
self.set_editor_ui()
self.units = self.app.defaults['units']
self.units = self.app.app_units
# Hide original geometry
self.fcgeometry = fcgeometry
@@ -5367,7 +5367,7 @@ class AppGeoEditor(QtCore.QObject):
editor_obj.plot_all()
# updated units
editor_obj.units = self.app.defaults['units'].upper()
editor_obj.units = self.app.app_units.upper()
editor_obj.decimals = self.app.decimals
# start with GRID toolbar activated

View File

@@ -3254,7 +3254,7 @@ class AppGerberEditor(QtCore.QObject):
self.decimals = self.app.decimals
# Current application units in Upper Case
self.units = self.app.defaults['units'].upper()
self.units = self.app.app_units.upper()
self.ui = AppGerberEditorUI(self.app)
@@ -3504,7 +3504,7 @@ class AppGerberEditor(QtCore.QObject):
def set_editor_ui(self):
# updated units
self.units = self.app.defaults['units'].upper()
self.units = self.app.app_units.upper()
self.decimals = self.app.decimals
self.oldapcode_newapcode.clear()
@@ -3576,7 +3576,7 @@ class AppGerberEditor(QtCore.QObject):
pass
# updated units
self.units = self.app.defaults['units'].upper()
self.units = self.app.app_units.upper()
# make a new name for the new Excellon object (the one with edited content)
self.edited_obj_name = self.gerber_obj.options['name']
@@ -4536,7 +4536,7 @@ class AppGerberEditor(QtCore.QObject):
self.gerber_obj_options = orig_grb_obj.options
file_units = self.gerber_obj.units if self.gerber_obj.units else 'IN'
app_units = self.app.defaults['units']
app_units = self.app.app_units
# self.conversion_factor = 25.4 if file_units == 'IN' else (1 / 25.4) if file_units != app_units else 1
if file_units == app_units:
@@ -4923,7 +4923,7 @@ class AppGerberEditor(QtCore.QObject):
grb_obj.multigeo = False
grb_obj.follow = False
grb_obj.units = app_obj.defaults['units']
grb_obj.units = app_obj.app_units
try:
grb_obj.create_geometry()
@@ -5435,7 +5435,7 @@ class AppGerberEditor(QtCore.QObject):
# "%.4f&nbsp;&nbsp;&nbsp;&nbsp;" % (self.app.dx, self.app.dy))
self.app.ui.update_location_labels(self.app.dx, self.app.dy, x, y)
units = self.app.defaults["units"].lower()
units = self.app.app_units.lower()
# self.app.plotcanvas.text_hud.text = \
# 'Dx:\t{:<.4f} [{:s}]\nDy:\t{:<.4f} [{:s}]\n\nX: \t{:<.4f} [{:s}]\nY: \t{:<.4f} [{:s}]'.format(
# self.app.dx, units, self.app.dy, units, x, units, y, units)
@@ -5937,7 +5937,7 @@ class AppGerberEditor(QtCore.QObject):
# clear previous marking
self.ma_annotation.clear(update=True)
self.units = self.app.defaults['units'].upper()
self.units = self.app.app_units.upper()
text = []
position = []
@@ -6015,7 +6015,7 @@ class AppGerberEditorUI:
self.decimals = self.app.decimals
# ## Current application units in Upper Case
self.units = self.app.defaults['units'].upper()
self.units = self.app.app_units.upper()
self.grb_edit_widget = QtWidgets.QWidget()
@@ -7599,7 +7599,7 @@ class TransformEditorTool(AppTool):
self.app.inform.emit('[WARNING_NOTCL] %s...' % _("Rotate cancelled"))
def on_offx_key(self):
units = self.app.defaults['units'].lower()
units = self.app.app_units.lower()
val_box = FCInputDoubleSpinner(title=_("Offset on X axis ..."),
text='%s: (%s)' % (_('Enter a distance Value'), str(units)),
@@ -7617,7 +7617,7 @@ class TransformEditorTool(AppTool):
self.app.inform.emit('[WARNING_NOTCL] %s...' % _("Offset X cancelled"))
def on_offy_key(self):
units = self.app.defaults['units'].lower()
units = self.app.app_units.lower()
val_box = FCInputDoubleSpinner(title=_("Offset on Y axis ..."),
text='%s: (%s)' % (_('Enter a distance Value'), str(units)),

View File

@@ -278,7 +278,7 @@ class AppTextEditor(QtWidgets.QWidget):
# styleH = styles['Heading1']
story = []
if self.app.defaults['units'].lower() == 'mm':
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

View File

@@ -728,7 +728,7 @@ class AppGCodeEditorUI:
self.decimals = self.app.decimals
# ## Current application units in Upper Case
self.units = self.app.defaults['units'].upper()
self.units = self.app.app_units.upper()
# self.setSizePolicy(
# QtWidgets.QSizePolicy.Policy.MinimumExpanding,