Facility Control

 View Only
  • 1.  Custom panel key tally light

    Posted 05-22-2019 06:57

    Hi
    How do I go about making an "led" tally for a keyer in panel builder? As per another post dragging it from donor panel doesn't work as it is referenced by the active ME row; this one needs to be an absolute ME>Key#.
    I found a "key active" variable in the add parameters that I got going extremely crudely displaying as a radio checkbox output, but would rather a nice simple on-off tally light.
    Any help appreciated!
    Paul



  • 2.  RE: Custom panel key tally light

    Posted 05-22-2019 20:35

    Hi Paul

    Using the key cut parameter from Live Assist will likely give you what you are looking for. If you just want to color a "LED" in your UI instead of showing the actual parameter, you can use an <ogscript/> listener (or parameter task) to set the background color of a label (or other component) whenever the button changes state:

     

    <abs contexttype="opengear">
    <meta>
    <context contexttype="opengear" id="carb-context" objectid="Carbonite 00:0F:9B:03:62:79&lt;br&gt;Slot 0&lt;br&gt;Carbonite" objecttype="Carbonite">
    <ogscript handles="onchange,onload" oid="0x9A2">var keyState = params.getValue(0x9A2, 0);
    if (keyState == 1)
    {
    ogscript.setStyle('key-tally', "#FF0000");
    }
    else
    {
    ogscript.setStyle('key-tally', "#000000");
    }
    </ogscript>
    </context>
    </meta>
    <label height="43" id="key-tally" left="20" style="txt-align:west" top="20" width="160"/>
    <param contextid="carb-context" expand="true" height="71" left="226" mid="48131" oid="0x9A2" showlabel="false" top="17" width="112"/>
    </abs>

     

    Cheers.

    James


    #DashBoard


  • 3.  RE: Custom panel key tally light

    Posted 05-23-2019 02:08

    Legend! 

    Took a bit of figuring out where to apply what, but I have it functioning, thanks!!

    Paul


    #DashBoard


  • 4.  RE: Custom panel key tally light

    Posted 07-24-2019 16:30

    Hey guys,

    I'm attempting to use this for the same functionality but can't parse where to put it. Or its not working. Any help would be appreciate. I'm doing this to a button that is also doing my key cut. Here is what I have. 

     

    <button buttontype="push" colspan="1" fill="both" height="50" id="ME1 KEY 1 CUT" name="CUT" rowspan="1" weightx="1.0" weighty="1.0" width="50">
    <ogscript handles="onchange,onload" oid="0x9A2">var keyState = params.getValue(0x9A2, 0);
    if (keyState == 1)
    {
    ogscript.setStyle('ME1 KEY 1 CUT', "#FF0000");
    }
    else
    {
    ogscript.setStyle('ME1 KEY 1 CUT', "#000000");</ogscript>
    <task tasktype="ogscript">/*! block id=1041 !*/
    rosstalk.sendMessage("10.10.10.45", 7788, "KEYCUT ME:" + 1 + ":" +1);
    /*!!
    &lt;block id="1041" type="Carbonite 00:0F:9B:02:41:C0&amp;lt;br&amp;gt;Slot 0&amp;lt;br&amp;gt;Carbonite_carbonite_keycut" x="10" y="100" w="243" MESRC="ME" MENUM="1" KEYER="1" /&gt;
    !!*/
    /*!!&lt;checksum&gt;47463c19752d4639fa34efb064658953&lt;/checksum&gt;!!*/</task>
    </button>

     

     


    #DashBoard


  • 5.  RE: Custom panel key tally light

    Posted 07-24-2019 22:17

    Hiya

    I just did a tally which was based on a simple label that changed style (colour) based on the key state; but you can tailor to your cut button.

    My label had an ID of "CG1-tally". Nothing else special about it, other than a suitable size and shape.

     

    Then I made an Ogscript in the 'meta' folder called CG1 Tally. It has event types of onchange and onload. Doesn't always work on first opening the panel, but because of the onchange it is reliable after the first time.

    This is the contents of my script - (in Source, not Attributes). Forgive any typing errors as I cannot copy/paste.

    <ogscript handles="onchange,onload" name="CG1 Tally" oid="0x9A1">var keystate = params.getValue(0x9A1, 0):

    if (keyState == 2)

    {

    ogscript.setStyle('CG1-tally', "#FF0000");

    }

    else

    {

    ogscript.setStyle('CG1-tally', "#000000");

    }</ogscript>

     

    Clearly the 0x9A1 along with other details will need to be tailored, but hope this helps.

    PS remind me how to correctly post script? Ha

    Paul


    #DashBoard