#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" #include "udpcan.h" #include "control_sensor.h" class CControlSensor; class CCarSim; class COutSim; class CRadarSim; class CLidarSim; class CUdpSensor; 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,int32_t r8); void OnEncodeData(int32_t left, int32_t right); void OnPingValue(int32_t value, double temp); void OnStopAck(); 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); virtual void OnMessageFrameNotify(ChannelType type, int16_t cmd, int16_t length, const void* data) override; /// /* 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); */ /// std::unique_ptr> _udpcan; std::unique_ptr _can; std::unique_ptr _carsim; //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 _outsim; std::unique_ptr _radarsim; //std::unique_ptr _lidarsim; int32_t _uid = 0; float _steer_angle = 0; //PageProp _currentpage = PageProp::WorkPage1; };