45 lines
623 B
C++
45 lines
623 B
C++
#ifndef _ROBOT_H
|
|
#define _ROBOT_H
|
|
|
|
#include "stdafx.h"
|
|
|
|
class IO_Module;
|
|
class Sensor;
|
|
class Engine;
|
|
|
|
class Robot
|
|
{
|
|
public:
|
|
Robot();
|
|
~Robot();
|
|
|
|
private:
|
|
IO_Module* modules[IO_END];
|
|
|
|
public:
|
|
bool AddModule(IO_Module* newModule);
|
|
|
|
template <class T> T* GetModule(uint8 moduleId)
|
|
{
|
|
return ((T*)modules[moduleId]);
|
|
}
|
|
|
|
bool RemoveModule(uint8 moduleId)
|
|
{
|
|
if(!modules[moduleId])
|
|
return false;
|
|
|
|
delete modules[moduleId];
|
|
modules[moduleId] = NULL;
|
|
|
|
return true;
|
|
}
|
|
|
|
bool RemoveModule(IO_Module* oldModule);
|
|
|
|
void Update();
|
|
|
|
uint16 GetADCValue(uint8 channel);
|
|
};
|
|
|
|
#endif
|