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

Add testing of rs232.SerialData #164

Merged
merged 13 commits into from
Dec 4, 2017

Conversation

jamessynge
Copy link
Contributor

This is a re-do of PR #147 after merging in the big changes from develop.

# Properties have been set to reasonable values, ready to open the port.
self.ser.open()

# TODO(jamessynge): Consider eliminating this sleep period, or making
Copy link
Member

Choose a reason for hiding this comment

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

I still need to dig back through my notes about why the delay is there in the first place but would prefer to capture these TODOs in an Issue unless it will be resolved as part of this PR>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah. Sorry, I'm in the habit of capturing these things in the code where their context is readily apparent.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Issue added, TODO removed.

"""
assert not self._start_needed
Copy link
Member

Choose a reason for hiding this comment

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

I don't see where this comes from or get what it is doing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed.

# (i.e. toss out any buffered input, and then read the next full line...
# which likely requires tossing out a fragment of a line).
count = self.ser.in_waiting
self.ser.reset_input_buffer()
# self.logger.debug('Cleared {} bytes from buffer'.format(count))
Copy link
Member

Choose a reason for hiding this comment

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

IIRC this was generating too many log entries and so was commented out. Could consider eliminating along with count variable above.

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 can do so now if you like.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, let's get rid of it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.


# Not worrying here about bytes arriving between reading in_waiting
# and calling reset_input_buffer().
# Note that Wilfred reports that the Arduino input can seriously lag behind
Copy link
Member

Choose a reason for hiding this comment

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

The lag of 10 seconds would probably apply more to the output buffer. Once it is lagging the only way to catch-up would be to clear output buffer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

output meaning writing from POCS to the Arduino? That sounds like a flush call needs to be made on the device to ensure it is making it out of buffers and into the OS.

Copy link
Member

Choose a reason for hiding this comment

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

Output meaning from the Arduino to POCS. Unless we connect to and start reading from the arduino immediately after it is reset the sensor readings lag behind.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let's try to be specific when we use the words input and output (I wasn't sufficiently in the comment). So, "input from Arduino" rather than "Arduino input", which was ambiguous; or "POCS output to the mount".

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've updated the comment accordingly.

@codecov
Copy link

codecov bot commented Dec 3, 2017

Codecov Report

Merging #164 into develop will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           develop    #164   +/-   ##
=======================================
  Coverage     80.6%   80.6%           
=======================================
  Files           36      36           
  Lines         2527    2527           
  Branches       319     319           
=======================================
  Hits          2037    2037           
  Misses         386     386           
  Partials       104     104

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a436f2a...1fd8969. Read the comment docs.

@wtgee
Copy link
Member

wtgee commented Dec 3, 2017

With a big addition to this I would like to get into the habit of adding a quick user-friendly entry to the Changelog.md file. This should be added to the Unreleased section. Can you add something for the PR? Thanks!

@jamessynge
Copy link
Contributor Author

Added Changelog.md. Will test and push.

@jamessynge
Copy link
Contributor Author

PTAL

Changelog.md Outdated
@@ -1,5 +1,12 @@
## [Unreleased]

- PR#164 (no sha yet)
Copy link
Member

Choose a reason for hiding this comment

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

I guess we should first clarify what the purpose of the changelog is. I'm mostly following http://keepachangelog.com/en/0.3.0/

I don't think we care about the PR or the SHA. Things like "...doesn't hide exceptions..." also seem like too much detail for how I think about this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

Copy link
Member

@wtgee wtgee left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM

@wtgee wtgee merged commit b4e5b8d into panoptes:develop Dec 4, 2017
@jamessynge jamessynge deleted the new-pyserial-test-handler branch December 20, 2017 21:23
@wtgee wtgee mentioned this pull request Dec 29, 2017
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.

2 participants