Merge "Fixed post4066 bug: Prestart() inaccessible."

This commit is contained in:
Fred Silberberg (WPI)
2014-12-17 14:19:03 -08:00
committed by Gerrit Code Review
2 changed files with 9 additions and 2 deletions

View File

@@ -16,8 +16,7 @@ class DriverStation;
if (!HALInitialize()){std::cerr<<"FATAL ERROR: HAL could not be initialized"<<std::endl;return -1;} \
HALReport(HALUsageReporting::kResourceType_Language, HALUsageReporting::kLanguage_CPlusPlus); \
_ClassName_ *robot = new _ClassName_(); \
robot->Prestart();\
robot->StartCompetition(); \
RobotBase::robotSetup(robot); \
return 0; \
}
@@ -45,6 +44,8 @@ public:
static void startRobotTask(FUNCPTR factory);
static void robotTask(FUNCPTR factory, Task *task);
virtual void StartCompetition() = 0;
static void robotSetup(RobotBase *robot);
protected:
virtual ~RobotBase();

View File

@@ -37,6 +37,12 @@ RobotBase &RobotBase::getInstance()
return *m_instance;
}
void RobotBase::robotSetup(RobotBase *robot)
{
robot->Prestart();
robot->StartCompetition();
}
/**
* Constructor for a generic robot program.
* User code should be placed in the constructor that runs before the Autonomous or Operator