- for Excellon, Geometry and Gerber objects now in the Object UI (Properties Tab) by default the Offset field is populated with the coordinates of the center of the current object

This commit is contained in:
Marius Stanciu
2021-01-08 04:01:10 +02:00
committed by Marius
parent bd1d48bde0
commit 4539d22329
5 changed files with 22 additions and 1 deletions

View File

@@ -11,6 +11,7 @@ CHANGELOG for FlatCAM beta
- added the toggle button for Beginner/Advanced mode for the CNCjob, Geometry, Gerber, Excellon Objects UI (Properties Tab) - added the toggle button for Beginner/Advanced mode for the CNCjob, Geometry, Gerber, Excellon Objects UI (Properties Tab)
- some changes in PreferencesManager due of Milling Tool changing names of the geometry defaults to tools_mill_ defaults - some changes in PreferencesManager due of Milling Tool changing names of the geometry defaults to tools_mill_ defaults
- for Excellon, Geometry and Gerber objects now in the Object UI (Properties Tab) by default the Offset field is populated with the coordinates of the center of the current object
6.01.2021 6.01.2021

View File

@@ -127,7 +127,6 @@ class ObjectUI(QtWidgets.QWidget):
# ### Offset #### # ### Offset ####
self.offsetvector_entry = NumericalEvalTupleEntry(border_color='#0069A9') self.offsetvector_entry = NumericalEvalTupleEntry(border_color='#0069A9')
self.offsetvector_entry.setText("(0.0, 0.0)")
self.offsetvector_entry.setToolTip( self.offsetvector_entry.setToolTip(
_("Amount by which to move the object\n" _("Amount by which to move the object\n"
"in the x and y axes in (x, y) format.\n" "in the x and y axes in (x, y) format.\n"

View File

@@ -187,6 +187,13 @@ class ExcellonObject(FlatCAMObj, Excellon):
self.units_found = self.app.defaults['units'] self.units_found = self.app.defaults['units']
xmin, ymin, xmax, ymax = self.bounds()
center_coords = (
xmin + abs((xmax - xmin) / 2),
ymin + abs((ymax - ymin) / 2)
)
self.ui.offsetvector_entry.set_value(str(center_coords))
def change_level(self, level): def change_level(self, level):
""" """

View File

@@ -701,6 +701,13 @@ class GeometryObject(FlatCAMObj, Geometry):
# #
# self.launch_job.connect(self.mtool_gen_cncjob) # self.launch_job.connect(self.mtool_gen_cncjob)
xmin, ymin, xmax, ymax = self.bounds()
center_coords = (
xmin + abs((xmax - xmin) / 2),
ymin + abs((ymax - ymin) / 2)
)
self.ui.offsetvector_entry.set_value(str(center_coords))
# Show/Hide Advanced Options # Show/Hide Advanced Options
app_mode = self.app.defaults["global_app_level"] app_mode = self.app.defaults["global_app_level"]
self.change_level(app_mode) self.change_level(app_mode)

View File

@@ -195,6 +195,13 @@ class GerberObject(FlatCAMObj, Gerber):
self.build_ui() self.build_ui()
self.units_found = self.app.defaults['units'] self.units_found = self.app.defaults['units']
xmin, ymin, xmax, ymax = self.bounds()
center_coords = (
xmin + abs((xmax - xmin) / 2),
ymin + abs((ymax - ymin) / 2)
)
self.ui.offsetvector_entry.set_value(str(center_coords))
def change_level(self, level): def change_level(self, level):
""" """