14 #include <QDomDocument> 29 if(!this->openDomDocument())
32 if(!this->openDocumentElement())
38 bool SonixProbeFileReader::openFile()
40 if(!mFile.open(QIODevice::ReadOnly))
46 bool SonixProbeFileReader::openDomDocument()
48 if(!mDoc.setContent(&mFile))
56 bool SonixProbeFileReader::openDocumentElement()
58 mDocElem = mDoc.documentElement();
68 QDomNode probeNode = probes.firstChild();
70 while(!probeNode.isNull() && retval.isNull())
72 retval = probeNode.toElement();
75 if(retval.attribute(
"name") != probeName)
77 retval = QDomElement();
78 probeNode = probeNode.nextSibling();
87 return this->getChildWithTag(mDocElem,
"probes");
92 QDomElement type = this->getChildWithTag(probeNode,
"type");
93 if (type.text() ==
"2")
99 QDomElement SonixProbeFileReader::getChildWithTag(QDomNode parent, QString tagName)
101 QDomNode probesNode = parent.firstChild();
103 while(!probesNode.isNull() && retval.isNull())
105 retval = probesNode.toElement();
108 if(retval.tagName() != tagName)
110 retval = QDomElement();
111 probesNode = probesNode.nextSibling();
126 QDomElement element = this->getChildWithTag(probeNode, param);
127 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)
Namespace for all CustusX production code.