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

Drop Throttle commands? #13

Closed FrightRisk closed 3 years ago

FrightRisk commented 3 years ago

We need to make sure that the log has no delay, but also what do we do with something like a throttle that can fill the buffer if we spin it back and forth quickly? We can have hundreds of throttle commands that will take forever to catch up in the log. Do we flush the buffer when the throttle is changed and only show the last command? Thoughts?

ManiAkasapu commented 3 years ago

what do you think most useful to user? we can replace the content instead of appending.. so not only for throttle, for every command the content (log) will be replaced.

matt-vdv commented 3 years ago

I noticed that that happened. My suggestion would be to only have one entry for a throttle turn. Here is an example

1 t1 3 100 1

If the throttle was turned again, it would look like this:

1 t1 3 100 1 t1 3 5 1

Basically, all movements with less than one second (for example) between them would be contacted to one output.

ManiAkasapu commented 3 years ago

@FrightRisk I removed animation and it is quickly moving bottom. I think this is fine for me. Code below:

// Display log of events
function displayLog(data){
    $("#log-box").append("<br>"+data+"<br>");
    $("#log-box").scrollTop($("#log-box").prop("scrollHeight"));
}
ManiAkasapu commented 3 years ago

@matt-hu As you suggested (if I understand what you are trying there) we can use timeout to clear old log. That means if the message (log) is displayed 1 second ago (or whatever timing it is) we clear it else we append it.

matt-vdv commented 3 years ago

@ManiAkasapu that sounds about right. Do you want to have a go at implementing it in a separate branch so we can then have a look? There's no rush if you are going to do that.

ManiAkasapu commented 3 years ago

I think the main problem is delay. I removed the animation from the Logbox and now the scroll is moving to bottom without delay. I think that is enough to fix this issue. @matt-hu Let's wait and see how this change works. So I would recommend to defer. What do think?

matt-vdv commented 3 years ago

@ManiAkasapu, sorry I didn't see the code sample, my mistake! I've tried that out and it seems good! I will commit it to my dev branch. Great work!

ManiAkasapu commented 3 years ago

@matt-hu @FrightRisk I think we can close this.

matt-vdv commented 3 years ago

Yep! Well done for noticing.