Facility Control

 View Only
  • 1.  Multiple Dashboards

    Posted 04-18-2017 04:45
    Hi Gents

    How could I get multiple dashboards speaking to each other?

    For instance, I want the data on my Dashboard to replicate to dashboard running on another PC but it is on the network.

    Cheers
    Dennis


  • 2.  RE: Multiple Dashboards

    Posted 04-19-2017 19:50

    Hi Dennis.
    There are a few ways to do this... The most correct way depends on exactly what you're trying to do with the data. If you have 2 operator stations/panels trying to work off of the same data, then your best bet is to have one DashBoard/panel be the data provider and the other DashBoard/panel be the data consumer.

    You can share all of the parameters in a Custom Panel as a virtual device, add this virtual device to the other DashBoard instance, create a second Custom Panel, and point the second panel to the virtual device as its data source.

    Data Provider:

    <abs contexttype="opengear" jsonport="5555">
       <meta>
          <params>
             <param access="1" maxlength="0" name="Parameter One" oid="Parameter_One" type="STRING" value="First Value" widget="text"/>
             <param access="1" maxlength="0" name="Parameter Two" oid="Parameter_Two" type="STRING" value="Second Value" widget="text"/>
             <param access="1" maxlength="0" name="Device Name" oid="0x105" type="STRING" value="My Data Source" widget="default"/>
          </params>
       </meta>
       <param expand="true" height="60" left="20" oid="Parameter_One" top="20" width="360"/>
       <param expand="true" height="60" left="20" oid="Parameter_Two" top="100" width="360"/>
    </abs>

    Data Consumer (assuming I have selected port 5555 for the virual device and have it on "localhost"):

    <abs contexttype="opengear" objectid="localhost:5555&lt;br&gt;Slot 0&lt;br&gt;My Data Source" objecttype="My Data Source">
       <param expand="true" height="60" left="20" oid="Parameter_One" top="20" width="360"/>
       <param expand="true" height="60" left="20" oid="Parameter_Two" top="100" width="360"/>
    </abs>

    The virtual device is created by editing the source and supplying the "jsonport" attribute (set to 5555 in my example)




    These are the steps for adding the virtual device to the consumer DashBoard:



    Create/open the consumer custom panel


    #DashBoard


  • 3.  RE: Multiple Dashboards

    Posted 04-19-2017 20:13
    Hi James

    You've been a great help, I will test this out tomorrow and give you feedback (the 6 hour time gap is tricky)

    Thanks a million
    Dennis
    #DashBoard


  • 4.  RE: Multiple Dashboards

    Posted 04-24-2017 17:11
    Hi James

    "‹I managed to get this working and its been pretty good apart from a few issues which I'm hoping youd have some advice on.

    "‹1.) My receiving Custom panel does not always receive my info straight away and as soon as I press Ctrl+G, it resets data on the receiver side.

    "‹2.) Is there a way I could create a dropdown menu to select file paths for my team logos? I am using a file path and having to enter the source everytime to change this (We have 4 matches back to back which makes this hard)

    "‹3.) I want to use some data on Xpression from the laptop providing info (things like stats, score, time etc) and from the graphics captioning machine (Data receiver, I want to use commentary straps etc on Xpression. My problem is that when I add the Json port, I can only see the datalinq from the localhost. When I browse the data donor, it is blank.

    "‹Cheers
    Dennis
    #DashBoard


  • 5.  RE: Multiple Dashboards

    Posted 05-09-2017 22:00

    Hi Dennis.
    Sorry for the delay. Here's what I have:

    1. Rebuilding the panel will trigger a reset of any data being shared via the OGP-JSON virtual device. It *should* be sending the data as soon as it changes though.

    2. Here is some sample code I wrote a while back that reads a directory and updates a parameter's choice constraint to list the files:

    function replaceAll(str, search, replace)
    {
       return str.split(search).join(replace);
    }
    
    //Take a file path like "c:\" and turn it into a URL like file:/c:/
    function makeUrl(dirPath)
    {
       dirPath = replaceAll(dirPath, '\\', '/');
       dirPath = replaceAll(dirPath, ' ', '%20');
       if (dirPath.charAt(dirPath.length - 1) != '/')   
       {
          dirPath = dirPath + '/';
       }
       
       if (dirPath.indexOf('file:/') != 0)   
       {
          dirPath = 'file:/' + dirPath;
       }
       return dirPath;
    }
    
    function loadDirectory(dirPath)
    {
       dirPath = makeUrl(dirPath);
    
       ////////////////////////////////////////////
       //THIS IS REALLY THE ONLY IMPORTANT THING!//
       var dirList = ogscript.post(dirPath, null).trim().split('\n');
       ////////////////////////////////////////////
    
       if (Array.isArray(dirList))
       {
          var listedFiles = new Array();
          listedFiles[0] = '..';
          
          //Loop through and look for (possible) directories
          for (var i = 0; i < dirList.length; i++)
          {
             if (dirList[i].indexOf('.') < 0)
             {
                listedFiles[listedFiles.length] = dirList[i] + '<bg-u:folder_128.png>';
             }
          }
    
          //Loop through again and look for (possible) images
          for (var i = 0; i < dirList.length; i++)
          {
             var lowerCase = dirList[i].toLowerCase();
             if (lowerCase.indexOf('.png') > 0)
             {
                listedFiles[listedFiles.length] = dirList[i] + '<bg-u:png_128.png>';
             }
             else if (lowerCase.indexOf('.jpg') > 0)
             {
                listedFiles[listedFiles.length] = dirList[i] + '<bg-u:jpg_128.png>';
             }
             else if (lowerCase.indexOf('.gif') > 0)
             {
                listedFiles[listedFiles.length] = dirList[i] + '<bg-u:gif_128.png>';
             }
          }
    
          var newChoices = params.createIntChoiceConstraint(listedFiles);
          params.replaceConstraint('File_List', newChoices);
          params.setValue('File_List', 0, -1);
          params.setValue('Current_Directory', 0, dirPath);
       }
    }

    3. You would have to specify 2 XML streaming ports for DataLinq and add them as 2 connections.


    #DashBoard


  • 6.  RE: Multiple Dashboards

    Posted 10-27-2023 11:29

    This is very helpful! My question is there a way to have a consumer panel have it pull / populate the OID information? It works fine once I start populating / changing OIDs when the panels are active but doesn't on launch pull in that information. 



    ------------------------------
    Mark Macklin
    ------------------------------