It's acceptable for the contexts to be nulls. Can you describe the behavior that is causing you an issue? Is there an error message, or are you just not getting the right values back?
It would help to know your AF SDK version as well as language, so we can maybe give C# or VB.NET examples if need be.
It may help to share some of your code, if possible.
Thanks for the support. I am using AF SDK 220.127.116.1166 (2015 R2), developed in C#.
I was expecting that the timecontext would be an AFTime matching the date passed to the getvalue.
If the timecontext is null, does this mean "Current Time"?
Ok Rick, I got my answer.
I have launched PSE using the debug and change a query date. The timecontext is then correctly set to a AFTime.
Sorry for my misunderstanding.
1 of 1 people found this helpful
A null timeContext means what you want it to mean. But yes, typically, you would most likely want it to mean Current Time.
With my DR's I typically considered 3 possibilities for the timeContext:
- A null
- An AFTimeRange
- An AFTime
Here again you have the decision to make on how to treat a time range for your GetValue() to return a value at ONE timestamp. Do you want to use the StartTime or EndTime? Your call. Here's a snippet of code:
AFTime timestamp; if (timeContext is AFTime) timestamp = (AFTime)timeContext; else if (timeContext is AFTimeRange) timestamp = ((AFTimeRange)timeContext).EndTime; else // null or otherwise timestamp = AFTime.Now.ToPIPrecision(); // Your DR should output value at timestamp
Great this is what I need. Thank you very much Rick.