From 0bb575eddebb8177571a5ac19edc550c3596407a Mon Sep 17 00:00:00 2001 From: zhaohe Date: Wed, 21 Aug 2024 18:16:40 +0800 Subject: [PATCH] fix some bug --- appdep/components/uart_printer/uart_printer.cpp | 2 +- appsrc/service/disinfection_logs_service.cpp | 10 ++++------ appsrc/service/disinfection_logs_service.hpp | 4 ++-- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/appdep/components/uart_printer/uart_printer.cpp b/appdep/components/uart_printer/uart_printer.cpp index 17e6347..7236f3b 100644 --- a/appdep/components/uart_printer/uart_printer.cpp +++ b/appdep/components/uart_printer/uart_printer.cpp @@ -23,7 +23,7 @@ void UartPrinter::print(string str) { logger->error("uart {} is not open", m_path); return; } - logger->info("print:{}", str); + // logger->info("print:{}", str); m_uart->send((char *)str.c_str(), str.size()); return; } \ No newline at end of file diff --git a/appsrc/service/disinfection_logs_service.cpp b/appsrc/service/disinfection_logs_service.cpp index a08cf1c..831e59a 100644 --- a/appsrc/service/disinfection_logs_service.cpp +++ b/appsrc/service/disinfection_logs_service.cpp @@ -157,10 +157,10 @@ void DisinfectionLogsService::initialize() { GET_TO_SERVICE(m_udiskMgrService); REG_EXTFN_VOID(getRecordList, void()); - REG_EXTFN_VOID(getRecord, void()); + REG_EXTFN(getRecord, void(string), logName); REG_EXTFN(deleteReport, void(string), logName); REG_EXTFN(exportRecord, void(vector), logNames); - REG_EXTFN_VOID(printRecord, void()); + REG_EXTFN(printRecord, void(string), logName); REG_EXTFN_VOID(selftest, void()); m_csvHeaderDict.insert(CSVHeader::time, "时间"); @@ -561,8 +561,7 @@ void DisinfectionLogsService::getRecordList(shared_ptr cxt) { cxt->rely = record; return; } -void DisinfectionLogsService::getRecord(shared_ptr cxt) { - string logName = cxt->params["logName"]; +void DisinfectionLogsService::getRecord(shared_ptr cxt, string logName) { string content = FileUtils().readFileAsString(fmt::format("{}{}.csv", LOG_STORGE_PATH, logName)); vector lines; split(content, lines, '\n'); @@ -586,9 +585,8 @@ void DisinfectionLogsService::exportRecord(shared_ptr cxt, ve return; } } -void DisinfectionLogsService::printRecord(shared_ptr cxt) { +void DisinfectionLogsService::printRecord(shared_ptr cxt,string logName) { // - string logName = cxt->params["logName"]; printRecordFile(logName); } diff --git a/appsrc/service/disinfection_logs_service.hpp b/appsrc/service/disinfection_logs_service.hpp index 8b8c872..1f448f1 100644 --- a/appsrc/service/disinfection_logs_service.hpp +++ b/appsrc/service/disinfection_logs_service.hpp @@ -52,10 +52,10 @@ class DisinfectionLogsService : public enable_shared_from_this cxt); - void getRecord(shared_ptr cxt); + void getRecord(shared_ptr cxt, string logName); void deleteReport(shared_ptr cxt,string logName); void exportRecord(shared_ptr cxt,vector logNames); - void printRecord(shared_ptr cxt); + void printRecord(shared_ptr cxt,string logName); void selftest(shared_ptr cxt); private: