-
Notifications
You must be signed in to change notification settings - Fork 2
/
simpleVisoar.py
120 lines (77 loc) · 3.03 KB
/
simpleVisoar.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
from VisoarSettings import *
#from slam2dWidget import *
#from analysis_scripts import *
from lookAndFeel import *
from pathlib import Path
from datetime import datetime
from ViSOARUIWidget import *
from slampy.utils import *
# IMPORTANT for WIndows
# Mixing C++ Qt5 and PyQt5 won't work in Windows/DEBUG mode
# because forcing the use of PyQt5 means to use only release libraries (example: Qt5Core.dll)
# but I'm in need of the missing debug version (example: Qt5Cored.dll)
# as you know, python (release) does not work with debugging versions, unless you recompile all from scratch
# on windows rememeber to INSTALL and CONFIGURE
class StartWindow(QMainWindow):
def __init__(self):
super().__init__()
self.scriptNames = MASTER_SCRIPT_LIST
self.setWindowTitle('ViSOAR Ag Explorer Prototype')
self.setMinimumSize(QSize(600, 600))
self.setStyleSheet(LOOK_AND_FEEL)
self.central_widget = QFrame()
self.central_widget.setFrameShape(QFrame.NoFrame)
self.viewerW = MyViewerWidget(self)
self.viewer = self.viewerW.viewer # MyViewer()
# self.viewer.hide()
self.viewer.setMinimal()
self.viewer_subwin = self.viewerW.viewer_subwin
self.slam_widget = Slam2DWidgetForVisoar()
self.slam = Slam2D()
# self.redirect_log.setCallback(self.slam.printLog)
print("Log from ViSOARUIWidget....")
self.slam.enable_svg = False
self.slam_widget.setStyleSheet(LOOK_AND_FEEL)
self.slam_widget.progress_bar.bar.setStyleSheet(PROGRESSBAR_LOOK_AND_FEEL)
self.slam_widget.progress_bar.bar.setMinimumWidth(300)
self.setCentralWidget(self.slam_widget )
def on_click(self):
print("\n")
for currentQTableWidgetItem in self.tabWidget.selectedItems():
print(currentQTableWidgetItem.row(), currentQTableWidgetItem.column(), currentQTableWidgetItem.text())
def onChange(self):
QMessageBox.information(self,
"Tab Index Changed!",
"Current Tab Index: ");
def setEnabledCombobxItem(self, cbox, itemName, enabled):
itemNumber = self.scriptNames.index(itemName)
cbox.model().item(itemNumber).setEnabled(enabled)
# //////////////////////////////////////////////////////////////////////////////
# //////////////////////////////////////////////
def Main(argv):
SetCommandLine("__main__")
app = QApplication(sys.argv)
app.setAttribute(Qt.AA_UseHighDpiPixmaps, True)
app.setAttribute(Qt.AA_EnableHighDpiScaling, True)
app.setStyle("Fusion")
#GuiModule.createApplication()
GuiModule.attach()
window = StartWindow()
window.show()
app.exec()
#GuiModule.execApplication()
#viewer=None
GuiModule.detach()
print("All done")
#sys.exit(0)
# //////////////////////////////////////////////
if __name__ == '__main__':
Main(sys.argv)
# <<project>
# <projName> "Project2" </projName>
# <dir> "/Users/amygooch/GIT/SCI/DATA/FromDale/ag1" </dir>
# </project>
# <<project>
# <projName> "Project3" </projName>
# <dir> "/Users/amygooch/GIT/SCI/DATA/TaylorGrant/rgb/" </dir>
# </project>