Merge branch 'dg101_refine_schedule' of http://192.168.0.10:3000/pandx/WLG into dg101_refine_schedule

This commit is contained in:
pandx 2025-04-11 14:18:33 +08:00
commit 4cad199e7f
3 changed files with 21 additions and 16 deletions

View File

@ -899,7 +899,7 @@ std::string JsonData::JsonCmd_Cgi_62(Param_62 &param){
if (nSize > 0) {
char szTableName[100] = {0x00}, whereCon[256] = {0x00},selectCon[100] = {0x00};
if (param.mMode == 1){
sprintf(selectCon," dataNodeNo,channelID,timeStamp,sendMsg,nodeResend ");
sprintf(selectCon," dataNodeNo,channelID,timeStamp,sendMsg,sendMsg,nodeResend ");
sprintf(szTableName,"t_data_%s",param.MeasurementID.c_str());
}else{
sprintf(selectCon," * ");
@ -908,14 +908,14 @@ std::string JsonData::JsonCmd_Cgi_62(Param_62 &param){
if(param.straxis == ""){
if (param.mMode == 1){
sprintf(whereCon, " channelID like '%%%s%%' and timeStamp < '%s' and timeStamp > '%s' ", param.MeasurementID.c_str(), param.timeEnd.c_str(), param.timeStart.c_str());
sprintf(whereCon, " channelID like '%s-X' and timeStamp < '%s' and timeStamp > '%s' ", param.MeasurementID.c_str(), param.timeEnd.c_str(), param.timeStart.c_str());
}else{
sprintf(whereCon, " data_nodeno like '%%%s%%' and timeStamp < '%s' and timeStamp > '%s' ", param.MeasurementID.c_str(), param.timeEnd.c_str(), param.timeStart.c_str());
}
}
else{
if (param.mMode == 1){
sprintf(whereCon, " channelID = '%s-%s' and timeStamp < '%s' and timeStamp > '%s' ", param.MeasurementID.c_str(),param.straxis.c_str(), param.timeEnd.c_str(), param.timeStart.c_str());
sprintf(whereCon, " channelID = '%s-X' and timeStamp < '%s' and timeStamp > '%s' ", param.MeasurementID.c_str(), param.timeEnd.c_str(), param.timeStart.c_str());
}else{
sprintf(whereCon, " data_nodeno = '%s-%s' and timeStamp < '%s' and timeStamp > '%s' ", param.MeasurementID.c_str(),param.straxis.c_str(), param.timeEnd.c_str(), param.timeStart.c_str());
}
@ -951,15 +951,15 @@ std::string JsonData::JsonCmd_Cgi_62(Param_62 &param){
if(param.straxis == "")
{
if (param.mMode == 1){
sprintf(whereCon, " channelID like '%%%s%%' and timeStamp < '%s' and timeStamp > '%s' order by timeStamp asc LIMIT %d OFFSET %d", param.MeasurementID.c_str(), param.timeEnd.c_str(), param.timeStart.c_str(), 550, packgeNum);
sprintf(whereCon, " channelID like '%s-X' and timeStamp < '%s' and timeStamp > '%s' order by timeStamp asc LIMIT %d OFFSET %d", param.MeasurementID.c_str(), param.timeEnd.c_str(), param.timeStart.c_str(), 550, packgeNum);
}else{
sprintf(whereCon, " data_nodeno like '%%%s%%' and timeStamp < '%s' and timeStamp > '%s' order by timeStamp asc LIMIT %d OFFSET %d", param.MeasurementID.c_str(), param.timeEnd.c_str(), param.timeStart.c_str(), 550, packgeNum);
}
}else{
if (param.mMode == 1){
sprintf(whereCon, " channelID = '%s-%s' and timeStamp < '%s' and timeStamp > '%s' order by timeStamp asc LIMIT %d OFFSET %d", param.MeasurementID.c_str(),param.straxis.c_str(), param.timeEnd.c_str(), param.timeStart.c_str(), 550, packgeNum);
sprintf(whereCon, " channelID = '%s-X' and timeStamp < '%s' and timeStamp > '%s' order by timeStamp asc LIMIT %d OFFSET %d", param.MeasurementID.c_str(), param.timeEnd.c_str(), param.timeStart.c_str(), 550, packgeNum);
}else{
sprintf(whereCon, "data_nodeno = %s-%s' and timeStamp < '%s' and timeStamp > '%s' order by timeStamp asc LIMIT %d OFFSET %d", param.MeasurementID.c_str(),param.straxis.c_str(), param.timeEnd.c_str(), param.timeStart.c_str(), 550, packgeNum);
sprintf(whereCon, "data_nodeno = '%s-%s' and timeStamp < '%s' and timeStamp > '%s' order by timeStamp asc LIMIT %d OFFSET %d", param.MeasurementID.c_str(),param.straxis.c_str(), param.timeEnd.c_str(), param.timeStart.c_str(), 550, packgeNum);
}
}
array_t vecRes;

View File

@ -1092,11 +1092,11 @@ int Uart::FindRecvPackage(int bytesRead, char *mUartRecvBuf, char *head) {
strChannelID = strMeasurementID + "-Z";
wave_error_z = true;
}
if(scheduler::instance().WaveError(wave_shortAddr) < 0){
zlog_error(zct, "WaveError error ShortAddr :%s", strShortAddr.c_str());
sprintf(insertSql, "'%s','%s','%s',%d,'%d','%s' ", strChannelID.c_str(),strShortAddr.c_str(),localtimestamp,bytesRead,0,error_msg.c_str());
sqlite_db_ctrl::instance().InsertData(" receive_wave_status ", insertSql);
}
zlog_error(zct, "WaveError error ShortAddr :%s", strShortAddr.c_str());
sprintf(insertSql, "'%s','%s','%s',%d,'%d','%s' ", strChannelID.c_str(),strShortAddr.c_str(),localtimestamp,bytesRead,0,error_msg.c_str());
sqlite_db_ctrl::instance().InsertData(" receive_wave_status ", insertSql);
JsonData jd;
jd.JsonCmd_32(strMeasurementID,1,1,strChannelID,error_msg);
@ -1134,11 +1134,11 @@ int Uart::FindRecvPackage(int bytesRead, char *mUartRecvBuf, char *head) {
strChannelID = strMeasurementID + "-Z";
wave_error_z = true;
}
if(scheduler::instance().WaveError(wave_shortAddr) < 0){
zlog_error(zct, "WaveError error ShortAddr :%s", strShortAddr.c_str());
sprintf(insertSql, "'%s','%s','%s',%d,'%d','%s' ", strChannelID.c_str(),strShortAddr.c_str(),localtimestamp,bytesRead,0,error_msg.c_str());
sqlite_db_ctrl::instance().InsertData(" receive_wave_status ", insertSql);
}
zlog_error(zct, "WaveError error ShortAddr :%s", strShortAddr.c_str());
sprintf(insertSql, "'%s','%s','%s',%d,'%d','%s' ", strChannelID.c_str(),strShortAddr.c_str(),localtimestamp,bytesRead,0,error_msg.c_str());
sqlite_db_ctrl::instance().InsertData(" receive_wave_status ", insertSql);
JsonData jd;
jd.JsonCmd_32(strMeasurementID,1,1,strChannelID,error_msg);
continue;

View File

@ -861,6 +861,11 @@ void Uart::DealWave() {
scheduler::instance().WaveSuccess(wave_shortAddr);
}
if (g_mapCompress[strShortAddr].CountX <= 0 && g_mapCompress[strShortAddr].CountY <= 0 && g_mapCompress[strShortAddr].CountZ <= 0)
{
scheduler::instance().WaveError(wave_shortAddr);
}
g_mapCompress[strShortAddr].CountX = 0;
g_mapCompress[strShortAddr].CountY = 0;
g_mapCompress[strShortAddr].CountZ = 0;