Skip to content

QueryInterface open/close in context managers + SocketInterface.

Bitbucket Importer requested to merge bitbucket/merged-pr-7 into branch/default

Created originally on Bitbucket by jsalort (Julien Salort)

Was already merged in Bitbucket before import, marked as merged by the import user

Source changeset not longer availableat the time of import. Commit listwill look empty

  • Changes to QueryInterface:

    • do not open interface in __init__ or rely on __del__to close
    • create new private methods _open, _close, _read, _write, and public methods open, close, read, write which maintains a boolean opened, and call the private methods accordingly (checks if interface is opened before reading or writing, avoid calling _open twice, etc.). Users should call the public methods. New interfaces only need to implement to private methods in the general case.
    • open/close with context managers. New interfaces do not need to reimplement __enter__ and __exit__, except if they want to do something additional (like printing the instrument identification string).
  • Create SocketInterface for network devices. Change VISADriver to use SocketInterface when __init__ is called with a string instead of an Interface object, if default_port attribute is defined.

  • Add implementation for Cryocon 24C temperature controller. Use SocketInterface by default.

  • Fix Lauda driver to prevent sending writes in __init__

  • Fix Pfeiffer MaxiGauge to prevent sending writes in __init__

  • Rename Stanford DS360 with similar name as SR830

Merge request reports

Loading