|
|
@ -613,9 +613,42 @@ void DisinfectionCtrlService::startDraining() { |
|
|
|
m_disinfectionThread = nullptr; |
|
|
|
} |
|
|
|
|
|
|
|
m_disinfectionThread.reset(new Thread("disinfectionThread", [this]() { |
|
|
|
ThisThread thisThread; |
|
|
|
|
|
|
|
m_deviceIoControlService->drainingPump_open(); |
|
|
|
logger->info("startDraining "); |
|
|
|
|
|
|
|
auto startdrainingtime = zsteady_clock().now(); |
|
|
|
|
|
|
|
zsteady_tp volumeReachZeroTime; |
|
|
|
bool volumeReachZeroFlag = false; |
|
|
|
|
|
|
|
while (!thisThread.getExitFlag()) { |
|
|
|
int32_t nowvolume = m_deviceIoControlService->getDisinfectantVolume_g(); |
|
|
|
logger->info("draining remain {} g", nowvolume); |
|
|
|
if (!volumeReachZeroFlag && nowvolume == 0) { |
|
|
|
volumeReachZeroTime = zsteady_clock().now(); |
|
|
|
volumeReachZeroFlag = true; |
|
|
|
} |
|
|
|
|
|
|
|
if (volumeReachZeroFlag) { |
|
|
|
logger->info("stopDraining after {} s", 30 - zsteady_clock().elapsedTimeS(volumeReachZeroTime)); |
|
|
|
if (zsteady_clock().elapsedTimeS(volumeReachZeroTime) > 30) { |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
thisThread.sleepForMs(1000); |
|
|
|
} |
|
|
|
logger->info("stopDraining"); |
|
|
|
// replenishingFluidsPump_close();
|
|
|
|
m_deviceIoControlService->drainingPump_close(); |
|
|
|
m_drainingWorkState = 0; |
|
|
|
})); |
|
|
|
|
|
|
|
logger->info("startDraining"); |
|
|
|
// drainingPump_open();
|
|
|
|
m_deviceIoControlService->drainingPump_open(); |
|
|
|
m_drainingWorkState = 1; |
|
|
|
} |
|
|
|
/**
|
|
|
|