jckantor / TCLab

Software support for the Temperature Control Laboratory.
Apache License 2.0
13 stars 22 forks source link

Initialize to a known state #92

Open jckantor opened 6 years ago

jckantor commented 6 years ago

To enable use with notebooks and accommodate typical student use, each open/close cycle for tclab should leave code in a known state. Need to validate and test.

alchemyst commented 6 years ago

I'm not 100% sure what you mean here. At the moment if someone uses the context manager, everything will get closed and shut down properly. It is too time consuming to connect to the port on each write, so there wil inevitably be the opportunity to open a connection and not close it if you use low-level commands. Perhaps you could elaborate on "open/close cycle"?

jckantor commented 6 years ago

The problem I encountered was with labtime. It wasn't being reset on TCLab.init() or TCLab.close(), so could be in an odd state upon starting a new session with the device. I did a quick fix on that, but created the issue as a reminder to scan the remaining bits of code to be sure there's a well defined state upon a restart of TCLab.