autolab-project / autolab

Python package for laboratory instruments control and scientific experiments automation
https://autolab.readthedocs.io/
GNU General Public License v3.0
28 stars 7 forks source link

[enhancement] [GUI] Automatically read some variables when instantiating #6

Closed pyMatJ closed 7 months ago

pyMatJ commented 2 years ago

I would like to have the option to read some of the variables created in the get_driver_model upon initialization.

Some variables might be unsafe to read, so this cannot be a default solution, but some might be important: as an example, I have a laser that gets 'armed' upon initialization, but the checkbox in the GUI is created with a default 'False' state. I thus need a first 'read' to set it in the correct state, otherwise I end up in a situation where the display is the inverse of the actual state.

Two possibilitie:

  1. only read the boolean variables (by default). I think this should be safe and helps to start with the GUI in a correct state
  2. add an option to read the value immediately upon instantiation.
Python-simulation commented 11 months ago

Hi! I added an option called 'read_init' in get_driver_model to tell the GUI which variable to read upon device instantiation. Look at commit f42c061 if you are still interested.