- made the Distance Tool display the angle in values between 0 and 359.9999 degrees
- changed some strings
This commit is contained in:
@@ -511,12 +511,13 @@ class Distance(AppTool):
|
||||
self.distance_x_entry.set_value('%.*f' % (self.decimals, abs(dx)))
|
||||
self.distance_y_entry.set_value('%.*f' % (self.decimals, abs(dy)))
|
||||
|
||||
if dx != 0.0:
|
||||
try:
|
||||
angle = math.degrees(math.atan(dy / dx))
|
||||
self.angle_entry.set_value('%.*f' % (self.decimals, angle))
|
||||
except Exception:
|
||||
pass
|
||||
try:
|
||||
angle = math.degrees(math.atan2(dy, dx))
|
||||
if angle < 0:
|
||||
angle += 360
|
||||
self.angle_entry.set_value('%.*f' % (self.decimals, angle))
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
self.total_distance_entry.set_value('%.*f' % (self.decimals, abs(d)))
|
||||
# self.app.ui.rel_position_label.setText(
|
||||
@@ -582,13 +583,14 @@ class Distance(AppTool):
|
||||
if len(self.points) == 1:
|
||||
self.utility_geometry(pos=pos)
|
||||
# and display the temporary angle
|
||||
if dx != 0.0:
|
||||
try:
|
||||
angle = math.degrees(math.atan(dy / dx))
|
||||
self.angle_entry.set_value('%.*f' % (self.decimals, angle))
|
||||
except Exception as e:
|
||||
log.debug("Distance.on_mouse_move_meas() -> update utility geometry -> %s" % str(e))
|
||||
pass
|
||||
try:
|
||||
angle = math.degrees(math.atan2(dy, dx))
|
||||
if angle < 0:
|
||||
angle += 360
|
||||
self.angle_entry.set_value('%.*f' % (self.decimals, angle))
|
||||
except Exception as e:
|
||||
log.debug("Distance.on_mouse_move_meas() -> update utility geometry -> %s" % str(e))
|
||||
pass
|
||||
|
||||
except Exception as e:
|
||||
log.debug("Distance.on_mouse_move_meas() --> %s" % str(e))
|
||||
|
||||
@@ -1497,11 +1497,10 @@ class SolderPaste(AppTool):
|
||||
)
|
||||
except TypeError:
|
||||
filename, _f = FCFileSaveDialog.get_saved_filename(
|
||||
caption=_("Export Machine Code ..."), ext_filter=_filter_)
|
||||
caption=_("Export Code ..."), ext_filter=_filter_)
|
||||
|
||||
if filename == '':
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' %
|
||||
_("Export Machine Code cancelled ..."))
|
||||
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Export cancelled ..."))
|
||||
return
|
||||
|
||||
gcode = '(G-CODE GENERATED BY FLATCAM v%s - www.flatcam.org - Version Date: %s)\n' % \
|
||||
|
||||
Reference in New Issue
Block a user