#pragma once #include #include #include #include enum EventType { NORMAL, OFFLINE, EMERGENCY, LOW_RPM, }; class CEventLog { public: void Start(); void Stop(); void SetEvent( EventType type,int32_t steer,int32_t accel,int32_t brake); private: void Run(); std::string GetLocalTime(); EventType _type=EventType::NORMAL; int32_t _steer=0; int32_t _accel=0; int32_t _brake=0; bool _run; std::mutex _mutex; std::thread _thread; std::ofstream _ofile; };