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