diff --git a/lib/Equitherm/Equitherm.h b/lib/Equitherm/Equitherm.h index 6b56d01..84422f4 100644 --- a/lib/Equitherm/Equitherm.h +++ b/lib/Equitherm/Equitherm.h @@ -44,27 +44,12 @@ public: private: unsigned short _minOut = 20, _maxOut = 90; - // температура контура отопления в зависимости от наружной температуры - // datatype getResultN() { - // Kntemp = Kn*3.3; //Подгонка под типовые кривые - // float tempDiff = targetTemp - outdoorTemp; - // if (tempDiff < 0) tempDiff = 0; - // float T_rad = targetTemp + pow(Kntemp * tempDiff, 1.0 / Ke); - // return T_rad; - // } datatype getResultN() { - float tempDiff = targetTemp - outdoorTemp; - if (tempDiff < 0) { - tempDiff = 0; - } - float minOutside = targetTemp - (_maxOut - targetTemp) / Kn; - float c1 = (_maxOut - targetTemp) / pow(targetTemp - minOutside, 1.0 / Ke); - float T_rad = targetTemp + c1 * pow(tempDiff, 1.0 / Ke) ; - if (T_rad > _maxOut) { - T_rad = _maxOut; - } - - return T_rad; + float tempDiff = targetTemp - outdoorTemp, + maxPoint = targetTemp - (_maxOut - targetTemp) / Kn, + sf = (_maxOut - targetTemp) / pow(targetTemp - maxPoint, 1.0 / Ke), + T_rad = targetTemp + sf * pow(tempDiff, 1.0 / Ke); + return T_rad > _maxOut ? _maxOut : T_rad; } // Расчет поправки (ошибки) термостата diff --git a/src_data/pages/settings.html b/src_data/pages/settings.html index 05121e4..719354c 100644 --- a/src_data/pages/settings.html +++ b/src_data/pages/settings.html @@ -1143,6 +1143,15 @@ updateChart(formData); }); + //Следим за изменениями в полях + document.querySelectorAll('#equitherm-settings input').forEach(input => { + input.addEventListener('change', () => { + const form = document.getElementById('equitherm-settings'); + const formData = new FormData(form); + updateChart(formData); + }); + }); + // инициализируем initChart();