EgoController.cpp 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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 "out_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. void CEgoController::ChangeState(int carID,UserState state)
  59. {
  60. _client->ChangeState(carID,state);
  61. }
  62. std::string CEgoController::GetAccount()
  63. {
  64. return _client->GetAccount();
  65. }
  66. std::string CEgoController::GetPassword()
  67. {
  68. return _client->GetPassword();
  69. }
  70. std::string CEgoController::GetName()
  71. {
  72. return _client->GetName();
  73. }
  74. /*
  75. bool CEgoController::IsAutoClose()
  76. {
  77. return _client->IsAutoClose();
  78. }
  79. */
  80. ControlStatus CEgoController::CheckStatus()
  81. {
  82. return _client->CheckStatus();
  83. }
  84. /*
  85. void CEgoController::SetCurrentPage(PageProp prop)
  86. {
  87. _client->SetCurrentPage(prop);
  88. }
  89. */