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