- modified all the FlatCAM tools strings to the new format in which the status is no longer included in the translated strings to make it easier for the future translations
- updated POT file with the new strings
This commit is contained in:
@@ -18,6 +18,7 @@ CAD program, and create G-Code for Isolation routing.
|
|||||||
- some fixes and prepared the activity monitor area to receive updated texts
|
- some fixes and prepared the activity monitor area to receive updated texts
|
||||||
- added progress display in status bar for generating CNCJob from Excellon objects
|
- added progress display in status bar for generating CNCJob from Excellon objects
|
||||||
- added progress display in status bar for generating CNCJob from Geometry objects
|
- added progress display in status bar for generating CNCJob from Geometry objects
|
||||||
|
- modified all the FlatCAM tools strings to the new format in which the status is no longer included in the translated strings to make it easier for the future translations
|
||||||
- updated POT file with the new strings
|
- updated POT file with the new strings
|
||||||
|
|
||||||
5.09.2019
|
5.09.2019
|
||||||
|
|||||||
@@ -307,8 +307,8 @@ class ToolCalculator(FlatCAMTool):
|
|||||||
try:
|
try:
|
||||||
tip_diameter = float(self.tipDia_entry.get_value().replace(',', '.'))
|
tip_diameter = float(self.tipDia_entry.get_value().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered, "
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
"use a number."))
|
_("Wrong value format entered, use a number."))
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -318,8 +318,8 @@ class ToolCalculator(FlatCAMTool):
|
|||||||
try:
|
try:
|
||||||
half_tip_angle = float(self.tipAngle_entry.get_value().replace(',', '.'))
|
half_tip_angle = float(self.tipAngle_entry.get_value().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered, "
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
"use a number."))
|
_("Wrong value format entered, use a number."))
|
||||||
return
|
return
|
||||||
half_tip_angle /= 2
|
half_tip_angle /= 2
|
||||||
|
|
||||||
@@ -330,8 +330,8 @@ class ToolCalculator(FlatCAMTool):
|
|||||||
try:
|
try:
|
||||||
cut_depth = float(self.cutDepth_entry.get_value().replace(',', '.'))
|
cut_depth = float(self.cutDepth_entry.get_value().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered, "
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
"use a number."))
|
_("Wrong value format entered, use a number."))
|
||||||
return
|
return
|
||||||
|
|
||||||
tool_diameter = tip_diameter + (2 * cut_depth * math.tan(math.radians(half_tip_angle)))
|
tool_diameter = tip_diameter + (2 * cut_depth * math.tan(math.radians(half_tip_angle)))
|
||||||
@@ -345,8 +345,8 @@ class ToolCalculator(FlatCAMTool):
|
|||||||
try:
|
try:
|
||||||
mm_val = float(self.mm_entry.get_value().replace(',', '.'))
|
mm_val = float(self.mm_entry.get_value().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered, "
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
"use a number."))
|
_("Wrong value format entered, use a number."))
|
||||||
return
|
return
|
||||||
self.inch_entry.set_value('%.6f' % (mm_val / 25.4))
|
self.inch_entry.set_value('%.6f' % (mm_val / 25.4))
|
||||||
|
|
||||||
@@ -358,8 +358,8 @@ class ToolCalculator(FlatCAMTool):
|
|||||||
try:
|
try:
|
||||||
inch_val = float(self.inch_entry.get_value().replace(',', '.'))
|
inch_val = float(self.inch_entry.get_value().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered, "
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
"use a number."))
|
_("Wrong value format entered, use a number."))
|
||||||
return
|
return
|
||||||
self.mm_entry.set_value('%.6f' % (inch_val * 25.4))
|
self.mm_entry.set_value('%.6f' % (inch_val * 25.4))
|
||||||
|
|
||||||
@@ -372,8 +372,8 @@ class ToolCalculator(FlatCAMTool):
|
|||||||
try:
|
try:
|
||||||
length = float(self.pcblength_entry.get_value().replace(',', '.'))
|
length = float(self.pcblength_entry.get_value().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered, "
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
"use a number."))
|
_("Wrong value format entered, use a number."))
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -383,8 +383,8 @@ class ToolCalculator(FlatCAMTool):
|
|||||||
try:
|
try:
|
||||||
width = float(self.pcbwidth_entry.get_value().replace(',', '.'))
|
width = float(self.pcbwidth_entry.get_value().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered, "
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
"use a number."))
|
_("Wrong value format entered, use a number."))
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -394,8 +394,8 @@ class ToolCalculator(FlatCAMTool):
|
|||||||
try:
|
try:
|
||||||
density = float(self.cdensity_entry.get_value().replace(',', '.'))
|
density = float(self.cdensity_entry.get_value().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered, "
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
"use a number."))
|
_("Wrong value format entered, use a number."))
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -405,8 +405,8 @@ class ToolCalculator(FlatCAMTool):
|
|||||||
try:
|
try:
|
||||||
copper = float(self.growth_entry.get_value().replace(',', '.'))
|
copper = float(self.growth_entry.get_value().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered, "
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
"use a number."))
|
_("Wrong value format entered, use a number."))
|
||||||
return
|
return
|
||||||
|
|
||||||
calculated_current = (length * width * density) * 0.0021527820833419
|
calculated_current = (length * width * density) * 0.0021527820833419
|
||||||
|
|||||||
@@ -368,11 +368,12 @@ class CutOut(FlatCAMTool):
|
|||||||
cutout_obj = self.app.collection.get_by_name(str(name))
|
cutout_obj = self.app.collection.get_by_name(str(name))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.debug("CutOut.on_freeform_cutout() --> %s" % str(e))
|
log.debug("CutOut.on_freeform_cutout() --> %s" % str(e))
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Could not retrieve object: %s") % name)
|
self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Could not retrieve object"), name))
|
||||||
return "Could not retrieve object: %s" % name
|
return "Could not retrieve object: %s" % name
|
||||||
|
|
||||||
if cutout_obj is None:
|
if cutout_obj is None:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] There is no object selected for Cutout.\nSelect one and try again."))
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
|
_("There is no object selected for Cutout.\nSelect one and try again."))
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -382,12 +383,13 @@ class CutOut(FlatCAMTool):
|
|||||||
try:
|
try:
|
||||||
dia = float(self.dia.get_value().replace(',', '.'))
|
dia = float(self.dia.get_value().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] Tool diameter value is missing or wrong format. "
|
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||||
"Add it and retry."))
|
_("Tool diameter value is missing or wrong format. Add it and retry."))
|
||||||
return
|
return
|
||||||
|
|
||||||
if 0 in {dia}:
|
if 0 in {dia}:
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] Tool Diameter is zero value. Change it to a positive real number."))
|
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||||
|
_("Tool Diameter is zero value. Change it to a positive real number."))
|
||||||
return "Tool Diameter is zero value. Change it to a positive real number."
|
return "Tool Diameter is zero value. Change it to a positive real number."
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -402,8 +404,8 @@ class CutOut(FlatCAMTool):
|
|||||||
try:
|
try:
|
||||||
margin = float(self.margin.get_value().replace(',', '.'))
|
margin = float(self.margin.get_value().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] Margin value is missing or wrong format. "
|
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||||
"Add it and retry."))
|
_("Margin value is missing or wrong format. Add it and retry."))
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -413,26 +415,27 @@ class CutOut(FlatCAMTool):
|
|||||||
try:
|
try:
|
||||||
gapsize = float(self.gapsize.get_value().replace(',', '.'))
|
gapsize = float(self.gapsize.get_value().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] Gap size value is missing or wrong format. "
|
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||||
"Add it and retry."))
|
_("Gap size value is missing or wrong format. Add it and retry."))
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
gaps = self.gaps.get_value()
|
gaps = self.gaps.get_value()
|
||||||
except TypeError:
|
except TypeError:
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] Number of gaps value is missing. Add it and retry."))
|
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Number of gaps value is missing. Add it and retry."))
|
||||||
return
|
return
|
||||||
|
|
||||||
if gaps not in ['None', 'LR', 'TB', '2LR', '2TB', '4', '8']:
|
if gaps not in ['None', 'LR', 'TB', '2LR', '2TB', '4', '8']:
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] Gaps value can be only one of: "
|
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||||
"'None', 'lr', 'tb', '2lr', '2tb', 4 or 8. "
|
_("Gaps value can be only one of: 'None', 'lr', 'tb', '2lr', '2tb', 4 or 8. "
|
||||||
"Fill in a correct value and retry. "))
|
"Fill in a correct value and retry. "))
|
||||||
return
|
return
|
||||||
|
|
||||||
if cutout_obj.multigeo is True:
|
if cutout_obj.multigeo is True:
|
||||||
self.app.inform.emit(_("[ERROR]Cutout operation cannot be done on a multi-geo Geometry.\n"
|
self.app.inform.emit('[ERROR] %s' % _("Cutout operation cannot be done on a multi-geo Geometry.\n"
|
||||||
"Optionally, this Multi-geo Geometry can be converted to Single-geo Geometry,\n"
|
"Optionally, this Multi-geo Geometry can be converted to "
|
||||||
"and after that perform Cutout."))
|
"Single-geo Geometry,\n"
|
||||||
|
"and after that perform Cutout."))
|
||||||
return
|
return
|
||||||
|
|
||||||
convex_box = self.convex_box.get_value()
|
convex_box = self.convex_box.get_value()
|
||||||
@@ -548,7 +551,7 @@ class CutOut(FlatCAMTool):
|
|||||||
self.app.new_object('geometry', outname, geo_init)
|
self.app.new_object('geometry', outname, geo_init)
|
||||||
|
|
||||||
cutout_obj.plot()
|
cutout_obj.plot()
|
||||||
self.app.inform.emit(_("[success] Any form CutOut operation finished."))
|
self.app.inform.emit('[success] %s' % _("Any form CutOut operation finished."))
|
||||||
self.app.ui.notebook.setCurrentWidget(self.app.ui.project_tab)
|
self.app.ui.notebook.setCurrentWidget(self.app.ui.project_tab)
|
||||||
self.app.should_we_save = True
|
self.app.should_we_save = True
|
||||||
|
|
||||||
@@ -565,11 +568,11 @@ class CutOut(FlatCAMTool):
|
|||||||
cutout_obj = self.app.collection.get_by_name(str(name))
|
cutout_obj = self.app.collection.get_by_name(str(name))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.debug("CutOut.on_rectangular_cutout() --> %s" % str(e))
|
log.debug("CutOut.on_rectangular_cutout() --> %s" % str(e))
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Could not retrieve object: %s") % name)
|
self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Could not retrieve object"), name))
|
||||||
return "Could not retrieve object: %s" % name
|
return "Could not retrieve object: %s" % name
|
||||||
|
|
||||||
if cutout_obj is None:
|
if cutout_obj is None:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Object not found: %s") % cutout_obj)
|
self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Object not found: %s"), cutout_obj))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
dia = float(self.dia.get_value())
|
dia = float(self.dia.get_value())
|
||||||
@@ -578,12 +581,13 @@ class CutOut(FlatCAMTool):
|
|||||||
try:
|
try:
|
||||||
dia = float(self.dia.get_value().replace(',', '.'))
|
dia = float(self.dia.get_value().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] Tool diameter value is missing or wrong format. "
|
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||||
"Add it and retry."))
|
_("Tool diameter value is missing or wrong format. Add it and retry."))
|
||||||
return
|
return
|
||||||
|
|
||||||
if 0 in {dia}:
|
if 0 in {dia}:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Tool Diameter is zero value. Change it to a positive real number."))
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
|
_("Tool Diameter is zero value. Change it to a positive real number."))
|
||||||
return "Tool Diameter is zero value. Change it to a positive real number."
|
return "Tool Diameter is zero value. Change it to a positive real number."
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -598,8 +602,8 @@ class CutOut(FlatCAMTool):
|
|||||||
try:
|
try:
|
||||||
margin = float(self.margin.get_value().replace(',', '.'))
|
margin = float(self.margin.get_value().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] Margin value is missing or wrong format. "
|
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||||
"Add it and retry."))
|
_("Margin value is missing or wrong format. Add it and retry."))
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -609,26 +613,28 @@ class CutOut(FlatCAMTool):
|
|||||||
try:
|
try:
|
||||||
gapsize = float(self.gapsize.get_value().replace(',', '.'))
|
gapsize = float(self.gapsize.get_value().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] Gap size value is missing or wrong format. "
|
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||||
"Add it and retry."))
|
_("Gap size value is missing or wrong format. Add it and retry."))
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
gaps = self.gaps.get_value()
|
gaps = self.gaps.get_value()
|
||||||
except TypeError:
|
except TypeError:
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] Number of gaps value is missing. Add it and retry."))
|
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||||
|
_("Number of gaps value is missing. Add it and retry."))
|
||||||
return
|
return
|
||||||
|
|
||||||
if gaps not in ['None', 'LR', 'TB', '2LR', '2TB', '4', '8']:
|
if gaps not in ['None', 'LR', 'TB', '2LR', '2TB', '4', '8']:
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] Gaps value can be only one of: "
|
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Gaps value can be only one of: "
|
||||||
"'None', 'lr', 'tb', '2lr', '2tb', 4 or 8. "
|
"'None', 'lr', 'tb', '2lr', '2tb', 4 or 8. "
|
||||||
"Fill in a correct value and retry. "))
|
"Fill in a correct value and retry. "))
|
||||||
return
|
return
|
||||||
|
|
||||||
if cutout_obj.multigeo is True:
|
if cutout_obj.multigeo is True:
|
||||||
self.app.inform.emit(_("[ERROR]Cutout operation cannot be done on a multi-geo Geometry.\n"
|
self.app.inform.emit('[ERROR] %s' % _("Cutout operation cannot be done on a multi-geo Geometry.\n"
|
||||||
"Optionally, this Multi-geo Geometry can be converted to Single-geo Geometry,\n"
|
"Optionally, this Multi-geo Geometry can be converted to "
|
||||||
"and after that perform Cutout."))
|
"Single-geo Geometry,\n"
|
||||||
|
"and after that perform Cutout."))
|
||||||
return
|
return
|
||||||
|
|
||||||
# Get min and max data for each object as we just cut rectangles across X or Y
|
# Get min and max data for each object as we just cut rectangles across X or Y
|
||||||
@@ -729,7 +735,8 @@ class CutOut(FlatCAMTool):
|
|||||||
self.app.new_object('geometry', outname, geo_init)
|
self.app.new_object('geometry', outname, geo_init)
|
||||||
|
|
||||||
# cutout_obj.plot()
|
# cutout_obj.plot()
|
||||||
self.app.inform.emit(_("[success] Any form CutOut operation finished."))
|
self.app.inform.emit('[success] %s' %
|
||||||
|
_("Any form CutOut operation finished."))
|
||||||
self.app.ui.notebook.setCurrentWidget(self.app.ui.project_tab)
|
self.app.ui.notebook.setCurrentWidget(self.app.ui.project_tab)
|
||||||
self.app.should_we_save = True
|
self.app.should_we_save = True
|
||||||
|
|
||||||
@@ -744,12 +751,13 @@ class CutOut(FlatCAMTool):
|
|||||||
try:
|
try:
|
||||||
self.cutting_dia = float(self.dia.get_value().replace(',', '.'))
|
self.cutting_dia = float(self.dia.get_value().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] Tool diameter value is missing or wrong format. "
|
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||||
"Add it and retry."))
|
_("Tool diameter value is missing or wrong format. Add it and retry."))
|
||||||
return
|
return
|
||||||
|
|
||||||
if 0 in {self.cutting_dia}:
|
if 0 in {self.cutting_dia}:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Tool Diameter is zero value. Change it to a positive real number."))
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
|
_("Tool Diameter is zero value. Change it to a positive real number."))
|
||||||
return "Tool Diameter is zero value. Change it to a positive real number."
|
return "Tool Diameter is zero value. Change it to a positive real number."
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -759,8 +767,8 @@ class CutOut(FlatCAMTool):
|
|||||||
try:
|
try:
|
||||||
self.cutting_gapsize = float(self.gapsize.get_value().replace(',', '.'))
|
self.cutting_gapsize = float(self.gapsize.get_value().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] Gap size value is missing or wrong format. "
|
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||||
"Add it and retry."))
|
_("Gap size value is missing or wrong format. Add it and retry."))
|
||||||
return
|
return
|
||||||
|
|
||||||
name = self.man_object_combo.currentText()
|
name = self.man_object_combo.currentText()
|
||||||
@@ -769,7 +777,7 @@ class CutOut(FlatCAMTool):
|
|||||||
self.man_cutout_obj = self.app.collection.get_by_name(str(name))
|
self.man_cutout_obj = self.app.collection.get_by_name(str(name))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.debug("CutOut.on_manual_cutout() --> %s" % str(e))
|
log.debug("CutOut.on_manual_cutout() --> %s" % str(e))
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Could not retrieve Geometry object: %s") % name)
|
self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Could not retrieve Geometry object"), name))
|
||||||
return "Could not retrieve object: %s" % name
|
return "Could not retrieve object: %s" % name
|
||||||
|
|
||||||
self.app.plotcanvas.vis_disconnect('key_press', self.app.ui.keyPressEvent)
|
self.app.plotcanvas.vis_disconnect('key_press', self.app.ui.keyPressEvent)
|
||||||
@@ -788,12 +796,12 @@ class CutOut(FlatCAMTool):
|
|||||||
self.man_cutout_obj = self.app.collection.get_by_name(str(name))
|
self.man_cutout_obj = self.app.collection.get_by_name(str(name))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.debug("CutOut.on_manual_cutout() --> %s" % str(e))
|
log.debug("CutOut.on_manual_cutout() --> %s" % str(e))
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Could not retrieve Geometry object: %s") % name)
|
self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Could not retrieve Geometry object"), name))
|
||||||
return "Could not retrieve object: %s" % name
|
return "Could not retrieve object: %s" % name
|
||||||
|
|
||||||
if self.man_cutout_obj is None:
|
if self.man_cutout_obj is None:
|
||||||
self.app.inform.emit(
|
self.app.inform.emit('[ERROR_NOTCL] %s: %s' %
|
||||||
_("[ERROR_NOTCL] Geometry object for manual cutout not found: %s") % self.man_cutout_obj)
|
(_("Geometry object for manual cutout not found"), self.man_cutout_obj))
|
||||||
return
|
return
|
||||||
|
|
||||||
# use the snapped position as reference
|
# use the snapped position as reference
|
||||||
@@ -803,7 +811,7 @@ class CutOut(FlatCAMTool):
|
|||||||
self.man_cutout_obj.subtract_polygon(cut_poly)
|
self.man_cutout_obj.subtract_polygon(cut_poly)
|
||||||
|
|
||||||
self.man_cutout_obj.plot()
|
self.man_cutout_obj.plot()
|
||||||
self.app.inform.emit(_("[success] Added manual Bridge Gap."))
|
self.app.inform.emit('[success] %s' % _("Added manual Bridge Gap."))
|
||||||
|
|
||||||
self.app.should_we_save = True
|
self.app.should_we_save = True
|
||||||
|
|
||||||
@@ -815,16 +823,18 @@ class CutOut(FlatCAMTool):
|
|||||||
cutout_obj = self.app.collection.get_by_name(str(name))
|
cutout_obj = self.app.collection.get_by_name(str(name))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.debug("CutOut.on_manual_geo() --> %s" % str(e))
|
log.debug("CutOut.on_manual_geo() --> %s" % str(e))
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Could not retrieve Gerber object: %s") % name)
|
self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Could not retrieve Gerber object"), name))
|
||||||
return "Could not retrieve object: %s" % name
|
return "Could not retrieve object: %s" % name
|
||||||
|
|
||||||
if cutout_obj is None:
|
if cutout_obj is None:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] There is no Gerber object selected for Cutout.\n"
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
|
_("There is no Gerber object selected for Cutout.\n"
|
||||||
"Select one and try again."))
|
"Select one and try again."))
|
||||||
return
|
return
|
||||||
|
|
||||||
if not isinstance(cutout_obj, FlatCAMGerber):
|
if not isinstance(cutout_obj, FlatCAMGerber):
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] The selected object has to be of Gerber type.\n"
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
|
_("The selected object has to be of Gerber type.\n"
|
||||||
"Select a Gerber file and try again."))
|
"Select a Gerber file and try again."))
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -835,12 +845,13 @@ class CutOut(FlatCAMTool):
|
|||||||
try:
|
try:
|
||||||
dia = float(self.dia.get_value().replace(',', '.'))
|
dia = float(self.dia.get_value().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] Tool diameter value is missing or wrong format. "
|
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||||
"Add it and retry."))
|
_("Tool diameter value is missing or wrong format. Add it and retry."))
|
||||||
return
|
return
|
||||||
|
|
||||||
if 0 in {dia}:
|
if 0 in {dia}:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Tool Diameter is zero value. Change it to a positive real number."))
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
|
_("Tool Diameter is zero value. Change it to a positive real number."))
|
||||||
return "Tool Diameter is zero value. Change it to a positive real number."
|
return "Tool Diameter is zero value. Change it to a positive real number."
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -855,8 +866,8 @@ class CutOut(FlatCAMTool):
|
|||||||
try:
|
try:
|
||||||
margin = float(self.margin.get_value().replace(',', '.'))
|
margin = float(self.margin.get_value().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] Margin value is missing or wrong format. "
|
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||||
"Add it and retry."))
|
_("Margin value is missing or wrong format. Add it and retry."))
|
||||||
return
|
return
|
||||||
|
|
||||||
convex_box = self.convex_box.get_value()
|
convex_box = self.convex_box.get_value()
|
||||||
@@ -877,7 +888,8 @@ class CutOut(FlatCAMTool):
|
|||||||
geo = box(x0, y0, x1, y1)
|
geo = box(x0, y0, x1, y1)
|
||||||
geo_obj.solid_geometry = geo.buffer(margin + abs(dia / 2))
|
geo_obj.solid_geometry = geo.buffer(margin + abs(dia / 2))
|
||||||
else:
|
else:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Geometry not supported for cutout: %s") % type(geo_union))
|
self.app.inform.emit('[ERROR_NOTCL] %s: %s' %
|
||||||
|
(_("Geometry not supported for cutout"), type(geo_union)))
|
||||||
return 'fail'
|
return 'fail'
|
||||||
else:
|
else:
|
||||||
geo = geo_union
|
geo = geo_union
|
||||||
|
|||||||
@@ -328,8 +328,8 @@ class DblSidedTool(FlatCAMTool):
|
|||||||
try:
|
try:
|
||||||
px, py = self.point_entry.get_value()
|
px, py = self.point_entry.get_value()
|
||||||
except TypeError:
|
except TypeError:
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] 'Point' reference is selected and 'Point' coordinates "
|
self.app.inform.emit('[WARNING_NOTCL] %s' % _("'Point' reference is selected and 'Point' coordinates "
|
||||||
"are missing. Add them and retry."))
|
"are missing. Add them and retry."))
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
selection_index = self.box_combo.currentIndex()
|
selection_index = self.box_combo.currentIndex()
|
||||||
@@ -347,7 +347,7 @@ class DblSidedTool(FlatCAMTool):
|
|||||||
bb_obj = model_index.internalPointer().obj
|
bb_obj = model_index.internalPointer().obj
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
self.app.inform.emit(
|
self.app.inform.emit(
|
||||||
_("[WARNING_NOTCL] There is no Box reference object loaded. Load one and retry."))
|
'[WARNING_NOTCL] %s' % _("There is no Box reference object loaded. Load one and retry."))
|
||||||
return
|
return
|
||||||
|
|
||||||
xmin, ymin, xmax, ymax = bb_obj.bounds()
|
xmin, ymin, xmax, ymax = bb_obj.bounds()
|
||||||
@@ -364,20 +364,21 @@ class DblSidedTool(FlatCAMTool):
|
|||||||
dia = float(self.drill_dia.get_value().replace(',', '.'))
|
dia = float(self.drill_dia.get_value().replace(',', '.'))
|
||||||
self.drill_dia.set_value(dia)
|
self.drill_dia.set_value(dia)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] Tool diameter value is missing or wrong format. "
|
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Tool diameter value is missing or wrong format. "
|
||||||
"Add it and retry."))
|
"Add it and retry."))
|
||||||
return
|
return
|
||||||
|
|
||||||
if dia is '':
|
if dia is '':
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] No value or wrong format in Drill Dia entry. Add it and retry."))
|
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||||
|
_("No value or wrong format in Drill Dia entry. Add it and retry."))
|
||||||
return
|
return
|
||||||
tools = {"1": {"C": dia}}
|
tools = {"1": {"C": dia}}
|
||||||
|
|
||||||
# holes = self.alignment_holes.get_value()
|
# holes = self.alignment_holes.get_value()
|
||||||
holes = eval('[{}]'.format(self.alignment_holes.text()))
|
holes = eval('[{}]'.format(self.alignment_holes.text()))
|
||||||
if not holes:
|
if not holes:
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] There are no Alignment Drill Coordinates to use. "
|
self.app.inform.emit('[WARNING_NOTCL] %s' % _("There are no Alignment Drill Coordinates to use. "
|
||||||
"Add them and retry."))
|
"Add them and retry."))
|
||||||
return
|
return
|
||||||
|
|
||||||
drills = []
|
drills = []
|
||||||
@@ -399,7 +400,7 @@ class DblSidedTool(FlatCAMTool):
|
|||||||
|
|
||||||
self.app.new_object("excellon", "Alignment Drills", obj_init)
|
self.app.new_object("excellon", "Alignment Drills", obj_init)
|
||||||
self.drill_values = ''
|
self.drill_values = ''
|
||||||
self.app.inform.emit(_("[success] Excellon object with alignment drills created..."))
|
self.app.inform.emit('[success] %s' % _("Excellon object with alignment drills created..."))
|
||||||
|
|
||||||
def on_mirror_gerber(self):
|
def on_mirror_gerber(self):
|
||||||
selection_index = self.gerber_object_combo.currentIndex()
|
selection_index = self.gerber_object_combo.currentIndex()
|
||||||
@@ -408,11 +409,11 @@ class DblSidedTool(FlatCAMTool):
|
|||||||
try:
|
try:
|
||||||
fcobj = model_index.internalPointer().obj
|
fcobj = model_index.internalPointer().obj
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] There is no Gerber object loaded ..."))
|
self.app.inform.emit('[WARNING_NOTCL] %s' % _("There is no Gerber object loaded ..."))
|
||||||
return
|
return
|
||||||
|
|
||||||
if not isinstance(fcobj, FlatCAMGerber):
|
if not isinstance(fcobj, FlatCAMGerber):
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Only Gerber, Excellon and Geometry objects can be mirrored."))
|
self.app.inform.emit('[ERROR_NOTCL] %s' % _("Only Gerber, Excellon and Geometry objects can be mirrored."))
|
||||||
return
|
return
|
||||||
|
|
||||||
axis = self.mirror_axis.get_value()
|
axis = self.mirror_axis.get_value()
|
||||||
@@ -422,8 +423,8 @@ class DblSidedTool(FlatCAMTool):
|
|||||||
try:
|
try:
|
||||||
px, py = self.point_entry.get_value()
|
px, py = self.point_entry.get_value()
|
||||||
except TypeError:
|
except TypeError:
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] 'Point' coordinates missing. "
|
self.app.inform.emit('[WARNING_NOTCL] %s' % _("'Point' coordinates missing. "
|
||||||
"Using Origin (0, 0) as mirroring reference."))
|
"Using Origin (0, 0) as mirroring reference."))
|
||||||
px, py = (0, 0)
|
px, py = (0, 0)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
@@ -432,7 +433,7 @@ class DblSidedTool(FlatCAMTool):
|
|||||||
try:
|
try:
|
||||||
bb_obj = model_index_box.internalPointer().obj
|
bb_obj = model_index_box.internalPointer().obj
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] There is no Box object loaded ..."))
|
self.app.inform.emit('[WARNING_NOTCL] %s' % _("There is no Box object loaded ..."))
|
||||||
return
|
return
|
||||||
|
|
||||||
xmin, ymin, xmax, ymax = bb_obj.bounds()
|
xmin, ymin, xmax, ymax = bb_obj.bounds()
|
||||||
@@ -442,7 +443,7 @@ class DblSidedTool(FlatCAMTool):
|
|||||||
fcobj.mirror(axis, [px, py])
|
fcobj.mirror(axis, [px, py])
|
||||||
self.app.object_changed.emit(fcobj)
|
self.app.object_changed.emit(fcobj)
|
||||||
fcobj.plot()
|
fcobj.plot()
|
||||||
self.app.inform.emit(_("[success] Gerber %s was mirrored...") % str(fcobj.options['name']))
|
self.app.inform.emit('[success] Gerber %s %s...' % (str(fcobj.options['name']), _("was mirrored")))
|
||||||
|
|
||||||
def on_mirror_exc(self):
|
def on_mirror_exc(self):
|
||||||
selection_index = self.exc_object_combo.currentIndex()
|
selection_index = self.exc_object_combo.currentIndex()
|
||||||
@@ -451,11 +452,11 @@ class DblSidedTool(FlatCAMTool):
|
|||||||
try:
|
try:
|
||||||
fcobj = model_index.internalPointer().obj
|
fcobj = model_index.internalPointer().obj
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] There is no Excellon object loaded ..."))
|
self.app.inform.emit('[WARNING_NOTCL] %s' % _("There is no Excellon object loaded ..."))
|
||||||
return
|
return
|
||||||
|
|
||||||
if not isinstance(fcobj, FlatCAMExcellon):
|
if not isinstance(fcobj, FlatCAMExcellon):
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Only Gerber, Excellon and Geometry objects can be mirrored."))
|
self.app.inform.emit('[ERROR_NOTCL] %s' % _("Only Gerber, Excellon and Geometry objects can be mirrored."))
|
||||||
return
|
return
|
||||||
|
|
||||||
axis = self.mirror_axis.get_value()
|
axis = self.mirror_axis.get_value()
|
||||||
@@ -466,8 +467,8 @@ class DblSidedTool(FlatCAMTool):
|
|||||||
px, py = self.point_entry.get_value()
|
px, py = self.point_entry.get_value()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.debug("DblSidedTool.on_mirror_geo() --> %s" % str(e))
|
log.debug("DblSidedTool.on_mirror_geo() --> %s" % str(e))
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] There are no Point coordinates in the Point field. "
|
self.app.inform.emit('[WARNING_NOTCL] %s' % _("There are no Point coordinates in the Point field. "
|
||||||
"Add coords and try again ..."))
|
"Add coords and try again ..."))
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
selection_index_box = self.box_combo.currentIndex()
|
selection_index_box = self.box_combo.currentIndex()
|
||||||
@@ -476,7 +477,7 @@ class DblSidedTool(FlatCAMTool):
|
|||||||
bb_obj = model_index_box.internalPointer().obj
|
bb_obj = model_index_box.internalPointer().obj
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.debug("DblSidedTool.on_mirror_geo() --> %s" % str(e))
|
log.debug("DblSidedTool.on_mirror_geo() --> %s" % str(e))
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] There is no Box object loaded ..."))
|
self.app.inform.emit('[WARNING_NOTCL] %s' % _("There is no Box object loaded ..."))
|
||||||
return
|
return
|
||||||
|
|
||||||
xmin, ymin, xmax, ymax = bb_obj.bounds()
|
xmin, ymin, xmax, ymax = bb_obj.bounds()
|
||||||
@@ -486,7 +487,7 @@ class DblSidedTool(FlatCAMTool):
|
|||||||
fcobj.mirror(axis, [px, py])
|
fcobj.mirror(axis, [px, py])
|
||||||
self.app.object_changed.emit(fcobj)
|
self.app.object_changed.emit(fcobj)
|
||||||
fcobj.plot()
|
fcobj.plot()
|
||||||
self.app.inform.emit(_("[success] Excellon %s was mirrored...") % str(fcobj.options['name']))
|
self.app.inform.emit('[success] Excellon %s %s...' % (str(fcobj.options['name']), _("was mirrored")))
|
||||||
|
|
||||||
def on_mirror_geo(self):
|
def on_mirror_geo(self):
|
||||||
selection_index = self.geo_object_combo.currentIndex()
|
selection_index = self.geo_object_combo.currentIndex()
|
||||||
@@ -495,11 +496,11 @@ class DblSidedTool(FlatCAMTool):
|
|||||||
try:
|
try:
|
||||||
fcobj = model_index.internalPointer().obj
|
fcobj = model_index.internalPointer().obj
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] There is no Geometry object loaded ..."))
|
self.app.inform.emit('[WARNING_NOTCL] %s' % _("There is no Geometry object loaded ..."))
|
||||||
return
|
return
|
||||||
|
|
||||||
if not isinstance(fcobj, FlatCAMGeometry):
|
if not isinstance(fcobj, FlatCAMGeometry):
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Only Gerber, Excellon and Geometry objects can be mirrored."))
|
self.app.inform.emit('[ERROR_NOTCL] %s' % _("Only Gerber, Excellon and Geometry objects can be mirrored."))
|
||||||
return
|
return
|
||||||
|
|
||||||
axis = self.mirror_axis.get_value()
|
axis = self.mirror_axis.get_value()
|
||||||
@@ -513,7 +514,7 @@ class DblSidedTool(FlatCAMTool):
|
|||||||
try:
|
try:
|
||||||
bb_obj = model_index_box.internalPointer().obj
|
bb_obj = model_index_box.internalPointer().obj
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] There is no Box object loaded ..."))
|
self.app.inform.emit('[WARNING_NOTCL] %s' % _("There is no Box object loaded ..."))
|
||||||
return
|
return
|
||||||
|
|
||||||
xmin, ymin, xmax, ymax = bb_obj.bounds()
|
xmin, ymin, xmax, ymax = bb_obj.bounds()
|
||||||
@@ -523,7 +524,8 @@ class DblSidedTool(FlatCAMTool):
|
|||||||
fcobj.mirror(axis, [px, py])
|
fcobj.mirror(axis, [px, py])
|
||||||
self.app.object_changed.emit(fcobj)
|
self.app.object_changed.emit(fcobj)
|
||||||
fcobj.plot()
|
fcobj.plot()
|
||||||
self.app.inform.emit(_("[success] Geometry %s was mirrored...") % str(fcobj.options['name']))
|
self.app.inform.emit('[success] Geometry %s %s...' % (str(fcobj.options['name']), _("was mirrored")))
|
||||||
|
|
||||||
|
|
||||||
def on_point_add(self):
|
def on_point_add(self):
|
||||||
val = self.app.defaults["global_point_clipboard_format"] % (self.app.pos[0], self.app.pos[1])
|
val = self.app.defaults["global_point_clipboard_format"] % (self.app.pos[0], self.app.pos[1])
|
||||||
|
|||||||
@@ -227,13 +227,15 @@ class Film(FlatCAMTool):
|
|||||||
try:
|
try:
|
||||||
name = self.tf_object_combo.currentText()
|
name = self.tf_object_combo.currentText()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] No FlatCAM object selected. Load an object for Film and retry."))
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
|
_("No FlatCAM object selected. Load an object for Film and retry."))
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
boxname = self.tf_box_combo.currentText()
|
boxname = self.tf_box_combo.currentText()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] No FlatCAM object selected. Load an object for Box and retry."))
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
|
_("No FlatCAM object selected. Load an object for Box and retry."))
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -243,15 +245,13 @@ class Film(FlatCAMTool):
|
|||||||
try:
|
try:
|
||||||
border = float(self.boundary_entry.get_value().replace(',', '.'))
|
border = float(self.boundary_entry.get_value().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered, "
|
self.app.inform.emit('[ERROR_NOTCL] %s' % _("Wrong value format entered, use a number."))
|
||||||
"use a number."))
|
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
scale_stroke_width = int(self.film_scale_entry.get_value())
|
scale_stroke_width = int(self.film_scale_entry.get_value())
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered, "
|
self.app.inform.emit('[ERROR_NOTCL] %s' % _("Wrong value format entered, use a number."))
|
||||||
"use a number."))
|
|
||||||
return
|
return
|
||||||
|
|
||||||
if border is None:
|
if border is None:
|
||||||
@@ -271,7 +271,7 @@ class Film(FlatCAMTool):
|
|||||||
filename = str(filename)
|
filename = str(filename)
|
||||||
|
|
||||||
if str(filename) == "":
|
if str(filename) == "":
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] Export SVG positive cancelled."))
|
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Export SVG positive cancelled."))
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
self.app.export_svg_black(name, boxname, filename, scale_factor=scale_stroke_width)
|
self.app.export_svg_black(name, boxname, filename, scale_factor=scale_stroke_width)
|
||||||
@@ -287,7 +287,7 @@ class Film(FlatCAMTool):
|
|||||||
filename = str(filename)
|
filename = str(filename)
|
||||||
|
|
||||||
if str(filename) == "":
|
if str(filename) == "":
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] Export SVG negative cancelled."))
|
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Export SVG negative cancelled."))
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
self.app.export_svg_negative(name, boxname, filename, border, scale_factor=scale_stroke_width)
|
self.app.export_svg_negative(name, boxname, filename, border, scale_factor=scale_stroke_width)
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ class ToolMove(FlatCAMTool):
|
|||||||
self.setVisible(False)
|
self.setVisible(False)
|
||||||
# signal that there is no command active
|
# signal that there is no command active
|
||||||
self.app.command_active = None
|
self.app.command_active = None
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] MOVE action cancelled. No object(s) to move."))
|
self.app.inform.emit('[WARNING_NOTCL] %s' % _("MOVE action cancelled. No object(s) to move."))
|
||||||
|
|
||||||
def on_left_click(self, event):
|
def on_left_click(self, event):
|
||||||
# mouse click will be accepted only if the left button is clicked
|
# mouse click will be accepted only if the left button is clicked
|
||||||
@@ -132,7 +132,7 @@ class ToolMove(FlatCAMTool):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
if not obj_list:
|
if not obj_list:
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] No object(s) selected."))
|
self.app.inform.emit('[WARNING_NOTCL] %s' % _("No object(s) selected."))
|
||||||
return "fail"
|
return "fail"
|
||||||
else:
|
else:
|
||||||
for sel_obj in obj_list:
|
for sel_obj in obj_list:
|
||||||
@@ -155,14 +155,15 @@ class ToolMove(FlatCAMTool):
|
|||||||
# self.app.collection.set_active(sel_obj.options['name'])
|
# self.app.collection.set_active(sel_obj.options['name'])
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
proc.done()
|
proc.done()
|
||||||
self.app.inform.emit(_('[ERROR_NOTCL] '
|
self.app.inform.emit('[ERROR_NOTCL] %s --> %s' % (_('ToolMove.on_left_click('), str(e)))
|
||||||
'ToolMove.on_left_click() --> %s') % str(e))
|
|
||||||
return "fail"
|
return "fail"
|
||||||
proc.done()
|
proc.done()
|
||||||
# delete the selection bounding box
|
# delete the selection bounding box
|
||||||
self.delete_shape()
|
self.delete_shape()
|
||||||
self.app.inform.emit(_('[success] %s object was moved ...') %
|
self.app.inform.emit('[success] %s %s' % (str(sel_obj.kind).capitalize(),
|
||||||
str(sel_obj.kind).capitalize())
|
_('object was moved ...')
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
self.app.worker_task.emit({'fcn': job_move, 'params': [self]})
|
self.app.worker_task.emit({'fcn': job_move, 'params': [self]})
|
||||||
|
|
||||||
@@ -171,8 +172,8 @@ class ToolMove(FlatCAMTool):
|
|||||||
return
|
return
|
||||||
|
|
||||||
except TypeError:
|
except TypeError:
|
||||||
self.app.inform.emit(_('[ERROR_NOTCL] '
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
'ToolMove.on_left_click() --> Error when mouse left click.'))
|
_('ToolMove.on_left_click() --> Error when mouse left click.'))
|
||||||
return
|
return
|
||||||
|
|
||||||
self.clicked_move = 1
|
self.clicked_move = 1
|
||||||
@@ -199,7 +200,7 @@ class ToolMove(FlatCAMTool):
|
|||||||
def on_key_press(self, event):
|
def on_key_press(self, event):
|
||||||
if event.key == 'escape':
|
if event.key == 'escape':
|
||||||
# abort the move action
|
# abort the move action
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] Move action cancelled."))
|
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Move action cancelled."))
|
||||||
self.toggle()
|
self.toggle()
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -211,7 +212,7 @@ class ToolMove(FlatCAMTool):
|
|||||||
|
|
||||||
obj_list = self.app.collection.get_selected()
|
obj_list = self.app.collection.get_selected()
|
||||||
if not obj_list:
|
if not obj_list:
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] Object(s) not selected"))
|
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Object(s) not selected"))
|
||||||
self.toggle()
|
self.toggle()
|
||||||
else:
|
else:
|
||||||
# if we have an object selected then we can safely activate the mouse events
|
# if we have an object selected then we can safely activate the mouse events
|
||||||
|
|||||||
@@ -859,8 +859,8 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
|||||||
try:
|
try:
|
||||||
tip_dia = float(self.tipdia_entry.get_value().replace(',', '.'))
|
tip_dia = float(self.tipdia_entry.get_value().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered, "
|
self.app.inform.emit('[ERROR_NOTCL] %s' % _("Wrong value format entered, "
|
||||||
"use a number."))
|
"use a number."))
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -870,8 +870,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
|||||||
try:
|
try:
|
||||||
tip_angle = float(self.tipangle_entry.get_value().replace(',', '.')) / 2
|
tip_angle = float(self.tipangle_entry.get_value().replace(',', '.')) / 2
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered, "
|
self.app.inform.emit('[ERROR_NOTCL] %s' % _("Wrong value format entered, use a number."))
|
||||||
"use a number."))
|
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -881,8 +880,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
|||||||
try:
|
try:
|
||||||
cut_z = float(self.cutz_entry.get_value().replace(',', '.'))
|
cut_z = float(self.cutz_entry.get_value().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered, "
|
self.app.inform.emit('[ERROR_NOTCL] %s' % _("Wrong value format entered, use a number."))
|
||||||
"use a number."))
|
|
||||||
return
|
return
|
||||||
# calculated tool diameter so the cut_z parameter is obeyed
|
# calculated tool diameter so the cut_z parameter is obeyed
|
||||||
tool_dia = tip_dia + 2 * cut_z * math.tan(math.radians(tip_angle))
|
tool_dia = tip_dia + 2 * cut_z * math.tan(math.radians(tip_angle))
|
||||||
@@ -900,13 +898,12 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
|||||||
try:
|
try:
|
||||||
tool_dia = float(self.addtool_entry.get_value().replace(',', '.'))
|
tool_dia = float(self.addtool_entry.get_value().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered, "
|
self.app.inform.emit('[ERROR_NOTCL] %s' % _("Wrong value format entered, use a number."))
|
||||||
"use a number."))
|
|
||||||
return
|
return
|
||||||
|
|
||||||
if tool_dia is None:
|
if tool_dia is None:
|
||||||
self.build_ui()
|
self.build_ui()
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] Please enter a tool diameter to add, in Float format."))
|
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Please enter a tool diameter to add, in Float format."))
|
||||||
return
|
return
|
||||||
|
|
||||||
if self.units == 'MM':
|
if self.units == 'MM':
|
||||||
@@ -915,8 +912,8 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
|||||||
tool_dia = float('%.4f' % tool_dia)
|
tool_dia = float('%.4f' % tool_dia)
|
||||||
|
|
||||||
if tool_dia == 0:
|
if tool_dia == 0:
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] Please enter a tool diameter with non-zero value, "
|
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Please enter a tool diameter with non-zero value, "
|
||||||
"in Float format."))
|
"in Float format."))
|
||||||
return
|
return
|
||||||
|
|
||||||
# construct a list of all 'tooluid' in the self.tools
|
# construct a list of all 'tooluid' in the self.tools
|
||||||
@@ -940,12 +937,12 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
|||||||
|
|
||||||
if float('%.4f' % tool_dia) in tool_dias:
|
if float('%.4f' % tool_dia) in tool_dias:
|
||||||
if muted is None:
|
if muted is None:
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] Adding tool cancelled. Tool already in Tool Table."))
|
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Adding tool cancelled. Tool already in Tool Table."))
|
||||||
self.tools_table.itemChanged.connect(self.on_tool_edit)
|
self.tools_table.itemChanged.connect(self.on_tool_edit)
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
if muted is None:
|
if muted is None:
|
||||||
self.app.inform.emit(_("[success] New tool added to Tool Table."))
|
self.app.inform.emit('[success] %s' % _("New tool added to Tool Table."))
|
||||||
self.ncc_tools.update({
|
self.ncc_tools.update({
|
||||||
int(self.tooluid): {
|
int(self.tooluid): {
|
||||||
'tooldia': float('%.4f' % tool_dia),
|
'tooldia': float('%.4f' % tool_dia),
|
||||||
@@ -980,7 +977,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
|||||||
try:
|
try:
|
||||||
new_tool_dia = float(self.tools_table.item(row, 1).text().replace(',', '.'))
|
new_tool_dia = float(self.tools_table.item(row, 1).text().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered, "
|
self.app.inform.emit('[ERROR_NOTCL] %s' % _("Wrong value format entered, "
|
||||||
"use a number."))
|
"use a number."))
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -989,7 +986,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
|||||||
# identify the tool that was edited and get it's tooluid
|
# identify the tool that was edited and get it's tooluid
|
||||||
if new_tool_dia not in tool_dias:
|
if new_tool_dia not in tool_dias:
|
||||||
self.ncc_tools[tooluid]['tooldia'] = new_tool_dia
|
self.ncc_tools[tooluid]['tooldia'] = new_tool_dia
|
||||||
self.app.inform.emit(_("[success] Tool from Tool Table was edited."))
|
self.app.inform.emit('[success] %s' % _("Tool from Tool Table was edited."))
|
||||||
self.build_ui()
|
self.build_ui()
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
@@ -1000,8 +997,8 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
|||||||
break
|
break
|
||||||
restore_dia_item = self.tools_table.item(row, 1)
|
restore_dia_item = self.tools_table.item(row, 1)
|
||||||
restore_dia_item.setText(str(old_tool_dia))
|
restore_dia_item.setText(str(old_tool_dia))
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] Edit cancelled. "
|
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Edit cancelled. "
|
||||||
"New diameter value is already in the Tool Table."))
|
"New diameter value is already in the Tool Table."))
|
||||||
self.build_ui()
|
self.build_ui()
|
||||||
|
|
||||||
def on_tool_delete(self, rows_to_delete=None, all=None):
|
def on_tool_delete(self, rows_to_delete=None, all=None):
|
||||||
@@ -1040,12 +1037,12 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
|||||||
self.ncc_tools.pop(t, None)
|
self.ncc_tools.pop(t, None)
|
||||||
|
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] Delete failed. Select a tool to delete."))
|
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Delete failed. Select a tool to delete."))
|
||||||
return
|
return
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.debug(str(e))
|
log.debug(str(e))
|
||||||
|
|
||||||
self.app.inform.emit(_("[success] Tool(s) deleted from Tool Table."))
|
self.app.inform.emit('[success] %s' % _("Tool(s) deleted from Tool Table."))
|
||||||
self.build_ui()
|
self.build_ui()
|
||||||
|
|
||||||
def on_ncc_click(self):
|
def on_ncc_click(self):
|
||||||
@@ -1062,13 +1059,13 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
|||||||
try:
|
try:
|
||||||
overlap = float(self.ncc_overlap_entry.get_value().replace(',', '.'))
|
overlap = float(self.ncc_overlap_entry.get_value().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered, "
|
self.app.inform.emit('[ERROR_NOTCL] %s' % _("Wrong value format entered, "
|
||||||
"use a number."))
|
"use a number."))
|
||||||
return
|
return
|
||||||
|
|
||||||
if overlap >= 1 or overlap < 0:
|
if overlap >= 1 or overlap < 0:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Overlap value must be between "
|
self.app.inform.emit('[ERROR_NOTCL] %s' % _("Overlap value must be between "
|
||||||
"0 (inclusive) and 1 (exclusive), "))
|
"0 (inclusive) and 1 (exclusive), "))
|
||||||
return
|
return
|
||||||
|
|
||||||
connect = self.ncc_connect_cb.get_value()
|
connect = self.ncc_connect_cb.get_value()
|
||||||
@@ -1083,11 +1080,11 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
|||||||
try:
|
try:
|
||||||
self.ncc_obj = self.app.collection.get_by_name(self.obj_name)
|
self.ncc_obj = self.app.collection.get_by_name(self.obj_name)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Could not retrieve object: %s") % self.obj_name)
|
self.app.inform.emit('[ERROR_NOTCL] %s' % _("Could not retrieve object: %s") % self.obj_name)
|
||||||
return "Could not retrieve object: %s" % self.obj_name
|
return "Could not retrieve object: %s" % self.obj_name
|
||||||
|
|
||||||
if self.ncc_obj is None:
|
if self.ncc_obj is None:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Object not found: %s") % self.ncc_obj)
|
self.app.inform.emit('[ERROR_NOTCL] %s' % _("Object not found: %s") % self.ncc_obj)
|
||||||
return
|
return
|
||||||
|
|
||||||
# use the selected tools in the tool table; get diameters for non-copper clear
|
# use the selected tools in the tool table; get diameters for non-copper clear
|
||||||
@@ -1103,8 +1100,8 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
|||||||
try:
|
try:
|
||||||
tooldia = float(self.tools_table.item(x.row(), 1).text().replace(',', '.'))
|
tooldia = float(self.tools_table.item(x.row(), 1).text().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong Tool Dia value format entered, "
|
self.app.inform.emit('[ERROR_NOTCL] %s' % _("Wrong Tool Dia value format entered, "
|
||||||
"use a number."))
|
"use a number."))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if self.tools_table.cellWidget(x.row(), 4).currentText() == 'iso_op':
|
if self.tools_table.cellWidget(x.row(), 4).currentText() == 'iso_op':
|
||||||
@@ -1112,7 +1109,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
|||||||
else:
|
else:
|
||||||
ncc_dia_list.append(tooldia)
|
ncc_dia_list.append(tooldia)
|
||||||
else:
|
else:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] No selected tools in Tool Table."))
|
self.app.inform.emit('[ERROR_NOTCL] %s' % _("No selected tools in Tool Table."))
|
||||||
return
|
return
|
||||||
|
|
||||||
o_name = '%s_ncc' % self.obj_name
|
o_name = '%s_ncc' % self.obj_name
|
||||||
@@ -1124,7 +1121,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
|||||||
try:
|
try:
|
||||||
self.bound_obj = self.app.collection.get_by_name(self.bound_obj_name)
|
self.bound_obj = self.app.collection.get_by_name(self.bound_obj_name)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Could not retrieve object: %s") % self.obj_name)
|
self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Could not retrieve object"), self.obj_name))
|
||||||
return "Could not retrieve object: %s" % self.obj_name
|
return "Could not retrieve object: %s" % self.obj_name
|
||||||
|
|
||||||
self.clear_copper(ncc_obj=self.ncc_obj,
|
self.clear_copper(ncc_obj=self.ncc_obj,
|
||||||
@@ -1137,7 +1134,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
|||||||
contour=contour,
|
contour=contour,
|
||||||
rest=rest)
|
rest=rest)
|
||||||
elif select_method == 'area':
|
elif select_method == 'area':
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] Click the start point of the area."))
|
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Click the start point of the area."))
|
||||||
|
|
||||||
# use the first tool in the tool table; get the diameter
|
# use the first tool in the tool table; get the diameter
|
||||||
# tooldia = float('%.4f' % float(self.tools_table.item(0, 1).text()))
|
# tooldia = float('%.4f' % float(self.tools_table.item(0, 1).text()))
|
||||||
@@ -1148,7 +1145,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
|||||||
if event.button == 1:
|
if event.button == 1:
|
||||||
if self.first_click is False:
|
if self.first_click is False:
|
||||||
self.first_click = True
|
self.first_click = True
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] Click the end point of the paint area."))
|
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Click the end point of the paint area."))
|
||||||
|
|
||||||
self.cursor_pos = self.app.plotcanvas.translate_coords(event.pos)
|
self.cursor_pos = self.app.plotcanvas.translate_coords(event.pos)
|
||||||
if self.app.grid_status() == True:
|
if self.app.grid_status() == True:
|
||||||
@@ -1265,7 +1262,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
|||||||
try:
|
try:
|
||||||
self.bound_obj = self.app.collection.get_by_name(self.bound_obj_name)
|
self.bound_obj = self.app.collection.get_by_name(self.bound_obj_name)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Could not retrieve object: %s") % self.bound_obj_name)
|
self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Could not retrieve object"), self.bound_obj_name))
|
||||||
return "Could not retrieve object: %s. Error: %s" % (self.bound_obj_name, str(e))
|
return "Could not retrieve object: %s. Error: %s" % (self.bound_obj_name, str(e))
|
||||||
|
|
||||||
self.clear_copper(ncc_obj=self.ncc_obj,
|
self.clear_copper(ncc_obj=self.ncc_obj,
|
||||||
@@ -1339,8 +1336,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
|||||||
try:
|
try:
|
||||||
ncc_margin = float(self.ncc_margin_entry.get_value().replace(',', '.'))
|
ncc_margin = float(self.ncc_margin_entry.get_value().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered, "
|
self.app.inform.emit('[ERROR_NOTCL] %s' % _("Wrong value format entered, use a number."))
|
||||||
"use a number."))
|
|
||||||
return
|
return
|
||||||
|
|
||||||
if select_method is not None:
|
if select_method is not None:
|
||||||
@@ -1366,8 +1362,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
|||||||
try:
|
try:
|
||||||
ncc_offset = float(self.ncc_offset_spinner.get_value())
|
ncc_offset = float(self.ncc_offset_spinner.get_value())
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered, "
|
self.app.inform.emit('[ERROR_NOTCL] %s' % _("Wrong value format entered, use a number."))
|
||||||
"use a number."))
|
|
||||||
return
|
return
|
||||||
|
|
||||||
# ######################################################################################################
|
# ######################################################################################################
|
||||||
@@ -1417,7 +1412,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
|||||||
bounding_box = env_obj.buffer(distance=ncc_margin, join_style=base.JOIN_STYLE.mitre)
|
bounding_box = env_obj.buffer(distance=ncc_margin, join_style=base.JOIN_STYLE.mitre)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.debug("NonCopperClear.clear_copper() 'itself' --> %s" % str(e))
|
log.debug("NonCopperClear.clear_copper() 'itself' --> %s" % str(e))
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] No object available."))
|
self.app.inform.emit('[ERROR_NOTCL] %s' % _("No object available."))
|
||||||
return 'fail'
|
return 'fail'
|
||||||
elif ncc_select == 'area':
|
elif ncc_select == 'area':
|
||||||
geo_n = cascaded_union(self.sel_rect)
|
geo_n = cascaded_union(self.sel_rect)
|
||||||
@@ -1451,7 +1446,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
|||||||
bounding_box = cascaded_union(self.ncc_obj.solid_geometry).convex_hull.intersection(geo_n)
|
bounding_box = cascaded_union(self.ncc_obj.solid_geometry).convex_hull.intersection(geo_n)
|
||||||
bounding_box = bounding_box.buffer(distance=ncc_margin, join_style=base.JOIN_STYLE.mitre)
|
bounding_box = bounding_box.buffer(distance=ncc_margin, join_style=base.JOIN_STYLE.mitre)
|
||||||
else:
|
else:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] The reference object type is not supported."))
|
self.app.inform.emit('[ERROR_NOTCL] %s' % _("The reference object type is not supported."))
|
||||||
return 'fail'
|
return 'fail'
|
||||||
|
|
||||||
log.debug("Copper clearing. Finished non-copper polygons.")
|
log.debug("Copper clearing. Finished non-copper polygons.")
|
||||||
@@ -1507,9 +1502,9 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
|||||||
if isinstance(ncc_obj, FlatCAMGerber) and not isotooldia:
|
if isinstance(ncc_obj, FlatCAMGerber) and not isotooldia:
|
||||||
sol_geo = ncc_obj.solid_geometry
|
sol_geo = ncc_obj.solid_geometry
|
||||||
if has_offset is True:
|
if has_offset is True:
|
||||||
app_obj.inform.emit(_("[WARNING_NOTCL] Buffering ..."))
|
app_obj.inform.emit('[WARNING_NOTCL] %s' % _("Buffering ..."))
|
||||||
sol_geo = sol_geo.buffer(distance=ncc_offset)
|
sol_geo = sol_geo.buffer(distance=ncc_offset)
|
||||||
app_obj.inform.emit(_("[success] Buffering finished ..."))
|
app_obj.inform.emit('[success] %s' % _("Buffering finished ..."))
|
||||||
empty = self.get_ncc_empty_area(target=sol_geo, boundary=bounding_box)
|
empty = self.get_ncc_empty_area(target=sol_geo, boundary=bounding_box)
|
||||||
elif isinstance(ncc_obj, FlatCAMGerber) and isotooldia:
|
elif isinstance(ncc_obj, FlatCAMGerber) and isotooldia:
|
||||||
isolated_geo = []
|
isolated_geo = []
|
||||||
@@ -1527,7 +1522,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
|||||||
isolated_geo = self.generate_envelope(tool_iso / 2, 0)
|
isolated_geo = self.generate_envelope(tool_iso / 2, 0)
|
||||||
|
|
||||||
if isolated_geo == 'fail':
|
if isolated_geo == 'fail':
|
||||||
app_obj.inform.emit(_("[ERROR_NOTCL] Isolation geometry could not be generated."))
|
app_obj.inform.emit('[ERROR_NOTCL] %s' % _("Isolation geometry could not be generated."))
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
for geo_elem in isolated_geo:
|
for geo_elem in isolated_geo:
|
||||||
@@ -1589,21 +1584,22 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
|||||||
if has_offset is True:
|
if has_offset is True:
|
||||||
app_obj.inform.emit(_("[WARNING_NOTCL] Buffering ..."))
|
app_obj.inform.emit(_("[WARNING_NOTCL] Buffering ..."))
|
||||||
sol_geo = sol_geo.buffer(distance=ncc_offset)
|
sol_geo = sol_geo.buffer(distance=ncc_offset)
|
||||||
app_obj.inform.emit(_("[success] Buffering finished ..."))
|
app_obj.inform.emit('[success] %s' % _("Buffering finished ..."))
|
||||||
empty = self.get_ncc_empty_area(target=sol_geo, boundary=bounding_box)
|
empty = self.get_ncc_empty_area(target=sol_geo, boundary=bounding_box)
|
||||||
elif isinstance(ncc_obj, FlatCAMGeometry):
|
elif isinstance(ncc_obj, FlatCAMGeometry):
|
||||||
sol_geo = cascaded_union(ncc_obj.solid_geometry)
|
sol_geo = cascaded_union(ncc_obj.solid_geometry)
|
||||||
if has_offset is True:
|
if has_offset is True:
|
||||||
app_obj.inform.emit(_("[WARNING_NOTCL] Buffering ..."))
|
app_obj.inform.emit(_("[WARNING_NOTCL] Buffering ..."))
|
||||||
sol_geo = sol_geo.buffer(distance=ncc_offset)
|
sol_geo = sol_geo.buffer(distance=ncc_offset)
|
||||||
app_obj.inform.emit(_("[success] Buffering finished ..."))
|
app_obj.inform.emit('[success] %' % _("Buffering finished ..."))
|
||||||
empty = self.get_ncc_empty_area(target=sol_geo, boundary=bounding_box)
|
empty = self.get_ncc_empty_area(target=sol_geo, boundary=bounding_box)
|
||||||
else:
|
else:
|
||||||
app_obj.inform.emit(_('[ERROR_NOTCL] The selected object is not suitable for copper clearing.'))
|
app_obj.inform.emit('[ERROR_NOTCL] %' % _('The selected object is not suitable for copper clearing.'))
|
||||||
return
|
return
|
||||||
|
|
||||||
if empty.is_empty:
|
if empty.is_empty:
|
||||||
app_obj.inform.emit(_("[ERROR_NOTCL] Could not get the extent of the area to be non copper cleared."))
|
app_obj.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
|
_("Could not get the extent of the area to be non copper cleared."))
|
||||||
return 'fail'
|
return 'fail'
|
||||||
|
|
||||||
if type(empty) is Polygon:
|
if type(empty) is Polygon:
|
||||||
@@ -1747,19 +1743,22 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
|||||||
if geo_obj.tools[tooluid]['solid_geometry']:
|
if geo_obj.tools[tooluid]['solid_geometry']:
|
||||||
has_solid_geo += 1
|
has_solid_geo += 1
|
||||||
if has_solid_geo == 0:
|
if has_solid_geo == 0:
|
||||||
app_obj.inform.emit(_("[ERROR] There is no Painting Geometry in the file.\n"
|
app_obj.inform.emit('[ERROR] %s' % _("There is no Painting Geometry in the file.\n"
|
||||||
"Usually it means that the tool diameter is too big for the painted geometry.\n"
|
"Usually it means that the tool diameter is too big "
|
||||||
"Change the painting parameters and try again."))
|
"for the painted geometry.\n"
|
||||||
|
"Change the painting parameters and try again."))
|
||||||
return
|
return
|
||||||
|
|
||||||
# Experimental...
|
# Experimental...
|
||||||
# print("Indexing...", end=' ')
|
# print("Indexing...", end=' ')
|
||||||
# geo_obj.make_index()
|
# geo_obj.make_index()
|
||||||
if warning_flag == 0:
|
if warning_flag == 0:
|
||||||
self.app.inform.emit(_("[success] Non-Copper clear all done."))
|
self.app.inform.emit('[success] %s' % _("Non-Copper clear all done."))
|
||||||
else:
|
else:
|
||||||
self.app.inform.emit('%s: %s %s.' % (_("[WARNING] Non-Copper clear all done but the copper features "
|
self.app.inform.emit('[WARNING] %s: %s %s.' % (_("Non-Copper clear all done but the copper features "
|
||||||
"isolation is broken for"), str(warning_flag), _("tools")))
|
"isolation is broken for"),
|
||||||
|
str(warning_flag),
|
||||||
|
_("tools")))
|
||||||
|
|
||||||
# ###########################################################################################
|
# ###########################################################################################
|
||||||
# Initializes the new geometry object for the case of the rest-machining ####################
|
# Initializes the new geometry object for the case of the rest-machining ####################
|
||||||
@@ -1793,9 +1792,9 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
|||||||
if isinstance(ncc_obj, FlatCAMGerber) and not isotooldia:
|
if isinstance(ncc_obj, FlatCAMGerber) and not isotooldia:
|
||||||
sol_geo = ncc_obj.solid_geometry
|
sol_geo = ncc_obj.solid_geometry
|
||||||
if has_offset is True:
|
if has_offset is True:
|
||||||
app_obj.inform.emit(_("[WARNING_NOTCL] Buffering ..."))
|
app_obj.inform.emit('[WARNING_NOTCL] %s' % _("Buffering ..."))
|
||||||
sol_geo = sol_geo.buffer(distance=ncc_offset)
|
sol_geo = sol_geo.buffer(distance=ncc_offset)
|
||||||
app_obj.inform.emit(_("[success] Buffering finished ..."))
|
app_obj.inform.emit('[success] %s' % _("Buffering finished ..."))
|
||||||
empty = self.get_ncc_empty_area(target=sol_geo, boundary=bounding_box)
|
empty = self.get_ncc_empty_area(target=sol_geo, boundary=bounding_box)
|
||||||
elif isinstance(ncc_obj, FlatCAMGerber) and isotooldia:
|
elif isinstance(ncc_obj, FlatCAMGerber) and isotooldia:
|
||||||
isolated_geo = []
|
isolated_geo = []
|
||||||
@@ -1813,7 +1812,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
|||||||
isolated_geo = self.generate_envelope(tool_iso, 0)
|
isolated_geo = self.generate_envelope(tool_iso, 0)
|
||||||
|
|
||||||
if isolated_geo == 'fail':
|
if isolated_geo == 'fail':
|
||||||
app_obj.inform.emit(_("[ERROR_NOTCL] Isolation geometry could not be generated."))
|
app_obj.inform.emit('[ERROR_NOTCL] %s' % _("Isolation geometry could not be generated."))
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
for geo_elem in isolated_geo:
|
for geo_elem in isolated_geo:
|
||||||
@@ -1873,23 +1872,24 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
|||||||
|
|
||||||
sol_geo = cascaded_union(isolated_geo)
|
sol_geo = cascaded_union(isolated_geo)
|
||||||
if has_offset is True:
|
if has_offset is True:
|
||||||
app_obj.inform.emit(_("[WARNING_NOTCL] Buffering ..."))
|
app_obj.inform.emit('[WARNING_NOTCL] %s' % _("Buffering ..."))
|
||||||
sol_geo = sol_geo.buffer(distance=ncc_offset)
|
sol_geo = sol_geo.buffer(distance=ncc_offset)
|
||||||
app_obj.inform.emit(_("[success] Buffering finished ..."))
|
app_obj.inform.emit('[success] %s' % _("Buffering finished ..."))
|
||||||
empty = self.get_ncc_empty_area(target=sol_geo, boundary=bounding_box)
|
empty = self.get_ncc_empty_area(target=sol_geo, boundary=bounding_box)
|
||||||
elif isinstance(ncc_obj, FlatCAMGeometry):
|
elif isinstance(ncc_obj, FlatCAMGeometry):
|
||||||
sol_geo = cascaded_union(ncc_obj.solid_geometry)
|
sol_geo = cascaded_union(ncc_obj.solid_geometry)
|
||||||
if has_offset is True:
|
if has_offset is True:
|
||||||
app_obj.inform.emit(_("[WARNING_NOTCL] Buffering ..."))
|
app_obj.inform.emit(_("[WARNING_NOTCL] Buffering ..."))
|
||||||
sol_geo = sol_geo.buffer(distance=ncc_offset)
|
sol_geo = sol_geo.buffer(distance=ncc_offset)
|
||||||
app_obj.inform.emit(_("[success] Buffering finished ..."))
|
app_obj.inform.emit('[success] %s' % _("Buffering finished ..."))
|
||||||
empty = self.get_ncc_empty_area(target=sol_geo, boundary=bounding_box)
|
empty = self.get_ncc_empty_area(target=sol_geo, boundary=bounding_box)
|
||||||
else:
|
else:
|
||||||
app_obj.inform.emit(_('[ERROR_NOTCL] The selected object is not suitable for copper clearing.'))
|
app_obj.inform.emit('[ERROR_NOTCL] %s' % _('The selected object is not suitable for copper clearing.'))
|
||||||
return
|
return
|
||||||
|
|
||||||
if empty.is_empty:
|
if empty.is_empty:
|
||||||
app_obj.inform.emit(_("[ERROR_NOTCL] Could not get the extent of the area to be non copper cleared."))
|
app_obj.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
|
_("Could not get the extent of the area to be non copper cleared."))
|
||||||
return 'fail'
|
return 'fail'
|
||||||
|
|
||||||
if type(empty) is Polygon:
|
if type(empty) is Polygon:
|
||||||
@@ -2048,11 +2048,11 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
|||||||
# it will be updated only if there is a solid_geometry for tools
|
# it will be updated only if there is a solid_geometry for tools
|
||||||
if geo_obj.tools:
|
if geo_obj.tools:
|
||||||
if warning_flag == 0:
|
if warning_flag == 0:
|
||||||
self.app.inform.emit(_("[success] Non-Copper Rest Machining clear all done."))
|
self.app.inform.emit('[success] %s' % _("Non-Copper Rest Machining clear all done."))
|
||||||
else:
|
else:
|
||||||
self.app.inform.emit(
|
self.app.inform.emit(
|
||||||
'%s: %s %s.' % (_("[WARNING] Non-Copper Rest Machining clear all done but the copper features "
|
'[WARNING] %s: %s %s.' % (_("Non-Copper Rest Machining clear all done but the copper features "
|
||||||
"isolation is broken for"), str(warning_flag), _("tools")))
|
"isolation is broken for"), str(warning_flag), _("tools")))
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
# I will use this variable for this purpose although it was meant for something else
|
# I will use this variable for this purpose although it was meant for something else
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ class ToolPDF(FlatCAMTool):
|
|||||||
filenames, _f = QtWidgets.QFileDialog.getOpenFileNames(caption=_("Open PDF"), filter=_filter_)
|
filenames, _f = QtWidgets.QFileDialog.getOpenFileNames(caption=_("Open PDF"), filter=_filter_)
|
||||||
|
|
||||||
if len(filenames) == 0:
|
if len(filenames) == 0:
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] Open PDF cancelled."))
|
self.app.inform.emit('[WARNING_NOTCL] %s.' % _("Open PDF cancelled"))
|
||||||
else:
|
else:
|
||||||
# start the parsing timer with a period of 1 second
|
# start the parsing timer with a period of 1 second
|
||||||
self.periodic_check(1000)
|
self.periodic_check(1000)
|
||||||
@@ -241,8 +241,7 @@ class ToolPDF(FlatCAMTool):
|
|||||||
name_tool += 1
|
name_tool += 1
|
||||||
|
|
||||||
# create tools dictionary
|
# create tools dictionary
|
||||||
spec = {"C": dia}
|
spec = {"C": dia, 'solid_geometry': []}
|
||||||
spec['solid_geometry'] = []
|
|
||||||
exc_obj.tools[str(name_tool)] = spec
|
exc_obj.tools[str(name_tool)] = spec
|
||||||
|
|
||||||
# create drill list of dictionaries
|
# create drill list of dictionaries
|
||||||
@@ -259,19 +258,22 @@ class ToolPDF(FlatCAMTool):
|
|||||||
for tool in exc_obj.tools:
|
for tool in exc_obj.tools:
|
||||||
if exc_obj.tools[tool]['solid_geometry']:
|
if exc_obj.tools[tool]['solid_geometry']:
|
||||||
return
|
return
|
||||||
app_obj.inform.emit(_("[ERROR_NOTCL] No geometry found in file: %s") % outname)
|
app_obj.inform.emit('[ERROR_NOTCL] %s: %s' %
|
||||||
|
(_("No geometry found in file"), outname))
|
||||||
return "fail"
|
return "fail"
|
||||||
|
|
||||||
with self.app.proc_container.new(_("Rendering PDF layer #%d ...") % int(layer_nr)):
|
with self.app.proc_container.new(_("Rendering PDF layer #%d ...") % int(layer_nr)):
|
||||||
|
|
||||||
ret_val = self.app.new_object("excellon", outname, obj_init, autoselected=False)
|
ret_val = self.app.new_object("excellon", outname, obj_init, autoselected=False)
|
||||||
if ret_val == 'fail':
|
if ret_val == 'fail':
|
||||||
self.app.inform.emit(_('[ERROR_NOTCL] Open PDF file failed.'))
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
|
_('Open PDF file failed.'))
|
||||||
return
|
return
|
||||||
# Register recent file
|
# Register recent file
|
||||||
self.app.file_opened.emit("excellon", filename)
|
self.app.file_opened.emit("excellon", filename)
|
||||||
# GUI feedback
|
# GUI feedback
|
||||||
self.app.inform.emit(_("[success] Rendered: %s") % outname)
|
self.app.inform.emit('[success] %s: %s' %
|
||||||
|
(_("Rendered"), outname))
|
||||||
|
|
||||||
def layer_rendering_as_gerber(self, filename, ap_dict, layer_nr):
|
def layer_rendering_as_gerber(self, filename, ap_dict, layer_nr):
|
||||||
outname = filename.split('/')[-1].split('\\')[-1] + "_%s" % str(layer_nr)
|
outname = filename.split('/')[-1].split('\\')[-1] + "_%s" % str(layer_nr)
|
||||||
@@ -339,12 +341,13 @@ class ToolPDF(FlatCAMTool):
|
|||||||
|
|
||||||
ret = self.app.new_object('gerber', outname, obj_init, autoselected=False)
|
ret = self.app.new_object('gerber', outname, obj_init, autoselected=False)
|
||||||
if ret == 'fail':
|
if ret == 'fail':
|
||||||
self.app.inform.emit(_('[ERROR_NOTCL] Open PDF file failed.'))
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
|
_('Open PDF file failed.'))
|
||||||
return
|
return
|
||||||
# Register recent file
|
# Register recent file
|
||||||
self.app.file_opened.emit('gerber', filename)
|
self.app.file_opened.emit('gerber', filename)
|
||||||
# GUI feedback
|
# GUI feedback
|
||||||
self.app.inform.emit(_("[success] Rendered: %s") % outname)
|
self.app.inform.emit('[success] %s: %s' % (_("Rendered"), outname))
|
||||||
|
|
||||||
def periodic_check(self, check_period):
|
def periodic_check(self, check_period):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -691,13 +691,14 @@ class ToolPaint(FlatCAMTool, Gerber):
|
|||||||
try:
|
try:
|
||||||
tool_dia = float(self.addtool_entry.get_value().replace(',', '.'))
|
tool_dia = float(self.addtool_entry.get_value().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered, "
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
"use a number."))
|
_("Wrong value format entered, use a number."))
|
||||||
return
|
return
|
||||||
|
|
||||||
if tool_dia is None:
|
if tool_dia is None:
|
||||||
self.build_ui()
|
self.build_ui()
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] Please enter a tool diameter to add, in Float format."))
|
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||||
|
_("Please enter a tool diameter to add, in Float format."))
|
||||||
return
|
return
|
||||||
|
|
||||||
# construct a list of all 'tooluid' in the self.tools
|
# construct a list of all 'tooluid' in the self.tools
|
||||||
@@ -721,12 +722,14 @@ class ToolPaint(FlatCAMTool, Gerber):
|
|||||||
|
|
||||||
if float('%.4f' % tool_dia) in tool_dias:
|
if float('%.4f' % tool_dia) in tool_dias:
|
||||||
if muted is None:
|
if muted is None:
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] Adding tool cancelled. Tool already in Tool Table."))
|
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||||
|
_("Adding tool cancelled. Tool already in Tool Table."))
|
||||||
self.tools_table.itemChanged.connect(self.on_tool_edit)
|
self.tools_table.itemChanged.connect(self.on_tool_edit)
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
if muted is None:
|
if muted is None:
|
||||||
self.app.inform.emit(_("[success] New tool added to Tool Table."))
|
self.app.inform.emit('[success] %s' %
|
||||||
|
_("New tool added to Tool Table."))
|
||||||
self.paint_tools.update({
|
self.paint_tools.update({
|
||||||
int(self.tooluid): {
|
int(self.tooluid): {
|
||||||
'tooldia': float('%.4f' % tool_dia),
|
'tooldia': float('%.4f' % tool_dia),
|
||||||
@@ -763,15 +766,16 @@ class ToolPaint(FlatCAMTool, Gerber):
|
|||||||
try:
|
try:
|
||||||
new_tool_dia = float(self.tools_table.item(row, 1).text().replace(',', '.'))
|
new_tool_dia = float(self.tools_table.item(row, 1).text().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered, "
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
"use a number."))
|
_("Wrong value format entered, use a number."))
|
||||||
return
|
return
|
||||||
tooluid = int(self.tools_table.item(row, 3).text())
|
tooluid = int(self.tools_table.item(row, 3).text())
|
||||||
|
|
||||||
# identify the tool that was edited and get it's tooluid
|
# identify the tool that was edited and get it's tooluid
|
||||||
if new_tool_dia not in tool_dias:
|
if new_tool_dia not in tool_dias:
|
||||||
self.paint_tools[tooluid]['tooldia'] = new_tool_dia
|
self.paint_tools[tooluid]['tooldia'] = new_tool_dia
|
||||||
self.app.inform.emit(_("[success] Tool from Tool Table was edited."))
|
self.app.inform.emit('[success] %s' %
|
||||||
|
_("Tool from Tool Table was edited."))
|
||||||
self.build_ui()
|
self.build_ui()
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
@@ -782,8 +786,8 @@ class ToolPaint(FlatCAMTool, Gerber):
|
|||||||
break
|
break
|
||||||
restore_dia_item = self.tools_table.item(row, 1)
|
restore_dia_item = self.tools_table.item(row, 1)
|
||||||
restore_dia_item.setText(str(old_tool_dia))
|
restore_dia_item.setText(str(old_tool_dia))
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] Edit cancelled. "
|
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||||
"New diameter value is already in the Tool Table."))
|
_("Edit cancelled. New diameter value is already in the Tool Table."))
|
||||||
self.build_ui()
|
self.build_ui()
|
||||||
|
|
||||||
# def on_tool_copy(self, all=None):
|
# def on_tool_copy(self, all=None):
|
||||||
@@ -881,12 +885,14 @@ class ToolPaint(FlatCAMTool, Gerber):
|
|||||||
self.paint_tools.pop(t, None)
|
self.paint_tools.pop(t, None)
|
||||||
|
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] Delete failed. Select a tool to delete."))
|
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||||
|
_("Delete failed. Select a tool to delete."))
|
||||||
return
|
return
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.debug(str(e))
|
log.debug(str(e))
|
||||||
|
|
||||||
self.app.inform.emit(_("[success] Tool(s) deleted from Tool Table."))
|
self.app.inform.emit('[success] %s' %
|
||||||
|
_("Tool(s) deleted from Tool Table."))
|
||||||
self.build_ui()
|
self.build_ui()
|
||||||
|
|
||||||
def on_paint_button_click(self):
|
def on_paint_button_click(self):
|
||||||
@@ -904,16 +910,17 @@ class ToolPaint(FlatCAMTool, Gerber):
|
|||||||
try:
|
try:
|
||||||
overlap = float(self.paintoverlap_entry.get_value().replace(',', '.'))
|
overlap = float(self.paintoverlap_entry.get_value().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered, "
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
"use a number."))
|
_("Wrong value format entered, use a number."))
|
||||||
return
|
return
|
||||||
|
|
||||||
if overlap >= 1 or overlap < 0:
|
if overlap >= 1 or overlap < 0:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Overlap value must be between "
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
"0 (inclusive) and 1 (exclusive), "))
|
_("Overlap value must be between 0 (inclusive) and 1 (exclusive)"))
|
||||||
return
|
return
|
||||||
|
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] Click inside the desired polygon."))
|
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||||
|
_("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()
|
||||||
@@ -926,17 +933,22 @@ class ToolPaint(FlatCAMTool, Gerber):
|
|||||||
self.paint_obj = self.app.collection.get_by_name(str(self.obj_name))
|
self.paint_obj = self.app.collection.get_by_name(str(self.obj_name))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.debug("ToolPaint.on_paint_button_click() --> %s" % str(e))
|
log.debug("ToolPaint.on_paint_button_click() --> %s" % str(e))
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Could not retrieve object: %s") % self.obj_name)
|
self.app.inform.emit('[ERROR_NOTCL] %s: %s' %
|
||||||
|
(_("Could not retrieve object: %s"),
|
||||||
|
self.obj_name))
|
||||||
return
|
return
|
||||||
|
|
||||||
if self.paint_obj is None:
|
if self.paint_obj is None:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Object not found: %s") % self.paint_obj)
|
self.app.inform.emit('[ERROR_NOTCL] %s: %s' %
|
||||||
|
(_("Object not found"),
|
||||||
|
self.paint_obj))
|
||||||
return
|
return
|
||||||
|
|
||||||
# test if the Geometry Object is multigeo and return Fail if True because
|
# test if the Geometry Object is multigeo and return Fail if True because
|
||||||
# for now Paint don't work on MultiGeo
|
# for now Paint don't work on MultiGeo
|
||||||
if self.paint_obj.multigeo is True:
|
if self.paint_obj.multigeo is True:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Can't do Paint on MultiGeo geometries ..."))
|
self.app.inform.emit('[ERROR_NOTCL] %s...' %
|
||||||
|
_("Can't do Paint on MultiGeo geometries"))
|
||||||
return 'Fail'
|
return 'Fail'
|
||||||
|
|
||||||
o_name = '%s_multitool_paint' % self.obj_name
|
o_name = '%s_multitool_paint' % self.obj_name
|
||||||
@@ -952,12 +964,13 @@ class ToolPaint(FlatCAMTool, Gerber):
|
|||||||
try:
|
try:
|
||||||
tooldia = float(self.tools_table.item(x.row(), 1).text().replace(',', '.'))
|
tooldia = float(self.tools_table.item(x.row(), 1).text().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong Tool Dia value format entered, "
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
"use a number."))
|
_("Wrong value format entered, use a number."))
|
||||||
continue
|
continue
|
||||||
tooldia_list.append(tooldia)
|
tooldia_list.append(tooldia)
|
||||||
else:
|
else:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] No selected tools in Tool Table."))
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
|
_("No selected tools in Tool Table."))
|
||||||
return
|
return
|
||||||
|
|
||||||
if select_method == "all":
|
if select_method == "all":
|
||||||
@@ -969,7 +982,8 @@ class ToolPaint(FlatCAMTool, Gerber):
|
|||||||
contour=contour)
|
contour=contour)
|
||||||
|
|
||||||
elif select_method == "single":
|
elif select_method == "single":
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] Click inside the desired polygon."))
|
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||||
|
_("Click inside the desired polygon."))
|
||||||
|
|
||||||
# use the first tool in the tool table; get the diameter
|
# use the first tool in the tool table; get the diameter
|
||||||
# tooldia = float('%.4f' % float(self.tools_table.item(0, 1).text()))
|
# tooldia = float('%.4f' % float(self.tools_table.item(0, 1).text()))
|
||||||
@@ -999,7 +1013,8 @@ class ToolPaint(FlatCAMTool, Gerber):
|
|||||||
self.app.plotcanvas.vis_connect('mouse_press', doit)
|
self.app.plotcanvas.vis_connect('mouse_press', doit)
|
||||||
|
|
||||||
elif select_method == "area":
|
elif select_method == "area":
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] Click the start point of the paint area."))
|
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||||
|
_("Click the start point of the paint area."))
|
||||||
|
|
||||||
# use the first tool in the tool table; get the diameter
|
# use the first tool in the tool table; get the diameter
|
||||||
# tooldia = float('%.4f' % float(self.tools_table.item(0, 1).text()))
|
# tooldia = float('%.4f' % float(self.tools_table.item(0, 1).text()))
|
||||||
@@ -1010,7 +1025,8 @@ class ToolPaint(FlatCAMTool, Gerber):
|
|||||||
if event.button == 1:
|
if event.button == 1:
|
||||||
if not self.first_click:
|
if not self.first_click:
|
||||||
self.first_click = True
|
self.first_click = True
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] Click the end point of the paint area."))
|
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||||
|
_("Click the end point of the paint area."))
|
||||||
|
|
||||||
self.cursor_pos = self.app.plotcanvas.translate_coords(event.pos)
|
self.cursor_pos = self.app.plotcanvas.translate_coords(event.pos)
|
||||||
if self.app.grid_status() == True:
|
if self.app.grid_status() == True:
|
||||||
@@ -1121,7 +1137,9 @@ class ToolPaint(FlatCAMTool, Gerber):
|
|||||||
try:
|
try:
|
||||||
self.bound_obj = self.app.collection.get_by_name(self.bound_obj_name)
|
self.bound_obj = self.app.collection.get_by_name(self.bound_obj_name)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Could not retrieve object: %s") % self.obj_name)
|
self.app.inform.emit('[ERROR_NOTCL] %s: %s' %
|
||||||
|
(_("Could not retrieve object"),
|
||||||
|
self.obj_name))
|
||||||
return "Could not retrieve object: %s" % self.obj_name
|
return "Could not retrieve object: %s" % self.obj_name
|
||||||
|
|
||||||
self.paint_poly_ref(obj=self.paint_obj,
|
self.paint_poly_ref(obj=self.paint_obj,
|
||||||
@@ -1178,8 +1196,8 @@ class ToolPaint(FlatCAMTool, Gerber):
|
|||||||
try:
|
try:
|
||||||
paint_margin = float(self.paintmargin_entry.get_value().replace(',', '.'))
|
paint_margin = float(self.paintmargin_entry.get_value().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered, "
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
"use a number."))
|
_("Wrong value format entered, use a number."))
|
||||||
return
|
return
|
||||||
|
|
||||||
# No polygon?
|
# No polygon?
|
||||||
@@ -1261,7 +1279,8 @@ class ToolPaint(FlatCAMTool, Gerber):
|
|||||||
geo_obj.solid_geometry += list(cpoly.get_objects())
|
geo_obj.solid_geometry += list(cpoly.get_objects())
|
||||||
return cpoly
|
return cpoly
|
||||||
else:
|
else:
|
||||||
self.app.inform.emit(_('[ERROR_NOTCL] Geometry could not be painted completely'))
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
|
_('Geometry could not be painted completely'))
|
||||||
return None
|
return None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -1303,9 +1322,10 @@ class ToolPaint(FlatCAMTool, Gerber):
|
|||||||
total_geometry = list(cp.get_objects())
|
total_geometry = list(cp.get_objects())
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.debug("Could not Paint the polygons. %s" % str(e))
|
log.debug("Could not Paint the polygons. %s" % str(e))
|
||||||
self.app.inform.emit(
|
self.app.inform.emit('[ERROR] %s\n%s' %
|
||||||
_("[ERROR] Could not do Paint. Try a different combination of parameters. "
|
(_("Could not do Paint. Try a different combination of parameters. "
|
||||||
"Or a different strategy of paint\n%s") % str(e))
|
"Or a different strategy of paint"),
|
||||||
|
str(e)))
|
||||||
return
|
return
|
||||||
|
|
||||||
# add the solid_geometry to the current too in self.paint_tools (tools_storage)
|
# add the solid_geometry to the current too in self.paint_tools (tools_storage)
|
||||||
@@ -1340,12 +1360,13 @@ class ToolPaint(FlatCAMTool, Gerber):
|
|||||||
if geo_obj.tools[tooluid]['solid_geometry']:
|
if geo_obj.tools[tooluid]['solid_geometry']:
|
||||||
has_solid_geo += 1
|
has_solid_geo += 1
|
||||||
if has_solid_geo == 0:
|
if has_solid_geo == 0:
|
||||||
self.app.inform.emit(_("[ERROR] There is no Painting Geometry in the file.\n"
|
self.app.inform.emit('[ERROR] %s' %
|
||||||
|
_("There is no Painting Geometry in the file.\n"
|
||||||
"Usually it means that the tool diameter is too big for the painted geometry.\n"
|
"Usually it means that the tool diameter is too big for the painted geometry.\n"
|
||||||
"Change the painting parameters and try again."))
|
"Change the painting parameters and try again."))
|
||||||
return
|
return
|
||||||
|
|
||||||
self.app.inform.emit(_("[success] Paint Single Done."))
|
self.app.inform.emit('[success] %s' % _("Paint Single Done."))
|
||||||
|
|
||||||
# Experimental...
|
# Experimental...
|
||||||
# print("Indexing...", end=' ')
|
# print("Indexing...", end=' ')
|
||||||
@@ -1366,7 +1387,9 @@ class ToolPaint(FlatCAMTool, Gerber):
|
|||||||
app_obj.new_object("geometry", name, gen_paintarea)
|
app_obj.new_object("geometry", name, gen_paintarea)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
proc.done()
|
proc.done()
|
||||||
self.app.inform.emit(_('[ERROR_NOTCL] PaintTool.paint_poly() --> %s') % str(e))
|
self.app.inform.emit('[ERROR_NOTCL] %s --> %s' %
|
||||||
|
(_('PaintTool.paint_poly()'),
|
||||||
|
str(e)))
|
||||||
return
|
return
|
||||||
proc.done()
|
proc.done()
|
||||||
# focus on Selected Tab
|
# focus on Selected Tab
|
||||||
@@ -1418,8 +1441,8 @@ class ToolPaint(FlatCAMTool, Gerber):
|
|||||||
try:
|
try:
|
||||||
paint_margin = float(self.paintmargin_entry.get_value().replace(',', '.'))
|
paint_margin = float(self.paintmargin_entry.get_value().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered, "
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
"use a number."))
|
_("Wrong value format entered, use a number."))
|
||||||
return
|
return
|
||||||
|
|
||||||
proc = self.app.proc_container.new(_("Painting polygon..."))
|
proc = self.app.proc_container.new(_("Painting polygon..."))
|
||||||
@@ -1583,9 +1606,10 @@ class ToolPaint(FlatCAMTool, Gerber):
|
|||||||
total_geometry += list(cp.get_objects())
|
total_geometry += list(cp.get_objects())
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.debug("Could not Paint the polygons. %s" % str(e))
|
log.debug("Could not Paint the polygons. %s" % str(e))
|
||||||
self.app.inform.emit(
|
self.app.inform.emit('[ERROR] %s\n%s' %
|
||||||
_("[ERROR] Could not do Paint All. Try a different combination of parameters. "
|
(_("Could not do Paint All. Try a different combination of parameters. "
|
||||||
"Or a different Method of paint\n%s") % str(e))
|
"Or a different Method of paint"),
|
||||||
|
str(e)))
|
||||||
return
|
return
|
||||||
|
|
||||||
pol_nr += 1
|
pol_nr += 1
|
||||||
@@ -1635,7 +1659,8 @@ class ToolPaint(FlatCAMTool, Gerber):
|
|||||||
if geo_obj.tools[tooluid]['solid_geometry']:
|
if geo_obj.tools[tooluid]['solid_geometry']:
|
||||||
has_solid_geo += 1
|
has_solid_geo += 1
|
||||||
if has_solid_geo == 0:
|
if has_solid_geo == 0:
|
||||||
self.app.inform.emit(_("[ERROR] There is no Painting Geometry in the file.\n"
|
self.app.inform.emit('[ERROR] %s' %
|
||||||
|
_("There is no Painting Geometry in the file.\n"
|
||||||
"Usually it means that the tool diameter is too big for the painted geometry.\n"
|
"Usually it means that the tool diameter is too big for the painted geometry.\n"
|
||||||
"Change the painting parameters and try again."))
|
"Change the painting parameters and try again."))
|
||||||
return
|
return
|
||||||
@@ -1710,9 +1735,10 @@ class ToolPaint(FlatCAMTool, Gerber):
|
|||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.debug("Could not Paint the polygons. %s" % str(e))
|
log.debug("Could not Paint the polygons. %s" % str(e))
|
||||||
self.app.inform.emit(
|
self.app.inform.emit('[ERROR] %s\n%s' %
|
||||||
_("[ERROR] Could not do Paint All. Try a different combination of parameters. "
|
(_("Could not do Paint All. Try a different combination of parameters. "
|
||||||
"Or a different Method of paint\n%s") % str(e))
|
"Or a different Method of paint"),
|
||||||
|
str(e)))
|
||||||
return
|
return
|
||||||
|
|
||||||
pol_nr += 1
|
pol_nr += 1
|
||||||
@@ -1756,7 +1782,8 @@ class ToolPaint(FlatCAMTool, Gerber):
|
|||||||
if geo_obj.tools[tooluid]['solid_geometry']:
|
if geo_obj.tools[tooluid]['solid_geometry']:
|
||||||
has_solid_geo += 1
|
has_solid_geo += 1
|
||||||
if has_solid_geo == 0:
|
if has_solid_geo == 0:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] There is no Painting Geometry in the file.\n"
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
|
_("There is no Painting Geometry in the file.\n"
|
||||||
"Usually it means that the tool diameter is too big for the painted geometry.\n"
|
"Usually it means that the tool diameter is too big for the painted geometry.\n"
|
||||||
"Change the painting parameters and try again."))
|
"Change the painting parameters and try again."))
|
||||||
return
|
return
|
||||||
@@ -1765,7 +1792,7 @@ class ToolPaint(FlatCAMTool, Gerber):
|
|||||||
# print("Indexing...", end=' ')
|
# print("Indexing...", end=' ')
|
||||||
# geo_obj.make_index()
|
# geo_obj.make_index()
|
||||||
|
|
||||||
self.app.inform.emit(_("[success] Paint All with Rest-Machining done."))
|
self.app.inform.emit('[success] %s' % _("Paint All with Rest-Machining done."))
|
||||||
|
|
||||||
def job_thread(app_obj):
|
def job_thread(app_obj):
|
||||||
try:
|
try:
|
||||||
@@ -1828,8 +1855,8 @@ class ToolPaint(FlatCAMTool, Gerber):
|
|||||||
try:
|
try:
|
||||||
paint_margin = float(self.paintmargin_entry.get_value().replace(',', '.'))
|
paint_margin = float(self.paintmargin_entry.get_value().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered, "
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
"use a number."))
|
_("Wrong value format entered, use a number."))
|
||||||
return
|
return
|
||||||
|
|
||||||
proc = self.app.proc_container.new(_("Painting polygon..."))
|
proc = self.app.proc_container.new(_("Painting polygon..."))
|
||||||
@@ -1991,9 +2018,9 @@ class ToolPaint(FlatCAMTool, Gerber):
|
|||||||
total_geometry += list(cp.get_objects())
|
total_geometry += list(cp.get_objects())
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.debug("Could not Paint the polygons. %s" % str(e))
|
log.debug("Could not Paint the polygons. %s" % str(e))
|
||||||
self.app.inform.emit(
|
self.app.inform.emit('[ERROR] %s' %
|
||||||
_("[ERROR] Could not do Paint All. Try a different combination of parameters. "
|
_("Could not do Paint All. Try a different combination of parameters. "
|
||||||
"Or a different Method of paint\n%s") % str(e))
|
"Or a different Method of paint\n%s") % str(e))
|
||||||
return
|
return
|
||||||
|
|
||||||
pol_nr += 1
|
pol_nr += 1
|
||||||
@@ -2043,7 +2070,8 @@ class ToolPaint(FlatCAMTool, Gerber):
|
|||||||
if geo_obj.tools[tooluid]['solid_geometry']:
|
if geo_obj.tools[tooluid]['solid_geometry']:
|
||||||
has_solid_geo += 1
|
has_solid_geo += 1
|
||||||
if has_solid_geo == 0:
|
if has_solid_geo == 0:
|
||||||
self.app.inform.emit(_("[ERROR] There is no Painting Geometry in the file.\n"
|
self.app.inform.emit('[ERROR] %s' %
|
||||||
|
_("There is no Painting Geometry in the file.\n"
|
||||||
"Usually it means that the tool diameter is too big for the painted geometry.\n"
|
"Usually it means that the tool diameter is too big for the painted geometry.\n"
|
||||||
"Change the painting parameters and try again."))
|
"Change the painting parameters and try again."))
|
||||||
return
|
return
|
||||||
@@ -2125,9 +2153,9 @@ class ToolPaint(FlatCAMTool, Gerber):
|
|||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.debug("Could not Paint the polygons. %s" % str(e))
|
log.debug("Could not Paint the polygons. %s" % str(e))
|
||||||
self.app.inform.emit(
|
self.app.inform.emit('[ERROR] %s' %
|
||||||
_("[ERROR] Could not do Paint All. Try a different combination of parameters. "
|
_("Could not do Paint All. Try a different combination of parameters. "
|
||||||
"Or a different Method of paint\n%s") % str(e))
|
"Or a different Method of paint\n%s") % str(e))
|
||||||
return
|
return
|
||||||
|
|
||||||
pol_nr += 1
|
pol_nr += 1
|
||||||
@@ -2171,7 +2199,8 @@ class ToolPaint(FlatCAMTool, Gerber):
|
|||||||
if geo_obj.tools[tooluid]['solid_geometry']:
|
if geo_obj.tools[tooluid]['solid_geometry']:
|
||||||
has_solid_geo += 1
|
has_solid_geo += 1
|
||||||
if has_solid_geo == 0:
|
if has_solid_geo == 0:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] There is no Painting Geometry in the file.\n"
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
|
_("There is no Painting Geometry in the file.\n"
|
||||||
"Usually it means that the tool diameter is too big for the painted geometry.\n"
|
"Usually it means that the tool diameter is too big for the painted geometry.\n"
|
||||||
"Change the painting parameters and try again."))
|
"Change the painting parameters and try again."))
|
||||||
return
|
return
|
||||||
@@ -2180,7 +2209,7 @@ class ToolPaint(FlatCAMTool, Gerber):
|
|||||||
# print("Indexing...", end=' ')
|
# print("Indexing...", end=' ')
|
||||||
# geo_obj.make_index()
|
# geo_obj.make_index()
|
||||||
|
|
||||||
self.app.inform.emit(_("[success] Paint All with Rest-Machining done."))
|
self.app.inform.emit('[success] %s' % _("Paint All with Rest-Machining done."))
|
||||||
|
|
||||||
def job_thread(app_obj):
|
def job_thread(app_obj):
|
||||||
try:
|
try:
|
||||||
@@ -2244,7 +2273,7 @@ class ToolPaint(FlatCAMTool, Gerber):
|
|||||||
sel_rect = env_obj.buffer(distance=0.0000001, join_style=base.JOIN_STYLE.mitre)
|
sel_rect = env_obj.buffer(distance=0.0000001, join_style=base.JOIN_STYLE.mitre)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.debug("ToolPaint.on_paint_button_click() --> %s" % str(e))
|
log.debug("ToolPaint.on_paint_button_click() --> %s" % str(e))
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] No object available."))
|
self.app.inform.emit('[ERROR_NOTCL] %s' % _("No object available."))
|
||||||
return
|
return
|
||||||
|
|
||||||
self.paint_poly_area(obj=obj,
|
self.paint_poly_area(obj=obj,
|
||||||
|
|||||||
@@ -355,13 +355,15 @@ class Panelize(FlatCAMTool):
|
|||||||
obj = self.app.collection.get_by_name(str(name))
|
obj = self.app.collection.get_by_name(str(name))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.debug("Panelize.on_panelize() --> %s" % str(e))
|
log.debug("Panelize.on_panelize() --> %s" % str(e))
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Could not retrieve object: %s") % name)
|
self.app.inform.emit('[ERROR_NOTCL] %s: %s' %
|
||||||
|
(_("Could not retrieve object"), name))
|
||||||
return "Could not retrieve object: %s" % name
|
return "Could not retrieve object: %s" % name
|
||||||
|
|
||||||
panel_obj = obj
|
panel_obj = obj
|
||||||
|
|
||||||
if panel_obj is None:
|
if panel_obj is None:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Object not found: %s") % panel_obj)
|
self.app.inform.emit('[ERROR_NOTCL] %s: %s' %
|
||||||
|
(_("Object not found"), panel_obj))
|
||||||
return "Object not found: %s" % panel_obj
|
return "Object not found: %s" % panel_obj
|
||||||
|
|
||||||
boxname = self.box_combo.currentText()
|
boxname = self.box_combo.currentText()
|
||||||
@@ -370,11 +372,13 @@ class Panelize(FlatCAMTool):
|
|||||||
box = self.app.collection.get_by_name(boxname)
|
box = self.app.collection.get_by_name(boxname)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.debug("Panelize.on_panelize() --> %s" % str(e))
|
log.debug("Panelize.on_panelize() --> %s" % str(e))
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Could not retrieve object: %s") % boxname)
|
self.app.inform.emit('[ERROR_NOTCL] %s: %s' %
|
||||||
|
(_("Could not retrieve object"), boxname))
|
||||||
return "Could not retrieve object: %s" % boxname
|
return "Could not retrieve object: %s" % boxname
|
||||||
|
|
||||||
if box is None:
|
if box is None:
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL]No object Box. Using instead %s") % panel_obj)
|
self.app.inform.emit('[WARNING_NOTCL]%s: %s' %
|
||||||
|
(_("No object Box. Using instead"), panel_obj))
|
||||||
self.reference_radio.set_value('bbox')
|
self.reference_radio.set_value('bbox')
|
||||||
|
|
||||||
if self.reference_radio.get_value() == 'bbox':
|
if self.reference_radio.get_value() == 'bbox':
|
||||||
@@ -389,8 +393,8 @@ class Panelize(FlatCAMTool):
|
|||||||
try:
|
try:
|
||||||
spacing_columns = float(self.spacing_columns.get_value().replace(',', '.'))
|
spacing_columns = float(self.spacing_columns.get_value().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered, "
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
"use a number."))
|
_("Wrong value format entered, use a number."))
|
||||||
return
|
return
|
||||||
spacing_columns = spacing_columns if spacing_columns is not None else 0
|
spacing_columns = spacing_columns if spacing_columns is not None else 0
|
||||||
|
|
||||||
@@ -401,8 +405,8 @@ class Panelize(FlatCAMTool):
|
|||||||
try:
|
try:
|
||||||
spacing_rows = float(self.spacing_rows.get_value().replace(',', '.'))
|
spacing_rows = float(self.spacing_rows.get_value().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered, "
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
"use a number."))
|
_("Wrong value format entered, use a number."))
|
||||||
return
|
return
|
||||||
spacing_rows = spacing_rows if spacing_rows is not None else 0
|
spacing_rows = spacing_rows if spacing_rows is not None else 0
|
||||||
|
|
||||||
@@ -414,8 +418,8 @@ class Panelize(FlatCAMTool):
|
|||||||
rows = float(self.rows.get_value().replace(',', '.'))
|
rows = float(self.rows.get_value().replace(',', '.'))
|
||||||
rows = int(rows)
|
rows = int(rows)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered, "
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
"use a number."))
|
_("Wrong value format entered, use a number."))
|
||||||
return
|
return
|
||||||
rows = rows if rows is not None else 1
|
rows = rows if rows is not None else 1
|
||||||
|
|
||||||
@@ -427,8 +431,8 @@ class Panelize(FlatCAMTool):
|
|||||||
columns = float(self.columns.get_value().replace(',', '.'))
|
columns = float(self.columns.get_value().replace(',', '.'))
|
||||||
columns = int(columns)
|
columns = int(columns)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered, "
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
"use a number."))
|
_("Wrong value format entered, use a number."))
|
||||||
return
|
return
|
||||||
columns = columns if columns is not None else 1
|
columns = columns if columns is not None else 1
|
||||||
|
|
||||||
@@ -439,8 +443,8 @@ class Panelize(FlatCAMTool):
|
|||||||
try:
|
try:
|
||||||
constrain_dx = float(self.x_width_entry.get_value().replace(',', '.'))
|
constrain_dx = float(self.x_width_entry.get_value().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered, "
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
"use a number."))
|
_("Wrong value format entered, use a number."))
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -450,14 +454,15 @@ class Panelize(FlatCAMTool):
|
|||||||
try:
|
try:
|
||||||
constrain_dy = float(self.y_height_entry.get_value().replace(',', '.'))
|
constrain_dy = float(self.y_height_entry.get_value().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered, "
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
"use a number."))
|
_("Wrong value format entered, use a number."))
|
||||||
return
|
return
|
||||||
|
|
||||||
panel_type = str(self.panel_type_radio.get_value())
|
panel_type = str(self.panel_type_radio.get_value())
|
||||||
|
|
||||||
if 0 in {columns, rows}:
|
if 0 in {columns, rows}:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Columns or Rows are zero value. Change them to a positive integer."))
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
|
_("Columns or Rows are zero value. Change them to a positive integer."))
|
||||||
return "Columns or Rows are zero value. Change them to a positive integer."
|
return "Columns or Rows are zero value. Change them to a positive integer."
|
||||||
|
|
||||||
xmin, ymin, xmax, ymax = box.bounds()
|
xmin, ymin, xmax, ymax = box.bounds()
|
||||||
@@ -635,19 +640,19 @@ class Panelize(FlatCAMTool):
|
|||||||
plot=True, autoselected=True)
|
plot=True, autoselected=True)
|
||||||
|
|
||||||
if self.constrain_flag is False:
|
if self.constrain_flag is False:
|
||||||
self.app.inform.emit(_("[success] Panel done..."))
|
self.app.inform.emit('[success] %s' % _("Panel done..."))
|
||||||
else:
|
else:
|
||||||
self.constrain_flag = False
|
self.constrain_flag = False
|
||||||
self.app.inform.emit(_("[WARNING] Too big for the constrain area. "
|
self.app.inform.emit(_("{text} Too big for the constrain area. "
|
||||||
"Final panel has {col} columns and {row} rows").format(
|
"Final panel has {col} columns and {row} rows").format(
|
||||||
col=columns, row=rows))
|
text='[WARNING] ', col=columns, row=rows))
|
||||||
|
|
||||||
proc = self.app.proc_container.new(_("Generating panel ..."))
|
proc = self.app.proc_container.new(_("Generating panel ..."))
|
||||||
|
|
||||||
def job_thread(app_obj):
|
def job_thread(app_obj):
|
||||||
try:
|
try:
|
||||||
panelize_2()
|
panelize_2()
|
||||||
self.app.inform.emit(_("[success] Panel created successfully."))
|
self.app.inform.emit('[success] %s' % _("Panel created successfully."))
|
||||||
except Exception as ee:
|
except Exception as ee:
|
||||||
proc.done()
|
proc.done()
|
||||||
log.debug(str(ee))
|
log.debug(str(ee))
|
||||||
|
|||||||
@@ -362,7 +362,8 @@ class PcbWizard(FlatCAMTool):
|
|||||||
self.frac_entry.set_value(self.fractional)
|
self.frac_entry.set_value(self.fractional)
|
||||||
|
|
||||||
if not self.tools_from_inf:
|
if not self.tools_from_inf:
|
||||||
self.app.inform.emit(_("[ERROR] The INF file does not contain the tool table.\n"
|
self.app.inform.emit('[ERROR] %s' %
|
||||||
|
_("The INF file does not contain the tool table.\n"
|
||||||
"Try to open the Excellon file from File -> Open -> Excellon\n"
|
"Try to open the Excellon file from File -> Open -> Excellon\n"
|
||||||
"and edit the drill diameters manually."))
|
"and edit the drill diameters manually."))
|
||||||
return "fail"
|
return "fail"
|
||||||
@@ -382,11 +383,13 @@ class PcbWizard(FlatCAMTool):
|
|||||||
if signal == 'inf':
|
if signal == 'inf':
|
||||||
self.inf_loaded = True
|
self.inf_loaded = True
|
||||||
self.tools_table.setVisible(True)
|
self.tools_table.setVisible(True)
|
||||||
self.app.inform.emit(_("[success] PcbWizard .INF file loaded."))
|
self.app.inform.emit('[success] %s' %
|
||||||
|
_("PcbWizard .INF file loaded."))
|
||||||
elif signal == 'excellon':
|
elif signal == 'excellon':
|
||||||
self.excellon_loaded = True
|
self.excellon_loaded = True
|
||||||
self.outname = os.path.split(str(filename))[1]
|
self.outname = os.path.split(str(filename))[1]
|
||||||
self.app.inform.emit(_("[success] Main PcbWizard Excellon file loaded."))
|
self.app.inform.emit('[success] %s' %
|
||||||
|
_("Main PcbWizard Excellon file loaded."))
|
||||||
|
|
||||||
if self.excellon_loaded and self.inf_loaded:
|
if self.excellon_loaded and self.inf_loaded:
|
||||||
self.update_params()
|
self.update_params()
|
||||||
@@ -420,16 +423,18 @@ class PcbWizard(FlatCAMTool):
|
|||||||
ret = excellon_obj.parse_file(file_obj=excellon_fileobj)
|
ret = excellon_obj.parse_file(file_obj=excellon_fileobj)
|
||||||
if ret == "fail":
|
if ret == "fail":
|
||||||
app_obj.log.debug("Excellon parsing failed.")
|
app_obj.log.debug("Excellon parsing failed.")
|
||||||
app_obj.inform.emit(_("[ERROR_NOTCL] This is not Excellon file."))
|
app_obj.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
|
_("This is not Excellon file."))
|
||||||
return "fail"
|
return "fail"
|
||||||
except IOError:
|
except IOError:
|
||||||
app_obj.inform.emit(_("[ERROR_NOTCL] Cannot parse file: %s") % self.outname)
|
app_obj.inform.emit('[ERROR_NOTCL] %s: %s' % (
|
||||||
|
_("Cannot parse file"), self.outname))
|
||||||
app_obj.log.debug("Could not import Excellon object.")
|
app_obj.log.debug("Could not import Excellon object.")
|
||||||
app_obj.progress.emit(0)
|
app_obj.progress.emit(0)
|
||||||
return "fail"
|
return "fail"
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
app_obj.log.debug("PcbWizard.on_import_excellon().obj_init() %s" % str(e))
|
app_obj.log.debug("PcbWizard.on_import_excellon().obj_init() %s" % str(e))
|
||||||
msg = _("[ERROR_NOTCL] An internal error has occurred. See shell.\n")
|
msg = '[ERROR_NOTCL] %s' % _("An internal error has occurred. See shell.\n")
|
||||||
msg += app_obj.traceback.format_exc()
|
msg += app_obj.traceback.format_exc()
|
||||||
app_obj.inform.emit(msg)
|
app_obj.inform.emit(msg)
|
||||||
return "fail"
|
return "fail"
|
||||||
@@ -442,7 +447,8 @@ class PcbWizard(FlatCAMTool):
|
|||||||
for tool in excellon_obj.tools:
|
for tool in excellon_obj.tools:
|
||||||
if excellon_obj.tools[tool]['solid_geometry']:
|
if excellon_obj.tools[tool]['solid_geometry']:
|
||||||
return
|
return
|
||||||
app_obj.inform.emit(_("[ERROR_NOTCL] No geometry found in file: %s") % name)
|
app_obj.inform.emit('[ERROR_NOTCL] %s: %s' %
|
||||||
|
(_("No geometry found in file"), name))
|
||||||
return "fail"
|
return "fail"
|
||||||
|
|
||||||
if excellon_fileobj is not None and excellon_fileobj != '':
|
if excellon_fileobj is not None and excellon_fileobj != '':
|
||||||
@@ -454,16 +460,19 @@ class PcbWizard(FlatCAMTool):
|
|||||||
|
|
||||||
ret_val = self.app.new_object("excellon", name, obj_init, autoselected=False)
|
ret_val = self.app.new_object("excellon", name, obj_init, autoselected=False)
|
||||||
if ret_val == 'fail':
|
if ret_val == 'fail':
|
||||||
self.app.inform.emit(_('[ERROR_NOTCL] Import Excellon file failed.'))
|
self.app.inform.emit('[ERROR_NOTCL] %s' % _('Import Excellon file failed.'))
|
||||||
return
|
return
|
||||||
|
|
||||||
# Register recent file
|
# Register recent file
|
||||||
self.app.file_opened.emit("excellon", name)
|
self.app.file_opened.emit("excellon", name)
|
||||||
|
|
||||||
# GUI feedback
|
# GUI feedback
|
||||||
self.app.inform.emit(_("[success] Imported: %s") % name)
|
self.app.inform.emit('[success] %s: %s' %
|
||||||
|
(_("Imported"), name))
|
||||||
self.app.ui.notebook.setCurrentWidget(self.app.ui.project_tab)
|
self.app.ui.notebook.setCurrentWidget(self.app.ui.project_tab)
|
||||||
else:
|
else:
|
||||||
self.app.inform.emit(_('[WARNING_NOTCL] Excellon merging is in progress. Please wait...'))
|
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||||
|
_('Excellon merging is in progress. Please wait...'))
|
||||||
else:
|
else:
|
||||||
self.app.inform.emit(_('[ERROR_NOTCL] The imported Excellon file is None.'))
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
|
_('The imported Excellon file is None.'))
|
||||||
|
|||||||
@@ -108,14 +108,16 @@ class Properties(FlatCAMTool):
|
|||||||
def properties(self):
|
def properties(self):
|
||||||
obj_list = self.app.collection.get_selected()
|
obj_list = self.app.collection.get_selected()
|
||||||
if not obj_list:
|
if not obj_list:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Properties Tool was not displayed. No object selected."))
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
|
_("Properties Tool was not displayed. No object selected."))
|
||||||
self.app.ui.notebook.setTabText(2, _("Tools"))
|
self.app.ui.notebook.setTabText(2, _("Tools"))
|
||||||
self.properties_frame.hide()
|
self.properties_frame.hide()
|
||||||
self.app.ui.notebook.setCurrentWidget(self.app.ui.project_tab)
|
self.app.ui.notebook.setCurrentWidget(self.app.ui.project_tab)
|
||||||
return
|
return
|
||||||
for obj in obj_list:
|
for obj in obj_list:
|
||||||
self.addItems(obj)
|
self.addItems(obj)
|
||||||
self.app.inform.emit(_("[success] Object Properties are displayed."))
|
self.app.inform.emit('[success] %s' %
|
||||||
|
_("Object Properties are displayed."))
|
||||||
self.app.ui.notebook.setTabText(2, _("Properties Tool"))
|
self.app.ui.notebook.setTabText(2, _("Properties Tool"))
|
||||||
|
|
||||||
def addItems(self, obj):
|
def addItems(self, obj):
|
||||||
|
|||||||
@@ -760,17 +760,18 @@ class SolderPaste(FlatCAMTool):
|
|||||||
try:
|
try:
|
||||||
tool_dia = float(self.addtool_entry.get_value().replace(',', '.'))
|
tool_dia = float(self.addtool_entry.get_value().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered, "
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
"use a number."))
|
_("Wrong value format entered, use a number."))
|
||||||
return
|
return
|
||||||
if tool_dia is None:
|
if tool_dia is None:
|
||||||
self.build_ui()
|
self.build_ui()
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] Please enter a tool diameter to add, in Float format."))
|
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||||
|
_("Please enter a tool diameter to add, in Float format."))
|
||||||
return
|
return
|
||||||
|
|
||||||
if tool_dia == 0:
|
if tool_dia == 0:
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] Please enter a tool diameter with non-zero value, "
|
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||||
"in Float format."))
|
_("Please enter a tool diameter with non-zero value, in Float format."))
|
||||||
return
|
return
|
||||||
|
|
||||||
# construct a list of all 'tooluid' in the self.tooltable_tools
|
# construct a list of all 'tooluid' in the self.tooltable_tools
|
||||||
@@ -794,12 +795,14 @@ class SolderPaste(FlatCAMTool):
|
|||||||
|
|
||||||
if float('%.4f' % tool_dia) in tool_dias:
|
if float('%.4f' % tool_dia) in tool_dias:
|
||||||
if muted is None:
|
if muted is None:
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] Adding Nozzle tool cancelled. Tool already in Tool Table."))
|
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||||
|
_("Adding Nozzle tool cancelled. Tool already in Tool Table."))
|
||||||
self.tools_table.itemChanged.connect(self.on_tool_edit)
|
self.tools_table.itemChanged.connect(self.on_tool_edit)
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
if muted is None:
|
if muted is None:
|
||||||
self.app.inform.emit(_("[success] New Nozzle tool added to Tool Table."))
|
self.app.inform.emit('[success] %s' %
|
||||||
|
_("New Nozzle tool added to Tool Table."))
|
||||||
self.tooltable_tools.update({
|
self.tooltable_tools.update({
|
||||||
int(self.tooluid): {
|
int(self.tooluid): {
|
||||||
'tooldia': float('%.4f' % tool_dia),
|
'tooldia': float('%.4f' % tool_dia),
|
||||||
@@ -832,8 +835,8 @@ class SolderPaste(FlatCAMTool):
|
|||||||
try:
|
try:
|
||||||
new_tool_dia = float(self.tools_table.item(row, 1).text().replace(',', '.'))
|
new_tool_dia = float(self.tools_table.item(row, 1).text().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered, "
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
"use a number."))
|
_("Wrong value format entered, use a number."))
|
||||||
return
|
return
|
||||||
|
|
||||||
tooluid = int(self.tools_table.item(row, 2).text())
|
tooluid = int(self.tools_table.item(row, 2).text())
|
||||||
@@ -841,7 +844,8 @@ class SolderPaste(FlatCAMTool):
|
|||||||
# identify the tool that was edited and get it's tooluid
|
# identify the tool that was edited and get it's tooluid
|
||||||
if new_tool_dia not in tool_dias:
|
if new_tool_dia not in tool_dias:
|
||||||
self.tooltable_tools[tooluid]['tooldia'] = new_tool_dia
|
self.tooltable_tools[tooluid]['tooldia'] = new_tool_dia
|
||||||
self.app.inform.emit(_("[success] Nozzle tool from Tool Table was edited."))
|
self.app.inform.emit('[success] %s' %
|
||||||
|
_("Nozzle tool from Tool Table was edited."))
|
||||||
self.build_ui()
|
self.build_ui()
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
@@ -852,8 +856,8 @@ class SolderPaste(FlatCAMTool):
|
|||||||
break
|
break
|
||||||
restore_dia_item = self.tools_table.item(row, 1)
|
restore_dia_item = self.tools_table.item(row, 1)
|
||||||
restore_dia_item.setText(str(old_tool_dia))
|
restore_dia_item.setText(str(old_tool_dia))
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] Edit cancelled. "
|
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||||
"New diameter value is already in the Tool Table."))
|
_("Edit cancelled. New diameter value is already in the Tool Table."))
|
||||||
self.build_ui()
|
self.build_ui()
|
||||||
|
|
||||||
def on_tool_delete(self, rows_to_delete=None, all=None):
|
def on_tool_delete(self, rows_to_delete=None, all=None):
|
||||||
@@ -898,12 +902,14 @@ class SolderPaste(FlatCAMTool):
|
|||||||
self.tooltable_tools.pop(t, None)
|
self.tooltable_tools.pop(t, None)
|
||||||
|
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] Delete failed. Select a Nozzle tool to delete."))
|
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||||
|
_("Delete failed. Select a Nozzle tool to delete."))
|
||||||
return
|
return
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.debug(str(e))
|
log.debug(str(e))
|
||||||
|
|
||||||
self.app.inform.emit(_("[success] Nozzle tool(s) deleted from Tool Table."))
|
self.app.inform.emit('[success] %s' %
|
||||||
|
_("Nozzle tool(s) deleted from Tool Table."))
|
||||||
self.build_ui()
|
self.build_ui()
|
||||||
|
|
||||||
def on_rmb_combo(self, pos, combo):
|
def on_rmb_combo(self, pos, combo):
|
||||||
@@ -958,7 +964,8 @@ class SolderPaste(FlatCAMTool):
|
|||||||
"""
|
"""
|
||||||
name = self.obj_combo.currentText()
|
name = self.obj_combo.currentText()
|
||||||
if name == '':
|
if name == '':
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] No SolderPaste mask Gerber object loaded."))
|
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||||
|
_("No SolderPaste mask Gerber object loaded."))
|
||||||
return
|
return
|
||||||
|
|
||||||
obj = self.app.collection.get_by_name(name)
|
obj = self.app.collection.get_by_name(name)
|
||||||
@@ -988,7 +995,8 @@ class SolderPaste(FlatCAMTool):
|
|||||||
sorted_tools.sort(reverse=True)
|
sorted_tools.sort(reverse=True)
|
||||||
|
|
||||||
if not sorted_tools:
|
if not sorted_tools:
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] No Nozzle tools in the tool table."))
|
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||||
|
_("No Nozzle tools in the tool table."))
|
||||||
return 'fail'
|
return 'fail'
|
||||||
|
|
||||||
def flatten(geometry=None, reset=True, pathonly=False):
|
def flatten(geometry=None, reset=True, pathonly=False):
|
||||||
@@ -1114,16 +1122,19 @@ class SolderPaste(FlatCAMTool):
|
|||||||
if not geo_obj.tools[tooluid_key]['solid_geometry']:
|
if not geo_obj.tools[tooluid_key]['solid_geometry']:
|
||||||
a += 1
|
a += 1
|
||||||
if a == len(geo_obj.tools):
|
if a == len(geo_obj.tools):
|
||||||
self.app.inform.emit(_('[ERROR_NOTCL] Cancelled. Empty file, it has no geometry...'))
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
|
_('Cancelled. Empty file, it has no geometry...'))
|
||||||
return 'fail'
|
return 'fail'
|
||||||
|
|
||||||
app_obj.inform.emit(_("[success] Solder Paste geometry generated successfully..."))
|
app_obj.inform.emit('[success] %s...' %
|
||||||
|
_("Solder Paste geometry generated successfully"))
|
||||||
return
|
return
|
||||||
|
|
||||||
# if we still have geometry not processed at the end of the tools then we failed
|
# if we still have geometry not processed at the end of the tools then we failed
|
||||||
# some or all the pads are not covered with solder paste
|
# some or all the pads are not covered with solder paste
|
||||||
if work_geo:
|
if work_geo:
|
||||||
app_obj.inform.emit(_("[WARNING_NOTCL] Some or all pads have no solder "
|
app_obj.inform.emit('[WARNING_NOTCL] %s' %
|
||||||
|
_("Some or all pads have no solder "
|
||||||
"due of inadequate nozzle diameters..."))
|
"due of inadequate nozzle diameters..."))
|
||||||
return 'fail'
|
return 'fail'
|
||||||
|
|
||||||
@@ -1157,11 +1168,13 @@ class SolderPaste(FlatCAMTool):
|
|||||||
obj = self.app.collection.get_by_name(name)
|
obj = self.app.collection.get_by_name(name)
|
||||||
|
|
||||||
if name == '':
|
if name == '':
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] There is no Geometry object available."))
|
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||||
|
_("There is no Geometry object available."))
|
||||||
return 'fail'
|
return 'fail'
|
||||||
|
|
||||||
if obj.special_group != 'solder_paste_tool':
|
if obj.special_group != 'solder_paste_tool':
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] This Geometry can't be processed. "
|
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||||
|
_("This Geometry can't be processed. "
|
||||||
"NOT a solder_paste_tool geometry."))
|
"NOT a solder_paste_tool geometry."))
|
||||||
return 'fail'
|
return 'fail'
|
||||||
|
|
||||||
@@ -1170,7 +1183,8 @@ class SolderPaste(FlatCAMTool):
|
|||||||
if obj.tools[tooluid_key]['solid_geometry'] is None:
|
if obj.tools[tooluid_key]['solid_geometry'] is None:
|
||||||
a += 1
|
a += 1
|
||||||
if a == len(obj.tools):
|
if a == len(obj.tools):
|
||||||
self.app.inform.emit(_('[ERROR_NOTCL] Cancelled. Empty file, it has no geometry...'))
|
self.app.inform.emit('[ERROR_NOTCL] %s...' %
|
||||||
|
_('Cancelled. Empty file, it has no geometry'))
|
||||||
return 'fail'
|
return 'fail'
|
||||||
|
|
||||||
# use the name of the first tool selected in self.geo_tools_table which has the diameter passed as tool_dia
|
# use the name of the first tool selected in self.geo_tools_table which has the diameter passed as tool_dia
|
||||||
@@ -1197,7 +1211,7 @@ class SolderPaste(FlatCAMTool):
|
|||||||
ymax = obj.options['ymax']
|
ymax = obj.options['ymax']
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.debug("FlatCAMObj.FlatCAMGeometry.mtool_gen_cncjob() --> %s\n" % str(e))
|
log.debug("FlatCAMObj.FlatCAMGeometry.mtool_gen_cncjob() --> %s\n" % str(e))
|
||||||
msg = "[ERROR] An internal error has ocurred. See shell.\n"
|
msg = '[ERROR] %s' % _("An internal error has ocurred. See shell.\n")
|
||||||
msg += 'FlatCAMObj.FlatCAMGeometry.mtool_gen_cncjob() --> %s' % str(e)
|
msg += 'FlatCAMObj.FlatCAMGeometry.mtool_gen_cncjob() --> %s' % str(e)
|
||||||
msg += traceback.format_exc()
|
msg += traceback.format_exc()
|
||||||
self.app.inform.emit(msg)
|
self.app.inform.emit(msg)
|
||||||
@@ -1267,7 +1281,8 @@ class SolderPaste(FlatCAMTool):
|
|||||||
def job_thread(app_obj):
|
def job_thread(app_obj):
|
||||||
with self.app.proc_container.new("Generating CNC Code"):
|
with self.app.proc_container.new("Generating CNC Code"):
|
||||||
if app_obj.new_object("cncjob", name, job_init) != 'fail':
|
if app_obj.new_object("cncjob", name, job_init) != 'fail':
|
||||||
app_obj.inform.emit(_("[success] ToolSolderPaste CNCjob created: %s") % name)
|
app_obj.inform.emit('[success] [success] %s: %s' %
|
||||||
|
(_("ToolSolderPaste CNCjob created"), name))
|
||||||
app_obj.progress.emit(100)
|
app_obj.progress.emit(100)
|
||||||
|
|
||||||
# Create a promise with the name
|
# Create a promise with the name
|
||||||
@@ -1299,11 +1314,13 @@ class SolderPaste(FlatCAMTool):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
if obj.special_group != 'solder_paste_tool':
|
if obj.special_group != 'solder_paste_tool':
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] This CNCJob object can't be processed. "
|
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||||
|
_("This CNCJob object can't be processed. "
|
||||||
"NOT a solder_paste_tool CNCJob object."))
|
"NOT a solder_paste_tool CNCJob object."))
|
||||||
return
|
return
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] This CNCJob object can't be processed. "
|
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||||
|
_("This CNCJob object can't be processed. "
|
||||||
"NOT a solder_paste_tool CNCJob object."))
|
"NOT a solder_paste_tool CNCJob object."))
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -1327,7 +1344,8 @@ class SolderPaste(FlatCAMTool):
|
|||||||
lines = StringIO(gcode)
|
lines = StringIO(gcode)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.debug("ToolSolderpaste.on_view_gcode() --> %s" % str(e))
|
log.debug("ToolSolderpaste.on_view_gcode() --> %s" % str(e))
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] No Gcode in the object..."))
|
self.app.inform.emit('[ERROR_NOTCL] %s...' %
|
||||||
|
_("No Gcode in the object"))
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -1336,7 +1354,8 @@ class SolderPaste(FlatCAMTool):
|
|||||||
self.app.ui.code_editor.append(proc_line)
|
self.app.ui.code_editor.append(proc_line)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.debug('ToolSolderPaste.on_view_gcode() -->%s' % str(e))
|
log.debug('ToolSolderPaste.on_view_gcode() -->%s' % str(e))
|
||||||
self.app.inform.emit(_('[ERROR] ToolSolderPaste.on_view_gcode() -->%s') % str(e))
|
self.app.inform.emit('[ERROR] %s --> %s' %
|
||||||
|
(_('ToolSolderPaste.on_view_gcode()'), str(e)))
|
||||||
return
|
return
|
||||||
|
|
||||||
self.app.ui.code_editor.moveCursor(QtGui.QTextCursor.Start)
|
self.app.ui.code_editor.moveCursor(QtGui.QTextCursor.Start)
|
||||||
@@ -1355,7 +1374,8 @@ class SolderPaste(FlatCAMTool):
|
|||||||
obj = self.app.collection.get_by_name(name)
|
obj = self.app.collection.get_by_name(name)
|
||||||
|
|
||||||
if obj.special_group != 'solder_paste_tool':
|
if obj.special_group != 'solder_paste_tool':
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] This CNCJob object can't be processed. "
|
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||||
|
_("This CNCJob object can't be processed. "
|
||||||
"NOT a solder_paste_tool CNCJob object."))
|
"NOT a solder_paste_tool CNCJob object."))
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -1373,7 +1393,8 @@ class SolderPaste(FlatCAMTool):
|
|||||||
filename, _f = QtWidgets.QFileDialog.getSaveFileName(caption=_("Export Machine Code ..."), filter=_filter_)
|
filename, _f = QtWidgets.QFileDialog.getSaveFileName(caption=_("Export Machine Code ..."), filter=_filter_)
|
||||||
|
|
||||||
if filename == '':
|
if filename == '':
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] Export Machine Code cancelled ..."))
|
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||||
|
_("Export Machine Code cancelled ..."))
|
||||||
return
|
return
|
||||||
|
|
||||||
gcode = '(G-CODE GENERATED BY FLATCAM v%s - www.flatcam.org - Version Date: %s)\n' % \
|
gcode = '(G-CODE GENERATED BY FLATCAM v%s - www.flatcam.org - Version Date: %s)\n' % \
|
||||||
@@ -1399,17 +1420,20 @@ class SolderPaste(FlatCAMTool):
|
|||||||
for line in lines:
|
for line in lines:
|
||||||
f.write(line)
|
f.write(line)
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] No such file or directory"))
|
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||||
|
_("No such file or directory"))
|
||||||
return
|
return
|
||||||
except PermissionError:
|
except PermissionError:
|
||||||
self.app.inform.emit(_("[WARNING] Permission denied, saving not possible.\n"
|
self.app.inform.emit('[WARNING] %s' %
|
||||||
|
_("Permission denied, saving not possible.\n"
|
||||||
"Most likely another app is holding the file open and not accessible."))
|
"Most likely another app is holding the file open and not accessible."))
|
||||||
return 'fail'
|
return 'fail'
|
||||||
|
|
||||||
if self.app.defaults["global_open_style"] is False:
|
if self.app.defaults["global_open_style"] is False:
|
||||||
self.app.file_opened.emit("gcode", filename)
|
self.app.file_opened.emit("gcode", filename)
|
||||||
self.app.file_saved.emit("gcode", filename)
|
self.app.file_saved.emit("gcode", filename)
|
||||||
self.app.inform.emit(_("[success] Solder paste dispenser GCode file saved to: %s") % filename)
|
self.app.inform.emit('[success] %s: %s' %
|
||||||
|
(_("Solder paste dispenser GCode file saved to"), filename))
|
||||||
|
|
||||||
def reset_fields(self):
|
def reset_fields(self):
|
||||||
self.obj_combo.setRootModelIndex(self.app.collection.index(0, 0, QtCore.QModelIndex()))
|
self.obj_combo.setRootModelIndex(self.app.collection.index(0, 0, QtCore.QModelIndex()))
|
||||||
|
|||||||
@@ -241,7 +241,8 @@ class ToolSub(FlatCAMTool):
|
|||||||
|
|
||||||
self.target_grb_obj_name = self.target_gerber_combo.currentText()
|
self.target_grb_obj_name = self.target_gerber_combo.currentText()
|
||||||
if self.target_grb_obj_name == '':
|
if self.target_grb_obj_name == '':
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] No Target object loaded."))
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
|
_("No Target object loaded."))
|
||||||
return
|
return
|
||||||
|
|
||||||
# Get target object.
|
# Get target object.
|
||||||
@@ -249,12 +250,14 @@ class ToolSub(FlatCAMTool):
|
|||||||
self.target_grb_obj = self.app.collection.get_by_name(self.target_grb_obj_name)
|
self.target_grb_obj = self.app.collection.get_by_name(self.target_grb_obj_name)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.debug("ToolSub.on_grb_intersection_click() --> %s" % str(e))
|
log.debug("ToolSub.on_grb_intersection_click() --> %s" % str(e))
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Could not retrieve object: %s") % self.obj_name)
|
self.app.inform.emit('[ERROR_NOTCL] %s: %s' %
|
||||||
|
(_("Could not retrieve object"), self.obj_name))
|
||||||
return "Could not retrieve object: %s" % self.target_grb_obj_name
|
return "Could not retrieve object: %s" % self.target_grb_obj_name
|
||||||
|
|
||||||
self.sub_grb_obj_name = self.sub_gerber_combo.currentText()
|
self.sub_grb_obj_name = self.sub_gerber_combo.currentText()
|
||||||
if self.sub_grb_obj_name == '':
|
if self.sub_grb_obj_name == '':
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] No Substractor object loaded."))
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
|
_("No Substractor object loaded."))
|
||||||
return
|
return
|
||||||
|
|
||||||
# Get substractor object.
|
# Get substractor object.
|
||||||
@@ -262,7 +265,8 @@ class ToolSub(FlatCAMTool):
|
|||||||
self.sub_grb_obj = self.app.collection.get_by_name(self.sub_grb_obj_name)
|
self.sub_grb_obj = self.app.collection.get_by_name(self.sub_grb_obj_name)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.debug("ToolSub.on_grb_intersection_click() --> %s" % str(e))
|
log.debug("ToolSub.on_grb_intersection_click() --> %s" % str(e))
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Could not retrieve object: %s") % self.obj_name)
|
self.app.inform.emit('[ERROR_NOTCL] %s: %s' %
|
||||||
|
(_("Could not retrieve object"), self.obj_name))
|
||||||
return "Could not retrieve object: %s" % self.sub_grb_obj_name
|
return "Could not retrieve object: %s" % self.sub_grb_obj_name
|
||||||
|
|
||||||
# crate the new_apertures dict structure
|
# crate the new_apertures dict structure
|
||||||
@@ -412,11 +416,13 @@ class ToolSub(FlatCAMTool):
|
|||||||
with self.app.proc_container.new(_("Generating new object ...")):
|
with self.app.proc_container.new(_("Generating new object ...")):
|
||||||
ret = self.app.new_object('gerber', outname, obj_init, autoselected=False)
|
ret = self.app.new_object('gerber', outname, obj_init, autoselected=False)
|
||||||
if ret == 'fail':
|
if ret == 'fail':
|
||||||
self.app.inform.emit(_('[ERROR_NOTCL] Generating new object failed.'))
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
|
_('Generating new object failed.'))
|
||||||
return
|
return
|
||||||
|
|
||||||
# GUI feedback
|
# GUI feedback
|
||||||
self.app.inform.emit(_("[success] Created: %s") % outname)
|
self.app.inform.emit('[success] %s: %s' %
|
||||||
|
(_("Created"), outname))
|
||||||
|
|
||||||
# cleanup
|
# cleanup
|
||||||
self.new_apertures.clear()
|
self.new_apertures.clear()
|
||||||
@@ -437,7 +443,8 @@ class ToolSub(FlatCAMTool):
|
|||||||
|
|
||||||
self.target_geo_obj_name = self.target_geo_combo.currentText()
|
self.target_geo_obj_name = self.target_geo_combo.currentText()
|
||||||
if self.target_geo_obj_name == '':
|
if self.target_geo_obj_name == '':
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] No Target object loaded."))
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
|
_("No Target object loaded."))
|
||||||
return
|
return
|
||||||
|
|
||||||
# Get target object.
|
# Get target object.
|
||||||
@@ -445,12 +452,14 @@ class ToolSub(FlatCAMTool):
|
|||||||
self.target_geo_obj = self.app.collection.get_by_name(self.target_geo_obj_name)
|
self.target_geo_obj = self.app.collection.get_by_name(self.target_geo_obj_name)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.debug("ToolSub.on_geo_intersection_click() --> %s" % str(e))
|
log.debug("ToolSub.on_geo_intersection_click() --> %s" % str(e))
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Could not retrieve object: %s") % self.target_geo_obj_name)
|
self.app.inform.emit('[ERROR_NOTCL] %s: %s' %
|
||||||
|
(_("Could not retrieve object"), self.target_geo_obj_name))
|
||||||
return "Could not retrieve object: %s" % self.target_grb_obj_name
|
return "Could not retrieve object: %s" % self.target_grb_obj_name
|
||||||
|
|
||||||
self.sub_geo_obj_name = self.sub_geo_combo.currentText()
|
self.sub_geo_obj_name = self.sub_geo_combo.currentText()
|
||||||
if self.sub_geo_obj_name == '':
|
if self.sub_geo_obj_name == '':
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] No Substractor object loaded."))
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
|
_("No Substractor object loaded."))
|
||||||
return
|
return
|
||||||
|
|
||||||
# Get substractor object.
|
# Get substractor object.
|
||||||
@@ -458,11 +467,13 @@ class ToolSub(FlatCAMTool):
|
|||||||
self.sub_geo_obj = self.app.collection.get_by_name(self.sub_geo_obj_name)
|
self.sub_geo_obj = self.app.collection.get_by_name(self.sub_geo_obj_name)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.debug("ToolSub.on_geo_intersection_click() --> %s" % str(e))
|
log.debug("ToolSub.on_geo_intersection_click() --> %s" % str(e))
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Could not retrieve object: %s") % self.sub_geo_obj_name)
|
self.app.inform.emit('[ERROR_NOTCL] %s: %s' %
|
||||||
|
(_("Could not retrieve object"), self.sub_geo_obj_name))
|
||||||
return "Could not retrieve object: %s" % self.sub_geo_obj_name
|
return "Could not retrieve object: %s" % self.sub_geo_obj_name
|
||||||
|
|
||||||
if self.sub_geo_obj.multigeo:
|
if self.sub_geo_obj.multigeo:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Currently, the Substractor geometry cannot be of type Multigeo."))
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
|
_("Currently, the Substractor geometry cannot be of type Multigeo."))
|
||||||
return
|
return
|
||||||
|
|
||||||
# create the target_options obj
|
# create the target_options obj
|
||||||
@@ -608,12 +619,14 @@ class ToolSub(FlatCAMTool):
|
|||||||
with self.app.proc_container.new(_("Generating new object ...")):
|
with self.app.proc_container.new(_("Generating new object ...")):
|
||||||
ret = self.app.new_object('geometry', outname, obj_init, autoselected=False)
|
ret = self.app.new_object('geometry', outname, obj_init, autoselected=False)
|
||||||
if ret == 'fail':
|
if ret == 'fail':
|
||||||
self.app.inform.emit(_('[ERROR_NOTCL] Generating new object failed.'))
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
|
_('Generating new object failed.'))
|
||||||
return
|
return
|
||||||
# Register recent file
|
# Register recent file
|
||||||
self.app.file_opened.emit('geometry', outname)
|
self.app.file_opened.emit('geometry', outname)
|
||||||
# GUI feedback
|
# GUI feedback
|
||||||
self.app.inform.emit(_("[success] Created: %s") % outname)
|
self.app.inform.emit('[success] %s: %s' %
|
||||||
|
(_("Created"), outname))
|
||||||
|
|
||||||
# cleanup
|
# cleanup
|
||||||
self.new_tools.clear()
|
self.new_tools.clear()
|
||||||
@@ -687,7 +700,8 @@ class ToolSub(FlatCAMTool):
|
|||||||
self.app.worker_task.emit({'fcn': self.new_geo_object,
|
self.app.worker_task.emit({'fcn': self.new_geo_object,
|
||||||
'params': [outname]})
|
'params': [outname]})
|
||||||
else:
|
else:
|
||||||
self.app.inform.emit(_('[ERROR_NOTCL] Generating new object failed.'))
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
|
_('Generating new object failed.'))
|
||||||
|
|
||||||
def reset_fields(self):
|
def reset_fields(self):
|
||||||
self.target_gerber_combo.setRootModelIndex(self.app.collection.index(0, 0, QtCore.QModelIndex()))
|
self.target_gerber_combo.setRootModelIndex(self.app.collection.index(0, 0, QtCore.QModelIndex()))
|
||||||
|
|||||||
@@ -470,8 +470,8 @@ class ToolTransform(FlatCAMTool):
|
|||||||
try:
|
try:
|
||||||
value = float(self.rotate_entry.get_value().replace(',', '.'))
|
value = float(self.rotate_entry.get_value().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered for Rotate, "
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
"use a number."))
|
_("Wrong value format entered, use a number."))
|
||||||
return
|
return
|
||||||
self.app.worker_task.emit({'fcn': self.on_rotate_action,
|
self.app.worker_task.emit({'fcn': self.on_rotate_action,
|
||||||
'params': [value]})
|
'params': [value]})
|
||||||
@@ -504,8 +504,8 @@ class ToolTransform(FlatCAMTool):
|
|||||||
try:
|
try:
|
||||||
value = float(self.skewx_entry.get_value().replace(',', '.'))
|
value = float(self.skewx_entry.get_value().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered for Skew X, "
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
"use a number."))
|
_("Wrong value format entered, use a number."))
|
||||||
return
|
return
|
||||||
|
|
||||||
# self.on_skew("X", value)
|
# self.on_skew("X", value)
|
||||||
@@ -522,8 +522,8 @@ class ToolTransform(FlatCAMTool):
|
|||||||
try:
|
try:
|
||||||
value = float(self.skewy_entry.get_value().replace(',', '.'))
|
value = float(self.skewy_entry.get_value().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered for Skew Y, "
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
"use a number."))
|
_("Wrong value format entered, use a number."))
|
||||||
return
|
return
|
||||||
|
|
||||||
# self.on_skew("Y", value)
|
# self.on_skew("Y", value)
|
||||||
@@ -540,8 +540,8 @@ class ToolTransform(FlatCAMTool):
|
|||||||
try:
|
try:
|
||||||
xvalue = float(self.scalex_entry.get_value().replace(',', '.'))
|
xvalue = float(self.scalex_entry.get_value().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered for Scale X, "
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
"use a number."))
|
_("Wrong value format entered, use a number."))
|
||||||
return
|
return
|
||||||
|
|
||||||
# scaling to zero has no sense so we remove it, because scaling with 1 does nothing
|
# scaling to zero has no sense so we remove it, because scaling with 1 does nothing
|
||||||
@@ -574,8 +574,8 @@ class ToolTransform(FlatCAMTool):
|
|||||||
try:
|
try:
|
||||||
yvalue = float(self.scaley_entry.get_value().replace(',', '.'))
|
yvalue = float(self.scaley_entry.get_value().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered for Scale Y, "
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
"use a number."))
|
_("Wrong value format entered, use a number."))
|
||||||
return
|
return
|
||||||
|
|
||||||
# scaling to zero has no sense so we remove it, because scaling with 1 does nothing
|
# scaling to zero has no sense so we remove it, because scaling with 1 does nothing
|
||||||
@@ -603,8 +603,8 @@ class ToolTransform(FlatCAMTool):
|
|||||||
try:
|
try:
|
||||||
value = float(self.offx_entry.get_value().replace(',', '.'))
|
value = float(self.offx_entry.get_value().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered for Offset X, "
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
"use a number."))
|
_("Wrong value format entered, use a number."))
|
||||||
return
|
return
|
||||||
|
|
||||||
# self.on_offset("X", value)
|
# self.on_offset("X", value)
|
||||||
@@ -621,8 +621,8 @@ class ToolTransform(FlatCAMTool):
|
|||||||
try:
|
try:
|
||||||
value = float(self.offy_entry.get_value().replace(',', '.'))
|
value = float(self.offy_entry.get_value().replace(',', '.'))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered for Offset Y, "
|
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||||
"use a number."))
|
_("Wrong value format entered, use a number."))
|
||||||
return
|
return
|
||||||
|
|
||||||
# self.on_offset("Y", value)
|
# self.on_offset("Y", value)
|
||||||
@@ -639,7 +639,8 @@ class ToolTransform(FlatCAMTool):
|
|||||||
ymaxlist = []
|
ymaxlist = []
|
||||||
|
|
||||||
if not obj_list:
|
if not obj_list:
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] No object selected. Please Select an object to rotate!"))
|
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||||
|
_("No object selected. Please Select an object to rotate!"))
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
with self.app.proc_container.new(_("Appying Rotate")):
|
with self.app.proc_container.new(_("Appying Rotate")):
|
||||||
@@ -675,11 +676,12 @@ class ToolTransform(FlatCAMTool):
|
|||||||
# add information to the object that it was changed and how much
|
# add information to the object that it was changed and how much
|
||||||
sel_obj.options['rotate'] = num
|
sel_obj.options['rotate'] = num
|
||||||
sel_obj.plot()
|
sel_obj.plot()
|
||||||
self.app.inform.emit(_('[success] Rotate done ...'))
|
self.app.inform.emit('[success] %s...' % _('Rotate done'))
|
||||||
self.app.progress.emit(100)
|
self.app.progress.emit(100)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Due of %s, rotation movement was not executed.") % str(e))
|
self.app.inform.emit('[ERROR_NOTCL] %s %s, %s.' %
|
||||||
|
(_("Due of"), str(e), _("action was not executed.")))
|
||||||
return
|
return
|
||||||
|
|
||||||
def on_flip(self, axis):
|
def on_flip(self, axis):
|
||||||
@@ -690,7 +692,8 @@ class ToolTransform(FlatCAMTool):
|
|||||||
ymaxlist = []
|
ymaxlist = []
|
||||||
|
|
||||||
if not obj_list:
|
if not obj_list:
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] No object selected. Please Select an object to flip!"))
|
self.app.inform.emit('[WARNING_NOTCL] %s!' %
|
||||||
|
_("No object selected. Please Select an object to flip"))
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
with self.app.proc_container.new(_("Applying Flip")):
|
with self.app.proc_container.new(_("Applying Flip")):
|
||||||
@@ -735,7 +738,8 @@ class ToolTransform(FlatCAMTool):
|
|||||||
sel_obj.options['mirror_y'] = not sel_obj.options['mirror_y']
|
sel_obj.options['mirror_y'] = not sel_obj.options['mirror_y']
|
||||||
else:
|
else:
|
||||||
sel_obj.options['mirror_y'] = True
|
sel_obj.options['mirror_y'] = True
|
||||||
self.app.inform.emit(_('[success] Flip on the Y axis done ...'))
|
self.app.inform.emit('[success] %s...' %
|
||||||
|
_('Flip on the Y axis done'))
|
||||||
elif axis is 'Y':
|
elif axis is 'Y':
|
||||||
sel_obj.mirror('Y', (px, py))
|
sel_obj.mirror('Y', (px, py))
|
||||||
# add information to the object that it was changed and how much
|
# add information to the object that it was changed and how much
|
||||||
@@ -744,13 +748,15 @@ class ToolTransform(FlatCAMTool):
|
|||||||
sel_obj.options['mirror_x'] = not sel_obj.options['mirror_x']
|
sel_obj.options['mirror_x'] = not sel_obj.options['mirror_x']
|
||||||
else:
|
else:
|
||||||
sel_obj.options['mirror_x'] = True
|
sel_obj.options['mirror_x'] = True
|
||||||
self.app.inform.emit(_('[success] Flip on the X axis done ...'))
|
self.app.inform.emit('[success] %s...' %
|
||||||
|
_('Flip on the X axis done'))
|
||||||
self.app.object_changed.emit(sel_obj)
|
self.app.object_changed.emit(sel_obj)
|
||||||
sel_obj.plot()
|
sel_obj.plot()
|
||||||
self.app.progress.emit(100)
|
self.app.progress.emit(100)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Due of %s, Flip action was not executed.") % str(e))
|
self.app.inform.emit('[ERROR_NOTCL] %s %s, %s.' %
|
||||||
|
(_("Due of"), str(e), _("action was not executed.")))
|
||||||
return
|
return
|
||||||
|
|
||||||
def on_skew(self, axis, num):
|
def on_skew(self, axis, num):
|
||||||
@@ -759,7 +765,8 @@ class ToolTransform(FlatCAMTool):
|
|||||||
yminlist = []
|
yminlist = []
|
||||||
|
|
||||||
if not obj_list:
|
if not obj_list:
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] No object selected. Please Select an object to shear/skew!"))
|
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||||
|
_("No object selected. Please Select an object to shear/skew!"))
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
with self.app.proc_container.new(_("Applying Skew")):
|
with self.app.proc_container.new(_("Applying Skew")):
|
||||||
@@ -797,7 +804,8 @@ class ToolTransform(FlatCAMTool):
|
|||||||
self.app.progress.emit(100)
|
self.app.progress.emit(100)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Due of %s, Skew action was not executed.") % str(e))
|
self.app.inform.emit('[ERROR_NOTCL] %s %s, %s.' %
|
||||||
|
(_("Due of"), str(e), _("action was not executed.")))
|
||||||
return
|
return
|
||||||
|
|
||||||
def on_scale(self, axis, xfactor, yfactor, point=None):
|
def on_scale(self, axis, xfactor, yfactor, point=None):
|
||||||
@@ -808,7 +816,8 @@ class ToolTransform(FlatCAMTool):
|
|||||||
ymaxlist = []
|
ymaxlist = []
|
||||||
|
|
||||||
if not obj_list:
|
if not obj_list:
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] No object selected. Please Select an object to scale!"))
|
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||||
|
_("No object selected. Please Select an object to scale!"))
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
with self.app.proc_container.new(_("Applying Scale")):
|
with self.app.proc_container.new(_("Applying Scale")):
|
||||||
@@ -850,17 +859,20 @@ class ToolTransform(FlatCAMTool):
|
|||||||
self.app.object_changed.emit(sel_obj)
|
self.app.object_changed.emit(sel_obj)
|
||||||
sel_obj.plot()
|
sel_obj.plot()
|
||||||
|
|
||||||
self.app.inform.emit(_('[success] Scale on the %s axis done ...') % str(axis))
|
self.app.inform.emit('[success] %s %s %s...' %
|
||||||
|
(_('Scale on the'), str(axis), _('axis done')))
|
||||||
self.app.progress.emit(100)
|
self.app.progress.emit(100)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Due of %s, Scale action was not executed.") % str(e))
|
self.app.inform.emit('[ERROR_NOTCL] %s %s, %s.' %
|
||||||
|
(_("Due of"), str(e), _("action was not executed.")))
|
||||||
return
|
return
|
||||||
|
|
||||||
def on_offset(self, axis, num):
|
def on_offset(self, axis, num):
|
||||||
obj_list = self.app.collection.get_selected()
|
obj_list = self.app.collection.get_selected()
|
||||||
|
|
||||||
if not obj_list:
|
if not obj_list:
|
||||||
self.app.inform.emit(_("[WARNING_NOTCL] No object selected. Please Select an object to offset!"))
|
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||||
|
_("No object selected. Please Select an object to offset!"))
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
with self.app.proc_container.new(_("Applying Offset")):
|
with self.app.proc_container.new(_("Applying Offset")):
|
||||||
@@ -869,7 +881,7 @@ class ToolTransform(FlatCAMTool):
|
|||||||
|
|
||||||
for sel_obj in obj_list:
|
for sel_obj in obj_list:
|
||||||
if isinstance(sel_obj, FlatCAMCNCjob):
|
if isinstance(sel_obj, FlatCAMCNCjob):
|
||||||
self.app.inform.emit(_("CNCJob objects can't be offseted."))
|
self.app.inform.emit(_("CNCJob objects can't be offset."))
|
||||||
else:
|
else:
|
||||||
if axis is 'X':
|
if axis is 'X':
|
||||||
sel_obj.offset((num, 0))
|
sel_obj.offset((num, 0))
|
||||||
@@ -882,11 +894,13 @@ class ToolTransform(FlatCAMTool):
|
|||||||
self.app.object_changed.emit(sel_obj)
|
self.app.object_changed.emit(sel_obj)
|
||||||
sel_obj.plot()
|
sel_obj.plot()
|
||||||
|
|
||||||
self.app.inform.emit(_('[success] Offset on the %s axis done ...') % str(axis))
|
self.app.inform.emit('[success] %s %s %s...' %
|
||||||
|
(_('Offset on the'), str(axis), _('axis done')))
|
||||||
self.app.progress.emit(100)
|
self.app.progress.emit(100)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.app.inform.emit(_("[ERROR_NOTCL] Due of %s, Offset action was not executed.") % str(e))
|
self.app.inform.emit('[ERROR_NOTCL] %s %s, %s.' %
|
||||||
|
(_("Due of"), str(e), _("action was not executed.")))
|
||||||
return
|
return
|
||||||
|
|
||||||
# end of file
|
# end of file
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user