Skip to content

Commit

Permalink
Implement lock/unlock buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
bruno-f-cruz committed Jun 12, 2024
1 parent 26fdb92 commit e45a3a5
Showing 1 changed file with 131 additions and 62 deletions.
193 changes: 131 additions & 62 deletions src/AllenNeuralDynamics.AindManipulator/AindManipulator.bonsai
Original file line number Diff line number Diff line change
Expand Up @@ -839,34 +839,98 @@
<Expression xsi:type="SubscribeSubject">
<Name>EnableMotorUiControl</Name>
</Expression>
<Expression xsi:type="scr:ExpressionTransform">
<scr:Expression>it ? "Unlock" : "Lock"</scr:Expression>
</Expression>
<Expression xsi:type="PropertyMapping">
<PropertyMappings>
<Property Name="Text" />
<Property Name="Enabled" />
</PropertyMappings>
</Expression>
<Expression xsi:type="gui:ButtonBuilder">
<gui:Name>Lock</gui:Name>
<gui:Enabled>true</gui:Enabled>
<gui:Visible>true</gui:Visible>
<gui:Text>Lock</gui:Text>
</Expression>
<Expression xsi:type="rx:Sink">
<Name>Lock</Name>
<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="MulticastSubject">
<Name>EnableMotorUiControl</Name>
</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" />
</Edges>
</Workflow>
</Expression>
<Expression xsi:type="VisualizerMapping">
<VisualizerType xsi:type="TypeMapping" TypeArguments="gui:ButtonVisualizer" />
</Expression>
<Expression xsi:type="SubscribeSubject">
<Name>EnableMotorUiControl</Name>
</Expression>
<Expression xsi:type="BitwiseNot" />
<Expression xsi:type="PropertyMapping">
<PropertyMappings>
<Property Name="Checked" />
<Property Name="Enabled" />
</PropertyMappings>
</Expression>
<Expression xsi:type="gui:ToggleButtonBuilder">
<gui:Name>ControlBypass</gui:Name>
<gui:Enabled>true</gui:Enabled>
<Expression xsi:type="gui:ButtonBuilder">
<gui:Name>Unlock</gui:Name>
<gui:Enabled>false</gui:Enabled>
<gui:Visible>true</gui:Visible>
<gui:Text />
<gui:Checked>false</gui:Checked>
<gui:Text>Unlock</gui:Text>
</Expression>
<Expression xsi:type="MulticastSubject">
<Name>EnableMotorUiControl</Name>
<Expression xsi:type="rx:Sink">
<Workflow>
<Nodes>
<Expression xsi:type="WorkflowInput">
<Name>Source1</Name>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="BooleanProperty">
<Value>true</Value>
</Combinator>
</Expression>
<Expression xsi:type="MulticastSubject">
<Name>EnableMotorUiControl</Name>
</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" />
</Edges>
</Workflow>
</Expression>
<Expression xsi:type="VisualizerMapping">
<VisualizerType xsi:type="TypeMapping" TypeArguments="gui:ButtonVisualizer" />
</Expression>
<Expression xsi:type="gui:TableLayoutPanelBuilder">
<gui:Name>LockUnlock</gui:Name>
<gui:Enabled>true</gui:Enabled>
<gui:Visible>true</gui:Visible>
<gui:Font>Microsoft Sans Serif, 36pt</gui:Font>
<gui:ColumnCount>2</gui:ColumnCount>
<gui:RowCount>1</gui:RowCount>
<gui:ColumnStyles />
<gui:RowStyles />
<gui:CellSpans />
</Expression>
<Expression xsi:type="VisualizerMapping">
<VisualizerType xsi:type="TypeMapping" TypeArguments="gui:ToggleButtonVisualizer" />
<VisualizerType xsi:type="TypeMapping" TypeArguments="gui:TableLayoutPanelVisualizer" />
</Expression>
<Expression xsi:type="GroupWorkflow">
<Name>HasAxis</Name>
Expand Down Expand Up @@ -941,7 +1005,7 @@
</Expression>
<Expression xsi:type="gui:ButtonBuilder">
<gui:Name>-X</gui:Name>
<gui:Enabled>false</gui:Enabled>
<gui:Enabled>true</gui:Enabled>
<gui:Visible>true</gui:Visible>
<gui:Text>-X</gui:Text>
</Expression>
Expand Down Expand Up @@ -1058,7 +1122,7 @@
</Expression>
<Expression xsi:type="gui:ButtonBuilder">
<gui:Name>+X</gui:Name>
<gui:Enabled>false</gui:Enabled>
<gui:Enabled>true</gui:Enabled>
<gui:Visible>true</gui:Visible>
<gui:Text>+X</gui:Text>
</Expression>
Expand Down Expand Up @@ -1433,7 +1497,7 @@
</Expression>
<Expression xsi:type="gui:ButtonBuilder">
<gui:Name>-Y2</gui:Name>
<gui:Enabled>false</gui:Enabled>
<gui:Enabled>true</gui:Enabled>
<gui:Visible>true</gui:Visible>
<gui:Text>-Y2</gui:Text>
</Expression>
Expand Down Expand Up @@ -1550,7 +1614,7 @@
</Expression>
<Expression xsi:type="gui:ButtonBuilder">
<gui:Name>+Y2</gui:Name>
<gui:Enabled>false</gui:Enabled>
<gui:Enabled>true</gui:Enabled>
<gui:Visible>true</gui:Visible>
<gui:Text>+Y2</gui:Text>
</Expression>
Expand Down Expand Up @@ -1679,7 +1743,7 @@
</Expression>
<Expression xsi:type="gui:ButtonBuilder">
<gui:Name>-Z</gui:Name>
<gui:Enabled>false</gui:Enabled>
<gui:Enabled>true</gui:Enabled>
<gui:Visible>true</gui:Visible>
<gui:Text>-Z</gui:Text>
</Expression>
Expand Down Expand Up @@ -1796,7 +1860,7 @@
</Expression>
<Expression xsi:type="gui:ButtonBuilder">
<gui:Name>+Z</gui:Name>
<gui:Enabled>false</gui:Enabled>
<gui:Enabled>true</gui:Enabled>
<gui:Visible>true</gui:Visible>
<gui:Text>+Z</gui:Text>
</Expression>
Expand Down Expand Up @@ -1852,6 +1916,14 @@
<Expression xsi:type="VisualizerMapping">
<VisualizerType xsi:type="TypeMapping" TypeArguments="gui:TableLayoutPanelVisualizer" />
</Expression>
<Expression xsi:type="SubscribeSubject">
<Name>EnableMotorUiControl</Name>
</Expression>
<Expression xsi:type="PropertyMapping">
<PropertyMappings>
<Property Name="Enabled" />
</PropertyMappings>
</Expression>
<Expression xsi:type="gui:TableLayoutPanelBuilder">
<gui:Name>ManipulatorOffsetButton</gui:Name>
<gui:Enabled>true</gui:Enabled>
Expand All @@ -1866,14 +1938,6 @@
<Expression xsi:type="VisualizerMapping">
<VisualizerType xsi:type="TypeMapping" TypeArguments="gui:TableLayoutPanelVisualizer" />
</Expression>
<Expression xsi:type="SubscribeSubject">
<Name>EnableMotorUiControl</Name>
</Expression>
<Expression xsi:type="PropertyMapping">
<PropertyMappings>
<Property Name="Enabled" />
</PropertyMappings>
</Expression>
<Expression xsi:type="gui:TableLayoutPanelBuilder">
<gui:Name>ManipulatorOffset</gui:Name>
<gui:Enabled>true</gui:Enabled>
Expand Down Expand Up @@ -1956,79 +2020,84 @@
<Edges>
<Edge From="0" To="1" Label="Source1" />
<Edge From="2" To="3" Label="Source1" />
<Edge From="3" To="64" Label="Source1" />
<Edge From="3" To="69" Label="Source1" />
<Edge From="4" To="5" Label="Source1" />
<Edge From="5" To="6" Label="Source1" />
<Edge From="6" To="9" Label="Source1" />
<Edge From="6" To="7" Label="Source1" />
<Edge From="7" To="8" Label="Source1" />
<Edge From="8" To="9" Label="Source2" />
<Edge From="8" To="15" Label="Source1" />
<Edge From="9" To="10" Label="Source1" />
<Edge From="10" To="11" Label="Source1" />
<Edge From="11" To="64" Label="Source2" />
<Edge From="11" To="12" Label="Source1" />
<Edge From="12" To="13" Label="Source1" />
<Edge From="13" To="14" Label="Source1" />
<Edge From="14" To="15" Label="Source1" />
<Edge From="14" To="15" Label="Source2" />
<Edge From="15" To="16" Label="Source1" />
<Edge From="16" To="22" Label="Source1" />
<Edge From="16" To="69" Label="Source2" />
<Edge From="17" To="18" Label="Source1" />
<Edge From="18" To="19" Label="Source1" />
<Edge From="19" To="20" Label="Source1" />
<Edge From="20" To="21" Label="Source1" />
<Edge From="21" To="22" Label="Source2" />
<Edge From="21" To="27" Label="Source1" />
<Edge From="22" To="23" Label="Source1" />
<Edge From="23" To="60" Label="Source1" />
<Edge From="23" To="24" Label="Source1" />
<Edge From="24" To="25" Label="Source1" />
<Edge From="25" To="26" Label="Source1" />
<Edge From="26" To="27" Label="Source1" />
<Edge From="26" To="27" Label="Source2" />
<Edge From="27" To="28" Label="Source1" />
<Edge From="28" To="34" Label="Source1" />
<Edge From="28" To="67" Label="Source1" />
<Edge From="29" To="30" Label="Source1" />
<Edge From="30" To="31" Label="Source1" />
<Edge From="31" To="32" Label="Source1" />
<Edge From="32" To="33" Label="Source1" />
<Edge From="33" To="34" Label="Source2" />
<Edge From="33" To="39" Label="Source1" />
<Edge From="34" To="35" Label="Source1" />
<Edge From="35" To="60" Label="Source2" />
<Edge From="35" To="36" Label="Source1" />
<Edge From="36" To="37" Label="Source1" />
<Edge From="37" To="38" Label="Source1" />
<Edge From="38" To="39" Label="Source1" />
<Edge From="38" To="39" Label="Source2" />
<Edge From="39" To="40" Label="Source1" />
<Edge From="40" To="46" Label="Source1" />
<Edge From="40" To="67" Label="Source2" />
<Edge From="41" To="42" Label="Source1" />
<Edge From="42" To="43" Label="Source1" />
<Edge From="43" To="44" Label="Source1" />
<Edge From="44" To="45" Label="Source1" />
<Edge From="45" To="46" Label="Source2" />
<Edge From="45" To="51" Label="Source1" />
<Edge From="46" To="47" Label="Source1" />
<Edge From="47" To="60" Label="Source3" />
<Edge From="47" To="48" Label="Source1" />
<Edge From="48" To="49" Label="Source1" />
<Edge From="49" To="50" Label="Source1" />
<Edge From="50" To="51" Label="Source1" />
<Edge From="50" To="51" Label="Source2" />
<Edge From="51" To="52" Label="Source1" />
<Edge From="52" To="58" Label="Source1" />
<Edge From="52" To="67" Label="Source3" />
<Edge From="53" To="54" Label="Source1" />
<Edge From="54" To="55" Label="Source1" />
<Edge From="55" To="56" Label="Source1" />
<Edge From="56" To="57" Label="Source1" />
<Edge From="57" To="58" Label="Source2" />
<Edge From="57" To="63" Label="Source1" />
<Edge From="58" To="59" Label="Source1" />
<Edge From="59" To="60" Label="Source4" />
<Edge From="59" To="60" Label="Source1" />
<Edge From="60" To="61" Label="Source1" />
<Edge From="61" To="64" Label="Source3" />
<Edge From="62" To="63" Label="Source1" />
<Edge From="63" To="64" Label="Source4" />
<Edge From="64" To="65" Label="Source1" />
<Edge From="66" To="67" Label="Source1" />
<Edge From="67" To="74" Label="Source1" />
<Edge From="68" To="69" Label="Source1" />
<Edge From="69" To="74" Label="Source2" />
<Edge From="70" To="71" Label="Source1" />
<Edge From="71" To="74" Label="Source3" />
<Edge From="72" To="73" Label="Source1" />
<Edge From="73" To="74" Label="Source4" />
<Edge From="74" To="75" Label="Source1" />
<Edge From="61" To="62" Label="Source1" />
<Edge From="62" To="63" Label="Source2" />
<Edge From="63" To="64" Label="Source1" />
<Edge From="64" To="67" Label="Source4" />
<Edge From="65" To="66" Label="Source1" />
<Edge From="66" To="67" Label="Source5" />
<Edge From="67" To="68" Label="Source1" />
<Edge From="68" To="69" Label="Source3" />
<Edge From="69" To="70" Label="Source1" />
<Edge From="71" To="72" Label="Source1" />
<Edge From="72" To="79" Label="Source1" />
<Edge From="73" To="74" Label="Source1" />
<Edge From="74" To="79" Label="Source2" />
<Edge From="75" To="76" Label="Source1" />
<Edge From="76" To="77" Label="Source1" />
<Edge From="76" To="79" Label="Source3" />
<Edge From="77" To="78" Label="Source1" />
<Edge From="78" To="79" Label="Source4" />
<Edge From="79" To="80" Label="Source1" />
<Edge From="80" To="81" Label="Source1" />
<Edge From="81" To="82" Label="Source1" />
</Edges>
</Workflow>
</Expression>
Expand Down Expand Up @@ -2149,7 +2218,7 @@
</Expression>
<Expression xsi:type="gui:ButtonBuilder">
<gui:Name>SetPosition</gui:Name>
<gui:Enabled>false</gui:Enabled>
<gui:Enabled>true</gui:Enabled>
<gui:Visible>true</gui:Visible>
<gui:Font>Microsoft Sans Serif, 36pt</gui:Font>
<gui:Text>Set position</gui:Text>
Expand Down

0 comments on commit e45a3a5

Please sign in to comment.