Hey Folks- I searched, but was unable to find anything regarding the “alarmled” parameter widget type. I’ve been toying around with it, but can’t seem to get it to work like I think it should.
I’d basically like to have a parameter that I can set to either 0 or 1 and have the light turn Red or Green accordingly. I’m scripting it such that it’ll tell me whether or not a particular listener is connected.
I’ve tried both CHOICE_CONSTRAINT and ALARM_TABLE constraints, neither seem to work properly.
Can anyone shed some light on how alarmled’s work? Thanks!
Bo
Hi Bo,
Its important to recognize that the Alarm Table constraint is evaluating bits and not decimal values. This can lead to a bit of confusion.
A common way to have a light turn red or green is to send the text parameter an embedded colour code. In the code snippet below, I have a ogScript function that evaluates if the passed value is 1 or 0 and will update the light colour. I have used an unconstrained type in this example.
NOTE: You can choose whether or not to send text along with the colour code.
Please let me know if you have any questions.
function setAlarm(num){
switch(num) {
case 0:
params.setValue(“alarm”, 0, “Disconnection<#ff0000>”);
break;
case 1:
params.setValue(“alarm”, 0, “<#13E40C>”);
break;
}
}
setAlarm(0);
setAlarm(1);
[#DashBoard](https://livinglive.community/search?s=tags%3A%22DashBoard%22&executesearch=true)
That’s exactly what I needed. Thanks Dave!!
#DashBoard