-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflowmeter.cpp
More file actions
executable file
·44 lines (33 loc) · 993 Bytes
/
flowmeter.cpp
File metadata and controls
executable file
·44 lines (33 loc) · 993 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Exisiting file implemented for project by Oleksandra Baga
#include "flowmeter.h"
Flowmeter::Flowmeter()
{
sensorType = FLOW;
sensorState = UNDEFINED;
recipeAmountOfLiquid = 0;
hasPreparedDrink = false;
}
Flowmeter::~Flowmeter() {
}
int Flowmeter::getRecipeAmountOfLiquid() const {
return recipeAmountOfLiquid;
}
void Flowmeter::setRecipeAmountOfLiquid(UserChoice *activeUserChoice) {
recipeAmountOfLiquid = activeUserChoice->getHotWaterAmount();
}
bool Flowmeter::mainFlowmeterRoutine() {
for (int i = 0; i < recipeAmountOfLiquid; i++) {
// we will do here some simulation
}
// All is OK, drink is ready
recipeAmountOfLiquid = 0;
hasPreparedDrink = true;
return hasPreparedDrink;
}
bool Flowmeter::getHasPreparedDrink() const {
qDebug() << "FLOWMETER: A drink just have been prepared: " << hasPreparedDrink;
return hasPreparedDrink;
}
void Flowmeter::setHasPreparedDrink(bool flag) {
hasPreparedDrink = flag;
}