nidas  v1.2-1520
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 
39 namespace nidas { namespace dynld { namespace raf {
40 
41 using namespace nidas::core;
42 
54 {
55 public:
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 
61  SidsNetSensor();
62  ~SidsNetSensor();
63 
64  bool process(const Sample *samp,std::list<const Sample *>& results)
65  throw();
66 
67 
68 protected:
69  class Particle
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() throw(nidas::util::InvalidParameterException);
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 
146  dsm_time_t _prevTime;
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 
174  static const nidas::util::EndianConverter *_fromLittle;
175  static const nidas::util::EndianConverter *_fromBig;
176 
177 
178 private:
181 
183  SidsNetSensor& operator=(const SidsNetSensor&);
184 };
185 
186 }}}
187 
188 #endif
void zero()
Definition: SidsNetSensor.h:73
Implementation of support for a sensor which generates character output.
Definition: CharacterSensor.h:46
unsigned int height
Max particle height, along diode array.
Definition: SidsNetSensor.h:76
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:61
unsigned int area
Actual number of shadowed diodes.
Definition: SidsNetSensor.h:85
Sensor class supporting the NCAR/EOL SID2H modifications via Ethernet UDP connection.
Definition: SidsNetSensor.h:53
Definition: SidsNetSensor.h:69
Interface to a data sample.
Definition: Sample.h:189
unsigned int iat
Inter-arrival time / deltaT.
Definition: SidsNetSensor.h:80
unsigned int width
Max particle length, along flight path.
Definition: SidsNetSensor.h:78
Particle()
Definition: SidsNetSensor.h:72
Definition: InvalidParameterException.h:35