aktos-io / aktos-scada

Web based SCADA system for industrial and home automation systems
https://aktos.io
10 stars 9 forks source link

color ranges of gauges must be defined easily #39

Open ceremcem opened 8 years ago

ceremcem commented 8 years ago

Gauges might have static or dynamic, color ranges.

for example, a gauge should be set by the following:

{{>gauge {..., range: '0 blue 100'} }}   
# => simple blue color, from 0 to 100

{{>gauge {..., range: '0 blue 10| green |50 red 80'} }}   
# => overall range is 0 to 80, blue between 0 and 10, green between 10 and 50, 
#      red between 50 and 80, color changes are immediate
#      blue at 10, red at 50

{{>gauge {..., gradient_range: '0 blue |10 green |50 red 80'} }}   
# => same as above, color changes are gradient
#      green at 10, red at 50

{{>gauge {..., gradient_range: '0 blue 10 #aaa #bbb #ccc 120'} }}   
# => same as above, but mid point between 10 and 120 is set by `pin_name = 'bbb'`, 
#      color between `10` and `#bbb` is set by message sent for `pin_name = 'aaa'` and 
#      so on... 
#      default : blue at 10, #aaa at #bbb