Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
artiq_experiments
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
artiq_experiments
Commits
ce11254f
Commit
ce11254f
authored
Jul 01, 2021
by
Lucas Giardino
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test de scheduler para submittear experimentos
parent
687c2e72
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
0 deletions
+72
-0
scheduler_interrupt_test.py
...ster/repository/Examples/Misc/scheduler_interrupt_test.py
+41
-0
turn_lasers_on.py
artiq_master/repository/Experiments/turn_lasers_on.py
+31
-0
No files found.
artiq_master/repository/Examples/Misc/scheduler_interrupt_test.py
0 → 100644
View file @
ce11254f
from
artiq.experiment
import
*
from
time
import
sleep
class
SchedulerInterruptTest
(
EnvExperiment
):
"""Scheduler/Interruption Test"""
def
build
(
self
):
self
.
setattr_device
(
"scheduler"
)
self
.
N
=
0
def
run
(
self
):
expid_1
=
{
"file"
:
"Experiments/turn_lasers_on.py"
,
"class_name"
:
"TurnOnLasers"
,
"arguments"
:
{},
"log_level"
:
self
.
scheduler
.
expid
[
"log_level"
],
"repo_rev"
:
self
.
scheduler
.
expid
[
"repo_rev"
],
}
try
:
while
True
:
## Opcion 1: Input en terminal
# self.turn_on()
# self.wait_for_go()
## Opcion 2: Scheduler
if
not
self
.
scheduler
.
check_pause
():
self
.
turn_on
()
self
.
scheduler
.
submit
(
"main"
,
expid_1
,
priority
=
10
)
sleep
(
0.5
)
# Ojo con esto, que podes programar muchas corridas a futuro
self
.
scheduler
.
pause
()
except
TerminationRequested
:
print
(
"
\t\t
OFF WITH THE LASERS"
)
def
turn_on
(
self
):
print
(
f
">>>>>> Medicion {self.N}"
)
self
.
N
+=
1
# sleep(1)
def
wait_for_go
(
self
):
while
input
(
"GO? "
)
!=
'go'
:
pass
self
.
scheduler
.
pause
()
artiq_master/repository/Experiments/turn_lasers_on.py
0 → 100644
View file @
ce11254f
from
artiq.experiment
import
*
from
pyLIAF.artiq.controllers
import
UrukulCh
from
time
import
sleep
class
TurnOnLasers
(
EnvExperiment
):
"""Turn on IR and UV lasers and Hold"""
def
build
(
self
):
self
.
setattr_device
(
"core"
)
self
.
setattr_device
(
"scheduler"
)
self
.
laserUV
=
UrukulCh
(
self
,
ch
=
2
,
freq
=
110.0
,
amp
=
0.3
,
name
=
"UV"
)
#corresponde a 0.7 Vpp
self
.
laserIR
=
UrukulCh
(
self
,
ch
=
1
,
freq
=
208.0
,
amp
=
0.35
,
name
=
"IR"
)
#corresponde a 0.8 Vpp
def
run
(
self
):
try
:
self
.
turn_on
()
while
True
:
self
.
scheduler
.
pause
()
# posible punto de pausa del programa
sleep
(
0.5
)
except
TerminationRequested
:
print
(
"LIBERO LASERES"
)
# Para testear, sin el artiq
# def turn_on(self):
# print("PRENDO LASERES")
@
kernel
def
turn_on
(
self
):
self
.
core
.
break_realtime
()
self
.
laserUV
.
on
()
self
.
laserIR
.
on
()
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