SpecLog 0.0.5__tar.gz → 0.0.7__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.
Files changed (38) hide show
  1. {speclog-0.0.5 → speclog-0.0.7}/PKG-INFO +41 -6
  2. {speclog-0.0.5 → speclog-0.0.7}/README.md +40 -5
  3. speclog-0.0.7/SpecLog/config/monitor_config.cfg +24 -0
  4. {speclog-0.0.5 → speclog-0.0.7}/SpecLog/config_editor.py +35 -0
  5. {speclog-0.0.5 → speclog-0.0.7}/SpecLog/monitor.py +727 -55
  6. speclog-0.0.7/SpecLog/monitor_style.py +113 -0
  7. speclog-0.0.7/SpecLog/ui/historical_data.py +116 -0
  8. speclog-0.0.7/SpecLog/version.py +1 -0
  9. {speclog-0.0.5 → speclog-0.0.7}/SpecLog.egg-info/PKG-INFO +41 -6
  10. {speclog-0.0.5 → speclog-0.0.7}/SpecLog.egg-info/SOURCES.txt +3 -0
  11. {speclog-0.0.5 → speclog-0.0.7}/tests/test_core.py +2 -1
  12. speclog-0.0.5/SpecLog/version.py +0 -1
  13. {speclog-0.0.5 → speclog-0.0.7}/LICENSE +0 -0
  14. {speclog-0.0.5 → speclog-0.0.7}/SpecLog/SpecLog.py +0 -0
  15. {speclog-0.0.5 → speclog-0.0.7}/SpecLog/SpecLogger.py +0 -0
  16. {speclog-0.0.5 → speclog-0.0.7}/SpecLog/SpecMonitor.py +0 -0
  17. {speclog-0.0.5 → speclog-0.0.7}/SpecLog/__init__.py +0 -0
  18. {speclog-0.0.5 → speclog-0.0.7}/SpecLog/config/__init__.py +0 -0
  19. {speclog-0.0.5 → speclog-0.0.7}/SpecLog/config/config.cfg +0 -0
  20. {speclog-0.0.5 → speclog-0.0.7}/SpecLog/config/config.py +0 -0
  21. {speclog-0.0.5 → speclog-0.0.7}/SpecLog/debugLog.py +0 -0
  22. {speclog-0.0.5 → speclog-0.0.7}/SpecLog/device.py +0 -0
  23. {speclog-0.0.5 → speclog-0.0.7}/SpecLog/history.py +0 -0
  24. {speclog-0.0.5 → speclog-0.0.7}/SpecLog/loggerConfig.py +0 -0
  25. {speclog-0.0.5 → speclog-0.0.7}/SpecLog/logger_status.py +0 -0
  26. {speclog-0.0.5 → speclog-0.0.7}/SpecLog/run_logger.pyw +0 -0
  27. {speclog-0.0.5 → speclog-0.0.7}/SpecLog/run_monitor.pyw +0 -0
  28. {speclog-0.0.5 → speclog-0.0.7}/SpecLog/startup_task.py +0 -0
  29. {speclog-0.0.5 → speclog-0.0.7}/SpecLog/ui/__init__.py +0 -0
  30. {speclog-0.0.5 → speclog-0.0.7}/SpecLog/ui/config_editor.py +0 -0
  31. {speclog-0.0.5 → speclog-0.0.7}/SpecLog/ui/plotting.py +0 -0
  32. {speclog-0.0.5 → speclog-0.0.7}/SpecLog/ui/plotting.ui +0 -0
  33. {speclog-0.0.5 → speclog-0.0.7}/SpecLog.egg-info/dependency_links.txt +0 -0
  34. {speclog-0.0.5 → speclog-0.0.7}/SpecLog.egg-info/entry_points.txt +0 -0
  35. {speclog-0.0.5 → speclog-0.0.7}/SpecLog.egg-info/requires.txt +0 -0
  36. {speclog-0.0.5 → speclog-0.0.7}/SpecLog.egg-info/top_level.txt +0 -0
  37. {speclog-0.0.5 → speclog-0.0.7}/pyproject.toml +0 -0
  38. {speclog-0.0.5 → speclog-0.0.7}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: SpecLog
3
- Version: 0.0.5
3
+ Version: 0.0.7
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
@@ -135,7 +135,11 @@ SpecLogger -startup False
135
135
  ```
136
136
 
137
137
  The configuration editor also provides **Enable** and **Disable** startup
138
- buttons. Administrator permission is normally required to use them.
138
+ buttons. Administrator permission is normally required to use them.
139
+
140
+ After **Enable**, open **Task Scheduler** and find **Speclogger** task, disable
141
+ **Stop the task if it runs longer than** in **settings**.
142
+
139
143
 
140
144
  If the startup task was created by another administrator, a standard account
141
145
  may show startup as **Unavailable**. If new log data is still being written, the
@@ -151,10 +155,28 @@ SpecMonitor
151
155
  ```
152
156
 
153
157
  Use the monitoring-item controls to select which measurements are plotted. Use
154
- the data-selection controls to choose a start time and duration.
155
-
156
- To load all available history, leave the date fields at their defaults and click
157
- **Ok**. The first import may take longer; later queries load only new or changed
158
+ **Historical Data** to open a separate historical-data window. Enter a start time
159
+ and duration, choose curves from the **Items to plot** checklist, then click
160
+ **OK** to plot the selected range in that window. This checklist is independent
161
+ of the main monitor's live-item selection. After data is loaded, checking or
162
+ unchecking an item updates the historical plot immediately without loading the
163
+ files again. The main monitor remains open and
164
+ continues displaying live data. Click **Reset** to cancel the current historical
165
+ request and clear the selection fields and plot.
166
+
167
+ The historical plot uses a time-only horizontal axis; its title shows the full
168
+ start and end date/time. Click **Save** to export the loaded Date, Time, and
169
+ currently checked measurement items to a CSV file.
170
+
171
+ Click **Load** in the Historical Data window to open an existing SpecLog CSV
172
+ file in the historical plot. File loading is kept out of the main monitor so its
173
+ graph continues showing live data.
174
+
175
+ Click **Save Figure** to export the historical plot, including its title, axes,
176
+ curves, and legend, as a PNG image.
177
+
178
+ To load all available history, leave Start Time empty, keep Duration at **All**,
179
+ and click **OK**. The first import may take longer; later queries load only new or changed
158
180
  files.
159
181
 
160
182
  Start the monitor with a visible debug console when troubleshooting:
@@ -163,6 +185,19 @@ Start the monitor with a visible debug console when troubleshooting:
163
185
  SpecMonitor -debug True
164
186
  ```
165
187
 
188
+ Monitor curves use a high-contrast subset of the packaged Bruker color palette
189
+ that remains visible on a white background. They cycle through solid, dashed,
190
+ dotted, and dash-dot line shapes when additional curve styles are needed. Style
191
+ assignment is recalculated from the currently selected items, so selections that
192
+ fit within the color palette use solid lines only. These
193
+ application styles are stored internally in
194
+ `SpecLog/config/monitor_config.cfg`; they are separate from the public device
195
+ configuration.
196
+
197
+ Plot legends are displayed below the curves rather than over them. Legend and
198
+ axis text use larger fonts, and long legends automatically use additional
199
+ columns.
200
+
166
201
  ## Common status messages
167
202
 
168
203
  - **Running**: The logger is active and directly detectable.
@@ -116,7 +116,11 @@ SpecLogger -startup False
116
116
  ```
117
117
 
118
118
  The configuration editor also provides **Enable** and **Disable** startup
119
- buttons. Administrator permission is normally required to use them.
119
+ buttons. Administrator permission is normally required to use them.
120
+
121
+ After **Enable**, open **Task Scheduler** and find **Speclogger** task, disable
122
+ **Stop the task if it runs longer than** in **settings**.
123
+
120
124
 
121
125
  If the startup task was created by another administrator, a standard account
122
126
  may show startup as **Unavailable**. If new log data is still being written, the
@@ -132,10 +136,28 @@ SpecMonitor
132
136
  ```
133
137
 
134
138
  Use the monitoring-item controls to select which measurements are plotted. Use
135
- the data-selection controls to choose a start time and duration.
136
-
137
- To load all available history, leave the date fields at their defaults and click
138
- **Ok**. The first import may take longer; later queries load only new or changed
139
+ **Historical Data** to open a separate historical-data window. Enter a start time
140
+ and duration, choose curves from the **Items to plot** checklist, then click
141
+ **OK** to plot the selected range in that window. This checklist is independent
142
+ of the main monitor's live-item selection. After data is loaded, checking or
143
+ unchecking an item updates the historical plot immediately without loading the
144
+ files again. The main monitor remains open and
145
+ continues displaying live data. Click **Reset** to cancel the current historical
146
+ request and clear the selection fields and plot.
147
+
148
+ The historical plot uses a time-only horizontal axis; its title shows the full
149
+ start and end date/time. Click **Save** to export the loaded Date, Time, and
150
+ currently checked measurement items to a CSV file.
151
+
152
+ Click **Load** in the Historical Data window to open an existing SpecLog CSV
153
+ file in the historical plot. File loading is kept out of the main monitor so its
154
+ graph continues showing live data.
155
+
156
+ Click **Save Figure** to export the historical plot, including its title, axes,
157
+ curves, and legend, as a PNG image.
158
+
159
+ To load all available history, leave Start Time empty, keep Duration at **All**,
160
+ and click **OK**. The first import may take longer; later queries load only new or changed
139
161
  files.
140
162
 
141
163
  Start the monitor with a visible debug console when troubleshooting:
@@ -144,6 +166,19 @@ Start the monitor with a visible debug console when troubleshooting:
144
166
  SpecMonitor -debug True
145
167
  ```
146
168
 
169
+ Monitor curves use a high-contrast subset of the packaged Bruker color palette
170
+ that remains visible on a white background. They cycle through solid, dashed,
171
+ dotted, and dash-dot line shapes when additional curve styles are needed. Style
172
+ assignment is recalculated from the currently selected items, so selections that
173
+ fit within the color palette use solid lines only. These
174
+ application styles are stored internally in
175
+ `SpecLog/config/monitor_config.cfg`; they are separate from the public device
176
+ configuration.
177
+
178
+ Plot legends are displayed below the curves rather than over them. Legend and
179
+ axis text use larger fonts, and long legends automatically use additional
180
+ columns.
181
+
147
182
  ## Common status messages
148
183
 
149
184
  - **Running**: The logger is active and directly detectable.
@@ -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
@@ -45,6 +45,7 @@ class ConfigEditor(QMainWindow):
45
45
  self.logger_log_offset = 0
46
46
  self.startup_state = "Checking..."
47
47
  self.scheduled_task_running = False
48
+ self._closing = False
48
49
  self.setWindowTitle("SpecLog Configuration")
49
50
  self.resize(900, 600)
50
51
  self._build_ui()
@@ -95,6 +96,36 @@ class ConfigEditor(QMainWindow):
95
96
  self.startup_timer.start()
96
97
  self._refresh_startup_status()
97
98
 
99
+ def closeEvent(self, event):
100
+ """Stop status probes before Qt destroys the editor's widgets."""
101
+ self._closing = True
102
+ for timer_name in ("logger_timer", "startup_timer"):
103
+ timer = getattr(self, timer_name, None)
104
+ if timer is not None:
105
+ timer.stop()
106
+
107
+ # A process can emit errorOccurred while its parent and sibling widgets
108
+ # are being torn down. Block those callbacks first, then ensure no
109
+ # child process is left running when its QProcess wrapper is destroyed.
110
+ for process_name in (
111
+ "task_state_process",
112
+ "startup_query_process",
113
+ "logger_process",
114
+ "startup_process",
115
+ ):
116
+ process = getattr(self, process_name, None)
117
+ if process is None:
118
+ continue
119
+ process.blockSignals(True)
120
+ if process.state() == QProcess.ProcessState.NotRunning:
121
+ continue
122
+ process.terminate()
123
+ if not process.waitForFinished(500):
124
+ process.kill()
125
+ process.waitForFinished(1000)
126
+
127
+ super().closeEvent(event)
128
+
98
129
  def _update_command_buttons(self, tab_index):
99
130
  self.add_value_command_button.setVisible(tab_index == 0)
100
131
  self.add_status_command_button.setVisible(tab_index == 1)
@@ -115,6 +146,8 @@ class ConfigEditor(QMainWindow):
115
146
  return is_logger_running()
116
147
 
117
148
  def _refresh_logger_status(self):
149
+ if self._closing:
150
+ return
118
151
  if os.name != "nt":
119
152
  self.logger_status_label.setText("Status unavailable")
120
153
  self.start_logger_button.setEnabled(False)
@@ -286,6 +319,8 @@ class ConfigEditor(QMainWindow):
286
319
  )
287
320
 
288
321
  def _refresh_startup_status(self):
322
+ if self._closing:
323
+ return
289
324
  if os.name != "nt":
290
325
  self._set_startup_state("Unavailable")
291
326
  return