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()
262
262
// SetCabControls() expects a request passing an array of ControlValuePost objects using JSON.
263
263
// For example:
264
264
// [{ "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)
266
266
// , "Value": 0.50 // A floating-point value
267
267
// }
268
268
// ]
@@ -271,14 +271,16 @@ IEnumerable<string> GetValues()
271
271
public async Task SetCabControls ( )
272
272
{
273
273
var data = await HttpContext . GetRequestDataAsync < IEnumerable < ControlValuePost > > ( WebServer . DeserializationCallback < IEnumerable < ControlValuePost > > ) ;
274
- var dev = UserInput . WebDeviceState ;
274
+ var dev = UserInput . WebDeviceState ;
275
275
foreach ( var control in data )
276
276
{
277
277
var key = ( new CabViewControlType ( control . TypeName ) , control . ControlIndex ) ;
278
278
if ( ! dev . CabControls . TryGetValue ( key , out var state ) )
279
279
{
280
280
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 ;
282
284
}
283
285
state . Value = ( float ) control . Value ;
284
286
}
You can’t perform that action at this time.
0 commit comments