File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Source/RunActivity/Viewer3D/WebServices Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -247,18 +247,26 @@ IEnumerable<string> GetValues()
247
247
public IEnumerable < TrainDpuDisplay . ListLabel > TrainDpuDisplay ( [ QueryField ] bool normalText ) => Viewer . TrainDpuDisplayList ( normalText ) ;
248
248
#endregion
249
249
250
+ #region /API/CABCONTROLS
250
251
// Note: to see the JSON, use "localhost:2150/API/CABCONTROLS" - Beware: case matters
251
252
// Note: to run the webpage, use "localhost:2150/CabControls/index.html" - case doesn't matter
252
253
// or use "localhost:2150/CabControls/"
253
254
// Do not use "localhost:2150/CabControls/"
254
255
// as that will return the webpage, but the path will be "/" not "/CabControls/ and the appropriate scripts will not be loaded.
255
256
256
- #region /API/CABCONTROLS
257
257
[ Route ( HttpVerbs . Get , "/CABCONTROLS" ) ]
258
258
public IEnumerable < ControlValue > CabControls ( ) => ( ( MSTSLocomotiveViewer ) Viewer . PlayerLocomotiveViewer ) . GetWebControlValueList ( ) ;
259
259
#endregion
260
260
261
261
#region /API/CABCONTROLS
262
+ // SetCabControls() expects a request passing an array of ControlValuePost objects using JSON.
263
+ // For example:
264
+ // [{ "TypeName": "THROTTLE" // A CABViewControlTypes name - must be uppercase.
265
+ // , "ControlIndex": 1 // This property is optional and used in rendering cab view
266
+ // , "Value": 0.50 // A floating-point value
267
+ // }
268
+ // ]
269
+
262
270
[ Route ( HttpVerbs . Post , "/CABCONTROLS" ) ]
263
271
public async Task SetCabControls ( )
264
272
{
@@ -282,4 +290,4 @@ public async Task SetCabControls()
282
290
public double Time ( ) => Viewer . Simulator . ClockTime ;
283
291
#endregion
284
292
}
285
- }
293
+ }
You can’t perform that action at this time.
0 commit comments