nidas  v1.2-1520
CVIProcessor.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_CVIProcessor_h
28 #define __nidas_dynld_raf_CVIProcessor_h
29 
30 #include <memory>
31 
33 #include <nidas/dynld/ViperDIO.h>
36 
37 namespace nidas { namespace dynld { namespace raf {
38 
39 using namespace nidas::core;
40 
45 {
46 public:
47 
48  CVIProcessor();
49 
50  ~CVIProcessor();
51 
55  void flush() throw();
56 
57  void addRequestedSampleTag(SampleTag* tag)
69  void connectSource(SampleSource*) override;
70 
75  void disconnectSource(SampleSource*) throw();
76 
82  void connect(SampleOutput* output) throw();
83 
89  void disconnect(SampleOutput* output) throw();
90 
91  void setD2ADeviceName(const std::string& val)
92  {
93  _d2aDeviceName = val;
94  }
95 
96  const std::string& getD2ADeviceName() const
97  {
98  return _d2aDeviceName;
99  }
100 
101  void setDigIODeviceName(const std::string& val)
102  {
103  _digioDeviceName = val;
104  }
105 
106  const std::string& getDigIODeviceName()
107  {
108  return _digioDeviceName;
109  }
110 
117  bool receive(const Sample*s) throw();
118 
119  void fromDOMElement(const xercesc::DOMElement* node)
121 
122 protected:
123 
126  void attachLVInput(SampleSource* src, const SampleTag* tag)
128 
129 private:
130 
132 
133  std::set<SampleSource*> _connectedSources;
134 
135  std::set<SampleOutput*> _connectedOutputs;
136 
138 
139  std::string _d2aDeviceName;
140 
141  std::string _digioDeviceName;
142 
143  std::vector<bool> _varMatched;
144 
146 
147  float _rate;
148 
150 
152 
154 
155  unsigned int _numD2A;
156 
157  unsigned int _numDigout;
158 
159  float _vouts[5];
160 
161  int _douts[4];
162 
163  const Site* _site;
164 
168  CVIProcessor(const CVIProcessor&);
169 
173  CVIProcessor& operator=(const CVIProcessor&);
174 
175 };
176 
177 }}} // namespace nidas namespace dynld namespace raf
178 
179 #endif
ViperDIO _dout
Definition: CVIProcessor.h:153
std::string _d2aDeviceName
Definition: CVIProcessor.h:139
std::string _digioDeviceName
Definition: CVIProcessor.h:141
unsigned int dsm_sample_id_t
Definition: Sample.h:63
const std::string & getDigIODeviceName()
Definition: CVIProcessor.h:106
const Site * _site
Definition: CVIProcessor.h:163
A measurement site.
Definition: Site.h:49
SampleAverager _averager
Definition: CVIProcessor.h:145
unsigned int _numD2A
Definition: CVIProcessor.h:155
Interface of an output stream of samples.
Definition: SampleOutput.h:47
Pure virtual interface for a source of Samples.
Definition: SampleSource.h:48
Pure virtual interface of a client of Samples.
Definition: SampleClient.h:38
Definition: SampleAverager.h:37
DSC_AnalogOut _aout
Definition: CVIProcessor.h:151
Support for the D2A device on a Diamond DMMAT card.
Definition: DSC_AnalogOut.h:42
float _rate
Definition: CVIProcessor.h:147
dsm_sample_id_t _lvSampleId
Definition: CVIProcessor.h:149
Support for the digital IO on an Arcom Viper.
Definition: ViperDIO.h:45
Interface to a data sample.
Definition: Sample.h:189
SampleTag * _outputSampleTag
Definition: CVIProcessor.h:137
Definition: IOException.h:37
Class describing a group of variables that are sampled and handled together.
Definition: SampleTag.h:87
Processor to support Counter-flow Virtual Impactor.
Definition: CVIProcessor.h:44
Interface of a processor of samples.
Definition: SampleIOProcessor.h:49
nidas::util::Mutex _connectionMutex
Definition: CVIProcessor.h:131
void setDigIODeviceName(const std::string &val)
Definition: CVIProcessor.h:101
A C++ wrapper for a POSIX mutex.
Definition: ThreadSupport.h:154
void setD2ADeviceName(const std::string &val)
Definition: CVIProcessor.h:91
std::set< SampleSource * > _connectedSources
Definition: CVIProcessor.h:133
unsigned int _numDigout
Definition: CVIProcessor.h:157
std::vector< bool > _varMatched
Definition: CVIProcessor.h:143
std::set< SampleOutput * > _connectedOutputs
Definition: CVIProcessor.h:135
const std::string & getD2ADeviceName() const
Definition: CVIProcessor.h:96
Definition: InvalidParameterException.h:35