Facility Control

 View Only
  • 1.  PGM follow PVW

    Posted 12-09-2020 14:08

    Hello guys, 

    I hope everyone is fine!

    I have a panel which I created two parameters, PVW and PGM, and both are feed for the same sources.

    They formed toggle buttons that by pressing them, I see the desired source on my PVW or PGM. It's working fine. 

    However, I'd like to customized them to works simultaneously, it means,  if I selected source 1 in my PVW, the PGM follow this command and shows up the same source, without needed to press the button. 

    Is it possible to do that? 



  • 2.  RE: PGM follow PVW

    Posted 01-04-2021 16:03

    You can add a task to a parameter so that when it changes, you can change the other parameter.   In PanelBuilderMode, double-click on the parameter, and at the bottom, you should see a place to attach a task.

    Here is a panel that locks one parameter to another, if the lock button is toggled on.

    <abs contexttype="opengear" gridsize="20" id="_top" keepalive="false" style="">
    <meta>
    <params>
    <param access="1" constrainttype="STRING_CHOICE" maxlength="0" name="prv" oid="prv" type="STRING" value="cam1" widget="radio-toggle">
    <constraint>cam1</constraint>
    <constraint>cam2</constraint>
    <constraint>cam3</constraint>
    <constraint>cam4</constraint>
    </param>
    <param access="1" constrainttype="STRING_CHOICE" maxlength="0" name="pgm" oid="pgm" type="STRING" value="cam1" widget="radio-toggle">
    <constraint>cam1</constraint>
    <constraint>cam2</constraint>
    <constraint>cam3</constraint>
    <constraint>cam4</constraint>
    </param>
    <param access="1" constrainttype="INT_CHOICE" name="lock" oid="lock" precision="0" type="INT16" value="1" widget="toggle">
    <constraint key="0">Unlocked</constraint>
    <constraint key="1">Locked</constraint>
    </param>
    </params>
    </meta>
    <param expand="true" height="60" left="100" oid="pgm" showlabel="false" top="80" width="520">
    <task tasktype="ogscript">


    /*! block id=1000,1001,1002,1003 !*/
    if (params.getValue('lock', 0) == 1)
    {
    params.setValue('prv', 0, params.getValue('pgm', 0));
    } else {

    }
    /*!!
    &lt;block id="1000" type="if" x="461" y="100" w="268" INPUT1="ID:1001" OPERATION="equals" INPUT2="1" TRUE="ID:1002" FALSE="" IGNORE="" /&gt;
    &lt;block id="1001" type="param__top&amp;amp;lock (lock)[0]" x="10" y="264" w="243" SET="" /&gt;
    &lt;block id="1002" type="param__top&amp;amp;prv (prv)[0]" x="712" y="388" w="243" SET="ID:1003" /&gt;
    &lt;block id="1003" type="param__top&amp;amp;pgm (pgm)[0]" x="10" y="480" w="243" SET="" /&gt;
    !!*/
    /*!!&lt;checksum&gt;951fc827a3ffcf30388e3a1330c6c806&lt;/checksum&gt;!!*/</task>
    </param>
    <param expand="true" height="60" left="100" oid="prv" showlabel="false" top="200" width="520"/>
    <label height="20" left="100" name="PGM" style="txt-align:west" top="60" width="100"/>
    <label height="20" left="100" name="PRV" style="txt-align:west" top="180" width="60"/>
    <param expand="true" height="40" left="660" oid="lock" showlabel="false" top="140" width="100"/>
    </abs>

     

     

    Note that you can have both parameters locked to each other (so if either changes, the other changes), but that is more complex.   Because when you trigger the first one, it will change the second one, which will trigger the first one again, which will trigger the second one, and so on in an infinite loop.     When you want them both to be locked to each other, you need to have some sort of check to see if they have the same value.  If they do, then stop the loop.


    #DashBoard


  • 3.  RE: PGM follow PVW

    Posted 01-05-2021 11:17

    Hello Ben,

    Thanks for your usual help! I'll try to apply this example panel on my Dashboard. 

    However, I'm still wondering about it, and I'd like to know if is it possible to customized the same panel (PGM and PVW) that PGM sources only will follow the PVW ones when I press an TAKE button? 

    My best, 


    #DashBoard


  • 4.  RE: PGM follow PVW

    Posted 01-05-2021 14:28

    If it's a "take" button in your own custom panel, that's easy.   You just make your take button set the value of both the PGM and PVW to what you want.

    Here is an example of a couple of take buttons:

    <abs contexttype="opengear" gridsize="20" id="_top" keepalive="false" style="">
    <meta>
    <params>
    <param access="1" constrainttype="STRING_CHOICE" maxlength="0" name="prv" oid="prv" type="STRING" value="cam2" widget="radio-toggle">
    <constraint>cam1</constraint>
    <constraint>cam2</constraint>
    <constraint>cam3</constraint>
    <constraint>cam4</constraint>
    </param>
    <param access="1" constrainttype="STRING_CHOICE" maxlength="0" name="pgm" oid="pgm" type="STRING" value="cam3" widget="radio-toggle">
    <constraint>cam1</constraint>
    <constraint>cam2</constraint>
    <constraint>cam3</constraint>
    <constraint>cam4</constraint>
    </param>
    <param access="1" constrainttype="INT_CHOICE" name="lock" oid="lock" precision="0" type="INT16" value="0" widget="toggle">
    <constraint key="0">Unlocked</constraint>
    <constraint key="1">Locked</constraint>
    </param>
    </params>
    </meta>
    <param expand="true" height="60" left="100" oid="pgm" showlabel="false" top="80" width="520">
    <task tasktype="ogscript">


    /*! block id=1000,1001,1002,1003 !*/
    if (params.getValue('lock', 0) == 1)
    {
    params.setValue('prv', 0, params.getValue('pgm', 0));
    } else {

    }
    /*!!
    &lt;block id="1000" type="if" x="461" y="100" w="268" INPUT1="ID:1001" OPERATION="equals" INPUT2="1" TRUE="ID:1002" FALSE="" IGNORE="" /&gt;
    &lt;block id="1001" type="param__top&amp;amp;lock (lock)[0]" x="10" y="264" w="243" SET="" /&gt;
    &lt;block id="1002" type="param__top&amp;amp;prv (prv)[0]" x="712" y="388" w="243" SET="ID:1003" /&gt;
    &lt;block id="1003" type="param__top&amp;amp;pgm (pgm)[0]" x="10" y="480" w="243" SET="" /&gt;
    !!*/
    /*!!&lt;checksum&gt;951fc827a3ffcf30388e3a1330c6c806&lt;/checksum&gt;!!*/</task>
    </param>
    <param expand="true" height="60" left="100" oid="prv" showlabel="false" top="200" width="520"/>
    <label height="20" left="100" name="PGM" style="txt-align:west" top="60" width="100"/>
    <label height="20" left="100" name="PRV" style="txt-align:west" top="180" width="60"/>
    <param expand="true" height="40" left="660" oid="lock" showlabel="false" top="140" width="100"/>
    <button buttontype="push" height="60" left="860" name="&lt;html&gt;&lt;center&gt;Take&lt;br/&gt;Swap PGM/PRV&lt;/center&gt;&lt;/html&gt;" top="160" width="200">
    <task tasktype="ogscript">

    var temp = "";

    /*! block id=1000,1001 !*/
    temp = params.getValue('pgm', 0);
    /*! block id=1003,1002 !*/
    params.setValue('pgm', 0, params.getValue('prv', 0));
    /*! block id=1005,1004 !*/
    params.setValue('prv', 0, temp);
    /*!!
    &lt;block id="1000" type="temp_Generic Variable_variable" x="406" y="169" w="243" color="#ee862a" SET="ID:1001" next="ID:1003" /&gt;
    &lt;block id="1001" type="param__top&amp;amp;pgm (pgm)[0]" x="10" y="192" w="243" SET="" /&gt;
    &lt;block id="1003" type="param__top&amp;amp;pgm (pgm)[0]" x="374" y="260" w="243" SET="ID:1002" next="ID:1005" /&gt;
    &lt;block id="1002" type="param__top&amp;amp;prv (prv)[0]" x="10" y="284" w="243" SET="" /&gt;
    &lt;block id="1005" type="param__top&amp;amp;prv (prv)[0]" x="376" y="362" w="243" SET="ID:1004" /&gt;
    &lt;block id="1004" type="temp_Generic Variable_variable" x="10" y="376" w="243" color="#ee862a" SET="" /&gt;
    !!*/
    /*!!&lt;checksum&gt;cd4868245f5bd4c5f8256f564e3d1130&lt;/checksum&gt;!!*/</task>
    </button>
    <button buttontype="push" height="60" left="860" name="&lt;html&gt;&lt;center&gt;Take&lt;br/&gt;PGM becomes PRV&lt;/center&gt;&lt;/html&gt;" top="80" width="200">
    <task tasktype="ogscript">/*! block id=1007,1006 !*/
    params.setValue('pgm', 0, params.getValue('prv', 0));
    /*!!
    &lt;block id="1007" type="param__top&amp;amp;pgm (pgm)[0]" x="324" y="113" w="243" SET="ID:1006" /&gt;
    &lt;block id="1006" type="param__top&amp;amp;prv (prv)[0]" x="10" y="100" w="243" SET="" /&gt;
    !!*/
    /*!!&lt;checksum&gt;5dc9e2abf70436e3f06ea32f24b4d303&lt;/checksum&gt;!!*/</task>
    </button>
    </abs>

     

     

    If you're talking about a TAKE button on another panel or UI, then it's slightly more complicated.   

     

    If it's a carbonite TAKE button, you could drag that button onto your panel.   I believe that button is backed by a parameter (i.e. when someone presses the button, it changes a parameter to tell the Cabonite the button was pressed).   We can then put a task on that parameter and do an additional task when the button is pressed.   That way we could also change the PRV after the Carbonite has changed the PGM.

    If that's what you are talking about, let me know and I can give a more comprehensive example.   But I suspect you are talking about the first case.


    #DashBoard