#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); int32_t GetSteerAngle(); //void SetCurrentPage(PageProp prop); //PageProp GetCurrentPage(); void Start(std::array& 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)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); /// /* 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); */ /// //virtual void OnLidarData(bool isLeft, bool isDense, int32_t seq, PointXYZI* data, int32_t length) override; void OnFeedPage(FeedData& data); private: std::unique_ptr _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 > _userInfo; CUpdateThread _updateThread; std::vector> _WindowArray; std::unique_ptr _can; std::unique_ptr _carsim; std::unique_ptr _outsim; std::unique_ptr _radarsim; //std::unique_ptr _lidarsim; int32_t _uid = 0; int32_t _steer_angle = 0; //PageProp _currentpage = PageProp::WorkPage1; };