Critical Link MityCam SoC Firmware  1.0
Critical Link MityCam SoC Firmware
ControlApplication.h
Go to the documentation of this file.
1 #ifndef CONTROLAPPLICATION_H
2 #define CONTROLAPPLICATION_H
3 
4 #include <list>
5 #include <set>
6 #include <map>
7 #include <functional>
8 #include <vector>
9 
10 #include "Utility/Types.h"
11 #include "Sensors/SensorBoard.h"
14 
15 #include "CameraTypes.h"
16 
17 namespace SocCamera
18 {
19 
36 {
37 public:
39 
41 
47  static std::string getexepath();
48  static std::string getPluginPath();
49 // --- Execution control
56  int start();
57 
62  int wait();
63 
70  int execute();
71 
72 // --- Accessors for created objects.
78 
85 
91  std::list<tcCommandInterface*> getCommandInterface();
92 
97  std::list<tcIOChannel*> getIOChannel();
98 
99 // --- Individual parameter setters.
104  void setSensorBoard(tcSensorBoard *apSensor, bool abSavable = false);
105 
110  void setSensorBoard(int32 value, std::string *apData, bool abSavable = false);
111 
117  void setCommandInterface(int32 value, std::string *data);
118 
124  void setIOChannel(int32 value, std::string *data);
125 
131  int addIOChannel(tcIOChannel *apCh);
132 
138  void setStatusInterface(int32 value, std::string *data = NULL);
139 
140 // --- Group parameter setters
147  bool processCommandLineArguments(int32 argc, char **argv);
148 
153  void setConfig(char* filename);
154 
155  void setTEC(std::string &arTecData);
156 
157  void setTEC(tcPIDControl *apTEC);
158 
159  static void registerSensorFactory(int anId, std::function<tcSensorBoard* (const char*)> apFunc);
160 private:
161  tcSensorBoard* mpSensor;
162  tcIOChannel* mpNextIOChannel;
163  std::list<tcCommandInterface*> mhCommandInterfaces;
164  std::list<tcIOChannel*> mhIOChannels;
165  tcPIDControl *mpTEC;
166 
167  static std::map<int, std::function<tcSensorBoard* (const char*)> > mcSensorFactory;
168  std::vector<void*> mcModulesToClose;
169 
170  void printHelp(int32 argc, char **argv);
171 };
172 
173 }
174 
175 #endif // CONTROLAPPLICATION_H
SocCamera::tcControlApplication::addCommandInterface
int addCommandInterface(tcCommandInterface *apIface)
addCommandInterface add a command interface
Definition: ControlApplication.cpp:357
SocCamera::tcControlApplication::setIOChannel
void setIOChannel(int32 value, std::string *data)
Definition: ControlApplication.cpp:491
SocCamera::tcControlApplication::wait
int wait()
Definition: ControlApplication.cpp:325
SocCamera::tcControlApplication::setSensorBoard
void setSensorBoard(tcSensorBoard *apSensor, bool abSavable=false)
Definition: ControlApplication.cpp:377
int32
int32_t int32
Definition: Types.h:8
SocCamera::tcControlApplication::getexepath
static std::string getexepath()
get the path to the application exe file
Definition: ControlApplication.cpp:158
Types.h
SocCamera::tcControlApplication::getIOChannel
std::list< tcIOChannel * > getIOChannel()
Definition: ControlApplication.cpp:372
SocCamera::tcControlApplication::execute
int execute()
Definition: ControlApplication.cpp:340
SensorBoard.h
SocCamera::tcPIDControl
Definition: PIDControl.h:27
CameraTypes.h
SocCamera::tcControlApplication::setTEC
void setTEC(std::string &arTecData)
Definition: ControlApplication.cpp:656
SocCamera::tcControlApplication::getCommandInterface
std::list< tcCommandInterface * > getCommandInterface()
Definition: ControlApplication.cpp:367
SocCamera::tcControlApplication::tcControlApplication
tcControlApplication()
Definition: ControlApplication.cpp:82
tcIOChannel
Camera Output IO channel management class.
Definition: IOChannel.h:34
SocCamera::tcControlApplication::setStatusInterface
void setStatusInterface(int32 value, std::string *data=NULL)
Definition: ControlApplication.cpp:473
SocCamera::tcControlApplication
Definition: ControlApplication.h:35
StatusReporter.h
CommandInterface.h
This file contains the tcCommandInterface class.
SocCamera
Definition: CameraTypes.h:7
SocCamera::tcControlApplication::setConfig
void setConfig(char *filename)
Definition: ControlApplication.cpp:577
SocCamera::tcControlApplication::registerSensorFactory
static void registerSensorFactory(int anId, std::function< tcSensorBoard *(const char *)> apFunc)
Definition: ControlApplication.cpp:697
SocCamera::tcControlApplication::addIOChannel
int addIOChannel(tcIOChannel *apCh)
addIOChannel add an IO channel to the app
Definition: ControlApplication.cpp:566
SocCamera::tcSensorBoard
Definition: SensorBoard.h:40
SocCamera::tcCommandInterface
Definition: CommandInterface.h:25
SocCamera::tcControlApplication::getPluginPath
static std::string getPluginPath()
locate the plugin directory
Definition: ControlApplication.cpp:713
SocCamera::tcControlApplication::processCommandLineArguments
bool processCommandLineArguments(int32 argc, char **argv)
Definition: ControlApplication.cpp:206
SocCamera::tcControlApplication::setCommandInterface
void setCommandInterface(int32 value, std::string *data)
Definition: ControlApplication.cpp:411
SocCamera::tcControlApplication::~tcControlApplication
~tcControlApplication()
Definition: ControlApplication.cpp:165
SocCamera::tcControlApplication::getSensorBoard
tcSensorBoard * getSensorBoard()
Definition: ControlApplication.cpp:352
SocCamera::tcControlApplication::start
int start()
Definition: ControlApplication.cpp:259