/* * ParamsNode.hh * * Created on: 21 nov. 2013 * Author: CS */ #ifndef PARAMSNODE_HH_ #define PARAMSNODE_HH_ #include "NodeCfg.hh" #include "PlotLogger.hh" #include "CommonNode.hh" #include "DefaultPlotConfiguration.hh" #include "PanelPlotOutput.hh" #include "DrawingPropertiesNode.hh" #include "SeriesNode.hh" #include "SpectroNode.hh" #include "SauvaudNode.hh" #include "IntervalsNode.hh" namespace plot { template class ParamNode: public AMDA::XMLConfigurator::NodeGrpCfg { public: ParamNode() : AMDA::XMLConfigurator::NodeGrpCfg() { getChildList()["default"] = AMDA::XMLConfigurator::NodeCfgSPtr( new DrawingPropertiesNode()); getChildList()["serie"] = AMDA::XMLConfigurator::NodeCfgSPtr( new SeriesNode()); getChildList()["spectro"] = AMDA::XMLConfigurator::NodeCfgSPtr( new SpectroNode()); getChildList()["sauvaud"] = AMDA::XMLConfigurator::NodeCfgSPtr( new SauvaudNode()); getChildList()["intervals"] = AMDA::XMLConfigurator::NodeCfgSPtr( new IntervalsNode()); getChildList()["colorserie"] = AMDA::XMLConfigurator::NodeCfgSPtr( new ColorSeriesNode()); } virtual ~ParamNode() { } void proceed(xmlNodePtr pNode, const AMDA::Parameters::CfgContext& pContext) { LOG4CXX_DEBUG(gLogger, "ParamNode::proceed"); PlotType* plotOutput = pContext.get(); xmlChar* name = NULL; // -- param id name = xmlGetProp(pNode, (const xmlChar *) "id"); if (name) { plotOutput->addParam((const char*) name); } // initialize drawing default properties object: DrawingProperties props; // take default value during init... DefaultPlotConfiguration::getInstance().applyDefaultDrawingProperties( plotOutput->typeName(), props ); // add default properties to parameter plotOutput->getParameter((const char*)name).setDefaultProperties( props ); AMDA::Parameters::CfgContext context; context.push(name); context.push(plotOutput); AMDA::XMLConfigurator::NodeGrpCfg::proceed(pNode, context); if (name) { xmlFree (name); } } }; template class ParamsNode: public AMDA::XMLConfigurator::NodeGrpCfg { public: ParamsNode() : AMDA::XMLConfigurator::NodeGrpCfg() { getChildList()["param"] = AMDA::XMLConfigurator::NodeCfgSPtr( new ParamNode()); } virtual ~ParamsNode() { } }; } /* namespace plot */ #endif /* PARAMSNODE_HH_ */