nidas v1.2.3
IRIGSensor.h
Go to the documentation of this file.
1// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 4; -*-
2// vim: set shiftwidth=4 softtabstop=4 expandtab:
3/*
4 ********************************************************************
5 ** NIDAS: NCAR In-situ Data Acquistion Software
6 **
7 ** 2005, Copyright University Corporation for Atmospheric Research
8 **
9 ** This program is free software; you can redistribute it and/or modify
10 ** it under the terms of the GNU General Public License as published by
11 ** the Free Software Foundation; either version 2 of the License, or
12 ** (at your option) any later version.
13 **
14 ** This program is distributed in the hope that it will be useful,
15 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ** GNU General Public License for more details.
18 **
19 ** The LICENSE.txt file accompanying this software contains
20 ** a copy of the GNU General Public License. If it is not found,
21 ** write to the Free Software Foundation, Inc.,
22 ** 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 **
24 ********************************************************************
25*/
26#ifndef NIDAS_DYNLD_RAF_IRIGSENSOR_H
27#define NIDAS_DYNLD_RAF_IRIGSENSOR_H
28
33
34namespace nidas { namespace dynld { namespace raf {
35
36using namespace nidas::core;
37
41class IRIGSensor : public DSMSensor
42{
43
44public:
45
50 IRIGSensor();
51
53
58
63
70 void open(int flags);
71
77 void close();
78
86
92 void setIRIGTime(dsm_time_t val);
93
94 static std::string statusString(unsigned char status,bool xml=false);
95
96 static std::string shortStatusString(unsigned char status,bool xml=false);
97
98 void printStatus(std::ostream& ostr) throw();
99
103 bool process(const Sample* samp,std::list<const Sample*>& result)
104 throw();
105
109 void fromDOMElement(const xercesc::DOMElement*);
110
114 static dsm_time_t getIRIGTime(const Sample* samp);
115
121 static dsm_time_t getUnixTime(const Sample* samp);
122
126 static const unsigned char* getStatusPtr(const Sample* samp);
127
128 static float get100HzBacklog(const Sample* samp);
129
131private:
132
136 void checkClock();
137
139
141
143
145
146};
147
148}}} // namespace nidas namespace dynld namespace raf
149
150#endif
DSMSensor provides the basic support for reading, processing and distributing samples from a sensor a...
Definition DSMSensor.h:88
An interface to an IO device.
Definition IODevice.h:42
A scanner of sample data.
Definition SampleScanner.h:74
Interface to a data sample.
Definition Sample.h:190
Sensor class for controlling and recieving data from an IRIG clock.
Definition IRIGSensor.h:42
static const nidas::util::EndianConverter * lecvtr
Definition IRIGSensor.h:130
void checkClock()
Definition IRIGSensor.cc:130
int _slews[IRIG_MAX_DT_DIFF - IRIG_MIN_DT_DIFF+1]
Definition IRIGSensor.h:144
void open(int flags)
Open the device connected to the sensor.
Definition IRIGSensor.cc:74
int _nvars
Definition IRIGSensor.h:140
dsm_sample_id_t _sampleId
Definition IRIGSensor.h:138
~IRIGSensor()
Definition IRIGSensor.cc:60
static std::string statusString(unsigned char status, bool xml=false)
Definition IRIGSensor.cc:220
static dsm_time_t getUnixTime(const Sample *samp)
Return the UNIX time in an IRIG sample.
Definition IRIGSensor.cc:352
bool process(const Sample *samp, std::list< const Sample * > &result)
Process a raw sample.
Definition IRIGSensor.cc:385
void setIRIGTime(dsm_time_t val)
Set the time on the IRIG card.
Definition IRIGSensor.cc:118
static const unsigned char * getStatusPtr(const Sample *samp)
fetch the pointer to the clock status in an IRIG sample.
Definition IRIGSensor.cc:364
static std::string shortStatusString(unsigned char status, bool xml=false)
Definition IRIGSensor.cc:250
dsm_time_t getIRIGTime()
Get the current time from the IRIG card.
Definition IRIGSensor.cc:96
int _nStatusPrints
Definition IRIGSensor.h:142
void close()
Close the device connected to the sensor.
Definition IRIGSensor.cc:214
void printStatus(std::ostream &ostr)
Definition IRIGSensor.cc:278
IRIGSensor()
No arg constructor.
Definition IRIGSensor.cc:55
void fromDOMElement(const xercesc::DOMElement *)
Definition IRIGSensor.cc:410
static float get100HzBacklog(const Sample *samp)
Definition IRIGSensor.cc:378
IODevice * buildIODevice()
Definition IRIGSensor.cc:63
SampleScanner * buildSampleScanner()
Definition IRIGSensor.cc:68
Virtual base class declaring methods for converting numeric values between little-endian and big-endi...
Definition EndianConverter.h:304
#define IRIG_MIN_DT_DIFF
Definition irigclock.h:169
#define IRIG_MAX_DT_DIFF
Limits for how many ticks the 100Hz software clock can disagree with the hardware clock before a rese...
Definition irigclock.h:168
The essential core classes of nidas.
Definition A2DConverter.h:31
long long dsm_time_t
Posix time in microseconds, the number of non-leap microseconds since 1970 Jan 1 00:00 UTC.
Definition Sample.h:62
unsigned int dsm_sample_id_t
Definition Sample.h:64
Root namespace for the NCAR In-Situ Data Acquisition Software.
Definition A2DConverter.h:31