12345678910111213141516171819202122232425262728293031323334 |
- #pragma once
- #include <thread>
- #include <fstream>
- #include <string>
- #include <mutex>
- 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;
-
- };
|