6 changed files with 174 additions and 14 deletions
-
18appsrc/service/app/add_liquid_service.cpp
-
13appsrc/service/app/add_liquid_service.hpp
-
31appsrc/service/app/air_tightness_test.cpp
-
52appsrc/service/app/air_tightness_test.hpp
-
32appsrc/service/app/drain_liquid_service.cpp
-
42appsrc/service/app/drain_liquid_service.hpp
@ -1,4 +1,31 @@ |
|||||
#include "air_tightness_test.hpp"
|
#include "air_tightness_test.hpp"
|
||||
|
|
||||
using namespace iflytop; |
using namespace iflytop; |
||||
void AirTightnessTest::initialize() { logger->info("AirTightnessTest initialize"); } |
|
||||
|
void AirTightnessTest::initialize() { |
||||
|
logger->info("AirTightnessTest initialize"); |
||||
|
REGFNV2(AirTightnessTest, start); |
||||
|
REGFNV2(AirTightnessTest, stop); |
||||
|
REGFNV2(AirTightnessTest, getState); |
||||
|
REGFNV2(AirTightnessTest, getServiceConfig); |
||||
|
} |
||||
|
|
||||
|
void AirTightnessTest::start() { m_workstate = kleakTesting; } |
||||
|
void AirTightnessTest::stop() { m_workstate = kidle; } |
||||
|
AirTightnessTest::state_t AirTightnessTest::getWorkstate() { return m_workstate; } |
||||
|
|
||||
|
void AirTightnessTest::fn_start(shared_ptr<MsgProcessContext> cxt) { //
|
||||
|
start(); |
||||
|
} |
||||
|
void AirTightnessTest::fn_stop(shared_ptr<MsgProcessContext> cxt) { stop(); } |
||||
|
void AirTightnessTest::fn_getState(shared_ptr<MsgProcessContext> cxt) { //
|
||||
|
cxt->content["workState"] = state2str(getWorkstate()); |
||||
|
cxt->content["workStateDisplay"] = state2chstr(getWorkstate()); |
||||
|
cxt->content["pressure"] = 3.1; |
||||
|
} |
||||
|
void AirTightnessTest::fn_getServiceConfig(shared_ptr<MsgProcessContext> cxt) { |
||||
|
json cfg; |
||||
|
cfg["pressureUint"] = "kPa"; |
||||
|
cfg["pressureMax"] = 5.0; |
||||
|
cfg["show"] = true; |
||||
|
cfg["updatePeriod"] = 300; |
||||
|
cxt->content = cfg; |
||||
|
} |
@ -1,4 +1,32 @@ |
|||||
#include "drain_liquid_service.hpp"
|
#include "drain_liquid_service.hpp"
|
||||
|
|
||||
using namespace iflytop; |
using namespace iflytop; |
||||
void DrainLiquidService::initialize() { logger->info("DrainLiquidService initialize"); } |
|
||||
|
void DrainLiquidService::initialize() { |
||||
|
logger->info("DrainLiquidService initialize"); |
||||
|
REGFNV2(DrainLiquidService, start); |
||||
|
REGFNV2(DrainLiquidService, stop); |
||||
|
REGFNV2(DrainLiquidService, getState); |
||||
|
REGFNV2(DrainLiquidService, getServiceConfig); |
||||
|
} |
||||
|
|
||||
|
void DrainLiquidService::start() { m_workstate = kwork; } |
||||
|
void DrainLiquidService::stop() { m_workstate = kidle; } |
||||
|
DrainLiquidService::state_t DrainLiquidService::getWorkstate() { return m_workstate; } |
||||
|
|
||||
|
void DrainLiquidService::fn_start(shared_ptr<MsgProcessContext> cxt) { //
|
||||
|
start(); |
||||
|
} |
||||
|
void DrainLiquidService::fn_stop(shared_ptr<MsgProcessContext> cxt) { stop(); } |
||||
|
void DrainLiquidService::fn_getState(shared_ptr<MsgProcessContext> cxt) { //
|
||||
|
cxt->content["workState"] = state2str(getWorkstate()); |
||||
|
cxt->content["workStateDisplay"] = state2chstr(getWorkstate()); |
||||
|
cxt->content["nowLiquid"] = 1000; |
||||
|
} |
||||
|
|
||||
|
void DrainLiquidService::fn_getServiceConfig(shared_ptr<MsgProcessContext> cxt) { |
||||
|
json cfg; |
||||
|
cfg["maxLiquid"] = 4950; |
||||
|
cfg["show"] = true; |
||||
|
cfg["updatePeriod"] = 300; |
||||
|
|
||||
|
cxt->content = cfg; |
||||
|
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue