Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Teresa Hönigl-Decrinis
python-repo
Commits
59f1d598
Commit
59f1d598
authored
Jul 21, 2019
by
Christian Schneider
Browse files
Bugfixes
parent
d9ca6ca7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Instruments/Drivers/RohdeSchwarz/FSV30.py
View file @
59f1d598
...
...
@@ -10,7 +10,7 @@ v2.0.1 - OSC:
import
numpy
as
np
import
visa
import
struct
from
Instruments.Drivers
import
dummy
from
Instruments.Drivers
.dummy
import
dummy
class
FSV30
(
object
):
...
...
@@ -25,7 +25,7 @@ class FSV30(object):
"""
# Use dummy driver if testing
if
test
:
self
.
_inst
=
dummy
self
.
_inst
=
dummy
(
ip
)
else
:
rm
=
visa
.
ResourceManager
()
self
.
_inst
=
rm
.
open_resource
(
'TCPIP::{}::INSTR'
.
format
(
ip
)
)
...
...
Instruments/Drivers/Tektronix/RSA5115B.py
View file @
59f1d598
...
...
@@ -12,7 +12,7 @@ import struct
import
time
import
numpy
as
np
import
visa
from
Instruments.Drivers
import
dummy
from
Instruments.Drivers
.dummy
import
dummy
class
RSA5115B
(
object
):
"""Instrument Driver for Tektronix RSA5115B Spectum analyzer"""
...
...
@@ -25,7 +25,7 @@ class RSA5115B(object):
IP of spectrum analyzer
"""
if
test
:
self
.
_inst
=
dummy
self
.
_inst
=
dummy
(
ip
)
else
:
rm
=
visa
.
ResourceManager
()
self
.
_inst
=
rm
.
open_resource
(
'TCPIP::{}::INSTR'
.
format
(
ip
)
)
...
...
@@ -54,7 +54,8 @@ class RSA5115B(object):
return
resp
.
strip
(
'
\n
'
)
else
:
self
.
_inst
.
write
(
"{} {}"
.
format
(
command
,
arg
))
arg
=
"{} {}"
.
format
(
command
,
arg
)
self
.
_inst
.
write
(
arg
)
return
0
def
clear
(
self
):
...
...
Instruments/Drivers/dummy.py
View file @
59f1d598
...
...
@@ -11,14 +11,14 @@ class dummy(object):
"""Dummy instrument for testing
"""
def
__init__
(
self
,
ip
,
reset
=
False
):
def
__init__
(
self
,
ip
):
self
.
version
=
VERSION
self
.
ip
=
ip
def
close
(
self
):
return
0
def
write
(
self
):
def
write
(
self
,
c
):
"""Dummy write: Does nothing"""
return
0
...
...
Instruments/SA.py
View file @
59f1d598
...
...
@@ -56,19 +56,20 @@ class SA(object):
# Device parameters ####################################################
self
.
test
=
False
# Running in test mode?
try
:
if
id_string
in
IPList
:
# Try to find device in IPList
self
.
ip
=
IPList
[
id_string
]
e
xcept
KeyError
:
e
lse
:
# If it is a test, give IP with zeros and set test mode to true
if
id_string
[
-
4
:
-
1
].
lower
()
==
'tes'
:
self
.
ip
=
'0.0.0.0'
self
.
test
=
True
# If SA is not specified by valid IPList entry. Try directly ip
if
driver
is
not
None
:
el
if
driver
is
not
None
:
self
.
ip
=
id_string
else
:
raise
Exception
(
'SA not in IPList. Please specify driver'
)
self
.
CryoID
=
cryostat
self
.
ch
=
1
self
.
id
=
id_string
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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