Regarding the attached project I found that a row (made with GUIBuilder) make a runtime error if I don’t call theApp.Run() in the software
The error
unhandled exception in 0x00F6384B (libGui.dll) in OscilloC.exe: 0xC0000005:access violation while reading the path 0xFEEEFEF2.
The row
TRootEmbeddedCanvas *realtime = new TRootEmbeddedCanvas(0, fCompositeFrame671, 950, 520, kSunkenFrame, ucolor);
I want to make a custom loop inside my main function and to use gSystem->ProcessEvents(); to handle GUI only when needed. I tried to use theApp.Run(kTRUE) but it seems to be blocking.
I cannot reproduce the problem…
EDIT: OK, sorry, I see. You must use theApp.Run() to have handle the events. Or use an infinite loop , like while (!gSystem->ProcessEvents()) {;}, but I really don’t see why you want to do it that way…
Oh, sorry for the delay but i read your message from the mail and yesterday I reinstalled VS, root and root debug to try to solve the problem.
With theApp.Run() I don’t have the problem, but with while (!gSystem->ProcessEvents()) {;} I have it.
I come from a py+pyQtGraph experience and I want to move to a more performing software; for that reason i prefer to manually update the UI and to have more free CPU for other tasks.
Yes, but i want to plot analyzed data in real time so I must link the UI and the serial analysis.
From my point of view i can’t see any advantage. My main goal is to analyze all data in the serial buffer and then plot results, then analyzing other received data and then plotting, etc. How can i achieve that?
In py I built a system with 2 thread but data arrays must be locked when accessed from the two thread (or to send “packets” of data between threads) so i think i loose more performance then what i gain.
So, since i want to improve maximum readable speed, i went to root & C++ thinking I should keep the serial analysis in the main thread and to reduce the use of resources.
Well, you can also use multi-threading in ROOT…
But anyway, you should be able to create a loop with calls to gSystem->ProcessEvents() without any problem. So I would debug this first…
OK, from my tests the problems happens if I complete the main function, without calling
gSystem->Exit(0); // or something similar
It’s probably related to something i start creating TRootEmbeddedCanvas that can’t end propely. I can also terminate the app calling gSystem->ProcessEvents() after that the console has beeen closed.