Browse Source

- finished the GUI layout for the Calibrate Excellon Tool

Marius Stanciu 6 years ago
parent
commit
cff0787107
3 changed files with 169 additions and 41 deletions
  1. 10 10
      FlatCAMObj.py
  2. 1 0
      README.md
  3. 158 31
      flatcamTools/ToolCalibrateExcellon.py

+ 10 - 10
FlatCAMObj.py

@@ -1472,18 +1472,18 @@ class FlatCAMGerber(FlatCAMObj, Gerber):
 
 
         if self.app.is_legacy is False:
         if self.app.is_legacy is False:
             def random_color():
             def random_color():
-                color = np.random.rand(4)
-                color[3] = 1
-                return color
+                r_color = np.random.rand(4)
+                r_color[3] = 1
+                return r_color
         else:
         else:
             def random_color():
             def random_color():
                 while True:
                 while True:
-                    color = np.random.rand(4)
-                    color[3] = 1
+                    r_color = np.random.rand(4)
+                    r_color[3] = 1
 
 
                     new_color = '#'
                     new_color = '#'
-                    for idx in range(len(color)):
-                        new_color += '%x' % int(color[idx] * 255)
+                    for idx in range(len(r_color)):
+                        new_color += '%x' % int(r_color[idx] * 255)
                     # do it until a valid color is generated
                     # do it until a valid color is generated
                     # a valid color has the # symbol, another 6 chars for the color and the last 2 chars for alpha
                     # a valid color has the # symbol, another 6 chars for the color and the last 2 chars for alpha
                     # for a total of 9 chars
                     # for a total of 9 chars
@@ -2259,9 +2259,9 @@ class FlatCAMExcellon(FlatCAMObj, Excellon):
 
 
             self.tot_slot_cnt += slot_cnt
             self.tot_slot_cnt += slot_cnt
 
 
-            id = QtWidgets.QTableWidgetItem('%d' % int(tool_no))
-            id.setFlags(QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled)
-            self.ui.tools_table.setItem(self.tool_row, 0, id)  # Tool name/id
+            exc_id = QtWidgets.QTableWidgetItem('%d' % int(tool_no))
+            exc_id.setFlags(QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled)
+            self.ui.tools_table.setItem(self.tool_row, 0, exc_id)  # Tool name/id
 
 
             # Make sure that the drill diameter when in MM is with no more than 2 decimals
             # Make sure that the drill diameter when in MM is with no more than 2 decimals
             # There are no drill bits in MM with more than 3 decimals diameter
             # There are no drill bits in MM with more than 3 decimals diameter

+ 1 - 0
README.md

@@ -11,6 +11,7 @@ CAD program, and create G-Code for Isolation routing.
 22.10.2019
 22.10.2019
 
 
 - working on the Calibrate Excellon Tool
 - working on the Calibrate Excellon Tool
+- finished the GUI layout for the Calibrate Excellon Tool
 
 
 21.10.2019
 21.10.2019
 
 

+ 158 - 31
flatcamTools/ToolCalibrateExcellon.py

@@ -6,12 +6,17 @@
 # ##########################################################
 # ##########################################################
 
 
 from PyQt5 import QtWidgets, QtCore
 from PyQt5 import QtWidgets, QtCore
+
 from FlatCAMTool import FlatCAMTool
 from FlatCAMTool import FlatCAMTool
-from flatcamGUI.GUIElements import FCDoubleSpinner, EvalEntry
-import math
+from flatcamGUI.GUIElements import FCDoubleSpinner, EvalEntry, FCCheckBox
+
 from shapely.geometry import Point
 from shapely.geometry import Point
 from shapely.geometry.base import *
 from shapely.geometry.base import *
 
 
+import math
+from datetime import datetime
+import logging
+
 import gettext
 import gettext
 import FlatCAMTranslation as fcTranslate
 import FlatCAMTranslation as fcTranslate
 import builtins
 import builtins
@@ -20,6 +25,8 @@ fcTranslate.apply_language('strings')
 if '_' not in builtins.__dict__:
 if '_' not in builtins.__dict__:
     _ = gettext.gettext
     _ = gettext.gettext
 
 
+log = logging.getLogger('base')
+
 
 
 class ToolCalibrateExcellon(FlatCAMTool):
 class ToolCalibrateExcellon(FlatCAMTool):
 
 
@@ -45,11 +52,11 @@ class ToolCalibrateExcellon(FlatCAMTool):
         self.layout.addWidget(title_label)
         self.layout.addWidget(title_label)
 
 
         # ## Grid Layout
         # ## Grid Layout
-        grid_lay = QtWidgets.QGridLayout()
-        self.layout.addLayout(grid_lay)
-        grid_lay.setColumnStretch(0, 0)
-        grid_lay.setColumnStretch(1, 1)
-        grid_lay.setColumnStretch(2, 1)
+        i_grid_lay = QtWidgets.QGridLayout()
+        self.layout.addLayout(i_grid_lay)
+        i_grid_lay.setColumnStretch(0, 0)
+        i_grid_lay.setColumnStretch(1, 1)
+        i_grid_lay.setColumnStretch(2, 1)
 
 
         self.exc_object_combo = QtWidgets.QComboBox()
         self.exc_object_combo = QtWidgets.QComboBox()
         self.exc_object_combo.setModel(self.app.collection)
         self.exc_object_combo.setModel(self.app.collection)
@@ -58,19 +65,64 @@ class ToolCalibrateExcellon(FlatCAMTool):
 
 
         self.excobj_label = QtWidgets.QLabel("<b>%s:</b>" % _("EXCELLON"))
         self.excobj_label = QtWidgets.QLabel("<b>%s:</b>" % _("EXCELLON"))
         self.excobj_label.setToolTip(
         self.excobj_label.setToolTip(
-            _("Excellon Object to be mirrored.")
+            _("Excellon Object to be used as a source for reference points.")
+        )
+
+        i_grid_lay.addWidget(self.excobj_label, 0, 0)
+        i_grid_lay.addWidget(self.exc_object_combo, 0, 1, 1, 2)
+        i_grid_lay.addWidget(QtWidgets.QLabel(''), 1, 0)
+
+        self.gcode_title_label = QtWidgets.QLabel('<b>%s</b>' % _('GCode Parameters'))
+        self.gcode_title_label.setToolTip(
+            _("Parameters used when creating the GCode in this tool.")
         )
         )
+        i_grid_lay.addWidget(self.gcode_title_label, 1, 0, 1, 3)
+
+        # Travel Z entry
+        travelz_lbl = QtWidgets.QLabel('%s:' % _("Travel Z"))
+
+        self.travelz_entry = FCDoubleSpinner()
+        self.travelz_entry.set_range(-9999.9999, 9999.9999)
+        self.travelz_entry.set_precision(self.decimals)
+        self.travelz_entry.setSingleStep(0.1)
+
+        i_grid_lay.addWidget(travelz_lbl, 2, 0)
+        i_grid_lay.addWidget(self.travelz_entry, 2, 1, 1, 2)
+
+        # Verification Z entry
+        verz_lbl = QtWidgets.QLabel('%s:' % _("Verification Z"))
+
+        self.verz_entry = FCDoubleSpinner()
+        self.verz_entry.set_range(-9999.9999, 9999.9999)
+        self.verz_entry.set_precision(self.decimals)
+        self.verz_entry.setSingleStep(0.1)
+
+        i_grid_lay.addWidget(verz_lbl, 3, 0)
+        i_grid_lay.addWidget(self.verz_entry, 3, 1, 1, 2)
 
 
-        grid_lay.addWidget(self.excobj_label, 0, 0)
-        grid_lay.addWidget(self.exc_object_combo, 0, 1, 1, 2)
-        grid_lay.addWidget(QtWidgets.QLabel(''), 1, 0)
+        # Zero the Z of the verification tool
+        self.zeroz_cb = FCCheckBox('%s' % _("Zero Z tool"))
+        self.zeroz_cb.setToolTip(
+            _("Include a secquence to zero the height (Z)\n"
+              "of the verification tool.")
+        )
+        i_grid_lay.addWidget(self.zeroz_cb, 4, 0, 1, 3)
+
+        i_grid_lay.addWidget(QtWidgets.QLabel(''), 5, 0, 1, 3)
+
+        # ## Grid Layout
+        grid_lay = QtWidgets.QGridLayout()
+        self.layout.addLayout(grid_lay)
+        grid_lay.setColumnStretch(0, 0)
+        grid_lay.setColumnStretch(1, 1)
+        grid_lay.setColumnStretch(2, 1)
 
 
         self.points_table_label = QtWidgets.QLabel('<b>%s</b>' % _('Calibration Points'))
         self.points_table_label = QtWidgets.QLabel('<b>%s</b>' % _('Calibration Points'))
         self.points_table_label.setToolTip(
         self.points_table_label.setToolTip(
             _("Contain the expected calibration points and the\n"
             _("Contain the expected calibration points and the\n"
               "ones measured.")
               "ones measured.")
         )
         )
-        grid_lay.addWidget(self.points_table_label, 2, 0, 1, 2)
+        grid_lay.addWidget(self.points_table_label, 2, 0, 1, 3)
 
 
         # BOTTOM LEFT
         # BOTTOM LEFT
         self.bottom_left_lbl = QtWidgets.QLabel('<b>%s</b>' % _('Bottom Left'))
         self.bottom_left_lbl = QtWidgets.QLabel('<b>%s</b>' % _('Bottom Left'))
@@ -83,7 +135,7 @@ class ToolCalibrateExcellon(FlatCAMTool):
         self.bottom_left_coordx_lbl = QtWidgets.QLabel('%s' % _('X'))
         self.bottom_left_coordx_lbl = QtWidgets.QLabel('%s' % _('X'))
         grid_lay.addWidget(self.bottom_left_coordx_lbl, 4, 0)
         grid_lay.addWidget(self.bottom_left_coordx_lbl, 4, 0)
         self.bottom_left_coordx_tgt = EvalEntry()
         self.bottom_left_coordx_tgt = EvalEntry()
-        self.bottom_left_coordx_tgt.setDisabled(True)
+        self.bottom_left_coordx_tgt.setReadOnly(True)
         grid_lay.addWidget(self.bottom_left_coordx_tgt, 4, 1)
         grid_lay.addWidget(self.bottom_left_coordx_tgt, 4, 1)
         self.bottom_left_coordx_found = EvalEntry()
         self.bottom_left_coordx_found = EvalEntry()
         grid_lay.addWidget(self.bottom_left_coordx_found, 4, 2)
         grid_lay.addWidget(self.bottom_left_coordx_found, 4, 2)
@@ -91,7 +143,7 @@ class ToolCalibrateExcellon(FlatCAMTool):
         self.bottom_left_coordy_lbl = QtWidgets.QLabel('%s' % _('Y'))
         self.bottom_left_coordy_lbl = QtWidgets.QLabel('%s' % _('Y'))
         grid_lay.addWidget(self.bottom_left_coordy_lbl, 5, 0)
         grid_lay.addWidget(self.bottom_left_coordy_lbl, 5, 0)
         self.bottom_left_coordy_tgt = EvalEntry()
         self.bottom_left_coordy_tgt = EvalEntry()
-        self.bottom_left_coordy_tgt.setDisabled(True)
+        self.bottom_left_coordy_tgt.setReadOnly(True)
         grid_lay.addWidget(self.bottom_left_coordy_tgt, 5, 1)
         grid_lay.addWidget(self.bottom_left_coordy_tgt, 5, 1)
         self.bottom_left_coordy_found = EvalEntry()
         self.bottom_left_coordy_found = EvalEntry()
         grid_lay.addWidget(self.bottom_left_coordy_found, 5, 2)
         grid_lay.addWidget(self.bottom_left_coordy_found, 5, 2)
@@ -112,7 +164,7 @@ class ToolCalibrateExcellon(FlatCAMTool):
         self.bottom_right_coordx_lbl = QtWidgets.QLabel('%s' % _('X'))
         self.bottom_right_coordx_lbl = QtWidgets.QLabel('%s' % _('X'))
         grid_lay.addWidget(self.bottom_right_coordx_lbl, 7, 0)
         grid_lay.addWidget(self.bottom_right_coordx_lbl, 7, 0)
         self.bottom_right_coordx_tgt = EvalEntry()
         self.bottom_right_coordx_tgt = EvalEntry()
-        self.bottom_right_coordx_tgt.setDisabled(True)
+        self.bottom_right_coordx_tgt.setReadOnly(True)
         grid_lay.addWidget(self.bottom_right_coordx_tgt, 7, 1)
         grid_lay.addWidget(self.bottom_right_coordx_tgt, 7, 1)
         self.bottom_right_coordx_found = EvalEntry()
         self.bottom_right_coordx_found = EvalEntry()
         grid_lay.addWidget(self.bottom_right_coordx_found, 7, 2)
         grid_lay.addWidget(self.bottom_right_coordx_found, 7, 2)
@@ -120,12 +172,11 @@ class ToolCalibrateExcellon(FlatCAMTool):
         self.bottom_right_coordy_lbl = QtWidgets.QLabel('%s' % _('Y'))
         self.bottom_right_coordy_lbl = QtWidgets.QLabel('%s' % _('Y'))
         grid_lay.addWidget(self.bottom_right_coordy_lbl, 8, 0)
         grid_lay.addWidget(self.bottom_right_coordy_lbl, 8, 0)
         self.bottom_right_coordy_tgt = EvalEntry()
         self.bottom_right_coordy_tgt = EvalEntry()
-        self.bottom_right_coordy_tgt.setDisabled(True)
+        self.bottom_right_coordy_tgt.setReadOnly(True)
         grid_lay.addWidget(self.bottom_right_coordy_tgt, 8, 1)
         grid_lay.addWidget(self.bottom_right_coordy_tgt, 8, 1)
         self.bottom_right_coordy_found = EvalEntry()
         self.bottom_right_coordy_found = EvalEntry()
         grid_lay.addWidget(self.bottom_right_coordy_found, 8, 2)
         grid_lay.addWidget(self.bottom_right_coordy_found, 8, 2)
 
 
-
         # TOP LEFT
         # TOP LEFT
         self.top_left_lbl = QtWidgets.QLabel('<b>%s</b>' % _('Top Left'))
         self.top_left_lbl = QtWidgets.QLabel('<b>%s</b>' % _('Top Left'))
         grid_lay.addWidget(self.top_left_lbl, 9, 0)
         grid_lay.addWidget(self.top_left_lbl, 9, 0)
@@ -137,7 +188,7 @@ class ToolCalibrateExcellon(FlatCAMTool):
         self.top_left_coordx_lbl = QtWidgets.QLabel('%s' % _('X'))
         self.top_left_coordx_lbl = QtWidgets.QLabel('%s' % _('X'))
         grid_lay.addWidget(self.top_left_coordx_lbl, 10, 0)
         grid_lay.addWidget(self.top_left_coordx_lbl, 10, 0)
         self.top_left_coordx_tgt = EvalEntry()
         self.top_left_coordx_tgt = EvalEntry()
-        self.top_left_coordx_tgt.setDisabled(True)
+        self.top_left_coordx_tgt.setReadOnly(True)
         grid_lay.addWidget(self.top_left_coordx_tgt, 10, 1)
         grid_lay.addWidget(self.top_left_coordx_tgt, 10, 1)
         self.top_left_coordx_found = EvalEntry()
         self.top_left_coordx_found = EvalEntry()
         grid_lay.addWidget(self.top_left_coordx_found, 10, 2)
         grid_lay.addWidget(self.top_left_coordx_found, 10, 2)
@@ -145,7 +196,7 @@ class ToolCalibrateExcellon(FlatCAMTool):
         self.top_left_coordy_lbl = QtWidgets.QLabel('%s' % _('Y'))
         self.top_left_coordy_lbl = QtWidgets.QLabel('%s' % _('Y'))
         grid_lay.addWidget(self.top_left_coordy_lbl, 11, 0)
         grid_lay.addWidget(self.top_left_coordy_lbl, 11, 0)
         self.top_left_coordy_tgt = EvalEntry()
         self.top_left_coordy_tgt = EvalEntry()
-        self.top_left_coordy_tgt.setDisabled(True)
+        self.top_left_coordy_tgt.setReadOnly(True)
         grid_lay.addWidget(self.top_left_coordy_tgt, 11, 1)
         grid_lay.addWidget(self.top_left_coordy_tgt, 11, 1)
         self.top_left_coordy_found = EvalEntry()
         self.top_left_coordy_found = EvalEntry()
         grid_lay.addWidget(self.top_left_coordy_found, 11, 2)
         grid_lay.addWidget(self.top_left_coordy_found, 11, 2)
@@ -161,7 +212,7 @@ class ToolCalibrateExcellon(FlatCAMTool):
         self.top_right_coordx_lbl = QtWidgets.QLabel('%s' % _('X'))
         self.top_right_coordx_lbl = QtWidgets.QLabel('%s' % _('X'))
         grid_lay.addWidget(self.top_right_coordx_lbl, 13, 0)
         grid_lay.addWidget(self.top_right_coordx_lbl, 13, 0)
         self.top_right_coordx_tgt = EvalEntry()
         self.top_right_coordx_tgt = EvalEntry()
-        self.top_right_coordx_tgt.setDisabled(True)
+        self.top_right_coordx_tgt.setReadOnly(True)
         grid_lay.addWidget(self.top_right_coordx_tgt, 13, 1)
         grid_lay.addWidget(self.top_right_coordx_tgt, 13, 1)
         self.top_right_coordx_found = EvalEntry()
         self.top_right_coordx_found = EvalEntry()
         grid_lay.addWidget(self.top_right_coordx_found, 13, 2)
         grid_lay.addWidget(self.top_right_coordx_found, 13, 2)
@@ -169,16 +220,17 @@ class ToolCalibrateExcellon(FlatCAMTool):
         self.top_right_coordy_lbl = QtWidgets.QLabel('%s' % _('Y'))
         self.top_right_coordy_lbl = QtWidgets.QLabel('%s' % _('Y'))
         grid_lay.addWidget(self.top_right_coordy_lbl, 14, 0)
         grid_lay.addWidget(self.top_right_coordy_lbl, 14, 0)
         self.top_right_coordy_tgt = EvalEntry()
         self.top_right_coordy_tgt = EvalEntry()
-        self.top_right_coordy_tgt.setDisabled(True)
+        self.top_right_coordy_tgt.setReadOnly(True)
         grid_lay.addWidget(self.top_right_coordy_tgt, 14, 1)
         grid_lay.addWidget(self.top_right_coordy_tgt, 14, 1)
         self.top_right_coordy_found = EvalEntry()
         self.top_right_coordy_found = EvalEntry()
         grid_lay.addWidget(self.top_right_coordy_found, 14, 2)
         grid_lay.addWidget(self.top_right_coordy_found, 14, 2)
 
 
+        # STEP 1 #
         step_1 = QtWidgets.QLabel('<b>%s</b>' % _("STEP 1"))
         step_1 = QtWidgets.QLabel('<b>%s</b>' % _("STEP 1"))
         step_1.setToolTip(
         step_1.setToolTip(
             _("Pick four points by clicking inside the drill holes.\n"
             _("Pick four points by clicking inside the drill holes.\n"
-              "Those four points should be in the four squares of\n"
-              "the Excellon object.")
+              "Those four points should be in the four\n"
+              "(as much as possible) corners of the Excellon object.")
         )
         )
         grid_lay.addWidget(step_1, 15, 0, 1, 3)
         grid_lay.addWidget(step_1, 15, 0, 1, 3)
 
 
@@ -192,6 +244,7 @@ class ToolCalibrateExcellon(FlatCAMTool):
 
 
         grid_lay.addWidget(self.start_button, 16, 0, 1, 3)
         grid_lay.addWidget(self.start_button, 16, 0, 1, 3)
 
 
+        # STEP 2 #
         step_2 = QtWidgets.QLabel('<b>%s</b>' % _("STEP 2"))
         step_2 = QtWidgets.QLabel('<b>%s</b>' % _("STEP 2"))
         step_2.setToolTip(
         step_2.setToolTip(
             _("Generate GCode file to locate and align the PCB by using\n"
             _("Generate GCode file to locate and align the PCB by using\n"
@@ -208,6 +261,7 @@ class ToolCalibrateExcellon(FlatCAMTool):
 
 
         grid_lay.addWidget(self.gcode_button, 18, 0, 1, 3)
         grid_lay.addWidget(self.gcode_button, 18, 0, 1, 3)
 
 
+        # STEP 3 #
         step_3 = QtWidgets.QLabel('<b>%s</b>' % _("STEP 3"))
         step_3 = QtWidgets.QLabel('<b>%s</b>' % _("STEP 3"))
         step_3.setToolTip(
         step_3.setToolTip(
             _("Calculate Scale and Skew factors based on the differences (delta)\n"
             _("Calculate Scale and Skew factors based on the differences (delta)\n"
@@ -232,7 +286,10 @@ class ToolCalibrateExcellon(FlatCAMTool):
         self.scalex_label.setToolTip(
         self.scalex_label.setToolTip(
             _("Factor for Scale action over X axis.")
             _("Factor for Scale action over X axis.")
         )
         )
-        self.scalex_entry = EvalEntry()
+        self.scalex_entry = FCDoubleSpinner()
+        self.scalex_entry.set_range(0, 9999.9999)
+        self.scalex_entry.set_precision(self.decimals)
+        self.scalex_entry.setSingleStep(0.1)
 
 
         grid_lay.addWidget(self.scalex_label, 22, 0)
         grid_lay.addWidget(self.scalex_label, 22, 0)
         grid_lay.addWidget(self.scalex_entry, 22, 1, 1, 2)
         grid_lay.addWidget(self.scalex_entry, 22, 1, 1, 2)
@@ -241,7 +298,10 @@ class ToolCalibrateExcellon(FlatCAMTool):
         self.scaley_label.setToolTip(
         self.scaley_label.setToolTip(
             _("Factor for Scale action over Y axis.")
             _("Factor for Scale action over Y axis.")
         )
         )
-        self.scaley_entry = EvalEntry()
+        self.scaley_entry = FCDoubleSpinner()
+        self.scaley_entry.set_range(0, 9999.9999)
+        self.scaley_entry.set_precision(self.decimals)
+        self.scaley_entry.setSingleStep(0.1)
 
 
         grid_lay.addWidget(self.scaley_label, 23, 0)
         grid_lay.addWidget(self.scaley_label, 23, 0)
         grid_lay.addWidget(self.scaley_entry, 23, 1, 1, 2)
         grid_lay.addWidget(self.scaley_entry, 23, 1, 1, 2)
@@ -254,7 +314,10 @@ class ToolCalibrateExcellon(FlatCAMTool):
             _("Angle for Skew action, in degrees.\n"
             _("Angle for Skew action, in degrees.\n"
               "Float number between -360 and 359.")
               "Float number between -360 and 359.")
         )
         )
-        self.skewx_entry = EvalEntry()
+        self.skewx_entry = FCDoubleSpinner()
+        self.skewx_entry.set_range(-360, 360)
+        self.skewx_entry.set_precision(self.decimals)
+        self.skewx_entry.setSingleStep(0.1)
 
 
         grid_lay.addWidget(self.skewx_label, 25, 0)
         grid_lay.addWidget(self.skewx_label, 25, 0)
         grid_lay.addWidget(self.skewx_entry, 25, 1, 1, 2)
         grid_lay.addWidget(self.skewx_entry, 25, 1, 1, 2)
@@ -264,11 +327,15 @@ class ToolCalibrateExcellon(FlatCAMTool):
             _("Angle for Skew action, in degrees.\n"
             _("Angle for Skew action, in degrees.\n"
               "Float number between -360 and 359.")
               "Float number between -360 and 359.")
         )
         )
-        self.skewy_entry = EvalEntry()
+        self.skewy_entry = FCDoubleSpinner()
+        self.skewy_entry.set_range(-360, 360)
+        self.skewy_entry.set_precision(self.decimals)
+        self.skewy_entry.setSingleStep(0.1)
 
 
         grid_lay.addWidget(self.skewy_label, 26, 0)
         grid_lay.addWidget(self.skewy_label, 26, 0)
         grid_lay.addWidget(self.skewy_entry, 26, 1, 1, 2)
         grid_lay.addWidget(self.skewy_entry, 26, 1, 1, 2)
 
 
+        # STEP 4 #
         step_4 = QtWidgets.QLabel('<b>%s</b>' % _("STEP 4"))
         step_4 = QtWidgets.QLabel('<b>%s</b>' % _("STEP 4"))
         step_4.setToolTip(
         step_4.setToolTip(
             _("Generate verification GCode file adjusted with\n"
             _("Generate verification GCode file adjusted with\n"
@@ -276,14 +343,57 @@ class ToolCalibrateExcellon(FlatCAMTool):
         )
         )
         grid_lay.addWidget(step_4, 27, 0, 1, 3)
         grid_lay.addWidget(step_4, 27, 0, 1, 3)
 
 
-        # ## GCode Button
-        self.gcode_button = QtWidgets.QPushButton(_("Generate Adjusted GCode"))
-        self.gcode_button.setToolTip(
+        # ## Adjusted GCode Button
+        self.adj_gcode_button = QtWidgets.QPushButton(_("Generate Adjusted GCode"))
+        self.adj_gcode_button.setToolTip(
             _("Generate verification GCode file adjusted with\n"
             _("Generate verification GCode file adjusted with\n"
               "the factors above.")
               "the factors above.")
         )
         )
-        grid_lay.addWidget(self.gcode_button, 28, 0, 1, 3)
+        grid_lay.addWidget(self.adj_gcode_button, 28, 0, 1, 3)
+
+        # STEP 5 #
+        step_5 = QtWidgets.QLabel('<b>%s</b>' % _("STEP 5"))
+        step_5.setToolTip(
+            _("Ajust the Excellon and Cutout Geometry objects\n"
+              "with the factors determined, and verified, above.")
+        )
+        grid_lay.addWidget(step_5, 29, 0, 1, 3)
+
+        self.adj_exc_object_combo = QtWidgets.QComboBox()
+        self.adj_exc_object_combo.setModel(self.app.collection)
+        self.adj_exc_object_combo.setRootModelIndex(self.app.collection.index(1, 0, QtCore.QModelIndex()))
+        self.adj_exc_object_combo.setCurrentIndex(1)
+
+        self.adj_excobj_label = QtWidgets.QLabel("<b>%s:</b>" % _("EXCELLON"))
+        self.adj_excobj_label.setToolTip(
+            _("Excellon Object to be adjusted.")
+        )
 
 
+        grid_lay.addWidget(self.adj_excobj_label, 30, 0)
+        grid_lay.addWidget(self.adj_exc_object_combo, 30, 1, 1, 2)
+
+        self.adj_geo_object_combo = QtWidgets.QComboBox()
+        self.adj_geo_object_combo.setModel(self.app.collection)
+        self.adj_geo_object_combo.setRootModelIndex(self.app.collection.index(2, 0, QtCore.QModelIndex()))
+        self.adj_geo_object_combo.setCurrentIndex(1)
+
+        self.adj_geoobj_label = QtWidgets.QLabel("<b>%s:</b>" % _("GEOMETRY"))
+        self.adj_geoobj_label.setToolTip(
+            _("Geometry Object to be adjusted.")
+        )
+
+        grid_lay.addWidget(self.adj_geoobj_label, 31, 0)
+        grid_lay.addWidget(self.adj_geo_object_combo, 31, 1, 1, 2)
+
+        # ## Adjust Objects Button
+        self.adj_obj_button = QtWidgets.QPushButton(_("Adjust Objects"))
+        self.adj_obj_button.setToolTip(
+            _("Adjust (scale and / or skew) the objects\n"
+              "with the factors determined above.")
+        )
+        grid_lay.addWidget(self.adj_obj_button, 32, 0, 1, 3)
+
+        grid_lay.addWidget(QtWidgets.QLabel(''), 33, 0)
         self.layout.addStretch()
         self.layout.addStretch()
 
 
         self.mr = None
         self.mr = None
@@ -393,6 +503,23 @@ class ToolCalibrateExcellon(FlatCAMTool):
             self.app.inform.emit('[success] %s' % _("Done. All four points have been acquired."))
             self.app.inform.emit('[success] %s' % _("Done. All four points have been acquired."))
             self.disconnect_cal_events()
             self.disconnect_cal_events()
 
 
+    def generate_verification_gcode(self):
+        pass
+
+    def gcode_header(self):
+        log.debug("ToolCalibrateExcellon.gcode_header()")
+        time_str = "{:%A, %d %B %Y at %H:%M}".format(datetime.now())
+
+        gcode = '(G-CODE GENERATED BY FLATCAM v%s - www.flatcam.org - Version Date: %s)\n' % \
+                (str(self.app.version), str(self.app.version_date)) + '\n'
+
+        gcode += '(Name: ' + _('Verification GCode') + ')\n'
+
+        gcode += '(Units: ' + self.units.upper() + ')\n' + "\n"
+        gcode += '(Created on ' + time_str + ')\n' + '\n'
+
+        return gcode
+
     def disconnect_cal_events(self):
     def disconnect_cal_events(self):
         self.app.mr = self.canvas.graph_event_connect('mouse_release', self.app.on_mouse_click_release_over_plot)
         self.app.mr = self.canvas.graph_event_connect('mouse_release', self.app.on_mouse_click_release_over_plot)