Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pyLIAF
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nicolas Nunez Barreto
pyLIAF
Commits
7eacdc4e
Commit
7eacdc4e
authored
Jun 12, 2021
by
Lucas Giardino
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
agrego controladores
parent
8a06f2a3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
0 deletions
+70
-0
Urukul.py
pyLIAF/artiq/_controllers/Urukul.py
+66
-0
__init__.py
pyLIAF/artiq/_controllers/__init__.py
+0
-0
controllers.py
pyLIAF/artiq/controllers.py
+4
-0
No files found.
pyLIAF/artiq/_controllers/Urukul.py
0 → 100644
View file @
7eacdc4e
from
artiq.experiment
import
*
class
UrukulCh
(
HasEnvironment
):
"""Urukul single freq class
Set the frecuencies/amplitudes of each Urukul channel
"""
def
build
(
self
,
ch
=
0
,
freq
=
100.0
,
amp
=
1.0
,
name
=
None
):
self
.
ch
=
ch
self
.
amp
=
amp
self
.
freq
=
freq
self
.
name
=
str
(
name
)
if
name
is
not
None
else
f
'canal_{self.ch}'
self
.
channel
=
self
.
get_device
(
f
"urukul0_ch{self.ch}"
)
### This two attributes will be shown in the GUI grouped by channel
# use/don't use each channel
self
.
state
=
self
.
get_argument
(
f
"state_ch{self.ch}"
,
BooleanValue
(
1
==
0
),
name
)
# each channel's frequency
self
.
frequency
=
self
.
get_argument
(
f
"freq_ch{self.ch}"
,
NumberValue
(
self
.
freq
*
MHz
,
unit
=
'MHz'
,
scale
=
MHz
,
min
=
1
*
MHz
,
max
=
400
*
MHz
),
name
)
# each channel's amplitude
self
.
amplitude
=
self
.
get_argument
(
f
"amp_ch{self.ch}"
,
NumberValue
(
self
.
amp
,
min
=
0.
,
max
=
1.
),
name
)
@
rpc
def
generate_dataset
(
self
):
self
.
set_dataset
(
f
"laser_{self.name}"
,
'{'
+
f
'"freq": {self.frequency}, "amp": {self.amplitude}"'
+
'}'
)
@
kernel
def
initialize_channel
(
self
):
# initialises CPLD the selected channel
self
.
channel
.
cpld
.
init
()
self
.
channel
.
init
()
@
kernel
def
set_channel
(
self
):
self
.
channel
.
set
(
self
.
frequency
,
amplitude
=
self
.
amplitude
)
if
self
.
state
==
True
:
self
.
channel
.
sw
.
on
()
else
:
self
.
channel
.
sw
.
off
()
@
kernel
def
on
(
self
):
self
.
channel
.
sw
.
on
()
@
kernel
def
off
(
self
):
self
.
channel
.
sw
.
off
()
@
kernel
def
set_o
(
self
,
state
):
self
.
channel
.
sw
.
set_o
(
state
)
@
kernel
def
pulse_mu
(
self
,
delay_time_mu
):
self
.
channel
.
sw
.
pulse_mu
(
delay_time_mu
)
@
kernel
def
pulse
(
self
,
delay_time
):
self
.
channel
.
sw
.
pulse
(
delay_time
)
pyLIAF/artiq/_controllers/__init__.py
0 → 100644
View file @
7eacdc4e
pyLIAF/artiq/controllers.py
0 → 100644
View file @
7eacdc4e
from
._controllers.Urukul
import
UrukulCh
__all__
=
[
"UrukulCh"
]
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