You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
91 lines
1.8 KiB
91 lines
1.8 KiB
//
|
|
// Created by zwsd
|
|
//
|
|
|
|
#pragma once
|
|
#include <fstream>
|
|
#include <iostream>
|
|
#include <list>
|
|
#include <map>
|
|
#include <memory>
|
|
#include <mutex>
|
|
#include <set>
|
|
#include <sstream>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "iflytop/components/zcanreceiver/zcanhost.hpp"
|
|
#include "iflytop/core/core.hpp"
|
|
#include "zservice_container/zservice_container.hpp"
|
|
|
|
/**
|
|
* @brief
|
|
*
|
|
* service: DisinfectionCtrlService
|
|
*
|
|
* 监听事件:
|
|
* 依赖状态:
|
|
* 依赖服务:
|
|
* 作用:
|
|
*
|
|
*/
|
|
|
|
namespace iflytop {
|
|
using namespace std;
|
|
using namespace core;
|
|
class DisinfectionCtrlService : public enable_shared_from_this<DisinfectionCtrlService> {
|
|
ENABLE_LOGGER(DisinfectionCtrlService);
|
|
|
|
unique_ptr<Thread> m_disinfectionThread;
|
|
string m_disinfectionID;
|
|
|
|
int m_remaintime = 0;
|
|
bool m_isDisinfectionRunning = false;
|
|
recursive_mutex lock_;
|
|
|
|
int m_disinfectionWorkState = 0;
|
|
int m_replenishingFluidsWorkState = 0;
|
|
int m_drainingWorkState = 0;
|
|
|
|
shared_ptr<ZCanHost> m_zcanHost;
|
|
|
|
public:
|
|
DisinfectionCtrlService();
|
|
|
|
public:
|
|
void initialize();
|
|
/**
|
|
* @brief 开始消毒
|
|
*
|
|
* @param loglevel 消毒等级
|
|
*/
|
|
void startDisinfection(int loglevel, float roomVol);
|
|
void stopDisinfection();
|
|
void pauseDisinfection();
|
|
void continueDisinfection();
|
|
|
|
int getDisinfectionWorkState();
|
|
int getReplenishingFluidsWorkState();
|
|
int getDrainingWorkState();
|
|
|
|
/**
|
|
* @brief
|
|
*
|
|
* @return true
|
|
* @return false
|
|
*/
|
|
|
|
void startReplenishingFluids();
|
|
void stopReplenishingFluids();
|
|
|
|
void startDraining();
|
|
void stopDraining();
|
|
|
|
bool isDisinfectionRunning();
|
|
int32_t getEstimatedRemainingTimeS();
|
|
string getDisinfectionID();
|
|
|
|
private:
|
|
string createDisinfectionID();
|
|
};
|
|
} // namespace iflytop
|