Check Measurement file unit.
--HG-- branch : feature
This commit is contained in:
parent
0c73e7f760
commit
f3d24856be
|
@ -273,6 +273,21 @@ void MainWindow::LoadMeasurements(const QString &path)
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m->Type() == MeasurementsType::Standard)
|
||||||
|
{
|
||||||
|
if (m->MUnit() == Unit::Inch)
|
||||||
|
{
|
||||||
|
QMessageBox::critical(this, tr("Wrong units."),
|
||||||
|
tr("Application doesn't support standard table with inches."));
|
||||||
|
qCDebug(vMainWindow, "Application doesn't support standard table with inches.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
m->SetDataSize();
|
||||||
|
m->SetDataHeight();
|
||||||
|
}
|
||||||
|
|
||||||
|
qApp->setPatternType(m->Type());
|
||||||
|
ToolBarOption();
|
||||||
pattern->ClearVariables(VarType::Measurement);
|
pattern->ClearVariables(VarType::Measurement);
|
||||||
m->ReadMeasurements();
|
m->ReadMeasurements();
|
||||||
delete m;
|
delete m;
|
||||||
|
@ -992,6 +1007,7 @@ void MainWindow::LoadStandard()
|
||||||
*/
|
*/
|
||||||
void MainWindow::ToolBarOption()
|
void MainWindow::ToolBarOption()
|
||||||
{
|
{
|
||||||
|
ui->toolBarOption->clear();
|
||||||
if (qApp->patternType() == MeasurementsType::Standard)
|
if (qApp->patternType() == MeasurementsType::Standard)
|
||||||
{
|
{
|
||||||
const QStringList listHeights = VMeasurement::ListHeights(doc->GetGradationHeights(), qApp->patternUnit());
|
const QStringList listHeights = VMeasurement::ListHeights(doc->GetGradationHeights(), qApp->patternUnit());
|
||||||
|
@ -2127,7 +2143,6 @@ void MainWindow::New()
|
||||||
//Set scene size to size scene view
|
//Set scene size to size scene view
|
||||||
VMainGraphicsView::NewSceneRect(sceneDraw, ui->view);
|
VMainGraphicsView::NewSceneRect(sceneDraw, ui->view);
|
||||||
VMainGraphicsView::NewSceneRect(sceneDetails, ui->view);
|
VMainGraphicsView::NewSceneRect(sceneDetails, ui->view);
|
||||||
ToolBarOption();
|
|
||||||
|
|
||||||
AddPP(patternPieceName);
|
AddPP(patternPieceName);
|
||||||
}
|
}
|
||||||
|
|
|
@ -533,6 +533,20 @@ QStringList VMeasurements::ListKnown() const
|
||||||
return listNames;
|
return listNames;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void VMeasurements::SetDataSize()
|
||||||
|
{
|
||||||
|
data->SetSize(UnitConvertor(BaseSize(), MUnit(), *data->GetPatternUnit()));
|
||||||
|
data->SetSizeName(size_M);
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void VMeasurements::SetDataHeight()
|
||||||
|
{
|
||||||
|
data->SetHeight(UnitConvertor(BaseHeight(), MUnit(), *data->GetPatternUnit()));
|
||||||
|
data->SetHeightName(height_M);
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VMeasurements::CreateEmptyStandardFile(Unit unit, int baseSize, int baseHeight)
|
void VMeasurements::CreateEmptyStandardFile(Unit unit, int baseSize, int baseHeight)
|
||||||
{
|
{
|
||||||
|
|
|
@ -121,6 +121,9 @@ public:
|
||||||
QStringList ListAll() const;
|
QStringList ListAll() const;
|
||||||
QStringList ListKnown() const;
|
QStringList ListKnown() const;
|
||||||
|
|
||||||
|
void SetDataSize();
|
||||||
|
void SetDataHeight();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(VMeasurements)
|
Q_DISABLE_COPY(VMeasurements)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user