From 87156fa3adfa2e3232a6f6e612584aa8a4ebaea1 Mon Sep 17 00:00:00 2001
From: yy1717 <fctom1215@outlook.com>
Date: 星期二, 19 一月 2021 18:40:25 +0800
Subject: [PATCH] 添加模拟灯光

---
 lib/src/main/cpp/master/comm_if.cpp |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/lib/src/main/cpp/master/comm_if.cpp b/lib/src/main/cpp/master/comm_if.cpp
index b1898f6..b2772e1 100644
--- a/lib/src/main/cpp/master/comm_if.cpp
+++ b/lib/src/main/cpp/master/comm_if.cpp
@@ -1969,6 +1969,7 @@
             Document doc;
             doc.Parse(value);
             if (!doc.HasParseError()) {
+                DEBUG("瑙f瀽鐏厜閰嶇疆...");
                 if (doc.HasMember("exam")) {
                     const Value& s = doc["exam"];
                     s.GetInt();
@@ -1979,30 +1980,39 @@
                         int n = 0;
                         struct dummy_light_exam *content = new struct dummy_light_exam[s.Size()];
 
+                        DEBUG("棰樼洰鏁伴噺 %d", 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();
                                 content[n].tts = s2.GetString();
+
+                                DEBUG("棰樼洰 %s", s2.GetString());
                             }
 
                             if (itr->HasMember("wrong_code")) {
                                 const Value &s = (*itr)["wrong_code"];
 
                                 content[n].wrongCode = s.GetInt();
+
+                                DEBUG("棰樼洰wrongCode %d", s.GetInt());
                             }
 
                             if (itr->HasMember("process")) {
-                                const Value& s = doc["process"];
+                                const Value& s = (*itr)["process"];
                                 for(Value::ConstValueIterator itr2 = s.Begin(); itr2 != s.End(); ++itr2) {
+                                    DEBUG("棰樼洰process %d", itr2->GetInt());
                                     content[n].process.push_back(itr2->GetInt());
                                 }
                             }
                             if (itr->HasMember("solution")) {
-                                const Value& s = doc["solution"];
+                                const Value& s = (*itr)["solution"];
                                 for(Value::ConstValueIterator itr2 = s.Begin(); itr2 != s.End(); ++itr2) {
+                                    DEBUG("棰樼洰solution %d", itr2->GetInt());
                                     content[n].solution.push_back(itr2->GetInt());
                                 }
                             }

--
Gitblit v1.8.0