LRAUV  revA
Aanderaa_O2.h
Go to the documentation of this file.
1 
12 #ifndef AANDERAA_O2_H
13 #define AANDERAA_O2_H
14 
15 #include "Aanderaa_O2IF.h"
16 
18 #include "io/LoadControl.h"
19 #include "io/UartStream.h"
20 #include "logger/Logger.h"
21 
23 
31 {
32 public:
33 
34  Aanderaa_O2( const Module* module );
35 
36  virtual ~Aanderaa_O2();
37 
38  virtual void run();
39 
42  virtual RunState start();
43 
45  virtual RunState starting();
46 
48  virtual RunState pause();
49 
51  virtual RunState paused();
52 
54  virtual RunState resume();
55 
57  virtual RunState resuming();
58 
60  virtual RunState runnable();
61 
63  virtual RunState resetting()
64  {
65  return start();
66  }
67 
69  virtual RunState stop();
70 
71  virtual RunState stopping();
72 
74  virtual RunState stopped();
75 
76  void uninitialize( void );
77 
79  virtual ConfigURI getConfigURI( ConfigOption configOption ) const;
80 
81 private:
82  // Note that the copy constructor below is private and not given a body.
83  // Any attempt to call it will return a compiler error.
84  Aanderaa_O2( const Aanderaa_O2& old ); // disallow copy constructor
85 
86  // Parses the information sent back
87  bool parse();
88 
89  // returns true if data is requested from one of the readers
90  bool isDataRequested();
91 
92  // Sends data to DataWriters
93  void writeData();
94 
95  // Instance of load controller
97 
98 #define MAX_DEVICE_RESPONSE ( 255U )
99 
100  // Stores the current response from the device
102 
105 
108 
111 
114 
119 
120  // model number of this device
122 
124  bool debug_;
125 
126  // We have told the instrument to start sampling
128 
129  // Output variable
131 
132  // Output variable
134 
135  // Output variable
137 
138 };
139 #endif /*AANDERAA_O2_H*/
float temperature_
Definition: Aanderaa_O2.h:130
virtual ~Aanderaa_O2()
Definition: Aanderaa_O2.cpp:52
virtual RunState runnable()
Should eventually follow a START request or RESETTING.
Definition: Aanderaa_O2.cpp:186
Contains the SyncComponent class definition.
void uninitialize(void)
Provide a space for uninitialization.
Definition: Aanderaa_O2.cpp:337
Contains the LoadControl class declaration.
Abstract Base class for components that collect data for use later in the computation cycle...
Definition: SyncComponent.h:172
A DataAccessor that writes values to the Slate via its associated DataElement.
Definition: UniversalDataWriter.h:24
virtual RunState stopping()
Might follow a STOP request.
Definition: Aanderaa_O2.cpp:277
virtual RunState start()
Do what needs to be done to run Similar to initialize, in old init/run/uninit sequence.
Definition: Aanderaa_O2.cpp:63
Timespan period_
How often data should spit out.
Definition: Aanderaa_O2.h:113
RunState
Definition: Component.h:115
Contains the UartStream class declaration.
UniversalDataWriter * o2ConcentrationWriter_
Definition: Aanderaa_O2.h:117
Timespan class, represents a delta of time.
Definition: Timestamp.h:248
virtual RunState resuming()
Might follow a PAUSE...RESUME sequence.
Definition: Aanderaa_O2.cpp:179
Aanderaa_O2(const Module *module)
Definition: Aanderaa_O2.cpp:18
virtual RunState stop()
Initial state – can be later followed by START.
Definition: Aanderaa_O2.cpp:260
float airSaturation_
Definition: Aanderaa_O2.h:136
virtual RunState paused()
Should eventually follow a PAUSE request: should set continueTime.
Definition: Aanderaa_O2.cpp:161
Implements both InStream and OutStream for the LPC3XXX Standard UART.
Definition: UartStream.h:26
A DataAccessor that writes values to the Slate via its associated DataElement.
Definition: DataWriter.h:27
DataWriter * airSaturationWriter_
Definition: Aanderaa_O2.h:118
Definition: ElementURI.h:166
LoadControl loadControl_
Definition: Aanderaa_O2.h:96
Module is the abstract base class for a collection of Component objects that can be contained in a lo...
Definition: Module.h:45
bool debug_
Debugging outputs.
Definition: Aanderaa_O2.h:124
Replacement for standard template class string.
Definition: Str.h:12
Timespan timeout_
Timeout for getting data.
Definition: Aanderaa_O2.h:110
void writeData()
Definition: Aanderaa_O2.cpp:319
DataWriter * temperatureWriter_
Outputs to slate.
Definition: Aanderaa_O2.h:116
bool startCommanded_
Definition: Aanderaa_O2.h:127
Timestamp startTime_
Time data request started.
Definition: Aanderaa_O2.h:107
This class allows one to control loads on a load controller channel.
Definition: LoadControl.h:24
Provides software interface to the Aanderaa O2 sensor.
Definition: Aanderaa_O2.h:30
bool isDataRequested()
Definition: Aanderaa_O2.cpp:330
#define MAX_DEVICE_RESPONSE
Definition: Aanderaa_O2.h:98
virtual ConfigURI getConfigURI(ConfigOption configOption) const
Should return [myNamespace]::SIMULATE_HARDWARE, or [myNamespace]::POWER, etc.
Definition: Aanderaa_O2.cpp:353
Contains the Logger class definition.
float o2Concentration_
Definition: Aanderaa_O2.h:133
virtual RunState resetting()
Might occur in case of Error.
Definition: Aanderaa_O2.h:63
virtual RunState resume()
Resume from PAUSE.
Definition: Aanderaa_O2.cpp:172
virtual RunState starting()
Might follow a STOP...START sequence.
Definition: Aanderaa_O2.cpp:96
Str model_
Definition: Aanderaa_O2.h:121
virtual RunState stopped()
Initial state – can be later followed by START.
Definition: Aanderaa_O2.cpp:294
Specifies the interface details for the Aanderaa_O2 component in the ScienceModule.
bool parse()
Definition: Aanderaa_O2.cpp:305
UartStream uart_
Holds the communications device.
Definition: Aanderaa_O2.h:104
virtual void run()
The actual "payload" of the component.
Definition: Aanderaa_O2.cpp:56
ConfigOption
Definition: Component.h:456
virtual RunState pause()
Pause for a short period (indicated by pauseTime)
Definition: Aanderaa_O2.cpp:138
char deviceResponse_[MAX_DEVICE_RESPONSE+1]
Definition: Aanderaa_O2.h:101
Represents absolute times.
Definition: Timestamp.h:31