Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Socket updates - reconnect loop, merge buttons #18

Merged
merged 9 commits into from
Nov 4, 2024
Merged

Conversation

bparks13
Copy link
Member

@bparks13 bparks13 commented Oct 23, 2024

This PR is updated to work with version 1.0 of the GUI.

If the remote socket closes unexpectedly, the plugin will attempt to automatically reconnect to the same port if the remote socket opens again.
This will also ensure that header parameters are consistent between connections, and will stop acquisition if the header changes.
Buttons are consolidated so there is one button that changes from Connect to Disconnect and vice versa.

- Fixed formatting
- Removed all `ScopedPointer`s and used std::unique_ptr instead
- Say the remote socket closes unexpectedly; now, this plugin will attempt to automatically reconnect to the same port if the remote socket opens again
- This will also ensure that header parameters are consistent between connections, and will stop acquisition if the header changes
- Once connected, all data is read to prevent buffer overflow
- If acquisition is running, this data is processed and plotted; otherwise, it is thrown away

Fixes #12
@bparks13 bparks13 requested a review from jonnew November 4, 2024 17:52
Source/Socket.cpp Outdated Show resolved Hide resolved
- Fixed a visual bug where the disconnect button would not be correctly enabled in certain conditions
@bparks13 bparks13 merged commit 33f46f4 into juce8 Nov 4, 2024
3 checks passed
if (printOutput)
{
LOGC("EphysSocket failed to connect; could not read header from stream.");
CoreServices::sendStatusMessage("Ephys Socket: Could not read stream.");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Putting here for lack of better place:

I think the messages presented in the GUI should be more descriptive. For instance, when I change the underlying type of a cv::Mat in Bonsai, I get the following error message

image

It would be nice if the message said why the Ephys Socket stopped data acqusition (in this case I changed for u16 to floats). I would say the same is true for e.g. changing the shape of the input array. I would be nice to know what exactly. I see this in the console

[open-ephys][debug] CoreServices::sendStatusMessage: Ephys Socket: Invalid header
[open-ephys] ***ERROR*** Ephys Socket: Header values have changed since first connecting

But, this still does not tell us what changed that caused the issue and its quite buried to the user. I think this info should be displayed on the main message bar.

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