- fixed the annotation plotting in the CNCJob object
- created a new InputDialog widget that has the buttons and the context menu translated and replaced the old widget throughout the app - updated the translation strings
This commit is contained in:
parent
a4c8737ab7
commit
d4fec5ae60
|
@ -7,6 +7,12 @@ CHANGELOG for FlatCAM beta
|
||||||
|
|
||||||
=================================================
|
=================================================
|
||||||
|
|
||||||
|
5.11.2020
|
||||||
|
|
||||||
|
- fixed the annotation plotting in the CNCJob object
|
||||||
|
- created a new InputDialog widget that has the buttons and the context menu translated and replaced the old widget throughout the app
|
||||||
|
- updated the translation strings
|
||||||
|
|
||||||
4.11.2020
|
4.11.2020
|
||||||
|
|
||||||
- updated all the translation files
|
- updated all the translation files
|
||||||
|
|
|
@ -17,7 +17,7 @@ from PyQt5.QtCore import Qt
|
||||||
from camlib import distance, arc, three_point_circle, Geometry, FlatCAMRTreeStorage
|
from camlib import distance, arc, three_point_circle, Geometry, FlatCAMRTreeStorage
|
||||||
from appTool import AppTool
|
from appTool import AppTool
|
||||||
from appGUI.GUIElements import OptionalInputSection, FCCheckBox, FCLabel, FCComboBox, FCTextAreaRich, \
|
from appGUI.GUIElements import OptionalInputSection, FCCheckBox, FCLabel, FCComboBox, FCTextAreaRich, \
|
||||||
FCDoubleSpinner, FCButton, FCInputDialog, FCTree, NumericalEvalTupleEntry
|
FCDoubleSpinner, FCButton, FCInputDoubleSpinner, FCTree, NumericalEvalTupleEntry
|
||||||
from appParsers.ParseFont import *
|
from appParsers.ParseFont import *
|
||||||
|
|
||||||
from shapely.geometry import LineString, LinearRing, MultiLineString, Polygon, MultiPolygon, Point
|
from shapely.geometry import LineString, LinearRing, MultiLineString, Polygon, MultiPolygon, Point
|
||||||
|
@ -1445,12 +1445,12 @@ class TransformEditorTool(AppTool):
|
||||||
return
|
return
|
||||||
|
|
||||||
def on_rotate_key(self):
|
def on_rotate_key(self):
|
||||||
val_box = FCInputDialog(title=_("Rotate ..."),
|
val_box = FCInputDoubleSpinner(title=_("Rotate ..."),
|
||||||
text='%s:' % _('Enter an Angle Value (degrees)'),
|
text='%s:' % _('Enter an Angle Value (degrees)'),
|
||||||
min=-359.9999, max=360.0000, decimals=self.decimals,
|
min=-359.9999, max=360.0000, decimals=self.decimals,
|
||||||
init_val=float(self.app.defaults['tools_transform_rotate']),
|
init_val=float(self.app.defaults['tools_transform_rotate']),
|
||||||
parent=self.app.ui)
|
parent=self.app.ui)
|
||||||
val_box.setWindowIcon(QtGui.QIcon(self.app.resource_location + '/rotate.png'))
|
val_box.set_icon(QtGui.QIcon(self.app.resource_location + '/rotate.png'))
|
||||||
|
|
||||||
val, ok = val_box.get_value()
|
val, ok = val_box.get_value()
|
||||||
if ok:
|
if ok:
|
||||||
|
@ -1463,12 +1463,12 @@ class TransformEditorTool(AppTool):
|
||||||
def on_offx_key(self):
|
def on_offx_key(self):
|
||||||
units = self.app.defaults['units'].lower()
|
units = self.app.defaults['units'].lower()
|
||||||
|
|
||||||
val_box = FCInputDialog(title=_("Offset on X axis ..."),
|
val_box = FCInputDoubleSpinner(title=_("Offset on X axis ..."),
|
||||||
text='%s: (%s)' % (_('Enter a distance Value'), str(units)),
|
text='%s: (%s)' % (_('Enter a distance Value'), str(units)),
|
||||||
min=-10000.0000, max=10000.0000, decimals=self.decimals,
|
min=-10000.0000, max=10000.0000, decimals=self.decimals,
|
||||||
init_val=float(self.app.defaults['tools_transform_offset_x']),
|
init_val=float(self.app.defaults['tools_transform_offset_x']),
|
||||||
parent=self.app.ui)
|
parent=self.app.ui)
|
||||||
val_box.setWindowIcon(QtGui.QIcon(self.app.resource_location + '/offsetx32.png'))
|
val_box.set_icon(QtGui.QIcon(self.app.resource_location + '/offsetx32.png'))
|
||||||
|
|
||||||
val, ok = val_box.get_value()
|
val, ok = val_box.get_value()
|
||||||
if ok:
|
if ok:
|
||||||
|
@ -1481,12 +1481,12 @@ class TransformEditorTool(AppTool):
|
||||||
def on_offy_key(self):
|
def on_offy_key(self):
|
||||||
units = self.app.defaults['units'].lower()
|
units = self.app.defaults['units'].lower()
|
||||||
|
|
||||||
val_box = FCInputDialog(title=_("Offset on Y axis ..."),
|
val_box = FCInputDoubleSpinner(title=_("Offset on Y axis ..."),
|
||||||
text='%s: (%s)' % (_('Enter a distance Value'), str(units)),
|
text='%s: (%s)' % (_('Enter a distance Value'), str(units)),
|
||||||
min=-10000.0000, max=10000.0000, decimals=self.decimals,
|
min=-10000.0000, max=10000.0000, decimals=self.decimals,
|
||||||
init_val=float(self.app.defaults['tools_transform_offset_y']),
|
init_val=float(self.app.defaults['tools_transform_offset_y']),
|
||||||
parent=self.app.ui)
|
parent=self.app.ui)
|
||||||
val_box.setWindowIcon(QtGui.QIcon(self.app.resource_location + '/offsety32.png'))
|
val_box.set_icon(QtGui.QIcon(self.app.resource_location + '/offsety32.png'))
|
||||||
|
|
||||||
val, ok = val_box.get_value()
|
val, ok = val_box.get_value()
|
||||||
if ok:
|
if ok:
|
||||||
|
@ -1497,12 +1497,12 @@ class TransformEditorTool(AppTool):
|
||||||
self.app.inform.emit('[success] %s...' % _("Offset on the Y axis canceled"))
|
self.app.inform.emit('[success] %s...' % _("Offset on the Y axis canceled"))
|
||||||
|
|
||||||
def on_skewx_key(self):
|
def on_skewx_key(self):
|
||||||
val_box = FCInputDialog(title=_("Skew on X axis ..."),
|
val_box = FCInputDoubleSpinner(title=_("Skew on X axis ..."),
|
||||||
text='%s:' % _('Enter an Angle Value (degrees)'),
|
text='%s:' % _('Enter an Angle Value (degrees)'),
|
||||||
min=-359.9999, max=360.0000, decimals=self.decimals,
|
min=-359.9999, max=360.0000, decimals=self.decimals,
|
||||||
init_val=float(self.app.defaults['tools_transform_skew_x']),
|
init_val=float(self.app.defaults['tools_transform_skew_x']),
|
||||||
parent=self.app.ui)
|
parent=self.app.ui)
|
||||||
val_box.setWindowIcon(QtGui.QIcon(self.app.resource_location + '/skewX.png'))
|
val_box.set_icon(QtGui.QIcon(self.app.resource_location + '/skewX.png'))
|
||||||
|
|
||||||
val, ok = val_box.get_value()
|
val, ok = val_box.get_value()
|
||||||
if ok:
|
if ok:
|
||||||
|
@ -1513,12 +1513,12 @@ class TransformEditorTool(AppTool):
|
||||||
self.app.inform.emit('[success] %s...' % _("Skew on X axis canceled"))
|
self.app.inform.emit('[success] %s...' % _("Skew on X axis canceled"))
|
||||||
|
|
||||||
def on_skewy_key(self):
|
def on_skewy_key(self):
|
||||||
val_box = FCInputDialog(title=_("Skew on Y axis ..."),
|
val_box = FCInputDoubleSpinner(title=_("Skew on Y axis ..."),
|
||||||
text='%s:' % _('Enter an Angle Value (degrees)'),
|
text='%s:' % _('Enter an Angle Value (degrees)'),
|
||||||
min=-359.9999, max=360.0000, decimals=self.decimals,
|
min=-359.9999, max=360.0000, decimals=self.decimals,
|
||||||
init_val=float(self.app.defaults['tools_transform_skew_y']),
|
init_val=float(self.app.defaults['tools_transform_skew_y']),
|
||||||
parent=self.app.ui)
|
parent=self.app.ui)
|
||||||
val_box.setWindowIcon(QtGui.QIcon(self.app.resource_location + '/skewY.png'))
|
val_box.set_icon(QtGui.QIcon(self.app.resource_location + '/skewY.png'))
|
||||||
|
|
||||||
val, ok = val_box.get_value()
|
val, ok = val_box.get_value()
|
||||||
if ok:
|
if ok:
|
||||||
|
|
|
@ -19,7 +19,7 @@ import logging
|
||||||
|
|
||||||
from camlib import distance, arc, three_point_circle
|
from camlib import distance, arc, three_point_circle
|
||||||
from appGUI.GUIElements import FCEntry, FCComboBox, FCTable, FCDoubleSpinner, FCSpinner, RadioSet, EvalEntry2, \
|
from appGUI.GUIElements import FCEntry, FCComboBox, FCTable, FCDoubleSpinner, FCSpinner, RadioSet, EvalEntry2, \
|
||||||
FCInputDialog, FCButton, OptionalInputSection, FCCheckBox, NumericalEvalTupleEntry, FCComboBox2, FCLabel
|
FCInputDoubleSpinner, FCButton, OptionalInputSection, FCCheckBox, NumericalEvalTupleEntry, FCComboBox2, FCLabel
|
||||||
from appTool import AppTool
|
from appTool import AppTool
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
@ -6348,12 +6348,12 @@ class TransformEditorTool(AppTool):
|
||||||
return
|
return
|
||||||
|
|
||||||
def on_rotate_key(self):
|
def on_rotate_key(self):
|
||||||
val_box = FCInputDialog(title=_("Rotate ..."),
|
val_box = FCInputDoubleSpinner(title=_("Rotate ..."),
|
||||||
text='%s:' % _('Enter an Angle Value (degrees)'),
|
text='%s:' % _('Enter an Angle Value (degrees)'),
|
||||||
min=-359.9999, max=360.0000, decimals=self.decimals,
|
min=-359.9999, max=360.0000, decimals=self.decimals,
|
||||||
init_val=float(self.app.defaults['tools_transform_rotate']),
|
init_val=float(self.app.defaults['tools_transform_rotate']),
|
||||||
parent=self.app.ui)
|
parent=self.app.ui)
|
||||||
val_box.setWindowIcon(QtGui.QIcon(self.app.resource_location + '/rotate.png'))
|
val_box.set_icon(QtGui.QIcon(self.app.resource_location + '/rotate.png'))
|
||||||
|
|
||||||
val, ok = val_box.get_value()
|
val, ok = val_box.get_value()
|
||||||
if ok:
|
if ok:
|
||||||
|
@ -6366,11 +6366,11 @@ class TransformEditorTool(AppTool):
|
||||||
def on_offx_key(self):
|
def on_offx_key(self):
|
||||||
units = self.app.defaults['units'].lower()
|
units = self.app.defaults['units'].lower()
|
||||||
|
|
||||||
val_box = FCInputDialog(title=_("Offset on X axis ..."),
|
val_box = FCInputDoubleSpinner(title=_("Offset on X axis ..."),
|
||||||
text='%s: (%s)' % (_('Enter a distance Value'), str(units)),
|
text='%s: (%s)' % (_('Enter a distance Value'), str(units)),
|
||||||
min=-10000.0000, max=10000.0000, decimals=self.decimals,
|
min=-10000.0000, max=10000.0000, decimals=self.decimals,
|
||||||
init_val=float(self.app.defaults['tools_transform_offset_x']),
|
init_val=float(self.app.defaults['tools_transform_offset_x']),
|
||||||
parent=self.app.ui)
|
parent=self.app.ui)
|
||||||
val_box.setWindowIcon(QtGui.QIcon(self.app.resource_location + '/offsetx32.png'))
|
val_box.setWindowIcon(QtGui.QIcon(self.app.resource_location + '/offsetx32.png'))
|
||||||
|
|
||||||
val, ok = val_box.get_value()
|
val, ok = val_box.get_value()
|
||||||
|
@ -6384,12 +6384,12 @@ class TransformEditorTool(AppTool):
|
||||||
def on_offy_key(self):
|
def on_offy_key(self):
|
||||||
units = self.app.defaults['units'].lower()
|
units = self.app.defaults['units'].lower()
|
||||||
|
|
||||||
val_box = FCInputDialog(title=_("Offset on Y axis ..."),
|
val_box = FCInputDoubleSpinner(title=_("Offset on Y axis ..."),
|
||||||
text='%s: (%s)' % (_('Enter a distance Value'), str(units)),
|
text='%s: (%s)' % (_('Enter a distance Value'), str(units)),
|
||||||
min=-10000.0000, max=10000.0000, decimals=self.decimals,
|
min=-10000.0000, max=10000.0000, decimals=self.decimals,
|
||||||
init_val=float(self.app.defaults['tools_transform_offset_y']),
|
init_val=float(self.app.defaults['tools_transform_offset_y']),
|
||||||
parent=self.app.ui)
|
parent=self.app.ui)
|
||||||
val_box.setWindowIcon(QtGui.QIcon(self.app.resource_location + '/offsety32.png'))
|
val_box.set_icon(QtGui.QIcon(self.app.resource_location + '/offsety32.png'))
|
||||||
|
|
||||||
val, ok = val_box.get_value()
|
val, ok = val_box.get_value()
|
||||||
if ok:
|
if ok:
|
||||||
|
@ -6400,11 +6400,11 @@ class TransformEditorTool(AppTool):
|
||||||
self.app.inform.emit('[WARNING_NOTCL] %s...' % _("Offset Y cancelled"))
|
self.app.inform.emit('[WARNING_NOTCL] %s...' % _("Offset Y cancelled"))
|
||||||
|
|
||||||
def on_skewx_key(self):
|
def on_skewx_key(self):
|
||||||
val_box = FCInputDialog(title=_("Skew on X axis ..."),
|
val_box = FCInputDoubleSpinner(title=_("Skew on X axis ..."),
|
||||||
text='%s:' % _('Enter an Angle Value (degrees)'),
|
text='%s:' % _('Enter an Angle Value (degrees)'),
|
||||||
min=-359.9999, max=360.0000, decimals=self.decimals,
|
min=-359.9999, max=360.0000, decimals=self.decimals,
|
||||||
init_val=float(self.app.defaults['tools_transform_skew_x']),
|
init_val=float(self.app.defaults['tools_transform_skew_x']),
|
||||||
parent=self.app.ui)
|
parent=self.app.ui)
|
||||||
val_box.setWindowIcon(QtGui.QIcon(self.app.resource_location + '/skewX.png'))
|
val_box.setWindowIcon(QtGui.QIcon(self.app.resource_location + '/skewX.png'))
|
||||||
|
|
||||||
val, ok = val_box.get_value()
|
val, ok = val_box.get_value()
|
||||||
|
@ -6416,11 +6416,11 @@ class TransformEditorTool(AppTool):
|
||||||
self.app.inform.emit('[WARNING_NOTCL] %s...' % _("Skew X cancelled"))
|
self.app.inform.emit('[WARNING_NOTCL] %s...' % _("Skew X cancelled"))
|
||||||
|
|
||||||
def on_skewy_key(self):
|
def on_skewy_key(self):
|
||||||
val_box = FCInputDialog(title=_("Skew on Y axis ..."),
|
val_box = FCInputDoubleSpinner(title=_("Skew on Y axis ..."),
|
||||||
text='%s:' % _('Enter an Angle Value (degrees)'),
|
text='%s:' % _('Enter an Angle Value (degrees)'),
|
||||||
min=-359.9999, max=360.0000, decimals=self.decimals,
|
min=-359.9999, max=360.0000, decimals=self.decimals,
|
||||||
init_val=float(self.app.defaults['tools_transform_skew_y']),
|
init_val=float(self.app.defaults['tools_transform_skew_y']),
|
||||||
parent=self.app.ui)
|
parent=self.app.ui)
|
||||||
val_box.setWindowIcon(QtGui.QIcon(self.app.resource_location + '/skewY.png'))
|
val_box.setWindowIcon(QtGui.QIcon(self.app.resource_location + '/skewY.png'))
|
||||||
|
|
||||||
val, ok = val_box.get_value()
|
val, ok = val_box.get_value()
|
||||||
|
|
|
@ -2220,6 +2220,84 @@ class FCInputDialog(QtWidgets.QInputDialog):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class FCInputDoubleSpinner(QtWidgets.QDialog):
|
||||||
|
def __init__(self, parent=None, title=None, text=None,
|
||||||
|
min=0.0, max=100.0000, step=1, decimals=4, init_val=None):
|
||||||
|
super(FCInputDoubleSpinner, self).__init__(parent)
|
||||||
|
|
||||||
|
self.val = 0.0
|
||||||
|
|
||||||
|
self.init_value = init_val if init_val else 0.0
|
||||||
|
|
||||||
|
self.setWindowTitle(title) if title else self.setWindowTitle('title')
|
||||||
|
self.text = text if text else 'text'
|
||||||
|
|
||||||
|
self.min = min
|
||||||
|
self.max = max
|
||||||
|
self.step = step
|
||||||
|
self.decimals = decimals
|
||||||
|
|
||||||
|
self.lbl = FCLabel(self.text)
|
||||||
|
|
||||||
|
if title is None:
|
||||||
|
self.title = 'title'
|
||||||
|
else:
|
||||||
|
self.title = title
|
||||||
|
if text is None:
|
||||||
|
self.text = 'text'
|
||||||
|
else:
|
||||||
|
self.text = text
|
||||||
|
|
||||||
|
self.wdg = FCDoubleSpinner()
|
||||||
|
self.wdg.set_value(self.init_value)
|
||||||
|
|
||||||
|
QBtn = QtWidgets.QDialogButtonBox.Ok | QtWidgets.QDialogButtonBox.Cancel
|
||||||
|
|
||||||
|
self.buttonBox = QtWidgets.QDialogButtonBox(QBtn)
|
||||||
|
self.buttonBox.accepted.connect(self.accept)
|
||||||
|
self.buttonBox.rejected.connect(self.reject)
|
||||||
|
|
||||||
|
self.layout = QtWidgets.QVBoxLayout()
|
||||||
|
self.layout.addWidget(self.lbl)
|
||||||
|
self.layout.addWidget(self.wdg)
|
||||||
|
self.layout.addWidget(self.buttonBox)
|
||||||
|
|
||||||
|
self.buttonBox.button(QtWidgets.QDialogButtonBox.Ok).setText(_("Ok"))
|
||||||
|
self.buttonBox.button(QtWidgets.QDialogButtonBox.Cancel).setText(_("Cancel"))
|
||||||
|
|
||||||
|
self.setLayout(self.layout)
|
||||||
|
|
||||||
|
def set_title(self, txt):
|
||||||
|
self.setWindowTitle(txt)
|
||||||
|
|
||||||
|
def set_text(self, txt):
|
||||||
|
self.lbl.set_value(txt)
|
||||||
|
|
||||||
|
def set_icon(self, icon):
|
||||||
|
self.setWindowIcon(icon)
|
||||||
|
|
||||||
|
def set_min(self, val):
|
||||||
|
self.wdg.setMinimum(val)
|
||||||
|
|
||||||
|
def set_max(self, val):
|
||||||
|
self.wdg.setMaximum(val)
|
||||||
|
|
||||||
|
def set_range(self, min, max):
|
||||||
|
self.wdg.set_range(min, max)
|
||||||
|
|
||||||
|
def set_step(self, val):
|
||||||
|
self.wdg.set_step(val)
|
||||||
|
|
||||||
|
def set_value(self, val):
|
||||||
|
self.wdg.set_value(val)
|
||||||
|
|
||||||
|
def get_value(self):
|
||||||
|
if self.exec_() == QtWidgets.QDialog.Accepted:
|
||||||
|
return self.wdg.get_value(), True
|
||||||
|
else:
|
||||||
|
return None, False
|
||||||
|
|
||||||
|
|
||||||
class FCInputSpinner(QtWidgets.QDialog):
|
class FCInputSpinner(QtWidgets.QDialog):
|
||||||
def __init__(self, parent=None, title=None, text=None, min=None, max=None, decimals=4, step=1, init_val=None):
|
def __init__(self, parent=None, title=None, text=None, min=None, max=None, decimals=4, step=1, init_val=None):
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
|
@ -2253,6 +2331,9 @@ class FCInputSpinner(QtWidgets.QDialog):
|
||||||
self.buttonBox.accepted.connect(self.accept)
|
self.buttonBox.accepted.connect(self.accept)
|
||||||
self.buttonBox.rejected.connect(self.reject)
|
self.buttonBox.rejected.connect(self.reject)
|
||||||
|
|
||||||
|
self.buttonBox.button(QtWidgets.QDialogButtonBox.Ok).setText(_("Ok"))
|
||||||
|
self.buttonBox.button(QtWidgets.QDialogButtonBox.Cancel).setText(_("Cancel"))
|
||||||
|
|
||||||
self.layout = QtWidgets.QVBoxLayout()
|
self.layout = QtWidgets.QVBoxLayout()
|
||||||
self.layout.addWidget(self.lbl)
|
self.layout.addWidget(self.lbl)
|
||||||
self.layout.addWidget(self.wdg)
|
self.layout.addWidget(self.wdg)
|
||||||
|
@ -2311,6 +2392,9 @@ class FCInputDialogSlider(QtWidgets.QDialog):
|
||||||
self.buttonBox.accepted.connect(self.accept)
|
self.buttonBox.accepted.connect(self.accept)
|
||||||
self.buttonBox.rejected.connect(self.reject)
|
self.buttonBox.rejected.connect(self.reject)
|
||||||
|
|
||||||
|
self.buttonBox.button(QtWidgets.QDialogButtonBox.Ok).setText(_("Ok"))
|
||||||
|
self.buttonBox.button(QtWidgets.QDialogButtonBox.Cancel).setText(_("Cancel"))
|
||||||
|
|
||||||
self.layout = QtWidgets.QVBoxLayout()
|
self.layout = QtWidgets.QVBoxLayout()
|
||||||
self.layout.addWidget(self.lbl)
|
self.layout.addWidget(self.lbl)
|
||||||
self.layout.addWidget(self.wdg)
|
self.layout.addWidget(self.wdg)
|
||||||
|
@ -2372,6 +2456,9 @@ class FCInputDialogSpinnerButton(QtWidgets.QDialog):
|
||||||
self.buttonBox.accepted.connect(self.accept)
|
self.buttonBox.accepted.connect(self.accept)
|
||||||
self.buttonBox.rejected.connect(self.reject)
|
self.buttonBox.rejected.connect(self.reject)
|
||||||
|
|
||||||
|
self.buttonBox.button(QtWidgets.QDialogButtonBox.Ok).setText(_("Ok"))
|
||||||
|
self.buttonBox.button(QtWidgets.QDialogButtonBox.Cancel).setText(_("Cancel"))
|
||||||
|
|
||||||
self.layout = QtWidgets.QVBoxLayout()
|
self.layout = QtWidgets.QVBoxLayout()
|
||||||
self.layout.addWidget(self.lbl)
|
self.layout.addWidget(self.lbl)
|
||||||
self.layout.addWidget(self.wdg)
|
self.layout.addWidget(self.wdg)
|
||||||
|
@ -2384,6 +2471,9 @@ class FCInputDialogSpinnerButton(QtWidgets.QDialog):
|
||||||
def set_text(self, txt):
|
def set_text(self, txt):
|
||||||
self.lbl.set_value(txt)
|
self.lbl.set_value(txt)
|
||||||
|
|
||||||
|
def set_icon(self, icon):
|
||||||
|
self.setWindowIcon(icon)
|
||||||
|
|
||||||
def set_min(self, val):
|
def set_min(self, val):
|
||||||
self.wdg.spinner.setMinimum(val)
|
self.wdg.spinner.setMinimum(val)
|
||||||
|
|
||||||
|
@ -3708,6 +3798,9 @@ class DialogBoxRadio(QtWidgets.QDialog):
|
||||||
orientation=Qt.Horizontal, parent=self)
|
orientation=Qt.Horizontal, parent=self)
|
||||||
self.form.addRow(self.button_box)
|
self.form.addRow(self.button_box)
|
||||||
|
|
||||||
|
self.button_box.button(QtWidgets.QDialogButtonBox.Ok).setText(_("Ok"))
|
||||||
|
self.button_box.button(QtWidgets.QDialogButtonBox.Cancel).setText(_("Cancel"))
|
||||||
|
|
||||||
self.button_box.accepted.connect(self.accept)
|
self.button_box.accepted.connect(self.accept)
|
||||||
self.button_box.rejected.connect(self.reject)
|
self.button_box.rejected.connect(self.reject)
|
||||||
|
|
||||||
|
|
|
@ -3646,10 +3646,10 @@ class MainGUI(QtWidgets.QMainWindow):
|
||||||
self.app.exc_editor.launched_from_shortcuts = True
|
self.app.exc_editor.launched_from_shortcuts = True
|
||||||
# ## Current application units in Upper Case
|
# ## Current application units in Upper Case
|
||||||
self.units = self.general_defaults_form.general_app_group.units_radio.get_value().upper()
|
self.units = self.general_defaults_form.general_app_group.units_radio.get_value().upper()
|
||||||
tool_add_popup = FCInputDialog(title='%s ...' % _("New Tool"),
|
tool_add_popup = FCInputDoubleSpinner(title='%s ...' % _("New Tool"),
|
||||||
text='%s:' % _('Enter a Tool Diameter'),
|
text='%s:' % _('Enter a Tool Diameter'),
|
||||||
min=0.0000, max=99.9999, decimals=4)
|
min=0.0000, max=99.9999, decimals=self.decimals)
|
||||||
tool_add_popup.setWindowIcon(QtGui.QIcon(self.app.resource_location + '/letter_t_32.png'))
|
tool_add_popup.set_icon(QtGui.QIcon(self.app.resource_location + '/letter_t_32.png'))
|
||||||
|
|
||||||
val, ok = tool_add_popup.get_value()
|
val, ok = tool_add_popup.get_value()
|
||||||
if ok:
|
if ok:
|
||||||
|
|
|
@ -2509,10 +2509,10 @@ class CNCJobObject(FlatCAMObj, CNCjob):
|
||||||
if self.app.is_legacy is False:
|
if self.app.is_legacy is False:
|
||||||
self.annotation.clear(update=True)
|
self.annotation.clear(update=True)
|
||||||
|
|
||||||
# Annotaions shapes plotting
|
# Annotations shapes plotting
|
||||||
try:
|
try:
|
||||||
if self.app.is_legacy is False:
|
if self.app.is_legacy is False:
|
||||||
if self.ui.annotation_cb.get_value() and self.ui.plot_cb.get_value():
|
if self.ui.annotation_cb.get_value() and visible:
|
||||||
self.plot_annotations(obj=self, visible=True)
|
self.plot_annotations(obj=self, visible=True)
|
||||||
else:
|
else:
|
||||||
self.plot_annotations(obj=self, visible=False)
|
self.plot_annotations(obj=self, visible=False)
|
||||||
|
@ -2521,20 +2521,28 @@ class CNCJobObject(FlatCAMObj, CNCjob):
|
||||||
if self.app.is_legacy is False:
|
if self.app.is_legacy is False:
|
||||||
self.annotation.clear(update=True)
|
self.annotation.clear(update=True)
|
||||||
|
|
||||||
def on_annotation_change(self):
|
def on_annotation_change(self, val):
|
||||||
"""
|
"""
|
||||||
Handler for toggling the annotation display by clicking a checkbox.
|
Handler for toggling the annotation display by clicking a checkbox.
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if self.app.is_legacy is False:
|
if self.app.is_legacy is False:
|
||||||
if self.ui.annotation_cb.get_value():
|
# self.text_col.visible = True if val == 2 else False
|
||||||
self.text_col.enabled = True
|
# self.plot(kind=self.ui.cncplot_method_combo.get_value())
|
||||||
else:
|
# Annotations shapes plotting
|
||||||
self.text_col.enabled = False
|
try:
|
||||||
# kind = self.ui.cncplot_method_combo.get_value()
|
if self.app.is_legacy is False:
|
||||||
# self.plot(kind=kind)
|
if val and self.ui.plot_cb.get_value():
|
||||||
self.annotation.redraw()
|
self.plot_annotations(obj=self, visible=True)
|
||||||
|
else:
|
||||||
|
self.plot_annotations(obj=self, visible=False)
|
||||||
|
|
||||||
|
except (ObjectDeleted, AttributeError):
|
||||||
|
if self.app.is_legacy is False:
|
||||||
|
self.annotation.clear(update=True)
|
||||||
|
|
||||||
|
# self.annotation.redraw()
|
||||||
else:
|
else:
|
||||||
kind = self.ui.cncplot_method_combo.get_value()
|
kind = self.ui.cncplot_method_combo.get_value()
|
||||||
self.plot(kind=kind)
|
self.plot(kind=kind)
|
||||||
|
|
|
@ -13,8 +13,8 @@ from copy import deepcopy
|
||||||
|
|
||||||
from appParsers.ParseGerber import Gerber
|
from appParsers.ParseGerber import Gerber
|
||||||
from camlib import Geometry, FlatCAMRTreeStorage, grace
|
from camlib import Geometry, FlatCAMRTreeStorage, grace
|
||||||
from appGUI.GUIElements import FCTable, FCDoubleSpinner, FCCheckBox, FCInputDialog, RadioSet, FCButton, FCComboBox, \
|
from appGUI.GUIElements import FCTable, FCDoubleSpinner, FCCheckBox, FCInputDoubleSpinner, RadioSet, \
|
||||||
FCLabel, FCComboBox2
|
FCButton, FCComboBox, FCLabel, FCComboBox2
|
||||||
|
|
||||||
from shapely.geometry import base, Polygon, MultiPolygon, LinearRing, Point
|
from shapely.geometry import base, Polygon, MultiPolygon, LinearRing, Point
|
||||||
from shapely.ops import unary_union, linemerge
|
from shapely.ops import unary_union, linemerge
|
||||||
|
@ -381,11 +381,11 @@ class ToolPaint(AppTool, Gerber):
|
||||||
self.blockSignals(False)
|
self.blockSignals(False)
|
||||||
|
|
||||||
def on_add_tool_by_key(self):
|
def on_add_tool_by_key(self):
|
||||||
tool_add_popup = FCInputDialog(title='%s...' % _("New Tool"),
|
tool_add_popup = FCInputDoubleSpinner(title='%s...' % _("New Tool"),
|
||||||
text='%s:' % _('Enter a Tool Diameter'),
|
text='%s:' % _('Enter a Tool Diameter'),
|
||||||
min=0.0000, max=99.9999, decimals=4,
|
min=0.0000, max=99.9999, decimals=self.decimals,
|
||||||
parent=self.app.ui)
|
parent=self.app.ui)
|
||||||
tool_add_popup.setWindowIcon(QtGui.QIcon(self.app.resource_location + '/letter_t_32.png'))
|
tool_add_popup.set_icon(QtGui.QIcon(self.app.resource_location + '/letter_t_32.png'))
|
||||||
|
|
||||||
val, ok = tool_add_popup.get_value()
|
val, ok = tool_add_popup.get_value()
|
||||||
if ok:
|
if ok:
|
||||||
|
|
46
app_Main.py
46
app_Main.py
|
@ -6115,10 +6115,12 @@ class App(QtCore.QObject):
|
||||||
self.inform.emit('[WARNING_NOTCL] %s' % _("No object is selected."))
|
self.inform.emit('[WARNING_NOTCL] %s' % _("No object is selected."))
|
||||||
else:
|
else:
|
||||||
if silent is False:
|
if silent is False:
|
||||||
rotatebox = FCInputDialog(title=_("Transform"), text=_("Enter the Angle value:"),
|
rotatebox = FCInputDoubleSpinner(title=_("Transform"), text=_("Enter the Angle value:"),
|
||||||
min=-360, max=360, decimals=4,
|
min=-360, max=360, decimals=4,
|
||||||
init_val=float(self.defaults['tools_transform_rotate']),
|
init_val=float(self.defaults['tools_transform_rotate']),
|
||||||
parent=self.ui)
|
parent=self.ui)
|
||||||
|
rotatebox.setWindowIcon(QtGui.QIcon(self.resource_location + '/rotate.png'))
|
||||||
|
|
||||||
num, ok = rotatebox.get_value()
|
num, ok = rotatebox.get_value()
|
||||||
else:
|
else:
|
||||||
num = preset
|
num = preset
|
||||||
|
@ -6167,10 +6169,12 @@ class App(QtCore.QObject):
|
||||||
if not obj_list:
|
if not obj_list:
|
||||||
self.inform.emit('[WARNING_NOTCL] %s' % _("No object is selected."))
|
self.inform.emit('[WARNING_NOTCL] %s' % _("No object is selected."))
|
||||||
else:
|
else:
|
||||||
skewxbox = FCInputDialog(title=_("Transform"), text=_("Enter the Angle value:"),
|
skewxbox = FCInputDoubleSpinner(title=_("Transform"), text=_("Enter the Angle value:"),
|
||||||
min=-360, max=360, decimals=4,
|
min=-360, max=360, decimals=4,
|
||||||
init_val=float(self.defaults['tools_transform_skew_x']),
|
init_val=float(self.defaults['tools_transform_skew_x']),
|
||||||
parent=self.ui)
|
parent=self.ui)
|
||||||
|
skewxbox.setWindowIcon(QtGui.QIcon(self.resource_location + '/skewX.png'))
|
||||||
|
|
||||||
num, ok = skewxbox.get_value()
|
num, ok = skewxbox.get_value()
|
||||||
if ok:
|
if ok:
|
||||||
# first get a bounding box to fit all
|
# first get a bounding box to fit all
|
||||||
|
@ -6205,10 +6209,12 @@ class App(QtCore.QObject):
|
||||||
if not obj_list:
|
if not obj_list:
|
||||||
self.inform.emit('[WARNING_NOTCL] %s' % _("No object is selected."))
|
self.inform.emit('[WARNING_NOTCL] %s' % _("No object is selected."))
|
||||||
else:
|
else:
|
||||||
skewybox = FCInputDialog(title=_("Transform"), text=_("Enter the Angle value:"),
|
skewybox = FCInputDoubleSpinner(title=_("Transform"), text=_("Enter the Angle value:"),
|
||||||
min=-360, max=360, decimals=4,
|
min=-360, max=360, decimals=4,
|
||||||
init_val=float(self.defaults['tools_transform_skew_y']),
|
init_val=float(self.defaults['tools_transform_skew_y']),
|
||||||
parent=self.ui)
|
parent=self.ui)
|
||||||
|
skewybox.setWindowIcon(QtGui.QIcon(self.resource_location + '/skewY.png'))
|
||||||
|
|
||||||
num, ok = skewybox.get_value()
|
num, ok = skewybox.get_value()
|
||||||
if ok:
|
if ok:
|
||||||
# first get a bounding box to fit all
|
# first get a bounding box to fit all
|
||||||
|
@ -6307,10 +6313,10 @@ class App(QtCore.QObject):
|
||||||
# ## Current application units in lower Case
|
# ## Current application units in lower Case
|
||||||
units = self.defaults['units'].lower()
|
units = self.defaults['units'].lower()
|
||||||
|
|
||||||
grid_add_popup = FCInputDialog(title=_("New Grid ..."),
|
grid_add_popup = FCInputDoubleSpinner(title=_("New Grid ..."),
|
||||||
text=_('Enter a Grid Value:'),
|
text=_('Enter a Grid Value:'),
|
||||||
min=0.0000, max=99.9999, decimals=4,
|
min=0.0000, max=99.9999, decimals=self.decimals,
|
||||||
parent=self.ui)
|
parent=self.ui)
|
||||||
grid_add_popup.setWindowIcon(QtGui.QIcon(self.resource_location + '/plus32.png'))
|
grid_add_popup.setWindowIcon(QtGui.QIcon(self.resource_location + '/plus32.png'))
|
||||||
|
|
||||||
val, ok = grid_add_popup.get_value()
|
val, ok = grid_add_popup.get_value()
|
||||||
|
@ -6332,10 +6338,10 @@ class App(QtCore.QObject):
|
||||||
# ## Current application units in lower Case
|
# ## Current application units in lower Case
|
||||||
units = self.defaults['units'].lower()
|
units = self.defaults['units'].lower()
|
||||||
|
|
||||||
grid_del_popup = FCInputDialog(title="Delete Grid ...",
|
grid_del_popup = FCInputDoubleSpinner(title="Delete Grid ...",
|
||||||
text='Enter a Grid Value:',
|
text='Enter a Grid Value:',
|
||||||
min=0.0000, max=99.9999, decimals=4,
|
min=0.0000, max=99.9999, decimals=self.decimals,
|
||||||
parent=self.ui)
|
parent=self.ui)
|
||||||
grid_del_popup.setWindowIcon(QtGui.QIcon(self.resource_location + '/delete32.png'))
|
grid_del_popup.setWindowIcon(QtGui.QIcon(self.resource_location + '/delete32.png'))
|
||||||
|
|
||||||
val, ok = grid_del_popup.get_value()
|
val, ok = grid_del_popup.get_value()
|
||||||
|
|
|
@ -6830,7 +6830,7 @@ class CNCjob(Geometry):
|
||||||
|
|
||||||
:param obj: FlatCAM CNCJob object for which to plot the annotations
|
:param obj: FlatCAM CNCJob object for which to plot the annotations
|
||||||
:type obj:
|
:type obj:
|
||||||
:param visible: annotaions visibility
|
:param visible: annotations visibility
|
||||||
:type visible: bool
|
:type visible: bool
|
||||||
:return: Nothing
|
:return: Nothing
|
||||||
:rtype:
|
:rtype:
|
||||||
|
@ -6840,9 +6840,11 @@ class CNCjob(Geometry):
|
||||||
return
|
return
|
||||||
|
|
||||||
if visible is True:
|
if visible is True:
|
||||||
obj.text_col.enabled = True
|
if self.app.is_legacy is False:
|
||||||
|
obj.annotation.clear(update=True)
|
||||||
|
obj.text_col.visible = True
|
||||||
else:
|
else:
|
||||||
obj.text_col.enabled = False
|
obj.text_col.visible = False
|
||||||
return
|
return
|
||||||
|
|
||||||
text = []
|
text = []
|
||||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue