lib/src/main/cpp/driver_test.cpp | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
lib/src/main/cpp/driver_test.h | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
lib/src/main/cpp/master/comm_if.cpp | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
lib/src/main/cpp/master/comm_if.h | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
lib/src/main/cpp/mcu/mcu_if.cpp | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
lib/src/main/cpp/mcu/mcu_if.h | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
lib/src/main/cpp/test_items/comm_test.cpp | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
lib/src/main/cpp/driver_test.cpp
@@ -359,14 +359,17 @@ { bool err = false; DEBUG("StartDriverExam %d", start); if (start == 0) { DEBUG("-------------结束考试----------------"); CurrExamMapIndex = -1; TestStart = false; CommTestStart(false); MA_SendExamStatus(0, 0); return; } DEBUG("+++++++++++++++开始考试++++++++++++++++++++"); if (MapNum == 0) { err = true; @@ -977,6 +980,18 @@ double tx = carModel->carDesc[i].distance*sin(toRadians(azimuth)); double ty = carModel->carDesc[i].distance*cos(toRadians(azimuth)); // double qrx = carModel->carDesc[i].distance * sin(toRadians(carModel->carDesc[i].angle)); // double qry = carModel->carDesc[i].distance * cos(toRadians(carModel->carDesc[i].angle)) * cos(toRadians(pitch)); // // double projDis = sqrt(pow(qrx, 2) + pow(pry, 2)); // double projAng; // // if (fabs(qry) <= EPSILON) { // projAng = 90; // } else { // projAng = toDegree(atan(qrx / qry)); // } carModel->carXY[i].X = (tx)*cos(toRadians(carModel->carDesc[i].angle)) - (ty)*sin(toRadians(carModel->carDesc[i].angle)) + main_ant.X; carModel->carXY[i].Y = (tx)*sin(toRadians(carModel->carDesc[i].angle)) + lib/src/main/cpp/driver_test.h
@@ -87,9 +87,11 @@ void FindSensorCfg(int func, int &gpio, bool &lvl); void StartDriverExam(int start); void StartMapExam(int map_id, int exam); void GetRtkClock(struct RtkTime *s); void UpdateRTKInfo(const rtk_info *s); void AddExamFault(int wrong, const struct RtkTime *rtkTime); car_model_cache_t *GetCarModelCache(int node); void SystemShutdown(int event, int timeout); #endif //RTKDRIVERTEST_DRIVER_TEST_H lib/src/main/cpp/master/comm_if.cpp
@@ -45,12 +45,14 @@ #define ID_SM_RTK_BRIEF 0x000B #define ID_SM_EXAM_BRIEF 0x000C #define ID_SM_ENTER_MAP 0x000D #define ID_MS_EXAM_MAP 0x800D #define ID_SM_CAR 0x000E #define ID_SM_RTCM_IND 0x000F #define ID_SM_DEBUG_INFO 0x0010 #define ID_MS_FILE 0x8100 #define ID_MS_READ_CARD 0x800F #define ID_SM_PUT_CARD 0x000F #define ID_MS_SYS_SHUTDOWN 0x8010 #define MA_OUT_GPS_BRIEF 0x0001 #define MA_OUT_RTK_BRIEF 0x0002 @@ -706,6 +708,19 @@ } break; } case ID_MS_EXAM_MAP: { Document doc; doc.Parse(value); if (!doc.HasParseError()) { if (doc.HasMember("map_id") && doc.HasMember("exam")) { Value& s = doc["map_id"]; Value& s2 = doc["exam"]; StartMapExam(s.GetInt(), s2.GetInt()); } } break; } case ID_MS_IND_ONOFF: { Document doc; doc.Parse(value); @@ -723,6 +738,24 @@ ReadCard(); break; } case ID_MS_SYS_SHUTDOWN: { Document doc; doc.Parse(value); if (!doc.HasParseError()) { int event = 0, timeout = 15; if (doc.HasMember("event")) { Value& s = doc["event"]; event = s.GetInt(); } if (doc.HasMember("timeout")) { Value& s = doc["timeout"]; timeout = s.GetInt(); } SystemShutdown(event, timeout); } break; } default:break; } } @@ -738,3 +771,18 @@ break; } } void MA_EnterMap(int map_id, int enter) { StringBuffer sb; Writer<StringBuffer> writer(sb); writer.StartObject(); writer.Key("map_id"); writer.Int(map_id); writer.Key("enter"); writer.Int(enter); writer.EndObject(); SendMsgToMainProc(ID_SM_ENTER_MAP, sb.GetString()); } lib/src/main/cpp/master/comm_if.h
@@ -93,5 +93,6 @@ void MA_SendExamWrong(vector<ExamFault> &ExamFaultList); void MA_SendRtcmInd(int length); void MA_SendDebugInfo(const char *str, ...); void MA_EnterMap(int map_id, int enter); #endif //MYAPPLICATION2_COMM_IF_H lib/src/main/cpp/mcu/mcu_if.cpp
@@ -45,6 +45,7 @@ #define ID_CM_RTK_DATA 0x0008 #define ID_CM_READ_RFCARD 0x0009 #define ID_MC_RFCARD_RSP 0x8009 #define ID_CM_SHUTDOWN 0x0020 static parse_status_t parse_status; @@ -514,3 +515,10 @@ AppTimer_add(ReadCardTimeout, D_SEC(3)); SendMcuCommand(ID_CM_READ_RFCARD, NULL, 0); } void ShutdownInd(int timeout) { uint8_t v = timeout; SendMcuCommand(ID_CM_SHUTDOWN, &v, 1); } lib/src/main/cpp/mcu/mcu_if.h
@@ -16,5 +16,6 @@ void UploadDfuFileEnd(void); void UploadDfuFile(const uint8_t *file, int length); void ReadCard(void); void ShutdownInd(int timeout); #endif //RTKDRIVERTEST_MCU_IF_H lib/src/main/cpp/test_items/comm_test.cpp
@@ -33,7 +33,7 @@ if (CheckSensorX(SEATBELT) == 0) { struct RtkTime rt; GetRtkClock(&rt); AddExamFault(1, &rt); // AddExamFault(1, &rt); } } }