EPANET头文件解读系列1——TEXT.H
定义在TEXT.H文件中的字符常量都以小写开头,然后紧跟一个下划线,再接着就全是大写字母
/*
****************************************************
String Constants for EPANET Program
VERSION: 2.00
DATE: 5/8/00
10/25/00
8/15/07 (2.00.11)
2/14/08 (2.00.12)
AUTHOR: L. Rossman
US EPA - NRMRL
****************************************************
*/
/* ------------ Keyword Dictionary ---------- */ //一些整个系统都会用到的关键词,注意命名规则都是小写的w开头,表示是KEYWORD
#define w_USE "USE"
#define w_SAVE "SAVE"
#define w_NONE "NONE"
#define w_ALL "ALL"
#define w_CHEM "CHEM"
#define w_AGE "AGE"
#define w_TRACE "TRACE"
...
/* ---------Input Section Names ---------- */ //INPUT文件的段落头(Section Names),内核代码解析*.inp文件时一行行读取数据,根据这些段落头
#define s_TITLE "[TITL" //注意命名规则都是小写的s开头,表示是Section
#define s_JUNCTIONS "[JUNC"
#define s_RESERVOIRS "[RESE"
#define s_TANKS "[TANK"
/* ---------------- Units ---------------- */ //单位,注意命名规则都是小写的u开头,表示是Units
/*** Limit units to MAXID or less characters ***/
#define u_CFS "cfs"
#define u_GPM "gpm"
/* -------------- Curve Types ----------------- */ //曲线类型,注意命名规则都是小写的c开头,表示是Curve
#define c_HEADLOSS "HEADLOSS"
#define c_PUMP "PUMP"
#define c_EFFIC "EFFIC"
#define c_VOLUME "VOLUME"
/* ------------------ Text Phrases ------------------- */ //常用文本解释,注意命名规则都是小写的t开头,表示是Text
#define t_ABOVE "above"
#define t_BELOW "below"
/* ------------------ Format Messages ------------------*/ //程序的logo
#define LOGO1 \
"******************************************************************"
#define LOGO2 \
"* E P A N E T *"
#define FMT01 "\n... EPANET Version 2.0\n" //格式化的字符串文本
#define FMT02 "\n o Retrieving network data" //常用格式化文本,命名规则基本上是FMT开头
#define FMT03 "\n Correct syntax is:\n epanet <input file> <output file>\n"
...
#define FMT24 " Number of Valves .................. %-d" //格式化的字符串文本,显示阀门个数等。
#define FMT25 " Headloss Formula .................. %s"
#define FMT26 " Hydraulic Timestep ................ %-.2f %s"
...
/* -------------------- Energy Report Table ------------------- */ //能量方面的报告
#define FMT71 "Energy Usage:"
...
/* -------------------- Node Report Table --------------------- */ //节点计算信息
#define FMT76 "%s Node Results:"
#define FMT77 "Node Results:"
#define FMT78 "Node Results at %s hrs:"
/* -------------------- Link Report Table --------------------- */ //管段计算信息
#define FMT79 "%s Link Results:"
#define FMT80 "Link Results:"
#define FMT81 "Link Results at %s hrs:"
#define FMT82 "\n\f\n Page %-d %60.60s\n"
/* ------------------- Progress Messages ---------------------- */ //进度提示信息
#define FMT100 "Retrieving network data..."
#define FMT101 "Computing hydraulics at hour %s"
#define FMT102 "Computing water quality at hour %s"
#define FMT103 "Saving results to file..."
#define FMT104 "Analysis begun %s"
#define FMT105 "Analysis ended %s"
/*------------------- Error Messages --------------------*/ //出错信息,基本以ERR开头,并且数字编号都是大于100的。
#define ERR101 "System Error 101: insufficient memory available."
#define ERR102 "System Error 102: no network data available."
#define ERR103 "System Error 103: hydraulics not initialized."
#define ERR104 "System Error 104: no hydraulics for water quality analysis."
...
/*-------------------- Specific Warning Messages -------------------------*/ //特殊的警告信息,比如水力解算不平衡,负压等情况
#define WARN01 "WARNING: System unbalanced at %s hrs." //出错信息,基本以WARN开头
#define WARN02 \
"WARNING: Maximum trials exceeded at %s hrs. System may be unstable."
#define WARN03a "WARNING: Node %s disconnected at %s hrs"
#define WARN03b "WARNING: %d additional nodes disconnected at %s hrs"
#define WARN03c "WARNING: System disconnected because of Link %s"
#define WARN04 "WARNING: Pump %s %s at %s hrs."
#define WARN05 "WARNING: %s %s %s at %s hrs."
#define WARN06 "WARNING: Negative pressures at %s hrs."
/*-------------------- General Warning Messages -------------------------*/ //普通警告信息
#define WARN1 "WARNING: System hydraulically unbalanced."
#define WARN2 "WARNING: System may be hydraulically unstable."
#define WARN3 "WARNING: System disconnected."
#define WARN4 "WARNING: Pumps cannot deliver enough flow or head."
#define WARN5 "WARNING: Valves cannot deliver enough flow."
#define WARN6 "WARNING: System has negative pressures."