config.cpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include "apps/fountain/config.h"
00027
00028 #include <iostream>
00029 #include <utils/utils.h>
00030
00031 using namespace std;
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 RCSoftXFountainConfig::RCSoftXFountainConfig(CConfigReader *configFile)
00042 {
00043
00044 string errmsg;
00045
00046 m_pXMLConfigFile = configFile;
00047 m_sPrefix = "";
00048
00049 if (m_pXMLConfigFile != NULL) {
00050 m_sPrefix = "<RCSoftConfigFile><Lowlevel><FireVision><Fountain>";
00051
00052 if (!m_pXMLConfigFile->GetNodeValue(m_sPrefix+"<FountainPort>", FountainPort, errmsg)) {
00053 cout << endl << "** XML ERROR while trying to fetch "+m_sPrefix+"<FountainPort>" << endl << flush;
00054 cout << __FUNCTION__ << ": " << __FILE__ << "[" << __LINE__ << "]" << endl << flush;
00055 cout << "Error message from ConfigReader was: " << errmsg << endl;
00056 exit(1);
00057 }
00058 cout << m_sPrefix << "<FountainPort>: " << toString(FountainPort) << endl << flush;
00059
00060 if (!m_pXMLConfigFile->GetNodeValue(m_sPrefix+"<ImageDelay>", ImageDelay, errmsg)) {
00061 cout << endl << "** XML ERROR while trying to fetch "+m_sPrefix+"<ImageDelay>" << endl << flush;
00062 cout << __FUNCTION__ << ": " << __FILE__ << "[" << __LINE__ << "]" << endl << flush;
00063 cout << "Error message from ConfigReader was: " << errmsg << endl;
00064 exit(1);
00065 }
00066 cout << m_sPrefix << "<ImageDelay>: " << toString(ImageDelay) << endl << flush;
00067
00068 } else {
00069 cout << "*** XML ERROR: No XMLConfigReader given to Config Object. Did NOT read config!" << endl << flush;
00070 exit(2);
00071 }
00072
00073 }
00074
00075
00076 RCSoftXFountainConfig::~RCSoftXFountainConfig()
00077 {
00078 }
00079
00080
00081