#include <cctwcomparer.h>
Definition at line 8 of file cctwcomparer.h.
CctwComparer::CctwComparer |
( |
CctwApplication * |
application, |
|
|
QString |
name, |
|
|
QObject * |
parent = 0 |
|
) |
| |
|
explicit |
Definition at line 5 of file cctwcomparer.cpp.
9 m_Dataset1(
m_Application->
saver(),
this,
"dataset1",
"data",
"Name of dataset within 1st file"),
11 m_Dataset2(
m_Application->
saver(),
this,
"dataset2",
"data",
"Name of dataset within 2nd file"),
12 m_CompareRigorously(
m_Application->
saver(),
this,
"compareRigorously",
false,
"Perform rigorous compare (every element) of imported data"),
13 m_CompareApproximately(
m_Application->
saver(),
this,
"compareApproximately",
true,
"Perform approximate compare (about 30 seconds) of imported data")
CctwApplication * m_Application
QcepSettingsSaverWPtr saver() const
CctwObject(QString name, QObject *parent=0)
CctwComparer::~CctwComparer |
( |
| ) |
|
|
virtual |
void CctwComparer::compareDatasets |
( |
| ) |
|
|
slot |
void CctwComparer::compareDatasetsApproximately |
( |
| ) |
|
|
slot |
Definition at line 44 of file cctwcomparer.cpp.
References CctwInputDataH5::dimensions(), m_Application, CctwObject::printMessage(), randomIndex(), CctwInputDataH5::readChunk(), CctwVector3D< T >::toString(), CctwVector3D< T >::x(), CctwVector3D< T >::y(), and CctwVector3D< T >::z().
Referenced by compareDatasets().
55 printMessage(tr(
"Dataset dimensions are not the same (%1 vs %2)")
65 while (startAt.elapsed() < 60*1000
76 QVector<double> c1 = d1.readChunk(ix, iy, iz, nx, ny, nz);
77 QVector<double> c2 = d2.readChunk(ix, iy, iz, nx, ny, nz);
79 if (c1.count() != c2.count()) {
81 printMessage(tr(
"Chunk data lengths are not the same for chunk %1 :: %2: (%3 vs %4)")
84 .arg(c1.count()).arg(c2.count()));
86 for (
int i=0; i<c1.count(); i++) {
89 printMessage(tr(
"Chunk values differ in chunk %1 :: %2: at %3 (%4 vs %5)")
92 .arg(i).arg(c1[i]).arg(c2[i]));
99 printMessage(tr(
"Compare completed, %1 errors found").arg(n));
CctwApplication * m_Application
virtual void printMessage(QString msg, QDateTime dt=QDateTime::currentDateTime())
CctwVector3D< int > CctwIntVector3D
static int randomIndex(int n)
void CctwComparer::compareDatasetsRigorously |
( |
| ) |
|
|
slot |
bool CctwComparer::compareApproximately |
|
readwrite |
bool CctwComparer::compareRigorously |
|
readwrite |
QString CctwComparer::dataset1 |
|
readwrite |
QString CctwComparer::dataset2 |
|
readwrite |
QString CctwComparer::filePath1 |
|
readwrite |
QString CctwComparer::filePath2 |
|
readwrite |
The documentation for this class was generated from the following files: