64 Out() <<
"------------------------------------------------------" << endl;
66 Out() <<
"------------------------------------------------------" << endl;
69 const size_t p1 =
fRdfData.find(
"\r\n\r\n");
72 Warn(
"HTTP header not found.");
79 vector<float>
temp(3);
86 pt::read_json(ss, tree);
88 const pt::ptree sub2 = tree.get_child(
"sensor_values.").begin()->second;
89 const pt::ptree sub3 = sub2.get_child(
"values").begin()->second.begin()->second;
91 temp[0] = sub3.get_child(
"v").get_value<
float>();
93 auto sub = sub3.get_child(
"st.").begin();
95 temp[1] = sub++->second.get_value<
float>();
96 temp[2] = sub->second.get_value<
float>();
98 catch (std::exception
const& e)
100 Warn(
"Parsing of JSON failed: "+
string(e.what()));
113 msg <<
"T=" <<
temp[0] <<
"°C" 114 <<
" Tmin=" <<
temp[1] <<
"°C" 115 <<
" Tmax=" <<
temp[2] <<
"°C";
void PostClose(bool restart=true)
Adds some functionality to boost::posix_time::ptime for our needs.
int Warn(const std::string &str)
virtual void Update(const vector< float > &)
int Message(const std::string &str)