I’m still a beginner, but this shouldn’t happen.
I started one topic on other forum too:
There You can see the code of the program, and my questions.
I hope someone can tell me what’s wrong.
Istvan
I’m still a beginner, but this shouldn’t happen.
I started one topic on other forum too:
There You can see the code of the program, and my questions.
I hope someone can tell me what’s wrong.
Istvan
I think you’re accessing the GUI from a thread.
That’s a no-no!
Only the main thread should access the GUI. (And this is true in all GUI systems, as far as I know.)
A background thread should pass messages to the main thread via a queue (from the queue
module) and the main thread can check the queue periodically and update the GUI accordingly.
Many thanks for the quick reply, I will reorganize the code based on Your answer.
Istvan
Despite the speedup; problem come after 2 hours and 47 mins later (because 1s refresh here: self.after(1000, lambda: self.t_meas(tdisp)) )
I left inside a code in commented section that version witch frosen jomp of the timer from GUI… after 10k sample
I’m out of ideas. …
I reduced the timeout of:
self.after(1000, lambda: self.t_meas(tdisp))
to:
self.after(100, lambda: self.t_meas(tdisp))
to speed this up more and saw a steady increase in memory usage.
This is probably because you’re creating a new label for label7
every time in t_meas
, so there’ll be a stack of labels hidden under the top one.
Kind of explains why the screenshot shows one on the dialog and another one next to the dialog.
There are probably a lot of other ones beneath them too…
Instead, create the label in build_gui
and then update its text using the label’s config
method.
I also notice that you create buttons in every time in button_state
. Similar remarks apply.
I’m back to the event_generate method, (code updated)
which looks more elegant, I think. - I had the indicated errors here as well.
Preliminary quick tests are also very encouraging.
Continue the long-time test.
Huge Thank You Matthew,
rock-stable software and a user interface without freezes mean incredible happiness, to Me now.
Istvan
Now. how I start to analyze what I experienced, and what you wrote the first time;
Because now the GUI is in the main thread, could be an even more stable software structure.
When the Gui (main thread) froze, the data logging in separeted thread also paused for a few minutes, but then continued to run.
Istvan