• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

toolkit.h

Go to the documentation of this file.
00001 /*
00002 *******************************************************************
00003 
00004 TOOLKIT.H - Prototypes for EPANET Functions Exported to DLL Toolkit
00005 
00006 VERSION: 1.5
00007 
00008 AUTHOR:     M. Lopez-Ibanez (M. L\'opez-Ib\'a\~nez)
00009             Napier University, Edinburgh, UK.
00010 
00011 $LastChangedBy: manu $ $Revision: 187 $
00012 $LastChangedDate: 2009-02-05 20:27:34 +0100 (Thu, 05 Feb 2009) $
00013 
00014 ---------------------------------------------------------------------
00015 
00016  Copyright (c) 2005, 2006 Manuel Lopez-Ibanez
00017  TeX: \copyright 2005, 2006 Manuel L\'opez-Ib\'a\~nez
00018 
00019  This program is free software (software libre); you can redistribute
00020  it and/or modify it under the terms of version 2 of the GNU General
00021  Public License version as published by the Free Software Foundation.
00022 
00023  This program is distributed in the hope that it will be useful, but
00024  WITHOUT ANY WARRANTY; without even the implied warranty of
00025  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00026  General Public License for more details.
00027 
00028  You should have received a copy of the GNU General Public License
00029  along with this program; if not, you can obtain a copy of the GNU
00030  General Public License at:
00031                 http://www.gnu.org/copyleft/gpl.html
00032  or by writing to:
00033           Free Software Foundation, Inc., 59 Temple Place,
00034                 Suite 330, Boston, MA 02111-1307 USA
00035 
00036 ----------------------------------------------------------------------
00037 ----------------------------------------------------------------------
00038 
00039 Original public domain sources (no license) from:
00040 
00041 EPANET VERSION:    2.00
00042 DATE:       5/8/00
00043             10/25/00
00044             3/1/01
00045 AUTHOR:     L. Rossman
00046             US EPA - NRMRL
00047 
00048 *******************************************************************
00049 */
00050 
00051 #define EPANET_VERSION "1.5"
00052 
00053 #ifndef LINUX
00054 #ifdef DLL
00055 #ifdef __cplusplus
00056 #define DLLEXPORT extern "C" __declspec(dllexport) __stdcall
00057 #else
00058 #define DLLEXPORT __declspec(dllexport) __stdcall
00059 #endif
00060 #else
00061 #define DLLEXPORT
00062 #endif
00063 #else
00064 #define DLLEXPORT
00065 #endif
00066 
00067 /* These are codes used by the DLL functions */
00068 #define EN_ELEVATION    0    /* Node parameters */
00069 #define EN_BASEDEMAND   1
00070 #define EN_PATTERN      2
00071 #define EN_EMITTER      3
00072 #define EN_INITQUAL     4
00073 #define EN_SOURCEQUAL   5
00074 #define EN_SOURCEPAT    6
00075 #define EN_SOURCETYPE   7
00076 #define EN_TANKLEVEL    8
00077 #define EN_DEMAND       9
00078 #define EN_HEAD         10
00079 #define EN_PRESSURE     11
00080 #define EN_QUALITY      12
00081 #define EN_SOURCEMASS   13
00082 #define EN_VOLUME       20
00083 #define EN_INITVOL      21
00084 #define EN_MAXLEVEL     30
00085 #define EN_MINLEVEL     31
00086 
00087 #define EN_DIAMETER     0    /* Link parameters */
00088 #define EN_LENGTH       1
00089 #define EN_ROUGHNESS    2
00090 #define EN_MINORLOSS    3
00091 #define EN_INITSTATUS   4
00092 #define EN_INITSETTING  5
00093 #define EN_KBULK        6
00094 #define EN_KWALL        7
00095 #define EN_FLOW         8
00096 #define EN_VELOCITY     9
00097 #define EN_HEADLOSS     10
00098 #define EN_STATUS       11
00099 #define EN_SETTING      12
00100 #define EN_ENERGY       13
00101 #define EN_UPATTERN     20
00102 #define EN_SCHEDULE     21
00103 
00104 #define EN_DURATION     0    /* Time parameters */
00105 #define EN_HYDSTEP      1
00106 #define EN_QUALSTEP     2
00107 #define EN_PATTERNSTEP  3
00108 #define EN_PATTERNSTART 4
00109 #define EN_REPORTSTEP   5
00110 #define EN_REPORTSTART  6
00111 #define EN_RULESTEP     7
00112 #define EN_STATISTIC    8
00113 #define EN_PERIODS      9
00114 #define EN_CLOCKSTART  20
00115 
00116 #define EN_NODECOUNT    0   /* Component counts */
00117 #define EN_TANKCOUNT    1
00118 #define EN_LINKCOUNT    2
00119 #define EN_PATCOUNT     3
00120 #define EN_CURVECOUNT   4
00121 #define EN_CONTROLCOUNT 5
00122 #define EN_PUMPCOUNT    6
00123 #define EN_RESERVCOUNT  7
00124 #define EN_JUNCSCOUNT   8
00125 
00126 #define EN_JUNCTION     0    /* Node types */
00127 #define EN_RESERVOIR    1
00128 #define EN_TANK         2
00129 
00130 #define EN_CVPIPE       0    /* Link types. */
00131 #define EN_PIPE         1    /* See LinkType in TYPES.H */
00132 #define EN_PUMP         2
00133 #define EN_PRV          3
00134 #define EN_PSV          4
00135 #define EN_PBV          5
00136 #define EN_FCV          6
00137 #define EN_TCV          7
00138 #define EN_GPV          8
00139 
00140 #define EN_NONE         0    /* Quality analysis types. */
00141 #define EN_CHEM         1    /* See QualType in TYPES.H */
00142 #define EN_AGE          2
00143 #define EN_TRACE        3
00144 
00145 #define EN_CONCEN       0    /* Source quality types.      */
00146 #define EN_MASS         1    /* See SourceType in TYPES.H. */
00147 #define EN_SETPOINT     2
00148 #define EN_FLOWPACED    3
00149 
00150 #define EN_CFS          0    /* Flow units types.   */
00151 #define EN_GPM          1    /* See FlowUnitsType   */
00152 #define EN_MGD          2    /* in TYPES.H.         */
00153 #define EN_IMGD         3
00154 #define EN_AFD          4
00155 #define EN_LPS          5
00156 #define EN_LPM          6
00157 #define EN_MLD          7
00158 #define EN_CMH          8
00159 #define EN_CMD          9
00160 
00161 #define EN_TRIALS       0   /* Misc. options */
00162 #define EN_ACCURACY     1
00163 #define EN_TOLERANCE    2
00164 #define EN_EMITEXPON    3
00165 #define EN_DEMANDMULT   4
00166 
00167 #define EN_LOWLEVEL     0   /* Control types.  */
00168 #define EN_HILEVEL      1   /* See ControlType */
00169 #define EN_TIMER        2   /* in TYPES.H.     */
00170 #define EN_TIMEOFDAY    3
00171 
00172 #define EN_AVERAGE      1   /* Time statistic types.    */
00173 #define EN_MINIMUM      2   /* See TstatType in TYPES.H */
00174 #define EN_MAXIMUM      3
00175 #define EN_RANGE        4
00176 
00177 #define EN_NOSAVE       0   /* Save-results-to-file flag */
00178 #define EN_SAVE         1
00179 
00180 /*** Updated 3/1/01 ***/
00181 #define EN_INITFLOW    10   /* Re-initialize flows flag  */
00182 
00183 #define   EN_MAX_ID_LEN         15 // Max. # characters in ID name
00184 #define   EN_MAX_MSG_LEN        79 // Max. # characters in message text
00185 #define   EN_MAX_FILENAME_LEN  259 // Max. # characters in file name
00186 
00187 
00188 /* These are the external functions that comprise the DLL */
00189 
00190 /*** Updated 3/1/01 ***/
00191 int  DLLEXPORT ENepanet(char *, char *, char *, void (*) (char *));
00192 
00193 int  DLLEXPORT ENopen(char *, char *, char *);
00194 int  DLLEXPORT ENsaveinpfile(char *);
00195 int  DLLEXPORT ENclose(void);
00196 
00197 int  DLLEXPORT ENsolveH(void);
00198 int  DLLEXPORT ENsaveH(void);
00199 int  DLLEXPORT ENopenH(void);
00200 int  DLLEXPORT ENinitH(int);
00201 int  DLLEXPORT ENrunH(long *);
00202 int  DLLEXPORT ENnextH(long *);
00203 int  DLLEXPORT ENcloseH(void);
00204 int  DLLEXPORT ENsavehydfile(char *);
00205 int  DLLEXPORT ENusehydfile(char *);
00206 
00207 int  DLLEXPORT ENsolveQ(void);
00208 int  DLLEXPORT ENopenQ(void);
00209 int  DLLEXPORT ENinitQ(int);
00210 int  DLLEXPORT ENrunQ(long *);
00211 int  DLLEXPORT ENnextQ(long *);
00212 int  DLLEXPORT ENstepQ(long *);
00213 int  DLLEXPORT ENcloseQ(void);
00214 
00215 int  DLLEXPORT ENwriteline(char *);
00216 int  DLLEXPORT ENreport(void);
00217 int  DLLEXPORT ENresetreport(void);
00218 int  DLLEXPORT ENsetreport(char *);
00219 
00220 int  DLLEXPORT ENgetcontrol(int, int *, int *, float *,
00221                             int *, float *);
00222 int  DLLEXPORT ENgetcount(int, int *);
00223 int  DLLEXPORT ENgetoption(int, float *);
00224 int  DLLEXPORT ENgettimeparam(int, long *);
00225 int  DLLEXPORT ENgetflowunits(int *);
00226 int  DLLEXPORT ENgetpatternindex(char *, int *);
00227 int  DLLEXPORT ENgetpatternid(int, char *);
00228 int  DLLEXPORT ENgetpatternlen(int, int *);
00229 int  DLLEXPORT ENgetpatternvalue(int, int, float *);
00230 int  DLLEXPORT ENgetqualtype(int *, int *);
00231 int  DLLEXPORT ENgeterror(int, char *, int);
00232 
00233 int  DLLEXPORT ENgetnodeindex(char *, int *);
00234 int  DLLEXPORT ENgetnodeid(int, char *);
00235 int  DLLEXPORT ENgetnodetype(int, int *);
00236 int  DLLEXPORT ENgetnodevalue(int, int, float *);
00237 
00238 int  DLLEXPORT ENgetlinkindex(char *, int *);
00239 int  DLLEXPORT ENgetlinkid(int, char *);
00240 int  DLLEXPORT ENgetlinktype(int, int *);
00241 int  DLLEXPORT ENgetlinknodes(int, int *, int *);
00242 int  DLLEXPORT ENgetlinkvalue(int, int, float *);
00243 
00244 /*** Updated 10/25/00 ***/
00245 int  DLLEXPORT ENgetversion(int *);
00246 
00247 int  DLLEXPORT ENsetcontrol(int, int, int, float, int, float);
00248 int  DLLEXPORT ENsetnodevalue(int, int, float);
00249 int  DLLEXPORT ENsetlinkvalue(int, int, float);
00250 int  DLLEXPORT ENsetpattern(int, float *, int);
00251 int  DLLEXPORT ENsetpatternvalue(int, int, float);
00252 int  DLLEXPORT ENsettimeparam(int, long);
00253 int  DLLEXPORT ENsetoption(int, float);
00254 int  DLLEXPORT ENsetstatusreport(int);
00255 int  DLLEXPORT ENsetqualtype(int, char *, char *, char *);
00256 
00257 int  DLLEXPORT ENaddpattern(char *id);
00258 int  DLLEXPORT ENgettotalenergycost(float *cost);
00259 int  DLLEXPORT ENgetpumpswitches(int index, int *value);
00260 
00261 int  DLLEXPORT ENgetpumpindex(int pump_index, int *link_index);
00262 int  DLLEXPORT ENgettankindex(int tank_index, int *node_index);
00263 
00264 int  DLLEXPORT ENaddleveltrigger(int pump_index, int tank_index,
00265                                  int start_time, int stop_time,
00266                                  float level, int status);
00267 
00268 int  DLLEXPORT ENgetminstoptime(int index, int *value);
00269 
00270 int  DLLEXPORT ENrulesclear(void);
00271 int  DLLEXPORT ENgetnumwarnings(void);
00272 
00273 int  DLLEXPORT ENgettotaldemand(float *demand);
00274 int  DLLEXPORT ENgettotalinflow(float *inflow);
00275 int  DLLEXPORT ENgettotalleakage(float *leakage);
00276 
00277 int DLLEXPORT ENgetnode_xcoord(int index, float *x);
00278 int DLLEXPORT ENgetnode_ycoord(int index, float *y);

Generated on Tue Oct 4 2011 16:25:19 for WDN by  doxygen 1.7.2