Facility Control

 View Only
  • 1.  Companion - RossTalk GPI by Name to trigger Choice Constraint Int Array

    Posted 03-01-2024 09:31

    Hi there!

    Been a while since I posted a question, but here we go.
    I have a dashboard that is made to interact with a 3rd party PTZ Joystick, that doubles as a shotbox, works great.
    Now I want to add a StreamDeck with Companion running on it, and RossTalk that speaks to not only my Graphite mixer and Xpression, but also to this dashboard.
    No, there's no module in companion to speak to the ontroller yet (will request or possibly make).

    Anyways, I know that buttons etc can be set with a triggerID on them to trigger the button through the RossTalk GPI by Name function in companion, wich again, works great. However, when I try to press a button that is created by a Choice Constraint Integer Array og buttons, setting just a triggerID would not be enough. I would also have to add wich one of the 50 buttons to press.

    Now in the compantion interface, you have two fields to input, one is the name, wich would be the same as the triggerID set on a regular button (works just fine btw), but there's also a "parameter" input field. I was hoping putting a 3 in this would trigger button number 4 (starting from 0), but it did not.

    Does anyone have any idea how I can send RossTalk GPI by Name to trigger a button in an array of buttons made by a parameter?
    I'm sure the sollution is staring me right in the face, but I just cant find it.



    ------------------------------
    Aleksander Stalsberg
    Inland Norway University of Applied Sciences/Lillehammer Icehockey Club
    Norway
    ------------------------------


  • 2.  RE: Companion - RossTalk GPI by Name to trigger Choice Constraint Int Array

    Ross Staff
    Posted 03-01-2024 10:44

    Hi Aleksander

    Your fastest path here would be to use a small piece of script registered against the trigger ID instead of using the toggle buttons directly:

    <abs contexttype="opengear" id="_top" keepalive="false" style="">
       <meta>
          <params>
             <param access="1" constrainttype="INT_CHOICE" name="My Choices" oid="My_Choices" precision="0" type="INT32" value="1" widget="radio-toggle">
                <constraint key="1">One</constraint>
                <constraint key="2">Two</constraint>
                <constraint key="3">Three</constraint>
             </param>
          </params>
          <ogscript handles="onload">ogscript.addRemoteTrigger('choice', function(event)
    {
       if (event.getState() == null) {
          return;
       }
       var state = parseInt(event.getState());
       params.setValue('My_Choices', 0, state);
    });
    </ogscript>
       </meta>
       <param expand="true" height="104" left="58" oid="My_Choices" style="style:toggleButton;" top="64" width="520">
          <task tasktype="ogscript">ogscript.debug('Choice Changed: ' + this.getValue());</task>
       </param>
       <button buttontype="push" height="122" left="126" name="Fire GPI choices:1" top="384" width="285">
          <task tasktype="ogscript">ogscript.fireGPI("choice", 1, true);</task>
       </button>
       <button buttontype="push" height="122" left="433" name="Fire GPI choices:2" top="385" width="285">
          <task tasktype="ogscript">ogscript.fireGPI("choice", 2, true);</task>
       </button>
    </abs>
    

    The relevant part here is the ogscript running onload to add the remote trigger registered against the trigger ID of "choices":

    ogscript.addRemoteTrigger('choice', function(event)
    {
       if (event.getState() == null) {
          return;
       }
       var state = parseInt(event.getState());
       params.setValue('My_Choices', 0, state);
    });
    


    ------------------------------
    James Peltzer
    Ross Video
    ------------------------------



  • 3.  RE: Companion - RossTalk GPI by Name to trigger Choice Constraint Int Array

    Posted 03-02-2024 18:36

    Ahhh, thank you again @James Peltzer for another quick and great sollution.
    This solves it triggering one of the choice constraints I have. As the one in your example has an OID of "choice".
    How would I best access that part of the Rosstalk message in the function?

    event.getState() gives access to the number I add to the message, but how do I access the name of what parameter I am trying to trigger?

    I can of course just use "event" string and get the source=choice (from your example), but I figured since you can access the State as well, I assume we can also access the first part in an elegant way. The help documentation about how to trigger things externally only covers the getState() function.

    EDIT - After some more testing and trial...

    Well, ask a question, and you often find the answer to your question right after it. In this case it was as simple as accessing the event object and using the source name. Meaning event.source gives access to what I was looking for.

    However, looking over your examples yet again, It becomes clear after some trial and error that the trigger here is actually defined in the ogscript.addRemoteTrigger, meaning if you want to trigger two different panels, you can just copy/paste the first addRemoteTrigger, add a new one, with a new trigger that targets the second parameter.

    Soooo that works even better. Thanks again!



    ------------------------------
    Aleksander Stalsberg
    Inland Norway University of Applied Sciences/Lillehammer Icehockey Club
    Norway
    ------------------------------