Merged in vbenso/flatcam/issue284 (pull request #140)
Issue #284 - Sanitize the entered Overlap value. Approved-by: Marius Stanciu <marius.adrian@gmail.com>
This commit is contained in:
@@ -437,7 +437,7 @@ class PaintOptionsTool(FlatCAMTool):
|
|||||||
grid.addWidget(self.painttooldia_entry, 0, 1)
|
grid.addWidget(self.painttooldia_entry, 0, 1)
|
||||||
|
|
||||||
# Overlap
|
# Overlap
|
||||||
ovlabel = QtWidgets.QLabel(_('Overlap:'))
|
ovlabel = QtWidgets.QLabel(_('Overlap Rate:'))
|
||||||
ovlabel.setToolTip(
|
ovlabel.setToolTip(
|
||||||
_("How much (fraction) of the tool width to overlap each tool pass.\n"
|
_("How much (fraction) of the tool width to overlap each tool pass.\n"
|
||||||
"Example:\n"
|
"Example:\n"
|
||||||
|
|||||||
@@ -4865,7 +4865,7 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI):
|
|||||||
self.ncc_tool_dia_entry = FCEntry()
|
self.ncc_tool_dia_entry = FCEntry()
|
||||||
grid0.addWidget(self.ncc_tool_dia_entry, 0, 1)
|
grid0.addWidget(self.ncc_tool_dia_entry, 0, 1)
|
||||||
|
|
||||||
nccoverlabel = QtWidgets.QLabel(_('Overlap:'))
|
nccoverlabel = QtWidgets.QLabel(_('Overlap Rate:'))
|
||||||
nccoverlabel.setToolTip(
|
nccoverlabel.setToolTip(
|
||||||
_( "How much (fraction) of the tool width to overlap each tool pass.\n"
|
_( "How much (fraction) of the tool width to overlap each tool pass.\n"
|
||||||
"Example:\n"
|
"Example:\n"
|
||||||
@@ -5110,7 +5110,7 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI):
|
|||||||
grid0.addWidget(self.painttooldia_entry, 0, 1)
|
grid0.addWidget(self.painttooldia_entry, 0, 1)
|
||||||
|
|
||||||
# Overlap
|
# Overlap
|
||||||
ovlabel = QtWidgets.QLabel(_('Overlap:'))
|
ovlabel = QtWidgets.QLabel(_('Overlap Rate:'))
|
||||||
ovlabel.setToolTip(
|
ovlabel.setToolTip(
|
||||||
_("How much (fraction) of the tool\n"
|
_("How much (fraction) of the tool\n"
|
||||||
"width to overlap each tool pass.")
|
"width to overlap each tool pass.")
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
|||||||
e_lab_1 = QtWidgets.QLabel('')
|
e_lab_1 = QtWidgets.QLabel('')
|
||||||
grid3.addWidget(e_lab_1, 0, 0)
|
grid3.addWidget(e_lab_1, 0, 0)
|
||||||
|
|
||||||
nccoverlabel = QtWidgets.QLabel(_('Overlap:'))
|
nccoverlabel = QtWidgets.QLabel(_('Overlap Rate:'))
|
||||||
nccoverlabel.setToolTip(
|
nccoverlabel.setToolTip(
|
||||||
_("How much (fraction) of the tool width to overlap each tool pass.\n"
|
_("How much (fraction) of the tool width to overlap each tool pass.\n"
|
||||||
"Example:\n"
|
"Example:\n"
|
||||||
@@ -628,6 +628,11 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
|||||||
return
|
return
|
||||||
over = over if over else self.app.defaults["tools_nccoverlap"]
|
over = over if over else self.app.defaults["tools_nccoverlap"]
|
||||||
|
|
||||||
|
if over >= 1 or over < 0:
|
||||||
|
self.app.inform.emit(_("[ERROR_NOTCL] Overlap value must be between "
|
||||||
|
"0 (inclusive) and 1 (exclusive), "))
|
||||||
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
margin = float(self.ncc_margin_entry.get_value())
|
margin = float(self.ncc_margin_entry.get_value())
|
||||||
except ValueError:
|
except ValueError:
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ class ToolPaint(FlatCAMTool, Gerber):
|
|||||||
self.tools_box.addLayout(grid3)
|
self.tools_box.addLayout(grid3)
|
||||||
|
|
||||||
# Overlap
|
# Overlap
|
||||||
ovlabel = QtWidgets.QLabel(_('Overlap:'))
|
ovlabel = QtWidgets.QLabel(_('Overlap Rate:'))
|
||||||
ovlabel.setToolTip(
|
ovlabel.setToolTip(
|
||||||
_("How much (fraction) of the tool width to overlap each tool pass.\n"
|
_("How much (fraction) of the tool width to overlap each tool pass.\n"
|
||||||
"Example:\n"
|
"Example:\n"
|
||||||
@@ -732,7 +732,6 @@ class ToolPaint(FlatCAMTool, Gerber):
|
|||||||
self.app.report_usage(_("geometry_on_paint_button"))
|
self.app.report_usage(_("geometry_on_paint_button"))
|
||||||
# self.app.call_source = 'paint'
|
# self.app.call_source = 'paint'
|
||||||
|
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] Click inside the desired polygon."))
|
|
||||||
try:
|
try:
|
||||||
overlap = float(self.paintoverlap_entry.get_value())
|
overlap = float(self.paintoverlap_entry.get_value())
|
||||||
except ValueError:
|
except ValueError:
|
||||||
@@ -744,6 +743,13 @@ class ToolPaint(FlatCAMTool, Gerber):
|
|||||||
"use a number."))
|
"use a number."))
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if overlap >= 1 or overlap < 0:
|
||||||
|
self.app.inform.emit(_("[ERROR_NOTCL] Overlap value must be between "
|
||||||
|
"0 (inclusive) and 1 (exclusive), "))
|
||||||
|
return
|
||||||
|
|
||||||
|
self.app.inform.emit(_("[WARNING_NOTCL] Click inside the desired polygon."))
|
||||||
|
|
||||||
connect = self.pathconnect_cb.get_value()
|
connect = self.pathconnect_cb.get_value()
|
||||||
contour = self.paintcontour_cb.get_value()
|
contour = self.paintcontour_cb.get_value()
|
||||||
select_method = self.selectmethod_combo.get_value()
|
select_method = self.selectmethod_combo.get_value()
|
||||||
|
|||||||
Reference in New Issue
Block a user