Browse Source

update

storage-in-realtime
zhaohe 11 months ago
parent
commit
e632902cf6
  1. 10
      appsrc/service/app/add_liquid_service.cpp
  2. 6
      appsrc/service/app/air_leak_detect_test.cpp
  3. 3
      appsrc/service/app/disinfection_ctrl_service_ext.cpp
  4. 6
      appsrc/service/app/drain_liquid_service.cpp
  5. 7
      appsrc/service/app/pipeline_pressure_control.cpp
  6. 4
      appsrc/service/app/pipeline_pressure_control.hpp

10
appsrc/service/app/add_liquid_service.cpp

@ -142,8 +142,14 @@ void AddLiquidService::stop() {
} }
AddLiquidService::state_t AddLiquidService::getWorkstate() { return m_workstate; } AddLiquidService::state_t AddLiquidService::getWorkstate() { return m_workstate; }
void AddLiquidService::start(shared_ptr<MsgProcessContext> cxt, int stopatg) { start(stopatg); }
void AddLiquidService::stop(shared_ptr<MsgProcessContext> cxt) { stop(); }
void AddLiquidService::start(shared_ptr<MsgProcessContext> cxt, int stopatg) {
start(stopatg);
if (stateUpdateThread) stateUpdateThread->wake();
}
void AddLiquidService::stop(shared_ptr<MsgProcessContext> cxt) {
stop();
if (stateUpdateThread) stateUpdateThread->wake();
}
void AddLiquidService::getServiceConfig(shared_ptr<MsgProcessContext> cxt) { void AddLiquidService::getServiceConfig(shared_ptr<MsgProcessContext> cxt) {
json cfg; json cfg;
cfg["maxLiquid"] = PORT.getDisinfectantBucketCapacity(); cfg["maxLiquid"] = PORT.getDisinfectantBucketCapacity();

6
appsrc/service/app/air_leak_detect_test.cpp

@ -101,8 +101,12 @@ void AirLeakDetectTest::airLeakDetectTestThread(int inflationTimeMs) {
void AirLeakDetectTest::start(shared_ptr<MsgProcessContext> cxt, int inflationTimeMs) { // void AirLeakDetectTest::start(shared_ptr<MsgProcessContext> cxt, int inflationTimeMs) { //
start(inflationTimeMs); start(inflationTimeMs);
if (stateUpdateThread) stateUpdateThread->wake();
}
void AirLeakDetectTest::stop(shared_ptr<MsgProcessContext> cxt) {
stop();
if (stateUpdateThread) stateUpdateThread->wake();
} }
void AirLeakDetectTest::stop(shared_ptr<MsgProcessContext> cxt) { stop(); }
void AirLeakDetectTest::getServiceConfig(shared_ptr<MsgProcessContext> cxt) { void AirLeakDetectTest::getServiceConfig(shared_ptr<MsgProcessContext> cxt) {
if (PORT.isPipeDM()) { if (PORT.isPipeDM()) {

3
appsrc/service/app/disinfection_ctrl_service_ext.cpp

@ -60,14 +60,17 @@ void DisinfectionCtrlServiceExt::start(shared_ptr<MsgProcessContext> cxt, string
dcs->start(level); dcs->start(level);
ADD_USER_BEHAVIOR(ds->getLoginName(), kbehavior_do_disinfection, fmt::format("开始消毒,level:{}", level)); ADD_USER_BEHAVIOR(ds->getLoginName(), kbehavior_do_disinfection, fmt::format("开始消毒,level:{}", level));
// m_state = DisinfectionState::preheat; // m_state = DisinfectionState::preheat;
if (stateUpdateThread) stateUpdateThread->wake();
} }
void DisinfectionCtrlServiceExt::startWithFormula(shared_ptr<MsgProcessContext> cxt, string formulaid) { // void DisinfectionCtrlServiceExt::startWithFormula(shared_ptr<MsgProcessContext> cxt, string formulaid) { //
json formula = dcs->startWithFormula(formulaid); json formula = dcs->startWithFormula(formulaid);
ADD_USER_BEHAVIOR(ds->getLoginName(), kbehavior_do_formula, fmt::format("启动配置方,{}", formula["name"])); ADD_USER_BEHAVIOR(ds->getLoginName(), kbehavior_do_formula, fmt::format("启动配置方,{}", formula["name"]));
if (stateUpdateThread) stateUpdateThread->wake();
} }
void DisinfectionCtrlServiceExt::stop(shared_ptr<MsgProcessContext> cxt) { void DisinfectionCtrlServiceExt::stop(shared_ptr<MsgProcessContext> cxt) {
ADD_USER_BEHAVIOR(ds->getLoginName(), kbehavior_stop_disinfection, ""); ADD_USER_BEHAVIOR(ds->getLoginName(), kbehavior_stop_disinfection, "");
dcs->stop(); dcs->stop();
if (stateUpdateThread) stateUpdateThread->wake();
} }
void DisinfectionCtrlServiceExt::getRealtimeConfig(shared_ptr<MsgProcessContext> cxt) { void DisinfectionCtrlServiceExt::getRealtimeConfig(shared_ptr<MsgProcessContext> cxt) {

6
appsrc/service/app/drain_liquid_service.cpp

@ -76,8 +76,12 @@ void DrainLiquidService::stop() {
void DrainLiquidService::start(shared_ptr<MsgProcessContext> cxt) { // void DrainLiquidService::start(shared_ptr<MsgProcessContext> cxt) { //
start(); start();
if (stateUpdateThread) stateUpdateThread->wake();
}
void DrainLiquidService::stop(shared_ptr<MsgProcessContext> cxt) {
stop();
if (stateUpdateThread) stateUpdateThread->wake();
} }
void DrainLiquidService::stop(shared_ptr<MsgProcessContext> cxt) { stop(); }
void DrainLiquidService::getServiceConfig(shared_ptr<MsgProcessContext> cxt) { void DrainLiquidService::getServiceConfig(shared_ptr<MsgProcessContext> cxt) {
json cfg; json cfg;

7
appsrc/service/app/pipeline_pressure_control.cpp

@ -25,8 +25,8 @@ void PipelinePressureControl::initialize() {
REG_EXTFN(setIntensity, void(int), intensity); REG_EXTFN(setIntensity, void(int), intensity);
REG_EXTFN_VOID(getState, void(void)); REG_EXTFN_VOID(getState, void(void));
REG_EXTFN_VOID(getConfig, void(void)); REG_EXTFN_VOID(getConfig, void(void));
REG_EXTFN_VOID(startStateReport, void());
REG_EXTFN_VOID(stopStateReport, void());
// REG_EXTFN_VOID(startStateReport, void());
// REG_EXTFN_VOID(stopStateReport, void());
m_type = PressureType::constantPressure; m_type = PressureType::constantPressure;
m_intensity = 0; m_intensity = 0;
@ -91,7 +91,7 @@ void PipelinePressureControl::setIntensity(shared_ptr<MsgProcessContext> cxt, in
syncPressureValueState(); syncPressureValueState();
} }
void PipelinePressureControl::getState(shared_ptr<MsgProcessContext> cxt) { cxt->rely = getState(); } void PipelinePressureControl::getState(shared_ptr<MsgProcessContext> cxt) { cxt->rely = getState(); }
#if 0
void PipelinePressureControl::startStateReport(shared_ptr<MsgProcessContext> cxt) { void PipelinePressureControl::startStateReport(shared_ptr<MsgProcessContext> cxt) {
if (stateUpdateThread) { if (stateUpdateThread) {
stateUpdateThread->join(); stateUpdateThread->join();
@ -115,6 +115,7 @@ void PipelinePressureControl::stopStateReport(shared_ptr<MsgProcessContext> cxt)
stateUpdateThread = nullptr; stateUpdateThread = nullptr;
} }
} }
#endif
json PipelinePressureControl::getState() { json PipelinePressureControl::getState() {
json state; json state;
state["type"] = m_type; state["type"] = m_type;

4
appsrc/service/app/pipeline_pressure_control.hpp

@ -73,8 +73,8 @@ class PipelinePressureControl : public enable_shared_from_this<PipelinePressureC
void getState(shared_ptr<MsgProcessContext> cxt); void getState(shared_ptr<MsgProcessContext> cxt);
void getConfig(shared_ptr<MsgProcessContext> cxt); void getConfig(shared_ptr<MsgProcessContext> cxt);
void startStateReport(shared_ptr<MsgProcessContext> cxt);
void stopStateReport(shared_ptr<MsgProcessContext> cxt);
// void startStateReport(shared_ptr<MsgProcessContext> cxt);
// void stopStateReport(shared_ptr<MsgProcessContext> cxt);
json getState(); json getState();
private: private:

Loading…
Cancel
Save