- fixed an issue where the function handler that changed the layout had a parameter changed accidentally by an index value passed by the 'activate' signal to which was connected

- fixed bug in paint function in Geometry Editor that didn't allow painting due of overlap value
- added protections again wrong values for the Buffer and Paint Tool in Geometry Editor
- the Paint Tool in Geometry Editor will load the default values from Tool Paint in Preferences
- when the Tools in Geometry Editor are activated, the notebook with the Tool Tab will be unhidden. After execution the notebook will hide again for the Buffer Tool.
- changed the font in Tool names
- added in Geometry Editor a new Tool: Transformation Tool. It still has some bugs, though ...
This commit is contained in:
Marius Stanciu 2019-02-18 03:45:34 +02:00 committed by Marius S
parent 032f68a848
commit cc2fe29942
15 changed files with 1434 additions and 83 deletions

View File

@ -1470,7 +1470,7 @@ class App(QtCore.QObject):
if not factory_defaults: if not factory_defaults:
self.save_factory_defaults(silent=False) self.save_factory_defaults(silent=False)
# ONLY AT FIRST STARTUP INIT THE GUI LAYOUT TO 'COMPACT' # ONLY AT FIRST STARTUP INIT THE GUI LAYOUT TO 'COMPACT'
self.on_layout(layout='compact') self.on_layout(index=None, lay='compact')
factory_file.close() factory_file.close()
# and then make the factory_defaults.FlatConfig file read_only os it can't be modified after creation. # and then make the factory_defaults.FlatConfig file read_only os it can't be modified after creation.
@ -3373,13 +3373,12 @@ class App(QtCore.QObject):
self.general_defaults_form.general_gui_group.workspace_cb.setChecked(True) self.general_defaults_form.general_gui_group.workspace_cb.setChecked(True)
self.on_workspace() self.on_workspace()
def on_layout(self, layout=None): def on_layout(self, index, lay=None):
self.report_usage("on_layout()") self.report_usage("on_layout()")
if lay:
if layout is None: current_layout = lay
current_layout= self.general_defaults_form.general_gui_group.layout_combo.get_value().lower()
else: else:
current_layout = layout current_layout = self.general_defaults_form.general_gui_group.layout_combo.get_value().lower()
settings = QSettings("Open Source", "FlatCAM") settings = QSettings("Open Source", "FlatCAM")
settings.setValue('layout', current_layout) settings.setValue('layout', current_layout)

File diff suppressed because it is too large Load Diff

View File

@ -378,10 +378,13 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.geo_editor_menu.addSeparator() self.geo_editor_menu.addSeparator()
self.geo_move_menuitem = self.geo_editor_menu.addAction(QtGui.QIcon('share/move32.png'), "Move\tM") self.geo_move_menuitem = self.geo_editor_menu.addAction(QtGui.QIcon('share/move32.png'), "Move\tM")
self.geo_buffer_menuitem = self.geo_editor_menu.addAction( self.geo_buffer_menuitem = self.geo_editor_menu.addAction(
QtGui.QIcon('share/buffer16.png'), "Buffer Selection\tB" QtGui.QIcon('share/buffer16.png'), "Buffer Tool\tB"
) )
self.geo_paint_menuitem = self.geo_editor_menu.addAction( self.geo_paint_menuitem = self.geo_editor_menu.addAction(
QtGui.QIcon('share/paint16.png'), "Paint Selection\tI" QtGui.QIcon('share/paint16.png'), "Paint Tool\tI"
)
self.geo_transform_menuitem = self.geo_editor_menu.addAction(
QtGui.QIcon('share/transform.png'), "Transform Tool\tALT+R"
) )
self.geo_editor_menu.addSeparator() self.geo_editor_menu.addSeparator()
self.geo_cornersnap_menuitem = self.geo_editor_menu.addAction( self.geo_cornersnap_menuitem = self.geo_editor_menu.addAction(
@ -527,7 +530,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.shell_btn = self.toolbartools.addAction(QtGui.QIcon('share/shell32.png'), "&Command Line") self.shell_btn = self.toolbartools.addAction(QtGui.QIcon('share/shell32.png'), "&Command Line")
### Drill Editor Toolbar ### ### Drill Editor Toolbar ###
self.select_drill_btn = self.exc_edit_toolbar.addAction(QtGui.QIcon('share/pointer32.png'), "Select 'Esc'") self.select_drill_btn = self.exc_edit_toolbar.addAction(QtGui.QIcon('share/pointer32.png'), "Select")
self.add_drill_btn = self.exc_edit_toolbar.addAction(QtGui.QIcon('share/plus16.png'), 'Add Drill Hole') self.add_drill_btn = self.exc_edit_toolbar.addAction(QtGui.QIcon('share/plus16.png'), 'Add Drill Hole')
self.add_drill_array_btn = self.exc_edit_toolbar.addAction( self.add_drill_array_btn = self.exc_edit_toolbar.addAction(
QtGui.QIcon('share/addarray16.png'), 'Add Drill Hole Array') QtGui.QIcon('share/addarray16.png'), 'Add Drill Hole Array')
@ -541,7 +544,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.move_drill_btn = self.exc_edit_toolbar.addAction(QtGui.QIcon('share/move32.png'), "Move Drill") self.move_drill_btn = self.exc_edit_toolbar.addAction(QtGui.QIcon('share/move32.png'), "Move Drill")
### Geometry Editor Toolbar ### ### Geometry Editor Toolbar ###
self.geo_select_btn = self.geo_edit_toolbar.addAction(QtGui.QIcon('share/pointer32.png'), "Select 'Esc'") self.geo_select_btn = self.geo_edit_toolbar.addAction(QtGui.QIcon('share/pointer32.png'), "Select")
self.geo_add_circle_btn = self.geo_edit_toolbar.addAction(QtGui.QIcon('share/circle32.png'), 'Add Circle') self.geo_add_circle_btn = self.geo_edit_toolbar.addAction(QtGui.QIcon('share/circle32.png'), 'Add Circle')
self.geo_add_arc_btn = self.geo_edit_toolbar.addAction(QtGui.QIcon('share/arc32.png'), 'Add Arc') self.geo_add_arc_btn = self.geo_edit_toolbar.addAction(QtGui.QIcon('share/arc32.png'), 'Add Arc')
self.geo_add_rectangle_btn = self.geo_edit_toolbar.addAction(QtGui.QIcon('share/rectangle32.png'), self.geo_add_rectangle_btn = self.geo_edit_toolbar.addAction(QtGui.QIcon('share/rectangle32.png'),
@ -564,13 +567,15 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.geo_edit_toolbar.addSeparator() self.geo_edit_toolbar.addSeparator()
self.geo_cutpath_btn = self.geo_edit_toolbar.addAction(QtGui.QIcon('share/cutpath32.png'), 'Cut Path') self.geo_cutpath_btn = self.geo_edit_toolbar.addAction(QtGui.QIcon('share/cutpath32.png'), 'Cut Path')
self.geo_copy_btn = self.geo_edit_toolbar.addAction(QtGui.QIcon('share/copy32.png'), "Copy Objects 'c'") self.geo_copy_btn = self.geo_edit_toolbar.addAction(QtGui.QIcon('share/copy32.png'), "Copy Shape(s)")
self.geo_rotate_btn = self.geo_edit_toolbar.addAction(QtGui.QIcon('share/rotate.png'), "Rotate Objects 'Space'") self.geo_rotate_btn = self.geo_edit_toolbar.addAction(QtGui.QIcon('share/rotate.png'), "Rotate Shape(s)")
self.geo_transform_btn = self.geo_edit_toolbar.addAction(QtGui.QIcon('share/transform.png'), "Transformations'")
self.geo_delete_btn = self.geo_edit_toolbar.addAction(QtGui.QIcon('share/deleteshape32.png'), self.geo_delete_btn = self.geo_edit_toolbar.addAction(QtGui.QIcon('share/deleteshape32.png'),
"Delete Shape '-'") "Delete Shape '-'")
self.geo_edit_toolbar.addSeparator() self.geo_edit_toolbar.addSeparator()
self.geo_move_btn = self.geo_edit_toolbar.addAction(QtGui.QIcon('share/move32.png'), "Move Objects 'm'") self.geo_move_btn = self.geo_edit_toolbar.addAction(QtGui.QIcon('share/move32.png'), "Move Objects ")
### Snap Toolbar ### ### Snap Toolbar ###
# Snap GRID toolbar is always active to facilitate usage of measurements done on GRID # Snap GRID toolbar is always active to facilitate usage of measurements done on GRID
@ -1138,18 +1143,22 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
<td height="20"><strong>U</strong></td> <td height="20"><strong>U</strong></td>
<td>&nbsp;Polygon Union Tool</td> <td>&nbsp;Polygon Union Tool</td>
</tr> </tr>
<tr height="20">
<td height="20"><strong>X</strong></td>
<td>&nbsp;Polygon Cut Tool</td>
</tr>
<tr height="20"> <tr height="20">
<td height="20">&nbsp;</td> <td height="20">&nbsp;</td>
<td>&nbsp;</td> <td>&nbsp;</td>
</tr> </tr>
<tr height="20">
<td height="20"><strong>CTRL+M</strong></td>
<td>&nbsp;Measurement Tool</td>
</tr>
<tr height="20"> <tr height="20">
<td height="20"><strong>CTRL+S</strong></td> <td height="20"><strong>CTRL+S</strong></td>
<td>&nbsp;Save Object and Exit Editor</td> <td>&nbsp;Save Object and Exit Editor</td>
</tr> </tr>
<tr height="20">
<td height="20"><strong>CTRL+X</strong></td>
<td>&nbsp;Polygon Cut Tool</td>
</tr>
<tr height="20"> <tr height="20">
<td height="20">&nbsp;</td> <td height="20">&nbsp;</td>
<td>&nbsp;</td> <td>&nbsp;</td>
@ -1720,7 +1729,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.app.transform_tool.run() self.app.transform_tool.run()
return return
# Transformation Tool # View Source Object Content
if key == QtCore.Qt.Key_S: if key == QtCore.Qt.Key_S:
self.app.on_view_source() self.app.on_view_source()
return return
@ -1879,10 +1888,34 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.app.measurement_tool.run() self.app.measurement_tool.run()
return return
# Cut Action Tool
if key == QtCore.Qt.Key_X or key == 'X':
if self.app.geo_editor.get_selected() is not None:
self.app.geo_editor.cutpath()
else:
msg = 'Please first select a geometry item to be cutted\n' \
'then select the geometry item that will be cutted\n' \
'out of the first item. In the end press ~X~ key or\n' \
'the toolbar button.'
messagebox = QtWidgets.QMessageBox()
messagebox.setText(msg)
messagebox.setWindowTitle("Warning")
messagebox.setWindowIcon(QtGui.QIcon('share/warning.png'))
messagebox.setStandardButtons(QtWidgets.QMessageBox.Ok)
messagebox.setDefaultButton(QtWidgets.QMessageBox.Ok)
messagebox.exec_()
return
elif modifiers == QtCore.Qt.ShiftModifier: elif modifiers == QtCore.Qt.ShiftModifier:
pass pass
elif modifiers == QtCore.Qt.AltModifier: elif modifiers == QtCore.Qt.AltModifier:
pass
# Transformation Tool
if key == QtCore.Qt.Key_R or key == 'R':
self.app.geo_editor.select_tool('transform')
return
elif modifiers == QtCore.Qt.NoModifier: elif modifiers == QtCore.Qt.NoModifier:
# toggle display of Notebook area # toggle display of Notebook area
if key == QtCore.Qt.Key_QuoteLeft or key == '`': if key == QtCore.Qt.Key_QuoteLeft or key == '`':
@ -1923,10 +1956,12 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
# deselect any shape that might be selected # deselect any shape that might be selected
self.app.geo_editor.selected = [] self.app.geo_editor.selected = []
self.app.geo_editor.replot() self.app.geo_editor.replot()
# self.select_btn.setChecked(True)
# self.on_tool_select('select')
self.app.geo_editor.select_tool('select') self.app.geo_editor.select_tool('select')
# hide the notebook
self.app.ui.splitter.setSizes([0, 1])
return return
# Delete selected object # Delete selected object
@ -1970,11 +2005,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
# Copy # Copy
if key == QtCore.Qt.Key_C or key == 'C': if key == QtCore.Qt.Key_C or key == 'C':
self.app.ui.geo_copy_btn.setChecked(True) self.app.geo_editor.on_copy_click()
self.app.geo_editor.on_tool_select('copy')
self.app.geo_editor.active_tool.set_origin(self.app.geo_editor.snap(
self.app.geo_editor.x, self.app.geo_editor.y))
self.app.inform.emit("Click on target point.")
# Substract Tool # Substract Tool
if key == QtCore.Qt.Key_E or key == 'E': if key == QtCore.Qt.Key_E or key == 'E':
@ -2073,24 +2104,6 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
if key == QtCore.Qt.Key_V or key == 'V': if key == QtCore.Qt.Key_V or key == 'V':
self.app.on_zoom_fit(None) self.app.on_zoom_fit(None)
# Cut Action Tool
if key == QtCore.Qt.Key_X or key == 'X':
if self.app.geo_editor.get_selected() is not None:
self.app.geo_editor.cutpath()
else:
msg = 'Please first select a geometry item to be cutted\n' \
'then select the geometry item that will be cutted\n' \
'out of the first item. In the end press ~X~ key or\n' \
'the toolbar button.' \
messagebox = QtWidgets.QMessageBox()
messagebox.setText(msg)
messagebox.setWindowTitle("Warning")
messagebox.setWindowIcon(QtGui.QIcon('share/warning.png'))
messagebox.setStandardButtons(QtWidgets.QMessageBox.Ok)
messagebox.setDefaultButton(QtWidgets.QMessageBox.Ok)
messagebox.exec_()
# Propagate to tool # Propagate to tool
response = None response = None
if self.app.geo_editor.active_tool is not None: if self.app.geo_editor.active_tool is not None:

View File

@ -9,6 +9,14 @@ CAD program, and create G-Code for Isolation routing.
================================================= =================================================
18.02.2019
- added protections again wrong values for the Buffer and Paint Tool in Geometry Editor
- the Paint Tool in Geometry Editor will load the default values from Tool Paint in Preferences
- when the Tools in Geometry Editor are activated, the notebook with the Tool Tab will be unhidden. After execution the notebook will hide again for the Buffer Tool.
- changed the font in Tool names
- added in Geometry Editor a new Tool: Transformation Tool. It still has some bugs, though ...
17.02.2019 17.02.2019
- changed some status bar messages - changed some status bar messages
@ -21,6 +29,8 @@ CAD program, and create G-Code for Isolation routing.
- when pressing Escape in Geometry Editor it will automatically deselect any shape not only the currently selected tool. - when pressing Escape in Geometry Editor it will automatically deselect any shape not only the currently selected tool.
- when deselecting an object in Project menu the status bar selection message is deleted - when deselecting an object in Project menu the status bar selection message is deleted
- added ability to save the Gerber file content that is stored in FlatCAM on Gerber file loading. It's useful to recover from saved FlatCAM projects when the source files are no longer available. - added ability to save the Gerber file content that is stored in FlatCAM on Gerber file loading. It's useful to recover from saved FlatCAM projects when the source files are no longer available.
- fixed an issue where the function handler that changed the layout had a parameter changed accidentally by an index value passed by the 'activate' signal to which was connected
- fixed bug in paint function in Geometry Editor that didn't allow painting due of overlap value
16.02.2019 16.02.2019

View File

@ -1375,8 +1375,6 @@ class Geometry(object):
except AttributeError: except AttributeError:
self.app.inform.emit("[ERROR_NOTCL] Failed to mirror. No object selected") self.app.inform.emit("[ERROR_NOTCL] Failed to mirror. No object selected")
def rotate(self, angle, point): def rotate(self, angle, point):
""" """
Rotate an object by an angle (in degrees) around the provided coordinates. Rotate an object by an angle (in degrees) around the provided coordinates.

View File

@ -18,7 +18,14 @@ class ToolCalculator(FlatCAMTool):
self.app = app self.app = app
## Title ## Title
title_label = QtWidgets.QLabel("<font size=4><b>%s</b></font>" % self.toolName) title_label = QtWidgets.QLabel("%s" % self.toolName)
title_label.setStyleSheet("""
QLabel
{
font-size: 16px;
font-weight: bold;
}
""")
self.layout.addWidget(title_label) self.layout.addWidget(title_label)
###################### ######################

View File

@ -16,7 +16,14 @@ class ToolCutOut(FlatCAMTool):
FlatCAMTool.__init__(self, app) FlatCAMTool.__init__(self, app)
## Title ## Title
title_label = QtWidgets.QLabel("<font size=4><b>%s</b></font>" % self.toolName) title_label = QtWidgets.QLabel("%s" % self.toolName)
title_label.setStyleSheet("""
QLabel
{
font-size: 16px;
font-weight: bold;
}
""")
self.layout.addWidget(title_label) self.layout.addWidget(title_label)
## Form Layout ## Form Layout

View File

@ -15,7 +15,14 @@ class DblSidedTool(FlatCAMTool):
FlatCAMTool.__init__(self, app) FlatCAMTool.__init__(self, app)
## Title ## Title
title_label = QtWidgets.QLabel("<font size=4><b>%s</b></font>" % self.toolName) title_label = QtWidgets.QLabel("%s" % self.toolName)
title_label.setStyleSheet("""
QLabel
{
font-size: 16px;
font-weight: bold;
}
""")
self.layout.addWidget(title_label) self.layout.addWidget(title_label)
self.empty_lb = QtWidgets.QLabel("") self.empty_lb = QtWidgets.QLabel("")

View File

@ -12,7 +12,14 @@ class Film(FlatCAMTool):
FlatCAMTool.__init__(self, app) FlatCAMTool.__init__(self, app)
# Title # Title
title_label = QtWidgets.QLabel("<font size=4><b>%s</b></font>" % self.toolName) title_label = QtWidgets.QLabel("%s" % self.toolName)
title_label.setStyleSheet("""
QLabel
{
font-size: 16px;
font-weight: bold;
}
""")
self.layout.addWidget(title_label) self.layout.addWidget(title_label)
# Form Layout # Form Layout

View File

@ -12,7 +12,14 @@ class ToolImage(FlatCAMTool):
FlatCAMTool.__init__(self, app) FlatCAMTool.__init__(self, app)
# Title # Title
title_label = QtWidgets.QLabel("<font size=4><b>IMAGE to PCB</b></font>") title_label = QtWidgets.QLabel("%s" % 'Image to PCB')
title_label.setStyleSheet("""
QLabel
{
font-size: 16px;
font-weight: bold;
}
""")
self.layout.addWidget(title_label) self.layout.addWidget(title_label)
# Form Layout # Form Layout

View File

@ -24,7 +24,14 @@ class NonCopperClear(FlatCAMTool, Gerber):
self.tools_frame.setLayout(self.tools_box) self.tools_frame.setLayout(self.tools_box)
## Title ## Title
title_label = QtWidgets.QLabel("<font size=4><b>%s</b></font>" % self.toolName) title_label = QtWidgets.QLabel("%s" % self.toolName)
title_label.setStyleSheet("""
QLabel
{
font-size: 16px;
font-weight: bold;
}
""")
self.tools_box.addWidget(title_label) self.tools_box.addWidget(title_label)
## Form Layout ## Form Layout

View File

@ -14,7 +14,14 @@ class ToolPaint(FlatCAMTool, Gerber):
Geometry.__init__(self, geo_steps_per_circle=self.app.defaults["geometry_circle_steps"]) Geometry.__init__(self, geo_steps_per_circle=self.app.defaults["geometry_circle_steps"])
## Title ## Title
title_label = QtWidgets.QLabel("<font size=4><b>%s</b></font>" % self.toolName) title_label = QtWidgets.QLabel("%s" % self.toolName)
title_label.setStyleSheet("""
QLabel
{
font-size: 16px;
font-weight: bold;
}
""")
self.layout.addWidget(title_label) self.layout.addWidget(title_label)
self.tools_frame = QtWidgets.QFrame() self.tools_frame = QtWidgets.QFrame()

View File

@ -13,7 +13,14 @@ class Panelize(FlatCAMTool):
self.app = app self.app = app
## Title ## Title
title_label = QtWidgets.QLabel("<font size=4><b>%s</b></font>" % self.toolName) title_label = QtWidgets.QLabel("%s" % self.toolName)
title_label.setStyleSheet("""
QLabel
{
font-size: 16px;
font-weight: bold;
}
""")
self.layout.addWidget(title_label) self.layout.addWidget(title_label)
## Form Layout ## Form Layout

View File

@ -22,7 +22,14 @@ class Properties(FlatCAMTool):
self.properties_frame.setLayout(self.properties_box) self.properties_frame.setLayout(self.properties_box)
## Title ## Title
title_label = QtWidgets.QLabel("<font size=4><b>&nbsp;%s</b></font>" % self.toolName) title_label = QtWidgets.QLabel("%s" % self.toolName)
title_label.setStyleSheet("""
QLabel
{
font-size: 16px;
font-weight: bold;
}
""")
self.properties_box.addWidget(title_label) self.properties_box.addWidget(title_label)
# self.layout.setMargin(0) # PyQt4 # self.layout.setMargin(0) # PyQt4

View File

@ -20,7 +20,14 @@ class ToolTransform(FlatCAMTool):
self.transform_lay = QtWidgets.QVBoxLayout() self.transform_lay = QtWidgets.QVBoxLayout()
self.layout.addLayout(self.transform_lay) self.layout.addLayout(self.transform_lay)
## Title ## Title
title_label = QtWidgets.QLabel("<font size=4><b>%s</b></font><br>" % self.toolName) title_label = QtWidgets.QLabel("%s" % self.toolName)
title_label.setStyleSheet("""
QLabel
{
font-size: 16px;
font-weight: bold;
}
""")
self.transform_lay.addWidget(title_label) self.transform_lay.addWidget(title_label)
self.empty_label = QtWidgets.QLabel("") self.empty_label = QtWidgets.QLabel("")
@ -368,7 +375,7 @@ class ToolTransform(FlatCAMTool):
self.app.ui.notebook.setTabText(2, "Transform Tool") self.app.ui.notebook.setTabText(2, "Transform Tool")
def install(self, icon=None, separator=None, **kwargs): def install(self, icon=None, separator=None, **kwargs):
FlatCAMTool.install(self, icon, separator, shortcut='ALT+R', **kwargs) FlatCAMTool.install(self, icon, separator, shortcut='ALT+T', **kwargs)
def set_tool_ui(self): def set_tool_ui(self):
## Initialize form ## Initialize form