// Copyright 2007 Nanorex, Inc. See LICENSE file for details. #include "ResultsSummaryWindow.h" /* CONSTRUCTOR */ ResultsSummaryWindow::ResultsSummaryWindow(const QString& filename, NXDataStoreInfo* dataStoreInfo, QWidget *parent) : DataWindow(parent), Ui_ResultsSummaryWindow() { this->dataStoreInfo = dataStoreInfo; setupUi(this); QString title = tr("Results Summary - %1").arg(filename); setWindowTitle(title); setWindowFlags(Qt::Dialog | Qt::Tool); printSummary(); } /* DESTRUCTOR */ ResultsSummaryWindow::~ResultsSummaryWindow() { } /* FUNCTION: refresh */ void ResultsSummaryWindow::refresh() { printSummary(); } /* FUNCTION: printSummary */ void ResultsSummaryWindow::printSummary() { NXProperties* properties = dataStoreInfo->getResultsSummary(); if (properties == NULL) { textEdit->insertHtml(tr("Results Summary
No results summary found.
")); } else { QString html = QString("Results Summary
"); vector keys = properties->getPropertyKeys(); vector::iterator iter = keys.begin(); string key, value, units; while (iter != keys.end()) { key = *iter; value = properties->getProperty(*iter); if (value != "") { formatParameter(key, value, units); html.append (tr("%2 %3") .arg(key.c_str()).arg(value.c_str()).arg(units.c_str())); } iter++; } html.append("
%1:
"); textEdit->clear(); textEdit->setHtml(html); } }