- changes some icons
- added a new GUI element which is a evaluated LineEdit that accepts only float numbers and /,*,+,-,% chars - finished the Etch Compensation Tool
This commit is contained in:
@@ -573,6 +573,7 @@ class EvalEntry(QtWidgets.QLineEdit):
|
||||
def __init__(self, parent=None):
|
||||
super(EvalEntry, self).__init__(parent)
|
||||
self.readyToEdit = True
|
||||
|
||||
self.editingFinished.connect(self.on_edit_finished)
|
||||
|
||||
def on_edit_finished(self):
|
||||
@@ -599,7 +600,6 @@ class EvalEntry(QtWidgets.QLineEdit):
|
||||
|
||||
def get_value(self):
|
||||
raw = str(self.text()).strip(' ')
|
||||
evaled = 0.0
|
||||
try:
|
||||
evaled = eval(raw)
|
||||
except Exception as e:
|
||||
@@ -656,6 +656,17 @@ class EvalEntry2(QtWidgets.QLineEdit):
|
||||
return QtCore.QSize(EDIT_SIZE_HINT, default_hint_size.height())
|
||||
|
||||
|
||||
class NumericalEvalEntry(EvalEntry):
|
||||
"""
|
||||
Will evaluate the input and return a value. Accepts only float numbers and formulas using the operators: /,*,+,-,%
|
||||
"""
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
|
||||
regex = QtCore.QRegExp("[0-9\/\*\+\-\%\.\s]*")
|
||||
validator = QtGui.QRegExpValidator(regex, self)
|
||||
self.setValidator(validator)
|
||||
|
||||
class FCSpinner(QtWidgets.QSpinBox):
|
||||
|
||||
returnPressed = QtCore.pyqtSignal()
|
||||
|
||||
@@ -855,7 +855,7 @@ class MainGUI(QtWidgets.QMainWindow):
|
||||
self.copy_btn = self.toolbaredit.addAction(
|
||||
QtGui.QIcon(self.app.resource_location + '/copy_file32.png'), _("Copy"))
|
||||
self.delete_btn = self.toolbaredit.addAction(
|
||||
QtGui.QIcon(self.app.resource_location + '/delete_file32.png'), _("&Delete"))
|
||||
QtGui.QIcon(self.app.resource_location + '/trash32.png'), _("&Delete"))
|
||||
self.toolbaredit.addSeparator()
|
||||
self.distance_btn = self.toolbaredit.addAction(
|
||||
QtGui.QIcon(self.app.resource_location + '/distance32.png'), _("Distance Tool"))
|
||||
@@ -1851,7 +1851,7 @@ class MainGUI(QtWidgets.QMainWindow):
|
||||
self.copy_btn = self.toolbaredit.addAction(
|
||||
QtGui.QIcon(self.app.resource_location + '/copy_file32.png'), _("Copy"))
|
||||
self.delete_btn = self.toolbaredit.addAction(
|
||||
QtGui.QIcon(self.app.resource_location + '/delete_file32.png'), _("&Delete"))
|
||||
QtGui.QIcon(self.app.resource_location + '/trash32.png'), _("&Delete"))
|
||||
self.toolbaredit.addSeparator()
|
||||
self.distance_btn = self.toolbaredit.addAction(
|
||||
QtGui.QIcon(self.app.resource_location + '/distance32.png'), _("Distance Tool"))
|
||||
|
||||
Reference in New Issue
Block a user