From 2fd78f68a5a0c6dd1040dec2d3a1a30b100ac67b Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 3 May 2023 16:23:54 +0300 Subject: [PATCH] Simplify number of versions for DXF AAMA/ASTM. --- ChangeLog.txt | 1 + dist/OBS_debian/debian.valentina.1 | 52 +------- dist/debian/valentina.1 | 52 +------- .../puzzle/dialogs/dialogsavemanuallayout.cpp | 80 ++---------- src/app/puzzle/vpmainwindow.cpp | 87 +------------ src/app/puzzle/vpsettings.cpp | 2 +- .../valentina/dialogs/dialogsavelayout.cpp | 120 ++---------------- src/app/valentina/mainwindowsnogui.cpp | 87 +------------ src/libs/vlayout/vlayoutdef.h | 30 +---- src/libs/vlayout/vlayoutexporter.cpp | 79 +++--------- src/libs/vmisc/vcommonsettings.cpp | 16 +++ src/libs/vmisc/vcommonsettings.h | 2 + src/libs/vmisc/vvalentinasettings.cpp | 4 +- 13 files changed, 74 insertions(+), 538 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 4ed9c2f4a..4dd97a2af 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -24,6 +24,7 @@ - New grainline type: Four way. - [smart-pattern/valentina#163] Show/hide grainline when export. - Improve calculating notches. +- Simplify number of versions for DXF AAMA/ASTM. # Valentina 0.7.52 September 12, 2022 - Fix crash when default locale is ru. diff --git a/dist/OBS_debian/debian.valentina.1 b/dist/OBS_debian/debian.valentina.1 index 7f6ba6c48..af5873f9a 100644 --- a/dist/OBS_debian/debian.valentina.1 +++ b/dist/OBS_debian/debian.valentina.1 @@ -75,58 +75,10 @@ The path to output destination folder. By default the directory at which the app .BR "*" " AutoCAD DXF 2013 (flat) files (*.dxf) = 14," .RE .RS -.BR "*" " AutoCAD DXF R10 AAMA files (*.dxf) = 15," +.BR "*" " AutoCAD DXF AAMA files (*.dxf) = 16," .RE .RS -.BR "*" " AutoCAD DXF R11/12 AAMA files (*.dxf) = 16," -.RE -.RS -.BR "*" " AutoCAD DXF R13 AAMA files (*.dxf) = 17," -.RE -.RS -.BR "*" " AutoCAD DXF R14 AAMA files (*.dxf) = 18," -.RE -.RS -.BR "*" " AutoCAD DXF 2000 AAMA files (*.dxf) = 19," -.RE -.RS -.BR "*" " AutoCAD DXF 2004 AAMA files (*.dxf) = 20," -.RE -.RS -.BR "*" " AutoCAD DXF 2007 AAMA files (*.dxf) = 21," -.RE -.RS -.BR "*" " AutoCAD DXF 2010 AAMA files (*.dxf) = 22," -.RE -.RS -.BR "*" " AutoCAD DXF 2013 AAMA files (*.dxf) = 23," -.RE -.RS -.BR "*" " AutoCAD DXF R10 ASTM файли (*.dxf) = 24," -.RE -.RS -.BR "*" " AutoCAD DXF R11/12 ASTM файли (*.dxf) = 25," -.RE -.RS -.BR "*" " AutoCAD DXF R13 ASTM файли (*.dxf) = 26," -.RE -.RS -.BR "*" " AutoCAD DXF R14 ASTM файли (*.dxf) = 27," -.RE -.RS -.BR "*" " AutoCAD DXF 2000 ASTM файли (*.dxf) = 28," -.RE -.RS -.BR "*" " AutoCAD DXF 2004 ASTM файли (*.dxf) = 29," -.RE -.RS -.BR "*" " AutoCAD DXF 2007 ASTM файли (*.dxf) = 30," -.RE -.RS -.BR "*" " AutoCAD DXF 2010 ASTM файли (*.dxf) = 31," -.RE -.RS -.BR "*" " AutoCAD DXF 2013 ASTM файли (*.dxf) = 32," +.BR "*" " AutoCAD DXF ASTM файли (*.dxf) = 25," .RE .RS .BR "*" " PDF tiled files (*.pdf) = 33," diff --git a/dist/debian/valentina.1 b/dist/debian/valentina.1 index 7f6ba6c48..af5873f9a 100755 --- a/dist/debian/valentina.1 +++ b/dist/debian/valentina.1 @@ -75,58 +75,10 @@ The path to output destination folder. By default the directory at which the app .BR "*" " AutoCAD DXF 2013 (flat) files (*.dxf) = 14," .RE .RS -.BR "*" " AutoCAD DXF R10 AAMA files (*.dxf) = 15," +.BR "*" " AutoCAD DXF AAMA files (*.dxf) = 16," .RE .RS -.BR "*" " AutoCAD DXF R11/12 AAMA files (*.dxf) = 16," -.RE -.RS -.BR "*" " AutoCAD DXF R13 AAMA files (*.dxf) = 17," -.RE -.RS -.BR "*" " AutoCAD DXF R14 AAMA files (*.dxf) = 18," -.RE -.RS -.BR "*" " AutoCAD DXF 2000 AAMA files (*.dxf) = 19," -.RE -.RS -.BR "*" " AutoCAD DXF 2004 AAMA files (*.dxf) = 20," -.RE -.RS -.BR "*" " AutoCAD DXF 2007 AAMA files (*.dxf) = 21," -.RE -.RS -.BR "*" " AutoCAD DXF 2010 AAMA files (*.dxf) = 22," -.RE -.RS -.BR "*" " AutoCAD DXF 2013 AAMA files (*.dxf) = 23," -.RE -.RS -.BR "*" " AutoCAD DXF R10 ASTM файли (*.dxf) = 24," -.RE -.RS -.BR "*" " AutoCAD DXF R11/12 ASTM файли (*.dxf) = 25," -.RE -.RS -.BR "*" " AutoCAD DXF R13 ASTM файли (*.dxf) = 26," -.RE -.RS -.BR "*" " AutoCAD DXF R14 ASTM файли (*.dxf) = 27," -.RE -.RS -.BR "*" " AutoCAD DXF 2000 ASTM файли (*.dxf) = 28," -.RE -.RS -.BR "*" " AutoCAD DXF 2004 ASTM файли (*.dxf) = 29," -.RE -.RS -.BR "*" " AutoCAD DXF 2007 ASTM файли (*.dxf) = 30," -.RE -.RS -.BR "*" " AutoCAD DXF 2010 ASTM файли (*.dxf) = 31," -.RE -.RS -.BR "*" " AutoCAD DXF 2013 ASTM файли (*.dxf) = 32," +.BR "*" " AutoCAD DXF ASTM файли (*.dxf) = 25," .RE .RS .BR "*" " PDF tiled files (*.pdf) = 33," diff --git a/src/app/puzzle/dialogs/dialogsavemanuallayout.cpp b/src/app/puzzle/dialogs/dialogsavemanuallayout.cpp index d583aa695..157253edf 100644 --- a/src/app/puzzle/dialogs/dialogsavemanuallayout.cpp +++ b/src/app/puzzle/dialogs/dialogsavemanuallayout.cpp @@ -186,24 +186,8 @@ void DialogSaveManualLayout::SetBinaryDXFFormat(bool binary) case LayoutExportFormats::DXF_AC1021_Flat: case LayoutExportFormats::DXF_AC1024_Flat: case LayoutExportFormats::DXF_AC1027_Flat: - case LayoutExportFormats::DXF_AC1006_AAMA: - case LayoutExportFormats::DXF_AC1009_AAMA: - case LayoutExportFormats::DXF_AC1012_AAMA: - case LayoutExportFormats::DXF_AC1014_AAMA: - case LayoutExportFormats::DXF_AC1015_AAMA: - case LayoutExportFormats::DXF_AC1018_AAMA: - case LayoutExportFormats::DXF_AC1021_AAMA: - case LayoutExportFormats::DXF_AC1024_AAMA: - case LayoutExportFormats::DXF_AC1027_AAMA: - case LayoutExportFormats::DXF_AC1006_ASTM: - case LayoutExportFormats::DXF_AC1009_ASTM: - case LayoutExportFormats::DXF_AC1012_ASTM: - case LayoutExportFormats::DXF_AC1014_ASTM: - case LayoutExportFormats::DXF_AC1015_ASTM: - case LayoutExportFormats::DXF_AC1018_ASTM: - case LayoutExportFormats::DXF_AC1021_ASTM: - case LayoutExportFormats::DXF_AC1024_ASTM: - case LayoutExportFormats::DXF_AC1027_ASTM: + case LayoutExportFormats::DXF_AAMA: + case LayoutExportFormats::DXF_ASTM: ui->checkBoxBinaryDXF->setChecked(binary); break; default: @@ -226,24 +210,8 @@ auto DialogSaveManualLayout::IsBinaryDXFFormat() const -> bool case LayoutExportFormats::DXF_AC1021_Flat: case LayoutExportFormats::DXF_AC1024_Flat: case LayoutExportFormats::DXF_AC1027_Flat: - case LayoutExportFormats::DXF_AC1006_AAMA: - case LayoutExportFormats::DXF_AC1009_AAMA: - case LayoutExportFormats::DXF_AC1012_AAMA: - case LayoutExportFormats::DXF_AC1014_AAMA: - case LayoutExportFormats::DXF_AC1015_AAMA: - case LayoutExportFormats::DXF_AC1018_AAMA: - case LayoutExportFormats::DXF_AC1021_AAMA: - case LayoutExportFormats::DXF_AC1024_AAMA: - case LayoutExportFormats::DXF_AC1027_AAMA: - case LayoutExportFormats::DXF_AC1006_ASTM: - case LayoutExportFormats::DXF_AC1009_ASTM: - case LayoutExportFormats::DXF_AC1012_ASTM: - case LayoutExportFormats::DXF_AC1014_ASTM: - case LayoutExportFormats::DXF_AC1015_ASTM: - case LayoutExportFormats::DXF_AC1018_ASTM: - case LayoutExportFormats::DXF_AC1021_ASTM: - case LayoutExportFormats::DXF_AC1024_ASTM: - case LayoutExportFormats::DXF_AC1027_ASTM: + case LayoutExportFormats::DXF_AAMA: + case LayoutExportFormats::DXF_ASTM: return ui->checkBoxBinaryDXF->isChecked(); default: return false; @@ -504,24 +472,8 @@ void DialogSaveManualLayout::ShowExample() switch(currentFormat) { - case LayoutExportFormats::DXF_AC1006_AAMA: - case LayoutExportFormats::DXF_AC1009_AAMA: - case LayoutExportFormats::DXF_AC1012_AAMA: - case LayoutExportFormats::DXF_AC1014_AAMA: - case LayoutExportFormats::DXF_AC1015_AAMA: - case LayoutExportFormats::DXF_AC1018_AAMA: - case LayoutExportFormats::DXF_AC1021_AAMA: - case LayoutExportFormats::DXF_AC1024_AAMA: - case LayoutExportFormats::DXF_AC1027_AAMA: - case LayoutExportFormats::DXF_AC1006_ASTM: - case LayoutExportFormats::DXF_AC1009_ASTM: - case LayoutExportFormats::DXF_AC1012_ASTM: - case LayoutExportFormats::DXF_AC1014_ASTM: - case LayoutExportFormats::DXF_AC1015_ASTM: - case LayoutExportFormats::DXF_AC1018_ASTM: - case LayoutExportFormats::DXF_AC1021_ASTM: - case LayoutExportFormats::DXF_AC1024_ASTM: - case LayoutExportFormats::DXF_AC1027_ASTM: + case LayoutExportFormats::DXF_AAMA: + case LayoutExportFormats::DXF_ASTM: ui->checkBoxBinaryDXF->setEnabled(true); ui->checkBoxShowGrainline->setEnabled(false); break; @@ -600,24 +552,8 @@ auto DialogSaveManualLayout::InitFormats() -> QVector qreal //--------------------------------------------------------------------------------------------------------------------- auto VPSettings::GetLayoutExportFormat() const -> qint8 { - return qvariant_cast(value(*settingLayoutExportFormat, 0)); + return CastToLayoutExportFormat(qvariant_cast(value(*settingLayoutExportFormat, 0))); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/valentina/dialogs/dialogsavelayout.cpp b/src/app/valentina/dialogs/dialogsavelayout.cpp index 9173a7622..acd4f736d 100644 --- a/src/app/valentina/dialogs/dialogsavelayout.cpp +++ b/src/app/valentina/dialogs/dialogsavelayout.cpp @@ -193,24 +193,8 @@ void DialogSaveLayout::SetBinaryDXFFormat(bool binary) case LayoutExportFormats::DXF_AC1021_Flat: case LayoutExportFormats::DXF_AC1024_Flat: case LayoutExportFormats::DXF_AC1027_Flat: - case LayoutExportFormats::DXF_AC1006_AAMA: - case LayoutExportFormats::DXF_AC1009_AAMA: - case LayoutExportFormats::DXF_AC1012_AAMA: - case LayoutExportFormats::DXF_AC1014_AAMA: - case LayoutExportFormats::DXF_AC1015_AAMA: - case LayoutExportFormats::DXF_AC1018_AAMA: - case LayoutExportFormats::DXF_AC1021_AAMA: - case LayoutExportFormats::DXF_AC1024_AAMA: - case LayoutExportFormats::DXF_AC1027_AAMA: - case LayoutExportFormats::DXF_AC1006_ASTM: - case LayoutExportFormats::DXF_AC1009_ASTM: - case LayoutExportFormats::DXF_AC1012_ASTM: - case LayoutExportFormats::DXF_AC1014_ASTM: - case LayoutExportFormats::DXF_AC1015_ASTM: - case LayoutExportFormats::DXF_AC1018_ASTM: - case LayoutExportFormats::DXF_AC1021_ASTM: - case LayoutExportFormats::DXF_AC1024_ASTM: - case LayoutExportFormats::DXF_AC1027_ASTM: + case LayoutExportFormats::DXF_AAMA: + case LayoutExportFormats::DXF_ASTM: ui->checkBoxBinaryDXF->setChecked(binary); break; case LayoutExportFormats::SVG: @@ -243,24 +227,8 @@ auto DialogSaveLayout::IsBinaryDXFFormat() const -> bool case LayoutExportFormats::DXF_AC1021_Flat: case LayoutExportFormats::DXF_AC1024_Flat: case LayoutExportFormats::DXF_AC1027_Flat: - case LayoutExportFormats::DXF_AC1006_AAMA: - case LayoutExportFormats::DXF_AC1009_AAMA: - case LayoutExportFormats::DXF_AC1012_AAMA: - case LayoutExportFormats::DXF_AC1014_AAMA: - case LayoutExportFormats::DXF_AC1015_AAMA: - case LayoutExportFormats::DXF_AC1018_AAMA: - case LayoutExportFormats::DXF_AC1021_AAMA: - case LayoutExportFormats::DXF_AC1024_AAMA: - case LayoutExportFormats::DXF_AC1027_AAMA: - case LayoutExportFormats::DXF_AC1006_ASTM: - case LayoutExportFormats::DXF_AC1009_ASTM: - case LayoutExportFormats::DXF_AC1012_ASTM: - case LayoutExportFormats::DXF_AC1014_ASTM: - case LayoutExportFormats::DXF_AC1015_ASTM: - case LayoutExportFormats::DXF_AC1018_ASTM: - case LayoutExportFormats::DXF_AC1021_ASTM: - case LayoutExportFormats::DXF_AC1024_ASTM: - case LayoutExportFormats::DXF_AC1027_ASTM: + case LayoutExportFormats::DXF_AAMA: + case LayoutExportFormats::DXF_ASTM: return ui->checkBoxBinaryDXF->isChecked(); case LayoutExportFormats::SVG: case LayoutExportFormats::PDF: @@ -300,24 +268,8 @@ void DialogSaveLayout::SetShowGrainline(bool show) case LayoutExportFormats::TIF: ui->checkBoxShowGrainline->setChecked(show); break; - case LayoutExportFormats::DXF_AC1006_AAMA: - case LayoutExportFormats::DXF_AC1009_AAMA: - case LayoutExportFormats::DXF_AC1012_AAMA: - case LayoutExportFormats::DXF_AC1014_AAMA: - case LayoutExportFormats::DXF_AC1015_AAMA: - case LayoutExportFormats::DXF_AC1018_AAMA: - case LayoutExportFormats::DXF_AC1021_AAMA: - case LayoutExportFormats::DXF_AC1024_AAMA: - case LayoutExportFormats::DXF_AC1027_AAMA: - case LayoutExportFormats::DXF_AC1006_ASTM: - case LayoutExportFormats::DXF_AC1009_ASTM: - case LayoutExportFormats::DXF_AC1012_ASTM: - case LayoutExportFormats::DXF_AC1014_ASTM: - case LayoutExportFormats::DXF_AC1015_ASTM: - case LayoutExportFormats::DXF_AC1018_ASTM: - case LayoutExportFormats::DXF_AC1021_ASTM: - case LayoutExportFormats::DXF_AC1024_ASTM: - case LayoutExportFormats::DXF_AC1027_ASTM: + case LayoutExportFormats::DXF_AAMA: + case LayoutExportFormats::DXF_ASTM: case LayoutExportFormats::RLD: case LayoutExportFormats::NC: case LayoutExportFormats::OBJ: @@ -349,24 +301,8 @@ auto DialogSaveLayout::IsShowGrainline() const -> bool case LayoutExportFormats::EPS: case LayoutExportFormats::TIF: return ui->checkBoxShowGrainline->isChecked(); - case LayoutExportFormats::DXF_AC1006_AAMA: - case LayoutExportFormats::DXF_AC1009_AAMA: - case LayoutExportFormats::DXF_AC1012_AAMA: - case LayoutExportFormats::DXF_AC1014_AAMA: - case LayoutExportFormats::DXF_AC1015_AAMA: - case LayoutExportFormats::DXF_AC1018_AAMA: - case LayoutExportFormats::DXF_AC1021_AAMA: - case LayoutExportFormats::DXF_AC1024_AAMA: - case LayoutExportFormats::DXF_AC1027_AAMA: - case LayoutExportFormats::DXF_AC1006_ASTM: - case LayoutExportFormats::DXF_AC1009_ASTM: - case LayoutExportFormats::DXF_AC1012_ASTM: - case LayoutExportFormats::DXF_AC1014_ASTM: - case LayoutExportFormats::DXF_AC1015_ASTM: - case LayoutExportFormats::DXF_AC1018_ASTM: - case LayoutExportFormats::DXF_AC1021_ASTM: - case LayoutExportFormats::DXF_AC1024_ASTM: - case LayoutExportFormats::DXF_AC1027_ASTM: + case LayoutExportFormats::DXF_AAMA: + case LayoutExportFormats::DXF_ASTM: case LayoutExportFormats::RLD: case LayoutExportFormats::NC: case LayoutExportFormats::OBJ: @@ -516,24 +452,8 @@ void DialogSaveLayout::ShowExample() switch(currentFormat) { - case LayoutExportFormats::DXF_AC1006_AAMA: - case LayoutExportFormats::DXF_AC1009_AAMA: - case LayoutExportFormats::DXF_AC1012_AAMA: - case LayoutExportFormats::DXF_AC1014_AAMA: - case LayoutExportFormats::DXF_AC1015_AAMA: - case LayoutExportFormats::DXF_AC1018_AAMA: - case LayoutExportFormats::DXF_AC1021_AAMA: - case LayoutExportFormats::DXF_AC1024_AAMA: - case LayoutExportFormats::DXF_AC1027_AAMA: - case LayoutExportFormats::DXF_AC1006_ASTM: - case LayoutExportFormats::DXF_AC1009_ASTM: - case LayoutExportFormats::DXF_AC1012_ASTM: - case LayoutExportFormats::DXF_AC1014_ASTM: - case LayoutExportFormats::DXF_AC1015_ASTM: - case LayoutExportFormats::DXF_AC1018_ASTM: - case LayoutExportFormats::DXF_AC1021_ASTM: - case LayoutExportFormats::DXF_AC1024_ASTM: - case LayoutExportFormats::DXF_AC1027_ASTM: + case LayoutExportFormats::DXF_AAMA: + case LayoutExportFormats::DXF_ASTM: ui->checkBoxBinaryDXF->setEnabled(true); ui->checkBoxShowGrainline->setEnabled(false); break; @@ -779,24 +699,8 @@ auto DialogSaveLayout::InitFormats() -> QVector &listDetails) { const LayoutExportFormats format = m_dialogSaveLayout->Format(); - if (format == LayoutExportFormats::DXF_AC1006_AAMA || - format == LayoutExportFormats::DXF_AC1009_AAMA || - format == LayoutExportFormats::DXF_AC1012_AAMA || - format == LayoutExportFormats::DXF_AC1014_AAMA || - format == LayoutExportFormats::DXF_AC1015_AAMA || - format == LayoutExportFormats::DXF_AC1018_AAMA || - format == LayoutExportFormats::DXF_AC1021_AAMA || - format == LayoutExportFormats::DXF_AC1024_AAMA || - format == LayoutExportFormats::DXF_AC1027_AAMA || - format == LayoutExportFormats::DXF_AC1006_ASTM || - format == LayoutExportFormats::DXF_AC1009_ASTM || - format == LayoutExportFormats::DXF_AC1012_ASTM || - format == LayoutExportFormats::DXF_AC1014_ASTM || - format == LayoutExportFormats::DXF_AC1015_ASTM || - format == LayoutExportFormats::DXF_AC1018_ASTM || - format == LayoutExportFormats::DXF_AC1021_ASTM || - format == LayoutExportFormats::DXF_AC1024_ASTM || - format == LayoutExportFormats::DXF_AC1027_ASTM || + if (format == LayoutExportFormats::DXF_AAMA || format == LayoutExportFormats::DXF_ASTM || format == LayoutExportFormats::RLD) { if (m_dialogSaveLayout->Mode() == Draw::Layout) @@ -675,78 +658,14 @@ void MainWindowsNoGUI::ExportApparelLayout(const QVector &details, switch (format) { - case LayoutExportFormats::DXF_AC1006_ASTM: - exporter.SetDxfVersion(DRW::AC1006); - exporter.ExportToASTMDXF(details); - break; - case LayoutExportFormats::DXF_AC1009_ASTM: + case LayoutExportFormats::DXF_ASTM: exporter.SetDxfVersion(DRW::AC1009); exporter.ExportToASTMDXF(details); break; - case LayoutExportFormats::DXF_AC1012_ASTM: - exporter.SetDxfVersion(DRW::AC1012); - exporter.ExportToASTMDXF(details); - break; - case LayoutExportFormats::DXF_AC1014_ASTM: - exporter.SetDxfVersion(DRW::AC1014); - exporter.ExportToASTMDXF(details); - break; - case LayoutExportFormats::DXF_AC1015_ASTM: - exporter.SetDxfVersion(DRW::AC1015); - exporter.ExportToASTMDXF(details); - break; - case LayoutExportFormats::DXF_AC1018_ASTM: - exporter.SetDxfVersion(DRW::AC1018); - exporter.ExportToASTMDXF(details); - break; - case LayoutExportFormats::DXF_AC1021_ASTM: - exporter.SetDxfVersion(DRW::AC1021); - exporter.ExportToASTMDXF(details); - break; - case LayoutExportFormats::DXF_AC1024_ASTM: - exporter.SetDxfVersion(DRW::AC1024); - exporter.ExportToASTMDXF(details); - break; - case LayoutExportFormats::DXF_AC1027_ASTM: - exporter.SetDxfVersion(DRW::AC1027); - exporter.ExportToASTMDXF(details); - break; - case LayoutExportFormats::DXF_AC1006_AAMA: - exporter.SetDxfVersion(DRW::AC1006); - exporter.ExportToAAMADXF(details); - break; - case LayoutExportFormats::DXF_AC1009_AAMA: + case LayoutExportFormats::DXF_AAMA: exporter.SetDxfVersion(DRW::AC1009); exporter.ExportToAAMADXF(details); break; - case LayoutExportFormats::DXF_AC1012_AAMA: - exporter.SetDxfVersion(DRW::AC1012); - exporter.ExportToAAMADXF(details); - break; - case LayoutExportFormats::DXF_AC1014_AAMA: - exporter.SetDxfVersion(DRW::AC1014); - exporter.ExportToAAMADXF(details); - break; - case LayoutExportFormats::DXF_AC1015_AAMA: - exporter.SetDxfVersion(DRW::AC1015); - exporter.ExportToAAMADXF(details); - break; - case LayoutExportFormats::DXF_AC1018_AAMA: - exporter.SetDxfVersion(DRW::AC1018); - exporter.ExportToAAMADXF(details); - break; - case LayoutExportFormats::DXF_AC1021_AAMA: - exporter.SetDxfVersion(DRW::AC1021); - exporter.ExportToAAMADXF(details); - break; - case LayoutExportFormats::DXF_AC1024_AAMA: - exporter.SetDxfVersion(DRW::AC1024); - exporter.ExportToAAMADXF(details); - break; - case LayoutExportFormats::DXF_AC1027_AAMA: - exporter.SetDxfVersion(DRW::AC1027); - exporter.ExportToAAMADXF(details); - break; case LayoutExportFormats::RLD: exporter.ExportToRLD(details); break; diff --git a/src/libs/vlayout/vlayoutdef.h b/src/libs/vlayout/vlayoutdef.h index 538f627f0..e25ef9b11 100644 --- a/src/libs/vlayout/vlayoutdef.h +++ b/src/libs/vlayout/vlayoutdef.h @@ -40,8 +40,8 @@ enum class LayoutExportFormats : qint8 SVG = 0, PDF = 1, PNG = 2, - OBJ = 3, /* Wavefront OBJ*/ - PS = 4, + OBJ = 3, /* Wavefront OBJ*/ + PS = 4, EPS = 5, DXF_AC1006_Flat = 6, /* R10. */ DXF_AC1009_Flat = 7, /* R11 & R12. */ @@ -52,29 +52,13 @@ enum class LayoutExportFormats : qint8 DXF_AC1021_Flat = 12, /* ACAD 2007. */ DXF_AC1024_Flat = 13, /* ACAD 2010. */ DXF_AC1027_Flat = 14, /* ACAD 2013. */ - DXF_AC1006_AAMA = 15, /* R10. */ - DXF_AC1009_AAMA = 16, /* R11 & R12. */ - DXF_AC1012_AAMA = 17, /* R13. */ - DXF_AC1014_AAMA = 18, /* R14. */ - DXF_AC1015_AAMA = 19, /* ACAD 2000. */ - DXF_AC1018_AAMA = 20, /* ACAD 2004. */ - DXF_AC1021_AAMA = 21, /* ACAD 2007. */ - DXF_AC1024_AAMA = 22, /* ACAD 2010. */ - DXF_AC1027_AAMA = 23, /* ACAD 2013. */ - DXF_AC1006_ASTM = 24, /* R10. */ - DXF_AC1009_ASTM = 25, /* R11 & R12. */ - DXF_AC1012_ASTM = 26, /* R13. */ - DXF_AC1014_ASTM = 27, /* R14. */ - DXF_AC1015_ASTM = 28, /* ACAD 2000. */ - DXF_AC1018_ASTM = 29, /* ACAD 2004. */ - DXF_AC1021_ASTM = 30, /* ACAD 2007. */ - DXF_AC1024_ASTM = 31, /* ACAD 2010. */ - DXF_AC1027_ASTM = 32, /* ACAD 2013. */ + DXF_AAMA = 16, /* R11 & R12. */ + DXF_ASTM = 25, /* R11 & R12. */ PDFTiled = 33, - NC = 34, /*G-code. Reserved for future*/ - RLD = 35, /*Raw Layout Data*/ + NC = 34, /*G-code. Reserved for future*/ + RLD = 35, /*Raw Layout Data*/ TIF = 36, - COUNT /*Use only for validation*/ + COUNT /*Use only for validation*/ }; enum class LayoutErrors : qint8 diff --git a/src/libs/vlayout/vlayoutexporter.cpp b/src/libs/vlayout/vlayoutexporter.cpp index bcf92d20e..549f9a26e 100644 --- a/src/libs/vlayout/vlayoutexporter.cpp +++ b/src/libs/vlayout/vlayoutexporter.cpp @@ -40,16 +40,15 @@ #include #include -#include "../vmisc/vmath.h" -#include "../vmisc/defglobal.h" -#include "../vmisc/def.h" -#include "../vobj/vobjpaintdevice.h" -#include "../vdxf/vdxfpaintdevice.h" -#include "vrawlayout.h" -#include "../vmisc/vabstractvalapplication.h" #include "../ifc/exception/vexception.h" -#include "vprintlayout.h" +#include "../vdxf/vdxfpaintdevice.h" +#include "../vmisc/def.h" +#include "../vmisc/defglobal.h" +#include "../vmisc/vabstractapplication.h" +#include "../vobj/vobjpaintdevice.h" #include "vgraphicsfillitem.h" +#include "vprintlayout.h" +#include "vrawlayout.h" namespace { @@ -536,42 +535,10 @@ auto VLayoutExporter::ExportFormatDescription(LayoutExportFormats format) -> QSt return QStringLiteral("AutoCAD DXF 2010 %1 %2").arg(dxfFlatFilesStr, dxfSuffix); case LayoutExportFormats::DXF_AC1027_Flat: return QStringLiteral("AutoCAD DXF 2013 %1 %2").arg(dxfFlatFilesStr, dxfSuffix); - case LayoutExportFormats::DXF_AC1006_AAMA: - return QStringLiteral("AutoCAD DXF R10 AAMA %1 %2").arg(filesStr, dxfSuffix); - case LayoutExportFormats::DXF_AC1009_AAMA: - return QStringLiteral("AutoCAD DXF R11/12 AAMA %1 %2").arg(filesStr, dxfSuffix); - case LayoutExportFormats::DXF_AC1012_AAMA: - return QStringLiteral("AutoCAD DXF R13 AAMA %1 %2").arg(filesStr, dxfSuffix); - case LayoutExportFormats::DXF_AC1014_AAMA: - return QStringLiteral("AutoCAD DXF R14 AAMA %1 %2").arg(filesStr, dxfSuffix); - case LayoutExportFormats::DXF_AC1015_AAMA: - return QStringLiteral("AutoCAD DXF 2000 AAMA %1 %2").arg(filesStr, dxfSuffix); - case LayoutExportFormats::DXF_AC1018_AAMA: - return QStringLiteral("AutoCAD DXF 2004 AAMA %1 %2").arg(filesStr, dxfSuffix); - case LayoutExportFormats::DXF_AC1021_AAMA: - return QStringLiteral("AutoCAD DXF 2007 AAMA %1 %2").arg(filesStr, dxfSuffix); - case LayoutExportFormats::DXF_AC1024_AAMA: - return QStringLiteral("AutoCAD DXF 2010 AAMA %1 %2").arg(filesStr, dxfSuffix); - case LayoutExportFormats::DXF_AC1027_AAMA: - return QStringLiteral("AutoCAD DXF 2013 AAMA %1 %2").arg(filesStr, dxfSuffix); - case LayoutExportFormats::DXF_AC1006_ASTM: - return QStringLiteral("AutoCAD DXF R10 ASTM %1 %2").arg(filesStr, dxfSuffix); - case LayoutExportFormats::DXF_AC1009_ASTM: - return QStringLiteral("AutoCAD DXF R11/12 ASTM %1 %2").arg(filesStr, dxfSuffix); - case LayoutExportFormats::DXF_AC1012_ASTM: - return QStringLiteral("AutoCAD DXF R13 ASTM %1 %2").arg(filesStr, dxfSuffix); - case LayoutExportFormats::DXF_AC1014_ASTM: - return QStringLiteral("AutoCAD DXF R14 ASTM %1 %2").arg(filesStr, dxfSuffix); - case LayoutExportFormats::DXF_AC1015_ASTM: - return QStringLiteral("AutoCAD DXF 2000 ASTM %1 %2").arg(filesStr, dxfSuffix); - case LayoutExportFormats::DXF_AC1018_ASTM: - return QStringLiteral("AutoCAD DXF 2004 ASTM %1 %2").arg(filesStr, dxfSuffix); - case LayoutExportFormats::DXF_AC1021_ASTM: - return QStringLiteral("AutoCAD DXF 2007 ASTM %1 %2").arg(filesStr, dxfSuffix); - case LayoutExportFormats::DXF_AC1024_ASTM: - return QStringLiteral("AutoCAD DXF 2010 ASTM %1 %2").arg(filesStr, dxfSuffix); - case LayoutExportFormats::DXF_AC1027_ASTM: - return QStringLiteral("AutoCAD DXF 2013 ASTM %1 %2").arg(filesStr, dxfSuffix); + case LayoutExportFormats::DXF_AAMA: + return QStringLiteral("AutoCAD DXF AAMA %1 %2").arg(filesStr, dxfSuffix); + case LayoutExportFormats::DXF_ASTM: + return QStringLiteral("AutoCAD DXF ASTM %1 %2").arg(filesStr, dxfSuffix); case LayoutExportFormats::PDFTiled: return QStringLiteral("PDF %1 %2 (*.pdf)").arg(tr("tiled"), filesStr); case LayoutExportFormats::NC: @@ -581,7 +548,7 @@ auto VLayoutExporter::ExportFormatDescription(LayoutExportFormats format) -> QSt case LayoutExportFormats::TIF: return QStringLiteral("TIFF %1 (*.tif)").arg(filesStr); default: - return QString(); + return {}; } } @@ -612,24 +579,8 @@ auto VLayoutExporter::ExportFormatSuffix(LayoutExportFormats format) -> QString case LayoutExportFormats::DXF_AC1021_Flat: case LayoutExportFormats::DXF_AC1024_Flat: case LayoutExportFormats::DXF_AC1027_Flat: - case LayoutExportFormats::DXF_AC1006_AAMA: - case LayoutExportFormats::DXF_AC1009_AAMA: - case LayoutExportFormats::DXF_AC1012_AAMA: - case LayoutExportFormats::DXF_AC1014_AAMA: - case LayoutExportFormats::DXF_AC1015_AAMA: - case LayoutExportFormats::DXF_AC1018_AAMA: - case LayoutExportFormats::DXF_AC1021_AAMA: - case LayoutExportFormats::DXF_AC1024_AAMA: - case LayoutExportFormats::DXF_AC1027_AAMA: - case LayoutExportFormats::DXF_AC1006_ASTM: - case LayoutExportFormats::DXF_AC1009_ASTM: - case LayoutExportFormats::DXF_AC1012_ASTM: - case LayoutExportFormats::DXF_AC1014_ASTM: - case LayoutExportFormats::DXF_AC1015_ASTM: - case LayoutExportFormats::DXF_AC1018_ASTM: - case LayoutExportFormats::DXF_AC1021_ASTM: - case LayoutExportFormats::DXF_AC1024_ASTM: - case LayoutExportFormats::DXF_AC1027_ASTM: + case LayoutExportFormats::DXF_AAMA: + case LayoutExportFormats::DXF_ASTM: return QStringLiteral(".dxf"); case LayoutExportFormats::NC: return QStringLiteral(".nc"); @@ -638,7 +589,7 @@ auto VLayoutExporter::ExportFormatSuffix(LayoutExportFormats format) -> QString case LayoutExportFormats::TIF: return QStringLiteral(".tif"); default: - return QString(); + return {}; } } diff --git a/src/libs/vmisc/vcommonsettings.cpp b/src/libs/vmisc/vcommonsettings.cpp index abb3731c3..15f9ef629 100644 --- a/src/libs/vmisc/vcommonsettings.cpp +++ b/src/libs/vmisc/vcommonsettings.cpp @@ -374,6 +374,22 @@ auto VCommonSettings::PrepareLabelTemplates(const QString ¤tPath) -> QStri return PrepareStandardFiles(currentPath, LabelTemplatesPath(), GetDefPathLabelTemplate()); } +//--------------------------------------------------------------------------------------------------------------------- +auto VCommonSettings::CastToLayoutExportFormat(qint8 f) -> qint8 +{ + qint8 format = f; + if (f == 15 || (f > 16 && f < 23)) + { + format = 16; + } + else if (f == 24 || (f > 26 && f < 33)) + { + format = 26; + } + + return format; +} + //--------------------------------------------------------------------------------------------------------------------- auto VCommonSettings::GetDefPathIndividualMeasurements() -> QString { diff --git a/src/libs/vmisc/vcommonsettings.h b/src/libs/vmisc/vcommonsettings.h index b18f2fcc3..9178e0e36 100644 --- a/src/libs/vmisc/vcommonsettings.h +++ b/src/libs/vmisc/vcommonsettings.h @@ -61,6 +61,8 @@ public: static auto PrepareMultisizeTables(const QString ¤tPath) -> QString; static auto PrepareLabelTemplates(const QString ¤tPath) -> QString; + static auto CastToLayoutExportFormat(qint8 f) -> qint8; + static auto GetDefPathIndividualMeasurements() -> QString; auto GetPathIndividualMeasurements() const -> QString; void SetPathIndividualMeasurements(const QString &value); diff --git a/src/libs/vmisc/vvalentinasettings.cpp b/src/libs/vmisc/vvalentinasettings.cpp index 9ecf4a95b..dd0c894e7 100644 --- a/src/libs/vmisc/vvalentinasettings.cpp +++ b/src/libs/vmisc/vvalentinasettings.cpp @@ -699,7 +699,7 @@ void VValentinaSettings::SetToolPanelScaling(const bool &value) //--------------------------------------------------------------------------------------------------------------------- auto VValentinaSettings::GetLayoutExportFormat() const -> qint8 { - return qvariant_cast(value(*settingLayoutExportFormat, 0)); + return CastToLayoutExportFormat(qvariant_cast(value(*settingLayoutExportFormat, 0))); } //--------------------------------------------------------------------------------------------------------------------- @@ -711,7 +711,7 @@ void VValentinaSettings::SetLayoutExportFormat(qint8 format) //--------------------------------------------------------------------------------------------------------------------- auto VValentinaSettings::GetDetailExportFormat() const -> qint8 { - return qvariant_cast(value(*settingDetailExportFormat, 0)); + return CastToLayoutExportFormat(qvariant_cast(value(*settingDetailExportFormat, 0))); } //---------------------------------------------------------------------------------------------------------------------