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()
247247 public IEnumerable < TrainDpuDisplay . ListLabel > TrainDpuDisplay ( [ QueryField ] bool normalText ) => Viewer . TrainDpuDisplayList ( normalText ) ;
248248 #endregion
249249
250+ #region /API/CABCONTROLS
250251 // Note: to see the JSON, use "localhost:2150/API/CABCONTROLS" - Beware: case matters
251252 // Note: to run the webpage, use "localhost:2150/CabControls/index.html" - case doesn't matter
252253 // or use "localhost:2150/CabControls/"
253254 // Do not use "localhost:2150/CabControls/"
254255 // as that will return the webpage, but the path will be "/" not "/CabControls/ and the appropriate scripts will not be loaded.
255256
256- #region /API/CABCONTROLS
257257 [ Route ( HttpVerbs . Get , "/CABCONTROLS" ) ]
258258 public IEnumerable < ControlValue > CabControls ( ) => ( ( MSTSLocomotiveViewer ) Viewer . PlayerLocomotiveViewer ) . GetWebControlValueList ( ) ;
259259 #endregion
260260
261261 #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+
262270 [ Route ( HttpVerbs . Post , "/CABCONTROLS" ) ]
263271 public async Task SetCabControls ( )
264272 {
@@ -282,4 +290,4 @@ public async Task SetCabControls()
282290 public double Time ( ) => Viewer . Simulator . ClockTime ;
283291 #endregion
284292 }
285- }
293+ }
You can’t perform that action at this time.
0 commit comments