Given a DFSR the FrameSetPlan gives offsets to any part of the Logical Record for any frame and channel.
Specialisation of exception for FrameSetPlan.
Specialisation of exception for negative/too small length arguments to FrameSetPlan.
Exception channel number greater than available.
Read event
Skip event
Extrapolate event
Given a DFSR the FrameSetPlan gives offsets to any part of the frame set within a Logical Record.
NOTE: All offsets, lengths etc. are relative to the end of the LRH i.e. add LR_HEADER_LENGTH to get absolute Logical Data position.
The size, in bytes of the indirect X axis value. 0 for explicit X axis.
Frame size in bytes.
Number of channels.
Returns the number of frames that will fit into the record length. May raise a ExceptionFrameSetPlan. May raise ExceptionFrameSetPlanNegLen if arguments are negative.
NOTE: record length should not include size of LRH.
Returns the offset into the LR (after LRH) to the start of a particular channel and frame.
Will raise ExceptionFrameSetPlanNegLen if arguments are negative or an IndexError if ch out of range.
Returns the skip distance into the LR to the end of frame after a particular channel.
Yields an indefinite set of (frame, channel, offset) values for the set of channels. Will raise ExceptionFrameSetPlanNegLen if any channel negative. Will raise KeyError if any channel index is out of range.
list of weak references to the object (if defined)
For a single Logical Record type 0/1 this yields an set of events.
theFSlice is a frame slice object (default start=0, step=1), step 0 is interpreted as step 1.
theChIndexS is as list of indexes of channels that need to be read.
The events are 5 member tuples: (event_type, size, frame, channel_start, channel_stop)
event_type is ‘skip’ or ‘read’ or ‘extrapolate’:
skip: (‘skip’, size, frame_number, channel_start, channel_stop)
read: (‘read’, size, frame_number, channel_start, channel_stop)
extrapolate: (‘extrapolate’, frames, frame_number, None, None)
NOTE: No ‘seek’, 0, ... events are generated.
size is the number of bytes to read or skip or, for ‘extrapolate’ the number of frames to extrapolate the implied X axis.
frame_number is the frame number in the predicted Logical Record.
In the case of ‘skip’ or ‘extrapolate’ its is the frame number in the Logical Record being moved to. The frame number can be None if there is no prediction, for example when reading an indirect X at the beginning of an LR.
channel_start, channel_stop are the channel numbers (inclusive) in the DFSR DSB block None being the indirect X axis.
Thus: (‘read’, size, frame_number, None, 3) Means read size bytes and interpret them as channels: None, 0, 1, 2, 3. ‘extrapolate’ events mean project the Xaxis forward by the specified number of frames (this will not be bestrided with two seek events but preceded or followed by a single seek event (if any). ‘read’ and ‘seek’ events are synchronous as are ‘read’ and ‘extrapolate’. However ‘seek’ and ‘extrapolate’ are asynchronous i.e. ‘seek’-‘extrapolate’ is equivalent to ‘extrapolate’-‘seek’.
Will raise ExceptionFrameSetPlanNegLen if any channel negative or fStop < fStart. Will raise IndexError if any channel index is out of range.
Be aware: This code is tricky.