2
* mashstep.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/>.
24
#include "observable.h"
26
#include "BeerXMLElement.h"
29
class MashStepException;
31
class MashStep : public Observable, public BeerXMLElement
36
MashStep(const XmlNode *node);
37
MashStep( const QDomNode& mashStepNode );
39
friend bool operator<(MashStep &m1, MashStep &m2);
40
friend bool operator==(MashStep &m1, MashStep &m2);
42
virtual void toXml(QDomDocument& doc, QDomNode& parent); // From BeerXMLElement
43
//std::string toXml();
45
void setName( const std::string &var );
46
void setType( const std::string &var );
47
void setInfuseAmount_l( double var );
48
void setStepTemp_c( double var );
49
void setStepTime_min( double var );
50
void setRampTime_min( double var );
51
void setEndTemp_c( double var );
53
std::string getName() const;
54
std::string getType() const;
55
double getInfuseAmount_l() const;
56
double getStepTemp_c() const;
57
double getStepTime_min() const;
58
double getRampTime_min() const;
59
double getEndTemp_c() const;
62
void setInfuseTemp_c( double var );
63
double getInfuseTemp_c() const;
64
void setDecoctionAmount_l( double var );
65
double getDecoctionAmount_l() const;
71
static const int version = 1;
73
double infuseAmount_l;
81
double decoctionAmount_l;
84
bool isValidType( const std::string &str ) const;
88
class MashStepException : public std::exception
92
virtual const char* what() const throw()
94
return std::string("BeerXML MASH_STEP error: " + _err + "\n").c_str();
97
MashStepException( std::string message )
102
~MashStepException() throw() {}
109
struct MashStep_ptr_cmp
111
bool operator()( MashStep* lhs, MashStep* rhs)
117
struct MashStep_ptr_equals
119
bool operator()( MashStep* lhs, MashStep* rhs )