Index: /trunk/FACT++/src/smartfact.cc
===================================================================
--- /trunk/FACT++/src/smartfact.cc	(revision 19711)
+++ /trunk/FACT++/src/smartfact.cc	(revision 19712)
@@ -43,4 +43,5 @@
 #include "HeadersRateControl.h"
 #include "HeadersTNGWeather.h"
+#include "HeadersGTC.h"
 #include "HeadersMagicLidar.h"
 #include "HeadersMagicWeather.h"
@@ -548,4 +549,7 @@
     Time  fTngWeatherDustTime;
 
+    deque<float> fGtcDustHist;
+    Time  fGtcDustTime;
+
     deque<float> fRainSensorDataHist;
     Time  fRainSensorDataTime;
@@ -638,4 +642,5 @@
     DimDescribedState fDimMagicLidar;
     DimDescribedState fDimTngWeather;
+    DimDescribedState fDimGtcDust;
     DimDescribedState fDimTemperature;
     DimDescribedState fDimRainSensor;
@@ -1030,4 +1035,9 @@
         else
             out << "\t\n";
+        out << HTML::kWhite << '\t';
+        if (!fGtcDustHist.empty())
+            out << fGtcDustHist.back() << '\t' << fGtcDustTime.GetAsStr("%H:%M") << '\n';
+        else
+            out << "\t\n";
 
         ofstream(fPath+"/weather.data") << out.str();
@@ -1092,4 +1102,30 @@
         return GetCurrentState();
     }
+
+    int HandleGtcDustData(const EventImp &d)
+    {
+        if (!CheckDataSize(d, "GtcDust:Data", 4))
+            return GetCurrentState();
+
+        fGtcDustTime = d.GetTime();
+
+        fGtcDustHist.push_back(d.GetFloat());
+        if (fGtcDustHist.size()>300)
+                fGtcDustHist.pop_front();
+
+        const Statistics stat(fGtcDustHist);
+
+        const double scale = stat.max>0 ? pow(10, ceil(log10(stat.max))) : 0;
+
+        WriteHist(d, "hist-gtc-dust", fGtcDustHist, scale);
+
+        ostringstream out;
+        out << d.GetJavaDate() << '\n';
+
+        ofstream(fPath+"/gtcdust.data") << out.str();
+
+        return GetCurrentState();
+    }
+
 
     int HandleRainSensorData(const EventImp &d)
@@ -2301,4 +2337,5 @@
         Out() << fDimMagicWeather   << endl;
         Out() << fDimTngWeather     << endl;
+        Out() << fDimGtcDust        << endl;
         Out() << fDimMagicLidar     << endl;
         Out() << fDimTemperature    << endl;
@@ -3268,4 +3305,5 @@
             out << GetStateHtml(fDimMagicWeather,   MagicWeather::State::kConnected);
             out << GetStateHtml(fDimTngWeather,     TNGWeather::State::kConnected);
+            out << GetStateHtml(fDimGtcDust,        GTC::State::kReceiving);
             out << GetStateHtml(fDimMagicLidar,     MagicLidar::State::kConnected);
             out << GetStateHtml(fDimTemperature,    Temperature::State::kValid);
@@ -3318,4 +3356,5 @@
         fLastRunFinishedWithZeroEvents(false),
         fTngWeatherDustTime(Time::none),
+        fGtcDustTime(Time::none),
         fBiasControlVoltageMed(0),
         fBiasControlCurrentMed(0),
@@ -3337,4 +3376,5 @@
         fDimMagicLidar    ("MAGIC_LIDAR"),
         fDimTngWeather    ("TNG_WEATHER"),
+        fDimGtcDust       ("GTC_DUST"),
         fDimTemperature   ("TEMPERATURE"),
         fDimRainSensor    ("RAIN_SENSOR"),
@@ -3367,4 +3407,5 @@
         fDimMagicLidar.Subscribe(*this);
         fDimTngWeather.Subscribe(*this);
+        fDimGtcDust.Subscribe(*this);
         fDimTemperature.Subscribe(*this);
         fDimRainSensor.Subscribe(*this);
@@ -3442,4 +3483,6 @@
         Subscribe("TNG_WEATHER/DATA")
             (bind(&StateMachineSmartFACT::HandleTngWeatherData,      this, placeholders::_1));
+        Subscribe("GTC_DUST/DATA")
+            (bind(&StateMachineSmartFACT::HandleGtcDustData,         this, placeholders::_1));
         Subscribe("RAIN_SENSOR/DATA")
             (bind(&StateMachineSmartFACT::HandleRainSensorData,      this, placeholders::_1));
Index: /trunk/FACT++/www/smartfact/struct/gtcdust.page
===================================================================
--- /trunk/FACT++/www/smartfact/struct/gtcdust.page	(revision 19712)
+++ /trunk/FACT++/www/smartfact/struct/gtcdust.page	(revision 19712)
@@ -0,0 +1,2 @@
+Dust (GTC)
+|hist=hist-gtc-dust.bin/ &micro;g/m&sup3;|
Index: /trunk/FACT++/www/smartfact/struct/status.page
===================================================================
--- /trunk/FACT++/www/smartfact/struct/status.page	(revision 19711)
+++ /trunk/FACT++/www/smartfact/struct/status.page	(revision 19712)
@@ -24,4 +24,5 @@
 |Magic Weather|$0|
 |TNG Weather|$0|tngdata
+|GTC Dust|$0|gtcdust
 |Magic Lidar|$0|
 |Temperature|$0|temperature
Index: /trunk/FACT++/www/smartfact/struct/weather.page
===================================================================
--- /trunk/FACT++/www/smartfact/struct/weather.page	(revision 19711)
+++ /trunk/FACT++/www/smartfact/struct/weather.page	(revision 19712)
@@ -10,3 +10,4 @@
 |Wind direction|$0
 |Dust (TNG)|$0 &micro;g/m&sup3; [$1]|tngdust
+|Dust (GTC)|$0 &micro;g/m&sup3; [$1]|gtcdust
 
