Changeset 17934 for trunk


Ignore:
Timestamp:
07/27/14 11:45:39 (10 years ago)
Author:
tbretz
Message:
Added sqmctrl
File:
1 edited

Legend:

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

    r17884 r17934  
    2828#include "HeadersFSC.h"
    2929#include "HeadersGPS.h"
     30#include "HeadersSQM.h"
    3031#include "HeadersMCP.h"
    3132#include "HeadersLid.h"
     
    536537    DimDescribedState fDimFscControl;
    537538    DimDescribedState fDimGpsControl;
     539    DimDescribedState fDimSqmControl;
    538540    DimDescribedState fDimAgilentControl24;
    539541    DimDescribedState fDimAgilentControl50;
     
    18341836
    18351837        ofstream(fPath+"/gps.data") << out.str();
     1838
     1839        return GetCurrentState();
     1840    }
     1841
     1842    int HandleSqmData(const EventImp &d)
     1843    {
     1844        if (!CheckDataSize(d, "SqmControl:Data", sizeof(SQM::Data)))
     1845            return GetCurrentState();
     1846
     1847        const SQM::Data &data = d.Ref<SQM::Data>();
     1848
     1849        ostringstream out;
     1850
     1851        out << fixed;
     1852        out << d.GetJavaDate() << '\n';
     1853        out << setprecision(4);
     1854        out << HTML::kWhite << '\t' << data.mag    << '\n';
     1855        out << HTML::kWhite << '\t' << data.freq   << '\n';
     1856        out << HTML::kWhite << '\t' << data.counts << '\n';
     1857        out << HTML::kWhite << '\t' << data.period << '\n';
     1858        out << HTML::kWhite << '\t' << data.temp   << "\n";
     1859
     1860        ofstream(fPath+"/sqm.data") << out.str();
    18361861
    18371862        return GetCurrentState();
     
    29512976            out << GetStateHtml(fDimFscControl,     FSC::State::kConnected);
    29522977            out << GetStateHtml(fDimGpsControl,     GPS::State::kConnected);
     2978            out << GetStateHtml(fDimSqmControl,     SQM::State::kConnected);
    29532979            out << GetStateHtml(fDimAgilentControl24, Agilent::State::kVoltageOff);
    29542980            out << GetStateHtml(fDimAgilentControl50, Agilent::State::kVoltageOff);
     
    30253051        fDimFscControl    ("FSC_CONTROL"),
    30263052        fDimGpsControl    ("GPS_CONTROL"),
     3053        fDimSqmControl    ("SQM_CONTROL"),
    30273054        fDimAgilentControl24("AGILENT_CONTROL_24V"),
    30283055        fDimAgilentControl50("AGILENT_CONTROL_50V"),
     
    30513078        fDimFscControl.Subscribe(*this);
    30523079        fDimGpsControl.Subscribe(*this);
     3080        fDimSqmControl.Subscribe(*this);
    30533081        fDimAgilentControl24.Subscribe(*this);
    30543082        fDimAgilentControl50.Subscribe(*this);
     
    30893117        Subscribe("GPS_CONTROL/NEMA")
    30903118            (bind(&StateMachineSmartFACT::HandleGpsNema,             this, placeholders::_1));
     3119
     3120        Subscribe("SQM_CONTROL/DATA")
     3121            (bind(&StateMachineSmartFACT::HandleSqmData,             this, placeholders::_1));
    30913122
    30923123        Subscribe("TEMPERATURE/DATA")
Note: See TracChangeset for help on using the changeset viewer.