Facility Control

 View Only
  • 1.  Dashboard into XPression: 2 parameters into 1 parameter or textfield

    Posted 08-06-2015 01:30
    I have 2 paramters in Dashboard ("Downs" and "Yards") that need to feed into 1 textfield in XPression. Is there a way to concatenate the params into 1 param in dashboard or do I need to do that in XPression?


  • 2.  RE: Dashboard into XPression: 2 parameters into 1 parameter or textfield

    Posted 08-06-2015 13:53

    Hi Josh,

    This is easily accomplished in DashBoard.

    You will want to make a 3rd parameter, let's call it 'distance' for the sake of argument.

    This 3rd parameter will be the one you DataLinq to XPression.

    You need to put a task on each of the 2 other parameters. When you put a task on a parameter, it is run whenever that parameters value changes.

    On each of those tasks you will want to update the 3rd parameter.

    The task will be pretty small and look something like:

    //Get the values of the 2 parameters and put them into local variables

    var downs;

    var yards;

    var distance;

    downs = params.getValue('params.downs',0);

    yards = params.getValue('params.yards',0);

    distance = downs + ' ' + yards; // the extra quote in the middle is to add a space between your two pieces of text

    // set the 3rd parameter now

    params.setValue('params.distance',0,distance);

    Of course, your variable names, parameter names, exact formatting of how you want your 3rd parameter to include information from your yards and downs parameters will be slightly different.

    // you might have wanted something like

    distance = downs + ' Down: ' + yards + 'Yards';

    Which would output text that looked like "3rd Down: 7 Yards" assuming that your downs variable included text options for '1st', '2nd','3rd' etc.. (notice the difference between putting quotes around text to be used exactly and using a variable name).


    #DashBoard


  • 3.  RE: Dashboard into XPression: 2 parameters into 1 parameter or textfield

    Posted 08-06-2015 17:12

    I have labels linked to the yards and downs params. Would those update distance? If so i'm using OGscript so what would that look like?

    var dwns = params.getValue('Downs', 0);
    var yrds = params.getValue('Yards', 0);
    params.setValue('Distance', 0, 'dwns+yrds');

    #DashBoard


  • 4.  RE: Dashboard into XPression: 2 parameters into 1 parameter or textfield

    Posted 08-06-2015 17:21

    I got it:

    var dwns = params.getValue('Downs', 0);
    var yrds = params.getValue('Yards', 0);
    params.setValue('Distance', 0, dwns+yrds);

     


    #DashBoard


  • 5.  RE: Dashboard into XPression: 2 parameters into 1 parameter or textfield

    Posted 08-06-2015 17:22
    Hey Josh,

    To add a Task to the parameter, you must open up the Edit Component window by double clicking on the CustomPanel canvas(when in Edit Mode). Then select the desired Parameter from the component tree and there will be an option to add a task to the parameter.

    Sadman

    #DashBoard