From 252cb295c5ff96197163fe31afd904f4527755b3 Mon Sep 17 00:00:00 2001 From: bruno-f-cruz <7049351+bruno-f-cruz@users.noreply.github.com> Date: Thu, 5 Mar 2026 15:51:39 -0800 Subject: [PATCH] Fix visualizer --- src/Extensions/Visualizers.bonsai | 1171 ++++++++++++++++++----------- src/main.bonsai | 15 - 2 files changed, 741 insertions(+), 445 deletions(-) diff --git a/src/Extensions/Visualizers.bonsai b/src/Extensions/Visualizers.bonsai index e5fe0d1..fdf11fe 100644 --- a/src/Extensions/Visualizers.bonsai +++ b/src/Extensions/Visualizers.bonsai @@ -7,203 +7,247 @@ xmlns:gui="clr-namespace:Bonsai.Gui;assembly=Bonsai.Gui" xmlns:p3="clr-namespace:AllenNeuralDynamics.Core.Design;assembly=AllenNeuralDynamics.Core.Design" xmlns:scr="clr-namespace:Bonsai.Scripting.Expressions;assembly=Bonsai.Scripting.Expressions" + xmlns:ui="clr-namespace:Bonsai.Design;assembly=Bonsai.Design" xmlns="https://bonsai-rx.org/2018/workflow"> - - Source1 + + + 0 + - - GlobalTrialOutcome - - - 16 - - - - SoftwareEvent - - - IsRightLickEvent - - + + TrialPlots - - Source1 + + GlobalTrialOutcome - - Value + + 16 - - - - - - - - - - - LickRight - - - - IsRightLickEvent - - - - - - Source1 + + + SoftwareEvent + + + IsRightLickEvent + + + + + + Source1 + + + Value + + + + + + + + - - Value + + + LickRight + + + + IsRightLickEvent + + + + + + Source1 + + + Value + + + + + + + + + + + + + + LickLeft + + + + GiveRewardRight + + + + + + Source1 + + + + + + + + + + + WaterRight + + + + GiveRewardRight + + + + + Source1 + + + + + + + + + + + WaterLeft + + + + + + + 16 + 3600 + + + QuiscentPeriod + Gold + 0.3 + + + ResponsePeriod + SandyBrown + 0.3 + + + RewardConsumptionPeriod + RosyBrown + 0.3 + + + ItiPeriod + Green + 0.3 + + + + + LickLeft + Red + 0.9 + 6 + Down + + + LickRight + Blue + 0.1 + 6 + Up + + + IsRightTriggerQuickRetract + DarkCyan + 0.5 + 6 + Plus + + + DeliverSecondaryReinforcer + Sienna + 0.5 + 6 + Plus + + + WaterRight + Blue + 0.2 + 6 + Circle + + + WaterLeft + Red + 0.8 + 6 + Circle + + + + 5 + + + + true + true + 1 + 2 + + + + - + + + + + + + + + + + + + + + + + + + - - - LickLeft - - - - - - - 16 - 30 - - - QuiscentPeriod - Gold - 0.3 - - - ResponsePeriod - SandyBrown - 0.3 - - - RewardConsumptionPeriod - WhiteSmoke - 0.3 - - - ItiPeriod - Green - 0.3 - - - - - LickLeft - Red - 0.9 - 6 - Down - - - LickRight - Blue - 0.1 - 6 - Up - - - IsRightTriggerQuickRetract - DarkCyan - 0.5 - 6 - Plus - - - DeliverSecondaryReinforcer - Sienna - 0.5 - 6 - Plus - - - GiveRewardRight - DarkViolet - 0.5 - 6 - Circle - - - QuiscentPeriod - 5 - - - - - true - true - 1 - 2 - - - - - - GlobalTrial - - - 2 - 16 - - - - - true - true - 1 - 1 - - - - - - - - DynamicForaging - true - true - 2 - 1 - - - Percent - 0.7 - - - Percent - 0.3 - - - - - TriggeredCamerasStream - - - + + + LauncherControl @@ -211,9 +255,7 @@ - - - + ExperimentState @@ -232,9 +274,7 @@ StartExperimentToggleButton - - - + End true @@ -244,9 +284,7 @@ EndExperimentButton - - - + LauncherControl true @@ -321,303 +359,546 @@ - + + true + true + - - GiveWaterUI + + true + true + 2 + 1 + + + + + + + + true + true + 1 + 2 + + + + + + + + + + + ManualOverrides - - Left - true - true - ๐Ÿ’งโ—€ - - - TriggerLeft + + GiveWaterUI - - Source1 + + Left + true + true + ๐Ÿ’งโ—€ - - - false - + + TriggerLeft + + + + Source1 + + + + false + + + + GiveRewardRight + + + + + + + + + + + + + Right + true + true + ๐Ÿ’งโ–ถ - - GiveRewardRight + + TriggerRight + + + + Source1 + + + + true + + + + GiveRewardRight + + + + + + + + + + + + + ManualWater + true + true + 2 + 1 + + + Percent + 0.5 + + + Percent + 0.5 + + + + - + + + + + - - Right + + Give water true true - ๐Ÿ’งโ–ถ + Give water - - TriggerRight + + + ForceAutoWater - - Source1 + + GlobalAutoWaterState - - - true - + + !it.IsLeft - - GiveRewardRight + + + + - - - - - - - - - - - - ManualWater - true - true - 1 - 1 - - - Percent - 0.5 - - - Percent - 0.5 - - - - - - - - - - - - - - - - - - - - - ForceAutoWater - - - - GlobalAutoWaterState - - - !it.IsLeft - - - - - - - - SetLeft - true - true - ๐ŸŽฃโ—€ - - - UpdateGlobalState - - - - Source1 + + SetLeft + true + true + ๐ŸŽฃโ—€ + + UpdateGlobalState + + + + Source1 + + + GlobalAutoWaterState + + + + + + Item2 + + + + + + it.SetLeft() + + + GlobalAutoWaterState + + + + + + + + + + + + + + + GlobalAutoWaterState - - + + !it.IsRight - - Item2 + + + + + + + SetRight + true + true + ๐ŸŽฃโ–ถ - - + + UpdateGlobalState + + + + Source1 + + + GlobalAutoWaterState + + + + + + Item2 + + + + + + it.SetRight() + + + GlobalAutoWaterState + + + + + + + + + + + + + + + + + GlobalAutoWaterState - it.SetLeft() + it.HasValue - - - 1 - + + + + - - GlobalAutoWaterState + + Reset + false + true + โŽ + + + UpdateGlobalState + + + + Source1 + + + GlobalAutoWaterState + + + + + + Item2 + + + + + + it.Reset() + + + GlobalAutoWaterState + + + + + + + + + + + + + + + + + ForceAutoWater + true + true + 3 + 1 + + + - - + + - - - + + + + + + + + + + + + + + - - GlobalAutoWaterState - - - !it.IsRight - - - - - - - - SetRight + + Arm water true true - ๐ŸŽฃโ–ถ + Arm water - - UpdateGlobalState + + + OffsetControl - - Source1 - - - GlobalAutoWaterState + + + 0.05 + - + + 1 + - - Item2 + + BumpSize - - + + ManipulatorBiasTracker - - it.SetRight() + + ManipulatorBiasTracker 1 - - GlobalAutoWaterState + + - - - - - - - - - - - - - - - - - GlobalAutoWaterState - - - it.HasValue - - - - - - - - Reset - true - true - โŽ - - - UpdateGlobalState - - - - Source1 + + + + + + - - GlobalAutoWaterState + + true + true + 0.15 - - + + + Left + true + true + โ—€๏ธ - - Item2 + + BumpLeft + + + + Source1 + + + BumpSize + + + + + + Item2 + + + + -1 + + + + ManualSpoutDelta + + + + + + + + + + + + - - + + + Right + true + true + โ–ถ - - it.Reset() + + BumpRight + + + + Source1 + + + BumpSize + + + + + + Item2 + + + ManualSpoutDelta + + + + + + + + + + + - - - 1 - + + + true + true + 2 + 1 + + + - - GlobalAutoWaterState + + + true + true + Microsoft Sans Serif, 22.125pt + 1 + 2 + + + - - - - - - + + + + + + + + + + + + + + + + + + + + Spout offset + true + true + Spout offset + + - ForceAutoWater + Manual Control true true - 3 - 1 + Microsoft Sans Serif, 36pt + 1 + 3 @@ -628,77 +909,107 @@ - + - + - + - + - - - - - - + + true + true + 1 + 2 + + + + + + + true + true + 2 + 1 + + + Percent + 0.75 + + + Percent + 0.25 + + + + + + + + GlobalTrial + + + 2 + 16 + + true true + - - - - + + + + - + - - - + + + - - + + - + - - - + + + - - - - - - - - - - - - - + + + + + DynamicForaging + true + + + + + \ No newline at end of file diff --git a/src/main.bonsai b/src/main.bonsai index 9034607..fd96806 100644 --- a/src/main.bonsai +++ b/src/main.bonsai @@ -7,7 +7,6 @@ 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:ui="clr-namespace:Bonsai.Design;assembly=Bonsai.Design" xmlns="https://bonsai-rx.org/2018/workflow"> @@ -355,19 +354,7 @@ - - - 0 - - - - DynamicForaging - true - - - - @@ -381,8 +368,6 @@ - - \ No newline at end of file