Train status

Files at this revision

API Documentation at this revision

Comitter:
takashikojo
Date:
Sun Nov 22 08:47:56 2015 +0000
Parent:
5:6105553963bb
Commit message:
Serial Terminal message macro

Changed in this revision

TrainStat.cpp Show annotated file Show diff for this revision Revisions of this file
matchLine.cpp Show annotated file Show diff for this revision Revisions of this file
tokyoMetro.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 6105553963bb -r d4d781f31f70 TrainStat.cpp
--- a/TrainStat.cpp	Fri Oct 23 05:51:49 2015 +0000
+++ b/TrainStat.cpp	Sun Nov 22 08:47:56 2015 +0000
@@ -7,6 +7,12 @@
 
 #define ERR(x, ...) std::printf("[TrainStat : ERR]"x"\r\n", ##__VA_ARGS__);
 
+#if 0
+#define TERMINAL(x, ...) std::printf("[TrainStat :]"x"\r\n", ##__VA_ARGS__);
+#else 
+#define TERMINAL(x, ...) 
+#endif
+
 TrainStat::TrainStat(enum infoSource s) {
         source = s ;
 } ;
@@ -34,7 +40,6 @@
     default:
         return false ;
     }
-    printf("     Train => %s\n", ret?"Delay":"No Delay") ;
+    TERMINAL("%s\n", ret?"Delay":"No Delay") ; 
     return ret ;
-    
 }
diff -r 6105553963bb -r d4d781f31f70 matchLine.cpp
--- a/matchLine.cpp	Fri Oct 23 05:51:49 2015 +0000
+++ b/matchLine.cpp	Sun Nov 22 08:47:56 2015 +0000
@@ -6,7 +6,7 @@
 #include <SDFileSystem.h>
 #include "matchLine.h"
 
-SDFileSystem sdCard(PTE3, PTE1, PTE2, PTE4, "sd");
+SDFileSystem sdCard(PTE3, PTE1, PTE2, PTE4, "sd"); // SD for FRDM-K64F
 
 #define ERR(x, ...) std::printf("[DigitalClock : ERR]"x"\r\n", ##__VA_ARGS__);
 
@@ -24,7 +24,6 @@
 
 bool matchLine::getList(string filename)
 {
-    int cnt = 0 ;
     char line[100] ;
     FILE *fp ;
     fp = fopen(filename.c_str(), "r");
diff -r 6105553963bb -r d4d781f31f70 tokyoMetro.cpp
--- a/tokyoMetro.cpp	Fri Oct 23 05:51:49 2015 +0000
+++ b/tokyoMetro.cpp	Sun Nov 22 08:47:56 2015 +0000
@@ -115,7 +115,9 @@
     picojson::array array = trainStat.get<picojson::array>();
     for (picojson::array::iterator it = array.begin(); it != array.end(); it++) {
         picojson::object& obj = it->get<picojson::object>();
-        DBG("Line=%s, %s\n", obj["odpt:railway"].get<std::string>().c_str(), lineTbl[obj["odpt:railway"].get<std::string>()].c_str()) ;
+        DBG("Line=%s, %s, %s\n", obj["odpt:railway"].get<std::string>().c_str(), 
+                             lineTbl[obj["odpt:railway"].get<std::string>()].c_str(),
+                             obj["odpt:trainInformationText"].get<std::string>()) ;
         if(watchList.find(lineTbl[obj["odpt:railway"].get<std::string>()])) {
             printStat(
                 lineTbl[obj["odpt:railway"].get<std::string>()].c_str(),