Skip to content

Commit

Permalink
FIX: Fix program_view_when_loading_program signal
Browse files Browse the repository at this point in the history
  • Loading branch information
TurBoss committed May 31, 2021
1 parent f84b99a commit 2ac0c6b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import linuxcnc
import os

from qtpy.QtCore import Signal
from qtpy.QtCore import Signal, QObject
from qtpyvcp.plugins import getPlugin
from qtpyvcp.utilities import logger
from qtpyvcp.utilities.info import Info

INFO = Info()
LOG = logger.getLogger(__name__)
from PyQt5.QtCore import QObject

IN_DESIGNER = os.getenv('DESIGNER', False)
"""
Expand Down
11 changes: 6 additions & 5 deletions qtpyvcp/widgets/display_widgets/vtk_backplot/vtk_backplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@
NUMBER_OF_WCS = 9

# turn on antialiasing
from PyQt5.QtOpenGL import QGLFormat
from qtpy.QtOpenGL import QGLFormat
f = QGLFormat()
f.setSampleBuffers(True)
QGLFormat.setDefaultFormat(f)


class VTKBackPlot(QVTKRenderWindowInteractor, VCPWidget, BaseBackPlot):
def __init__(self, parent=None):
super(VTKBackPlot, self).__init__(parent)
Expand All @@ -51,7 +52,7 @@ def __init__(self, parent=None):
self.parent = parent
self.ploter_enabled = True
self.touch_enabled = False
self.programViewWhenLoadingProgram = False
self.program_view_when_loading_program = False
self.pan_mode = False
self.line = None
self._last_filename = str()
Expand Down Expand Up @@ -79,7 +80,6 @@ def __init__(self, parent=None):
self._dwel_color = self._default_dwell_color
self._user_color = self._default_user_color



self.active_wcs_index = self._datasource.getActiveWcsIndex()
self.wcs_offsets = self._datasource.getWcsOffsets()
Expand Down Expand Up @@ -468,7 +468,7 @@ def load_program(self, fname=None):

self.renderer.AddActor(self.axes_actor)
self.renderer_window.Render()
if self.setProgramViewWhenLoadingProgram:
if self.program_view_when_loading_program:
self.setViewProgram()

def motion_type(self, value):
Expand Down Expand Up @@ -711,6 +711,7 @@ def setViewZ(self):

@Slot()
def setViewZ2(self):
self.active_view = 'Z2'
position = self.wcs_offsets[self.active_wcs_index]
self.camera.SetPosition(position[0], position[1], position[2] + self.position_mult)
self.camera.SetFocalPoint(position[:3])
Expand Down Expand Up @@ -832,7 +833,7 @@ def enableMultiTouch(self, enabled):

@Slot(bool)
def setProgramViewWhenLoadingProgram(self, enabled):
self.touch_enabled = enabled
self.program_view_when_loading_program = enabled

@Slot()
def zoomIn(self):
Expand Down

0 comments on commit 2ac0c6b

Please # to comment.