nidas  v1.2-1520
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 
32 namespace nidas { namespace dynld {
33 
34 using namespace nidas::core;
35 
36 using namespace nidas::core;
39 
82 class WxtSensor: public SerialSensor
83 {
84 
85 public:
86 
87  WxtSensor();
88 
89  ~WxtSensor();
90 
91  int
92  scanSample(AsciiSscanf* sscanf, const char* inputstr, float* data_ptr);
93 
94  void init() throw(nidas::util::InvalidParameterException);
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() throw(nidas::util::InvalidParameterException);
107 
108 private:
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 
131  int _speedIndex;
132 
136  int _dirIndex;
137 
141  int _uIndex;
142 
146  int _vIndex;
147 
151  dsm_sample_id_t _speedDirId;
152 
156  dsm_sample_id_t _uvId;
157 
161  int _uvlen;
162 
163 };
164 
165 }} // namespace nidas namespace dynld
166 
167 #endif // NIDAS_DYNLD_WXTSENSOR_H
unsigned int dsm_sample_id_t
Definition: Sample.h:63
Support for a sensor that is sending packets on a TCP socket, a UDP socket, a Bluetooth RF Comm socke...
Definition: SerialSensor.h:64
Class providing sscanf functionality for parsing ASCII data.
Definition: AsciiSscanf.h:62
const std::string & getVName() const
Definition: WxtSensor.h:102
void setVName(const std::string &val)
Definition: WxtSensor.h:104
const std::string & getUName() const
Definition: WxtSensor.h:98
Interface to a data sample.
Definition: Sample.h:189
void setUName(const std::string &val)
Definition: WxtSensor.h:100
Definition: IOException.h:37
Vaisala WXT weather sensor.
Definition: WxtSensor.h:82
Definition: InvalidParameterException.h:35