Facility Control

 View Only
  • 1.  ogscript for Dashboard

    Posted 04-10-2014 01:43
    Hi, I am using panel builder to build an interface for Xpression Control. I find the ogscript reference guide does not show how to get properties from the object in panel such as the number of item in a list object. Some of the usage can be found in the example but it was not in the manual like

    .getStringOf();

    .getChoiceCount;

    Is there anywhere I can get the usage guide of those functions? Thanks.


  • 2.  RE: ogscript for Dashboard

    Posted 04-10-2014 17:47

    Hi Raymond.

    We are constantly working to improve on the ogscript documentation available and have made progress in DashBoard 6.1 with the ogscript reference guide. Unfortunately, parameter constraints (available choices for lists and max/min values for ranges) have not yet been added to our ogscript documentation.

    I can provide you a bit of help here. If there are other questions you have, please ask and I'll see what I can do.

    To get a parameter's constraint:

    var constraint = params.getConstraint([parameter OID]);

    If the constraint is a list of choices:

    var choiceCount = constraint.getChoiceCount();

    If you wanted to work with the list of choices (this list is unmodifiable)

    var choiceArray = constraint.getChoices();
    
    for (var i = 0; i < choiceArray.length; i++)
    
    {
    
       ogscript.debug('My value is ' + choiceArray[i].getValue());
    
       ogscript.debug('My name is ' + choiceArray[i].getName());
    
    }

    If you wanted to get the name for a given value:

    var choiceName = constraint.getStringOf([value]);

    #DashBoard


  • 3.  RE: ogscript for Dashboard

    Posted 04-10-2014 20:50
    Thanks for your advice and hey are useful for me. One more question. I am able to read a XML file data to a list. Could you suggest how to write data in a list back to a XML file?

    #DashBoard


  • 4.  RE: ogscript for Dashboard

    Posted 04-10-2014 21:05
    DashBoard 6.0 and 6.1 do not have the ability to write to files.

    Watch for this feature when DashBoard 6.2 Beta becomes available.

    #DashBoard


  • 5.  RE: ogscript for Dashboard

    Posted 05-02-2016 20:18
    James - how can I set up a variable that I use in ogScript to check what layer an item is on, and subsequently set that item to go to a different layer (layer +1)?
    #DashBoard