#ifndef SHENLANFD_H #define SHENLANFD_H #include #include #include 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