I am migrating some of my AF 1.3 code I use with cases to AF 2.4 and am not seeing the equivalent of the AFCaseLog class. Is there something that is equivalent, but just named different that I am not seeing in the AFSDK help file.
The AFCaseLog class is mentioned at few places in the documentation, but looks obsolete though:
see here: AF SDK Reference - Search .
If this does not work, I think that the best approach would be that you give a a little explanation of why you need to use this object and what you are trying to achieve.
With that, we should be in a better position to recommend you an approach you can use with the AF SDK.
AF 1.x's AFCaseLog is replaced by the AF 2.x AFTrace functionality. See the examples in the AF SDK reference for AFCase and AFTrace for how to set up a trace listener and capture messages from running a case.
Dow Corning Confidential - INTERNAL
Thank you Chris for your response. I took a look at the links and the AFTrace link was some help, but when I looked at the AFCase link there is no descriptions, remarks or comments providing additional details for any of the Trace... methods.
Thank you these links were very helpful.
I have looked at the trace listener example and I see how itworks. What I would like to understand next is how to determine what typeof message each is when received(i.e. Error, Warning, Informational,etc). Ultimately what I would like to see is the same information thatyou can see when you run a case and then look at the case Log Output tab forthe informational, warning and error messages. I would assume thetimestamp can be captured based on when it was received by the listener, butwhat about the type.
When implementing a TraceListener, you can also override the TraceData methods which have a TraceEventType property that specifies the type of the message. The implementation of these methods would normally check the parameters and determine if the WriteLine methods should be called. But you could also check the TraceEventType and add it to the message or completely intercept the call and perform your logging from the TraceData call.
Here is the link to the TraceListener documentation on MSDN: TraceListener Methods (System.Diagnostics)
Thank you I will take a look at this.
I have another question, it may belong in a different post, but is related to the obsolescence of the CaseLog object. In 1.3 there was an ActiveX control I had used which showed the case log when you executed different steps in the case runner. It was OSIsoft.PI.Modeling.UI.AXControls.AxAFViewControl and had tabs for General, Result, Adjustments, Log, Layers, Elements and Connections. I would guess this is the one used in AF Explorere. I see that the PI System Explorer has a control which has tabs for Case Runner Output and Log Output. Is this available as a control I can consume in my .Net project. Is there an equivalent control in AF 2.4 and what names space can I find it in. I took a quick look at the AF UI help file, but nothing jumped out at me.
The control you are looking for is the OSIsoft.AF.UI.AFCaseViewControl.
The OSIsoft.AF.UI.AFCaseViewControl has a property ShowCaseRunnerAndOutput that you set to TRUE to have the same format as the Sigmafine Model Analysis Plugin.
Thank you very much, that is exactly what I was looking for.
The OSIsoft.AF.Analysis.AFCaseLog actually still exists in the AF 2.x SDK, but is not documented and is marked as obsolete. It is implemented similar to the examples show in the AFCase and AFTrace documentation referenced in Chris Manhard's post. You should replace your use of the AFCaseLog with your own custom trace listener and not try to use the obsolete one provided in the AFSDK only for backwards compatibility.
Retrieving data ...