How can I find list of AF Analysis template functions, the name, a group, a description and the amount of attributes?
Here you go, courtesy of the awesome TGG:
var functionXML = "";
Assembly ass = Assembly.LoadFrom(@"C:\Program Files\PIPC\Analytics\OSIsoft.PIAnalytics.PerformanceEquation.dll");
using (Stream stream = ass.GetManifestResourceStream("OSIsoft.AN.PerformanceEquation.FunctionData.resources"))
using (StreamReader reader = new StreamReader(stream))
functionXML = reader.ReadToEnd();
functionXML = functionXML.Substring(functionXML.IndexOf(@"<functionCategories>"), functionXML.Length - functionXML.IndexOf(@"<functionCategories>"));
You can find the description you need in AF Help.
Thank you for your answer, but that's not what I need. I need a list of functions and information about them in the program code. This information will I need to display on the user's screen, without using guide AF.
Is it to be shown in a local or web application?
That makes it difficult. I was thinking about using Help.ShowHelp function with the chm file, but it wouldn't apply for a web app.
I was also searching for the xml documenattion for the PE Analysis Rule dll, but couldn't find it...
How can I do it locally?
Help.ShowHelp allows showing info on a topic from a chm file.
The only option i can think of is to scrape the data from the (online) documentation and store the help information in your own application.
Scrape all pages below this one: https://livelibrary.osisoft.com/LiveLibrary/content/en/server-v6/GUID-A02EBB5C-9E5D-4D92-B50B-17163173BC26
Really good hint....
What about online parsing the html. If you check the items in the tree <ul> at the left, they have a short description of the function as title. You wouldn't need scraping it or drill down...
<div class="lc_toc_title xref lc_toc_document" title="Return the absolute value of an integer or real number." alt="Return the absolute value of an integer or real number." lcuuid="d54891e15312" lc:filename="GUID-4BB05977-A69D-49B4-B502-3B7D2F440CE0.xml" lcdocid="GUID-4BB05977-A69D-49B4-B502-3B7D2F440CE0"><div class="lc_toc_doc_title">Abs</div></div>
Yes, it's a way out .. but it would be better to find a solution where information about functions is located in the AF library..
This could be an option assuming this is not going against the Copyright !
how about including a link for the users to lead them to the official documentation?
That would be even less effort for you to build your application.
Well, cross-apply the licensing terms for the software and associated documentation and then you end up with some right to copy, right? Copy that?
See the attached text document with the list of functions per category that I pulled via code. The file name gives you a hint of where to get the list from if you want to do that programmatically. Don't forget about the Steam Functions too.
Unfortunately, your hint did not help me .. Maybe I am doing something wrong .. Could you write more detail?
String "GetManifestResourceStream("OSIsoft.AN.PerformanceEquation.FunctionData.resources")" returns null
Strange...works perfectly fine for me.
I assume you have located the correct Assembly file to load from?
Thank you very much Rhys Kirk, it worked out.
Retrieving data ...