nidas v1.2.3
PSI9116_Sensor.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 ** 2005, 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_PSI9116_SENSOR_H
28#define NIDAS_DYNLD_RAF_PSI9116_SENSOR_H
29
31
32namespace nidas { namespace dynld { namespace raf {
33
34using namespace nidas::core;
35
43{
44
45public:
46
48
50
52
53 void open(int flags);
54
55 void validate();
56
57 bool process(const Sample* samp,std::list<const Sample*>& results);
58
62 void startPurge();
63
68 void stopPurge();
69
70 void startStreams();
71
72 void stopStreams();
73
74 void executeXmlRpc(XmlRpc::XmlRpcValue& params, XmlRpc::XmlRpcValue& result);
75
76protected:
77
78 std::string sendCommand(const std::string& cmd,int readlen = 0);
79
81
86
88
95
96 unsigned int _sequenceNumber;
97
99
100 // Stuff to handle when output data samples are broken
101 // over two input samples (as happened on ICE-T)
102 union flip {
103 unsigned int lval;
104 float fval;
105 char bytes[4];
112
113private:
114
117
120
121};
122
123}}} // namespace nidas namespace dynld namespace raf
124
125#endif
Implementation of support for a sensor which generates character output.
Definition CharacterSensor.h:46
An interface to an IO device.
Definition IODevice.h:42
Interface to a data sample.
Definition Sample.h:190
Support for sampling a PSI 9116 pressure scanner from EsterLine Pressure Systems.
Definition PSI9116_Sensor.h:43
SampleT< float > * _firstPrevious
Definition PSI9116_Sensor.h:108
size_t _outOfSequence
Definition PSI9116_Sensor.h:98
void stopPurge()
Set valve position back to RUN from PURGE, then restart data streams.
Definition PSI9116_Sensor.cc:205
SampleT< float > * _secondPrevious
Definition PSI9116_Sensor.h:108
~PSI9116_Sensor()
Definition PSI9116_Sensor.h:49
void stopStreams()
Definition PSI9116_Sensor.cc:118
void validate()
Implementation of DSMSensor::validate for a Character Sensor.
Definition PSI9116_Sensor.cc:213
int _nPrevSampVals
Definition PSI9116_Sensor.h:109
int _nchannels
Number of sampled channels.
Definition PSI9116_Sensor.h:85
void startStreams()
Definition PSI9116_Sensor.cc:112
bool _partialSecond
Definition PSI9116_Sensor.h:107
union nidas::dynld::raf::PSI9116_Sensor::flip _prevPartial
bool _gotOne
Definition PSI9116_Sensor.h:110
float _psiConvert
Conversion factor to apply to PSI data.
Definition PSI9116_Sensor.h:94
dsm_sample_id_t _sampleId
Definition PSI9116_Sensor.h:87
bool _partialFirst
Definition PSI9116_Sensor.h:107
void open(int flags)
Open the sensor device port for real-time sampling.
Definition PSI9116_Sensor.cc:144
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 PSI9116_Sensor.cc:249
std::string sendCommand(const std::string &cmd, int readlen=0)
Definition PSI9116_Sensor.cc:64
int _msecPeriod
Definition PSI9116_Sensor.h:80
void executeXmlRpc(XmlRpc::XmlRpcValue &params, XmlRpc::XmlRpcValue &result)
Method invoked when the DSMEngineIntf XmlRpcServer receives a "SensorAction" request,...
Definition PSI9116_Sensor.cc:463
IODevice * buildIODevice()
Creates an IODevice depending on the device name prefix: name prefix type of IODevice inet: TCPSocket...
Definition PSI9116_Sensor.cc:56
PSI9116_Sensor(const PSI9116_Sensor &)
No copying.
void startPurge()
Stop data streams, set valve position to PURGE.
Definition PSI9116_Sensor.cc:196
unsigned int _sequenceNumber
Definition PSI9116_Sensor.h:96
PSI9116_Sensor()
Definition PSI9116_Sensor.cc:47
int _prevPartNBytes
Definition PSI9116_Sensor.h:111
PSI9116_Sensor & operator=(const PSI9116_Sensor &)
No assignment.
The essential core classes of nidas.
Definition A2DConverter.h:31
unsigned int dsm_sample_id_t
Definition Sample.h:64
Root namespace for the NCAR In-Situ Data Acquisition Software.
Definition A2DConverter.h:31
Definition PSI9116_Sensor.h:102
unsigned int lval
Definition PSI9116_Sensor.h:103
char bytes[4]
Definition PSI9116_Sensor.h:105
float fval
Definition PSI9116_Sensor.h:104