Key Error

https://www.dacm-logiciels.fr/tracewin
Post Reply
Francejonathan dumas
Neophyte
Neophyte
Posts: 12
Joined: Thu 10 Dec 2020 15:35
Country:
France (fr)
France

Key Error

Post by Francejonathan dumas »

Dear Didier,
there is a popup window that informs me that there is a "Key error" and that the version is too old, see attached.
I updated TraceWin and the key today.
Is it possible to disable this popup window? It blocks batch calculations until I press "OK".
Cheers,
Jonathan
Attachments
keyerror.png
keyerror.png (2.66 KiB) Viewed 1796 times
User avatar
FranceDidier
Administrator
Administrator
Posts: 862
Joined: Wed 26 Aug 2020 14:40
Country:
France (fr)
France

Re: Key Error

Post by FranceDidier »

Dear Janathan,

I don't understand!
The TraceWin update didn't fix the problem, the message still appears ?

Regards,

Didier
Francejonathan dumas
Neophyte
Neophyte
Posts: 12
Joined: Thu 10 Dec 2020 15:35
Country:
France (fr)
France

Re: Key Error

Post by Francejonathan dumas »

Yes, it still appears after the update!
It's very random, it might be after a few hundreds of TraceWin uses

I can add in my script a function (hereafter in case someone has the same problem, for Windows/Python) to press all the time on the ok button of this window in case it appears but it's not ideal:

Code: Select all

import win32gui, win32con, win32api
from datetime import datetime

cmptErr=0
def closeKeyError(win_title):
    handle = win32gui.FindWindow(0, win_title)
    global cmptErr
    if win32gui.IsWindow(handle):
        win32api.SendMessage(handle, win32con.WM_CLOSE, 0, 0)
        cmptErr+=1
    else:
        win32api.Sleep(60000)
    print("Time:",datetime.now(),"Still Running. Key error count:",cmptErr) 
        
while True:
    closeKeyError("Key error")

Last edited by Francejonathan dumas on Thu 18 Aug 2022 21:54, edited 2 times in total.
User avatar
FranceDidier
Administrator
Administrator
Posts: 862
Joined: Wed 26 Aug 2020 14:40
Country:
France (fr)
France

Re: Key Error

Post by FranceDidier »

Hi Jonathan,

I've looked at the code, but I can't see any reason for this message to appear and if it's random it's even more incomprehensible.
I have added information in the error message dialog and in the "tracewin_key.log" file to understand. So next time if you are able to keep the message or the log file, send it to me so I can understand.
Of course you still have to upgrade the code to get these extra details.

Regards,

Didier
United States of AmericaAbhishek
Initiated
Initiated
Posts: 40
Joined: Sun 12 Dec 2021 00:44
Country:
United States of America (us)
United States of America

Re: Key Error

Post by United States of AmericaAbhishek »

Dear Didier,
I am using TraceWin 2.18.6.0, and I am still getting this message (as attached). May you please look into it? This occur when I run TraceWin in Batch mode for a very large number of runs.

Thank you

With Regards
Abhishek Pathak
Attachments
key error.JPG
key error.JPG (17.94 KiB) Viewed 1507 times
User avatar
FranceDidier
Administrator
Administrator
Posts: 862
Joined: Wed 26 Aug 2020 14:40
Country:
France (fr)
France

Re: Key Error

Post by FranceDidier »

Dear Abhishek,

Is it systematic or only for certain runs?
Could you tell me exactly what your bacth command is?
Do you have the same problem if you use "TraceWin_noGUI.exe" which is exactly the same code without GUI?

Regards,

Didier
United States of AmericaAbhishek
Initiated
Initiated
Posts: 40
Joined: Sun 12 Dec 2021 00:44
Country:
United States of America (us)
United States of America

Re: Key Error

Post by United States of AmericaAbhishek »

Dear Didier,
I think is not systematic; sometimes, it appears consecutively sometimes it does not. My batch command is,

TraceWin config.ini path_cal=',num2str(k),'\',num2str(i),'\ Ele[',num2str(en(k)),'][2]=',num2str(F(I))

where I run a for loop over I and k and assign respective calculation directories. Here I also change the gradient of the quadrupole command. Ele[',num2str(en(k)) represents the quadrupole element number, and num2str(F(I)) stores the gradient range that I want to use.

So far, I have not tried the "TraceWin_noGUI.exe" option. I will try and see what happens.

Thank you

With Regars
Abhishek pathak
User avatar
FranceDidier
Administrator
Administrator
Posts: 862
Joined: Wed 26 Aug 2020 14:40
Country:
France (fr)
France

Re: Key Error

Post by FranceDidier »

Dear Abhishek,

I understood the problem thanks to your various information. It is now fixed in the latest version available on our website.

Regards,

Didier
Post Reply