forked from PerroTron/JauriaCNC
-
Notifications
You must be signed in to change notification settings - Fork 6
/
main.py
56 lines (39 loc) · 1.56 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env python
import os
from qtpy.QtCore import Slot
from qtpy.QtWidgets import QAbstractButton
from qtpyvcp.widgets.form_widgets.main_window import VCPMainWindow
# Setup logging
from qtpyvcp.utilities import logger
LOG = logger.getLogger("QtPyVCP." + __name__)
from qtpyvcp import actions
from tnc.dialogs.zero_xy import ZeroXY
import resources_rc
VCP_DIR = os.path.dirname(os.path.abspath(__file__))
class MainWindow(VCPMainWindow):
def __init__(self, *args, **kwargs):
super(MainWindow, self).__init__(*args, **kwargs)
self.initUi()
self.plot.camera.Zoom(0.002)
self.plot.setViewMachine()
@Slot(QAbstractButton)
def on_probeTabGroup_buttonClicked(self, button):
self.probe_tab_widget.setCurrentIndex(button.property('page'))
@Slot(QAbstractButton)
def on_sidebarTabGroup_buttonClicked(self, button):
self.sidebar_widget.setCurrentIndex(button.property('page'))
# Fwd/Back buttons off the stacked widget
def on_probe_help_next_released(self):
lastPage = 5
currentIndex = self.probe_help_widget.currentIndex()
if currentIndex == lastPage:
self.probe_help_widget.setCurrentIndex(0)
else:
self.probe_help_widget.setCurrentIndex(currentIndex + 1)
def on_probe_help_prev_released(self):
lastPage = 5
currentIndex = self.probe_help_widget.currentIndex()
if currentIndex == 0:
self.probe_help_widget.setCurrentIndex(lastPage)
else:
self.probe_help_widget.setCurrentIndex(currentIndex - 1)