diff --git a/src/Extensions/OperationControl.bonsai b/src/Extensions/OperationControl.bonsai index 7931b7d4..b05e227b 100644 --- a/src/Extensions/OperationControl.bonsai +++ b/src/Extensions/OperationControl.bonsai @@ -348,10 +348,30 @@ - TaskLogicParameters + SetIsRightRewardAmount + + + IsLeft + + + + Source1 + + + Item1 + + + + + + + + + + - RewardSize.LeftValueVolume + Item2 RigSchema @@ -387,10 +407,28 @@ SetIsRightValveMs - TaskLogicParameters + SetIsRightRewardAmount + + + IsRight + + + + Source1 + + + Item1 + + + + + + + + - RewardSize.RightValueVolume + Item2 RigSchema @@ -425,39 +463,130 @@ SetIsRightValveMs + + SetIsRightValveMs + + + gt0 + + + + Source1 + + + Item2 + + + + 0 + + + + + + + + + + + + + IsRight + + + + Source1 + + + Item1 + + + + + + + + + + + Item2 + + + Write + + + + IsLeft + + + + Source1 + + + Item1 + + + + + + + + + + + + + Item2 + + + Write + + + + + + + HarpBehaviorCommands + - - - - - - - - + + + + + + + + - - + + - + - - - - - + + + + + + + + + + + + + + + + + - - HarpBehaviorEvents - - - - GiveRewardRight @@ -506,128 +635,16 @@ HarpBehaviorCommands - - SetIsRightValveMs - - - - - - Source1 - - - Item1 - - - - - - - - - - - Item2 - - - gt0 - - - - Source1 - - - - 0 - - - - - - - - - - - - Write - - - - - - - Source1 - - - Item1 - - - - - - - - - - - - - Item2 - - - gt0 - - - - Source1 - - - - 0 - - - - - - - - - - - - Write - - - - - - - HarpBehaviorCommands - - - - - + + + + - - + + - - - - - - - - - - - - - diff --git a/src/Extensions/ValveUi.bonsai b/src/Extensions/ValveUi.bonsai index e4cc8a0a..f2541c94 100644 --- a/src/Extensions/ValveUi.bonsai +++ b/src/Extensions/ValveUi.bonsai @@ -5,6 +5,7 @@ xmlns:scr="clr-namespace:Bonsai.Scripting.Expressions;assembly=Bonsai.Scripting.Expressions" xmlns:gui="clr-namespace:Bonsai.Gui;assembly=Bonsai.Gui" xmlns:sys="clr-namespace:System;assembly=mscorlib" + xmlns:p1="clr-namespace:AllenNeuralDynamics.Core;assembly=AllenNeuralDynamics.Core" xmlns="https://bonsai-rx.org/2018/workflow"> @@ -264,7 +265,7 @@ - SetIsRightValveMs + SetIsRightRewardAmount isRightValve @@ -344,6 +345,56 @@ + + + + + + + + true + + + + ResetRewardVolume + + + + Source1 + + + TaskLogicParameters + + + RewardSize + + + + + + ValveVolume + it.Item1 ? it.Item2.RightValueVolume : it.Item2.LeftValueVolume + + + + + + SetIsRightRewardAmount + + + + + + + + + + + + + + + @@ -381,12 +432,16 @@ + + + + @@ -660,6 +715,19 @@ Flush + + + 50 + + + + + 1 + + + + DefaultVolume + Source1 @@ -690,16 +758,14 @@ false - - - 500 - + + DefaultVolume - SetIsRightValveMs + SetIsRightRewardAmount @@ -712,15 +778,8 @@ GiveRewardRight - - - PT0.5S - - - - - 5000 - + + DefaultVolume RigSchema @@ -735,18 +794,25 @@ RewardToTime ((Item1 * 0.001) - Item2.Offset) / Item2.Slope - - ToMilliseconds - + + + + + + + - - - 1000 - + + + PT0.607S + + + + DefaultVolume DivideByEachOpen - Math.Ceiling(it / 500) + Math.Ceiling(5000 / it) @@ -755,7 +821,7 @@ - 300 + 100 @@ -782,38 +848,81 @@ - - - - - - - - + + + + + + + - - - - + + + + - - + + - + + + + + + + ResetLeftRewardVolume + + + + Source1 + + + + false + + + + TaskLogicParameters + + + RewardSize + + + LeftValueVolume + + + + + + SetIsRightRewardAmount + + + + + + + + + + + + + + IsFlushingValveRight @@ -821,6 +930,19 @@ Flush + + + 50 + + + + + 1 + + + + DefaultVolume + Source1 @@ -851,16 +973,14 @@ true - - - 500 - + + DefaultVolume - SetIsRightValveMs + SetIsRightRewardAmount @@ -873,15 +993,8 @@ GiveRewardRight - - - PT0.5S - - - - - 5000 - + + DefaultVolume RigSchema @@ -896,18 +1009,25 @@ RewardToTime ((Item1 * 0.001) - Item2.Offset) / Item2.Slope - - ToMilliseconds - + + - - - 1000 - + + + + + + + + PT0.678S + + + + DefaultVolume DivideByEachOpen - Math.Ceiling(it / 500) + Math.Ceiling(5000 / it) @@ -916,7 +1036,7 @@ - 300 + 100 @@ -943,38 +1063,81 @@ - - - - - - - - + + + + + + + - - - - + + + + - - + + - + + + + + + + ResetRightRewardVolume + + + + Source1 + + + + true + + + + TaskLogicParameters + + + RewardSize + + + RightValueVolume + + + + + + SetIsRightRewardAmount + + + + + + + + + + + + + + @@ -1028,8 +1191,10 @@ - + + + diff --git a/src/main.bonsai b/src/main.bonsai index a5e1dbe9..579c4274 100644 --- a/src/main.bonsai +++ b/src/main.bonsai @@ -7,6 +7,7 @@ xmlns:p2="clr-namespace:;assembly=Extensions" xmlns:p3="clr-namespace:System.Reactive;assembly=System.Reactive.Core" xmlns:p4="clr-namespace:AllenNeuralDynamics.AindBehaviorServices.DataTypes;assembly=AllenNeuralDynamics.AindBehaviorServices" + xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:scr="clr-namespace:Bonsai.Scripting.Expressions;assembly=Bonsai.Scripting.Expressions" xmlns="https://bonsai-rx.org/2018/workflow"> @@ -150,6 +151,9 @@ GlobalTrial + + SetIsRightRewardAmount + GlobalTrialMetrics @@ -204,6 +208,56 @@ ExperimentState + + SetIsRightRewardAmount + + + + 1 + + + + + true + + + + TaskLogicParameters + + + RewardSize + + + RightValueVolume + + + + + + SetIsRightRewardAmount + + + + 1 + + + + + false + + + + TaskLogicParameters + + + RewardSize + + + LeftValueVolume + + + + -5 @@ -233,21 +287,33 @@ - - - - + + + - - + + - - - - + + + + - + + + + + + + + + + + + + +