|
@ -226,7 +226,13 @@ void DisinfectionCtrlService::initContext(DisinfectionContext& context, |
|
|
"Remaining time (s)\n" //
|
|
|
"Remaining time (s)\n" //
|
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
static string formattimeS(int sec) { return fmt::format("{:0>2}:{:0>2}:{:0>2}", sec / 3600, sec % 3600 / 60, sec % 60); } |
|
|
|
|
|
|
|
|
static string formattimeS(int sec) { |
|
|
|
|
|
if (sec >= 0) { |
|
|
|
|
|
return fmt::format("{:0>2}:{:0>2}:{:0>2}", sec / 3600, sec % 3600 / 60, sec % 60); |
|
|
|
|
|
} else { |
|
|
|
|
|
return fmt::format("--:--:--"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
void DisinfectionCtrlService::dumpDisinfectionLogsToCSV(DisinfectionContext& context) { |
|
|
void DisinfectionCtrlService::dumpDisinfectionLogsToCSV(DisinfectionContext& context) { |
|
|
auto* sensors = &m_context.h2o2data.h2o2sensor_data[0]; |
|
|
auto* sensors = &m_context.h2o2data.h2o2sensor_data[0]; |
|
|
auto ds = m_deviceIoControlService; |
|
|
auto ds = m_deviceIoControlService; |
|
@ -236,6 +242,9 @@ void DisinfectionCtrlService::dumpDisinfectionLogsToCSV(DisinfectionCon |
|
|
} else { |
|
|
} else { |
|
|
dvalue = m_context.dvalue; |
|
|
dvalue = m_context.dvalue; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int remaintime = getEstimatedRemainingTimeS(); |
|
|
|
|
|
|
|
|
context.csvlogger->write( |
|
|
context.csvlogger->write( |
|
|
fmt::format("{}," //
|
|
|
fmt::format("{}," //
|
|
|
"{},{},{},{}," //
|
|
|
"{},{},{},{}," //
|
|
@ -254,7 +263,7 @@ void DisinfectionCtrlService::dumpDisinfectionLogsToCSV(DisinfectionCon |
|
|
dvalue, m_context.m_nowLoglevel, m_context.m_targetLoglevel, //
|
|
|
dvalue, m_context.m_nowLoglevel, m_context.m_targetLoglevel, //
|
|
|
ds->heatingStrip_getstate(), ds->airBlower_getstate(), ds->airCompressor_getstate(), ds->sprayLiquidPump_getGPM(), //
|
|
|
ds->heatingStrip_getstate(), ds->airBlower_getstate(), ds->airCompressor_getstate(), ds->sprayLiquidPump_getGPM(), //
|
|
|
m_deviceIoControlService->getDisinfectantVolume_g(), //
|
|
|
m_deviceIoControlService->getDisinfectantVolume_g(), //
|
|
|
formattimeS(m_context.m_remaintime))); |
|
|
|
|
|
|
|
|
formattimeS(remaintime))); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void DisinfectionCtrlService::finishDisinfection(DisinfectionContext& context) { |
|
|
void DisinfectionCtrlService::finishDisinfection(DisinfectionContext& context) { |
|
@ -322,7 +331,7 @@ void DisinfectionCtrlService::dumpDisinfectionLogs(DisinfectionContext& context) |
|
|
ds->heatingStrip_getstate(), ds->airBlower_getstate(), ds->airCompressor_getstate(), ds->sprayLiquidPump_getRPM(), //
|
|
|
ds->heatingStrip_getstate(), ds->airBlower_getstate(), ds->airCompressor_getstate(), ds->sprayLiquidPump_getRPM(), //
|
|
|
ds->getPressureSensorData(1), ds->getPressureSensorData(2), ds->getPressureSensorData(3), ds->getPressureSensorData(4), //
|
|
|
ds->getPressureSensorData(1), ds->getPressureSensorData(2), ds->getPressureSensorData(3), ds->getPressureSensorData(4), //
|
|
|
m_deviceIoControlService->getDisinfectantVolume_g(), //
|
|
|
m_deviceIoControlService->getDisinfectantVolume_g(), //
|
|
|
m_context.m_remaintime); |
|
|
|
|
|
|
|
|
getEstimatedRemainingTimeS()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
@ -530,8 +539,12 @@ int32_t DisinfectionCtrlService::getEstimatedRemainingTimeS() { |
|
|
if (m_context.m_state == kpreheat) { |
|
|
if (m_context.m_state == kpreheat) { |
|
|
return getPreHeatRaminTimeS(); |
|
|
return getPreHeatRaminTimeS(); |
|
|
} else if (m_context.m_state == kdisinfection || m_context.m_state == kdisinfection_take_a_break) { |
|
|
} else if (m_context.m_state == kdisinfection || m_context.m_state == kdisinfection_take_a_break) { |
|
|
|
|
|
if (m_context.dvalue > 0) { |
|
|
return m_context.m_remaintime; |
|
|
return m_context.m_remaintime; |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
return -1; |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
return 0; |
|
|
return 0; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|