123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- #pragma once
- #ifdef EGODLL_EXPORTS
- #define EGODLL_API __declspec(dllexport)
- #else
- #define EGODLL_API __declspec(dllimport)
- #endif
- #include <stdint.h>
- #include <memory>
- #include <array>
- #include "../common/comm.h"
- struct PointXYZI ///< user defined point type
- {
- float x;
- float y;
- float z;
- uint8_t intensity;
- };
- struct Position
- {
- float x;
- float y;
- float z;
- float rx;
- float ry;
- float rz;
- float rw;
- };
- /*
- enum PageProp
- {
- WorkPage1,
- WorkPage2,
- EngineParameterPage,
- CalibrationPage,
- WarningPage
- };
- */
- class IRender
- {
- public:
- virtual void OnRender(std::unique_ptr<uint8_t>& pBuffer, int32_t width, int32_t height) = 0;
- virtual void Empty() = 0;
- };
- /*
- 一个抽象接口类
- 类中定义的纯虚函数需要在其派生类中实现
- */
- class IEgoNotify
- {
- public:
-
- virtual void OnRobot(std::unique_ptr<UserCamera>& info) = 0;
- virtual void OnSigin(bool bRet) = 0;
- virtual void OnNotifyDel(int32_t peer) = 0;
- virtual void OnNotifyKickOff() = 0;
- virtual void OnNotifyRadar(int32_t r0, int32_t r1, int32_t r2, int32_t r3, int32_t r4, int32_t r5,int32_t r6, int32_t r7) = 0;
- virtual void OnNotifyImu(float x, float y) = 0;
- virtual void OnNotifyEncode(int32_t left, int32_t right) = 0;
- virtual void OnNotifyLeave(int32_t peer) = 0;
- virtual void OnNotifyPing(int32_t value, double temp) = 0;
- virtual void OnNotifyState(int32_t uid, UserState state) = 0;
- virtual void OnNotifyVideoFail(int32_t uid) = 0;
- virtual void OnNotifyFeed(const FeedData& data) = 0;
- virtual void OnNotifyMoveEnd(int32_t rid, WorkArea area, int32_t no) = 0;
- virtual void OnNotifyMoveRet(MoveDesc desc) = 0;
- virtual void OnNDTPos(Position* pos) = 0;
- //add-wfg
- virtual void OnCautionLight(bool cautionLight) = 0;
- virtual void OnLightL(bool lightL) = 0;
- virtual void OnLightR(bool lightR) = 0;
- virtual void OnGearF(bool gearF) = 0;
- virtual void OnGearR(bool gearR) = 0;
- virtual void OnCarPark(bool carPark) = 0;
- virtual void OnBuzzerPlay(bool buzzerPlay) = 0;
- virtual void OnLightFront(bool lightFront) = 0;
- virtual void OnLightWork(bool lightWork) = 0;
- virtual void OnEmergency(bool emergency) = 0;
- //virtual void OpenFullView(const char* viewurl) = 0;
- //virtual void CloseFullView() = 0;
- /*
- virtual void OnEmergency(bool enable, bool motor, bool gear, bool turnl, bool turnR) = 0;
- virtual void OnAccel(int16_t accel,bool onoff) = 0;
- virtual void OnSteer(uint64_t steer) = 0;
- virtual void OnArm(int16_t flip, int16_t armL, int16_t armR, bool onoff) = 0;
- */
- };
- enum ControlStatus
- {
- Ok,
- GearNotN,
- Gear_D_d_1,
- BootStrap,//已加电
- Startup,//已启动
- Emergency,
- Steer,
- Throttle,
- Brake,
- ArmTriger,
- DircLightNotOff,//转向灯关闭
- };
- class IEgoControl
- {
- public:
- virtual void Login(std::string account, std::string pass) = 0;
- virtual void Start(std::array<IRender*, RenderPosition::ALL>& ar) = 0;
- virtual void ReqCarList() = 0;
- virtual void OnCarConnect(int32_t peer) = 0;
- virtual void OnCarLeave() = 0;
- virtual void OnMoveBegin(int32_t rid,WorkArea area, int32_t no) = 0;
- //virtual void SwitchDriver(int32_t id) = 0;
- virtual ControlStatus CheckStatus() = 0;
- virtual std::string GetAccount() = 0;
- virtual std::string GetPassword() = 0;
- virtual std::string GetName() = 0;
- //virtual bool IsAutoClose() = 0;
- virtual void ChangeState(UserState state) = 0;
- virtual void SetReady(bool b) = 0;
- //virtual void SetCurrentPage(PageProp prop) = 0;
- };
-
- EGODLL_API IEgoControl* GetEgoController(IEgoNotify* n);
|