-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Outfile #1
Comments
@adamssson what do you mean with outfile? |
@tspspi Sorry - this term saw in your logpressure.py - line14. I meant external file where all measures are stored. |
@adamssson Now I get it - I haven't looked into the examples and wondered. I'm going to update this / move to argparse in the example when there is some spare time. Currently this is only a really crude implementation that captures the measurement values till the program is interrupted via Keyboard Interrupt and then in the end writes everything into a numpy npz file where one can just specify the filename. Maybe I'm going to rework the whole usage sample at some point - I've just written this in a hurry to show how one can use the library / since I needed to monitor pressure of a system over night. |
Thanks this will be helpful. |
This question is not silly - but doing this with this library in a GUI is not so straight forward as doing in a simple loop. This is because this "library" is written in an imperative and non event based style. To use it in a GUI application you'd need some kind of timer that queries the get_pressure() function periodically or query it from your event loop. Maybe I have some time in the next view days hacking something together that shows how this works as a complete example. As some starters for how my personal approach would look like: For TKTo execute a task periodically you could use tk's after:
And before starting you main loop register the task to run after a second:
Using the CLIFor now a very simple way of pressure indication that utilizes a CLI but not a GUI that I can imagine would just look like the following:
MatplotlibIf you really only need a very quick visualization you could also utilize a way of using matplotlib and just reopening the window all the time. This is then about the same as the CLI example just closing the plot all over again (not complete code, just a sample):
Using FreeSimpleGUI and MatplotlibWhat I usually do when I really want to visualize in a very quick way is embedding matplotlib in freesimplegui since one doesnt have to deal with most of the GUI stuff there - I've got a small project at GitHub that does something similar but received information via MQTT - when using such an approach one would put the query somewhere into the event loop or trigger a timer periodically (this would be the loop at line 121 in the main program there) |
Thanks! You are Star! |
You don't mention in documentation how to define outfile. It's also not visible in comments.
The text was updated successfully, but these errors were encountered: