nidas v1.2.3
IR104_Relays.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 ** 2011, 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_IR104_RELAYS_H
27#define NIDAS_DYNLD_IR104_RELAYS_H
28
30
32
35#include <nidas/util/BitArray.h>
36
37namespace nidas { namespace dynld {
38
46
47public:
48
50
52
57
62
69 void open(int flags);
70
76 bool process(const nidas::core::Sample*,
77 std::list<const nidas::core::Sample*>& result);
78
84 int getNumOutputs() const
85 {
86 return _noutputs;
87 }
88
94 int getNumInputs() const
95 {
96 return _ninputs;
97 }
98
105 void clearOutputs(const nidas::util::BitArray& which);
106
113 void setOutputs(const nidas::util::BitArray& which);
114
122 void setOutputs(const nidas::util::BitArray& which,
123 const nidas::util::BitArray& val);
124
131
138
139private:
140
145
150
151};
152
153}} // namespace nidas namespace dynld
154
155#endif
DSMSensor provides the basic support for reading, processing and distributing samples from a sensor a...
Definition DSMSensor.h:88
An interface to an IO device.
Definition IODevice.h:42
A scanner of sample data.
Definition SampleScanner.h:74
Interface to a data sample.
Definition Sample.h:190
Support for the digital IO on a Diamond Systems IR104 board.
Definition IR104_Relays.h:45
void setOutputs(const nidas::util::BitArray &which)
Set relays as selected by bits 0-19 of which.
Definition IR104_Relays.cc:104
int _ninputs
How many DIN pins are on this device?
Definition IR104_Relays.h:149
int getNumOutputs() const
Return number of DOUT pins on this device (8).
Definition IR104_Relays.h:84
IR104_Relays()
Definition IR104_Relays.cc:45
void clearOutputs(const nidas::util::BitArray &which)
Unset relays as selected by bits 0-19 of which.
Definition IR104_Relays.cc:116
nidas::core::IODevice * buildIODevice()
Definition IR104_Relays.cc:55
nidas::core::SampleScanner * buildSampleScanner()
Definition IR104_Relays.cc:60
nidas::util::BitArray getOutputs()
Get current settings of relays.
Definition IR104_Relays.cc:143
void open(int flags)
Open the IR104 device.
Definition IR104_Relays.cc:65
nidas::util::BitArray getInputs()
get current settings of inputs.
Definition IR104_Relays.cc:155
bool process(const nidas::core::Sample *, std::list< const nidas::core::Sample * > &result)
Process a raw sample of the relay bit settings.
Definition IR104_Relays.cc:76
int _noutputs
How many DOUT pins are on this device?
Definition IR104_Relays.h:144
~IR104_Relays()
Definition IR104_Relays.cc:51
int getNumInputs() const
Return number of DIN pins on this device (8).
Definition IR104_Relays.h:94
A class for holding bits.
Definition BitArray.h:39
Root namespace for the NCAR In-Situ Data Acquisition Software.
Definition A2DConverter.h:31