nidas v1.2.3
SidsNetSensor.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 ** 2012, 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/* SidsNetSensor.h
27 *
28 */
29
30
31#ifndef NIDAS_DYNLD_RAF_SIDSNETSENSOR_H
32#define NIDAS_DYNLD_RAF_SIDSNETSENSOR_H
33
36
38
39namespace nidas { namespace dynld { namespace raf {
40
41using namespace nidas::core;
42
54{
55public:
56 static const unsigned int HEIGHT_SIZE = 32;
57 static const unsigned int WIDTH_SIZE = 256;
58 static const unsigned int IAT_SIZE = 100;
59 static const unsigned char SIDS_SYNC_WORD = 0x55;
60
63
64 bool process(const Sample *samp,std::list<const Sample *>& results)
65 throw();
66
67
68protected:
70 {
71 public:
72 Particle() : height(0), width(0), iat(0), area(0) { } ;
73 void zero() { height = width = iat = area = 0; }
74
76 unsigned int height;
78 unsigned int width;
80 unsigned int iat;
85 unsigned int area;
86 } ;
87
88
92 void init();
93
98 virtual void countParticle(const Particle& p);
99
105 virtual bool acceptThisParticle(const Particle& p) const;
106
108
116 virtual void createSamples(dsm_time_t nextTimeTag,std::list<const Sample *>&results) throw();
117
121 virtual void clearData();
123
127 unsigned int *_size_dist_H;
128
132 unsigned int *_size_dist_W;
133
137 unsigned int *_inter_arrival_T;
138
140 unsigned int _rejected;
141
147
151 unsigned long long _prevTimeWord;
152
154
157 unsigned int _totalRecords;
158 unsigned int _totalParticles;
159 unsigned int _rejected1D_Cntr;
160 unsigned int _overSizeCount;
161 unsigned int _misAligned;
162 unsigned int _recordsPerSecond;
164
166 long long _histoEndTime;
167
172 const int _nextraValues;
173
176
177
178private:
181
184};
185
186}}}
187
188#endif
Implementation of support for a sensor which generates character output.
Definition CharacterSensor.h:46
Interface to a data sample.
Definition Sample.h:190
Definition SidsNetSensor.h:70
unsigned int area
Actual number of shadowed diodes.
Definition SidsNetSensor.h:85
unsigned int iat
Inter-arrival time / deltaT.
Definition SidsNetSensor.h:80
unsigned int height
Max particle height, along diode array.
Definition SidsNetSensor.h:76
void zero()
Definition SidsNetSensor.h:73
unsigned int width
Max particle length, along flight path.
Definition SidsNetSensor.h:78
Particle()
Definition SidsNetSensor.h:72
Sensor class supporting the NCAR/EOL SID2H modifications via Ethernet UDP connection.
Definition SidsNetSensor.h:54
unsigned int _totalRecords
Statistics variables for processRecord().
Definition SidsNetSensor.h:157
virtual void createSamples(dsm_time_t nextTimeTag, std::list< const Sample * > &results)
Send derived data and reset.
Definition SidsNetSensor.cc:188
dsm_time_t _prevTime
Time from previous record.
Definition SidsNetSensor.h:146
unsigned int * _size_dist_W
Array for size-distribution histograms; width.
Definition SidsNetSensor.h:132
unsigned int _recordsPerSecond
Definition SidsNetSensor.h:162
static const unsigned int WIDTH_SIZE
Definition SidsNetSensor.h:57
SidsNetSensor()
Definition SidsNetSensor.cc:43
unsigned int _rejected1D_Cntr
Definition SidsNetSensor.h:159
static const unsigned int IAT_SIZE
Definition SidsNetSensor.h:58
virtual void countParticle(const Particle &p)
Look at particle stats/info and decide whether to accept or reject.
Definition SidsNetSensor.cc:169
unsigned int _totalParticles
Definition SidsNetSensor.h:158
unsigned int _rejected
Total rejected particles from probe per second.
Definition SidsNetSensor.h:140
virtual void clearData()
Clear size_dist arrays.
Definition SidsNetSensor.cc:232
static const unsigned int HEIGHT_SIZE
Definition SidsNetSensor.h:56
virtual bool acceptThisParticle(const Particle &p) const
Accept/reject criteria are in these functions.
Definition SidsNetSensor.cc:160
static const nidas::util::EndianConverter * _fromLittle
Definition SidsNetSensor.h:174
unsigned int * _size_dist_H
Array for size-distribution histograms; height.
Definition SidsNetSensor.h:127
static const nidas::util::EndianConverter * _fromBig
Definition SidsNetSensor.h:175
void init()
Called by post-processing code.
Definition SidsNetSensor.cc:57
unsigned int * _inter_arrival_T
Array for inter-arrival time histograms.
Definition SidsNetSensor.h:137
unsigned int _misAligned
Definition SidsNetSensor.h:161
~SidsNetSensor()
Definition SidsNetSensor.cc:71
SidsNetSensor(const SidsNetSensor &)
No copying.
static const unsigned char SIDS_SYNC_WORD
Definition SidsNetSensor.h:59
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 SidsNetSensor.cc:87
unsigned long long _prevTimeWord
Previous time word from SID probe.
Definition SidsNetSensor.h:151
unsigned int _overSizeCount
Definition SidsNetSensor.h:160
long long _histoEndTime
The end time of the current histogram.
Definition SidsNetSensor.h:166
const int _nextraValues
Number of output values excluding histogram.
Definition SidsNetSensor.h:172
SidsNetSensor & operator=(const SidsNetSensor &)
No assignment.
Virtual base class declaring methods for converting numeric values between little-endian and big-endi...
Definition EndianConverter.h:304
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
Root namespace for the NCAR In-Situ Data Acquisition Software.
Definition A2DConverter.h:31