- modified the way the FlatCAM Tools are run from toolbar as opposed of running them from other sources
- some Gerber UI changes
This commit is contained in:
parent
996b63cf4e
commit
b20a6a1a85
|
@ -1784,17 +1784,17 @@ class App(QtCore.QObject):
|
|||
self.ui.shell_btn.triggered.connect(self.on_toggle_shell)
|
||||
|
||||
# Tools Toolbar Signals
|
||||
self.ui.dblsided_btn.triggered.connect(lambda: self.dblsidedtool.run())
|
||||
self.ui.cutout_btn.triggered.connect(lambda: self.cutout_tool.run())
|
||||
self.ui.ncc_btn.triggered.connect(lambda: self.ncclear_tool.run())
|
||||
self.ui.paint_btn.triggered.connect(lambda: self.paint_tool.run())
|
||||
self.ui.dblsided_btn.triggered.connect(lambda: self.dblsidedtool.run(toggle=True))
|
||||
self.ui.cutout_btn.triggered.connect(lambda: self.cutout_tool.run(toggle=True))
|
||||
self.ui.ncc_btn.triggered.connect(lambda: self.ncclear_tool.run(toggle=True))
|
||||
self.ui.paint_btn.triggered.connect(lambda: self.paint_tool.run(toggle=True))
|
||||
|
||||
self.ui.panelize_btn.triggered.connect(lambda: self.panelize_tool.run())
|
||||
self.ui.film_btn.triggered.connect(lambda: self.film_tool.run())
|
||||
self.ui.solder_btn.triggered.connect(lambda: self.paste_tool.run())
|
||||
self.ui.panelize_btn.triggered.connect(lambda: self.panelize_tool.run(toggle=True))
|
||||
self.ui.film_btn.triggered.connect(lambda: self.film_tool.run(toggle=True))
|
||||
self.ui.solder_btn.triggered.connect(lambda: self.paste_tool.run(toggle=True))
|
||||
|
||||
self.ui.calculators_btn.triggered.connect(lambda: self.calculator_tool.run())
|
||||
self.ui.transform_btn.triggered.connect(lambda: self.transform_tool.run())
|
||||
self.ui.calculators_btn.triggered.connect(lambda: self.calculator_tool.run(toggle=True))
|
||||
self.ui.transform_btn.triggered.connect(lambda: self.transform_tool.run(toggle=True))
|
||||
|
||||
def object2editor(self):
|
||||
"""
|
||||
|
|
|
@ -533,9 +533,10 @@ class FlatCAMGerber(FlatCAMObj, Gerber):
|
|||
self.ui.generate_ext_iso_button.hide()
|
||||
self.ui.generate_int_iso_button.hide()
|
||||
self.ui.follow_cb.hide()
|
||||
|
||||
self.ui.padding_area_label.show()
|
||||
else:
|
||||
self.ui.level.setText('<span style="color:red;"><b>Advanced</b></span>')
|
||||
self.ui.padding_area_label.hide()
|
||||
|
||||
# set initial state of the aperture table and associated widgets
|
||||
self.on_aperture_table_visibility_change()
|
||||
|
|
|
@ -388,6 +388,10 @@ class GerberObjectUI(ObjectUI):
|
|||
hlay_1 = QtWidgets.QHBoxLayout()
|
||||
self.custom_box.addLayout(hlay_1)
|
||||
|
||||
self.padding_area_label = QtWidgets.QLabel('')
|
||||
self.padding_area_label.setFixedWidth(90)
|
||||
hlay_1.addWidget(self.padding_area_label)
|
||||
|
||||
self.generate_iso_button = QtWidgets.QPushButton('FULL Geo')
|
||||
self.generate_iso_button.setToolTip(
|
||||
"Create the Geometry Object\n"
|
||||
|
@ -395,7 +399,7 @@ class GerberObjectUI(ObjectUI):
|
|||
"the interiors and exteriors geometry."
|
||||
)
|
||||
self.generate_iso_button.setFixedWidth(90)
|
||||
hlay_1.addWidget(self.generate_iso_button)
|
||||
hlay_1.addWidget(self.generate_iso_button, alignment=Qt.AlignLeft)
|
||||
|
||||
# hlay_1.addStretch()
|
||||
|
||||
|
@ -422,6 +426,8 @@ class GerberObjectUI(ObjectUI):
|
|||
self.ois_iso = OptionalInputSection(self.follow_cb,
|
||||
[self.generate_int_iso_button, self.generate_ext_iso_button], logic=False)
|
||||
|
||||
|
||||
|
||||
grid2 = QtWidgets.QGridLayout()
|
||||
self.custom_box.addLayout(grid2)
|
||||
|
||||
|
|
|
@ -9,6 +9,12 @@ CAD program, and create G-Code for Isolation routing.
|
|||
|
||||
=================================================
|
||||
|
||||
6.03.2019
|
||||
|
||||
- modified the way the FlatCAM Tools are run from toolbar as opposed of running them from other sources
|
||||
- some Gerber UI changes
|
||||
|
||||
|
||||
5.03.2019
|
||||
|
||||
- modified the grbl-laser postprocessor lift_code()
|
||||
|
|
|
@ -222,18 +222,19 @@ class ToolCalculator(FlatCAMTool):
|
|||
self.calculate_plate_button.clicked.connect(self.on_calculate_eplate)
|
||||
|
||||
|
||||
def run(self):
|
||||
def run(self, toggle=False):
|
||||
self.app.report_usage("ToolCalculators()")
|
||||
|
||||
# if the splitter is hidden, display it, else hide it but only if the current widget is the same
|
||||
if self.app.ui.splitter.sizes()[0] == 0:
|
||||
self.app.ui.splitter.setSizes([1, 1])
|
||||
else:
|
||||
try:
|
||||
if self.app.ui.tool_scroll_area.widget().objectName() == self.toolName:
|
||||
self.app.ui.splitter.setSizes([0, 1])
|
||||
except AttributeError:
|
||||
pass
|
||||
if toggle:
|
||||
# if the splitter is hidden, display it, else hide it but only if the current widget is the same
|
||||
if self.app.ui.splitter.sizes()[0] == 0:
|
||||
self.app.ui.splitter.setSizes([1, 1])
|
||||
else:
|
||||
try:
|
||||
if self.app.ui.tool_scroll_area.widget().objectName() == self.toolName:
|
||||
self.app.ui.splitter.setSizes([0, 1])
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
FlatCAMTool.run(self)
|
||||
self.set_tool_ui()
|
||||
|
|
|
@ -263,18 +263,20 @@ class CutOut(FlatCAMTool):
|
|||
self.obj_combo.setRootModelIndex(self.app.collection.index(obj_type, 0, QtCore.QModelIndex()))
|
||||
self.obj_combo.setCurrentIndex(0)
|
||||
|
||||
def run(self):
|
||||
def run(self, toggle=False):
|
||||
self.app.report_usage("ToolCutOut()")
|
||||
|
||||
# if the splitter is hidden, display it, else hide it but only if the current widget is the same
|
||||
if self.app.ui.splitter.sizes()[0] == 0:
|
||||
self.app.ui.splitter.setSizes([1, 1])
|
||||
else:
|
||||
try:
|
||||
if self.app.ui.tool_scroll_area.widget().objectName() == self.toolName:
|
||||
self.app.ui.splitter.setSizes([0, 1])
|
||||
except AttributeError:
|
||||
pass
|
||||
if toggle:
|
||||
# if the splitter is hidden, display it, else hide it but only if the current widget is the same
|
||||
if self.app.ui.splitter.sizes()[0] == 0:
|
||||
self.app.ui.splitter.setSizes([1, 1])
|
||||
else:
|
||||
try:
|
||||
if self.app.ui.tool_scroll_area.widget().objectName() == self.toolName:
|
||||
self.app.ui.splitter.setSizes([0, 1])
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
FlatCAMTool.run(self)
|
||||
self.set_tool_ui()
|
||||
|
||||
|
|
|
@ -261,18 +261,19 @@ class DblSidedTool(FlatCAMTool):
|
|||
def install(self, icon=None, separator=None, **kwargs):
|
||||
FlatCAMTool.install(self, icon, separator, shortcut='ALT+D', **kwargs)
|
||||
|
||||
def run(self):
|
||||
def run(self, toggle=False):
|
||||
self.app.report_usage("Tool2Sided()")
|
||||
|
||||
# if the splitter is hidden, display it, else hide it but only if the current widget is the same
|
||||
if self.app.ui.splitter.sizes()[0] == 0:
|
||||
self.app.ui.splitter.setSizes([1, 1])
|
||||
else:
|
||||
try:
|
||||
if self.app.ui.tool_scroll_area.widget().objectName() == self.toolName:
|
||||
self.app.ui.splitter.setSizes([0, 1])
|
||||
except AttributeError:
|
||||
pass
|
||||
if toggle:
|
||||
# if the splitter is hidden, display it, else hide it but only if the current widget is the same
|
||||
if self.app.ui.splitter.sizes()[0] == 0:
|
||||
self.app.ui.splitter.setSizes([1, 1])
|
||||
else:
|
||||
try:
|
||||
if self.app.ui.tool_scroll_area.widget().objectName() == self.toolName:
|
||||
self.app.ui.splitter.setSizes([0, 1])
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
FlatCAMTool.run(self)
|
||||
self.set_tool_ui()
|
||||
|
|
|
@ -163,18 +163,19 @@ class Film(FlatCAMTool):
|
|||
self.tf_box_combo.setRootModelIndex(self.app.collection.index(obj_type, 0, QtCore.QModelIndex()))
|
||||
self.tf_box_combo.setCurrentIndex(0)
|
||||
|
||||
def run(self):
|
||||
def run(self, toggle=False):
|
||||
self.app.report_usage("ToolFilm()")
|
||||
|
||||
# if the splitter is hidden, display it, else hide it but only if the current widget is the same
|
||||
if self.app.ui.splitter.sizes()[0] == 0:
|
||||
self.app.ui.splitter.setSizes([1, 1])
|
||||
else:
|
||||
try:
|
||||
if self.app.ui.tool_scroll_area.widget().objectName() == self.toolName:
|
||||
self.app.ui.splitter.setSizes([0, 1])
|
||||
except AttributeError:
|
||||
pass
|
||||
if toggle:
|
||||
# if the splitter is hidden, display it, else hide it but only if the current widget is the same
|
||||
if self.app.ui.splitter.sizes()[0] == 0:
|
||||
self.app.ui.splitter.setSizes([1, 1])
|
||||
else:
|
||||
try:
|
||||
if self.app.ui.tool_scroll_area.widget().objectName() == self.toolName:
|
||||
self.app.ui.splitter.setSizes([0, 1])
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
FlatCAMTool.run(self)
|
||||
self.set_tool_ui()
|
||||
|
|
|
@ -131,18 +131,19 @@ class ToolImage(FlatCAMTool):
|
|||
## Signals
|
||||
self.import_button.clicked.connect(self.on_file_importimage)
|
||||
|
||||
def run(self):
|
||||
def run(self, toggle=False):
|
||||
self.app.report_usage("ToolImage()")
|
||||
|
||||
# if the splitter is hidden, display it, else hide it but only if the current widget is the same
|
||||
if self.app.ui.splitter.sizes()[0] == 0:
|
||||
self.app.ui.splitter.setSizes([1, 1])
|
||||
else:
|
||||
try:
|
||||
if self.app.ui.tool_scroll_area.widget().objectName() == self.toolName:
|
||||
self.app.ui.splitter.setSizes([0, 1])
|
||||
except AttributeError:
|
||||
pass
|
||||
if toggle:
|
||||
# if the splitter is hidden, display it, else hide it but only if the current widget is the same
|
||||
if self.app.ui.splitter.sizes()[0] == 0:
|
||||
self.app.ui.splitter.setSizes([1, 1])
|
||||
else:
|
||||
try:
|
||||
if self.app.ui.tool_scroll_area.widget().objectName() == self.toolName:
|
||||
self.app.ui.splitter.setSizes([0, 1])
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
FlatCAMTool.run(self)
|
||||
self.set_tool_ui()
|
||||
|
|
|
@ -243,19 +243,19 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
|||
def install(self, icon=None, separator=None, **kwargs):
|
||||
FlatCAMTool.install(self, icon, separator, shortcut='ALT+N', **kwargs)
|
||||
|
||||
def run(self):
|
||||
def run(self, toggle=False):
|
||||
self.app.report_usage("ToolNonCopperClear()")
|
||||
|
||||
# if the splitter is hidden, display it, else hide it but only if the current widget is the same
|
||||
if self.app.ui.splitter.sizes()[0] == 0:
|
||||
self.app.ui.splitter.setSizes([1, 1])
|
||||
else:
|
||||
try:
|
||||
if self.app.ui.tool_scroll_area.widget().objectName() == self.toolName:
|
||||
self.app.ui.splitter.setSizes([0, 1])
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
if toggle:
|
||||
# if the splitter is hidden, display it, else hide it but only if the current widget is the same
|
||||
if self.app.ui.splitter.sizes()[0] == 0:
|
||||
self.app.ui.splitter.setSizes([1, 1])
|
||||
else:
|
||||
try:
|
||||
if self.app.ui.tool_scroll_area.widget().objectName() == self.toolName:
|
||||
self.app.ui.splitter.setSizes([0, 1])
|
||||
except AttributeError:
|
||||
pass
|
||||
FlatCAMTool.run(self)
|
||||
self.set_tool_ui()
|
||||
|
||||
|
|
|
@ -301,18 +301,19 @@ class ToolPaint(FlatCAMTool, Gerber):
|
|||
def install(self, icon=None, separator=None, **kwargs):
|
||||
FlatCAMTool.install(self, icon, separator, shortcut='ALT+P', **kwargs)
|
||||
|
||||
def run(self):
|
||||
def run(self, toggle=False):
|
||||
self.app.report_usage("ToolPaint()")
|
||||
|
||||
# if the splitter is hidden, display it, else hide it but only if the current widget is the same
|
||||
if self.app.ui.splitter.sizes()[0] == 0:
|
||||
self.app.ui.splitter.setSizes([1, 1])
|
||||
else:
|
||||
try:
|
||||
if self.app.ui.tool_scroll_area.widget().objectName() == self.toolName:
|
||||
self.app.ui.splitter.setSizes([0, 1])
|
||||
except AttributeError:
|
||||
pass
|
||||
if toggle:
|
||||
# if the splitter is hidden, display it, else hide it but only if the current widget is the same
|
||||
if self.app.ui.splitter.sizes()[0] == 0:
|
||||
self.app.ui.splitter.setSizes([1, 1])
|
||||
else:
|
||||
try:
|
||||
if self.app.ui.tool_scroll_area.widget().objectName() == self.toolName:
|
||||
self.app.ui.splitter.setSizes([0, 1])
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
FlatCAMTool.run(self)
|
||||
self.set_tool_ui()
|
||||
|
|
|
@ -197,18 +197,19 @@ class Panelize(FlatCAMTool):
|
|||
# flag to signal the constrain was activated
|
||||
self.constrain_flag = False
|
||||
|
||||
def run(self):
|
||||
def run(self, toggle=False):
|
||||
self.app.report_usage("ToolPanelize()")
|
||||
|
||||
# if the splitter is hidden, display it, else hide it but only if the current widget is the same
|
||||
if self.app.ui.splitter.sizes()[0] == 0:
|
||||
self.app.ui.splitter.setSizes([1, 1])
|
||||
else:
|
||||
try:
|
||||
if self.app.ui.tool_scroll_area.widget().objectName() == self.toolName:
|
||||
self.app.ui.splitter.setSizes([0, 1])
|
||||
except AttributeError:
|
||||
pass
|
||||
if toggle:
|
||||
# if the splitter is hidden, display it, else hide it but only if the current widget is the same
|
||||
if self.app.ui.splitter.sizes()[0] == 0:
|
||||
self.app.ui.splitter.setSizes([1, 1])
|
||||
else:
|
||||
try:
|
||||
if self.app.ui.tool_scroll_area.widget().objectName() == self.toolName:
|
||||
self.app.ui.splitter.setSizes([0, 1])
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
FlatCAMTool.run(self)
|
||||
self.set_tool_ui()
|
||||
|
|
|
@ -48,22 +48,23 @@ class Properties(FlatCAMTool):
|
|||
self.vlay.addWidget(self.treeWidget)
|
||||
self.vlay.setStretch(0,0)
|
||||
|
||||
def run(self):
|
||||
def run(self, toggle=False):
|
||||
self.app.report_usage("ToolProperties()")
|
||||
|
||||
if self.app.tool_tab_locked is True:
|
||||
return
|
||||
self.set_tool_ui()
|
||||
|
||||
# if the splitter is hidden, display it, else hide it but only if the current widget is the same
|
||||
if self.app.ui.splitter.sizes()[0] == 0:
|
||||
self.app.ui.splitter.setSizes([1, 1])
|
||||
else:
|
||||
try:
|
||||
if self.app.ui.tool_scroll_area.widget().objectName() == self.toolName:
|
||||
self.app.ui.splitter.setSizes([0, 1])
|
||||
except AttributeError:
|
||||
pass
|
||||
if toggle:
|
||||
# if the splitter is hidden, display it, else hide it but only if the current widget is the same
|
||||
if self.app.ui.splitter.sizes()[0] == 0:
|
||||
self.app.ui.splitter.setSizes([1, 1])
|
||||
else:
|
||||
try:
|
||||
if self.app.ui.tool_scroll_area.widget().objectName() == self.toolName:
|
||||
self.app.ui.splitter.setSizes([0, 1])
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
FlatCAMTool.run(self)
|
||||
self.properties()
|
||||
|
|
|
@ -411,18 +411,19 @@ class SolderPaste(FlatCAMTool):
|
|||
|
||||
self.app.object_status_changed.connect(self.update_comboboxes)
|
||||
|
||||
def run(self):
|
||||
def run(self, toggle=False):
|
||||
self.app.report_usage("ToolSolderPaste()")
|
||||
|
||||
# if the splitter is hidden, display it, else hide it but only if the current widget is the same
|
||||
if self.app.ui.splitter.sizes()[0] == 0:
|
||||
self.app.ui.splitter.setSizes([1, 1])
|
||||
else:
|
||||
try:
|
||||
if self.app.ui.tool_scroll_area.widget().objectName() == self.toolName:
|
||||
self.app.ui.splitter.setSizes([0, 1])
|
||||
except AttributeError:
|
||||
pass
|
||||
if toggle:
|
||||
# if the splitter is hidden, display it, else hide it but only if the current widget is the same
|
||||
if self.app.ui.splitter.sizes()[0] == 0:
|
||||
self.app.ui.splitter.setSizes([1, 1])
|
||||
else:
|
||||
try:
|
||||
if self.app.ui.tool_scroll_area.widget().objectName() == self.toolName:
|
||||
self.app.ui.splitter.setSizes([0, 1])
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
FlatCAMTool.run(self)
|
||||
self.set_tool_ui()
|
||||
|
|
|
@ -362,18 +362,19 @@ class ToolTransform(FlatCAMTool):
|
|||
self.offx_entry.returnPressed.connect(self.on_offx)
|
||||
self.offy_entry.returnPressed.connect(self.on_offy)
|
||||
|
||||
def run(self):
|
||||
def run(self, toggle=False):
|
||||
self.app.report_usage("ToolTransform()")
|
||||
|
||||
# if the splitter is hidden, display it, else hide it but only if the current widget is the same
|
||||
if self.app.ui.splitter.sizes()[0] == 0:
|
||||
self.app.ui.splitter.setSizes([1, 1])
|
||||
else:
|
||||
try:
|
||||
if self.app.ui.tool_scroll_area.widget().objectName() == self.toolName:
|
||||
self.app.ui.splitter.setSizes([0, 1])
|
||||
except AttributeError:
|
||||
pass
|
||||
if toggle:
|
||||
# if the splitter is hidden, display it, else hide it but only if the current widget is the same
|
||||
if self.app.ui.splitter.sizes()[0] == 0:
|
||||
self.app.ui.splitter.setSizes([1, 1])
|
||||
else:
|
||||
try:
|
||||
if self.app.ui.tool_scroll_area.widget().objectName() == self.toolName:
|
||||
self.app.ui.splitter.setSizes([0, 1])
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
FlatCAMTool.run(self)
|
||||
self.set_tool_ui()
|
||||
|
|
Loading…
Reference in New Issue