Browse Source

update

master
zhaohe 2 years ago
parent
commit
a3d14bc485
  1. 4
      src/db/db_service.cpp
  2. 11
      src/service/disinfection_ctl_service.cpp

4
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<Setting>(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<Setting>(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<Setting>(where(c(&Setting::id) == 3)).size() == 0)
storage.insert(Setting{3, "stoped_satur", "消毒停止过氧化氢相对饱和度", 0, 100, 1, 70});

11
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;

Loading…
Cancel
Save