2
* equipment.h is part of Brewtarget, and is Copyright Philip G. Lee
3
* (rocketman768@gmail.com), 2009.
5
* Brewtarget is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation, either version 3 of the License, or
8
* (at your option) any later version.
10
* Brewtarget is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
27
#include "observable.h"
28
#include "BeerXMLElement.h"
31
class EquipmentException;
33
class Equipment : public Observable, public BeerXMLElement
38
Equipment(XmlNode *node);
39
Equipment(const QDomNode& equipmentNode);
41
virtual void toXml(QDomDocument& doc, QDomNode& parent); // From BeerXMLElement
42
//std::string toXml();
45
friend bool operator<(Equipment &e1, Equipment &e2);
46
friend bool operator==(Equipment &e1, Equipment &e2);
49
void setName( const std::string &var );
50
void setBoilSize_l( double var );
51
void setBatchSize_l( double var );
52
void setTunVolume_l( double var );
53
void setTunWeight_kg( double var );
54
void setTunSpecificHeat_calGC( double var );
55
void setTopUpWater_l( double var );
56
void setTrubChillerLoss_l( double var );
57
void setEvapRate_pctHr( double var );
58
void setBoilTime_min( double var );
59
void setCalcBoilVolume( bool var );
60
void setLauterDeadspace_l( double var );
61
void setTopUpKettle_l( double var );
62
void setHopUtilization_pct( double var );
63
void setNotes( const std::string &var );
66
std::string getName() const;
67
double getBoilSize_l() const;
68
double getBatchSize_l() const;
69
double getTunVolume_l() const;
70
double getTunWeight_kg() const;
71
double getTunSpecificHeat_calGC() const;
72
double getTopUpWater_l() const;
73
double getTrubChillerLoss_l() const;
74
double getEvapRate_pctHr() const;
75
double getBoilTime_min() const;
76
bool getCalcBoilVolume() const;
77
double getLauterDeadspace_l() const;
78
double getTopUpKettle_l() const;
79
double getHopUtilization_pct() const;
80
std::string getNotes() const;
82
double wortEndOfBoil_l( double kettleWort_l ) const; // Calculate how much wort is left immediately at knockout.
86
static const int version = 1;
91
double tunSpecificHeat_calGC;
93
double trubChillerLoss_l;
94
double evapRate_pctHr;
97
double lauterDeadspace_l;
99
double hopUtilization_pct;
103
void doCalculations();
106
class EquipmentException : public std::exception
110
virtual const char* what() const throw()
112
// Note: this temporary object might get destroyed too early.
113
// I'm not really sure.
114
return std::string("BeerXml EQUIPMENT error: " + _err + "\n").c_str();
117
EquipmentException( std::string message )
122
~EquipmentException() throw() {}
129
struct Equipment_ptr_cmp
131
bool operator()( Equipment* lhs, Equipment* rhs)
137
struct Equipment_ptr_equals
139
bool operator()( Equipment* lhs, Equipment* rhs )
145
#endif /* _EQUIPMENT_H */