- in Excellon Editor added a protection for Tool_dia field in case numbers using comma as decimal separator are used. Also added a QDoubleValidator forcing a number with max 4 decimals and from 0.0000 to 9.9999

- in Excellon Editor added a shortcut key 'T' that popup a window allowing to enter a new Tool with the set diameter
- in App added a shortcut key 'T' that popup a windows allowing to enter a new Tool with set diameter only when the Selected tab is on focus and only if a Geometry object is selected
- changed the shortcut key for Transform Tool from 'T' to 'ALT+T'
- fixed bug in Geometry Selected tab that generated error when used tool offset was less than half of either total length or half of total width. Now the app signal the issue with a status bar message
- added Double Validator for the Offset value so only float numbers can be entered.
- in App added a shortcut key 'T' that popup a windows allowing to enter a new Tool with set diameter only when the Tool tab is on focus and only if a NCC Tool or Paint Area Tool object is installed in the Tool Tab
This commit is contained in:
Marius Stanciu
2019-02-09 00:08:54 +02:00
committed by Marius S
parent 824b1a95ab
commit 8f000c0a18
11 changed files with 347 additions and 112 deletions

View File

@@ -3255,7 +3255,8 @@ class FlatCAMExcEditor(QtCore.QObject):
grid1.addWidget(addtool_entry_lbl, 0, 0)
hlay = QtWidgets.QHBoxLayout()
self.addtool_entry = LengthEntry()
self.addtool_entry = FCEntry()
self.addtool_entry.setValidator(QtGui.QDoubleValidator(0.0001, 99.9999, 4))
hlay.addWidget(self.addtool_entry)
self.addtool_btn = QtWidgets.QPushButton('Add Tool')
@@ -3663,7 +3664,7 @@ class FlatCAMExcEditor(QtCore.QObject):
if self.units == "IN":
self.addtool_entry.set_value(0.039)
else:
self.addtool_entry.set_value(1)
self.addtool_entry.set_value(1.00)
sort_temp = []
@@ -3847,9 +3848,21 @@ class FlatCAMExcEditor(QtCore.QObject):
# we reactivate the signals after the after the tool adding as we don't need to see the tool been populated
self.tools_table_exc.itemChanged.connect(self.on_tool_edit)
def on_tool_add(self):
def on_tool_add(self, tooldia=None):
self.is_modified = True
tool_dia = float(self.addtool_entry.get_value())
if tooldia:
tool_dia = tooldia
else:
try:
tool_dia = float(self.addtool_entry.get_value())
except ValueError:
# try to convert comma to decimal point. if it's still not working error message and return
try:
tool_dia = float(self.addtool_entry.get_value().replace(',', '.'))
except ValueError:
self.app.inform.emit("[ERROR_NOTCL]Wrong value format entered, "
"use a number.")
return
if tool_dia not in self.olddia_newdia:
storage_elem = FlatCAMGeoEditor.make_storage()
@@ -4156,6 +4169,9 @@ class FlatCAMExcEditor(QtCore.QObject):
self.replot()
# add a first tool in the Tool Table
self.on_tool_add(tooldia=1.00)
def update_fcexcellon(self, exc_obj):
"""
Create a new Excellon object that contain the edited content of the source Excellon object