@@ -83,6 +83,19 @@ public ManipulatorInspectorView(ManipulatorInspectorViewModel manipulatorInspect
8383 "manipulator-inspector__manual-control-toggle"
8484 ) ;
8585
86+ var demoHomeCoordinateField = root . Q < Vector4Field > (
87+ "manipulator-inspector__demo--home-field"
88+ ) ;
89+ var demoSetHomeButton = root . Q < Button > ( "manipulator-inspector__demo--set-home-button" ) ;
90+ var demoTargetCoordinateField = root . Q < Vector4Field > (
91+ "manipulator-inspector__demo--target-field"
92+ ) ;
93+ var demoSetTargetButton = root . Q < Button > (
94+ "manipulator-inspector__demo--set-target-button"
95+ ) ;
96+ var runDemoButton = root . Q < Button > ( "manipulator-inspector__demo--run-button" ) ;
97+ var stopDemoButton = root . Q < Button > ( "manipulator-inspector__demo--stop-button" ) ;
98+
8699 // Register event handlers.
87100 addNeuropixels10 . clickable . clicked += ( ) =>
88101 manipulatorInspectorViewModel . AddVisualizationProbeCommand . Execute (
@@ -162,6 +175,24 @@ public ManipulatorInspectorView(ManipulatorInspectorViewModel manipulatorInspect
162175 {
163176 manipulatorInspectorViewModel . SetManualControlEnabledCommand . Execute ( evt . newValue ) ;
164177 } ) ;
178+ demoHomeCoordinateField . RegisterValueChangedCallback ( evt =>
179+ {
180+ manipulatorInspectorViewModel . SetDemoHomeCoordinateCommand . Execute ( evt . newValue ) ;
181+ } ) ;
182+ demoSetHomeButton . clickable . clicked += manipulatorInspectorViewModel
183+ . SetDemoHomeToCurrentPositionCommand
184+ . Execute ;
185+ demoTargetCoordinateField . RegisterValueChangedCallback ( evt =>
186+ {
187+ manipulatorInspectorViewModel . SetDemoTargetCoordinateCommand . Execute ( evt . newValue ) ;
188+ } ) ;
189+ demoSetTargetButton . clickable . clicked += manipulatorInspectorViewModel
190+ . SetDemoTargetToCurrentPositionCommand
191+ . Execute ;
192+ runDemoButton . clickable . clicked += ( ) =>
193+ manipulatorInspectorViewModel . SetIsDemoRunningCommand . Execute ( true ) ;
194+ stopDemoButton . clickable . clicked += ( ) =>
195+ manipulatorInspectorViewModel . SetIsDemoRunningCommand . Execute ( false ) ;
165196
166197 // Customize field units.
167198 anglesField . Q < FloatField > ( "appui-vector3field__x-field" ) . unit = "Yaw" ;
@@ -219,6 +250,15 @@ public static void RegisterMainViewConverters()
219250 "ManipulatorHandednessToRightButtonSelected" ,
220251 ( ref ManipulatorHandedness handedness ) => handedness == ManipulatorHandedness . Right
221252 ) ;
253+
254+ DataTypeConverters . RegisterUnidirectionalConverterGroup < bool , StyleEnum < DisplayStyle > > (
255+ "DemoIsRunningToRunButtonVisibility" ,
256+ ( ref bool isDemoRunning ) => isDemoRunning ? DisplayStyle . None : DisplayStyle . Flex
257+ ) ;
258+ DataTypeConverters . RegisterUnidirectionalConverterGroup (
259+ "DemoIsRunningToInputsEnabled" ,
260+ ( ref bool isDemoRunning ) => ! isDemoRunning
261+ ) ;
222262 }
223263 }
224264}
0 commit comments