nidas  v1.2-1520
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 
32 namespace nidas { namespace dynld { namespace raf {
33 
34 using namespace nidas::core;
35 
43 {
44 
45 public:
46 
48 
50 
51  IODevice* buildIODevice() throw(nidas::util::IOException);
52 
53  void open(int flags)
54  throw(nidas::util::IOException,nidas::util::InvalidParameterException);
55 
56  void validate() throw(nidas::util::InvalidParameterException);
57 
58  bool process(const Sample* samp,std::list<const Sample*>& results)
59  throw();
60 
64  void startPurge() throw(nidas::util::IOException);
65 
70  void stopPurge() throw(nidas::util::IOException);
71 
72  void startStreams() throw(nidas::util::IOException);
73 
74  void stopStreams() throw(nidas::util::IOException);
75 
76  void executeXmlRpc(XmlRpc::XmlRpcValue& params, XmlRpc::XmlRpcValue& result) throw();
77 
78 protected:
79 
80  std::string sendCommand(const std::string& cmd,int readlen = 0)
81  throw(nidas::util::IOException);
82 
83  int _msecPeriod;
84 
88  int _nchannels;
89 
90  dsm_sample_id_t _sampleId;
91 
97  float _psiConvert;
98 
99  unsigned int _sequenceNumber;
100 
101  size_t _outOfSequence;
102 
103  // Stuff to handle when output data samples are broken
104  // over two input samples (as happened on ICE-T)
105  union flip {
106  unsigned int lval;
107  float fval;
108  char bytes[4];
109  } _prevPartial;
110  bool _partialFirst, _partialSecond;
111  SampleT<float> *_firstPrevious, *_secondPrevious;
113  bool _gotOne;
115 
116 private:
117 
120 
122  PSI9116_Sensor& operator=(const PSI9116_Sensor&);
123 
124 };
125 
126 }}} // namespace nidas namespace dynld namespace raf
127 
128 #endif
bool _gotOne
Definition: PSI9116_Sensor.h:113
unsigned int dsm_sample_id_t
Definition: Sample.h:63
Implementation of support for a sensor which generates character output.
Definition: CharacterSensor.h:46
unsigned int lval
Definition: PSI9116_Sensor.h:106
SampleT< float > * _secondPrevious
Definition: PSI9116_Sensor.h:111
~PSI9116_Sensor()
Definition: PSI9116_Sensor.h:49
int _prevPartNBytes
Definition: PSI9116_Sensor.h:114
Definition: PSI9116_Sensor.h:105
An interface to an IO device.
Definition: IODevice.h:41
int _nPrevSampVals
Definition: PSI9116_Sensor.h:112
Interface to a data sample.
Definition: Sample.h:189
Definition: IOException.h:37
bool _partialSecond
Definition: PSI9116_Sensor.h:110
Support for sampling a PSI 9116 pressure scanner from EsterLine Pressure Systems. ...
Definition: PSI9116_Sensor.h:42
float fval
Definition: PSI9116_Sensor.h:107
Definition: InvalidParameterException.h:35