/*
 *
 * [desc.]
 */
#include "Tools/Viewer/Parser/include/parser.h"
using namespace morpheo::tools::viewer::bdd;
namespace morpheo{
namespace tools{
namespace viewer{
namespace parser{     

  void Parse::parser_param(QDomNode n,int level){
       while( !n.isNull() )
      {
	QDomElement e = n.toElement();
	QDomNamedNodeMap a;
	QDomAttr ab;
	unsigned i;
	if( !e.isNull() )
	  {
	    group=new Group(e.tagName().toStdString(),level);
	    a=e.attributes();
	    for(i=0;i<a.length();i++)
	    {
	      ab=a.item(i).toAttr();
	      param=new Param(ab.name().toStdString(),ab.value().toInt(),e.tagName().toStdString());
	      //cout << ab.name().toStdString()<<endl;
	      group->addParam(param);
	      delete param;
	    }
	    base->addGroup(group);
	    delete group;
	    parser_param(n.firstChild(),level+1);
	  }
	n = n.nextSibling(); //next channel
	    
      }
      
  }

};//end parser
};//end viewer
};//end tools
};//end morpheo

