-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathFastScan.py
79 lines (58 loc) · 2.16 KB
/
FastScan.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
# -*- coding: utf-8 -*-
"""
@author: Steinn Ymir Agustsson
Copyright (C) 2018 Steinn Ymir Agustsson
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
#
# import nidaqmx
# import numpy as np
# import pyqtgraph as pg
# from PyQt5.pQtCore import QCoreApplication, QTimer
# from PyQt5.QtWidgets import QMainWindow, QApplication, QWidget, QGridLayout, QHBoxLayout, QVBoxLayout, QPushButton, \
# QGroupBox
# from nidaqmx.constants import Edge, AcquisitionType
import logging
import sys, os
from logging.config import fileConfig
from PyQt5 import QtCore, QtWidgets
from measurement.fastscan_gui import FastScanMainWindow
from utilities.settings import set_default_settings
def main():
from utilities.qt import my_exception_hook
# used to see errors generated by PyQt5 in pycharm:
sys._excepthook = sys.excepthook
# Set the exception hook to our wrapping function
sys.excepthook = my_exception_hook
# create main logger
# fileConfig('./cfg/logging_config.ini')
fileConfig('./SETTINGS.ini')
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
logger.debug('Started logger')
app = QtCore.QCoreApplication.instance()
if app is None:
app = QtWidgets.QApplication(sys.argv)
# Create handle prg for the Graphic Interface
prg = FastScanMainWindow()
# print('showing GUI')
prg.show()
try:
app.exec_()
except:
print('exiting')
if __name__ == '__main__':
# print('asd')
if not os.path.isfile('SETTINGS.ini'):
print('creating settings file')
set_default_settings()
main()