diff options
| author | Christian Kolset <christian.kolset@gmail.com> | 2026-08-01 22:55:49 -0600 |
|---|---|---|
| committer | Christian Kolset <christian.kolset@gmail.com> | 2026-08-01 23:02:14 -0600 |
| commit | e1b951db7714a9496ebf7f861a6741598d4c7e67 (patch) | |
| tree | 2c10266de94b9649e5fab65aac1fd33a87de2528 | |
| parent | 91b0b613f0b58498315ef91f6a541dd1089b88de (diff) | |
Major control panel improvements.
- Added dedicated firmware file for arduino
- Added View button to consolidate windows
- Control Panel changes:
- Changed name fron "Controls" to "Control Panel"
- Blue side bar when Panel is hidden.
- Supports "popping" out contorl panel
- Settings > Advanced tab added with developer settings
| -rw-r--r-- | .gitignore | 12 | ||||
| -rw-r--r-- | api_layers/arduino_layer.py | 224 | ||||
| -rw-r--r-- | api_layers/firmware/LabUI_firmware.ino | 218 | ||||
| -rw-r--r-- | plugins/enabled.json | 2 | ||||
| -rw-r--r-- | scripts/release/.tufup-repo-config | 34 | ||||
| -rwxr-xr-x | scripts/release/repository/metadata/1.root.json | 71 | ||||
| -rwxr-xr-x | scripts/release/repository/metadata/root.json | 71 | ||||
| -rwxr-xr-x | scripts/release/repository/metadata/snapshot.json | 19 | ||||
| -rwxr-xr-x | scripts/release/repository/metadata/targets.json | 15 | ||||
| -rwxr-xr-x | scripts/release/repository/metadata/timestamp.json | 19 | ||||
| -rw-r--r-- | ui/control_panel.py | 13 | ||||
| -rw-r--r-- | ui/main_window.py | 183 | ||||
| -rw-r--r-- | ui/style_dark.qss | 31 | ||||
| -rw-r--r-- | ui/style_light.qss | 8 | ||||
| -rw-r--r-- | ui/windows/settings_window.py | 41 |
15 files changed, 682 insertions, 279 deletions
@@ -1,5 +1,15 @@ logs/* -__pychache__/ +__pycache__/ *.pyc *.pyo + +# Build artifacts +build/ +dist/ + +# TUF release keystore (private signing keys) +scripts/release/keystore/ + +# Claude project memory +.claude/ diff --git a/api_layers/arduino_layer.py b/api_layers/arduino_layer.py index 4f8cee4..88a2655 100644 --- a/api_layers/arduino_layer.py +++ b/api_layers/arduino_layer.py @@ -569,226 +569,6 @@ class ArduinoLayer: # ═══════════════════════════════════════════════════════════════════════════ -# ARDUINO FIRMWARE — upload this to your board +# Arduino firmware source: api_layers/firmware/LabUI_firmware.ino +# Upload to board via Arduino IDE (115200 baud). # ═══════════════════════════════════════════════════════════════════════════ - -ARDUINO_FIRMWARE = r""" -/* - * LabDAQ Arduino Firmware v1.1 - * ───────────────────────────────────────────────────────────────────────── - * Upload this sketch to your Arduino. - * Set baud rate to 115200 in both this sketch and LabDAQ. - * - * WHAT IT DOES - * Continuously streams analog + digital readings to the PC. - * Listens for commands from the PC and executes them. - * - * RECEIVED COMMANDS (PC → Arduino): - * W:D13:1 digitalWrite(13, HIGH) - * W:D6:0 digitalWrite(6, LOW) - * P:D9:128 analogWrite(9, 128) → ~50% PWM - * C:SETPOINT:75.0 store named parameter - * Q:A0 reply immediately with A0 reading - * R:ALL send full data frame immediately - * X:STOP set all outputs LOW - * X:RESET reset to defaults - * - * SENT DATA (Arduino → PC): - * A0:3.142,A1:0.015,D2:0,D3:1\n (every SEND_INTERVAL ms) - * ACK:W:D13:1\n (after each command) - * ERR:Unknown command\n (on parse failure) - * ───────────────────────────────────────────────────────────────────────── - */ - -// ── Configuration ───────────────────────────────────────────────────────── -int ANALOG_PINS[6] = {A0, A1, A2, A3, A4, A5}; // actual pin numbers (reconfigured by APIN:) -int ANALOG_IDX[6] = {0, 1, 2, 3, 4, 5}; // label indices used in output (A0, A1, …) -int DIGITAL_IN[16] = {2, 3, 4}; // reconfigured at runtime via DPIN:IN: -int DIGITAL_OUT[16] = {5, 6, 7, 9, 10, 11}; // reconfigured via DPIN:OUT: -int N_ANALOG = 0; // set by APIN: command (0 = inactive until configured by PC) -int N_DIG_IN = 0; // set by DPIN:IN: command (0 = inactive until configured) -int N_DIG_OUT = 0; // set by DPIN:OUT: command (0 = inactive until configured) -const int SEND_INTERVAL = 50; // ms between data frames (50 = 20 Hz) -const long BAUD_RATE = 115200; - -// ── Named parameters (set via C: commands) ────────────────────────────── -float param_setpoint = 0.0; -float param_kp = 1.0; -float param_ki = 0.0; -float param_kd = 0.0; -int param_mode = 0; - -unsigned long lastSend = 0; - -// ── Setup ───────────────────────────────────────────────────────────────── -void setup() { - Serial.begin(BAUD_RATE); - for (int i = 0; i < N_DIG_IN; i++) pinMode(DIGITAL_IN[i], INPUT_PULLUP); - for (int i = 0; i < N_DIG_OUT; i++) pinMode(DIGITAL_OUT[i], OUTPUT); -} - -// ── Main loop ───────────────────────────────────────────────────────────── -void loop() { - handleCommands(); - sendData(); -} - -// ── Command handler ─────────────────────────────────────────────────────── -void handleCommands() { - if (!Serial.available()) return; - - String cmd = Serial.readStringUntil('\n'); - cmd.trim(); - if (cmd.length() == 0) return; - - char type = cmd.charAt(0); - - // W:Dxx:val — digital write - if (type == 'W') { - int c1 = cmd.indexOf(':', 2); - if (c1 < 0) { Serial.println("ERR:Bad W format"); return; } - String pinStr = cmd.substring(2, c1); - int val = cmd.substring(c1 + 1).toInt(); - int pin = pinStr.substring(1).toInt(); // strip 'D' - digitalWrite(pin, val ? HIGH : LOW); - Serial.print("ACK:"); Serial.println(cmd); - } - - // P:Dxx:duty — PWM write (0-255) - else if (type == 'P') { - int c1 = cmd.indexOf(':', 2); - if (c1 < 0) { Serial.println("ERR:Bad P format"); return; } - int pin = cmd.substring(2, c1).substring(1).toInt(); - int duty = constrain(cmd.substring(c1 + 1).toInt(), 0, 255); - analogWrite(pin, duty); - Serial.print("ACK:"); Serial.println(cmd); - } - - // C:NAME:value — set named parameter - else if (type == 'C') { - int c1 = cmd.indexOf(':', 2); - int c2 = cmd.indexOf(':', c1 + 1); - if (c1 < 0 || c2 < 0) { Serial.println("ERR:Bad C format"); return; } - String name = cmd.substring(2, c1); - float val = cmd.substring(c2 + 1).toFloat(); - if (name == "SETPOINT") param_setpoint = val; - else if (name == "KP") param_kp = val; - else if (name == "KI") param_ki = val; - else if (name == "KD") param_kd = val; - else if (name == "MODE") param_mode = (int)val; - // Add your own parameters here: - // else if (name == "SPEED") motor_speed = val; - Serial.print("ACK:"); Serial.println(cmd); - } - - // Q:NAME — immediate query - else if (type == 'Q') { - String name = cmd.substring(2); - if (name == "SETPOINT") { Serial.print("SETPOINT:"); Serial.println(param_setpoint, 3); } - else if (name == "KP") { Serial.print("KP:"); Serial.println(param_kp, 4); } - else { - // Try to read as analog pin Q:A0 - if (name.charAt(0) == 'A') { - int pin = name.substring(1).toInt(); - float v = analogRead(pin) * (5.0 / 1023.0); - Serial.print(name); Serial.print(":"); Serial.println(v, 3); - } - } - } - - // R:ALL — send full frame immediately - else if (type == 'R') { - sendFrame(); - } - - // X:STOP / X:RESET — emergency stop - else if (type == 'X') { - String sub = cmd.substring(2); - for (int i = 0; i < N_DIG_OUT; i++) digitalWrite(DIGITAL_OUT[i], LOW); - Serial.print("ACK:"); Serial.println(cmd); - } - - // APIN:0,1,3 — reconfigure analog inputs at runtime (indices 0–5 into A0–A5) - else if (type == 'A') { - if (!cmd.startsWith("APIN:")) { Serial.println("ERR:Bad A command"); return; } - String pinList = cmd.substring(5); // "0,1,3" - const int _APINS[] = {A0,A1,A2,A3,A4,A5}; - N_ANALOG = 0; - int start = 0; - for (int i = 0; i <= (int)pinList.length(); i++) { - if (i == (int)pinList.length() || pinList[i] == ',') { - String tok = pinList.substring(start, i); tok.trim(); - if (tok.length() > 0 && N_ANALOG < 6) { - int idx = tok.toInt(); - if (idx >= 0 && idx < 6) { - ANALOG_PINS[N_ANALOG] = _APINS[idx]; - ANALOG_IDX[N_ANALOG] = idx; - N_ANALOG++; - } - } - start = i + 1; - } - } - Serial.print("ACK:"); Serial.println(cmd); - } - - // DPIN:IN:2,3,8 or DPIN:OUT:5,6,7 — reconfigure digital I/O pins at runtime - else if (type == 'D') { - int c1 = cmd.indexOf(':', 2); - int c2 = (c1 >= 0) ? cmd.indexOf(':', c1 + 1) : -1; - if (c1 < 0 || c2 < 0) { Serial.println("ERR:Bad DPIN format"); return; } - String dir = cmd.substring(2, c1); // "IN" or "OUT" - String pinList = cmd.substring(c2 + 1); // "2,3,8" - bool isIn = (dir == "IN"); - int* arr = isIn ? DIGITAL_IN : DIGITAL_OUT; - int* cnt = isIn ? &N_DIG_IN : &N_DIG_OUT; - int mode = isIn ? INPUT_PULLUP : OUTPUT; - *cnt = 0; - int start = 0; - for (int i = 0; i <= (int)pinList.length(); i++) { - if (i == (int)pinList.length() || pinList[i] == ',') { - String tok = pinList.substring(start, i); tok.trim(); - if (tok.length() > 0 && *cnt < 16) { - arr[*cnt] = tok.toInt(); - pinMode(arr[*cnt], mode); - (*cnt)++; - } - start = i + 1; - } - } - Serial.print("ACK:"); Serial.println(cmd); - } - - else { - Serial.print("ERR:Unknown command: "); Serial.println(cmd); - } -} - -// ── Data sender ─────────────────────────────────────────────────────────── -void sendData() { - if (millis() - lastSend < SEND_INTERVAL) return; - lastSend = millis(); - sendFrame(); -} - -void sendFrame() { - String out = ""; - bool first = true; - // Analog inputs — converted to 0.0–5.0 V - for (int i = 0; i < N_ANALOG; i++) { - float v = analogRead(ANALOG_PINS[i]) * (5.0 / 1023.0); - if (!first) out += ","; - out += "A" + String(ANALOG_IDX[i]) + ":" + String(v, 3); - first = false; - } - // Digital inputs (INPUT_PULLUP — invert so pressed=1) - // These share the same output line as analog — one line per frame. - for (int i = 0; i < N_DIG_IN; i++) { - if (!first) out += ","; - out += "D" + String(DIGITAL_IN[i]) + ":" + String(!digitalRead(DIGITAL_IN[i])); - first = false; - } - Serial.println(out); - // Example combined output: A0:3.142,D2:0,D3:1 -} -""" diff --git a/api_layers/firmware/LabUI_firmware.ino b/api_layers/firmware/LabUI_firmware.ino new file mode 100644 index 0000000..8f1b252 --- /dev/null +++ b/api_layers/firmware/LabUI_firmware.ino @@ -0,0 +1,218 @@ +/* + * LabUI Arduino Firmware v1.1 + * ───────────────────────────────────────────────────────────────────────── + * Upload this sketch to your Arduino. + * Set baud rate to 115200 in both this sketch and LabUI. + * + * WHAT IT DOES + * Continuously streams analog + digital readings to the PC. + * Listens for commands from the PC and executes them. + * + * RECEIVED COMMANDS (PC → Arduino): + * W:D13:1 digitalWrite(13, HIGH) + * W:D6:0 digitalWrite(6, LOW) + * P:D9:128 analogWrite(9, 128) → ~50% PWM + * C:SETPOINT:75.0 store named parameter + * Q:A0 reply immediately with A0 reading + * R:ALL send full data frame immediately + * X:STOP set all outputs LOW + * X:RESET reset to defaults + * + * SENT DATA (Arduino → PC): + * A0:3.142,A1:0.015,D2:0,D3:1\n (every SEND_INTERVAL ms) + * ACK:W:D13:1\n (after each command) + * ERR:Unknown command\n (on parse failure) + * ───────────────────────────────────────────────────────────────────────── + */ + +// ── Configuration ───────────────────────────────────────────────────────── +int ANALOG_PINS[6] = {A0, A1, A2, A3, A4, A5}; // actual pin numbers (reconfigured by APIN:) +int ANALOG_IDX[6] = {0, 1, 2, 3, 4, 5}; // label indices used in output (A0, A1, …) +int DIGITAL_IN[16] = {2, 3, 4}; // reconfigured at runtime via DPIN:IN: +int DIGITAL_OUT[16] = {5, 6, 7, 9, 10, 11}; // reconfigured via DPIN:OUT: +int N_ANALOG = 0; // set by APIN: command (0 = inactive until configured by PC) +int N_DIG_IN = 0; // set by DPIN:IN: command (0 = inactive until configured) +int N_DIG_OUT = 0; // set by DPIN:OUT: command (0 = inactive until configured) +const int SEND_INTERVAL = 50; // ms between data frames (50 = 20 Hz) +const long BAUD_RATE = 115200; + +// ── Named parameters (set via C: commands) ────────────────────────────── +float param_setpoint = 0.0; +float param_kp = 1.0; +float param_ki = 0.0; +float param_kd = 0.0; +int param_mode = 0; + +unsigned long lastSend = 0; + +// ── Setup ───────────────────────────────────────────────────────────────── +void setup() { + Serial.begin(BAUD_RATE); + for (int i = 0; i < N_DIG_IN; i++) pinMode(DIGITAL_IN[i], INPUT_PULLUP); + for (int i = 0; i < N_DIG_OUT; i++) pinMode(DIGITAL_OUT[i], OUTPUT); +} + +// ── Main loop ───────────────────────────────────────────────────────────── +void loop() { + handleCommands(); + sendData(); +} + +// ── Command handler ─────────────────────────────────────────────────────── +void handleCommands() { + if (!Serial.available()) return; + + String cmd = Serial.readStringUntil('\n'); + cmd.trim(); + if (cmd.length() == 0) return; + + char type = cmd.charAt(0); + + // W:Dxx:val — digital write + if (type == 'W') { + int c1 = cmd.indexOf(':', 2); + if (c1 < 0) { Serial.println("ERR:Bad W format"); return; } + String pinStr = cmd.substring(2, c1); + int val = cmd.substring(c1 + 1).toInt(); + int pin = pinStr.substring(1).toInt(); // strip 'D' + digitalWrite(pin, val ? HIGH : LOW); + Serial.print("ACK:"); Serial.println(cmd); + } + + // P:Dxx:duty — PWM write (0-255) + else if (type == 'P') { + int c1 = cmd.indexOf(':', 2); + if (c1 < 0) { Serial.println("ERR:Bad P format"); return; } + int pin = cmd.substring(2, c1).substring(1).toInt(); + int duty = constrain(cmd.substring(c1 + 1).toInt(), 0, 255); + analogWrite(pin, duty); + Serial.print("ACK:"); Serial.println(cmd); + } + + // C:NAME:value — set named parameter + else if (type == 'C') { + int c1 = cmd.indexOf(':', 2); + int c2 = cmd.indexOf(':', c1 + 1); + if (c1 < 0 || c2 < 0) { Serial.println("ERR:Bad C format"); return; } + String name = cmd.substring(2, c1); + float val = cmd.substring(c2 + 1).toFloat(); + if (name == "SETPOINT") param_setpoint = val; + else if (name == "KP") param_kp = val; + else if (name == "KI") param_ki = val; + else if (name == "KD") param_kd = val; + else if (name == "MODE") param_mode = (int)val; + // Add your own parameters here: + // else if (name == "SPEED") motor_speed = val; + Serial.print("ACK:"); Serial.println(cmd); + } + + // Q:NAME — immediate query + else if (type == 'Q') { + String name = cmd.substring(2); + if (name == "SETPOINT") { Serial.print("SETPOINT:"); Serial.println(param_setpoint, 3); } + else if (name == "KP") { Serial.print("KP:"); Serial.println(param_kp, 4); } + else { + // Try to read as analog pin Q:A0 + if (name.charAt(0) == 'A') { + int pin = name.substring(1).toInt(); + float v = analogRead(pin) * (5.0 / 1023.0); + Serial.print(name); Serial.print(":"); Serial.println(v, 3); + } + } + } + + // R:ALL — send full frame immediately + else if (type == 'R') { + sendFrame(); + } + + // X:STOP / X:RESET — emergency stop + else if (type == 'X') { + String sub = cmd.substring(2); + for (int i = 0; i < N_DIG_OUT; i++) digitalWrite(DIGITAL_OUT[i], LOW); + Serial.print("ACK:"); Serial.println(cmd); + } + + // APIN:0,1,3 — reconfigure analog inputs at runtime (indices 0–5 into A0–A5) + else if (type == 'A') { + if (!cmd.startsWith("APIN:")) { Serial.println("ERR:Bad A command"); return; } + String pinList = cmd.substring(5); // "0,1,3" + const int _APINS[] = {A0,A1,A2,A3,A4,A5}; + N_ANALOG = 0; + int start = 0; + for (int i = 0; i <= (int)pinList.length(); i++) { + if (i == (int)pinList.length() || pinList[i] == ',') { + String tok = pinList.substring(start, i); tok.trim(); + if (tok.length() > 0 && N_ANALOG < 6) { + int idx = tok.toInt(); + if (idx >= 0 && idx < 6) { + ANALOG_PINS[N_ANALOG] = _APINS[idx]; + ANALOG_IDX[N_ANALOG] = idx; + N_ANALOG++; + } + } + start = i + 1; + } + } + Serial.print("ACK:"); Serial.println(cmd); + } + + // DPIN:IN:2,3,8 or DPIN:OUT:5,6,7 — reconfigure digital I/O pins at runtime + else if (type == 'D') { + int c1 = cmd.indexOf(':', 2); + int c2 = (c1 >= 0) ? cmd.indexOf(':', c1 + 1) : -1; + if (c1 < 0 || c2 < 0) { Serial.println("ERR:Bad DPIN format"); return; } + String dir = cmd.substring(2, c1); // "IN" or "OUT" + String pinList = cmd.substring(c2 + 1); // "2,3,8" + bool isIn = (dir == "IN"); + int* arr = isIn ? DIGITAL_IN : DIGITAL_OUT; + int* cnt = isIn ? &N_DIG_IN : &N_DIG_OUT; + int mode = isIn ? INPUT_PULLUP : OUTPUT; + *cnt = 0; + int start = 0; + for (int i = 0; i <= (int)pinList.length(); i++) { + if (i == (int)pinList.length() || pinList[i] == ',') { + String tok = pinList.substring(start, i); tok.trim(); + if (tok.length() > 0 && *cnt < 16) { + arr[*cnt] = tok.toInt(); + pinMode(arr[*cnt], mode); + (*cnt)++; + } + start = i + 1; + } + } + Serial.print("ACK:"); Serial.println(cmd); + } + + else { + Serial.print("ERR:Unknown command: "); Serial.println(cmd); + } +} + +// ── Data sender ─────────────────────────────────────────────────────────── +void sendData() { + if (millis() - lastSend < SEND_INTERVAL) return; + lastSend = millis(); + sendFrame(); +} + +void sendFrame() { + String out = ""; + bool first = true; + // Analog inputs — converted to 0.0–5.0 V + for (int i = 0; i < N_ANALOG; i++) { + float v = analogRead(ANALOG_PINS[i]) * (5.0 / 1023.0); + if (!first) out += ","; + out += "A" + String(ANALOG_IDX[i]) + ":" + String(v, 3); + first = false; + } + // Digital inputs (INPUT_PULLUP — invert so pressed=1) + // These share the same output line as analog — one line per frame. + for (int i = 0; i < N_DIG_IN; i++) { + if (!first) out += ","; + out += "D" + String(DIGITAL_IN[i]) + ":" + String(!digitalRead(DIGITAL_IN[i])); + first = false; + } + Serial.println(out); + // Example combined output: A0:3.142,D2:0,D3:1 +} diff --git a/plugins/enabled.json b/plugins/enabled.json index a33a40a..7d3abd6 100644 --- a/plugins/enabled.json +++ b/plugins/enabled.json @@ -1,3 +1,3 @@ { - "motion_capture": true + "motion_capture": false }
\ No newline at end of file diff --git a/scripts/release/.tufup-repo-config b/scripts/release/.tufup-repo-config new file mode 100644 index 0000000..e072c2a --- /dev/null +++ b/scripts/release/.tufup-repo-config @@ -0,0 +1,34 @@ +{ + "app_name": "labui", + "app_version_attr": null, + "binary_diff": null, + "encrypted_keys": [], + "expiration_days": { + "root": 365, + "snapshot": 90, + "targets": 90, + "timestamp": 90 + }, + "key_map": { + "root": [ + "root" + ], + "snapshot": [ + "snapshot" + ], + "targets": [ + "targets" + ], + "timestamp": [ + "timestamp" + ] + }, + "keys_dir": "keystore", + "repo_dir": "repository", + "thresholds": { + "root": 1, + "snapshot": 1, + "targets": 1, + "timestamp": 1 + } +}
\ No newline at end of file diff --git a/scripts/release/repository/metadata/1.root.json b/scripts/release/repository/metadata/1.root.json new file mode 100755 index 0000000..343b2e2 --- /dev/null +++ b/scripts/release/repository/metadata/1.root.json @@ -0,0 +1,71 @@ +{ + "signatures": [ + { + "keyid": "25e91fe88ce247418835d22b18c63a8166038a16b2b9f26f319bc65a8b2687ed", + "sig": "cb0c1b0078781b4b87a181deaa03122a7e1f08dd39fab4eac842acd43397e0c5b268009825fa942e86b368b4edd651e69967182981e8be746a60566b42d36109" + } + ], + "signed": { + "_type": "root", + "consistent_snapshot": false, + "expires": "2027-08-01T23:55:23Z", + "keys": { + "25e91fe88ce247418835d22b18c63a8166038a16b2b9f26f319bc65a8b2687ed": { + "keytype": "ed25519", + "keyval": { + "public": "be8f719618189eb74b524ee92e85eea99a5228fafc7257356b5d8acad2829b24" + }, + "scheme": "ed25519" + }, + "40e5301cd4b92e4a9c2e63dcca99ffa4a5627c25ac6c254f272bb52c9a076cfc": { + "keytype": "ed25519", + "keyval": { + "public": "cbde8cdde12b19b39a786da7128214d01e0f4415e590df34768530fad2bf4702" + }, + "scheme": "ed25519" + }, + "4edf46a4cf08f9b2c59cbe9a435024a8498ce68cc63208f1fbb8b69e74768d42": { + "keytype": "ed25519", + "keyval": { + "public": "1559cdea5a3295593d4c08e6ee625561f7cd96a1dcc0d553b9961734491b801a" + }, + "scheme": "ed25519" + }, + "998b28525eec351c6cdd16d6da3854876e84ab450595feac782ae83d3a8226d6": { + "keytype": "ed25519", + "keyval": { + "public": "6ac7a3b9d83f0d1835ea6fdc0307fe340ea422bc15763fdc0bc197383a61d79b" + }, + "scheme": "ed25519" + } + }, + "roles": { + "root": { + "keyids": [ + "25e91fe88ce247418835d22b18c63a8166038a16b2b9f26f319bc65a8b2687ed" + ], + "threshold": 1 + }, + "snapshot": { + "keyids": [ + "40e5301cd4b92e4a9c2e63dcca99ffa4a5627c25ac6c254f272bb52c9a076cfc" + ], + "threshold": 1 + }, + "targets": { + "keyids": [ + "998b28525eec351c6cdd16d6da3854876e84ab450595feac782ae83d3a8226d6" + ], + "threshold": 1 + }, + "timestamp": { + "keyids": [ + "4edf46a4cf08f9b2c59cbe9a435024a8498ce68cc63208f1fbb8b69e74768d42" + ], + "threshold": 1 + } + }, + "spec_version": "1.0.31", + "version": 1 + } +}
\ No newline at end of file diff --git a/scripts/release/repository/metadata/root.json b/scripts/release/repository/metadata/root.json new file mode 100755 index 0000000..343b2e2 --- /dev/null +++ b/scripts/release/repository/metadata/root.json @@ -0,0 +1,71 @@ +{ + "signatures": [ + { + "keyid": "25e91fe88ce247418835d22b18c63a8166038a16b2b9f26f319bc65a8b2687ed", + "sig": "cb0c1b0078781b4b87a181deaa03122a7e1f08dd39fab4eac842acd43397e0c5b268009825fa942e86b368b4edd651e69967182981e8be746a60566b42d36109" + } + ], + "signed": { + "_type": "root", + "consistent_snapshot": false, + "expires": "2027-08-01T23:55:23Z", + "keys": { + "25e91fe88ce247418835d22b18c63a8166038a16b2b9f26f319bc65a8b2687ed": { + "keytype": "ed25519", + "keyval": { + "public": "be8f719618189eb74b524ee92e85eea99a5228fafc7257356b5d8acad2829b24" + }, + "scheme": "ed25519" + }, + "40e5301cd4b92e4a9c2e63dcca99ffa4a5627c25ac6c254f272bb52c9a076cfc": { + "keytype": "ed25519", + "keyval": { + "public": "cbde8cdde12b19b39a786da7128214d01e0f4415e590df34768530fad2bf4702" + }, + "scheme": "ed25519" + }, + "4edf46a4cf08f9b2c59cbe9a435024a8498ce68cc63208f1fbb8b69e74768d42": { + "keytype": "ed25519", + "keyval": { + "public": "1559cdea5a3295593d4c08e6ee625561f7cd96a1dcc0d553b9961734491b801a" + }, + "scheme": "ed25519" + }, + "998b28525eec351c6cdd16d6da3854876e84ab450595feac782ae83d3a8226d6": { + "keytype": "ed25519", + "keyval": { + "public": "6ac7a3b9d83f0d1835ea6fdc0307fe340ea422bc15763fdc0bc197383a61d79b" + }, + "scheme": "ed25519" + } + }, + "roles": { + "root": { + "keyids": [ + "25e91fe88ce247418835d22b18c63a8166038a16b2b9f26f319bc65a8b2687ed" + ], + "threshold": 1 + }, + "snapshot": { + "keyids": [ + "40e5301cd4b92e4a9c2e63dcca99ffa4a5627c25ac6c254f272bb52c9a076cfc" + ], + "threshold": 1 + }, + "targets": { + "keyids": [ + "998b28525eec351c6cdd16d6da3854876e84ab450595feac782ae83d3a8226d6" + ], + "threshold": 1 + }, + "timestamp": { + "keyids": [ + "4edf46a4cf08f9b2c59cbe9a435024a8498ce68cc63208f1fbb8b69e74768d42" + ], + "threshold": 1 + } + }, + "spec_version": "1.0.31", + "version": 1 + } +}
\ No newline at end of file diff --git a/scripts/release/repository/metadata/snapshot.json b/scripts/release/repository/metadata/snapshot.json new file mode 100755 index 0000000..03821d1 --- /dev/null +++ b/scripts/release/repository/metadata/snapshot.json @@ -0,0 +1,19 @@ +{ + "signatures": [ + { + "keyid": "40e5301cd4b92e4a9c2e63dcca99ffa4a5627c25ac6c254f272bb52c9a076cfc", + "sig": "bd89d38c63ddee6537276a13657a2716a1a88346421a8d51db9fa8c12b9dc6b0db57a48bbab616930b6aaaa91c4a12a54909cd9722e07b23632638d68bd08307" + } + ], + "signed": { + "_type": "snapshot", + "expires": "2026-10-30T23:55:23Z", + "meta": { + "targets.json": { + "version": 1 + } + }, + "spec_version": "1.0.31", + "version": 1 + } +}
\ No newline at end of file diff --git a/scripts/release/repository/metadata/targets.json b/scripts/release/repository/metadata/targets.json new file mode 100755 index 0000000..6296ebe --- /dev/null +++ b/scripts/release/repository/metadata/targets.json @@ -0,0 +1,15 @@ +{ + "signatures": [ + { + "keyid": "998b28525eec351c6cdd16d6da3854876e84ab450595feac782ae83d3a8226d6", + "sig": "88ebf0eac3bea958b3d5d99e713a2af1a8e6d230c414bca1b22f1bf64ce2a8734b3db5eaa80dcc9fdd31c1954864af2828c122bf6d4354b1a06136e478e6d00d" + } + ], + "signed": { + "_type": "targets", + "expires": "2026-10-30T23:55:23Z", + "spec_version": "1.0.31", + "targets": {}, + "version": 1 + } +}
\ No newline at end of file diff --git a/scripts/release/repository/metadata/timestamp.json b/scripts/release/repository/metadata/timestamp.json new file mode 100755 index 0000000..12227b6 --- /dev/null +++ b/scripts/release/repository/metadata/timestamp.json @@ -0,0 +1,19 @@ +{ + "signatures": [ + { + "keyid": "4edf46a4cf08f9b2c59cbe9a435024a8498ce68cc63208f1fbb8b69e74768d42", + "sig": "b11ee59ed85d21b52d25e676a98232c9d63813ac5236493c11d47264065647933f1c28bc9748f8c880174a3ab3bcb27f6786c1c4a596ef80b70fc11b40f9f002" + } + ], + "signed": { + "_type": "timestamp", + "expires": "2026-10-30T23:55:23Z", + "meta": { + "snapshot.json": { + "version": 1 + } + }, + "spec_version": "1.0.31", + "version": 1 + } +}
\ No newline at end of file diff --git a/ui/control_panel.py b/ui/control_panel.py index 6e78e89..61e1807 100644 --- a/ui/control_panel.py +++ b/ui/control_panel.py @@ -532,19 +532,6 @@ class ControlPanel(QWidget): layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(0) - # Header with Add button - hdr_widget = QWidget(); hdr_widget.setObjectName("controlPanelHeader") - hdr_widget.setFixedHeight(30) - hdr_lay = QHBoxLayout(hdr_widget) - hdr_lay.setContentsMargins(8, 0, 6, 0) - hdr_lbl = QLabel("CONTROLS"); hdr_lbl.setObjectName("panelHeader") - hdr_lay.addWidget(hdr_lbl, 1) - add_btn = QPushButton("+"); add_btn.setObjectName("devicesSmallBtn") - add_btn.setFixedSize(24, 22); add_btn.setToolTip("Add control widget") - add_btn.clicked.connect(self._on_add) - hdr_lay.addWidget(add_btn) - layout.addWidget(hdr_widget) - scroll = QScrollArea() scroll.setWidgetResizable(True) scroll.setHorizontalScrollBarPolicy(Qt.ScrollBarPolicy.ScrollBarAlwaysOff) diff --git a/ui/main_window.py b/ui/main_window.py index d0e0ac4..76c203d 100644 --- a/ui/main_window.py +++ b/ui/main_window.py @@ -8,11 +8,13 @@ Toolbar (left→right): from PyQt6.QtWidgets import ( QMainWindow, QWidget, QHBoxLayout, QVBoxLayout, - QSplitter, QStatusBar, QLabel, QPushButton, + QDockWidget, QStatusBar, QLabel, QPushButton, QToolBar, QSizePolicy, QApplication, QFrame, - QAbstractSpinBox, QComboBox, + QAbstractSpinBox, QComboBox, QMenu, ) -from PyQt6.QtCore import Qt, QTimer, QObject, QEvent, pyqtSlot +from PyQt6.QtCore import Qt, QTimer, QObject, QEvent, QRect, pyqtSignal, pyqtSlot +from PyQt6.QtGui import QPainter, QColor, QFont, QAction +import logging import os @@ -27,6 +29,71 @@ class _WheelBlocker(QObject): return True return super().eventFilter(obj, event) +class _CtrlTabStrip(QWidget): + """Thin vertical strip shown on the left edge when the Control Panel dock is hidden. + Clicking it restores the dock. Safety feature — operator can never lose the panel.""" + + clicked = pyqtSignal() + + def __init__(self, parent=None): + super().__init__(parent) + self.setObjectName("ctrlTabStrip") + self.setFixedWidth(22) + self.setCursor(Qt.CursorShape.PointingHandCursor) + self.setToolTip("Show Control Panel") + + def mousePressEvent(self, event): + if event.button() == Qt.MouseButton.LeftButton: + self.clicked.emit() + super().mousePressEvent(event) + + def paintEvent(self, _event): + p = QPainter(self) + p.setRenderHint(QPainter.RenderHint.Antialiasing) + p.fillRect(self.rect(), QColor("#3b82f6")) + p.setPen(QColor("#ffffff")) + font = QFont() + font.setPointSize(8) + font.setBold(True) + p.setFont(font) + p.translate(self.width() / 2.0, self.height() / 2.0) + p.rotate(-90.0) + text_rect = QRect(-self.height() // 2, -self.width() // 2, + self.height(), self.width()) + p.drawText(text_rect, Qt.AlignmentFlag.AlignCenter, "CONTROL PANEL ▶") + p.end() + + +class _DockTitleBar(QWidget): + """Custom title bar for the Control Panel QDockWidget. + Replaces native title bar; provides Add, Float, and Close buttons.""" + + def __init__(self, dock: QDockWidget, add_callback, parent=None): + super().__init__(parent) + self.setObjectName("controlPanelHeader") + self.setFixedHeight(30) + lay = QHBoxLayout(self) + lay.setContentsMargins(8, 0, 4, 0); lay.setSpacing(4) + + lbl = QLabel("CONTROL PANEL"); lbl.setObjectName("panelHeader") + lay.addWidget(lbl, 1) + + add_btn = QPushButton("+"); add_btn.setObjectName("devicesSmallBtn") + add_btn.setFixedSize(24, 22); add_btn.setToolTip("Add control widget") + add_btn.clicked.connect(add_callback) + lay.addWidget(add_btn) + + float_btn = QPushButton("⧉"); float_btn.setObjectName("devicesSmallBtn") + float_btn.setFixedSize(22, 22); float_btn.setToolTip("Float / dock") + float_btn.clicked.connect(lambda: dock.setFloating(not dock.isFloating())) + lay.addWidget(float_btn) + + close_btn = QPushButton("✕"); close_btn.setObjectName("devicesSmallBtn") + close_btn.setFixedSize(22, 22); close_btn.setToolTip("Hide Control Panel") + close_btn.clicked.connect(dock.hide) + lay.addWidget(close_btn) + + from devices.arduino_device import ArduinoDevice from devices.nidaqmx_device import NidaqmxDevice from devices.serial_device import SerialDevice @@ -116,6 +183,38 @@ class MainWindow(QMainWindow): apply_profile=self._profile_apply, ) tb.addWidget(self._file_btn) + + # ── ⊞ View menu ─────────────────────────────────────────────────── + view_btn = QPushButton("⊞ View ▾"); view_btn.setObjectName("toolbarSectionBtn") + self._view_menu = QMenu(self) + + self._act_ctrl_panel = QAction("Control Panel", self) + self._act_ctrl_panel.setCheckable(True); self._act_ctrl_panel.setChecked(True) + self._act_ctrl_panel.triggered.connect(self._on_view_ctrl_panel) + self._view_menu.addAction(self._act_ctrl_panel) + self._view_menu.addSeparator() + + for label, name, opener in [ + ("Devices", "devices", self._open_devices), + ("Channels", "channels", self._open_channels), + ("Plot Builder", "plot", self._open_plot), + ]: + act = QAction(label, self); act.setCheckable(True) + act.triggered.connect( + lambda checked, nm=name, op=opener: + op() if checked else + (getattr(self, f"_win_{nm}") and getattr(self, f"_win_{nm}").hide()) + ) + self._view_menu.addAction(act) + setattr(self, f"_act_{name}", act) + + self._view_plugin_sep = self._view_menu.addSeparator() + self._view_plugin_sep.setVisible(False) + + view_btn.clicked.connect( + lambda: self._view_menu.exec(view_btn.mapToGlobal(view_btn.rect().bottomLeft())) + ) + tb.addWidget(view_btn) tb.addWidget(_sep()) self._run_btn = QPushButton("▶ RUN") @@ -135,23 +234,6 @@ class MainWindow(QMainWindow): tb.addWidget(_sep()) - dev_btn = QPushButton("⊞ Devices") - dev_btn.setObjectName("toolbarSectionBtn"); dev_btn.setCheckable(True) - dev_btn.clicked.connect(lambda c: self._toggle_win("devices", c, dev_btn)) - tb.addWidget(dev_btn); self._btn_devices = dev_btn - - sig_btn = QPushButton("⚗ Channels") - sig_btn.setObjectName("toolbarSectionBtn"); sig_btn.setCheckable(True) - sig_btn.clicked.connect(lambda c: self._toggle_win("channels", c, sig_btn)) - tb.addWidget(sig_btn); self._btn_channels = sig_btn - - plot_btn = QPushButton("📐 Plot") - plot_btn.setObjectName("toolbarSectionBtn"); plot_btn.setCheckable(True) - plot_btn.clicked.connect(lambda c: self._toggle_win("plot", c, plot_btn)) - tb.addWidget(plot_btn); self._btn_plot = plot_btn - - tb.addWidget(_sep()) - # Plugin buttons are inserted here at runtime (between this sep and spacer) self._plugin_sep_action = tb.addWidget(_sep()) self._plugin_sep_action.setVisible(False) @@ -176,18 +258,35 @@ class MainWindow(QMainWindow): central = QWidget(); self.setCentralWidget(central) root = QHBoxLayout(central); root.setContentsMargins(0,0,0,0); root.setSpacing(0) - hsplit = QSplitter(Qt.Orientation.Horizontal); hsplit.setHandleWidth(3) + # Side tab strip — shown when Control Panel dock is hidden + self._ctrl_tab = _CtrlTabStrip() + self._ctrl_tab.setVisible(False) + self._ctrl_tab.clicked.connect(self._show_ctrl_panel) + root.addWidget(self._ctrl_tab) + self._chart = StripChartWidget(self.engine, self.registry, self.processor) + root.addWidget(self._chart, 1) + + # ── Control Panel dock ──────────────────────────────────────────── self._ctrl = ControlPanel(self.registry, processor=self.processor) self._ctrl.setMinimumWidth(200); self._ctrl.setMaximumWidth(340) self._ctrl._add_demo_widgets() - hsplit.addWidget(self._ctrl) - - self._chart = StripChartWidget(self.engine, self.registry, self.processor) - hsplit.addWidget(self._chart) - hsplit.setSizes([260, 1000]) - root.addWidget(hsplit) + self._ctrl_dock = QDockWidget("Control Panel", self) + self._ctrl_dock.setObjectName("controlPanelDock") + self._ctrl_dock.setWidget(self._ctrl) + self._ctrl_dock.setFeatures( + QDockWidget.DockWidgetFeature.DockWidgetMovable | + QDockWidget.DockWidgetFeature.DockWidgetFloatable | + QDockWidget.DockWidgetFeature.DockWidgetClosable + ) + self._ctrl_dock.setAllowedAreas( + Qt.DockWidgetArea.LeftDockWidgetArea | + Qt.DockWidgetArea.RightDockWidgetArea + ) + self.addDockWidget(Qt.DockWidgetArea.LeftDockWidgetArea, self._ctrl_dock) + self._ctrl_dock.setTitleBarWidget(_DockTitleBar(self._ctrl_dock, self._ctrl._on_add)) + self._ctrl_dock.visibilityChanged.connect(self._on_ctrl_dock_visibility) sb = QStatusBar(); self.setStatusBar(sb) self._status = QLabel("Ready"); sb.addWidget(self._status) @@ -196,6 +295,21 @@ class MainWindow(QMainWindow): self._clock = QTimer(self); self._clock.setInterval(1000) self._clock.timeout.connect(self._tick) + def _on_ctrl_dock_visibility(self, visible: bool): + self._ctrl_tab.setVisible(not visible) + if hasattr(self, "_act_ctrl_panel"): + self._act_ctrl_panel.setChecked(visible) + + def _on_view_ctrl_panel(self, checked: bool): + if checked: + self._ctrl_dock.show(); self._ctrl_dock.raise_() + else: + self._ctrl_dock.hide() + + def _show_ctrl_panel(self): + self._ctrl_dock.show() + self._ctrl_dock.raise_() + def _connect_signals(self): self.engine.new_data.connect(self.processor.on_raw_data) self.processor.processed_data.connect(self._chart.on_new_data) @@ -336,14 +450,14 @@ class MainWindow(QMainWindow): self._win_devices.channel_visibility_changed.connect(self._on_channel_visibility_changed) self._win_devices.channel_name_changed.connect(self._on_channel_name_changed) self._win_devices.channel_unit_changed.connect(self._on_channel_unit_changed) - self._win_devices.closed.connect(lambda: self._btn_devices.setChecked(False)) + self._win_devices.closed.connect(lambda: self._act_devices.setChecked(False)) self._show_win(self._win_devices, "right") def _open_channels(self): if self._win_channels is None: self._win_channels = ChannelsWindow(self.registry, self.processor, self) self._win_channels.derived_changed.connect(self._on_derived_changed) - self._win_channels.closed.connect(lambda: self._btn_channels.setChecked(False)) + self._win_channels.closed.connect(lambda: self._act_channels.setChecked(False)) self._show_win(self._win_channels, "right") def _open_plot(self): @@ -351,7 +465,7 @@ class MainWindow(QMainWindow): self._win_plot = PlotWindow(self.registry, self.processor, self._chart._cfg, self) self._win_plot.layout_applied.connect(self._chart.apply_layout) - self._win_plot.closed.connect(lambda: self._btn_plot.setChecked(False)) + self._win_plot.closed.connect(lambda: self._act_plot.setChecked(False)) self._win_plot.refresh_channels() # sync any derived channels else: self._win_plot.cfg = self._chart._cfg @@ -423,7 +537,8 @@ class MainWindow(QMainWindow): if self._win_plot: self._win_plot.refresh_channels() - self._chart.refresh() + self._chart.apply_layout(build_default_layout(self.registry, self.processor)) + self._clear_history() self._status.setText("New profile — blank slate.") def _profile_capture(self, name: str = "Profile") -> Profile: @@ -554,10 +669,16 @@ class MainWindow(QMainWindow): def _apply_settings_on_startup(self): self._apply_theme(self._settings.get("theme", "dark")) self.engine._interval = self._settings.get("poll_ms", 100) / 1000.0 + self._apply_developer_mode(self._settings.get("developer_mode", False)) + + def _apply_developer_mode(self, enabled: bool): + level = logging.DEBUG if enabled else logging.WARNING + logging.getLogger().setLevel(level) def _on_settings(self, cfg: dict): self._settings.update(cfg) self.engine._interval = cfg.get("poll_ms", 100) / 1000.0 + self._apply_developer_mode(cfg.get("developer_mode", False)) save_settings(self._settings) def _tick(self): diff --git a/ui/style_dark.qss b/ui/style_dark.qss index e562365..029d085 100644 --- a/ui/style_dark.qss +++ b/ui/style_dark.qss @@ -322,8 +322,8 @@ QComboBox#traceStyleCb, QDoubleSpinBox#traceWidthSpin { font-family: "IBM Plex Mono", monospace; font-size: 11px; background: #0b0e13; border: 1px solid #1c2540; border-radius: 3px; color: #8b9dc3; padding: 2px 4px; } -QToolButton#traceRemoveBtn { background: transparent; color: #334155; border: none; font-size: 13px; border-radius: 3px; } -QToolButton#traceRemoveBtn:hover { background-color: #450a0a; color: #ef4444; } +QPushButton#traceRemoveBtn { background: transparent; color: #8b9dc3; border: none; font-size: 13px; border-radius: 3px; padding: 0; } +QPushButton#traceRemoveBtn:hover { background-color: #450a0a; color: #ef4444; } QPushButton#addTraceBtn { background-color: #1c2540; color: #8b9dc3; @@ -603,3 +603,30 @@ QLabel#layoutTileLabel { color: #8b9dc3; background: transparent; } + +/* ── Control Panel Dock ──────────────────────────────────────────── */ +QDockWidget#controlPanelDock { + border: none; +} +QDockWidget#controlPanelDock::title { + background-color: #0f1521; + color: #8b9dc3; + padding: 4px 8px; + text-align: left; + font-size: 11px; + font-weight: bold; + letter-spacing: 1px; + border-bottom: 1px solid #2a3558; +} +QDockWidget#controlPanelDock::close-button, +QDockWidget#controlPanelDock::float-button { + background: transparent; + border: none; + padding: 2px; + subcontrol-position: top right; +} +QDockWidget#controlPanelDock::close-button:hover, +QDockWidget#controlPanelDock::float-button:hover { + background: #2a3558; + border-radius: 2px; +} diff --git a/ui/style_light.qss b/ui/style_light.qss index e0a1987..72619c6 100644 --- a/ui/style_light.qss +++ b/ui/style_light.qss @@ -116,6 +116,8 @@ QPushButton#digitalOutBtn:checked { background:#dcfce7; border-color:#22c55e; co QWidget#controlPanelHeader { background:#f1f5f9; border-bottom:1px solid #e2e8f0; } QPushButton#devicesSmallBtn { background:transparent; color:#94a3b8; border:1px solid #e2e8f0; border-radius:3px; font-size:13px; padding:0; } QPushButton#devicesSmallBtn:hover { background:#f0f9ff; color:#3b82f6; border-color:#3b82f6; } +QPushButton#traceRemoveBtn { background:transparent; color:#94a3b8; border:none; font-size:13px; border-radius:3px; padding:0; } +QPushButton#traceRemoveBtn:hover { background:#fee2e2; color:#ef4444; } QPushButton#plotCfgButton { background:#f0f9ff; color:#1d4ed8; border:1px solid #93c5fd; border-radius:4px; padding:5px 14px; font-weight:600; } QPushButton#plotCfgButton:hover { background:#dbeafe; border-color:#3b82f6; } QPushButton#plotCfgButton:checked { background:#dbeafe; border-color:#3b82f6; } @@ -132,3 +134,9 @@ QFrame#layoutTile { background-color:#e2e8f0; border:1px solid #94a3b8; border-r QFrame#layoutTile:hover { border-color:#4338ca; background-color:#c7d2fe; } QFrame#layoutTileDragging { background-color:#bfdbfe; border:2px solid #3b82f6; border-radius:5px; } QLabel#layoutTileLabel { font-family:"IBM Plex Mono",monospace; font-size:11px; font-weight:700; color:#334155; background:transparent; } + +/* Control Panel Dock */ +QDockWidget#controlPanelDock { border: none; } +QDockWidget#controlPanelDock::title { background-color:#f1f5f9; color:#475569; padding:4px 8px; text-align:left; font-size:11px; font-weight:bold; letter-spacing:1px; border-bottom:1px solid #e2e8f0; } +QDockWidget#controlPanelDock::close-button, QDockWidget#controlPanelDock::float-button { background:transparent; border:none; padding:2px; } +QDockWidget#controlPanelDock::close-button:hover, QDockWidget#controlPanelDock::float-button:hover { background:#e2e8f0; border-radius:2px; } diff --git a/ui/windows/settings_window.py b/ui/windows/settings_window.py index 1630efa..1afbca5 100644 --- a/ui/windows/settings_window.py +++ b/ui/windows/settings_window.py @@ -40,6 +40,7 @@ class SettingsWindow(QWidget): "show_grid": True, "font_size": 12, "antialias": True, + "developer_mode": False, } def __init__(self, registry: DeviceRegistry, @@ -77,6 +78,7 @@ class SettingsWindow(QWidget): tabs.addTab(self._acquisition_tab(), " Acquisition ") tabs.addTab(self._display_tab(), " Display ") tabs.addTab(self._plugins_tab(), " Plugins ") + tabs.addTab(self._advanced_tab(), " Advanced ") # Bottom bar btm = QWidget(); btm.setObjectName("cfgBottomBar") @@ -126,6 +128,7 @@ class SettingsWindow(QWidget): self._tw_sp.setValue(self.cfg["time_window_s"]) self._legend_chk.setChecked(self.cfg["show_legend"]) self._grid_chk.setChecked(self.cfg["show_grid"]) + self._dev_mode_chk.setChecked(self.cfg.get("developer_mode", False)) def _acquisition_tab(self): w = QWidget() @@ -256,6 +259,25 @@ class SettingsWindow(QWidget): return card + def _advanced_tab(self): + w = QWidget() + scroll = QScrollArea(); scroll.setWidgetResizable(True) + scroll.setObjectName("deviceScroll") + cont = QWidget(); lay = QFormLayout(cont) + lay.setContentsMargins(16, 14, 16, 14); lay.setSpacing(10) + + self._dev_mode_chk = QCheckBox() + self._dev_mode_chk.setChecked(self.cfg.get("developer_mode", False)) + lay.addRow("Developer mode:", self._dev_mode_chk) + + note = QLabel("Enables verbose DEBUG output in the terminal.\nNo effect when running as a packaged app.") + note.setObjectName("traceSource"); note.setWordWrap(True) + lay.addRow("", note) + + scroll.setWidget(cont) + root = QVBoxLayout(w); root.setContentsMargins(0, 0, 0, 0); root.addWidget(scroll) + return w + def _toggle_plugin(self, plugin_id: str, btn: QPushButton): if self._plugin_mgr.is_enabled(plugin_id): self.plugin_disable_requested.emit(plugin_id) @@ -285,15 +307,16 @@ class SettingsWindow(QWidget): def _apply(self): theme = self._theme_cb.currentText().lower() self.cfg.update({ - "theme": theme, - "font_size": self._font_sp.value(), - "antialias": self._aa_chk.isChecked(), - "poll_ms": self._poll_sp.value(), - "buffer_size": self._buf_sp.value(), - "log_dir": self._log_edit.text(), - "time_window_s": self._tw_sp.value(), - "show_legend": self._legend_chk.isChecked(), - "show_grid": self._grid_chk.isChecked(), + "theme": theme, + "font_size": self._font_sp.value(), + "antialias": self._aa_chk.isChecked(), + "poll_ms": self._poll_sp.value(), + "buffer_size": self._buf_sp.value(), + "log_dir": self._log_edit.text(), + "time_window_s": self._tw_sp.value(), + "show_legend": self._legend_chk.isChecked(), + "show_grid": self._grid_chk.isChecked(), + "developer_mode": self._dev_mode_chk.isChecked(), }) self.theme_changed.emit(theme) self.settings_changed.emit(dict(self.cfg)) |
