- fixed some issues in the Geometry Editor; the jump sigmal disconnect was failing for repeated Editor tool operation
This commit is contained in:
@@ -9,6 +9,10 @@ CAD program, and create G-Code for Isolation routing.
|
|||||||
|
|
||||||
=================================================
|
=================================================
|
||||||
|
|
||||||
|
19.02.2020
|
||||||
|
|
||||||
|
- fixed some issues in the Geometry Editor; the jump sigmal disconnect was failing for repeated Editor tool operation
|
||||||
|
|
||||||
17.02.2020
|
17.02.2020
|
||||||
|
|
||||||
- updated the Excellon UI to hold data for each tool
|
- updated the Excellon UI to hold data for each tool
|
||||||
|
|||||||
18
camlib.py
18
camlib.py
@@ -2850,14 +2850,16 @@ class CNCjob(Geometry):
|
|||||||
self.app.inform.emit('[WARNING] %s' %
|
self.app.inform.emit('[WARNING] %s' %
|
||||||
_("The Cut Z parameter has positive value. "
|
_("The Cut Z parameter has positive value. "
|
||||||
"It is the depth value to drill into material.\n"
|
"It is the depth value to drill into material.\n"
|
||||||
"The Cut Z parameter needs to have a negative value, assuming it is a typo "
|
"The Cut Z parameter needs to have a negative value, "
|
||||||
|
"assuming it is a typo "
|
||||||
"therefore the app will convert the value to negative. "
|
"therefore the app will convert the value to negative. "
|
||||||
"Check the resulting CNC code (Gcode etc)."))
|
"Check the resulting CNC code (Gcode etc)."))
|
||||||
self.z_cut = -self.z_cut
|
self.z_cut = -self.z_cut
|
||||||
elif self.z_cut == 0:
|
elif self.z_cut == 0:
|
||||||
self.app.inform.emit('[WARNING] %s: %s' %
|
self.app.inform.emit('[WARNING] %s: %s' %
|
||||||
(_(
|
(_(
|
||||||
"The Cut Z parameter is zero. There will be no cut, skipping file"),
|
"The Cut Z parameter is zero. There will be no cut, "
|
||||||
|
"skipping file"),
|
||||||
exobj.options['name']))
|
exobj.options['name']))
|
||||||
return 'fail'
|
return 'fail'
|
||||||
|
|
||||||
@@ -3063,14 +3065,16 @@ class CNCjob(Geometry):
|
|||||||
self.app.inform.emit('[WARNING] %s' %
|
self.app.inform.emit('[WARNING] %s' %
|
||||||
_("The Cut Z parameter has positive value. "
|
_("The Cut Z parameter has positive value. "
|
||||||
"It is the depth value to drill into material.\n"
|
"It is the depth value to drill into material.\n"
|
||||||
"The Cut Z parameter needs to have a negative value, assuming it is a typo "
|
"The Cut Z parameter needs to have a negative value, "
|
||||||
|
"assuming it is a typo "
|
||||||
"therefore the app will convert the value to negative. "
|
"therefore the app will convert the value to negative. "
|
||||||
"Check the resulting CNC code (Gcode etc)."))
|
"Check the resulting CNC code (Gcode etc)."))
|
||||||
self.z_cut = -self.z_cut
|
self.z_cut = -self.z_cut
|
||||||
elif self.z_cut == 0:
|
elif self.z_cut == 0:
|
||||||
self.app.inform.emit('[WARNING] %s: %s' %
|
self.app.inform.emit('[WARNING] %s: %s' %
|
||||||
(_(
|
(_(
|
||||||
"The Cut Z parameter is zero. There will be no cut, skipping file"),
|
"The Cut Z parameter is zero. There will be no cut, "
|
||||||
|
"skipping file"),
|
||||||
exobj.options['name']))
|
exobj.options['name']))
|
||||||
return 'fail'
|
return 'fail'
|
||||||
|
|
||||||
@@ -3269,14 +3273,16 @@ class CNCjob(Geometry):
|
|||||||
self.app.inform.emit('[WARNING] %s' %
|
self.app.inform.emit('[WARNING] %s' %
|
||||||
_("The Cut Z parameter has positive value. "
|
_("The Cut Z parameter has positive value. "
|
||||||
"It is the depth value to drill into material.\n"
|
"It is the depth value to drill into material.\n"
|
||||||
"The Cut Z parameter needs to have a negative value, assuming it is a typo "
|
"The Cut Z parameter needs to have a negative value, "
|
||||||
|
"assuming it is a typo "
|
||||||
"therefore the app will convert the value to negative. "
|
"therefore the app will convert the value to negative. "
|
||||||
"Check the resulting CNC code (Gcode etc)."))
|
"Check the resulting CNC code (Gcode etc)."))
|
||||||
self.z_cut = -self.z_cut
|
self.z_cut = -self.z_cut
|
||||||
elif self.z_cut == 0:
|
elif self.z_cut == 0:
|
||||||
self.app.inform.emit('[WARNING] %s: %s' %
|
self.app.inform.emit('[WARNING] %s: %s' %
|
||||||
(_(
|
(_(
|
||||||
"The Cut Z parameter is zero. There will be no cut, skipping file"),
|
"The Cut Z parameter is zero. There will be no cut, "
|
||||||
|
"skipping file"),
|
||||||
exobj.options['name']))
|
exobj.options['name']))
|
||||||
return 'fail'
|
return 'fail'
|
||||||
|
|
||||||
|
|||||||
@@ -1924,6 +1924,12 @@ class FCCircle(FCShapeTool):
|
|||||||
self.steps_per_circ = self.draw_app.app.defaults["geometry_circle_steps"]
|
self.steps_per_circ = self.draw_app.app.defaults["geometry_circle_steps"]
|
||||||
|
|
||||||
def click(self, point):
|
def click(self, point):
|
||||||
|
try:
|
||||||
|
self.draw_app.app.jump_signal.disconnect()
|
||||||
|
except (TypeError, AttributeError):
|
||||||
|
pass
|
||||||
|
self.draw_app.app.jump_signal.connect(lambda x: self.draw_app.update_utility_geometry(data=x))
|
||||||
|
|
||||||
self.points.append(point)
|
self.points.append(point)
|
||||||
|
|
||||||
if len(self.points) == 1:
|
if len(self.points) == 1:
|
||||||
@@ -2003,6 +2009,12 @@ class FCArc(FCShapeTool):
|
|||||||
self.steps_per_circ = self.draw_app.app.defaults["geometry_circle_steps"]
|
self.steps_per_circ = self.draw_app.app.defaults["geometry_circle_steps"]
|
||||||
|
|
||||||
def click(self, point):
|
def click(self, point):
|
||||||
|
try:
|
||||||
|
self.draw_app.app.jump_signal.disconnect()
|
||||||
|
except (TypeError, AttributeError):
|
||||||
|
pass
|
||||||
|
self.draw_app.app.jump_signal.connect(lambda x: self.draw_app.update_utility_geometry(data=x))
|
||||||
|
|
||||||
self.points.append(point)
|
self.points.append(point)
|
||||||
|
|
||||||
if len(self.points) == 1:
|
if len(self.points) == 1:
|
||||||
@@ -2227,6 +2239,12 @@ class FCRectangle(FCShapeTool):
|
|||||||
self.draw_app.app.inform.emit(_("Click on 1st corner ..."))
|
self.draw_app.app.inform.emit(_("Click on 1st corner ..."))
|
||||||
|
|
||||||
def click(self, point):
|
def click(self, point):
|
||||||
|
try:
|
||||||
|
self.draw_app.app.jump_signal.disconnect()
|
||||||
|
except (TypeError, AttributeError):
|
||||||
|
pass
|
||||||
|
self.draw_app.app.jump_signal.connect(lambda x: self.draw_app.update_utility_geometry(data=x))
|
||||||
|
|
||||||
self.points.append(point)
|
self.points.append(point)
|
||||||
|
|
||||||
if len(self.points) == 1:
|
if len(self.points) == 1:
|
||||||
@@ -2294,6 +2312,12 @@ class FCPolygon(FCShapeTool):
|
|||||||
self.draw_app.app.inform.emit(_("Click on 1st corner ..."))
|
self.draw_app.app.inform.emit(_("Click on 1st corner ..."))
|
||||||
|
|
||||||
def click(self, point):
|
def click(self, point):
|
||||||
|
try:
|
||||||
|
self.draw_app.app.jump_signal.disconnect()
|
||||||
|
except (TypeError, AttributeError):
|
||||||
|
pass
|
||||||
|
self.draw_app.app.jump_signal.connect(lambda x: self.draw_app.update_utility_geometry(data=x))
|
||||||
|
|
||||||
self.draw_app.in_action = True
|
self.draw_app.in_action = True
|
||||||
self.points.append(point)
|
self.points.append(point)
|
||||||
|
|
||||||
@@ -2609,6 +2633,7 @@ class FCMove(FCShapeTool):
|
|||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
self.draw_app.app.inform.emit(_(" MOVE: Click on reference point ..."))
|
self.draw_app.app.inform.emit(_(" MOVE: Click on reference point ..."))
|
||||||
|
|
||||||
self.draw_app.app.jump_signal.connect(lambda x: self.draw_app.update_utility_geometry(data=x))
|
self.draw_app.app.jump_signal.connect(lambda x: self.draw_app.update_utility_geometry(data=x))
|
||||||
|
|
||||||
def set_origin(self, origin):
|
def set_origin(self, origin):
|
||||||
@@ -2616,6 +2641,12 @@ class FCMove(FCShapeTool):
|
|||||||
self.origin = origin
|
self.origin = origin
|
||||||
|
|
||||||
def click(self, point):
|
def click(self, point):
|
||||||
|
try:
|
||||||
|
self.draw_app.app.jump_signal.disconnect()
|
||||||
|
except (TypeError, AttributeError):
|
||||||
|
pass
|
||||||
|
self.draw_app.app.jump_signal.connect(lambda x: self.draw_app.update_utility_geometry(data=x))
|
||||||
|
|
||||||
if len(self.draw_app.get_selected()) == 0:
|
if len(self.draw_app.get_selected()) == 0:
|
||||||
# self.complete = True
|
# self.complete = True
|
||||||
# self.draw_app.app.inform.emit(_("[WARNING_NOTCL] Move cancelled. No shape selected."))
|
# self.draw_app.app.inform.emit(_("[WARNING_NOTCL] Move cancelled. No shape selected."))
|
||||||
@@ -2647,7 +2678,10 @@ class FCMove(FCShapeTool):
|
|||||||
self.draw_app.delete_selected()
|
self.draw_app.delete_selected()
|
||||||
self.complete = True
|
self.complete = True
|
||||||
self.draw_app.app.inform.emit('[success] %s' % _("Done. Geometry(s) Move completed."))
|
self.draw_app.app.inform.emit('[success] %s' % _("Done. Geometry(s) Move completed."))
|
||||||
self.draw_app.app.jump_signal.disconnect()
|
try:
|
||||||
|
self.draw_app.app.jump_signal.disconnect()
|
||||||
|
except TypeError:
|
||||||
|
pass
|
||||||
|
|
||||||
def selection_bbox(self):
|
def selection_bbox(self):
|
||||||
geo_list = []
|
geo_list = []
|
||||||
@@ -2777,7 +2811,10 @@ class FCCopy(FCMove):
|
|||||||
for geom in self.draw_app.get_selected()]
|
for geom in self.draw_app.get_selected()]
|
||||||
self.complete = True
|
self.complete = True
|
||||||
self.draw_app.app.inform.emit('[success] %s' % _("Done. Geometry(s) Copy completed."))
|
self.draw_app.app.inform.emit('[success] %s' % _("Done. Geometry(s) Copy completed."))
|
||||||
self.draw_app.app.jump_signal.disconnect()
|
try:
|
||||||
|
self.draw_app.app.jump_signal.disconnect()
|
||||||
|
except (TypeError, AttributeError):
|
||||||
|
pass
|
||||||
|
|
||||||
def clean_up(self):
|
def clean_up(self):
|
||||||
self.draw_app.selected = list()
|
self.draw_app.selected = list()
|
||||||
@@ -2812,6 +2849,12 @@ class FCText(FCShapeTool):
|
|||||||
self.draw_app.app.jump_signal.connect(lambda x: self.draw_app.update_utility_geometry(data=x))
|
self.draw_app.app.jump_signal.connect(lambda x: self.draw_app.update_utility_geometry(data=x))
|
||||||
|
|
||||||
def click(self, point):
|
def click(self, point):
|
||||||
|
try:
|
||||||
|
self.draw_app.app.jump_signal.disconnect()
|
||||||
|
except (TypeError, AttributeError):
|
||||||
|
pass
|
||||||
|
self.draw_app.app.jump_signal.connect(lambda x: self.draw_app.update_utility_geometry(data=x))
|
||||||
|
|
||||||
# Create new geometry
|
# Create new geometry
|
||||||
dx = point[0]
|
dx = point[0]
|
||||||
dy = point[1]
|
dy = point[1]
|
||||||
@@ -2831,7 +2874,10 @@ class FCText(FCShapeTool):
|
|||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
self.draw_app.app.inform.emit('[WARNING_NOTCL] %s' % _("No text to add."))
|
self.draw_app.app.inform.emit('[WARNING_NOTCL] %s' % _("No text to add."))
|
||||||
self.draw_app.app.jump_signal.disconnect()
|
try:
|
||||||
|
self.draw_app.app.jump_signal.disconnect()
|
||||||
|
except (TypeError, AttributeError):
|
||||||
|
pass
|
||||||
return
|
return
|
||||||
|
|
||||||
self.text_gui.text_path = []
|
self.text_gui.text_path = []
|
||||||
@@ -2909,13 +2955,11 @@ class FCBuffer(FCShapeTool):
|
|||||||
self.disactivate()
|
self.disactivate()
|
||||||
if ret_val == 'fail':
|
if ret_val == 'fail':
|
||||||
return
|
return
|
||||||
self.draw_app.app.inform.emit('[success] %s' %
|
self.draw_app.app.inform.emit('[success] %s' % _("Done. Buffer Tool completed."))
|
||||||
_("Done. Buffer Tool completed."))
|
|
||||||
|
|
||||||
def on_buffer_int(self):
|
def on_buffer_int(self):
|
||||||
if not self.draw_app.selected:
|
if not self.draw_app.selected:
|
||||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Buffer cancelled. No shape selected."))
|
||||||
_("Buffer cancelled. No shape selected."))
|
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -2939,13 +2983,11 @@ class FCBuffer(FCShapeTool):
|
|||||||
self.disactivate()
|
self.disactivate()
|
||||||
if ret_val == 'fail':
|
if ret_val == 'fail':
|
||||||
return
|
return
|
||||||
self.draw_app.app.inform.emit('[success] %s' %
|
self.draw_app.app.inform.emit('[success] %s' % _("Done. Buffer Int Tool completed."))
|
||||||
_("Done. Buffer Int Tool completed."))
|
|
||||||
|
|
||||||
def on_buffer_ext(self):
|
def on_buffer_ext(self):
|
||||||
if not self.draw_app.selected:
|
if not self.draw_app.selected:
|
||||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Buffer cancelled. No shape selected."))
|
||||||
_("Buffer cancelled. No shape selected."))
|
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -2969,8 +3011,7 @@ class FCBuffer(FCShapeTool):
|
|||||||
self.disactivate()
|
self.disactivate()
|
||||||
if ret_val == 'fail':
|
if ret_val == 'fail':
|
||||||
return
|
return
|
||||||
self.draw_app.app.inform.emit('[success] %s' %
|
self.draw_app.app.inform.emit('[success] %s' % _("Done. Buffer Ext Tool completed."))
|
||||||
_("Done. Buffer Ext Tool completed."))
|
|
||||||
|
|
||||||
def activate(self):
|
def activate(self):
|
||||||
self.buff_tool.buffer_button.clicked.disconnect()
|
self.buff_tool.buffer_button.clicked.disconnect()
|
||||||
@@ -2992,6 +3033,10 @@ class FCBuffer(FCShapeTool):
|
|||||||
self.complete = True
|
self.complete = True
|
||||||
self.draw_app.select_tool("select")
|
self.draw_app.select_tool("select")
|
||||||
self.buff_tool.hide_tool()
|
self.buff_tool.hide_tool()
|
||||||
|
try:
|
||||||
|
self.draw_app.app.jump_signal.disconnect()
|
||||||
|
except (TypeError, AttributeError):
|
||||||
|
pass
|
||||||
|
|
||||||
def clean_up(self):
|
def clean_up(self):
|
||||||
self.draw_app.selected = list()
|
self.draw_app.selected = list()
|
||||||
@@ -3003,7 +3048,6 @@ class FCBuffer(FCShapeTool):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class FCEraser(FCShapeTool):
|
class FCEraser(FCShapeTool):
|
||||||
def __init__(self, draw_app):
|
def __init__(self, draw_app):
|
||||||
DrawTool.__init__(self, draw_app)
|
DrawTool.__init__(self, draw_app)
|
||||||
@@ -3031,6 +3075,12 @@ class FCEraser(FCShapeTool):
|
|||||||
self.origin = origin
|
self.origin = origin
|
||||||
|
|
||||||
def click(self, point):
|
def click(self, point):
|
||||||
|
try:
|
||||||
|
self.draw_app.app.jump_signal.disconnect()
|
||||||
|
except (TypeError, AttributeError):
|
||||||
|
pass
|
||||||
|
self.draw_app.app.jump_signal.connect(lambda x: self.draw_app.update_utility_geometry(data=x))
|
||||||
|
|
||||||
if len(self.draw_app.get_selected()) == 0:
|
if len(self.draw_app.get_selected()) == 0:
|
||||||
for obj_shape in self.storage.get_objects():
|
for obj_shape in self.storage.get_objects():
|
||||||
try:
|
try:
|
||||||
@@ -3078,7 +3128,10 @@ class FCEraser(FCShapeTool):
|
|||||||
self.draw_app.delete_utility_geometry()
|
self.draw_app.delete_utility_geometry()
|
||||||
self.draw_app.plot_all()
|
self.draw_app.plot_all()
|
||||||
self.draw_app.app.inform.emit('[success] %s' % _("Done. Eraser tool action completed."))
|
self.draw_app.app.inform.emit('[success] %s' % _("Done. Eraser tool action completed."))
|
||||||
self.draw_app.app.jump_signal.disconnect()
|
try:
|
||||||
|
self.draw_app.app.jump_signal.disconnect()
|
||||||
|
except (TypeError, AttributeError):
|
||||||
|
pass
|
||||||
|
|
||||||
def utility_geometry(self, data=None):
|
def utility_geometry(self, data=None):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user