nidas v1.2.3
DSC_A2DSensor.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 ** 2006, 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#ifndef NIDAS_DYNLD_DSC_A2DSENSOR_H
27#define NIDAS_DYNLD_DSC_A2DSENSOR_H
28
29#include "A2DSensor.h"
31
33
34#include <vector>
35#include <map>
36#include <set>
37
38namespace nidas { namespace dynld {
39
40using namespace nidas::core;
41
42class DSC_AnalogOut;
43
47class DSC_A2DSensor : public A2DSensor {
48
49public:
50
53
58
63
67 void validate();
68
75 void open(int flags);
76
77 /*
78 * Close the device connected to the sensor.
79 *
80 * @throws nidas::util::IOException
81 **/
82 void close();
83
84 void printStatus(std::ostream& ostr) throw();
85
89 void setGainBipolar(int ichan, int gain, int bipolar);
90
91 void getDefaultConversion(int ichan, float& intercept, float& slope) const;
92
93 void executeXmlRpc(XmlRpc::XmlRpcValue& params, XmlRpc::XmlRpcValue& result)
94 throw();
95
96 void getA2DSetup(XmlRpc::XmlRpcValue& params, XmlRpc::XmlRpcValue& result)
97 throw();
98
99 void testVoltage(XmlRpc::XmlRpcValue& params, XmlRpc::XmlRpcValue& result)
100 throw();
101
107 {
108 return _initialConverter;
109 }
110
118 {
119 return _finalConverter;
120 }
121
122private:
123
125
127
131 int _gain;
132
137
142
147
152
155
158};
159
160}} // namespace nidas namespace dynld
161
162#endif
Virtual class with methods for performing conversions from integer A2D counts to floating point volta...
Definition A2DConverter.h:61
An interface to an IO device.
Definition IODevice.h:42
A scanner of sample data.
Definition SampleScanner.h:74
Virtual base class for supporting sensors attached to an A2D.
Definition A2DSensor.h:46
Support for a Diamond Systems Corp A2D.
Definition DSC_A2DSensor.h:47
~DSC_A2DSensor()
Definition DSC_A2DSensor.cc:57
DSC_A2DSensor()
Definition DSC_A2DSensor.cc:47
IODevice * buildIODevice()
Definition DSC_A2DSensor.cc:68
bool _bipolar
Each card can only support one polarity.
Definition DSC_A2DSensor.h:136
void close()
close my associated device.
Definition DSC_A2DSensor.cc:139
A2DConverter * getInitialConverter() const
Initial A2DConverter, containing the default conversion from counts to volts based on the gain and bi...
Definition DSC_A2DSensor.h:106
void validate()
Definition DSC_A2DSensor.cc:78
DSC_A2DSensor & operator=(const DSC_A2DSensor &)
No assignment.
void testVoltage(XmlRpc::XmlRpcValue &params, XmlRpc::XmlRpcValue &result)
Definition DSC_A2DSensor.cc:294
void open(int flags)
Open the device connected to the sensor.
Definition DSC_A2DSensor.cc:100
DSC_A2DSensor(const DSC_A2DSensor &)
No copying.
void getA2DSetup(XmlRpc::XmlRpcValue &params, XmlRpc::XmlRpcValue &result)
Definition DSC_A2DSensor.cc:279
int _gain
Each card can only support one gain value.
Definition DSC_A2DSensor.h:131
void executeXmlRpc(XmlRpc::XmlRpcValue &params, XmlRpc::XmlRpcValue &result)
Method invoked when the DSMEngineIntf XmlRpcServer receives a "SensorAction" request,...
Definition DSC_A2DSensor.cc:242
int _voltage
Voltage set by auto_cal for diagnostics.
Definition DSC_A2DSensor.h:151
SampleScanner * buildSampleScanner()
Definition DSC_A2DSensor.cc:73
DSC_AnalogOut * _d2a
Used for auto_cal, diagnostic voltages output.
Definition DSC_A2DSensor.h:141
void setGainBipolar(int ichan, int gain, int bipolar)
Definition DSC_A2DSensor.cc:170
int _calset
Channels to engage by auto_cal.
Definition DSC_A2DSensor.h:146
void printStatus(std::ostream &ostr)
Definition DSC_A2DSensor.cc:145
A2DConverter * _finalConverter
Definition DSC_A2DSensor.h:126
A2DConverter * getFinalConverter() const
Final A2DConverter, updated from the CalFile, and applied after the initial conversion.
Definition DSC_A2DSensor.h:117
void getDefaultConversion(int ichan, float &intercept, float &slope) const
Get the default linear conversion for a channel.
Definition DSC_A2DSensor.cc:213
A2DConverter * _initialConverter
Definition DSC_A2DSensor.h:124
Support for the D2A device on a Diamond DMMAT card.
Definition DSC_AnalogOut.h:42
The essential core classes of nidas.
Definition A2DConverter.h:31
Root namespace for the NCAR In-Situ Data Acquisition Software.
Definition A2DConverter.h:31