From a3d14bc4850d79486c24a0059e60cd1d9c7ab814 Mon Sep 17 00:00:00 2001 From: zhaohe Date: Fri, 25 Aug 2023 00:37:10 +0800 Subject: [PATCH] update --- src/db/db_service.cpp | 4 ++-- src/service/disinfection_ctl_service.cpp | 15 ++++++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/db/db_service.cpp b/src/db/db_service.cpp index f8cf0cf..464e319 100644 --- a/src/db/db_service.cpp +++ b/src/db/db_service.cpp @@ -136,10 +136,10 @@ id setting_name setting_name_ch val_upper_limit val_lower_limi storage.sync_schema(); if (storage.get_all(where(c(&Setting::id) == 1)).size() == 0) // - storage.insert(Setting{1, "stoped_gs", "消毒停止过氧化氢溶度", 0, 2000, 1, 200}); + storage.insert(Setting{1, "stoped_gs", "消毒停止过氧化氢溶度", 0, 2000, 1, 300}); if (storage.get_all(where(c(&Setting::id) == 2)).size() == 0) - storage.insert(Setting{2, "continued_gs", "消毒继续过氧化氢溶度", 0, 2000, 1, 180}); + storage.insert(Setting{2, "continued_gs", "消毒继续过氧化氢溶度", 0, 2000, 1, 260}); if (storage.get_all(where(c(&Setting::id) == 3)).size() == 0) storage.insert(Setting{3, "stoped_satur", "消毒停止过氧化氢相对饱和度", 0, 100, 1, 70}); diff --git a/src/service/disinfection_ctl_service.cpp b/src/service/disinfection_ctl_service.cpp index e6f220b..461d2cc 100644 --- a/src/service/disinfection_ctl_service.cpp +++ b/src/service/disinfection_ctl_service.cpp @@ -82,9 +82,14 @@ float DisinfectionCtrlService::getDisinfectionDValue(float ppm) { float dvalue = 0; if (ppm < 150) { - dvalue = -0.5269 * ppm + 97.868; - } else if (ppm >= 150 || ppm < 300) { - dvalue = -0.1405 * ppm + 40.369; + dvalue = -0.5251 * ppm + 98.154; + } else if (ppm >= 150 || ppm < 240) { + dvalue = -0.125 * ppm + 38.913; + } else if (ppm >= 240) { + // 240 -> 8.913 + // 1400 -> 2 + // y = -0.00603x + 10.4472 + dvalue = -0.00596 * ppm + 10.3434; } if (dvalue < 2) { dvalue = 2; @@ -157,7 +162,7 @@ void DisinfectionCtrlService::initContext(DisinfectionContext& context, int logl "heating,blower,compressor,pump," // "pressure1,pressure2,pressure3,pressure4," // "disinfectantVolume," // - "remaintime\n" // + "remaintime\n" // ); } void DisinfectionCtrlService::finishDisinfection(DisinfectionContext& context) { @@ -234,7 +239,7 @@ void DisinfectionCtrlService::dumpDisinfectionLogsToCSV(DisinfectionContext& con "{},{},{},{}," // "{},{},{},{}," // "{}," // - "{}\n" // + "{}\n" // , zsteady_clock().elapsedTimeS(m_context.m_starttp), // sensors[0].h2o2, sensors[0].temp, sensors[0].humid, sensors[0].saturation, //