Ego.cpp 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. #include "Ego.h"
  2. // start -> login -> OnSigin -> OnCarConnect -> OnRobot -> OnCarLeave
  3. // -> OnNotifyDel
  4. //qqq 发送给QT
  5. void CEgoNotify::OnSigin(bool bRet) {
  6. emit egoLoginResult(bRet);
  7. //emit egoMoveEnd(10004, WorkArea::Area_F, 32);
  8. }
  9. //qqq 发送给QT
  10. //车辆ID
  11. void CEgoNotify::OnRobot(std::unique_ptr<UserCamera> &info) {
  12. UserCamera users;
  13. users.uid = info->uid;
  14. users.name = info->name;
  15. users.type = info->type;
  16. users.state = info->state;
  17. users.carType = info->carType;
  18. //_users.push_back(users);
  19. emit egoCarAppend(users);
  20. }
  21. void CEgoNotify::OnNotifyDel(int32_t peer)
  22. {
  23. qDebug() << "OnNotifyDel";
  24. emit egoNotifyDel(peer);
  25. }
  26. //qqq 发送给QT
  27. void CEgoNotify::OnNotifyRadar(int32_t r0, int32_t r1, int32_t r2, int32_t r3,
  28. int32_t r4, int32_t r5,int32_t r6,int32_t r7,int32_t r8)
  29. {
  30. emit egoRadar(r0, r1, r2, r3, r4, r5,r6,r7,r8);
  31. }
  32. void CEgoNotify::OnNotifyEncode(int32_t left, int32_t right)
  33. {
  34. emit egoEncode(left, right);
  35. }
  36. //void CEgoNotify::OnNotifyIMU() {}
  37. void CEgoNotify::OnNotifyPing(int32_t value,double temp) { emit egoPing(value,temp); }
  38. void CEgoNotify::OnNotifyKickOff() {
  39. qDebug() << "kick off";
  40. emit egoKickoff();
  41. }
  42. void CEgoNotify::OnNotifyMoveEnd(int32_t rid, WorkArea area, int32_t no)
  43. {
  44. emit egoMoveEnd(rid, area, no);
  45. }
  46. void CEgoNotify::OnNotifyMoveRet(MoveDesc desc)
  47. {
  48. emit egoMoveRet(desc);
  49. }
  50. // void CEgoNotify::OnEmergency(bool enable, bool motor, bool gear, bool turnl, bool turnR) {
  51. //
  52. // }
  53. // void CEgoNotify::OnAccel(int16_t accel, bool onoff)
  54. // {
  55. //
  56. // }
  57. // void CEgoNotify::OnSteer(uint64_t steer)
  58. // {
  59. //
  60. // }
  61. // void CEgoNotify::OnArm(int16_t flip, int16_t armL, int16_t armR, bool onoff)
  62. // {
  63. //
  64. // }
  65. void CEgoNotify::OnNotifyFeed(const FeedData& data)
  66. {
  67. emit egoFeedData(data);
  68. }
  69. void CEgoNotify::OnNotifyLeave(int32_t peer)
  70. {
  71. emit egoNotifyLeave(peer);
  72. }
  73. void CEgoNotify::OnNotifyState(int32_t uid, UserState state)
  74. {
  75. /*
  76. for (auto& node : _users)
  77. {
  78. if (node.uid == uid)
  79. {
  80. node.state = state;
  81. break;
  82. }
  83. }
  84. */
  85. emit egoNotifyState(uid,state);
  86. }
  87. void CEgoNotify::OnNotifyVideoFail(int32_t uid)
  88. {
  89. emit egoNotifyFail(uid);
  90. }
  91. void CEgoNotify::OnNDTPos(Position* pos)
  92. {
  93. emit egoPosition(pos->x, pos->y, pos->z);
  94. }