TNG2
The TNG2 device is a bend sensor recording device developed by Salomo at the
Institute for Interventional Informatics. When it has finished recording, it can
be attached to a computer serial port, and the information it provides can be downloaded.
NeatToolsModule
|
+-- InputDevice
|
+-- FramedInput
|
+-- TNG2
Input streams
1 byte stream, byteStream inherited from FramedInput.
Output streams
8 byte streams: channel[0],..,channel[7] and
1 boolean stream frameSynch inherited from FramedInput.
Fields
none
Methods
- startUp() -- opens the associated input stream. If the associated input stream
is a SerialPortInput stream, sends the string "START" to that serial port.
If successful, sets the Input Device "running" field to true.
- shutDown() -- closes the associated input streams if it was opened,
Unconditionally sets the Input Device "running" field to false.
- update() -- reads data from the input stream, places it in the output streams. Keeps
track of bad frames read. Automatically calls "shutDown" when no data has been read for
3 seconds, or if the input stream has shut itself down.
- protected final boolean startFrameFound() -- searches the inputBuffer for the frame delimitter
byte 0xff.
If found, sets the startFrameOffset to the offset it was found and returns true.
Otherwise returns false.
- protected final boolean endFrameFound() -- searches the inputBuffer starting at startOffset+1
for the frame delimitter byte 0xff.
If found sets endFrameOffset to the offset it was
found, increments goodFrameCount and returns true. Otherwise returns false. If the frame delimitter is not found
at the correct location (startOffset+8), updates inputBuffer to skip
badly formatted frame and updates badFrameCount.
- protected final void updateOutputStreams() -- sets channel[0] to inputBuffer[startOffset+1], etc.
Then updates the inputBuffer so that the first unprocessed byte is endOffset.
(Currently the DOS Neat software makes the first unprocessed byte endOffset+1,
which results in skipping every other frame).