nidas v1.2.3
CDP_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_CDP_SERIAL_H
28#define NIDAS_DYNLD_RAF_CDP_SERIAL_H
29
30#include "SppSerial.h"
31
32namespace nidas { namespace dynld { namespace raf {
33
38class CDP_Serial : public SppSerial
39{
40public:
41
42 CDP_Serial();
43
47 void validate();
48
52 void sendInitString();
53
57 bool process(const Sample* samp,std::list<const Sample*>& results);
58
59
60 // Packet to initialize probe with.
62 {
63 char esc; // ESC 0x1b
64 char id; // cmd id
65 DMT_UShort trig_thresh; // trigger threshold
66 DMT_UShort transRej; // Transit Reject
67 DMT_UShort chanCnt; // chanCnt
69 DMT_UShort range; // range
70 DMT_UShort avTranWe; // avgTransWeight
72 DMT_UShort divFlag; // divisorflag 0=/2, 1=/4
74 DMT_UShort OPCthreshold[MAX_CHANNELS]; // OPCthreshold[MAX_CHANNELS]
76 };
77
78 static const int _InitPacketSize = 102;
79
85 struct CDP_blk
86 {
92 DMT_UShort SizerBndwdth; // in 2012 documentation this is Sizer DT Bandwidth (unused)
93 DMT_UShort SizerThrshld; // in 2012 documentation this is Sizer Dynamic Threshold (unused)
95 DMT_ULong OPCchan[MAX_CHANNELS]; // 40 channels max
97 };
98
99protected:
100
101 int packetLen() const {
102 return (36 + 4 * _nChannels);
103 }
104
107
108 unsigned short _dofReject;
109};
110
111}}} // namespace nidas namespace dynld raf
112
113#endif
Interface to a data sample.
Definition Sample.h:190
A class for reading PMS1D probes with the DMT interface conversion.
Definition CDP_Serial.h:39
static const size_t FWB_TMP_INDX
Definition CDP_Serial.h:105
static const size_t FLSR_TMP_INDX
Definition CDP_Serial.h:105
CDP_Serial()
Definition CDP_Serial.cc:51
void validate()
Definition CDP_Serial.cc:83
static const size_t FCB_TMP_INDX
Definition CDP_Serial.h:106
int packetLen() const
Return the expected data packet length in bytes based on the number of channels being used.
Definition CDP_Serial.h:101
static const size_t QUAL_BLINE_INDX
Definition CDP_Serial.h:106
void sendInitString()
Definition CDP_Serial.cc:114
static const size_t SIZER_BLINE_INDX
Definition CDP_Serial.h:106
static const size_t FLSR_PWR_INDX
Definition CDP_Serial.h:105
bool process(const Sample *samp, std::list< const Sample * > &results)
Definition CDP_Serial.cc:150
unsigned short _dofReject
Definition CDP_Serial.h:108
static const size_t VDC5_MON_INDX
Definition CDP_Serial.h:106
static const size_t FLSR_CUR_INDX
Definition CDP_Serial.h:105
static const int _InitPacketSize
Definition CDP_Serial.h:78
Base class for many DMT Probes, including SPP100, SPP200, SPP300 and the CDP.
Definition SppSerial.h:100
static const int MAX_CHANNELS
Max # for array sizing.
Definition SppSerial.h:121
int _nChannels
Number of channels requested to be recorded.
Definition SppSerial.h:177
unsigned char DMT_ULong[4]
DMT 4-byte ints are packed with byte order 2301, where byte 0 is the low-order byte.
Definition SppSerial.h:78
unsigned char DMT_UShort[2]
DMT 2-byte ints are packed with byte order 01, where byte 0 is the low-order byte.
Definition SppSerial.h:52
Root namespace for the NCAR In-Situ Data Acquisition Software.
Definition A2DConverter.h:31
Data packet back from probe.
Definition CDP_Serial.h:86
DMT_UShort QualBndwdth
Definition CDP_Serial.h:89
DMT_ULong rejDOF
Definition CDP_Serial.h:88
DMT_UShort SizerThrshld
Definition CDP_Serial.h:93
DMT_UShort SizerBndwdth
Definition CDP_Serial.h:92
DMT_UShort chksum
Definition CDP_Serial.h:96
DMT_UShort QualThrshld
Definition CDP_Serial.h:90
DMT_UShort AvgTransit
Definition CDP_Serial.h:91
DMT_ULong OPCchan[MAX_CHANNELS]
Definition CDP_Serial.h:95
DMT_UShort cabinChan[8]
Definition CDP_Serial.h:87
DMT_ULong ADCoverflow
Definition CDP_Serial.h:94
DMT_UShort dofRej
Definition CDP_Serial.h:68
DMT_UShort chanCnt
Definition CDP_Serial.h:67
DMT_UShort attAccept
Definition CDP_Serial.h:71
DMT_UShort OPCthreshold[MAX_CHANNELS]
Definition CDP_Serial.h:74
char esc
Definition CDP_Serial.h:63
DMT_UShort ct_method
Definition CDP_Serial.h:73
DMT_UShort divFlag
Definition CDP_Serial.h:72
DMT_UShort trig_thresh
Definition CDP_Serial.h:65
DMT_UShort avTranWe
Definition CDP_Serial.h:70
DMT_UShort chksum
Definition CDP_Serial.h:75
DMT_UShort range
Definition CDP_Serial.h:69
DMT_UShort transRej
Definition CDP_Serial.h:66
char id
Definition CDP_Serial.h:64