nidas  v1.2-1520
GOESXmtr.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 
27 #ifndef NIDAS_DYNLD_ISFF_GOESXMTR_H
28 #define NIDAS_DYNLD_ISFF_GOESXMTR_H
29 
30 #include <nidas/core/IOChannel.h>
31 #include <nidas/core/SampleTag.h>
32 #include <nidas/util/SerialPort.h>
33 #include <nidas/util/UTime.h>
34 
35 #include <string>
36 #include <iostream>
37 #include <vector>
38 
39 namespace nidas { namespace dynld { namespace isff {
40 
41 using namespace nidas::core;
42 
47 class GOESXmtr: public IOChannel {
48 
49 public:
50 
54  GOESXmtr();
55 
59  GOESXmtr(const GOESXmtr&);
60 
64  virtual ~GOESXmtr();
65 
66  const std::string& getName() const
67  {
68  return _port.getName();
69  }
70 
71  void setName(const std::string& val)
72  {
73  _port.setName(val);
74  }
75 
76  void setId(unsigned long val)
77  {
78  _id = val;
79  }
80 
81  unsigned long getId() const
82  {
83  return _id;
84  }
85 
86  void setChannel(int val)
87  {
88  _channel = val;
89  }
90 
91  int getChannel() const
92  {
93  return _channel;
94  }
95 
100  void setXmitInterval(long val)
101  {
102  _xmitInterval = val;
103  }
104 
105  int getXmitInterval() const
106  {
107  return _xmitInterval;
108  }
109 
114  void setXmitOffset(long val)
115  {
116  _xmitOffset = val;
117  }
118 
119  int getXmitOffset() const
120  {
121  return _xmitOffset;
122  }
123 
128  virtual void setRFBaud(long val) throw(nidas::util::InvalidParameterException) = 0;
129 
130  virtual int getRFBaud() const = 0;
131 
135  void requestConnection(IOChannelRequester* rqstr)
137 
141  IOChannel* connect() throw(nidas::util::IOException);
142 
143  void setNonBlocking(bool val __attribute__ ((unused)) ) throw(nidas::util::IOException)
144  {
145  // ignore for now.
146  }
147 
148  bool isNonBlocking() const throw(nidas::util::IOException)
149  {
150  return false;
151  }
152 
153  virtual void open() throw(nidas::util::IOException);
154 
158  virtual void init() throw(nidas::util::IOException) = 0;
159 
163  virtual void transmitData(const nidas::util::UTime& at,
164  int configid,const Sample*) throw (nidas::util::IOException) = 0;
165 
166  virtual unsigned long checkId() throw(nidas::util::IOException) = 0;
167 
172  virtual int checkClock() throw(nidas::util::IOException) = 0;
173 
174  virtual void reset() throw(nidas::util::IOException) = 0;
175 
179  virtual void printStatus() throw() = 0;
180 
181  void flush() throw (nidas::util::IOException)
182  {
183  _port.flushBoth();
184  }
185 
186  void close() throw (nidas::util::IOException) {
187  _port.close();
188  }
189 
190  int getFd() const
191  {
192  return _port.getFd();
193  }
194 
195  void setStatusFile(const std::string& val)
196  {
197  _statusFile = val;
198  }
199 
200  const std::string& getStatusFile() const {
201  return _statusFile;
202  }
203 
204  void fromDOMElement(const xercesc::DOMElement* node)
206 
207 protected:
208 
210 
211 private:
212 
213  unsigned long _id;
214 
215  int _channel;
216 
218 
220 
221  std::string _statusFile;
222 
223 };
224 
225 
226 }}} // namespace nidas namespace dynld namespace isff
227 
228 #endif
static int __attribute__((__unused__)) cksum_test(int
unsigned long _id
Definition: GOESXmtr.h:213
void setChannel(int val)
Definition: GOESXmtr.h:86
int getXmitInterval() const
Definition: GOESXmtr.h:105
unsigned long getId() const
Definition: GOESXmtr.h:81
int _channel
Definition: GOESXmtr.h:215
int _xmitOffset
Definition: GOESXmtr.h:219
int getXmitOffset() const
Definition: GOESXmtr.h:119
void setXmitInterval(long val)
Set the transmission interval.
Definition: GOESXmtr.h:100
void setId(unsigned long val)
Definition: GOESXmtr.h:76
std::string _statusFile
Definition: GOESXmtr.h:221
Support for a GOES transmitter, implemented as an IOChannel.
Definition: GOESXmtr.h:47
const std::string & getName() const
Definition: GOESXmtr.h:66
void setName(const std::string &val)
Definition: GOESXmtr.h:71
A channel for Input or Output of data.
Definition: IOChannel.h:64
Definition: SerialPort.h:43
int _xmitInterval
Definition: GOESXmtr.h:217
int getChannel() const
Definition: GOESXmtr.h:91
nidas::util::SerialPort _port
Definition: GOESXmtr.h:209
Interface to a data sample.
Definition: Sample.h:189
Definition: IOException.h:37
void setXmitOffset(long val)
Set the transmission offset.
Definition: GOESXmtr.h:114
void close()
Definition: GOESXmtr.h:186
int getFd() const
Definition: GOESXmtr.h:190
void setStatusFile(const std::string &val)
Definition: GOESXmtr.h:195
Interface for an object that requests connections to Inputs or Outputs.
Definition: IOChannel.h:54
bool isNonBlocking() const
Definition: GOESXmtr.h:148
const std::string & getStatusFile() const
Definition: GOESXmtr.h:200
Definition: InvalidParameterException.h:35