Change for reading individual measurements.

--HG--
branch : feature
This commit is contained in:
dismine 2014-05-16 13:00:33 +03:00
parent f2cc874e7e
commit 3fc99547fb
14 changed files with 219 additions and 202 deletions

View File

@ -30,21 +30,18 @@
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VMeasurement::VMeasurement() VMeasurement::VMeasurement()
:base(0), ksize(50.0), kheight(176.0), gui_text(QString()), number(QString()), virtualM(false), :base(0), ksize(50.0), kheight(176.0), gui_text(QString()), number(QString()), _tagName(QString())
_tagName(QString())
{} {}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VMeasurement::VMeasurement(const qreal &base, const qreal &ksize, const qreal &kgrowth, VMeasurement::VMeasurement(const qreal &base, const qreal &ksize, const qreal &kgrowth,
const QString &gui_text, const QString &number, const QString &tagName) const QString &gui_text, const QString &number, const QString &tagName)
:base(base), ksize(ksize), kheight(kgrowth), gui_text(gui_text), number(number), virtualM(false), :base(base), ksize(ksize), kheight(kgrowth), gui_text(gui_text), number(number), _tagName(tagName)
_tagName(tagName)
{} {}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VMeasurement::VMeasurement(const qreal &base, const QString &gui_text, const QString &number, const QString &tagName) VMeasurement::VMeasurement(const qreal &base, const QString &gui_text, const QString &number, const QString &tagName)
:base(base), ksize(50.0), kheight(176.0), gui_text(gui_text), number(number), virtualM(false), :base(base), ksize(50.0), kheight(176.0), gui_text(gui_text), number(number), _tagName(tagName)
_tagName(tagName)
{} {}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -100,7 +100,6 @@ private:
*/ */
QString gui_text; QString gui_text;
QString number; QString number;
bool virtualM;
QString _tagName; QString _tagName;
}; };
@ -144,14 +143,4 @@ inline void VMeasurement::setTagName(const QString &tagName)
_tagName = tagName; _tagName = tagName;
} }
inline bool VMeasurement::Virtual() const
{
return virtualM;
}
inline void VMeasurement::setVirtual(bool value)
{
virtualM = value;
}
#endif // VSTANDARDTABLEROW_H #endif // VSTANDARDTABLEROW_H

View File

@ -110,6 +110,7 @@ const QString waistToHipHeight = QStringLiteral("waist_to_hip_height"
const QString waistToKneeHeight = QStringLiteral("waist_to_knee_height"); const QString waistToKneeHeight = QStringLiteral("waist_to_knee_height");
const QString crotchHeight = QStringLiteral("crotch_height"); const QString crotchHeight = QStringLiteral("crotch_height");
//extended measurements //extended measurements
const QString size = QStringLiteral("size");
const QString heightFrontNeckBasePoint = QStringLiteral("height_front_neck_base_point"); const QString heightFrontNeckBasePoint = QStringLiteral("height_front_neck_base_point");
const QString heightBaseNeckSidePoint = QStringLiteral("height_base_neck_side_point"); const QString heightBaseNeckSidePoint = QStringLiteral("height_base_neck_side_point");
const QString heightShoulderPoint = QStringLiteral("height_shoulder_point"); const QString heightShoulderPoint = QStringLiteral("height_shoulder_point");

View File

@ -194,6 +194,7 @@ extern const QString waistToHipHeight;
extern const QString waistToKneeHeight; extern const QString waistToKneeHeight;
extern const QString crotchHeight; extern const QString crotchHeight;
//extended measurements //extended measurements
extern const QString size;
extern const QString heightFrontNeckBasePoint; extern const QString heightFrontNeckBasePoint;
extern const QString heightBaseNeckSidePoint; extern const QString heightBaseNeckSidePoint;
extern const QString heightShoulderPoint; extern const QString heightShoulderPoint;

View File

@ -83,7 +83,7 @@
<xs:attribute name="value" type="xs:double" use="required"></xs:attribute> <xs:attribute name="value" type="xs:double" use="required"></xs:attribute>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="bust__girth"> <xs:element name="bust_girth">
<xs:complexType> <xs:complexType>
<xs:attribute name="value" type="xs:double" use="required"></xs:attribute> <xs:attribute name="value" type="xs:double" use="required"></xs:attribute>
</xs:complexType> </xs:complexType>
@ -203,12 +203,12 @@
<xs:attribute name="value" type="xs:double" use="required"></xs:attribute> <xs:attribute name="value" type="xs:double" use="required"></xs:attribute>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="front_upper-bust_arc"> <xs:element name="front_upper_chest_arc">
<xs:complexType> <xs:complexType>
<xs:attribute name="value" type="xs:double" use="required"></xs:attribute> <xs:attribute name="value" type="xs:double" use="required"></xs:attribute>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="back_upper-bust_arc"> <xs:element name="back_upper_chest_arc">
<xs:complexType> <xs:complexType>
<xs:attribute name="value" type="xs:double" use="required"></xs:attribute> <xs:attribute name="value" type="xs:double" use="required"></xs:attribute>
</xs:complexType> </xs:complexType>
@ -223,12 +223,12 @@
<xs:attribute name="value" type="xs:double" use="required"></xs:attribute> <xs:attribute name="value" type="xs:double" use="required"></xs:attribute>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="front_upper-hip_arc"> <xs:element name="front_upper_hip_arc">
<xs:complexType> <xs:complexType>
<xs:attribute name="value" type="xs:double" use="required"></xs:attribute> <xs:attribute name="value" type="xs:double" use="required"></xs:attribute>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="back_upper-hip_arc"> <xs:element name="back_upper_hip_arc">
<xs:complexType> <xs:complexType>
<xs:attribute name="value" type="xs:double" use="required"></xs:attribute> <xs:attribute name="value" type="xs:double" use="required"></xs:attribute>
</xs:complexType> </xs:complexType>
@ -263,12 +263,12 @@
<xs:attribute name="value" type="xs:double" use="required"></xs:attribute> <xs:attribute name="value" type="xs:double" use="required"></xs:attribute>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="front-neck_to_upper-chest_height"> <xs:element name="front_neck_to_upper_chest_height">
<xs:complexType> <xs:complexType>
<xs:attribute name="value" type="xs:double" use="required"></xs:attribute> <xs:attribute name="value" type="xs:double" use="required"></xs:attribute>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="front-neck_to_bust_height"> <xs:element name="front_neck_to_bust_height">
<xs:complexType> <xs:complexType>
<xs:attribute name="value" type="xs:double" use="required"></xs:attribute> <xs:attribute name="value" type="xs:double" use="required"></xs:attribute>
</xs:complexType> </xs:complexType>
@ -289,7 +289,7 @@
<xs:attribute name="value" type="xs:double" use="required"></xs:attribute> <xs:attribute name="value" type="xs:double" use="required"></xs:attribute>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="upper-arm_girth"> <xs:element name="upper_arm_girth">
<xs:complexType> <xs:complexType>
<xs:attribute name="value" type="xs:double" use="required"></xs:attribute> <xs:attribute name="value" type="xs:double" use="required"></xs:attribute>
</xs:complexType> </xs:complexType>

View File

@ -108,7 +108,7 @@
<xs:attribute name="size_increace" type="xs:double" use="required"></xs:attribute> <xs:attribute name="size_increace" type="xs:double" use="required"></xs:attribute>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="bust__girth"> <xs:element name="bust_girth">
<xs:complexType> <xs:complexType>
<xs:attribute name="value" type="xs:double" use="required"></xs:attribute> <xs:attribute name="value" type="xs:double" use="required"></xs:attribute>
<xs:attribute name="height_increase" type="xs:double" use="required"></xs:attribute> <xs:attribute name="height_increase" type="xs:double" use="required"></xs:attribute>
@ -276,14 +276,14 @@
<xs:attribute name="size_increace" type="xs:double" use="required"></xs:attribute> <xs:attribute name="size_increace" type="xs:double" use="required"></xs:attribute>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="front_upper-bust_arc"> <xs:element name="front_upper_chest_arc">
<xs:complexType> <xs:complexType>
<xs:attribute name="value" type="xs:double" use="required"></xs:attribute> <xs:attribute name="value" type="xs:double" use="required"></xs:attribute>
<xs:attribute name="height_increase" type="xs:double" use="required"></xs:attribute> <xs:attribute name="height_increase" type="xs:double" use="required"></xs:attribute>
<xs:attribute name="size_increace" type="xs:double" use="required"></xs:attribute> <xs:attribute name="size_increace" type="xs:double" use="required"></xs:attribute>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="back_upper-bust_arc"> <xs:element name="back_upper_chest_arc">
<xs:complexType> <xs:complexType>
<xs:attribute name="value" type="xs:double" use="required"></xs:attribute> <xs:attribute name="value" type="xs:double" use="required"></xs:attribute>
<xs:attribute name="height_increase" type="xs:double" use="required"></xs:attribute> <xs:attribute name="height_increase" type="xs:double" use="required"></xs:attribute>
@ -304,14 +304,14 @@
<xs:attribute name="size_increace" type="xs:double" use="required"></xs:attribute> <xs:attribute name="size_increace" type="xs:double" use="required"></xs:attribute>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="front_upper-hip_arc"> <xs:element name="front_upper_hip_arc">
<xs:complexType> <xs:complexType>
<xs:attribute name="value" type="xs:double" use="required"></xs:attribute> <xs:attribute name="value" type="xs:double" use="required"></xs:attribute>
<xs:attribute name="height_increase" type="xs:double" use="required"></xs:attribute> <xs:attribute name="height_increase" type="xs:double" use="required"></xs:attribute>
<xs:attribute name="size_increace" type="xs:double" use="required"></xs:attribute> <xs:attribute name="size_increace" type="xs:double" use="required"></xs:attribute>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="back_upper-hip_arc"> <xs:element name="back_upper_hip_arc">
<xs:complexType> <xs:complexType>
<xs:attribute name="value" type="xs:double" use="required"></xs:attribute> <xs:attribute name="value" type="xs:double" use="required"></xs:attribute>
<xs:attribute name="height_increase" type="xs:double" use="required"></xs:attribute> <xs:attribute name="height_increase" type="xs:double" use="required"></xs:attribute>
@ -360,14 +360,14 @@
<xs:attribute name="size_increace" type="xs:double" use="required"></xs:attribute> <xs:attribute name="size_increace" type="xs:double" use="required"></xs:attribute>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="front-neck_to_upper-chest_height"> <xs:element name="front_neck_to_upper_chest_height">
<xs:complexType> <xs:complexType>
<xs:attribute name="value" type="xs:double" use="required"></xs:attribute> <xs:attribute name="value" type="xs:double" use="required"></xs:attribute>
<xs:attribute name="height_increase" type="xs:double" use="required"></xs:attribute> <xs:attribute name="height_increase" type="xs:double" use="required"></xs:attribute>
<xs:attribute name="size_increace" type="xs:double" use="required"></xs:attribute> <xs:attribute name="size_increace" type="xs:double" use="required"></xs:attribute>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="front-neck_to_bust_height"> <xs:element name="front_neck_to_bust_height">
<xs:complexType> <xs:complexType>
<xs:attribute name="value" type="xs:double" use="required"></xs:attribute> <xs:attribute name="value" type="xs:double" use="required"></xs:attribute>
<xs:attribute name="height_increase" type="xs:double" use="required"></xs:attribute> <xs:attribute name="height_increase" type="xs:double" use="required"></xs:attribute>
@ -394,7 +394,7 @@
<xs:attribute name="size_increace" type="xs:double" use="required"></xs:attribute> <xs:attribute name="size_increace" type="xs:double" use="required"></xs:attribute>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="upper-arm_girth"> <xs:element name="upper_arm_girth">
<xs:complexType> <xs:complexType>
<xs:attribute name="value" type="xs:double" use="required"></xs:attribute> <xs:attribute name="value" type="xs:double" use="required"></xs:attribute>
<xs:attribute name="height_increase" type="xs:double" use="required"></xs:attribute> <xs:attribute name="height_increase" type="xs:double" use="required"></xs:attribute>

View File

@ -48,25 +48,25 @@
<back_shoulder_to_waist_length value="0.0"/> <back_shoulder_to_waist_length value="0.0"/>
<front_neck_arc value="0.0"/> <front_neck_arc value="0.0"/>
<back_neck_arc value="0.0"/> <back_neck_arc value="0.0"/>
<front_upper-bust_arc value="0.0"/> <front_upper_chest_arc value="0.0"/>
<back_upper-bust_arc value="0.0"/> <back_upper_chest_arc value="0.0"/>
<front_waist_arc value="0.0"/> <front_waist_arc value="0.0"/>
<back_waist_arc value="0.0"/> <back_waist_arc value="0.0"/>
<front_upper-hip_arc value="0.0"/> <front_upper_hip_arc value="0.0"/>
<back_upper-hip_arc value="0.0"/> <back_upper_hip_arc value="0.0"/>
<front_hip_arc value="0.0"/> <front_hip_arc value="0.0"/>
<back_hip_arc value="0.0"/> <back_hip_arc value="0.0"/>
<chest_slope value="0.0"/> <chest_slope value="0.0"/>
<back_slope value="0.0"/> <back_slope value="0.0"/>
<front_waist_slope value="0.0"/> <front_waist_slope value="0.0"/>
<back_waist_slope value="0.0"/> <back_waist_slope value="0.0"/>
<front-neck_to_upper-chest_height value="0.0"/> <front_neck_to_upper_chest_height value="0.0"/>
<front-neck_to_bust_height value="0.0"/> <front_neck_to_bust_height value="0.0"/>
</torso> </torso>
<arm> <arm>
<armscye_girth value="0.0"/> <armscye_girth value="0.0"/>
<elbow_girth value="0.0"/> <elbow_girth value="0.0"/>
<upper-arm_girth value="0.0"/> <upper_arm_girth value="0.0"/>
<wrist_girth value="0.0"/> <wrist_girth value="0.0"/>
<scye_depth value="0.0"/> <scye_depth value="0.0"/>
<shoulder_and_arm_length value="0.0"/> <shoulder_and_arm_length value="0.0"/>

View File

@ -44,25 +44,25 @@
<back_shoulder_to_waist_length value="0.0" size_increace="0" height_increase="0"/><!--Нету перевода--> <back_shoulder_to_waist_length value="0.0" size_increace="0" height_increase="0"/><!--Нету перевода-->
<front_neck_arc value="0.0" size_increace="0" height_increase="0"/><!--Нету перевода--> <front_neck_arc value="0.0" size_increace="0" height_increase="0"/><!--Нету перевода-->
<back_neck_arc value="0.0" size_increace="0" height_increase="0"/><!--Нету перевода--> <back_neck_arc value="0.0" size_increace="0" height_increase="0"/><!--Нету перевода-->
<front_upper-bust_arc value="0.0" size_increace="0" height_increase="0"/><!--Нету перевода--> <front_upper_chest_arc value="0.0" size_increace="0" height_increase="0"/><!--Нету перевода-->
<back_upper-bust_arc value="0.0" size_increace="0" height_increase="0"/><!--Нету перевода--> <back_upper_chest_arc value="0.0" size_increace="0" height_increase="0"/><!--Нету перевода-->
<front_waist_arc value="0.0" size_increace="0" height_increase="0"/><!--Нету перевода--> <front_waist_arc value="0.0" size_increace="0" height_increase="0"/><!--Нету перевода-->
<back_waist_arc value="0.0" size_increace="0" height_increase="0"/><!--Нету перевода--> <back_waist_arc value="0.0" size_increace="0" height_increase="0"/><!--Нету перевода-->
<front_upper-hip_arc value="0.0" size_increace="0" height_increase="0"/><!--Нету перевода--> <front_upper_hip_arc value="0.0" size_increace="0" height_increase="0"/><!--Нету перевода-->
<back_upper-hip_arc value="0.0" size_increace="0" height_increase="0"/><!--Нету перевода--> <back_upper_hip_arc value="0.0" size_increace="0" height_increase="0"/><!--Нету перевода-->
<front_hip_arc value="0.0" size_increace="0" height_increase="0"/><!--Нету перевода--> <front_hip_arc value="0.0" size_increace="0" height_increase="0"/><!--Нету перевода-->
<back_hip_arc value="0.0" size_increace="0" height_increase="0"/><!--Нету перевода--> <back_hip_arc value="0.0" size_increace="0" height_increase="0"/><!--Нету перевода-->
<chest_slope value="0.0" size_increace="0" height_increase="0"/><!--Нету перевода--> <chest_slope value="0.0" size_increace="0" height_increase="0"/><!--Нету перевода-->
<back_slope value="0.0" size_increace="0" height_increase="0"/><!--Нету перевода--> <back_slope value="0.0" size_increace="0" height_increase="0"/><!--Нету перевода-->
<front_waist_slope value="0.0" size_increace="0" height_increase="0"/><!--Нету перевода--> <front_waist_slope value="0.0" size_increace="0" height_increase="0"/><!--Нету перевода-->
<back_waist_slope value="0.0" size_increace="0" height_increase="0"/><!--Нету перевода--> <back_waist_slope value="0.0" size_increace="0" height_increase="0"/><!--Нету перевода-->
<front-neck_to_upper-chest_height value="0.0" size_increace="0" height_increase=""/><!--Нету перевода--> <front_neck_to_upper_chest_height value="0.0" size_increace="0" height_increase=""/><!--Нету перевода-->
<front-neck_to_bust_height value="0.0" size_increace="0" height_increase="0"/><!--Нету перевода--> <front_neck_to_bust_height value="0.0" size_increace="0" height_increase="0"/><!--Нету перевода-->
</torso> </torso>
<arm> <arm>
<armscye_girth value="0.0" size_increace="0" height_increase="0"/><!--Нету перевода--> <armscye_girth value="0.0" size_increace="0" height_increase="0"/><!--Нету перевода-->
<elbow_girth value="0.0" size_increace="0" height_increase="0"/><!--Олк(Обхват локтя)--> <elbow_girth value="0.0" size_increace="0" height_increase="0"/><!--Олк(Обхват локтя)-->
<upper-arm_girth value="316" size_increace="12" height_increase ="0"/><!--Оп(Обхват плеча)--> <upper_arm_girth value="316" size_increace="12" height_increase ="0"/><!--Оп(Обхват плеча)-->
<wrist_girth value="180" size_increace="4" height_increase ="0"/><!--Озап(Обхват запястья)--> <wrist_girth value="180" size_increace="4" height_increase ="0"/><!--Озап(Обхват запястья)-->
<scye_depth value="0.0" size_increace="0" height_increase="0"/><!--Нету перевода--> <scye_depth value="0.0" size_increace="0" height_increase="0"/><!--Нету перевода-->
<shoulder_and_arm_length value="768" size_increace="2" height_increase ="24"/><!--Дзап(Расстояние от точки основания шеи сбоку до линии обхвата запястья)--> <shoulder_and_arm_length value="768" size_increace="2" height_increase ="24"/><!--Дзап(Расстояние от точки основания шеи сбоку до линии обхвата запястья)-->

View File

@ -45,7 +45,7 @@ const qreal VApplication::PrintDPI = 96.0;
VApplication::VApplication(int &argc, char **argv) VApplication::VApplication(int &argc, char **argv)
: QApplication(argc, argv), _patternUnit(Valentina::Cm), _patternType(Pattern::Individual), : QApplication(argc, argv), _patternUnit(Valentina::Cm), _patternType(Pattern::Individual),
_widthMainLine(DefWidth), _widthHairLine(DefWidth/3.0), measurements(QMap<QString, VTranslation>()), _widthMainLine(DefWidth), _widthHairLine(DefWidth/3.0), measurements(QMap<QString, VTranslation>()),
guiText(QMap<QString, VTranslation>()), description(QMap<QString, VTranslation>()), guiTexts(QMap<QString, VTranslation>()), descriptions(QMap<QString, VTranslation>()),
variables(QMap<QString, VTranslation>()), functions(QMap<QString, VTranslation>()) variables(QMap<QString, VTranslation>()), functions(QMap<QString, VTranslation>())
{ {
InitLineWidth(); InitLineWidth();
@ -569,7 +569,7 @@ void VApplication::InitMeasurements()
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VApplication::InitMeasurement(const QString &measurement, const QString &guiTxt, const QString &desc) void VApplication::InitMeasurement(const QString &measurement, const QString &guiText, const QString &desc)
{ {
const QString context = QStringLiteral("Measurements"); const QString context = QStringLiteral("Measurements");
const QString disambiguation1 = QStringLiteral("Short measurement name. Don't use math symbols in name!!!!"); const QString disambiguation1 = QStringLiteral("Short measurement name. Don't use math symbols in name!!!!");
@ -577,8 +577,8 @@ void VApplication::InitMeasurement(const QString &measurement, const QString &gu
const QString disambiguation3 = QStringLiteral("Full measurement description"); const QString disambiguation3 = QStringLiteral("Full measurement description");
measurements.insert(measurement, VTranslation::translate(context, measurement, disambiguation1)); measurements.insert(measurement, VTranslation::translate(context, measurement, disambiguation1));
guiText.insert(measurement, VTranslation::translate(context, guiTxt, disambiguation2)); guiTexts.insert(measurement, VTranslation::translate(context, guiText, disambiguation2));
description.insert(measurement, VTranslation::translate(context, desc, disambiguation3)); descriptions.insert(measurement, VTranslation::translate(context, desc, disambiguation3));
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -636,3 +636,33 @@ void VApplication::setPatternUnit(const Valentina::Units &patternUnit)
_patternUnit = patternUnit; _patternUnit = patternUnit;
InitLineWidth(); InitLineWidth();
} }
//---------------------------------------------------------------------------------------------------------------------
QString VApplication::Measurement(const QString &measurement) const
{
return measurements.value(measurement).translate();
}
//---------------------------------------------------------------------------------------------------------------------
QString VApplication::GuiText(const QString &measurement) const
{
return guiTexts.value(measurement).translate();
}
//---------------------------------------------------------------------------------------------------------------------
QString VApplication::Description(const QString &measurement) const
{
return descriptions.value(measurement).translate();
}
//---------------------------------------------------------------------------------------------------------------------
QString VApplication::Variable(const QString &name) const
{
return variables.value(name).translate();
}
//---------------------------------------------------------------------------------------------------------------------
QString VApplication::Function(const QString &name) const
{
return functions.value(name).translate();
}

View File

@ -72,19 +72,24 @@ public:
QString pathToTables() const; QString pathToTables() const;
qreal widthMainLine() const; qreal widthMainLine() const;
qreal widthHairLine() const; qreal widthHairLine() const;
QString Measurement(const QString &measurement) const;
QString GuiText(const QString &measurement) const;
QString Description(const QString &measurement) const;
QString Variable(const QString &name) const;
QString Function(const QString &name) const;
private: private:
Valentina::Units _patternUnit; Valentina::Units _patternUnit;
Pattern::Measurements _patternType; Pattern::Measurements _patternType;
qreal _widthMainLine; qreal _widthMainLine;
qreal _widthHairLine; qreal _widthHairLine;
QMap<QString, VTranslation> measurements; QMap<QString, VTranslation> measurements;
QMap<QString, VTranslation> guiText; QMap<QString, VTranslation> guiTexts;
QMap<QString, VTranslation> description; QMap<QString, VTranslation> descriptions;
QMap<QString, VTranslation> variables; QMap<QString, VTranslation> variables;
QMap<QString, VTranslation> functions; QMap<QString, VTranslation> functions;
void InitLineWidth(); void InitLineWidth();
void InitMeasurements(); void InitMeasurements();
void InitMeasurement(const QString &measurement, const QString &guiTxt, const QString & desc); void InitMeasurement(const QString &measurement, const QString &guiText, const QString & desc);
void InitVariables(); void InitVariables();
void InitFunctions(); void InitFunctions();

View File

@ -40,12 +40,15 @@ VTranslation VTranslation::translate(const QString &context, const QString &sour
return t; return t;
} }
//---------------------------------------------------------------------------------------------------------------------
VTranslation::VTranslation()
:mcontext(QString()), msourceText(QString()), mdisambiguation(QString()), mn(-1)
{}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VTranslation::VTranslation(const QString &context, const QString &sourceText, const QString &disambiguation, int n) VTranslation::VTranslation(const QString &context, const QString &sourceText, const QString &disambiguation, int n)
:mcontext(context), msourceText(sourceText), mdisambiguation(disambiguation), mn(n) :mcontext(context), msourceText(sourceText), mdisambiguation(disambiguation), mn(n)
{ {}
mn = -1;
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QString VTranslation::VTranslation::translate() const QString VTranslation::VTranslation::translate() const

View File

@ -50,6 +50,7 @@
class VTranslation class VTranslation
{ {
public: public:
VTranslation();
VTranslation(const QString &context, const QString &sourceText, const QString &disambiguation = 0, int n = -1); VTranslation(const QString &context, const QString &sourceText, const QString &disambiguation = 0, int n = -1);
QString translate() const; QString translate() const;
static VTranslation translate(const QString &context, const QString &sourceText, const QString &disambiguation = 0, static VTranslation translate(const QString &context, const QString &sourceText, const QString &disambiguation = 0,

View File

@ -27,22 +27,15 @@
*************************************************************************/ *************************************************************************/
#include "vindividualmeasurements.h" #include "vindividualmeasurements.h"
#include "../widgets/vapplication.h"
const QString VIndividualMeasurements::AttrIgnore = QStringLiteral("ignore");
const QString VIndividualMeasurements::AttrName = QStringLiteral("name");
const QString VIndividualMeasurements::AttrM_number = QStringLiteral("m_number");
const QString VIndividualMeasurements::AttrGui_text = QStringLiteral("gui_text");
const QString VIndividualMeasurements::AttrValue = QStringLiteral("value"); const QString VIndividualMeasurements::AttrValue = QStringLiteral("value");
const QString VIndividualMeasurements::AttrDescription = QStringLiteral("description");
const QString VIndividualMeasurements::TagLang = QStringLiteral("lang");
const QString VIndividualMeasurements::TagFamily_name = QStringLiteral("family-name"); const QString VIndividualMeasurements::TagFamily_name = QStringLiteral("family-name");
const QString VIndividualMeasurements::TagGiven_name = QStringLiteral("given-name"); const QString VIndividualMeasurements::TagGiven_name = QStringLiteral("given-name");
const QString VIndividualMeasurements::TagBirth_date = QStringLiteral("birth-date"); const QString VIndividualMeasurements::TagBirth_date = QStringLiteral("birth-date");
const QString VIndividualMeasurements::TagSex = QStringLiteral("sex"); const QString VIndividualMeasurements::TagSex = QStringLiteral("sex");
const QString VIndividualMeasurements::TagUnit = QStringLiteral("unit"); const QString VIndividualMeasurements::TagUnit = QStringLiteral("unit");
const QString VIndividualMeasurements::TagEmail = QStringLiteral("email"); const QString VIndividualMeasurements::TagEmail = QStringLiteral("email");
const QString VIndividualMeasurements::SexMale = QStringLiteral("male"); const QString VIndividualMeasurements::SexMale = QStringLiteral("male");
const QString VIndividualMeasurements::SexFemale = QStringLiteral("female"); const QString VIndividualMeasurements::SexFemale = QStringLiteral("female");
@ -67,92 +60,142 @@ void VIndividualMeasurements::setUnit(const Valentina::Units &unit)
void VIndividualMeasurements::Measurements() void VIndividualMeasurements::Measurements()
{ {
//head and neck //head and neck
Measurement("head_girth"); Measurement(headGirth);
Measurement("mid_neck_girth"); Measurement(midNeckGirth);
Measurement("neck_base_girth"); Measurement(neckBaseGirth);
Measurement("head_and_neck_length"); Measurement(headAndNeckLength);
//torso //torso
Measurement("center_front_waist_length"); Measurement(centerFrontWaistLength);
Measurement("center_back_waist_length"); Measurement(centerBackWaistLength);
Measurement("shoulder_length"); Measurement(shoulderLength);
Measurement("side_waist_length"); Measurement(sideWaistLength);
Measurement("trunk_length"); Measurement(trunkLength);
Measurement("shoulder_girth"); Measurement(shoulderGirth);
Measurement("upper_chest_girth"); Measurement(upperChestGirth);
Measurement("bust__girth"); Measurement(bustGirth);
Measurement("under_bust_girth"); Measurement(underBustGirth);
Measurement("waist_girth"); Measurement(waistGirth);
Measurement("high_hip_girth"); Measurement(highHipGirth);
Measurement("hip_girth"); Measurement(hipGirth);
Measurement("upper_front_chest_width"); Measurement(upperFrontChestWidth);
Measurement("front_chest_width"); Measurement(frontChestWidth);
Measurement("across_front_shoulder_width"); Measurement(acrossFrontShoulderWidth);
Measurement("across_back_shoulder_width"); Measurement(acrossBackShoulderWidth);
Measurement("upper_back_width"); Measurement(upperBackWidth);
Measurement("back_width"); Measurement(backWidth);
Measurement("bustpoint_to_bustpoint"); Measurement(bustpointToBustpoint);
Measurement("halter_bustpoint_to_bustpoint"); Measurement(halterBustpointToBustpoint);
Measurement("neck_to_bustpoint"); Measurement(neckToBustpoint);
Measurement("crotch_length"); Measurement(crotchLength);
Measurement("rise_height"); Measurement(riseHeight);
Measurement("shoulder_drop"); Measurement(shoulderDrop);
Measurement("shoulder_slope_degrees"); Measurement(shoulderSlopeDegrees);
Measurement("front_shoulder_slope_length"); Measurement(frontShoulderSlopeLength);
Measurement("back_shoulder_slope_length"); Measurement(backShoulderSlopeLength);
Measurement("front_shoulder_to_waist_length"); Measurement(frontShoulderToWaistLength);
Measurement("back_shoulder_to_waist_length"); Measurement(backShoulderToWaistLength);
Measurement("front_neck_arc"); Measurement(frontNeckArc);
Measurement("back_neck_arc"); Measurement(backNeckArc);
Measurement("front_upper-bust_arc"); Measurement(frontUpperChestArc);
Measurement("back_upper-bust_arc"); Measurement(backUpperChestArc);
Measurement("front_waist_arc"); Measurement(frontWaistArc);
Measurement("back_waist_arc"); Measurement(backWaistArc);
Measurement("front_upper-hip_arc"); Measurement(frontUpperHipArc);
Measurement("back_upper-hip_arc"); Measurement(backUpperHipArc);
Measurement("front_hip_arc"); Measurement(frontHipArc);
Measurement("back_hip_arc"); Measurement(backHipArc);
Measurement("chest_slope"); Measurement(chestSlope);
Measurement("back_slope"); Measurement(backSlope);
Measurement("front_waist_slope"); Measurement(frontWaistSlope);
Measurement("back_waist_slope"); Measurement(backWaistSlope);
Measurement("front-neck_to_upper-chest_height"); Measurement(frontNeckToUpperChestHeight);
Measurement("front-neck_to_bust_height"); Measurement(frontNeckToBustHeight);
//arm //arm
Measurement("armscye_girth"); Measurement(armscyeGirth);
Measurement("elbow_girth"); Measurement(elbowGirth);
Measurement("upper-arm_girth"); Measurement(upperArmGirth);
Measurement("wrist_girth"); Measurement(wristGirth);
Measurement("scye_depth"); Measurement(scyeDepth);
Measurement("shoulder_and_arm_length"); Measurement(shoulderAndArmLength);
Measurement("underarm_length"); Measurement(underarmLength);
Measurement("cervicale_to_wrist_length"); Measurement(cervicaleToWristLength);
Measurement("shoulder_to_elbow_length"); Measurement(shoulderToElbowLength);
Measurement("arm_length"); Measurement(armLength);
//hand //hand
Measurement("hand_width"); Measurement(handWidth);
Measurement("hand_length"); Measurement(handLength);
Measurement("hand_girth"); Measurement(handGirth);
//leg //leg
Measurement("thigh_girth"); Measurement(thighGirth);
Measurement("mid_thigh_girth"); Measurement(midThighGirth);
Measurement("knee_girth"); Measurement(kneeGirth);
Measurement("calf_girth"); Measurement(calfGirth);
Measurement("ankle_girth"); Measurement(ankleGirth);
Measurement("knee_height"); Measurement(kneeHeight);
Measurement("ankle_height"); Measurement(ankleHeight);
//foot //foot
Measurement("foot_width"); Measurement(footWidth);
Measurement("foot_length"); Measurement(footLength);
//heights //heights
Measurement("height"); Measurement(height);
Measurement("cervicale_height"); Measurement(cervicaleHeight);
Measurement("cervicale_to_knee_height"); Measurement(cervicaleToKneeHeight);
Measurement("waist_height"); Measurement(waistHeight);
Measurement("high_hip_height"); Measurement(highHipHeight);
Measurement("hip_height"); Measurement(hipHeight);
Measurement("waist_to_hip_height"); Measurement(waistToHipHeight);
Measurement("waist_to_knee_height"); Measurement(waistToKneeHeight);
Measurement("crotch_height"); Measurement(crotchHeight);
//extended
Measurement(size);
Measurement(heightFrontNeckBasePoint);
Measurement(heightBaseNeckSidePoint);
Measurement(heightShoulderPoint);
Measurement(heightNipplePoint);
Measurement(heightBackAngleAxilla);
Measurement(heightScapularPoint);
Measurement(heightUnderButtockFolds);
Measurement(hipsExcludingProtrudingAbdomen);
Measurement(girthFootInstep);
Measurement(sideWaistToFloor);
Measurement(frontWaistToFloor);
Measurement(arcThroughGroinArea);
Measurement(waistToPlaneSeat);
Measurement(neckToRadialPoint);
Measurement(neckToThirdFinger);
Measurement(neckToFirstLineChestCircumference);
Measurement(frontWaistLength);
Measurement(arcThroughShoulderJoint);
Measurement(neckToBackLineChestCircumference);
Measurement(waistToNeckSide);
Measurement(arcLengthUpperBody);
Measurement(chestWidth);
Measurement(anteroposteriorDiameterHands);
Measurement(heightClavicularPoint);
Measurement(heightArmholeSlash);
Measurement(slashShoulderHeight);
Measurement(halfGirthNeck);
Measurement(halfGirthNeckForShirts);
Measurement(halfGirthChestFirst);
Measurement(halfGirthChestSecond);
Measurement(halfGirthChestThird);
Measurement(halfGirthWaist);
Measurement(halfGirthHipsConsideringProtrudingAbdomen);
Measurement(halfGirthHipsExcludingProtrudingAbdomen);
Measurement(girthKneeFlexedFeet);
Measurement(neckTransverseDiameter);
Measurement(frontSlashShoulderHeight);
Measurement(neckToFrontWaistLine);
Measurement(handVerticalDiameter);
Measurement(neckToKneePoint);
Measurement(waistToKnee);
Measurement(shoulderHeight);
Measurement(headHeight);
Measurement(bodyPosition);
Measurement(arcBehindShoulderGirdle);
Measurement(neckToNeckBase);
Measurement(depthWaistFirst);
Measurement(depthWaistSecond);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -172,61 +215,17 @@ void VIndividualMeasurements::Measurement(const QString &tag)
const QDomElement domElement = domNode.toElement(); const QDomElement domElement = domNode.toElement();
if (domElement.isNull() == false) if (domElement.isNull() == false)
{ {
const bool ignore = QVariant(GetParametrString(domElement, AttrIgnore, "false")).toBool(); qreal value = GetParametrDouble(domElement, AttrValue, "0.0");
if (ignore)
{
return;
}
const QString name = GetParametrString(domElement, AttrName, "");
if (name.isEmpty())
{
return;
}
const QString m_number = GetParametrString(domElement, AttrM_number, "");
const QString gui_text = GetParametrString(domElement, AttrGui_text, "");
const qreal value = GetParametrDouble(domElement, AttrValue, "0.0");
const QString description = GetParametrString(domElement, AttrDescription, "");
if (Unit() == Valentina::Mm)//Convert to Cm. if (Unit() == Valentina::Mm)//Convert to Cm.
{ {
data->AddMeasurement(name, VMeasurement(value/10.0, gui_text, description, tag)); value = value / 10.0;
if (m_number.isEmpty())
{
qDebug()<<"Can't find language-independent measurement name for "<< tag;
return;
} }
else data->AddMeasurement(tag, VMeasurement(value, qApp->GuiText(tag), qApp->Description(tag), tag));
{
VMeasurement m(value/10.0, gui_text, description, tag);
m.setVirtual(true);
data->AddMeasurement(m_number, m);
}
}
else//Cm or inch.
{
data->AddMeasurement(name, VMeasurement(value, gui_text, description, tag));
if (m_number.isEmpty())
{
qDebug()<<"Can't find language-independent measurement name for "<< tag;
return;
}
else
{
VMeasurement m(value, gui_text, description, tag);
m.setVirtual(true);
data->AddMeasurement(m_number, m);
} }
} }
} }
} }
}
}
//---------------------------------------------------------------------------------------------------------------------
QString VIndividualMeasurements::Language() const
{
return UniqueTagText(TagLang, "en");
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QString VIndividualMeasurements::FamilyName() const QString VIndividualMeasurements::FamilyName() const

View File

@ -42,7 +42,6 @@ public:
Valentina::Units Unit() const; Valentina::Units Unit() const;
void setUnit(const Valentina::Units &unit); void setUnit(const Valentina::Units &unit);
void Measurements(); void Measurements();
QString Language() const;
QString FamilyName() const; QString FamilyName() const;
void setFamilyName(const QString &text); void setFamilyName(const QString &text);
QString GivenName() const; QString GivenName() const;
@ -53,21 +52,13 @@ public:
void setSex(const VIndividualMeasurements::Genders &sex); void setSex(const VIndividualMeasurements::Genders &sex);
QString Mail() const; QString Mail() const;
void setMail(const QString &text); void setMail(const QString &text);
static const QString AttrIgnore;
static const QString AttrName;
static const QString AttrM_number;
static const QString AttrGui_text;
static const QString AttrValue; static const QString AttrValue;
static const QString AttrDescription;
static const QString TagLang;
static const QString TagFamily_name; static const QString TagFamily_name;
static const QString TagGiven_name; static const QString TagGiven_name;
static const QString TagBirth_date; static const QString TagBirth_date;
static const QString TagSex; static const QString TagSex;
static const QString TagUnit; static const QString TagUnit;
static const QString TagEmail; static const QString TagEmail;
static const QString SexMale; static const QString SexMale;
static const QString SexFemale; static const QString SexFemale;