DCC-EX / WebThrottle-EX

WebThrottle-EX is a web based (html,jQuery,JavaScript) Controller/Throttle for DCC-EX EX-CommandStations
https://dcc-ex.com/WebThrottle-EX
GNU General Public License v3.0
21 stars 14 forks source link

Add an emulator #7

Closed matt-vdv closed 3 years ago

matt-vdv commented 3 years ago

It would be useful if there was an emulator built in, similar to the one on the control system for DCC++ classic.

This would allow for users to test the software before they committed to buying and Arduino/base station, and also for people who want to contribute but don't always have a base station attached to the pc they use for development.

FrightRisk commented 3 years ago

I really haven't taken the time yet to do anything other than look at the controller source. Not very many people used it, in part because it required yet another thing to install. I don't have any more space on this machine to install "processing" just to run a controller. That was the inspiration for me deciding to write a web based throttle that Mani and I are working on.

Do you have much experience with DCC++ Controller? What can you tell us about it? How does it work? What does it do to simulate? Does it actually have a dot or something to make a "train" move on the track? We can talk here and then move to Discord if we need to and chat in more detail.

matt-vdv commented 3 years ago

You are right, the old controller was a bit of a pain to use, partly because of having to install processing but also due to having to configure it fully in software. The web throttle looks like it is going to be much better!

Basically, what the emulator did was it enabled the software to run fully without an Arduino attached, simulating responses therefore stopping runtime errors occurring. In the words of the DCC++ Classic documentation:

If you do not have an Arduino Base Station, or just want to test out the Controller, you can select "Emulator" from the serial connection window. This will allow the Controller to operate most functions as if it were connected to a Base Station.

Note that most of the functions on the Controller rely on feedback from the Base Station in order to operate. This is why the imbedded "Emulator" functionality is needed -- to provide emulated feedback to the Controller.

If it would be helpful, I am prepared to have a go at implementing it myself on my fork, then I can submit a pull request if I manage to get it working.

FrightRisk commented 3 years ago

Matt, are you on our Discord? I sent you an invite here to be part of the web throttle team. Feel free to work here in this repo on your own branch rather than fork it. Let's figure out a way to trade info so we have each others' contact information and we can see where we are both going with projects and which ones we can help each other on.

matt-vdv commented 3 years ago

@FrightRisk thanks for that! My main project at the moment is the TrainLink API. When I saw what you were doing here, I thought that the API would work well with it. I am going to have a go implementing it and I was using the emulator to get to know the code.