-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMainWindow.py
More file actions
59 lines (49 loc) · 1.9 KB
/
MainWindow.py
File metadata and controls
59 lines (49 loc) · 1.9 KB
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
57
58
from PyQt5.QtGui import QIcon
from ControllerGUITab import ControllerGUITab
from Brooks025X import Brooks025X
from GlobalTab import GlobalTab
from PyQt5.QtWidgets import (
QVBoxLayout,
QWidget,
QTabWidget,
)
import resources
class MainWindow(QWidget):
def __init__(self, pyvisaConnection, controllers=None):
super().__init__()
if controllers is None:
controllers = [True, True, True, False]
self.setWindowIcon(QIcon(":/icon.png"))
self.setWindowTitle("FlowController by Mirosław Wiącek")
self.setMinimumSize(900, 730)
brooks = Brooks025X(pyvisaConnection, controllers)
layout = QVBoxLayout()
self.setLayout(layout)
tabs = QTabWidget()
tabReferences = []
if brooks.controller1 is not None:
controller1Tab = ControllerGUITab(brooks.controller1)
tabs.addTab(controller1Tab, "Controller 1")
tabReferences.append(controller1Tab)
else:
tabReferences.append(None)
if brooks.controller2 is not None:
controller2Tab = ControllerGUITab(brooks.controller2)
tabs.addTab(controller2Tab, "Controller 2")
tabReferences.append(controller2Tab)
else:
tabReferences.append(None)
if brooks.controller3 is not None:
controller3Tab = ControllerGUITab(brooks.controller3)
tabs.addTab(controller3Tab, "Controller 3")
tabReferences.append(controller3Tab)
else:
tabReferences.append(None)
if brooks.controller4 is not None:
controller4Tab = ControllerGUITab(brooks.controller4)
tabs.addTab(controller4Tab, "Controller 4")
tabReferences.append(controller4Tab)
else:
tabReferences.append(None)
tabs.addTab(GlobalTab(brooks, tabReferences), "Global controls")
layout.addWidget(tabs)