CalibrationNode.cc 1.45 KB
/*
 * CalibrationNode.cc
 *
 *  Created on: Dec 24, 2012
 *      Author: f.casimir
 */

#include "Parameter.hh"
#include "CalibrationNode.hh"

#include "Config.hh"
#include "CalibrationInfoWriter.hh"
#include "ServicesServer.hh"

using namespace AMDA::Parameters;

namespace AMDA {
namespace XMLParameterConfigurator {

	CalibrationNode::CalibrationNode() : NodeCfg() {
	}

	CalibrationNode::~CalibrationNode() {
	}

	void CalibrationNode::proceed(xmlNodePtr pNode, const AMDA::Parameters::CfgContext& pContext) {
		Parameter* lParameter = pContext.get<Parameter*>();
		if (pNode->children && pNode->children->content && pNode->children->content[0] != '\0') {
                                                           // plugin load 
                    std::string content  = (char *)(pNode->children->content); 
                    std::string plugin = content.substr(0, content.find("("));
                                        AMDA::Parameters::ServicesServer *servicesServer = AMDA::Parameters::ServicesServer::getInstance();
                    servicesServer->loadPlugin(plugin);
			LOG4CXX_DEBUG(gLogger, "CalibrationNode::proceed push: " << (char*)pNode->children->content << " to Parameter: " << lParameter)
			CalibrationInfoWriter* lWriter = new  CalibrationInfoWriter();
			lWriter->setExpression((char*)pNode->children->content);
			lParameter->getCalibrationInfoWriterList().push_back(lWriter);
		}
	}

} /* namespace XMLParameterConfigurator */
} /* namespace AMDA */