- updated all FlatCAM tools to use the new confirmation message for QSpinBoxes, too

This commit is contained in:
Marius Stanciu 2020-02-17 04:56:57 +02:00 committed by Marius
parent 1e9232aeaa
commit ea1b99242c
13 changed files with 22 additions and 21 deletions

View File

@ -15,6 +15,7 @@ CAD program, and create G-Code for Isolation routing.
- in Excellon UI removed the tools table column for Offset Z and used the UI form parameter - in Excellon UI removed the tools table column for Offset Z and used the UI form parameter
- updated the Excellon Editor to add for each tool a 'data' dictionary - updated the Excellon Editor to add for each tool a 'data' dictionary
- updated all FlatCAM tools to use the new confirmation message that show if the entered value is within range or outside - updated all FlatCAM tools to use the new confirmation message that show if the entered value is within range or outside
- updated all FlatCAM tools to use the new confirmation message for QSpinBoxes, too
16.02.2020 16.02.2020

View File

@ -103,7 +103,7 @@ class ToolCalculator(FlatCAMTool):
"It is specified by manufacturer.") "It is specified by manufacturer.")
) )
self.tipAngle_label = QtWidgets.QLabel('%s:' % _("Tip Angle")) self.tipAngle_label = QtWidgets.QLabel('%s:' % _("Tip Angle"))
self.tipAngle_entry = FCSpinner() self.tipAngle_entry = FCSpinner(callback=self.confirmation_message_int)
self.tipAngle_entry.set_range(0,180) self.tipAngle_entry.set_range(0,180)
self.tipAngle_entry.setSingleStep(5) self.tipAngle_entry.setSingleStep(5)

View File

@ -276,7 +276,7 @@ class ToolExtractDrills(FlatCAMTool):
grid3.addWidget(self.prop_label, 2, 0, 1, 2) grid3.addWidget(self.prop_label, 2, 0, 1, 2)
# Diameter value # Diameter value
self.factor_entry = FCDoubleSpinner(suffix='%') self.factor_entry = FCDoubleSpinner(callback=self.confirmation_message, suffix='%')
self.factor_entry.set_precision(self.decimals) self.factor_entry.set_precision(self.decimals)
self.factor_entry.set_range(0.0000, 100.0000) self.factor_entry.set_range(0.0000, 100.0000)
self.factor_entry.setSingleStep(0.1) self.factor_entry.setSingleStep(0.1)

View File

@ -61,7 +61,7 @@ class ToolImage(FlatCAMTool):
ti_form_layout.addRow(self.tf_type_obj_combo_label, self.tf_type_obj_combo) ti_form_layout.addRow(self.tf_type_obj_combo_label, self.tf_type_obj_combo)
# DPI value of the imported image # DPI value of the imported image
self.dpi_entry = FCSpinner() self.dpi_entry = FCSpinner(callback=self.confirmation_message_int)
self.dpi_entry.set_range(0, 99999) self.dpi_entry.set_range(0, 99999)
self.dpi_label = QtWidgets.QLabel('%s:' % _("DPI value")) self.dpi_label = QtWidgets.QLabel('%s:' % _("DPI value"))
self.dpi_label.setToolTip(_("Specify a DPI value for the image.") ) self.dpi_label.setToolTip(_("Specify a DPI value for the image.") )
@ -87,7 +87,7 @@ class ToolImage(FlatCAMTool):
ti2_form_layout.addRow(self.image_type_label, self.image_type) ti2_form_layout.addRow(self.image_type_label, self.image_type)
# Mask value of the imported image when image monochrome # Mask value of the imported image when image monochrome
self.mask_bw_entry = FCSpinner() self.mask_bw_entry = FCSpinner(callback=self.confirmation_message_int)
self.mask_bw_entry.set_range(0, 255) self.mask_bw_entry.set_range(0, 255)
self.mask_bw_label = QtWidgets.QLabel("%s <b>B/W</b>:" % _('Mask value')) self.mask_bw_label = QtWidgets.QLabel("%s <b>B/W</b>:" % _('Mask value'))
@ -102,7 +102,7 @@ class ToolImage(FlatCAMTool):
ti2_form_layout.addRow(self.mask_bw_label, self.mask_bw_entry) ti2_form_layout.addRow(self.mask_bw_label, self.mask_bw_entry)
# Mask value of the imported image for RED color when image color # Mask value of the imported image for RED color when image color
self.mask_r_entry = FCSpinner() self.mask_r_entry = FCSpinner(callback=self.confirmation_message_int)
self.mask_r_entry.set_range(0, 255) self.mask_r_entry.set_range(0, 255)
self.mask_r_label = QtWidgets.QLabel("%s <b>R:</b>" % _('Mask value')) self.mask_r_label = QtWidgets.QLabel("%s <b>R:</b>" % _('Mask value'))
@ -115,7 +115,7 @@ class ToolImage(FlatCAMTool):
ti2_form_layout.addRow(self.mask_r_label, self.mask_r_entry) ti2_form_layout.addRow(self.mask_r_label, self.mask_r_entry)
# Mask value of the imported image for GREEN color when image color # Mask value of the imported image for GREEN color when image color
self.mask_g_entry = FCSpinner() self.mask_g_entry = FCSpinner(callback=self.confirmation_message_int)
self.mask_g_entry.set_range(0, 255) self.mask_g_entry.set_range(0, 255)
self.mask_g_label = QtWidgets.QLabel("%s <b>G:</b>" % _('Mask value')) self.mask_g_label = QtWidgets.QLabel("%s <b>G:</b>" % _('Mask value'))
@ -128,7 +128,7 @@ class ToolImage(FlatCAMTool):
ti2_form_layout.addRow(self.mask_g_label, self.mask_g_entry) ti2_form_layout.addRow(self.mask_g_label, self.mask_g_entry)
# Mask value of the imported image for BLUE color when image color # Mask value of the imported image for BLUE color when image color
self.mask_b_entry = FCSpinner() self.mask_b_entry = FCSpinner(callback=self.confirmation_message_int)
self.mask_b_entry.set_range(0, 255) self.mask_b_entry.set_range(0, 255)
self.mask_b_label = QtWidgets.QLabel("%s <b>B:</b>" % _('Mask value')) self.mask_b_label = QtWidgets.QLabel("%s <b>B:</b>" % _('Mask value'))

View File

@ -366,7 +366,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
"Higher values = slow processing and slow execution on CNC\n" "Higher values = slow processing and slow execution on CNC\n"
"due of too many paths.") "due of too many paths.")
) )
self.ncc_overlap_entry = FCDoubleSpinner(suffix='%') self.ncc_overlap_entry = FCDoubleSpinner(callback=self.confirmation_message, suffix='%')
self.ncc_overlap_entry.set_precision(self.decimals) self.ncc_overlap_entry.set_precision(self.decimals)
self.ncc_overlap_entry.setWrapping(True) self.ncc_overlap_entry.setWrapping(True)
self.ncc_overlap_entry.setRange(0.000, 99.9999) self.ncc_overlap_entry.setRange(0.000, 99.9999)

View File

@ -78,7 +78,7 @@ class ToolOptimal(FlatCAMTool):
self.precision_label = QtWidgets.QLabel('%s:' % _("Precision")) self.precision_label = QtWidgets.QLabel('%s:' % _("Precision"))
self.precision_label.setToolTip(_("Number of decimals kept for found distances.")) self.precision_label.setToolTip(_("Number of decimals kept for found distances."))
self.precision_spinner = FCSpinner() self.precision_spinner = FCSpinner(callback=self.confirmation_message_int)
self.precision_spinner.set_range(2, 10) self.precision_spinner.set_range(2, 10)
self.precision_spinner.setWrapping(True) self.precision_spinner.setWrapping(True)
form_lay.addRow(self.precision_label, self.precision_spinner) form_lay.addRow(self.precision_label, self.precision_spinner)

