Vision display view only over the network

I’m out of office. In the CLIENT open the debug console.

Regards,

Patrick

Thanks Patrick, I did go there and i see nothing containing anything related to my script. From all I can tell its not running at all.

/from java.io import File
from javax.imageio import ImageIO

logger = system.util.getLogger("Snapshot Script Logger")

component = event.source.parent.getComponent('Main Window')
bufferedImage = system.print.createImage(component)
logger.info("Line 9")

rawPath = system.util.getProperty("user.home") + system.util.getProperty("file.separator") +"Cletus_KPI.jpg"
logger.info("Line 13")
formattedPath = File('C:\Users\Public\Pictures')
logger.info("Line 15")

ImageIO.write(bufferedImage , "jpg", formattedPath)
logger.info("Line 18")
print ("Snapshot success")

The forward slash at the beginning isn’t there in the text

A client timer event isn't run within any window, so this line cannot possibly work. You need to use system.gui.getWindow(...) to obtain the desired window object.

There's probably an error visible in your debug console.

Be aware that writing a file in a Vision client puts it in the client computer, not anywhere the gateway can access it. You probably should message the image bytes to the gateway and have the gateway store the file (organized by client) to be able to offer them to Perspective clients.

1 Like

Thanks I will change the text. I go to:

Am I in the correct place?

No. Those are gateway logs. Go to the Help menu in the client (or designer) and open diagnostics there.

OK, wonderful that is a big help. I cannot really get to the client PC at the moment but I went to designer/help/diagnostics. Would I expect to see it in scripts? I do not see anything in the Log Viewer. Except early this morning:

I have made several changes, updates since then.

Most print operations and logger.info() output will show up in the diagnostics "Console" tab.

The "Scripts" tab is usually going to show nothing, as it can only effectively show asynchronous threads. (A consequence of Java Swing's design.)

1 Like

OK, thank you, Very helpful. This is what I have:

I’d recommended that while debugging, you increase the frequency to e.g. every 5 seconds, so you’re not looking for a log every 10 minutes

1 Like

Thanks for the reply, I already did that, I am not seeing any sign that it is working. I rebooted the client PC as well. Simply put, I do not see any evidence that the script is failing or succeeding. Maybe there is a setting that is not allowing it to run that I missed somewhere. I just don’t know! I expected it to fail but I was also expecting see how it failed and debug it.

I see Designer-Startup logs - are you testing this in designer? Run a real client. See what happens.

Thanks for the reply, this particular script will not work in designer so I have it running on the actual client

1 Like

Under log viewer do you see any folders with “Snapshot Script Logger”?

OK all I might have an actual error to work with. I cleared the console messages, shut down designer and re-launched it. When I came back I have these three errors:

{E09E1E31-77F4-4006-A190-1DBD96217CC9}

image

I thought you said you were running it in a real vision client? As in from vision client launcher, or Tools→Launch Project. Those seem not related. The logger name you used in your script was Snapshot Script Logger correct? So I don’t think the LMI_CHAMF_KPI logger has anything to do with this or don’t see how it would.

I think you may just want to call support at this point to have someone help you poke around.

By that I mean I am opening the diagnostic screen in designer to see what is going on in the client.

You need to open the diagnostic screen in the client. It will look identical. Can do it form the top tool bar or use control+shift+f7 in the real live running client to get it’s diagnostic panel - the designer diagnostic panel will only tell you about whats going on in the designer, nothing about any live running clients.

ok, that is not what I understood. Thank You!!

1 Like