Browse Source

- converted all ObjectUI entries to FCDoubleSpinner and FCSpinner

Marius Stanciu 6 năm trước cách đây
mục cha
commit
4ce84ec00a
3 tập tin đã thay đổi với 252 bổ sung102 xóa
  1. 1 0
      README.md
  2. 248 100
      flatcamGUI/ObjectUI.py
  3. 3 2
      flatcamGUI/PreferencesUI.py

+ 1 - 0
README.md

@@ -14,6 +14,7 @@ CAD program, and create G-Code for Isolation routing.
 - modified the result highlight color in Check Rules Tool
 - added the Check Rules Tool parameters to the unit conversion list
 - converted more of the Preferences entries to FCDoubleSpinner and FCSpinner
+- converted all ObjectUI entries to FCDoubleSpinner and FCSpinner
 
 13.10.2019
 

+ 248 - 100
flatcamGUI/ObjectUI.py

@@ -34,6 +34,8 @@ class ObjectUI(QtWidgets.QWidget):
     def __init__(self, icon_file='share/flatcam_icon32.png', title=_('FlatCAM Object'), parent=None, common=True):
         QtWidgets.QWidget.__init__(self, parent=parent)
 
+        self.decimals = 4
+
         layout = QtWidgets.QVBoxLayout()
         self.setLayout(layout)
 
@@ -76,15 +78,18 @@ class ObjectUI(QtWidgets.QWidget):
         # ## Common to all objects ##
         # ###########################
         if common is True:
+            grid0 = QtWidgets.QGridLayout()
+            layout.addLayout(grid0)
+            grid0.setColumnStretch(0, 0)
+            grid0.setColumnStretch(1, 1)
+
             # ### Scale ####
-            self.scale_label = QtWidgets.QLabel('<b>%s:</b>' % _('Scale'))
+            self.scale_label = QtWidgets.QLabel('<b>%s</b>' % _('Scale'))
             self.scale_label.setToolTip(
                 _("Change the size of the object.")
             )
-            layout.addWidget(self.scale_label)
 
-            self.scale_grid = QtWidgets.QGridLayout()
-            layout.addLayout(self.scale_grid)
+            grid0.addWidget(self.scale_label, 0, 0, 1, 3)
 
             # Factor
             faclabel = QtWidgets.QLabel('%s:' % _('Factor'))
@@ -92,10 +97,12 @@ class ObjectUI(QtWidgets.QWidget):
                 _("Factor by which to multiply\n"
                   "geometric features of this object.")
             )
-            self.scale_grid.addWidget(faclabel, 0, 0)
-            self.scale_entry = FloatEntry2()
+            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.set_value(1.0)
-            self.scale_grid.addWidget(self.scale_entry, 0, 1)
 
             # GO Button
             self.scale_button = QtWidgets.QPushButton(_('Scale'))
@@ -103,34 +110,36 @@ class ObjectUI(QtWidgets.QWidget):
                 _("Perform scaling operation.")
             )
             self.scale_button.setMinimumWidth(70)
-            self.scale_grid.addWidget(self.scale_button, 0, 2)
+
+            grid0.addWidget(faclabel, 1, 0)
+            grid0.addWidget(self.scale_entry, 1, 1)
+            grid0.addWidget(self.scale_button, 1, 2)
 
             # ### Offset ####
-            self.offset_label = QtWidgets.QLabel('<b>%s:</b>' % _('Offset'))
+            self.offset_label = QtWidgets.QLabel('<b>%s</b>' % _('Offset'))
             self.offset_label.setToolTip(
                 _("Change the position of this object.")
             )
-            layout.addWidget(self.offset_label)
 
-            self.offset_grid = QtWidgets.QGridLayout()
-            layout.addLayout(self.offset_grid)
+            grid0.addWidget(self.offset_label, 2, 0, 1, 3)
 
             self.offset_vectorlabel = QtWidgets.QLabel('%s:' % _('Vector'))
             self.offset_vectorlabel.setToolTip(
                 _("Amount by which to move the object\n"
                   "in the x and y axes in (x, y) format.")
             )
-            self.offset_grid.addWidget(self.offset_vectorlabel, 0, 0)
             self.offsetvector_entry = EvalEntry2()
             self.offsetvector_entry.setText("(0.0, 0.0)")
-            self.offset_grid.addWidget(self.offsetvector_entry, 0, 1)
 
             self.offset_button = QtWidgets.QPushButton(_('Offset'))
             self.offset_button.setToolTip(
                 _("Perform the offset operation.")
             )
             self.offset_button.setMinimumWidth(70)
-            self.offset_grid.addWidget(self.offset_button, 0, 2)
+
+            grid0.addWidget(self.offset_vectorlabel, 3, 0)
+            grid0.addWidget(self.offsetvector_entry, 3, 1)
+            grid0.addWidget(self.offset_button, 3, 2)
 
         layout.addStretch()
 
@@ -142,11 +151,14 @@ class GerberObjectUI(ObjectUI):
 
     def __init__(self, parent=None):
         ObjectUI.__init__(self, title=_('Gerber Object'), parent=parent)
+        self.decimals = 4
 
         # Plot options
         grid0 = QtWidgets.QGridLayout()
         grid0.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter)
         self.custom_box.addLayout(grid0)
+        grid0.setColumnStretch(0, 0)
+        grid0.setColumnStretch(1, 1)
 
         self.plot_options_label = QtWidgets.QLabel("<b>%s:</b>" % _("Plot Options"))
         self.plot_options_label.setMinimumWidth(90)
@@ -247,8 +259,10 @@ class GerberObjectUI(ObjectUI):
         # start with apertures table hidden
         self.apertures_table.setVisible(False)
 
