Check known names after conversion.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2015-09-25 13:45:58 +03:00
parent 96f1f63fa4
commit 25561858f0
2 changed files with 19 additions and 18 deletions

View File

@ -194,12 +194,6 @@ void TMainWindow::LoadFile(const QString &path)
m = new VMeasurements(data);
m->setXMLContent(path);
if (not m->IsDefinedKnownNamesValid())
{
VException e(tr("File contains invalid known measurement(s)."));
throw e;
}
mType = m->Type();
if (mType == MeasurementsType::Unknown)
@ -224,6 +218,13 @@ void TMainWindow::LoadFile(const QString &path)
}
m->setXMLContent(path);// Read again after conversion
if (not m->IsDefinedKnownNamesValid())
{
VException e(tr("File contains invalid known measurement(s)."));
throw e;
}
mUnit = m->MUnit();
pUnit = mUnit;

View File

@ -245,12 +245,6 @@ bool MainWindow::LoadMeasurements(const QString &path)
m = new VMeasurements(pattern);
m->setXMLContent(path);
if (not m->IsDefinedKnownNamesValid())
{
VException e(tr("Measurement file contains invalid known measurement(s)."));
throw e;
}
if (m->Type() == MeasurementsType::Unknown)
{
VException e(tr("Measurement file has unknown format."));
@ -274,6 +268,12 @@ bool MainWindow::LoadMeasurements(const QString &path)
m->setXMLContent(path);// Read again after conversion
if (not m->IsDefinedKnownNamesValid())
{
VException e(tr("Measurement file contains invalid known measurement(s)."));
throw e;
}
const QStringList mList = m->ListAll();
const QStringList pList = doc->ListMeasurements();
@ -3440,12 +3440,6 @@ QString MainWindow::CheckPathToMeasurements(const QString &patternPath, const QS
VMeasurements *m = new VMeasurements(pattern);
m->setXMLContent(mPath);
if (not m->IsDefinedKnownNamesValid())
{
VException e(tr("Measurement file contains invalid known measurement(s)."));
throw e;
}
patternType = m->Type();
if (patternType == MeasurementsType::Unknown)
@ -3471,6 +3465,12 @@ QString MainWindow::CheckPathToMeasurements(const QString &patternPath, const QS
m->setXMLContent(mPath);// Read again after conversion
if (not m->IsDefinedKnownNamesValid())
{
VException e(tr("Measurement file contains invalid known measurement(s)."));
throw e;
}
const QStringList mList = m->ListAll();
const QStringList pList = doc->ListMeasurements();