12 changed files with 143 additions and 66 deletions
-
6README.md
-
2appsrc/appconfig/basic/zappversion.hpp
-
2appsrc/baseservice/db/device_ext_setting_dao.cpp
-
2appsrc/service/app_core.cpp
-
2appsrc/service/disinfection_logs_service.cpp
-
8appsrc/service/setting/ext_setting_mgr_service.cpp
-
1appsrc/service/setting/ext_setting_mgr_service.hpp
-
0appsrc/service/test_page_api_service.cpp
-
46appsrc/service/test_page_api_service.hpp
-
26appsrc/service/test_page_mgr_service.cpp
-
60appsrc/service/test_page_service_v2.cpp
-
54appsrc/service/test_page_service_v2.hpp
@ -1,3 +1,3 @@ |
|||
#pragma once
|
|||
#define VERSION "2.0.8"
|
|||
#define VERSION "2.0.9"
|
|||
#define PROJECT_NAME "TRANSMIT_DM"
|
@ -1,46 +0,0 @@ |
|||
#pragma once
|
|||
#include <fstream>
|
|||
#include <iostream>
|
|||
#include <list>
|
|||
#include <map>
|
|||
#include <memory>
|
|||
#include <set>
|
|||
#include <sstream>
|
|||
#include <string>
|
|||
#include <vector>
|
|||
//
|
|||
#include "appbase/appbean/test_page_iterm.hpp"
|
|||
#include "baseservice/baseservice.hpp"
|
|||
#include "service/hardware/device_io_ctrl_service.hpp"
|
|||
#include "testpage/test_page_processer.hpp"
|
|||
namespace iflytop { |
|||
using namespace testpage; |
|||
|
|||
|
|||
class TestPageMgrService : public enable_shared_from_this<TestPageMgrService> { |
|||
THISCLASS(TestPageMgrService); |
|||
|
|||
shared_ptr<DeviceStateService> m_ds; |
|||
shared_ptr<DeviceIoControlService> dcs; |
|||
|
|||
unique_ptr<Thread> m_thread; |
|||
|
|||
// shared_ptr<ZDictionary> m_dict;
|
|||
TestPageItemMgr m_testPageItemMgr; |
|||
|
|||
public: |
|||
void initialize(); |
|||
|
|||
private: |
|||
void getTestPageCfgInfo(shared_ptr<MsgProcessContext> cxt); |
|||
void onButton(shared_ptr<MsgProcessContext> cxt, string groupName, string buttonName, json params); |
|||
void readState(shared_ptr<MsgProcessContext> cxt); |
|||
void startReportState(shared_ptr<MsgProcessContext> cxt); |
|||
void stopReportState(shared_ptr<MsgProcessContext> cxt); |
|||
|
|||
|
|||
private: |
|||
int PrinterTest_test(); |
|||
}; |
|||
|
|||
} // namespace iflytop
|
@ -0,0 +1,60 @@ |
|||
#include "test_page_service_v2.hpp"
|
|||
|
|||
#include "appdep/components/ziconv.hpp"
|
|||
using namespace iflytop; |
|||
using namespace testpage; |
|||
|
|||
void TestPageServiceV2::initialize() { |
|||
GET_TO_SERVICE(m_ds); |
|||
GET_TO_SERVICE(dcs); |
|||
|
|||
// REG_EXTFN_VOID(getSetting, json(void)); // 单位g
|
|||
// REG_EXTFN(setDeviceId, void(string));
|
|||
|
|||
REG_EXTFN(doSprayPumpFroward, void(int), gpm); |
|||
REG_EXTFN(doSprayPumpBackward, void(int), gpm); |
|||
REG_EXTFN_VOID(doSprayPumpStop, void(void)); |
|||
|
|||
REG_EXTFN_VOID(doAddLiquid, void(void)); |
|||
REG_EXTFN_VOID(doDrainLiquid, void(void)); |
|||
REG_EXTFN_VOID(doStopAddLiquid, void(void)); |
|||
|
|||
REG_EXTFN_VOID(doPrinterTest, void(void)); |
|||
} |
|||
void TestPageServiceV2::doSprayPumpFroward(shared_ptr<MsgProcessContext> cxt, int gpm) { dcs->SprayPump_start(gpm); } |
|||
void TestPageServiceV2::doSprayPumpBackward(shared_ptr<MsgProcessContext> cxt, int gpm) { dcs->SprayPump_start(-gpm); } |
|||
void TestPageServiceV2::doSprayPumpStop(shared_ptr<MsgProcessContext> cxt) { dcs->SprayPump_stop(); } |
|||
|
|||
void TestPageServiceV2::doAddLiquid(shared_ptr<MsgProcessContext> cxt) { |
|||
dcs->setAddFluidChannelSelectorValve(true); |
|||
dcs->AddLiquidPump_stop(); |
|||
usleep(500 * 1000); |
|||
dcs->AddLiquidPump_addLiquid(); |
|||
} |
|||
void TestPageServiceV2::doDrainLiquid(shared_ptr<MsgProcessContext> cxt) { |
|||
dcs->setAddFluidChannelSelectorValve(true); |
|||
dcs->AddLiquidPump_stop(); |
|||
usleep(500 * 1000); |
|||
dcs->AddLiquidPump_drainLiquid(); |
|||
} |
|||
void TestPageServiceV2::doStopAddLiquid(shared_ptr<MsgProcessContext> cxt) { |
|||
dcs->AddLiquidPump_stop(); |
|||
usleep(1500 * 1000); |
|||
dcs->setAddFluidChannelSelectorValve(false); |
|||
} |
|||
|
|||
int TestPageServiceV2::doPrinterTest(shared_ptr<MsgProcessContext> cxt) { |
|||
GET_SERVICE(UartPrinter)->print("abcdefghijklmn\n"); |
|||
usleep(100 * 1000); |
|||
GET_SERVICE(UartPrinter)->print("opqrstuvwxyz\n"); |
|||
usleep(100 * 1000); |
|||
GET_SERVICE(UartPrinter)->print("1234567890\n"); |
|||
usleep(100 * 1000); |
|||
GET_SERVICE(UartPrinter)->print(ZIconv::utf8_to_gb2312("打印机中文测试\n")); |
|||
usleep(100 * 1000); |
|||
GET_SERVICE(UartPrinter)->print("\n"); |
|||
GET_SERVICE(UartPrinter)->print("\n"); |
|||
GET_SERVICE(UartPrinter)->print("\n"); |
|||
GET_SERVICE(UartPrinter)->print("\n"); |
|||
return 0; |
|||
} |
@ -0,0 +1,54 @@ |
|||
#pragma once
|
|||
|
|||
#include <fstream>
|
|||
#include <iostream>
|
|||
#include <list>
|
|||
#include <map>
|
|||
#include <memory>
|
|||
#include <set>
|
|||
#include <sstream>
|
|||
#include <string>
|
|||
#include <vector>
|
|||
//
|
|||
#include "appbase/appbean/test_page_iterm.hpp"
|
|||
#include "baseservice/baseservice.hpp"
|
|||
#include "service/hardware/device_io_ctrl_service.hpp"
|
|||
#include "testpage/test_page_processer.hpp"
|
|||
namespace iflytop { |
|||
using namespace testpage; |
|||
|
|||
/**
|
|||
* @brief |
|||
* |
|||
* |
|||
* WARNING: 这个页面接口的接口已经废弃,仅为了兼容老版本,接口不会再更新 |
|||
* Date: 2024-12-05 |
|||
* |
|||
*/ |
|||
|
|||
class TestPageServiceV2 : public enable_shared_from_this<TestPageServiceV2> { |
|||
THISCLASS(TestPageServiceV2); |
|||
|
|||
shared_ptr<DeviceStateService> m_ds; |
|||
shared_ptr<DeviceIoControlService> dcs; |
|||
|
|||
unique_ptr<Thread> m_thread; |
|||
|
|||
TestPageItemMgr m_testPageItemMgr; |
|||
|
|||
public: |
|||
void initialize(); |
|||
|
|||
private: |
|||
int doPrinterTest(shared_ptr<MsgProcessContext> cxt); |
|||
|
|||
void doSprayPumpFroward(shared_ptr<MsgProcessContext> cxt, int gpm); |
|||
void doSprayPumpBackward(shared_ptr<MsgProcessContext> cxt, int gpm); |
|||
void doSprayPumpStop(shared_ptr<MsgProcessContext> cxt); |
|||
|
|||
void doAddLiquid(shared_ptr<MsgProcessContext> cxt); |
|||
void doDrainLiquid(shared_ptr<MsgProcessContext> cxt); |
|||
void doStopAddLiquid(shared_ptr<MsgProcessContext> cxt); |
|||
}; |
|||
|
|||
} // namespace iflytop
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue