Facility Control

 View Only
  • 1.  Joystick selector

    Posted 05-06-2020 14:36

    Since I'm limited on the buttons available on a joystick I'm trying to set the value of the selector for camera selection. I found the parameter (I think), but can't get it to set a value.

    params.getParam("Selector UI Mappings.1", 'selector.selection', 0).getValue(); - Where I believe the selection number is stored

    I tried:

    params.getParam("Selector UI Mappings.1", 'selector.selection', 0).setValue(2);

    But no luck there, any idea?



  • 2.  RE: Joystick selector

    Posted 05-06-2020 17:01

    Hi Mark

    Do you have a <context/> tag with the ID of "Selector UI Mappings.1"?

    Also, is the selector service in Selector UI Mappings chosen as the "selector" in "Device Class Mappings"? I suspect you might be changing the value the wrong selector parameter.

    James


    #DashBoard


  • 3.  RE: Joystick selector

    Posted 05-07-2020 07:01

    Hey James,

    Here is the context tag:

     <context contexttype="opengear" id="Selector UI Mappings.1" objectid="selector-service-frame&lt;br&gt;Slot 0&lt;br&gt;Selector UI Mappings" objecttype="Selector UI Mappings"/>

    I have it set on the joystick for the selector and the db.uiselector set to Selector UI Mappings on Dashboard Selector Service.


    #DashBoard


  • 4.  RE: Joystick selector

    Posted 05-08-2020 11:15

    Just realized I posted the wrong parameter on the first one sorry. I meant to post the joystick parameter:

    params.getParam("DB-Joystick.1", 'selector.selection', 0).getValue(); - retrieves the number of the device being controlled

    Tried:

    params.getParam("DB-Joystick.1", 'selector.selection', 0).setValue(1);

     

    Context tag:

    <context contexttype="opengear" id="DB-Joystick.1" objectid="com.rossvideo.joystick.Unknown:0:CH OEM 3 AXIS 6 BUTTON JOYSTICK" objecttype="DB-Joystick"/>


    #DashBoard


  • 5.  RE: Joystick selector

    Posted 05-11-2020 19:00

    Hi Mark

    Your posted context should give you the ability to write to the joystick's selection parameter (provided it has a mapping to your selector.selection OID set to at least one of your physical buttons).  Have you been able to make any progress with your original problem?

    Cheers

    James


    #DashBoard


  • 6.  RE: Joystick selector

    Posted 05-12-2020 13:11

    Hey James,

    I can get the individual button value to change, but I was hoping to get change the actual selected value without making the user hit a button again. 

    When I looked into the hidden parameters I see that the access is locked for it, Is there anyway to unlock, change the value then lock again?

    <param access="0" constrainttype="INT_NULL" name="Mapped: selector.selection" oid="selector.selection" precision="0" type="INT32" value="2" widget="default"/>


    #DashBoard


  • 7.  RE: Joystick selector

    Posted 05-12-2020 15:33

    Hi Mark

    You can give this a try - the joystick parameters are typically read-only but for your use case setting access like this can make sense.

    Once you have the parameter object in ogScript (params.getParam('CONTEXT', OID, index)), you can call param.setAccess(1), set your value, and call setAccess(0) to return it to read-only.

    James


    #DashBoard


  • 8.  RE: Joystick selector

    Posted 05-12-2020 17:44

    Thanks James!

    That seems to have done it, Not back at work till Monday, but I was able to at least test out the output on Dashboard at home.

     

    Got free time to test it today. Worked like a charm, thanks again James!


    #DashBoard