00001 #ifndef _MTUFORMAT_INCLUDED_
00002 #define _MTUFORMAT_INCLUDED_
00003 #include "TimeSeries.h"
00004
00005 #include <string>
00006 #include <fstream>
00007
00008
00009
00010
00011 class MtuFormat : public TimeSeries{
00012 private:
00013 char startsec;
00014 char startmin;
00015 char starthr;
00016 char startday;
00017 char startmonth;
00018 char startyear;
00019 char startdow;
00020 char startcentury;
00021 int serialnumber;
00022 int nscans;
00023 char nchannels;
00024 char taglength;
00025 char status;
00026 char saturationflags;
00027 char futurereserved;
00028 double sampledenom;
00029 double sampleenum;
00030 char sampleunit;
00031 char samplelength;
00032 char rateunit;
00033 char clockstatus;
00034 int clockerror;
00035 char reserved[6];
00036
00037 void ReadRecord(std::ifstream &infile);
00038
00039 void WriteNum(double number, std::ofstream &outfile);
00040
00041 int ByteToInt(unsigned char first, unsigned char second, unsigned char last);
00042
00043 void ReadValue(TimeSeriesComponent &CurrChannel, char *pos);
00044
00045 void UpDateHeader(unsigned char *&header, const int firstscan);
00046 public:
00047
00048 void MakeGood();
00049 MtuFormat();
00050 virtual ~MtuFormat();
00051 virtual void GetData(const std::string filename);
00052 virtual void GetData();
00053 virtual void WriteData(const std::string filename);
00054 MtuFormat& operator=(MtuFormat &source);
00055 MtuFormat& operator=(TimeSeries &source);
00056 };
00057
00058
00059 #endif