From b644209406daf78fbd9e6fc179e369e75487dc22 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 26 Oct 2016 14:49:09 +0300 Subject: [PATCH] Resolved issue #580. Extend the list of heights. --HG-- branch : develop --- ChangeLog.txt | 1 + .../dialogs/dialogpatternproperties.cpp | 14 + .../dialogs/dialogpatternproperties.ui | 400 ++++++++++-------- src/libs/ifc/schema.qrc | 1 + src/libs/ifc/schema/pattern/v0.3.8.xsd | 14 + .../schema/standard_measurements/v0.4.3.xsd | 153 +++++++ src/libs/ifc/xml/vabstractpattern.cpp | 36 ++ src/libs/ifc/xml/vabstractpattern.h | 7 + src/libs/ifc/xml/vvstconverter.cpp | 17 +- src/libs/ifc/xml/vvstconverter.h | 5 +- src/libs/vmisc/def.h | 7 +- .../vpatterndb/variables/vmeasurement.cpp | 6 +- 12 files changed, 486 insertions(+), 175 deletions(-) create mode 100644 src/libs/ifc/schema/standard_measurements/v0.4.3.xsd diff --git a/ChangeLog.txt b/ChangeLog.txt index 4b8cb815b..b3e69e059 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -43,6 +43,7 @@ - [#573] New tool: 'Move Point'. - [#577] 10 new colors added for the lines - [#570] Tiled PDF : Margin values correctly taken into account +- [#580] Extend the list of heights. # Version 0.4.5 October 15, 2016 - [#435] Valentina doesn't change the cursor. diff --git a/src/app/valentina/dialogs/dialogpatternproperties.cpp b/src/app/valentina/dialogs/dialogpatternproperties.cpp index 31e29d4ca..c406548cf 100644 --- a/src/app/valentina/dialogs/dialogpatternproperties.cpp +++ b/src/app/valentina/dialogs/dialogpatternproperties.cpp @@ -438,6 +438,13 @@ void DialogPatternProperties::GeneralInfoChanged() //--------------------------------------------------------------------------------------------------------------------- void DialogPatternProperties::SetHeightsChecked(bool enabled) { + ui->checkBoxH50->setChecked(enabled); + ui->checkBoxH56->setChecked(enabled); + ui->checkBoxH62->setChecked(enabled); + ui->checkBoxH68->setChecked(enabled); + ui->checkBoxH74->setChecked(enabled); + ui->checkBoxH80->setChecked(enabled); + ui->checkBoxH86->setChecked(enabled); ui->checkBoxH92->setChecked(enabled); ui->checkBoxH98->setChecked(enabled); ui->checkBoxH104->setChecked(enabled); @@ -486,6 +493,13 @@ void DialogPatternProperties::InitHeights() { Init(ui->checkBoxAllHeights, static_cast(GHeights::ALL), &DialogPatternProperties::SelectAll); + Init(ui->checkBoxH50, static_cast(GHeights::H50), &DialogPatternProperties::CheckStateHeight); + Init(ui->checkBoxH56, static_cast(GHeights::H56), &DialogPatternProperties::CheckStateHeight); + Init(ui->checkBoxH62, static_cast(GHeights::H62), &DialogPatternProperties::CheckStateHeight); + Init(ui->checkBoxH68, static_cast(GHeights::H68), &DialogPatternProperties::CheckStateHeight); + Init(ui->checkBoxH74, static_cast(GHeights::H74), &DialogPatternProperties::CheckStateHeight); + Init(ui->checkBoxH80, static_cast(GHeights::H80), &DialogPatternProperties::CheckStateHeight); + Init(ui->checkBoxH86, static_cast(GHeights::H86), &DialogPatternProperties::CheckStateHeight); Init(ui->checkBoxH92, static_cast(GHeights::H92), &DialogPatternProperties::CheckStateHeight); Init(ui->checkBoxH98, static_cast(GHeights::H98), &DialogPatternProperties::CheckStateHeight); Init(ui->checkBoxH104, static_cast(GHeights::H104), &DialogPatternProperties::CheckStateHeight); diff --git a/src/app/valentina/dialogs/dialogpatternproperties.ui b/src/app/valentina/dialogs/dialogpatternproperties.ui index 43970b9b2..7738866db 100644 --- a/src/app/valentina/dialogs/dialogpatternproperties.ui +++ b/src/app/valentina/dialogs/dialogpatternproperties.ui @@ -7,7 +7,7 @@ 0 0 727 - 649 + 532 @@ -21,7 +21,7 @@ - 3 + 1 @@ -304,45 +304,7 @@ QLayout::SetMaximumSize - - - - true - - - - 0 - 0 - - - - 92 - - - true - - - - - - - true - - - - 0 - 0 - - - - 146 - - - true - - - - + true @@ -361,8 +323,58 @@ - - + + + + 50 + + + true + + + + + + + 56 + + + true + + + + + + + 62 + + + true + + + + + + + 68 + + + true + + + + + + + 74 + + + true + + + + + true @@ -373,14 +385,34 @@ - 152 + 92 true - + + + + 86 + + + true + + + + + + + 80 + + + true + + + + true @@ -405,26 +437,7 @@ - - - - true - - - - 0 - 0 - - - - 158 - - - true - - - - + true @@ -443,26 +456,7 @@ - - - - true - - - - 0 - 0 - - - - 164 - - - true - - - - + true @@ -481,26 +475,7 @@ - - - - true - - - - 0 - 0 - - - - 170 - - - true - - - - + true @@ -519,26 +494,7 @@ - - - - true - - - - 0 - 0 - - - - 176 - - - true - - - - + true @@ -557,26 +513,7 @@ - - - - true - - - - 0 - 0 - - - - 182 - - - true - - - - + true @@ -595,26 +532,7 @@ - - - - true - - - - 0 - 0 - - - - 188 - - - true - - - - + true @@ -633,7 +551,159 @@ + + + + true + + + + 0 + 0 + + + + 146 + + + true + + + + + + true + + + + 0 + 0 + + + + 152 + + + true + + + + + + + true + + + + 0 + 0 + + + + 158 + + + true + + + + + + + true + + + + 0 + 0 + + + + 164 + + + true + + + + + + + true + + + + 0 + 0 + + + + 170 + + + true + + + + + + + true + + + + 0 + 0 + + + + 176 + + + true + + + + + + + true + + + + 0 + 0 + + + + 182 + + + true + + + + + + + true + + + + 0 + 0 + + + + 188 + + + true + + + + true diff --git a/src/libs/ifc/schema.qrc b/src/libs/ifc/schema.qrc index bcc912f3c..33ca3fdf5 100644 --- a/src/libs/ifc/schema.qrc +++ b/src/libs/ifc/schema.qrc @@ -26,6 +26,7 @@ schema/standard_measurements/v0.4.0.xsd schema/standard_measurements/v0.4.1.xsd schema/standard_measurements/v0.4.2.xsd + schema/standard_measurements/v0.4.3.xsd schema/individual_measurements/v0.2.0.xsd schema/individual_measurements/v0.3.0.xsd schema/individual_measurements/v0.3.1.xsd diff --git a/src/libs/ifc/schema/pattern/v0.3.8.xsd b/src/libs/ifc/schema/pattern/v0.3.8.xsd index 7533631a6..aa31828bc 100644 --- a/src/libs/ifc/schema/pattern/v0.3.8.xsd +++ b/src/libs/ifc/schema/pattern/v0.3.8.xsd @@ -24,6 +24,13 @@ + + + + + + + @@ -494,6 +501,13 @@ + + + + + + + diff --git a/src/libs/ifc/schema/standard_measurements/v0.4.3.xsd b/src/libs/ifc/schema/standard_measurements/v0.4.3.xsd new file mode 100644 index 000000000..cc2b42c85 --- /dev/null +++ b/src/libs/ifc/schema/standard_measurements/v0.4.3.xsd @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/libs/ifc/xml/vabstractpattern.cpp b/src/libs/ifc/xml/vabstractpattern.cpp index 4246c9091..c7ed109f2 100644 --- a/src/libs/ifc/xml/vabstractpattern.cpp +++ b/src/libs/ifc/xml/vabstractpattern.cpp @@ -104,6 +104,13 @@ const QString VAbstractPattern::AttrArrows = QStringLiteral("arrows"); const QString VAbstractPattern::AttrAll = QStringLiteral("all"); +const QString VAbstractPattern::AttrH50 = QStringLiteral("h50"); +const QString VAbstractPattern::AttrH56 = QStringLiteral("h56"); +const QString VAbstractPattern::AttrH62 = QStringLiteral("h62"); +const QString VAbstractPattern::AttrH68 = QStringLiteral("h68"); +const QString VAbstractPattern::AttrH74 = QStringLiteral("h74"); +const QString VAbstractPattern::AttrH80 = QStringLiteral("h80"); +const QString VAbstractPattern::AttrH86 = QStringLiteral("h86"); const QString VAbstractPattern::AttrH92 = QStringLiteral("h92"); const QString VAbstractPattern::AttrH98 = QStringLiteral("h98"); const QString VAbstractPattern::AttrH104 = QStringLiteral("h104"); @@ -657,7 +664,15 @@ QStringList VAbstractPattern::getPatternPieces() const QMap VAbstractPattern::GetGradationHeights() const { QMap map; + map.insert(GHeights::ALL, true); + map.insert(GHeights::H50, true); + map.insert(GHeights::H56, true); + map.insert(GHeights::H62, true); + map.insert(GHeights::H68, true); + map.insert(GHeights::H74, true); + map.insert(GHeights::H80, true); + map.insert(GHeights::H86, true); map.insert(GHeights::H92, true); map.insert(GHeights::H98, true); map.insert(GHeights::H104, true); @@ -705,6 +720,13 @@ QMap VAbstractPattern::GetGradationHeights() const map.insert(GHeights::ALL, false); } + map.insert(GHeights::H50, GetParametrBool(domElement, AttrH50, defValue)); + map.insert(GHeights::H56, GetParametrBool(domElement, AttrH56, defValue)); + map.insert(GHeights::H62, GetParametrBool(domElement, AttrH62, defValue)); + map.insert(GHeights::H68, GetParametrBool(domElement, AttrH68, defValue)); + map.insert(GHeights::H74, GetParametrBool(domElement, AttrH74, defValue)); + map.insert(GHeights::H80, GetParametrBool(domElement, AttrH80, defValue)); + map.insert(GHeights::H86, GetParametrBool(domElement, AttrH86, defValue)); map.insert(GHeights::H92, GetParametrBool(domElement, AttrH92, defValue)); map.insert(GHeights::H98, GetParametrBool(domElement, AttrH98, defValue)); map.insert(GHeights::H104, GetParametrBool(domElement, AttrH104, defValue)); @@ -763,6 +785,13 @@ void VAbstractPattern::SetGradationHeights(const QMap &options) SetAttribute(domElement, AttrAll, options.value(GHeights::ALL)); if (options.value(GHeights::ALL)) { + domElement.removeAttribute(AttrH50); + domElement.removeAttribute(AttrH56); + domElement.removeAttribute(AttrH62); + domElement.removeAttribute(AttrH68); + domElement.removeAttribute(AttrH74); + domElement.removeAttribute(AttrH80); + domElement.removeAttribute(AttrH86); domElement.removeAttribute(AttrH92); domElement.removeAttribute(AttrH98); domElement.removeAttribute(AttrH104); @@ -784,6 +813,13 @@ void VAbstractPattern::SetGradationHeights(const QMap &options) } else { + SetAttribute(domElement, AttrH50, options.value(GHeights::H50)); + SetAttribute(domElement, AttrH56, options.value(GHeights::H56)); + SetAttribute(domElement, AttrH62, options.value(GHeights::H62)); + SetAttribute(domElement, AttrH68, options.value(GHeights::H68)); + SetAttribute(domElement, AttrH74, options.value(GHeights::H74)); + SetAttribute(domElement, AttrH80, options.value(GHeights::H80)); + SetAttribute(domElement, AttrH86, options.value(GHeights::H86)); SetAttribute(domElement, AttrH92, options.value(GHeights::H92)); SetAttribute(domElement, AttrH98, options.value(GHeights::H98)); SetAttribute(domElement, AttrH104, options.value(GHeights::H104)); diff --git a/src/libs/ifc/xml/vabstractpattern.h b/src/libs/ifc/xml/vabstractpattern.h index 50aeb8521..d5036b3f0 100644 --- a/src/libs/ifc/xml/vabstractpattern.h +++ b/src/libs/ifc/xml/vabstractpattern.h @@ -209,6 +209,13 @@ public: static const QString AttrAll; + static const QString AttrH50; + static const QString AttrH56; + static const QString AttrH62; + static const QString AttrH68; + static const QString AttrH74; + static const QString AttrH80; + static const QString AttrH86; static const QString AttrH92; static const QString AttrH98; static const QString AttrH104; diff --git a/src/libs/ifc/xml/vvstconverter.cpp b/src/libs/ifc/xml/vvstconverter.cpp index eb8c85d8a..051255156 100644 --- a/src/libs/ifc/xml/vvstconverter.cpp +++ b/src/libs/ifc/xml/vvstconverter.cpp @@ -54,8 +54,8 @@ */ const QString VVSTConverter::MeasurementMinVerStr = QStringLiteral("0.3.0"); -const QString VVSTConverter::MeasurementMaxVerStr = QStringLiteral("0.4.2"); -const QString VVSTConverter::CurrentSchema = QStringLiteral("://schema/standard_measurements/v0.4.2.xsd"); +const QString VVSTConverter::MeasurementMaxVerStr = QStringLiteral("0.4.3"); +const QString VVSTConverter::CurrentSchema = QStringLiteral("://schema/standard_measurements/v0.4.3.xsd"); //VVSTConverter::MeasurementMinVer; // <== DON'T FORGET TO UPDATE TOO!!!! //VVSTConverter::MeasurementMaxVer; // <== DON'T FORGET TO UPDATE TOO!!!! @@ -83,6 +83,8 @@ QString VVSTConverter::XSDSchema(int ver) const case (0x000401): return QStringLiteral("://schema/standard_measurements/v0.4.1.xsd"); case (0x000402): + return QStringLiteral("://schema/standard_measurements/v0.4.2.xsd"); + case (0x000403): return CurrentSchema; default: InvalidVersion(ver); @@ -110,6 +112,10 @@ void VVSTConverter::ApplyPatches() ValidateXML(XSDSchema(0x000402), fileName); V_FALLTHROUGH case (0x000402): + ToV0_4_3(); + ValidateXML(XSDSchema(0x000403), fileName); + V_FALLTHROUGH + case (0x000403): break; default: break; @@ -313,3 +319,10 @@ void VVSTConverter::ToV0_4_2() ConvertMeasurementsToV0_4_2(); Save(); } + +//--------------------------------------------------------------------------------------------------------------------- +void VVSTConverter::ToV0_4_3() +{ + SetVersion(QStringLiteral("0.4.3")); + Save(); +} diff --git a/src/libs/ifc/xml/vvstconverter.h b/src/libs/ifc/xml/vvstconverter.h index a1c6fb87d..d76ccc3b9 100644 --- a/src/libs/ifc/xml/vvstconverter.h +++ b/src/libs/ifc/xml/vvstconverter.h @@ -51,10 +51,10 @@ public: // GCC 4.6 doesn't allow constexpr and const together #if !defined(__INTEL_COMPILER) && !defined(__clang__) && defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) <= 406 static Q_DECL_CONSTEXPR int MeasurementMinVer = CONVERTER_VERSION_CHECK(0, 3, 0); - static Q_DECL_CONSTEXPR int MeasurementMaxVer = CONVERTER_VERSION_CHECK(0, 4, 2); + static Q_DECL_CONSTEXPR int MeasurementMaxVer = CONVERTER_VERSION_CHECK(0, 4, 3); #else static Q_DECL_CONSTEXPR const int MeasurementMinVer = CONVERTER_VERSION_CHECK(0, 3, 0); - static Q_DECL_CONSTEXPR const int MeasurementMaxVer = CONVERTER_VERSION_CHECK(0, 4, 2); + static Q_DECL_CONSTEXPR const int MeasurementMaxVer = CONVERTER_VERSION_CHECK(0, 4, 3); #endif protected: @@ -82,6 +82,7 @@ private: void ToV0_4_0(); void ToV0_4_1(); void ToV0_4_2(); + void ToV0_4_3(); }; //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vmisc/def.h b/src/libs/vmisc/def.h index dd5dda5e4..e2f3a8ae1 100644 --- a/src/libs/vmisc/def.h +++ b/src/libs/vmisc/def.h @@ -165,9 +165,10 @@ enum class VarType : char { Measurement, Increment, LineLength, CurveLength, Cur ArcRadius, Unknown }; enum class GHeights : unsigned char { ALL, - H92=92, H98=98, H104=104, H110=110, H116=116, H122=122, H128=128, H134=134, - H140=140, H146=146, H152=152, H158=158, H164=164, H170=170, H176=176, H182=182, - H188=188, H194=194}; + H50=50, H56=56, H62=62, H68=68, H74=74, H80=80, H86=86, H92=92, + H98=98, H104=104, H110=110, H116=116, H122=122, H128=128, H134=134, H140=140, + H146=146, H152=152, H158=158, H164=164, H170=170, H176=176, H182=182, H188=188, + H194=194}; enum class GSizes : unsigned char { ALL, S22=22, S24=24, S26=26, S28=28, S30=30, S32=32, S34=34, S36=36, S38=38, S40=40, diff --git a/src/libs/vpatterndb/variables/vmeasurement.cpp b/src/libs/vpatterndb/variables/vmeasurement.cpp index 3125cd142..19ac3a419 100644 --- a/src/libs/vpatterndb/variables/vmeasurement.cpp +++ b/src/libs/vpatterndb/variables/vmeasurement.cpp @@ -116,7 +116,7 @@ QStringList VMeasurement::ListHeights(QMap heights, Unit pattern if (list.isEmpty()) { - // from 92 cm to 194 cm + // from 50 cm to 194 cm list = VMeasurement::WholeListHeights(patternUnit); } return list; @@ -159,8 +159,8 @@ QStringList VMeasurement::WholeListHeights(Unit patternUnit) qWarning()<<"Standard table doesn't support inches."; return list; } - // from 92 cm to 194 cm - for (int i = 92; i<= 194; i = i+6) + // from 50 cm to 194 cm + for (int i = 50; i<= 194; i = i+6) { ListValue(list, i, patternUnit); }