static void Transforms()
{
ITime time = new TimeStamp(10.0);
string linkid = "wibble";
// has an output exchange item which returns Reed Growth as a height (IScalar/double)
ILinkableComponent iLC = new LinkableComponentReedGrowth();
IValueSet vs = iLC.GetValues(time, linkid);
double d = ((IScalarSet)vs).GetScalar(0);
string id = iLC.GetOutputExchangeItem(0).Quantity.ID;
string idd = iLC.GetOutputExchangeItem(0).Quantity.Description;
// make 3rd party Linkable component transformable
LinkableComponentTransformable iLCA = new LinkableComponentTransformable(iLC);
// change Reed Growth by linear transform y = 10x + 5
int index = iLCA.AddTransformOutput("ReedGrowthHeight", new LinearTransform(10, 5));
IValueSet vs2 = iLCA.GetValues(time, linkid);
double d2 = ((IScalarSet)vs2).GetScalar(0);
string ida = iLCA.GetOutputExchangeItem(index).Quantity.ID;
string idda = iLCA.GetOutputExchangeItem(index).Quantity.Description;
}
|