-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathmyparse.cpp
43 lines (41 loc) · 1.16 KB
/
myparse.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include "myparse.h"
#include "mymethod.h"
MyParse::MyParse(QObject *parent) : QObject(parent)
{
}
/**
*函数名:获取can接收数据结构体
*函数参数:NULL
*函数作用:NULL
*函数返回值:NULL
*备注:NULL
*/
void MyParse::getCanDataSlot(PVCI_CAN_OBJ objs,int count)
{
//发送给主界面显示
QString showInfo;
//qDebug()<<"count:"<<count;
for(int i=0;i<count;i++)
{
int packetType = Mymethod::GetInstance()->getPacketType(objs[i].ID);
int sourAddr = Mymethod::GetInstance()->getSourceAdres(objs[i].ID);
if((packetType != filterType)&&(filterType != ALL_PACKET))//过滤报文类型
{
//qDebug()<<"packetType:"<<packetType;
continue;
}
if((sourAddr != filterSourAddr)&&(filterSourAddr != ALL_ADDR))//过滤源地址
{
//qDebug()<<"sourAddr:"<<sourAddr;
continue;
}
//qDebug()<<"get a packet:"<<packetType;
PackeManager packet(packetType);
packet.setPacket(objs[i]);
showInfo += packet.getMeaningStr(CAN_RCV)+"\n";
}
if(showInfo!="")
{
emit showInfoSignal(showInfo.trimmed());
}
}