...
Include Page | ||||
---|---|---|---|---|
|
5.4 Implementing the GetValues method
The source code for the IEngine GetValues implementation is shown below.
Code Block |
---|
public org.OpenMI.Standard.IValueSet GetValues(string QuantityID, string ElementSetID) { double\[\] returnValues; Char\[\] separator = new char\[\]{':'}; if (QuantityID == 'Flow') { int index = Convert.ToInt32((ElementSetID.Split(separator))\[1\]); returnValues = new double\[1\]; returnValues\[0\] = \_simpleRiverEngine.GetFlow(index); } else { throw new Exception('Illegal QuantityID in GetValues method in SimpleRiverEngine'); } }
|
The branch number is extracted from the ElementSetID and used as an index in the GetValues call to the SimpleRiverDotNetAccess class.
...
Fig. 16. Calling sequence for the GetValues method
4.5.5 Implementation of the remaining methods
...