nidas  v1.2-1520
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 
33 namespace nidas { namespace core {
34  class VariableConverter;
35 }}
36 
37 namespace nidas { namespace dynld { namespace raf {
38 
44 {
45 public:
46 
47  UHSAS_Serial();
48 
49  ~UHSAS_Serial();
50 
51  void open(int flags)
53 
58 
60 
61  bool process(const Sample* samp,std::list<const Sample*>& results)
62  throw();
63 
64  void setSendInitBlock(bool val)
65  {
66  _sendInitBlock = val;
67  }
68 
69  bool getSendInitBlock() const
70  {
71  return _sendInitBlock;
72  }
73 
74  static unsigned const char* findMarker(unsigned const char* ip,unsigned const char* eoi,
75  unsigned char* marker, int len);
76 
77 private:
78 
80 
85 
94 
99 
103  float _hkScale[12];
104 
108  bool _binary;
109 
113  float _sampleRate;
114 
116 
118 
119  bool _sumBins;
120 
121  unsigned int _nDataErrors;
122 
126  int _dtUsec;
127 
131  unsigned int _nstitch;
132 
137  unsigned int _largeHistograms;
138 
139  unsigned int _totalHistograms;
140 
141  std::vector<nidas::core::VariableConverter*> _converters;
142 
143 };
144 
145 }}} // namespace nidas namespace dynld raf
146 
147 #endif
UHSAS_Serial()
Definition: UHSAS_Serial.cc:171
~UHSAS_Serial()
Definition: UHSAS_Serial.cc:183
bool _sendInitBlock
Definition: UHSAS_Serial.h:115
bool _binary
Some UHSAS insturments generate ASCII.
Definition: UHSAS_Serial.h:108
void setSendInitBlock(bool val)
Definition: UHSAS_Serial.h:64
std::vector< nidas::core::VariableConverter * > _converters
Definition: UHSAS_Serial.h:141
unsigned int _totalHistograms
Definition: UHSAS_Serial.h:139
float _hkScale[12]
Housekeeping scale factors.
Definition: UHSAS_Serial.h:103
bool getSendInitBlock() const
Definition: UHSAS_Serial.h:69
A class for reading the UHSAS probe.
Definition: UHSAS_Serial.h:43
bool _sumBins
Definition: UHSAS_Serial.h:119
void init()
Setup whatever is necessary for process method to work.
Definition: UHSAS_Serial.cc:206
int _dtUsec
sample period in microseconds.
Definition: UHSAS_Serial.h:126
Virtual base class declaring methods for converting numeric values between little-endian and big-endi...
Definition: EndianConverter.h:304
unsigned int _largeHistograms
Number of times that the number of bytes between the histogram markers (ffff04 and ffff05) exceeds th...
Definition: UHSAS_Serial.h:137
int len
Definition: sing.cc:934
int _nHousekeep
Number of housekeeping channels.
Definition: UHSAS_Serial.h:98
Interface to a data sample.
Definition: Sample.h:189
int _nValidChannels
Number of histogram bins to be read.
Definition: UHSAS_Serial.h:93
A sensor connected to a serial port.
Definition: DSMSerialSensor.h:38
Definition: IOException.h:37
void open(int flags)
Open the device connected to the sensor.
Definition: UHSAS_Serial.cc:190
unsigned int _nstitch
number of stitch sequences encountered.
Definition: UHSAS_Serial.h:131
unsigned int _nDataErrors
Definition: UHSAS_Serial.h:121
void sendInitString()
Definition: UHSAS_Serial.cc:295
int _noutValues
Total number of floats in the processed output sample.
Definition: UHSAS_Serial.h:84
int _nOutBins
Definition: UHSAS_Serial.h:117
static unsigned const char * findMarker(unsigned const char *ip, unsigned const char *eoi, unsigned char *marker, int len)
Definition: UHSAS_Serial.cc:324
float _sampleRate
UHSAS sample-rate, currently used for scaling the sum of the bins.
Definition: UHSAS_Serial.h:113
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:337
static const nidas::util::EndianConverter * fromLittle
Definition: UHSAS_Serial.h:79
Definition: InvalidParameterException.h:35