Skip to content

Commit

Permalink
hcam set was cancelling the reset flag incorrectly
Browse files Browse the repository at this point in the history
causing problems with hlogger.
  • Loading branch information
Tom Marsh committed Jun 2, 2021
1 parent 5a53107 commit c250ffc
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions hipercam/hcam.py
Original file line number Diff line number Diff line change
Expand Up @@ -1422,7 +1422,7 @@ def __call__(self, nframe=None):
Arguments::
nframe : int | none
nframe : int | None
frame number to get, starting at 1. 0 for the last (complete)
frame. 'None' indicates that the next frame is wanted.
Expand Down Expand Up @@ -1472,30 +1472,31 @@ def __call__(self, nframe=None):

# update the internal frame counter
self.nframe += 1

# set the reset status to save effort if next time
# we simply want the next frame
self.reset = False

return tbytes

def set(self, nframe=1):
"""Resets the position so that we are just about to read
the timing data of nframe, but does not read them unlike
__call__
__call__. Set the internal "reset" flag if needed.
Arguments::
nframe : int | none
nframe : int | None
frame number to get, starting at 1. 0 for the last (complete)
frame. 'None' indicates that the next frame is wanted.
frame. 'None' indicates just read whatever is the next frame.
Returns:: the timing bytes of the frame
Returns:: the frame number of entry
"""

old_frame = self.nframe

if nframe is None:
# just read whatever frame we are now on
self.reset = False
else:
if nframe is not None:

if nframe == 0:
# go for the last one
nframe = self.ntotal()
Expand Down

0 comments on commit c250ffc

Please sign in to comment.