From 833c5071486b7a86429df68052b6256fa66ed6a3 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 11 Nov 2015 16:26:48 +0200 Subject: [PATCH] New measurement (N08) rise_length_side. --HG-- branch : feature --- src/app/tape/share/resources/diagrams.qrc | 1 + src/app/tape/share/resources/diagrams/Np5.png | Bin 0 -> 6445 bytes src/app/tape/tape.pro | 1 + src/libs/ifc/schema.qrc | 3 + .../schema/individual_measurements/v0.3.3.xsd | 72 ++++ src/libs/ifc/schema/pattern/v0.2.1.xsd | 329 ++++++++++++++++++ .../schema/standard_measurements/v0.4.2.xsd | 66 ++++ src/libs/ifc/xml/vabstractmconverter.cpp | 13 +- src/libs/ifc/xml/vabstractmconverter.h | 1 + src/libs/ifc/xml/vpatternconverter.cpp | 45 ++- src/libs/ifc/xml/vpatternconverter.h | 4 + src/libs/ifc/xml/vvitconverter.cpp | 49 ++- src/libs/ifc/xml/vvitconverter.h | 2 + src/libs/ifc/xml/vvstconverter.cpp | 49 ++- src/libs/ifc/xml/vvstconverter.h | 2 + src/libs/vmisc/def.cpp | 6 +- src/libs/vmisc/def.h | 1 + .../vpatterndb/vtranslatemeasurements.cpp | 7 + .../ValentinaTest/tst_measurementregexp.cpp | 1 + 19 files changed, 643 insertions(+), 9 deletions(-) create mode 100644 src/app/tape/share/resources/diagrams/Np5.png create mode 100644 src/libs/ifc/schema/individual_measurements/v0.3.3.xsd create mode 100644 src/libs/ifc/schema/pattern/v0.2.1.xsd create mode 100644 src/libs/ifc/schema/standard_measurements/v0.4.2.xsd diff --git a/src/app/tape/share/resources/diagrams.qrc b/src/app/tape/share/resources/diagrams.qrc index ee4476135..0f814d09f 100644 --- a/src/app/tape/share/resources/diagrams.qrc +++ b/src/app/tape/share/resources/diagrams.qrc @@ -76,6 +76,7 @@ diagrams/Np2.png diagrams/Np3.png diagrams/Np4.png + diagrams/Np5.png diagrams/Op1.png diagrams/Op2.png diagrams/Op3.png diff --git a/src/app/tape/share/resources/diagrams/Np5.png b/src/app/tape/share/resources/diagrams/Np5.png new file mode 100644 index 0000000000000000000000000000000000000000..737e6bef53cc4c2c4c83be00dbb4c98e436cafac GIT binary patch literal 6445 zcmWj|2Q=0H_e=JSjAv)_tS4k;B+1JDKJVG&*+g~`S>+j7PZFWb_snONnV)RgTgb{L zWWMnCKj(ALJ@=mTS$BT!{lpp>JffvyrvdHxE znwtDS5NU{f2)bsH`{_J>NWMT#O-rssck1N<0FZti&HH9SGdtG7-b|D4ug)`H$jUTm zu`b=zu&b2NkC*;MtxxeK#B32u>*49pMK|xkpgb>-LDgpYeLlfjQkaRE#|KJTGIz5J zIm@9K^F1;7i3ew7+hQ6(#Hj7!_aoFWu=Qfu|0G^3^FFa_V$lf!hZ}!7Hn%s~y7yv% zFnBz~r(%G!U|cgHFhvZf~k%AYH#zWdasZ_eK9_NWE%^PYSeK0K$1bw#mu zA#{@;D7HMKeSqXb^=H^v%y#XjhTRBHK~i6=wRXSU?`Flx4c^E7tAzdxBjWj@`Z98n z6tGhmuu_&98;udrY3xTBOLg%3EQANdF!=r6?6eEy=*9<(n5ii5Zn3t%+@ZnAWMoxG z%z5VaNZd%D2~KX46lI@~T#jdX;Obet=65gv>AbVk;QjP<)*II~lDG$z3jdWK_TUf$ zR`Sknp#^wq${1w=P4}HM0$IMBDf2|YU z+)d`wNlq#tQN0;Cj~h{v)hT;9dik{Px0i*{@oEU3idXTsv5ks5Oh!De@fIN6l(=Z* z#&e?`uk^qzkXS>!LXYq`W;MpTb3gp1*!t@WTXmYgqAT{?F`3g#h>abaP;ksD%=Gmf zQN8u8w2yBP6qOOLIcgln_Lgvt3Dm50%YuP& zBDPM3$|#WW()acLE7VLxvVr`=07T&r@))A)eZyirYL+L>_!3zBdP_Il!Zm}9US*2Q3d2B>9 z{;4|YFLL-DMVx|+cAO5>IxO}o(D2`>H26?atxTlOa_eK=+af+(#5;pG3~JmEOXr{3 ziqgFE;2CY87@d39n$Oj*v?rL8Qa-b~&W<3VxTP6;tlPI+3K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?tB!*T=PnP ze%m6R1n(TjI@(S~-9=m&Q`$WO73DTIQCC!znCORpD+DnO37gsCqmwWB!TCyw) zD1oc|sj-xL7Ml3{{zRDmeS~_ZDEyL7}| zH?72Lm(;6NJ&4>elK#xB3CCY#LpgskL>baTF{qVR9blie|pGm?KNAC7XuB-Mm>WTP-v zWvGCaRkAzo%sRpK6xY`NULw~Hzc{Tf%AT@3%;yB!WMe%_8B13Y_iphT7S1R=d~zAl z%N`~X0#ky-#Ge;i$bD;40H+Zhm8I(F6YSR*WR$LdSucfm8Pz0lp;BE3xBcXQR5LeM z&~z`1$yrUH0aMh8;CFq8?|7~8M}bpuU$a0PEOmk<4jnqL#o@hP@f}Jmp3C`mDUYm= z+UjF~Ne>p(G+Ri$C7tE^y)p|n)AVcx@=%V?i}OI#CU5C*#mxE@*fflm54-L(EMf&@Xb0-)`;6~IcSE&x*hS|lC)1d3KAAZxnc_N*YOoGB%CH~> zI?)@w{z?z3+{Ym&jH6U>Yq-rna(sJjQ0=mK6)5NATqm1E)38!G-!3UB9F`x->!@}o zz~Z`^g@34cp$*>`X4X#s$J+8M0e<-BhvNF70rw@(SbcdMptD7G{nY{JJT%ZO*RYHD EA3U;WH~;_u literal 0 HcmV?d00001 diff --git a/src/app/tape/tape.pro b/src/app/tape/tape.pro index e1e8d5c2b..be72682c4 100644 --- a/src/app/tape/tape.pro +++ b/src/app/tape/tape.pro @@ -340,6 +340,7 @@ DIAGRAMS += \ $${PWD}/share/resources/diagrams/Np2.png \ $${PWD}/share/resources/diagrams/Np3.png \ $${PWD}/share/resources/diagrams/Np4.png \ + $${PWD}/share/resources/diagrams/Np5.png \ $${PWD}/share/resources/diagrams/Op1.png \ $${PWD}/share/resources/diagrams/Op2.png \ $${PWD}/share/resources/diagrams/Op3.png \ diff --git a/src/libs/ifc/schema.qrc b/src/libs/ifc/schema.qrc index de7259a73..6bec8b207 100644 --- a/src/libs/ifc/schema.qrc +++ b/src/libs/ifc/schema.qrc @@ -6,12 +6,15 @@ schema/pattern/v0.1.3.xsd schema/pattern/v0.1.4.xsd schema/pattern/v0.2.0.xsd + schema/pattern/v0.2.1.xsd schema/standard_measurements/v0.3.0.xsd schema/standard_measurements/v0.4.0.xsd schema/standard_measurements/v0.4.1.xsd + schema/standard_measurements/v0.4.2.xsd schema/individual_measurements/v0.2.0.xsd schema/individual_measurements/v0.3.0.xsd schema/individual_measurements/v0.3.1.xsd schema/individual_measurements/v0.3.2.xsd + schema/individual_measurements/v0.3.3.xsd diff --git a/src/libs/ifc/schema/individual_measurements/v0.3.3.xsd b/src/libs/ifc/schema/individual_measurements/v0.3.3.xsd new file mode 100644 index 000000000..a6a241e53 --- /dev/null +++ b/src/libs/ifc/schema/individual_measurements/v0.3.3.xsd @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/libs/ifc/schema/pattern/v0.2.1.xsd b/src/libs/ifc/schema/pattern/v0.2.1.xsd new file mode 100644 index 000000000..65456be2a --- /dev/null +++ b/src/libs/ifc/schema/pattern/v0.2.1.xsd @@ -0,0 +1,329 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/libs/ifc/schema/standard_measurements/v0.4.2.xsd b/src/libs/ifc/schema/standard_measurements/v0.4.2.xsd new file mode 100644 index 000000000..788adcbb1 --- /dev/null +++ b/src/libs/ifc/schema/standard_measurements/v0.4.2.xsd @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/libs/ifc/xml/vabstractmconverter.cpp b/src/libs/ifc/xml/vabstractmconverter.cpp index 2d8738e6e..268e4b2d4 100644 --- a/src/libs/ifc/xml/vabstractmconverter.cpp +++ b/src/libs/ifc/xml/vabstractmconverter.cpp @@ -128,7 +128,7 @@ QMultiMap VAbstractMConverter::OldNamesToNewNames_InV0_3_0() names.insert(QStringLiteral("body_armfold_circ"), QStringLiteral("shoulder_girth")); names.insert(QStringLiteral("body_torso_circ"), QStringLiteral("trunk_length")); names.insert(QStringLiteral("neck_front_to_waist_f"), QStringLiteral("front_waist_length")); - names.insert(QStringLiteral("neck_front_to_waist_flat"), QStringLiteral("center_front_waist_length")); + names.insert(QStringLiteral("neck_front_to_waist_flat_f"), QStringLiteral("center_front_waist_length")); names.insert(QStringLiteral("armpit_to_waist_side"), QStringLiteral("side_waist_length")); names.insert(QStringLiteral("neck_side_to_waist_b"), QStringLiteral("waist_to_neck_side")); @@ -235,3 +235,14 @@ QMultiMap VAbstractMConverter::OldNamesToNewNames_InV0_3_0() return names; } + +//--------------------------------------------------------------------------------------------------------------------- +QMap VAbstractMConverter::OldNamesToNewNames_InV0_3_3() +{ + // new name, old name + QMap names; + + names.insert(QStringLiteral("rise_length_side_sitting"), QStringLiteral("rise_length_side")); + + return names; +} diff --git a/src/libs/ifc/xml/vabstractmconverter.h b/src/libs/ifc/xml/vabstractmconverter.h index 3f73b6c46..24335f863 100644 --- a/src/libs/ifc/xml/vabstractmconverter.h +++ b/src/libs/ifc/xml/vabstractmconverter.h @@ -40,6 +40,7 @@ public: protected: void AddRootComment(); static QMultiMap OldNamesToNewNames_InV0_3_0(); + static QMap OldNamesToNewNames_InV0_3_3(); private: Q_DISABLE_COPY(VAbstractMConverter) diff --git a/src/libs/ifc/xml/vpatternconverter.cpp b/src/libs/ifc/xml/vpatternconverter.cpp index babf25724..e75f854d0 100644 --- a/src/libs/ifc/xml/vpatternconverter.cpp +++ b/src/libs/ifc/xml/vpatternconverter.cpp @@ -43,8 +43,8 @@ */ const QString VPatternConverter::PatternMinVerStr = QStringLiteral("0.1.0"); -const QString VPatternConverter::PatternMaxVerStr = QStringLiteral("0.2.0"); -const QString VPatternConverter::CurrentSchema = QStringLiteral("://schema/pattern/v0.2.0.xsd"); +const QString VPatternConverter::PatternMaxVerStr = QStringLiteral("0.2.1"); +const QString VPatternConverter::CurrentSchema = QStringLiteral("://schema/pattern/v0.2.1.xsd"); //--------------------------------------------------------------------------------------------------------------------- VPatternConverter::VPatternConverter(const QString &fileName) @@ -100,6 +100,8 @@ QString VPatternConverter::XSDSchema(int ver) const case (0x000104): return QStringLiteral("://schema/pattern/v0.1.4.xsd"); case (0x000200): + return QStringLiteral("://schema/pattern/v0.2.0.xsd"); + case (0x000201): return CurrentSchema; default: { @@ -152,6 +154,13 @@ void VPatternConverter::ApplyPatches() V_FALLTHROUGH } case (0x000200): + { + ToV0_2_1(); + const QString schema = XSDSchema(0x000201); + ValidateXML(schema, fileName); + V_FALLTHROUGH + } + case (0x000201): break; default: break; @@ -215,6 +224,14 @@ void VPatternConverter::ToV0_2_0() Save(); } +//--------------------------------------------------------------------------------------------------------------------- +void VPatternConverter::ToV0_2_1() +{ + SetVersion(QStringLiteral("0.2.1")); + ConvertMeasurementsToV0_2_1(); + Save(); +} + //--------------------------------------------------------------------------------------------------------------------- void VPatternConverter::TagUnitToV0_2_0() { @@ -665,6 +682,17 @@ void VPatternConverter::TagMeasurementsToV0_2_0() ms.appendChild(newNodeText); } +//--------------------------------------------------------------------------------------------------------------------- +void VPatternConverter::ConvertMeasurementsToV0_2_1() +{ + const QMap names = OldNamesToNewNames_InV0_2_1(); + + // Structure did not change. We can use the same code. + ConvertPointExpressionsToV0_2_0(names); + ConvertArcExpressionsToV0_2_0(names); + ConvertPathPointExpressionsToV0_2_0(names); +} + //--------------------------------------------------------------------------------------------------------------------- QString VPatternConverter::MUnitV0_1_4() const { @@ -826,7 +854,7 @@ QMap VPatternConverter::OldNamesToNewNames_InV0_2_0() names.insert(QStringLiteral("shoulder_girth"), QStringLiteral("body_armfold_circ")); names.insert(QStringLiteral("trunk_length"), QStringLiteral("body_torso_circ")); names.insert(QStringLiteral("front_waist_length"), QStringLiteral("neck_front_to_waist_f")); - names.insert(QStringLiteral("center_front_waist_length"), QStringLiteral("neck_front_to_waist_flat")); + names.insert(QStringLiteral("center_front_waist_length"), QStringLiteral("neck_front_to_waist_flat_f")); names.insert(QStringLiteral("side_waist_length"), QStringLiteral("armpit_to_waist_side")); names.insert(QStringLiteral("waist_to_neck_side"), QStringLiteral("neck_side_to_waist_b")); @@ -922,3 +950,14 @@ QMap VPatternConverter::OldNamesToNewNames_InV0_2_0() return names; } + +//--------------------------------------------------------------------------------------------------------------------- +QMap VPatternConverter::OldNamesToNewNames_InV0_2_1() +{ + // old name, new name + QMap names; + + names.insert(QStringLiteral("rise_length_side"), QStringLiteral("rise_length_side_sitting")); + + return names; +} diff --git a/src/libs/ifc/xml/vpatternconverter.h b/src/libs/ifc/xml/vpatternconverter.h index 5da3b07e1..b62ef6b5b 100644 --- a/src/libs/ifc/xml/vpatternconverter.h +++ b/src/libs/ifc/xml/vpatternconverter.h @@ -60,12 +60,15 @@ private: void ToV0_1_3(); void ToV0_1_4(); void ToV0_2_0(); + void ToV0_2_1(); void TagUnitToV0_2_0(); void TagIncrementToV0_2_0(); void ConvertMeasurementsToV0_2_0(); void TagMeasurementsToV0_2_0(); + void ConvertMeasurementsToV0_2_1(); + QSet FixIncrementsToV0_2_0(); QString FixIncrementInFormulaToV0_2_0(const QString &formula, const QSet &names); void FixPointExpressionsToV0_2_0(const QSet &names); @@ -83,6 +86,7 @@ private: QStringList ListPathPointExpressionsV0_1_4() const; static QMap OldNamesToNewNames_InV0_2_0(); + static QMap OldNamesToNewNames_InV0_2_1(); }; #endif // VPATTERNCONVERTER_H diff --git a/src/libs/ifc/xml/vvitconverter.cpp b/src/libs/ifc/xml/vvitconverter.cpp index bdd3eac36..b518967aa 100644 --- a/src/libs/ifc/xml/vvitconverter.cpp +++ b/src/libs/ifc/xml/vvitconverter.cpp @@ -40,8 +40,8 @@ */ const QString VVITConverter::MeasurementMinVerStr = QStringLiteral("0.2.0"); -const QString VVITConverter::MeasurementMaxVerStr = QStringLiteral("0.3.2"); -const QString VVITConverter::CurrentSchema = QStringLiteral("://schema/individual_measurements/v0.3.2.xsd"); +const QString VVITConverter::MeasurementMaxVerStr = QStringLiteral("0.3.3"); +const QString VVITConverter::CurrentSchema = QStringLiteral("://schema/individual_measurements/v0.3.3.xsd"); //--------------------------------------------------------------------------------------------------------------------- VVITConverter::VVITConverter(const QString &fileName) @@ -93,6 +93,8 @@ QString VVITConverter::XSDSchema(int ver) const case (0x000301): return QStringLiteral("://schema/individual_measurements/v0.3.1.xsd"); case (0x000302): + return QStringLiteral("://schema/individual_measurements/v0.3.2.xsd"); + case (0x000303): return CurrentSchema; default: { @@ -131,6 +133,13 @@ void VVITConverter::ApplyPatches() V_FALLTHROUGH } case (0x000302): + { + ToV0_3_3(); + const QString schema = XSDSchema(0x000303); + ValidateXML(schema, fileName); + V_FALLTHROUGH + } + case (0x000303): break; default: break; @@ -257,6 +266,34 @@ void VVITConverter::PM_SystemV0_3_2() parent.insertBefore(pm_system, personal); } +//--------------------------------------------------------------------------------------------------------------------- +void VVITConverter::ConvertMeasurementsToV0_3_3() +{ + const QMap names = OldNamesToNewNames_InV0_3_3(); + auto i = names.constBegin(); + while (i != names.constEnd()) + { + const QDomNodeList nodeList = this->elementsByTagName(QStringLiteral("m")); + if (nodeList.isEmpty()) + { + continue; + } + + for (int ii = 0; ii < nodeList.size(); ++ii) + { + const QString attrName = QStringLiteral("name"); + QDomElement element = nodeList.at(ii).toElement(); + const QString name = GetParametrString(element, attrName); + if (name == i.value()) + { + SetAttribute(element, attrName, i.key()); + } + } + + ++i; + } +} + //--------------------------------------------------------------------------------------------------------------------- void VVITConverter::ToV0_3_0() { @@ -282,3 +319,11 @@ void VVITConverter::ToV0_3_2() PM_SystemV0_3_2(); Save(); } + +//--------------------------------------------------------------------------------------------------------------------- +void VVITConverter::ToV0_3_3() +{ + SetVersion(QStringLiteral("0.3.3")); + ConvertMeasurementsToV0_3_3(); + Save(); +} diff --git a/src/libs/ifc/xml/vvitconverter.h b/src/libs/ifc/xml/vvitconverter.h index 10c808fee..b2a265d01 100644 --- a/src/libs/ifc/xml/vvitconverter.h +++ b/src/libs/ifc/xml/vvitconverter.h @@ -61,10 +61,12 @@ private: QDomElement AddMV0_3_0(const QString &name, qreal value); void GenderV0_3_1(); void PM_SystemV0_3_2(); + void ConvertMeasurementsToV0_3_3(); void ToV0_3_0(); void ToV0_3_1(); void ToV0_3_2(); + void ToV0_3_3(); }; #endif // VVITCONVERTER_H diff --git a/src/libs/ifc/xml/vvstconverter.cpp b/src/libs/ifc/xml/vvstconverter.cpp index ea6c2d4ba..0a928e054 100644 --- a/src/libs/ifc/xml/vvstconverter.cpp +++ b/src/libs/ifc/xml/vvstconverter.cpp @@ -40,8 +40,8 @@ */ const QString VVSTConverter::MeasurementMinVerStr = QStringLiteral("0.3.0"); -const QString VVSTConverter::MeasurementMaxVerStr = QStringLiteral("0.4.1"); -const QString VVSTConverter::CurrentSchema = QStringLiteral("://schema/standard_measurements/v0.4.1.xsd"); +const QString VVSTConverter::MeasurementMaxVerStr = QStringLiteral("0.4.2"); +const QString VVSTConverter::CurrentSchema = QStringLiteral("://schema/standard_measurements/v0.4.2.xsd"); //--------------------------------------------------------------------------------------------------------------------- VVSTConverter::VVSTConverter(const QString &fileName) @@ -91,6 +91,8 @@ QString VVSTConverter::XSDSchema(int ver) const case (0x000400): return QStringLiteral("://schema/standard_measurements/v0.4.0.xsd"); case (0x000401): + return QStringLiteral("://schema/standard_measurements/v0.4.1.xsd"); + case (0x000402): return CurrentSchema; default: { @@ -122,6 +124,13 @@ void VVSTConverter::ApplyPatches() V_FALLTHROUGH } case (0x000401): + { + ToV0_4_2(); + const QString schema = XSDSchema(0x000402); + ValidateXML(schema, fileName); + V_FALLTHROUGH + } + case (0x000402): break; default: break; @@ -263,6 +272,34 @@ void VVSTConverter::PM_SystemV0_4_1() parent.insertBefore(pm_system, personal); } +//--------------------------------------------------------------------------------------------------------------------- +void VVSTConverter::ConvertMeasurementsToV0_4_2() +{ + const QMap names = OldNamesToNewNames_InV0_3_3(); + auto i = names.constBegin(); + while (i != names.constEnd()) + { + const QDomNodeList nodeList = this->elementsByTagName(QStringLiteral("m")); + if (nodeList.isEmpty()) + { + continue; + } + + for (int ii = 0; ii < nodeList.size(); ++ii) + { + const QString attrName = QStringLiteral("name"); + QDomElement element = nodeList.at(ii).toElement(); + const QString name = GetParametrString(element, attrName); + if (name == i.value()) + { + SetAttribute(element, attrName, i.key()); + } + } + + ++i; + } +} + //--------------------------------------------------------------------------------------------------------------------- void VVSTConverter::ToV0_4_0() { @@ -281,3 +318,11 @@ void VVSTConverter::ToV0_4_1() PM_SystemV0_4_1(); Save(); } + +//--------------------------------------------------------------------------------------------------------------------- +void VVSTConverter::ToV0_4_2() +{ + SetVersion(QStringLiteral("0.4.2")); + ConvertMeasurementsToV0_4_2(); + Save(); +} diff --git a/src/libs/ifc/xml/vvstconverter.h b/src/libs/ifc/xml/vvstconverter.h index f124ff3fb..bdaa74d1b 100644 --- a/src/libs/ifc/xml/vvstconverter.h +++ b/src/libs/ifc/xml/vvstconverter.h @@ -60,9 +60,11 @@ private: void ConvertMeasurementsToV0_4_0(); QDomElement AddMV0_4_0(const QString &name, qreal value, qreal sizeIncrease, qreal heightIncrease); void PM_SystemV0_4_1(); + void ConvertMeasurementsToV0_4_2(); void ToV0_4_0(); void ToV0_4_1(); + void ToV0_4_2(); }; #endif // VMEASUREMENTCONVERTER_H diff --git a/src/libs/vmisc/def.cpp b/src/libs/vmisc/def.cpp index 47f06f728..b7886a359 100644 --- a/src/libs/vmisc/def.cpp +++ b/src/libs/vmisc/def.cpp @@ -264,6 +264,7 @@ const QString riseLengthSideSitting_M = QStringLiteral("rise_length_side_sitting const QString riseLengthDiag_M = QStringLiteral("rise_length_diag"); // N05 const QString riseLengthB_M = QStringLiteral("rise_length_b"); // N06 const QString riseLengthF_M = QStringLiteral("rise_length_f"); // N07 +const QString riseLengthSide_M = QStringLiteral("rise_length_side"); // N08 // O const QString neckBackToWaistFront_M = QStringLiteral("neck_back_to_waist_front"); // O01 const QString waistToWaistHalter_M = QStringLiteral("waist_to_waist_halter"); // O02 @@ -881,7 +882,8 @@ QStringList ListGroupN() << riseLengthSideSitting_M // N04 << riseLengthDiag_M // N05 << riseLengthB_M // N06 - << riseLengthF_M; // N07 + << riseLengthF_M // N07 + << riseLengthSide_M; // N08 return list; } @@ -1603,6 +1605,8 @@ QString MapDiagrams(const QString &number) V_FALLTHROUGH case 6: // N07 return QStringLiteral("Np4"); + case 7: // N08 + return QStringLiteral("Np5"); default: break; } diff --git a/src/libs/vmisc/def.h b/src/libs/vmisc/def.h index c757049d3..05247b423 100644 --- a/src/libs/vmisc/def.h +++ b/src/libs/vmisc/def.h @@ -420,6 +420,7 @@ extern const QString riseLengthSideSitting_M; // N04 extern const QString riseLengthDiag_M; // N05 extern const QString riseLengthB_M; // N06 extern const QString riseLengthF_M; // N07 +extern const QString riseLengthSide_M; // N08 // O extern const QString neckBackToWaistFront_M; // O01 extern const QString waistToWaistHalter_M; // O02 diff --git a/src/libs/vpatterndb/vtranslatemeasurements.cpp b/src/libs/vpatterndb/vtranslatemeasurements.cpp index 48f637e08..ecb8e0c1b 100644 --- a/src/libs/vpatterndb/vtranslatemeasurements.cpp +++ b/src/libs/vpatterndb/vtranslatemeasurements.cpp @@ -1852,6 +1852,13 @@ void VTranslateMeasurements::InitGroupN() "Full measurement description."); InitMeasurement(riseLengthF_M, m, g, d, "N07"); //================================================================================================================= + m = translate("VTranslateMeasurements", "rise_length_side", + "Name in a formula. Don't use math symbols and space in name!!!!"); + g = translate("VTranslateMeasurements", "Rise length, side", "Full measurement name."); + d = translate("VTranslateMeasurements", "Vertical distance from Waist side down to Crotch level. Use formula " + "(Height: Waist side - Leg: Crotch to floor).", "Full measurement description."); + InitMeasurement(riseLengthSide_M, m, g, d, "N08"); + //================================================================================================================= } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/test/ValentinaTest/tst_measurementregexp.cpp b/src/test/ValentinaTest/tst_measurementregexp.cpp index c000c23aa..5a5ad7ca9 100644 --- a/src/test/ValentinaTest/tst_measurementregexp.cpp +++ b/src/test/ValentinaTest/tst_measurementregexp.cpp @@ -334,6 +334,7 @@ void TST_MeasurementRegExp::TestCorrectOrderMeasurement_data() QTest::newRow("N05") << riseLengthDiag_M << "rise_length_diag"; QTest::newRow("N06") << riseLengthB_M << "rise_length_b"; QTest::newRow("N07") << riseLengthF_M << "rise_length_f"; + QTest::newRow("N08") << riseLengthSide_M << "rise_length_side"; QTest::newRow("O01") << neckBackToWaistFront_M << "neck_back_to_waist_front"; QTest::newRow("O02") << waistToWaistHalter_M << "waist_to_waist_halter"; QTest::newRow("O03") << waistNaturalCirc_M << "waist_natural_circ";