Skip to content
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

There should be a way to know if an Instrument is open or not #107

Open
developedby opened this issue Mar 6, 2020 · 1 comment
Open

Comments

@developedby
Copy link
Contributor

I only use UC480, so I'm not sure if it applies to other instruments.
The only way I found out to know if a camera is open is to check _in_use, a protected member. Maybe it would be a good idea to rename it to in_use or to provide a function to access it.

@natezb
Copy link
Contributor

natezb commented Mar 14, 2020

As per #94, I've added an is_open field and a public open() method to the uc480 driver.

As every Instrument now has a close() method, it's reasonable to consider adding open() and is_open to all instruments. Some instruments (like NI DAQs) are essentially always-open, there's no underlying opening or closing going on. In cases like this, we could either make is_open perpetually True and open() and close() no-ops, or have those methods only "virtually" open and close by modifying is_open. It's not immediately obvious to me which is better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants