- fixed issue when loading unbuffered a Gerber file that has negative regions
- fixed Panelize Tool to save the aperture geometries into the panel apertures. Also made the tool faster by removing the buffering at the end of the job - modified FlatCAMEditor's files to the new string format that will allow easier translations - updated POT file and the Romanian translation
This commit is contained in:
@@ -50,7 +50,8 @@ class FCDrillAdd(FCShapeTool):
|
||||
item = self.draw_app.tools_table_exc.item((self.draw_app.last_tool_selected - 1), 1)
|
||||
self.draw_app.tools_table_exc.setCurrentItem(item)
|
||||
except KeyError:
|
||||
self.draw_app.app.inform.emit(_("[WARNING_NOTCL] To add a drill first select a tool"))
|
||||
self.draw_app.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("To add a drill first select a tool"))
|
||||
self.draw_app.select_tool("drill_select")
|
||||
return
|
||||
|
||||
@@ -112,7 +113,8 @@ class FCDrillAdd(FCShapeTool):
|
||||
self.geometry = DrawToolShape(self.util_shape(self.points))
|
||||
self.draw_app.in_action = False
|
||||
self.complete = True
|
||||
self.draw_app.app.inform.emit(_("[success] Done. Drill added."))
|
||||
self.draw_app.app.inform.emit('[success] %s' %
|
||||
_("Done. Drill added."))
|
||||
|
||||
|
||||
class FCDrillArray(FCShapeTool):
|
||||
@@ -154,7 +156,8 @@ class FCDrillArray(FCShapeTool):
|
||||
item = self.draw_app.tools_table_exc.item((self.draw_app.last_tool_selected - 1), 1)
|
||||
self.draw_app.tools_table_exc.setCurrentItem(item)
|
||||
except KeyError:
|
||||
self.draw_app.app.inform.emit(_("[WARNING_NOTCL] To add an Drill Array first select a tool in Tool Table"))
|
||||
self.draw_app.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("To add an Drill Array first select a tool in Tool Table"))
|
||||
return
|
||||
|
||||
try:
|
||||
@@ -208,11 +211,12 @@ class FCDrillArray(FCShapeTool):
|
||||
self.drill_linear_angle = float(self.draw_app.linear_angle_spinner.get_value())
|
||||
self.drill_angle = float(self.draw_app.drill_angle_entry.get_value())
|
||||
except TypeError:
|
||||
self.draw_app.app.inform.emit(
|
||||
_("[ERROR_NOTCL] The value is not Float. Check for comma instead of dot separator."))
|
||||
self.draw_app.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||
_("The value is not Float. Check for comma instead of dot separator."))
|
||||
return
|
||||
except Exception as e:
|
||||
self.draw_app.app.inform.emit(_("[ERROR_NOTCL] The value is mistyped. Check the value. %s") % str(e))
|
||||
self.draw_app.app.inform.emit('[ERROR_NOTCL] %s. %s' %
|
||||
(_("The value is mistyped. Check the value"), str(e)))
|
||||
return
|
||||
|
||||
if self.drill_array == 'Linear':
|
||||
@@ -310,7 +314,8 @@ class FCDrillArray(FCShapeTool):
|
||||
self.geometry.append(DrawToolShape(geo))
|
||||
else:
|
||||
if (self.drill_angle * self.drill_array_size) > 360:
|
||||
self.draw_app.app.inform.emit(_("[WARNING_NOTCL] Too many drills for the selected spacing angle."))
|
||||
self.draw_app.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Too many drills for the selected spacing angle."))
|
||||
return
|
||||
|
||||
radius = distance(self.destination, self.origin)
|
||||
@@ -327,7 +332,8 @@ class FCDrillArray(FCShapeTool):
|
||||
geo = self.util_shape((x, y))
|
||||
self.geometry.append(DrawToolShape(geo))
|
||||
self.complete = True
|
||||
self.draw_app.app.inform.emit(_("[success] Done. Drill Array added."))
|
||||
self.draw_app.app.inform.emit('[success] %s' %
|
||||
_("Done. Drill Array added."))
|
||||
self.draw_app.in_action = False
|
||||
self.draw_app.array_frame.hide()
|
||||
return
|
||||
@@ -355,7 +361,8 @@ class FCSlot(FCShapeTool):
|
||||
item = self.draw_app.tools_table_exc.item((self.draw_app.last_tool_selected - 1), 1)
|
||||
self.draw_app.tools_table_exc.setCurrentItem(item)
|
||||
except KeyError:
|
||||
self.draw_app.app.inform.emit(_("[WARNING_NOTCL] To add a slot first select a tool"))
|
||||
self.draw_app.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("To add a slot first select a tool"))
|
||||
self.draw_app.select_tool("drill_select")
|
||||
return
|
||||
|
||||
@@ -412,15 +419,15 @@ class FCSlot(FCShapeTool):
|
||||
slot_length = float(self.draw_app.slot_length_entry.get_value().replace(',', '.'))
|
||||
self.draw_app.slot_length_entry.set_value(slot_length)
|
||||
except ValueError:
|
||||
self.draw_app.app.inform.emit(_("[WARNING_NOTCL] Value is missing or wrong format. "
|
||||
"Add it and retry."))
|
||||
self.draw_app.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Value is missing or wrong format. Add it and retry."))
|
||||
return
|
||||
|
||||
try:
|
||||
slot_angle = float(self.draw_app.slot_angle_spinner.get_value())
|
||||
except ValueError:
|
||||
self.draw_app.app.inform.emit(_("[WARNING_NOTCL] Value is missing or wrong format. "
|
||||
"Add it and retry."))
|
||||
self.draw_app.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Value is missing or wrong format. Add it and retry."))
|
||||
return
|
||||
|
||||
if self.draw_app.slot_axis_radio.get_value() == 'X':
|
||||
@@ -518,7 +525,8 @@ class FCSlot(FCShapeTool):
|
||||
|
||||
self.draw_app.in_action = False
|
||||
self.complete = True
|
||||
self.draw_app.app.inform.emit(_("[success] Done. Adding Slot completed."))
|
||||
self.draw_app.app.inform.emit('[success] %s' %
|
||||
_("Done. Adding Slot completed."))
|
||||
self.draw_app.slot_frame.hide()
|
||||
|
||||
|
||||
@@ -544,7 +552,8 @@ class FCSlotArray(FCShapeTool):
|
||||
item = self.draw_app.tools_table_exc.item((self.draw_app.last_tool_selected - 1), 1)
|
||||
self.draw_app.tools_table_exc.setCurrentItem(item)
|
||||
except KeyError:
|
||||
self.draw_app.app.inform.emit(_("[WARNING_NOTCL] To add an Slot Array first select a tool in Tool Table"))
|
||||
self.draw_app.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("To add an Slot Array first select a tool in Tool Table"))
|
||||
return
|
||||
|
||||
|
||||
@@ -622,11 +631,12 @@ class FCSlotArray(FCShapeTool):
|
||||
self.slot_linear_angle = float(self.draw_app.slot_array_linear_angle_spinner.get_value())
|
||||
self.slot_angle = float(self.draw_app.slot_array_angle_entry.get_value())
|
||||
except TypeError:
|
||||
self.draw_app.app.inform.emit(
|
||||
_("[ERROR_NOTCL] The value is not Float. Check for comma instead of dot separator."))
|
||||
self.draw_app.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||
_("The value is not Float. Check for comma instead of dot separator."))
|
||||
return
|
||||
except Exception as e:
|
||||
self.draw_app.app.inform.emit(_("[ERROR_NOTCL] The value is mistyped. Check the value."))
|
||||
self.draw_app.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||
_("The value is mistyped. Check the value."))
|
||||
return
|
||||
|
||||
if self.slot_array == 'Linear':
|
||||
@@ -687,15 +697,15 @@ class FCSlotArray(FCShapeTool):
|
||||
slot_length = float(self.draw_app.slot_length_entry.get_value().replace(',', '.'))
|
||||
self.draw_app.slot_length_entry.set_value(slot_length)
|
||||
except ValueError:
|
||||
self.draw_app.app.inform.emit(_("[WARNING_NOTCL] Value is missing or wrong format. "
|
||||
"Add it and retry."))
|
||||
self.draw_app.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Value is missing or wrong format. Add it and retry."))
|
||||
return
|
||||
|
||||
try:
|
||||
slot_angle = float(self.draw_app.slot_angle_spinner.get_value())
|
||||
except ValueError:
|
||||
self.draw_app.app.inform.emit(_("[WARNING_NOTCL] Value is missing or wrong format. "
|
||||
"Add it and retry."))
|
||||
self.draw_app.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Value is missing or wrong format. Add it and retry."))
|
||||
return
|
||||
|
||||
if self.draw_app.slot_axis_radio.get_value() == 'X':
|
||||
@@ -804,7 +814,8 @@ class FCSlotArray(FCShapeTool):
|
||||
self.geometry.append(DrawToolShape(geo))
|
||||
else:
|
||||
if (self.slot_angle * self.slot_array_size) > 360:
|
||||
self.draw_app.app.inform.emit(_("[WARNING_NOTCL] Too many Slots for the selected spacing angle."))
|
||||
self.draw_app.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Too many Slots for the selected spacing angle."))
|
||||
return
|
||||
|
||||
radius = distance(self.destination, self.origin)
|
||||
@@ -826,7 +837,8 @@ class FCSlotArray(FCShapeTool):
|
||||
|
||||
self.geometry.append(DrawToolShape(geo))
|
||||
self.complete = True
|
||||
self.draw_app.app.inform.emit(_("[success] Done. Slot Array added."))
|
||||
self.draw_app.app.inform.emit('[success] %s' %
|
||||
_("Done. Slot Array added."))
|
||||
self.draw_app.in_action = False
|
||||
self.draw_app.slot_frame.hide()
|
||||
self.draw_app.slot_array_frame.hide()
|
||||
@@ -872,9 +884,8 @@ class FCDrillResize(FCShapeTool):
|
||||
try:
|
||||
new_dia = self.draw_app.resdrill_entry.get_value()
|
||||
except:
|
||||
self.draw_app.app.inform.emit(
|
||||
_("[ERROR_NOTCL] Resize drill(s) failed. Please enter a diameter for resize.")
|
||||
)
|
||||
self.draw_app.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||
_("Resize drill(s) failed. Please enter a diameter for resize."))
|
||||
return
|
||||
|
||||
if new_dia not in self.draw_app.olddia_newdia:
|
||||
@@ -963,7 +974,8 @@ class FCDrillResize(FCShapeTool):
|
||||
self.geometry.append(DrawToolShape(new_poly))
|
||||
else:
|
||||
# unexpected geometry so we cancel
|
||||
self.draw_app.app.inform.emit(_("[ERROR_NOTCL] Cancelled."))
|
||||
self.draw_app.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||
_("Cancelled."))
|
||||
return
|
||||
|
||||
# remove the geometry with the old size
|
||||
@@ -1032,7 +1044,8 @@ class FCDrillResize(FCShapeTool):
|
||||
except KeyError:
|
||||
# if the exception happen here then we are not dealing with slots neither
|
||||
# therefore something else is not OK so we return
|
||||
self.draw_app.app.inform.emit(_("[ERROR_NOTCL] Cancelled."))
|
||||
self.draw_app.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||
_("Cancelled."))
|
||||
return
|
||||
|
||||
# this simple hack is used so we can delete form self.draw_app.selected but
|
||||
@@ -1052,9 +1065,11 @@ class FCDrillResize(FCShapeTool):
|
||||
# we reactivate the signals after the after the tool editing
|
||||
self.draw_app.tools_table_exc.itemChanged.connect(self.draw_app.on_tool_edit)
|
||||
|
||||
self.draw_app.app.inform.emit(_("[success] Done. Drill/Slot Resize completed."))
|
||||
self.draw_app.app.inform.emit('[success] Done. %s' %
|
||||
_("Drill/Slot Resize completed."))
|
||||
else:
|
||||
self.draw_app.app.inform.emit(_("[WARNING_NOTCL] Cancelled. No drills/slots selected for resize ..."))
|
||||
self.draw_app.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Cancelled. No drills/slots selected for resize ..."))
|
||||
|
||||
# init this set() for another use perhaps
|
||||
self.selected_dia_set = set()
|
||||
@@ -1137,7 +1152,8 @@ class FCDrillMove(FCShapeTool):
|
||||
sel_shapes_to_be_deleted = []
|
||||
|
||||
self.draw_app.build_ui()
|
||||
self.draw_app.app.inform.emit(_("[success] Done. Drill(s) Move completed."))
|
||||
self.draw_app.app.inform.emit('[success] %s' %
|
||||
_("Done. Drill(s) Move completed."))
|
||||
|
||||
def selection_bbox(self):
|
||||
geo_list = []
|
||||
@@ -1234,7 +1250,8 @@ class FCDrillCopy(FCDrillMove):
|
||||
sel_shapes_to_be_deleted = []
|
||||
|
||||
self.draw_app.build_ui()
|
||||
self.draw_app.app.inform.emit(_("[success] Done. Drill(s) copied."))
|
||||
self.draw_app.app.inform.emit('[success] %s' %
|
||||
_("Done. Drill(s) copied."))
|
||||
|
||||
|
||||
class FCDrillSelect(DrawTool):
|
||||
@@ -2395,9 +2412,8 @@ class FlatCAMExcEditor(QtCore.QObject):
|
||||
try:
|
||||
tool_dia = float(self.addtool_entry.get_value().replace(',', '.'))
|
||||
except ValueError:
|
||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered, "
|
||||
"use a number.")
|
||||
)
|
||||
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||
_("Wrong value format entered, use a number."))
|
||||
return
|
||||
|
||||
if tool_dia not in self.olddia_newdia:
|
||||
@@ -2408,17 +2424,17 @@ class FlatCAMExcEditor(QtCore.QObject):
|
||||
# each time a tool diameter is edited or added
|
||||
self.olddia_newdia[tool_dia] = tool_dia
|
||||
else:
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] Tool already in the original or actual tool list.\n"
|
||||
"Save and reedit Excellon if you need to add this tool. ")
|
||||
)
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Tool already in the original or actual tool list.\n"
|
||||
"Save and reedit Excellon if you need to add this tool. "))
|
||||
return
|
||||
|
||||
# since we add a new tool, we update also the initial state of the tool_table through it's dictionary
|
||||
# we add a new entry in the tool2tooldia dict
|
||||
self.tool2tooldia[len(self.olddia_newdia)] = tool_dia
|
||||
|
||||
self.app.inform.emit(_("[success] Added new tool with dia: {dia} {units}").format(dia=str(tool_dia),
|
||||
units=str(self.units)))
|
||||
self.app.inform.emit('[success] %s: %s %s' %
|
||||
(_("Added new tool with dia"), str(tool_dia), str(self.units)))
|
||||
|
||||
self.build_ui()
|
||||
|
||||
@@ -2449,7 +2465,8 @@ class FlatCAMExcEditor(QtCore.QObject):
|
||||
else:
|
||||
deleted_tool_dia_list.append(float('%.4f' % dia))
|
||||
except Exception as e:
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] Select a tool in Tool Table"))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Select a tool in Tool Table"))
|
||||
return
|
||||
|
||||
for deleted_tool_dia in deleted_tool_dia_list:
|
||||
@@ -2481,9 +2498,8 @@ class FlatCAMExcEditor(QtCore.QObject):
|
||||
|
||||
self.olddia_newdia.pop(deleted_tool_dia, None)
|
||||
|
||||
self.app.inform.emit(_("[success] Deleted tool with dia: {del_dia} {units}").format(
|
||||
del_dia=str(deleted_tool_dia),
|
||||
units=str(self.units)))
|
||||
self.app.inform.emit('[success] %s: %s %s' %
|
||||
(_("Deleted tool with diameter"), str(deleted_tool_dia), str(self.units)))
|
||||
|
||||
self.replot()
|
||||
# self.app.inform.emit("Could not delete selected tool")
|
||||
@@ -2632,7 +2648,8 @@ class FlatCAMExcEditor(QtCore.QObject):
|
||||
self.tools_table_exc.itemChanged.connect(self.on_tool_edit)
|
||||
self.tools_table_exc.cellPressed.connect(self.on_row_selected)
|
||||
|
||||
self.app.inform.emit(_("[success] Done. Tool edit completed."))
|
||||
self.app.inform.emit('[success] %s' %
|
||||
_("Done. Tool edit completed."))
|
||||
|
||||
# self.tools_table_exc.selectionModel().currentChanged.connect(self.on_row_selected)
|
||||
|
||||
@@ -3166,11 +3183,12 @@ class FlatCAMExcEditor(QtCore.QObject):
|
||||
try:
|
||||
excellon_obj.create_geometry()
|
||||
except KeyError:
|
||||
self.app.inform.emit(
|
||||
_("[ERROR_NOTCL] There are no Tools definitions in the file. Aborting Excellon creation.")
|
||||
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||
_("There are no Tools definitions in the file. Aborting Excellon creation.")
|
||||
)
|
||||
except:
|
||||
msg = _("[ERROR] An internal error has ocurred. See shell.\n")
|
||||
msg = '[ERROR] %s' % \
|
||||
_("An internal error has ocurred. See Shell.\n")
|
||||
msg += traceback.format_exc()
|
||||
app_obj.inform.emit(msg)
|
||||
raise
|
||||
@@ -3185,7 +3203,8 @@ class FlatCAMExcEditor(QtCore.QObject):
|
||||
self.app.progress.emit(100)
|
||||
return
|
||||
|
||||
self.app.inform.emit(_("[success] Excellon editing finished."))
|
||||
self.app.inform.emit('[success] %s' %
|
||||
_("Excellon editing finished."))
|
||||
# self.progress.emit(100)
|
||||
|
||||
def on_tool_select(self, tool):
|
||||
@@ -3202,7 +3221,8 @@ class FlatCAMExcEditor(QtCore.QObject):
|
||||
# self.draw_app.select_tool('drill_select')
|
||||
self.complete = True
|
||||
current_tool = 'drill_select'
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] Cancelled. There is no Tool/Drill selected"))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Cancelled. There is no Tool/Drill selected"))
|
||||
|
||||
# This is to make the group behave as radio group
|
||||
if current_tool in self.tools_exc:
|
||||
@@ -3421,14 +3441,16 @@ class FlatCAMExcEditor(QtCore.QObject):
|
||||
self.active_tool.complete = True
|
||||
self.in_action = False
|
||||
self.delete_utility_geometry()
|
||||
self.app.inform.emit(_("[success] Done."))
|
||||
self.app.inform.emit('[success] %s' %
|
||||
_("Done."))
|
||||
self.select_tool('drill_select')
|
||||
else:
|
||||
if isinstance(self.active_tool, FCDrillAdd):
|
||||
self.active_tool.complete = True
|
||||
self.in_action = False
|
||||
self.delete_utility_geometry()
|
||||
self.app.inform.emit(_("[success] Done."))
|
||||
self.app.inform.emit('[success] %s' %
|
||||
_("Done."))
|
||||
self.select_tool('drill_select')
|
||||
|
||||
self.app.cursor = QtGui.QCursor()
|
||||
@@ -3784,7 +3806,8 @@ class FlatCAMExcEditor(QtCore.QObject):
|
||||
|
||||
self.selected = []
|
||||
self.build_ui()
|
||||
self.app.inform.emit(_("[success] Done. Drill(s) deleted."))
|
||||
self.app.inform.emit('[success] %s' %
|
||||
_("Done. Drill(s) deleted."))
|
||||
|
||||
def delete_shape(self, del_shape):
|
||||
self.is_modified = True
|
||||
|
||||
@@ -137,8 +137,8 @@ class BufferSelectionTool(FlatCAMTool):
|
||||
buffer_distance = float(self.buffer_distance_entry.get_value().replace(',', '.'))
|
||||
self.buffer_distance_entry.set_value(buffer_distance)
|
||||
except ValueError:
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] Buffer distance value is missing or wrong format. "
|
||||
"Add it and retry."))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Buffer distance value is missing or wrong format. Add it and retry."))
|
||||
return
|
||||
# the cb index start from 0 but the join styles for the buffer start from 1 therefore the adjustment
|
||||
# I populated the combobox such that the index coincide with the join styles value (which is really an INT)
|
||||
@@ -154,8 +154,8 @@ class BufferSelectionTool(FlatCAMTool):
|
||||
buffer_distance = float(self.buffer_distance_entry.get_value().replace(',', '.'))
|
||||
self.buffer_distance_entry.set_value(buffer_distance)
|
||||
except ValueError:
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] Buffer distance value is missing or wrong format. "
|
||||
"Add it and retry."))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Buffer distance value is missing or wrong format. Add it and retry."))
|
||||
return
|
||||
# the cb index start from 0 but the join styles for the buffer start from 1 therefore the adjustment
|
||||
# I populated the combobox such that the index coincide with the join styles value (which is really an INT)
|
||||
@@ -171,8 +171,8 @@ class BufferSelectionTool(FlatCAMTool):
|
||||
buffer_distance = float(self.buffer_distance_entry.get_value().replace(',', '.'))
|
||||
self.buffer_distance_entry.set_value(buffer_distance)
|
||||
except ValueError:
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] Buffer distance value is missing or wrong format. "
|
||||
"Add it and retry."))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Buffer distance value is missing or wrong format. Add it and retry."))
|
||||
return
|
||||
# the cb index start from 0 but the join styles for the buffer start from 1 therefore the adjustment
|
||||
# I populated the combobox such that the index coincide with the join styles value (which is really an INT)
|
||||
@@ -562,7 +562,8 @@ class PaintOptionsTool(FlatCAMTool):
|
||||
|
||||
def on_paint(self):
|
||||
if not self.fcdraw.selected:
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] Paint cancelled. No shape selected."))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Paint cancelled. No shape selected."))
|
||||
return
|
||||
|
||||
try:
|
||||
@@ -573,8 +574,8 @@ class PaintOptionsTool(FlatCAMTool):
|
||||
tooldia = float(self.painttooldia_entry.get_value().replace(',', '.'))
|
||||
self.painttooldia_entry.set_value(tooldia)
|
||||
except ValueError:
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] Tool diameter value is missing or wrong format. "
|
||||
"Add it and retry."))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Tool diameter value is missing or wrong format. Add it and retry."))
|
||||
return
|
||||
try:
|
||||
overlap = float(self.paintoverlap_entry.get_value())
|
||||
@@ -584,8 +585,8 @@ class PaintOptionsTool(FlatCAMTool):
|
||||
overlap = float(self.paintoverlap_entry.get_value().replace(',', '.'))
|
||||
self.paintoverlap_entry.set_value(overlap)
|
||||
except ValueError:
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] Overlap value is missing or wrong format. "
|
||||
"Add it and retry."))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Overlap value is missing or wrong format. Add it and retry."))
|
||||
return
|
||||
|
||||
try:
|
||||
@@ -596,8 +597,8 @@ class PaintOptionsTool(FlatCAMTool):
|
||||
margin = float(self.paintmargin_entry.get_value().replace(',', '.'))
|
||||
self.paintmargin_entry.set_value(margin)
|
||||
except ValueError:
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] Margin distance value is missing or wrong format. "
|
||||
"Add it and retry."))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Margin distance value is missing or wrong format. Add it and retry."))
|
||||
return
|
||||
method = self.paintmethod_combo.get_value()
|
||||
contour = self.paintcontour_cb.get_value()
|
||||
@@ -1053,7 +1054,8 @@ class TransformEditorTool(FlatCAMTool):
|
||||
|
||||
def template(self):
|
||||
if not self.fcdraw.selected:
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] Transformation cancelled. No shape selected."))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Transformation cancelled. No shape selected."))
|
||||
return
|
||||
|
||||
|
||||
@@ -1074,8 +1076,8 @@ class TransformEditorTool(FlatCAMTool):
|
||||
try:
|
||||
value = float(self.rotate_entry.get_value().replace(',', '.'))
|
||||
except ValueError:
|
||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered for Rotate, "
|
||||
"use a number."))
|
||||
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||
_("Wrong value format entered, use a number."))
|
||||
return
|
||||
self.app.worker_task.emit({'fcn': self.on_rotate_action,
|
||||
'params': [value]})
|
||||
@@ -1111,8 +1113,8 @@ class TransformEditorTool(FlatCAMTool):
|
||||
try:
|
||||
value = float(self.skewx_entry.get_value().replace(',', '.'))
|
||||
except ValueError:
|
||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered for Skew X, "
|
||||
"use a number."))
|
||||
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||
_("Wrong value format entered, use a number."))
|
||||
return
|
||||
|
||||
# self.on_skew("X", value)
|
||||
@@ -1132,8 +1134,8 @@ class TransformEditorTool(FlatCAMTool):
|
||||
try:
|
||||
value = float(self.skewy_entry.get_value().replace(',', '.'))
|
||||
except ValueError:
|
||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered for Skew Y, "
|
||||
"use a number."))
|
||||
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||
_("Wrong value format entered, use a number."))
|
||||
return
|
||||
|
||||
# self.on_skew("Y", value)
|
||||
@@ -1153,8 +1155,8 @@ class TransformEditorTool(FlatCAMTool):
|
||||
try:
|
||||
xvalue = float(self.scalex_entry.get_value().replace(',', '.'))
|
||||
except ValueError:
|
||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered for Scale X, "
|
||||
"use a number."))
|
||||
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||
_("Wrong value format entered, use a number."))
|
||||
return
|
||||
|
||||
# scaling to zero has no sense so we remove it, because scaling with 1 does nothing
|
||||
@@ -1190,8 +1192,8 @@ class TransformEditorTool(FlatCAMTool):
|
||||
try:
|
||||
yvalue = float(self.scaley_entry.get_value().replace(',', '.'))
|
||||
except ValueError:
|
||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered for Scale Y, "
|
||||
"use a number."))
|
||||
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||
_("Wrong value format entered, use a number."))
|
||||
return
|
||||
|
||||
# scaling to zero has no sense so we remove it, because scaling with 1 does nothing
|
||||
@@ -1222,8 +1224,8 @@ class TransformEditorTool(FlatCAMTool):
|
||||
try:
|
||||
value = float(self.offx_entry.get_value().replace(',', '.'))
|
||||
except ValueError:
|
||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered for Offset X, "
|
||||
"use a number."))
|
||||
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||
_("Wrong value format entered, use a number."))
|
||||
return
|
||||
|
||||
# self.on_offset("X", value)
|
||||
@@ -1243,8 +1245,8 @@ class TransformEditorTool(FlatCAMTool):
|
||||
try:
|
||||
value = float(self.offy_entry.get_value().replace(',', '.'))
|
||||
except ValueError:
|
||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered for Offset Y, "
|
||||
"use a number."))
|
||||
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||
_("Wrong value format entered, use a number."))
|
||||
return
|
||||
|
||||
# self.on_offset("Y", value)
|
||||
@@ -1261,7 +1263,8 @@ class TransformEditorTool(FlatCAMTool):
|
||||
ymaxlist = []
|
||||
|
||||
if not shape_list:
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] No shape selected. Please Select a shape to rotate!"))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("No shape selected. Please Select a shape to rotate!"))
|
||||
return
|
||||
else:
|
||||
with self.app.proc_container.new(_("Appying Rotate")):
|
||||
@@ -1292,12 +1295,14 @@ class TransformEditorTool(FlatCAMTool):
|
||||
|
||||
# self.draw_app.transform_complete.emit()
|
||||
|
||||
self.app.inform.emit(_("[success] Done. Rotate completed."))
|
||||
self.app.inform.emit('[success] %s' %
|
||||
_("Done. Rotate completed."))
|
||||
|
||||
self.app.progress.emit(100)
|
||||
|
||||
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' %
|
||||
(_("Rotation action was not executed"),str(e)))
|
||||
return
|
||||
|
||||
def on_flip(self, axis):
|
||||
@@ -1308,7 +1313,8 @@ class TransformEditorTool(FlatCAMTool):
|
||||
ymaxlist = []
|
||||
|
||||
if not shape_list:
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] No shape selected. Please Select a shape to flip!"))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("No shape selected. Please Select a shape to flip!"))
|
||||
return
|
||||
else:
|
||||
with self.app.proc_container.new(_("Applying Flip")):
|
||||
@@ -1341,10 +1347,12 @@ class TransformEditorTool(FlatCAMTool):
|
||||
for sha in shape_list:
|
||||
if axis is 'X':
|
||||
sha.mirror('X', (px, py))
|
||||
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':
|
||||
sha.mirror('Y', (px, py))
|
||||
self.app.inform.emit(_('[success] Flip on the X axis done ...'))
|
||||
self.app.inform.emit('[success] %s' %
|
||||
_('Flip on the X axis done'))
|
||||
self.draw_app.replot()
|
||||
|
||||
# self.draw_app.add_shape(DrawToolShape(sha.geo))
|
||||
@@ -1354,7 +1362,8 @@ class TransformEditorTool(FlatCAMTool):
|
||||
self.app.progress.emit(100)
|
||||
|
||||
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' %
|
||||
(_("Flip action was not executed"), str(e)))
|
||||
return
|
||||
|
||||
def on_skew(self, axis, num):
|
||||
@@ -1363,7 +1372,8 @@ class TransformEditorTool(FlatCAMTool):
|
||||
yminlist = []
|
||||
|
||||
if not shape_list:
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] No shape selected. Please Select a shape to shear/skew!"))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("No shape selected. Please Select a shape to shear/skew!"))
|
||||
return
|
||||
else:
|
||||
with self.app.proc_container.new(_("Applying Skew")):
|
||||
@@ -1390,12 +1400,17 @@ class TransformEditorTool(FlatCAMTool):
|
||||
# self.draw_app.add_shape(DrawToolShape(sha.geo))
|
||||
#
|
||||
# self.draw_app.transform_complete.emit()
|
||||
|
||||
self.app.inform.emit(_('[success] Skew on the %s axis done ...') % str(axis))
|
||||
if axis == 'X':
|
||||
self.app.inform.emit('[success] %s...' %
|
||||
_('Skew on the X axis done'))
|
||||
else:
|
||||
self.app.inform.emit('[success] %s...' %
|
||||
_('Skew on the Y axis done'))
|
||||
self.app.progress.emit(100)
|
||||
|
||||
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' %
|
||||
(_("Skew action was not executed"), str(e)))
|
||||
return
|
||||
|
||||
def on_scale(self, axis, xfactor, yfactor, point=None):
|
||||
@@ -1406,7 +1421,8 @@ class TransformEditorTool(FlatCAMTool):
|
||||
ymaxlist = []
|
||||
|
||||
if not shape_list:
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] No shape selected. Please Select a shape to scale!"))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("No shape selected. Please Select a shape to scale!"))
|
||||
return
|
||||
else:
|
||||
with self.app.proc_container.new(_("Applying Scale")):
|
||||
@@ -1442,10 +1458,16 @@ class TransformEditorTool(FlatCAMTool):
|
||||
#
|
||||
# self.draw_app.transform_complete.emit()
|
||||
|
||||
self.app.inform.emit(_('[success] Scale on the %s axis done ...') % str(axis))
|
||||
if str(axis) == 'X':
|
||||
self.app.inform.emit('[success] %s...' %
|
||||
_('Scale on the X axis done'))
|
||||
else:
|
||||
self.app.inform.emit('[success] %s...' %
|
||||
_('Scale on the Y axis done'))
|
||||
self.app.progress.emit(100)
|
||||
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' %
|
||||
(_("Scale action was not executed"), str(e)))
|
||||
return
|
||||
|
||||
def on_offset(self, axis, num):
|
||||
@@ -1454,7 +1476,8 @@ class TransformEditorTool(FlatCAMTool):
|
||||
yminlist = []
|
||||
|
||||
if not shape_list:
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] No shape selected. Please Select a shape to offset!"))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("No shape selected. Please Select a shape to offset!"))
|
||||
return
|
||||
else:
|
||||
with self.app.proc_container.new(_("Applying Offset")):
|
||||
@@ -1468,11 +1491,17 @@ class TransformEditorTool(FlatCAMTool):
|
||||
sha.offset((0, num))
|
||||
self.draw_app.replot()
|
||||
|
||||
self.app.inform.emit(_('[success] Offset on the %s axis done ...') % str(axis))
|
||||
if axis == 'X':
|
||||
self.app.inform.emit('[success] %s...' %
|
||||
_('Offset on the X axis done'))
|
||||
else:
|
||||
self.app.inform.emit('[success] %s...' %
|
||||
_('Offset on the Y axis done'))
|
||||
self.app.progress.emit(100)
|
||||
|
||||
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' %
|
||||
(_("Offset action was not executed"), str(e)))
|
||||
return
|
||||
|
||||
def on_rotate_key(self):
|
||||
@@ -1485,14 +1514,12 @@ class TransformEditorTool(FlatCAMTool):
|
||||
val, ok = val_box.get_value()
|
||||
if ok:
|
||||
self.on_rotate(val=val)
|
||||
self.app.inform.emit(
|
||||
_("[success] Geometry shape rotate done...")
|
||||
)
|
||||
self.app.inform.emit('[success] %s...' %
|
||||
_("Geometry shape rotate done"))
|
||||
return
|
||||
else:
|
||||
self.app.inform.emit(
|
||||
_("[WARNING_NOTCL] Geometry shape rotate cancelled...")
|
||||
)
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Geometry shape rotate cancelled"))
|
||||
|
||||
def on_offx_key(self):
|
||||
units = self.app.ui.general_defaults_form.general_app_group.units_radio.get_value().lower()
|
||||
@@ -1506,12 +1533,12 @@ class TransformEditorTool(FlatCAMTool):
|
||||
val, ok = val_box.get_value()
|
||||
if ok:
|
||||
self.on_offx(val=val)
|
||||
self.app.inform.emit(
|
||||
_("[success] Geometry shape offset on X axis done..."))
|
||||
self.app.inform.emit('[success] %s' %
|
||||
_("Geometry shape offset on X axis done"))
|
||||
return
|
||||
else:
|
||||
self.app.inform.emit(
|
||||
_("[WARNING_NOTCL] Geometry shape offset X cancelled..."))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Geometry shape offset X cancelled"))
|
||||
|
||||
def on_offy_key(self):
|
||||
units = self.app.ui.general_defaults_form.general_app_group.units_radio.get_value().lower()
|
||||
@@ -1525,12 +1552,12 @@ class TransformEditorTool(FlatCAMTool):
|
||||
val, ok = val_box.get_value()
|
||||
if ok:
|
||||
self.on_offx(val=val)
|
||||
self.app.inform.emit(
|
||||
_("[success] Geometry shape offset on Y axis done..."))
|
||||
self.app.inform.emit('[success] %s...' %
|
||||
_("Geometry shape offset on Y axis done"))
|
||||
return
|
||||
else:
|
||||
self.app.inform.emit(
|
||||
_("[WARNING_NOTCL] Geometry shape offset Y cancelled..."))
|
||||
self.app.inform.emit('[success] %s...' %
|
||||
_("Geometry shape offset on Y axis canceled"))
|
||||
|
||||
def on_skewx_key(self):
|
||||
val_box = FCInputDialog(title=_("Skew on X axis ..."),
|
||||
@@ -1542,12 +1569,12 @@ class TransformEditorTool(FlatCAMTool):
|
||||
val, ok = val_box.get_value()
|
||||
if ok:
|
||||
self.on_skewx(val=val)
|
||||
self.app.inform.emit(
|
||||
_("[success] Geometry shape skew on X axis done..."))
|
||||
self.app.inform.emit('[success] %s...' %
|
||||
_("Geometry shape skew on X axis done"))
|
||||
return
|
||||
else:
|
||||
self.app.inform.emit(
|
||||
_("[WARNING_NOTCL] Geometry shape skew X cancelled..."))
|
||||
self.app.inform.emit('[success] %s...' %
|
||||
_("Geometry shape skew on X axis canceled"))
|
||||
|
||||
def on_skewy_key(self):
|
||||
val_box = FCInputDialog(title=_("Skew on Y axis ..."),
|
||||
@@ -1559,12 +1586,12 @@ class TransformEditorTool(FlatCAMTool):
|
||||
val, ok = val_box.get_value()
|
||||
if ok:
|
||||
self.on_skewx(val=val)
|
||||
self.app.inform.emit(
|
||||
_("[success] Geometry shape skew on Y axis done..."))
|
||||
self.app.inform.emit('[success] %s...' %
|
||||
_("Geometry shape skew on Y axis done"))
|
||||
return
|
||||
else:
|
||||
self.app.inform.emit(
|
||||
_("[WARNING_NOTCL] Geometry shape skew Y cancelled..."))
|
||||
self.app.inform.emit('[success] %s...' %
|
||||
_("Geometry shape skew on Y axis canceled"))
|
||||
|
||||
|
||||
class DrawToolShape(object):
|
||||
@@ -1964,7 +1991,8 @@ class FCCircle(FCShapeTool):
|
||||
radius = distance(p1, p2)
|
||||
self.geometry = DrawToolShape(Point(p1).buffer(radius, int(self.steps_per_circ / 4)))
|
||||
self.complete = True
|
||||
self.draw_app.app.inform.emit(_("[success] Done. Adding Circle completed."))
|
||||
self.draw_app.app.inform.emit('[success] %s' %
|
||||
_("Done. Adding Circle completed."))
|
||||
|
||||
|
||||
class FCArc(FCShapeTool):
|
||||
@@ -2178,7 +2206,8 @@ class FCArc(FCShapeTool):
|
||||
self.geometry = DrawToolShape(LineString(arc(center, radius, startangle, stopangle,
|
||||
self.direction, self.steps_per_circ)))
|
||||
self.complete = True
|
||||
self.draw_app.app.inform.emit(_("[success] Done. Arc completed."))
|
||||
self.draw_app.app.inform.emit('[success] %s' %
|
||||
_("Done. Arc completed."))
|
||||
|
||||
|
||||
class FCRectangle(FCShapeTool):
|
||||
@@ -2231,7 +2260,8 @@ class FCRectangle(FCShapeTool):
|
||||
# self.geometry = LinearRing([p1, (p2[0], p1[1]), p2, (p1[0], p2[1])])
|
||||
self.geometry = DrawToolShape(Polygon([p1, (p2[0], p1[1]), p2, (p1[0], p2[1])]))
|
||||
self.complete = True
|
||||
self.draw_app.app.inform.emit(_("[success] Done. Rectangle completed."))
|
||||
self.draw_app.app.inform.emit('[success] %s' %
|
||||
_("Done. Rectangle completed."))
|
||||
|
||||
|
||||
class FCPolygon(FCShapeTool):
|
||||
@@ -2285,7 +2315,8 @@ class FCPolygon(FCShapeTool):
|
||||
self.geometry = DrawToolShape(Polygon(self.points))
|
||||
self.draw_app.in_action = False
|
||||
self.complete = True
|
||||
self.draw_app.app.inform.emit(_("[success] Done. Polygon completed."))
|
||||
self.draw_app.app.inform.emit('[success] %s' %
|
||||
_("Done. Polygon completed."))
|
||||
|
||||
def on_key(self, key):
|
||||
if key == 'Backspace' or key == QtCore.Qt.Key_Backspace:
|
||||
@@ -2440,7 +2471,8 @@ class FCMove(FCShapeTool):
|
||||
self.selection_shape = self.selection_bbox()
|
||||
|
||||
if len(self.draw_app.get_selected()) == 0:
|
||||
self.draw_app.app.inform.emit(_("[WARNING_NOTCL] MOVE: No shape selected. Select a shape to move ..."))
|
||||
self.draw_app.app.inform.emit('[WARNING_NOTCL] %s...' %
|
||||
_("MOVE: No shape selected. Select a shape to move"))
|
||||
else:
|
||||
self.draw_app.app.inform.emit(_(" MOVE: Click on reference point ..."))
|
||||
|
||||
@@ -2479,7 +2511,8 @@ class FCMove(FCShapeTool):
|
||||
# Delete old
|
||||
self.draw_app.delete_selected()
|
||||
self.complete = True
|
||||
self.draw_app.app.inform.emit(_("[success] Done. Geometry(s) Move completed."))
|
||||
self.draw_app.app.inform.emit('[success] %s' %
|
||||
_("Done. Geometry(s) Move completed."))
|
||||
|
||||
def selection_bbox(self):
|
||||
geo_list = []
|
||||
@@ -2599,7 +2632,8 @@ class FCCopy(FCMove):
|
||||
self.geometry = [DrawToolShape(affinity.translate(geom.geo, xoff=dx, yoff=dy))
|
||||
for geom in self.draw_app.get_selected()]
|
||||
self.complete = True
|
||||
self.draw_app.app.inform.emit(_("[success] Done. Geometry(s) Copy completed."))
|
||||
self.draw_app.app.inform.emit('[success] %s' %
|
||||
_("Done. Geometry(s) Copy completed."))
|
||||
|
||||
|
||||
class FCText(FCShapeTool):
|
||||
@@ -2635,20 +2669,23 @@ class FCText(FCShapeTool):
|
||||
self.geometry = DrawToolShape(affinity.translate(self.text_gui.text_path, xoff=dx, yoff=dy))
|
||||
except Exception as e:
|
||||
log.debug("Font geometry is empty or incorrect: %s" % str(e))
|
||||
self.draw_app.app.inform.emit(_("[ERROR]Font not supported. Only Regular, Bold, Italic and BoldItalic are "
|
||||
"supported. Error: %s") % str(e))
|
||||
self.draw_app.app.inform.emit('[ERROR] %s: %s' %
|
||||
(_("Font not supported. Only Regular, Bold, Italic and BoldItalic are "
|
||||
"supported. Error"), str(e)))
|
||||
self.text_gui.text_path = []
|
||||
self.text_gui.hide_tool()
|
||||
self.draw_app.select_tool('select')
|
||||
return
|
||||
else:
|
||||
self.draw_app.app.inform.emit(_("[WARNING_NOTCL] No text to add."))
|
||||
self.draw_app.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("No text to add."))
|
||||
return
|
||||
|
||||
self.text_gui.text_path = []
|
||||
self.text_gui.hide_tool()
|
||||
self.complete = True
|
||||
self.draw_app.app.inform.emit(_("[success] Done. Adding Text completed."))
|
||||
self.draw_app.app.inform.emit('[success]%s' %
|
||||
_(" Done. Adding Text completed."))
|
||||
|
||||
def utility_geometry(self, data=None):
|
||||
"""
|
||||
@@ -2687,7 +2724,8 @@ class FCBuffer(FCShapeTool):
|
||||
|
||||
def on_buffer(self):
|
||||
if not self.draw_app.selected:
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] Buffer cancelled. No shape selected."))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Buffer cancelled. No shape selected."))
|
||||
return
|
||||
|
||||
try:
|
||||
@@ -2698,8 +2736,8 @@ class FCBuffer(FCShapeTool):
|
||||
buffer_distance = float(self.buff_tool.buffer_distance_entry.get_value().replace(',', '.'))
|
||||
self.buff_tool.buffer_distance_entry.set_value(buffer_distance)
|
||||
except ValueError:
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] Buffer distance value is missing or wrong format. "
|
||||
"Add it and retry."))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Buffer distance value is missing or wrong format. Add it and retry."))
|
||||
return
|
||||
# the cb index start from 0 but the join styles for the buffer start from 1 therefore the adjustment
|
||||
# I populated the combobox such that the index coincide with the join styles value (whcih is really an INT)
|
||||
@@ -2711,11 +2749,13 @@ class FCBuffer(FCShapeTool):
|
||||
self.disactivate()
|
||||
if ret_val == 'fail':
|
||||
return
|
||||
self.draw_app.app.inform.emit(_("[success] Done. Buffer Tool completed."))
|
||||
self.draw_app.app.inform.emit('[success] %s' %
|
||||
_("Done. Buffer Tool completed."))
|
||||
|
||||
def on_buffer_int(self):
|
||||
if not self.draw_app.selected:
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] Buffer cancelled. No shape selected."))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Buffer cancelled. No shape selected."))
|
||||
return
|
||||
|
||||
try:
|
||||
@@ -2726,8 +2766,8 @@ class FCBuffer(FCShapeTool):
|
||||
buffer_distance = float(self.buff_tool.buffer_distance_entry.get_value().replace(',', '.'))
|
||||
self.buff_tool.buffer_distance_entry.set_value(buffer_distance)
|
||||
except ValueError:
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] Buffer distance value is missing or wrong format. "
|
||||
"Add it and retry."))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Buffer distance value is missing or wrong format. Add it and retry."))
|
||||
return
|
||||
# the cb index start from 0 but the join styles for the buffer start from 1 therefore the adjustment
|
||||
# I populated the combobox such that the index coincide with the join styles value (whcih is really an INT)
|
||||
@@ -2739,11 +2779,13 @@ class FCBuffer(FCShapeTool):
|
||||
self.disactivate()
|
||||
if ret_val == 'fail':
|
||||
return
|
||||
self.draw_app.app.inform.emit(_("[success] Done. Buffer Int Tool completed."))
|
||||
self.draw_app.app.inform.emit('[success] %s' %
|
||||
_("Done. Buffer Int Tool completed."))
|
||||
|
||||
def on_buffer_ext(self):
|
||||
if not self.draw_app.selected:
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] Buffer cancelled. No shape selected."))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Buffer cancelled. No shape selected."))
|
||||
return
|
||||
|
||||
try:
|
||||
@@ -2754,8 +2796,8 @@ class FCBuffer(FCShapeTool):
|
||||
buffer_distance = float(self.buff_tool.buffer_distance_entry.get_value().replace(',', '.'))
|
||||
self.buff_tool.buffer_distance_entry.set_value(buffer_distance)
|
||||
except ValueError:
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] Buffer distance value is missing or wrong format. "
|
||||
"Add it and retry."))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Buffer distance value is missing or wrong format. Add it and retry."))
|
||||
return
|
||||
# the cb index start from 0 but the join styles for the buffer start from 1 therefore the adjustment
|
||||
# I populated the combobox such that the index coincide with the join styles value (whcih is really an INT)
|
||||
@@ -2767,7 +2809,8 @@ class FCBuffer(FCShapeTool):
|
||||
self.disactivate()
|
||||
if ret_val == 'fail':
|
||||
return
|
||||
self.draw_app.app.inform.emit(_("[success] Done. Buffer Ext Tool completed."))
|
||||
self.draw_app.app.inform.emit('[success] %s' %
|
||||
_("Done. Buffer Ext Tool completed."))
|
||||
|
||||
def activate(self):
|
||||
self.buff_tool.buffer_button.clicked.disconnect()
|
||||
@@ -2862,7 +2905,8 @@ class FCEraser(FCShapeTool):
|
||||
|
||||
self.draw_app.delete_utility_geometry()
|
||||
self.draw_app.plot_all()
|
||||
self.draw_app.app.inform.emit(_("[success] Done. Eraser tool action completed."))
|
||||
self.draw_app.app.inform.emit('[success] %s' %
|
||||
_("Done. Eraser tool action completed."))
|
||||
|
||||
def utility_geometry(self, data=None):
|
||||
"""
|
||||
@@ -3497,8 +3541,13 @@ class FlatCAMGeoEditor(QtCore.QObject):
|
||||
if multigeo_tool:
|
||||
self.multigeo_tool = multigeo_tool
|
||||
geo_to_edit = fcgeometry.flatten(geometry=fcgeometry.tools[self.multigeo_tool]['solid_geometry'])
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] Editing MultiGeo Geometry, tool: {tool} with diameter: {dia}").
|
||||
format(tool=self.multigeo_tool, dia=fcgeometry.tools[self.multigeo_tool]['tooldia']))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s: %s %s: %s' %
|
||||
(_("Editing MultiGeo Geometry, tool"),
|
||||
str(self.multigeo_tool),
|
||||
_("with diameter"),
|
||||
str(fcgeometry.tools[self.multigeo_tool]['tooldia'])
|
||||
)
|
||||
)
|
||||
else:
|
||||
geo_to_edit = fcgeometry.flatten()
|
||||
|
||||
@@ -3738,7 +3787,8 @@ class FlatCAMGeoEditor(QtCore.QObject):
|
||||
self.active_tool.complete = True
|
||||
self.in_action = False
|
||||
self.delete_utility_geometry()
|
||||
self.app.inform.emit(_("[success] Done."))
|
||||
self.app.inform.emit('[success] %s' %
|
||||
_("Done."))
|
||||
self.select_tool('select')
|
||||
else:
|
||||
self.app.cursor = QtGui.QCursor()
|
||||
@@ -3752,7 +3802,8 @@ class FlatCAMGeoEditor(QtCore.QObject):
|
||||
self.active_tool.make()
|
||||
if self.active_tool.complete:
|
||||
self.on_shape_complete()
|
||||
self.app.inform.emit(_("[success] Done."))
|
||||
self.app.inform.emit('[success] %s' %
|
||||
_("Done."))
|
||||
self.select_tool(self.active_tool.name)
|
||||
except Exception as e:
|
||||
log.warning("Error: %s" % str(e))
|
||||
@@ -3869,7 +3920,8 @@ class FlatCAMGeoEditor(QtCore.QObject):
|
||||
|
||||
def on_copy_click(self):
|
||||
if not self.selected:
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] Copy cancelled. No shape selected."))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Copy cancelled. No shape selected."))
|
||||
return
|
||||
|
||||
self.app.ui.geo_copy_btn.setChecked(True)
|
||||
@@ -4119,8 +4171,8 @@ class FlatCAMGeoEditor(QtCore.QObject):
|
||||
results = geo_shapes[0].geo
|
||||
except Exception as e:
|
||||
log.debug("FlatCAMGeoEditor.intersection() --> %s" % str(e))
|
||||
self.app.inform.emit(
|
||||
_("[WARNING_NOTCL] A selection of at least 2 geo items is required to do Intersection."))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("A selection of at least 2 geo items is required to do Intersection."))
|
||||
self.select_tool('select')
|
||||
return
|
||||
|
||||
@@ -4154,8 +4206,8 @@ class FlatCAMGeoEditor(QtCore.QObject):
|
||||
intersector = geo_shapes[0].geo
|
||||
except Exception as e:
|
||||
log.debug("FlatCAMGeoEditor.intersection() --> %s" % str(e))
|
||||
self.app.inform.emit(
|
||||
_("[WARNING_NOTCL] A selection of at least 2 geo items is required to do Intersection."))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("A selection of at least 2 geo items is required to do Intersection."))
|
||||
self.select_tool('select')
|
||||
return
|
||||
|
||||
@@ -4240,9 +4292,9 @@ class FlatCAMGeoEditor(QtCore.QObject):
|
||||
selected = self.get_selected()
|
||||
|
||||
if buf_distance < 0:
|
||||
self.app.inform.emit(
|
||||
_("[ERROR_NOTCL] Negative buffer value is not accepted. "
|
||||
"Use Buffer interior to generate an 'inside' shape"))
|
||||
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||
_("Negative buffer value is not accepted. Use Buffer interior to generate an "
|
||||
"'inside' shape"))
|
||||
|
||||
# deselect everything
|
||||
self.selected = []
|
||||
@@ -4250,11 +4302,13 @@ class FlatCAMGeoEditor(QtCore.QObject):
|
||||
return 'fail'
|
||||
|
||||
if len(selected) == 0:
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] Nothing selected for buffering."))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Nothing selected for buffering."))
|
||||
return 'fail'
|
||||
|
||||
if not isinstance(buf_distance, float):
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] Invalid distance for buffering."))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Invalid distance for buffering."))
|
||||
|
||||
# deselect everything
|
||||
self.selected = []
|
||||
@@ -4277,7 +4331,8 @@ class FlatCAMGeoEditor(QtCore.QObject):
|
||||
)
|
||||
|
||||
if not results:
|
||||
self.app.inform.emit(_("[ERROR_NOTCL] Failed, the result is empty. Choose a different buffer value."))
|
||||
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||
_("Failed, the result is empty. Choose a different buffer value."))
|
||||
# deselect everything
|
||||
self.selected = []
|
||||
self.replot()
|
||||
@@ -4287,14 +4342,15 @@ class FlatCAMGeoEditor(QtCore.QObject):
|
||||
self.add_shape(DrawToolShape(sha))
|
||||
|
||||
self.replot()
|
||||
self.app.inform.emit(_("[success] Full buffer geometry created."))
|
||||
self.app.inform.emit('[success] %s' %
|
||||
_("Full buffer geometry created."))
|
||||
|
||||
def buffer_int(self, buf_distance, join_style):
|
||||
selected = self.get_selected()
|
||||
|
||||
if buf_distance < 0:
|
||||
self.app.inform.emit(
|
||||
_("[ERROR_NOTCL] Negative buffer value is not accepted.")
|
||||
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||
_("Negative buffer value is not accepted.")
|
||||
)
|
||||
# deselect everything
|
||||
self.selected = []
|
||||
@@ -4302,11 +4358,13 @@ class FlatCAMGeoEditor(QtCore.QObject):
|
||||
return 'fail'
|
||||
|
||||
if len(selected) == 0:
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] Nothing selected for buffering."))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Nothing selected for buffering."))
|
||||
return 'fail'
|
||||
|
||||
if not isinstance(buf_distance, float):
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] Invalid distance for buffering."))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Invalid distance for buffering."))
|
||||
# deselect everything
|
||||
self.selected = []
|
||||
self.replot()
|
||||
@@ -4325,7 +4383,8 @@ class FlatCAMGeoEditor(QtCore.QObject):
|
||||
)
|
||||
|
||||
if not results:
|
||||
self.app.inform.emit(_("[ERROR_NOTCL] Failed, the result is empty. Choose a smaller buffer value."))
|
||||
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||
_("Failed, the result is empty. Choose a smaller buffer value."))
|
||||
# deselect everything
|
||||
self.selected = []
|
||||
self.replot()
|
||||
@@ -4335,25 +4394,29 @@ class FlatCAMGeoEditor(QtCore.QObject):
|
||||
self.add_shape(DrawToolShape(sha))
|
||||
|
||||
self.replot()
|
||||
self.app.inform.emit(_("[success] Interior buffer geometry created."))
|
||||
self.app.inform.emit('[success] %s' %
|
||||
_("Interior buffer geometry created."))
|
||||
|
||||
def buffer_ext(self, buf_distance, join_style):
|
||||
selected = self.get_selected()
|
||||
|
||||
if buf_distance < 0:
|
||||
self.app.inform.emit(_("[ERROR_NOTCL] Negative buffer value is not accepted. "
|
||||
"Use Buffer interior to generate an 'inside' shape"))
|
||||
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||
_("Negative buffer value is not accepted. Use Buffer interior to generate an "
|
||||
"'inside' shape"))
|
||||
# deselect everything
|
||||
self.selected = []
|
||||
self.replot()
|
||||
return
|
||||
|
||||
if len(selected) == 0:
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] Nothing selected for buffering."))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Nothing selected for buffering."))
|
||||
return
|
||||
|
||||
if not isinstance(buf_distance, float):
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] Invalid distance for buffering."))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Invalid distance for buffering."))
|
||||
# deselect everything
|
||||
self.selected = []
|
||||
self.replot()
|
||||
@@ -4372,7 +4435,8 @@ class FlatCAMGeoEditor(QtCore.QObject):
|
||||
)
|
||||
|
||||
if not results:
|
||||
self.app.inform.emit(_("[ERROR_NOTCL] Failed, the result is empty. Choose a different buffer value."))
|
||||
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||
_("Failed, the result is empty. Choose a different buffer value."))
|
||||
# deselect everything
|
||||
self.selected = []
|
||||
self.replot()
|
||||
@@ -4382,7 +4446,8 @@ class FlatCAMGeoEditor(QtCore.QObject):
|
||||
self.add_shape(DrawToolShape(sha))
|
||||
|
||||
self.replot()
|
||||
self.app.inform.emit(_("[success] Exterior buffer geometry created."))
|
||||
self.app.inform.emit('[success] %s' %
|
||||
_("Exterior buffer geometry created."))
|
||||
|
||||
# def paint(self, tooldia, overlap, margin, method):
|
||||
# selected = self.get_selected()
|
||||
@@ -4446,19 +4511,21 @@ class FlatCAMGeoEditor(QtCore.QObject):
|
||||
selected = self.get_selected()
|
||||
|
||||
if len(selected) == 0:
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] Nothing selected for painting."))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Nothing selected for painting."))
|
||||
return
|
||||
|
||||
for param in [tooldia, overlap, margin]:
|
||||
if not isinstance(param, float):
|
||||
param_name = [k for k, v in locals().items() if v is param][0]
|
||||
self.app.inform.emit(_("[WARNING] Invalid value for {}").format(param))
|
||||
self.app.inform.emit('[WARNING] %s: %s' %
|
||||
(_("Invalid value for"), str(param)))
|
||||
|
||||
results = []
|
||||
|
||||
if overlap >= 1:
|
||||
self.app.inform.emit(
|
||||
_("[ERROR_NOTCL] Could not do Paint. Overlap value has to be less than 1.00 (100%)."))
|
||||
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||
_("Could not do Paint. Overlap value has to be less than 1.00 (100%%)."))
|
||||
return
|
||||
|
||||
def recurse(geometry, reset=True):
|
||||
@@ -4516,8 +4583,8 @@ class FlatCAMGeoEditor(QtCore.QObject):
|
||||
local_results += list(cp.get_objects())
|
||||
except Exception as e:
|
||||
log.debug("Could not Paint the polygons. %s" % str(e))
|
||||
self.app.inform.emit(
|
||||
_("[ERROR] Could not do Paint. Try a different combination of parameters. "
|
||||
self.app.inform.emit('[ERROR] %s' %
|
||||
_("Could not do Paint. Try a different combination of parameters. "
|
||||
"Or a different method of Paint\n%s") % str(e))
|
||||
return
|
||||
|
||||
|
||||
@@ -204,14 +204,15 @@ class FCPad(FCShapeTool):
|
||||
try:
|
||||
self.radius = float(self.draw_app.storage_dict[self.draw_app.last_aperture_selected]['size']) / 2
|
||||
except KeyError:
|
||||
self.draw_app.app.inform.emit(_(
|
||||
"[WARNING_NOTCL] To add an Pad first select a aperture in Aperture Table"))
|
||||
self.draw_app.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("To add an Pad first select a aperture in Aperture Table"))
|
||||
self.draw_app.in_action = False
|
||||
self.complete = True
|
||||
return
|
||||
|
||||
if self.radius == 0:
|
||||
self.draw_app.app.inform.emit(_("[WARNING_NOTCL] Aperture size is zero. It needs to be greater than zero."))
|
||||
self.draw_app.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Aperture size is zero. It needs to be greater than zero."))
|
||||
self.dont_execute = True
|
||||
return
|
||||
else:
|
||||
@@ -374,7 +375,8 @@ class FCPad(FCShapeTool):
|
||||
|
||||
self.draw_app.in_action = False
|
||||
self.complete = True
|
||||
self.draw_app.app.inform.emit(_("[success] Done. Adding Pad completed."))
|
||||
self.draw_app.app.inform.emit('[success] %s' %
|
||||
_("Done. Adding Pad completed."))
|
||||
|
||||
def clean_up(self):
|
||||
self.draw_app.selected = []
|
||||
@@ -395,15 +397,16 @@ class FCPadArray(FCShapeTool):
|
||||
try:
|
||||
self.radius = float(self.draw_app.storage_dict[self.draw_app.last_aperture_selected]['size']) / 2
|
||||
except KeyError:
|
||||
self.draw_app.app.inform.emit(_(
|
||||
"[WARNING_NOTCL] To add an Pad Array first select a aperture in Aperture Table"))
|
||||
self.draw_app.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("To add an Pad Array first select a aperture in Aperture Table"))
|
||||
self.complete = True
|
||||
self.draw_app.in_action = False
|
||||
self.draw_app.array_frame.hide()
|
||||
return
|
||||
|
||||
if self.radius == 0:
|
||||
self.draw_app.app.inform.emit(_("[WARNING_NOTCL] Aperture size is zero. It needs to be greater than zero."))
|
||||
self.draw_app.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Aperture size is zero. It needs to be greater than zero."))
|
||||
self.dont_execute = True
|
||||
return
|
||||
else:
|
||||
@@ -498,11 +501,12 @@ class FCPadArray(FCShapeTool):
|
||||
self.pad_linear_angle = float(self.draw_app.linear_angle_spinner.get_value())
|
||||
self.pad_angle = float(self.draw_app.pad_angle_entry.get_value())
|
||||
except TypeError:
|
||||
self.draw_app.app.inform.emit(
|
||||
_("[ERROR_NOTCL] The value is not Float. Check for comma instead of dot separator."))
|
||||
self.draw_app.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||
_("The value is not Float. Check for comma instead of dot separator."))
|
||||
return
|
||||
except Exception as e:
|
||||
self.draw_app.app.inform.emit(_("[ERROR_NOTCL] The value is mistyped. Check the value."))
|
||||
self.draw_app.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||
_("The value is mistyped. Check the value."))
|
||||
return
|
||||
|
||||
if self.pad_array == 'Linear':
|
||||
@@ -692,7 +696,8 @@ class FCPadArray(FCShapeTool):
|
||||
self.geometry.append(DrawToolShape(geo))
|
||||
else:
|
||||
if (self.pad_angle * self.pad_array_size) > 360:
|
||||
self.draw_app.app.inform.emit(_("[WARNING_NOTCL] Too many Pads for the selected spacing angle."))
|
||||
self.draw_app.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Too many Pads for the selected spacing angle."))
|
||||
return
|
||||
|
||||
radius = distance(self.destination, self.origin)
|
||||
@@ -714,7 +719,8 @@ class FCPadArray(FCShapeTool):
|
||||
|
||||
self.geometry.append(DrawToolShape(geo))
|
||||
self.complete = True
|
||||
self.draw_app.app.inform.emit(_("[success] Done. Pad Array added."))
|
||||
self.draw_app.app.inform.emit('[success] %s' %
|
||||
_("Done. Pad Array added."))
|
||||
self.draw_app.in_action = False
|
||||
self.draw_app.array_frame.hide()
|
||||
return
|
||||
@@ -746,7 +752,8 @@ class FCPoligonize(FCShapeTool):
|
||||
if not self.draw_app.selected:
|
||||
self.draw_app.in_action = False
|
||||
self.complete = True
|
||||
self.draw_app.app.inform.emit(_("[ERROR_NOTCL] Failed. Nothing selected."))
|
||||
self.draw_app.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||
_("Failed. Nothing selected."))
|
||||
self.draw_app.select_tool("select")
|
||||
return
|
||||
|
||||
@@ -761,8 +768,9 @@ class FCPoligonize(FCShapeTool):
|
||||
if len(apid_set) > 1:
|
||||
self.draw_app.in_action = False
|
||||
self.complete = True
|
||||
self.draw_app.app.inform.emit(_("[WARNING_NOTCL] Failed. Poligonize works only on "
|
||||
"geometries belonging to the same aperture."))
|
||||
self.draw_app.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Failed. Poligonize works only on geometries belonging "
|
||||
"to the same aperture."))
|
||||
self.draw_app.select_tool("select")
|
||||
return
|
||||
|
||||
@@ -814,7 +822,8 @@ class FCPoligonize(FCShapeTool):
|
||||
|
||||
self.draw_app.in_action = False
|
||||
self.complete = True
|
||||
self.draw_app.app.inform.emit(_("[success] Done. Poligonize completed."))
|
||||
self.draw_app.app.inform.emit('[success] %s' %
|
||||
_("Done. Poligonize completed."))
|
||||
|
||||
# MS: always return to the Select Tool if modifier key is not pressed
|
||||
# else return to the current tool
|
||||
@@ -1054,7 +1063,8 @@ class FCRegion(FCShapeTool):
|
||||
self.geometry = DrawToolShape(new_geo_el)
|
||||
self.draw_app.in_action = False
|
||||
self.complete = True
|
||||
self.draw_app.app.inform.emit(_("[success] Done."))
|
||||
self.draw_app.app.inform.emit('[success] %s' %
|
||||
_("Done."))
|
||||
|
||||
def clean_up(self):
|
||||
self.draw_app.selected = []
|
||||
@@ -1157,7 +1167,8 @@ class FCTrack(FCRegion):
|
||||
|
||||
self.draw_app.in_action = False
|
||||
self.complete = True
|
||||
self.draw_app.app.inform.emit(_("[success] Done."))
|
||||
self.draw_app.app.inform.emit('[success] %s' %
|
||||
_("Done."))
|
||||
|
||||
def clean_up(self):
|
||||
self.draw_app.selected = []
|
||||
@@ -1430,7 +1441,8 @@ class FCDisc(FCShapeTool):
|
||||
|
||||
self.draw_app.in_action = False
|
||||
self.complete = True
|
||||
self.draw_app.app.inform.emit(_("[success] Done."))
|
||||
self.draw_app.app.inform.emit('[success] %s' %
|
||||
_("Done."))
|
||||
|
||||
def clean_up(self):
|
||||
self.draw_app.selected = []
|
||||
@@ -1687,7 +1699,8 @@ class FCSemiDisc(FCShapeTool):
|
||||
|
||||
self.draw_app.in_action = False
|
||||
self.complete = True
|
||||
self.draw_app.app.inform.emit(_("[success] Done."))
|
||||
self.draw_app.app.inform.emit('[success] %s' %
|
||||
_("Done."))
|
||||
|
||||
def clean_up(self):
|
||||
self.draw_app.selected = []
|
||||
@@ -1835,7 +1848,8 @@ class FCApertureMove(FCShapeTool):
|
||||
self.selected_apertures = []
|
||||
|
||||
if len(self.draw_app.get_selected()) == 0:
|
||||
self.draw_app.app.inform.emit(_("[WARNING_NOTCL] Nothing selected to move ..."))
|
||||
self.draw_app.app.inform.emit('[WARNING_NOTCL] %s...' %
|
||||
_("Nothing selected to move"))
|
||||
self.complete = True
|
||||
self.draw_app.select_tool("select")
|
||||
return
|
||||
@@ -1958,7 +1972,8 @@ class FCApertureMove(FCShapeTool):
|
||||
|
||||
self.draw_app.plot_all()
|
||||
self.draw_app.build_ui()
|
||||
self.draw_app.app.inform.emit(_("[success] Done. Apertures Move completed."))
|
||||
self.draw_app.app.inform.emit('[success] %s' %
|
||||
_("Done. Apertures Move completed."))
|
||||
|
||||
def clean_up(self):
|
||||
self.draw_app.selected = []
|
||||
@@ -2034,7 +2049,8 @@ class FCApertureCopy(FCApertureMove):
|
||||
sel_shapes_to_be_deleted = []
|
||||
|
||||
self.draw_app.build_ui()
|
||||
self.draw_app.app.inform.emit(_("[success] Done. Apertures copied."))
|
||||
self.draw_app.app.inform.emit('[success] %s' %
|
||||
_("Done. Apertures copied."))
|
||||
|
||||
|
||||
class FCEraser(FCShapeTool):
|
||||
@@ -2141,7 +2157,8 @@ class FCEraser(FCShapeTool):
|
||||
|
||||
self.draw_app.delete_utility_geometry()
|
||||
self.draw_app.plot_all()
|
||||
self.draw_app.app.inform.emit(_("[success] Done. Eraser tool action completed."))
|
||||
self.draw_app.app.inform.emit('[success] %s' %
|
||||
_("Done. Eraser tool action completed."))
|
||||
|
||||
def clean_up(self):
|
||||
self.draw_app.selected = []
|
||||
@@ -3132,12 +3149,12 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
||||
try:
|
||||
ap_id = str(self.apcode_entry.get_value())
|
||||
except ValueError:
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] Aperture code value is missing or wrong format. "
|
||||
"Add it and retry."))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Aperture code value is missing or wrong format. Add it and retry."))
|
||||
return
|
||||
if ap_id == '':
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] Aperture code value is missing or wrong format. "
|
||||
"Add it and retry."))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Aperture code value is missing or wrong format. Add it and retry."))
|
||||
return
|
||||
|
||||
if ap_id == '0':
|
||||
@@ -3172,7 +3189,8 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
||||
except Exception as e:
|
||||
log.error("FlatCAMGrbEditor.on_aperture_add() --> the R or O aperture dims has to be in a "
|
||||
"tuple format (x,y)\nError: %s" % str(e))
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] Aperture dimensions value is missing or wrong format. "
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Aperture dimensions value is missing or wrong format. "
|
||||
"Add it in format (width, height) and retry."))
|
||||
return
|
||||
else:
|
||||
@@ -3184,8 +3202,8 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
||||
size_val = float(self.apsize_entry.get_value().replace(',', '.'))
|
||||
self.apsize_entry.set_value(size_val)
|
||||
except ValueError:
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] Aperture size value is missing or wrong format. "
|
||||
"Add it and retry."))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Aperture size value is missing or wrong format. Add it and retry."))
|
||||
return
|
||||
self.storage_dict[ap_id]['size'] = size_val
|
||||
|
||||
@@ -3195,14 +3213,16 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
||||
# values each time a aperture code is edited or added
|
||||
self.olddia_newdia[ap_id] = ap_id
|
||||
else:
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] Aperture already in the aperture table."))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Aperture already in the aperture table."))
|
||||
return
|
||||
|
||||
# since we add a new tool, we update also the initial state of the tool_table through it's dictionary
|
||||
# we add a new entry in the tool2tooldia dict
|
||||
self.tool2tooldia[len(self.olddia_newdia)] = int(ap_id)
|
||||
|
||||
self.app.inform.emit(_("[success] Added new aperture with code: {apid}").format(apid=str(ap_id)))
|
||||
self.app.inform.emit('[success] %s: %s' %
|
||||
(_("Added new aperture with code"), str(ap_id)))
|
||||
|
||||
self.build_ui()
|
||||
|
||||
@@ -3230,13 +3250,15 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
||||
else:
|
||||
# deleted_tool_dia = float(self.apertures_table.item(self.apertures_table.currentRow(), 1).text())
|
||||
if len(self.apertures_table.selectionModel().selectedRows()) == 0:
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] Select an aperture in Aperture Table"))
|
||||
self.app.inform.emit('[WARNING_NOTCL]%s' %
|
||||
_(" Select an aperture in Aperture Table"))
|
||||
return
|
||||
for index in self.apertures_table.selectionModel().selectedRows():
|
||||
row = index.row()
|
||||
deleted_apcode_list.append(self.apertures_table.item(row, 1).text())
|
||||
except Exception as exc:
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] Select an aperture in Aperture Table --> %s" % str(exc)))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s %s' %
|
||||
(_("Select an aperture in Aperture Table -->", str(exc))))
|
||||
return
|
||||
|
||||
if deleted_apcode_list:
|
||||
@@ -3259,8 +3281,8 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
||||
|
||||
self.olddia_newdia.pop(deleted_aperture, None)
|
||||
|
||||
self.app.inform.emit(_("[success] Deleted aperture with code: {del_dia}").format(
|
||||
del_dia=str(deleted_aperture)))
|
||||
self.app.inform.emit('[success] %s: %s' %
|
||||
(_("Deleted aperture with code"), str(deleted_aperture)))
|
||||
|
||||
self.plot_all()
|
||||
self.build_ui()
|
||||
@@ -3910,11 +3932,11 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
||||
try:
|
||||
grb_obj.create_geometry()
|
||||
except KeyError:
|
||||
self.app.inform.emit(
|
||||
_("[ERROR_NOTCL] There are no Aperture definitions in the file. Aborting Gerber creation.")
|
||||
)
|
||||
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||
_("There are no Aperture definitions in the file. Aborting Gerber creation."))
|
||||
except Exception as e:
|
||||
msg = _("[ERROR] An internal error has occurred. See shell.\n")
|
||||
msg = '[ERROR] %s' % \
|
||||
_("An internal error has occurred. See shell.\n")
|
||||
msg += traceback.format_exc()
|
||||
app_obj.inform.emit(msg)
|
||||
raise
|
||||
@@ -3927,7 +3949,8 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
||||
self.app.progress.emit(100)
|
||||
return
|
||||
|
||||
self.app.inform.emit(_("[success] Gerber editing finished."))
|
||||
self.app.inform.emit('[success] %s' %
|
||||
_("Done. Gerber editing finished."))
|
||||
|
||||
def on_tool_select(self, tool):
|
||||
"""
|
||||
@@ -3943,7 +3966,8 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
||||
# self.draw_app.select_tool('select')
|
||||
self.complete = True
|
||||
current_tool = 'select'
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] Cancelled. No aperture is selected"))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Cancelled. No aperture is selected"))
|
||||
|
||||
# This is to make the group behave as radio group
|
||||
if current_tool in self.tools_gerber:
|
||||
@@ -4094,7 +4118,8 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
||||
self.app.clipboard.setText(
|
||||
self.app.defaults["global_point_clipboard_format"] % (self.pos[0], self.pos[1])
|
||||
)
|
||||
self.app.inform.emit(_("[success] Coordinates copied to clipboard."))
|
||||
self.app.inform.emit('[success] %s' %
|
||||
_("Coordinates copied to clipboard."))
|
||||
return
|
||||
|
||||
# Dispatch event to active_tool
|
||||
@@ -4153,7 +4178,8 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
||||
self.active_tool.complete = True
|
||||
self.in_action = False
|
||||
self.delete_utility_geometry()
|
||||
self.app.inform.emit(_("[success] Done."))
|
||||
self.app.inform.emit('[success] %s' %
|
||||
_("Done."))
|
||||
self.select_tool('select')
|
||||
else:
|
||||
self.app.cursor = QtGui.QCursor()
|
||||
@@ -4167,7 +4193,8 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
||||
self.active_tool.make()
|
||||
if self.active_tool.complete:
|
||||
self.on_grb_shape_complete()
|
||||
self.app.inform.emit(_("[success] Done."))
|
||||
self.app.inform.emit('[success] %s' %
|
||||
_("Done."))
|
||||
|
||||
# MS: always return to the Select Tool if modifier key is not pressed
|
||||
# else return to the current tool but not for FCTrack
|
||||
@@ -4474,7 +4501,8 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
||||
temp_ref = [s for s in self.selected]
|
||||
|
||||
if len(temp_ref) == 0:
|
||||
self.app.inform.emit(_("[ERROR_NOTCL] Failed. No aperture geometry is selected."))
|
||||
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||
_("Failed. No aperture geometry is selected."))
|
||||
return
|
||||
|
||||
for shape_sel in temp_ref:
|
||||
@@ -4482,7 +4510,8 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
||||
|
||||
self.selected = []
|
||||
self.build_ui()
|
||||
self.app.inform.emit(_("[success] Done. Apertures geometry deleted."))
|
||||
self.app.inform.emit('[success] %s' %
|
||||
_("Done. Apertures geometry deleted."))
|
||||
|
||||
def delete_shape(self, geo_el):
|
||||
self.is_modified = True
|
||||
@@ -4596,8 +4625,8 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
||||
buff_value = float(self.buffer_distance_entry.get_value().replace(',', '.'))
|
||||
self.buffer_distance_entry.set_value(buff_value)
|
||||
except ValueError:
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] Buffer distance value is missing or wrong format. "
|
||||
"Add it and retry."))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Buffer distance value is missing or wrong format. Add it and retry."))
|
||||
return
|
||||
# the cb index start from 0 but the join styles for the buffer start from 1 therefore the adjustment
|
||||
# I populated the combobox such that the index coincide with the join styles value (which is really an INT)
|
||||
@@ -4624,9 +4653,8 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
||||
return geom_el
|
||||
|
||||
if not self.apertures_table.selectedItems():
|
||||
self.app.inform.emit(_(
|
||||
"[WARNING_NOTCL] No aperture to buffer. Select at least one aperture and try again."
|
||||
))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("No aperture to buffer. Select at least one aperture and try again."))
|
||||
return
|
||||
|
||||
for x in self.apertures_table.selectedItems():
|
||||
@@ -4638,10 +4666,12 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
||||
self.storage_dict[apid]['geometry'] = temp_storage
|
||||
except Exception as e:
|
||||
log.debug("FlatCAMGrbEditor.buffer() --> %s\n%s" % str(e))
|
||||
self.app.inform.emit(_("[ERROR_NOTCL] Failed.\n%s") % str(traceback.print_exc()))
|
||||
self.app.inform.emit('[ERROR_NOTCL] %s\n%s' %
|
||||
(_("Failed."), str(traceback.print_exc())))
|
||||
return
|
||||
self.plot_all()
|
||||
self.app.inform.emit(_("[success] Done. Buffer Tool completed."))
|
||||
self.app.inform.emit('[success] %s' %
|
||||
_("Done. Buffer Tool completed."))
|
||||
|
||||
def on_scale(self):
|
||||
scale_factor = 1.0
|
||||
@@ -4655,8 +4685,8 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
||||
scale_factor = float(self.scale_factor_entry.get_value().replace(',', '.'))
|
||||
self.scale_factor_entry.set_value(scale_factor)
|
||||
except ValueError:
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] Scale factor value is missing or wrong format. "
|
||||
"Add it and retry."))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Scale factor value is missing or wrong format. Add it and retry."))
|
||||
return
|
||||
|
||||
def scale_recursion(geom_el, selection):
|
||||
@@ -4687,9 +4717,8 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
||||
return geom_el
|
||||
|
||||
if not self.apertures_table.selectedItems():
|
||||
self.app.inform.emit(_(
|
||||
"[WARNING_NOTCL] No aperture to scale. Select at least one aperture and try again."
|
||||
))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("No aperture to scale. Select at least one aperture and try again."))
|
||||
return
|
||||
|
||||
for x in self.apertures_table.selectedItems():
|
||||
@@ -4704,7 +4733,8 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
||||
log.debug("FlatCAMGrbEditor.on_scale() --> %s" % str(e))
|
||||
|
||||
self.plot_all()
|
||||
self.app.inform.emit(_("[success] Done. Scale Tool completed."))
|
||||
self.app.inform.emit('[success] %s' %
|
||||
_("Done. Scale Tool completed."))
|
||||
|
||||
def on_markarea(self):
|
||||
# clear previous marking
|
||||
@@ -4741,9 +4771,11 @@ class FlatCAMGrbEditor(QtCore.QObject):
|
||||
self.ma_annotation.set(text=text, pos=position, visible=True,
|
||||
font_size=self.app.defaults["cncjob_annotation_fontsize"],
|
||||
color=self.app.defaults["global_sel_draw_color"])
|
||||
self.app.inform.emit(_("[success] Polygon areas marked."))
|
||||
self.app.inform.emit('[success] %s' %
|
||||
_("Polygon areas marked."))
|
||||
else:
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] There are no polygons to mark area."))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("There are no polygons to mark area."))
|
||||
|
||||
def on_eraser(self):
|
||||
self.select_tool('eraser')
|
||||
@@ -5226,7 +5258,8 @@ class TransformEditorTool(FlatCAMTool):
|
||||
|
||||
def template(self):
|
||||
if not self.fcdraw.selected:
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] Transformation cancelled. No shape selected."))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Transformation cancelled. No shape selected."))
|
||||
return
|
||||
|
||||
self.draw_app.select_tool("select")
|
||||
@@ -5246,8 +5279,8 @@ class TransformEditorTool(FlatCAMTool):
|
||||
try:
|
||||
value = float(self.rotate_entry.get_value().replace(',', '.'))
|
||||
except ValueError:
|
||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered for Rotate, "
|
||||
"use a number."))
|
||||
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||
_("Wrong value format entered, use a number."))
|
||||
return
|
||||
self.app.worker_task.emit({'fcn': self.on_rotate_action,
|
||||
'params': [value]})
|
||||
@@ -5289,8 +5322,8 @@ class TransformEditorTool(FlatCAMTool):
|
||||
try:
|
||||
value = float(self.skewx_entry.get_value().replace(',', '.'))
|
||||
except ValueError:
|
||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered for Skew X, "
|
||||
"use a number."))
|
||||
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||
_("Wrong value format entered, use a number."))
|
||||
return
|
||||
|
||||
# self.on_skew("X", value)
|
||||
@@ -5316,8 +5349,8 @@ class TransformEditorTool(FlatCAMTool):
|
||||
try:
|
||||
value = float(self.skewy_entry.get_value().replace(',', '.'))
|
||||
except ValueError:
|
||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered for Skew Y, "
|
||||
"use a number."))
|
||||
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||
_("Wrong value format entered, use a number."))
|
||||
return
|
||||
|
||||
# self.on_skew("Y", value)
|
||||
@@ -5343,8 +5376,8 @@ class TransformEditorTool(FlatCAMTool):
|
||||
try:
|
||||
x_value = float(self.scalex_entry.get_value().replace(',', '.'))
|
||||
except ValueError:
|
||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered for Scale X, "
|
||||
"use a number."))
|
||||
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||
_("Wrong value format entered, use a number."))
|
||||
return
|
||||
|
||||
# scaling to zero has no sense so we remove it, because scaling with 1 does nothing
|
||||
@@ -5384,8 +5417,8 @@ class TransformEditorTool(FlatCAMTool):
|
||||
try:
|
||||
y_value = float(self.scaley_entry.get_value().replace(',', '.'))
|
||||
except ValueError:
|
||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered for Scale Y, "
|
||||
"use a number."))
|
||||
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||
_("Wrong value format entered, use a number."))
|
||||
return
|
||||
|
||||
# scaling to zero has no sense so we remove it, because scaling with 1 does nothing
|
||||
@@ -5422,8 +5455,8 @@ class TransformEditorTool(FlatCAMTool):
|
||||
try:
|
||||
value = float(self.offx_entry.get_value().replace(',', '.'))
|
||||
except ValueError:
|
||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered for Offset X, "
|
||||
"use a number."))
|
||||
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||
_("Wrong value format entered, use a number."))
|
||||
return
|
||||
|
||||
# self.on_offset("X", value)
|
||||
@@ -5448,8 +5481,8 @@ class TransformEditorTool(FlatCAMTool):
|
||||
try:
|
||||
value = float(self.offy_entry.get_value().replace(',', '.'))
|
||||
except ValueError:
|
||||
self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered for Offset Y, "
|
||||
"use a number."))
|
||||
self.app.inform.emit('[ERROR_NOTCL] %s' %
|
||||
_("Wrong value format entered, use a number."))
|
||||
return
|
||||
|
||||
# self.on_offset("Y", value)
|
||||
@@ -5471,7 +5504,8 @@ class TransformEditorTool(FlatCAMTool):
|
||||
ymaxlist = []
|
||||
|
||||
if not elem_list:
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] No shape selected. Please Select a shape to rotate!"))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("No shape selected. Please Select a shape to rotate!"))
|
||||
return
|
||||
|
||||
with self.app.proc_container.new(_("Appying Rotate")):
|
||||
@@ -5507,10 +5541,12 @@ class TransformEditorTool(FlatCAMTool):
|
||||
sel_el['clear'] = affinity.rotate(sel_el['clear'], angle=-num, origin=(px, py))
|
||||
self.draw_app.plot_all()
|
||||
|
||||
self.app.inform.emit(_("[success] Done. Rotate completed."))
|
||||
self.app.inform.emit('[success] %s' %
|
||||
_("Done. Rotate completed."))
|
||||
self.app.progress.emit(100)
|
||||
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' %
|
||||
(_("Rotation action was not executed."), str(e)))
|
||||
return
|
||||
|
||||
def on_flip(self, axis):
|
||||
@@ -5526,7 +5562,8 @@ class TransformEditorTool(FlatCAMTool):
|
||||
ymaxlist = []
|
||||
|
||||
if not elem_list:
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] No shape selected. Please Select a shape to flip!"))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("No shape selected. Please Select a shape to flip!"))
|
||||
return
|
||||
|
||||
with self.app.proc_container.new(_("Applying Flip")):
|
||||
@@ -5568,7 +5605,8 @@ class TransformEditorTool(FlatCAMTool):
|
||||
sel_el['follow'] = affinity.scale(sel_el['follow'], xfact=1, yfact=-1, origin=(px, py))
|
||||
if 'clear' in sel_el:
|
||||
sel_el['clear'] = affinity.scale(sel_el['clear'], xfact=1, yfact=-1, origin=(px, py))
|
||||
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':
|
||||
if 'solid' in sel_el:
|
||||
sel_el['solid'] = affinity.scale(sel_el['solid'], xfact=-1, yfact=1, origin=(px, py))
|
||||
@@ -5576,12 +5614,14 @@ class TransformEditorTool(FlatCAMTool):
|
||||
sel_el['follow'] = affinity.scale(sel_el['follow'], xfact=-1, yfact=1, origin=(px, py))
|
||||
if 'clear' in sel_el:
|
||||
sel_el['clear'] = affinity.scale(sel_el['clear'], xfact=-1, yfact=1, origin=(px, py))
|
||||
self.app.inform.emit(_('[success] Flip on the X axis done ...'))
|
||||
self.app.inform.emit('[success] %s...' %
|
||||
_('Flip on the X axis done'))
|
||||
self.draw_app.plot_all()
|
||||
self.app.progress.emit(100)
|
||||
|
||||
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' %
|
||||
(_("Flip action was not executed."), str(e)))
|
||||
return
|
||||
|
||||
def on_skew(self, axis, num):
|
||||
@@ -5596,7 +5636,8 @@ class TransformEditorTool(FlatCAMTool):
|
||||
yminlist = []
|
||||
|
||||
if not elem_list:
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] No shape selected. Please Select a shape to shear/skew!"))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("No shape selected. Please Select a shape to shear/skew!"))
|
||||
return
|
||||
else:
|
||||
with self.app.proc_container.new(_("Applying Skew")):
|
||||
@@ -5634,11 +5675,17 @@ class TransformEditorTool(FlatCAMTool):
|
||||
sel_el['clear'] = affinity.skew(sel_el['clear'], 0, num, origin=(xminimal, yminimal))
|
||||
self.draw_app.plot_all()
|
||||
|
||||
self.app.inform.emit(_('[success] Skew on the %s axis done ...') % str(axis))
|
||||
if str(axis) == 'X':
|
||||
self.app.inform.emit('[success] %s...' %
|
||||
_('Skew on the X axis done'))
|
||||
else:
|
||||
self.app.inform.emit('[success] %s...' %
|
||||
_('Skew on the Y axis done'))
|
||||
self.app.progress.emit(100)
|
||||
|
||||
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' %
|
||||
(_("Skew action was not executed."), str(e)))
|
||||
return
|
||||
|
||||
def on_scale(self, axis, xfactor, yfactor, point=None):
|
||||
@@ -5657,7 +5704,8 @@ class TransformEditorTool(FlatCAMTool):
|
||||
ymaxlist = []
|
||||
|
||||
if not elem_list:
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] No shape selected. Please Select a shape to scale!"))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("No shape selected. Please Select a shape to scale!"))
|
||||
return
|
||||
else:
|
||||
with self.app.proc_container.new(_("Applying Scale")):
|
||||
@@ -5698,10 +5746,16 @@ class TransformEditorTool(FlatCAMTool):
|
||||
sel_el['clear'] = affinity.scale(sel_el['clear'], xfactor, yfactor, origin=(px, py))
|
||||
self.draw_app.plot_all()
|
||||
|
||||
self.app.inform.emit(_('[success] Scale on the %s axis done ...') % str(axis))
|
||||
if str(axis) == 'X':
|
||||
self.app.inform.emit('[success] %s...' %
|
||||
_('Scale on the X axis done'))
|
||||
else:
|
||||
self.app.inform.emit('[success] %s...' %
|
||||
_('Scale on the Y axis done'))
|
||||
self.app.progress.emit(100)
|
||||
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' %
|
||||
(_("Scale action was not executed."), str(e)))
|
||||
return
|
||||
|
||||
def on_offset(self, axis, num):
|
||||
@@ -5714,7 +5768,8 @@ class TransformEditorTool(FlatCAMTool):
|
||||
elem_list = self.draw_app.selected
|
||||
|
||||
if not elem_list:
|
||||
self.app.inform.emit(_("[WARNING_NOTCL] No shape selected. Please Select a shape to offset!"))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("No shape selected. Please Select a shape to offset!"))
|
||||
return
|
||||
else:
|
||||
with self.app.proc_container.new(_("Applying Offset")):
|
||||
@@ -5739,11 +5794,17 @@ class TransformEditorTool(FlatCAMTool):
|
||||
sel_el['clear'] = affinity.translate(sel_el['clear'], 0, num)
|
||||
self.draw_app.plot_all()
|
||||
|
||||
self.app.inform.emit(_('[success] Offset on the %s axis done ...') % str(axis))
|
||||
if str(axis) == 'X':
|
||||
self.app.inform.emit('[success] %s...' %
|
||||
_('Offset on the X axis done'))
|
||||
else:
|
||||
self.app.inform.emit('[success] %s...' %
|
||||
_('Offset on the Y axis done'))
|
||||
self.app.progress.emit(100)
|
||||
|
||||
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' %
|
||||
(_("Offset action was not executed."), str(e)))
|
||||
return
|
||||
|
||||
def on_rotate_key(self):
|
||||
@@ -5756,14 +5817,12 @@ class TransformEditorTool(FlatCAMTool):
|
||||
val, ok = val_box.get_value()
|
||||
if ok:
|
||||
self.on_rotate(val=val)
|
||||
self.app.inform.emit(
|
||||
_("[success] Geometry shape rotate done...")
|
||||
)
|
||||
self.app.inform.emit('[success] %s...' %
|
||||
_("Geometry shape rotate done"))
|
||||
return
|
||||
else:
|
||||
self.app.inform.emit(
|
||||
_("[WARNING_NOTCL] Geometry shape rotate cancelled...")
|
||||
)
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s...' %
|
||||
_("Geometry shape rotate cancelled"))
|
||||
|
||||
def on_offx_key(self):
|
||||
units = self.app.ui.general_defaults_form.general_app_group.units_radio.get_value().lower()
|
||||
@@ -5777,12 +5836,12 @@ class TransformEditorTool(FlatCAMTool):
|
||||
val, ok = val_box.get_value()
|
||||
if ok:
|
||||
self.on_offx(val=val)
|
||||
self.app.inform.emit(
|
||||
_("[success] Geometry shape offset on X axis done..."))
|
||||
self.app.inform.emit('[success] %s...' %
|
||||
_("Geometry shape offset on X axis done"))
|
||||
return
|
||||
else:
|
||||
self.app.inform.emit(
|
||||
_("[WARNING_NOTCL] Geometry shape offset X cancelled..."))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s...' %
|
||||
_("Geometry shape offset X cancelled"))
|
||||
|
||||
def on_offy_key(self):
|
||||
units = self.app.ui.general_defaults_form.general_app_group.units_radio.get_value().lower()
|
||||
@@ -5796,12 +5855,12 @@ class TransformEditorTool(FlatCAMTool):
|
||||
val, ok = val_box.get_value()
|
||||
if ok:
|
||||
self.on_offx(val=val)
|
||||
self.app.inform.emit(
|
||||
_("[success] Geometry shape offset on Y axis done..."))
|
||||
self.app.inform.emit('[success] %s...' %
|
||||
_("Geometry shape offset on Y axis done"))
|
||||
return
|
||||
else:
|
||||
self.app.inform.emit(
|
||||
_("[WARNING_NOTCL] Geometry shape offset Y cancelled..."))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s...' %
|
||||
_("Geometry shape offset Y cancelled"))
|
||||
|
||||
def on_skewx_key(self):
|
||||
val_box = FCInputDialog(title=_("Skew on X axis ..."),
|
||||
@@ -5813,12 +5872,12 @@ class TransformEditorTool(FlatCAMTool):
|
||||
val, ok = val_box.get_value()
|
||||
if ok:
|
||||
self.on_skewx(val=val)
|
||||
self.app.inform.emit(
|
||||
_("[success] Geometry shape skew on X axis done..."))
|
||||
self.app.inform.emit('[success] %s...' %
|
||||
_("Geometry shape skew on X axis done"))
|
||||
return
|
||||
else:
|
||||
self.app.inform.emit(
|
||||
_("[WARNING_NOTCL] Geometry shape skew X cancelled..."))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s...' %
|
||||
_("Geometry shape skew X cancelled"))
|
||||
|
||||
def on_skewy_key(self):
|
||||
val_box = FCInputDialog(title=_("Skew on Y axis ..."),
|
||||
@@ -5830,12 +5889,12 @@ class TransformEditorTool(FlatCAMTool):
|
||||
val, ok = val_box.get_value()
|
||||
if ok:
|
||||
self.on_skewx(val=val)
|
||||
self.app.inform.emit(
|
||||
_("[success] Geometry shape skew on Y axis done..."))
|
||||
self.app.inform.emit('[success] %s...' %
|
||||
_("Geometry shape skew on Y axis done"))
|
||||
return
|
||||
else:
|
||||
self.app.inform.emit(
|
||||
_("[WARNING_NOTCL] Geometry shape skew Y cancelled..."))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s...' %
|
||||
_("Geometry shape skew Y cancelled"))
|
||||
|
||||
|
||||
def get_shapely_list_bounds(geometry_list):
|
||||
|
||||
Reference in New Issue
Block a user