Changeset 18917 for trunk/FACT++/src


Ignore:
Timestamp:
10/18/17 13:45:23 (7 years ago)
Author:
tbretz
Message:
Added BIAS_TEMP server
File:
1 edited

Legend:

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

    r18908 r18917  
    3535#include "HeadersPower.h"
    3636#include "HeadersPFmini.h"
     37#include "HeadersBiasTemp.h"
    3738#include "HeadersAgilent.h"
    3839#include "HeadersFeedback.h"
     
    637638    DimDescribedState fDimFscControl;
    638639    DimDescribedState fDimPfMiniControl;
     640    DimDescribedState fDimBiasTemp;
    639641    DimDescribedState fDimGpsControl;
    640642    DimDescribedState fDimSqmControl;
     
    19571959        WriteHist(d, "hist-pfmini-hum",
    19581960                  fPfMiniHumidityHist, 100, 0);
     1961
     1962        return GetCurrentState();
     1963    }
     1964
     1965    int HandleBiasTemp(const EventImp &d)
     1966    {
     1967        if (!CheckDataSize(d, "BiasTemp:Data", sizeof(BiasTemp::Data)))
     1968            return GetCurrentState();
     1969
     1970        const BiasTemp::Data &data = d.Ref<BiasTemp::Data>();
     1971
     1972        ostringstream out;
     1973
     1974        out << fixed << setprecision(1);
     1975        out << d.GetJavaDate() << '\n';
     1976
     1977        out << HTML::kGreen << '\t' << data.time << '\n';
     1978        out << HTML::kGreen << '\t' << data.avg << '\n';
     1979        out << HTML::kGreen << '\t' << data.rms  << '\n';
     1980
     1981        ofstream(fPath+"/biastemp.data") << out.str();
    19591982
    19601983        return GetCurrentState();
     
    31653188            out << GetStateHtml(fDimFscControl,     FSC::State::kConnected);
    31663189            out << GetStateHtml(fDimPfMiniControl,  PFmini::State::kConnected);
     3190            out << GetStateHtml(fDimBiasTemp,       BiasTemp::State::kConnected);
    31673191            out << GetStateHtml(fDimGpsControl,     GPS::State::kConnected);
    31683192            out << GetStateHtml(fDimSqmControl,     SQM::State::kConnected);
     
    32513275        fDimFscControl    ("FSC_CONTROL"),
    32523276        fDimPfMiniControl ("PFMINI_CONTROL"),
     3277        fDimBiasTemp      ("BIAS_TEMP"),
    32533278        fDimGpsControl    ("GPS_CONTROL"),
    32543279        fDimSqmControl    ("SQM_CONTROL"),
     
    32793304        fDimFscControl.Subscribe(*this);
    32803305        fDimPfMiniControl.Subscribe(*this);
     3306        fDimBiasTemp.Subscribe(*this);
    32813307        fDimGpsControl.Subscribe(*this);
    32823308        fDimSqmControl.Subscribe(*this);
     
    33193345        Subscribe("PFMINI_CONTROL/DATA")
    33203346            (bind(&StateMachineSmartFACT::HandlePfMiniData,          this, placeholders::_1));
     3347
     3348        Subscribe("BIAS_TEMP/DATA")
     3349            (bind(&StateMachineSmartFACT::HandleBiasTemp,            this, placeholders::_1));
    33213350
    33223351        Subscribe("GPS_CONTROL/NEMA")
Note: See TracChangeset for help on using the changeset viewer.