- some small changes in the Scale button handler in FlatCAMObj() class
This commit is contained in:
parent
f88db33ada
commit
b429f9b0c8
|
@ -268,9 +268,19 @@ class FlatCAMObj(QtCore.QObject):
|
||||||
|
|
||||||
def on_scale_button_click(self):
|
def on_scale_button_click(self):
|
||||||
self.read_form()
|
self.read_form()
|
||||||
factor = eval(self.ui.scale_entry.get_value())
|
try:
|
||||||
|
factor = float(eval(self.ui.scale_entry.get_value()))
|
||||||
|
except Exception as e:
|
||||||
|
self.app.inform.emit('[ERROR_NOTCL] %s' % _("Scaling could not be executed."))
|
||||||
|
log.debug("FlatCAMObj.on_scale_button_click() -- %s" % str(e))
|
||||||
|
return
|
||||||
|
|
||||||
|
if type(factor) != float:
|
||||||
|
self.app.inform.emit('[ERROR_NOTCL] %s' % _("Scaling could not be executed."))
|
||||||
|
|
||||||
# if factor is 1.0 do nothing, there is no point in scaling with a factor of 1.0
|
# if factor is 1.0 do nothing, there is no point in scaling with a factor of 1.0
|
||||||
if factor == 1.0:
|
if factor == 1.0:
|
||||||
|
self.app.inform.emit('[success] %s' % _("Scale done."))
|
||||||
return
|
return
|
||||||
|
|
||||||
log.debug("FlatCAMObj.on_scale_button_click()")
|
log.debug("FlatCAMObj.on_scale_button_click()")
|
||||||
|
@ -278,6 +288,8 @@ class FlatCAMObj(QtCore.QObject):
|
||||||
def worker_task():
|
def worker_task():
|
||||||
with self.app.proc_container.new(_("Scaling...")):
|
with self.app.proc_container.new(_("Scaling...")):
|
||||||
self.scale(factor)
|
self.scale(factor)
|
||||||
|
self.app.inform.emit('[success] %s' % _("Scale done."))
|
||||||
|
|
||||||
self.app.proc_container.update_view_text('')
|
self.app.proc_container.update_view_text('')
|
||||||
with self.app.proc_container.new('%s...' % _("Plotting")):
|
with self.app.proc_container.new('%s...' % _("Plotting")):
|
||||||
self.plot()
|
self.plot()
|
||||||
|
|
|
@ -13,6 +13,7 @@ CAD program, and create G-Code for Isolation routing.
|
||||||
|
|
||||||
- finished the Calibration Tool
|
- finished the Calibration Tool
|
||||||
- changed the Scale Entry in Object UI to FCEntry() GUI element in order to allow expressions to be entered. E.g: 1/25.4
|
- changed the Scale Entry in Object UI to FCEntry() GUI element in order to allow expressions to be entered. E.g: 1/25.4
|
||||||
|
- some small changes in the Scale button handler in FlatCAMObj() class
|
||||||
|
|
||||||
11.12.2019
|
11.12.2019
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue