Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tammo Jan Dijkema
HPIB
Commits
f7d6a7f4
Commit
f7d6a7f4
authored
Apr 17, 2018
by
Tammo Jan Dijkema
Browse files
Instantiate hpib port on first use
parent
df524331
Changes
1
Hide whitespace changes
Inline
Side-by-side
camrasdevices.py
View file @
f7d6a7f4
import
hpib
from
hpib
import
HpibDevice
_port
=
hpib
.
PrologixGpibUsb
()
import
threading
class
CamrasHpibDevice
(
HpibDevice
):
"""Wrapper around HPIB commands"""
_CamrasHpibDevice__port
=
None
_CamrasHpibDevice__port_lock
=
threading
.
Lock
()
def
__init__
(
self
,
address
):
if
not
CamrasHpibDevice
.
_CamrasHpibDevice__port
:
with
CamrasHpibDevice
.
_CamrasHpibDevice__port_lock
:
_port
=
hpib
.
PrologixGpibUsb
()
super
(
CamrasHpibDevice
,
self
).
__init__
(
address
,
_port
)
self
.
__frequency
=
0
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment