EgoController.cpp 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #define WIN32_LEAN_AND_MEAN
  2. #include <windows.h>
  3. #include "PCANBasic.h"
  4. #include "protocol.pb.h"
  5. #include "api/video/video_frame.h"
  6. #include "include/EgoInterface.h"
  7. #include "api.h"
  8. #include "../common/peer_connection.h"
  9. #include "control_sensor.h"
  10. #include "EgoWindow.h"
  11. #include "car_sim.h"
  12. #include "lidar_sim.h"
  13. #include "radar_sim.h"
  14. #include "EgoClient.h"
  15. #include "EgoController.h"
  16. CEgoController::CEgoController(IEgoNotify* noitfy)
  17. {
  18. _client = std::make_unique<CEgoClient>(noitfy);
  19. }
  20. void CEgoController::OnCarConnect(int32_t peer)
  21. {
  22. _client->OnCarConnect(peer);
  23. }
  24. void CEgoController::OnCarLeave()
  25. {
  26. _client->OnCarLeave();
  27. }
  28. void CEgoController::Login(std::string account, std::string pass)
  29. {
  30. _client->Login(account, pass);
  31. }
  32. void CEgoController::Start(std::array<IRender*, RenderPosition::ALL>& ar)
  33. {
  34. _client->Start(ar);
  35. }
  36. void CEgoController::SetReady(bool b)
  37. {
  38. _client->SetReady(b);
  39. }
  40. void CEgoController::ReqCarList()
  41. {
  42. _client->ReqCarList();
  43. }
  44. void CEgoController::OnMoveBegin(int32_t rid, WorkArea area, int32_t no)
  45. {
  46. _client->OnMoveBegin(rid, area, no);
  47. }
  48. /*
  49. void CEgoController::SwitchDriver(int32_t id)
  50. {
  51. _client->SwitchDriver(id);
  52. }
  53. */
  54. void CEgoController::ChangeState(UserState state)
  55. {
  56. _client->ChangeState(state);
  57. }
  58. std::string CEgoController::GetAccount()
  59. {
  60. return _client->GetAccount();
  61. }
  62. std::string CEgoController::GetPassword()
  63. {
  64. return _client->GetPassword();
  65. }
  66. std::string CEgoController::GetName()
  67. {
  68. return _client->GetName();
  69. }
  70. /*
  71. bool CEgoController::IsAutoClose()
  72. {
  73. return _client->IsAutoClose();
  74. }
  75. */
  76. ControlStatus CEgoController::CheckStatus()
  77. {
  78. return _client->CheckStatus();
  79. }
  80. /*
  81. void CEgoController::SetCurrentPage(PageProp prop)
  82. {
  83. _client->SetCurrentPage(prop);
  84. }
  85. */