- made the Distance Tool display the angle in values between 0 and 359.9999 degrees

- changed some strings
This commit is contained in:
Marius Stanciu
2020-06-01 01:21:53 +03:00
committed by Marius
parent 8eee9a9dcf
commit 440d0dde02
12 changed files with 44 additions and 39 deletions

View File

@@ -315,7 +315,7 @@ class ToolsDB(QtWidgets.QWidget):
self.app.inform.emit('[ERROR] %s' % _("Failed to parse Tools DB file.")) self.app.inform.emit('[ERROR] %s' % _("Failed to parse Tools DB file."))
return return
self.app.inform.emit('[success] %s: %s' % (_("Loaded FlatCAM Tools DB from"), filename)) self.app.inform.emit('[success] %s: %s' % (_("Loaded Tools DB from"), filename))
self.build_db_ui() self.build_db_ui()
@@ -726,7 +726,7 @@ class ToolsDB(QtWidgets.QWidget):
self.app.inform.emit('[ERROR] %s' % _("Failed to parse Tools DB file.")) self.app.inform.emit('[ERROR] %s' % _("Failed to parse Tools DB file."))
return return
self.app.inform.emit('[success] %s: %s' % (_("Loaded FlatCAM Tools DB from"), filename)) self.app.inform.emit('[success] %s: %s' % (_("Loaded Tools DB from"), filename))
self.build_db_ui() self.build_db_ui()
self.callback_on_edited() self.callback_on_edited()
@@ -2034,7 +2034,7 @@ class ToolsDB2(QtWidgets.QWidget):
self.app.inform.emit('[ERROR] %s' % _("Failed to parse Tools DB file.")) self.app.inform.emit('[ERROR] %s' % _("Failed to parse Tools DB file."))
return return
self.app.inform.emit('[success] %s: %s' % (_("Loaded FlatCAM Tools DB from"), filename)) self.app.inform.emit('[success] %s: %s' % (_("Loaded Tools DB from"), filename))
self.build_db_ui() self.build_db_ui()
@@ -2323,7 +2323,7 @@ class ToolsDB2(QtWidgets.QWidget):
self.app.inform.emit('[ERROR] %s' % _("Failed to parse Tools DB file.")) self.app.inform.emit('[ERROR] %s' % _("Failed to parse Tools DB file."))
return return
self.app.inform.emit('[success] %s: %s' % (_("Loaded FlatCAM Tools DB from"), filename)) self.app.inform.emit('[success] %s: %s' % (_("Loaded Tools DB from"), filename))
self.build_db_ui() self.build_db_ui()
self.update_storage() self.update_storage()

View File

@@ -35,7 +35,7 @@ class ObjectUI(QtWidgets.QWidget):
put UI elements in ObjectUI.custom_box (QtWidgets.QLayout). put UI elements in ObjectUI.custom_box (QtWidgets.QLayout).
""" """
def __init__(self, app, icon_file='assets/resources/flatcam_icon32.png', title=_('FlatCAM Object'), def __init__(self, app, icon_file='assets/resources/flatcam_icon32.png', title=_('App Object'),
parent=None, common=True): parent=None, common=True):
QtWidgets.QWidget.__init__(self, parent=parent) QtWidgets.QWidget.__init__(self, parent=parent)

View File

@@ -35,7 +35,7 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
# Theme selection # Theme selection
self.theme_label = QtWidgets.QLabel('%s:' % _('Theme')) self.theme_label = QtWidgets.QLabel('%s:' % _('Theme'))
self.theme_label.setToolTip( self.theme_label.setToolTip(
_("Select a theme for FlatCAM.\n" _("Select a theme for the application.\n"
"It will theme the plot area.") "It will theme the plot area.")
) )
@@ -72,7 +72,7 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
# Layout selection # Layout selection
self.layout_label = QtWidgets.QLabel('%s:' % _('Layout')) self.layout_label = QtWidgets.QLabel('%s:' % _('Layout'))
self.layout_label.setToolTip( self.layout_label.setToolTip(
_("Select an layout for FlatCAM.\n" _("Select an layout for the application.\n"
"It is applied immediately.") "It is applied immediately.")
) )
self.layout_combo = FCComboBox() self.layout_combo = FCComboBox()
@@ -94,7 +94,7 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
# Style selection # Style selection
self.style_label = QtWidgets.QLabel('%s:' % _('Style')) self.style_label = QtWidgets.QLabel('%s:' % _('Style'))
self.style_label.setToolTip( self.style_label.setToolTip(
_("Select an style for FlatCAM.\n" _("Select an style for the application.\n"
"It will be applied at the next app start.") "It will be applied at the next app start.")
) )
self.style_combo = FCComboBox() self.style_combo = FCComboBox()
@@ -110,7 +110,7 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
# Enable High DPI Support # Enable High DPI Support
self.hdpi_cb = FCCheckBox('%s' % _('Activate HDPI Support')) self.hdpi_cb = FCCheckBox('%s' % _('Activate HDPI Support'))
self.hdpi_cb.setToolTip( self.hdpi_cb.setToolTip(
_("Enable High DPI support for FlatCAM.\n" _("Enable High DPI support for the application.\n"
"It will be applied at the next app start.") "It will be applied at the next app start.")
) )
@@ -126,7 +126,7 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
# Enable Hover box # Enable Hover box
self.hover_cb = FCCheckBox('%s' % _('Display Hover Shape')) self.hover_cb = FCCheckBox('%s' % _('Display Hover Shape'))
self.hover_cb.setToolTip( self.hover_cb.setToolTip(
_("Enable display of a hover shape for FlatCAM objects.\n" _("Enable display of a hover shape for the application objects.\n"
"It is displayed whenever the mouse cursor is hovering\n" "It is displayed whenever the mouse cursor is hovering\n"
"over any kind of not-selected object.") "over any kind of not-selected object.")
) )
@@ -135,7 +135,7 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
# Enable Selection box # Enable Selection box
self.selection_cb = FCCheckBox('%s' % _('Display Selection Shape')) self.selection_cb = FCCheckBox('%s' % _('Display Selection Shape'))
self.selection_cb.setToolTip( self.selection_cb.setToolTip(
_("Enable the display of a selection shape for FlatCAM objects.\n" _("Enable the display of a selection shape for the application objects.\n"
"It is displayed whenever the mouse selects an object\n" "It is displayed whenever the mouse selects an object\n"
"either by clicking or dragging mouse from left to right or\n" "either by clicking or dragging mouse from left to right or\n"
"right to left.") "right to left.")

View File

@@ -30,8 +30,7 @@ class ToolsFilmPrefGroupUI(OptionsGroupUI):
# ## Parameters # ## Parameters
self.film_label = QtWidgets.QLabel("<b>%s:</b>" % _("Parameters")) self.film_label = QtWidgets.QLabel("<b>%s:</b>" % _("Parameters"))
self.film_label.setToolTip( self.film_label.setToolTip(
_("Create a PCB film from a Gerber or Geometry\n" _("Create a PCB film from a Gerber or Geometry object.\n"
"FlatCAM object.\n"
"The file is saved in SVG format.") "The file is saved in SVG format.")
) )
self.layout.addWidget(self.film_label) self.layout.addWidget(self.film_label)

View File

@@ -105,7 +105,7 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI):
cutzlabel = QtWidgets.QLabel('%s:' % _('Cut Z')) cutzlabel = QtWidgets.QLabel('%s:' % _('Cut Z'))
cutzlabel.setToolTip( cutzlabel.setToolTip(
_("Depth of cut into material. Negative value.\n" _("Depth of cut into material. Negative value.\n"
"In FlatCAM units.") "In application units.")
) )
self.cutz_entry = FCDoubleSpinner() self.cutz_entry = FCDoubleSpinner()
self.cutz_entry.set_precision(self.decimals) self.cutz_entry.set_precision(self.decimals)
@@ -114,7 +114,7 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI):
self.cutz_entry.setToolTip( self.cutz_entry.setToolTip(
_("Depth of cut into material. Negative value.\n" _("Depth of cut into material. Negative value.\n"
"In FlatCAM units.") "In application units.")
) )
grid0.addWidget(cutzlabel, 4, 0) grid0.addWidget(cutzlabel, 4, 0)
grid0.addWidget(self.cutz_entry, 4, 1) grid0.addWidget(self.cutz_entry, 4, 1)

View File

@@ -31,7 +31,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI):
self.transform_label = QtWidgets.QLabel("<b>%s:</b>" % _("Parameters")) self.transform_label = QtWidgets.QLabel("<b>%s:</b>" % _("Parameters"))
self.transform_label.setToolTip( self.transform_label.setToolTip(
_("Various transformations that can be applied\n" _("Various transformations that can be applied\n"
"on a FlatCAM object.") "on a application object.")
) )
self.layout.addWidget(self.transform_label) self.layout.addWidget(self.transform_label)

View File

@@ -504,17 +504,17 @@ class CNCJobObject(FlatCAMObj, CNCjob):
try: try:
dir_file_to_save = self.app.get_last_save_folder() + '/' + str(name) dir_file_to_save = self.app.get_last_save_folder() + '/' + str(name)
filename, _f = FCFileSaveDialog.get_saved_filename( filename, _f = FCFileSaveDialog.get_saved_filename(
caption=_("Export Machine Code ..."), caption=_("Export Code ..."),
directory=dir_file_to_save, directory=dir_file_to_save,
ext_filter=_filter_ ext_filter=_filter_
) )
except TypeError: except TypeError:
filename, _f = FCFileSaveDialog.get_saved_filename(caption=_("Export Machine Code ..."), ext_filter=_filter_) filename, _f = FCFileSaveDialog.get_saved_filename(caption=_("Export Code ..."), ext_filter=_filter_)
filename = str(filename) filename = str(filename)
if filename == '': if filename == '':
self.app.inform.emit('[WARNING_NOTCL] %s' % _("Export Machine Code cancelled ...")) self.app.inform.emit('[WARNING_NOTCL] %s' % _("Export cancelled ..."))
return return
else: else:
if save_gcode is True: if save_gcode is True:

View File

@@ -139,7 +139,7 @@ class FlatCAMObj(QtCore.QObject):
except KeyError: except KeyError:
log.debug("FlatCAMObj.from_dict() --> KeyError: %s. " log.debug("FlatCAMObj.from_dict() --> KeyError: %s. "
"Means that we are loading an old project that don't" "Means that we are loading an old project that don't"
"have all attributes in the latest FlatCAM." % str(attr)) "have all attributes in the latest application version." % str(attr))
pass pass
def on_options_change(self, key): def on_options_change(self, key):

View File

@@ -511,12 +511,13 @@ class Distance(AppTool):
self.distance_x_entry.set_value('%.*f' % (self.decimals, abs(dx))) self.distance_x_entry.set_value('%.*f' % (self.decimals, abs(dx)))
self.distance_y_entry.set_value('%.*f' % (self.decimals, abs(dy))) self.distance_y_entry.set_value('%.*f' % (self.decimals, abs(dy)))
if dx != 0.0: try:
try: angle = math.degrees(math.atan2(dy, dx))
angle = math.degrees(math.atan(dy / dx)) if angle < 0:
self.angle_entry.set_value('%.*f' % (self.decimals, angle)) angle += 360
except Exception: self.angle_entry.set_value('%.*f' % (self.decimals, angle))
pass except Exception:
pass
self.total_distance_entry.set_value('%.*f' % (self.decimals, abs(d))) self.total_distance_entry.set_value('%.*f' % (self.decimals, abs(d)))
# self.app.ui.rel_position_label.setText( # self.app.ui.rel_position_label.setText(
@@ -582,13 +583,14 @@ class Distance(AppTool):
if len(self.points) == 1: if len(self.points) == 1:
self.utility_geometry(pos=pos) self.utility_geometry(pos=pos)
# and display the temporary angle # and display the temporary angle
if dx != 0.0: try:
try: angle = math.degrees(math.atan2(dy, dx))
angle = math.degrees(math.atan(dy / dx)) if angle < 0:
self.angle_entry.set_value('%.*f' % (self.decimals, angle)) angle += 360
except Exception as e: self.angle_entry.set_value('%.*f' % (self.decimals, angle))
log.debug("Distance.on_mouse_move_meas() -> update utility geometry -> %s" % str(e)) except Exception as e:
pass log.debug("Distance.on_mouse_move_meas() -> update utility geometry -> %s" % str(e))
pass
except Exception as e: except Exception as e:
log.debug("Distance.on_mouse_move_meas() --> %s" % str(e)) log.debug("Distance.on_mouse_move_meas() --> %s" % str(e))

View File

@@ -1497,11 +1497,10 @@ class SolderPaste(AppTool):
) )
except TypeError: except TypeError:
filename, _f = FCFileSaveDialog.get_saved_filename( filename, _f = FCFileSaveDialog.get_saved_filename(
caption=_("Export Machine Code ..."), ext_filter=_filter_) caption=_("Export Code ..."), ext_filter=_filter_)
if filename == '': if filename == '':
self.app.inform.emit('[WARNING_NOTCL] %s' % self.app.inform.emit('[WARNING_NOTCL] %s' % _("Export cancelled ..."))
_("Export Machine Code cancelled ..."))
return return
gcode = '(G-CODE GENERATED BY FLATCAM v%s - www.flatcam.org - Version Date: %s)\n' % \ gcode = '(G-CODE GENERATED BY FLATCAM v%s - www.flatcam.org - Version Date: %s)\n' % \

View File

@@ -287,8 +287,8 @@ class BookmarkManager(QtWidgets.QWidget):
date = date.replace(' ', '_') date = date.replace(' ', '_')
filter__ = "Text File (*.TXT);;All Files (*.*)" filter__ = "Text File (*.TXT);;All Files (*.*)"
filename, _f = FCFileSaveDialog.get_saved_filename(caption=_("Export FlatCAM Bookmarks"), filename, _f = FCFileSaveDialog.get_saved_filename(caption=_("Export Bookmarks"),
directory='{l_save}/FlatCAM_{n}_{date}'.format( directory='{l_save}/{n}_{date}'.format(
l_save=str(self.app.get_last_save_folder()), l_save=str(self.app.get_last_save_folder()),
n=_("Bookmarks"), n=_("Bookmarks"),
date=date), date=date),
@@ -334,7 +334,7 @@ class BookmarkManager(QtWidgets.QWidget):
self.app.log.debug("on_import_bookmarks()") self.app.log.debug("on_import_bookmarks()")
filter_ = "Text File (*.txt);;All Files (*.*)" filter_ = "Text File (*.txt);;All Files (*.*)"
filename, _f = QtWidgets.QFileDialog.getOpenFileName(caption=_("Import FlatCAM Bookmarks"), filter=filter_) filename, _f = QtWidgets.QFileDialog.getOpenFileName(caption=_("Import Bookmarks"), filter=filter_)
filename = str(filename) filename = str(filename)

View File

@@ -7,6 +7,11 @@ CHANGELOG for FlatCAM beta
================================================= =================================================
1.06.2020
- made the Distance Tool display the angle in values between 0 and 359.9999 degrees
- changed some strings
31.05.2020 31.05.2020
- structural changes in Preferences from David Robertson - structural changes in Preferences from David Robertson