Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
A
ADC Testing
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
ADC Testing
Commits
23311255
Commit
23311255
authored
Aug 25, 2011
by
Federico Asara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PAIN removed.
parent
e8b5eb0e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
0 additions
and
656 deletions
+0
-656
Sis33.py
Pain/ADC/Sis33.py
+0
-448
Agilent33250A.py
Pain/Agilent33250A/Agilent33250A.py
+0
-59
SineWaveform.py
Pain/Agilent33250A/SineWaveform.py
+0
-12
__init__.py
Pain/Agilent33250A/__init__.py
+0
-5
Generator.py
Pain/Generic/Generator.py
+0
-44
SineWaveform.py
Pain/Generic/SineWaveform.py
+0
-70
Waveform.py
Pain/Generic/Waveform.py
+0
-8
__init__.py
Pain/Generic/__init__.py
+0
-5
__init__.py
Pain/__init__.py
+0
-5
No files found.
Pain/ADC/Sis33.py
deleted
100644 → 0
View file @
e8b5eb0e
This diff is collapsed.
Click to expand it.
Pain/Agilent33250A/Agilent33250A.py
deleted
100644 → 0
View file @
e8b5eb0e
import
Generic.Generator
as
gen
import
time
from
SineWaveform
import
*
def
Property
(
func
):
return
property
(
**
func
())
"""This class should manage the Agilent 33250A waveform generator"""
class
Agilent33250A
(
gen
.
Generator
):
def
__init__
(
self
,
device
=
"/dev/ttyUSB0"
,
bauds
=
57600
,
to
=
2
,
interCharTimeout
=
1
):
gen
.
Generator
.
__init__
(
self
,
device
=
device
,
bauds
=
bauds
,
to
=
to
,
interCharTimeout
=
interCharTimeout
)
def
command
(
self
,
what
):
if
type
(
what
)
is
str
:
what
=
(
what
,
)
return
sum
(
map
(
lambda
x
:
self
.
write
(
"
%
s
\n
"
%
x
),
what
))
@
Property
def
output
():
doc
=
"Output status of the generator"
def
fget
(
self
):
self
.
command
(
"OUTP?"
)
output
=
self
.
read
(
2
)[
0
]
return
output
==
"1"
def
fset
(
self
,
status
):
if
type
(
status
)
is
not
bool
:
return
self
.
command
(
"OUTP
%
d"
%
(
1
if
status
else
0
))
return
locals
()
# legacy
def
lsine
(
self
,
frequency
,
amplitude
,
dc
=
0
,
freqm
=
'HZ'
,
ampm
=
'VPP'
,
dcm
=
'V'
):
self
.
command
(
"APPL:SIN
%.2
f
%
s,
%.2
f
%
s,
%.2
f
%
s"
%
(
frequency
,
freqm
,
amplitude
,
ampm
,
dc
,
dcm
))
def
sweep
(
self
,
interval
,
waves
,
callback
=
None
):
for
w
in
waves
:
self
.
command
(
w
.
apply
())
time
.
sleep
(
interval
)
if
callback
is
not
None
:
callback
(
f
)
# legacy
def
lsweep
(
self
,
interval
,
frequencies
,
amplitude
,
dc
=
0
,
freqm
=
'HZ'
,
ampm
=
'VPP'
,
dcm
=
'V'
,
callback
=
None
):
for
f
in
frequencies
:
self
.
sine
(
f
,
amplitude
,
dc
,
freqm
,
ampm
,
dcm
)
time
.
sleep
(
interval
)
if
callback
is
not
None
:
callback
(
f
)
Pain/Agilent33250A/SineWaveform.py
deleted
100644 → 0
View file @
e8b5eb0e
import
Generic.SineWaveform
as
sw
class
SineWaveform
(
sw
.
SineWaveform
):
def
apply
(
self
):
return
"APPL:SIN
%
f
%
s,
%
f
%
s,
%
f
%
s"
%
(
self
.
_freq
[
0
],
self
.
_freq
[
1
],
\
self
.
_amp
[
0
],
self
.
_amp
[
1
],
\
self
.
_dc
[
0
],
self
.
_dc
[
1
])
Pain/Agilent33250A/__init__.py
deleted
100644 → 0
View file @
e8b5eb0e
__author__
=
"Federico"
__date__
=
"$Aug 17, 2011 4:43:08 PM$"
# PAIn: Python ADC Interface
Pain/Generic/Generator.py
deleted
100644 → 0
View file @
e8b5eb0e
import
serial
import
time
def
Property
(
func
):
return
property
(
**
func
())
"""This class should manage a generic waveform generator"""
class
Generator
(
serial
.
Serial
):
def
__init__
(
self
,
device
=
"/dev/ttyUSB0"
,
bauds
=
57600
,
to
=
2
,
interCharTimeout
=
1
):
serial
.
Serial
.
__init__
(
self
,
device
,
bauds
,
timeout
=
to
,
interCharTimeout
=
1
)
def
command
(
self
,
what
):
return
self
.
write
(
"
%
s
\n
"
%
what
)
@
Property
def
output
():
doc
=
"Output status of the generator"
def
fget
(
self
):
self
.
command
(
"OUTP?"
)
output
=
self
.
read
(
2
)[
0
]
return
output
==
"1"
def
fset
(
self
,
status
):
if
type
(
status
)
is
not
bool
:
return
self
.
command
(
"OUTP
%
d"
%
(
1
if
status
else
0
))
return
locals
()
def
sine
(
self
,
frequency
,
amplitude
,
dc
=
0
,
freqm
=
'HZ'
,
ampm
=
'VPP'
,
dcm
=
'V'
):
self
.
command
(
"APPL:SIN
%.2
f
%
s,
%.2
f
%
s,
%.2
f
%
s"
%
(
frequency
,
freqm
,
amplitude
,
ampm
,
dc
,
dcm
))
def
sweep
(
self
,
interval
,
frequencies
,
amplitude
,
dc
=
0
,
freqm
=
'HZ'
,
ampm
=
'VPP'
,
dcm
=
'V'
,
callback
=
None
):
for
f
in
frequencies
:
self
.
sine
(
f
,
amplitude
,
dc
,
freqm
,
ampm
,
dcm
)
time
.
sleep
(
interval
)
if
callback
is
not
None
:
callback
(
f
)
Pain/Generic/SineWaveform.py
deleted
100644 → 0
View file @
e8b5eb0e
import
Waveform
def
Property
(
func
):
return
property
(
**
func
())
def
parse
(
value
,
s
):
if
type
(
value
)
is
str
:
value
=
value
.
split
(
" "
)
value
[
0
]
=
float
(
value
[
0
])
value
=
tuple
(
value
)
if
type
(
value
)
is
tuple
and
len
(
value
)
==
1
:
value
=
value
[
0
]
if
type
(
value
)
is
not
tuple
:
return
(
value
,
s
)
else
:
return
value
class
SineWaveform
(
Waveform
.
Waveform
):
def
apply
(
self
):
return
""
_freq
=
(
1
,
'KHZ'
);
_amp
=
(
0.1
,
'VPP'
);
_dc
=
(
0
,
'V'
);
@
Property
def
frequency
():
doc
=
"Frequency of the sinewave"
def
fget
(
self
):
return
self
.
_freq
def
fset
(
self
,
value
):
self
.
_freq
=
parse
(
value
,
'HZ'
)
def
fdel
(
self
):
del
self
.
_freq
return
locals
()
@
Property
def
amplitude
():
doc
=
"Amplitude of the sinewave"
def
fget
(
self
):
return
self
.
_amp
def
fset
(
self
,
value
):
self
.
_amp
=
parse
(
value
,
'HZ'
)
def
fdel
(
self
):
del
self
.
_amp
return
locals
()
@
Property
def
dc
():
doc
=
"Amplitude of the sinewave"
def
fget
(
self
):
return
self
.
_dc
def
fset
(
self
,
value
):
self
.
_dc
=
parse
(
value
,
'HZ'
)
def
fdel
(
self
):
del
self
.
_dc
return
locals
()
Pain/Generic/Waveform.py
deleted
100644 → 0
View file @
e8b5eb0e
def
Property
(
func
):
return
property
(
**
func
())
class
Waveform
(
object
):
def
apply
(
self
):
return
""
Pain/Generic/__init__.py
deleted
100644 → 0
View file @
e8b5eb0e
__author__
=
"Federico"
__date__
=
"$Aug 17, 2011 4:43:08 PM$"
# PAIn: Python ADC Interface
Pain/__init__.py
deleted
100644 → 0
View file @
e8b5eb0e
__author__
=
"Federico"
__date__
=
"$Aug 17, 2011 4:43:08 PM$"
# PAIn: Python ADC Interface
Write
Preview
Markdown
is supported
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