| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- #ifndef CANCTRL_H
- #define CANCTRL_H
- #include <QThread>
- #include <QMutex>
- #include <memory>
- #include <QTimer>
- #include <array>
- #include <vector>
- #include <iostream>
- #include "vcican.h"
- #include "modulecomm.h"
- #include "canmsg.pb.h"
- #include "canraw.pb.h"
- #include "canstate.pb.h"
- class canctrl : public QThread
- {
- Q_OBJECT
- public:
- canctrl(const char * strmemsend0,const char * strmemsend1,const char * strmemrecv0,const char * strmemrecv1,const char * strdevnum = "0",
- const char * strbaud0="500k",const char * strbaud1="500k");
- private slots:
- void onCANState(bool bCAN,int nR,const char * strres);
- private:
- void run();
- basecan * mpcan;
- std::shared_ptr<basecan> mspcan;
- bool mbCANOpen = false;
- std::vector<basecan_msg> msendmsgvector1;
- std::vector<basecan_msg> msendmsgvector2;
- const int SENDMSGBUFSIZE = 3000;
- QMutex mMutexcan1;
- QMutex mMutexcan2;
- void * mpasend0,*mpcanState, * mpasend1, * mparecv0, * mparecv1;
- int mindex[2];
- char mstrmemsend0[256],mstrmemsend1[256],mstrmemrecv0[256],mstrmemrecv1[256];
- public:
- void sendmsg(int index,iv::can::canmsg xmsg);
- void sharecanmsg(void * xpa,basecan_msg * pxmsg,int ncount,int nch);
- };
- #endif // CANCTRL_H
|