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:
parent
556aee250a
commit
245ed6df64
@ -1,4 +1,8 @@
|
|||||||
#include "HHBase.h"
|
#include "HHBase.h"
|
||||||
|
#include <iostream>
|
||||||
|
#include <ifstream.h>
|
||||||
|
#include <stdexcept>
|
||||||
|
#include <map>
|
||||||
HHBase::HHBase():
|
HHBase::HHBase():
|
||||||
hHBot(new HHRobot()){
|
hHBot(new HHRobot()){
|
||||||
printf("Done\n");
|
printf("Done\n");
|
||||||
@ -10,6 +14,16 @@ void HHBase::RobotInit(){
|
|||||||
printf("***UNPLUG AND REPLUG THE JOYSTICKS***\n");
|
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::DisabledInit(){}
|
||||||
void HHBase::AutonomousInit(){}
|
void HHBase::AutonomousInit(){}
|
||||||
void HHBase::TeleopInit(){}
|
void HHBase::TeleopInit(){}
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
#include "Subsystems/Compressor.h"
|
#include "Subsystems/Compressor.h"
|
||||||
#include "Subsystems/Sonar.h"
|
#include "Subsystems/Sonar.h"
|
||||||
#include "Subsystems/Dashboard.h"
|
#include "Subsystems/Dashboard.h"
|
||||||
|
#include <string>
|
||||||
//Because this is the first header to be included, classes need to be declared here
|
//Because this is the first header to be included, classes need to be declared here
|
||||||
class HHRobot;
|
class HHRobot;
|
||||||
class HHShooter;
|
class HHShooter;
|
||||||
|
Loading…
Reference in New Issue
Block a user