00001
00002
00003
00004
00005
00006 #ifndef __PPFDATATYPE_HPP__
00007 #define __PPFDATATYPE_HPP__
00008
00009 #include <vector>
00010 #include <string>
00011 #include "ppftypes.hpp"
00012
00013 using namespace std;
00014
00015 namespace ppf
00016 {
00017 class system;
00018
00020 class datatype
00021 {
00022
00023
00025 friend class system;
00026
00027 public:
00028
00029
00030
00031
00033 datatype();
00034
00036 ~datatype();
00037
00038
00039
00040
00041
00042
00043
00047 datatype(string filename);
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00070 void readLocal(string filename);
00071
00072
00073
00074
00075
00078 void writeLocal(string filename);
00079
00080
00081
00082
00083
00086 int getTDim();
00087
00090 int getXDim();
00091
00094 string getTUnit();
00095
00098 string getXUnit();
00099
00102 string getDataUnit();
00103
00106 string getComment();
00107
00110 int getUserDTStatus();
00111
00114 int getSysDDAStatus();
00115
00118 int getSysDTStatus();
00119
00120
00121
00125 float getT(int It);
00126
00130 float getX(int Ix);
00131
00136 float getDataIt(int It);
00137
00142 float getDataIx(int Ix);
00143
00148 float getDataItIx(int It, int Ix);
00149
00150
00151
00156 int getIt(float t);
00157
00162 int getIx(float x);
00163
00168 float getDataT(float t);
00169
00176 float getDataT(float t, processflag flag);
00177
00184 coord getDataCT(float t, processflag flag);
00185
00190 float getDataX(float x);
00191
00198 float getDataX(float x, processflag flag);
00199
00206 coord getDataCX(float x, processflag flag);
00207
00213 float getDataTIx(float t, long Ix);
00214
00222 float getDataTIx(float t, long Ix, processflag t_flag);
00223
00231 coord getDataCTIx(float t, long Ix, processflag t_flag);
00232
00238 float getDataItX(long It, float x);
00239
00247 float getDataItX(long It, float x, processflag x_flag);
00248
00256 coord getDataCItX(long It, float x, processflag x_flag);
00257
00263 float getDataTX(float t, float x);
00264
00273 float getDataTX(float t, float x, processflag t_flag, processflag x_flag);
00274
00283 coord getDataCTX(float t, float x, processflag t_flag, processflag x_flag);
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00299 void setT(int It, float v);
00300
00304 void setX(int Ix, float v);
00305
00310 void setDataIt(int It, float v);
00311
00316 void setDataIx(int Ix, float v);
00317
00322 void setDataItIx(int It, int Ix, float v);
00323
00324
00325
00326
00327
00328 private:
00329
00330
00331 vector<float> t;
00332 vector<float> x;
00333 vector<vector<float> > data;
00334 string xunit;
00335 string tunit;
00336 string dataunit;
00337 string comment;
00338 int userdtstatus;
00339 int sysddastatus;
00340 int sysdtstatus;
00341
00342
00343
00344
00345
00359 void findNearest(vector<float> &v, int Imin, int Imax, float f, int &Ilower, int &Iupper);
00360
00369 double interpolateLinear(double p1, double v1, double p2, double v2, double pt);
00370
00381
00382
00391 void getDataTIx(float t, long Ix, processflag t_flag, float &ta, float &v);
00392
00401 void getDataItX(long It, float x, processflag x_flag, float &xa, float &v);
00402
00413 void getDataTX(float t, float x, processflag t_flag, processflag x_flag, float &ta, float &xa, float &v);
00414 };
00415
00416 };
00417
00418
00419 #endif