Fix pulse time#93
Conversation
bruno-f-cruz
left a comment
There was a problem hiding this comment.
I think if we are doing this, we may as well future-proof it and have "SetRightRewardAmount" be a Tuple<Bool, float> similar to SetIsRightValveMs. Once we do that, SetIsRightValveMs will become private to the OperationControl scope (currently a global subject shared with the UI components) and the flush will instead use the SetRightRewardAmount, which becomes the public interface. The advantage is that it gives an obvious interface to implement single-trial-level reward amount modification in the future, should we need it.
|
@bruno-f-cruz implemented SetRightReward amount and tested on rig |
|
Made a couple of small changes for consistency and readability. One important thing worth noting. While you decided to use "50"ul (instead of 500ms), the delay between pulses is still 500ms (hard-coded). You will now also have to calculate the "expected" delay for 50uL in the UI logic and await that period of time (probably worth adding a fudge factor). Since the hardware doesn't know anything about volume, and only time, I don't think there is a better way to do this. (Unfortunately, the harp behavior does not report when the pulse is done...). Let me know if this is not clear, and we can talk about it. If you do not calculate it you run the risk of the valve opening again before even closing (not sure if this is ok or not) OR waiting for too long to reopen it. |
|
Small note, you are committing from the service account |



Fixes bug where reward time is not reset after flushing valves. Now, reward time is reset after spouts are flushed. Confirmed that after flushing, reward amount returns to reward volume.