+        self.custom_box.addWidget(QtWidgets.QLabel(''))
+
         # Isolation Routing
-        self.isolation_routing_label = QtWidgets.QLabel("<b>%s:</b>" % _("Isolation Routing"))
+        self.isolation_routing_label = QtWidgets.QLabel("<b>%s</b>" % _("Isolation Routing"))
         self.isolation_routing_label.setToolTip(
             _("Create a Geometry object with\n"
               "toolpaths to cut outside polygons.")
@@ -261,9 +275,11 @@ class GerberObjectUI(ObjectUI):
 
         grid1 = QtWidgets.QGridLayout()
         self.custom_box.addLayout(grid1)
+        grid1.setColumnStretch(0, 0)
+        grid1.setColumnStretch(1, 1)
 
         # Tool Type
-        self.tool_type_label = QtWidgets.QLabel('<b>%s</b>' % _('Tool Type'))
+        self.tool_type_label = QtWidgets.QLabel('%s:' % _('Tool Type'))
         self.tool_type_label.setToolTip(
             _("Choose what tool to use for Gerber isolation:\n"
               "'Circular' or 'V-shape'.\n"
@@ -283,6 +299,7 @@ class GerberObjectUI(ObjectUI):
         )
         self.tipdia_spinner = FCDoubleSpinner()
         self.tipdia_spinner.set_range(-99.9999, 99.9999)
+        self.tipdia_spinner.set_precision(self.decimals)
         self.tipdia_spinner.setSingleStep(0.1)
         self.tipdia_spinner.setWrapping(True)
         grid1.addWidget(self.tipdialabel, 1, 0)
@@ -294,8 +311,9 @@ class GerberObjectUI(ObjectUI):
             _("The tip angle for V-Shape Tool.\n"
               "In degree.")
         )
-        self.tipangle_spinner = FCSpinner()
+        self.tipangle_spinner = FCDoubleSpinner()
         self.tipangle_spinner.set_range(0, 180)
+        self.tipangle_spinner.set_precision(self.decimals)
         self.tipangle_spinner.setSingleStep(5)
         self.tipangle_spinner.setWrapping(True)
         grid1.addWidget(self.tipanglelabel, 2, 0)
@@ -308,7 +326,8 @@ class GerberObjectUI(ObjectUI):
               "below the copper surface.")
         )
         self.cutz_spinner = FCDoubleSpinner()
-        self.cutz_spinner.set_range(-99.9999, -0.0001)
+        self.cutz_spinner.set_range(-9999.9999, -0.0001)
+        self.cutz_spinner.set_precision(self.decimals)
         self.cutz_spinner.setSingleStep(0.1)
         self.cutz_spinner.setWrapping(True)
         grid1.addWidget(self.cutzlabel, 3, 0)
@@ -324,7 +343,11 @@ class GerberObjectUI(ObjectUI):
               "this parameter.")
         )
         tdlabel.setMinimumWidth(90)
-        self.iso_tool_dia_entry = LengthEntry()
+        self.iso_tool_dia_entry = FCDoubleSpinner()
+        self.iso_tool_dia_entry.set_range(0, 9999.9999)
+        self.iso_tool_dia_entry.set_precision(self.decimals)
+        self.iso_tool_dia_entry.setSingleStep(0.1)
+
         grid1.addWidget(tdlabel, 4, 0)
         grid1.addWidget(self.iso_tool_dia_entry, 4, 1, 1, 2)
 
@@ -349,7 +372,7 @@ class GerberObjectUI(ObjectUI):
         )
         overlabel.setMinimumWidth(90)
         self.iso_overlap_entry = FCDoubleSpinner()
-        self.iso_overlap_entry.set_precision(3)
+        self.iso_overlap_entry.set_precision(self.decimals)
         self.iso_overlap_entry.setWrapping(True)
         self.iso_overlap_entry.setRange(0.000, 0.999)
         self.iso_overlap_entry.setSingleStep(0.1)
@@ -427,7 +450,7 @@ class GerberObjectUI(ObjectUI):
 
         form_layout.addRow(self.obj_label, self.obj_combo)
 
-        self.gen_iso_label = QtWidgets.QLabel("<b>%s:</b>" % _("Generate Isolation Geometry"))
+        self.gen_iso_label = QtWidgets.QLabel("<b>%s</b>" % _("Generate Isolation Geometry"))
         self.gen_iso_label.setToolTip(
             _("Create a Geometry object with toolpaths to cut \n"
               "isolation outside, inside or on both sides of the\n"
@@ -497,12 +520,14 @@ class GerberObjectUI(ObjectUI):
 
         grid2 = QtWidgets.QGridLayout()
         self.custom_box.addLayout(grid2)
+        grid2.setColumnStretch(0, 0)
+        grid2.setColumnStretch(1, 1)
 
-        self.tool_lbl = QtWidgets.QLabel('<b>%s</b>:' % _("TOOLS"))
+        self.tool_lbl = QtWidgets.QLabel('<b>%s</b>' % _("TOOLS"))
         grid2.addWidget(self.tool_lbl, 0, 0, 1, 2)
 
         # ## Clear non-copper regions
-        self.clearcopper_label = QtWidgets.QLabel("<b>%s:</b>" % _("Clear N-copper"))
+        self.clearcopper_label = QtWidgets.QLabel("%s" % _("Clear N-copper"))
         self.clearcopper_label.setToolTip(
             _("Create a Geometry object with\n"
               "toolpaths to cut all non-copper regions.")
@@ -518,7 +543,7 @@ class GerberObjectUI(ObjectUI):
         grid2.addWidget(self.generate_ncc_button, 1, 1)
 
         # ## Board cutout
-        self.board_cutout_label = QtWidgets.QLabel("<b>%s:</b>" % _("Board cutout"))
+        self.board_cutout_label = QtWidgets.QLabel("%s" % _("Board cutout"))
         self.board_cutout_label.setToolTip(
             _("Create toolpaths to cut around\n"
               "the PCB and separate it from\n"
@@ -534,7 +559,7 @@ class GerberObjectUI(ObjectUI):
         grid2.addWidget(self.generate_cutout_button, 2, 1)
 
         # ## Non-copper regions
-        self.noncopper_label = QtWidgets.QLabel("<b>%s:</b>" % _("Non-copper regions"))
+        self.noncopper_label = QtWidgets.QLabel("<b>%s</b>" % _("Non-copper regions"))
         self.noncopper_label.setToolTip(
             _("Create polygons covering the\n"
               "areas without copper on the PCB.\n"
@@ -554,7 +579,11 @@ class GerberObjectUI(ObjectUI):
               "distance.")
         )
         bmlabel.setMinimumWidth(90)
-        self.noncopper_margin_entry = LengthEntry()
+        self.noncopper_margin_entry = FCDoubleSpinner()
+        self.noncopper_margin_entry.set_range(-9999.9999, 9999.9999)
+        self.noncopper_margin_entry.set_precision(self.decimals)
+        self.noncopper_margin_entry.setSingleStep(0.1)
+
         grid2.addWidget(bmlabel, 4, 0)
         grid2.addWidget(self.noncopper_margin_entry, 4, 1)
 
@@ -570,7 +599,7 @@ class GerberObjectUI(ObjectUI):
         grid2.addWidget(self.generate_noncopper_button, 5, 1)
 
         # ## Bounding box
-        self.boundingbox_label = QtWidgets.QLabel('<b>%s:</b>' % _('Bounding Box'))
+        self.boundingbox_label = QtWidgets.QLabel('<b>%s</b>' % _('Bounding Box'))
         self.boundingbox_label.setToolTip(
             _("Create a geometry surrounding the Gerber object.\n"
               "Square shape.")
@@ -584,7 +613,11 @@ class GerberObjectUI(ObjectUI):
               "to the nearest polygon.")
         )
         bbmargin.setMinimumWidth(90)
-        self.bbmargin_entry = LengthEntry()
+        self.bbmargin_entry = FCDoubleSpinner()
+        self.bbmargin_entry.set_range(-9999.9999, 9999.9999)
+        self.bbmargin_entry.set_precision(self.decimals)
+        self.bbmargin_entry.setSingleStep(0.1)
+
         grid2.addWidget(bbmargin, 7, 0)
         grid2.addWidget(self.bbmargin_entry, 7, 1)
 
@@ -615,6 +648,8 @@ class ExcellonObjectUI(ObjectUI):
                           icon_file='share/drill32.png',
                           parent=parent)
 
+        self.decimals = 4
+
         # ### Plot options ####
         hlay_plot = QtWidgets.QHBoxLayout()
         self.custom_box.addLayout(hlay_plot)
@@ -709,6 +744,8 @@ class ExcellonObjectUI(ObjectUI):
 
         grid1 = QtWidgets.QGridLayout()
         self.tools_box.addLayout(grid1)
+        grid1.setColumnStretch(0, 0)
+        grid1.setColumnStretch(1, 1)
 
         # Cut Z
         cutzlabel = QtWidgets.QLabel('%s:' % _('Cut Z'))
@@ -717,7 +754,11 @@ class ExcellonObjectUI(ObjectUI):
               "below the copper surface.")
         )
         grid1.addWidget(cutzlabel, 0, 0)
-        self.cutz_entry = LengthEntry()
+        self.cutz_entry = FCDoubleSpinner()
+        self.cutz_entry.set_precision(self.decimals)
+        self.cutz_entry.setRange(-9999.9999, -0.000001)
+        self.cutz_entry.setSingleStep(0.1)
+
         grid1.addWidget(self.cutz_entry, 0, 1)
 
         # Travel Z (z_move)
@@ -727,16 +768,20 @@ class ExcellonObjectUI(ObjectUI):
               "across the XY plane.")
         )
         grid1.addWidget(travelzlabel, 1, 0)
-        self.travelz_entry = LengthEntry()
+        self.travelz_entry = FCDoubleSpinner()
+        self.travelz_entry.set_precision(self.decimals)
+        self.travelz_entry.setRange(0.0, 9999.9999)
+        self.travelz_entry.setSingleStep(0.1)
+
         grid1.addWidget(self.travelz_entry, 1, 1)
 
         # Tool change:
-        self.toolchange_cb = FCCheckBox('%s:' % _("Tool change"))
+        self.toolchange_cb = FCCheckBox('%s' % _("Tool change"))
         self.toolchange_cb.setToolTip(
             _("Include tool-change sequence\n"
               "in G-Code (Pause for tool change).")
         )
-        grid1.addWidget(self.toolchange_cb, 2, 0)
+        grid1.addWidget(self.toolchange_cb, 2, 0, 1, 2)
 
         # Tool change Z:
         toolchzlabel = QtWidgets.QLabel('%s:' % _("Tool change Z"))
@@ -745,7 +790,11 @@ class ExcellonObjectUI(ObjectUI):
               "tool change.")
         )
         grid1.addWidget(toolchzlabel, 3, 0)
-        self.toolchangez_entry = LengthEntry()
+        self.toolchangez_entry = FCDoubleSpinner()
+        self.toolchangez_entry.set_precision(self.decimals)
+        self.toolchangez_entry.setRange(0.0, 9999.9999)
+        self.toolchangez_entry.setSingleStep(0.1)
+
         grid1.addWidget(self.toolchangez_entry, 3, 1)
         self.ois_tcz_e = OptionalInputSection(self.toolchange_cb, [self.toolchangez_entry])
 
@@ -766,7 +815,11 @@ class ExcellonObjectUI(ObjectUI):
               "the last move at the end of the job.")
         )
         grid1.addWidget(self.eendz_label, 5, 0)
-        self.eendz_entry = LengthEntry()
+        self.eendz_entry = FCDoubleSpinner()
+        self.eendz_entry.set_precision(self.decimals)
+        self.eendz_entry.setRange(0.0, 9999.9999)
+        self.eendz_entry.setSingleStep(0.1)
+
         grid1.addWidget(self.eendz_entry, 5, 1)
 
         # Excellon Feedrate Z
@@ -778,7 +831,11 @@ class ExcellonObjectUI(ObjectUI):
               "This is for linear move G01.")
         )
         grid1.addWidget(frlabel, 6, 0)
-        self.feedrate_entry = LengthEntry()
+        self.feedrate_entry = FCDoubleSpinner()
+        self.feedrate_entry.set_precision(self.decimals)
+        self.feedrate_entry.setRange(0.0, 9999.9999)
+        self.feedrate_entry.setSingleStep(0.1)
+
         grid1.addWidget(self.feedrate_entry, 6, 1)
 
         # Excellon Rapid Feedrate
@@ -791,7 +848,11 @@ class ExcellonObjectUI(ObjectUI):
               "ignore for any other cases.")
         )
         grid1.addWidget(self.feedrate_rapid_label, 7, 0)
-        self.feedrate_rapid_entry = LengthEntry()
+        self.feedrate_rapid_entry = FCDoubleSpinner()
+        self.feedrate_rapid_entry.set_precision(self.decimals)
+        self.feedrate_rapid_entry.setRange(0.0, 9999.9999)
+        self.feedrate_rapid_entry.setSingleStep(0.1)
+
         grid1.addWidget(self.feedrate_rapid_entry, 7, 1)
         # default values is to hide
         self.feedrate_rapid_label.hide()
@@ -813,7 +874,11 @@ class ExcellonObjectUI(ObjectUI):
             _("Pause to allow the spindle to reach its\n"
               "speed before cutting.")
         )
-        self.dwelltime_entry = FCEntry()
+        self.dwelltime_entry = FCDoubleSpinner()
+        self.dwelltime_entry.set_precision(self.decimals)
+        self.dwelltime_entry.setRange(0.0, 9999.9999)
+        self.dwelltime_entry.setSingleStep(0.1)
+
         self.dwelltime_entry.setToolTip(
             _("Number of time units for spindle to dwell.")
         )
@@ -840,7 +905,11 @@ class ExcellonObjectUI(ObjectUI):
               "to probe. Negative value, in current units.")
         )
         grid1.addWidget(self.pdepth_label, 11, 0)
-        self.pdepth_entry = FCEntry()
+        self.pdepth_entry = FCDoubleSpinner()
+        self.pdepth_entry.set_precision(self.decimals)
+        self.pdepth_entry.setRange(-9999.9999, 9999.9999)
+        self.pdepth_entry.setSingleStep(0.1)
+
         grid1.addWidget(self.pdepth_entry, 11, 1)
         self.pdepth_label.hide()
         self.pdepth_entry.setVisible(False)
@@ -850,21 +919,31 @@ class ExcellonObjectUI(ObjectUI):
         self.feedrate_probe_label.setToolTip(
             _("The feedrate used while the probe is probing.")
         )
+
+        self.feedrate_probe_entry = FCDoubleSpinner()
+        self.feedrate_probe_entry.set_precision(self.decimals)
+        self.feedrate_probe_entry.setRange(0.0, 9999.9999)
+        self.feedrate_probe_entry.setSingleStep(0.1)
+
         grid1.addWidget(self.feedrate_probe_label, 12, 0)
-        self.feedrate_probe_entry = FCEntry()
         grid1.addWidget(self.feedrate_probe_entry, 12, 1)
+
         self.feedrate_probe_label.hide()
         self.feedrate_probe_entry.setVisible(False)
 
+        grid2 = QtWidgets.QGridLayout()
+        self.tools_box.addLayout(grid2)
+        grid2.setColumnStretch(0, 0)
+        grid2.setColumnStretch(1, 1)
+
         choose_tools_label = QtWidgets.QLabel(
             _("Select from the Tools Table above\n"
               "the hole dias that are to be drilled.\n"
               "Use the # column to make the selection.")
         )
-        self.tools_box.addWidget(choose_tools_label)
+        grid2.addWidget(choose_tools_label, 0, 0, 1, 3)
 
         # ### Choose what to use for Gcode creation: Drills, Slots or Both
-        gcode_box = QtWidgets.QFormLayout()
         gcode_type_label = QtWidgets.QLabel('<b>%s</b>' % _('Gcode'))
         gcode_type_label.setToolTip(
             _("Choose what to use for GCode generation:\n"
@@ -875,9 +954,8 @@ class ExcellonObjectUI(ObjectUI):
         self.excellon_gcode_type_radio = RadioSet([{'label': 'Drills', 'value': 'drills'},
                                                    {'label': 'Slots', 'value': 'slots'},
                                                    {'label': 'Both', 'value': 'both'}])
-        gcode_box.addRow(gcode_type_label, self.excellon_gcode_type_radio)
-        self.tools_box.addLayout(gcode_box)
-
+        grid2.addWidget(gcode_type_label, 1, 0)
+        grid2.addWidget(self.excellon_gcode_type_radio, 1, 1)
         # temporary action until I finish the feature
         self.excellon_gcode_type_radio.setVisible(False)
         gcode_type_label.hide()
@@ -886,54 +964,61 @@ class ExcellonObjectUI(ObjectUI):
         self.generate_cnc_button.setToolTip(
             _("Generate the CNC Job.")
         )
-        self.tools_box.addWidget(self.generate_cnc_button)
+        grid2.addWidget(self.generate_cnc_button, 2, 0, 1, 3)
 
         # ### Milling Holes Drills ####
         self.mill_hole_label = QtWidgets.QLabel('<b>%s</b>' % _('Mill Holes'))
         self.mill_hole_label.setToolTip(
             _("Create Geometry for milling holes.")
         )
-        self.tools_box.addWidget(self.mill_hole_label)
+        grid2.addWidget(self.mill_hole_label, 3, 0, 1, 3)
 
         self.choose_tools_label2 = QtWidgets.QLabel(
             _("Select from the Tools Table above\n"
               "the hole dias that are to be milled.\n"
               "Use the # column to make the selection.")
         )
-        self.tools_box.addWidget(self.choose_tools_label2)
+        grid2.addWidget(self.choose_tools_label2, 4, 0, 1, 3)
 
-        grid2 = QtWidgets.QGridLayout()
-        self.tools_box.addLayout(grid2)
         self.tdlabel = QtWidgets.QLabel('%s:' % _('Drill Tool dia'))
         self.tdlabel.setToolTip(
             _("Diameter of the cutting tool.")
         )
-        grid2.addWidget(self.tdlabel, 0, 0)
-        self.tooldia_entry = LengthEntry()
-        grid2.addWidget(self.tooldia_entry, 0, 1)
+        self.tooldia_entry = FCDoubleSpinner()
+        self.tooldia_entry.set_precision(self.decimals)
+        self.tooldia_entry.setRange(0.0, 9999.9999)
+        self.tooldia_entry.setSingleStep(0.1)
+
         self.generate_milling_button = QtWidgets.QPushButton(_('Mill Drills Geo'))
         self.generate_milling_button.setToolTip(
             _("Create the Geometry Object\n"
               "for milling DRILLS toolpaths.")
         )
-        grid2.addWidget(self.generate_milling_button, 0, 2)
 
-        grid3 = QtWidgets.QGridLayout()
-        self.custom_box.addLayout(grid3)
+        grid2.addWidget(self.tdlabel, 5, 0)
+        grid2.addWidget(self.tooldia_entry, 5, 1)
+        grid2.addWidget(self.generate_milling_button, 5, 2)
+
         self.stdlabel = QtWidgets.QLabel('%s:' % _('Slot Tool dia'))
         self.stdlabel.setToolTip(
             _("Diameter of the cutting tool\n"
               "when milling slots.")
         )
-        grid3.addWidget(self.stdlabel, 0, 0)
-        self.slot_tooldia_entry = LengthEntry()
-        grid3.addWidget(self.slot_tooldia_entry, 0, 1)
+
+        self.slot_tooldia_entry = FCDoubleSpinner()
+        self.slot_tooldia_entry.set_precision(self.decimals)
+        self.slot_tooldia_entry.setRange(0.0, 9999.9999)
+        self.slot_tooldia_entry.setSingleStep(0.1)
+
         self.generate_milling_slots_button = QtWidgets.QPushButton(_('Mill Slots Geo'))
         self.generate_milling_slots_button.setToolTip(
             _("Create the Geometry Object\n"
               "for milling SLOTS toolpaths.")
         )
-        grid3.addWidget(self.generate_milling_slots_button, 0, 2)
+
+        grid2.addWidget(self.stdlabel, 6, 0)
+        grid2.addWidget(self.slot_tooldia_entry, 6, 1)
+        grid2.addWidget(self.generate_milling_slots_button, 6, 2)
 
     def hide_drills(self, state=True):
         if state is True:
@@ -950,6 +1035,7 @@ class GeometryObjectUI(ObjectUI):
     def __init__(self, parent=None):
         super(GeometryObjectUI, self).__init__(title=_('Geometry Object'),
                                                icon_file='share/geometry32.png', parent=parent)
+        self.decimals = 4
 
         # Plot options
         self.plot_options_label = QtWidgets.QLabel("<b>%s:</b>" % _("Plot Options"))
@@ -1079,8 +1165,11 @@ class GeometryObjectUI(ObjectUI):
             )
         )
         self.grid1.addWidget(self.tool_offset_lbl, 0, 0)
-        self.tool_offset_entry = FloatEntry()
-        self.tool_offset_entry.setValidator(QtGui.QDoubleValidator(-9999.9999, 9999.9999, 4))
+        self.tool_offset_entry = FCDoubleSpinner()
+        self.tool_offset_entry.set_precision(self.decimals)
+        self.tool_offset_entry.setRange(-9999.9999, 9999.9999)
+        self.tool_offset_entry.setSingleStep(0.1)
+
         spacer_lbl = QtWidgets.QLabel(" ")
         spacer_lbl.setMinimumWidth(80)
 
@@ -1101,10 +1190,11 @@ class GeometryObjectUI(ObjectUI):
                 "Diameter for the new tool"
             )
         )
-        self.addtool_entry = FCEntry2()
+        self.addtool_entry = FCDoubleSpinner()
+        self.addtool_entry.set_precision(self.decimals)
+        self.addtool_entry.setRange(0.00001, 9999.9999)
+        self.addtool_entry.setSingleStep(0.1)
 
-        # hlay.addWidget(self.addtool_label)
-        # hlay.addStretch()
         hlay.addWidget(self.addtool_entry_lbl)
         hlay.addWidget(self.addtool_entry)
 
@@ -1173,8 +1263,12 @@ class GeometryObjectUI(ObjectUI):
                 "The tip diameter for V-Shape Tool"
             )
         )
+        self.tipdia_entry = FCDoubleSpinner()
+        self.tipdia_entry.set_precision(self.decimals)
+        self.tipdia_entry.setRange(0.00001, 9999.9999)
+        self.tipdia_entry.setSingleStep(0.1)
+
         self.grid3.addWidget(self.tipdialabel, 1, 0)
-        self.tipdia_entry = LengthEntry()
         self.grid3.addWidget(self.tipdia_entry, 1, 1)
 
         # Tip Angle
@@ -1185,8 +1279,12 @@ class GeometryObjectUI(ObjectUI):
                 "In degree."
             )
         )
+        self.tipangle_entry = FCDoubleSpinner()
+        self.tipangle_entry.set_precision(self.decimals)
+        self.tipangle_entry.setRange(0.0, 180.0)
+        self.tipangle_entry.setSingleStep(1)
+
         self.grid3.addWidget(self.tipanglelabel, 2, 0)
-        self.tipangle_entry = LengthEntry()
         self.grid3.addWidget(self.tipangle_entry, 2, 1)
 
         # Cut Z
@@ -1197,8 +1295,12 @@ class GeometryObjectUI(ObjectUI):
                 "below the copper surface."
             )
         )
+        self.cutz_entry = FCDoubleSpinner()
+        self.cutz_entry.set_precision(self.decimals)
+        self.cutz_entry.setRange(-9999.9999, -0.00001)
+        self.cutz_entry.setSingleStep(0.1)
+
         self.grid3.addWidget(cutzlabel, 3, 0)
-        self.cutz_entry = FloatEntry()
         self.grid3.addWidget(self.cutz_entry, 3, 1)
 
         # Multi-pass
@@ -1211,30 +1313,37 @@ class GeometryObjectUI(ObjectUI):
                 "reached."
             )
         )
-        self.grid3.addWidget(self.mpass_cb, 4, 0)
 
-        self.maxdepth_entry = FloatEntry()
+        self.maxdepth_entry = FCDoubleSpinner()
+        self.maxdepth_entry.set_precision(self.decimals)
+        self.maxdepth_entry.setRange(0, 9999.9999)
+        self.maxdepth_entry.setSingleStep(0.1)
+
         self.maxdepth_entry.setToolTip(
             _(
                 "Depth of each pass (positive)."
             )
         )
-        self.grid3.addWidget(self.maxdepth_entry, 4, 1)
-
         self.ois_mpass_geo = OptionalInputSection(self.mpass_cb, [self.maxdepth_entry])
 
+        self.grid3.addWidget(self.mpass_cb, 4, 0)
+        self.grid3.addWidget(self.maxdepth_entry, 4, 1)
+
         # Travel Z
         travelzlabel = QtWidgets.QLabel('%s:' % _('Travel Z'))
         travelzlabel.setToolTip(
             _("Height of the tool when\n"
               "moving without cutting.")
         )
+        self.travelz_entry = FCDoubleSpinner()
+        self.travelz_entry.set_precision(self.decimals)
+        self.travelz_entry.setRange(0, 9999.9999)
+        self.travelz_entry.setSingleStep(0.1)
+
         self.grid3.addWidget(travelzlabel, 5, 0)
-        self.travelz_entry = FloatEntry()
         self.grid3.addWidget(self.travelz_entry, 5, 1)
 
         # Tool change:
-
         self.toolchzlabel = QtWidgets.QLabel('%s:' % _("Tool change Z"))
         self.toolchzlabel.setToolTip(
             _(
@@ -1242,16 +1351,19 @@ class GeometryObjectUI(ObjectUI):
                 "tool change."
             )
         )
-        self.toolchangeg_cb = FCCheckBox('%s:' % _("Tool change"))
+        self.toolchangeg_cb = FCCheckBox('%s' % _("Tool change"))
         self.toolchangeg_cb.setToolTip(
             _(
                 "Include tool-change sequence\n"
                 "in the Machine Code (Pause for tool change)."
             )
         )
-        self.toolchangez_entry = FloatEntry()
+        self.toolchangez_entry = FCDoubleSpinner()
+        self.toolchangez_entry.set_precision(self.decimals)
+        self.toolchangez_entry.setRange(0, 9999.9999)
+        self.toolchangez_entry.setSingleStep(0.1)
 
-        self.grid3.addWidget(self.toolchangeg_cb, 6, 0)
+        self.grid3.addWidget(self.toolchangeg_cb, 6, 0, 1, 2)
         self.grid3.addWidget(self.toolchzlabel, 7, 0)
         self.grid3.addWidget(self.toolchangez_entry, 7, 1)
         self.ois_tcz_geo = OptionalInputSection(self.toolchangeg_cb, [self.toolchangez_entry])
@@ -1273,8 +1385,12 @@ class GeometryObjectUI(ObjectUI):
             _("Height of the tool after\n"
               "the last move at the end of the job.")
         )
+        self.gendz_entry = FCDoubleSpinner()
+        self.gendz_entry.set_precision(self.decimals)
+        self.gendz_entry.setRange(0, 9999.9999)
+        self.gendz_entry.setSingleStep(0.1)
+
         self.grid3.addWidget(self.endzlabel, 9, 0)
-        self.gendz_entry = FloatEntry()
         self.grid3.addWidget(self.gendz_entry, 9, 1)
 
         # Feedrate X-Y
@@ -1283,8 +1399,12 @@ class GeometryObjectUI(ObjectUI):
             _("Cutting speed in the XY\n"
               "plane in units per minute")
         )
+        self.cncfeedrate_entry = FCDoubleSpinner()
+        self.cncfeedrate_entry.set_precision(self.decimals)
+        self.cncfeedrate_entry.setRange(0, 9999.9999)
+        self.cncfeedrate_entry.setSingleStep(0.1)
+
         self.grid3.addWidget(frlabel, 10, 0)
-        self.cncfeedrate_entry = FloatEntry()
         self.grid3.addWidget(self.cncfeedrate_entry, 10, 1)
 
         # Feedrate Z (Plunge)
@@ -1294,8 +1414,12 @@ class GeometryObjectUI(ObjectUI):
               "plane in units per minute.\n"
               "It is called also Plunge.")
         )
+        self.cncplunge_entry = FCDoubleSpinner()
+        self.cncplunge_entry.set_precision(self.decimals)
+        self.cncplunge_entry.setRange(0, 9999.9999)
+        self.cncplunge_entry.setSingleStep(0.1)
+
         self.grid3.addWidget(frzlabel, 11, 0)
-        self.cncplunge_entry = FloatEntry()
         self.grid3.addWidget(self.cncplunge_entry, 11, 1)
 
         # Feedrate rapids
@@ -1307,8 +1431,12 @@ class GeometryObjectUI(ObjectUI):
               "It is useful only for Marlin,\n"
               "ignore for any other cases.")
         )
+        self.cncfeedrate_rapid_entry = FCDoubleSpinner()
+        self.cncfeedrate_rapid_entry.set_precision(self.decimals)
+        self.cncfeedrate_rapid_entry.setRange(0, 9999.9999)
+        self.cncfeedrate_rapid_entry.setSingleStep(0.1)
+
         self.grid3.addWidget(self.fr_rapidlabel, 12, 0)
-        self.cncfeedrate_rapid_entry = FloatEntry()
         self.grid3.addWidget(self.cncfeedrate_rapid_entry, 12, 1)
         # default values is to hide
         self.fr_rapidlabel.hide()
@@ -1333,8 +1461,9 @@ class GeometryObjectUI(ObjectUI):
                 "this value is the power of laser."
             )
         )
-        self.grid3.addWidget(spdlabel, 14, 0)
         self.cncspindlespeed_entry = IntEntry(allow_empty=True)
+
+        self.grid3.addWidget(spdlabel, 14, 0)
         self.grid3.addWidget(self.cncspindlespeed_entry, 14, 1)
 
         # Dwell
@@ -1345,24 +1474,29 @@ class GeometryObjectUI(ObjectUI):
                 "speed before cutting."
             )
         )
-        self.dwelltime_entry = FloatEntry()
+        self.dwelltime_entry = FCDoubleSpinner()
+        self.dwelltime_entry.set_precision(self.decimals)
+        self.dwelltime_entry.setRange(0, 9999.9999)
+        self.dwelltime_entry.setSingleStep(0.1)
+
         self.dwelltime_entry.setToolTip(
             _("Number of time units for spindle to dwell.")
         )
+        self.ois_dwell_geo = OptionalInputSection(self.dwell_cb, [self.dwelltime_entry])
+
         self.grid3.addWidget(self.dwell_cb, 15, 0)
         self.grid3.addWidget(self.dwelltime_entry, 15, 1)
 
-        self.ois_dwell_geo = OptionalInputSection(self.dwell_cb, [self.dwelltime_entry])
-
         # postprocessor selection
         pp_label = QtWidgets.QLabel('%s:' % _("PostProcessor"))
         pp_label.setToolTip(
             _("The Postprocessor file that dictates\n"
               "the Machine Code (like GCode, RML, HPGL) output.")
         )
-        self.grid3.addWidget(pp_label, 16, 0)
         self.pp_geometry_name_cb = FCComboBox()
         self.pp_geometry_name_cb.setFocusPolicy(QtCore.Qt.StrongFocus)
+
+        self.grid3.addWidget(pp_label, 16, 0)
         self.grid3.addWidget(self.pp_geometry_name_cb, 16, 1)
 
         # Probe depth
@@ -1371,9 +1505,14 @@ class GeometryObjectUI(ObjectUI):
             _("The maximum depth that the probe is allowed\n"
               "to probe. Negative value, in current units.")
         )
+        self.pdepth_entry = FCDoubleSpinner()
+        self.pdepth_entry.set_precision(self.decimals)
+        self.pdepth_entry.setRange(-9999.9999, 9999.9999)
+        self.pdepth_entry.setSingleStep(0.1)
+
         self.grid3.addWidget(self.pdepth_label, 17, 0)
-        self.pdepth_entry = FCEntry()
         self.grid3.addWidget(self.pdepth_entry, 17, 1)
+
         self.pdepth_label.hide()
         self.pdepth_entry.setVisible(False)
 
@@ -1382,9 +1521,14 @@ class GeometryObjectUI(ObjectUI):
         self.feedrate_probe_label.setToolTip(
             _("The feedrate used while the probe is probing.")
         )
+        self.feedrate_probe_entry = FCDoubleSpinner()
+        self.feedrate_probe_entry.set_precision(self.decimals)
+        self.feedrate_probe_entry.setRange(0.0, 9999.9999)
+        self.feedrate_probe_entry.setSingleStep(0.1)
+
         self.grid3.addWidget(self.feedrate_probe_label, 18, 0)
-        self.feedrate_probe_entry = FCEntry()
         self.grid3.addWidget(self.feedrate_probe_entry, 18, 1)
+
         self.feedrate_probe_label.hide()
         self.feedrate_probe_entry.setVisible(False)
 
@@ -1437,6 +1581,7 @@ class CNCObjectUI(ObjectUI):
         """
 
         ObjectUI.__init__(self, title=_('CNC Job Object'), icon_file='share/cnc32.png', parent=parent)
+        self.decimals = 4
 
         # Scale and offset ans skew are not available for CNCJob objects.
         # Hiding from the GUI.
@@ -1672,18 +1817,21 @@ class CNCObjectUI(ObjectUI):
                      'z_cut', 'z_move', 'z_depthpercut', 'spindlespeed', 'dwelltime']
         self.tc_variable_combo.addItems(variables)
         self.tc_variable_combo.setItemData(0, _("FlatCAM CNC parameters"), Qt.ToolTipRole)
-        self.tc_variable_combo.setItemData(1, _("tool = tool number"), Qt.ToolTipRole)
-        self.tc_variable_combo.setItemData(2, _("tooldia = tool diameter"), Qt.ToolTipRole)
-        self.tc_variable_combo.setItemData(3, _("t_drills = for Excellon, total number of drills"), Qt.ToolTipRole)
-        self.tc_variable_combo.setItemData(4, _("x_toolchange = X coord for Toolchange"), Qt.ToolTipRole)
-        self.tc_variable_combo.setItemData(5, _("y_toolchange = Y coord for Toolchange"), Qt.ToolTipRole)
-        self.tc_variable_combo.setItemData(6, _("z_toolchange = Z coord for Toolchange"), Qt.ToolTipRole)
-        self.tc_variable_combo.setItemData(7, _("z_cut = depth where to cut"), Qt.ToolTipRole)
-        self.tc_variable_combo.setItemData(8, _("z_move = height where to travel"), Qt.ToolTipRole)
-        self.tc_variable_combo.setItemData(9, _("z_depthpercut = the step value for multidepth cut"), Qt.ToolTipRole)
-        self.tc_variable_combo.setItemData(10, _("spindlesspeed = the value for the spindle speed"), Qt.ToolTipRole)
-        self.tc_variable_combo.setItemData(11, _("dwelltime = time to dwell to allow the "
-                                                 "spindle to reach it's set RPM"),
+        self.tc_variable_combo.setItemData(1, "tool = " + _("tool number"), Qt.ToolTipRole)
+        self.tc_variable_combo.setItemData(2, "tooldia = " + _("tool diameter"), Qt.ToolTipRole)
+        self.tc_variable_combo.setItemData(3, "t_drills = " + _("for Excellon, total number of drills"),
+                                           Qt.ToolTipRole)
+        self.tc_variable_combo.setItemData(4, "x_toolchange = " + _("X coord for Toolchange"), Qt.ToolTipRole)
+        self.tc_variable_combo.setItemData(5, "y_toolchange = " + _("Y coord for Toolchange"), Qt.ToolTipRole)
+        self.tc_variable_combo.setItemData(6, "z_toolchange = " + _("Z coord for Toolchange"), Qt.ToolTipRole)
+        self.tc_variable_combo.setItemData(7, "z_cut = " + _("depth where to cut"), Qt.ToolTipRole)
+        self.tc_variable_combo.setItemData(8, "z_move = " + _("height where to travel"), Qt.ToolTipRole)
+        self.tc_variable_combo.setItemData(9, "z_depthpercut = " + _("the step value for multidepth cut"),
+                                           Qt.ToolTipRole)
+        self.tc_variable_combo.setItemData(10, "spindlesspeed = " + _("the value for the spindle speed"),
+                                           Qt.ToolTipRole)
+        self.tc_variable_combo.setItemData(11, "dwelltime = " + _("time to dwell to allow the "
+                                                                  "spindle to reach it's set RPM"),
                                            Qt.ToolTipRole)
 
         cnclay.addWidget(self.toolchange_cb)

+ 3 - 2
flatcamGUI/PreferencesUI.py

@@ -4205,6 +4205,7 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI):
         self.paintoverlap_entry.setWrapping(True)
         self.paintoverlap_entry.setRange(0.000, 0.999)
         self.paintoverlap_entry.setSingleStep(0.1)
+
         grid0.addWidget(ovlabel, 2, 0)
         grid0.addWidget(self.paintoverlap_entry, 2, 1)
 
@@ -4653,7 +4654,7 @@ class ToolsCalculatorsPrefGroupUI(OptionsGroupUI):
         self.tip_angle_entry = FCDoubleSpinner()
         self.tip_angle_entry.set_range(0.0, 180.0)
         self.tip_angle_entry.set_precision(self.decimals)
-        self.tip_angle_entry.setSingleStep(10)
+        self.tip_angle_entry.setSingleStep(5)
 
         self.tip_angle_label = QtWidgets.QLabel('%s:' % _("Tip Angle"))
         self.tip_angle_label.setToolTip(
@@ -4665,7 +4666,7 @@ class ToolsCalculatorsPrefGroupUI(OptionsGroupUI):
 
         # ## Depth-of-cut Cut Z
         self.cut_z_entry = FCDoubleSpinner()
-        self.cut_z_entry.set_range(-0.000001, -9999.9999)
+        self.cut_z_entry.set_range(-9999.9999, -0.00001)
         self.cut_z_entry.set_precision(self.decimals)
         self.cut_z_entry.setSingleStep(0.01)