Professional Documents
Culture Documents
AF SDK Online Course - Useful Helper Methods
AF SDK Online Course - Useful Helper Methods
The GetValue method has an argument named timeContext, which is an object. Your output calculation
will want a specific AFTime instead of an object. One of many ways to determine that is this method:
You may find the need to make sure the measurement attribute is a numeric data type. This could be
done in the GetInputs method or in GetValue.
If you wanted to know the data type associated with an AFAttribute, you will need an extra call. Here's a
small snippet:
IsNumericType(Type.GetTypeCode(attr.Type))
If you want to know the data type of an AFValue's Value, this is more direct:
IsNumericType(value.ValueTypeCode)
And finally, as the world is not perfect, neither is data. You may have bad data or data completely
missing. There are many ways in .NET to deal with this situation. You could use nullable values such as
int? or single?. My approach is to treat all numerics as a double and let double.NaN represent any kind of
bad or missing data scenario.