forked from M-Labs/artiq
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()
|
args = get_argparser().parse_args()
|
||||||
init_logger(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)
|
dev = Novatech409B(args.device if not args.simulation else None)
|
||||||
try:
|
try:
|
||||||
simple_server_loop(
|
simple_server_loop(
|
||||||
|
|
|
@ -27,6 +27,12 @@ def main():
|
||||||
args = get_argparser().parse_args()
|
args = get_argparser().parse_args()
|
||||||
init_logger(args)
|
init_logger(args)
|
||||||
port = None
|
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:
|
if args.simulation:
|
||||||
port = open(args.dump, "wb")
|
port = open(args.dump, "wb")
|
||||||
dev = Pdq2(url=args.device, dev=port)
|
dev = Pdq2(url=args.device, dev=port)
|
||||||
|
|
|
@ -25,6 +25,11 @@ def main():
|
||||||
args = get_argparser().parse_args()
|
args = get_argparser().parse_args()
|
||||||
init_logger(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:
|
if args.simulation:
|
||||||
daq = DAQmxSim()
|
daq = DAQmxSim()
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -26,6 +26,11 @@ def main():
|
||||||
args = get_argparser().parse_args()
|
args = get_argparser().parse_args()
|
||||||
init_logger(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.simulation:
|
||||||
if args.product == "TDC001":
|
if args.product == "TDC001":
|
||||||
dev = TdcSim()
|
dev = TdcSim()
|
||||||
|
|
Loading…
Reference in New Issue