nidas v1.2.3
DSC_AnalogOut.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#ifndef NIDAS_DYNLD_DSC_ANALOG_OUT_H
27#define NIDAS_DYNLD_DSC_ANALOG_OUT_H
28
30
34
35#include <vector>
36
37namespace nidas { namespace dynld {
38
43
44public:
45
47
49
50 void setDeviceName(const std::string& val)
51 {
52 _devName = val;
53 }
54
55 const std::string& getDeviceName() const
56 {
57 return _devName;
58 }
59
60 const std::string& getName() const
61 {
62 return _devName;
63 }
64
65 int getFd() const { return _fd; }
66
72 void open();
73
79 void close();
80
86 int getNumOutputs() const
87 {
88 return _noutputs;
89 }
90
94 float getMinVoltage(int i) const;
95
99 float getMaxVoltage(int i) const;
100
113 void setVoltage(int which, float val);
114
127 void setVoltages(const std::vector<int>& which,
128 const std::vector<float>& val);
129
130 void clearVoltages();
131
132
133private:
134
135 std::string _devName;
136
140 int _fd;
141
146
152};
153
154}} // namespace nidas namespace dynld
155
156#endif
Support for the D2A device on a Diamond DMMAT card.
Definition DSC_AnalogOut.h:42
float getMinVoltage(int i) const
Return the minimum setable voltage of an output.
Definition DSC_AnalogOut.cc:78
const std::string & getName() const
Definition DSC_AnalogOut.h:60
int getFd() const
Definition DSC_AnalogOut.h:65
int getNumOutputs() const
Return number of VOUT pins on this device.
Definition DSC_AnalogOut.h:86
~DSC_AnalogOut()
Definition DSC_AnalogOut.cc:48
DSC_AnalogOut()
Definition DSC_AnalogOut.cc:43
void open()
Open the D2A.
Definition DSC_AnalogOut.cc:58
void close()
Close the D2A.
Definition DSC_AnalogOut.cc:70
void setDeviceName(const std::string &val)
Definition DSC_AnalogOut.h:50
const std::string & getDeviceName() const
Definition DSC_AnalogOut.h:55
void setVoltage(int which, float val)
Set a voltage on an output.
Definition DSC_AnalogOut.cc:145
int _noutputs
How many VOUT pins are on this device?
Definition DSC_AnalogOut.h:145
void setVoltages(const std::vector< int > &which, const std::vector< float > &val)
Set one or more outputs.
Definition DSC_AnalogOut.cc:100
float getMaxVoltage(int i) const
Return the maximum setable voltage of an output.
Definition DSC_AnalogOut.cc:84
int _fd
The file descriptor of this device.
Definition DSC_AnalogOut.h:140
void clearVoltages()
Definition DSC_AnalogOut.cc:90
std::string _devName
Definition DSC_AnalogOut.h:135
struct DMMAT_D2A_Conversion _conv
Linear parameters for converting a voltage to an integer count, which is sent to the device.
Definition DSC_AnalogOut.h:151
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
Root namespace for the NCAR In-Situ Data Acquisition Software.
Definition A2DConverter.h:31
Structure describing the linear relation of counts and D2A voltage.
Definition dmd_mmat.h:179