Java Reference
In-Depth Information
PrintStream fPortOutStream;
// This array and streams are used to convert a stream
// of bytes to primitive type values.
byte[] fByteArray;
ByteArrayInputStream fByteIn;
DataInputStream fDataIn;
// Values are returned as text to the fParent that
// implements the Outputable interface.
Outputable fParent;
// Use for text from device.
StringBuffer fStrBuf = new StringBuffer ();
// Data taking parameters
// flag for the data taking thread
boolean fTakeData
=
false;
int fPauseTime
=
1000;
// Data description and info
String fDataDescription
="
Temperature
"
;
double fSlope
=
0.5;
double fOffset
=
0.0;
String fDataUnit ="C";
/**
* Constructor
* @param fParent implements the Outputable interface
* for print output.
* @param rate is the data taking rate in number of
* values per second.
*/
public GetJavelinData (Outputable parent, int rate) {
fParent = parent;
fPauseTime = 1000/rate; // Pause time in milliseconds
// Set up the byte array and streams for converting
// bytes to an int primitive value.
fByteArray
=
new byte[4];
fByteIn
=
new ByteArrayInputStream (fByteArray);
fDataIn
=
new DataInputStream (fByteIn);
}
// ctor
/** Obtain streams for the serial lines. **/
Search WWH ::
Custom Search