1 /***************************************************************************
3 * Gains.cpp Copyright (C) 2008 by Jon Rumble *
4 * j.w.rumble@reading.ac.uk *
6 * This file is part of HECS, *
8 * HECS is free software: you can redistribute it and/or modify *
9 * it under the terms of the GNU General Public License as published by *
10 * the Free Software Foundation, either version 2 of the License, or *
11 * (at your option) any later version. *
13 * HECS is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU General Public License for more details. *
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
19 * You should have received a copy of the GNU General Public License *
20 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
21 ***************************************************************************/
25 double kWHtoGigaJoules(double val_in
)
27 double val_out
= 0.00;
29 return val_out
= (val_in
* 3600000) / 1000000000;
34 double lerp(const double& x1
,
42 y2
= y1
+ (x2
- x1
) *(y3
- y1
)/(x3
- x1
);
46 double calcWk(double area
, double uValue
)
49 return wK
= area
* uValue
;
52 double sqFeettoSquareMetres(double sqFeetIn
)
54 return sqFeetIn
/ 10.7639104;
57 /*QString sedbukGrade(int sedbukVal)
64 if (sedbuk >= 86 && < 90 )
78 //NB QStringList must be sorted or it won't work !!!
79 QStringList
pruneDuplicates(QStringList strListIn
)
82 QStringList prunedList
;
83 QString curEntry
,lastEntry
= "";
84 for (int i
= 0; i
< strListIn
.size(); ++i
)
86 curEntry
= strListIn
.at(i
);
88 if (curEntry
== lastEntry
)
91 prunedList
<< curEntry
;