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;
|
||||
}
|
||||
|
||||
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);
|
||||
m->ReadMeasurements();
|
||||
delete m;
|
||||
|
@ -992,6 +1007,7 @@ void MainWindow::LoadStandard()
|
|||
*/
|
||||
void MainWindow::ToolBarOption()
|
||||
{
|
||||
ui->toolBarOption->clear();
|
||||
if (qApp->patternType() == MeasurementsType::Standard)
|
||||
{
|
||||
const QStringList listHeights = VMeasurement::ListHeights(doc->GetGradationHeights(), qApp->patternUnit());
|
||||
|
@ -2127,7 +2143,6 @@ void MainWindow::New()
|
|||
//Set scene size to size scene view
|
||||
VMainGraphicsView::NewSceneRect(sceneDraw, ui->view);
|
||||
VMainGraphicsView::NewSceneRect(sceneDetails, ui->view);
|
||||
ToolBarOption();
|
||||
|
||||
AddPP(patternPieceName);
|
||||
}
|
||||
|
|
|
@ -533,6 +533,20 @@ QStringList VMeasurements::ListKnown() const
|
|||
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)
|
||||
{
|
||||
|
|
|
@ -121,6 +121,9 @@ public:
|
|||
QStringList ListAll() const;
|
||||
QStringList ListKnown() const;
|
||||
|
||||
void SetDataSize();
|
||||
void SetDataHeight();
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(VMeasurements)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user