| | |
| | | #define ID_MS_READ_CARD 0x8011 |
| | | #define ID_SM_PUT_CARD 0x0011 |
| | | #define ID_MS_SYS_SHUTDOWN 0x8010 |
| | | #define ID_SM_LIGHT_EXAM_REQ 0x0012 |
| | | #define ID_MS_LIGHT_EXAM_RES 0x8012 |
| | | |
| | | #define MA_OUT_GPS_BRIEF 0x0001 |
| | | #define MA_OUT_RTK_BRIEF 0x0002 |
| | |
| | | Document doc; |
| | | doc.Parse(value); |
| | | if (!doc.HasParseError()) { |
| | | int start = 0, type = 0; |
| | | if (doc.HasMember("exam")) { |
| | | Value& s = doc["exam"]; |
| | | StartDriverExam(s.GetInt()); |
| | | start = s.GetInt(); |
| | | } |
| | | if (doc.HasMember("type")) { |
| | | Value& s = doc["type"]; |
| | | type = s.GetInt(); |
| | | } |
| | | StartDriverExam(start, type); |
| | | } |
| | | break; |
| | | } |
| | |
| | | } |
| | | break; |
| | | } |
| | | case ID_MS_LIGHT_EXAM_RES: { |
| | | Document doc; |
| | | doc.Parse(value); |
| | | if (!doc.HasParseError()) { |
| | | if (doc.HasMember("exam")) { |
| | | const Value& s = doc["exam"]; |
| | | s.GetInt(); |
| | | } |
| | | if (doc.HasMember("question")) { |
| | | const Value& s = doc["question"]; |
| | | if (s.IsArray() && s.Size() > 0) { |
| | | int n = 0; |
| | | struct dummy_light_exam *content = new struct dummy_light_exam[s.Size()]; |
| | | |
| | | for(Value::ConstValueIterator itr = s.Begin(); itr != s.End(); ++itr) { |
| | | if (itr->HasMember("item") && itr->HasMember("tts")) { |
| | | const Value &s1 = (*itr)["item"]; |
| | | const Value &s2 = (*itr)["tts"]; |
| | | |
| | | content[n].item = s1.GetInt(); |
| | | strcpy(content[n].tts, s1.GetString()); |
| | | n++; |
| | | } |
| | | } |
| | | |
| | | SetDummyLightExam(n, content); |
| | | |
| | | delete []content; |
| | | } |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | default:break; |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | void MA_EnterMap(int map_id, int enter) |
| | | void MA_EnterMap(int map_id, int type, int enter) |
| | | { |
| | | StringBuffer sb; |
| | | Writer<StringBuffer> writer(sb); |
| | |
| | | writer.StartObject(); |
| | | writer.Key("map_id"); |
| | | writer.Int(map_id); |
| | | writer.Key("type"); |
| | | writer.Int(type); |
| | | writer.Key("enter"); |
| | | writer.Int(enter); |
| | | writer.EndObject(); |
| | | |
| | | SendMsgToMainProc(ID_SM_ENTER_MAP, sb.GetString()); |
| | | } |
| | | |
| | | void MA_ExamLight(void) |
| | | { |
| | | SendMsgToMainProc(ID_SM_LIGHT_EXAM_REQ, NULL); |
| | | } |