35 #include <QDomDocument>
50 if(!this->openDomDocument())
53 if(!this->openDocumentElement())
59 bool SonixProbeFileReader::openFile()
61 if(!mFile.open(QIODevice::ReadOnly))
67 bool SonixProbeFileReader::openDomDocument()
69 if(!mDoc.setContent(&mFile))
77 bool SonixProbeFileReader::openDocumentElement()
79 mDocElem = mDoc.documentElement();
89 QDomNode probeNode = probes.firstChild();
91 while(!probeNode.isNull() && retval.isNull())
93 retval = probeNode.toElement();
96 if(retval.attribute(
"name") != probeName)
98 retval = QDomElement();
99 probeNode = probeNode.nextSibling();
108 return this->getChildWithTag(mDocElem,
"probes");
113 QDomElement type = this->getChildWithTag(probeNode,
"type");
114 if (type.text() ==
"2")
120 QDomElement SonixProbeFileReader::getChildWithTag(QDomNode parent, QString tagName)
122 QDomNode probesNode = parent.firstChild();
124 while(!probesNode.isNull() && retval.isNull())
126 retval = probesNode.toElement();
129 if(retval.tagName() != tagName)
131 retval = QDomElement();
132 probesNode = probesNode.nextSibling();
147 QDomElement element = this->getChildWithTag(probeNode, param);
148 QString val = element.text();
QDomElement getProbes()
Traverse top level nodes. Return first node where tag=="probes".
SonixProbeFileReader(QString probeFile)
bool isProbeLinear(QDomNode probeNode)
long getProbeLenght(QDomNode probeNode)
QDomNode getProbeNode(QString probeName)
Traverse all first childs of the probes node. Return the first node where attribute name==probeName...
long getProbeParam(QDomNode probeNode, QString param)