Skip to content
This repository has been archived by the owner on Oct 14, 2022. It is now read-only.

Commit

Permalink
use sipyco
Browse files Browse the repository at this point in the history
  • Loading branch information
sbourdeauducq committed Nov 7, 2019
1 parent 7bc1911 commit 9f6092b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
15 changes: 6 additions & 9 deletions newfocus8742/aqctl_newfocus8742.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import os
import asyncio

from artiq.protocols.pc_rpc import simple_server_loop
from artiq import tools
from sipyco.pc_rpc import simple_server_loop
from sipyco import common_args


def get_argparser():
Expand All @@ -15,17 +15,14 @@ def get_argparser():
parser.add_argument("--simulation", action="store_true",
help="simulation device")

tools.simple_network_args(parser, 3257)
if hasattr(tools, "add_common_args"):
tools.add_common_args(parser) # ARTIQ-5
else:
tools.verbosity_args(parser) # ARTIQ-4
common_args.simple_network_args(parser, 3257)
common_args.verbosity_args(parser)
return parser


def main():
args = get_argparser().parse_args()
tools.init_logger(args)
common_args.init_logger_from_args(args)

if os.name == "nt":
asyncio.set_event_loop(asyncio.ProactorEventLoop())
Expand All @@ -43,7 +40,7 @@ def main():

try:
simple_server_loop({"newfocus8742": dev},
tools.bind_address_from_args(args), args.port)
common_args.bind_address_from_args(args), args.port)
except KeyboardInterrupt:
pass
finally:
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name="newfocus8742",
version="0.1",
version="0.2",
description="Driver for New Focus/Newport 8742 four channel open loop "
"piezo motor controller",
long_description=open("README.rst").read(),
Expand All @@ -15,7 +15,7 @@
url="https://github.com/quartiq/newfocus8742",
download_url="https://github.com/quartiq/newfocus8742",
packages=find_packages(),
install_requires=[],
install_requires=["sipyco"],
entry_points={
"console_scripts": [
"aqctl_newfocus8742 = newfocus8742.aqctl_newfocus8742:main",
Expand Down

0 comments on commit 9f6092b

Please sign in to comment.