[Kst] extragear/graphics/kst/src/datasources/naddirect
Eli Fidler
eli at staikos.net
Tue Apr 4 01:16:28 CEST 2006
SVN commit 526156 by fidler:
remove dataset type
M +7 -14 nadconnection.cpp
M +1 -3 nadconnection.h
--- trunk/extragear/graphics/kst/src/datasources/naddirect/nadconnection.cpp #526155:526156
@@ -62,9 +62,6 @@
if ((index = atts.index("name")) != -1) {
response->datasetName = atts.value(index);
}
- if ((index = atts.index("type")) != -1) {
- response->datasetType = atts.value(index);
- }
} else if (qName == "Fields") {
} else if (qName == "Float64") {
NADFieldsResponseField *rf = new NADFieldsResponseField;
@@ -147,9 +144,6 @@
if ((index = atts.index("name")) != -1) {
response->datasetName = atts.value(index);
}
- if ((index = atts.index("type")) != -1) {
- response->datasetType = atts.value(index);
- }
} else if (qName == "ChunkSize") {
} else if (qName == "Endian") {
} else if (qName == "ResponseFrame") {
@@ -250,12 +244,11 @@
}
-// NADUrlString is currently nad://user:pw@host:port/dsName?type=dsType
+// NADUrlString is currently nad://user:pw@host:port/dsName
void NADConnection::setUrl(const QString &NADUrlString) {
KURL NADUrl = KURL::fromPathOrURL(NADUrlString);
_datasetName = NADUrl.path();
- _datasetType = NADUrl.queryItem("type");
KURL url;
url.setUser(NADUrl.user());
@@ -273,7 +266,7 @@
// return true if updated, false if not
bool NADConnection::updateLastFieldsResponse() {
- QString postData = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n<GetFields><DataSet><DataSetName>" + _datasetName + "</DataSetName><DataSetType>" + _datasetType + "</DataSetType></DataSet></GetFields>\n";
+ QString postData = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n<GetFields><DataSet><DataSetName>" + _datasetName + "</DataSetName></DataSet></GetFields>\n";
QByteArray data;
data.duplicate(postData.local8Bit(), postData.length());
@@ -369,7 +362,7 @@
QStringList rc;
QValueList<QString> fieldNames = _lastFieldsResponse->fields.keys();
- for (QValueList<QString>::iterator i = fieldNames.begin(); i != fieldNames.end(); ++i) {
+ for (QValueList<QString>::const_iterator i = fieldNames.begin(); i != fieldNames.end(); ++i) {
rc += (*i);
}
return rc;
@@ -380,7 +373,7 @@
bool NADConnection::isValid() const {
- return !_url.host().isEmpty() && !_datasetName.isEmpty() && !_datasetType.isEmpty() && _lastFieldsResponse;
+ return !_url.host().isEmpty() && !_datasetName.isEmpty() && _lastFieldsResponse;
}
@@ -421,7 +414,7 @@
int NADConnection::getData(const QString &field, double *buf, long startFrame, long stopFrame) {
- QString postData = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n<GetData><DataSet><DataSetName>" + _datasetName + "</DataSetName><DataSetType>" + _datasetType + "</DataSetType></DataSet><Endian>LittleEndian</Endian><ChunkSize>40</ChunkSize><Fields><Field><FieldName>" + field + "</FieldName><Start type=\"frame\">" + QString::number(startFrame) + "</Start><Stop type=\"frame\">" + QString::number(stopFrame) + "</Stop></Field></Fields></GetData>";
+ QString postData = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n<GetData><DataSet><DataSetName>" + _datasetName + "</DataSetName></DataSet><Endian>LittleEndian</Endian><Fields><Field><FieldName>" + field + "</FieldName><Start type=\"frame\">" + QString::number(startFrame) + "</Start><Stop type=\"frame\">" + QString::number(stopFrame) + "</Stop></Field></Fields></GetData>";
// remove trailing null
QByteArray data;
@@ -517,7 +510,7 @@
long curOutPos = 0;
while (!respBuf.atEnd()) {
- timer.restart();
+// timer.restart();
// read data chunk
bufStr = respTStream.readLine();
@@ -562,7 +555,7 @@
respTStream.skipWhiteSpace();
- kstdDebug() << "NAD: done reading data chunk for getData: " << QString::number(timer.elapsed()) << " ms" << endl;
+// kstdDebug() << "NAD: done reading data chunk for getData: " << QString::number(timer.elapsed()) << " ms" << endl;
}
return curOutPos;
--- trunk/extragear/graphics/kst/src/datasources/naddirect/nadconnection.h #526155:526156
@@ -43,7 +43,6 @@
struct NADFieldsResponse {
QString datasetName;
- QString datasetType;
QMap<QString, NADFieldsResponseField *> fields;
};
@@ -55,7 +54,6 @@
struct NADDataResponse {
QString datasetName;
- QString datasetType;
int chunkSize;
QDataStream::ByteOrder endian;
QMap<QString, NADDataResponseField *> fields;
@@ -85,7 +83,7 @@
bool NADConnection::updateLastFieldsResponse();
KURL _url;
- QString _datasetName, _datasetType;
+ QString _datasetName;
struct NADFieldsResponse * _lastFieldsResponse;
bool _firstTime;
};
More information about the Kst
mailing list