10
FlatCAM.py
10
FlatCAM.py
@@ -1,4 +1,5 @@
|
|||||||
import sys, os
|
import sys
|
||||||
|
import os
|
||||||
|
|
||||||
from PyQt5 import QtWidgets
|
from PyQt5 import QtWidgets
|
||||||
from PyQt5.QtCore import QSettings, Qt
|
from PyQt5.QtCore import QSettings, Qt
|
||||||
@@ -10,6 +11,7 @@ if sys.platform == "win32":
|
|||||||
# cx_freeze 'module win32' workaround
|
# cx_freeze 'module win32' workaround
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
def debug_trace():
|
def debug_trace():
|
||||||
"""
|
"""
|
||||||
Set a tracepoint in the Python debugger that works with Qt
|
Set a tracepoint in the Python debugger that works with Qt
|
||||||
@@ -20,12 +22,11 @@ def debug_trace():
|
|||||||
pyqtRemoveInputHook()
|
pyqtRemoveInputHook()
|
||||||
# set_trace()
|
# set_trace()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
# All X11 calling should be thread safe otherwise we have strange issues
|
# All X11 calling should be thread safe otherwise we have strange issues
|
||||||
# QtCore.QCoreApplication.setAttribute(QtCore.Qt.AA_X11InitThreads)
|
# QtCore.QCoreApplication.setAttribute(QtCore.Qt.AA_X11InitThreads)
|
||||||
# NOTE: Never talk to the GUI from threads! This is why I commented the above.
|
# NOTE: Never talk to the GUI from threads! This is why I commented the above.
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
freeze_support()
|
freeze_support()
|
||||||
|
|
||||||
debug_trace()
|
debug_trace()
|
||||||
@@ -59,4 +60,3 @@ if __name__ == '__main__':
|
|||||||
fc = App()
|
fc = App()
|
||||||
|
|
||||||
sys.exit(app.exec_())
|
sys.exit(app.exec_())
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import gc
|
|||||||
from xml.dom.minidom import parseString as parse_xml_string
|
from xml.dom.minidom import parseString as parse_xml_string
|
||||||
|
|
||||||
# #######################################
|
# #######################################
|
||||||
# # Imports part of FlatCAM # ##
|
# # Imports part of FlatCAM ##
|
||||||
# #######################################
|
# #######################################
|
||||||
from ObjectCollection import *
|
from ObjectCollection import *
|
||||||
from FlatCAMObj import *
|
from FlatCAMObj import *
|
||||||
@@ -681,7 +681,7 @@ class App(QtCore.QObject):
|
|||||||
"zoom_out_key": '-',
|
"zoom_out_key": '-',
|
||||||
"zoom_in_key": '=',
|
"zoom_in_key": '=',
|
||||||
"grid_toggle_key": 'G',
|
"grid_toggle_key": 'G',
|
||||||
"zoom_ratio": 1.5,
|
"global_zoom_ratio": 1.5,
|
||||||
"global_point_clipboard_format": "(%.4f, %.4f)",
|
"global_point_clipboard_format": "(%.4f, %.4f)",
|
||||||
"global_zdownrate": None,
|
"global_zdownrate": None,
|
||||||
|
|
||||||
@@ -929,9 +929,8 @@ class App(QtCore.QObject):
|
|||||||
self.ui.general_defaults_form.general_app_group.language_cb.setCurrentText(ret_val)
|
self.ui.general_defaults_form.general_app_group.language_cb.setCurrentText(ret_val)
|
||||||
log.debug("App.__init__() --> Applied %s language." % str(ret_val).capitalize())
|
log.debug("App.__init__() --> Applied %s language." % str(ret_val).capitalize())
|
||||||
|
|
||||||
|
|
||||||
# ##################################
|
# ##################################
|
||||||
# # ## CREATE UNIQUE SERIAL NUMBER # ##
|
# ### CREATE UNIQUE SERIAL NUMBER ##
|
||||||
# ##################################
|
# ##################################
|
||||||
|
|
||||||
chars = 'abcdefghijklmnopqrstuvwxyz0123456789'
|
chars = 'abcdefghijklmnopqrstuvwxyz0123456789'
|
||||||
@@ -1416,9 +1415,15 @@ class App(QtCore.QObject):
|
|||||||
self.ui.menuviewdisableall.triggered.connect(self.disable_all_plots)
|
self.ui.menuviewdisableall.triggered.connect(self.disable_all_plots)
|
||||||
self.ui.menuviewdisableother.triggered.connect(self.disable_other_plots)
|
self.ui.menuviewdisableother.triggered.connect(self.disable_other_plots)
|
||||||
self.ui.menuviewenable.triggered.connect(self.enable_all_plots)
|
self.ui.menuviewenable.triggered.connect(self.enable_all_plots)
|
||||||
|
|
||||||
self.ui.menuview_zoom_fit.triggered.connect(self.on_zoom_fit)
|
self.ui.menuview_zoom_fit.triggered.connect(self.on_zoom_fit)
|
||||||
self.ui.menuview_zoom_in.triggered.connect(lambda: self.plotcanvas.zoom(1 / 1.5))
|
self.ui.menuview_zoom_in.triggered.connect(
|
||||||
self.ui.menuview_zoom_out.triggered.connect(lambda: self.plotcanvas.zoom(1.5))
|
lambda: self.plotcanvas.zoom(1 / float(self.defaults['global_zoom_ratio']))
|
||||||
|
)
|
||||||
|
self.ui.menuview_zoom_out.triggered.connect(
|
||||||
|
lambda: self.plotcanvas.zoom(float(self.defaults['global_zoom_ratio']))
|
||||||
|
)
|
||||||
|
|
||||||
self.ui.menuview_toggle_code_editor.triggered.connect(self.on_toggle_code_editor)
|
self.ui.menuview_toggle_code_editor.triggered.connect(self.on_toggle_code_editor)
|
||||||
self.ui.menuview_toggle_fscreen.triggered.connect(self.on_fullscreen)
|
self.ui.menuview_toggle_fscreen.triggered.connect(self.on_fullscreen)
|
||||||
self.ui.menuview_toggle_parea.triggered.connect(self.on_toggle_plotarea)
|
self.ui.menuview_toggle_parea.triggered.connect(self.on_toggle_plotarea)
|
||||||
@@ -2796,16 +2801,16 @@ class App(QtCore.QObject):
|
|||||||
self.date = ''.join(c for c in self.date if c not in ':-')
|
self.date = ''.join(c for c in self.date if c not in ':-')
|
||||||
self.date = self.date.replace(' ', '_')
|
self.date = self.date.replace(' ', '_')
|
||||||
|
|
||||||
filter = "Config File (*.FlatConfig);;All Files (*.*)"
|
filter__ = "Config File (*.FlatConfig);;All Files (*.*)"
|
||||||
try:
|
try:
|
||||||
filename, _f = QtWidgets.QFileDialog.getSaveFileName(
|
filename, _f = QtWidgets.QFileDialog.getSaveFileName(
|
||||||
caption=_("Export FlatCAM Preferences"),
|
caption=_("Export FlatCAM Preferences"),
|
||||||
directory=self.data_path + '/preferences_' + self.date,
|
directory=self.data_path + '/preferences_' + self.date,
|
||||||
filter=filter
|
filter=filter__
|
||||||
)
|
)
|
||||||
except TypeError:
|
except TypeError:
|
||||||
filename, _f = QtWidgets.QFileDialog.getSaveFileName(caption=_("Export FlatCAM Preferences"),
|
filename, _f = QtWidgets.QFileDialog.getSaveFileName(caption=_("Export FlatCAM Preferences"),
|
||||||
filter=filter)
|
filter=filter__)
|
||||||
|
|
||||||
filename = str(filename)
|
filename = str(filename)
|
||||||
defaults_from_file = {}
|
defaults_from_file = {}
|
||||||
|
|||||||
@@ -9,12 +9,18 @@ CAD program, and create G-Code for Isolation routing.
|
|||||||
|
|
||||||
=================================================
|
=================================================
|
||||||
|
|
||||||
|
9.06.2019
|
||||||
|
|
||||||
|
- updated translations
|
||||||
|
- fixed the the labels for shortcut keys for zoom in and zoom out both in the Menu links and in the Shortcut list
|
||||||
|
- made sure the zoom functions use the global_zoom_ratio parameter from App.self.defaults dictionary.
|
||||||
|
- some PEP8 cleanup
|
||||||
|
|
||||||
8.06.2019
|
8.06.2019
|
||||||
|
|
||||||
- make sure that the annotation shapes are deleted on creation of a new project
|
- make sure that the annotation shapes are deleted on creation of a new project
|
||||||
- added folder for the Russian translation
|
- added folder for the Russian translation
|
||||||
- made sure that visibility for TextGroup is set only if index is not None in VisPyVisuals.TextGroup.visible() setter
|
- made sure that visibility for TextGroup is set only if index is not None in VisPyVisuals.TextGroup.visible() setter
|
||||||
- RELEASE 8.918
|
|
||||||
|
|
||||||
7.06.2019
|
7.06.2019
|
||||||
|
|
||||||
|
|||||||
@@ -355,8 +355,8 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
|||||||
# Separator
|
# Separator
|
||||||
self.menuview.addSeparator()
|
self.menuview.addSeparator()
|
||||||
self.menuview_zoom_fit = self.menuview.addAction(QtGui.QIcon('share/zoom_fit32.png'), _("&Zoom Fit\tV"))
|
self.menuview_zoom_fit = self.menuview.addAction(QtGui.QIcon('share/zoom_fit32.png'), _("&Zoom Fit\tV"))
|
||||||
self.menuview_zoom_in = self.menuview.addAction(QtGui.QIcon('share/zoom_in32.png'), _("&Zoom In\t-"))
|
self.menuview_zoom_in = self.menuview.addAction(QtGui.QIcon('share/zoom_in32.png'), _("&Zoom In\t="))
|
||||||
self.menuview_zoom_out = self.menuview.addAction(QtGui.QIcon('share/zoom_out32.png'), _("&Zoom Out\t="))
|
self.menuview_zoom_out = self.menuview.addAction(QtGui.QIcon('share/zoom_out32.png'), _("&Zoom Out\t-"))
|
||||||
self.menuview.addSeparator()
|
self.menuview.addSeparator()
|
||||||
|
|
||||||
self.menuview_toggle_code_editor = self.menuview.addAction(QtGui.QIcon('share/code_editor32.png'),
|
self.menuview_toggle_code_editor = self.menuview.addAction(QtGui.QIcon('share/code_editor32.png'),
|
||||||
@@ -1069,11 +1069,11 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
|||||||
<td> Flip on Y_axis</td>
|
<td> Flip on Y_axis</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr height="20">
|
<tr height="20">
|
||||||
<td height="20"><strong>'='</strong></td>
|
<td height="20"><strong>'-'</strong></td>
|
||||||
<td> Zoom Out</td>
|
<td> Zoom Out</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr height="20">
|
<tr height="20">
|
||||||
<td height="20"><strong>'-'</strong></td>
|
<td height="20"><strong>'='</strong></td>
|
||||||
<td> Zoom In</td>
|
<td> Zoom In</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr height="20">
|
<tr height="20">
|
||||||
@@ -2289,7 +2289,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
|||||||
self.app.on_set_origin()
|
self.app.on_set_origin()
|
||||||
return
|
return
|
||||||
|
|
||||||
# Set Origin
|
# Properties Tool
|
||||||
if key == QtCore.Qt.Key_P:
|
if key == QtCore.Qt.Key_P:
|
||||||
self.app.properties_tool.run()
|
self.app.properties_tool.run()
|
||||||
return
|
return
|
||||||
@@ -2329,11 +2329,11 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
|||||||
|
|
||||||
# Zoom In
|
# Zoom In
|
||||||
if key == QtCore.Qt.Key_Equal:
|
if key == QtCore.Qt.Key_Equal:
|
||||||
self.app.plotcanvas.zoom(1 / self.app.defaults['zoom_ratio'], self.app.mouse)
|
self.app.plotcanvas.zoom(1 / self.app.defaults['global_zoom_ratio'], self.app.mouse)
|
||||||
|
|
||||||
# Zoom Out
|
# Zoom Out
|
||||||
if key == QtCore.Qt.Key_Minus:
|
if key == QtCore.Qt.Key_Minus:
|
||||||
self.app.plotcanvas.zoom(self.app.defaults['zoom_ratio'], self.app.mouse)
|
self.app.plotcanvas.zoom(self.app.defaults['global_zoom_ratio'], self.app.mouse)
|
||||||
|
|
||||||
# toggle display of Notebook area
|
# toggle display of Notebook area
|
||||||
if key == QtCore.Qt.Key_QuoteLeft:
|
if key == QtCore.Qt.Key_QuoteLeft:
|
||||||
@@ -2455,11 +2455,11 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
|||||||
self.app.geo_editor.transform_tool.on_rotate_key()
|
self.app.geo_editor.transform_tool.on_rotate_key()
|
||||||
|
|
||||||
if key == QtCore.Qt.Key_Minus or key == '-':
|
if key == QtCore.Qt.Key_Minus or key == '-':
|
||||||
self.app.plotcanvas.zoom(1 / self.app.defaults['zoom_ratio'],
|
self.app.plotcanvas.zoom(1 / self.app.defaults['global_zoom_ratio'],
|
||||||
[self.app.geo_editor.snap_x, self.app.geo_editor.snap_y])
|
[self.app.geo_editor.snap_x, self.app.geo_editor.snap_y])
|
||||||
|
|
||||||
if key == QtCore.Qt.Key_Equal or key == '=':
|
if key == QtCore.Qt.Key_Equal or key == '=':
|
||||||
self.app.plotcanvas.zoom(self.app.defaults['zoom_ratio'],
|
self.app.plotcanvas.zoom(self.app.defaults['global_zoom_ratio'],
|
||||||
[self.app.geo_editor.snap_x, self.app.geo_editor.snap_y])
|
[self.app.geo_editor.snap_x, self.app.geo_editor.snap_y])
|
||||||
|
|
||||||
# Switch to Project Tab
|
# Switch to Project Tab
|
||||||
@@ -2657,13 +2657,13 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
|||||||
|
|
||||||
if key == QtCore.Qt.Key_Minus or key == '-':
|
if key == QtCore.Qt.Key_Minus or key == '-':
|
||||||
self.app.grb_editor.launched_from_shortcuts = True
|
self.app.grb_editor.launched_from_shortcuts = True
|
||||||
self.app.plotcanvas.zoom(1 / self.app.defaults['zoom_ratio'],
|
self.app.plotcanvas.zoom(1 / self.app.defaults['global_zoom_ratio'],
|
||||||
[self.app.grb_editor.snap_x, self.app.grb_editor.snap_y])
|
[self.app.grb_editor.snap_x, self.app.grb_editor.snap_y])
|
||||||
return
|
return
|
||||||
|
|
||||||
if key == QtCore.Qt.Key_Equal or key == '=':
|
if key == QtCore.Qt.Key_Equal or key == '=':
|
||||||
self.app.grb_editor.launched_from_shortcuts = True
|
self.app.grb_editor.launched_from_shortcuts = True
|
||||||
self.app.plotcanvas.zoom(self.app.defaults['zoom_ratio'],
|
self.app.plotcanvas.zoom(self.app.defaults['global_zoom_ratio'],
|
||||||
[self.app.grb_editor.snap_x, self.app.grb_editor.snap_y])
|
[self.app.grb_editor.snap_x, self.app.grb_editor.snap_y])
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -2869,13 +2869,13 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
|||||||
|
|
||||||
if key == QtCore.Qt.Key_Minus or key == '-':
|
if key == QtCore.Qt.Key_Minus or key == '-':
|
||||||
self.app.exc_editor.launched_from_shortcuts = True
|
self.app.exc_editor.launched_from_shortcuts = True
|
||||||
self.app.plotcanvas.zoom(1 / self.app.defaults['zoom_ratio'],
|
self.app.plotcanvas.zoom(1 / self.app.defaults['global_zoom_ratio'],
|
||||||
[self.app.exc_editor.snap_x, self.app.exc_editor.snap_y])
|
[self.app.exc_editor.snap_x, self.app.exc_editor.snap_y])
|
||||||
return
|
return
|
||||||
|
|
||||||
if key == QtCore.Qt.Key_Equal or key == '=':
|
if key == QtCore.Qt.Key_Equal or key == '=':
|
||||||
self.app.exc_editor.launched_from_shortcuts = True
|
self.app.exc_editor.launched_from_shortcuts = True
|
||||||
self.app.plotcanvas.zoom(self.app.defaults['zoom_ratio'],
|
self.app.plotcanvas.zoom(self.app.defaults['global_zoom_ratio'],
|
||||||
[self.app.exc_editor.snap_x, self.app.exc_editor.snap_y])
|
[self.app.exc_editor.snap_x, self.app.exc_editor.snap_y])
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user