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

Prevent crashes if no board is detected #9

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Prevent crashes if no board is detected #9

wants to merge 1 commit into from

Conversation

bparks13
Copy link
Member

@bparks13 bparks13 commented Jan 7, 2025

This PR is slightly modeled after how the Neuropixels-PXI plugin handles the user pressing No if no hardware is connected. Namely, it skips the initialization steps that were previously crashing, and instead presents a mostly blank editor and a blank canvas that cannot perform any actions.

I could not figure out how to prevent the canvas from being automatically opened, so if anyone has any recommendations on how to do that it would be greatly appreciated!

- This presents a blank canvas and an editor that only states "No boards detected" if the user presses "No" with no boards connected
@anjaldoshi
Copy link

Josh implemented a simulation mode for the acquisition board plugin, which can be used for testing. Here's the code for it: https://github.com/open-ephys-plugins/acquisition-board/tree/main/Source/devices/simulated. Similar to the Neuropixels plugin, this plugin should prompt the user to run in simulation mode if no boards are detected. If the user selects “ yes,” the plugin should run in simulation mode. If the user selects “ no,” the plugin should create a blank editor and canvas.

@bparks13
Copy link
Member Author

bparks13 commented Jan 7, 2025

@anjaldoshi I believe that this PR accomplishes what you are saying. The simulated device works correctly, but issue #2 occurs when the user presses "No", which would immediately crash the GUI. Now, with this PR, it simply shows the blank editor and canvas (the editor is not totally blank, similar to the Neuropixels-PXI plugin it states "No boards detected"). Unlike the PXI plugin, the canvas here still opens, even thought it is totally blank. If that is acceptable behavior then I think this PR is ready for review.

Let me know if there is anything I missed!

@anjaldoshi
Copy link

Great! Thanks for confirming! I haven't tested it on my end yet, will do and let you know.

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.

Plugin crashes if no acquisition board present and no simulation is selected
2 participants