- in Copper Thieving Tool added the display of the patterned plated area (approximative area)

This commit is contained in:
Marius Stanciu
2019-12-04 17:41:00 +02:00
parent f9c83a5e60
commit 92ea7e83be
3 changed files with 25 additions and 5 deletions

View File

@@ -353,10 +353,11 @@ class IntEntry(QtWidgets.QLineEdit):
class FCEntry(QtWidgets.QLineEdit):
def __init__(self, parent=None):
def __init__(self, decimals=None, parent=None):
super(FCEntry, self).__init__(parent)
self.readyToEdit = True
self.editingFinished.connect(self.on_edit_finished)
self.decimals = decimals if decimals is not None else 4
def on_edit_finished(self):
self.clearFocus()
@@ -376,9 +377,10 @@ class FCEntry(QtWidgets.QLineEdit):
def get_value(self):
return str(self.text())
def set_value(self, val, decimals=4):
def set_value(self, val, decimals=None):
decimal_digits = decimals if decimals is not None else self.decimals
if type(val) is float:
self.setText('%.*f' % (decimals, val))
self.setText('%.*f' % (decimal_digits, val))
else:
self.setText(str(val))