#include "WaferXML.h" WaferXML::WaferXML(void) { setSourceFileName(__FILE__); } WaferXML::~WaferXML(void) { } void WaferXML::clearXMLexportData() { _xMLexportArray.clear(); } void WaferXML::setNewXMLEntry(unsigned int pChipNumber, std::string pResultName, std::string pXMLresultName, std::string tValue) { _xMLexportArray[pChipNumber][pResultName] = std::make_pair(pXMLresultName, tValue); } void WaferXML::createXMLfile(std::string pWaferName, unsigned int pWaferSerialNumber, std::string pFileName) { debug("createXMLfile"); if(pFileName.compare("") == 0){ error(std::string("createXMLfile: no file name given, abort")); return; } XMLDocument tDoc; XMLDeclaration* tDeclaration = tDoc.NewDeclaration("xml version=\"1.0\""); tDoc.LinkEndChild(tDeclaration); XMLComment* tComment = tDoc.NewComment("Proof of concept FE-I4B wafer testing XML for production data base"); tDoc.LinkEndChild(tComment); XMLElement* tRoot = tDoc.NewElement("Wafer"); tDoc.LinkEndChild(tRoot); XMLElement* tWaferInfo = tDoc.NewElement("WaferInfo"); tWaferInfo->SetAttribute("WaferName", pWaferName.c_str()); tWaferInfo->SetAttribute("SerialNumber",pWaferSerialNumber); tRoot->LinkEndChild(tWaferInfo); XMLElement* tWaferStatistic = tDoc.NewElement("WaferStatistic"); tWaferStatistic->SetAttribute("GreenChips",54); tWaferStatistic->SetAttribute("YellowChips",4); tWaferStatistic->SetAttribute("RedChips",2); tRoot->LinkEndChild(tWaferStatistic); for(std::map > >::iterator it = _xMLexportArray.begin(); it != _xMLexportArray.end(); ++it){ std::stringstream tChipName; tChipName<<"IC"<first; XMLElement* tICElement = tDoc.NewElement(tChipName.str().c_str()); for(std::map >::iterator iit = it->second.begin(); iit != it->second.end(); ++iit){ XMLElement* tTempElement = tDoc.NewElement(iit->second.first.c_str()); tTempElement->SetAttribute(iit->first.c_str(),iit->second.second.c_str()); tICElement->LinkEndChild(tTempElement); } tRoot->LinkEndChild(tICElement); } tDoc.SaveFile(pFileName.c_str()); }