Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: b03ed2b39f
Fetching contributors…

Cannot retrieve contributors at this time

file 28 lines (24 sloc) 0.73 kb
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
/*
* SolarConverter.cc -- class to convert values from one system to another
*
* (c) 2003 Dr. Andreas Mueller, Beratung und Entwicklung
*
* $Id: SolarConverter.cc,v 1.3 2009/01/10 19:00:25 afm Exp $
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif /* HAVE_CONFIG_H */
#include <SolarConverter.h>
#include <MeteoException.h>
#include <mdebug.h>

namespace meteo {

double SolarConverter::operator()(const double value, const std::string& from) const {
if (from == getUnit())
return value;

if (from != "W/m2")
throw MeteoException("unknown solar radiation unit `from'", from);
if (getUnit() != "W/m2")
throw MeteoException("unknown solar radiation unit `to'", getUnit());
return value;
}

} /* namespace meteo */
Something went wrong with that request. Please try again.