Facility Control

 View Only
Expand all | Collapse all

Send XPression Titles Top-most Layer

  • 1.  Send XPression Titles Top-most Layer

    Posted 05-02-2016 19:25

    Trying to make a Custom Panel that will send GFX to the top-most layer. When the script runs, it doesn't seem to honor the "send to Top" code. Any ideas?

    Code below - In the example, GFX is ID 4001. I want to click the button (ASPP $100) and send this graphic to screen, in the top layer. I have not specified a layer ID in the RossTalk command, since it is unknown at the time it needs to go to screen. Currently, GFX goes to screen in the layer specified in the sequencer.

    <button buttontype="push" id="5001" name="ASPP $100">
    <task tasktype="ogscript">ogscript.toTop('[4001]');</task>
    <task tasktype="rosstalk">rosstalk.sendMessage('155.241. 240.198', 7788, 'TAKE 4001:Framebuffer 1');</task>
    </button>


  • 2.  RE: Send XPression Titles Top-most Layer

    Posted 05-02-2016 20:54
    Hi Shane.
    You would need to specify the layer manually and include it in your RossTalk command.
    There is no way to query for the "top layer" in XPression as the communication only flows one way (from DashBoard to XPression).

    One suggestion would be to track the "top layer" yourself in a parameter or other object - create an int parameter called "TOP_LAYER" and set it to whatever your current top layer is.
    You can then add it to your command with:

    Example: rosstalk.sendMessage('155.241. 240.198', 7788, 'TAKE 4001:0:' + params.getValue('TOP_LAYER', 0));




    #DashBoard


  • 3.  RE: Send XPression Titles Top-most Layer

    Posted 05-02-2016 21:05
    Is there a way for me to check the current live "layer stack" in XPression, to find out what layer is the top-most? I have several graphics that need to go to screen in an unknown, random order, and I always need these to go to the highest layer.
    #DashBoard


  • 4.  RE: Send XPression Titles Top-most Layer

    Posted 05-02-2016 21:28
    Sorry, just realized you already answered that part. Thanks for the reply...still thinking here.
    #DashBoard


  • 5.  RE: Send XPression Titles Top-most Layer

    Posted 05-03-2016 12:59
    There [I]might[/I] be something you can do in XPression's scripting to bring certain take item's to the top layer when they're brought on-air. You might try asking about doing it that way in the XPression discussion groups (the XPression experts don't monitor the threads on the DashBoard side).
    #DashBoard


  • 6.  RE: Send XPression Titles Top-most Layer

    Posted 05-03-2016 13:52

    Thanks. I am a little confused about this command:

    ogscript.toTop('[4001]');

    I was understanding this command to send the item to the top layer. Am I misunderstanding the use of this command/function? Documentation mentioned it would send the layer to the top of other items in the same container. Is there some logical container I need to define for my items?

    And another question on scope of variables/parameters. Are parameters global in scope? Assuming a var in a button script will only be local to that button?
    How do I define a parameter? How do I access layer number and set it to a parameter/variable?


    #DashBoard


  • 7.  RE: Send XPression Titles Top-most Layer

    Posted 05-03-2016 13:59
    In the case of toTop, it works within an container tag.
    An is a canvas in which everything is positioned in absolute coordinates. The toTop, and toBottom change the Z-Order of the components inside of the .

    Parameters are scoped to be visible to everything beneath them in the tag hierarchy. So, if I define a parameter at the top (or outer-most tag) of my panel, it will be visible to all sibling and nested tags.

    ogScript variables are slightly different. Variables (var abc...) defined in tags follow the same visibility rules as parameters. Variables defined in or tags are only visible within those tags. If you have data you want to pass outside of those tags, you can use ogscript.putObject('name', object); and ogscript.getObject('name'); to use them elsewhere in your panel.

    #DashBoard


  • 8.  RE: Send XPression Titles Top-most Layer

    Posted 05-03-2016 15:22
    ok. Checking documentation as well, but is my thinking sound:

    1) Declare a parameter or ogScript api variable, at the panel level, to hold my layerNum in XPression output
    (guessing I need to nest my needed buttons inside some container? Not sure how to do this)
    2) Set up my buttons in the panel to trigger my XPression Comps.
    3) Set up code/logic, on each button, to send the selected XP Comp to screen, using my layerNum variable + 1, to send GFX to highest, top-most layer

    Thank you for your help.

    #DashBoard


  • 9.  RE: Send XPression Titles Top-most Layer

    Posted 05-03-2016 15:24

    Looks right to me.
    Everything in a CustomPanel is already inside of a container (usually an <abs/> tag).

    Other containers include <table/>, <simplegrid/>, <tab/>, <split>, and <flow/>


    #DashBoard


  • 10.  RE: Send XPression Titles Top-most Layer

    Posted 05-03-2016 15:34
    So, thinking in terms of JavaScipt, I would just declare a variable at the top of the code"
    var layerNum = 1;

    And then that variable is present when I need it:
    send graphic to layerNum+1;

    And that would take care of it. So, in this case, what is the "best practice" method to declare a variable/value for use in multiple buttons in a custom panel? Would this be a Parameter? Or something else?
    #DashBoard


  • 11.  RE: Send XPression Titles Top-most Layer

    Posted 05-03-2016 15:54

    I set up a blank panel, added one button, and at the panel level, here is the code:

    <abs contexttype="opengear" style="">
    <button buttontype="push" height="95" id="1000" left="104" name="myButton" top="65" width="135"/>
    </abs>

    If i just want to declare my layerNum variable, and have it be globally scoped to any button I make on the panel, how would I go about this? I assume I cannot just add a line like this:

    var layerNum = 1;

    to the code shown in the "Edit Component" tab? Do I need to make some sort of tag to put my variable into?

    <someTagName>var layerNum = 1;</someTagName>

    #DashBoard


  • 12.  RE: Send XPression Titles Top-most Layer

    Posted 05-03-2016 16:57
    Shane, try putting your variable declaration inside an tag, it should then be visible everywhere.
    #DashBoard


  • 13.  RE: Send XPression Titles Top-most Layer

    Posted 05-03-2016 17:51

    Thanks Martin. I tried that, but must be missing something. When I try to actually use the variable, my system seems to ignore it. I'm guessing I have something wrong in syntax, or general workflow. I've created the variable in tag at the top panel level. Then, on a button on the panel, i've added a RossTalk TAKE command (for an XPression GFX), and instead of manually entering a number for Layer ID, I've tried to use my declared variable (layerNum). Ive tried layerNum as it is, in [ ] brackets, ( ), " ", ' ', [' '], etc., but the system always ignores my variable. still not sure what I've got wrong. Any ideas? Here is my current button code (also, not getting results from my debug trace attempt) :

    <button bottom="762" buttontype="push" id="5001" left="0" name="ASPP $100" right="1148" top="0">
    <ogscript>ogscript.debug ('My current layer number is: '+layerNum);</ogscript>
    <task tasktype="rosstalk">rosstalk.sendMessage('155.241. 240.198', 7788, 'TAKE 4001:Framebuffer 1:layerNum');</task>
    </button>

    #DashBoard


  • 14.  RE: Send XPression Titles Top-most Layer

    Posted 05-03-2016 18:32
    Ok, my problem seems to be simply using the variable in a RossTalk command. I apparently do not know the correct syntax to do this. Managed to get a debug printout in the callback function area of a button, so I can actually see the value of my variable being traced out in debug. Just can't seem to be able to use that value in my commands.
    #DashBoard


  • 15.  RE: Send XPression Titles Top-most Layer

    Posted 05-04-2016 13:46

    I'm not entirely familiar with the sendMessage instructions but I think you need to add your variable onto the end of the string you're sending. Try this:

    rosstalk.sendMessage('155.241. 240.198', 7788, 'TAKE 4001:Framebuffer 1:' + layerNum);

    #DashBoard


  • 16.  RE: Send XPression Titles Top-most Layer

    Posted 05-04-2016 15:13

    Shane,

    I've had a play with the rosstalk.sendmessage command. I can see that this is difficult if you use the Dashboard tool that builds rosstalk commands for you. If you dive in and edit the source on the button to this it should work:

    <button bottom="762" buttontype="push" id="5001" left="0" name="ASPP $100" right="1148" top="0">
    <task tasktype="ogscript">ogscript.debug ('My current layer number is: ' + layerNum);
    rosstalk.sendMessage('155.241. 240.198', 7788, 'TAKE 4001:Framebuffer 1:' + layerNum);</task>
    </button>

    Instead of editing the source you get the same result by adding the script as an ogscript task in the task editing pane for the button.


    #DashBoard


  • 17.  RE: Send XPression Titles Top-most Layer

    Posted 05-04-2016 16:44
    Thanks, Martin and Brian Ford! Looks like syntax was the issue, and your suggestion seems to have solved my problem. Thank you!
    #DashBoard