mirror of
https://github.com/m-labs/artiq.git
synced 2024-12-25 03:08:27 +08:00
examples: add main function
This commit is contained in:
parent
53b259b9a0
commit
2f58cf6aff
@ -32,7 +32,7 @@ class AluminumSpectroscopy(AutoContext):
|
||||
return state_0_count
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
def main():
|
||||
from artiq.sim import devices as sd
|
||||
from artiq.sim import time
|
||||
|
||||
@ -51,3 +51,6 @@ if __name__ == "__main__":
|
||||
)
|
||||
exp.run()
|
||||
print(time.manager.format_timeline())
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
@ -29,7 +29,7 @@ class CompilerTest(AutoContext):
|
||||
self.print_done()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
def main():
|
||||
from artiq.devices import corecom_dummy, core, dds_core
|
||||
|
||||
coredev = core.Core(corecom_dummy.CoreCom())
|
||||
@ -45,3 +45,6 @@ if __name__ == "__main__":
|
||||
reg_channel=3, rtio_channel=3)
|
||||
)
|
||||
exp.run(3, 100*us)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
@ -22,7 +22,7 @@ class DDSTest(AutoContext):
|
||||
self.led.set(0)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
def main():
|
||||
with corecom_serial.CoreCom() as com:
|
||||
coredev = core.Core(com)
|
||||
exp = DDSTest(
|
||||
@ -38,3 +38,6 @@ if __name__ == "__main__":
|
||||
led=gpio_core.GPIOOut(core=coredev, channel=1)
|
||||
)
|
||||
exp.run()
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
@ -38,7 +38,10 @@ class Mandelbrot(AutoContext):
|
||||
self.row()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
def main():
|
||||
with corecom_serial.CoreCom() as com:
|
||||
exp = Mandelbrot(core=core.Core(com))
|
||||
exp.run()
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
@ -35,7 +35,7 @@ class PhotonHistogram(AutoContext):
|
||||
self.report(i, hist[i])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
def main():
|
||||
with corecom_serial.CoreCom() as com:
|
||||
coredev = core.Core(com)
|
||||
exp = PhotonHistogram(
|
||||
@ -49,3 +49,6 @@ if __name__ == "__main__":
|
||||
nbins=100
|
||||
)
|
||||
exp.run()
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
@ -15,7 +15,7 @@ class SimpleSimulation(AutoContext):
|
||||
self.d.pulse(400*MHz, 20*us)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
def main():
|
||||
from artiq.sim import devices as sd
|
||||
from artiq.sim import time
|
||||
|
||||
@ -28,3 +28,6 @@ if __name__ == "__main__":
|
||||
)
|
||||
exp.run()
|
||||
print(time.manager.format_timeline())
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
Loading…
Reference in New Issue
Block a user