#ifndef PID_H struct RECORD{ time_t date; std::vector temp; RECORD(){} RECORD(const char *line){ auto tb = str_splitline(line,' '); if (tb.size() > 1){ date = atol(tb[0].c_str()); for (unsigned i=1; i &temps, int monitor, double target) { if (temps.size() > 10){ auto &last = temps.back(); auto &prev10 = temps[temps.size()-10]; if (last.temp.size() > (unsigned)monitor && prev10.temp.size() > (unsigned)monitor){ return (last.temp[monitor]-prev10.temp[monitor])/10; }else{ return 0; } }else{ return 0; } } /* Calcul l'intégrale de la température dans les dernière 10 minutes */ static double ads_intg (vector &temps, int monitor, double target) { double total = 0; if (temps.size() > 10){ for (unsigned i=temps.size()-10; i (unsigned)monitor){ double difftemp = p[monitor] - target; total += difftemp; } } } return total; } #endif