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

Refactor of PR #56 #60

Merged
merged 36 commits into from Jan 24, 2016
Merged

Refactor of PR #56 #60

merged 36 commits into from Jan 24, 2016

Conversation

scasagrande
Copy link
Contributor

  • Adds support for instruments to respond with an "acknowledgement" string via _ack_expected function
  • Adds support for instruments to send a "prompt" string (eg ">") after finishing with a previous command
  • Add Thorlabs TC200
  • Refactor Thorlabs SC10 and LCC25
  • Adds a little bit of value checking for enum, unitful, and bool property factories
  • Includes a few bug fixes

Regarding ack and prompt strings, here is the assumed format:

Sending a command: CMD=1 returns [ack][term][prompt][term]
Sending a query: CMD? returns [ack][term]response term[prompt][term]

if ack_expected is not None:
ack = self.read()
if ack != ack_expected:
raise IOError("Incorrect ACK message received: got {} "
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should make new errors called AckError and PromptError or something. Thoughts what the correct base they should inherit from @cgranade ?

def __init__(self, stdin=None, stdout=None):
AbstractCommunicator.__init__(self)
self._terminator = '\n'
self._stdout = stdout
self._stdin = stdin

## PROPERTIES ##
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just curious - does removing this extra pound sign mess up the sphinx docs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, they were just there to look pretty when looking at the source, but pylint likes to complain about them.

I might disable that rule in a .pylintrc file because I kinda like the ## for visual distinction

But then again I'm lazy and I use autopep8 and its removing it anyways soooooo

@scasagrande
Copy link
Contributor Author

I think we're good now with this PR.

scasagrande added a commit that referenced this pull request Jan 24, 2016
@scasagrande scasagrande merged commit cf32bba into dev Jan 24, 2016
@scasagrande scasagrande deleted the CatherineH-ch-tc200 branch January 24, 2016 21:25
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

Successfully merging this pull request may close these issues.

None yet

2 participants