diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e1866d9..39b42859 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ CHANGELOG for FlatCAM beta - fix issue in Legacy2D graphic mode where the snap function was not accessible when the PlotCanvasLegacy class was created - modified the HUD in Legacy2D when using Dark Theme to use different colors - modified how the graphic engine change act in Preferences: now only by clicking Apply(or Save) the change will happen. And there is also a message asking for confirmation +- re-added the position labels in the status bar; they will be useful if HUD is Off (Altium does the same :) so learn from the best) 10.05.2020 diff --git a/FlatCAMApp.py b/FlatCAMApp.py index c0007c80..e551d704 100644 --- a/FlatCAMApp.py +++ b/FlatCAMApp.py @@ -3480,7 +3480,7 @@ class App(QtCore.QObject): # delete the absolute and relative position and messages in the infobar self.ui.position_label.setText("") - self.ui.rel_position_label.setText("") + # self.ui.rel_position_label.setText("") # Switch plot_area to preferences page self.ui.plot_tab_area.setCurrentWidget(self.book_dialog_tab) @@ -5386,8 +5386,8 @@ class App(QtCore.QObject): # Set the relative position label dx = location[0] - float(self.rel_point1[0]) dy = location[1] - float(self.rel_point1[1]) - # self.ui.position_label.setText("    X: %.4f   " - # "Y: %.4f" % (location[0], location[1])) + self.ui.position_label.setText(" X: %.4f   " + "Y: %.4f " % (location[0], location[1])) # # Set the position label # # self.ui.rel_position_label.setText("Dx: %.4f   Dy: " @@ -5542,8 +5542,8 @@ class App(QtCore.QObject): self.dx = location[0] - float(self.rel_point1[0]) self.dy = location[1] - float(self.rel_point1[1]) # Set the position label - # self.ui.position_label.setText("    X: %.4f   " - # "Y: %.4f" % (location[0], location[1])) + self.ui.position_label.setText(" X: %.4f   " + "Y: %.4f " % (location[0], location[1])) # self.ui.rel_position_label.setText("Dx: %.4f   Dy: " # "%.4f    " % (self.dx, self.dy)) @@ -5859,7 +5859,7 @@ class App(QtCore.QObject): self.ui.plot_tab_area.addTab(self.ui.preferences_tab, _("Preferences")) # delete the absolute and relative position and messages in the infobar - # self.ui.position_label.setText("") + self.ui.position_label.setText("") # self.ui.rel_position_label.setText("") # Switch plot_area to preferences page @@ -5957,7 +5957,7 @@ class App(QtCore.QObject): # delete the absolute and relative position and messages in the infobar self.ui.position_label.setText("") - self.ui.rel_position_label.setText("") + # self.ui.rel_position_label.setText("") # Switch plot_area to preferences page self.ui.plot_tab_area.setCurrentWidget(self.tools_db_tab) @@ -6623,7 +6623,7 @@ class App(QtCore.QObject): # delete the absolute and relative position and messages in the infobar self.ui.position_label.setText("") - self.ui.rel_position_label.setText("") + # self.ui.rel_position_label.setText("") # Switch plot_area to preferences page self.ui.plot_tab_area.setCurrentWidget(self.ui.shortcuts_tab) @@ -6771,8 +6771,8 @@ class App(QtCore.QObject): self.dx = pos[0] - float(self.rel_point1[0]) self.dy = pos[1] - float(self.rel_point1[1]) - # self.ui.position_label.setText("    X: %.4f   " - # "Y: %.4f" % (pos[0], pos[1])) + self.ui.position_label.setText(" X: %.4f   " + "Y: %.4f " % (pos[0], pos[1])) # self.ui.rel_position_label.setText("Dx: %.4f   Dy: " # "%.4f    " % (self.dx, self.dy)) @@ -6831,7 +6831,7 @@ class App(QtCore.QObject): except Exception as e: log.debug("App.on_mouse_move_over_plot() - rel_point1 is not None -> %s" % str(e)) - # self.ui.position_label.setText("") + self.ui.position_label.setText("") # self.ui.rel_position_label.setText("") self.mouse = None @@ -8142,7 +8142,7 @@ class App(QtCore.QObject): # delete the absolute and relative position and messages in the infobar self.ui.position_label.setText("") - self.ui.rel_position_label.setText("") + # self.ui.rel_position_label.setText("") # first clear previous text in text editor (if any) self.text_editor_tab.code_editor.clear() @@ -8193,7 +8193,7 @@ class App(QtCore.QObject): # delete the absolute and relative position and messages in the infobar self.ui.position_label.setText("") - self.ui.rel_position_label.setText("") + # self.ui.rel_position_label.setText("") # first clear previous text in text editor (if any) self.source_editor_tab.code_editor.clear() @@ -8317,7 +8317,7 @@ class App(QtCore.QObject): # delete the absolute and relative position and messages in the infobar self.ui.position_label.setText("") - self.ui.rel_position_label.setText("") + # self.ui.rel_position_label.setText("") self.new_script_object() diff --git a/FlatCAMCommon.py b/FlatCAMCommon.py index ea6c3f78..f7bfae9e 100644 --- a/FlatCAMCommon.py +++ b/FlatCAMCommon.py @@ -471,8 +471,8 @@ class ExclusionAreas(QtCore.QObject): self.app.dx = curr_pos[0] - float(self.cursor_pos[0]) self.app.dy = curr_pos[1] - float(self.cursor_pos[1]) - # self.app.ui.position_label.setText("    X: %.4f   " - # "Y: %.4f" % (curr_pos[0], curr_pos[1])) + self.app.ui.position_label.setText(" X: %.4f   " + "Y: %.4f " % (curr_pos[0], curr_pos[1])) # self.app.ui.rel_position_label.setText("Dx: %.4f   Dy: " # "%.4f    " % (self.app.dx, self.app.dy)) diff --git a/Utils/vispy_example.py b/Utils/vispy_example.py index a9eaee12..980d2b10 100644 --- a/Utils/vispy_example.py +++ b/Utils/vispy_example.py @@ -182,7 +182,7 @@ class MyApp(QtCore.QObject): # we don't need all the info in the tuple returned by the translate_coords() # only first 2 elements pos_canvas = [pos_canvas[0], pos_canvas[1]] - # self.ui.position_label.setText("Position: X: %.4f\tY: %.4f" % (pos_canvas[0], pos_canvas[1])) + self.ui.position_label.setText("Position: X: %.4f\tY: %.4f" % (pos_canvas[0], pos_canvas[1])) # pos_text = 'Coordinates: \nX: {:<7.4f}\nY: {:<7.4f}'.format(pos_canvas[0], pos_canvas[1]) pos_text = 'Coordinates: \nX: {:<.4f}\nY: {:<.4f}'.format(pos_canvas[0], pos_canvas[1]) self.plot.vispy_canvas.text.text = pos_text diff --git a/flatcamEditors/FlatCAMExcEditor.py b/flatcamEditors/FlatCAMExcEditor.py index e77d0928..cbcd55b8 100644 --- a/flatcamEditors/FlatCAMExcEditor.py +++ b/flatcamEditors/FlatCAMExcEditor.py @@ -3782,8 +3782,8 @@ class FlatCAMExcEditor(QtCore.QObject): self.app.dy = y - self.pos[1] # # update the position label in the infobar since the APP mouse event handlers are disconnected - # self.app.ui.position_label.setText("    X: %.4f   " - # "Y: %.4f" % (x, y)) + self.app.ui.position_label.setText(" X: %.4f   " + "Y: %.4f " % (x, y)) # # update the reference position label in the infobar since the APP mouse event handlers are disconnected # self.app.ui.rel_position_label.setText("Dx: %.4f   Dy: " # "%.4f    " % (self.app.dx, self.app.dy)) diff --git a/flatcamEditors/FlatCAMGeoEditor.py b/flatcamEditors/FlatCAMGeoEditor.py index 6e4b616b..c8ded16a 100644 --- a/flatcamEditors/FlatCAMGeoEditor.py +++ b/flatcamEditors/FlatCAMGeoEditor.py @@ -4255,8 +4255,8 @@ class FlatCAMGeoEditor(QtCore.QObject): self.app.dy = y - self.pos[1] # # update the position label in the infobar since the APP mouse event handlers are disconnected - # self.app.ui.position_label.setText("    X: %.4f   " - # "Y: %.4f" % (x, y)) + self.app.ui.position_label.setText(" X: %.4f   " + "Y: %.4f " % (x, y)) # # # update the reference position label in the infobar since the APP mouse event handlers are disconnected # self.app.ui.rel_position_label.setText("Dx: %.4f   Dy: " diff --git a/flatcamEditors/FlatCAMGrbEditor.py b/flatcamEditors/FlatCAMGrbEditor.py index 0658926b..bd330d40 100644 --- a/flatcamEditors/FlatCAMGrbEditor.py +++ b/flatcamEditors/FlatCAMGrbEditor.py @@ -4755,8 +4755,8 @@ class FlatCAMGrbEditor(QtCore.QObject): self.app.dy = y - self.pos[1] # # update the position label in the infobar since the APP mouse event handlers are disconnected - # self.app.ui.position_label.setText("    X: %.4f   " - # "Y: %.4f" % (x, y)) + self.app.ui.position_label.setText(" X: %.4f   " + "Y: %.4f " % (x, y)) # # # update the reference position label in the infobar since the APP mouse event handlers are disconnected # self.app.ui.rel_position_label.setText("Dx: %.4f   Dy: " diff --git a/flatcamGUI/FlatCAMGUI.py b/flatcamGUI/FlatCAMGUI.py index 08821168..078f8f9d 100644 --- a/flatcamGUI/FlatCAMGUI.py +++ b/flatcamGUI/FlatCAMGUI.py @@ -2309,11 +2309,11 @@ class FlatCAMGUI(QtWidgets.QMainWindow): # self.rel_position_label.setToolTip(_("Relative measurement.\nReference is last click position")) # self.infobar.addWidget(self.rel_position_label) # - # self.position_label = QtWidgets.QLabel( - # "    X: 0.0000   Y: 0.0000") - # self.position_label.setMinimumWidth(110) - # self.position_label.setToolTip(_("Absolute measurement.\nReference is (X=0, Y= 0) position")) - # self.infobar.addWidget(self.position_label) + self.position_label = QtWidgets.QLabel( + " X: 0.0000   Y: 0.0000 ") + self.position_label.setMinimumWidth(110) + self.position_label.setToolTip(_("Absolute measurement.\nReference is (X=0, Y= 0) position")) + self.infobar.addWidget(self.position_label) self.snap_toolbar.setMaximumHeight(24) self.infobar.addWidget(self.snap_toolbar) diff --git a/flatcamObjects/FlatCAMCNCJob.py b/flatcamObjects/FlatCAMCNCJob.py index c9a47076..b75ec21d 100644 --- a/flatcamObjects/FlatCAMCNCJob.py +++ b/flatcamObjects/FlatCAMCNCJob.py @@ -564,7 +564,7 @@ class CNCJobObject(FlatCAMObj, CNCjob): # delete the absolute and relative position and messages in the infobar self.app.ui.position_label.setText("") - self.app.ui.rel_position_label.setText("") + # self.app.ui.rel_position_label.setText("") # first clear previous text in text editor (if any) self.gcode_editor_tab.code_editor.clear() diff --git a/flatcamTools/ToolCalibration.py b/flatcamTools/ToolCalibration.py index 98b487cf..c1e6b14d 100644 --- a/flatcamTools/ToolCalibration.py +++ b/flatcamTools/ToolCalibration.py @@ -1069,7 +1069,7 @@ class ToolCalibration(FlatCAMTool): # delete the absolute and relative position and messages in the infobar self.app.ui.position_label.setText("") - self.app.ui.rel_position_label.setText("") + # self.app.ui.rel_position_label.setText("") # first clear previous text in text editor (if any) self.gcode_editor_tab.code_editor.clear() diff --git a/flatcamTools/ToolCopperThieving.py b/flatcamTools/ToolCopperThieving.py index 8adb9fc4..0b43f71a 100644 --- a/flatcamTools/ToolCopperThieving.py +++ b/flatcamTools/ToolCopperThieving.py @@ -917,8 +917,8 @@ class ToolCopperThieving(FlatCAMTool): self.app.dy = curr_pos[1] - float(self.cursor_pos[1]) # # update the positions on status bar - # self.app.ui.position_label.setText("    X: %.4f   " - # "Y: %.4f" % (curr_pos[0], curr_pos[1])) + self.app.ui.position_label.setText(" X: %.4f   " + "Y: %.4f " % (curr_pos[0], curr_pos[1])) # self.app.ui.rel_position_label.setText("Dx: %.4f   Dy: " # "%.4f    " % (self.app.dx, self.app.dy)) diff --git a/flatcamTools/ToolDistance.py b/flatcamTools/ToolDistance.py index ef239454..1e61d782 100644 --- a/flatcamTools/ToolDistance.py +++ b/flatcamTools/ToolDistance.py @@ -544,11 +544,11 @@ class Distance(FlatCAMTool): else: pos = (pos_canvas[0], pos_canvas[1]) - # self.app.ui.position_label.setText( - # "    X: {}   Y: {}".format( - # '%.*f' % (self.decimals, pos[0]), '%.*f' % (self.decimals, pos[1]) - # ) - # ) + self.app.ui.position_label.setText( + "    X: {}   Y: {}".format( + '%.*f' % (self.decimals, pos[0]), '%.*f' % (self.decimals, pos[1]) + ) + ) units = self.app.defaults["units"].lower() self.app.plotcanvas.text_hud.text = \ @@ -583,7 +583,7 @@ class Distance(FlatCAMTool): except Exception as e: log.debug("Distance.on_mouse_move_meas() --> %s" % str(e)) self.app.ui.position_label.setText("") - self.app.ui.rel_position_label.setText("") + # self.app.ui.rel_position_label.setText("") def utility_geometry(self, pos): # first delete old shape diff --git a/flatcamTools/ToolNCC.py b/flatcamTools/ToolNCC.py index b3ab7fa5..e83d4bdb 100644 --- a/flatcamTools/ToolNCC.py +++ b/flatcamTools/ToolNCC.py @@ -1832,8 +1832,8 @@ class NonCopperClear(FlatCAMTool, Gerber): self.app.dy = curr_pos[1] - float(self.cursor_pos[1]) # # update the positions on status bar - # self.app.ui.position_label.setText("    X: %.4f   " - # "Y: %.4f" % (curr_pos[0], curr_pos[1])) + self.app.ui.position_label.setText(" X: %.4f   " + "Y: %.4f " % (curr_pos[0], curr_pos[1])) # self.app.ui.rel_position_label.setText("Dx: %.4f   Dy: " # "%.4f    " % (self.app.dx, self.app.dy)) diff --git a/flatcamTools/ToolPaint.py b/flatcamTools/ToolPaint.py index 131e025b..c06b6666 100644 --- a/flatcamTools/ToolPaint.py +++ b/flatcamTools/ToolPaint.py @@ -1731,8 +1731,8 @@ class ToolPaint(FlatCAMTool, Gerber): self.app.dy = curr_pos[1] - float(self.cursor_pos[1]) # # update the positions on status bar - # self.app.ui.position_label.setText("    X: %.4f   " - # "Y: %.4f" % (curr_pos[0], curr_pos[1])) + self.app.ui.position_label.setText(" X: %.4f   " + "Y: %.4f " % (curr_pos[0], curr_pos[1])) # self.app.ui.rel_position_label.setText("Dx: %.4f   Dy: " # "%.4f    " % (self.app.dx, self.app.dy))