Facility Control

 View Only
Expand all | Collapse all

Easing Into DashBoard

  • 1.  Easing Into DashBoard

    Posted 07-16-2019 15:35

    Hi

     

    I have decided to approach the learning/utilization of DASHBoard by starting small and simple.

     

    I envision the simplest task is putting a graphic on air.  Chris did this with these commands, which would put the scene with Sequencer # 82 on air:

     

    var takeid = ' SEQI 82';

    if (this.getValue() == '0'){
    //rosstalk.sendMessage(ogscript.getPrivateString('hosts', 'Dashboard.host'), parseInt(ogscript.getPrivateString('hosts', 'Dashboard.port')), takeidout);
    rosstalk.sendMessage(ogscript.getPrivateString('hosts', 'Dashboard.host'), parseInt(ogscript.getPrivateString('hosts', 'Dashboard.port')), 'RESUME 0:0 ');
    }
    if (this.getValue() == '1'){
    params.setValue('Button.Scorebug.ON.OFF', 0, 0);
    rosstalk.sendMessage(ogscript.getPrivateString('hosts', 'Dashboard.host'), parseInt(ogscript.getPrivateString('hosts', 'Dashboard.port')), takeid);
    }

    It was suggested elsewehere to replace the RESUME command with SEQO 82

     

    Is this the correct appraoch ?

     

    If so I can proceed to implement the toggle buttons to put the scenes on air and take them off.

     

    Thanks

     

    Whit



  • 2.  RE: Easing Into DashBoard

    Posted 07-18-2019 00:07

    Well, appereantly I cant copy/paste code from DashBoard into this forum anymore, so that's pretty much useless...

    I got an answer for you, and got some examples ready, but since I cant really paste the code into here... It's gonna have to wait until that is possible.

    --------------

    Fixed now!


    #DashBoard


  • 3.  RE: Easing Into DashBoard

    Posted 07-18-2019 02:16

    Thanks Aleksander, I will be waiting

     

    Thanks

     

    Whit


    #DashBoard


  • 4.  RE: Easing Into DashBoard

    Posted 07-20-2019 16:49

    Hi again Whit! And nice to see you're gonna ease into DashBoard! 
    You and me are basically trying to make somewhat the same thing so...

    First, I am wondering if you are using the "RossTalk" og the "ogScript" part of the task creator?
    I would highly recommend going for the ogScript part. I've been trying the other part, but I find it a bit too tedious, it works, but not as clever as the ogScript part.

    But let's get back to your idea there.
    What you are trying to do is to create some toggle buttons that lets you toggle graphics on/off.
    From what I can gather, you want one button for each graphic. Ok! Cool, let's do this then!

    What we need:

    3 toggle buttons, each one controlling an individual graphic/sequence in Xpression.
    For this we need 3 parameters so we can read on/off state in DashBoard.
    We need to know the sequence IDs of the different graphics. Let's assume they are 81, 82 and 83 for this example.
    We need to know the IP of the Xpression machine (localhost in this example, running both on the same machine) and the port for RossTalk commands (default 7788).
    Note:

    If you have the DashBoard/Xpression API intergration, this can be done even more gracefully, but I do not yet have access to that. However much i want it... #sadface. So we cannot read if the graphics IS online or not in Xpression and set our buttons state based on that.
    So let's get to it:

    Create three toggle choice parameter buttons. Let's name the paramters gfx1, gfx2 and gfx3.
    We could make a normal "button" and set it to a toggle appereance. However the problem with this is that you will never know what state the button is in. There is no way to get the current state of a regular button. With a parameter choice, it will allways be 1 of 2 options.

    Let's add a task, and add Xpression as a machine in the ogScript part:
    Dboule click on the first button for GFX1, and add a new task.
    In the "Add Task part, stay on ogScript, and click the green button next to Devices & Parameters, then "Add Xpression".
    - If you do NOT have the Xpression/DashBoard API module, then just use RossTalk. If you do have it, then I have no experience with it, but I guess then you use the RossTalkEX part. I will use regular RossTalk.
    - Give the Xpression a name. I will name it Local_XPR.
    - For IP I will enter "localhost" since I'm running them on the same machine.
    - RossTalk port I will leave at 7788.


    This will add "Local_XPR" as a folder under "Devices & Parameters".
    If you open that folder, and the following API folder, you will see all the available commands for Xpression using RossTalk (last two are greyed out, as they require RossTalkEX).

    Now, if you pull in the "sequence in" into the Visual Logic Part, you will be able to enter two values. Takeid and layer. Enter takeid 81 and layer 0. Now you have a button that for every time you press it will take sequence 81 in on layer 0, on the framebuffer that sequence has defined in the Sequencer in Xpression.
    (The "take" command also lets you specify the framebuffer).

    But that does not help with taking a scene on/off, as all this button will do, regardless of it's state is to take sequence in.
    But this is where the fun comes in. If you now go back into the button, and click on the "ogScript" part next to visual, we can see what this little snippet of code does.

    Line 5 is what we're after! (do not edit the text yet).

    rosstalk.sendMessage(params.getValue('Local_XPR_IPAddress', 0), params.getValue('Local_XPR_RossTalkPort', 0), "SEQI " + 81 + ":" + 0);

    So... If we pick apart that code, we can see that it sends a rosstalk message, to the ip sotred in the "Local_XPR_IPAddress" parameters, and to the port stored in the "Local_XPR_RossTalkPort" parameter.
    The message itself is: SEQI 81:0 

    Now, go back to visual logic (providede you didnt change code), and add the "sequence out", you'll get another line (7 I assume) and it will be prety much the same, but the message of the RossTalk command will be SEQO 81.

    So, with that known, let's build a code that gets the value of the button (as in what state it is now in), and what the code should do from there on. Let's also add some variables, so you can easilly change what TakeID that button will affect.
    Remove the all green text/comments, as we dont really need it, but leave the two lines of code with SEQI and SEQO commands.

    First, let's get the current state of the button.

    var x = this.getValue();

    This will store whatever the state of the button ends up with on a press, as the variable x.
    Now let's declare another variable that sets what TakeID will be used. Let us also store what layer it should be taken into.

    var x = this.getValue();

    var takeid = 81;
    var layer = 0;

    Having these stored easilly at the top, will let us copy/paste this code and reuse easily later.
    Now, on to checking the state of the button. Now, a task will execute every time a parameter IS changed, but it will happen AFTER the parameter is changed, so if button is pressed, it will change from value 0 to value 1, and THEN run the code.
    So, with that in mind, let's check what value the parameter is on a change, and act accordingly.

    var x = this.getValue();

    var takeid = 81;
    var layer = 0;

    if (x == 1) {
    // Do something when turned on...
    } else {
    // Do something when not turned on. Can only be off in this case.
    }

    Now, take the code we got earlier from the visual logic examples (and I hope you still have them in the code), and paste them into the correct if and else block. If the value is 1 we want the SEQI line, and if it's not 1, it must be 0, and we want the SEQO line.

    You also want to change the parts there it says 81 into takeid and where it says 0 to layer.
    In the end you'll have this:

    var x = this.getValue();
    var takeid = 81;
    var layer = 0;

    if (x == 1) {
    //Do something when turned on...
    rosstalk.sendMessage(params.getValue('Local_XPR_IPAddress', 0), params.getValue('Local_XPR_RossTalkPort', 0), "SEQI " + takeid + ":" + layer);
    } else {
    // Do something when not turned on. Can only be off in this case.
    rosstalk.sendMessage(params.getValue('Local_XPR_IPAddress', 0), params.getValue('Local_XPR_RossTalkPort', 0), "SEQO " + takeid);
    }

    And that's it... You've replaced the 81 and 0 with the values stored in the variables at the top. And you can reuse this code for all the toggle buttons you want, as long as the values of the parameters that button reads from is 0 and 1, and you just change the variables (line 2 and 3) to reflect what takeid and layer you want it on.


    #DashBoard


  • 5.  RE: Easing Into DashBoard

    Posted 07-20-2019 19:43

    What excellent mentorship. Thank you Aleksander.

     

    Not only did you illustrate what the steps were to accomplsih what I wanted but you also gave the rationale behind the code etc. This is terrific. My next step is to now examine some code and add the lines to change color of the graphic based on it's state.

     

    The critical elements in my "first phase" will be a scorebug, populated via Datalinq from an XML file (from Sportzcast). I envision these components

    • the scorebug itself
    • the SOG (shots on goal)
    • Penalty 1 for Home team (this is the time)
    • Penalty 2 for Home team (this is the time)
    • Penalty 1 for Away team (this is the time)
    • Penalty 2 for Away team (this is the time)

    Thanks again Aleksander, your detailed explanation was exactly what I need.

     

    Whit


    #DashBoard


  • 6.  RE: Easing Into DashBoard

    Posted 07-20-2019 19:47

    OOPS, forgot to ask, do I require a "special" version of XPression to us the XPression Desktop Preview widget ?

     

    Whit


    #DashBoard


  • 7.  RE: Easing Into DashBoard

    Posted 07-20-2019 22:17

    Happy to help!
    DashBoard is way underrated IMO and can do a hell of alot if you just let it.

    About the Xpression Desktop Preview, I'm not sure... I think it requires a lisence I do not have.
    Havent tested it fully to be honest.

    Maybe the almighty James Peltzer can clarify here?

    When it comes to changing the color of materials in Xpression, it is doable. I have a whole set of graphics that changes based on the preset color values for the home and away team. However, the problem here is that the color blocks of Xpressions visual logic is one of the following:

    • Just color, an arbitrarty color block with no input.
    • FloatColor. An arbitrary 0-1 value of each RGBA value.
    • IntColor. A 0-255 RGBA input.

    Now the IntColor is the "easiest" in my opinion, and it works... However, the value you get from a color picker in Xpression is a Hexadecimal with ARGB, but only if you touch the alpha value in the color picker.

    So, you'll have to strip of the #. Then get the last two values in hex, convert that into regular numbers, pad it to be three integers should the result be just one or two. Then get the second pair from last, and third pair from last and do the same.

    Eventually you'll have three values from 0-255, then you can concatenate those three into one string. Send THAT to Xpression, take that value into visual logic, use the "mid string" block, to again separate the RGB values from the resulted string above. Then assign those three values into their respective RGB input of an IntColor block, then use the output of that block to once again go into the material diffuse color (or ambient).

    At that point, you'll have a color picker or value from DashBoard that can control the color of a graphic in Xpression.

    And yes, I do have this working, so I very well know it's possible.
    But this one is tricky...

    (I suggest you leave the alpha value alone. As changing the alpha value of a material in Xpression can have some real wierd result on layers below it).


    #DashBoard


  • 8.  RE: Easing Into DashBoard

    Posted 07-20-2019 23:03

    Thanks Aleksander

     

    As usual I took the easy route.

     

    I now have 9 graphics I can take and cancel. These are the primary graphics I will use. Seven of these will be populated (via DataLinq) by an XML file that comes live from Sportzcast. Should be ( geez I am being brave saying that) easy to accomplsih. So for those 7 it should just be a matter of putting them on screen.

     

    The last two are special. These are the "Play by Play" graphics for goals and penalties. Every time there is an event of this nature in the game (hockey) my API adds another line with the details.

     I was hoping there was a way to "view" the dataLinq in Dashboard. Barring that I wll try to locate a set of commands in Rosstalk that allow you to scroll back and forth (or select a certain row) in DataLinq. That's just in case two events poccur at the same time (stoppage in play) and I would like to see hih one I m dealing with (Penalty or goal).

     

    But I would research this topic.

     

    Here's a screen shot of my panel so far

     

    I was basing it on the API version and hoping I could get the Sequrncer ( or even better datalinq) in there along with the TAKE INSPECTOR , the OUTPUT STATUS and of course the XPN Preview or Virtual output.

     

    But one step at a time. After all your great help, I will now check out the RossTalk commands . Another approach would be to see if Dashboard could import nthe same exteranl API file as XPN does. That way I could at leaset see whaT data I was dealing with.

     

    Thanks again

     

    On to the next phase

     

    Whit

     

    I cant test till XPN arrives hopefully next week. Actually the Sportzcast scorebot hasn't arrived either, but my backup for that, with reduced data is another API file.


    #DashBoard


  • 9.  RE: Easing Into DashBoard

    Posted 07-20-2019 23:13

    You can handle data/XML live into DashBoard as well... Reading an XML is fairly simply, though requires some try and fail.
    But if you got the basic idea of database theory behind you, you could in theory store everything in tables/structs in DashBoard and call up whatever stats you wish.

    What you are trying to do is not too far from what I'm allready doing, though our approach is somewhat different.
    But I'm sure you'll get there as well!

    So far, I have a full on dataset on each team and each player from our league before the game, with all the stats for each team etc

    Then I am also working on a listener that will work on a play-by-play basis and update the stats of each player accordingly to each shot, and then in return reflect that in the graphics.

    It IS doable, but yeah, you got some work ahead of you. :D


    #DashBoard


  • 10.  RE: Easing Into DashBoard

    Posted 07-21-2019 11:01

    Thank you Aleksander for the encouragement.

     

    My plan:

    1. The Sportzcast data to automatically populate the scorebug, I will use the dashboard to put the graphics on the screen.

    2. Have two graphics ( GOAL & PENALTY) be populated by an API (JSON formatted) when a goal or penalty occurs. The API just adds another line (row) of data when one of these two events occurs.

    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

    If & when ,I get these two areas working to my satisfaction then I would like to add

    • another area where I can display a generic Lower third with Name, #, Position and some relevant data (stats or a comment)
    • standings
    • Out of town scores around he league

    But one step at a time. I think I have the scorebug under control. Will try experimenting with seeing the JSON formatted API in Dashboard OR the DataLinq version of it from XPN.

     

    Thanks for everything. Keep me in the loop. When we are finihed I would love to see your work and show you mine, which will pal by comparison. But thanks to you Aleksander, I have made great strides allready.

    Whit


    #DashBoard


  • 11.  RE: Easing Into DashBoard

    Posted 07-22-2019 13:07

    Hello Whit

     

    I use Sportzcast for Volleyball and Basketball and 99% it works flawlessly.  I have encountered loss of signal on quite of number of occasions to the point that I have a backup Manual Scoreboard in place just in case. 

    The data you get from the Scorebot is only as good as the person operating the scoreboard controller.  In both Basketball and Volleyball I can pull data from the Scorebot (once again depends on who's at the controls) for players currently on the courts that include up to date stats and game stats from the teams that are playing. 

    For any league and standings information currently we are doing it manually because the league's Web Designer/Programmer seems to switch everything every other day on the website.  However saying that I am trying to work with them to have more consistency for that information.  

    I definitely like Scorebot/Sportcast and if you have a proper Scoreboard Controller/Operator then you can do wonders.  If we don't we switch to manual and do things without the Pizzazz of the automation from Scorebot.  I love being able to do everything automated, but I am Old School and sometimes less Pizzazz makes for a smoother less stressful show.

     

    Brad


    #DashBoard


  • 12.  RE: Easing Into DashBoard

    Posted 07-22-2019 13:39

    Thanks for the reply Brad.

     

    Our scoreboard is well managed, I believe. So it should function well.

     

    If there is an issue with it and/or Sportzcast, I am building a second ( or 10th) Dashboard gr/XPN combination to get the scorebug data from an API (JSON) formatted. Now this one really depends on our scorekeeper who is managing that manually in the Penalty Box as part of the online game scorekeeping. It will be much simpler (No Pizzaz for sure) basically only the score and the time.

     

    Chris Kapstein buit a very nice Hckey system for manually running everything. But I am inheritnenty lazy and would like to see Sportzcast functioning properly.

    I have one other key API ( its called the Play by Play) API which updates after each event Goal & Penalties. Not sure how I can handle this in Dashboard. It will even be tricky in XPression to co-ordinate the dataLinq updates with the correct graphic in the Sequencer. Will test this setup as soon as XPN arrives.

     

    Thanks again

     

    Whit


    #DashBoard


  • 13.  RE: Easing Into DashBoard

    Posted 08-01-2019 15:38

    Puffing the chest out a little bit! I said I was going to ease into this project, what a learning curve.

     

    Now that I have access to XPression, I can see if any of this actually works

     

    In XPression I have the scorebar working, populated by data from the Sportzcast XML file. Yeah!! I am learning XPression now as I go along.

     

    In Dashboard, I have take & remove buttons working and the layer issues resolved.

     

    Thanks to Aleksander, James and all the others.


    #DashBoard