Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Construct DTD, XML Skeleton File, Property Reader for LoCam. #1

Open
dyerlytle opened this issue Jun 10, 2019 · 1 comment
Open

Construct DTD, XML Skeleton File, Property Reader for LoCam. #1

dyerlytle opened this issue Jun 10, 2019 · 1 comment
Assignees

Comments

@dyerlytle
Copy link
Member

We need a way to construct a set of properties for an ARC Camera Server/Driver using the INDI protocol. The example DTD contained in Elwood Downy's document, "INDI: Instrument-Neutral Distributed Interface" will not work as written with a DTD (I am using "lxml" in python to read, validate, and interpret a test XML skeleton file). This "issue" will provide a place to document progress on this issue as well a place for possible discussion.

@dyerlytle dyerlytle self-assigned this Jun 10, 2019
@astrobokonon
Copy link
Member

Take a look at https://github.com/LowellObservatory/Camelot/blob/master/IWalkTheLine/interloper.py and specifically the constructCMDPacket function to see if that is suitable for now. The gist of it is that I generate the packet by specifying the root/base tag, and then generate an (ordered) dict of the actual contents. That ordered dict is then magically un-dicted and turned into an XML object via xmltodict.unparse() which is then sent across the broker.

On the other side, I parse the packet from the broker using a custom listener (https://github.com/LowellObservatory/Camelot/blob/master/IWalkTheLine/listener.py) that routes the topic to a parser, which unpacks it using the python package xmlschema using the schema at https://github.com/LowellObservatory/ligmos/blob/master/ligmos/schemas/MrFreeze.cmd.xsd.

I actually made the unparsed packet, then used https://github.com/wiztools/xsd-gen/releases to generate the schema and adjust it as needed, mostly because I'm super lazy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants