mirror of
https://github.com/m-labs/artiq.git
synced 2024-12-28 20:53:35 +08:00
example: add interactive args
This commit is contained in:
parent
13a36bf911
commit
329e7189cc
20
artiq/examples/no_hardware/repository/interactive.py
Normal file
20
artiq/examples/no_hardware/repository/interactive.py
Normal file
@ -0,0 +1,20 @@
|
||||
from artiq.experiment import *
|
||||
|
||||
|
||||
class InteractiveDemo(EnvExperiment):
|
||||
def build(self):
|
||||
pass
|
||||
|
||||
def run(self):
|
||||
print("Waiting for user input...")
|
||||
with self.interactive() as interactive:
|
||||
interactive.setattr_argument("number", NumberValue(42e-6,
|
||||
unit="us",
|
||||
precision=4))
|
||||
interactive.setattr_argument("integer", NumberValue(42,
|
||||
step=1, precision=0))
|
||||
interactive.setattr_argument("string", StringValue("Hello World"))
|
||||
print("Done! Values:")
|
||||
print(interactive.number, type(interactive.number))
|
||||
print(interactive.integer, type(interactive.integer))
|
||||
print(interactive.string)
|
Loading…
Reference in New Issue
Block a user