Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00056 #ifndef __DISTRIBINTERP_HPP__
00057 #define __DISTRIBINTERP_HPP__
00058
00059 #include <map>
00060 #include <openfluid/dllexport.hpp>
00061 #include <openfluid/core/DateTime.hpp>
00062
00063 namespace openfluid {
00064 namespace core {
00065 class DoubleValue;
00066 }
00067 }
00068
00069 namespace openfluid { namespace tools {
00070
00071 class DateTimeSerie;
00072 class IndexedSerie;
00073
00074 typedef std::map<int,DateTimeSerie*> DTSeriesMap;
00075 typedef std::map<int,DateTimeSerie*> UnitsDTSeriesMap;
00076 typedef std::map<int,IndexedSerie*> IndexedSeriesMap;
00077 typedef std::map<int,IndexedSerie*> UnitsIndexedSeriesMap;
00078
00079
00080
00081 enum SeriePreprocess
00082 {
00083 SERIEPREPCS_NONE,
00084 SERIEPREPCS_CUMULATE
00085 };
00086
00090 class DLLEXPORT DistributeInterpolate
00091 {
00092
00093 private:
00094
00095 DTSeriesMap m_InterpData;
00096 IndexedSeriesMap m_InterpIndexedData;
00097 UnitsDTSeriesMap m_UnitsData;
00098 UnitsIndexedSeriesMap m_UnitsIndexedData;
00099
00100
00101 std::string m_DataSourcesFilename;
00102 std::string m_DataDir;
00103 std::string m_DistributionFilename;
00104 SeriePreprocess m_SPpcs;
00105 openfluid::core::DateTime m_Begin;
00106 openfluid::core::DateTime m_End;
00107 int m_TimeStep;
00108
00109 bool m_Configured;
00110
00111 bool loadDataAsSerie(std::string FilePath, SeriePreprocess SPpcs, DateTimeSerie *Serie);
00112
00113 bool loadDistributionAndDistribute(std::string FilePath);
00114
00115 public:
00116 DistributeInterpolate();
00117
00118 void setConfig(std::string DataDir, std::string DataSourcesFilename, std::string DistributionFilename, SeriePreprocess SPpcs,
00119 openfluid::core::DateTime Begin,openfluid::core::DateTime End, int TimeStep);
00120
00121 bool loadAndPrepareData();
00122
00123 bool getValue(int ID, openfluid::core::DateTime DT, openfluid::core::DoubleValue *Value);
00124
00125 bool getValue(int ID, int Index, openfluid::core::DoubleValue *Value);
00126
00127 virtual ~DistributeInterpolate();
00128 };
00129
00130 } }
00131
00132
00133 #endif
00134