Commit 5334efd4 authored by Georg Auzinger's avatar Georg Auzinger
Browse files

added easylogging to System classes

parent cfcaeff5
......@@ -8,7 +8,7 @@ namespace Ph2_System {
if ( pFilename.find ( ".xml" ) != std::string::npos )
parseHWxml ( pFilename, pBeBoardFWMap, pBoardVector, os );
else
std::cerr << "Could not parse settings file " << pFilename << " - it is not .xml!" << std::endl;
LOG (ERROR) << "Could not parse settings file " << pFilename << " - it is not .xml!" ;
}
void FileParser::parseSettings ( const std::string& pFilename, SettingsMap& pSettingsMap, std::ostream& os)
......@@ -16,7 +16,7 @@ namespace Ph2_System {
if ( pFilename.find ( ".xml" ) != std::string::npos )
parseSettingsxml ( pFilename, pSettingsMap, os );
else
std::cerr << "Could not parse settings file " << pFilename << " - it is not .xm!" << std::endl;
LOG (ERROR) << "Could not parse settings file " << pFilename << " - it is not .xm!" ;
}
......@@ -70,10 +70,10 @@ namespace Ph2_System {
if (!strUhalConfig.empty() )
RegManager::setDummyXml (strUhalConfig);
std::cout << BOLDBLUE << " " << "|" << "----" << "Board Id: " << BOLDYELLOW << cId << BOLDBLUE << " URI: " << BOLDYELLOW << cUri << BOLDBLUE << " Address Table: " << BOLDYELLOW << cAddressTable;
std::cout << BOLDBLUE << " Type: " << BOLDYELLOW << cBoardType << RESET << std::endl;
os << BOLDBLUE << " " << "|" << "----" << "Board Id: " << BOLDYELLOW << cId << BOLDBLUE << " URI: " << BOLDYELLOW << cUri << BOLDBLUE << " Address Table: " << BOLDYELLOW << cAddressTable << std::endl;
os << BOLDBLUE << " Type: " << BOLDYELLOW << cBoardType << RESET << std::endl;
//else std::cout << BOLDBLUE << " " << "|" << "----" << "Board Id: " << BOLDYELLOW << cId << BOLDBLUE << " Type: " << BOLDYELLOW << cBoardType << RESET << std::endl;
//else LOG(INFO) << BOLDBLUE << " " << "|" << "----" << "Board Id: " << BOLDYELLOW << cId << BOLDBLUE << " Type: " << BOLDYELLOW << cBoardType << RESET ;
// Iterate over the BeBoardRegister Nodes
for ( pugi::xml_node cBeBoardRegNode = cBeBoardNode.child ( "Register" ); cBeBoardRegNode; cBeBoardRegNode = cBeBoardRegNode.next_sibling() )
......@@ -101,7 +101,7 @@ namespace Ph2_System {
{
bool cStatus = cModuleNode.attribute ( "Status" ).as_bool();
//std::cout << cStatus << std::endl;
//LOG(INFO) << cStatus ;
if ( cStatus )
{
os << BOLDCYAN << "|" << " " << "|" << "----" << cModuleNode.name() << " "
......
......@@ -26,6 +26,7 @@
#include "../Utils/picojson.h"
#include "../Utils/pugixml.hpp"
#include "../Utils/ConsoleColor.h"
#include "../Utils/easylogging++.h"
#include <iostream>
#include <vector>
#include <map>
......@@ -56,8 +57,8 @@ namespace Ph2_System {
FileParser() {}
~FileParser() {}
void parseHW ( const std::string& pFilename, BeBoardFWMap& pBeBoardFWMap, BeBoardVec& pBoardVector, std::ostream& os = std::cout );
void parseSettings ( const std::string& pFilename, SettingsMap& pSettingsMap, std::ostream& os = std::cout );
void parseHW ( const std::string& pFilename, BeBoardFWMap& pBeBoardFWMap, BeBoardVec& pBoardVector, std::ostream& os );
void parseSettings ( const std::string& pFilename, SettingsMap& pSettingsMap, std::ostream& os );
protected:
......@@ -88,17 +89,17 @@ namespace Ph2_System {
* \param pFilename : HW Description file
*\param os : ostream to dump output
*/
void parseHWxml ( const std::string& pFilename, BeBoardFWMap& pBeBoardFWMap, BeBoardVec& pBoardVector, std::ostream& os = std::cout );
void parseHWxml ( const std::string& pFilename, BeBoardFWMap& pBeBoardFWMap, BeBoardVec& pBoardVector, std::ostream& os );
/*!
* \brief Initialize the hardware via JSON config file
* \param pFilename : HW Description file
*\param os : ostream to dump output
*/
void parseSettingsxml ( const std::string& pFilename, SettingsMap& pSettingsMap, std::ostream& os = std::cout);
void parseSettingsxml ( const std::string& pFilename, SettingsMap& pSettingsMap, std::ostream& os );
BeBoard* parseBeBoard (pugi::xml_node pNode, BeBoardVec& pBoardVector, std::ostream& os = std::cout);
void parseRegister (pugi::xml_node pNode, BeBoard* pBoard, std::ostream& os = std::cout);
void parseCbc (pugi::xml_node pModuleNode, Module* pModule, std::ostream& os = std::cout);
BeBoard* parseBeBoard (pugi::xml_node pNode, BeBoardVec& pBoardVector, std::ostream& os );
void parseRegister (pugi::xml_node pNode, BeBoard* pBoard, std::ostream& os );
void parseCbc (pugi::xml_node pModuleNode, Module* pModule, std::ostream& os );
/*! \brief Expand environment variables in string
* \param s input string
* \return Result with variables expanded */
......
......@@ -130,7 +130,7 @@ namespace Ph2_System {
void SystemController::initializeFileHandler()
{
std::cout << BOLDBLUE << "Saving binary raw data to: " << fRawFileName << ".fedId" << RESET << std::endl;
LOG (INFO) << BOLDBLUE << "Saving binary raw data to: " << fRawFileName << ".fedId" << RESET ;
// here would be the ideal position to fill the file Header and call openFile when in read mode
for (const auto& cBoard : fBoardVector)
......
......@@ -26,6 +26,7 @@
#include "../Utils/Utilities.h"
#include "../Utils/FileHandler.h"
#include "../Utils/ConsoleColor.h"
#include "../Utils/easylogging++.h"
#include <iostream>
#include <vector>
#include <map>
......@@ -133,17 +134,17 @@ namespace Ph2_System {
* \param pFilename : HW Description file
*\param os : ostream to dump output
*/
void InitializeHw ( const std::string& pFilename, std::ostream& os = std::cout );
void InitializeHw ( const std::string& pFilename, std::ostream& os );
/*!
* \brief Initialize the settings
* \param pFilename : settings file
*\param os : ostream to dump output
*/
void InitializeSettings ( const std::string& pFilename, std::ostream& os = std::cout );
void InitializeSettings ( const std::string& pFilename, std::ostream& os );
/*!
* \brief Configure the Hardware with XML file indicated values
*/
void ConfigureHw ( std::ostream& os = std::cout, bool bIgnoreI2c = false );
void ConfigureHw ( std::ostream& os , bool bIgnoreI2c = false );
/*!
* \brief Run a DAQ
* \param pBeBoard
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment