Skip to content

Commit 8ce0f4a

Browse files
committed
ui: separate EMG and ADC shape displays in status panel
1 parent e0d8195 commit 8ce0f4a

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

examples/joint_angle_regression/open_ephys_lsl_streamer.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -655,15 +655,17 @@ def _init_ui(self):
655655

656656
self.status = QLabel("Disconnected")
657657
self.status.setStyleSheet("color: #ff6666; font-weight: bold; font-size: 14px;")
658-
self.samples = QLabel("Samples: 0")
659658
self.ch_info = QLabel("Channels: EMG=0 ADC=0")
659+
self.emg_shape = QLabel("EMG: —")
660+
self.adc_shape = QLabel("ADC: —")
660661
self.emg_stats = QLabel("EMG RMS: N/A | \u03c3: N/A")
661662
self.imu_stats = QLabel("IMU \u03c3: N/A | Mag \u03c3: N/A")
662663
self.rate = QLabel("Rate: N/A")
663664

664665
sl.addWidget(self.status)
665666
sl.addWidget(self.ch_info)
666-
sl.addWidget(self.samples)
667+
sl.addWidget(self.emg_shape)
668+
sl.addWidget(self.adc_shape)
667669
sl.addWidget(self.emg_stats)
668670
sl.addWidget(self.imu_stats)
669671
sl.addWidget(self.rate)
@@ -797,17 +799,21 @@ def _tick(self):
797799
info = self.streamer.poll_once()
798800
ch = info["channels"]
799801
n_adc = info.get("n_adc", 0)
802+
chunk = info["chunk"]
800803
fs_str = f"{self.streamer.detected_fs:.0f}" if self.streamer.detected_fs > 0 else "?"
801804
hdr = f"{self.streamer._header_fs:.0f}" if self.streamer._header_fs > 0 else "?"
802805
meas = f"{self.streamer._measured_fs}" if self.streamer._measured_fs > 0 else "?"
803-
self.samples.setText(
804-
f"EMG: {info['total_emg']:,} | ADC: {info.get('total_adc', 0):,} | "
805-
f"chunk ({ch}+{n_adc}ch, {info['chunk']}) @ {fs_str} Hz"
806+
self.emg_shape.setText(
807+
f"EMG: {info['total_emg']:,} samples | chunk ({chunk}, {ch}) @ {fs_str} Hz"
808+
)
809+
self.adc_shape.setText(
810+
f"ADC: {info.get('total_adc', 0):,} samples | chunk ({chunk}, {n_adc})"
811+
if n_adc > 0 else "ADC: none"
806812
)
807813
self.rate.setText(
808814
f"Rate: {info['rate_hz']:.1f} Hz | fs: header={hdr} measured={meas}"
809815
)
810-
if info["chunk"] > 0:
816+
if chunk > 0:
811817
self.emg_stats.setText(
812818
f"EMG RMS: {info['emg_rms']:.3f} | \u03c3: {info['emg_std']:.3f}"
813819
)

0 commit comments

Comments
 (0)