Thanks,
The reason I would like to use this is cause I use floating non maximized windows that I resize accordingly to be for instance a 'west overlay' that functions like an overlay (not cropping the main window) instead of a docked window that crops the main window. See screenshot:
I've written some project scripting functions (getOverlayWidth, getOverlayHeight and getLeftTop ect.) to detirmine sizes and points in my framework. These functions depend on 2 ignition docked windows, a north and a west one with a dock index of -1. Whenever the client starts I open these windows: north with a height of 0 and west with a width of 0, so you dont actually see them. Afterwards I use those windows to determine the width (north docked window) and height (west docked window) of the actual client runtime.
In my example you can see that my dock axis precedence is set to 'North/South' so to determine my actual overlay width I take the width of my north docked window and subtract it with the width of all my other open east or west windows:
# Get west and east docks width
winDockEastWidth = 0
winDockWestWidth = 0
for window in system.gui.getOpenedWindows():
if window.getComponentForPath('_parent').dockPosition == winDockLocationEast:
winDockEastWidth = winDockEastWidth + window.width
if window.getComponentForPath('_parent').dockPosition == winDockLocationWest:
winDockWestWidth = winDockWestWidth + window.width
# Get overlay width
return system.gui.getWindow(winPathClientDockSizeWidth).width - winDockEastWidth - winDockWestWidth
Whenever for some reason somebody changes this axis precedence, there is no need to subtract the east nor west dock. Thats why I like to know the axis precedence.
Now I realize this is a tricky way of working around the Ignition Vision posibilities, and after testing I've also noticed that I get other values for the axis precedence in 'Designer Testing' (play button) gives me 'North / South' and the actual Ignition client gives me '¿AxisPrecedence.NorthSouth?'. It stil give me north and south so I can get it out but this might change in future Ignition updates.
So, if you have a better solid option to get the actual client runtime width and height (red line A in the screenshot) so I don't need to use the trick with hidden docked windows that would make my day and probably be a better solution. I tried playing around with code I found at:
https://forum.inductiveautomation.com/t/how-to-get-vision-client-resolution/27328/4.
But this ends up in giving me the display resolution and not the actual client drawing resolution.
Next to this one more question. I got your solution working from a button, but how do i get to the getAppContext() from within project scripting?
Big thanks upfront already.