优化日志记录 3.2.2
This commit is contained in:
parent
408d0c7c42
commit
1c85208ab9
1
common/u2g.h
Normal file
1
common/u2g.h
Normal file
@ -0,0 +1 @@
|
||||
void utf2gbk(char *utf,char* gbk);
|
@ -942,7 +942,7 @@ int SqliteDB::CalculateBattery()
|
||||
print_info("已经使用 = %f\n",atof(vecResSig[6].c_str()));
|
||||
|
||||
float remainBattery = capacity - usageBattery * 0.2;
|
||||
LOG_INFO("dataNodeNo = %s,已经使用 = %f,剩余电量 = %f\n",vecRes[i][0].c_str(),atof(vecResSig[6].c_str()),remainBattery);
|
||||
LOG_INFO("dataNodeNo = %s,batteryUsage = %f,batteryRemain = %f\n",vecRes[i][0].c_str(),atof(vecResSig[6].c_str()),remainBattery);
|
||||
memset(whereCon,0x00,sizeof(whereCon));
|
||||
sprintf(whereCon," dataNodeNo = '%s' order by timeStamp desc limit 0,1 ",vecRes[i][0].c_str());
|
||||
string strtimeStamp = sql_ctl->GetData(T_BATTERY_INFO(TNAME)," timeStamp ",whereCon);
|
||||
|
@ -12,7 +12,7 @@ int GlobalConfig::LinkCount = 0;
|
||||
int GlobalConfig::net0Status = 1;
|
||||
|
||||
|
||||
std::string GlobalConfig::Version = "3.2.1";
|
||||
std::string GlobalConfig::Version = "3.2.2";
|
||||
std::string GlobalConfig::MacAddr_G = "";
|
||||
std::string GlobalConfig::MacAddr_G2 = "";
|
||||
std::string GlobalConfig::IpAddr_G = "";
|
||||
|
@ -29,7 +29,7 @@ Dial dial;
|
||||
void CheckThread()
|
||||
{
|
||||
print_info("ENTER CHECK THREAD \n");
|
||||
std::string runinfo = "系统循环检测模块启动";
|
||||
std::string runinfo = "ENTER CHECK THREAD ";
|
||||
LOG_INFO(runinfo.c_str());
|
||||
int heart_count = 0;
|
||||
|
||||
@ -306,7 +306,7 @@ void CheckThread()
|
||||
char localtimestamp[32] = { 0 };
|
||||
GetTimeNet(localtimestamp, 1);
|
||||
char whereCon[1024] = {0};
|
||||
sprintf(whereCon," timestamp < '%ld' ",atol(localtimestamp) - 15638400); //删除半年前的数据
|
||||
sprintf(whereCon," timestamp < '%ld' ",atol(localtimestamp) - 5097600); //删除2个月前的数据
|
||||
sql_ctl->DeleteTableData(" t_battery_history ",whereCon);
|
||||
/*staticData = 0;
|
||||
Json::Value jsHeart;
|
||||
|
@ -1964,7 +1964,14 @@ void Uart::DealDataNodeFeature(const char *pData, int flag)
|
||||
char buf[20] = {0x00};
|
||||
int nodeResend = 0;
|
||||
sprintf(buf, "%02x%02x", pRecvData->ShortAddr[0], pRecvData->ShortAddr[1]);
|
||||
LOG_INFO("DealDataNodeFeature %02x%02x,isWave \n",pRecvData->ShortAddr[0], pRecvData->ShortAddr[1],flag);
|
||||
if (flag == 1)
|
||||
{
|
||||
LOG_INFO("DealDataNodeFeature %02x%02x, %d\n",pRecvData->ShortAddr[0], pRecvData->ShortAddr[1],flag);
|
||||
}else{
|
||||
LOG_INFO("DealDataNodeFeature %02x%02x\n",pRecvData->ShortAddr[0], pRecvData->ShortAddr[1]);
|
||||
}
|
||||
|
||||
|
||||
if (bSendTimeStamp)//波形处理中
|
||||
return;
|
||||
std::string strShortAddr = std::string(buf);
|
||||
@ -2216,7 +2223,8 @@ void Uart::DealDataNodeFeature(const char *pData, int flag)
|
||||
char selectCon[128] = { 0 };
|
||||
sprintf(selectCon, "channelID='%s' and sendMsg = '1' ORDER BY timeStamp ASC LIMIT 0,1",(strMeasurementID + "-S").c_str());
|
||||
std::string strTime = sql_ctl->GetData(szTableName, "timeStamp", selectCon);
|
||||
int Count = sql_ctl->GetTableRows(szTableName, NULL);
|
||||
sprintf(whereCon,"channelID='%s' and sendMsg = '1'",(strMeasurementID + "-S").c_str());
|
||||
int Count = sql_ctl->GetTableRows(szTableName, whereCon);
|
||||
if(Count == -1){
|
||||
sql_ctl->CreatedataStatictable(szTableName);
|
||||
}
|
||||
@ -3434,7 +3442,7 @@ void Uart::DealDataNodeFeature(const char *pData, int flag)
|
||||
bZigbeeSinal = false;
|
||||
}
|
||||
|
||||
LOG_INFO("DealDataNodeFeature end %02x%02x,isWave \n",pRecvData->ShortAddr[0], pRecvData->ShortAddr[1],flag);
|
||||
LOG_INFO("DealDataNodeFeature end %02x%02x\n",pRecvData->ShortAddr[0], pRecvData->ShortAddr[1]);
|
||||
}
|
||||
|
||||
void Uart::DealDataNodeWave(const char *pData)
|
||||
|
Loading…
x
Reference in New Issue
Block a user