nidas v1.2.3
WxtSensor.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 ** 2010, 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
27#ifndef NIDAS_DYNLD_WXTSENSOR_H
28#define NIDAS_DYNLD_WXTSENSOR_H
29
31
32namespace nidas { namespace dynld {
33
34using namespace nidas::core;
35
36using namespace nidas::core;
39
83{
84
85public:
86
87 WxtSensor();
88
89 ~WxtSensor();
90
91 int
92 scanSample(AsciiSscanf* sscanf, const char* inputstr, float* data_ptr);
93
94 void init();
95
96 bool process(const Sample* samp, std::list<const Sample*>& results) throw();
97
98 const std::string& getUName() const { return _uName; }
99
100 void setUName(const std::string& val) { _uName = val; }
101
102 const std::string& getVName() const { return _vName; }
103
104 void setVName(const std::string& val) { _vName = val; }
105
106 void validateSscanfs();
107
108private:
109
110 void wxtValidateSscanfs();
111
116 std::map<dsm_sample_id_t,std::vector<std::string> > _field_formats;
117
121 std::string _uName;
122
126 std::string _vName;
127
132
137
142
147
152
157
162
163};
164
165}} // namespace nidas namespace dynld
166
167#endif // NIDAS_DYNLD_WXTSENSOR_H
Class providing sscanf functionality for parsing ASCII data.
Definition AsciiSscanf.h:62
Interface to a data sample.
Definition Sample.h:190
Support for a sensor that is sending packets on a TCP socket, a UDP socket, a Bluetooth RF Comm socke...
Definition SerialSensor.h:65
Vaisala WXT weather sensor.
Definition WxtSensor.h:83
void init()
Initialize the CharacterSensor instance for post-processing.
Definition WxtSensor.cc:66
dsm_sample_id_t _uvId
ID of sample containing wind U,V components.
Definition WxtSensor.h:156
int _uvlen
Length of output U,V sample.
Definition WxtSensor.h:161
int _dirIndex
Index of wind direction in output sample.
Definition WxtSensor.h:136
int _uIndex
Index of wind u component in output sample.
Definition WxtSensor.h:141
std::map< dsm_sample_id_t, std::vector< std::string > > _field_formats
For each <sample> with an scanfFormat, the parse format tokenized by commas.
Definition WxtSensor.h:116
WxtSensor()
Definition WxtSensor.cc:49
void wxtValidateSscanfs()
Definition WxtSensor.cc:390
std::string _uName
Initial characters in wind U component variable name.
Definition WxtSensor.h:121
bool process(const Sample *samp, std::list< const Sample * > &results)
Process a raw sample, which in this case means do a sscanf on the character string contents,...
Definition WxtSensor.cc:316
void setVName(const std::string &val)
Definition WxtSensor.h:104
std::string _vName
Initial characters in wind V component variable name.
Definition WxtSensor.h:126
int _speedIndex
Index of wind speed in output sample.
Definition WxtSensor.h:131
void setUName(const std::string &val)
Definition WxtSensor.h:100
int scanSample(AsciiSscanf *sscanf, const char *inputstr, float *data_ptr)
Definition WxtSensor.cc:200
const std::string & getVName() const
Definition WxtSensor.h:102
dsm_sample_id_t _speedDirId
ID of sample containing wind speed, direction.
Definition WxtSensor.h:151
const std::string & getUName() const
Definition WxtSensor.h:98
~WxtSensor()
Definition WxtSensor.cc:63
void validateSscanfs()
Virtual method to check that the Sscanfs for this CharacterSensor are OK.
Definition WxtSensor.cc:385
int _vIndex
Index of wind v component in output sample.
Definition WxtSensor.h:146
Definition IOException.h:37
Definition InvalidParameterException.h:35
The essential core classes of nidas.
Definition A2DConverter.h:31
Sample * getSample(sampleType type, unsigned int len)
A convienence method for getting a sample of an enumerated type from a pool.
Definition Sample.cc:70
unsigned int dsm_sample_id_t
Definition Sample.h:64
Root namespace for the NCAR In-Situ Data Acquisition Software.
Definition A2DConverter.h:31