<types> <simpleType name="int" baseType="int" /> <simpleType name="bool" baseType="boolean" /> <switchType name="theSwitch" types="int bool" /> </types>Each of the possible types is specified by its associated index. For example in the case above,
int
would have the index 0, and bool
the index 1.
Data.Switch data = (Data.Switch) service.getData(<the data name>); data.setValue(<the type name>, value); // or data.setValue(<the type index>, value); // or data.setValue(<the type>, value);For example, for this types declaration:
<types> <simpleType name="int" baseType="int" /> <simpleType name="bool" baseType="boolean" /> <switchType name="theSwitch" types="int bool" /> </types>If you want to set a boolean value for the switch type, you can do:
Type boolType = module.getType("bool"); Data.Switch data = (Data.Switch) service.getData(<the data name>); data.setValue("bool", true); // or data.setValue(1, true); // or data.setValue(boolType, true);
Copyright 2017-2020 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence