Facility Control

 View Only
  • 1.  Panel "listening" to another panel

    Posted 02-08-2018 18:31
    I have a custom panel that does a lot of production control, whether firing custom controls to my Carbonites, turning on projectors, triggering a video server, etc. I have this panel set up to publish the HTTP server on a specific port, which allows me to run the various trigger IDs from lots of devices. (I've written about this before, using the Elgato Stream Deck as a hardware panel. We have multiple decks in multiple locations which can all trigger the same panel.)

    I now have another custom panel that I would like to set up to listen and reflect what the production control panel is doing, and then perform actions based on that. So, if a button is clicked and a task is performed on a custom panel, I want the "remote" panel to be aware of it and possibly do something else.

    I know I could have the production control panel send GPI trigger commands to the remote panel which could be listening (a la Xpression), but the catch is that I'd like this panel to be open on multiple computers, and I don't always know which ones, which makes it difficult to program for.

    Is this possible? Is this a good approach? Has anyone done anything like this? Thanks!


  • 2.  RE: Panel "listening" to another panel

    Posted 02-09-2018 04:41
    Maybe when each instance of the remote panel loads, it could trigger a GPI on the master panel and send along (via the trigger state component) the necessary information to re-contact each remote panel, and store that in a param. Then each time a function is run on the master panel, it can do a call out to each remote panel that has been added to the param. I could pass other trigger IDs via the state component if I really wanted to get precise on which ones should trigger callbacks to the remote panels.

    Referencing this: https://discussions.rossvideo.com/forum/default-forum-gc1/dashboard-gc43/14557-dashboard-webcontrol
    #DashBoard


  • 3.  RE: Panel "listening" to another panel

    Posted 02-09-2018 17:00
    Hi Joseph.
    That makes a fair bit of sense. You could also probably get away with using a listener server on your 'master' panel and listener clients in your remote panels to collect an array of connections and send them messages whenever a button is pressed.

    J
    #DashBoard


  • 4.  RE: Panel "listening" to another panel

    Posted 02-09-2018 17:01
    Is there a way to get the IP address of the computer running the panel? I think I would need to send that in order to route a connection back.
    #DashBoard


  • 5.  RE: Panel "listening" to another panel

    Posted 02-09-2018 17:12
    I like this. I'll give it a run and post the results. Thanks!
    #DashBoard


  • 6.  RE: Panel "listening" to another panel

    Posted 02-10-2018 00:11
    @jamespeltzer , everything is working great.

    I set up a listener as server on a port, and then listeners on the remote panel clients to connect to the same port. I am sending messages back and forth between them and that's working fine.

    I want to have a label on the master/server panel that shows the currently connected panels. Is there a documented list somewhere of the properties of the objects I am storing in the array?


    #DashBoard


  • 7.  RE: Panel "listening" to another panel

    Posted 02-12-2018 21:27
    We used this new panel set this weekend and it worked great! Only issue we had is that occasionally the remote panels would lose their connection to the master panel (i.e. the messages would not get sent back). What's the best way around this? My initial thought was a timer that stops/starts the listeners every 5 minutes or so.
    #DashBoard


  • 8.  RE: Panel "listening" to another panel

    Posted 01-20-2019 14:02
    @jamespeltzer, revisiting this. I want to perform certain actions based on whether an incoming request is from a certain IP stored in a local key. What is the best way to get the IP of the listener clients? I'm storing them in a connection array as you suggested earlier.
    #DashBoard


  • 9.  RE: Panel "listening" to another panel

    Posted 01-21-2019 14:57

    The listener's "this" object does not expose the IP/Port but the Event object does.
    For any event (connect, message, disconnect), you can use event.getRemoteHost() and event.getRemotePort() to find this information.

    if (connectionArray == null)
      {
      connectionArray = [];
      ogscript.putObject('connection-array', connectionArray);
      }
       
      if (event.isConnectEvent())
      {
      var eventIP = event.getRemoteHost();
      var eventPort = event.getRemotePort();
      ogscript.debug("Connected to: " + eventIP + ":" + eventPort);
      connectionArray.push(this);
      }
      else if (event.isDisconnectEvent())
      {
      for (var i = 0; i < connectionArray.length; i++)
      {
      if (connectionArray[i] == this)
      {
      connectionArray.splice(i,1);
      break;
      }
      }
      }

    #DashBoard


  • 10.  RE: Panel "listening" to another panel

    Posted 01-22-2019 18:32
    Perfect. Just what I needed. Thanks, @jamespeltzer!
    #DashBoard