EPANET头文件解读系列2——ENUMSTXT.H

    在前一系统中介绍了text.h,回顾下,该文件包含了EPANET中所有字符串常量的定义,而ENUMSTXT.H文件则是以text.h中定义的字符串常量为基础,来对这些字符串常量进行合理的分组,形成字符串数组,这里的字符串用指针的形式来表示,也即用指针数组来进行分组。下面简单介绍下各个分组:

   ENUMSTXT.H for assignment of string constants to enumerated types

   以下部分是整个ENUMSTXT.H的原文,以及红色部分是我增加的注释

/*
***********************************************************************
                                                                    
ENUMSTXT.H -- Text strings for enumerated data types in EPANET 
                                                                    
VERSION:    2.00                                              
DATE:       5/8/00
AUTHOR:     L. Rossman                                        
            US EPA - NRMRL
                                                                    
**********************************************************************
*/

//描述节点的三种可能类型
char *NodeTxt[]         = {t_JUNCTION,           
                           t_RESERVOIR,
                           t_TANK};

//描述管线的9种可能类型,主要是各种类型的阀门以及水泵、管段,一般的计算中可能只包含Pipe
char *LinkTxt[]         = {w_CV,
                           w_PIPE,
                           w_PUMP,
                           w_PRV,
                           w_PSV,
                           w_PBV,
                           w_FCV,
                           w_TCV,
                           w_GPV};

//水力计算结果的一些统计信息
char *StatTxt[]         = {t_XHEAD,
                           t_TEMPCLOSED,
                           t_CLOSED,
                           t_OPEN,
                           t_ACTIVE,
                           t_XFLOW,
                           t_XFCV,
                           t_XPRESSURE,
                           t_FILLING,
                           t_EMPTYING};

//三种粗糙系数的计算公式
char *FormTxt[]         = {w_HW,
                           w_DW,
                           w_CM};

//用于报告中的三种粗糙系数的计算公式
char *RptFormTxt[]      = {t_HW,
                           t_DW,
                           t_CM};

//用于报告中的流量单位
char *RptFlowUnitsTxt[] = {u_CFS,
                           u_GPM,
                           u_MGD,
                           u_IMGD,
                           u_AFD,
                           u_LPS,
                           u_LPM,
                           u_MLD,
                           u_CMH,
                           u_CMD};

//流量单位
char *FlowUnitsTxt[]    = {w_CFS,
                           w_GPM,
                           w_MGD,
                           w_IMGD,
                           w_AFD,
                           w_LPS,
                           w_LPM,
                           w_MLD,
                           w_CMH,
                           w_CMD};

//3类压力单位
char *PressUnitsTxt[]   = {w_PSI,
                           w_KPA,
                           w_METERS};

//水质解算时的类型,INPUT中的Option选项中对应Quality这项
char *QualTxt[]         = {w_NONE,
                           w_CHEM,
                           w_AGE,
                           w_TRACE}; 


char *SourceTxt[]       = {w_CONCEN,
                           w_MASS,
                           w_SETPOINT,
                           w_FLOWPACED};

//常用控制规则关键词
char *ControlTxt[]      = {w_BELOW,
                           w_ABOVE,
                           w_TIME,
                           w_CLOCKTIME};

//统计词汇
char *TstatTxt[]        = {w_NONE,
                           w_AVG,
                           w_MIN,
                           w_MAX,
                           w_RANGE};


char *MixTxt[]          = {w_MIXED,
                           w_2COMP,
                           w_FIFO,
                           w_LIFO,
                           NULL};

//报告标记
char *RptFlagTxt[]      = {w_NO,
                           w_YES,
                           w_FULL};

//*.inp文件中的各段落标识
char *SectTxt[]         = {s_TITLE,     s_JUNCTIONS, s_RESERVOIRS,
                           s_TANKS,     s_PIPES,     s_PUMPS,
                           s_VALVES,    s_CONTROLS,  s_RULES,
                           s_DEMANDS,   s_SOURCES,   s_EMITTERS,
                           s_PATTERNS,  s_CURVES,    s_QUALITY,
                           s_STATUS,    s_ROUGHNESS, s_ENERGY,
                           s_REACTIONS, s_MIXING,    s_REPORT,
                           s_TIMES,     s_OPTIONS,   s_COORDS,
                           s_VERTICES,  s_LABELS,    s_BACKDROP,
                           s_TAGS,      s_END,
                           NULL};

//报告文件中的各段落标识
char *RptSectTxt[]      = {NULL,       t_JUNCTION, t_RESERVOIR,
                           t_TANK,     t_PIPE,     t_PUMP,
                           t_VALVE,    t_CONTROL,  t_RULE,
                           t_DEMANDFOR,t_SOURCE,   t_EMITTER,
                           t_PATTERN,  t_CURVE,    t_QUALITY,
                           t_STATUS,   t_ROUGHNESS,t_ENERGY,
                           t_REACTION, t_MIXING,   t_REPORT,
                           t_TIME,     t_OPTION};

//字段名称
char *Fldname[]         = {t_ELEV,      t_DEMAND,    t_HEAD,
                           t_PRESSURE,  t_QUALITY,   t_LENGTH,
                           t_DIAM,      t_FLOW,      t_VELOCITY,
                           t_HEADLOSS,  t_LINKQUAL,  t_LINKSTATUS,
                           t_SETTING,   t_REACTRATE, t_FRICTION,
                           "", "", "", "", "", "", NULL};

//控制台方式解算时显示的logo
char *LogoTxt[]         = {LOGO1,LOGO2,LOGO3,LOGO4,LOGO5,LOGO6,NULL};

转载于:https://www.cnblogs.com/KingOfFreedom/p/3310250.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值