修改状态信息上传频率,

This commit is contained in:
zhangsheng 2024-11-27 14:19:45 +08:00
parent 964074f8a9
commit 6854907bb4
3 changed files with 27 additions and 12 deletions

20
.vscode/settings.json vendored
View File

@ -81,7 +81,25 @@
"typeindex": "cpp",
"variant": "cpp",
"xstring": "cpp",
"xlocinfo": "cpp"
"xlocinfo": "cpp",
"charconv": "cpp",
"format": "cpp",
"forward_list": "cpp",
"ios": "cpp",
"locale": "cpp",
"xfacet": "cpp",
"xhash": "cpp",
"xiosbase": "cpp",
"xlocale": "cpp",
"xlocbuf": "cpp",
"xlocmes": "cpp",
"xlocmon": "cpp",
"xlocnum": "cpp",
"xloctime": "cpp",
"xmemory": "cpp",
"xtr1common": "cpp",
"xtree": "cpp",
"xutility": "cpp"
},
"C_Cpp.errorSquiggles": "disabled"
}

View File

@ -708,16 +708,12 @@ void JsonData::DataNodeStatusCheck() {
char whereCon[32] = {0};
sprintf(whereCon, "dataNodeNo='%s'", strDataNodeNo.c_str());
sqlite_db_ctrl::instance().UpdateTableData(T_SENSOR_INFO(TNAME), "status='0'", whereCon);
count++;
} else {
char whereCon[32] = {0};
sprintf(whereCon, "dataNodeNo='%s'", strDataNodeNo.c_str());
sqlite_db_ctrl::instance().UpdateTableData(T_SENSOR_INFO(TNAME), "status='1'", whereCon);
}
if (lTimeTemp > atoi(vetRes[i][21].c_str()) * 5 * 60) //判定传感器是否超过五次未传特征值
{
zlog_info(zct, "lTimeTemp = %d,featureInterVal = %d", lTimeTemp, atoi(vetRes[i][21].c_str()));
count++;
}
}
}
if (count == nSize && nodeOnline && count != 0) {

View File

@ -115,10 +115,9 @@ void CheckThread() {
}
}
if (120 == online_check) {
if (1800 == online_check) {
online_check = 0;
int Count = sqlite_db_ctrl::instance().GetTableRows(T_SENSOR_INFO(TNAME), NULL);
JsonData jd;
if (Count > 0) {
jd.DataNodeStatusCheck();
char localtimestamp[32] = {0};
@ -131,15 +130,17 @@ void CheckThread() {
long lTime = atol(nowTimetamp.c_str()) - atol(strTime.c_str());
zlog_info(zct, "online check = %ld", lTime);
}
jd.JsonCmd_07();
jd.JsonCmd_29();
jd.JsonCmd_30();
jd.JsonCmd_31();
}
if (7200 == Battery) {
Battery = 0;
zlog_info(zct, "Battery");
sqlite_db_ctrl::instance().CalculateBattery();
JsonData jd;
jd.JsonCmd_07();
jd.JsonCmd_29();
jd.JsonCmd_30();
jd.JsonCmd_31();
}
if (3500 == loose_check) {