Ego.cpp 1018 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #include "Ego.h"
  2. // start -> login -> OnSigin -> OnCarConnect -> OnRobot -> OnCarLeave
  3. // -> OnNotifyDel
  4. void CEgoNotify::OnSigin(bool bRet) {
  5. if (bRet) {
  6. emit egoLoginResult(true);
  7. } else {
  8. emit egoLoginResult(false);
  9. }
  10. }
  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. emit egoCarAppend(users);
  18. }
  19. void CEgoNotify::OnNotifyDel(int32_t peer) {
  20. qDebug() << "OnNotifyDel";
  21. emit egoNotifyDel();
  22. }
  23. void CEgoNotify::OnNotifyRadar(int32_t r0, int32_t r1, int32_t r2, int32_t r3,
  24. int32_t r4, int32_t r5) {
  25. emit egoRadar(r0, r1, r2, r3, r4, r5);
  26. }
  27. void CEgoNotify::OnNotifyImu(int32_t x, int32_t y) { emit egoImu(x, y); }
  28. void CEgoNotify::OnNotifyPing(int32_t value) { emit egoPing(value); }
  29. void CEgoNotify::OnNotifyKickOff() {
  30. qDebug() << "kick off";
  31. emit egoKickoff();
  32. }