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#pragma once
2
3#include <exception>
4#include <stdexcept>
5#include <vector>
6
8 public:
9 MeteredFlowMethodData(const double meterReading) : meterReading(meterReading) {}
10 double getMeterReading() const { return meterReading; }
11
12 void setMeterReading(double meterReading);
13
14 private:
15 double meterReading;
16};
17
19 public:
20 VolumeMeterMethodData(const double finalMeterReading, const double initialMeterReading, const double elapsedTime)
21 : finalMeterReading(finalMeterReading), initialMeterReading(initialMeterReading), elapsedTime(elapsedTime) {}
22 double getFinalMeterReading() const { return finalMeterReading; }
23
24 double getInitialMeterReading() const { return initialMeterReading; }
25
26 double getElapsedTime() const { return elapsedTime; }
27
28 void setFinalMeterReading(double finalMeterReading);
29
30 void setInitialMeterReading(double initialMeterReading);
31
32 void setElapsedTime(double elapsedTime);
33
34 private:
35 double finalMeterReading, initialMeterReading, elapsedTime;
36};
37
39 public:
40 BucketMethodData(const double bucketVolume, const double bucketFillTime)
41 : bucketVolume(bucketVolume), bucketFillTime(bucketFillTime) {}
42
43 double getBucketVolume() const { return bucketVolume; }
44
45 double getBucketFillTime() const { return bucketFillTime; }
46
47 void setBucketVolume(double bucketVolume);
48
49 void setBucketFillTime(double bucketFillTime);
50
51 private:
52 double bucketVolume;
53 double bucketFillTime;
54};
55
57 public:
58 WaterOtherMethodData(const double consumption) : consumption(consumption) {}
59
60 double getConsumption() const { return consumption; }
61
62 void setConsumption(double consumption);
63
64 private:
65 double consumption;
66};
67
69 public:
70 WaterReductionInput(const int operatingHours, const double waterCost, const int measurementMethod,
71 const MeteredFlowMethodData meteredFlowMethodData,
72 const VolumeMeterMethodData volumeMeterMethodData, const BucketMethodData bucketMethodData,
73 const WaterOtherMethodData otherMethodData)
74 : operatingHours(operatingHours), waterCost(waterCost), measurementMethod(measurementMethod),
75 meteredFlowMethodData(meteredFlowMethodData), volumeMeterMethodData(volumeMeterMethodData),
76 bucketMethodData(bucketMethodData), otherMethodData(otherMethodData) {}
77
78 int getOperatingHours() const { return operatingHours; }
79
80 double getWaterCost() const { return waterCost; }
81
82 int getMeasurementMethod() const { return measurementMethod; }
83
84 MeteredFlowMethodData getMeteredFlowMethodData() const { return meteredFlowMethodData; }
85
86 VolumeMeterMethodData getVolumeMeterMethodData() const { return volumeMeterMethodData; }
87
88 BucketMethodData getBucketMethodData() const { return bucketMethodData; }
89
90 WaterOtherMethodData getOtherMethodData() const { return otherMethodData; }
91
92 void setMeteredFlowMethodData(MeteredFlowMethodData meteredFlowMethodData);
93
94 void setVolumeMeterMethodData(VolumeMeterMethodData volumeMeterMethodData);
95
96 void setucketMethodData(BucketMethodData bucketMethodData);
97
98 void setOtherMethodData(WaterOtherMethodData otherMethodData);
99
100 private:
101 int operatingHours;
102 double waterCost;
103 int measurementMethod;
104 MeteredFlowMethodData meteredFlowMethodData;
105 VolumeMeterMethodData volumeMeterMethodData;
106 BucketMethodData bucketMethodData;
107 WaterOtherMethodData otherMethodData;
108};
109
111
112 public:
113 struct Output {
114 Output(double waterUse, double waterCost, double annualWaterSavings, double costSavings)
115 : waterUse(waterUse), waterCost(waterCost), annualWaterSavings(annualWaterSavings),
116 costSavings(costSavings) {}
117
118 Output() = default;
119
120 double waterUse = 0, waterCost = 0, annualWaterSavings = 0, costSavings = 0;
121 };
122
123 WaterReduction(std::vector<WaterReductionInput> waterReductionInputVec)
124 : waterReductionInputVec(waterReductionInputVec) {}
125
126 WaterReduction::Output calculate();
127
128 std::vector<WaterReductionInput> const& getWaterReductionInputVec() const { return waterReductionInputVec; }
129
130 void setWaterReductionInputVec(std::vector<WaterReductionInput>& waterReductionInputVec);
131
132 private:
133 std::vector<WaterReductionInput> waterReductionInputVec;
135};
136