using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
|
namespace Hydro.HydraulicHelperNS
|
{
|
class ErrorDefine
|
{
|
Dictionary<int, string> errList = new Dictionary<int, string>();
|
void DAT(int err,string ex)
|
{
|
errList.Add(err, ex);
|
}
|
public string getErrorTxt(int err)
|
{
|
if (errList.ContainsKey(err))
|
return errList[err];
|
else
|
return "未知错误";
|
}
|
public ErrorDefine()
|
{
|
//EPANET 2 Error Messages
|
DAT(0, null);
|
DAT(1, "WARNING: System hydraulically unbalanced.");
|
DAT(2,"WARNING: System may be hydraulically unstable.");
|
DAT(3,"WARNING: System disconnected.");
|
DAT(4,"WARNING: 水泵无法提供足够的扬程");
|
DAT(5,"WARNING: Valves cannot deliver enough flow.");
|
DAT(6,"WARNING: System has negative pressures.");
|
DAT(100, "设置模型对象属性失败");
|
DAT(101, "可用内存不足");
|
DAT(102, "没有管网数据");
|
DAT(103, "无法读取水力计算结果");
|
DAT(104, "水质计算前未进行水力计算");
|
DAT(105, "无法读取水质计算结果");
|
DAT(106, "报告内容为空");
|
DAT(107, "hydraulics supplied from external file");
|
DAT(108, "cannot use external file while hydraulics solver is active");
|
DAT(110, "cannot solve network hydraulic equations");
|
DAT(120, "cannot solve water quality transport equations");
|
|
// These errors apply only to an input file
|
DAT(200, "输入错误 200: 输入计算文件有多个错误。");
|
DAT(201, "输入错误 201: 以下行 [%s] 中有语法错误:");
|
|
// These errors apply to both an input file and to API functions
|
DAT(202, "{%s}输入错误 202: %s %s 包含非法数字值。");
|
DAT(203, "{%s}输入错误 203: %s %s 引用未定义的节点。");
|
DAT(204, "{%s}输入错误 204: %s %s 引用未定义的管线。");
|
DAT(205, "{%s}输入错误 205: %s %s 引用未定义的用水模式。");
|
DAT(206, "{%s}输入错误 206: %s %s 引用未定义的曲线。");
|
DAT(207, "{%s}输入错误 207: %s %s 控制不能控制止回阀。");
|
DAT(208, "illegal PDA pressure limits");
|
//#define ERR208 "{%s}输入错误 208: %s 指定了未定义的节点 %s。"
|
|
DAT(209, "{%s}输入错误 209: 非法值 %s 对应的节点 %s。");
|
DAT(210, "{%s}输入错误 210: %s 指定了没有定义的管线 %s。");
|
DAT(211, "illegal link property value");
|
//#define ERR211 "{%s}输入错误 211: 非法值 %s 对应的管线 %s。"
|
|
DAT(212, "{%s}输入错误 212: 跟踪节点 %.0s %s 没有定义。");
|
DAT(213, "{%s}输入错误 213: 非法的选项值在 [%s] :");
|
DAT(214, "输入错误 214: 下面的行中 [%s] 包含了太多的变量:");
|
DAT(215, "{%s}输入错误 215: %s %s 是相同的ID编号。");
|
DAT(216, "{%s}输入错误 216: %s 数据指定了没有定义的水泵 %s。");
|
DAT(217, "{%s}输入错误 217: 非法数据 %s 对应的水泵 %s。");
|
DAT(219, "{%s}输入错误 219: %s %s 非法连接水池。");
|
DAT(220, "{%s}输入错误 220: %s %s 非法连接其它阀门。");
|
DAT(221, "mis-placed rule clause in rule-based control");
|
DAT(222, "{%s}输入错误 222: %s %s 管线的起始节点与终止节点相同。");
|
|
// These errors apply to network consistency check
|
DAT(223, "输入错误 223: 管网中没有节点");
|
DAT(224, "输入错误 224: 管网中没有水池或水库或已知压力点。");
|
DAT(225, "{%s}输入错误 225: 水池 %s 的水位过高或过低。");
|
DAT(226, "{%s}输入错误 226: 水泵 %s 没有扬程曲线。");
|
DAT(227, "{%s}输入错误 227: 水泵 %s 的扬程曲线错误。");
|
DAT(230, "输入错误 230: 曲线 %s 有不合理的 x-轴。");
|
DAT(233, "{%s}输入错误 233: 节点 %s 不连通。");
|
|
// These errors apply only to API functions
|
DAT(240, "输入错误 240: %s %s 引用了未定义的水源。");
|
DAT(241, "输入错误 241: %s %s 引用了未定义的控制设备。");
|
DAT(250, "输入错误 250: 函数调用包含非法的格式。");
|
DAT(251, "输入错误 251: 函数调用包含非法的参数。");
|
DAT(252, "错误的 ID name");
|
DAT(253, "nonexistent demand category");
|
DAT(254, "node with no coordinates");
|
DAT(255, "错误的 link vertex");
|
DAT(257, "nonexistent rule");
|
DAT(258, "nonexistent rule clause");
|
DAT(259, "attempt to delete a node that still has links connected to it");
|
DAT(260, "attempt to delete node assigned as a Trace Node");
|
DAT(261, "attempt to delete a node or link contained in a control");
|
DAT(262, "attempt to modify network structure while solver is active");
|
|
// File errors
|
DAT(301, "文件错误 301: 文件名称相同。");
|
DAT(302, "文件错误 302: 不能打开输入文件。");
|
DAT(303, "文件错误 303: 不能打开报告文件");
|
DAT(304, "文件错误 304: 不能打开二进制输出文件。");
|
DAT(305, "文件错误 305: 不能打开水力文件。");
|
DAT(306, "文件错误 306: 水力计算文件和管网数据不匹配。");
|
DAT(307, "文件错误 307: 不能读取水力计算文件。");
|
DAT(308, "文件错误 308: 不能保存结果文件。");
|
DAT(309, "文件错误 309: 不能保存结果到报告文件。");
|
|
}
|
}
|
}
|