- in Geometry Object fixed the issue with not using the End X-Y value and also made some other updates here

This commit is contained in:
Marius Stanciu 2020-10-21 09:26:01 +03:00 committed by Marius
parent af85764730
commit d4555c02d0
6 changed files with 67 additions and 61 deletions

View File

@ -7,6 +7,10 @@ CHANGELOG for FlatCAM beta
=================================================
21.10.2020
- in Geometry Object fixed the issue with not using the End X-Y value and also made some other updates here
20.10.2020
- finished to add the Properties data to the Object Properties (former Selected Tab)

View File

@ -438,6 +438,11 @@ class GeometryObject(FlatCAMObj, Geometry):
"area_shape": self.ui.area_shape_radio,
"area_strategy": self.ui.strategy_radio,
"area_overz": self.ui.over_z_entry,
"polish": self.ui.polish_cb,
"polish_dia": self.ui.polish_dia_entry,
"polish_pressure": self.ui.polish_pressure_entry,
"polish_overlap": self.ui.polish_over_entry,
"polish_method": self.ui.polish_method_combo,
})
self.param_fields.update({
@ -741,7 +746,13 @@ class GeometryObject(FlatCAMObj, Geometry):
self.ui.plot_cb.stateChanged.connect(self.on_plot_cb_click)
# common parameters update
self.ui.toolchangeg_cb.stateChanged.connect(self.update_common_param_in_storage)
self.ui.toolchangez_entry.editingFinished.connect(self.update_common_param_in_storage)
self.ui.endz_entry.editingFinished.connect(self.update_common_param_in_storage)
self.ui.endxy_entry.editingFinished.connect(self.update_common_param_in_storage)
self.ui.pp_geometry_name_cb.currentIndexChanged.connect(self.update_common_param_in_storage)
self.ui.exclusion_cb.stateChanged.connect(self.update_common_param_in_storage)
self.ui.polish_cb.stateChanged.connect(self.update_common_param_in_storage)
def ui_disconnect(self):
@ -825,6 +836,36 @@ class GeometryObject(FlatCAMObj, Geometry):
except (TypeError, AttributeError):
pass
# common parameters update
try:
self.ui.toolchangeg_cb.stateChanged.disconnect(self.update_common_param_in_storage)
except (TypeError, AttributeError):
pass
try:
self.ui.toolchangez_entry.editingFinished.disconnect(self.update_common_param_in_storage)
except (TypeError, AttributeError):
pass
try:
self.ui.endz_entry.editingFinished.disconnect(self.update_common_param_in_storage)
except (TypeError, AttributeError):
pass
try:
self.ui.endxy_entry.editingFinished.disconnect(self.update_common_param_in_storage)
except (TypeError, AttributeError):
pass
try:
self.ui.pp_geometry_name_cb.currentIndexChanged.disconnect(self.update_common_param_in_storage)
except (TypeError, AttributeError):
pass
try:
self.ui.exclusion_cb.stateChanged.disconnect(self.update_common_param_in_storage)
except (TypeError, AttributeError):
pass
try:
self.ui.polish_cb.stateChanged.disconnect(self.update_common_param_in_storage)
except (TypeError, AttributeError):
pass
def on_toggle_all_rows(self):
"""
will toggle the selection of all rows in Tools table
@ -1574,7 +1615,13 @@ class GeometryObject(FlatCAMObj, Geometry):
def update_common_param_in_storage(self):
for tooluid_value in self.tools.values():
tooluid_value['data']['toolchange'] = self.ui.toolchangeg_cb.get_value()
tooluid_value['data']['toolchangez'] = self.ui.toolchangez_entry.get_value()
tooluid_value['data']['endz'] = self.ui.endz_entry.get_value()
tooluid_value['data']['endxy'] = self.ui.endxy_entry.get_value()
tooluid_value['data']['ppname_g'] = self.ui.pp_geometry_name_cb.get_value()
tooluid_value['data']['area_exclusion'] = self.ui.exclusion_cb.get_value()
tooluid_value['data']['polish'] = self.ui.polish_cb.get_value()
def select_tools_table_row(self, row, clearsel=None):
if clearsel:

View File

@ -971,7 +971,7 @@ class ObjectCollection(QtCore.QAbstractItemModel):
except Exception as e:
log.debug("Nothing to remove. %s" % str(e))
self.app.setup_component_editor()
self.app.setup_default_properties_tab()
return
if obj:

View File

@ -1092,7 +1092,7 @@ class App(QtCore.QObject):
self.ui.splitter.setSizes([0, 1])
# Sets up FlatCAMObj, FCProcess and FCProcessContainer.
self.setup_component_editor()
self.setup_default_properties_tab()
# ###########################################################################################################
# ####################################### Auto-complete KEYWORDS ############################################
@ -4655,7 +4655,7 @@ class App(QtCore.QObject):
self.collection.delete_active()
# Clear form
self.setup_component_editor()
self.setup_default_properties_tab()
self.inform.emit('%s: %s' % (_("Object deleted"), name))
@ -6965,7 +6965,7 @@ class App(QtCore.QObject):
self.collection.delete_all()
# add in Selected tab an initial text that describe the flow of work in FlatCAm
self.setup_component_editor()
self.setup_default_properties_tab()
# Clear project filename
self.project_filename = None
@ -9677,9 +9677,9 @@ class App(QtCore.QObject):
self.log.debug("Recent items list has been populated.")
def setup_component_editor(self):
def setup_default_properties_tab(self):
"""
Default text for the Selected tab when is not taken by the Object UI.
Default text for the Properties tab when is not taken by the Object UI.
:return:
"""
@ -9698,58 +9698,7 @@ class App(QtCore.QObject):
tsize = fsize + int(fsize / 2)
selected_text = '''
<p><span style="font-size:{tsize}px"><strong>{title}</strong></span></p>
<p><span style="font-size:{fsize}px"><strong>{subtitle}</strong>:<br />
{s1}</span></p>
<ol>
<li><span style="font-size:{fsize}px">{s2}<br />
<br />
{s3}</span><br />
&nbsp;</li>
<li><span style="font-size:{fsize}px">{s4}<br />
&nbsp;</li>
<br />
<li><span style="font-size:{fsize}px">{s5}<br />
&nbsp;</li>
<br />
<li><span style="font-size:{fsize}px">{s6}<br />
<br />
{s7}</span></li>
</ol>
<p><span style="font-size:{fsize}px">{s8}</span></p>
'''.format(
title=_("Properties Tab - Choose an Item from Project Tab"),
subtitle=_("Details"),
s1=_("The normal flow when working with the application is the following:"),
s2=_("Load/Import a Gerber, Excellon, Gcode, DXF, Raster Image or SVG file into the application "
"using either the toolbars, key shortcuts or even dragging and dropping the "
"files on the GUI."),
s3=_("You can also load a project by double clicking on the project file, "
"drag and drop of the file into the GUI or through the menu (or toolbar) "
"actions offered within the app."),
s4=_("Once an object is available in the Project Tab, by selecting it and then focusing "
"on Properties TAB (more simpler is to double click the object name in the Project Tab, "
"Properties TAB will be updated with the object properties according to its kind: "
"Gerber, Excellon, Geometry or CNCJob object."),
s5=_("If the selection of the object is done on the canvas by single click instead, "
"and the Properties TAB is in focus, again the object properties will be displayed into the "
"Properties Tab. Alternatively, double clicking on the object on the canvas will bring "
"the Properties TAB and populate it even if it was out of focus."),
s6=_("You can change the parameters in this screen and the flow direction is like this:"),
s7=_("Gerber/Excellon Object --> Change Parameter --> Generate Geometry --> Geometry Object --> "
"Add tools (change param in Selected Tab) --> Generate CNCJob --> CNCJob Object --> "
"Verify GCode (through Edit CNC Code) and/or append/prepend to GCode "
"(again, done in SELECTED TAB) --> Save GCode."),
s8=_("A list of key shortcuts is available through an menu entry in Help --> Shortcuts List "
"or through its own key shortcut: <b>F3</b>."),
tsize=tsize,
fsize=fsize
)
selected_text = ''
sel_title.setText(selected_text)
sel_title.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)

View File

@ -4875,7 +4875,7 @@ class CNCjob(Geometry):
:return: GCode - string
"""
log.debug("Generate_from_multitool_geometry()")
log.debug("generate_from_multitool_geometry()")
temp_solid_geometry = []
if offset != 0.0:
@ -5185,7 +5185,7 @@ class CNCjob(Geometry):
:rtype: str
"""
log.debug("Generate_from_multitool_geometry()")
log.debug("geometry_tool_gcode_gen()")
t_gcode = ''
temp_solid_geometry = []
@ -5310,8 +5310,9 @@ class CNCjob(Geometry):
self.startz = None
self.z_end = float(tool_dict['endz'])
self.xy_end = tool_dict['endxy']
try:
if self.xy_end == '':
if self.xy_end == '' or self.xy_end is None:
self.xy_end = None
else:
# either originally it was a string or not, xy_end will be made string

View File

@ -339,6 +339,11 @@ class FlatCAMDefaults:
"geometry_area_shape": "polygon",
"geometry_area_strategy": "over",
"geometry_area_overz": 1.0,
"geometry_polish": False,
"geometry_polish_dia": 10.0,
"geometry_polish_pressure": -1.0,
"geometry_polish_overlap": 1.0,
"geometry_polish_method": _("Standard"),
# Geometry Editor
"geometry_editor_sel_limit": 30,