LRAUV  revA
SCPI.h
Go to the documentation of this file.
1 
12 #ifndef SCPI_H
13 #define SCPI_H
14 
16 #include "io/UartStream.h"
17 #include "io/LoadControl.h"
18 #include "logger/Logger.h"
19 
21 
28 class SCPI : public SyncSensorComponent
29 {
30 public:
31 
32  SCPI( const Module* module );
33 
34  virtual ~SCPI();
35 
36  virtual void run();
37 
40  virtual RunState start();
41 
43  virtual RunState starting();
44 
46  virtual RunState pause();
47 
49  virtual RunState paused();
50 
52  virtual RunState resume();
53 
55  virtual RunState resuming();
56 
58  virtual RunState runnable();
59 
61  virtual RunState resetting()
62  {
63  return start();
64  }
65 
67  virtual RunState stop();
68 
69  virtual RunState stopping();
70 
72  virtual RunState stopped();
73 
75  virtual ConfigURI getConfigURI( ConfigOption configOption ) const;
76 
77 private:
78  // Note that the copy constructor below is private and not given a body.
79  // Any attempt to call it will return a compiler error.
80  SCPI( const SCPI& old ); // disallow copy constructor
81 
82  //*------------------- vehicle parameters --------------------------*/
83 
85 
87 
88  // initialize vehicle config variables
89  bool loadParams( void );
90  bool readConfig( void );
91 
92  // returns true if data is requested from one of the readers
93  bool isDataRequested();
94 
95  // indicates whether things are ok to run
96  bool ok_;
97 
98  // Power for the Freewave
100 
103 
106 
108  bool debug_;
109 
111  bool sampling_;
112 
113  // Holds the communications device
115 
116  // Stores the current response from SCPI
117  char deviceResponse_[396];
118 
120 
122 
123 };
124 #endif /*SCPI_H*/
virtual ConfigURI getConfigURI(ConfigOption configOption) const
Should return [myNamespace]::SIMULATE_HARDWARE, or [myNamespace]::POWER, etc.
Definition: SCPI.cpp:309
Contains the SyncComponent class definition.
Timespan powerOnTimeout_
Timeout for powering down/up.
Definition: SCPI.h:105
Contains the LoadControl class declaration.
char deviceResponse_[396]
Definition: SCPI.h:117
bool isDataRequested()
Definition: SCPI.cpp:314
Abstract Base class for components that collect data for use later in the computation cycle...
Definition: SyncComponent.h:172
Timestamp startTime_
Time data request started.
Definition: SCPI.h:102
Provides software interface to the Self Contained Plankton Imager camera.
Definition: SCPI.h:28
A DataAccessor that writes values to the Slate via its associated DataElement.
Definition: UniversalDataWriter.h:24
bool sampling_
A sample is in process.
Definition: SCPI.h:111
RunState
Definition: Component.h:115
Contains the UartStream class declaration.
virtual void run()
The actual "payload" of the component.
Definition: SCPI.cpp:65
Timespan class, represents a delta of time.
Definition: Timestamp.h:248
virtual RunState resume()
Resume from PAUSE.
Definition: SCPI.cpp:155
UartStream uart_
Definition: SCPI.h:114
virtual RunState stopped()
Initial state – can be later followed by START.
Definition: SCPI.cpp:297
Implements both InStream and OutStream for the LPC3XXX Standard UART.
Definition: UartStream.h:26
LoadControl loadControl_
Definition: SCPI.h:99
A DataAccessor that writes values to the Slate via its associated DataElement.
Definition: DataWriter.h:27
Definition: ElementURI.h:166
virtual RunState paused()
Should eventually follow a PAUSE request: should set continueTime.
Definition: SCPI.cpp:149
DataWriter * samplingSCPIDataWriter_
Definition: SCPI.h:119
virtual RunState start()
Do what needs to be done to run Similar to initialize, in old init/run/uninit sequence.
Definition: SCPI.cpp:72
Module is the abstract base class for a collection of Component objects that can be contained in a lo...
Definition: Module.h:45
bool readConfig(void)
Definition: SCPI.cpp:55
virtual RunState starting()
Might follow a STOP...START sequence.
Definition: SCPI.cpp:110
This class allows one to control loads on a load controller channel.
Definition: LoadControl.h:24
Definition: ConfigReader.h:13
bool ok_
Definition: SCPI.h:96
Contains the Logger class definition.
virtual ~SCPI()
Definition: SCPI.cpp:45
bool loadParams(void)
Definition: SCPI.cpp:50
Timespan sampleTime_
Definition: SCPI.h:84
virtual RunState runnable()
Should eventually follow a START request or RESETTING.
Definition: SCPI.cpp:168
SCPI(const Module *module)
Definition: SCPI.cpp:21
virtual RunState stopping()
Might follow a STOP request.
Definition: SCPI.cpp:279
virtual RunState resuming()
Might follow a PAUSE...RESUME sequence.
Definition: SCPI.cpp:161
bool debug_
Debugging outputs.
Definition: SCPI.h:108
ConfigOption
Definition: Component.h:456
ConfigReader * sampleTimeCfgReader_
Definition: SCPI.h:121
virtual RunState pause()
Pause for a short period (indicated by pauseTime)
Definition: SCPI.cpp:141
virtual RunState resetting()
Might occur in case of Error.
Definition: SCPI.h:61
Represents absolute times.
Definition: Timestamp.h:31
virtual RunState stop()
Initial state – can be later followed by START.
Definition: SCPI.cpp:260