2
0
mirror of https://github.com/team2059/Zaphod synced 2024-12-18 20:12:28 -05:00

Trying to add config file suport... (Not working)

This commit is contained in:
Austen Adler 2014-08-31 16:56:28 -04:00
parent 556aee250a
commit 245ed6df64
2 changed files with 15 additions and 0 deletions

View File

@ -1,4 +1,8 @@
#include "HHBase.h"
#include <iostream>
#include <ifstream.h>
#include <stdexcept>
#include <map>
HHBase::HHBase():
hHBot(new HHRobot()){
printf("Done\n");
@ -10,6 +14,16 @@ void HHBase::RobotInit(){
printf("***UNPLUG AND REPLUG THE JOYSTICKS***\n");
}
}
//Config testing
void parse(std::ifstream & cfgfile){
std::map<std::string, std::string> options;
std::string id, eq, val;
while(cfgfile >> id >> eq >> val){
if (id[0] == '#') continue;
if (eq != "=") throw std::runtime_error("Parse error");
options[id] = val;
}
}
void HHBase::DisabledInit(){}
void HHBase::AutonomousInit(){}
void HHBase::TeleopInit(){}

View File

@ -8,6 +8,7 @@
#include "Subsystems/Compressor.h"
#include "Subsystems/Sonar.h"
#include "Subsystems/Dashboard.h"
#include <string>
//Because this is the first header to be included, classes need to be declared here
class HHRobot;
class HHShooter;