Facility Control

 View Only
  • 1.  Dashboard Custom Panel - Display Current Source on Ultrix Crosspoint

    Posted 08-07-2024 17:36

    I'm working on a custom panel to control fixed Destinations on our UltrixFR12. I'd like it to be push button but with a lock feature.

    What I'm having trouble with is getting the current source that's routed to that destination to stay lit to show what is currently routed. I'd also like to be able to have a text display next to the row of buttons. Any help would be greatly appreciated!





  • 2.  RE: Dashboard Custom Panel - Display Current Source on Ultrix Crosspoint

    Posted 08-08-2024 06:55

    Hi David, 

    There are few tasks in this panel, I'd suggest breaking each of them down into individual tasks in tackling them on a custom panel.

    • Router SRC selection and Take Immediate.
    • Destination Status get value (string) and rename buttons.
    • Lock Destination and Unlock destination.

    Good news is all these functions are available in the Ultrix api. When adding a device to your custom panel from the Tree like the Ultrix, it will include these api functions when creating a task for any buttons. 

    On the custom panel in edit mode, double-click on the button, scroll to the bottom and 'Add Task', the Devices added from the Tree will be in the left (if not select '+' to add them). Now expand the devices tree to API where all the base functions are. Drag in each function you require. For the operations above you'll need the 'take crosspoint', 'get crosspoint source', 'lock destination', 'free destination' and 'lock status'.

    *BUG NOTE*

    There is a bug with 'get destination status' that means you'll need to modify the ogscript once drag-n-dropped the function into the visual editor.

    Here is the SRC 1 button functions in visual editor, 'take crosspoint' and below, 'get crosspoint source' that's renaming the Label called ID "dest.status".

    Navigate to ogScript top left of window, you'll see the script equivalent of the Visual pane. Delete the '+ 1' from the end of the function, then add "AsString" directly to the end of the "getValue" so it reads "getValueAsString" instead. There will be a pop-up indicating you cannot return to Visual editor once a manual change is made, click yes to this.

    This update does two things, removes the '+1' bug and ensures you receive the name of the source rather than the port id.

    I've included an example panel that you may review for ideas. 

    Best regards, 

    Richard

    <abs contexttype="opengear" gridsize="20" keepalive="true">
       <meta>
          <context contexttype="opengear" id="Ultrix" objectid="Ultrix-5ru-50245846007&lt;br&gt;Slot 0&lt;br&gt;Ultrix-5ru" objecttype="Ultrix-5ru" subscriptions="true"/>
       </meta>
       <abs height="140" left="40" style="bdr#selectbg;bdr:round;" top="40" width="620">
          <button buttontype="push" height="100" left="380" name="Lock" style="bg#red;" top="20" width="100">
             <task tasktype="ogscript">/*! block id=1029 !*/
    var panelid = ogscript.getString("Ultrix" + "_panelID");
    if (panelid == null) {
      panelid = 1999;
    }
    var levString = 1 + "";
    var levels = levString.split(",");			
    var multi1 = params.createMultiSet("Ultrix");
    multi1.setValue('params.statusByDestination.0.lockowner',0,panelid);
    for (i = 0; i &lt; levels.length; i++) {
    	multi1.setValue('params.statusByDestination.' + (1 - 1) + '.lockowner',levels[i] - 1,panelid);
    	multi1.setValue('params.statusByDestination.' + (1 - 1) + '.lockstatus',levels[i] - 1,2);
    }
    multi1.execute();
    /*! block id=1031,1030 !*/
    ogscript.debug(params.getParam("Ultrix", 'params.statusByDestination.' + (1 - 1) + '.lockstatus', 1 - 1).getValue());
    /*!!
     &lt;block id="1029" type="Ultrix_ultix_lockcrosspoint" x="120" y="104" w="243" DEST="1" LEVEL="1" /&gt;
    &lt;block id="1031" type="ogscript_debug" x="505" y="144" w="243" MESSAGE="ID:1030" /&gt;
    &lt;block id="1030" type="Ultrix_ultix_getcrosspointlock" x="166" y="270" w="243" DEST="1" LEVEL="1" /&gt;
    !!*/
    /*!!&lt;checksum&gt;5e429b8aa527df85686dd2f345d9d71a&lt;/checksum&gt;!!*/</task>
          </button>
          <button buttontype="push" height="100" left="500" name="Unlock" style="bg#lightdivider;" top="20" width="100">
             <task tasktype="ogscript">/*! block id=1032 !*/
    var panelid = ogscript.getString("Ultrix" + "_panelID");
    if (panelid == null) {
      panelid = 1999;
    }
    var levString = 1 + "";
    var levels = levString.split(",");			
    var multi1 = params.createMultiSet("Ultrix");
    for (i = 0; i &lt; levels.length; i++) {
    	multi1.setValue('params.statusByDestination.' + (1 - 1) + '.lockowner',levels[i] - 1,panelid);
    	multi1.setValue('params.statusByDestination.' + (1 - 1) + '.lockstatus',levels[i] - 1,0);
    }
    multi1.execute();
    /*! block id=1034,1033 !*/
    ogscript.debug(params.getParam("Ultrix", 'params.statusByDestination.' + (1 - 1) + '.lockstatus', 1 - 1).getValue());
    /*!!
     &lt;block id="1032" type="Ultrix_ultix_freecrosspoint" x="251" y="161" w="243" DEST="1" LEVEL="1" /&gt;
    &lt;block id="1034" type="ogscript_debug" x="440" y="364" w="243" MESSAGE="ID:1033" /&gt;
    &lt;block id="1033" type="Ultrix_ultix_getcrosspointlock" x="126" y="333" w="243" DEST="1" LEVEL="1" /&gt;
    !!*/
    /*!!&lt;checksum&gt;fdfcdb57eb37d69d91d398983b6541c4&lt;/checksum&gt;!!*/</task>
          </button>
          <button buttontype="push" height="100" left="20" name="SRC 1" style="bg#78B479;" top="20" width="100">
             <task tasktype="ogscript">/*! block id=1035 !*/
    var panelid = ogscript.getString("Ultrix" + "_panelID");
    if (panelid == null) {
      panelid = 1999;
    }
    var levString = 1 + "";
    var levels = levString.split(",");			
    var multi1 = params.createMultiSet("Ultrix");
    multi1.setValue('params.statusByDestination.0.lockowner',0,panelid);
    for (i = 0; i &lt; levels.length; i++) {
    	multi1.setValue('params.statusByDestination.' + (1 - 1) + '.inputstatus',levels[i] - 1,1 - 1);	
    }			
    multi1.execute();
    /*! block id=1051,1052 !*/
    ogscript.rename("dest.status", (params.getParam("Ultrix", 'params.statusByDestination.' + (1 - 1) + '.inputstatus', (1 - 1)).getValueAsString()));
    /*!!
     &lt;block id="1035" type="Ultrix_ultix_takecrosspoint" x="283" y="10" w="243" SRC="1" DEST="1" LEVEL="1" /&gt;
    &lt;block id="1051" type="ogscript_rename" x="283" y="150" w="243" ID="dest.status" NAME="ID:1052" /&gt;
    &lt;block id="1052" type="Ultrix_ultix_getcrosspoint" x="10" y="150" w="243" DEST="1" LEVEL="1" /&gt;
    !!*/
    /*!!&lt;checksum&gt;658db1faf75f5231fea68ec2c9a20f47&lt;/checksum&gt;!!*/</task>
          </button>
          <button buttontype="push" height="100" left="140" name="SRC 2" style="bg#78B479;" top="20" width="100">
             <task tasktype="ogscript">/*! block id=1048 !*/
    var panelid = ogscript.getString("Ultrix" + "_panelID");
    if (panelid == null) {
      panelid = 1999;
    }
    var levString = 1 + "";
    var levels = levString.split(",");			
    var multi1 = params.createMultiSet("Ultrix");
    multi1.setValue('params.statusByDestination.0.lockowner',0,panelid);
    for (i = 0; i &lt; levels.length; i++) {
    	multi1.setValue('params.statusByDestination.' + (1 - 1) + '.inputstatus',levels[i] - 1,1 - 1);	
    }			
    multi1.execute();
    /*! block id=1050,1049 !*/
    ogscript.rename("dest.status", (params.getParam("Ultrix", 'params.statusByDestination.' + (1 - 1) + '.inputstatus', (1 - 1)).getValueAsString()));
    /*!!
     &lt;block id="1048" type="Ultrix_ultix_takecrosspoint" x="283" y="10" w="243" SRC="1" DEST="1" LEVEL="1" /&gt;
    &lt;block id="1050" type="ogscript_rename" x="283" y="150" w="243" ID="dest.status" NAME="ID:1049" /&gt;
    &lt;block id="1049" type="Ultrix_ultix_getcrosspoint" x="10" y="150" w="243" DEST="1" LEVEL="1" /&gt;
    !!*/
    /*!!&lt;checksum&gt;6a2c536b39a0c2d19341ca8ef2b7557b&lt;/checksum&gt;!!*/</task>
          </button>
          <label height="40" left="260" name="Status" style="txt-align:center" top="20" width="100"/>
          <label height="40" id="dest.status" left="260" style="txt-align:center;bdr#panelfg;bdr:round;" top="60" width="100"/>
       </abs>
       <label height="20" left="40" name="DEST 1" style="txt-align:center;" top="20" width="140"/>
    </abs>
    



    ------------------------------
    Richard Crutwell
    Ross Video UK
    ------------------------------



  • 3.  RE: Dashboard Custom Panel - Display Current Source on Ultrix Crosspoint

    Posted 08-08-2024 16:01

    Wow @Richard Crutwell, you went above and beyond here. I always feel desperate for more resources like this of docs and examples for ogscripting, specifically for custom panels. Does Ross offer classes from time to time, or is there a general youtube that's not included in the 'university' vids? They seem to all stop a little short of what I'm seeking. 

    Is the example above you've referenced a custompanel.grid  file that one can download, or is it intended just to be copy/paste code into a task?



    ------------------------------
    D Block
    ------------------------------



  • 4.  RE: Dashboard Custom Panel - Display Current Source on Ultrix Crosspoint

    Posted 08-08-2024 18:27

    You're right there aren't many resources linking the Ross U to further complex scenarios or specific to devices. I'll look into that.

    If you create a new panel file in Dashboard and copy all the code in from the window, open edit mode and paste all the content (overwriting all), it will show you a panel. You will have to change the ultrix to your own unit. To do this, in edit mode, double-click to open, find the context device between <context></context> on the tree near the top. Once there change the device to your Ultrix and apply and close these changes.

    Try and use the panel, if you get stuck open the debug window, View --> openGear Debug Window and any errors will print a lot of detail in here.



    ------------------------------
    Richard Crutwell
    Ross Video UK
    ------------------------------