Facility Control

 View Only
  • 1.  PanelBuilder Slider Link

    Posted 04-26-2015 19:54
    I want to create a single slider in PanelBuilder that controls 2 separate sliders in an OG card. I'm using Ross UDC-8625 cards. I need to link stereo audio controls to move together. I know how to drag and drop the sliders from the config pages into PanelBuilder and how to create a new slider. I don't know how to link a custom created slider to a specific parameter on a config page. Can anyone help me with this?


  • 2.  RE: PanelBuilder Slider Link

    Posted 04-27-2015 11:01

    Hi Matthew,

    It would look something like the following. The idea is to attach a "listener" to your slider, using the "onchange" handler. This will be called each time the slider value changes. The ogscript function then updates the values of the original audio parameters.

    For stereo, you presumably want Group 1, Ch1 and Ch2, so two calls to param.setValue() are needed. Note that the UDC-8625 audio parameters are arrays with 4 elements each.

    // Assuming that 0x1234 is the OID of your new slider.
    // OID 0x550A is Embedded Audio Ch 1,
    // OID 0x550B is Embedded Audio Ch 2.

    #DashBoard


  • 3.  RE: PanelBuilder Slider Link

    Posted 04-27-2015 14:18

    Hi Matthew.

    The above code isn't quite likely to work (there are too many parameters for params.setValue)

    params.setValue accepts OID, index, value as its 3 arguments.

    The example also assumes that you've created a new slider parameter to drive the changes. If you want to make all of the sliders stay in sync, another option is to attach a change script to each of them and force them to be the same.

    For example, this script works on the first group of channels 1-4 on a UDC:

    `
    var newValue = this.getValue();

    if (params.getValue(0x550A, 0) != newValue)

    {

    params.setValue(0x550A, 0, newValue);

    }

    if (params.getValue(0x550B, 0) != newValue)

    {

    params.setValue(0x550B, 0, newValue);

    }

    if (params.getValue(0x550C, 0) != newValue)

    {

    params.setValue(0x550C, 0, newValue);

    }

    if (params.getValue(0x550D, 0) != newValue)

    {

    params.setValue(0x550D, 0, newValue);

    }

    `

    One thing you'll notice with the above is that things can bounce around a little bit as the changes come in. A way around this is to give time for the parameter changes to complete before trying to get everything in sync. Here is another version of the script that will sync things up 200 milliseconds after the change happens.

    ` var changedParam = this;

    function syncValues()

    {

    var newValue = changedParam.getValue();

    if (params.getValue(0x550A, 0) != newValue)

    {

    params.setValue(0x550A, 0, newValue);

    }

    if (params.getValue(0x550B, 0) != newValue)

    {

    params.setValue(0x550B, 0, newValue);

    }

    if (params.getValue(0x550C, 0) != newValue)

    {

    params.setValue(0x550C, 0, newValue);

    }

    if (params.getValue(0x550D, 0) != newValue)

    {

    params.setValue(0x550D, 0, newValue);

    }

    }

    ogscript.asyncExec(syncValues, 200);`

    Of course, all of these assume that you've got all of your parameters coming from the same device and that you've set your panel to talk to that specific device. If you need to keep parameters from different devices in sync, this is possible too but the code looks slightly different.

    Hope this helps.

    James


    #DashBoard


  • 4.  RE: PanelBuilder Slider Link

    Posted 04-28-2015 17:35
    Where do I put this code? In the OGScript window for the whole panel, or source window of the slider component? Also, I'm building sliders for multiple cards. How do I differentiate which card I'm talking to? The OID is the same for sliders on identical cards. I can drag and drop the sliders I want to control into the custom panel and just hide them behind things. I'm new at PanelBuilder, so I'm not sure where all this code goes. Thanks for walking me through it.

    #DashBoard


  • 5.  RE: PanelBuilder Slider Link

    Posted 04-29-2015 20:59

    Time to find out how you built your panel in the first place: If you look at the source code, does it contain a `

    ` tag around each `

    `?
    If so, and if all of the parameters are from the same device, the top-level tag of the panel should be pointed to device instead and the table tags can be removed.

    There are lots of different approaches one could take to handling multiple devices. I'll try to put together a sensible example tomorrow and get back to you.

    #DashBoard


  • 6.  RE: PanelBuilder Slider Link

    Posted 04-29-2015 21:01

    Oh, and if the entire panel is pointed at the single device, the code I sent would be placed inside of a `` tag in the top-level.

    `
    var changedParam = this;

    function syncValues()

    {

    var newValue = changedParam.getValue();

    if (params.getValue(0x550A, 0) != newValue)

    {

    params.setValue(0x550A, 0, newValue);

    }

    if (params.getValue(0x550B, 0) != newValue)

    {

    params.setValue(0x550B, 0, newValue);

    }

    if (params.getValue(0x550C, 0) != newValue)

    {

    params.setValue(0x550C, 0, newValue);

    }

    if (params.getValue(0x550D, 0) != newValue)

    {

    params.setValue(0x550D, 0, newValue);

    }

    }

    ogscript.asyncExec(syncValues, 200);

    `

    #DashBoard