From 3e1cde0719a852eb9364be5dabc652d487303619 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 10 Mar 2017 11:22:15 +0200 Subject: [PATCH] Updated file format version. --HG-- branch : feature --- ChangeLog.txt | 1 - src/libs/ifc/schema.qrc | 1 + src/libs/ifc/schema/pattern/v0.4.3.xsd | 871 +++++++++++++++++++++++++ src/libs/ifc/xml/vpatternconverter.cpp | 23 +- src/libs/ifc/xml/vpatternconverter.h | 4 +- 5 files changed, 894 insertions(+), 6 deletions(-) create mode 100644 src/libs/ifc/schema/pattern/v0.4.3.xsd diff --git a/ChangeLog.txt b/ChangeLog.txt index 788da933b..7cb5477de 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,5 +1,4 @@ # Version 0.5.0 -- Add 200 in heights - [#581] User can now filter input lists by keyword in function wizard. - [#24] User can now add labels with different information on the detail - [#505] New installer script based on Inno Setup 5. diff --git a/src/libs/ifc/schema.qrc b/src/libs/ifc/schema.qrc index 95b4fe6f2..1056de83e 100644 --- a/src/libs/ifc/schema.qrc +++ b/src/libs/ifc/schema.qrc @@ -26,6 +26,7 @@ schema/pattern/v0.4.0.xsd schema/pattern/v0.4.1.xsd schema/pattern/v0.4.2.xsd + schema/pattern/v0.4.3.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.4.3.xsd b/src/libs/ifc/schema/pattern/v0.4.3.xsd new file mode 100644 index 000000000..f671f2b8a --- /dev/null +++ b/src/libs/ifc/schema/pattern/v0.4.3.xsd @@ -0,0 +1,871 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/libs/ifc/xml/vpatternconverter.cpp b/src/libs/ifc/xml/vpatternconverter.cpp index 4b8f40465..64fc3c4e6 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.4.2"); -const QString VPatternConverter::CurrentSchema = QStringLiteral("://schema/pattern/v0.4.2.xsd"); +const QString VPatternConverter::PatternMaxVerStr = QStringLiteral("0.4.3"); +const QString VPatternConverter::CurrentSchema = QStringLiteral("://schema/pattern/v0.4.3.xsd"); //VPatternConverter::PatternMinVer; // <== DON'T FORGET TO UPDATE TOO!!!! //VPatternConverter::PatternMaxVer; // <== DON'T FORGET TO UPDATE TOO!!!! @@ -202,6 +202,8 @@ QString VPatternConverter::XSDSchema(int ver) const case (0x000401): return QStringLiteral("://schema/pattern/v0.4.1.xsd"); case (0x000402): + return QStringLiteral("://schema/pattern/v0.4.2.xsd"); + case (0x000403): return CurrentSchema; default: InvalidVersion(ver); @@ -315,6 +317,10 @@ void VPatternConverter::ApplyPatches() ValidateXML(XSDSchema(0x000402), m_convertedFileName); V_FALLTHROUGH case (0x000402): + ToV0_4_3(); + ValidateXML(XSDSchema(0x000403), m_convertedFileName); + V_FALLTHROUGH + case (0x000403): break; default: InvalidVersion(m_ver); @@ -333,7 +339,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, 4, 2), + Q_STATIC_ASSERT_X(VPatternConverter::PatternMaxVer == CONVERTER_VERSION_CHECK(0, 4, 3), "Check attribute readOnly."); // Possibly in future attribute readOnly will change position etc. @@ -638,6 +644,17 @@ void VPatternConverter::ToV0_4_2() Save(); } +//--------------------------------------------------------------------------------------------------------------------- +void VPatternConverter::ToV0_4_3() +{ + // TODO. Delete if minimal supported version is 0.4.3 + Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < CONVERTER_VERSION_CHECK(0, 4, 3), + "Time to refactor the code."); + + SetVersion(QStringLiteral("0.4.3")); + Save(); +} + //--------------------------------------------------------------------------------------------------------------------- void VPatternConverter::TagUnitToV0_2_0() { diff --git a/src/libs/ifc/xml/vpatternconverter.h b/src/libs/ifc/xml/vpatternconverter.h index 82636f2b5..649acd5e8 100644 --- a/src/libs/ifc/xml/vpatternconverter.h +++ b/src/libs/ifc/xml/vpatternconverter.h @@ -55,10 +55,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 PatternMinVer = CONVERTER_VERSION_CHECK(0, 1, 0); - static Q_DECL_CONSTEXPR int PatternMaxVer = CONVERTER_VERSION_CHECK(0, 4, 2); + static Q_DECL_CONSTEXPR int PatternMaxVer = CONVERTER_VERSION_CHECK(0, 4, 3); #else static Q_DECL_CONSTEXPR const int PatternMinVer = CONVERTER_VERSION_CHECK(0, 1, 0); - static Q_DECL_CONSTEXPR const int PatternMaxVer = CONVERTER_VERSION_CHECK(0, 4, 2); + static Q_DECL_CONSTEXPR const int PatternMaxVer = CONVERTER_VERSION_CHECK(0, 4, 3); #endif protected: