Skip to content

Some new UI features & marker stream integration - #4

Merged
s4rify merged 3 commits into
masterfrom
marker_stream_vis
Aug 21, 2026
Merged

Some new UI features & marker stream integration#4
s4rify merged 3 commits into
masterfrom
marker_stream_vis

Conversation

@s4rify

@s4rify s4rify commented Aug 21, 2026

Copy link
Copy Markdown
Contributor
  • added support to visualize irregular streams as vertical lines in the plot
  • changed the color scheme to be green
  • updated the readme to reflect the newest info and the paper reference

s4rify added 2 commits June 16, 2026 09:57
- LSLService: detect string-format streams (LSL ChannelFormat 3) and
  pull String[] samples, emitting MarkerSample events instead of
  DataSample; StreamConfig now carries isMarker flag.
- LivePlotViewModel: add MarkerUiState, per-stream marker buffers and
  markerUiState StateFlow; handleMarkerEvent() maintains a 10-second
  sliding window of (timestamp, label) pairs; handleConfigurationEvent()
  branches on isMarker so string streams never touch the float buffers;
  updateSelection() cleans up markerStreams on removal.
- StreamPlotAdapter: two RecyclerView view-types (VIEW_DATA / VIEW_MARKER);
  marker rows use a new MarkerVH / ItemMarkerPlotBinding and render each
  incoming event as a red X-axis LimitLine with the label at the top.
- item_marker_plot.xml: slim 80dp LineChart lane with stream title,
  no fullscreen button.
- LivePlotFragment: second 60 Hz collect on markerUiState so marker
  rows redraw when new events arrive.
Copilot AI lite review requested due to automatic review settings August 21, 2026 07:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds first-class support for LSL marker/event streams in the live plot UI (rendered as vertical limit lines), updates the app’s color theme toward green, and refreshes the README citation information.

Changes:

  • Adds marker stream detection in LSLService, marker buffering/state in LivePlotViewModel, and rendering support in StreamPlotAdapter (new marker item layout + view holder).
  • Updates light/dark theme primary colors (green) and adjusts UI copy where it referenced the previous blue theme.
  • Updates README with the latest paper reference.

Reviewed changes

Copilot reviewed 9 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
README.md Updates citation text for the referenced publication.
app/src/main/res/values/styles.xml Switches primary colors to green in the light theme.
app/src/main/res/values-night/styles.xml Switches primary/accent colors to green in the dark theme.
app/src/main/res/layout/item_marker_plot.xml Adds a new RecyclerView item layout for marker stream plots.
app/src/main/res/layout/activity_main.xml Updates comment text to reflect the new theme color.
app/src/main/java/de/uol/neuropsy/viewa/ui/plot/StreamPlotAdapter.kt Adds marker view type + binding logic to render marker events as vertical limit lines.
app/src/main/java/de/uol/neuropsy/viewa/ui/plot/LivePlotViewModel.kt Adds marker stream state, buffering, and event handling.
app/src/main/java/de/uol/neuropsy/viewa/ui/plot/LivePlotFragment.kt Triggers redraws when marker UI state updates.
app/src/main/java/de/uol/neuropsy/viewa/service/LSLService.kt Detects marker streams and emits marker samples (string payload) via the shared flow.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

val uiState: StateFlow<Map<String, ChartUiState>> = _uiState.asStateFlow()

// Marker stream support
val markerStreams: MutableSet<String> = mutableSetOf()
Comment on lines +147 to +151
// Set the visible window to match the 10-second buffer
val windowEnd = if (ui.latestX > 0f) ui.latestX else 10f
val windowStart = windowEnd - 10f
xAxis.axisMinimum = windowStart
xAxis.axisMaximum = windowEnd
Comment on lines +4 to 6
<item name="colorPrimary">#388E3C</item>
<item name="colorPrimaryDark">#1B5E20</item>
<item name="colorAccent">#00B4D8</item>
@s4rify
s4rify merged commit 9b44616 into master Aug 21, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants