Relax requirements for the shiftA attribute.
This commit is contained in:
parent
d6e555f482
commit
c2f2c62b1d
|
@ -69,6 +69,7 @@
|
|||
<file>schema/multisize_measurements/v0.4.3.xsd</file>
|
||||
<file>schema/multisize_measurements/v0.4.4.xsd</file>
|
||||
<file>schema/multisize_measurements/v0.5.0.xsd</file>
|
||||
<file>schema/multisize_measurements/v0.5.1.xsd</file>
|
||||
<file>schema/individual_measurements/v0.2.0.xsd</file>
|
||||
<file>schema/individual_measurements/v0.3.0.xsd</file>
|
||||
<file>schema/individual_measurements/v0.3.1.xsd</file>
|
||||
|
|
125
src/libs/ifc/schema/multisize_measurements/v0.5.1.xsd
Normal file
125
src/libs/ifc/schema/multisize_measurements/v0.5.1.xsd
Normal file
|
@ -0,0 +1,125 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
|
||||
<xs:element name="vst">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="version" type="formatVersion"/>
|
||||
<xs:element name="read-only" type="xs:boolean"/>
|
||||
<xs:element name="notes" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
||||
<xs:element name="unit" type="units"/>
|
||||
<xs:element name="pm_system" type="psCode"/>
|
||||
<xs:element name="dimensions">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="dimension" minOccurs="0" maxOccurs="3">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="labels" minOccurs="0" maxOccurs="1">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="label" minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:complexType>
|
||||
<xs:attribute name="value" type="dimesionValue" use="required"/>
|
||||
<xs:attribute name="label" type="xs:string" use="required"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="type" type="dimensionType" use="required"/>
|
||||
<xs:attribute name="base" type="dimesionValue" use="required"/>
|
||||
<xs:attribute name="min" type="dimesionValue" use="required"/>
|
||||
<xs:attribute name="max" type="dimesionValue" use="required"/>
|
||||
<xs:attribute name="step" type="dimensionStep" use="required"/>
|
||||
<xs:attribute name="circumference" type="xs:boolean"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="fullCircumference" type="xs:boolean"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="restrictions">
|
||||
</xs:element>
|
||||
<xs:element name="body-measurements">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="m" minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="corrections" minOccurs="0" maxOccurs="1">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="correction" minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:complexType>
|
||||
<xs:attribute name="coordinates" type="xs:string" use="required"/>
|
||||
<xs:attribute name="correction" type="xs:double" use="required"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="name" type="shortName" use="required"/>
|
||||
<xs:attribute name="base" type="xs:double" use="required"/>
|
||||
<xs:attribute name="shiftA" type="xs:double"/>
|
||||
<xs:attribute name="shiftB" type="xs:double"/>
|
||||
<xs:attribute name="shiftC" type="xs:double"/>
|
||||
<xs:attribute name="full_name" type="xs:string"/>
|
||||
<xs:attribute name="description" type="xs:string"/>
|
||||
<xs:attribute name="specialUnits" type="xs:boolean"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:unique name="measurementName">
|
||||
<xs:selector xpath="body-measurements/m"/>
|
||||
<xs:field xpath="@name"/>
|
||||
</xs:unique>
|
||||
</xs:element>
|
||||
<xs:simpleType name="shortName">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="([^\p{Nd}\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;'\"]){1,1}([^\p{Zs}*/&|!<>^ \()\-−+.,٫, ٬.’=?:;\"]){0,}"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="units">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="mm"/>
|
||||
<xs:enumeration value="cm"/>
|
||||
<xs:enumeration value="inch"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="formatVersion">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="psCode">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="(([0-9]|[1-4][0-9]|5[0-4])|998)"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="dimensionType">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="x"/>
|
||||
<xs:enumeration value="y"/>
|
||||
<xs:enumeration value="w"/>
|
||||
<xs:enumeration value="z"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="dimesionValue">
|
||||
<xs:restriction base="xs:unsignedInt">
|
||||
<xs:minInclusive value="6"/>
|
||||
<xs:maxInclusive value="2720"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="dimensionStep">
|
||||
<xs:restriction base="xs:unsignedInt">
|
||||
<xs:minInclusive value="0"/>
|
||||
<xs:maxInclusive value="80"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:schema>
|
|
@ -54,8 +54,8 @@
|
|||
*/
|
||||
|
||||
const QString VVSTConverter::MeasurementMinVerStr = QStringLiteral("0.3.0");
|
||||
const QString VVSTConverter::MeasurementMaxVerStr = QStringLiteral("0.5.0");
|
||||
const QString VVSTConverter::CurrentSchema = QStringLiteral("://schema/multisize_measurements/v0.5.0.xsd");
|
||||
const QString VVSTConverter::MeasurementMaxVerStr = QStringLiteral("0.5.1");
|
||||
const QString VVSTConverter::CurrentSchema = QStringLiteral("://schema/multisize_measurements/v0.5.1.xsd");
|
||||
|
||||
//VVSTConverter::MeasurementMinVer; // <== DON'T FORGET TO UPDATE TOO!!!!
|
||||
//VVSTConverter::MeasurementMaxVer; // <== DON'T FORGET TO UPDATE TOO!!!!
|
||||
|
@ -83,7 +83,8 @@ QString VVSTConverter::XSDSchema(int ver) const
|
|||
std::make_pair(FORMAT_VERSION(0, 4, 2), QStringLiteral("://schema/multisize_measurements/v0.4.2.xsd")),
|
||||
std::make_pair(FORMAT_VERSION(0, 4, 3), QStringLiteral("://schema/multisize_measurements/v0.4.3.xsd")),
|
||||
std::make_pair(FORMAT_VERSION(0, 4, 4), QStringLiteral("://schema/multisize_measurements/v0.4.4.xsd")),
|
||||
std::make_pair(FORMAT_VERSION(0, 5, 0), CurrentSchema),
|
||||
std::make_pair(FORMAT_VERSION(0, 5, 0), QStringLiteral("://schema/multisize_measurements/v0.5.0.xsd")),
|
||||
std::make_pair(FORMAT_VERSION(0, 5, 1), CurrentSchema),
|
||||
};
|
||||
|
||||
if (schemas.contains(ver))
|
||||
|
@ -126,6 +127,10 @@ void VVSTConverter::ApplyPatches()
|
|||
ValidateXML(XSDSchema(FORMAT_VERSION(0, 5, 0)));
|
||||
Q_FALLTHROUGH();
|
||||
case (FORMAT_VERSION(0, 5, 0)):
|
||||
ToV0_5_1();
|
||||
ValidateXML(XSDSchema(FORMAT_VERSION(0, 5, 1)));
|
||||
Q_FALLTHROUGH();
|
||||
case (FORMAT_VERSION(0, 5, 1)):
|
||||
break;
|
||||
default:
|
||||
InvalidVersion(m_ver);
|
||||
|
@ -144,7 +149,7 @@ void VVSTConverter::DowngradeToCurrentMaxVersion()
|
|||
bool VVSTConverter::IsReadOnly() const
|
||||
{
|
||||
// Check if attribute read-only was not changed in file format
|
||||
Q_STATIC_ASSERT_X(VVSTConverter::MeasurementMaxVer == FORMAT_VERSION(0, 5, 0),
|
||||
Q_STATIC_ASSERT_X(VVSTConverter::MeasurementMaxVer == FORMAT_VERSION(0, 5, 1),
|
||||
"Check attribute read-only.");
|
||||
|
||||
// Possibly in future attribute read-only will change position etc.
|
||||
|
@ -492,3 +497,14 @@ void VVSTConverter::ToV0_5_0()
|
|||
ConvertMeasurementsToV0_5_0();
|
||||
Save();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VVSTConverter::ToV0_5_1()
|
||||
{
|
||||
// TODO. Delete if minimal supported version is 0.5.1
|
||||
Q_STATIC_ASSERT_X(VVSTConverter::MeasurementMinVer < FORMAT_VERSION(0, 5, 1),
|
||||
"Time to refactor the code.");
|
||||
|
||||
SetVersion(QStringLiteral("0.5.1"));
|
||||
Save();
|
||||
}
|
||||
|
|
|
@ -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 = FORMAT_VERSION(0, 3, 0);
|
||||
static Q_DECL_CONSTEXPR int MeasurementMaxVer = FORMAT_VERSION(0, 5, 0);
|
||||
static Q_DECL_CONSTEXPR int MeasurementMaxVer = FORMAT_VERSION(0, 5, 1);
|
||||
#else
|
||||
static Q_DECL_CONSTEXPR const int MeasurementMinVer = FORMAT_VERSION(0, 3, 0);
|
||||
static Q_DECL_CONSTEXPR const int MeasurementMaxVer = FORMAT_VERSION(0, 5, 0);
|
||||
static Q_DECL_CONSTEXPR const int MeasurementMaxVer = FORMAT_VERSION(0, 5, 1);
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
@ -90,6 +90,7 @@ private:
|
|||
void ToV0_4_3();
|
||||
void ToV0_4_4();
|
||||
void ToV0_5_0();
|
||||
void ToV0_5_1();
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -1274,7 +1274,6 @@ QDomElement VMeasurements::MakeEmpty(const QString &name, const QString &formula
|
|||
if (type == MeasurementsType::Multisize)
|
||||
{
|
||||
SetAttribute(element, AttrBase, QChar('0'));
|
||||
SetAttribute(element, AttrShiftA, QChar('0'));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user