Skip to content

Commit

Permalink
controllers/thorlabs_tcube: accept any case for -P. Closes #150
Browse files Browse the repository at this point in the history
sbourdeauducq committed Oct 21, 2015

Verified

This commit was signed with the committer’s verified signature.
headius Charles Oliver Nutter
1 parent eb546bf commit ec02bea
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions artiq/frontend/thorlabs_tcube_controller.py
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ def get_argparser():
parser = argparse.ArgumentParser()
parser.add_argument("-P", "--product", required=True,
help="type of the Thorlabs T-Cube device to control",
choices=["TDC001", "TPZ001"])
choices=["tdc001", "tpz001"])
parser.add_argument("-d", "--device", default=None,
help="serial device. See documentation for how to "
"specify a USB Serial Number.")
@@ -33,19 +33,20 @@ def main():
"argument. Use --help for more information.")
sys.exit(1)

product = args.product.lower()
if args.simulation:
if args.product == "TDC001":
if product == "tdc001":
dev = TdcSim()
elif args.product == "TPZ001":
elif product == "tpz001":
dev = TpzSim()
else:
if args.product == "TDC001":
if product == "tdc001":
dev = Tdc(args.device)
elif args.product == "TPZ001":
elif product == "tpz001":
dev = Tpz(args.device)

try:
simple_server_loop({args.product.lower(): dev}, args.bind, args.port)
simple_server_loop({product: dev}, args.bind, args.port)
finally:
dev.close()

0 comments on commit ec02bea

Please sign in to comment.