|
@ -6,24 +6,25 @@ void DebugPageTestService::initialize() { |
|
|
REG_EXTFN_VOID(enterTestMode, void(void)); |
|
|
REG_EXTFN_VOID(enterTestMode, void(void)); |
|
|
REG_EXTFN_VOID(exitTestMode, void(void)); |
|
|
REG_EXTFN_VOID(exitTestMode, void(void)); |
|
|
REG_EXTFN(startGenFakeH2O2Data, void(json), data); |
|
|
REG_EXTFN(startGenFakeH2O2Data, void(json), data); |
|
|
|
|
|
REG_EXTFN_VOID(startGenFakeHighH2O2Data, void(void)); |
|
|
REG_EXTFN_VOID(stopGenFakeH2O2Data, void(void)); |
|
|
REG_EXTFN_VOID(stopGenFakeH2O2Data, void(void)); |
|
|
REG_EXTFN_VOID(getGenFakeH2O2DataDemoJson, void(void)); |
|
|
REG_EXTFN_VOID(getGenFakeH2O2DataDemoJson, void(void)); |
|
|
|
|
|
|
|
|
REG_EXTFN_VOID(triggerAppWarningPromoptEvent, void(void)); |
|
|
REG_EXTFN_VOID(triggerAppWarningPromoptEvent, void(void)); |
|
|
REG_EXTFN(triggerPromptEvent, void(string), message); |
|
|
REG_EXTFN(triggerPromptEvent, void(string), message); |
|
|
|
|
|
|
|
|
REG_EXTFN(test_int, int(json), param0); |
|
|
|
|
|
REG_EXTFN(test_int, int(SettingId), param0); |
|
|
|
|
|
REG_EXTFN(test_int, int(int), param0); |
|
|
|
|
|
REG_EXTFN(test_string, void(string), param0); |
|
|
|
|
|
REG_EXTFN(test_float, void(float), param0); |
|
|
|
|
|
REG_EXTFN(test_double, void(double), param0); |
|
|
|
|
|
REG_EXTFN(test_bool, void(bool), param0); |
|
|
|
|
|
REG_EXTFN(test_vector_int, void(vector<int>), param0); |
|
|
|
|
|
REG_EXTFN(test_vector_string, void(vector<string>), param0); |
|
|
|
|
|
REG_EXTFN(test_vector_double, void(vector<double>), param0); |
|
|
|
|
|
REG_EXTFN(test_vecto_json, void(vector<json>), param0); |
|
|
|
|
|
REG_EXTFN(test_vecto_bool, void(vector<bool>), param0); |
|
|
|
|
|
|
|
|
// REG_EXTFN(test_int, int(json), param0);
|
|
|
|
|
|
// REG_EXTFN(test_int, int(SettingId), param0);
|
|
|
|
|
|
// REG_EXTFN(test_int, int(int), param0);
|
|
|
|
|
|
// REG_EXTFN(test_string, void(string), param0);
|
|
|
|
|
|
// REG_EXTFN(test_float, void(float), param0);
|
|
|
|
|
|
// REG_EXTFN(test_double, void(double), param0);
|
|
|
|
|
|
// REG_EXTFN(test_bool, void(bool), param0);
|
|
|
|
|
|
// REG_EXTFN(test_vector_int, void(vector<int>), param0);
|
|
|
|
|
|
// REG_EXTFN(test_vector_string, void(vector<string>), param0);
|
|
|
|
|
|
// REG_EXTFN(test_vector_double, void(vector<double>), param0);
|
|
|
|
|
|
// REG_EXTFN(test_vecto_json, void(vector<json>), param0);
|
|
|
|
|
|
// REG_EXTFN(test_vecto_bool, void(vector<bool>), param0);
|
|
|
// REG_EXTFN(test_vecto_enum, void(vector<SettingId>), param0);
|
|
|
// REG_EXTFN(test_vecto_enum, void(vector<SettingId>), param0);
|
|
|
} |
|
|
} |
|
|
void DebugPageTestService::test_json(shared_ptr<MsgProcessContext> cxt, json param0) {} |
|
|
void DebugPageTestService::test_json(shared_ptr<MsgProcessContext> cxt, json param0) {} |
|
@ -56,6 +57,27 @@ typedef struct { |
|
|
|
|
|
|
|
|
#endif
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
void DebugPageTestService::startGenFakeHighH2O2Data(shared_ptr<MsgProcessContext> cxt) { |
|
|
|
|
|
if (m_genFakeH2O2DataThread) { |
|
|
|
|
|
m_genFakeH2O2DataThread->join(); |
|
|
|
|
|
m_genFakeH2O2DataThread = nullptr; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
m_genFakeH2O2DataThread.reset(new Thread("genFakeH2O2DataThread", [this]() { |
|
|
|
|
|
while (!ThisThread().getExitFlag()) { |
|
|
|
|
|
ThisThread().sleepForMs(1000); |
|
|
|
|
|
|
|
|
|
|
|
report_h2o2_data_t reportData; |
|
|
|
|
|
reportData.rh = 50 * 10; |
|
|
|
|
|
reportData.h2o2 = 400; |
|
|
|
|
|
reportData.temp = 25 * 10; // 温度是整数,乘以10
|
|
|
|
|
|
reportData.rs = 50 * 10; // rs is in %RS, convert to float
|
|
|
|
|
|
|
|
|
|
|
|
h2o2SensorStateSyncService->updateH2o2SensorData(H2O2SensorType::Internal, 1, &reportData); |
|
|
|
|
|
} |
|
|
|
|
|
})); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
void DebugPageTestService::startGenFakeH2O2Data(shared_ptr<MsgProcessContext> cxt, json data) { |
|
|
void DebugPageTestService::startGenFakeH2O2Data(shared_ptr<MsgProcessContext> cxt, json data) { |
|
|
if (m_genFakeH2O2DataThread) { |
|
|
if (m_genFakeH2O2DataThread) { |
|
|
m_genFakeH2O2DataThread->join(); |
|
|
m_genFakeH2O2DataThread->join(); |
|
@ -136,5 +158,4 @@ void DebugPageTestService::triggerPromptEvent(shared_ptr<MsgProcessContext> cxt, |
|
|
AppEventBus::ins()->pushPromoptEvent(message); |
|
|
AppEventBus::ins()->pushPromoptEvent(message); |
|
|
} |
|
|
} |
|
|
void DebugPageTestService::triggerAppCheckPointFailEvent(shared_ptr<MsgProcessContext> cxt) { //
|
|
|
void DebugPageTestService::triggerAppCheckPointFailEvent(shared_ptr<MsgProcessContext> cxt) { //
|
|
|
|
|
|
|
|
|
} |
|
|
} |