123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- // MainDlg.h : interface of the CMainDlg class
- //
- /////////////////////////////////////////////////////////////////////////////
- #pragma once
- #include <thread>
- #include <functional>
- #include <vector>
- #include "EgoInterface.h"
- #define WM_NOTIFYCONNECTED WM_APP+100
- #define MSG_WM_NOTIFYCONNECTED(func) if(uMsg==WM_NOTIFYCONNECTED){SetMsgHandled(TRUE); func((bool)wParam); lResult = 0; if(IsMsgHandled()) return TRUE;}
- #define WM_NOTIFYSIGIN WM_APP+101
- #define MSG_WM_NOTIFYSIGIN(func) if(uMsg==WM_NOTIFYSIGIN){SetMsgHandled(TRUE); func((bool)wParam); lResult = 0; if(IsMsgHandled()) return TRUE;}
- #define WM_NOTIFYREADY WM_APP+102
- #define MSG_WM_NOTIFYREADY(func) if(uMsg==WM_NOTIFYREADY){SetMsgHandled(TRUE); func(); lResult = 0; if(IsMsgHandled()) return TRUE;}
- #define WM_NOTIFYSTOP WM_APP+103
- #define MSG_WM_NOTIFYSTOP(func) if(uMsg==WM_NOTIFYSTOP){SetMsgHandled(TRUE); func(); lResult = 0; if(IsMsgHandled()) return TRUE;}
- #define WM_NOTIFYCONNECT WM_APP+104
- #define MSG_WM_NOTIFYCONNECT(func) if(uMsg==WM_NOTIFYCONNECT){SetMsgHandled(TRUE); func((int32_t)wParam); lResult = 0; if(IsMsgHandled()) return TRUE;}
- #define WM_NOTIFYDISCONNECT WM_APP+105
- #define MSG_WM_NOTIFYDISCONNECT(func) if(uMsg==WM_NOTIFYDISCONNECT){SetMsgHandled(TRUE); func((int32_t)wParam); lResult = 0; if(IsMsgHandled()) return TRUE;}
- //#define IDC_STATETIMER 0x1002
- //#define WM_STOP_ACK WM_APP+106
- //#define MSG_STOP_ACK(func) if(uMsg==WM_STOP_ACK){SetMsgHandled(TRUE); func(); lResult = 0; if(IsMsgHandled()) return TRUE;}
- class CRenderWindow;
- class CFishEyeWindow;
- class CMainDlg : public CDialogImpl<CMainDlg>,public IEgoNotify
- {
- public:
- enum { IDD = IDD_MAINDLG };
- BEGIN_MSG_MAP_EX(CMainDlg)
- MSG_WM_INITDIALOG(OnInitDialog)
- MSG_WM_DESTROY(OnDestroy)
- MSG_WM_NOTIFYCONNECTED(OnNotifyConnected)
- MSG_WM_NOTIFYSIGIN(OnNotifySigin)
- //MSG_WM_TIMER(OnTimer)
-
- //MSG_STOP_ACK(OnStopAck)
- //MSG_WM_NOTIFYREADY(OnNotifyReady)
- //MSG_WM_NOTIFYCONNECT(OnNotifyConnect)
- //MSG_WM_NOTIFYDISCONNECT(OnNotifyDisconnect)
- //MSG_WM_NOTIFYSTOP(OnNotifyStop)
- //MSG_WM_NOTIFY_STATE(OnNotifyState)
- //MSG_WM_NOTIFY_REP(OnNotifyRep)
- COMMAND_ID_HANDLER_EX(IDC_CARDISCONNECT, OnCarLeave)
-
- COMMAND_ID_HANDLER_EX(IDC_CARCONNECT, OnCarConnect)
-
- COMMAND_ID_HANDLER_EX(IDCANCEL, OnCancel)
- END_MSG_MAP()
- // Handler prototypes (uncomment arguments if needed):
- // LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
- // LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
- // LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)
-
- LRESULT OnInitDialog(HWND,LPARAM);
-
- void OnCancel(WORD /*wNotifyCode*/, WORD wID, HWND );
- virtual void OnRobot(std::unique_ptr<UserCamera>& info) override;
- virtual void OnSigin(bool bRet) override;
- virtual void OnNotifyDel(int32_t peer) override;
- virtual void OnNotifyKickOff() override;
- virtual void OnNotifyRadar(int32_t r0, int32_t r1, int32_t r2, int32_t r3, int32_t r4, int32_t r5) override;
- void OnNotifySigin(bool bRet);
- virtual void OnNotifyPing(int32_t value) override;
- void OnDestroy(void);
- //void OnStopAck(void);
- void OnTimer(UINT idEvent);
- void OnNotifyConnected(bool bRet);
- void OnCarConnect(WORD, WORD, HWND);
- void OnCarLeave(WORD, WORD, HWND);
- // virtual void OnEmergency(bool enable, bool motor, bool gear, bool turnl, bool turnR) override;
- // virtual void OnAccel(int16_t accel, bool onoff) override;
- // virtual void OnSteer(uint64_t steer) override;
- // virtual void OnArm(int16_t flip, int16_t armL, int16_t armR, bool onoff) override;
- virtual void OnLidarData(bool isLeft, bool isDense, int32_t seq, PointXYZI* data, int32_t length) override;
- virtual void OnNotifyFeed(const FeedData& data) override;
- virtual void OnNotifyLeave(int32_t peer) override;
- virtual void OnNotifyMoveEnd(int32_t rid, WorkArea area, int32_t no) override;
- private:
- std::vector<std::unique_ptr<UserCamera> > _userInfo;
- std::vector<std::unique_ptr<CRenderWindow>> _WindowArray;
- IEgoControl* _control;
- std::unique_ptr<CFishEyeWindow> _fishWindow;
- std::string _name;
- std::string _account;
- std::string _password;
- int32_t _carpeer = -1;
- bool _enable=false;
- bool _motor=false;
- bool _gear = false;
- bool _turnL = false;
- bool _turnR = false;
- int16_t _steer = 0;
-
- int16_t _accel = 0;
- bool _onoff = false;
-
- };
|