Skip to content

Commit

Permalink
Merge branch 'master' into remove-contrib-drivers
Browse files Browse the repository at this point in the history
  • Loading branch information
astafan8 committed Apr 16, 2020
2 parents d066f2e + 62a0c68 commit 9742af5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ See `License <https://github.com/QCoDeS/Qcodes/tree/master/LICENSE.rst>`__.
.. |DOCS| image:: https://img.shields.io/badge/read%20-thedocs-ff66b4.svg
:target: http://qcodes.github.io/Qcodes
.. |DOI| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.3674018.svg
:target: https://doi.org/10.5281/zenodo.3674018
:target: https://doi.org/10.5281/zenodo.3752870
14 changes: 7 additions & 7 deletions qcodes/instrument_drivers/tektronix/Keithley_s46.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ def __init__(

self._lock = lock
self._channel_number = channel_number
self.get = partial(self._get, get_cached=False)

if self._get(get_cached=True) == "close":
try:
Expand All @@ -83,8 +82,6 @@ def __init__(
"Refusing to initialize driver!"
) from e

self.set = self._set

def _get(self, get_cached):

closed_channels = self._instrument.closed_channels.get_latest()
Expand All @@ -94,17 +91,20 @@ def _get(self, get_cached):

return "close" if self.name in closed_channels else "open"

def _set(self, new_state) -> None:
def get_raw(self):
return self._get(get_cached=False)

def set_raw(self, value) -> None:

if new_state == "close":
if value == "close":
self._lock.acquire(self._channel_number)
elif new_state == "open":
elif value == "open":
self._lock.release(self._channel_number)

if self._instrument is None:
raise RuntimeError("Cannot set the value on a parameter "
"that is not attached to an instrument.")
self._instrument.write(f":{new_state} (@{self._channel_number})")
self._instrument.write(f":{value} (@{self._channel_number})")

def is_closed(self) -> bool:
"""
Expand Down

0 comments on commit 9742af5

Please sign in to comment.