nidas v1.2.3
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
36
37namespace nidas { namespace dynld { namespace raf {
38
39using namespace nidas::core;
40
45{
46public:
47
49
51
55 void flush() throw();
56
74 void connectSource(SampleSource*) override;
75
80 void disconnectSource(SampleSource*) throw();
81
87 void connect(SampleOutput* output) throw();
88
94 void disconnect(SampleOutput* output) throw();
95
96 void setD2ADeviceName(const std::string& val)
97 {
99 }
100
101 const std::string& getD2ADeviceName() const
102 {
103 return _d2aDeviceName;
104 }
105
106 void setDigIODeviceName(const std::string& val)
107 {
109 }
110
111 const std::string& getDigIODeviceName()
112 {
113 return _digioDeviceName;
114 }
115
122 bool receive(const Sample*s) throw();
123
127 void fromDOMElement(const xercesc::DOMElement* node);
128
129protected:
130
134 void attachLVInput(SampleSource* src, const SampleTag* tag);
135
136private:
137
139
140 std::set<SampleSource*> _connectedSources;
141
142 std::set<SampleOutput*> _connectedOutputs;
143
145
146 std::string _d2aDeviceName;
147
148 std::string _digioDeviceName;
149
150 std::vector<bool> _varMatched;
151
153
154 float _rate;
155
157
159
161
162 unsigned int _numD2A;
163
164 unsigned int _numDigout;
165
166 float _vouts[5];
167
168 int _douts[4];
169
170 const Site* _site;
171
176
181
182};
183
184}}} // namespace nidas namespace dynld namespace raf
185
186#endif
Definition SampleAverager.h:37
Pure virtual interface of a client of Samples.
Definition SampleClient.h:38
Interface of a processor of samples.
Definition SampleIOProcessor.h:50
Interface of an output stream of samples.
Definition SampleOutput.h:49
Pure virtual interface for a source of Samples.
Definition SampleSource.h:48
Class describing a group of variables that are sampled and handled together.
Definition SampleTag.h:88
Interface to a data sample.
Definition Sample.h:190
A measurement site.
Definition Site.h:49
Support for the D2A device on a Diamond DMMAT card.
Definition DSC_AnalogOut.h:42
Support for the digital IO on an Arcom Viper.
Definition ViperDIO.h:45
Processor to support Counter-flow Virtual Impactor.
Definition CVIProcessor.h:45
const Site * _site
Definition CVIProcessor.h:170
CVIProcessor(const CVIProcessor &)
Copy not supported.
void disconnect(SampleOutput *output)
Do common operations necessary when a output has disconnected:
Definition CVIProcessor.cc:217
~CVIProcessor()
Definition CVIProcessor.cc:59
CVIProcessor & operator=(const CVIProcessor &)
Assignment not supported.
std::set< SampleSource * > _connectedSources
Definition CVIProcessor.h:140
void attachLVInput(SampleSource *src, const SampleTag *tag)
Definition CVIProcessor.cc:179
void setDigIODeviceName(const std::string &val)
Definition CVIProcessor.h:106
float _rate
Definition CVIProcessor.h:154
void fromDOMElement(const xercesc::DOMElement *node)
Definition CVIProcessor.cc:332
std::string _d2aDeviceName
Definition CVIProcessor.h:146
bool receive(const Sample *s)
The CVIProcessor receive method is configured to received the processed samples from CVI_LV_Input.
Definition CVIProcessor.cc:255
int _douts[4]
Definition CVIProcessor.h:168
unsigned int _numDigout
Definition CVIProcessor.h:164
void flush()
Implementation of SampleSource and SampleClient flush().
Definition CVIProcessor.cc:245
SampleTag * _outputSampleTag
Definition CVIProcessor.h:144
float _vouts[5]
Definition CVIProcessor.h:166
void connectSource(SampleSource *) override
Do common operations necessary when a input has connected:
Definition CVIProcessor.cc:114
std::string _digioDeviceName
Definition CVIProcessor.h:148
const std::string & getDigIODeviceName()
Definition CVIProcessor.h:111
void disconnectSource(SampleSource *)
Disconnect a SampleSource from this CVIProcessor.
Definition CVIProcessor.cc:164
unsigned int _numD2A
Definition CVIProcessor.h:162
ViperDIO _dout
Definition CVIProcessor.h:160
std::set< SampleOutput * > _connectedOutputs
Definition CVIProcessor.h:142
SampleAverager _averager
Definition CVIProcessor.h:152
DSC_AnalogOut _aout
Definition CVIProcessor.h:158
const std::string & getD2ADeviceName() const
Definition CVIProcessor.h:101
nidas::util::Mutex _connectionMutex
Definition CVIProcessor.h:138
dsm_sample_id_t _lvSampleId
Definition CVIProcessor.h:156
CVIProcessor()
Definition CVIProcessor.cc:45
void setD2ADeviceName(const std::string &val)
Definition CVIProcessor.h:96
void addRequestedSampleTag(SampleTag *tag)
Definition CVIProcessor.cc:82
std::vector< bool > _varMatched
Definition CVIProcessor.h:150
void connect(SampleOutput *output)
Do common operations necessary when a output has connected:
Definition CVIProcessor.cc:208
A C++ wrapper for a POSIX mutex.
Definition ThreadSupport.h:161
The essential core classes of nidas.
Definition A2DConverter.h:31
Sample * getSample(sampleType type, unsigned int len)
A convienence method for getting a sample of an enumerated type from a pool.
Definition Sample.cc:70
unsigned int dsm_sample_id_t
Definition Sample.h:64
Root namespace for the NCAR In-Situ Data Acquisition Software.
Definition A2DConverter.h:31