plasma-app 2.2.2__tar.gz → 2.2.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.
Files changed (76) hide show
  1. {plasma_app-2.2.2 → plasma_app-2.2.3}/PKG-INFO +2 -2
  2. {plasma_app-2.2.2 → plasma_app-2.2.3}/README.md +1 -1
  3. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/__init__.py +1 -1
  4. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/devices/msense/config.py +28 -6
  5. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/devices/msense/device.py +32 -1
  6. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma_app.egg-info/PKG-INFO +2 -2
  7. {plasma_app-2.2.2 → plasma_app-2.2.3}/LICENSE +0 -0
  8. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/__main__.py +0 -0
  9. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/__pyinstaller/__init__.py +0 -0
  10. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/__pyinstaller/hook-plasma.py +0 -0
  11. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/api.py +0 -0
  12. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/app_context.py +0 -0
  13. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/build_info.py +0 -0
  14. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/config.py +0 -0
  15. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/ctl.py +0 -0
  16. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/desktop_shortcut.py +0 -0
  17. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/devices/__init__.py +0 -0
  18. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/devices/bitalino.py +0 -0
  19. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/devices/msense/__init__.py +0 -0
  20. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/devices/msense/ble_scan.py +0 -0
  21. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/devices/msense/bleak_probe.py +0 -0
  22. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/devices/msense/bleak_reconnect_test.py +0 -0
  23. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/devices/msense/detect.py +0 -0
  24. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/devices/msense/extract/__init__.py +0 -0
  25. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/devices/msense/extract/__main__.py +0 -0
  26. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/devices/msense/extract/clocksync.py +0 -0
  27. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/devices/msense/extract/options.py +0 -0
  28. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/devices/msense/extract/pipeline.py +0 -0
  29. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/devices/msense/formats/__init__.py +0 -0
  30. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/devices/msense/gyro_bias.py +0 -0
  31. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/devices/msense/nus_sim.py +0 -0
  32. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/devices/msense/nus_stream.py +0 -0
  33. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/devices/msense/panels/__init__.py +0 -0
  34. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/devices/msense/panels/_common.py +0 -0
  35. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/devices/msense/panels/clocksync.py +0 -0
  36. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/devices/msense/panels/control.py +0 -0
  37. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/devices/msense/panels/downloader.py +0 -0
  38. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/devices/msense/panels/extractor.py +0 -0
  39. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/devices/msense/panels/imu.py +0 -0
  40. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/devices/msense/panels/sqc.py +0 -0
  41. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/devices/msense/panels/tools.py +0 -0
  42. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/devices/msense/panels/uuid_tools.py +0 -0
  43. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/devices/msense/panels/viewer.py +0 -0
  44. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/devices/msense/quaternion.py +0 -0
  45. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/devices/msense/records.py +0 -0
  46. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/devices/msense/signal_quality.py +0 -0
  47. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/devices/msense_demo/__init__.py +0 -0
  48. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/devices/msense_demo/config.py +0 -0
  49. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/devices/msense_demo/device.py +0 -0
  50. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/devices/msense_demo/fake_stream.py +0 -0
  51. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/devices/msense_demo/faults.py +0 -0
  52. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/devices/obs.py +0 -0
  53. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/devices/pupil_labs.py +0 -0
  54. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/devices/qb2.py +0 -0
  55. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/devices/shimmer.py +0 -0
  56. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/devices/template.py +0 -0
  57. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/integrated_panel.py +0 -0
  58. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/journal.py +0 -0
  59. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/lsl_recorder.py +0 -0
  60. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/lsl_session.py +0 -0
  61. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/lsl_util.py +0 -0
  62. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/plot_util.py +0 -0
  63. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/plugins.py +0 -0
  64. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/resources/icons/plasma.icns +0 -0
  65. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/resources/icons/plasma.ico +0 -0
  66. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/resources/icons/plasma.png +0 -0
  67. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/resources/icons/plasma.svg +0 -0
  68. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/status.py +0 -0
  69. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma/xdf_writer.py +0 -0
  70. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma_app.egg-info/SOURCES.txt +0 -0
  71. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma_app.egg-info/dependency_links.txt +0 -0
  72. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma_app.egg-info/entry_points.txt +0 -0
  73. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma_app.egg-info/requires.txt +0 -0
  74. {plasma_app-2.2.2 → plasma_app-2.2.3}/plasma_app.egg-info/top_level.txt +0 -0
  75. {plasma_app-2.2.2 → plasma_app-2.2.3}/pyproject.toml +0 -0
  76. {plasma_app-2.2.2 → plasma_app-2.2.3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plasma-app
3
- Version: 2.2.2
3
+ Version: 2.2.3
4
4
  Summary: PLASMA — Platform for LSL-based Acquisition of Sensor Metrics and Analytics
5
5
  License: MIT
6
6
  Project-URL: Homepage, https://github.com/YuyiChang/PLASMA
@@ -101,7 +101,7 @@ plugins: `msense`, `qb2`, `pupil`, `shimmer`, `obs` (and `all`).
101
101
  - [x] linux aarch64 build — `PLASMA_Linux_arm64` for Jetson Orin (JetPack 6); CI job `build-linux-arm64`
102
102
  - [ ] infrequent stream (e.g., PLASMA journaler) shows green after recording stop
103
103
  - [ ] doc for msense workflow with better screenshots
104
- - [ ] memo `stage` transition logic optimization (e.g., timing of "ready to start" msg wrt sensor init status)
104
+ - [x] memo `stage` transition logic optimization (e.g., timing of "ready to start" msg wrt sensor init status)
105
105
 
106
106
  ## developing a sensor plugin
107
107
 
@@ -53,7 +53,7 @@ plugins: `msense`, `qb2`, `pupil`, `shimmer`, `obs` (and `all`).
53
53
  - [x] linux aarch64 build — `PLASMA_Linux_arm64` for Jetson Orin (JetPack 6); CI job `build-linux-arm64`
54
54
  - [ ] infrequent stream (e.g., PLASMA journaler) shows green after recording stop
55
55
  - [ ] doc for msense workflow with better screenshots
56
- - [ ] memo `stage` transition logic optimization (e.g., timing of "ready to start" msg wrt sensor init status)
56
+ - [x] memo `stage` transition logic optimization (e.g., timing of "ready to start" msg wrt sensor init status)
57
57
 
58
58
  ## developing a sensor plugin
59
59
 
@@ -1,4 +1,4 @@
1
- __version__ = "2.2.2"
1
+ __version__ = "2.2.3"
2
2
 
3
3
  # Short git commit hash baked in by CI (.github/workflows/build.yml) just
4
4
  # before a release build is frozen with PyInstaller — a frozen bundle ships no
@@ -46,7 +46,12 @@ def merge_msense_records(existing, scanned, overwrite):
46
46
 
47
47
  ``overwrite=True`` → one fresh record per scanned device, nothing kept.
48
48
  ``overwrite=False`` → ``existing`` plus a record for every scanned address
49
- not already listed (case-insensitive on "UUID / MAC Address").
49
+ not already listed (case-insensitive on "UUID / MAC Address"). A scanned
50
+ address that IS already listed has that record's Name refreshed to the
51
+ freshly advertised name instead — Nickname/Enabled/IMU Stream are left
52
+ alone — so a firmware update that changes the advertised name reaches the
53
+ table via Append without needing Overwrite (which would also reset those
54
+ per-device toggles for every other configured wristband).
50
55
 
51
56
  Fresh records use the advertised name as Name, blank Nickname, Enabled on,
52
57
  IMU Stream off. Returns ``(records, summary_str)``.
@@ -64,13 +69,30 @@ def merge_msense_records(existing, scanned, overwrite):
64
69
  records = [_fresh(dev) for dev in scanned]
65
70
  return records, f"Overwrote table with {len(records)} scanned wristband(s)"
66
71
 
72
+ scanned_by_addr = {dev["address"].strip().upper(): dev for dev in scanned}
73
+ records = []
74
+ renamed = 0
75
+ for rec in existing:
76
+ dev = scanned_by_addr.get(str(rec.get("UUID / MAC Address", "")).strip().upper())
77
+ if dev and dev["name"] != rec.get("Name", ""):
78
+ rec = {**rec, "Name": dev["name"]}
79
+ renamed += 1
80
+ records.append(rec)
81
+
67
82
  have = {str(rec.get("UUID / MAC Address", "")).strip().upper() for rec in existing}
68
83
  added = [_fresh(dev) for dev in scanned if dev["address"].strip().upper() not in have]
69
- skipped = len(scanned) - len(added)
70
- msg = f"Appended {len(added)} new wristband(s)"
71
- if skipped:
72
- msg += f" ({skipped} already listed)"
73
- return list(existing) + added, msg
84
+ records += added
85
+
86
+ unchanged = len(scanned) - len(added) - renamed
87
+ parts = []
88
+ if added:
89
+ parts.append(f"{len(added)} new")
90
+ if renamed:
91
+ parts.append(f"{renamed} renamed")
92
+ if unchanged:
93
+ parts.append(f"{unchanged} unchanged")
94
+ msg = "Appended " + ", ".join(parts) if parts else "No changes"
95
+ return records, msg
74
96
 
75
97
 
76
98
  # ── device_info.json import (YAMS provisioning format) ───────────────────────
@@ -74,6 +74,10 @@ BATTERY_CHAR_UUID = "00002a19-0000-1000-8000-00805f9b34fb"
74
74
 
75
75
  SQC_MIN_MTU = 128
76
76
  SQC_DEBUG = True # emit per-notification telemetry (printed off the BLE thread)
77
+ # devices with no active SQC/live session still get unsolicited NUS traffic
78
+ # (boot chatter, or firmware that exposes the NUS char but doesn't speak the
79
+ # SQC/live protocol) — coalesce that noise instead of one debug line/packet
80
+ NUS_IDLE_LOG_WINDOW_S = 5.0
77
81
 
78
82
  # NOTE: the overall per-transaction backstop timeout stays DISABLED — the real
79
83
  # BLE data rate is far slower than the handoff doc's provisional 35/45 s
@@ -173,6 +177,11 @@ class MotionSenseHRV(PlasmaDevice):
173
177
  # addr -> live INFINITY-stream state (see _new_live_state); only ever
174
178
  # one NUS stream (SQC snapshot OR live) active per wristband at a time.
175
179
  self.live_state = {}
180
+ # addr -> {"count", "bytes", "window_start"} — coalesces the
181
+ # "ignored (no active stream)" debug line so a chatty/idle wristband
182
+ # doesn't flood the console one line per notification (see
183
+ # _log_nus_ignored / NUS_IDLE_LOG_WINDOW_S)
184
+ self._nus_idle_rx = {}
176
185
  # addr -> {"status": confirmed|unconfirmed|unverifiable|unknown,
177
186
  # "checked_at": ts} — set by collection_ctl(addr, False), see
178
187
  # _confirm_acq_stopped. Cleared on the next collection_ctl(addr, True).
@@ -1325,7 +1334,7 @@ class MotionSenseHRV(PlasmaDevice):
1325
1334
  elif live and live.get("session") and not live["session"].is_terminal:
1326
1335
  self._handle_live_notification(live, name, bytes(data), now, t_entry)
1327
1336
  else:
1328
- self._sqc_debug(name, f"rx {len(data)}B ignored (no active stream)")
1337
+ self._log_nus_ignored(name, len(data))
1329
1338
  except Exception as e:
1330
1339
  self.info(f"Error handling NUS data from {name}: {e}")
1331
1340
 
@@ -1520,6 +1529,28 @@ class MotionSenseHRV(PlasmaDevice):
1520
1529
  except queue.Full:
1521
1530
  pass # never block the BLE thread on a slow console
1522
1531
 
1532
+ def _log_nus_ignored(self, name, nbytes):
1533
+ # first notification in a window prints immediately (so isolated,
1534
+ # one-off chatter is still visible); anything after that within
1535
+ # NUS_IDLE_LOG_WINDOW_S is tallied silently and flushed as one
1536
+ # rolled-up line — keeps a continuously-chattering/no-session
1537
+ # wristband (e.g. firmware that exposes NUS but doesn't speak the
1538
+ # SQC/live protocol) from spamming a line per packet
1539
+ st = self._nus_idle_rx.setdefault(name, {"count": 0, "bytes": 0, "window_start": 0.0})
1540
+ now = time.time()
1541
+ st["count"] += 1
1542
+ st["bytes"] += nbytes
1543
+ if now - st["window_start"] < NUS_IDLE_LOG_WINDOW_S:
1544
+ return
1545
+ if st["count"] > 1:
1546
+ self._sqc_debug(
1547
+ name, f"rx {st['count']}x ({st['bytes']}B total) ignored (no active stream)")
1548
+ else:
1549
+ self._sqc_debug(name, f"rx {nbytes}B ignored (no active stream)")
1550
+ st["count"] = 0
1551
+ st["bytes"] = 0
1552
+ st["window_start"] = now
1553
+
1523
1554
  def _sqc_diag_summary(self, name, store=None):
1524
1555
  d = (store or self.sqc_state).get(name, {}).get("diag")
1525
1556
  if not d:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plasma-app
3
- Version: 2.2.2
3
+ Version: 2.2.3
4
4
  Summary: PLASMA — Platform for LSL-based Acquisition of Sensor Metrics and Analytics
5
5
  License: MIT
6
6
  Project-URL: Homepage, https://github.com/YuyiChang/PLASMA
@@ -101,7 +101,7 @@ plugins: `msense`, `qb2`, `pupil`, `shimmer`, `obs` (and `all`).
101
101
  - [x] linux aarch64 build — `PLASMA_Linux_arm64` for Jetson Orin (JetPack 6); CI job `build-linux-arm64`
102
102
  - [ ] infrequent stream (e.g., PLASMA journaler) shows green after recording stop
103
103
  - [ ] doc for msense workflow with better screenshots
104
- - [ ] memo `stage` transition logic optimization (e.g., timing of "ready to start" msg wrt sensor init status)
104
+ - [x] memo `stage` transition logic optimization (e.g., timing of "ready to start" msg wrt sensor init status)
105
105
 
106
106
  ## developing a sensor plugin
107
107
 
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