mirror of https://github.com/m-labs/artiq.git
controllers: enforce the usage of either --simulation or --device
This commit is contained in:
parent
515aa96819
commit
a73776bd72
|
@ -31,6 +31,11 @@ def main():
|
|||
args = get_argparser().parse_args()
|
||||
init_logger(args)
|
||||
|
||||
if not args.simulation and args.device is None:
|
||||
raise ValueError("You need to specify either --simulation or "
|
||||
"-d/--device argument. Use --help for more "
|
||||
"information.")
|
||||
|
||||
dev = Novatech409B(args.device if not args.simulation else None)
|
||||
try:
|
||||
simple_server_loop(
|
||||
|
|
|
@ -27,6 +27,12 @@ def main():
|
|||
args = get_argparser().parse_args()
|
||||
init_logger(args)
|
||||
port = None
|
||||
|
||||
if not args.simulation and args.device is None:
|
||||
raise ValueError("You need to specify either --simulation or "
|
||||
"-d/--device argument. Use --help for more "
|
||||
"information.")
|
||||
|
||||
if args.simulation:
|
||||
port = open(args.dump, "wb")
|
||||
dev = Pdq2(url=args.device, dev=port)
|
||||
|
|
|
@ -25,6 +25,11 @@ def main():
|
|||
args = get_argparser().parse_args()
|
||||
init_logger(args)
|
||||
|
||||
if not args.simulation and args.channels is None:
|
||||
raise ValueError("You need to specify either --simulation or "
|
||||
"-C/--channels argument. Use --help for more "
|
||||
"information.")
|
||||
|
||||
if args.simulation:
|
||||
daq = DAQmxSim()
|
||||
else:
|
||||
|
|
|
@ -26,6 +26,11 @@ def main():
|
|||
args = get_argparser().parse_args()
|
||||
init_logger(args)
|
||||
|
||||
if not args.simulation and args.device is None:
|
||||
raise ValueError("You need to specify either --simulation or "
|
||||
"-d/--device argument. Use --help for more "
|
||||
"information.")
|
||||
|
||||
if args.simulation:
|
||||
if args.product == "TDC001":
|
||||
dev = TdcSim()
|
||||
|
|
Loading…
Reference in New Issue