void Logger::saveVisualEventSetToXML(std::list<MbariVisualEvent::VisualEvent *> &eventList, int eventframe, string eventframetimecode, FrameRange fr) { if (!itsXMLfileCreated) LFATAL("Error: Create an XML document first with createXMLDocument()"); else { itsXMLParser->add(itsSaveBoringEvents.getVal(), eventList, eventframe, eventframetimecode, itsScaleW, itsScaleH); } if (fr.getLast() == eventframe) { if (!itsXMLParser->isXMLValid(itsSaveXMLEventSetName.getVal().c_str())) LFATAL("Error: There is something wrong with the XML auto generated"); else { itsXMLParser->writeDocument(itsSaveXMLEventSetName.getVal().c_str()); LINFO("The XML output is valid"); } } }
void Logger::createXMLDocument(string versionString, FrameRange fr, string timecodefirst, string timecodelast, DetectionParameters params) { if (!itsXMLfileCreated) { itsXMLParser->creatDOMDocument(versionString, fr.getFirst(), fr.getLast(), timecodefirst, timecodelast); // add in source metadata if specified if (itsMetadataSource.getVal().length() > 0) { itsXMLParser->addSourceMetaData(itsMetadataSource.getVal()); } // add in detection parameters itsXMLParser->addDetectionParameters(params); itsXMLParser->writeDocument(itsSaveXMLEventSetName.getVal().c_str()); itsXMLfileCreated = true; } }