14 changed files with 185 additions and 105 deletions
-
1appsrc/appbase/appbase.hpp
-
31appsrc/appbase/appbean/h2o2_sensor_data_snapshot.hpp
-
15appsrc/appbase/appevent/app_disinfection_finished_event.hpp
-
34appsrc/appbase/appevent/app_disinfection_snapshot_event.hpp
-
15appsrc/appbase/appevent/app_disinfection_start_event.hpp
-
5appsrc/appbase/appevent/app_events.hpp
-
1appsrc/appbase/appevent/app_promopt_event.hpp
-
25appsrc/appbase/disinfection_snapshot.hpp
-
31appsrc/service/app/disinfection_ctrl/disinfection_ctrl_service.cpp
-
27appsrc/service/app/disinfection_ctrl/disinfection_ctrl_service.hpp
-
42appsrc/service/disinfection_logs_service.cpp
-
29appsrc/service/disinfection_logs_service.hpp
-
15appsrc/service/hardware/base/h2o2_sensor_data_mgr.hpp
-
19appsrc/service/hardware/disinfectant_weight_update_service.cpp
@ -0,0 +1,31 @@ |
|||||
|
#pragma once
|
||||
|
#include <fstream>
|
||||
|
#include <functional>
|
||||
|
#include <iostream>
|
||||
|
#include <list>
|
||||
|
#include <map>
|
||||
|
#include <memory>
|
||||
|
#include <set>
|
||||
|
#include <sstream>
|
||||
|
#include <string>
|
||||
|
#include <vector>
|
||||
|
namespace iflytop { |
||||
|
using namespace std; |
||||
|
|
||||
|
class H2O2SensorDataSnapshot { |
||||
|
public: |
||||
|
vector<bool> isExpired = {}; |
||||
|
|
||||
|
vector<float> h2o2 = {}; // ppm
|
||||
|
vector<float> humid = {}; // %RH
|
||||
|
vector<float> temp = {}; // °C
|
||||
|
vector<float> saturation = {}; // %RS
|
||||
|
|
||||
|
float minH2O2 = 0; |
||||
|
float maxH2O2 = 0; |
||||
|
float maxHumid = 0; |
||||
|
float maxSaturation = 0; |
||||
|
|
||||
|
int getSensorDataNum() { return h2o2.size(); } |
||||
|
}; |
||||
|
} // namespace iflytop
|
@ -0,0 +1,15 @@ |
|||||
|
#pragma once
|
||||
|
#include "iapp_event.hpp"
|
||||
|
namespace iflytop { |
||||
|
|
||||
|
class AppDisinfectionFinishedEvent : public IAppEvent { |
||||
|
private: |
||||
|
string sessionId; |
||||
|
|
||||
|
public: |
||||
|
AppDisinfectionFinishedEvent(string sessionId) : sessionId(sessionId) {} |
||||
|
virtual ~AppDisinfectionFinishedEvent() {} |
||||
|
string getSessionId() { return sessionId; } |
||||
|
}; |
||||
|
|
||||
|
} // namespace iflytop
|
@ -0,0 +1,34 @@ |
|||||
|
#pragma once
|
||||
|
|
||||
|
#include "appbase/appbean/disinfection_state.hpp"
|
||||
|
#include "appbase/appbean/h2o2_sensor_data_snapshot.hpp"
|
||||
|
#include "iapp_event.hpp"
|
||||
|
#include "iflytop/core/core.hpp"
|
||||
|
namespace iflytop { |
||||
|
|
||||
|
class DisinfectionStateSnapshot { |
||||
|
public: |
||||
|
DisinfectionState state; |
||||
|
zsystem_tp time; |
||||
|
|
||||
|
shared_ptr<H2O2SensorDataSnapshot> h2o2Snapshot; |
||||
|
|
||||
|
float dval; |
||||
|
float nlog; |
||||
|
float tlog; |
||||
|
|
||||
|
int remainDisinfectant; |
||||
|
int remainTime; |
||||
|
}; |
||||
|
|
||||
|
class AppDisinfectionSnapshotEvent : public IAppEvent { |
||||
|
private: |
||||
|
shared_ptr<DisinfectionStateSnapshot> stateSnapshot; |
||||
|
|
||||
|
public: |
||||
|
AppDisinfectionSnapshotEvent(shared_ptr<DisinfectionStateSnapshot> stateSnapshot) : stateSnapshot(stateSnapshot) {} |
||||
|
virtual ~AppDisinfectionSnapshotEvent() {} |
||||
|
shared_ptr<DisinfectionStateSnapshot> getStateSnapshot() { return stateSnapshot; } |
||||
|
}; |
||||
|
|
||||
|
} // namespace iflytop
|
@ -0,0 +1,15 @@ |
|||||
|
#pragma once
|
||||
|
#include "iapp_event.hpp"
|
||||
|
namespace iflytop { |
||||
|
|
||||
|
class AppDisinfectionStartEvent : public IAppEvent { |
||||
|
private: |
||||
|
string sessionId; |
||||
|
|
||||
|
public: |
||||
|
AppDisinfectionStartEvent(string sessionId) : sessionId(sessionId) {} |
||||
|
virtual ~AppDisinfectionStartEvent() {} |
||||
|
string getSessionId() { return sessionId; } |
||||
|
}; |
||||
|
|
||||
|
} // namespace iflytop
|
@ -1,4 +1,7 @@ |
|||||
#pragma once
|
#pragma once
|
||||
|
#include "app_disinfection_finished_event.hpp"
|
||||
|
#include "app_disinfection_snapshot_event.hpp"
|
||||
|
#include "app_disinfection_start_event.hpp"
|
||||
#include "app_promopt_event.hpp"
|
#include "app_promopt_event.hpp"
|
||||
#include "app_warning_promopt_event.hpp"
|
#include "app_warning_promopt_event.hpp"
|
||||
#include "iapp_event.hpp"
|
|
||||
|
#include "iapp_event.hpp"
|
@ -1,25 +0,0 @@ |
|||||
#pragma once
|
|
||||
#include "appbean/disinfection_state.hpp"
|
|
||||
#include "iflytop/core/components/timeutils.hpp"
|
|
||||
|
|
||||
namespace iflytop { |
|
||||
using namespace core; |
|
||||
|
|
||||
class StateSnapshot { |
|
||||
public: |
|
||||
DisinfectionState state; |
|
||||
zsystem_tp time; |
|
||||
|
|
||||
int32_t h2o2[10]; // ppm
|
|
||||
int32_t humid[10]; // %RH
|
|
||||
int32_t temp[10]; // °C
|
|
||||
int32_t saturation[10]; // %RS
|
|
||||
|
|
||||
int min_h2o2; |
|
||||
int max_h2o2; |
|
||||
int max_humid; |
|
||||
int max_saturation; |
|
||||
|
|
||||
float dloglevel; |
|
||||
}; |
|
||||
} // namespace iflytop
|
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue