|
@@ -32,11 +32,11 @@ class PlotCanvas(QtCore.QObject, VisPyCanvas):
|
|
|
:param container: The parent container in which to draw plots.
|
|
:param container: The parent container in which to draw plots.
|
|
|
:rtype: PlotCanvas
|
|
:rtype: PlotCanvas
|
|
|
"""
|
|
"""
|
|
|
- print("step_1_1")
|
|
|
|
|
|
|
|
|
|
- super(PlotCanvas, self).__init__()
|
|
|
|
|
|
|
+ # super(PlotCanvas, self).__init__()
|
|
|
|
|
+ # QtCore.QObject.__init__(self)
|
|
|
# VisPyCanvas.__init__(self)
|
|
# VisPyCanvas.__init__(self)
|
|
|
- print("step_1_2")
|
|
|
|
|
|
|
+ super().__init__()
|
|
|
|
|
|
|
|
# VisPyCanvas does not allow new attributes. Override.
|
|
# VisPyCanvas does not allow new attributes. Override.
|
|
|
self.unfreeze()
|
|
self.unfreeze()
|
|
@@ -46,8 +46,6 @@ class PlotCanvas(QtCore.QObject, VisPyCanvas):
|
|
|
# Parent container
|
|
# Parent container
|
|
|
self.container = container
|
|
self.container = container
|
|
|
|
|
|
|
|
- print("step_1_3")
|
|
|
|
|
-
|
|
|
|
|
settings = QtCore.QSettings("Open Source", "FlatCAM")
|
|
settings = QtCore.QSettings("Open Source", "FlatCAM")
|
|
|
if settings.contains("theme"):
|
|
if settings.contains("theme"):
|
|
|
theme = settings.value('theme', type=str)
|
|
theme = settings.value('theme', type=str)
|
|
@@ -117,8 +115,6 @@ class PlotCanvas(QtCore.QObject, VisPyCanvas):
|
|
|
}
|
|
}
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
- print("step_1_4")
|
|
|
|
|
-
|
|
|
|
|
# <VisPyCanvas>
|
|
# <VisPyCanvas>
|
|
|
self.create_native()
|
|
self.create_native()
|
|
|
self.native.setParent(self.fcapp.ui)
|
|
self.native.setParent(self.fcapp.ui)
|
|
@@ -126,8 +122,6 @@ class PlotCanvas(QtCore.QObject, VisPyCanvas):
|
|
|
# <QtCore.QObject>
|
|
# <QtCore.QObject>
|
|
|
self.container.addWidget(self.native)
|
|
self.container.addWidget(self.native)
|
|
|
|
|
|
|
|
- print("step_1_5")
|
|
|
|
|
-
|
|
|
|
|
# ## AXIS # ##
|
|
# ## AXIS # ##
|
|
|
self.v_line = InfiniteLine(pos=0, color=(0.70, 0.3, 0.3, 0.8), vertical=True,
|
|
self.v_line = InfiniteLine(pos=0, color=(0.70, 0.3, 0.3, 0.8), vertical=True,
|
|
|
parent=self.view.scene)
|
|
parent=self.view.scene)
|
|
@@ -135,15 +129,11 @@ class PlotCanvas(QtCore.QObject, VisPyCanvas):
|
|
|
self.h_line = InfiniteLine(pos=0, color=(0.70, 0.3, 0.3, 0.8), vertical=False,
|
|
self.h_line = InfiniteLine(pos=0, color=(0.70, 0.3, 0.3, 0.8), vertical=False,
|
|
|
parent=self.view.scene)
|
|
parent=self.view.scene)
|
|
|
|
|
|
|
|
- print("step_1_6")
|
|
|
|
|
-
|
|
|
|
|
# draw a rectangle made out of 4 lines on the canvas to serve as a hint for the work area
|
|
# draw a rectangle made out of 4 lines on the canvas to serve as a hint for the work area
|
|
|
# all CNC have a limited workspace
|
|
# all CNC have a limited workspace
|
|
|
if self.fcapp.defaults['global_workspace'] is True:
|
|
if self.fcapp.defaults['global_workspace'] is True:
|
|
|
self.draw_workspace(workspace_size=self.fcapp.defaults["global_workspaceT"])
|
|
self.draw_workspace(workspace_size=self.fcapp.defaults["global_workspaceT"])
|
|
|
|
|
|
|
|
- print("step_1_7")
|
|
|
|
|
-
|
|
|
|
|
self.line_parent = None
|
|
self.line_parent = None
|
|
|
if self.fcapp.defaults["global_cursor_color_enabled"]:
|
|
if self.fcapp.defaults["global_cursor_color_enabled"]:
|
|
|
c_color = Color(self.fcapp.defaults["global_cursor_color"]).rgba
|
|
c_color = Color(self.fcapp.defaults["global_cursor_color"]).rgba
|
|
@@ -156,8 +146,6 @@ class PlotCanvas(QtCore.QObject, VisPyCanvas):
|
|
|
self.cursor_h_line = InfiniteLine(pos=None, color=c_color, vertical=False,
|
|
self.cursor_h_line = InfiniteLine(pos=None, color=c_color, vertical=False,
|
|
|
parent=self.line_parent)
|
|
parent=self.line_parent)
|
|
|
|
|
|
|
|
- print("step_1_8")
|
|
|
|
|
-
|
|
|
|
|
self.shape_collections = []
|
|
self.shape_collections = []
|
|
|
|
|
|
|
|
self.shape_collection = self.new_shape_collection()
|
|
self.shape_collection = self.new_shape_collection()
|
|
@@ -171,10 +159,7 @@ class PlotCanvas(QtCore.QObject, VisPyCanvas):
|
|
|
self.big_cursor = None
|
|
self.big_cursor = None
|
|
|
# Keep VisPy canvas happy by letting it be "frozen" again.
|
|
# Keep VisPy canvas happy by letting it be "frozen" again.
|
|
|
self.freeze()
|
|
self.freeze()
|
|
|
- print("step_1_9")
|
|
|
|
|
-
|
|
|
|
|
self.fit_view()
|
|
self.fit_view()
|
|
|
- print("step_1_10")
|
|
|
|
|
|
|
|
|
|
self.graph_event_connect('mouse_wheel', self.on_mouse_scroll)
|
|
self.graph_event_connect('mouse_wheel', self.on_mouse_scroll)
|
|
|
|
|
|