summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjasplin <qt-info@nokia.com>2010-04-30 10:36:54 +0200
committerjasplin <qt-info@nokia.com>2010-04-30 10:36:54 +0200
commiteb2427e5a86bfd3d730f8e8be6f6bedb95ed28fd (patch)
treedbad27597a4d3e52b6746c9c143c228df105b567
parent18d7a0b98fde5e01f84cbbc7ff260240f99d37da (diff)
Updated ER-diagram and <area> title attribute.
-rw-r--r--doc/er-diagram.diabin5901 -> 5582 bytes
-rw-r--r--src/bm/bmrequest.cpp63
2 files changed, 34 insertions, 29 deletions
diff --git a/doc/er-diagram.dia b/doc/er-diagram.dia
index 6db08a4..9e76c8b 100644
--- a/doc/er-diagram.dia
+++ b/doc/er-diagram.dia
Binary files differ
diff --git a/src/bm/bmrequest.cpp b/src/bm/bmrequest.cpp
index c650fb6..71691ec 100644
--- a/src/bm/bmrequest.cpp
+++ b/src/bm/bmrequest.cpp
@@ -5252,6 +5252,7 @@ void BMRequest_IndexGetValues::handleReply_HTML(const QStringList &args) const
QDomElement argsElem = doc.elementsByTagName("args").at(0).toElement();
+
// *** Plot ***
// reply += "<br />args:<br />";
@@ -5294,6 +5295,10 @@ void BMRequest_IndexGetValues::handleReply_HTML(const QStringList &args) const
Q_ASSERT(ok);
}
+ const int baseValuePos = argsElem.attributeNode("baseValuePos").value().toInt(&ok);
+ Q_ASSERT(ok);
+ const qreal baseValue = indexValues.at(baseValuePos);
+
// ... get point infos ...
Plotter *plotter = new IndexPlotter(timestamps, indexValues, contributions);
QList<Plotter::PointInfo> pointInfos;
@@ -5314,47 +5319,51 @@ void BMRequest_IndexGetValues::handleReply_HTML(const QStringList &args) const
// ... add <area> tags for valid points ...
for (int i = 0; i < pointInfos.size(); ++i) {
+
if (contributions.at(i) == 0)
continue; // skip invalid point
- QString url = QString("%1/cgi-bin/bmclientwrapper").arg(webServer);
- url += QString("?command=-server %1").arg(server);
- url += QString(" get ixhistories detailspage -stylesheet %1").arg(styleSheet);
- url += QString(" -evaltimestamp %1").arg(timestamps.at(i));
-
QDomElement valueElem = valueNodes.at(i).toElement();
-
QDomNodeList rankedInfoNodes = valueElem.elementsByTagName("rankedInfo");
- if (rankedInfoNodes.size() == 0)
- continue; // skip if no ranked infos were found (typically the case for for the first
- // valid point)
+ QString url;
- for (int j = 0; j < rankedInfoNodes.size(); ++j) {
- QDomElement rankedInfoElem = rankedInfoNodes.at(j).toElement();
+ if (rankedInfoNodes.size() > 0) {
- const int bmcontextId = rankedInfoElem.attributeNode("id").value().toInt(&ok);
- Q_ASSERT(ok);
- const int basePos = rankedInfoElem.attributeNode("basePos").value().toInt(&ok);
- Q_ASSERT(ok);
- const int diffPos1 = rankedInfoElem.attributeNode("diffPos1").value().toInt(&ok);
- Q_ASSERT(ok);
- const int diffPos2 = rankedInfoElem.attributeNode("diffPos2").value().toInt(&ok);
- Q_ASSERT(ok);
- const QString descr = rankedInfoElem.attributeNode("descr").value();
+ url = QString("%1/cgi-bin/bmclientwrapper").arg(webServer);
+ url += QString("?command=-server %1").arg(server);
+ url += QString(" get ixhistories detailspage -stylesheet %1").arg(styleSheet);
+ url += QString(" -evaltimestamp %1").arg(timestamps.at(i));
+
+ for (int j = 0; j < rankedInfoNodes.size(); ++j) {
+ QDomElement rankedInfoElem = rankedInfoNodes.at(j).toElement();
+
+ const int bmcontextId = rankedInfoElem.attributeNode("id").value().toInt(&ok);
+ Q_ASSERT(ok);
+ const int basePos = rankedInfoElem.attributeNode("basePos").value().toInt(&ok);
+ Q_ASSERT(ok);
+ const int diffPos1 = rankedInfoElem.attributeNode("diffPos1").value().toInt(&ok);
+ Q_ASSERT(ok);
+ const int diffPos2 = rankedInfoElem.attributeNode("diffPos2").value().toInt(&ok);
+ Q_ASSERT(ok);
+ const QString descr = rankedInfoElem.attributeNode("descr").value();
- url += QString(" -rankedinfo %1 %2 %3 %4 '%5'")
- .arg(bmcontextId).arg(basePos).arg(diffPos1).arg(diffPos2).arg(descr);
+ url += QString(" -rankedinfo %1 %2 %3 %4 '%5'")
+ .arg(bmcontextId).arg(basePos).arg(diffPos1).arg(diffPos2).arg(descr);
+ }
}
QRect rect = pointInfos.at(i).rect.toAlignedRect();
+ const qreal baseDiff = indexValues.at(i) - baseValue;
+ const qreal basePercentage = 100 * qPow(2, baseDiff);
+
reply += QString(
- "<area shape=\"rect\" coords=\"%1,%2,%3,%4\" title=\"%5\" href=\"%6\" />\n")
+ "<area shape=\"rect\" coords=\"%1,%2,%3,%4\" title=\"%5 %\"%6 />\n")
.arg(rect.topLeft().x())
.arg(rect.topLeft().y())
.arg(rect.bottomRight().x())
.arg(rect.bottomRight().y())
- .arg(pointInfos.at(i).value)
- .arg(url);
+ .arg(QString().setNum(basePercentage, 'f', 3))
+ .arg(url.isEmpty() ? QString() : QString(" href=\"%1\"").arg(url));
}
reply += "</map>\n";
@@ -5500,10 +5509,6 @@ void BMRequest_IndexGetValues::handleReply_HTML(const QStringList &args) const
}
reply += "</td></table>\n";
- const int baseValuePos = argsElem.attributeNode("baseValuePos").value().toInt(&ok);
- Q_ASSERT(ok);
- const qreal baseValue = indexValues.at(baseValuePos);
-
// Absolute log2 base diffs that are at or below minColorAbsVal will be highlighted by the
// "weakest" (i.e. least saturated) color (red or green depending on the sign), while those
// that are at or above maxColorAbsVal will be highlighted by the "strongest" (i.e. most