7 m_Application(application),
8 m_FilePath1(m_Application->saver(), this,
"filePath1",
"",
"Path to 1st file"),
9 m_Dataset1(m_Application->saver(), this,
"dataset1",
"data",
"Name of dataset within 1st file"),
10 m_FilePath2(m_Application->saver(), this,
"filePath2",
"",
"Path to 2nd 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")
25 if (get_CompareRigorously()) {
29 if (get_CompareApproximately()) {
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())
CctwComparer(CctwApplication *application, QString name, QObject *parent=0)
void compareDatasetsApproximately()
CctwVector3D< int > CctwIntVector3D
void compareDatasetsRigorously()
static int randomIndex(int n)