Would like to have a way to log what displays are opened, with an opened timestamp and a second timestamp when the display was navigated away from.
We need to update our displays and having this information would allow us to prioritize the work.
Anyone done this before and developed a slick way to it, or have ideas on an efficient way to generate such a usage log?
In reply to Aaron Crews:
I'm not able to get to the DeltaV Facebook group you mentioned - any other options?
jh, Does this link work for you? www.facebook.com/home.php
Greetings. With a bit of assistance we were able to develop a solution where you do not have to edit every one of your graphic files to track main displays. It uses a Scheduler watching Event Based Entries on the gs_mainCurrent variables. When this variable changes, a line gets written to a text file with the filename, timestamp and monitor that was opened. By watching the gs_mod variables you can also track faceplates. It works very well. Email me if you would like details.
However, I am trying to extend this so that it can also watch detail faceplates and popup displays. Can someone out there help me to identify the right frsVariables to watch for the following conditions:
- When a detail faceplate opens, and what module it is for. I have found gb_opendetail that changes to -1 when a detail faceplate is opened, but how do I know what module that was for?
- When a popup window opens, and then closes as well.
- When a faceplate closes.
If I can't watch frsVariables for this info, then what is the syntax for the right variables to see this info?
Once again, I am looking for a solution that does not require editing all of your displays. The way I have it now, all of the code for this is contained in a single scheduler EVS file.
Thank you in advance.
Bob
In reply to Bob McIntyre:
Using the frsvariables for display information that is serial (can only be one thing at a time) is great. Now on to detail displays and faceplates for which there exists the ability to open multiple of these items at one time. Technically, only one copy of a faceplate/detail file can be opened at one time, but the pop-up picture replication script handles that by duplicated the file with indexed suffixes on the file name, which the open FP and DT routines are cognizant of. In other words, there is not just 1 frsvariable or register available to dictate all this, as it is extensible.
Your scripting will have to asses all open documents at any given moment. This will capture the details, faceplates, main, alarm banner, toolbars, etc. files as objects. Once you have each collected as an object, filter down to only what you need. In this example, faceplates and details...
For Each objPicture In Application.Documents
'only check if a picture (not global or scheduler)
If objPicture.Page.ClassName = "Picture" Then
'if the picture has the same name,
If Left(objPicture.activewindow.windowname, 6) = "Detail" Or Left(objPicture.activewindow.windowname, 9) = "Faceplate" Then
'***********This is where the fun starts...
'*******************************************
End If
Next
Within the 'fun' part above, you might look for something like the detail / faceplate display title module object (usually a datalink called ModuleName.Caption). Of course when you find it, you have to keep track (in an array or something like that) when the FP with module1 opened vs FP with module2. Each time you trigger the query, you have to then assess whether something that was opened is no longer opened in order to write the close date/time stamp.
Where shoud this script reside and how to trigger it? I have, in the past, stuck this in user.fxg. A variable with an animation associated with the gb_OpenFaceplate, or gb_OpenDetail should be created. Then the vba can use the event of newvariable_change to trigger the script above. I think the same could be done with a schedule.
In reply to Youssef.El-Bahtimy:
Thank you for your response Youssef. It is very helpful. I have the code for faceplates and detail successfully triggered by the gb_openDetail and gb_openFaceplate variables in an event based scheduler.
I can also see what type of documents are being loaded and can index through all of them very nicely.
The one thing I cannot find is how to look inside a Document object to see what module it is referring to. I can use objPicture.Page to get inside the object. I also know from using zPicture that there is a variable in each faceplate and detail page called ps_nm that shows what module this instance is working on. From the (lack of) documentation on the object model, I cannot figure out how to reference the ps_nm variable inside the .Page object.
Can you tell me how to reference this and/or where I can find a good map of the object model so I can dig around and find all of the info I am looking for?
Thank you again for your assistance. It is very helpful!
try this...
Set strthename = findlocalobject(objPicture.Page, "ps_nm")
msgbox strthename.currentvalue
...for your detail displays, for example.
Findlocalobject is used when providing the ole object (first argument objPicture.Page which is document object OLE handle) and the partial name of a child object. It will find the first instance.
You will probably need an on error statement prior to setting the object in the event ps_nm can't be found.