Update pattern format version to version 0.7.12.

--HG--
branch : release
This commit is contained in:
Roman Telezhynskyi 2018-09-29 19:47:32 +03:00
parent 4f7f907d8d
commit b5c771b964
4 changed files with 1092 additions and 5 deletions

View File

@ -49,6 +49,7 @@
<file>schema/pattern/v0.7.9.xsd</file>
<file>schema/pattern/v0.7.10.xsd</file>
<file>schema/pattern/v0.7.11.xsd</file>
<file>schema/pattern/v0.7.12.xsd</file>
<file>schema/standard_measurements/v0.3.0.xsd</file>
<file>schema/standard_measurements/v0.4.0.xsd</file>
<file>schema/standard_measurements/v0.4.1.xsd</file>

File diff suppressed because it is too large Load Diff

View File

@ -59,8 +59,8 @@ class QDomElement;
*/
const QString VPatternConverter::PatternMinVerStr = QStringLiteral("0.1.4");
const QString VPatternConverter::PatternMaxVerStr = QStringLiteral("0.7.11");
const QString VPatternConverter::CurrentSchema = QStringLiteral("://schema/pattern/v0.7.11.xsd");
const QString VPatternConverter::PatternMaxVerStr = QStringLiteral("0.7.12");
const QString VPatternConverter::CurrentSchema = QStringLiteral("://schema/pattern/v0.7.12.xsd");
//VPatternConverter::PatternMinVer; // <== DON'T FORGET TO UPDATE TOO!!!!
//VPatternConverter::PatternMaxVer; // <== DON'T FORGET TO UPDATE TOO!!!!
@ -227,7 +227,8 @@ QString VPatternConverter::XSDSchema(int ver) const
std::make_pair(FORMAT_VERSION(0, 7, 8), QStringLiteral("://schema/pattern/v0.7.8.xsd")),
std::make_pair(FORMAT_VERSION(0, 7, 9), QStringLiteral("://schema/pattern/v0.7.9.xsd")),
std::make_pair(FORMAT_VERSION(0, 7, 10), QStringLiteral("://schema/pattern/v0.7.10.xsd")),
std::make_pair(FORMAT_VERSION(0, 7, 11), CurrentSchema)
std::make_pair(FORMAT_VERSION(0, 7, 11), QStringLiteral("://schema/pattern/v0.7.11.xsd")),
std::make_pair(FORMAT_VERSION(0, 7, 12), CurrentSchema)
};
if (schemas.contains(ver))
@ -438,6 +439,10 @@ void VPatternConverter::ApplyPatches()
ValidateXML(XSDSchema(FORMAT_VERSION(0, 7, 11)), m_convertedFileName);
V_FALLTHROUGH
case (FORMAT_VERSION(0, 7, 11)):
ToV0_7_12();
ValidateXML(XSDSchema(FORMAT_VERSION(0, 7, 12)), m_convertedFileName);
V_FALLTHROUGH
case (FORMAT_VERSION(0, 7, 12)):
break;
default:
InvalidVersion(m_ver);
@ -455,7 +460,7 @@ void VPatternConverter::DowngradeToCurrentMaxVersion()
bool VPatternConverter::IsReadOnly() const
{
// Check if attribute readOnly was not changed in file format
Q_STATIC_ASSERT_X(VPatternConverter::PatternMaxVer == FORMAT_VERSION(0, 7, 11),
Q_STATIC_ASSERT_X(VPatternConverter::PatternMaxVer == FORMAT_VERSION(0, 7, 12),
"Check attribute readOnly.");
// Possibly in future attribute readOnly will change position etc.
@ -995,6 +1000,16 @@ void VPatternConverter::ToV0_7_11()
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::ToV0_7_12()
{
// TODO. Delete if minimal supported version is 0.7.12
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FORMAT_VERSION(0, 7, 12),
"Time to refactor the code.");
SetVersion(QStringLiteral("0.7.12"));
Save();
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternConverter::TagUnitToV0_2_0()
{

View File

@ -53,7 +53,7 @@ public:
static const QString PatternMaxVerStr;
static const QString CurrentSchema;
static Q_DECL_CONSTEXPR const int PatternMinVer = FORMAT_VERSION(0, 1, 4);
static Q_DECL_CONSTEXPR const int PatternMaxVer = FORMAT_VERSION(0, 7, 11);
static Q_DECL_CONSTEXPR const int PatternMaxVer = FORMAT_VERSION(0, 7, 12);
protected:
virtual int MinVer() const override;
@ -120,6 +120,7 @@ private:
void ToV0_7_9();
void ToV0_7_10();
void ToV0_7_11();
void ToV0_7_12();
void TagUnitToV0_2_0();
void TagIncrementToV0_2_0();