Index: /trunk/FACT++/src/smartfact.cc
===================================================================
--- /trunk/FACT++/src/smartfact.cc	(revision 13889)
+++ /trunk/FACT++/src/smartfact.cc	(revision 13890)
@@ -307,4 +307,6 @@
 {
 private:
+    const Time fRunTime;
+
     enum states_t
     {
@@ -511,5 +513,5 @@
         out << '\n';
 
-        ofstream(fPath+"/scriptlog.txt") << out.str();
+        ofstream(fPath+"/scriptlog.data") << out.str();
     }
 
@@ -573,5 +575,5 @@
         out << "#ffffff\t" << stat.max << '\n';
 
-        ofstream(fPath+"/"+name+".txt") << out.str();
+        ofstream(fPath+"/"+name+".data") << out.str();
 
         WriteBinary(d, "magicweather-"+name+"-hist", fMagicWeatherHist[i], max-min, min);
@@ -621,5 +623,5 @@
             out << "\t\n";
 
-        ofstream(fPath+"/weather.txt") << out.str();
+        ofstream(fPath+"/weather.data") << out.str();
 
         out.str("");
@@ -640,5 +642,5 @@
         out << kHtmlWhite << '\t';
 
-        ofstream(fPath+"/astro.txt") << out.str();
+        ofstream(fPath+"/astro.data") << out.str();
 
         WriteWeather(d, "temp",  kTemp,   -5,   35);
@@ -672,5 +674,5 @@
         out << d.GetJavaDate() << '\n';
 
-        ofstream(fPath+"/tngdust.txt") << out.str();
+        ofstream(fPath+"/tngdust.data") << out.str();
 
         return GetCurrentState();
@@ -704,5 +706,5 @@
         out << az << '\n';
 
-        ofstream(fPath+"/drive-pointing.txt") << out.str();
+        ofstream(fPath+"/drive-pointing.data") << out.str();
 
         return GetCurrentState();
@@ -763,5 +765,5 @@
             out << kHtmlWhite << "\t&mdash; \n";
 
-        ofstream(fPath+"/tracking.txt") << out.str();
+        ofstream(fPath+"/tracking.data") << out.str();
 
         return GetCurrentState();
@@ -793,5 +795,5 @@
         out << "#ffffff\t" << wang << '\n';
 
-        ofstream(fPath+"/source.txt") << out.str();
+        ofstream(fPath+"/source.data") << out.str();
 
         return GetCurrentState();
@@ -840,5 +842,5 @@
         out << kHtmlWhite << '\t' << stat.avg << '\n';
         out << kHtmlWhite << '\t' << stat.max << '\n';
-        ofstream(fPath+"/feedback.txt") << out.str();
+        ofstream(fPath+"/feedback.data") << out.str();
 
         return GetCurrentState();
@@ -878,5 +880,5 @@
         out << kHtmlWhite << '\t' << stat.avg << '\n';
         out << kHtmlWhite << '\t' << stat.max << '\n';
-        ofstream(fPath+"/voltage.txt") << out.str();
+        ofstream(fPath+"/voltage.data") << out.str();
 
         return GetCurrentState();
@@ -993,5 +995,5 @@
         out << col4 << '\t' << stat.max << '\n';
         out << kHtmlWhite << '\t' << power_tot << "W [" << power_apd << "mW]\n";
-        ofstream(fPath+"/current.txt") << out.str();
+        ofstream(fPath+"/current.data") << out.str();
 
         return GetCurrentState();
@@ -1057,5 +1059,5 @@
         out << col[2] << '\t' << rc.substr(20, 10) << '\n';
         out << col[3] << '\t' << rc.substr(30, 10) << '\n';
-        ofstream(fPath+"/fad.txt") << out.str();
+        ofstream(fPath+"/fad.data") << out.str();
 
         return GetCurrentState();
@@ -1095,5 +1097,5 @@
         out << "#ffffff\t" << fFtmControlTriggerRateCam << '\n';
 
-        ofstream(fPath+"/trigger.txt") << out.str();
+        ofstream(fPath+"/trigger.data") << out.str();
 
         const Statistics bstat(vector<float>(brates, brates+40));
@@ -1106,5 +1108,5 @@
         out << kHtmlWhite << '\t' << bstat.avg << '\n';
         out << kHtmlWhite << '\t' << bstat.max << '\n';
-        ofstream(fPath+"/boardrates.txt") << out.str();
+        ofstream(fPath+"/boardrates.data") << out.str();
 
         out.str("");
@@ -1114,5 +1116,5 @@
         out << kHtmlWhite << '\t' << pstat.avg << '\n';
         out << kHtmlWhite << '\t' << pstat.max << '\n';
-        ofstream(fPath+"/patchrates.txt") << out.str();
+        ofstream(fPath+"/patchrates.data") << out.str();
 
         return GetCurrentState();
@@ -1148,5 +1150,5 @@
         //out << kHtmlWhite << '\t' << statp.avg << '\n';
         out << kHtmlWhite << '\t' << statp.max << '\n';
-        ofstream(fPath+"/thresholds.txt") << out.str();
+        ofstream(fPath+"/thresholds.data") << out.str();
 
         out.str("");
@@ -1187,5 +1189,5 @@
             out << kHtmlWhite  << "\t" << 0.5*vp << "\n";
 
-        ofstream(fPath+"/ftm.txt") << out.str();
+        ofstream(fPath+"/ftm.data") << out.str();
 
         // Active FTUs: IsActive(i)
@@ -1227,5 +1229,5 @@
         fFtmControlFtuOk = cnt==40;
 
-        ofstream(fPath+"/ftu.txt") << out.str();
+        ofstream(fPath+"/ftu.data") << out.str();
 
         return GetCurrentState();
@@ -1317,5 +1319,5 @@
         out << "#ffffff\t" << stat.max << '\n';
 
-        ofstream(fPath+"/fsc.txt") << out.str();
+        ofstream(fPath+"/fsc.data") << out.str();
 
         WriteBinary(d, "fsccontrol-temperature-hist",
@@ -1386,5 +1388,5 @@
         out << "#ffffff\t" << max << '\n';
 
-        ofstream(fPath+"/ratescan.txt") << out.str();
+        ofstream(fPath+"/ratescan.data") << out.str();
 
         out.str("");
@@ -1393,5 +1395,5 @@
         out << "#ffffff\t" << pow(10, fRateScanDataHist[fRateScanBoard+1].back()) << '\n';
 
-        ofstream(fPath+"/ratescan_board.txt") << out.str();
+        ofstream(fPath+"/ratescan_board.data") << out.str();
 
         return GetCurrentState();
@@ -1412,5 +1414,5 @@
         }
 
-        ofstream(fPath+"/dotest.txt") << out.str();
+        ofstream(fPath+"/dotest.data") << out.str();
     }
 
