diff --git a/src/libs/ifc/schema.qrc b/src/libs/ifc/schema.qrc index 3644ffb8b..78bfb02d4 100644 --- a/src/libs/ifc/schema.qrc +++ b/src/libs/ifc/schema.qrc @@ -34,6 +34,7 @@ schema/pattern/v0.4.8.xsd schema/pattern/v0.5.0.xsd schema/pattern/v0.5.1.xsd + schema/pattern/v0.6.0.xsd schema/standard_measurements/v0.3.0.xsd schema/standard_measurements/v0.4.0.xsd schema/standard_measurements/v0.4.1.xsd diff --git a/src/libs/ifc/schema/pattern/v0.6.0.xsd b/src/libs/ifc/schema/pattern/v0.6.0.xsd new file mode 100644 index 000000000..71bb2b232 --- /dev/null +++ b/src/libs/ifc/schema/pattern/v0.6.0.xsd @@ -0,0 +1,952 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/libs/ifc/xml/vpatternconverter.cpp b/src/libs/ifc/xml/vpatternconverter.cpp index 25bbe6e8c..8c8500f4c 100644 --- a/src/libs/ifc/xml/vpatternconverter.cpp +++ b/src/libs/ifc/xml/vpatternconverter.cpp @@ -58,8 +58,8 @@ class QDomElement; */ const QString VPatternConverter::PatternMinVerStr = QStringLiteral("0.1.0"); -const QString VPatternConverter::PatternMaxVerStr = QStringLiteral("0.5.1"); -const QString VPatternConverter::CurrentSchema = QStringLiteral("://schema/pattern/v0.5.1.xsd"); +const QString VPatternConverter::PatternMaxVerStr = QStringLiteral("0.6.0"); +const QString VPatternConverter::CurrentSchema = QStringLiteral("://schema/pattern/v0.6.0.xsd"); //VPatternConverter::PatternMinVer; // <== DON'T FORGET TO UPDATE TOO!!!! //VPatternConverter::PatternMaxVer; // <== DON'T FORGET TO UPDATE TOO!!!! @@ -215,6 +215,8 @@ QString VPatternConverter::XSDSchema(int ver) const case (0x000500): return QStringLiteral("://schema/pattern/v0.5.0.xsd"); case (0x000501): + return QStringLiteral("://schema/pattern/v0.5.1.xsd"); + case (0x000600): return CurrentSchema; default: InvalidVersion(ver); @@ -361,6 +363,10 @@ void VPatternConverter::ApplyPatches() ValidateXML(XSDSchema(0x000501), m_convertedFileName); V_FALLTHROUGH case (0x000501): + ToV0_6_0(); + ValidateXML(XSDSchema(0x000600), m_convertedFileName); + V_FALLTHROUGH + case (0x000600): break; default: InvalidVersion(m_ver); @@ -379,7 +385,7 @@ void VPatternConverter::DowngradeToCurrentMaxVersion() bool VPatternConverter::IsReadOnly() const { // Check if attribute readOnly was not changed in file format - Q_STATIC_ASSERT_X(VPatternConverter::PatternMaxVer == CONVERTER_VERSION_CHECK(0, 5, 1), + Q_STATIC_ASSERT_X(VPatternConverter::PatternMaxVer == CONVERTER_VERSION_CHECK(0, 6, 0), "Check attribute readOnly."); // Possibly in future attribute readOnly will change position etc. @@ -768,6 +774,16 @@ void VPatternConverter::ToV0_5_1() Save(); } +//--------------------------------------------------------------------------------------------------------------------- +void VPatternConverter::ToV0_6_0() +{ + // TODO. Delete if minimal supported version is 0.6.0 + Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < CONVERTER_VERSION_CHECK(0, 6, 0), + "Time to refactor the code."); + SetVersion(QStringLiteral("0.6.0")); + Save(); +} + //--------------------------------------------------------------------------------------------------------------------- void VPatternConverter::TagUnitToV0_2_0() { diff --git a/src/libs/ifc/xml/vpatternconverter.h b/src/libs/ifc/xml/vpatternconverter.h index 449f75c18..a8d0559e3 100644 --- a/src/libs/ifc/xml/vpatternconverter.h +++ b/src/libs/ifc/xml/vpatternconverter.h @@ -53,7 +53,7 @@ public: static const QString PatternMaxVerStr; static const QString CurrentSchema; static Q_DECL_CONSTEXPR const int PatternMinVer = CONVERTER_VERSION_CHECK(0, 1, 0); - static Q_DECL_CONSTEXPR const int PatternMaxVer = CONVERTER_VERSION_CHECK(0, 5, 1); + static Q_DECL_CONSTEXPR const int PatternMaxVer = CONVERTER_VERSION_CHECK(0, 6, 0); protected: virtual int MinVer() const Q_DECL_OVERRIDE; @@ -105,6 +105,7 @@ private: void ToV0_4_8(); void ToV0_5_0(); void ToV0_5_1(); + void ToV0_6_0(); void TagUnitToV0_2_0(); void TagIncrementToV0_2_0();