View File

@ -334,7 +334,7 @@ class ToolPaint(FlatCAMTool, Gerber):
"Higher values = slow processing and slow execution on CNC\n" "Higher values = slow processing and slow execution on CNC\n"
"due of too many paths.") "due of too many paths.")
) )
self.paintoverlap_entry = FCDoubleSpinner(suffix='%') self.paintoverlap_entry = FCDoubleSpinner(callback=self.confirmation_message, suffix='%')
self.paintoverlap_entry.set_precision(3) self.paintoverlap_entry.set_precision(3)
self.paintoverlap_entry.setWrapping(True) self.paintoverlap_entry.setWrapping(True)
self.paintoverlap_entry.setRange(0.0000, 99.9999) self.paintoverlap_entry.setRange(0.0000, 99.9999)

View File

@ -182,7 +182,7 @@ class Panelize(FlatCAMTool):
form_layout.addRow(self.spacing_rows_label, self.spacing_rows) form_layout.addRow(self.spacing_rows_label, self.spacing_rows)
# Columns # Columns
self.columns = FCSpinner() self.columns = FCSpinner(callback=self.confirmation_message_int)
self.columns.set_range(0, 9999) self.columns.set_range(0, 9999)
self.columns_label = QtWidgets.QLabel('%s:' % _("Columns")) self.columns_label = QtWidgets.QLabel('%s:' % _("Columns"))
@ -192,7 +192,7 @@ class Panelize(FlatCAMTool):
form_layout.addRow(self.columns_label, self.columns) form_layout.addRow(self.columns_label, self.columns)
# Rows # Rows
self.rows = FCSpinner() self.rows = FCSpinner(callback=self.confirmation_message_int)
self.rows.set_range(0, 9999) self.rows.set_range(0, 9999)
self.rows_label = QtWidgets.QLabel('%s:' % _("Rows")) self.rows_label = QtWidgets.QLabel('%s:' % _("Rows"))

View File

@ -90,7 +90,7 @@ class PcbWizard(FlatCAMTool):
self.layout.addLayout(form_layout1) self.layout.addLayout(form_layout1)
# Integral part of the coordinates # Integral part of the coordinates
self.int_entry = FCSpinner() self.int_entry = FCSpinner(callback=self.confirmation_message_int)
self.int_entry.set_range(1, 10) self.int_entry.set_range(1, 10)
self.int_label = QtWidgets.QLabel('%s:' % _("Int. digits")) self.int_label = QtWidgets.QLabel('%s:' % _("Int. digits"))
self.int_label.setToolTip( self.int_label.setToolTip(
@ -99,7 +99,7 @@ class PcbWizard(FlatCAMTool):
form_layout1.addRow(self.int_label, self.int_entry) form_layout1.addRow(self.int_label, self.int_entry)
# Fractional part of the coordinates # Fractional part of the coordinates
self.frac_entry = FCSpinner() self.frac_entry = FCSpinner(callback=self.confirmation_message_int)
self.frac_entry.set_range(1, 10) self.frac_entry.set_range(1, 10)
self.frac_label = QtWidgets.QLabel('%s:' % _("Frac. digits")) self.frac_label = QtWidgets.QLabel('%s:' % _("Frac. digits"))
self.frac_label.setToolTip( self.frac_label.setToolTip(

View File

@ -298,7 +298,7 @@ class ToolPunchGerber(FlatCAMTool):
grid0.addWidget(self.prop_label, 12, 0, 1, 2) grid0.addWidget(self.prop_label, 12, 0, 1, 2)
# Diameter value # Diameter value
self.factor_entry = FCDoubleSpinner(suffix='%') self.factor_entry = FCDoubleSpinner(callback=self.confirmation_message, suffix='%')
self.factor_entry.set_precision(self.decimals) self.factor_entry.set_precision(self.decimals)
self.factor_entry.set_range(0.0000, 100.0000) self.factor_entry.set_range(0.0000, 100.0000)
self.factor_entry.setSingleStep(0.1) self.factor_entry.setSingleStep(0.1)

View File

@ -101,7 +101,7 @@ class QRCode(FlatCAMTool):
_("QRCode version can have values from 1 (21x21 boxes)\n" _("QRCode version can have values from 1 (21x21 boxes)\n"
"to 40 (177x177 boxes).") "to 40 (177x177 boxes).")
) )
self.version_entry = FCSpinner() self.version_entry = FCSpinner(callback=self.confirmation_message_int)
self.version_entry.set_range(1, 40) self.version_entry.set_range(1, 40)
self.version_entry.setWrapping(True) self.version_entry.setWrapping(True)
@ -137,7 +137,7 @@ class QRCode(FlatCAMTool):
_("Box size control the overall size of the QRcode\n" _("Box size control the overall size of the QRcode\n"
"by adjusting the size of each box in the code.") "by adjusting the size of each box in the code.")
) )
self.bsize_entry = FCSpinner() self.bsize_entry = FCSpinner(callback=self.confirmation_message_int)
self.bsize_entry.set_range(1, 9999) self.bsize_entry.set_range(1, 9999)
self.bsize_entry.setWrapping(True) self.bsize_entry.setWrapping(True)
@ -150,7 +150,7 @@ class QRCode(FlatCAMTool):
_("Size of the QRCode border. How many boxes thick is the border.\n" _("Size of the QRCode border. How many boxes thick is the border.\n"
"Default value is 4. The width of the clearance around the QRCode.") "Default value is 4. The width of the clearance around the QRCode.")
) )
self.border_size_entry = FCSpinner() self.border_size_entry = FCSpinner(callback=self.confirmation_message_int)
self.border_size_entry.set_range(1, 9999) self.border_size_entry.set_range(1, 9999)
self.border_size_entry.setWrapping(True) self.border_size_entry.setWrapping(True)
self.border_size_entry.set_value(4) self.border_size_entry.set_value(4)

