From 3be3710ffe817845f67af1a30fb38ceaf4d34407 Mon Sep 17 00:00:00 2001 From: fuqipeng <1285534278@qq.com> Date: Thu, 2 Mar 2023 11:10:30 +0800 Subject: [PATCH] =?utf8?q?=E7=A8=B3=E5=AE=9A=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Modules/hotcameramodule.cpp | 21 ++++++- Modules/main.cpp | 110 ++++++++++++++++++++++++++++++++++++ Modules/mynetmanager.cpp | 1 - 3 files changed, 128 insertions(+), 4 deletions(-) diff --git a/Modules/hotcameramodule.cpp b/Modules/hotcameramodule.cpp index 946d4491..27f3ea03 100644 --- a/Modules/hotcameramodule.cpp +++ b/Modules/hotcameramodule.cpp @@ -118,21 +118,32 @@ void HotCameraModule::moduleParaReadFromFile(HotCameraPara *p) { QTextStream in(&file); p->IP_Adress = in.readLine(); + qDebug()<IP_Adress); p->month = in.readLine().toInt(); + qDebug()<month); p->week = in.readLine().toInt(); + qDebug()<week); p->day = in.readLine().toInt(); + qDebug()<day); QString temp = in.readLine(); + qDebug()<start_hour = hours.toUInt(); p->start_minute = minutes.toUInt(); temp = in.readLine(); + qDebug()<end_hour = hours.toUInt(); + qDebug()<end_hour); p->end_minute = minutes.toUInt(); + qDebug()<end_minute); p->reflectivetemperature = in.readLine().toInt(); p->emissivity = in.readLine().toFloat(); @@ -338,7 +349,9 @@ bool HotCameraModule::eventTimeChangeCheck() { qDebug()<< QString("%1 changed!").arg(time_change_file); //更新参数文件,时间范围值会被更新 - moduleParaReadFromFile(¶); +// HotCameraPara temp; +// moduleParaReadFromFile(&temp); +// memcpy(¶, & temp, sizeof(HotCameraPara)); QFile file_change_time(time_change_file); file_change_time.remove(); @@ -367,7 +380,7 @@ bool HotCameraModule::eventConnectTimeCheck() modleDisConnect(); } - }else if(net->KeepState() != NET_DISCONNECT){ + }else { modleDisConnect(); } @@ -443,5 +456,7 @@ void HotCameraModule::moduleConnect() void HotCameraModule::modleDisConnect() { - net->KeepDisconnect(); + if(net->KeepState() != NET_DISCONNECT){ + net->KeepDisconnect(); + } } diff --git a/Modules/main.cpp b/Modules/main.cpp index d8a48be9..6ba3ece6 100644 --- a/Modules/main.cpp +++ b/Modules/main.cpp @@ -3,12 +3,122 @@ #include "hotcameramodule.h" +#ifndef WIN32 + +#include +#include +#include +#include +static void print_memory_base(void) +{ + char strbuf[512]; + pid_t pid = getpid(); + FILE *pf; + + sprintf(strbuf, "/proc/%d/maps", pid); + pf = fopen(strbuf, "r"); + if(NULL == pf) return; + while(fgets(strbuf, sizeof(strbuf), pf) != NULL) { + printf("%s", strbuf); + } + fclose(pf); +} +static void print_stack_trace(void) +{ + char strbuf[256], *pstr; + void *array[64]; + size_t size, i; + char **strings; + + size = backtrace(array, 64); + strings = backtrace_symbols(array, size); + //printf ("Obtained %zd stack frames.\n", size); + + pstr = strbuf; + for(i=1; i<=size; i++) { + sprintf(pstr, "%08X:", (int)array[i]); + pstr += strlen(pstr); + if(0 == (i%8)) { + printf("%s\n", strbuf); + pstr = strbuf; + } + } + if(pstr != strbuf) { + printf("%s\n", strbuf); + } + + for(i=0; i