123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- #include "Ego.h"
- // start -> login -> OnSigin -> OnCarConnect -> OnRobot -> OnCarLeave
- // -> OnNotifyDel
- void CEgoNotify::OnSigin(bool bRet) {
-
-
- emit egoLoginResult(bRet);
- //emit egoMoveEnd(10004, WorkArea::Area_F, 32);
- }
- //传递所有车辆信息,以egoCarAppend信号中的参数发送到appmodel类
- void CEgoNotify::OnRobot(std::unique_ptr<UserCamera> &info) {
- UserCamera users;
- users.uid = info->uid;
- users.name = info->name;
- users.type = info->type;
- users.state = info->state;
- users.carType = info->carType;
- //_users.push_back(users);
- //发送信号到appmodel类中
- emit egoCarAppend(users);
- }
- void CEgoNotify::OnNotifyDel(int32_t peer) {
- qDebug() << "OnNotifyDel";
- emit egoNotifyDel(peer);
- }
- void CEgoNotify::OnNotifyRadar(int32_t r0, int32_t r1, int32_t r2, int32_t r3,
- int32_t r4, int32_t r5,int32_t r6, int32_t r7) {
- emit egoRadar(r0, r1, r2, r3, r4, r5,r6,r7);
- }
- void CEgoNotify::OnNotifyImu(float x, float y) { emit egoImu(x, y); }
- void CEgoNotify::OnNotifyEncode(int32_t left, int32_t right)
- {
- emit egoEncode(left, right);
- }
- //void CEgoNotify::OnNotifyIMU() {}
- void CEgoNotify::OnNotifyPing(int32_t value,double temp) { emit egoPing(value,temp); }
- void CEgoNotify::OnNotifyKickOff() {
- qDebug() << "kick off";
- emit egoKickoff();
- }
- void CEgoNotify::OnNotifyMoveEnd(int32_t rid, WorkArea area, int32_t no)
- {
- emit egoMoveEnd(rid, area, no);
- }
- void CEgoNotify::OnNotifyMoveRet(MoveDesc desc)
- {
- emit egoMoveRet(desc);
- }
- // void CEgoNotify::OnEmergency(bool enable, bool motor, bool gear, bool turnl, bool turnR) {
- //
- // }
- // void CEgoNotify::OnAccel(int16_t accel, bool onoff)
- // {
- //
- // }
- // void CEgoNotify::OnSteer(uint64_t steer)
- // {
- //
- // }
- // void CEgoNotify::OnArm(int16_t flip, int16_t armL, int16_t armR, bool onoff)
- // {
- //
- // }
- void CEgoNotify::OnNotifyFeed(const FeedData& data)
- {
- emit egoFeedData(data);
- }
- void CEgoNotify::OnNotifyLeave(int32_t peer)
- {
- emit egoNotifyLeave(peer);
- }
- void CEgoNotify::OnNotifyState(int32_t uid, UserState state)
- {
- /*
- for (auto& node : _users)
- {
- if (node.uid == uid)
- {
- node.state = state;
- break;
- }
- }
- */
- emit egoNotifyState(uid,state);
- }
- void CEgoNotify::OnNotifyVideoFail(int32_t uid)
- {
- emit egoNotifyFail(uid);
- }
- void CEgoNotify::OnNDTPos(Position* pos)
- {
- emit egoPosition(pos->x, pos->y, pos->z);
- }
- void CEgoNotify::OnCautionLight(bool cautionLight)
- {
- emit egoCautionLightChanged(cautionLight);
- }
- void CEgoNotify::OnLightL(bool lightL)
- {
- emit egoLightLChanged(lightL);
- }
- void CEgoNotify::OnLightR(bool lightR)
- {
- emit egoLightRChanged(lightR);
- }
- void CEgoNotify::OnGearF(bool gearF)
- {
- emit egoGearFChanged(gearF);
- }
- void CEgoNotify::OnGearR(bool gearR)
- {
- emit egoGearRChanged(gearR);
- }
- void CEgoNotify::OnCarPark(bool carPark)
- {
- emit egoCarParkChanged(carPark);
- }
- void CEgoNotify::OnBuzzerPlay(bool buzzerPlay)
- {
- emit egoBuzzerPlayChanged(buzzerPlay);
- }
- void CEgoNotify::OnLightFront(bool lightFront)
- {
- emit egoLightFrontChanged(lightFront);
- }
- void CEgoNotify::OnLightWork(bool lightWork)
- {
- emit egoLightWorkChanged(lightWork);
- }
- void CEgoNotify::OnEmergency(bool emergency)
- {
- emit egoEmergencyChanged(emergency);
- }
|