2
* mash.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/>.
25
#include "observable.h"
27
#include "BeerXMLElement.h"
32
class Mash : public Observable, public MultipleObserver, public BeerXMLElement
37
Mash( const XmlNode *node);
38
Mash( const QDomNode& mashNode );
40
friend bool operator<(Mash &m1, Mash &m2);
41
friend bool operator==(Mash &m1, Mash &m2);
43
virtual void toXml(QDomDocument& doc, QDomNode& parent); // From BeerXMLElement
44
virtual void notify(Observable *notifier, QVariant info); // From MultipleObserver
46
void setName( const std::string &var );
47
void setGrainTemp_c( double var );
48
void setNotes( const std::string &var );
49
void setTunTemp_c( double var );
50
void setSpargeTemp_c( double var );
51
void setPh( double var );
52
void setTunWeight_kg( double var );
53
void setTunSpecificHeat_calGC( double var );
54
void setEquipAdjust( bool var );
56
std::string getName() const;
57
double getGrainTemp_c() const;
58
unsigned int getNumMashSteps() const;
59
MashStep* getMashStep( unsigned int i );
60
std::string getNotes() const;
61
double getTunTemp_c() const;
62
double getSpargeTemp_c() const;
64
double getTunWeight_kg() const;
65
double getTunSpecificHeat_calGC() const;
66
bool getEquipAdjust() const;
68
void addMashStep(MashStep* step);
69
void removeMashStep(MashStep* step);
70
double totalMashWater_l() const; // Total amount of water that went INTO the mash.
74
static const int version = 1;
76
std::vector<MashStep *> mashSteps;
82
double tunSpecificHeat_calGC;
89
class MashException : public std::exception
93
virtual const char* what() const throw()
95
return std::string("BeerXML ... error: " + _err + "\n").c_str();
98
MashException( std::string message )
103
~MashException() throw() {}
112
bool operator()( Mash* lhs, Mash* rhs)
118
struct Mash_ptr_equals
120
bool operator()( Mash* lhs, Mash* rhs )