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

Fix loading channel configuration files #272

Merged
merged 4 commits into from
Sep 6, 2024
Merged

Fix loading channel configuration files #272

merged 4 commits into from
Sep 6, 2024

Conversation

bparks13
Copy link
Member

In this PR, channel configuration files that are malformed or are missing required fields no longer throw an exception that forcibly closes the dialog. Exceptions are routed appropriately to notify the user instead.

Fixes #252

Additionally, files that contain changes other than the device channel indices are now respected. Previously, only the device channel indices were being saved, which meant that channels could be enabled and disabled by reading in a configuration file, but if the probe contour or contact shapes were modified those changes were not reflected in the GUI.

Fixes #271

Finally, an emergent property of fixing #271 led to a bug in drawing the scale bar after loading files without a probe contour. This has been addressed as well in this PR, but no issue was created for it.

- Remove manual throws in code
- Add an error handler to the JsonConvert.DeserializeObject call
- Instead of only copying over the device channel indices, now all aspects of a probe are copied and saved
- Bump OpenEphys.ProbeInterface.NET version to 0.1.1 to take advantage of patch fix
- Added internal methods to calculate contours if no probe contours are given
- Correctly removes scale points
@bparks13 bparks13 added this to the 0.3.0 milestone Aug 29, 2024
@bparks13 bparks13 requested a review from jonnew August 29, 2024 14:11
@bparks13 bparks13 self-assigned this Aug 29, 2024
- Instead of showing first JSON parse error, print all of them to stderr
- Realized that static functions in the NeuropixelsV1Helper.cs should
  really accept a path instead of a StreamReader as their first
  arguement because StreamReader is to general because cal data is always
  provided in a file and this function call expects to start from the
  beginning of the stream. This will require a change in the public API.
  I will open a new issue about this.
Copy link
Member

@jonnew jonnew left a comment

Choose a reason for hiding this comment

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

I committed some changes. Please have a look at those to make sure they look ok. After that feel free to merge.

@jonnew
Copy link
Member

jonnew commented Sep 3, 2024

Issue documented in my last commit is opened in #283

@bparks13 bparks13 merged commit d439fe8 into main Sep 6, 2024
7 checks passed
@bparks13 bparks13 deleted the issue-252 branch September 6, 2024 13:49
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.

Channel configurations do not respect file properties on load Handle exceptions when loading a JSON file
2 participants