Skip to content

Conversation

@bparks13
Copy link
Member

This PR moves the stimulus sequence verification logic from the inherited classes to the base class, to increase maintainability. It also adds the verification check when closing the Headstage64 dialog, which confirms that both the Electrical and Optical stimulus sequences are valid before continuing.

Fixes #528

@bparks13 bparks13 added this to the 0.7.0 milestone Oct 28, 2025
@bparks13 bparks13 requested a review from jonnew October 28, 2025 16:20
@bparks13 bparks13 self-assigned this Oct 28, 2025
@bparks13 bparks13 requested review from cjsha and removed request for jonnew October 30, 2025 19:47
@bparks13 bparks13 requested a review from cjsha November 3, 2025 18:46
@bparks13
Copy link
Member Author

bparks13 commented Nov 3, 2025

@cjsha I have updated this PR, if you could take a look at it again and see if the behavior now makes sense, that would be great!

Copy link
Member

@cjsha cjsha left a comment

Choose a reason for hiding this comment

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

I'm realizing now that the CanCloseForm() logic for each dialog is so similar that it makes me wonder if the logic in the generic CanCloseForm()

internal virtual bool CanCloseForm(out DialogResult result)

should be replaced by the logic that is here, here, and here. I'm not sure if that's possible, but I figured worth a consideration.

@bparks13
Copy link
Member Author

bparks13 commented Nov 3, 2025

@cjsha I wanted to confirm if you've pulled down the recent changes on this branch, as I did replace the specific CanCloseForm method in each class with the base version, so I've already implemented your suggestion to consolidate the logic.

@cjsha
Copy link
Member

cjsha commented Nov 3, 2025

ahhh you're right, I don't know how this happened. I was looking at the wrong commit in github >.<

Copy link
Member

@cjsha cjsha left a comment

Choose a reason for hiding this comment

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

The behavior is good. The two remaining comments are nit picks. One of them involves adding a detail in the messageBox dialog, and the other is just me struggling to understand some logic (though the logic seems to give the desired UI behavior). I'll just approve now so you can just decide yourself if you think it's worth acting on either of these two comments

- Add a check when closing the Headstage64 dialog
- Move existing logic to base class
- Ensure that the dialogs can be closed and the contents discarded correctly, allowing for one device to save parameters and another device to discard parameters where appropriate
@bparks13 bparks13 merged commit 7fb9332 into main Nov 4, 2025
8 checks passed
@bparks13 bparks13 deleted the issue-528 branch November 4, 2025 15:50
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.

Headstage64 dialog does not check for valid sequences

3 participants