MEASUR-Tools-Suite v1.0.11
The MEASUR Tools Suite is a collection of industrial efficiency calculations written in C++ and with bindings for compilation to WebAssembly.
Loading...
Searching...
No Matches
WaterReduction.h
1#ifndef TOOLS_SUITE_WATERREDUCTION_H
2#define TOOLS_SUITE_WATERREDUCTION_H
3
4#include <exception>
5#include <stdexcept>
6#include <vector>
7
9 public:
10 MeteredFlowMethodData(const double meterReading) : meterReading(meterReading) {}
11 double getMeterReading() const { return meterReading; }
12
13 void setMeterReading(double meterReading);
14
15 private:
16 double meterReading;
17};
18
20 public:
21 VolumeMeterMethodData(const double finalMeterReading, const double initialMeterReading, const double elapsedTime)
22 : finalMeterReading(finalMeterReading), initialMeterReading(initialMeterReading), elapsedTime(elapsedTime) {}
23 double getFinalMeterReading() const { return finalMeterReading; }
24
25 double getInitialMeterReading() const { return initialMeterReading; }
26
27 double getElapsedTime() const { return elapsedTime; }
28
29 void setFinalMeterReading(double finalMeterReading);
30
31 void setInitialMeterReading(double initialMeterReading);
32
33 void setElapsedTime(double elapsedTime);
34
35 private:
36 double finalMeterReading, initialMeterReading, elapsedTime;
37};
38
40 public:
41 BucketMethodData(const double bucketVolume, const double bucketFillTime)
42 : bucketVolume(bucketVolume), bucketFillTime(bucketFillTime) {}
43
44 double getBucketVolume() const { return bucketVolume; }
45
46 double getBucketFillTime() const { return bucketFillTime; }
47
48 void setBucketVolume(double bucketVolume);
49
50 void setBucketFillTime(double bucketFillTime);
51
52 private:
53 double bucketVolume;
54 double bucketFillTime;
55};
56
58 public:
59 WaterOtherMethodData(const double consumption) : consumption(consumption) {}
60
61 double getConsumption() const { return consumption; }
62
63 void setConsumption(double consumption);
64
65 private:
66 double consumption;
67};
68
70 public:
71 WaterReductionInput(const int operatingHours, const double waterCost, const int measurementMethod,
72 const MeteredFlowMethodData meteredFlowMethodData,
73 const VolumeMeterMethodData volumeMeterMethodData, const BucketMethodData bucketMethodData,
74 const WaterOtherMethodData otherMethodData)
75 : operatingHours(operatingHours), waterCost(waterCost), measurementMethod(measurementMethod),
76 meteredFlowMethodData(meteredFlowMethodData), volumeMeterMethodData(volumeMeterMethodData),
77 bucketMethodData(bucketMethodData), otherMethodData(otherMethodData) {}
78
79 int getOperatingHours() const { return operatingHours; }
80
81 double getWaterCost() const { return waterCost; }
82
83 int getMeasurementMethod() const { return measurementMethod; }
84
85 MeteredFlowMethodData getMeteredFlowMethodData() const { return meteredFlowMethodData; }
86
87 VolumeMeterMethodData getVolumeMeterMethodData() const { return volumeMeterMethodData; }
88
89 BucketMethodData getBucketMethodData() const { return bucketMethodData; }
90
91 WaterOtherMethodData getOtherMethodData() const { return otherMethodData; }
92
93 void setMeteredFlowMethodData(MeteredFlowMethodData meteredFlowMethodData);
94
95 void setVolumeMeterMethodData(VolumeMeterMethodData volumeMeterMethodData);
96
97 void setucketMethodData(BucketMethodData bucketMethodData);
98
99 void setOtherMethodData(WaterOtherMethodData otherMethodData);
100
101 private:
102 int operatingHours;
103 double waterCost;
104 int measurementMethod;
105 MeteredFlowMethodData meteredFlowMethodData;
106 VolumeMeterMethodData volumeMeterMethodData;
107 BucketMethodData bucketMethodData;
108 WaterOtherMethodData otherMethodData;
109};
110
112
113 public:
114 struct Output {
115 Output(double waterUse, double waterCost, double annualWaterSavings, double costSavings)
116 : waterUse(waterUse), waterCost(waterCost), annualWaterSavings(annualWaterSavings),
117 costSavings(costSavings) {}
118
119 Output() = default;
120
121 double waterUse = 0, waterCost = 0, annualWaterSavings = 0, costSavings = 0;
122 };
123
124 WaterReduction(std::vector<WaterReductionInput> waterReductionInputVec)
125 : waterReductionInputVec(waterReductionInputVec) {}
126
127 WaterReduction::Output calculate();
128
129 std::vector<WaterReductionInput> const& getWaterReductionInputVec() const { return waterReductionInputVec; }
130
131 void setWaterReductionInputVec(std::vector<WaterReductionInput>& waterReductionInputVec);
132
133 private:
134 std::vector<WaterReductionInput> waterReductionInputVec;
136};
137
138#endif // TOOLS_SUITE_WATERREDUCTION_H