EPANET  3.0
EPANET Development Project
reportfields.h
1 /* EPANET 3
2  *
3  * Copyright (c) 2016 Open Water Analytics
4  * Licensed under the terms of the MIT License (see the LICENSE file for details).
5  *
6  */
7 
8 #ifndef REPORTFIELDS_H_
9 #define REPORTFIELDS_H_
10 
11 #include <string>
12 
13 struct Field
14 {
15  std::string name;
16  std::string units;
17  bool enabled;
18  int precision;
19  double lowerLimit;
20  double upperLimit;
21 };
22 
23 
25 {
26  public:
27  enum NodeFieldType {ELEVATION, HEAD, PRESSURE, DEMAND, DEFICIT, OUTFLOW,
28  NODE_QUALITY, NUM_NODE_FIELDS};
29  enum LinkFieldType {LENGTH, DIAMETER, FLOW, LEAKAGE, VELOCITY, HEADLOSS, STATUS,
30  SETTING, LINK_QUALITY, NUM_LINK_FIELDS};
31 
32  static const char* NodeFieldNames[];
33  static const char* LinkFieldNames[];
34 
35  ReportFields();
36  void setDefaults();
37  void setField( int type,
38  int index,
39  int enabled,
40  int precision,
41  double lowerLimit,
42  double upperLimit);
43  Field& nodeField(int index) { return nodeFields[index]; }
44  Field& linkField(int index) { return linkFields[index]; }
45 
46  private:
47  Field nodeFields[NUM_NODE_FIELDS];
48  Field linkFields[NUM_LINK_FIELDS];
49 };
50 
51 #endif /* REPORTFIELDS_H_ */
Definition: reportfields.h:24
Definition: reportfields.h:13