function to read one sample
Definition at line 182 of file pdasread.cc.
References DATRW_abort, FtypeGAINRANGED, FtypeINT, and FtypeLONG.
Referenced by countdata(), and readdata().
193 if (is.eof())
throw FoundEOF();
194 is.get(lbyte.inchar);
195 if (is.eof())
throw FoundEOF();
196 is.get(hbyte.inchar);
197 invalue=int(lbyte.byte)+256*int(hbyte.byte);
198 if (
int(hbyte.byte)>127)
199 { value=
Tvalue(invalue-65536); }
else { value=
Tvalue(invalue); }
207 unsigned char ubyte[4];
210 if (is.eof())
throw FoundEOF();
211 is.get(inval.byte[0]);
212 if (is.eof())
throw FoundEOF();
213 is.get(inval.byte[1]);
214 if (is.eof())
throw FoundEOF();
215 is.get(inval.byte[2]);
216 if (is.eof())
throw FoundEOF();
217 is.get(inval.byte[3]);
226 unsigned char ubyte[2];
229 if (is.eof())
throw FoundEOF();
230 is.get(inval.byte[0]);
231 if (is.eof())
throw FoundEOF();
232 is.get(inval.byte[1]);
233 Short Smantissa=inval;
234 Smantissa.ubyte[0]=(inval.ubyte[0] & 0xFC);
235 int mantissa=Smantissa.ival/4;
236 unsigned short int exponent=(inval.ubyte[0] & 0x03);
237 int shifts=(5-exponent)*3;
238 int factor=(1<<shifts);
239 value=mantissa*factor;
#define DATRW_abort(M)
Abort and give a message.