Skip to content

COR-6620 : Support EpocFlex for Octave example and Handle case headset disconnected for Octave example - #253

Open
khanhle1993 wants to merge 10 commits into
masterfrom
COR-6620
Open

khanhle1993 wants to merge 10 commits into
masterfrom
COR-6620

Conversation

@khanhle1993

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI balanced review requested due to automatic review settings November 18, 2026 03:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved reconnection bugs can silently lose stream subscriptions, while example regressions break non-Flex support and hide exit controls during recovery.

4 open issues
What changed in this PR

This PR extends the Octave Cortex integration with EPOC Flex electrode mappings and automatic session recovery after headset disconnection.

Changes:

  • Adds default and custom Flex mappings with validation.
  • Introduces reconnection logic to restore profiles and stream subscriptions.
  • Updates the examples with flexible EEG channel selection, idle polling, and session-aware recording controls.
File Description
octave/​internal/​CortexHeadset.m Adds Flex mappings and session recovery logic.
octave/​functions/​cortexSession.m Validates and forwards the optional mappings parameter.
octave/​examples/​subscribeAndPlot.m Configures Flex mappings and adds fallback EEG channel selection.
octave/​examples/​recordAndMarker.m Adds disconnect polling, session-state resets, and keyboard-focus handling.

Review effort: Balanced

Comment thread octave/examples/recordAndMarker.m Resolved
Comment thread octave/examples/subscribeAndPlot.m Resolved
Comment thread octave/internal/CortexHeadset.m Resolved
Comment thread octave/internal/CortexHeadset.m Resolved
Refactor cortexSession call to handle headsetId conditions.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 18, 2026 03:21
Wrap reconnect properties assignment in a conditional check for reconnectPending.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Reconnection can lose saved recovery targets or finish without restoring all streams, while hiding the example window removes normal cancellation controls during prolonged disconnections.

2 open issues
2 resolved since last review

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 18, 2026 03:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Reconnection can drop requested streams, restore a stale profile, and hide the only exit controls, while EEG fallback misclassifies marker columns as electrodes.

3 open issues
1 previously missed issue

In code that hasn't changed since last review

Medium severity Exclude Cortex marker columns from the EEG channel fallback

octave/​examples/​subscribeAndPlot.m:99

The fallback excludes MARKER, but Cortex EEG columns use MARKER_HARDWARE and MARKERS (see python/sub_data.py:126 and python/cortex.py:742). When the fallback encounters those labels, it treats them as electrode channels; add both names to the exclusion list.

Review effort: Balanced

Comment thread octave/internal/CortexHeadset.m Resolved
Implement logic to handle missing streams during reconnection.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 18, 2026 03:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Hiding the figure during disconnection removes both normal exit paths and conceals reconnect status, leaving the polling loop running indefinitely if the headset remains unavailable.

2 open issues
1 resolved since last review

Review effort: Balanced

Comment thread octave/examples/subscribeAndPlot.m Resolved
Comment thread octave/examples/subscribeAndPlot.m Resolved
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.

3 participants