12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- #ifndef SHENLANFD_H
- #define SHENLANFD_H
- #include <thread>
- #include <iostream>
- #include <mutex>
- namespace iv {
- struct dcs
- {
- double mfTorque;
- double mfBrake;
- double mfWheel;
- double mblampleft;
- double mblampright;
- };
- }
- class Shenlanfd
- {
- public:
- Shenlanfd();
- ~Shenlanfd();
- void SetSpeed(double fSpeed);
- void SetDecision(iv::dcs &xdcs);
- void Get1C4(unsigned char * p1C4);
- void Get24E(unsigned char * p24E);
- void Get25E(unsigned char * p25E);
- private:
- void threadsend();
- void ExecuteDecision(iv::dcs & xdcs);
- private:
- std::thread * mpthreadsend;
- bool mbRun = true;
- bool mbHaveVehSpd = false;
- double mfVehSpd = 0.0;
- iv::dcs mdcs;
- std::mutex mmutexdcs;
- int64_t mnLastUpdate = 0;
- };
- #endif // SHENLANFD_H
|