File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Source/RunActivity/Viewer3D/WebServices Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -262,7 +262,7 @@ IEnumerable<string> GetValues()
262262 // SetCabControls() expects a request passing an array of ControlValuePost objects using JSON.
263263 // For example:
264264 // [{ "TypeName": "THROTTLE" // A CABViewControlTypes name - must be uppercase.
265- // , "ControlIndex": 1 // This property is optional and used in rendering cab view
265+ // , "ControlIndex": 1 // Index of control type in CVF (optional for most controls)
266266 // , "Value": 0.50 // A floating-point value
267267 // }
268268 // ]
@@ -271,14 +271,16 @@ IEnumerable<string> GetValues()
271271 public async Task SetCabControls ( )
272272 {
273273 var data = await HttpContext . GetRequestDataAsync < IEnumerable < ControlValuePost > > ( WebServer . DeserializationCallback < IEnumerable < ControlValuePost > > ) ;
274- var dev = UserInput . WebDeviceState ;
274+ var dev = UserInput . WebDeviceState ;
275275 foreach ( var control in data )
276276 {
277277 var key = ( new CabViewControlType ( control . TypeName ) , control . ControlIndex ) ;
278278 if ( ! dev . CabControls . TryGetValue ( key , out var state ) )
279279 {
280280 state = new ExternalDeviceCabControl ( ) ;
281- dev . CabControls [ key ] = state ;
281+ var controls = new Dictionary < ( CabViewControlType , int ) , ExternalDeviceCabControl > ( dev . CabControls ) ;
282+ controls [ key ] = state ;
283+ dev . CabControls = controls ;
282284 }
283285 state . Value = ( float ) control . Value ;
284286 }
You can’t perform that action at this time.
0 commit comments