nidas v1.2.3
UHSAS_Serial.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 ** 2007, 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_RAF_UHSAS_SERIAL_H
28#define NIDAS_DYNLD_RAF_UHSAS_SERIAL_H
29
32
33namespace nidas { namespace core {
34 class VariableConverter;
35}}
36
37namespace nidas { namespace dynld { namespace raf {
38
44{
45public:
46
48
50
51 void open(int flags);
52
56 void init();
57
58 void sendInitString();
59
60 bool process(const Sample* samp,std::list<const Sample*>& results);
61
62 void setSendInitBlock(bool val)
63 {
65 }
66
67 bool getSendInitBlock() const
68 {
69 return _sendInitBlock;
70 }
71
72 static unsigned const char* findMarker(unsigned const char* ip,unsigned const char* eoi,
73 unsigned char* marker, int len);
74
75private:
76
78
83
92
97
101 float _hkScale[12];
102
107
112
114
116
118
119 unsigned int _nDataErrors;
120
125
129 unsigned int _nstitch;
130
135 unsigned int _largeHistograms;
136
137 unsigned int _totalHistograms;
138
139 std::vector<nidas::core::VariableConverter*> _converters;
140
141};
142
143}}} // namespace nidas namespace dynld raf
144
145#endif
Interface to a data sample.
Definition Sample.h:190
A sensor connected to a serial port.
Definition DSMSerialSensor.h:39
A class for reading the UHSAS probe.
Definition UHSAS_Serial.h:44
std::vector< nidas::core::VariableConverter * > _converters
Definition UHSAS_Serial.h:139
int _nHousekeep
Number of housekeeping channels.
Definition UHSAS_Serial.h:96
bool getSendInitBlock() const
Definition UHSAS_Serial.h:67
void open(int flags)
Open the device connected to the sensor.
Definition UHSAS_Serial.cc:190
void sendInitString()
Definition UHSAS_Serial.cc:294
static const nidas::util::EndianConverter * fromLittle
Definition UHSAS_Serial.h:77
int _dtUsec
sample period in microseconds.
Definition UHSAS_Serial.h:124
~UHSAS_Serial()
Definition UHSAS_Serial.cc:183
void setSendInitBlock(bool val)
Definition UHSAS_Serial.h:62
int _nOutBins
Definition UHSAS_Serial.h:115
UHSAS_Serial()
Definition UHSAS_Serial.cc:171
void init()
Setup whatever is necessary for process method to work.
Definition UHSAS_Serial.cc:205
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 UHSAS_Serial.cc:336
float _sampleRate
UHSAS sample-rate, currently used for scaling the sum of the bins.
Definition UHSAS_Serial.h:111
bool _sendInitBlock
Definition UHSAS_Serial.h:113
bool _binary
Some UHSAS insturments generate ASCII.
Definition UHSAS_Serial.h:106
unsigned int _largeHistograms
Number of times that the number of bytes between the histogram markers (ffff04 and ffff05) exceeds th...
Definition UHSAS_Serial.h:135
static unsigned const char * findMarker(unsigned const char *ip, unsigned const char *eoi, unsigned char *marker, int len)
Definition UHSAS_Serial.cc:323
float _hkScale[12]
Housekeeping scale factors.
Definition UHSAS_Serial.h:101
unsigned int _nstitch
number of stitch sequences encountered.
Definition UHSAS_Serial.h:129
int _nValidChannels
Number of histogram bins to be read.
Definition UHSAS_Serial.h:91
unsigned int _nDataErrors
Definition UHSAS_Serial.h:119
unsigned int _totalHistograms
Definition UHSAS_Serial.h:137
int _noutValues
Total number of floats in the processed output sample.
Definition UHSAS_Serial.h:82
bool _sumBins
Definition UHSAS_Serial.h:117
Virtual base class declaring methods for converting numeric values between little-endian and big-endi...
Definition EndianConverter.h:304
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
Root namespace for the NCAR In-Situ Data Acquisition Software.
Definition A2DConverter.h:31
int len
Definition sing.cc:948