View File

@ -282,7 +282,7 @@ class SolderPaste(FlatCAMTool):
self.gcode_form_layout.addRow(self.frz_dispense_label, self.frz_dispense_entry) self.gcode_form_layout.addRow(self.frz_dispense_label, self.frz_dispense_entry)
# Spindle Speed Forward # Spindle Speed Forward
self.speedfwd_entry = FCSpinner() self.speedfwd_entry = FCSpinner(callback=self.confirmation_message_int)
self.speedfwd_entry.set_range(0, 999999) self.speedfwd_entry.set_range(0, 999999)
self.speedfwd_entry.setSingleStep(1000) self.speedfwd_entry.setSingleStep(1000)
@ -306,7 +306,7 @@ class SolderPaste(FlatCAMTool):
self.gcode_form_layout.addRow(self.dwellfwd_label, self.dwellfwd_entry) self.gcode_form_layout.addRow(self.dwellfwd_label, self.dwellfwd_entry)
# Spindle Speed Reverse # Spindle Speed Reverse
self.speedrev_entry = FCSpinner() self.speedrev_entry = FCSpinner(callback=self.confirmation_message_int)
self.speedrev_entry.set_range(0, 999999) self.speedrev_entry.set_range(0, 999999)
self.speedrev_entry.setSingleStep(1000) self.speedrev_entry.setSingleStep(1000)

View File

@ -380,7 +380,7 @@ class ToolTransform(FlatCAMTool):
"of the initial dimension.") "of the initial dimension.")
) )
self.buffer_factor_entry = FCDoubleSpinner(suffix='%') self.buffer_factor_entry = FCDoubleSpinner(callback=self.confirmation_message, suffix='%')
self.buffer_factor_entry.set_range(-100.0000, 1000.0000) self.buffer_factor_entry.set_range(-100.0000, 1000.0000)
self.buffer_factor_entry.set_precision(self.decimals) self.buffer_factor_entry.set_precision(self.decimals)
self.buffer_factor_entry.setWrapping(True) self.buffer_factor_entry.setWrapping(True)