2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-26 03:38:25 +08:00
artiq/examples/master/repository/arguments_demo.py

22 lines
721 B
Python
Raw Normal View History

2015-07-18 22:25:08 +08:00
from artiq import *
class ArgumentsDemo(EnvExperiment):
def build(self):
self.attr_argument("free_value", FreeValue(None))
self.attr_argument("boolean", BooleanValue(True))
self.attr_argument("enum", EnumerationValue(
["foo", "bar", "quux"], "foo"))
self.attr_argument("number", NumberValue(42, unit="s", step=0.1))
self.attr_argument("string", StringValue("Hello World"))
2015-07-21 23:23:32 +08:00
self.attr_argument("scan", Scannable(global_max=400, default=NoScan(325)))
2015-07-18 22:25:08 +08:00
def run(self):
print(self.free_value)
print(self.boolean)
print(self.enum)
print(self.number)
print(self.string)
2015-07-21 23:23:32 +08:00
for i in self.scan:
print(i)