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

CV programming #48

Open matt-vdv opened 3 years ago

matt-vdv commented 3 years ago

Just remembered we are lacking this. This is a crucial part of a DCC setup, so we should probably try and implement it sooner rather than later...

FrightRisk commented 3 years ago

This is strange. I added this, or thought I did the same day I input the bug report for return values not coming back from the serial monitor. Maybe I forgot to save it? Oh well, I need to see if there was anything else I intended to add and lost.

I remember I was asking about how to handle the programming. Should we have some buttons for standard programming like loco address, CV29, etc. so they can be in a "quick access" table? Then just allow "CV VALUE VERIFY" and the user just enters what they want? I don't see a way to do a table, though I guess we could of every possible number on a page. You could do like JMRI and read every CV and see which ones return. Thoughts?

ManiAkasapu commented 3 years ago

CV level programming is OK. We can have UI similar to JMRI. User can have button to read current CV value and button to Write (overwrite) desired value. And have buttons to Read All and Write all.

@FrightRisk How many CVs will be available? NMRA standards etc..I do not know about these rules & limitations.. if you will be number of CVs supported then we can add these..

We need to introduce page for Programming and get this UI ready. @matt-hu

On the other note, we should focus first on Turnout data and how to use them with in Throttle page.

FrightRisk commented 3 years ago

Rather than repeat the spec, I'll point to it and we can discuss. Basically, we have CVs from 1-1024. There is a method for extending them to allow for for 65,537 CVs. I think for starters, we just handle 1-1024 as normal CVs.

https://dccwiki.com/Configuration_Variable#:~:text=NMRA%20Standards,-Main%20article%3A%20Configuration&text=2.2%20defined%20the%20ranges%201,512%2D1024%20as%20normal%20CVs.

matt-vdv commented 3 years ago

@FrightRisk thanks for that! I know very little about CVs (I have only changed the address and acceleration of my decoders!), so I will make sure to have a look at that...

FrightRisk commented 3 years ago

I think we can start with the following regarding CVs. We can't just say "adjust volume" or "change to bell number 3" because things are so non standard. JMRI gets around some of this by maintaining a list of 100s of decoder definition files for all those locos. We could copy those, but I am thinking simple is better. People need to get out their loco sheet and look at the table and then just put in a number. JMRI has a "single CV program" screen and a "program sheet" with all the CVs on it. So you can read an entire page worth of CVs and save the values if you want for that loco. Again, just having the ability to program would be a big deal, it doesn't have to be fancy now. It could even be just a box to enter the cv, a box for the value and then a read and write button. What we know:

1-46 and 65-112 are standard for the most part. We can look at the tables for the major decoder manufacturers and load that as a starting point. That would mean reading us creating files for the major decoder manufacturers. If we are going to read pages, we are going to have to know how to set CV32 to page 1, 2, or 3 and then read CVs 257. Where it could get complicated is if we want ease of use features, like knowing that CV 1 has all zeros and therefore we need to read CV12 and then report we see an alternate power mode. Or read the CV for consisting and show that address. CV29 is a special case of bitflags, so do we decode them and print a table of what things are on and off? ETc. Etc.

matt-vdv commented 3 years ago

@FrightRisk @ManiAkasapu I have added a blank CV programming page to the features/cv branch