How to disable dial animations?

Hi, I'm using various types of the dial widget to display various temperature sensors, meter readings and fuel levels for a building. I'm displaying this dashboard on a Samsung Smart TV, which obviously doesn't have the greatest processing power so the way the dials animate from zero to the current value both seems unnecessary and looks terrible (shaky and slow).

Is there anyway I can disable the animation of these dials?? I presumed it would be as easy as deleting a few lines of dial_render.js but unfortunately I'm not fluent enough in JavaScript to not worry about deleting the wrong section.

 

Thanks in advance to anyone who can offer any help,

Will

Jérôme's picture

Re: How to disable dial animations?

I think these are not meant to be an animation, but are the side effect of a low-pass filtering, 0 being used as the initial value.

I just had a look and I think it happens in function curve_value():

https://github.com/emoncms/emoncms/blob/master/Modules/dashboard/Views/j...

What happens if you change

assoc_curve[feed] = assoc_curve[feed] + ((parseFloat(assoc[feed]) - assoc_curve[feed]) * rate);

into

assoc_curve[feed] = parseFloat(assoc[feed]);

?

(If it works, you may want to search for curve_value in the code, to check it does not have any effect in other functions.)

Perhaps a better idea to remove the initial ramp up phase, while keeping the low-pass, would be to replace

if (!assoc_curve[feed]) assoc_curve[feed] = 0;

with

if (!assoc_curve[feed]) assoc_curve[feed] = parseFloat(assoc[feed]);

These are just assumptions. My Pi is down, I didn't check anything.

aniston's picture

Re: How to disable dial animations?

@Will , even though this reply comes after more than a year ...

just incase you or anyone else still needing to manipulate the "dial" animation: (careful as these changes will affect the whole EMONCMS ! (this change will apply to "bar" and "jgauge" as well not only "dial")

on my emoncms ver8.3.6 on my Ubuntu 14 stock installation i found that i could modify

/emoncms/Modules/dashboard/Views/js/render.js         at line 28

var dialrate = 0.02;

I set this after some trial and error to 0.2 which for me brought this dial upto 10x speed. You can set the value  close to 1.02 the fastest or practically NO ANIMATION (which is probably what you were looking for)

Careful that if you set it to an Integer digit like 0 or 1 it just does not work and you will end up with a 0 (ZERO) display !

On the other hand if you set it in these ranges ..

0.20 Gives you a sort of 10x animation speed

1.02 Gives you a sort of direct to value settling (with a -0.01 error in the settled value)

1.72 Gives you a sort of vibration effect, spring loaded needle (with a +0.01 error in the settled value)

Values above 2 give undesirable FUNKY effects and generally don't settle to the end value!

These were my findings based on trial and error approximation values, your mileage could very well vary :)

happy animations,

...aniston

ricard0g0mes's picture

Re: How to disable dial animations?

just what i was looking for!

 

thanks!!!!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.