3.2.5 beta 2 增加计算每日统计特征数量
This commit is contained in:
parent
f8cf01b6c6
commit
4dc85b8187
@ -514,7 +514,15 @@ std::string GetCurrentTime()
|
|||||||
std::string strtime_now = std::string((char*)time_now);
|
std::string strtime_now = std::string((char*)time_now);
|
||||||
return strtime_now;
|
return strtime_now;
|
||||||
}
|
}
|
||||||
|
void get_current_date( int day)
|
||||||
|
{
|
||||||
|
time_t t = time(NULL);
|
||||||
|
struct tm *tm_info = localtime(&t);
|
||||||
|
int iyear;int imonth;
|
||||||
|
iyear = tm_info->tm_year + 1900;
|
||||||
|
imonth = tm_info->tm_mon + 1;
|
||||||
|
day = tm_info->tm_mday;
|
||||||
|
}
|
||||||
int system_custom(const char *cmd, char *buf)
|
int system_custom(const char *cmd, char *buf)
|
||||||
{
|
{
|
||||||
FILE * fp;
|
FILE * fp;
|
||||||
|
@ -86,6 +86,7 @@ struct DevData{
|
|||||||
memset(mDataMing, 0, 128);
|
memset(mDataMing, 0, 128);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct compressWaveChannel
|
struct compressWaveChannel
|
||||||
{
|
{
|
||||||
int compressChannelX;
|
int compressChannelX;
|
||||||
@ -649,6 +650,7 @@ extern int CheckFileVersion(int argc, char** argv);
|
|||||||
*/
|
*/
|
||||||
extern std::string GetCurrentTime();
|
extern std::string GetCurrentTime();
|
||||||
|
|
||||||
|
extern void get_current_date( int day) ;
|
||||||
/**
|
/**
|
||||||
* @brief 和系统交互函数
|
* @brief 和系统交互函数
|
||||||
* @param cmd 要发出的系统命令 例:ls
|
* @param cmd 要发出的系统命令 例:ls
|
||||||
|
@ -56,6 +56,7 @@ public :
|
|||||||
static GPIOInfo GPIO_G;
|
static GPIOInfo GPIO_G;
|
||||||
static enumZigBeeTransmitStatus EnterZigBeeWaveTransmittingFlag_G; // 进入ZigBee网络原始数据传输状态标志
|
static enumZigBeeTransmitStatus EnterZigBeeWaveTransmittingFlag_G; // 进入ZigBee网络原始数据传输状态标志
|
||||||
static int EnterZigBeeWaveTransmittingCnt_G; // 进入ZigBee网络原始数据传输状态计数器,以秒为单位进行计数
|
static int EnterZigBeeWaveTransmittingCnt_G; // 进入ZigBee网络原始数据传输状态计数器,以秒为单位进行计数
|
||||||
|
static int day;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -298,7 +298,7 @@ void SqliteDB::CreatedataStatictable(const char *ptableName)
|
|||||||
char sql_exec[2048];
|
char sql_exec[2048];
|
||||||
//创建传感器数据存储表
|
//创建传感器数据存储表
|
||||||
memset(sql_exec, 0, 2048);
|
memset(sql_exec, 0, 2048);
|
||||||
sprintf(sql_exec, "create table if not exists %s(%s,%s,%s,%s,%s,%s,%s,%s integer,%s,%s,%s,%s integer);",
|
sprintf(sql_exec, "create table if not exists %s(%s,%s,%s,%s,%s,%s,%s,%s integer,%s,%s,%s,%s integer,%s,%s);",
|
||||||
ptableName,
|
ptableName,
|
||||||
T_DATASTATIC_INFO(DATANODENO),
|
T_DATASTATIC_INFO(DATANODENO),
|
||||||
T_DATASTATIC_INFO(CHANNELID),
|
T_DATASTATIC_INFO(CHANNELID),
|
||||||
@ -311,7 +311,9 @@ void SqliteDB::CreatedataStatictable(const char *ptableName)
|
|||||||
T_DATASTATIC_INFO(TIMESTAMP),
|
T_DATASTATIC_INFO(TIMESTAMP),
|
||||||
"sendMsg",
|
"sendMsg",
|
||||||
"nodeResend",
|
"nodeResend",
|
||||||
"zigbeeSignalNode"
|
"zigbeeSignalNode",
|
||||||
|
"statisticType",
|
||||||
|
"timing"
|
||||||
);
|
);
|
||||||
CreateTable(sql_exec, 0);
|
CreateTable(sql_exec, 0);
|
||||||
memset(sql_exec, 0, 2048);
|
memset(sql_exec, 0, 2048);
|
||||||
@ -1396,6 +1398,192 @@ int SqliteDB::QueryofflineData()
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
int SqliteDB::CalculateData()
|
||||||
|
{
|
||||||
|
array_t vecRet = GetDataMultiLine(T_SENSOR_INFO(TNAME)," dataNodeNo,MeasurementID,NodeWaveSend,featureInterVal,waveInterVal,ZigbeePower ",NULL);
|
||||||
|
if (vecRet.size() > 0)
|
||||||
|
{
|
||||||
|
LOG_INFO("Node Count = %d\n",vecRet.size());
|
||||||
|
for (size_t i = 0; i < vecRet.size(); i++)
|
||||||
|
{
|
||||||
|
int planCount = 1440 / atoi(vecRet[i][4].c_str()) ;
|
||||||
|
int rate = readIntValue( "config", "waveRate",(char*)GlobalConfig::Config_G.c_str());
|
||||||
|
char tableName[50]={0x00};
|
||||||
|
char whereCon[128]={0x00};
|
||||||
|
sprintf(tableName,"t_dataStatic_%s",vecRet[i][0].c_str());
|
||||||
|
const char *sql =
|
||||||
|
" timestamp >= strftime('%s', 'now', '-1 day', 'start of day') "
|
||||||
|
"AND timestamp < strftime('%s', 'now', 'start of day') ";
|
||||||
|
|
||||||
|
int StatisticCount = GetTableRows(tableName,sql);
|
||||||
|
|
||||||
|
|
||||||
|
sql = "timeStamp >= strftime('%s', 'now', '-1 day', 'start of day') AND timeStamp < strftime('%s', 'now', 'start of day') and statisticType = '1' ";
|
||||||
|
int SixCount = GetTableRows(tableName,sql);
|
||||||
|
|
||||||
|
sql = "timeStamp >= strftime('%s', 'now', '-1 day', 'start of day') AND timeStamp < strftime('%s', 'now', 'start of day') and statisticType = '1' and timing = '0'";
|
||||||
|
int TimingCount = GetTableRows(tableName,sql);
|
||||||
|
print_info("nodeWaveSend = %s,waveInterVal = %s\n",vecRet[i][2].c_str(),vecRet[i][4].c_str());
|
||||||
|
if(vecRet[i][2] == "")
|
||||||
|
continue;
|
||||||
|
vector<string> nodeWaveSend ;
|
||||||
|
boost::split( nodeWaveSend, vecRet[i][2], boost::is_any_of( "," ), boost::token_compress_on );
|
||||||
|
int CountWaveX = 0,CountWaveY = 0,CountWaveZ = 0;
|
||||||
|
int CountWaveX2 = 0,CountWaveY2 = 0,CountWaveZ2 = 0;
|
||||||
|
int CountWaveX3 = 0,CountWaveY3 = 0,CountWaveZ3 = 0;
|
||||||
|
int rateX = 0,rateY = 0,rateZ = 0;
|
||||||
|
if (nodeWaveSend.size() < 3)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nodeWaveSend[0] == "0")
|
||||||
|
{
|
||||||
|
|
||||||
|
const char *sql =
|
||||||
|
"timeStamp >= strftime('%s', 'now', '-1 day', 'start of day')"
|
||||||
|
" AND timeStamp < strftime('%s', 'now', 'start of day')";
|
||||||
|
print_info("ret = %s\n",vecRet[i][1].c_str());
|
||||||
|
sprintf(whereCon," and channelID = '%s-X'",vecRet[i][1].c_str());
|
||||||
|
string strsql = string(sql) + string(whereCon);
|
||||||
|
printf("sql = %s\n",strsql.c_str());
|
||||||
|
CountWaveX = GetTableRows(tableName,strsql.c_str());
|
||||||
|
|
||||||
|
sql =
|
||||||
|
"timeStamp >= strftime('%s', 'now', '-2 day', 'start of day')"
|
||||||
|
" AND timeStamp < strftime('%s', 'now', 'start of day')";
|
||||||
|
print_info("ret = %s\n",vecRet[i][1].c_str());
|
||||||
|
sprintf(whereCon," and channelID = '%s-X'",vecRet[i][1].c_str());
|
||||||
|
strsql = string(sql) + string(whereCon);
|
||||||
|
|
||||||
|
//printf(whereCon,"timeStamp >= strftime('%s', 'now', '-2 day', 'start of day') AND timeStamp < strftime('%s', 'now', 'start of day') and channelID = '%s-X'",vecRet[i][1].c_str());
|
||||||
|
CountWaveX2 = GetTableRows(tableName,whereCon);
|
||||||
|
|
||||||
|
sql =
|
||||||
|
"timeStamp >= strftime('%s', 'now', '-3 day', 'start of day')"
|
||||||
|
" AND timeStamp < strftime('%s', 'now', 'start of day')";
|
||||||
|
print_info("ret = %s\n",vecRet[i][1].c_str());
|
||||||
|
sprintf(whereCon," and channelID = '%s-X'",vecRet[i][1].c_str());
|
||||||
|
strsql = string(sql) + string(whereCon);
|
||||||
|
//printf(whereCon,"timeStamp >= strftime('%s', 'now', '-3 day', 'start of day') AND timeStamp < strftime('%s', 'now', 'start of day') and channelID = '%s-X'",vecRet[i][1].c_str());
|
||||||
|
CountWaveX3 = GetTableRows(tableName,whereCon);
|
||||||
|
|
||||||
|
if ((CountWaveX > 0 && (CountWaveX / planCount > rate)) && (CountWaveX2 > 0 && (CountWaveX2 / planCount > rate)) && (CountWaveX3 > 0 && (CountWaveX3 / planCount > rate)))
|
||||||
|
{
|
||||||
|
rateX = 1;
|
||||||
|
}else{
|
||||||
|
rateX = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
if(nodeWaveSend[1] == "0"){
|
||||||
|
|
||||||
|
const char *sql =
|
||||||
|
"timeStamp >= strftime('%s', 'now', '-1 day', 'start of day')"
|
||||||
|
" AND timeStamp < strftime('%s', 'now', 'start of day')";
|
||||||
|
print_info("ret = %s\n",vecRet[i][1].c_str());
|
||||||
|
sprintf(whereCon," and channelID = '%s-Y'",vecRet[i][1].c_str());
|
||||||
|
string strsql = string(sql) + string(whereCon);
|
||||||
|
|
||||||
|
//sprintf(whereCon,"timeStamp >= strftime('%s', 'now', '-1 day', 'start of day') AND timeStamp < strftime('%s', 'now', 'start of day') and channelID = '%s-Y",vecRet[i][1].c_str());
|
||||||
|
CountWaveY = GetTableRows(tableName,strsql.c_str());
|
||||||
|
|
||||||
|
sql =
|
||||||
|
"timeStamp >= strftime('%s', 'now', '-2 day', 'start of day')"
|
||||||
|
" AND timeStamp < strftime('%s', 'now', 'start of day')";
|
||||||
|
print_info("ret = %s\n",vecRet[i][1].c_str());
|
||||||
|
sprintf(whereCon," and channelID = '%s-Y'",vecRet[i][1].c_str());
|
||||||
|
strsql = string(sql) + string(whereCon);
|
||||||
|
//sprintf(whereCon,"timeStamp >= strftime('%s', 'now', '-2 day', 'start of day') AND timeStamp < strftime('%s', 'now', 'start of day') and channelID = '%s-Y",vecRet[i][1].c_str());
|
||||||
|
CountWaveY2 = GetTableRows(tableName,whereCon);
|
||||||
|
|
||||||
|
sql =
|
||||||
|
"timeStamp >= strftime('%s', 'now', '-3 day', 'start of day')"
|
||||||
|
" AND timeStamp < strftime('%s', 'now', 'start of day')";
|
||||||
|
print_info("ret = %s\n",vecRet[i][1].c_str());
|
||||||
|
sprintf(whereCon," and channelID = '%s-Y'",vecRet[i][1].c_str());
|
||||||
|
strsql = string(sql) + string(whereCon);
|
||||||
|
//sprintf(whereCon,"timeStamp >= strftime('%s', 'now', '-3 day', 'start of day') AND timeStamp < strftime('%s', 'now', 'start of day') and channelID = '%s-Y",vecRet[i][1].c_str());
|
||||||
|
CountWaveY3 = GetTableRows(tableName,whereCon);
|
||||||
|
|
||||||
|
if ((CountWaveY > 0 && (CountWaveY / planCount > rate)) && (CountWaveY2 > 0 && (CountWaveY2 / planCount > rate)) && (CountWaveY3 > 0 && (CountWaveY3 / planCount > rate)))
|
||||||
|
{
|
||||||
|
rateY = 1;
|
||||||
|
}else{
|
||||||
|
rateY = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
if(nodeWaveSend[2] == "0"){
|
||||||
|
|
||||||
|
const char *sql =
|
||||||
|
"timeStamp >= strftime('%s', 'now', '-1 day', 'start of day')"
|
||||||
|
" AND timeStamp < strftime('%s', 'now', 'start of day')";
|
||||||
|
print_info("ret = %s\n",vecRet[i][1].c_str());
|
||||||
|
sprintf(whereCon," and channelID = '%s-Z'",vecRet[i][1].c_str());
|
||||||
|
string strsql = string(sql) + string(whereCon);
|
||||||
|
|
||||||
|
//sprintf(whereCon,"timeStamp >= strftime('%s', 'now', '-1 day', 'start of day') AND timeStamp < strftime('%s', 'now', 'start of day') and channelID = '%s-Z",vecRet[i][1].c_str());
|
||||||
|
CountWaveZ = GetTableRows(tableName,whereCon);
|
||||||
|
|
||||||
|
sql =
|
||||||
|
"timeStamp >= strftime('%s', 'now', '-2 day', 'start of day')"
|
||||||
|
" AND timeStamp < strftime('%s', 'now', 'start of day')";
|
||||||
|
print_info("ret = %s\n",vecRet[i][1].c_str());
|
||||||
|
sprintf(whereCon," and channelID = '%s-Z'",vecRet[i][1].c_str());
|
||||||
|
strsql = string(sql) + string(whereCon);
|
||||||
|
|
||||||
|
//sprintf(whereCon,"timeStamp >= strftime('%s', 'now', '-2 day', 'start of day') AND timeStamp < strftime('%s', 'now', 'start of day') and channelID = '%s-Z",vecRet[i][1].c_str());
|
||||||
|
CountWaveZ2 = GetTableRows(tableName,whereCon);
|
||||||
|
|
||||||
|
sql =
|
||||||
|
"timeStamp >= strftime('%s', 'now', '-3 day', 'start of day')"
|
||||||
|
" AND timeStamp < strftime('%s', 'now', 'start of day')";
|
||||||
|
print_info("ret = %s\n",vecRet[i][1].c_str());
|
||||||
|
sprintf(whereCon," and channelID = '%s-Z'",vecRet[i][1].c_str());
|
||||||
|
strsql = string(sql) + string(whereCon);
|
||||||
|
|
||||||
|
//sprintf(whereCon,"timeStamp >= strftime('%s', 'now', '-3 day', 'start of day') AND timeStamp < strftime('%s', 'now', 'start of day') and channelID = '%s-Z",vecRet[i][1].c_str());
|
||||||
|
CountWaveZ3 = GetTableRows(tableName,whereCon);
|
||||||
|
|
||||||
|
if ((CountWaveZ > 0 && (CountWaveZ / planCount > rate)) && (CountWaveZ2 > 0 && (CountWaveZ2 / planCount > rate)) && (CountWaveZ3 > 0 && (CountWaveZ3 / planCount > rate)))
|
||||||
|
{
|
||||||
|
rateZ = 1;
|
||||||
|
}else{
|
||||||
|
rateZ = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
print_info("CountWaveX = %d\n",CountWaveX);
|
||||||
|
LOG_INFO("YESTERDAY dataNodeNo = %s Statistic Count = %d,06 Count = %d Timing Count = %d,CountWaveX = %d,CountWaveY = %d,CountWaveZ = %d,featureInterVal = %s,waveInterVal = %s\n"\
|
||||||
|
,vecRet[i][0].c_str(),StatisticCount,SixCount,TimingCount,CountWaveX,CountWaveY,CountWaveZ,vecRet[i][3].c_str(),vecRet[i][4].c_str());
|
||||||
|
|
||||||
|
if (rateX == 1 && rateY == 1 && rateZ == 1 && vecRet[i][5] == "3")
|
||||||
|
{
|
||||||
|
char updateSql[50] = {0x00};
|
||||||
|
sprintf(updateSql,"ZigbeePower = '2',UpdateFlag = 0 ");
|
||||||
|
memset(whereCon,0x00,sizeof(whereCon));
|
||||||
|
sprintf(whereCon," dataNodeNo = '%s'",vecRet[i][0].c_str());
|
||||||
|
UpdateTableData(T_SENSOR_INFO(TNAME), updateSql, whereCon);
|
||||||
|
LOG_INFO("update ZigbeePower 2");
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((rateX == -1 || rateY == -1 || rateZ == 1 )&& vecRet[i][5] == "2")
|
||||||
|
{
|
||||||
|
char updateSql[50] = {0x00};
|
||||||
|
sprintf(updateSql,"ZigbeePower = '3',UpdateFlag = 0 ");
|
||||||
|
memset(whereCon,0x00,sizeof(whereCon));
|
||||||
|
sprintf(whereCon," dataNodeNo = '%s'",vecRet[i][0].c_str());
|
||||||
|
UpdateTableData(T_SENSOR_INFO(TNAME), updateSql, whereCon);
|
||||||
|
LOG_INFO("update ZigbeePower 3");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
int SqliteDB::TransBegin()
|
int SqliteDB::TransBegin()
|
||||||
{
|
{
|
||||||
return sqlite3_exec(mDBAcess, "begin;", 0, 0, 0);
|
return sqlite3_exec(mDBAcess, "begin;", 0, 0, 0);
|
||||||
|
@ -60,6 +60,8 @@ public:
|
|||||||
int CalculateDip();
|
int CalculateDip();
|
||||||
int InintGateway();
|
int InintGateway();
|
||||||
int QueryofflineData();
|
int QueryofflineData();
|
||||||
|
int CalculateData();
|
||||||
|
int CalculateWaveRate();
|
||||||
std::string GetNodeConfigureInfor(const char* whereCon);
|
std::string GetNodeConfigureInfor(const char* whereCon);
|
||||||
int CloseDB();
|
int CloseDB();
|
||||||
|
|
||||||
|
2
main.cpp
2
main.cpp
@ -48,7 +48,7 @@ int main(int argc, char *argv[])
|
|||||||
platform->PlatFormInit();
|
platform->PlatFormInit();
|
||||||
|
|
||||||
sql_ctl->InintGateway();
|
sql_ctl->InintGateway();
|
||||||
//sql_ctl->CalculateDip();
|
//sql_ctl->CalculateData();
|
||||||
//sql_ctl->CalculateBattery();
|
//sql_ctl->CalculateBattery();
|
||||||
pUart->InitZigbee();
|
pUart->InitZigbee();
|
||||||
// UDP,接收客户端发来的组播消息,用于外接 QT 专家系统,屏蔽之
|
// UDP,接收客户端发来的组播消息,用于外接 QT 专家系统,屏蔽之
|
||||||
|
@ -24,6 +24,7 @@ int GlobalConfig::serverStatus = 0;
|
|||||||
int GlobalConfig::NetSignal = 0;
|
int GlobalConfig::NetSignal = 0;
|
||||||
int GlobalConfig::ServerPort = 0;
|
int GlobalConfig::ServerPort = 0;
|
||||||
int GlobalConfig::threadStatus = 1;
|
int GlobalConfig::threadStatus = 1;
|
||||||
|
int GlobalConfig::day = 0;
|
||||||
|
|
||||||
extern map<string,compressWaveChannel> g_mapCompress;
|
extern map<string,compressWaveChannel> g_mapCompress;
|
||||||
|
|
||||||
|
@ -212,6 +212,19 @@ void CheckThread()
|
|||||||
std::string data = jd.JsonCmd_07();
|
std::string data = jd.JsonCmd_07();
|
||||||
data_publish(data.c_str(), GlobalConfig::Topic_G.mPubStatus.c_str());
|
data_publish(data.c_str(), GlobalConfig::Topic_G.mPubStatus.c_str());
|
||||||
HardStatus = 0;
|
HardStatus = 0;
|
||||||
|
if (GlobalConfig::day == 0)
|
||||||
|
{
|
||||||
|
get_current_date(GlobalConfig::day);
|
||||||
|
}else{
|
||||||
|
int day = 0;
|
||||||
|
get_current_date(day);
|
||||||
|
if(GlobalConfig::day != day){
|
||||||
|
LOG_INFO("global = %d ,day = %d\n",GlobalConfig::day,day);
|
||||||
|
sql_ctl->CalculateData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if(mqttresend == 1800){
|
if(mqttresend == 1800){
|
||||||
mqttresend = 0;
|
mqttresend = 0;
|
||||||
|
@ -210,6 +210,9 @@ Uart::Uart():mUart(mIoSev),mStrand(mIoSev)
|
|||||||
m_waveCountX = 0;
|
m_waveCountX = 0;
|
||||||
m_waveCountY = 0;
|
m_waveCountY = 0;
|
||||||
m_waveCountZ = 0;
|
m_waveCountZ = 0;
|
||||||
|
VecWaveDataX.reserve(300000);
|
||||||
|
VecWaveDataY.reserve(300000);
|
||||||
|
VecWaveDataZ.reserve (500000);
|
||||||
}
|
}
|
||||||
Uart::~Uart()
|
Uart::~Uart()
|
||||||
{
|
{
|
||||||
@ -1524,7 +1527,7 @@ int Uart::UpdateConfig(unsigned char* pDestShortAddr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
void Uart::UpdateWirelessNodeTime(unsigned char* pDestShortAddr,int modifyaddr/*,int nodewaveindex,int nodetime,int nodeindex*/)
|
int Uart::UpdateWirelessNodeTime(unsigned char* pDestShortAddr,int modifyaddr/*,int nodewaveindex,int nodetime,int nodeindex*/)
|
||||||
{
|
{
|
||||||
if(modifyaddr)
|
if(modifyaddr)
|
||||||
modify_DistAddr(pDestShortAddr);
|
modify_DistAddr(pDestShortAddr);
|
||||||
@ -1572,6 +1575,7 @@ void Uart::UpdateWirelessNodeTime(unsigned char* pDestShortAddr,int modifyaddr/*
|
|||||||
}else{
|
}else{
|
||||||
LOG_ERROR("NodeTime ACK send failed,shortAddr = %02x%02x\n",pDestShortAddr[0],pDestShortAddr[1]);
|
LOG_ERROR("NodeTime ACK send failed,shortAddr = %02x%02x\n",pDestShortAddr[0],pDestShortAddr[1]);
|
||||||
}
|
}
|
||||||
|
return iRet;
|
||||||
}
|
}
|
||||||
void Uart::DealRecvData(const char *pData)
|
void Uart::DealRecvData(const char *pData)
|
||||||
{
|
{
|
||||||
@ -2020,7 +2024,7 @@ void Uart::DealDataNodeInfo(const char *pData)
|
|||||||
|
|
||||||
compressWaveChannel tempchannel;
|
compressWaveChannel tempchannel;
|
||||||
g_mapCompress.insert(std::make_pair(dataNodeInfo.ZigbeeShortAddr,tempchannel));
|
g_mapCompress.insert(std::make_pair(dataNodeInfo.ZigbeeShortAddr,tempchannel));
|
||||||
|
print_info("new Node,size = %d\n",g_mapCompress.size());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2038,7 +2042,7 @@ void Uart::DealDataNodeFeature(const char *pData, int flag)
|
|||||||
char whereCon[1024] = {0};
|
char whereCon[1024] = {0};
|
||||||
char updateSql[1024] = { 0 };
|
char updateSql[1024] = { 0 };
|
||||||
char buf[20] = {0x00};
|
char buf[20] = {0x00};
|
||||||
int nodeResend = 0;
|
int nodeResend = 0,timing = 0;
|
||||||
sprintf(buf, "%02x%02x", pRecvData->ShortAddr[0], pRecvData->ShortAddr[1]);
|
sprintf(buf, "%02x%02x", pRecvData->ShortAddr[0], pRecvData->ShortAddr[1]);
|
||||||
if (flag == 1)
|
if (flag == 1)
|
||||||
{
|
{
|
||||||
@ -2086,7 +2090,7 @@ void Uart::DealDataNodeFeature(const char *pData, int flag)
|
|||||||
mssleep(20000);
|
mssleep(20000);
|
||||||
}
|
}
|
||||||
mssleep(10000);
|
mssleep(10000);
|
||||||
UpdateWirelessNodeTime((unsigned char*)pRecvData->ShortAddr,0);
|
timing = UpdateWirelessNodeTime((unsigned char*)pRecvData->ShortAddr,0);
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@ -2334,14 +2338,14 @@ void Uart::DealDataNodeFeature(const char *pData, int flag)
|
|||||||
print_info("dataStatic.TemTop : %f dataStatic.TemBot : %f dataStatic.Dip :%d dataStatic.Voltage : %d\n", dataStatic.TemTop\
|
print_info("dataStatic.TemTop : %f dataStatic.TemBot : %f dataStatic.Dip :%d dataStatic.Voltage : %d\n", dataStatic.TemTop\
|
||||||
, dataStatic.TemBot, dataStatic.Dip, dataStatic.Voltage);
|
, dataStatic.TemBot, dataStatic.Dip, dataStatic.Voltage);
|
||||||
|
|
||||||
sprintf(updateSql, "temTop='%f',temBot='%f',dip='%d',voltage='%d',timeStamp='%s',StaticIndex = %d, nodeResend = %d,zigbeeSignal = '',zigbeeSignalNode = '' ",\
|
sprintf(updateSql, "temTop='%f',temBot='%f',dip='%d',voltage='%d',timeStamp='%s',StaticIndex = %d, nodeResend = %d,zigbeeSignal = '',zigbeeSignalNode = '',statisticType = '',timing = '' ",\
|
||||||
dataStatic.TemTop, dataStatic.TemBot, dataStatic.Dip, dataStatic.Voltage, nowTimetamp.c_str(),staticIndex,nodeResend);
|
dataStatic.TemTop, dataStatic.TemBot, dataStatic.Dip, dataStatic.Voltage, nowTimetamp.c_str(),staticIndex,nodeResend);
|
||||||
sprintf(whereCon, "channelID='%s' and sendMsg = '1'", (strMeasurementID + "-S").c_str());
|
sprintf(whereCon, "channelID='%s' and sendMsg = '1'", (strMeasurementID + "-S").c_str());
|
||||||
if ( /*0 == sql_ctl->GetTableRows(T_DATASTATIC_INFO(TNAME), whereCon)*/ (Count * 3 < SAVE_COUNT && lTime < OneWeek ) || strTime.size() == 0 ) {
|
if ( /*0 == sql_ctl->GetTableRows(T_DATASTATIC_INFO(TNAME), whereCon)*/ (Count * 3 < SAVE_COUNT && lTime < OneWeek ) || strTime.size() == 0 ) {
|
||||||
print_info("insert static data to sql\n");
|
print_info("insert static data to sql\n");
|
||||||
char insertSql[1024] = { 0 };
|
char insertSql[1024] = { 0 };
|
||||||
sprintf(insertSql, "'%s','%s','%f','%f','%d','%d','',%d,'%s','1',%d,''",
|
sprintf(insertSql, "'%s','%s','%f','%f','%d','%d','',%d,'%s','1',%d,'','%d','%d'",
|
||||||
strLongAddr.c_str(), (strMeasurementID + "-S").c_str(), dataStatic.TemTop, dataStatic.TemBot, dataStatic.Dip, dataStatic.Voltage, staticIndex,nowTimetamp.c_str(),nodeResend);
|
strLongAddr.c_str(), (strMeasurementID + "-S").c_str(), dataStatic.TemTop, dataStatic.TemBot, dataStatic.Dip, dataStatic.Voltage, staticIndex,nowTimetamp.c_str(),nodeResend,flag,timing);
|
||||||
sql_ctl->InsertData(szTableName, insertSql);
|
sql_ctl->InsertData(szTableName, insertSql);
|
||||||
|
|
||||||
if(0 == sql_ctl->GetTableRows(T_DATASTATIC_INFO(TNAME), whereCon)){ // First Connect
|
if(0 == sql_ctl->GetTableRows(T_DATASTATIC_INFO(TNAME), whereCon)){ // First Connect
|
||||||
@ -2354,7 +2358,7 @@ void Uart::DealDataNodeFeature(const char *pData, int flag)
|
|||||||
else{
|
else{
|
||||||
memset(updateSql,0x00,sizeof(updateSql));
|
memset(updateSql,0x00,sizeof(updateSql));
|
||||||
sprintf(updateSql, "temTop='%f',temBot='%f',dip='%d',voltage='%d',timeStamp='%s',StaticIndex = %d ",\
|
sprintf(updateSql, "temTop='%f',temBot='%f',dip='%d',voltage='%d',timeStamp='%s',StaticIndex = %d ",\
|
||||||
dataStatic.TemTop, dataStatic.TemBot, dataStatic.Dip, dataStatic.Voltage, nowTimetamp.c_str(),staticIndex,nodeResend);
|
dataStatic.TemTop, dataStatic.TemBot, dataStatic.Dip, dataStatic.Voltage, nowTimetamp.c_str(),staticIndex);
|
||||||
sql_ctl->UpdateTableData(T_DATASTATIC_INFO(TNAME), updateSql, whereCon);
|
sql_ctl->UpdateTableData(T_DATASTATIC_INFO(TNAME), updateSql, whereCon);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -2366,7 +2370,7 @@ void Uart::DealDataNodeFeature(const char *pData, int flag)
|
|||||||
sprintf(whereCon, "channelID='%s' ", (strMeasurementID + "-S").c_str());
|
sprintf(whereCon, "channelID='%s' ", (strMeasurementID + "-S").c_str());
|
||||||
memset(updateSql,0x00,sizeof(updateSql));
|
memset(updateSql,0x00,sizeof(updateSql));
|
||||||
sprintf(updateSql, "temTop='%f',temBot='%f',dip='%d',voltage='%d',timeStamp='%s',StaticIndex = %d ",\
|
sprintf(updateSql, "temTop='%f',temBot='%f',dip='%d',voltage='%d',timeStamp='%s',StaticIndex = %d ",\
|
||||||
dataStatic.TemTop, dataStatic.TemBot, dataStatic.Dip, dataStatic.Voltage, nowTimetamp.c_str(),staticIndex,nodeResend);
|
dataStatic.TemTop, dataStatic.TemBot, dataStatic.Dip, dataStatic.Voltage, nowTimetamp.c_str(),staticIndex);
|
||||||
sql_ctl->UpdateTableData(T_DATASTATIC_INFO(TNAME), updateSql, whereCon);
|
sql_ctl->UpdateTableData(T_DATASTATIC_INFO(TNAME), updateSql, whereCon);
|
||||||
}
|
}
|
||||||
memset(szTableName,0x00,sizeof(szTableName));
|
memset(szTableName,0x00,sizeof(szTableName));
|
||||||
@ -3536,6 +3540,17 @@ void Uart::DealDataNodeWave(const char *pData,int comand)
|
|||||||
{
|
{
|
||||||
//print_info("recv wave\n");
|
//print_info("recv wave\n");
|
||||||
RecvData * pRecvData = (RecvData *)pData;
|
RecvData * pRecvData = (RecvData *)pData;
|
||||||
|
if (m_waveTrans)
|
||||||
|
{
|
||||||
|
if (comand == 3)
|
||||||
|
{
|
||||||
|
VecWaveDataX.push_back(*pRecvData);
|
||||||
|
}else if(comand == 4){
|
||||||
|
VecWaveDataY.push_back(*pRecvData);
|
||||||
|
}else if(comand == 5){
|
||||||
|
VecWaveDataZ.push_back(*pRecvData);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
if (comand == 3)
|
if (comand == 3)
|
||||||
{
|
{
|
||||||
g_VecWaveDataX[m_waveCountX] = *pRecvData;
|
g_VecWaveDataX[m_waveCountX] = *pRecvData;
|
||||||
@ -3547,6 +3562,7 @@ void Uart::DealDataNodeWave(const char *pData,int comand)
|
|||||||
g_VecWaveDataZ[m_waveCountZ] = *pRecvData;
|
g_VecWaveDataZ[m_waveCountZ] = *pRecvData;
|
||||||
m_waveCountZ++;
|
m_waveCountZ++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
//print_blue("wave data size is(m_VecWaveData.size) : %d\n",m_VecWaveData.size());
|
//print_blue("wave data size is(m_VecWaveData.size) : %d\n",m_VecWaveData.size());
|
||||||
char localtimestamp[32] = { 0 };
|
char localtimestamp[32] = { 0 };
|
||||||
GetTimeNet(localtimestamp, 1);
|
GetTimeNet(localtimestamp, 1);
|
||||||
@ -3617,8 +3633,14 @@ std::vector<float> Uart::DealData(int iChannel,float coe,int sampleRate,int ACCS
|
|||||||
print_info("data2 = %02x\n",g_VecWaveDataY[0].Data[0]);
|
print_info("data2 = %02x\n",g_VecWaveDataY[0].Data[0]);
|
||||||
print_info("data3 = %02x\n",g_VecWaveDataZ[0].Data[0]);
|
print_info("data3 = %02x\n",g_VecWaveDataZ[0].Data[0]);
|
||||||
size_t j = 0;
|
size_t j = 0;
|
||||||
|
std::string strShortAddr = "";
|
||||||
if (iChannel == 3)
|
if (iChannel == 3)
|
||||||
{
|
{
|
||||||
|
if (VecWaveDataX.size() > 0 )
|
||||||
|
{
|
||||||
|
g_VecWaveDataX.assign(VecWaveDataX.begin(), VecWaveDataX.end());
|
||||||
|
waveCount = VecWaveDataX.size();
|
||||||
|
}
|
||||||
waveCount = m_waveCountX;
|
waveCount = m_waveCountX;
|
||||||
for (; j < waveCount; j++)
|
for (; j < waveCount; j++)
|
||||||
{
|
{
|
||||||
@ -3627,12 +3649,17 @@ std::vector<float> Uart::DealData(int iChannel,float coe,int sampleRate,int ACCS
|
|||||||
}
|
}
|
||||||
memset(buf,0x00,sizeof(buf));
|
memset(buf,0x00,sizeof(buf));
|
||||||
sprintf(buf, "%02x%02x", g_VecWaveDataX[0].ShortAddr[0], g_VecWaveDataX[0].ShortAddr[1]);
|
sprintf(buf, "%02x%02x", g_VecWaveDataX[0].ShortAddr[0], g_VecWaveDataX[0].ShortAddr[1]);
|
||||||
std::string strShortAddr = std::string(buf);
|
strShortAddr = std::string(buf);
|
||||||
compress = g_mapCompress[strShortAddr].compressChannelX;
|
compress = g_mapCompress[strShortAddr].compressChannelX;
|
||||||
count = g_mapCompress[strShortAddr].CountX;
|
count = g_mapCompress[strShortAddr].CountX;
|
||||||
}
|
}
|
||||||
if (iChannel == 4)
|
if (iChannel == 4)
|
||||||
{
|
{
|
||||||
|
if (VecWaveDataY.size() > 0 )
|
||||||
|
{
|
||||||
|
g_VecWaveDataY.assign(VecWaveDataY.begin(), VecWaveDataY.end());
|
||||||
|
waveCount = VecWaveDataY.size();
|
||||||
|
}
|
||||||
waveCount = m_waveCountY;
|
waveCount = m_waveCountY;
|
||||||
for (; j < waveCount; j++)
|
for (; j < waveCount; j++)
|
||||||
{
|
{
|
||||||
@ -3641,12 +3668,17 @@ std::vector<float> Uart::DealData(int iChannel,float coe,int sampleRate,int ACCS
|
|||||||
}
|
}
|
||||||
memset(buf,0x00,sizeof(buf));
|
memset(buf,0x00,sizeof(buf));
|
||||||
sprintf(buf, "%02x%02x", g_VecWaveDataY[0].ShortAddr[0], g_VecWaveDataY[0].ShortAddr[1]);
|
sprintf(buf, "%02x%02x", g_VecWaveDataY[0].ShortAddr[0], g_VecWaveDataY[0].ShortAddr[1]);
|
||||||
std::string strShortAddr = std::string(buf);
|
strShortAddr = std::string(buf);
|
||||||
compress = g_mapCompress[strShortAddr].compressChannelY;
|
compress = g_mapCompress[strShortAddr].compressChannelY;
|
||||||
count = g_mapCompress[strShortAddr].CountY;
|
count = g_mapCompress[strShortAddr].CountY;
|
||||||
}
|
}
|
||||||
if (iChannel == 5)
|
if (iChannel == 5)
|
||||||
{
|
{
|
||||||
|
if (VecWaveDataZ.size() > 0 )
|
||||||
|
{
|
||||||
|
g_VecWaveDataZ.assign(VecWaveDataZ.begin(), VecWaveDataZ.end());
|
||||||
|
waveCount = VecWaveDataZ.size();
|
||||||
|
}
|
||||||
waveCount = m_waveCountZ;
|
waveCount = m_waveCountZ;
|
||||||
for (; j < waveCount; j++)
|
for (; j < waveCount; j++)
|
||||||
{
|
{
|
||||||
@ -3655,7 +3687,7 @@ std::vector<float> Uart::DealData(int iChannel,float coe,int sampleRate,int ACCS
|
|||||||
}
|
}
|
||||||
memset(buf,0x00,sizeof(buf));
|
memset(buf,0x00,sizeof(buf));
|
||||||
sprintf(buf, "%02x%02x", g_VecWaveDataZ[0].ShortAddr[0], g_VecWaveDataZ[0].ShortAddr[1]);
|
sprintf(buf, "%02x%02x", g_VecWaveDataZ[0].ShortAddr[0], g_VecWaveDataZ[0].ShortAddr[1]);
|
||||||
std::string strShortAddr = std::string(buf);
|
strShortAddr = std::string(buf);
|
||||||
compress = g_mapCompress[strShortAddr].compressChannelZ;
|
compress = g_mapCompress[strShortAddr].compressChannelZ;
|
||||||
count = g_mapCompress[strShortAddr].CountZ;
|
count = g_mapCompress[strShortAddr].CountZ;
|
||||||
}
|
}
|
||||||
@ -3668,12 +3700,16 @@ std::vector<float> Uart::DealData(int iChannel,float coe,int sampleRate,int ACCS
|
|||||||
print_info("lzo1x_decompress end\n");
|
print_info("lzo1x_decompress end\n");
|
||||||
if (r == LZO_E_OK ){
|
if (r == LZO_E_OK ){
|
||||||
printf("decompressed %lu bytes back into %lu bytes\n",
|
printf("decompressed %lu bytes back into %lu bytes\n",
|
||||||
|
(unsigned long) j * 92, (unsigned long) new_len);
|
||||||
|
LOG_INFO("iChannel = %d ,ShortAddr = %s decompressed %lu bytes back into %lu bytes\n",iChannel,strShortAddr.c_str(),
|
||||||
(unsigned long) j * 92, (unsigned long) new_len);
|
(unsigned long) j * 92, (unsigned long) new_len);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* this should NEVER happen */
|
/* this should NEVER happen */
|
||||||
printf("internal error - decompression failed: %d\n", r);
|
printf("internal error - decompression failed: %d\n", r);
|
||||||
|
LOG_ERROR("internal error - decompression failed: %d,channel = %d,ShortAddr = %s\n", r,iChannel,strShortAddr.c_str());
|
||||||
|
return vecData;
|
||||||
}
|
}
|
||||||
memcpy(dealdata,outdata,new_len);
|
memcpy(dealdata,outdata,new_len);
|
||||||
deallen = new_len;
|
deallen = new_len;
|
||||||
@ -3739,10 +3775,6 @@ void Uart::DealWave()
|
|||||||
|
|
||||||
RecvData recvTemp;
|
RecvData recvTemp;
|
||||||
if (m_waveTrans) { //对每个传感器的每个通道进行遍历然后处理数据,例如:传感器1x轴的数据处理完后,再去处理y轴的。传感器1的所有数据处理完后,再处理传感器2的
|
if (m_waveTrans) { //对每个传感器的每个通道进行遍历然后处理数据,例如:传感器1x轴的数据处理完后,再去处理y轴的。传感器1的所有数据处理完后,再处理传感器2的
|
||||||
LOG_INFO("all wave data size is(m_waveCount) : %d \n",\
|
|
||||||
m_waveCountX);
|
|
||||||
print_blue("wave data size is(m_waveCount.size) : %d\n",m_waveCountX);
|
|
||||||
|
|
||||||
char getLongAddr_sql[32] = { 0 };
|
char getLongAddr_sql[32] = { 0 };
|
||||||
sprintf(getLongAddr_sql, "zigbeeShortAddr='%s'", m_strDestShortAddr.c_str());
|
sprintf(getLongAddr_sql, "zigbeeShortAddr='%s'", m_strDestShortAddr.c_str());
|
||||||
vec_t res = sql_ctl->GetDataSingleLine(T_SENSOR_INFO(TNAME)," * ",getLongAddr_sql);
|
vec_t res = sql_ctl->GetDataSingleLine(T_SENSOR_INFO(TNAME)," * ",getLongAddr_sql);
|
||||||
@ -3768,45 +3800,48 @@ void Uart::DealWave()
|
|||||||
memset(getrange, 0, 32);
|
memset(getrange, 0, 32);
|
||||||
sprintf(getrange, "%s", ran.c_str());
|
sprintf(getrange, "%s", ran.c_str());
|
||||||
n = (int)strtol(getrange, NULL, 32);
|
n = (int)strtol(getrange, NULL, 32);
|
||||||
if (m_waveCountX > 0)
|
if (m_waveCountX > 0 || VecWaveDataX.size() > 0)
|
||||||
{
|
{
|
||||||
|
print_info("m_waveCountX = %d,VecWaveData = %d\n",m_waveCountX,VecWaveDataX.size());
|
||||||
coe = Calcoe(n,3,strProduct,range);
|
coe = Calcoe(n,3,strProduct,range);
|
||||||
vecData = DealData(3,coe,sampleRate,ACCSampleTime,strProduct);
|
vecData = DealData(3,coe,sampleRate,ACCSampleTime,strProduct);
|
||||||
WriteDatFile(sampleRate, strMeasurementID, 3,vecData);
|
WriteDatFile(sampleRate, strMeasurementID, 3,vecData);
|
||||||
|
m_waveCountX = 0;
|
||||||
|
g_VecWaveDataX.clear();
|
||||||
|
VecWaveDataX.clear();
|
||||||
}
|
}
|
||||||
if (m_waveCountY > 0)
|
if (m_waveCountY > 0 || VecWaveDataY.size() > 0)
|
||||||
{
|
{
|
||||||
|
print_info("m_waveCountX = %d,VecWaveData = %d\n",m_waveCountY,VecWaveDataY.size());
|
||||||
coe = Calcoe(n,4,strProduct,range);
|
coe = Calcoe(n,4,strProduct,range);
|
||||||
vecData = DealData(4,coe,sampleRate,ACCSampleTime,strProduct);
|
vecData = DealData(4,coe,sampleRate,ACCSampleTime,strProduct);
|
||||||
WriteDatFile(sampleRate, strMeasurementID, 4,vecData);
|
WriteDatFile(sampleRate, strMeasurementID, 4,vecData);
|
||||||
|
m_waveCountY = 0;
|
||||||
|
g_VecWaveDataY.clear();
|
||||||
|
VecWaveDataY.clear();
|
||||||
}
|
}
|
||||||
if (m_waveCountZ > 0)
|
if (m_waveCountZ > 0 || VecWaveDataZ.size() > 0)
|
||||||
{
|
{
|
||||||
|
print_info("m_waveCountZ = %d,VecWaveDataZ = %d\n",m_waveCountZ,VecWaveDataZ.size());
|
||||||
coe = Calcoe(n,5,strProduct,range);
|
coe = Calcoe(n,5,strProduct,range);
|
||||||
vecData = DealData(5,coe,sampleRate,ACCSampleTime,strProduct);
|
vecData = DealData(5,coe,sampleRate,ACCSampleTime,strProduct);
|
||||||
WriteDatFile(sampleRate, strMeasurementID, 5,vecData);
|
WriteDatFile(sampleRate, strMeasurementID, 5,vecData);
|
||||||
}
|
m_waveCountZ = 0;
|
||||||
|
g_VecWaveDataZ.clear();
|
||||||
|
VecWaveDataZ.clear();
|
||||||
|
|
||||||
}
|
}
|
||||||
if (strLongAddr != "")
|
|
||||||
{
|
|
||||||
char whereCon[1024] = {0x00};
|
char whereCon[1024] = {0x00};
|
||||||
char updateSql[1024] = {0x00};
|
char updateSql[1024] = {0x00};
|
||||||
sprintf(whereCon, "dataNodeNo='%s'", strLongAddr.c_str());
|
sprintf(whereCon, "dataNodeNo='%s'", strLongAddr.c_str());
|
||||||
sprintf(updateSql, "WaveTime = WaveTime + 1");
|
sprintf(updateSql, "WaveTime = WaveTime + 1");
|
||||||
sql_ctl->UpdateTableData(T_SENSOR_INFO(TNAME), updateSql, whereCon);
|
sql_ctl->UpdateTableData(T_SENSOR_INFO(TNAME), updateSql, whereCon);
|
||||||
m_waveCountX = 0;
|
|
||||||
m_waveCountY = 0;
|
|
||||||
m_waveCountZ = 0;
|
|
||||||
g_VecWaveDataX.clear();
|
|
||||||
g_VecWaveDataY.clear();
|
|
||||||
g_VecWaveDataZ.clear();
|
|
||||||
m_waveTrans = false;
|
m_waveTrans = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//string strData = sql_ctl->GetNodeConfigureInfor(whereCon);
|
//string strData = sql_ctl->GetNodeConfigureInfor(whereCon);
|
||||||
//data_publish(strData.c_str(), GlobalConfig::Topic_G.mPubConfig.c_str());
|
//data_publish(strData.c_str(), GlobalConfig::Topic_G.mPubConfig.c_str());
|
||||||
// memset(buf, 0, 8);
|
// memset(buf, 0, 8);
|
||||||
|
@ -98,7 +98,7 @@ public :
|
|||||||
void WriteShortAddr2Zigbee(unsigned short pad);
|
void WriteShortAddr2Zigbee(unsigned short pad);
|
||||||
void WriteShortAddr_DistAddr2Zigbee(unsigned short pad,unsigned char* pDestShortAddr);
|
void WriteShortAddr_DistAddr2Zigbee(unsigned short pad,unsigned char* pDestShortAddr);
|
||||||
void UpdateWirelessNode(unsigned short shortAdd);
|
void UpdateWirelessNode(unsigned short shortAdd);
|
||||||
void UpdateWirelessNodeTime(unsigned char* pDestShortAddr,int modifyaddr/*,int nodewaveindex,int nodetime,int nodeindex*/);
|
int UpdateWirelessNodeTime(unsigned char* pDestShortAddr,int modifyaddr/*,int nodewaveindex,int nodetime,int nodeindex*/);
|
||||||
int UpdateConfig(unsigned char* pDestShortAddr);
|
int UpdateConfig(unsigned char* pDestShortAddr);
|
||||||
bool ReadUpdatePackge(unsigned char* shortAddr);
|
bool ReadUpdatePackge(unsigned char* shortAddr);
|
||||||
bool CheckCrc(char* pCheckBuff,int No);
|
bool CheckCrc(char* pCheckBuff,int No);
|
||||||
@ -114,12 +114,15 @@ private :
|
|||||||
void WriteHandle(const char *strSend,const boost::system::error_code &ec,size_t bytesWrite);
|
void WriteHandle(const char *strSend,const boost::system::error_code &ec,size_t bytesWrite);
|
||||||
onReceiveUart m_callback;
|
onReceiveUart m_callback;
|
||||||
|
|
||||||
|
boost::mutex mtx; // 互斥锁
|
||||||
unsigned long m_TimeStamp;
|
unsigned long m_TimeStamp;
|
||||||
bool m_waveTrans;
|
bool m_waveTrans;
|
||||||
int m_waveCountX;
|
int m_waveCountX;
|
||||||
int m_waveCountY;
|
int m_waveCountY;
|
||||||
int m_waveCountZ;
|
int m_waveCountZ;
|
||||||
|
std::vector<RecvData> VecWaveDataX;
|
||||||
|
std::vector<RecvData> VecWaveDataY;
|
||||||
|
std::vector<RecvData> VecWaveDataZ;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user