12.03.2017, 20:13
(This post was last modified: 12.03.2017, 20:14 by Erwin van der Zwart.)
Hi Thomas,
You could use this also to scale your Lux values on client side, this way you don't need the dummy objects and server side event based scaling (:
This code is for both PC tablet and Touch visu (see lines 8 and 10)
BR,
Erwin
You could use this also to scale your Lux values on client side, this way you don't need the dummy objects and server side event based scaling (:
This code is for both PC tablet and Touch visu (see lines 8 and 10)
Code:
$(function(){
function LuxScale(value, classname){
value= value / 1000;
value = value.toFixed(2);
value = value + " klx";
// Update PC / Tablet visu
$("." + classname + ".item-value").text(value);
// Update Touch visu
$("." + classname).find(".control-value").text(value);
}
// Listener on object 1/1/14 with custom classname "lux1" (East side)
if (typeof grp != 'undefined') {
grp.listen('1/1/14', function(object, state) {
LuxScale(object.value, "lux1");
}, false);
}
// Listener on object 1/1/15 with custom classname "lux2" (South)
if (typeof grp != 'undefined') {
grp.listen('1/1/15', function(object, state) {
LuxScale(object.value, "lux2");
}, false);
}
// Listener on object 1/1/16 with custom classname "lux3" (West)
if (typeof grp != 'undefined') {
grp.listen('1/1/16', function(object, state) {
LuxScale(object.value, "lux3");
}, false);
}
});
Erwin