SpecLog 0.0.6__tar.gz → 0.0.8__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.6 → speclog-0.0.8}/PKG-INFO +45 -12
- {speclog-0.0.6 → speclog-0.0.8}/README.md +44 -11
- {speclog-0.0.6 → speclog-0.0.8}/SpecLog/SpecLogger.py +9 -25
- speclog-0.0.8/SpecLog/config/monitor_config.cfg +24 -0
- {speclog-0.0.6 → speclog-0.0.8}/SpecLog/monitor.py +727 -55
- speclog-0.0.8/SpecLog/monitor_style.py +113 -0
- speclog-0.0.8/SpecLog/ui/historical_data.py +116 -0
- speclog-0.0.8/SpecLog/version.py +1 -0
- {speclog-0.0.6 → speclog-0.0.8}/SpecLog.egg-info/PKG-INFO +45 -12
- {speclog-0.0.6 → speclog-0.0.8}/SpecLog.egg-info/SOURCES.txt +3 -0
- {speclog-0.0.6 → speclog-0.0.8}/tests/test_core.py +20 -3
- speclog-0.0.6/SpecLog/version.py +0 -1
- {speclog-0.0.6 → speclog-0.0.8}/LICENSE +0 -0
- {speclog-0.0.6 → speclog-0.0.8}/SpecLog/SpecLog.py +0 -0
- {speclog-0.0.6 → speclog-0.0.8}/SpecLog/SpecMonitor.py +0 -0
- {speclog-0.0.6 → speclog-0.0.8}/SpecLog/__init__.py +0 -0
- {speclog-0.0.6 → speclog-0.0.8}/SpecLog/config/__init__.py +0 -0
- {speclog-0.0.6 → speclog-0.0.8}/SpecLog/config/config.cfg +0 -0
- {speclog-0.0.6 → speclog-0.0.8}/SpecLog/config/config.py +0 -0
- {speclog-0.0.6 → speclog-0.0.8}/SpecLog/config_editor.py +0 -0
- {speclog-0.0.6 → speclog-0.0.8}/SpecLog/debugLog.py +0 -0
- {speclog-0.0.6 → speclog-0.0.8}/SpecLog/device.py +0 -0
- {speclog-0.0.6 → speclog-0.0.8}/SpecLog/history.py +0 -0
- {speclog-0.0.6 → speclog-0.0.8}/SpecLog/loggerConfig.py +0 -0
- {speclog-0.0.6 → speclog-0.0.8}/SpecLog/logger_status.py +0 -0
- {speclog-0.0.6 → speclog-0.0.8}/SpecLog/run_logger.pyw +0 -0
- {speclog-0.0.6 → speclog-0.0.8}/SpecLog/run_monitor.pyw +0 -0
- {speclog-0.0.6 → speclog-0.0.8}/SpecLog/startup_task.py +0 -0
- {speclog-0.0.6 → speclog-0.0.8}/SpecLog/ui/__init__.py +0 -0
- {speclog-0.0.6 → speclog-0.0.8}/SpecLog/ui/config_editor.py +0 -0
- {speclog-0.0.6 → speclog-0.0.8}/SpecLog/ui/plotting.py +0 -0
- {speclog-0.0.6 → speclog-0.0.8}/SpecLog/ui/plotting.ui +0 -0
- {speclog-0.0.6 → speclog-0.0.8}/SpecLog.egg-info/dependency_links.txt +0 -0
- {speclog-0.0.6 → speclog-0.0.8}/SpecLog.egg-info/entry_points.txt +0 -0
- {speclog-0.0.6 → speclog-0.0.8}/SpecLog.egg-info/requires.txt +0 -0
- {speclog-0.0.6 → speclog-0.0.8}/SpecLog.egg-info/top_level.txt +0 -0
- {speclog-0.0.6 → speclog-0.0.8}/pyproject.toml +0 -0
- {speclog-0.0.6 → speclog-0.0.8}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: SpecLog
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.8
|
|
4
4
|
Summary: A Python Package for logging data from instrumentations
|
|
5
5
|
Author-email: Yen-Chun Huang <yen-chun.huang@bruker.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -101,16 +101,14 @@ SpecLogger start
|
|
|
101
101
|
SpecLogger stop
|
|
102
102
|
```
|
|
103
103
|
|
|
104
|
+
These commands control the installed **SpecLogger** scheduled task; they do not
|
|
105
|
+
start a separate logger process. Enable the startup task first if it is not yet
|
|
106
|
+
installed.
|
|
107
|
+
|
|
104
108
|
You can also use **Start** and **Stop** at the bottom of the configuration
|
|
105
109
|
editor. Current status is shown as **Running**, **Stopped**, or **Status
|
|
106
110
|
unavailable**. Operation results and errors appear in the **Messages** area.
|
|
107
111
|
|
|
108
|
-
For troubleshooting, start the logger with a visible debug console:
|
|
109
|
-
|
|
110
|
-
```text
|
|
111
|
-
SpecLogger -debug True
|
|
112
|
-
```
|
|
113
|
-
|
|
114
112
|
## Start logging automatically without login
|
|
115
113
|
|
|
116
114
|
Open a terminal as Administrator and enable system startup:
|
|
@@ -135,7 +133,11 @@ SpecLogger -startup False
|
|
|
135
133
|
```
|
|
136
134
|
|
|
137
135
|
The configuration editor also provides **Enable** and **Disable** startup
|
|
138
|
-
buttons. Administrator permission is normally required to use them.
|
|
136
|
+
buttons. Administrator permission is normally required to use them.
|
|
137
|
+
|
|
138
|
+
After **Enable**, open **Task Scheduler** and find **Speclogger** task, disable
|
|
139
|
+
**Stop the task if it runs longer than** in **settings**.
|
|
140
|
+
|
|
139
141
|
|
|
140
142
|
If the startup task was created by another administrator, a standard account
|
|
141
143
|
may show startup as **Unavailable**. If new log data is still being written, the
|
|
@@ -151,10 +153,28 @@ SpecMonitor
|
|
|
151
153
|
```
|
|
152
154
|
|
|
153
155
|
Use the monitoring-item controls to select which measurements are plotted. Use
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
156
|
+
**Historical Data** to open a separate historical-data window. Enter a start time
|
|
157
|
+
and duration, choose curves from the **Items to plot** checklist, then click
|
|
158
|
+
**OK** to plot the selected range in that window. This checklist is independent
|
|
159
|
+
of the main monitor's live-item selection. After data is loaded, checking or
|
|
160
|
+
unchecking an item updates the historical plot immediately without loading the
|
|
161
|
+
files again. The main monitor remains open and
|
|
162
|
+
continues displaying live data. Click **Reset** to cancel the current historical
|
|
163
|
+
request and clear the selection fields and plot.
|
|
164
|
+
|
|
165
|
+
The historical plot uses a time-only horizontal axis; its title shows the full
|
|
166
|
+
start and end date/time. Click **Save** to export the loaded Date, Time, and
|
|
167
|
+
currently checked measurement items to a CSV file.
|
|
168
|
+
|
|
169
|
+
Click **Load** in the Historical Data window to open an existing SpecLog CSV
|
|
170
|
+
file in the historical plot. File loading is kept out of the main monitor so its
|
|
171
|
+
graph continues showing live data.
|
|
172
|
+
|
|
173
|
+
Click **Save Figure** to export the historical plot, including its title, axes,
|
|
174
|
+
curves, and legend, as a PNG image.
|
|
175
|
+
|
|
176
|
+
To load all available history, leave Start Time empty, keep Duration at **All**,
|
|
177
|
+
and click **OK**. The first import may take longer; later queries load only new or changed
|
|
158
178
|
files.
|
|
159
179
|
|
|
160
180
|
Start the monitor with a visible debug console when troubleshooting:
|
|
@@ -163,6 +183,19 @@ Start the monitor with a visible debug console when troubleshooting:
|
|
|
163
183
|
SpecMonitor -debug True
|
|
164
184
|
```
|
|
165
185
|
|
|
186
|
+
Monitor curves use a high-contrast subset of the packaged Bruker color palette
|
|
187
|
+
that remains visible on a white background. They cycle through solid, dashed,
|
|
188
|
+
dotted, and dash-dot line shapes when additional curve styles are needed. Style
|
|
189
|
+
assignment is recalculated from the currently selected items, so selections that
|
|
190
|
+
fit within the color palette use solid lines only. These
|
|
191
|
+
application styles are stored internally in
|
|
192
|
+
`SpecLog/config/monitor_config.cfg`; they are separate from the public device
|
|
193
|
+
configuration.
|
|
194
|
+
|
|
195
|
+
Plot legends are displayed below the curves rather than over them. Legend and
|
|
196
|
+
axis text use larger fonts, and long legends automatically use additional
|
|
197
|
+
columns.
|
|
198
|
+
|
|
166
199
|
## Common status messages
|
|
167
200
|
|
|
168
201
|
- **Running**: The logger is active and directly detectable.
|
|
@@ -82,16 +82,14 @@ SpecLogger start
|
|
|
82
82
|
SpecLogger stop
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
+
These commands control the installed **SpecLogger** scheduled task; they do not
|
|
86
|
+
start a separate logger process. Enable the startup task first if it is not yet
|
|
87
|
+
installed.
|
|
88
|
+
|
|
85
89
|
You can also use **Start** and **Stop** at the bottom of the configuration
|
|
86
90
|
editor. Current status is shown as **Running**, **Stopped**, or **Status
|
|
87
91
|
unavailable**. Operation results and errors appear in the **Messages** area.
|
|
88
92
|
|
|
89
|
-
For troubleshooting, start the logger with a visible debug console:
|
|
90
|
-
|
|
91
|
-
```text
|
|
92
|
-
SpecLogger -debug True
|
|
93
|
-
```
|
|
94
|
-
|
|
95
93
|
## Start logging automatically without login
|
|
96
94
|
|
|
97
95
|
Open a terminal as Administrator and enable system startup:
|
|
@@ -116,7 +114,11 @@ SpecLogger -startup False
|
|
|
116
114
|
```
|
|
117
115
|
|
|
118
116
|
The configuration editor also provides **Enable** and **Disable** startup
|
|
119
|
-
buttons. Administrator permission is normally required to use them.
|
|
117
|
+
buttons. Administrator permission is normally required to use them.
|
|
118
|
+
|
|
119
|
+
After **Enable**, open **Task Scheduler** and find **Speclogger** task, disable
|
|
120
|
+
**Stop the task if it runs longer than** in **settings**.
|
|
121
|
+
|
|
120
122
|
|
|
121
123
|
If the startup task was created by another administrator, a standard account
|
|
122
124
|
may show startup as **Unavailable**. If new log data is still being written, the
|
|
@@ -132,10 +134,28 @@ SpecMonitor
|
|
|
132
134
|
```
|
|
133
135
|
|
|
134
136
|
Use the monitoring-item controls to select which measurements are plotted. Use
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
137
|
+
**Historical Data** to open a separate historical-data window. Enter a start time
|
|
138
|
+
and duration, choose curves from the **Items to plot** checklist, then click
|
|
139
|
+
**OK** to plot the selected range in that window. This checklist is independent
|
|
140
|
+
of the main monitor's live-item selection. After data is loaded, checking or
|
|
141
|
+
unchecking an item updates the historical plot immediately without loading the
|
|
142
|
+
files again. The main monitor remains open and
|
|
143
|
+
continues displaying live data. Click **Reset** to cancel the current historical
|
|
144
|
+
request and clear the selection fields and plot.
|
|
145
|
+
|
|
146
|
+
The historical plot uses a time-only horizontal axis; its title shows the full
|
|
147
|
+
start and end date/time. Click **Save** to export the loaded Date, Time, and
|
|
148
|
+
currently checked measurement items to a CSV file.
|
|
149
|
+
|
|
150
|
+
Click **Load** in the Historical Data window to open an existing SpecLog CSV
|
|
151
|
+
file in the historical plot. File loading is kept out of the main monitor so its
|
|
152
|
+
graph continues showing live data.
|
|
153
|
+
|
|
154
|
+
Click **Save Figure** to export the historical plot, including its title, axes,
|
|
155
|
+
curves, and legend, as a PNG image.
|
|
156
|
+
|
|
157
|
+
To load all available history, leave Start Time empty, keep Duration at **All**,
|
|
158
|
+
and click **OK**. The first import may take longer; later queries load only new or changed
|
|
139
159
|
files.
|
|
140
160
|
|
|
141
161
|
Start the monitor with a visible debug console when troubleshooting:
|
|
@@ -144,6 +164,19 @@ Start the monitor with a visible debug console when troubleshooting:
|
|
|
144
164
|
SpecMonitor -debug True
|
|
145
165
|
```
|
|
146
166
|
|
|
167
|
+
Monitor curves use a high-contrast subset of the packaged Bruker color palette
|
|
168
|
+
that remains visible on a white background. They cycle through solid, dashed,
|
|
169
|
+
dotted, and dash-dot line shapes when additional curve styles are needed. Style
|
|
170
|
+
assignment is recalculated from the currently selected items, so selections that
|
|
171
|
+
fit within the color palette use solid lines only. These
|
|
172
|
+
application styles are stored internally in
|
|
173
|
+
`SpecLog/config/monitor_config.cfg`; they are separate from the public device
|
|
174
|
+
configuration.
|
|
175
|
+
|
|
176
|
+
Plot legends are displayed below the curves rather than over them. Legend and
|
|
177
|
+
axis text use larger fonts, and long legends automatically use additional
|
|
178
|
+
columns.
|
|
179
|
+
|
|
147
180
|
## Common status messages
|
|
148
181
|
|
|
149
182
|
- **Running**: The logger is active and directly detectable.
|
|
@@ -8,7 +8,6 @@ import argparse
|
|
|
8
8
|
import shutil
|
|
9
9
|
import subprocess
|
|
10
10
|
from .SpecLog import *
|
|
11
|
-
from .logger_status import is_logger_running
|
|
12
11
|
from .startup_task import (
|
|
13
12
|
TASK_SCHEDULER,
|
|
14
13
|
control_arguments,
|
|
@@ -71,12 +70,17 @@ def configure_startup(enabled, executable=None, runner=None):
|
|
|
71
70
|
|
|
72
71
|
|
|
73
72
|
def control_scheduled_logger(action, runner=None):
|
|
74
|
-
"""Start
|
|
73
|
+
"""Start or stop SpecLogger exclusively through Windows Task Scheduler."""
|
|
75
74
|
query = _run_task_scheduler(
|
|
76
75
|
query_arguments(), runner
|
|
77
76
|
)
|
|
78
77
|
if query.returncode:
|
|
79
|
-
|
|
78
|
+
details = (query.stderr or query.stdout).strip()
|
|
79
|
+
raise RuntimeError(
|
|
80
|
+
details
|
|
81
|
+
or "The SpecLogger scheduled task is not installed or is unavailable. "
|
|
82
|
+
"Enable startup first with 'SpecLogger -startup True'."
|
|
83
|
+
)
|
|
80
84
|
result = _run_task_scheduler(
|
|
81
85
|
control_arguments(action), runner
|
|
82
86
|
)
|
|
@@ -171,28 +175,8 @@ def main_func(argv=None):
|
|
|
171
175
|
except RuntimeError as error:
|
|
172
176
|
print(f"Could not control SpecLogger scheduled task: {error}", file=sys.stderr)
|
|
173
177
|
return 1
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
return 0
|
|
177
|
-
|
|
178
|
-
if args.status == "start":
|
|
179
|
-
if is_logger_running():
|
|
180
|
-
print("SpecLogger has started already.")
|
|
181
|
-
return
|
|
182
|
-
if args.debug == "False":
|
|
183
|
-
subprocess.Popen(
|
|
184
|
-
"SpecLogger_running.exe", creationflags=subprocess.CREATE_NO_WINDOW
|
|
185
|
-
)
|
|
186
|
-
print("SpecLogger started")
|
|
187
|
-
elif args.debug == "True":
|
|
188
|
-
os.startfile("SpecLogger_running.exe")
|
|
189
|
-
print("SpecLogger debug mode started")
|
|
190
|
-
|
|
191
|
-
elif args.status == "stop":
|
|
192
|
-
os.system("taskkill /im SpecLogger_running.exe /F /t")
|
|
193
|
-
print("SpecLogger stopped")
|
|
194
|
-
else: # ignore
|
|
195
|
-
return
|
|
178
|
+
print(task_message)
|
|
179
|
+
return 0
|
|
196
180
|
|
|
197
181
|
|
|
198
182
|
if __name__ == "__main__":
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
[Bruker Colors]
|
|
2
|
+
BrukerIce = #008DEB
|
|
3
|
+
BrukerPacific = #054169
|
|
4
|
+
BrukerOcean = #0071BC
|
|
5
|
+
BrukerGlacier = #E5F1F8
|
|
6
|
+
BrukerDolomite = #A0A0A0
|
|
7
|
+
BrukerObsidian = #313331
|
|
8
|
+
BrukerGranite = #737373
|
|
9
|
+
BrukerLimestone = #DCDCDC
|
|
10
|
+
BrukerOrange = #FF9300
|
|
11
|
+
BrukerRed = #FF0011
|
|
12
|
+
BrukerGreen = #AFC800
|
|
13
|
+
|
|
14
|
+
[Roles]
|
|
15
|
+
primary1 = #054169
|
|
16
|
+
primary2 = #0071BC
|
|
17
|
+
secondary1 = #737373
|
|
18
|
+
secondary2 = #A0A0A0
|
|
19
|
+
accent = #FF9300
|
|
20
|
+
|
|
21
|
+
[Plot]
|
|
22
|
+
color_order = BrukerPacific, BrukerIce, BrukerOrange, BrukerGreen, BrukerObsidian, BrukerGranite
|
|
23
|
+
line_styles = solid, dash, dot, dash_dot
|
|
24
|
+
line_width = 2.5
|