ソースを参照

- finished the Calibration Tool
- changed the Scale Entry in Object UI to FCEntry() GUI element in order to allow expressions to be entered. E.g: 1/25.4

Marius Stanciu 6 年 前
コミット
1cb66f3faf

+ 5 - 0
FlatCAMApp.py

@@ -902,6 +902,8 @@ class App(QtCore.QObject):
             "tools_cal_verz": 0.1,
             "tools_cal_zeroz": False,
             "tools_cal_toolchangez": 15,
+            "tools_cal_toolchange_xy": '',
+            "tools_cal_sec_point": 'tl',
 
             # Utilities
             # file associations
@@ -1484,6 +1486,8 @@ class App(QtCore.QObject):
             "tools_cal_verz": self.ui.tools2_defaults_form.tools2_cal_group.verz_entry,
             "tools_cal_zeroz": self.ui.tools2_defaults_form.tools2_cal_group.zeroz_cb,
             "tools_cal_toolchangez": self.ui.tools2_defaults_form.tools2_cal_group.toolchangez_entry,
+            "tools_cal_toolchange_xy": self.ui.tools2_defaults_form.tools2_cal_group.toolchange_xy_entry,
+            "tools_cal_sec_point": self.ui.tools2_defaults_form.tools2_cal_group.second_point_radio,
 
             # Utilities
             # File associations
@@ -3151,6 +3155,7 @@ class App(QtCore.QObject):
 
         # Tools Toolbar Signals
         self.ui.dblsided_btn.triggered.connect(lambda: self.dblsidedtool.run(toggle=True))
+        self.ui.cal_btn.triggered.connect(lambda: self.cal_exc_tool.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))

+ 2 - 1
FlatCAMObj.py

@@ -199,6 +199,7 @@ class FlatCAMObj(QtCore.QObject):
         #     self.ui.scale_entry.returnPressed.connect(self.on_scale_button_click)
         # except (TypeError, AttributeError):
         #     pass
+
         # self.ui.skew_button.clicked.connect(self.on_skew_button_click)
 
     def build_ui(self):
@@ -267,7 +268,7 @@ class FlatCAMObj(QtCore.QObject):
 
     def on_scale_button_click(self):
         self.read_form()
-        factor = self.ui.scale_entry.get_value()
+        factor = eval(self.ui.scale_entry.get_value())
         # if factor is 1.0 do nothing, there is no point in scaling with a factor of 1.0
         if factor == 1.0:
             return

+ 5 - 0
README.md

@@ -9,6 +9,11 @@ CAD program, and create G-Code for Isolation routing.
 
 =================================================
 
+12.12.2019
+
+- finished the Calibration Tool
+- changed the Scale Entry in Object UI to FCEntry() GUI element in order to allow expressions to be entered. E.g: 1/25.4
+
 11.12.2019
 
 - started work in HPGL2 parser

+ 2 - 0
flatcamGUI/FlatCAMGUI.py

@@ -754,6 +754,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
                                                           _("Copper Thieving Tool"))
 
         self.fiducials_btn = self.toolbartools.addAction(QtGui.QIcon('share/fiducials_32.png'), _("Fiducials Tool"))
+        self.cal_btn = self.toolbartools.addAction(QtGui.QIcon('share/calibrate_32.png'), _("Calibration Tool"))
 
         # ########################################################################
         # ########################## Excellon Editor Toolbar# ####################
@@ -2198,6 +2199,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
                                                           _("Copper Thieving Tool"))
 
         self.fiducials_btn = self.toolbartools.addAction(QtGui.QIcon('share/fiducials_32.png'), _("Fiducials Tool"))
+        self.cal_btn = self.toolbartools.addAction(QtGui.QIcon('share/calibrate_32.png'), _("Calibration Tool"))
 
         # ## Excellon Editor Toolbar # ##
         self.select_drill_btn = self.exc_edit_toolbar.addAction(QtGui.QIcon('share/pointer32.png'), _("Select"))

+ 3 - 6
flatcamGUI/ObjectUI.py

@@ -100,13 +100,10 @@ class ObjectUI(QtWidgets.QWidget):
             faclabel = QtWidgets.QLabel('%s:' % _('Factor'))
             faclabel.setToolTip(
                 _("Factor by which to multiply\n"
-                  "geometric features of this object.")
+                  "geometric features of this object.\n"
+                  "Expressions are allowed. E.g: 1/25.4")
             )
-            self.scale_entry = FCDoubleSpinner()
-            self.scale_entry.set_precision(self.decimals)
-            self.scale_entry.setRange(0.0, 9999.9999)
-            self.scale_entry.setSingleStep(0.1)
-
+            self.scale_entry = FCEntry()
             self.scale_entry.set_value(1.0)
 
             # GO Button

+ 27 - 0
flatcamGUI/PreferencesUI.py

@@ -6513,6 +6513,33 @@ class Tools2CalPrefGroupUI(OptionsGroupUI):
         grid_lay.addWidget(toolchangez_lbl, 6, 0)
         grid_lay.addWidget(self.toolchangez_entry, 6, 1, 1, 2)
 
+        # Toolchange X-Y entry
+        toolchangexy_lbl = QtWidgets.QLabel('%s:' % _('Toolchange X-Y'))
+        toolchangexy_lbl.setToolTip(
+            _("Toolchange X,Y position.\n"
+              "If no value is entered then the current\n"
+              "(x, y) point will be used,")
+        )
+
+        self.toolchange_xy_entry = FCEntry()
+
+        grid_lay.addWidget(toolchangexy_lbl, 7, 0)
+        grid_lay.addWidget(self.toolchange_xy_entry, 7, 1, 1, 2)
+
+        # Second point choice
+        second_point_lbl = QtWidgets.QLabel('%s:' % _("Second point"))
+        second_point_lbl.setToolTip(
+            _("Second point in the Gcode verification can be:\n"
+              "- top-left -> the user will align the PCB vertically\n"
+              "- bottom-right -> the user will align the PCB horizontally")
+        )
+        self.second_point_radio = RadioSet([{'label': _('Top-Left'), 'value': 'tl'},
+                                            {'label': _('Bottom-Right'), 'value': 'br'}],
+                                           orientation='vertical')
+
+        grid_lay.addWidget(second_point_lbl, 8, 0)
+        grid_lay.addWidget(self.second_point_radio, 8, 1, 1, 2)
+
         self.layout.addStretch()
 
 

ファイルの差分が大きいため隠しています
+ 366 - 274
flatcamTools/ToolCalibration.py


+ 1 - 1
flatcamTools/ToolDblSided.py

@@ -153,7 +153,7 @@ class DblSidedTool(FlatCAMTool):
         # ## Axis Location
         self.axis_location = RadioSet([{'label': _('Point'), 'value': 'point'},
                                        {'label': _('Box'), 'value': 'box'}])
-        self.axloc_label = QtWidgets.QLabel(_("Axis Ref:"))
+        self.axloc_label = QtWidgets.QLabel('%s:' % _("Axis Ref"))
         self.axloc_label.setToolTip(
             _("The axis should pass through a <b>point</b> or cut\n "
               "a specified <b>box</b> (in a FlatCAM object) through \n"

この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません