This repository has been archived by the owner on Aug 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
55 lines (39 loc) · 1.53 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
from MicroManagerControl import MicroManagerControl
from gui.GUIWidgets import SettingsView
import sys
from PyQt5 import QtWidgets
from pymm_eventserver.event_thread import EventThread
from gui.MainGUI import MainGUI
from hardware.nidaq import NIDAQ
def main():
app = QtWidgets.QApplication(sys.argv)
topics = ["StandardEvent", "GUIRefreshEvent", "LiveMode", "Acquisition",
"GUI", "Hardware", "Settings"]
event_thread = EventThread(topics=topics)
event_listener = event_thread.listener
mm_interface = MicroManagerControl(event_listener)
ni = NIDAQ(event_listener, mm_interface)
settings_view = SettingsView(event_listener)
miniapp = MainGUI(event_thread=event_listener)
miniapp.show()
sys.exit(app.exec_())
def alignment():
app = QtWidgets.QApplication(sys.argv)
topics = ["StandardEvent", "GUIRefreshEvent", "LiveMode", "Acquisition",
"GUI", "Hardware", "Settings", "NewImage"]
event_thread = EventThread(topics=topics, live_images=True)
event_listener = event_thread.listener
mm_interface = MicroManagerControl(event_listener)
ni = NIDAQ(event_listener, mm_interface)
settings_view = SettingsView(event_listener)
miniapp = MainGUI(event_thread=event_listener, alignment=True, monogram=False)
miniapp.show()
sys.exit(app.exec_())
flavours = {"main": main, "alignment": alignment}
try:
flavour = flavours[sys.argv[1]]
except IndexError:
print("No mode specified, running main")
flavour = main
if __name__ == "__main__":
flavour()