123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- #pragma once
- #include "message_queue.h"
- #include "api.h"
- #define WM_NOTIFY_CONNECTED WM_APP+100
- class IEgoNotify;
- class CEgoWindow;
- class IRender;
- #include "../common/sensor_socket.h"
- #include "./include/EgoInterface.h"
- #include "PCANBasic.h"
- class CControlSensor;
- class CCarSim;
- class COutSim;
- class CRadarSim;
-
- class CLidarSim;
-
- class CEgoClient : public INativeNotify
- {
- public:
- CEgoClient(IEgoNotify * C);
- void Login(std::string& account, std::string& pass);
- void OnCarConnect(int32_t peer);
- void OnCarLeave();
- void ReqCarList();
- void OnMoveBegin(int32_t rid, WorkArea area, int32_t no);
- void SwitchDriver(int32_t id);
-
- //void ChangeState(UserState state);
- void ChangeState(int carID,UserState state); //ChangeState重新构建
- int32_t GetSteerAngle();
- //void SetCurrentPage(PageProp prop);
- //PageProp GetCurrentPage();
- void Start(std::array<IRender*, RenderPosition::ALL>& ar);
- void OnRadarData(int32_t r0, int32_t r1, int32_t r2, int32_t r3, int32_t r4, int32_t r5, int32_t r6, int32_t r7);
- void OnImuData(float x, float y);
- void OnEncodeData(int32_t left, int32_t right);
- void OnPingValue(int32_t value, double temp);
- void OnStopAck();
- //增加wfg
- void SendCanDate(TPCANMsg* CANMsg);
- void SetReady(bool b);
- std::string GetAccount() ;
- std::string GetPassword() ;
- std::string GetName();
- //bool IsAutoClose();
- ControlStatus CheckStatus();
- SocketClient* GetSocketClient();
- //virtual void Process(CIOBuffer* pBuffer) override;
-
- //传递所有车辆信息
- virtual void OnRobot(const RemoNet::Robot& robot) override;
-
- virtual void OnConnected(bool bRet) override;
- virtual void OnSigin(int32_t uid,bool bRet,std::string user_uuid)override;
- virtual void OnVideoRep(bool ok,int32_t index, int32_t peer) override;
- virtual void OnVideoOffer(int32_t index, const char* type, const char* sdp) override;
- virtual void OnVideoAnswer(int32_t index, const char* type, const char* sdp) override;
- virtual void OnVideoCandidate(int32_t index, const char* candidate, int32_t sdp_mline_index, const char* sdp_mid) override;
- virtual void OnNotifyDel(int32_t peer, EgoType type) override;
- virtual void OnVideoLeave(int32_t peer, EgoType type) override;
- virtual void OnNotifyKick() override;
- virtual void OnMoveEnd(int32_t rid, WorkArea area, int32_t no) override;
- virtual void OnNotifyMoveRet(MoveDesc desc) override;
- virtual void OnNotifyState(int32_t rid, UserState state) override;
- void OnNDTPos(Position* pos);
-
- //当收到消息帧通知时,根据ChannelType来调用不同通道的处理函数
- virtual void OnMessageFrameNotify(ChannelType type, int16_t cmd, int16_t length, const void* data) override;
-
- //add-wfg
- void OnCautionLight(bool cautionLight);
- void OnLightL(bool lightL);
- void OnLightR(bool lightR);
- void OnGearF(bool gearF);
- void OnGearR(bool gearR);
- void OnCarPark(bool carPark);
- void OnBuzzerPlay(bool buzzerPlay);
- void OnLightFront(bool lightFront);
- void OnLightWork(bool lightWork);
- void OnEmergency(bool emergency);
- /// <summary>
-
- //mqtt
- void OnMqttData(cannet_frame* frames);
-
- /*
-
-
- void OnEmergency(bool enable, bool motor, bool gear, bool turnl, bool turnR);
- void OnAccel(int16_t accel, bool onoff);
- void OnSteer(uint64_t steer);
- void OnArm(int16_t flip, int16_t armL, int16_t armR, bool onoff);
- */
- /// </summary>
-
-
- //virtual void OnLidarData(bool isLeft, bool isDense, int32_t seq, PointXYZI* data, int32_t length) override;
- void OnFeedPage(FeedData& data);
-
- private:
- std::unique_ptr<SocketClient> _client;
- int32_t _carpeer;
- std::string _account;
- std::string _pass;
- std::string _accountText;
- std::string _passText;
- std::string _name;
- //bool _autoclose = false;
- IEgoNotify* _notify;
- bool _connected;
- std::vector<std::unique_ptr<UserCamera> > _userInfo;
- CUpdateThread _updateThread;
- std::vector<std::unique_ptr<CEgoWindow>> _WindowArray;
- std::unique_ptr<CControlSensor> _can;
- std::unique_ptr<CCarSim> _carsim;
- std::unique_ptr<COutSim> _outsim;
- std::unique_ptr<CRadarSim> _radarsim;
-
- //std::unique_ptr<CLidarSim> _lidarsim;
- int32_t _uid = 0;
- int32_t _steer_angle = 0;
-
- //PageProp _currentpage = PageProp::WorkPage1;
-
- };
|