Merge with develop.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2017-09-18 09:13:47 +03:00
commit 783f2f1296

View File

@ -160,6 +160,8 @@ static const QString strLetter = QStringLiteral("letter");
static const QString strMaterial = QStringLiteral("material");
static const QString strUserDefined = QStringLiteral("userDef");
static const QString strPlacement = QStringLiteral("placement");
static const QString strCutNumber = QStringLiteral("cutNumber");
static const QString strQuantity = QStringLiteral("quantity");
//---------------------------------------------------------------------------------------------------------------------
VPatternConverter::VPatternConverter(const QString &fileName)
@ -2268,6 +2270,9 @@ void VPatternConverter::PortPieceLabelstoV0_6_0()
AddLabelTemplateLineV0_6_0(dataTag, "%pName%", true, false, Qt::AlignHCenter, 2);
int firstLineCutNumber = 1;
bool firstLine = true;
for (int iMCP = 0; iMCP < count; ++iMCP)
{
QDomElement domMCP = nodeListMCP.at(iMCP).toElement();
@ -2295,7 +2300,29 @@ void VPatternConverter::PortPieceLabelstoV0_6_0()
break;
}
line.append(", %wCut% %pQuantity%");
line.append(", %wCut% ");
const int cutNumber = static_cast<int>(GetParametrUInt(domMCP, strCutNumber, "1"));
if (firstLine)
{
firstLineCutNumber = cutNumber;
dataTag.setAttribute(strQuantity, cutNumber);
line.append("%pQuantity%");
firstLine = false;
}
else
{
if (firstLineCutNumber != cutNumber)
{
line.append(QString::number(cutNumber));
}
else
{
line.append("%pQuantity%");
}
}
if (GetParametrUInt(domMCP, strPlacement, "0") == 1)
{
line.append(" %wOnFold%");