Conversation
jonnew
left a comment
There was a problem hiding this comment.
This code review was performed during a live demonstration via verbal notes.
|
Before finalizing the edits to this PR, I have an outstanding question at the bottom that I need some help answering before moving forward. This comment also serves as a general update on the status of the PR so that when the review comes it is easier to see the status of the GUI elements, as well as to provide context for the question. Current StatusThe current status of this PR is the following; all configuration properties have been removed from the Side note @jonnew: after our discussion this morning, I actually think that we no longer need the GUIs are functionally complete, I will be stress testing them today to make sure I haven't missed any obvious issues, but here is how they look: Headstage64 GUII have most of these changes as local commits, as there is some back and forth I want to clean up before requesting a review. Additionally, I will need to bring this branch up to date with main before we could merge it. Outstanding QuestionThe question that we need to answer now, before moving forward, is whether or not the stimulus sequence parameters should be packaged into a single Whichever method is used, they will both be written in real-time during acquisition so that the stimulus sequence can be updated on the fly. Stimulus Sequence object
Pros:
Cons:
Individual parameters
Pros:
Cons:
Final ThoughtsGiven that we do not know when bonsai-rx/bonsai#2370 will be approved and merged into a release version of Bonsai, it is probably prudent to leave the parameters as individual parameters and not worry about packing them into a |
|
I need to think about this, but one thing: Once you move this to the configure node, those will be not externalizable anyways, whether or not they are packed into a |
|
Ah, that's right. I was thinking about it from the context of the device node, but anything in the headstage node will not be externalizable until the property mapper is added |
|
@aacuevas @jonnew Update based on discussion during our meeting today: what does it look like if we were to implement this PR using individual parameters (i.e., copying the behavior from the original Exploring Individual ParametersStarting from the current main branch, and only implementing this for the View from the Bonsai editor for the
Passing Parameters to/from the GUIHere there are two options:
Option 2 is the option I went with, as it keeps the construction argument list short once all 12 parameters are implemented. Following the pattern of option 2, it is fairly easy to pass the In the ElectricalStimulatorSequenceDialog = new(configureNode.ElectricalStimulator);In the configureNode.ElectricalStimulator = editorDialog.ElectricalStimulatorSequenceDialog.ElectricalStimulator;Serializing / Deserializing the Stimulus SequenceThis is the only point where I think that keeping the individual properties runs into a hard issue to solve. Previously, when I was using The main work for serializing/deserializing is done by the There is support for serializing collections, but this would require manually pulling out the individual properties and adding them to a Externalizing ParametersSimilar to the issue of serializing above, once we have the ability to externalize nested parameters there is a question of usage for externalizing the stimulus parameters. If the user only needs to externalize and manipulate a single property then the individual parameters make this very easy, but if they wanted to cycle between two totally different sequences they would have to externalize and update all twelve parameters individually. The Maintaining real-time updatesIndividual Properties readonly BehaviorSubject<double> phaseOneCurrent = new(0);
public double PhaseOneCurrent
{
get => phaseOneCurrent.Value;
set => phaseOneCurrent.OnNext(value);
}
// [...]
phaseOneCurrent.SubscribeSafe(observer, value => device.WriteRegister(Headstage64ElectricalStimulator.CURRENT1, uAToCode(value)))Stimulus Sequence If we want to use the Final ThoughtsWe can port over the individual properties to the If we wanted to use the |
|
Based on our meeting this morning, we will probably implement the stimulator sequence as individual parameters in the If we do go with individual parameters, this also means that I will need to remove the ability to save the stimulus sequence as a file. Originally, I was following the pattern we started with If this is the route we want to go, I can finalize this PR and rebase so that the updates can be reviewed. |
4b8af2d to
bb9470b
Compare
Requested changes were implemented.
jonnew
left a comment
There was a problem hiding this comment.
I think we have to think about another way of dealing with configuration operators that don't need a GUI and what to do with them in the context of the GUI for the aggregate (headstage) configuration operator. There is a lot of lines of code and files added to this comment that, at the end of the day, actually are there to precisely nothing. I think we need to rethink about this and what were are trying to achieve with the GUI.
|
This PR is ready for review again, but it is not ready to merge. To be specific, we are still deciding whether or not keep the tabs for devices that do not have a custom UI yet. In the current iteration (as of ac8e445) the boilerplate files have been removed and only a single generic dialog remains, which all devices can then utilize to be rendered as a separate tab in a headstage GUI. Another topic to discuss is where GUIs should exist; should they only apply to the headstage configure nodes? Or should they be attached to the device configure nodes as well? To retain the full functionality, we might need to split the editor into two different files, since the same editor cannot be attached to a class and a property. For more details, see the implementation in ee3607d, where the HS64 electrical/optical stimulators are given two editors. Once these topics (and any others that come up) are finalized, I can finish the implementation and then clean up the history prior to merging. |
6931790 to
f1c6e9c
Compare
0dcf143 to
b4d910c
Compare
|
@jonnew This PR is ready for a final review, the history has been cleaned so that files are not added and then removed |
- Refactor Rhs2116 to utilize the generic stimulus sequence dialog
- Remove any boilerplate that does not serve any function - Add and utilize a GenericDeviceDialog for all devices without a custom GUI
- Add editors that allows either the configure device node or the headstage node properties to open the appropriate dialog - Move properties from the trigger nodes to the configure nodes
- When the number of bursts or pulses is 1, the period and the inter-burst interval are undefined, so these text boxes are disabled
730f3ec to
2c1c9eb
Compare
|
I also had to rebase this branch, as there were changes in the repo that were not present after the last update, but it is now up to date with all necessary changes from all sources (main, my changes, and your changes). Point 1 Modified the text boxes such that the Pulse Period and the Inter-Burst Interval are disabled when the Pulses Per Bursts and Bursts Per Train are 1, respectively.
Additionally, the logic now correctly handles the case where the pulse period is too short compared to the duration, and ignores it if the pulses per burst is 1. Point 2 I created a new issue (#515) so we can discuss the next steps before making any changes. |













This PR adds GUIs for the electrical and optical stimulators on the
Headstage64.