SpecLog 0.0.2__tar.gz → 0.0.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {speclog-0.0.2 → speclog-0.0.3}/PKG-INFO +1 -1
- speclog-0.0.3/SpecLog/config/config.cfg +31 -0
- speclog-0.0.3/SpecLog/run_logger.pyw +64 -0
- speclog-0.0.3/SpecLog/run_monitor.pyw +27 -0
- speclog-0.0.3/SpecLog/version.py +1 -0
- {speclog-0.0.2 → speclog-0.0.3}/SpecLog.egg-info/PKG-INFO +1 -1
- {speclog-0.0.2 → speclog-0.0.3}/SpecLog.egg-info/SOURCES.txt +3 -0
- {speclog-0.0.2 → speclog-0.0.3}/pyproject.toml +1 -4
- speclog-0.0.2/SpecLog/version.py +0 -1
- {speclog-0.0.2 → speclog-0.0.3}/README.md +0 -0
- {speclog-0.0.2 → speclog-0.0.3}/SpecLog/SpecLog.py +0 -0
- {speclog-0.0.2 → speclog-0.0.3}/SpecLog/SpecLogger.py +0 -0
- {speclog-0.0.2 → speclog-0.0.3}/SpecLog/__init__.py +0 -0
- {speclog-0.0.2 → speclog-0.0.3}/SpecLog/config/__init__.py +0 -0
- {speclog-0.0.2 → speclog-0.0.3}/SpecLog/config/config.py +0 -0
- {speclog-0.0.2 → speclog-0.0.3}/SpecLog/debugLog.py +0 -0
- {speclog-0.0.2 → speclog-0.0.3}/SpecLog/device.py +0 -0
- {speclog-0.0.2 → speclog-0.0.3}/SpecLog/loggerConfig.py +0 -0
- {speclog-0.0.2 → speclog-0.0.3}/SpecLog/monitor.py +0 -0
- {speclog-0.0.2 → speclog-0.0.3}/SpecLog/ui/__init__.py +0 -0
- {speclog-0.0.2 → speclog-0.0.3}/SpecLog/ui/plotting.py +0 -0
- {speclog-0.0.2 → speclog-0.0.3}/SpecLog/ui/plotting.ui +0 -0
- {speclog-0.0.2 → speclog-0.0.3}/SpecLog.egg-info/dependency_links.txt +0 -0
- {speclog-0.0.2 → speclog-0.0.3}/SpecLog.egg-info/entry_points.txt +0 -0
- {speclog-0.0.2 → speclog-0.0.3}/SpecLog.egg-info/requires.txt +0 -0
- {speclog-0.0.2 → speclog-0.0.3}/SpecLog.egg-info/top_level.txt +0 -0
- {speclog-0.0.2 → speclog-0.0.3}/setup.cfg +0 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
[SETTINGS]
|
|
2
|
+
log_interval = 10
|
|
3
|
+
log_folder_location = C:/Users/Public/
|
|
4
|
+
save_file_size_kb = 1024
|
|
5
|
+
limit_hours = 48
|
|
6
|
+
|
|
7
|
+
[F70]
|
|
8
|
+
device_status = True
|
|
9
|
+
address = ADDC_COM_NUMBER
|
|
10
|
+
termination = CR
|
|
11
|
+
id_command = $ID1D629
|
|
12
|
+
index = 1
|
|
13
|
+
delimiter = ,
|
|
14
|
+
helium_discharge_temperature = $TE140B8, alias = He discharge
|
|
15
|
+
water_outlet_temperature = $TE241F8, alias = H2O outlet, max = 45
|
|
16
|
+
water_inlet_temperature = $TE38139, alias = H2O inlet, min = 5, max = 30
|
|
17
|
+
compressor_pressure = $PR171F6, alias = He pressure
|
|
18
|
+
status = $STA3504, alias = Status, bits = 9, bit_static = 301, indicators = ['Compressor Run','*Motor Temperature','*Phase Sequence/Fuse','*Helium Temperature','*Water Temperature','*Water Flow','*Oil Level','*Pressure','Solenoid']
|
|
19
|
+
|
|
20
|
+
[MODEL218E]
|
|
21
|
+
device_status = True
|
|
22
|
+
address = ADDC_COM_NUMBER
|
|
23
|
+
data_bits = 7
|
|
24
|
+
termination = CRLF
|
|
25
|
+
parity = 1
|
|
26
|
+
delimiter = ,
|
|
27
|
+
1st_stage = KRDG?1, alias = 1st stage, min = 30, max = 50
|
|
28
|
+
2nd_stage = KRDG?2, alias = 2nd stage, min = 2, max = 5
|
|
29
|
+
magnet_lhs = KRDG?3, alias = Magnet LHS, min = 2, max = 5
|
|
30
|
+
magnet_rhs = KRDG?4, alias = Magnet RHS, min = 2, max = 5
|
|
31
|
+
magnet_switch = KRDG?5, alias = Magnet Switch, min = 2, max = 10
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
'''
|
|
2
|
+
This is the python program to run logger only
|
|
3
|
+
'''
|
|
4
|
+
|
|
5
|
+
import os
|
|
6
|
+
import traceback
|
|
7
|
+
import ctypes
|
|
8
|
+
import time
|
|
9
|
+
import threading
|
|
10
|
+
from collections import Counter
|
|
11
|
+
from .SpecLog import *
|
|
12
|
+
from .debugLog import *
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def popout(level = 0):
|
|
16
|
+
if level == 0:
|
|
17
|
+
return
|
|
18
|
+
elif level == 1:
|
|
19
|
+
ctypes.windll.user32.MessageBoxW(0, 'Warning: System is reaching the limit', "Logger", 1)
|
|
20
|
+
elif level > 2:
|
|
21
|
+
ctypes.windll.user32.MessageBoxW(0, 'Warning: System is error', "Logger", 1)
|
|
22
|
+
|
|
23
|
+
def main_func(config_file = None):
|
|
24
|
+
# last_warning = 0
|
|
25
|
+
debugLogger = debugLog(config_file).logger
|
|
26
|
+
current_exe = os.popen('wmic process get description').read().strip().replace(' ', '').split('\n\n')
|
|
27
|
+
hashDict = Counter(current_exe)
|
|
28
|
+
# thread = threading.Thread(target=popout, args=(0))
|
|
29
|
+
if 'SpecLogger_running.exe' in hashDict and hashDict['SpecLogger_running.exe'] > 1:
|
|
30
|
+
debugLogger.warning('start fail: SpecLogger is running in the background')
|
|
31
|
+
return
|
|
32
|
+
else:
|
|
33
|
+
try:
|
|
34
|
+
log = SpecLog()
|
|
35
|
+
debugLogger.info('SpecLog initialization succeed')
|
|
36
|
+
except Exception as err:
|
|
37
|
+
debugLogger.warning('SpecLog initialization failed')
|
|
38
|
+
debugLogger.error(traceback.format_exc())
|
|
39
|
+
return
|
|
40
|
+
debugLogger.info('SpecLog logging started')
|
|
41
|
+
while(1):
|
|
42
|
+
try:
|
|
43
|
+
log.log()
|
|
44
|
+
# warning = log.warning
|
|
45
|
+
# if last_warning != warning:
|
|
46
|
+
# if warning == 0 and thread.is_alive: # error clean
|
|
47
|
+
# thread.join()
|
|
48
|
+
# elif warning != last_warning: # error changes
|
|
49
|
+
# if thread.is_alive():
|
|
50
|
+
# wd=ctypes.windll.user32.FindWindowA(0,"Logger") # close window
|
|
51
|
+
# ctypes.windll.user32.SendMessageA(wd,0x0010,0,0)
|
|
52
|
+
# thread.join()
|
|
53
|
+
# thread = threading.Thread(target=popout, kwargs = {'level': warning})
|
|
54
|
+
# thread.start()
|
|
55
|
+
|
|
56
|
+
# last_warning = warning
|
|
57
|
+
|
|
58
|
+
except Exception as err:
|
|
59
|
+
debugLogger.warning('logging failed')
|
|
60
|
+
debugLogger.critical(traceback.format_exc())
|
|
61
|
+
return
|
|
62
|
+
|
|
63
|
+
if __name__ == "__main__":
|
|
64
|
+
main_func()
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'''
|
|
2
|
+
This is the python program to run monitor only
|
|
3
|
+
'''
|
|
4
|
+
|
|
5
|
+
import os
|
|
6
|
+
import sys
|
|
7
|
+
from collections import Counter
|
|
8
|
+
import argparse
|
|
9
|
+
from .monitor import *
|
|
10
|
+
|
|
11
|
+
def main_func():
|
|
12
|
+
parser = argparse.ArgumentParser(prog='specmonitor')
|
|
13
|
+
parser.add_argument('number_of_file', type=int, nargs='?', default = 10,
|
|
14
|
+
help='To select number of files to plot in real-time')
|
|
15
|
+
args = parser.parse_args()
|
|
16
|
+
current_exe = os.popen('wmic process get description').read().strip().replace(' ', '').split('\n\n')
|
|
17
|
+
hashDict = Counter(current_exe)
|
|
18
|
+
if 'specmonitor.exe' in hashDict and hashDict['specmonitor.exe'] > 1:
|
|
19
|
+
exit()
|
|
20
|
+
else:
|
|
21
|
+
app = QApplication(sys.argv)
|
|
22
|
+
window = MainWindow()
|
|
23
|
+
window.show()
|
|
24
|
+
app.exec()
|
|
25
|
+
|
|
26
|
+
if __name__ == "__main__":
|
|
27
|
+
main_func()
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.0.3"
|
|
@@ -7,6 +7,8 @@ SpecLog/debugLog.py
|
|
|
7
7
|
SpecLog/device.py
|
|
8
8
|
SpecLog/loggerConfig.py
|
|
9
9
|
SpecLog/monitor.py
|
|
10
|
+
SpecLog/run_logger.pyw
|
|
11
|
+
SpecLog/run_monitor.pyw
|
|
10
12
|
SpecLog/version.py
|
|
11
13
|
SpecLog.egg-info/PKG-INFO
|
|
12
14
|
SpecLog.egg-info/SOURCES.txt
|
|
@@ -15,6 +17,7 @@ SpecLog.egg-info/entry_points.txt
|
|
|
15
17
|
SpecLog.egg-info/requires.txt
|
|
16
18
|
SpecLog.egg-info/top_level.txt
|
|
17
19
|
SpecLog/config/__init__.py
|
|
20
|
+
SpecLog/config/config.cfg
|
|
18
21
|
SpecLog/config/config.py
|
|
19
22
|
SpecLog/ui/__init__.py
|
|
20
23
|
SpecLog/ui/plotting.py
|
|
@@ -41,10 +41,7 @@ include-package-data = true
|
|
|
41
41
|
include = ["SpecLog", "SpecLog.*"]
|
|
42
42
|
|
|
43
43
|
[tool.setuptools.package-data]
|
|
44
|
-
SpecLog = [
|
|
45
|
-
"config/command.cfg",
|
|
46
|
-
"ui/plotting.ui",
|
|
47
|
-
]
|
|
44
|
+
SpecLog = ["*.pyw", "config/*.cfg", "ui/*.ui"]
|
|
48
45
|
|
|
49
46
|
[tool.setuptools.dynamic]
|
|
50
47
|
version = { attr = "SpecLog.version.__version__" }
|
speclog-0.0.2/SpecLog/version.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.0.2"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|