... | ... | @@ -30,10 +30,10 @@ When an input `.geo` or `.pro` file is parsed, the command |
|
|
n = DefineNumber[ 3.14, Name "a number", <attributes...>];
|
|
|
```
|
|
|
first checks if a ONELAB parameter with name `"a number"` exists in the ONELAB database.
|
|
|
* If not, the parameter `"a number"` is added to the ONELAB database with value `3.14`, and the same value is also assigned to the local variable `n` in the namespace of Gmsh or GetDP.
|
|
|
* If it does, it is the value fetched from the ONELAB database that is assigned to the local variable `n`, and the argument value of the command is ignored.
|
|
|
* If it does not, the parameter `"a number"` is added to the ONELAB database with value `3.14`, and the same value is also assigned to the local variable `n` in the namespace of Gmsh or GetDP.
|
|
|
* If it does, it is the value fetched from the ONELAB database that is assigned to the local variable `n`, and the value given in the argument of the command is ignored.
|
|
|
|
|
|
This means that `3.14` can be interpreted as a default value for the local variable `n` (and for the ONELAB parameter `"a number"`): the first time the statement `n = DefineNumber[ 3.14, Name "a number"]` is parsed, the local variable `n` is assigned the default value `3.14`. All subsequent executions of a command like `n = DefineNumber[ 2.718, Name "a number"]` (in the same file if it is parsed again or in another file) will ignore the argument value `2.718` and assign to the local variable `n` the value of `"a number"` obtained from the ONELAB database. That value could be the original default value, or a value set in the meantime by the user via the graphical user interface, or a value set by another ONELAB client.
|
|
|
This means that `3.14` can be interpreted as a default value for the local variable `n` (and for the ONELAB parameter `"a number"`): the first time the statement `n = DefineNumber[ 3.14, Name "a number"]` is parsed, the local variable `n` is assigned the default value `3.14`. All subsequent executions of a command like `n = DefineNumber[ 2.718, Name "a number"]` (either in the same file if it is parsed again or in another file) will ignore the argument value `2.718`, and assign to the local variable `n` the value of `"a number"` obtained from the ONELAB database. That value could be the original default value, or a value set in the meantime by the user via the graphical user interface, or a value set by another ONELAB client.
|
|
|
|
|
|
Sometimes the opposite behavior is useful. This is done by giving the ONELAB parameter the attribute `ReadOnly 1`, e.g. by means of the command
|
|
|
|
... | ... | @@ -42,7 +42,7 @@ n = DefineNumber[2.718, Name "a number", ReadOnly 1, <attributes...> ]; |
|
|
```
|
|
|
In this case, the parameter `"a number"` in the ONELAB database and the local variable `n` are both assigned the argument value, here `2.718`. All subsequent `n = DefineNumber[ xx , Name "a number"]` statements will have the same behavior, as long as the attribute `ReadOnly' of the parameter `"a number"` is not reverted to 0. Logically, `ReadOnly` parameters are not editable in the graphical user interface.
|
|
|
|
|
|
A `/` character in a parameter name results in the creation of a sub-tree in the hierarchical parameter tree displayed in the menu panel of the graphical user interface. See also below for all the optional attributes that can be specified in addition to the `Name` of the parameter.
|
|
|
A `/` character in a parameter name results in the creation of a sub-tree in the hierarchical parameter tree displayed in the graphical user interface. See also below for all the optional attributes that can be specified in addition to the `Name` of the parameter.
|
|
|
|
|
|
If no ONELAB server exists (e.g. if GetDP is run in stand-alone mode), the `DefineNumber` command simply assigns the default value `3.14` to the local variable `n`. An input file using `DefineNumber` to create an appealing graphical user interface using ONELAB can thus also be run as-is without ONELAB.
|
|
|
|
... | ... | |