Index: trunk/FACT++/src/fscctrl.cc
===================================================================
--- trunk/FACT++/src/fscctrl.cc	(revision 11064)
+++ trunk/FACT++/src/fscctrl.cc	(revision 11067)
@@ -95,10 +95,44 @@
            Out() << kBold << "Received:" << endl;
 
+        /*
+         "status: 00000538 \n"
+         "time_s: 764.755 \n"
+         "VOLTAGES \n"
+         " \n"
+         "enable:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111  00001111 \n"
+         "  done:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111  00001111 \n"
+         "values:0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0  0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 \n"
+         "RESISTANCES \n"
+         " \n"
+         "enable:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 \n"
+         "  done:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 \n"
+         "values: \n"
+         "1000.16 3199.99 3199.99 3199.99 3199.99 3199.99 3199.99 3199.99 \n"
+         "3199.99 3199.99 3199.99 3199.99 3199.99 3199.99 3199.99 3199.99 \n"
+         "1197.07 3199.99 3199.99 3199.99 3199.99 3199.99 3199.99 3199.99 \n"
+         " 558.59  677.92  817.26  989.39 1200.35 1503.06 1799.90 2204.18 \n"
+         "3199.99 3199.99 3199.99 3199.99 3199.99 3199.99 3199.99 3199.99 \n"
+         "3199.99 3199.99 3199.99 3199.99 3199.99 3199.99 3199.99 3199.99 \n"
+         "3199.99 3199.99 3199.99 3199.99 3199.99 3199.99 3199.99 3199.99 \n"
+         "3199.99 3199.99 3199.99 3199.99 3199.99 3199.99 3199.99 3199.99 \n"
+         "end.\n";
+         */
+/*
+        const unsigned int TIME_OFF = 3;
+        const unsigned int VOLT_OFF = 30;
+        const unsigned int CURR_OFF = 70;
+        const unsigned int HUMI_OFF = 110;
+        const unsigned int TEMP_OFF = 134;
+*/
         istream is(&fBuffer);
 
         int state = 0;
         bool values = false;
-        int offset = 0;
-/*
+
+        vector<int>   volt;
+        vector<float> resist;
+        int status=-1;
+        float time=0;
+
         string buffer;
         while (getline(is, buffer, '\n'))
@@ -117,18 +151,39 @@
             if (buffer.substr(0, 8)=="status: ")
             {
+                status = atoi(buffer.c_str()+8);
+                continue;
             }
 
             if (buffer.substr(0, 8)=="time_s: ")
             {
+                time = atof(buffer.c_str()+8);
+                continue;
             }
 
             if (buffer.substr(0, 8)=="VOLTAGES")
+            {
                 state = 1;
+                continue;
+            }
 
             if (buffer.substr(0, 11)=="RESISTANCES")
+            {
                 state = 2;
+                continue;
+            }
 
             if (state==1 && buffer.substr(0, 7)=="values:")
             {
+                istringstream in(buffer.substr(7));
+                while (1)
+                {
+                    int v;
+                    in >> v;
+                    if (!in)
+                        break;
+
+                    volt.push_back(v);
+                }
+                continue;
             }
 
@@ -139,37 +194,19 @@
             }
 
-            istringtream str(buffer);
-            for (int i=0; i<8; i++)
+            if (state==2 && !values)
+                continue;
+
+            istringstream in(buffer);
+            while (1)
             {
                 float f;
-                str >> f;
-                offset += 8;
+                in >> f;
+                if (!in)
+                    break;
+
+                resist.push_back(f);
             }
         }
-*/
-/*
-"status: 00000538 \n"
-"time_s: 764.755 \n"
-"VOLTAGES \n"
-" \n"
-"enable:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111  00001111 \n"
-"  done:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111  00001111 \n"
-"values:0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0  0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 \n"
-"RESISTANCES \n"
-" \n"
-"enable:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 \n"
-"  done:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 \n"
-"values: \n"
-"1000.16 3199.99 3199.99 3199.99 3199.99 3199.99 3199.99 3199.99 \n"
-"3199.99 3199.99 3199.99 3199.99 3199.99 3199.99 3199.99 3199.99 \n"
-"1197.07 3199.99 3199.99 3199.99 3199.99 3199.99 3199.99 3199.99 \n"
-" 558.59  677.92  817.26  989.39 1200.35 1503.06 1799.90 2204.18 \n"
-"3199.99 3199.99 3199.99 3199.99 3199.99 3199.99 3199.99 3199.99 \n"
-"3199.99 3199.99 3199.99 3199.99 3199.99 3199.99 3199.99 3199.99 \n"
-"3199.99 3199.99 3199.99 3199.99 3199.99 3199.99 3199.99 3199.99 \n"
-"3199.99 3199.99 3199.99 3199.99 3199.99 3199.99 3199.99 3199.99 \n"
-"end.\n";
-
-*/
+
         StartRead();
     }
