00001 #ifndef _IRRIGATIONTABLE_
00002 #include "CommonTable.h"
00003 #include "IrrigationEfficiency.h"
00004
00005 #define _IRRIGATIONTABLE_
00006 class TimeHandler;
00007
00008
00009
00010 #include <iostream>
00011 #include <iomanip>
00012 #include <cstdio>
00013 #include <vector>
00014 #include <string.h>
00015
00016 #include"MatrixDouble.h"
00017 using namespace std;
00018 #define _MAXCHAR_ 200
00019
00020 typedef void (*functionpointer) (int);
00021
00022
00023 class irrigationtabletype
00024 {
00025 public:
00026 int Code;
00027 char *Name;
00028
00029 int methode;
00030 int origin;
00031 double psi_dry,
00032 psi_wet;
00033 int tabcnt;
00034
00035
00036
00037
00038
00039
00040 MatrixDouble matrixMonths;
00041 MatrixDouble matrixDays;
00042 MatrixDouble matrixAmount;
00043
00044
00045 bool isSpecifiedIrrigationMethod;
00046 IrrigationEfficiency efficiency;
00047
00048 long *month,
00049 *day;
00050 double *amount;
00051
00052 irrigationtabletype();
00053
00054 ~irrigationtabletype();
00055 void allocateVectors(int lenVect);
00056
00057
00058 int getCode() const {return Code;}
00059 string getName() const
00060 { string s=Name; return s; }
00061
00062 bool efficiencyIsSpecified() {return isSpecifiedIrrigationMethod;}
00063 void printToScreen();
00064 int getMethod() {return methode;};
00065 int getOrigin() {return origin;};
00066
00067
00068 };
00069
00070
00071 int GetIrrigTable(irrigationtabletype *&IRRIGtable);
00072 int GetIrrigTable(string dateinameein, irrigationtabletype *&irrigationtable);
00073 int GetIrrigTableFromStream( ostream*& WSstream, FILE*& steuerdatei, irrigationtabletype *&IRRIGtable);
00074
00075 void irrigationTable_errorOutput( ostream*& WSstream, string name, string subStr);
00076 void addIrrigationEfficiencyToIrrgationTable(
00077 ostream*& WSstream,
00078 int usenr,
00079 irrigationtabletype *&IRRIGtable,
00080 int numEntriesIrrigationMethods,
00081 IrrigationEfficiency*& irrigEfficiencyArray);
00082
00083 void irrigationtable_error(int i);
00084
00085 void WriteIrrigTable(string filenameOut, irrigationtabletype *&irrigationtable);
00086 void writeSingleSet(ofstream& stream , int startmonth, int startday, double startamount, int endmonth, int endday, double endamount, int deltaDays);
00087
00088 void writeIrrigationTableFromMatrixAndString(string fn, MatrixDouble& vectorCropIDs, MatrixDouble& indexValueAndColumn, MatrixDouble& monthlyWaterRequirements, string*& strNames, TimeHandler& timeHandlerLocal);
00089
00090 #endif