diff --git a/das-dn/hostadsbf/hostadsbf.cpp b/das-dn/hostadsbf/hostadsbf.cpp index 9aef73aa..ffb32b54 100644 --- a/das-dn/hostadsbf/hostadsbf.cpp +++ b/das-dn/hostadsbf/hostadsbf.cpp @@ -531,7 +531,8 @@ static void* ryftp_process(void* param) struRYDeviceData *data = (struRYDeviceData *)chunk.response; int uid = mbt->GetCurUnitID(); mbt->UnitFeedFTPDog(uid); - for (int i = 0; i < 250; i++, data++) { //每个文件有250个数据块 + int data_count = (chunk.size / sizeof(struRYDeviceData)); + for (int i = 0; i < data_count; i++, data++) { //每个文件有250个数据块 QLONG unix_time = filetime_to_unix(data->localtime); DWORD localtime = ((unix_time / 1000) - 28800L); @@ -550,7 +551,6 @@ static void* ryftp_process(void* param) st.hour, st.minute, st.millisecond/1000, millisec); } #endif - //vLog(LOG_DEBUG, "data.iPitchAngle1 is: %d, data.iPitchAngle2 is: %d, and data.iPitchAngle3 is: %d\n", data->iPitchAngle1, data->iPitchAngle2, data->iPitchAngle3); //如何将结构化数据传入,且快速获取 Json::Value highspeedvalues; for (datatypemap::iterator it = highspeedmap.begin(); it != highspeedmap.end(); it++) { @@ -560,7 +560,6 @@ static void* ryftp_process(void* param) int point = it->second; if (GetYCValue(point, fields, (const char *)data, dvalue)) { if (adsGetUnitYCIsFloat(uid, point)) { - //fprintf(stderr, "%s, ", config.units[uid].ycs[order].name); highspeedvalues[(const char *)config.units[uid].ycs[order].name] = adsGetUnitYCRealFromValue(uid, point, dvalue); } else { highspeedvalues[(const char *)config.units[uid].ycs[order].name] = dvalue; @@ -583,9 +582,7 @@ static void* ryftp_process(void* param) int order = it->first; int point = it->second; if (GetYCValue(point, fields, (const char *)data, dvalue)) { - //fprintf(stderr, "get<%d> value is: %d.\n", point, dvalue); if (adsGetUnitYCIsFloat(uid, point)) { - //fprintf(stderr, "%s, ", config.units[uid].ycs[order].name); lowspeedvalues[(const char *)config.units[uid].ycs[order].name] = adsGetUnitYCRealFromValue(uid, point, dvalue); } else { lowspeedvalues[(const char *)config.units[uid].ycs[order].name] = dvalue; @@ -599,7 +596,6 @@ static void* ryftp_process(void* param) int order = it->first; int point = it->second.point; int pos = it->second.pos; - //vLog(LOG_DEBUG, "start to get point is: %d, pos is: %d\n", point, pos); if (GetYXValue(point, fields, (const char *)data, pos, bvalue)) { lowspeedvalues[(const char *)config.units[uid].yxs[order].name] = (int)bvalue; } else {