Results 1 to 6 of 6

Thread: Using Node Parameters to enable / disable nodes. Can only get Boolean to work

  1. #1

    Default Using Node Parameters to enable / disable nodes. Can only get Boolean to work

    Hi, I've managed to program 2 nodes that enable or disable based on a parameter, but only when the parameter type is set to "boolean", or "string" and the input is either "true" or "false".

    I need this to be set to "Choice" instead of "boolean", and the selection to be numbers, in this case 50, 200, 300.
    The parameter name is "No. of Splits".

    For Boolean the code I'm using to enable the first node and disable the second when the parameter is set to "True" is :
    enable {{^No. of Splits=true^}}
    disable not({{^No. of Splits=true^}})
    This works perfectly.

    Any other string apart from "true and "false" or any numbers and nothing happens

    What is the correct code for using "Choice" using either numbers or strings ?

    Thanks,
    Dave

  2. #2
    Lavastorm Employee gmullin's Avatar
    Join Date
    May 2014
    Location
    Chicago
    Posts
    185

    Default

    If you could have this in the Enabled property:

    "{{^EnableParam=^}}" == "1"

    The node would only be enabled if the parameter called EnableParam was set to 1.

  3. #3

    Default

    Thanks, that worked. How do I set a default though as its the first option that appears in the dropdown ?
    I can set the parameters in the "edit Choices" box, but there's no option I can find to set which is the default.

    Also does the "Mandatory" field effect anything ? I've never touched it so it's always on Default, but sometimes the text box says True and others say False and I can't work out what exactly it does or what dictates it's setting.

  4. #4
    Lavastorm Employee stonysmith's Avatar
    Join Date
    Nov 2006
    Location
    Grapevine Tx
    Posts
    799

    Default

    1) You can't set a default value for a dropdown. It will always begin with "(default)". You could place the node into a library, and pick a value from the list, which will then become the default when you use the node from the library, but to my knowledge you can't pick a default value for the dropdown. If you want to enforce that some selection is always picked, you can set the Validator to "Not Blank"

    2) Mandatory comes into play when building a BRX or LXA. Any node tagged as Manditory MUST be executable (can be satisified)(must have data coming into it) or the compiler will throw an error and not build the BRX/LXA

  5. #5

    Default

    ok, thanks again.

  6. #6
    Lavastorm Employee gmullin's Avatar
    Join Date
    May 2014
    Location
    Chicago
    Posts
    185

    Default

    I'm not sure if it's clear but also the = sign inside the parameter is giving it a value in the event that the parameter has not been set. The value below would be saying that if nobody set a value on EnableParam, then take it that the value is 1. You could do something like this so the node is enabled by default and somebody has to change the value of the parameter to disable it (or vice versa).

    "{{^EnableParam=1^}}" == "1"

    Also to point out since Stony mentioned about BRXs and LXAs - you can't enable and disable a parameter within a BRX by a run parameter. The node is either enabled or disabled when you compile the BRX/LXA.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •