|
|
@ -35,8 +35,22 @@ void DisinfectionCtrlService::startDisinfection(int loglevel, float roomVol) { |
|
|
|
} |
|
|
|
|
|
|
|
m_disinfectionID = createDisinfectionID(); |
|
|
|
m_remaintime = 100; |
|
|
|
m_remaintime = 20 * 60; |
|
|
|
m_isDisinfectionRunning = true; |
|
|
|
logger->info("startDisinfection {} {} {}", loglevel, roomVol, m_disinfectionID); |
|
|
|
m_drainingWorkState = 1; |
|
|
|
|
|
|
|
m_zcanHost->writeio(0, 1); |
|
|
|
m_zcanHost->writeio(1, 1); |
|
|
|
sleep(1); |
|
|
|
m_zcanHost->writeio(2, 1); |
|
|
|
m_zcanHost->writeio(3, 1); |
|
|
|
sleep(1); |
|
|
|
m_zcanHost->writeio(4, 1); |
|
|
|
m_zcanHost->writeio(5, 1); |
|
|
|
sleep(1); |
|
|
|
m_zcanHost->pumpctrl_c1004(2, 300, 1000); |
|
|
|
|
|
|
|
m_disinfectionThread.reset(new Thread("m_disinfectionThread", [this, loglevel]() { |
|
|
|
// do something
|
|
|
|
// m_disinfectionThread->detach();
|
|
|
@ -58,6 +72,13 @@ void DisinfectionCtrlService::startDisinfection(int loglevel, float roomVol) { |
|
|
|
{ m_isDisinfectionRunning = false; } |
|
|
|
})); |
|
|
|
} |
|
|
|
|
|
|
|
int DisinfectionCtrlService::getDisinfectionWorkState() { return m_disinfectionWorkState; } |
|
|
|
int DisinfectionCtrlService::getReplenishingFluidsWorkState() { return m_replenishingFluidsWorkState; } |
|
|
|
int DisinfectionCtrlService::getDrainingWorkState() { return m_drainingWorkState; } |
|
|
|
|
|
|
|
void DisinfectionCtrlService::pauseDisinfection() { m_drainingWorkState = 2; } |
|
|
|
void DisinfectionCtrlService::continueDisinfection() { m_drainingWorkState = 1; } |
|
|
|
void DisinfectionCtrlService::stopDisinfection() { |
|
|
|
lock_guard<recursive_mutex> lock(lock_); |
|
|
|
|
|
|
@ -67,6 +88,18 @@ void DisinfectionCtrlService::stopDisinfection() { |
|
|
|
} |
|
|
|
m_remaintime = 0; |
|
|
|
logger->info("stop disinfection {}", m_disinfectionID); |
|
|
|
|
|
|
|
m_zcanHost->writeio(0, 0); |
|
|
|
m_zcanHost->writeio(1, 0); |
|
|
|
sleep(1); |
|
|
|
m_zcanHost->writeio(2, 0); |
|
|
|
m_zcanHost->writeio(3, 0); |
|
|
|
sleep(1); |
|
|
|
m_zcanHost->writeio(4, 0); |
|
|
|
m_zcanHost->writeio(5, 0); |
|
|
|
sleep(1); |
|
|
|
m_zcanHost->pumpctrl_c1004(2, 300, 0); |
|
|
|
m_drainingWorkState = 0; |
|
|
|
} |
|
|
|
bool DisinfectionCtrlService::isDisinfectionRunning() { |
|
|
|
lock_guard<recursive_mutex> lock(lock_); |
|
|
@ -82,8 +115,24 @@ string DisinfectionCtrlService::getDisinfectionID() { |
|
|
|
return m_disinfectionID; |
|
|
|
} |
|
|
|
|
|
|
|
void DisinfectionCtrlService::startReplenishingFluids() {} |
|
|
|
void DisinfectionCtrlService::stopReplenishingFluids() {} |
|
|
|
void DisinfectionCtrlService::startReplenishingFluids() { |
|
|
|
logger->info("startReplenishingFluids"); |
|
|
|
m_zcanHost->pumpctrl_c1004(1, 300, 1000); |
|
|
|
m_replenishingFluidsWorkState = 1; |
|
|
|
} |
|
|
|
void DisinfectionCtrlService::stopReplenishingFluids() { |
|
|
|
logger->info("stopReplenishingFluids"); |
|
|
|
m_zcanHost->pumpctrl_c1004(1, 300, 0); |
|
|
|
m_replenishingFluidsWorkState = 0; |
|
|
|
} |
|
|
|
|
|
|
|
void DisinfectionCtrlService::startDraining() {} |
|
|
|
void DisinfectionCtrlService::stopDraining() {} |
|
|
|
void DisinfectionCtrlService::startDraining() { |
|
|
|
logger->info("startDraining"); |
|
|
|
m_zcanHost->pumpctrl_c1004(1, 300, -1000); |
|
|
|
m_replenishingFluidsWorkState = 1; |
|
|
|
} |
|
|
|
void DisinfectionCtrlService::stopDraining() { |
|
|
|
logger->info("stopDraining"); |
|
|
|
m_zcanHost->pumpctrl_c1004(1, 300, 0); |
|
|
|
m_replenishingFluidsWorkState = 0; |
|
|
|
} |