LRAUV  revA
ISUS.h
Go to the documentation of this file.
1 
12 #ifndef ISUS_H
13 #define ISUS_H
14 
15 #include "ISUSIF.h"
16 
18 #include "io/LoadControl.h"
19 #include "io/UartStream.h"
20 #include "logger/Logger.h"
21 
23 
30 class ISUS : public SyncSensorComponent
31 {
32 public:
33 
34  ISUS( const Module* module );
35 
36  virtual ~ISUS();
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  ISUS( const ISUS& old ); // disallow copy constructor
85 
86  // Parses the header information sent back
87  bool parseHeader();
88 
89  // Parses the information sent back
90  bool parse( char *data );
91 
92  // returns true if data is requested from one of the readers
93  bool isDataRequested();
94 
95  // Sends data to DataWriters
96  void writeData();
97 
98  // Queries the LCBs for status
99  bool logVoltageAndCurrent();
100 
101  // Calculates the crc
102  unsigned short fCrc16Bit( const unsigned char* msg );
103 
104 #define MAX_ISUS_RESPONSE ( 2096U )
105 
106  // Stores the current response from the device
108 
111 
114 
117 
121 
124 
125  // For CTD data
129 
133 
134 
136  float nitrate_;
137 
138  char* dateString_;
139 
141  bool debug_;
142 
143 };
144 #endif /*ISUS_H*/
virtual ~ISUS()
Definition: ISUS.cpp:111
char deviceResponse_[MAX_ISUS_RESPONSE+1]
Definition: ISUS.h:107
Contains the SyncComponent class definition.
Timespan timeout_
Timeout for getting data and powering up.
Definition: ISUS.h:119
float nitrate_
Definition: ISUS.h:136
Contains the LoadControl class declaration.
LoadControl loadControl_
Power and comms in this case.
Definition: ISUS.h:113
virtual RunState stopping()
Might follow a STOP request.
Definition: ISUS.cpp:340
Abstract Base class for components that collect data for use later in the computation cycle...
Definition: SyncComponent.h:172
virtual RunState starting()
Might follow a STOP...START sequence.
Definition: ISUS.cpp:171
bool debug_
Debugging outputs.
Definition: ISUS.h:141
A DataAccessor that reads values from the Slate Contains a default dataValue that must not be NULL...
Definition: DataReader.h:30
A DataAccessor that writes values to the Slate via its associated DataElement.
Definition: UniversalDataWriter.h:24
virtual RunState resuming()
Might follow a PAUSE...RESUME sequence.
Definition: ISUS.cpp:242
RunState
Definition: Component.h:115
bool logVoltageAndCurrent()
Definition: ISUS.cpp:446
Contains the UartStream class declaration.
virtual RunState pause()
Pause for a short period (indicated by pauseTime)
Definition: ISUS.cpp:217
Timespan class, represents a delta of time.
Definition: Timestamp.h:248
bool parseHeader()
Definition: ISUS.cpp:368
unsigned short fCrc16Bit(const unsigned char *msg)
Definition: ISUS.cpp:513
virtual RunState stop()
Initial state – can be later followed by START.
Definition: ISUS.cpp:309
virtual RunState runnable()
Should eventually follow a START request or RESETTING.
Definition: ISUS.cpp:250
DataReader * depthReader_
Definition: ISUS.h:128
virtual ConfigURI getConfigURI(ConfigOption configOption) const
Should return [myNamespace]::SIMULATE_HARDWARE, or [myNamespace]::POWER, etc.
Definition: ISUS.cpp:500
Timespan dataTimeout_
Definition: ISUS.h:119
Implements both InStream and OutStream for the LPC3XXX Standard UART.
Definition: UartStream.h:26
virtual RunState paused()
Should eventually follow a PAUSE request: should set continueTime.
Definition: ISUS.cpp:226
A DataAccessor that writes values to the Slate via its associated DataElement.
Definition: DataWriter.h:27
Specifies the interface details for the ISUS component in the ScienceModule.
Definition: ElementURI.h:166
Timestamp isusDateString_
Definition: ISUS.h:116
DataReader * salinityReader_
Definition: ISUS.h:126
DataReader * temperatureReader_
Definition: ISUS.h:127
Module is the abstract base class for a collection of Component objects that can be contained in a lo...
Definition: Module.h:45
virtual RunState resume()
Resume from PAUSE.
Definition: ISUS.cpp:234
This class allows one to control loads on a load controller channel.
Definition: LoadControl.h:24
virtual RunState resetting()
Might occur in case of Error.
Definition: ISUS.h:63
Timestamp startTime_
Time data request started.
Definition: ISUS.h:116
DataWriter * dateStringWriter_
Outputs to slate.
Definition: ISUS.h:131
UniversalDataWriter * nitrateWriter_
Definition: ISUS.h:132
void uninitialize(void)
Provide a space for uninitialization.
Definition: ISUS.cpp:478
Contains the Logger class definition.
UartStream uart_
Holds the communications device.
Definition: ISUS.h:110
virtual RunState start()
Do what needs to be done to run Similar to initialize, in old init/run/uninit sequence.
Definition: ISUS.cpp:122
#define MAX_ISUS_RESPONSE
Definition: ISUS.h:104
Provides software interface to the ISUS nitrate sensor.
Definition: ISUS.h:30
char * dateString_
Definition: ISUS.h:138
float nitrateAccuracy_
Definition: ISUS.h:135
ISUS(const Module *module)
Definition: ISUS.cpp:75
bool parse(char *data)
Definition: ISUS.cpp:376
void writeData()
Definition: ISUS.cpp:439
Timespan period_
How often data should spit out.
Definition: ISUS.h:123
bool isDataRequested()
Definition: ISUS.cpp:471
Timespan poTimeout_
Definition: ISUS.h:120
ConfigOption
Definition: Component.h:456
virtual RunState stopped()
Initial state – can be later followed by START.
Definition: ISUS.cpp:357
Represents absolute times.
Definition: Timestamp.h:31
Timestamp dataTime_
Definition: ISUS.h:116
virtual void run()
The actual "payload" of the component.
Definition: ISUS.cpp:115