property
element denotes a simple property. A simple property definition has the following attributes:key
: (mandatory) The property keytype
: (mandatory) The property type. See properties typesdefaultValue
: (optional) The property default valueunit
: (optional) The property unit, can be useful for numeric properties. See properties unitsconstraints
: (optional) The constraints of the property, useful for URL properties. See property constraintsmandatory
: (optional) true
if the property is mandatory. By default a property is optional[2]
allowConfigVariables
: (optional) boolean property, true if the property will take into account variables (see usage of variables in the properties for more information)arrayProperty
element denotes a property which is an array of elements of the same type. A property array definition has the following attributes:key
: (mandatory) The property keytype
: (mandatory) The array element typemandatory
: (optional) true
if the property is mandatory. As for simple properties, by default a property is optional[2]
allowConfigVariables
: (optional) boolean property, true if the property will take into account variables (see usage of variables in the properties for more information)int
: integer valuesboolean
: boolean valuesfloat
: float valuesstring
: integer valuesurl
: URL values. By default URL values must point to existing files, but it is possible to change this constraint, see property constraintsduration
: duration values. Duration values are instances of the Duration class. Duration values typically have a value followed by the unit of the duration[3]
200ms
1.5s
1min
1hour
position
: position values. The format is <x position;>;<y position;
. Position values are instances of the ScreenPosition class. These properties can be useful to position the GUI Window associated with a module if this module has an associated windowmap
: Map of (String, String) valuesm
: meterft
: feetin
: inchnm
: nautical miledeg
: degreedeg360
: degree normalized in the [0, 360] rangedeg180
: degree normalized in the [-180, 180] rangerad
: radianmrd
: milliradiantr
: "tour" (180 degrees = -0.5, -180 degrees = -0.5)m/s
: meter per secondm/s2
or ms2
: meter per second squaredg
: G-forcefr/s
: feet per secondfr/min
: feet per minuteknot
: knotsrad/s
: radian per seconddeg/s
: degree per secondkg
: kilogramlb
: poundms
: millisecondutc
: utcepoch
: epochs
: secondminute
: minutehour
: hourutc
and epoch
units are aliases for ms
(millisecond).<property key="myProp" type="float" unit="nm"/>And we have in the properties configuration:
<properties> <application name="appli1" > <module name="module1" > <moduleProperty key="myProp" value="18520" unit="m"/> </module> </application> </properties>The value of the property in Nautical miles will be "10".
public void init(Module module) { // here valueNM will be 10 float valueNM = module.getPropertyFloatValue("myProp", Units.NM); // here valueM will be 18520 float valueM = module.getPropertyFloatValue("myProp", Units.M); }
value
attribute. For example, these two definitions are equivalent:<moduleProperty key="prop1" value="15" unit="ms" /> <moduleProperty key="prop3" value="1.5" unit="s" /> <moduleProperty key="prop4" value="1" unit="s"/> <moduleProperty key="prop5" value="2" unit="minute" /> <moduleProperty key="prop6" value="1.5" unit="minute" /> <moduleProperty key="prop7" value="1.5" unit="hour" />and:
<moduleProperty key="prop1" value="15ms" /> <moduleProperty key="prop3" value="1.5s" /> <moduleProperty key="prop4" value="1s" /> <moduleProperty key="prop5" value="2min" /> <moduleProperty key="prop6" value="1.5min" /> <moduleProperty key="prop7" value="1.5hour" />
int
properties definition. They allow to define the allowed values for the property[4]
<property key="prop1" type="int"> <enum name="first" value="0" /> <enum name="second" value="1" /> <enum name="third" value="3" /> </property>
allowConfigVariables
attribute allows to specify if the property will allow the usage of variables in their value.<module name="myModule" > ... <properties> <property key="myProperty" type="string" /> </properties> </module>For the following properties configuration:
<properties> <var key="globalVar" key="500" /> <application name="appli" > <module name="myModule" > <moduleProperty key="myProperty" value="${globalVar}" /> </module> </application> </properties>The value of the property will be the String "500".
<module name="myModule" > ... <properties> <property key="myProperty" type="string" allowConfigVariables="false" /> </properties> </module>The value of the property will be the String "${globalVar}".
constraints
attribute.existingFile
: an existing filenotExistingFile
: a not existing fileallFiles
: all files<properties> <property key="scenarioSave" type="url" constraints="notExistingFile" /> </properties>
propertyGroup
element specifies a group of properties[5]
propertyChoice
element specifies a choice between several properties[5]
propertyGroup
and propertyChoice
elements have an optional mandatory
property, which has the same meaning as for the property element.propertyArrayGroup
element denotes a group of properties which are arrays of elements, all with the same number of elements. A propertyArrayGroup
definition has the following attributes:key
: (mandatory) The propertyArrayGroup keymandatory
: (optional) true
if the property is mandatory. As for simple properties, by default a propertyArrayGroup is optional[2]
allServices.updateCap
: the default property allowing to set an update cap in ms for all Services for a ModulepublishServices.updateCap
: the default property allowing to set an update cap in ms for publish Services for a Module.${<property name>}
. For example:<cyclic service="theService" frequency="${freq}" attach="attach"/>Auto-properties allow to configure attributes defined for a service implementation by properties in the properties file.
<properties> <autoProperty key="freq" mandatory="false" defaultValue="200ms" /> </properties>
freq
auto-property is defined:<module name="myModule" id="1" > <interfaces> <cyclic service="theService" frequency="${freq}" attach="attach"/> </interfaces> <properties> <autoProperty key="freq" mandatory="false" defaultValue="200ms" /> </properties> </module>The type of this property is a
duration
, derived from the type of the frequency
attribute. This property is optional, and its default value is 200 ms.
<module name="myImpl" id="1" > <implementation path="my.ModuleImpl" > <preConfigureEntryPoint method="preConfigure" /> </implementation> </module>and the following code for the module:
public void preConfigure() { module.addPropertyType("myFile", URL.class, null, true); }A
myFile
property will be created with the following characteristics:<properties> <property key="hasWorld" type="boolean" /> <property key="duration" type="duration" /> <property key="aircraftConf" type="url" mandatory="true" /> </properties>Here we have the definition of the following properties:
hasWorld
is an optional boolean propertyduration
is a mandatory integer propertyaircraftConf
is an optional URL property<properties> <application name="appli1" > <module name="module1" > <moduleProperty key="hasWorld" value="true" /> <moduleProperty key="duration" value="2" /> <moduleProperty key="aircraftConf" value="my/directory/file.xml" /> </module> </application> </properties>
<properties> <property key="hasWorld" type="boolean" /> <propertyArray key="configURLs" type="url" /> </properties>Here we have the definition of the following properties:
hasWorld
is an optional boolean propertyconfigURLs
is an optional array of URLs<properties> <application name="appli1" > <module name="module1" > <moduleProperty key="hasWorld" value="true" /> <moduleArrayProperty key="configURLs"> <value value="my/directory/file1.xml" /> <value value="my/directory/file2.xml" /> </moduleArrayProperty> </module> </application> </properties>
<properties> <propertyChoice mandatory="true"> <property key="uaConfig" type="url" /> <propertyGroup> <property key="uaImpl" type="url" mandatory="true"/> <property key="uaPath" type="string" mandatory="true"/> </propertyGroup> </propertyChoice> </properties>Here we have the definition of the following properties:
uaImpl
and uaPath
belong in an optional property group, but they are both mandatory in their parent group, which means that they must both be present or both absentuaConfig
or both the uaImpl
and uaPath
properties must be present<properties> <application name="appli1" > <module name="module1" > <moduleProperty key="uaConfig" value="my/directory/file.xml" /> </module> </application> </properties>and:
<properties> <application name="appli1" > <module name="module1" > <moduleProperty key="uaImpl" value="my/directory/uaImpl.xml" /> <moduleProperty key="uaPath" value="the.path.UaClassName" /> </module> </application> </properties>
<properties> <propertyArrayGroup key="array1" mandatory="true"> <property key="prop1" type="int" /> <property key="prop2" type="int" /> </propertyArrayGroup> <property key="prop3" type="int" mandatory="true"/> </properties>Here we have the definition of the following properties:
prop1
and prop2
are two int arrays wich must have the same number of elementsprop3
is an int property<properties> <application name="appli1" > <module name="module1" > <moduleProperty key="prop3" value="2" /> <moduleArrayGroupProperty key="array1"> <moduleArrayValue> <moduleProperty key="prop1" value="1" /> <moduleProperty key="prop2" value="2" /> </moduleArrayValue> <moduleArrayValue> <moduleProperty key="prop1" value="3" /> <moduleProperty key="prop2" value="4" /> </moduleArrayValue> </moduleArrayGroupProperty> </module> </application> </properties>
200ms
1.5s
1min
1hour
Copyright 2017-2020 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence