James Ross, on 21 July 2018 - 03:58 AM, said:
Like Carlo mentioned, this sounds like a great implementation of the
cruise control card on our roadmap.
We'll want this code to be separated from the base locomotive code, like the existing items in Source\Orts.Simulation\Simulation\RollingStocks\SubSystems, but hopefully that's not too hard given the existing Train Control System, which does a similar set of things but via a script file.
If you can provide the diff/patch file and test builds, we can ensure that things are all in order before committing.
Hi. What I have done is I created a new class called CruiseControl under the SubSystems and put all logic there. If the engine is in CruiseControl's "Auto" mode, it is skipping the UpdateMotiveForce in the MSTSLocomotive and use the modified one from CruiseControl, that injects the TractiveForceN into the MSTSLocomotive. The CruiseControl is also able control the dynamic and train brakes.
Everything that the CruiseControl needs is set up in the eng file. So if no ORTSCruiseControl section in the eng file is present, everything runs as normal. Of course I needed to add some stf reading to the MSTSLocomotive, and also some stuff into the MSTSLocomotiveViewer and InputSettins to populate the controls and actions needed. I also added some CabView stuff. But these are just standart changes.
James Ross, on 21 July 2018 - 03:58 AM, said:
What is the purpose of this bit? It's also something that is known to the game, so I'd prefer we not include it.
Number of axes is set by the driver in the engine and it's little special for Czech and Slovak engines speed regulator system. It's used to remember a point, where restricted speed zone ends. As you pass this point, you press a button, and after then, you can select new speed. Once the whole train passes the point where you press the button (according to number of axes - or train length, that you select), the engine will start to accelerate to the new selected speed. Also a light is illuminated between the button press and the distance needed to pass, and is also used to determine, that the train has passed the whole platform, so that the last doors are above safe groud, etc..
James Ross, on 21 July 2018 - 03:58 AM, said:
I'm not sure I understand the shortcuts used here, but we can review them with the code.
These shortucts are to set the maximum acceleration the driver desire. In Czech trains it has 12 positions. 1= slow acceleration, 12= max. This feature can also be set incrementaly from -100 to +100%, and again is adjustable in the eng file.
James Ross, on 21 July 2018 - 03:58 AM, said:
What's the shortcut for this switch?
This one again is special mode equipped in Czech and Slovak engines, and it's called like "Agreement to go". It's a spring loaded switch that must be held until the train reaches 3km/h. It's just a kind of launch switch, confirming you want the auto speed controller to be engaged. Again, configured in eng.
I may do a diff from latest X version, but I am still in process of testing of many different engines, trying to avoid any bugs, and find all configurations, that will be needed for the variety of the world. I am awaiting delivery of tuned Thalys & LGV trains, and later I would love to implement also stuff like LZB used in Germany, that can also stop the train and/or control it's speed according to the signal or track speed restrictions.
As most of modern trains are highly automated, I believe my contribution will be a popular enhancement of the sim. (If accepted). :)