nidas v1.2.3
TwoD_USB.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_2d_usb_h_
28#define _nidas_dynld_raf_2d_usb_h_
29
33
36
38
39namespace nidas { namespace dynld { namespace raf {
40
41using namespace nidas::core;
42
48{
49
50public:
51 TwoD_USB();
52 virtual ~TwoD_USB();
53
55
57
61 void open(int flags);
62
63 void close();
64
65 int getTASRate() const { return _tasRate; }
66
67 void setTASRate(int val) { _tasRate = val; }
68
74 void init();
75
76 virtual void
77 derivedDataNotify(const nidas::core:: DerivedDataReader * s);
78
79 void printStatus(std::ostream& ostr);
80
87 // virtual int TASToTap2D(Tap2D * t2d, float tas);
88 virtual int TASToTap2D(void * t2d, float tas);
89
100 virtual float
101 Tap2DToTAS(const Tap2D * t2d) const;
106 virtual float
107 Tap2DToTAS(const Tap2Dv1 * t2d) const;
108
109
110protected:
111
112 // Probe produces Big Endian.
114
115 // Tap2D value sent back from driver has little endian ntap value
117
121 virtual void init_parameters();
122
127 virtual void sendTrueAirspeed(float tas);
128
136
137 unsigned int _tasOutOfRange;
138
140
152
157
158 static const float DefaultTrueAirspeed;
159
160private:
161
164
167};
168
169}}} // namespace nidas namespace dynld namespace raf
170
171#endif
DSMSensor provides the basic support for reading, processing and distributing samples from a sensor a...
Definition DSMSensor.h:88
Interface of a DerivedDataClient of the DerivedDataReader.
Definition DerivedDataClient.h:37
An interface to an IO device.
Definition IODevice.h:42
A scanner of sample data.
Definition SampleScanner.h:74
Base class for SPEC 2DS optical array probe on a USB interface.
Definition TwoD_Processing.h:43
Base class for PMS 2D particle probes on a USB interface.
Definition TwoD_USB.h:48
int getTASRate() const
Definition TwoD_USB.h:65
IODevice * buildIODevice()
Factory method for an IODevice for this DSMSensor.
Definition TwoD_USB.cc:77
virtual void sendTrueAirspeed(float tas)
Encode and send the true airspeed to the USB driver, which will in turn send it to the probe.
Definition TwoD_USB.cc:267
virtual void init_parameters()
Initialize parameters for real-time and post-processing.
Definition TwoD_USB.cc:121
static const nidas::util::EndianConverter * bigEndian
Definition TwoD_USB.h:113
static const nidas::util::EndianConverter * littleEndian
Definition TwoD_USB.h:116
void printStatus(std::ostream &ostr)
Definition TwoD_USB.cc:279
unsigned int _tasOutOfRange
Definition TwoD_USB.h:137
float _trueAirSpeed
True air speed, received from IWGADTS feed.
Definition TwoD_USB.h:156
void setTASRate(int val)
Definition TwoD_USB.h:67
int _tasRate
How often to send the true air speed.
Definition TwoD_USB.h:135
void init()
Called by post-processing code.
Definition TwoD_USB.cc:141
dsm_sample_id_t _sorID
Shadow OR sample ID.
Definition TwoD_USB.h:150
void close()
close my associated device.
Definition TwoD_USB.cc:108
virtual void derivedDataNotify(const nidas::core::DerivedDataReader *s)
Method called on a DerivedDataClient by the DerivedDataReader thread when a new packet of derived dat...
Definition TwoD_USB.cc:178
static const float DefaultTrueAirspeed
Definition TwoD_USB.h:158
TwoD_USB(const TwoD_USB &)
No copying.
TwoD_USB & operator=(const TwoD_USB &)
No copying.
void open(int flags)
open the sensor and perform any intialization to the driver.
Definition TwoD_USB.cc:89
virtual float Tap2DToTAS(const Tap2D *t2d) const
Reverse the true airspeed encoding.
Definition TwoD_USB.cc:245
TwoD_USB()
Definition TwoD_USB.cc:57
virtual ~TwoD_USB()
Definition TwoD_USB.cc:62
virtual int TASToTap2D(void *t2d, float tas)
Build the struct above from the true airspeed (in m/s).
Definition TwoD_USB.cc:194
SampleScanner * buildSampleScanner()
Factory method for a SampleScanner for this DSMSensor.
Definition TwoD_USB.cc:82
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
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
unsigned int dsm_sample_id_t
Definition Sample.h:64
Root namespace for the NCAR In-Situ Data Acquisition Software.
Definition A2DConverter.h:31
Struct to adjust probe slice rate for true airspeed.
Definition usbtwod.h:73
This version is for rev2 of Spowarts USB board.
Definition usbtwod.h:88