@@ -1525,4 +1527,6 @@
             msg << "dimctrl offline<br/>";
 
+        // FTM in Connected instead of Idle --> power cyclen
+
         /* // Check offline and disconnected status?
           Out() << fDimMcp          << endl;
@@ -1549,10 +1553,10 @@
 
         ostringstream out;
-        out << now.JavaDate() << '\t' << haserror << '\n';
+        out << now.JavaDate() << '\t' << haserror << '\t' << (fDimControl.state()>-3) << '\n';
         out << setprecision(3);
         out << kHtmlWhite << '\t' << msg.str() << '\n';
 
         if (haserror || fHasError)
-            ofstream(fPath+"/error.txt") << out.str();
+            ofstream(fPath+"/error.data") << out.str();
 
         fHasError = haserror;
@@ -1561,5 +1565,5 @@
 
         out.str("");
-        out << now.JavaDate() << '\t' << fHasError << '\n';
+        out << now.JavaDate() << '\t' << fHasError << '\t' << (fDimControl.state()>-3) << '\n';
         out << setprecision(3);
 
@@ -1791,15 +1795,18 @@
             out << kHtmlWhite << '\n';
 
-        ofstream(fPath+"/fact.txt") << out.str();
+        ofstream(fPath+"/fact.data") << out.str();
 
         // ==============================================================
 
         out.str("");
-        out << now.JavaDate() << '\t' << fHasError << '\n';
+        out << now.JavaDate() << '\t' << fHasError << '\t' << (fDimControl.state()>-3) << '\n';
 
         if (!fDimDNS.online())
-            out << kHtmlWhite << "\tOffline\n\n\n\n\n\n\n\n\n\n\n\n";
+            out << kHtmlWhite << "\tOffline\n\n\n\n\n\n\n\n\n\n\n\n\n";
         else
         {
+            ostringstream dt;
+            dt << (Time()-fRunTime);
+
             out << kHtmlGreen << '\t' << fDimDNS.version() << '\n';
 
@@ -1818,7 +1825,9 @@
             out << GetStateHtml(fDimRateScan,     4);
             out << GetStateHtml(fDimChatServer,   1);
-        }
-
-        ofstream(fPath+"/status.txt") << out.str();
+
+            out << kHtmlGreen << '\t' << dt.str().substr(0, dt.str().length()-7) << '\n';
+        }
+
+        ofstream(fPath+"/status.data") << out.str();
 
         return kStateRunning;
