Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
* text=auto
*.cmd text eol=crlf
*.bat text eol=crlf
*.bonsai text
# Default: text files normalized to LF in repo, converted on checkout as needed
* text=auto eol=lf

# Code & docs: LF
*.py text eol=lf
*.toml text eol=lf
*.yml text eol=lf
*.yaml text eol=lf
*.md text eol=lf
*.rst text eol=lf
*.svg text eol=lf
*.json text eol=lf

# Windows scripts / MSBuild / DOTNET: CRLF
*.ps1 text eol=crlf
*.bat text eol=crlf
*.cmd text eol=crlf
*.sln text eol=crlf
*.csproj text eol=crlf
*.props text eol=crlf
*.targets text eol=crlf
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,23 @@ ipython_config.py
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version
# Python
venv/
__pycache__/
*.py[cod]
*.pyo
.pytest_cache/

# Editors/OS
.vscode/
.idea/
.DS_Store

# Packaging/build
dist/
build/
*.egg-info/

# Bonsai/.NET build artifacts (keep the source Extensions but ignore build dirs)
**/bin/
**/obj/
69 changes: 69 additions & 0 deletions MPE_workflows/Allen.DrawPhotodiode.bonsai
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<WorkflowBuilder Version="2.6.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:gl="clr-namespace:Bonsai.Shaders;assembly=Bonsai.Shaders"
xmlns:rx="clr-namespace:Bonsai.Reactive;assembly=Bonsai.Core"
xmlns="https://bonsai-rx.org/2018/workflow">
<Workflow>
<Nodes>
<Expression xsi:type="Combinator">
<Combinator xsi:type="gl:RenderFrame" />
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="rx:ElementIndex" />
</Expression>
<Expression xsi:type="MemberSelector">
<Selector>Index</Selector>
</Expression>
<Expression xsi:type="Mod">
<Operand xsi:type="IntProperty">
<Value>60</Value>
</Operand>
</Expression>
<Expression xsi:type="Divide">
<Operand xsi:type="IntProperty">
<Value>30</Value>
</Operand>
</Expression>
<Expression xsi:type="PropertyMapping">
<PropertyMappings>
<Property Name="ColorR" />
<Property Name="ColorG" />
<Property Name="ColorB" />
</PropertyMappings>
</Expression>
<Expression xsi:type="WorkflowInput">
<Name>Source1</Name>
</Expression>
<Expression xsi:type="IncludeWorkflow" Path="BonVision:Primitives.DrawQuad.bonsai">
<ExtentX>10</ExtentX>
<ExtentY>10</ExtentY>
<LocationX>45</LocationX>
<LocationY>27</LocationY>
<Layer>0</Layer>
<Angle>0</Angle>
<ColorR>1</ColorR>
<ColorG>1</ColorG>
<ColorB>1</ColorB>
<ColorA>1</ColorA>
</Expression>
<Expression xsi:type="GreaterThan">
<Operand xsi:type="IntProperty">
<Value>0</Value>
</Operand>
</Expression>
<Expression xsi:type="WorkflowOutput" />
</Nodes>
<Edges>
<Edge From="0" To="1" Label="Source1" />
<Edge From="1" To="2" Label="Source1" />
<Edge From="2" To="3" Label="Source1" />
<Edge From="3" To="4" Label="Source1" />
<Edge From="4" To="5" Label="Source1" />
<Edge From="4" To="8" Label="Source1" />
<Edge From="5" To="7" Label="Source1" />
<Edge From="6" To="7" Label="Source2" />
<Edge From="8" To="9" Label="Source1" />
</Edges>
</Workflow>
</WorkflowBuilder>
53 changes: 53 additions & 0 deletions MPE_workflows/Allen.End.bonsai
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<WorkflowBuilder Version="2.6.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p1="clr-namespace:MPE;assembly=MPEBonsai"
xmlns:rx="clr-namespace:Bonsai.Reactive;assembly=Bonsai.Core"
xmlns:mx="clr-namespace:Bonsai.DAQmx;assembly=Bonsai.DAQmx"
xmlns="https://bonsai-rx.org/2018/workflow">
<Workflow>
<Nodes>
<Expression xsi:type="WorkflowInput">
<Name>Source1</Name>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="BooleanProperty">
<Value>false</Value>
</Combinator>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="p1:NotifyEndStimulus">
<p1:publish_port>5556</p1:publish_port>
</Combinator>
</Expression>
<Expression xsi:type="WorkflowOutput" />
<Expression xsi:type="Combinator">
<Combinator xsi:type="BooleanProperty">
<Value>true</Value>
</Combinator>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="rx:Merge" />
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="mx:DigitalOutput">
<mx:Channels>
<mx:DigitalOutputChannelConfiguration>
<mx:ChannelName />
<mx:Grouping>OneChannelForEachLine</mx:Grouping>
<mx:Lines>Dev1/port1/line7</mx:Lines>
</mx:DigitalOutputChannelConfiguration>
</mx:Channels>
</Combinator>
</Expression>
</Nodes>
<Edges>
<Edge From="0" To="1" Label="Source1" />
<Edge From="1" To="2" Label="Source1" />
<Edge From="2" To="3" Label="Source1" />
<Edge From="2" To="5" Label="Source2" />
<Edge From="4" To="5" Label="Source1" />
<Edge From="5" To="6" Label="Source1" />
</Edges>
</Workflow>
</WorkflowBuilder>
61 changes: 61 additions & 0 deletions MPE_workflows/Allen.InitLick.bonsai
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<WorkflowBuilder Version="2.6.3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:wie="clr-namespace:Bonsai.Windows.Input;assembly=Bonsai.Windows.Input"
xmlns:p1="clr-namespace:MPE;assembly=MPEBonsai"
xmlns:rx="clr-namespace:Bonsai.Reactive;assembly=Bonsai.Core"
xmlns="https://bonsai-rx.org/2018/workflow">
<Workflow>
<Nodes>
<Expression xsi:type="Combinator">
<Combinator xsi:type="wie:KeyDown">
<wie:Filter>L</wie:Filter>
<wie:SuppressRepetitions>false</wie:SuppressRepetitions>
</Combinator>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="p1:LickSensor">
<p1:Device>Dev1</p1:Device>
</Combinator>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="IntProperty">
<Value>1</Value>
</Combinator>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="wie:KeyDown">
<wie:Filter>T</wie:Filter>
<wie:SuppressRepetitions>false</wie:SuppressRepetitions>
</Combinator>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="rx:SubscribeWhen" />
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="IntProperty">
<Value>1</Value>
</Combinator>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="rx:Merge" />
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="BooleanProperty">
<Value>true</Value>
</Combinator>
</Expression>
<Expression xsi:type="WorkflowOutput" />
</Nodes>
<Edges>
<Edge From="0" To="4" Label="Source1" />
<Edge From="1" To="2" Label="Source1" />
<Edge From="2" To="6" Label="Source2" />
<Edge From="3" To="4" Label="Source2" />
<Edge From="4" To="5" Label="Source1" />
<Edge From="5" To="6" Label="Source1" />
<Edge From="6" To="7" Label="Source1" />
<Edge From="7" To="8" Label="Source1" />
</Edges>
</Workflow>
</WorkflowBuilder>
100 changes: 100 additions & 0 deletions MPE_workflows/Allen.InitView.bonsai
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
<?xml version="1.0" encoding="utf-8"?>
<WorkflowBuilder Version="2.6.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:gl="clr-namespace:Bonsai.Shaders;assembly=Bonsai.Shaders"
xmlns:res="clr-namespace:Bonsai.Resources;assembly=Bonsai.System"
xmlns="https://bonsai-rx.org/2018/workflow">
<Workflow>
<Nodes>
<Expression xsi:type="Combinator">
<Combinator xsi:type="gl:CreateWindow">
<gl:Width>640</gl:Width>
<gl:Height>480</gl:Height>
<gl:VSync>On</gl:VSync>
<gl:SwapSync>false</gl:SwapSync>
<gl:ClearColor>Black</gl:ClearColor>
<gl:ClearMask>DepthBufferBit ColorBufferBit</gl:ClearMask>
<gl:CursorVisible>true</gl:CursorVisible>
<gl:Location xsi:nil="true" />
<gl:WindowBorder>Resizable</gl:WindowBorder>
<gl:WindowState>Fullscreen</gl:WindowState>
<gl:DisplayDevice>Primary</gl:DisplayDevice>
<gl:TargetRenderFrequency>30</gl:TargetRenderFrequency>
<gl:TargetUpdateFrequency>480</gl:TargetUpdateFrequency>
<gl:RenderState />
<gl:GraphicsMode>
<gl:ColorFormat>
<gl:Red>8</gl:Red>
<gl:Green>8</gl:Green>
<gl:Blue>8</gl:Blue>
<gl:Alpha>8</gl:Alpha>
</gl:ColorFormat>
<gl:Depth>16</gl:Depth>
<gl:Stencil>0</gl:Stencil>
<gl:Samples>0</gl:Samples>
<gl:AccumulatorFormat>
<gl:Red>0</gl:Red>
<gl:Green>0</gl:Green>
<gl:Blue>0</gl:Blue>
<gl:Alpha>0</gl:Alpha>
</gl:AccumulatorFormat>
<gl:Buffers>2</gl:Buffers>
<gl:Stereo>false</gl:Stereo>
</gl:GraphicsMode>
</Combinator>
</Expression>
<Expression xsi:type="IncludeWorkflow" Path="BonVision:Primitives.BonVisionResources.bonsai" />
<Expression xsi:type="Combinator">
<Combinator xsi:type="res:LoadResources" />
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="gl:RenderFrame" />
</Expression>
<Expression xsi:type="IncludeWorkflow" Path="BonVision:Environment.OrthographicView.bonsai">
<Left>-180</Left>
<Right>180</Right>
<Bottom>-90</Bottom>
<Top>90</Top>
</Expression>
<Expression xsi:type="IncludeWorkflow" Path="BonVision:Environment.SphereMapping.bonsai">
<FaceSize xsi:nil="true" />
<ClearColor>Gray</ClearColor>
<Width xsi:nil="true" />
<Height xsi:nil="true" />
<RotationZ>0</RotationZ>
<RotationY>0</RotationY>
<RotationX>0</RotationX>
</Expression>
<Expression xsi:type="IncludeWorkflow" Path="BonVision:Environment.ViewWindow.bonsai">
<Width>20</Width>
<Height>15</Height>
<Rotation>
<X>0</X>
<Y>0</Y>
<Z>0</Z>
</Rotation>
<Translation>
<X>0</X>
<Y>0</Y>
<Z>-10</Z>
</Translation>
</Expression>
<Expression xsi:type="Disable">
<Builder xsi:type="IncludeWorkflow" Path="BonVision:Environment.GammaCorrection.bonsai">
<ClearColor>Gray</ClearColor>
<GammaLut xsi:nil="true" />
</Builder>
</Expression>
<Expression xsi:type="WorkflowOutput" />
</Nodes>
<Edges>
<Edge From="0" To="1" Label="Source1" />
<Edge From="1" To="2" Label="Source1" />
<Edge From="3" To="4" Label="Source1" />
<Edge From="4" To="5" Label="Source1" />
<Edge From="4" To="8" Label="Source1" />
<Edge From="5" To="6" Label="Source1" />
<Edge From="6" To="7" Label="Source1" />
</Edges>
</Workflow>
</WorkflowBuilder>
48 changes: 48 additions & 0 deletions MPE_workflows/Allen.Logger.bonsai
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<WorkflowBuilder Version="2.6.3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p1="clr-namespace:MPE;assembly=MPEBonsai"
xmlns:rx="clr-namespace:Bonsai.Reactive;assembly=Bonsai.Core"
xmlns:mx="clr-namespace:Bonsai.DAQmx;assembly=Bonsai.DAQmx"
xmlns="https://bonsai-rx.org/2018/workflow">
<Workflow>
<Nodes>
<Expression xsi:type="WorkflowInput">
<Name>Source1</Name>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="p1:Configuration" />
</Expression>
<Expression xsi:type="MemberSelector">
<Selector>Reward.reward_volume</Selector>
</Expression>
<Expression xsi:type="PropertyMapping">
<PropertyMappings>
<Property Name="DueTime" />
</PropertyMappings>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="rx:Timer">
<rx:DueTime>PT0S</rx:DueTime>
<rx:Period>PT0S</rx:Period>
</Combinator>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="rx:Merge" />
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="mx:DigitalOutput">
<mx:Channels />
</Combinator>
</Expression>
</Nodes>
<Edges>
<Edge From="0" To="5" Label="Source1" />
<Edge From="1" To="2" Label="Source1" />
<Edge From="2" To="3" Label="Source1" />
<Edge From="3" To="4" Label="Source1" />
<Edge From="4" To="5" Label="Source2" />
<Edge From="5" To="6" Label="Source1" />
</Edges>
</Workflow>
</WorkflowBuilder>
Loading