Changeset 13869


Ignore:
Timestamp:
05/24/12 14:46:14 (13 years ago)
Author:
tbretz
Message:
Fixed the reports; set the default request interval to 300s
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/tngweather.cc

    r13866 r13869  
    3232{
    3333    DimWeather() { memset(this, 0, sizeof(DimWeather)); }
    34 
    35     uint16_t fStatus;
    3634
    3735    float fTemp10M;
     
    174172                    w.fWindDirection = stof(obj);
    175173                if (id=="windSpeed")
    176                     w.fWindSpeed = stof(obj);
     174                    w.fWindSpeed = stof(obj)*3.6;
    177175                if (id=="hum")
    178176                    w.fHumidity = stof(obj);
     
    355353{
    356354private:
    357 
    358355    DimDescribedService fDimWeather;
     356    DimDescribedService fDimAtmosphere;
     357
     358    double dust;
    359359
    360360    virtual void UpdateWeather(const Time &t, const DimWeather &data)
     
    362362        fDimWeather.setData(&data, sizeof(DimWeather));
    363363        fDimWeather.Update(t);
     364
     365        if (dust==data.fDustTotal)
     366            return;
     367
     368        fDimAtmosphere.setData(&data.fDustTotal, sizeof(float));
     369        fDimAtmosphere.Update(t);
     370
     371        dust = data.fDustTotal;
    364372    }
    365373
     
    367375    ConnectionDimWeather(ba::io_service& ioservice, MessageImp &imp) :
    368376        ConnectionWeather(ioservice, imp),
    369         fDimWeather("TNG_WEATHER/DATA", "S:1;F:1;F:1;F:1;F:1;F:1;F:1;F:1",
    370                      "|stat:Status"
     377        fDimWeather("TNG_WEATHER/DATA", "F:1;F:1;F:1;F:1;F:1;F:1;F:1;F:1;F:1;F:1;F:1;F:1",
    371378                     "|T_10M[deg C]:Temperature 10m above ground"
    372379                     "|T_5M[deg C]:Temperature 5m above ground"
     
    376383                     "|H[%]:Humidity"
    377384                     "|P[mbar]:Air pressure"
    378                      "|v[m/s]:Wind speed"
     385                     "|v[km/h]:Wind speed"
    379386                     "|d[deg]:Wind direction (N-E)"
    380387                     "|DeltaM1"
    381388                     "|Dust[ug/m^3]:Dust (total)"
    382                      "|Seeing[W/m^2]:Seeing")
     389                     "|Seeing[W/m^2]:Seeing"),
     390        fDimAtmosphere("TNG_WEATHER/DUST", "F:1",
     391                       "|Dust[ug/m^3]:Dust (total)"),
     392        dust(-1)
    383393    {
    384394    }
     
    532542        ("url,u",  var<string>("/weather/rss/"),  "File name and path to load")
    533543        ("quiet,q", po_bool(true),  "Disable printing contents of all received messages (except dynamic data) in clear text.")
    534         ("interval,i", var<uint16_t>(120), "Interval between two updates on the server in seconds")
     544        ("interval,i", var<uint16_t>(300), "Interval between two updates on the server in seconds")
    535545        ("debug-tx", po_bool(), "Enable debugging of ethernet transmission.")
    536546        ;
Note: See TracChangeset for help on using the changeset viewer.