add codes
This commit is contained in:
parent
011201a6c7
commit
e08f3c1e7b
@ -567,7 +567,7 @@ void ImportConfig(std::string filename) {
|
||||
'%s','%s','%s','%s','%s','%s',\
|
||||
'%s','%s','%s','%s','%s','%s','%s','%s',\
|
||||
'%s','%s','%s','%s','%s',\
|
||||
'%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s'",
|
||||
'%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s'",
|
||||
vecDataNode[0].c_str(), dataNodeName, vecDataNode[2].c_str(), vecDataNode[3].c_str(),
|
||||
vecDataNode[4].c_str(), vecDataNode[5].c_str(), vecDataNode[6].c_str(),
|
||||
vecDataNode[7].c_str(), vecDataNode[8].c_str(), vecDataNode[9].c_str(), vecDataNode[10].c_str(),
|
||||
@ -580,7 +580,8 @@ void ImportConfig(std::string filename) {
|
||||
vecDataNode[31].c_str(), vecDataNode[32].c_str(), vecDataNode[33].c_str(), vecDataNode[34].c_str(),
|
||||
vecDataNode[35].c_str(), vecDataNode[36].c_str(), vecDataNode[37].c_str(), vecDataNode[38].c_str(),
|
||||
vecDataNode[39].c_str(), vecDataNode[40].c_str(),
|
||||
vecDataNode[41].c_str(), vecDataNode[42].c_str(), vecDataNode[43].c_str(), vecDataNode[44].c_str());
|
||||
vecDataNode[41].c_str(), vecDataNode[42].c_str(), vecDataNode[43].c_str(), vecDataNode[44].c_str(),
|
||||
vecDataNode[45].c_str(),vecDataNode[46].c_str());
|
||||
res = sqlite_db_ctrl::instance().InsertData(T_SENSOR_INFO(TNAME), insertSql);
|
||||
if (res != 0){
|
||||
zlog_error(zbt, "res:%d", res);
|
||||
|
||||
@ -168,7 +168,7 @@ std::string JsonData::JsonCmd_Cgi_54(Param_54 ¶m) {
|
||||
nodeArray.append(arrRes[j][0]);
|
||||
stringToHex(arrRes[j][1].c_str(), hex);
|
||||
nodeArray.append(hex);
|
||||
for (int k = 2; k <= 44; ++k) {
|
||||
for (int k = 2; k <= 46; ++k) {
|
||||
nodeArray.append(arrRes[j][k]);
|
||||
}
|
||||
jsArray.append(nodeArray);
|
||||
|
||||
@ -1106,7 +1106,7 @@ std::string JsonData::JsonCmd_Cgi_65(Param_65 ¶m){
|
||||
char count_sql[1024] = {0};
|
||||
int recive_feature = 0, send_feature = 0;
|
||||
int recive_x = 0, recive_y = 0, recive_z = 0;
|
||||
int send_x = 0, send_y = 0, send_z = 0;
|
||||
//int send_x = 0, send_y = 0, send_z = 0;
|
||||
for (size_t i = 0; i < nSize; i++)
|
||||
{
|
||||
Json::Value iTem;
|
||||
@ -1159,30 +1159,38 @@ std::string JsonData::JsonCmd_Cgi_65(Param_65 ¶m){
|
||||
iTem.append(recive_z);
|
||||
}
|
||||
|
||||
memset(count_sql,0,sizeof(count_sql));
|
||||
snprintf(count_sql,sizeof(count_sql),
|
||||
"SELECT "
|
||||
"COUNT(*) FILTER (WHERE channelID = '%s-X') AS send_x,"
|
||||
"COUNT(*) FILTER (WHERE channelID = '%s-Y') AS send_y,"
|
||||
"COUNT(*) FILTER (WHERE channelID = '%s-Z') AS send_z "
|
||||
"FROM ( "
|
||||
"SELECT * FROM t_data_waveSend "
|
||||
"WHERE sendMsg = 1 and timeStamp BETWEEN '%s' AND '%s');",MeasurementID.c_str(),MeasurementID.c_str(),MeasurementID.c_str(),param.timeStart.c_str(),param.timeEnd.c_str());
|
||||
vec_t vecResult3 = sqlite_db_ctrl::instance().GetDataSingleLine(count_sql);
|
||||
if (vecResult3.size() > 0)
|
||||
{
|
||||
send_x = atoi(vecResult3[0].c_str());
|
||||
send_y = atoi(vecResult3[1].c_str());
|
||||
send_z = atoi(vecResult3[2].c_str());
|
||||
iTem.append((float(send_feature)/(interval/featureInterVal)));
|
||||
iTem.append(send_feature);
|
||||
iTem.append((float(send_x)/(interval/waveInterVal)));
|
||||
iTem.append(send_x);
|
||||
iTem.append((float(send_y)/(interval/waveInterVal)));
|
||||
iTem.append(send_y);
|
||||
iTem.append((float(send_z)/(interval/waveInterVal)));
|
||||
iTem.append(send_z);
|
||||
}
|
||||
// memset(count_sql,0,sizeof(count_sql));
|
||||
// snprintf(count_sql,sizeof(count_sql),
|
||||
// "SELECT "
|
||||
// "COUNT(*) FILTER (WHERE channelID = '%s-X') AS send_x,"
|
||||
// "COUNT(*) FILTER (WHERE channelID = '%s-Y') AS send_y,"
|
||||
// "COUNT(*) FILTER (WHERE channelID = '%s-Z') AS send_z "
|
||||
// "FROM ( "
|
||||
// "SELECT * FROM t_data_waveSend "
|
||||
// "WHERE sendMsg = 1 and timeStamp BETWEEN '%s' AND '%s');",MeasurementID.c_str(),MeasurementID.c_str(),MeasurementID.c_str(),param.timeStart.c_str(),param.timeEnd.c_str());
|
||||
// vec_t vecResult3 = sqlite_db_ctrl::instance().GetDataSingleLine(count_sql);
|
||||
// if (vecResult3.size() > 0)
|
||||
// {
|
||||
// send_x = atoi(vecResult3[0].c_str());
|
||||
// send_y = atoi(vecResult3[1].c_str());
|
||||
// send_z = atoi(vecResult3[2].c_str());
|
||||
// iTem.append((float(send_feature)/(interval/featureInterVal)));
|
||||
// iTem.append(send_feature);
|
||||
// iTem.append((float(send_x)/(interval/waveInterVal)));
|
||||
// iTem.append(send_x);
|
||||
// iTem.append((float(send_y)/(interval/waveInterVal)));
|
||||
// iTem.append(send_y);
|
||||
// iTem.append((float(send_z)/(interval/waveInterVal)));
|
||||
// iTem.append(send_z);
|
||||
//}
|
||||
iTem.append(0);
|
||||
iTem.append(0);
|
||||
iTem.append(0);
|
||||
iTem.append(0);
|
||||
iTem.append(0);
|
||||
iTem.append(0);
|
||||
iTem.append(0);
|
||||
iTem.append(0);
|
||||
std::vector<std::string> vRssi;
|
||||
boost::split(vRssi, vetRes[i][2], boost::is_any_of(","), boost::token_compress_on);
|
||||
if (vRssi.size() > 0 ){
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user