-
Notifications
You must be signed in to change notification settings - Fork 4
/
main.py
executable file
·55 lines (43 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
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Archivo main
"""
from pyqtgraph.Qt import QtGui #interfaz en general
def main(APP):
from configuration import GENERAL_CONFIG as CONFIG
if CONFIG == None:
import sys
sys.exit()
from multi_process import init_process
from Graphics.libgraph import MainWindow
if CONFIG['ONLINE_MODE'] is False:
dev_usb = False
else:
from capture import connect
while(True):
#verifica usb, luego comienza captura si es correcto
try:
dev_usb = connect()
break
except:
if(QtGui.QMessageBox.question(
QtGui.QWidget(), 'Error',
"error: USB device not found, try again?",
QtGui.QMessageBox.Ok |QtGui.QMessageBox.Cancel,
QtGui.QMessageBox.Cancel) == QtGui.QMessageBox.Cancel):
return
# ## ## ## ## ## ## ## ## ## ## #
processing_process, get_data_process = init_process(dev_usb)
#processing_process,get_data_process=init_process(" ",0)
# ## ## ## ## ## ## ## ## ## ## #
window = MainWindow(processing_process, get_data_process)
window.show()
#APP.setWindowIcon(QtGui.QIcon('Graphics/icon.png'))
return APP.exec_()
if __name__ == '__main__':
APP = QtGui.QApplication([])
while main(APP):
import sys,os
python = sys.executable
os.execl(python, python, * sys.argv)