nidas v1.2.3
BCPD_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_BCPD_SERIAL_H
28#define NIDAS_DYNLD_RAF_BCPD_SERIAL_H
29
30#include "SppSerial.h"
31
32namespace nidas { namespace dynld { namespace raf {
33
38class BCPD_Serial : public SppSerial
39{
40public:
41
43
47 void validate();
48
52 void sendInitString();
53
54 bool process(const Sample* samp,std::list<const Sample*>& results)
55 throw();
56
57
58 // Packet to initialize probe with.
60 {
61 char esc; // ESC 0x1b
62 char id; // cmd id
63 DMT_UShort trig_thresh; // ADC Lower Threshold
64 DMT_UShort numPbP; // # of PbP packets
65 DMT_UShort chanCnt; // Channel Count
66 DMT_UShort numBytes; // # of bytes of raw data per channel
69 DMT_UShort OPCthreshold[MAX_CHANNELS]; // OPCthreshold[MAX_CHANNELS]
71 };
72
73 static const int _InitPacketSize = 96;
74
116
117protected:
118
119 int packetLen() const {
120 return (52 + 4 * _nChannels);
121 }
122
124
125};
126
127}}} // namespace nidas namespace dynld raf
128
129#endif
Interface to a data sample.
Definition Sample.h:190
A class for reading PMS1D probes with the DMT interface conversion.
Definition BCPD_Serial.h:39
static const size_t FiveVdcRef
Definition BCPD_Serial.h:123
int packetLen() const
Return the expected data packet length in bytes based on the number of channels being used.
Definition BCPD_Serial.h:119
static const size_t P_APD_Temp
Definition BCPD_Serial.h:123
void sendInitString()
Definition BCPD_Serial.cc:87
void validate()
Definition BCPD_Serial.cc:79
static const size_t S_APD_Temp
Definition BCPD_Serial.h:123
static const size_t S_APD_Vdc
Definition BCPD_Serial.h:123
static const size_t BoardTemp
Definition BCPD_Serial.h:123
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 BCPD_Serial.cc:116
BCPD_Serial()
Definition BCPD_Serial.cc:48
static const int _InitPacketSize
Definition BCPD_Serial.h:73
static const size_t P_APD_Vdc
Definition BCPD_Serial.h:123
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 (all unsigned little-endian):
Definition BCPD_Serial.h:104
DMT_UShort unused2
Definition BCPD_Serial.h:107
DMT_UShort SnoiseBandwidth
Definition BCPD_Serial.h:108
DMT_UShort SbaselineThreshold
Definition BCPD_Serial.h:109
DMT_UShort PbaselineThreshold
Definition BCPD_Serial.h:111
DMT_UShort chksum
Definition BCPD_Serial.h:114
DMT_ULong unused1
Definition BCPD_Serial.h:106
DMT_ULong OPCchan[MAX_CHANNELS]
Definition BCPD_Serial.h:113
DMT_UShort PnoiseBandwidth
Definition BCPD_Serial.h:110
DMT_ULong oversizeReject
Definition BCPD_Serial.h:112
DMT_UShort cabinChan[16]
Definition BCPD_Serial.h:105
char id
Definition BCPD_Serial.h:62
DMT_UShort numPbP
Definition BCPD_Serial.h:64
DMT_UShort chanCnt
Definition BCPD_Serial.h:65
DMT_UShort chksum
Definition BCPD_Serial.h:70
DMT_UShort trig_thresh
Definition BCPD_Serial.h:63
DMT_UShort numBytes
Definition BCPD_Serial.h:66
DMT_UShort OPCthreshold[MAX_CHANNELS]
Definition BCPD_Serial.h:69
DMT_UShort spare2
Definition BCPD_Serial.h:68
char esc
Definition BCPD_Serial.h:61
DMT_UShort spare1
Definition BCPD_Serial.h:67