ARA ROOT v3.9 Software

AraWebPlotter/AraWebPlotterConfig.cxx

00001 #include "AraWebPlotterConfig.h"
00002 #include "configLib/configLib.h"
00003 #include "kvpLib/keyValuePair.h"
00004 
00005 #include <iostream>
00006 #include <cstring>
00007 #include <cstdlib>
00008 
00009 
00010 AraWebPlotterConfig::AraWebPlotterConfig()
00011 {
00012   //Default constructor
00013   readConfigFile();
00014 }
00015 
00016 
00017 void AraWebPlotterConfig::readConfigFile()
00018 {
00019  /* Config file thingies */
00020     ConfigErrorCode status=CONFIG_E_OK;
00021     //    int tempNum=12;
00022     //    KvpErrorCode kvpStatus=KVP_E_OK;
00023     char *tempString;
00024 //     kvpReset();
00025 //     status = configLoad ("araWebPlotter.config","input") ;    
00026 //     if(status == CONFIG_E_OK) {       
00027 //      tempString = kvpGetString("eventLinkDir");
00028 //      if(tempString) {
00029 //          strncpy(fEventLinkDir,tempString,FILENAME_MAX);
00030 //      }
00031 //      else {
00032 //          std::cerr << "Couldn't get eventLinkDir" << std::endl;
00033 //          exit(0);
00034 //      }   
00035 
00036 //      tempString = kvpGetString("hkLinkDir");
00037 //      if(tempString) {
00038 //          strncpy(fHkLinkDir,tempString,FILENAME_MAX);
00039 //      }
00040 //      else {
00041 //          std::cerr << "Couldn't get hkLinkDir" << std::endl;
00042 //          exit(0);
00043 //      }
00044 //     }
00045 //     else {
00046 //       std::cerr << "Error reading araWebPlotter.config: " << configErrorString (status)  << std::endl;
00047 //     }
00048 
00049 
00050     kvpReset();
00051     status = configLoad ("araWebPlotter.config","output") ;    
00052     if(status == CONFIG_E_OK) {       
00053         tempString = kvpGetString("rootFileDir");
00054         if(tempString) {
00055             strncpy(fRootFileDir,tempString,FILENAME_MAX);
00056         }
00057         else {
00058             std::cerr << "Couldn't get rootFileDir" << std::endl;
00059             exit(0);
00060         }       
00061 
00062         tempString = kvpGetString("plotDir");
00063         if(tempString) {
00064             strncpy(fPlotDir,tempString,FILENAME_MAX);
00065         }
00066         else {
00067             std::cerr << "Couldn't get plotDir" << std::endl;
00068             exit(0);
00069         }   
00070         fMakeEventPlots=kvpGetInt("makeEventPlots",0);
00071     }
00072     else {
00073       std::cerr << "Error reading araWebPlotter.config: " << configErrorString (status)  << std::endl;
00074 
00075     }
00076 
00077 //     kvpReset();
00078 //     status = configLoad ("araWebPlotter.config","output") ;    
00079 //     if(status == CONFIG_E_OK) {       
00080 //      tempString = kvpGetString("plotDir");
00081 //      if(tempString) {
00082 //          strncpy(plotDir,tempString,FILENAME_MAX);
00083 //      }
00084 //      else {
00085 //          std::cerr << "Couldn't get plotDir" << std::endl;
00086 //          exit(0);
00087 //      }
00088 //      tempString = kvpGetString("dataDir");
00089 //      if(tempString) {
00090 //          strncpy(dataDir,tempString,FILENAME_MAX);
00091 //      }
00092 //      else {
00093 //          std::cerr << "Couldn't get dataDir" << std::endl;
00094 //          exit(0);
00095 //      }
00096 //     }
00097 //     else {
00098 //      eString=configErrorString (status) ;
00099 //      std::cerr << "Error reading araWebPlotter.config: " << eString << std::endl;
00100 //     }
00101 
00102 //     kvpReset();
00103 //     status = configLoad ("araWebPlotter.config","plots") ;    
00104 //     if(status == CONFIG_E_OK) {  
00105 //      makeHeaderPlots=kvpGetInt("makeHeaderPlots",1);
00106 //      makeSurfHkPlots=kvpGetInt("makeSurfHkPlots",1);
00107 //      makeTurfRatePlots=kvpGetInt("makeTurfRatePlots",1);
00108 //      makeMonitorPlots=kvpGetInt("makeMonitorPlots",1);
00109 //      makeHkPlots=kvpGetInt("makeHkPlots",1);
00110 //      makeGpsPlots=kvpGetInt("makeGpsPlots",1);
00111 //      makeEventPlots=kvpGetInt("makeEventPlots",1);
00112 //     }
00113 //     else {
00114 //      eString=configErrorString (status) ;
00115 //      std::cerr << "Error reading araWebPlotter.config: " << eString << std::endl;
00116 //     }
00117     
00118     //    return status;
00119     //    std::cout << fEventLinkDir << "\t" << fHkLinkDir << "\n";
00120 }

Generated on Mon Jun 3 16:10:05 2013 for ARA ROOT v3.9 Software by doxygen 1.4.7