Remove gradation information from pattern.
This commit is contained in:
parent
4cea74d63b
commit
18e1a4a601
10
dist/debian/valentina.1
vendored
10
dist/debian/valentina.1
vendored
|
@ -139,10 +139,12 @@ The path to output destination folder. By default the directory at which the app
|
||||||
.RB "Export only details. Export details as they positioned in the details mode. Any layout related options will be ignored."
|
.RB "Export only details. Export details as they positioned in the details mode. Any layout related options will be ignored."
|
||||||
.IP "--exportSuchDetails <The name regex>"
|
.IP "--exportSuchDetails <The name regex>"
|
||||||
.RB "Export only details that match a piece name regex."
|
.RB "Export only details that match a piece name regex."
|
||||||
.IP "-x, --gsize <The size value>"
|
.IP "--dimensionA <The dimension A base>"
|
||||||
.RB "Set size value a pattern file, that was opened with multisize measurements " "(export mode)" ". Valid values: 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56cm."
|
.RB "Set base for dimension A in the multisize measurements units " "(export mode)" "."
|
||||||
.IP "-e, --gheight <The height value>"
|
.IP "--dimensionB <The dimension B base>"
|
||||||
.RB "Set height value a pattern file, that was opened with multisize measurements (" "export mode" "). Valid values: 92, 98, 104, 110, 116, 122, 128, 134, 140, 146, 152, 158, 164, 170, 176, 182, 188, 194, 200cm."
|
.RB "Set base for dimension B in the multisize measurements units " "(export mode)" "."
|
||||||
|
.IP "--dimensionC <The dimension C base>"
|
||||||
|
.RB "Set base for dimension C in the multisize measurements units " "(export mode)" "."
|
||||||
.IP "--userMaterial <User material>"
|
.IP "--userMaterial <User material>"
|
||||||
.RB "Use this option to override user material defined in pattern. The value must be in form <number>@<user matrial name>. The number should be in range from 1 to 20. For example, 1@Fabric2. The key can be used multiple times. Has no effect in GUI mode."
|
.RB "Use this option to override user material defined in pattern. The value must be in form <number>@<user matrial name>. The number should be in range from 1 to 20. For example, 1@Fabric2. The key can be used multiple times. Has no effect in GUI mode."
|
||||||
.IP "-p, --pageformat <Template number>"
|
.IP "-p, --pageformat <Template number>"
|
||||||
|
|
|
@ -506,40 +506,68 @@ bool VCommandLine::IsGuiEnabled() const
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
bool VCommandLine::IsSetGradationSize() const
|
bool VCommandLine::IsSetDimensionA() const
|
||||||
{
|
{
|
||||||
return IsOptionSet(LONG_OPTION_GRADATIONSIZE);
|
return IsOptionSet(LONG_OPTION_DIMENSION_A);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
bool VCommandLine::IsSetGradationHeight() const
|
bool VCommandLine::IsSetDimensionB() const
|
||||||
{
|
{
|
||||||
return IsOptionSet(LONG_OPTION_GRADATIONHEIGHT);
|
return IsOptionSet(LONG_OPTION_DIMENSION_B);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QString VCommandLine::OptGradationSize() const
|
bool VCommandLine::IsSetDimensionC() const
|
||||||
{
|
{
|
||||||
const QString size = OptionValue(LONG_OPTION_GRADATIONSIZE);
|
return IsOptionSet(LONG_OPTION_DIMENSION_C);
|
||||||
if (VMeasurement::IsGradationSizeValid(size))
|
|
||||||
{
|
|
||||||
return size;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
qCritical() << translate("VCommandLine", "Invalid gradation size value.") << "\n";
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
int VCommandLine::OptDimensionA() const
|
||||||
|
{
|
||||||
|
const QString value = OptionValue(LONG_OPTION_DIMENSION_A);
|
||||||
|
|
||||||
|
bool ok = false;
|
||||||
|
int dimensionAValue = value.toInt(&ok);
|
||||||
|
if(ok && dimensionAValue > 0)
|
||||||
|
{
|
||||||
|
return dimensionAValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
qCritical() << translate("VCommandLine", "Invalid dimension A value.") << "\n";
|
||||||
const_cast<VCommandLine*>(this)->parser.showHelp(V_EX_USAGE);
|
const_cast<VCommandLine*>(this)->parser.showHelp(V_EX_USAGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QString VCommandLine::OptGradationHeight() const
|
int VCommandLine::OptDimensionB() const
|
||||||
{
|
{
|
||||||
const QString height = OptionValue(LONG_OPTION_GRADATIONHEIGHT);
|
const QString value = OptionValue(LONG_OPTION_DIMENSION_B);
|
||||||
if (VMeasurement::IsGradationHeightValid(height))
|
|
||||||
|
bool ok = false;
|
||||||
|
int dimensionBValue = value.toInt(&ok);
|
||||||
|
if(ok && dimensionBValue > 0)
|
||||||
{
|
{
|
||||||
return height;
|
return dimensionBValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
qCritical() << translate("VCommandLine", "Invalid gradation height value.") << "\n";
|
qCritical() << translate("VCommandLine", "Invalid dimension B value.") << "\n";
|
||||||
|
const_cast<VCommandLine*>(this)->parser.showHelp(V_EX_USAGE);
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
int VCommandLine::OptDimensionC() const
|
||||||
|
{
|
||||||
|
const QString value = OptionValue(LONG_OPTION_DIMENSION_C);
|
||||||
|
|
||||||
|
bool ok = false;
|
||||||
|
int dimensionCValue = value.toInt(&ok);
|
||||||
|
if(ok && dimensionCValue > 0)
|
||||||
|
{
|
||||||
|
return dimensionCValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
qCritical() << translate("VCommandLine", "Invalid dimension C value.") << "\n";
|
||||||
const_cast<VCommandLine*>(this)->parser.showHelp(V_EX_USAGE);
|
const_cast<VCommandLine*>(this)->parser.showHelp(V_EX_USAGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -635,14 +663,19 @@ void VCommandLine::InitCommandLineOptions()
|
||||||
{LONG_OPTION_EXPORTSUCHDETAILS,
|
{LONG_OPTION_EXPORTSUCHDETAILS,
|
||||||
translate("VCommandLine", "Export only details that match a piece name regex."),
|
translate("VCommandLine", "Export only details that match a piece name regex."),
|
||||||
translate("VCommandLine", "The name regex")},
|
translate("VCommandLine", "The name regex")},
|
||||||
{{SINGLE_OPTION_GRADATIONSIZE, LONG_OPTION_GRADATIONSIZE},
|
|
||||||
translate("VCommandLine", "Set size value for pattern file, that was opened with multisize measurements "
|
{LONG_OPTION_DIMENSION_A,
|
||||||
"(export mode). Valid values: %1cm.").arg(VMeasurement::WholeListSizes(Unit::Cm) .join(QStringLiteral(", "))),
|
translate("VCommandLine", "Set base for dimension A in the multisize measurements units (export mode)."),
|
||||||
translate("VCommandLine", "The size value")},
|
translate("VCommandLine", "The dimension A base")},
|
||||||
{{SINGLE_OPTION_GRADATIONHEIGHT, LONG_OPTION_GRADATIONHEIGHT},
|
|
||||||
translate("VCommandLine", "Set height value for pattern file, that was opened with multisize measurements "
|
{LONG_OPTION_DIMENSION_B,
|
||||||
"(export mode). Valid values: %1cm.").arg(VMeasurement::WholeListHeights(Unit::Cm).join(QStringLiteral(", "))),
|
translate("VCommandLine", "Set base for dimension B in the multisize measurements units (export mode)."),
|
||||||
translate("VCommandLine", "The height value")},
|
translate("VCommandLine", "The dimension B base")},
|
||||||
|
|
||||||
|
{LONG_OPTION_DIMENSION_C,
|
||||||
|
translate("VCommandLine", "Set base for dimension C in the multisize measurements units (export mode)."),
|
||||||
|
translate("VCommandLine", "The dimension C base")},
|
||||||
|
|
||||||
{LONG_OPTION_USER_MATERIAL,
|
{LONG_OPTION_USER_MATERIAL,
|
||||||
translate("VCommandLine", "Use this option to override user material defined in pattern. The value must be in "
|
translate("VCommandLine", "Use this option to override user material defined in pattern. The value must be in "
|
||||||
"form <number>@<user matrial name>. The number should be in range from 1 to %1. For example, 1@Fabric2. The "
|
"form <number>@<user matrial name>. The number should be in range from 1 to %1. For example, 1@Fabric2. The "
|
||||||
|
|
|
@ -115,11 +115,13 @@ public:
|
||||||
|
|
||||||
bool IsGuiEnabled()const;
|
bool IsGuiEnabled()const;
|
||||||
|
|
||||||
bool IsSetGradationSize() const;
|
bool IsSetDimensionA() const;
|
||||||
bool IsSetGradationHeight() const;
|
bool IsSetDimensionB() const;
|
||||||
|
bool IsSetDimensionC() const;
|
||||||
|
|
||||||
QString OptGradationSize() const;
|
int OptDimensionA() const;
|
||||||
QString OptGradationHeight() const;
|
int OptDimensionB() const;
|
||||||
|
int OptDimensionC() const;
|
||||||
|
|
||||||
QMarginsF TiledPageMargins() const;
|
QMarginsF TiledPageMargins() const;
|
||||||
VAbstractLayoutDialog::PaperSizeTemplate OptTiledPaperSize() const;
|
VAbstractLayoutDialog::PaperSizeTemplate OptTiledPaperSize() const;
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QDate>
|
#include <QDate>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include <QRadioButton>
|
||||||
|
|
||||||
#include "../xml/vpattern.h"
|
#include "../xml/vpattern.h"
|
||||||
#include "../vpatterndb/vcontainer.h"
|
#include "../vpatterndb/vcontainer.h"
|
||||||
|
@ -42,21 +43,12 @@
|
||||||
#include "dialogknownmaterials.h"
|
#include "dialogknownmaterials.h"
|
||||||
#include "dialogpatternmaterials.h"
|
#include "dialogpatternmaterials.h"
|
||||||
|
|
||||||
// calc how many combinations we have
|
|
||||||
static const int heightsCount = (static_cast<int>(GHeights::H200) -
|
|
||||||
(static_cast<int>(GHeights::H50) - heightStep))/heightStep;
|
|
||||||
static const int sizesCount = (static_cast<int>(GSizes::S72) - (static_cast<int>(GSizes::S22) - sizeStep))/sizeStep;
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
DialogPatternProperties::DialogPatternProperties(VPattern *doc, VContainer *pattern, QWidget *parent)
|
DialogPatternProperties::DialogPatternProperties(VPattern *doc, VContainer *pattern, QWidget *parent)
|
||||||
: QDialog(parent),
|
: QDialog(parent),
|
||||||
ui(new Ui::DialogPatternProperties),
|
ui(new Ui::DialogPatternProperties),
|
||||||
doc(doc),
|
doc(doc),
|
||||||
pattern(pattern),
|
pattern(pattern),
|
||||||
heightsChecked(heightsCount),
|
|
||||||
sizesChecked(sizesCount),
|
|
||||||
heights (QMap<GHeights, bool>()),
|
|
||||||
sizes(QMap<GSizes, bool>()),
|
|
||||||
data(QMap<QCheckBox *, int>()),
|
data(QMap<QCheckBox *, int>()),
|
||||||
descriptionChanged(false),
|
descriptionChanged(false),
|
||||||
gradationChanged(false),
|
gradationChanged(false),
|
||||||
|
@ -145,39 +137,6 @@ DialogPatternProperties::DialogPatternProperties(VPattern *doc, VContainer *pat
|
||||||
ui->tabWidget->setTabEnabled(1, false);
|
ui->tabWidget->setTabEnabled(1, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
InitHeights();
|
|
||||||
InitSizes();
|
|
||||||
|
|
||||||
heights = doc->GetGradationHeights();
|
|
||||||
sizes = doc->GetGradationSizes();
|
|
||||||
|
|
||||||
SetOptions(heights);
|
|
||||||
SetOptions(sizes);
|
|
||||||
|
|
||||||
InitComboBox(ui->comboBoxHeight, heights);
|
|
||||||
InitComboBox(ui->comboBoxSize, sizes);
|
|
||||||
|
|
||||||
const QString height = QString().setNum(doc->GetDefCustomHeight());
|
|
||||||
SetDefaultHeight(height);
|
|
||||||
|
|
||||||
const QString size = QString().setNum(doc->GetDefCustomSize());
|
|
||||||
SetDefaultSize(size);
|
|
||||||
|
|
||||||
connect(ui->radioButtonDefFromP, &QRadioButton::toggled, this, [this]()
|
|
||||||
{
|
|
||||||
ui->comboBoxHeight->setEnabled(ui->radioButtonDefFromP->isChecked());
|
|
||||||
ui->comboBoxSize->setEnabled(ui->radioButtonDefFromP->isChecked());
|
|
||||||
});
|
|
||||||
|
|
||||||
auto DefValueChanged = [this](){defaultChanged = true;};
|
|
||||||
|
|
||||||
connect(ui->radioButtonDefFromP, &QRadioButton::toggled, this, DefValueChanged);
|
|
||||||
|
|
||||||
ui->radioButtonDefFromP->setChecked(doc->IsDefCustom());
|
|
||||||
|
|
||||||
connect(ui->comboBoxHeight, QOverload<int>::of(&QComboBox::currentIndexChanged), this, DefValueChanged);
|
|
||||||
connect(ui->comboBoxSize, QOverload<int>::of(&QComboBox::currentIndexChanged), this, DefValueChanged);
|
|
||||||
|
|
||||||
const bool readOnly = doc->IsReadOnly();
|
const bool readOnly = doc->IsReadOnly();
|
||||||
ui->checkBoxPatternReadOnly->setChecked(readOnly);
|
ui->checkBoxPatternReadOnly->setChecked(readOnly);
|
||||||
if (not readOnly)
|
if (not readOnly)
|
||||||
|
@ -245,13 +204,9 @@ void DialogPatternProperties::Apply()
|
||||||
SaveDescription();
|
SaveDescription();
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
SaveGradation();
|
|
||||||
SaveDefValues();
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
SaveReadOnlyState();
|
SaveReadOnlyState();
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 2:
|
||||||
SaveLabelData();
|
SaveLabelData();
|
||||||
SaveTemplateData();
|
SaveTemplateData();
|
||||||
SaveMaterialData();
|
SaveMaterialData();
|
||||||
|
@ -266,8 +221,6 @@ void DialogPatternProperties::Apply()
|
||||||
void DialogPatternProperties::Ok()
|
void DialogPatternProperties::Ok()
|
||||||
{
|
{
|
||||||
SaveDescription();
|
SaveDescription();
|
||||||
SaveGradation();
|
|
||||||
SaveDefValues();
|
|
||||||
SaveReadOnlyState();
|
SaveReadOnlyState();
|
||||||
SaveLabelData();
|
SaveLabelData();
|
||||||
SaveTemplateData();
|
SaveTemplateData();
|
||||||
|
@ -278,143 +231,12 @@ void DialogPatternProperties::Ok()
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
void DialogPatternProperties::SelectAll(int state)
|
|
||||||
{
|
|
||||||
QCheckBox* box = qobject_cast<QCheckBox*>(sender());
|
|
||||||
if (box)
|
|
||||||
{
|
|
||||||
if (box == ui->checkBoxAllHeights)
|
|
||||||
{
|
|
||||||
if (state == Qt::Checked)
|
|
||||||
{
|
|
||||||
SetHeightsChecked(true);
|
|
||||||
}
|
|
||||||
else if (state == Qt::Unchecked)
|
|
||||||
{
|
|
||||||
SetHeightsChecked(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (data.contains(box))
|
|
||||||
{
|
|
||||||
heights.insert(static_cast<GHeights>(data.value(box)), box->isChecked());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (box == ui->checkBoxAllSizes)
|
|
||||||
{
|
|
||||||
if (state == Qt::Checked)
|
|
||||||
{
|
|
||||||
SetSizesChecked(true);
|
|
||||||
}
|
|
||||||
else if (state == Qt::Unchecked)
|
|
||||||
{
|
|
||||||
SetSizesChecked(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (data.contains(box))
|
|
||||||
{
|
|
||||||
sizes.insert(static_cast<GSizes>(data.value(box)), box->isChecked());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
void DialogPatternProperties::CheckStateHeight(int state)
|
|
||||||
{
|
|
||||||
QCheckBox* box = qobject_cast<QCheckBox*>(sender());
|
|
||||||
if (box)
|
|
||||||
{
|
|
||||||
if (state == Qt::Checked)
|
|
||||||
{
|
|
||||||
++heightsChecked;
|
|
||||||
if (heightsChecked == heightsCount)
|
|
||||||
{
|
|
||||||
ui->checkBoxAllHeights->blockSignals(true);//don't touch anothers checkboxes
|
|
||||||
ui->checkBoxAllHeights->setCheckState(Qt::Checked);
|
|
||||||
heights.insert(GHeights::ALL, true);
|
|
||||||
ui->checkBoxAllHeights->blockSignals(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (state == Qt::Unchecked)
|
|
||||||
{
|
|
||||||
if (heightsChecked == heightsCount)
|
|
||||||
{
|
|
||||||
ui->checkBoxAllHeights->blockSignals(true);//don't touch anothers checkboxes
|
|
||||||
ui->checkBoxAllHeights->setCheckState(Qt::Unchecked);
|
|
||||||
heights.insert(GHeights::ALL, false);
|
|
||||||
ui->checkBoxAllHeights->blockSignals(false);
|
|
||||||
}
|
|
||||||
--heightsChecked;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (data.contains(box))
|
|
||||||
{
|
|
||||||
heights.insert(static_cast<GHeights>(data.value(box)), box->isChecked());
|
|
||||||
}
|
|
||||||
|
|
||||||
UpdateDefHeight();
|
|
||||||
|
|
||||||
CheckApplyOk();
|
|
||||||
gradationChanged = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
void DialogPatternProperties::CheckStateSize(int state)
|
|
||||||
{
|
|
||||||
QCheckBox* box = qobject_cast<QCheckBox*>(sender());
|
|
||||||
if (box)
|
|
||||||
{
|
|
||||||
|
|
||||||
if (state == Qt::Checked)
|
|
||||||
{
|
|
||||||
++sizesChecked;
|
|
||||||
if (sizesChecked == sizesCount)
|
|
||||||
{
|
|
||||||
ui->checkBoxAllSizes->blockSignals(true);//don't touch anothers checkboxes
|
|
||||||
ui->checkBoxAllSizes->setCheckState(Qt::Checked);
|
|
||||||
sizes.insert(GSizes::ALL, true);
|
|
||||||
ui->checkBoxAllSizes->blockSignals(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (state == Qt::Unchecked)
|
|
||||||
{
|
|
||||||
if (sizesChecked == sizesCount)
|
|
||||||
{
|
|
||||||
ui->checkBoxAllSizes->blockSignals(true);//don't touch anothers checkboxes
|
|
||||||
ui->checkBoxAllSizes->setCheckState(Qt::Unchecked);
|
|
||||||
sizes.insert(GSizes::ALL, false);
|
|
||||||
ui->checkBoxAllSizes->blockSignals(false);
|
|
||||||
}
|
|
||||||
--sizesChecked;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (data.contains(box))
|
|
||||||
{
|
|
||||||
sizes.insert(static_cast<GSizes>(data.value(box)), box->isChecked());
|
|
||||||
}
|
|
||||||
|
|
||||||
UpdateDefSize();
|
|
||||||
|
|
||||||
CheckApplyOk();
|
|
||||||
gradationChanged = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogPatternProperties::DescEdited()
|
void DialogPatternProperties::DescEdited()
|
||||||
{
|
{
|
||||||
descriptionChanged = true;
|
descriptionChanged = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
void DialogPatternProperties::DefValueChanged()
|
|
||||||
{
|
|
||||||
defaultChanged = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogPatternProperties::LabelDataChanged()
|
void DialogPatternProperties::LabelDataChanged()
|
||||||
{
|
{
|
||||||
|
@ -422,134 +244,6 @@ void DialogPatternProperties::LabelDataChanged()
|
||||||
askSaveLabelData = true;
|
askSaveLabelData = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
void DialogPatternProperties::SetHeightsChecked(bool enabled)
|
|
||||||
{
|
|
||||||
ui->checkBoxH50->setChecked(enabled);
|
|
||||||
ui->checkBoxH56->setChecked(enabled);
|
|
||||||
ui->checkBoxH62->setChecked(enabled);
|
|
||||||
ui->checkBoxH68->setChecked(enabled);
|
|
||||||
ui->checkBoxH74->setChecked(enabled);
|
|
||||||
ui->checkBoxH80->setChecked(enabled);
|
|
||||||
ui->checkBoxH86->setChecked(enabled);
|
|
||||||
ui->checkBoxH92->setChecked(enabled);
|
|
||||||
ui->checkBoxH98->setChecked(enabled);
|
|
||||||
ui->checkBoxH104->setChecked(enabled);
|
|
||||||
ui->checkBoxH110->setChecked(enabled);
|
|
||||||
ui->checkBoxH116->setChecked(enabled);
|
|
||||||
ui->checkBoxH122->setChecked(enabled);
|
|
||||||
ui->checkBoxH128->setChecked(enabled);
|
|
||||||
ui->checkBoxH134->setChecked(enabled);
|
|
||||||
ui->checkBoxH140->setChecked(enabled);
|
|
||||||
ui->checkBoxH146->setChecked(enabled);
|
|
||||||
ui->checkBoxH152->setChecked(enabled);
|
|
||||||
ui->checkBoxH158->setChecked(enabled);
|
|
||||||
ui->checkBoxH164->setChecked(enabled);
|
|
||||||
ui->checkBoxH170->setChecked(enabled);
|
|
||||||
ui->checkBoxH176->setChecked(enabled);
|
|
||||||
ui->checkBoxH182->setChecked(enabled);
|
|
||||||
ui->checkBoxH188->setChecked(enabled);
|
|
||||||
ui->checkBoxH194->setChecked(enabled);
|
|
||||||
ui->checkBoxH200->setChecked(enabled);
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
void DialogPatternProperties::SetSizesChecked(bool enabled)
|
|
||||||
{
|
|
||||||
ui->checkBoxS22->setChecked(enabled);
|
|
||||||
ui->checkBoxS24->setChecked(enabled);
|
|
||||||
ui->checkBoxS26->setChecked(enabled);
|
|
||||||
ui->checkBoxS28->setChecked(enabled);
|
|
||||||
ui->checkBoxS30->setChecked(enabled);
|
|
||||||
ui->checkBoxS32->setChecked(enabled);
|
|
||||||
ui->checkBoxS34->setChecked(enabled);
|
|
||||||
ui->checkBoxS36->setChecked(enabled);
|
|
||||||
ui->checkBoxS38->setChecked(enabled);
|
|
||||||
ui->checkBoxS40->setChecked(enabled);
|
|
||||||
ui->checkBoxS42->setChecked(enabled);
|
|
||||||
ui->checkBoxS44->setChecked(enabled);
|
|
||||||
ui->checkBoxS46->setChecked(enabled);
|
|
||||||
ui->checkBoxS48->setChecked(enabled);
|
|
||||||
ui->checkBoxS50->setChecked(enabled);
|
|
||||||
ui->checkBoxS52->setChecked(enabled);
|
|
||||||
ui->checkBoxS54->setChecked(enabled);
|
|
||||||
ui->checkBoxS56->setChecked(enabled);
|
|
||||||
ui->checkBoxS58->setChecked(enabled);
|
|
||||||
ui->checkBoxS60->setChecked(enabled);
|
|
||||||
ui->checkBoxS62->setChecked(enabled);
|
|
||||||
ui->checkBoxS64->setChecked(enabled);
|
|
||||||
ui->checkBoxS66->setChecked(enabled);
|
|
||||||
ui->checkBoxS68->setChecked(enabled);
|
|
||||||
ui->checkBoxS70->setChecked(enabled);
|
|
||||||
ui->checkBoxS72->setChecked(enabled);
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
void DialogPatternProperties::InitHeights()
|
|
||||||
{
|
|
||||||
Init(ui->checkBoxAllHeights, static_cast<int>(GHeights::ALL), &DialogPatternProperties::SelectAll);
|
|
||||||
|
|
||||||
Init(ui->checkBoxH50, static_cast<int>(GHeights::H50), &DialogPatternProperties::CheckStateHeight);
|
|
||||||
Init(ui->checkBoxH56, static_cast<int>(GHeights::H56), &DialogPatternProperties::CheckStateHeight);
|
|
||||||
Init(ui->checkBoxH62, static_cast<int>(GHeights::H62), &DialogPatternProperties::CheckStateHeight);
|
|
||||||
Init(ui->checkBoxH68, static_cast<int>(GHeights::H68), &DialogPatternProperties::CheckStateHeight);
|
|
||||||
Init(ui->checkBoxH74, static_cast<int>(GHeights::H74), &DialogPatternProperties::CheckStateHeight);
|
|
||||||
Init(ui->checkBoxH80, static_cast<int>(GHeights::H80), &DialogPatternProperties::CheckStateHeight);
|
|
||||||
Init(ui->checkBoxH86, static_cast<int>(GHeights::H86), &DialogPatternProperties::CheckStateHeight);
|
|
||||||
Init(ui->checkBoxH92, static_cast<int>(GHeights::H92), &DialogPatternProperties::CheckStateHeight);
|
|
||||||
Init(ui->checkBoxH98, static_cast<int>(GHeights::H98), &DialogPatternProperties::CheckStateHeight);
|
|
||||||
Init(ui->checkBoxH104, static_cast<int>(GHeights::H104), &DialogPatternProperties::CheckStateHeight);
|
|
||||||
Init(ui->checkBoxH110, static_cast<int>(GHeights::H110), &DialogPatternProperties::CheckStateHeight);
|
|
||||||
Init(ui->checkBoxH116, static_cast<int>(GHeights::H116), &DialogPatternProperties::CheckStateHeight);
|
|
||||||
Init(ui->checkBoxH122, static_cast<int>(GHeights::H122), &DialogPatternProperties::CheckStateHeight);
|
|
||||||
Init(ui->checkBoxH128, static_cast<int>(GHeights::H128), &DialogPatternProperties::CheckStateHeight);
|
|
||||||
Init(ui->checkBoxH134, static_cast<int>(GHeights::H134), &DialogPatternProperties::CheckStateHeight);
|
|
||||||
Init(ui->checkBoxH140, static_cast<int>(GHeights::H140), &DialogPatternProperties::CheckStateHeight);
|
|
||||||
Init(ui->checkBoxH146, static_cast<int>(GHeights::H146), &DialogPatternProperties::CheckStateHeight);
|
|
||||||
Init(ui->checkBoxH152, static_cast<int>(GHeights::H152), &DialogPatternProperties::CheckStateHeight);
|
|
||||||
Init(ui->checkBoxH158, static_cast<int>(GHeights::H158), &DialogPatternProperties::CheckStateHeight);
|
|
||||||
Init(ui->checkBoxH164, static_cast<int>(GHeights::H164), &DialogPatternProperties::CheckStateHeight);
|
|
||||||
Init(ui->checkBoxH170, static_cast<int>(GHeights::H170), &DialogPatternProperties::CheckStateHeight);
|
|
||||||
Init(ui->checkBoxH176, static_cast<int>(GHeights::H176), &DialogPatternProperties::CheckStateHeight);
|
|
||||||
Init(ui->checkBoxH182, static_cast<int>(GHeights::H182), &DialogPatternProperties::CheckStateHeight);
|
|
||||||
Init(ui->checkBoxH188, static_cast<int>(GHeights::H188), &DialogPatternProperties::CheckStateHeight);
|
|
||||||
Init(ui->checkBoxH194, static_cast<int>(GHeights::H194), &DialogPatternProperties::CheckStateHeight);
|
|
||||||
Init(ui->checkBoxH200, static_cast<int>(GHeights::H200), &DialogPatternProperties::CheckStateHeight);
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
void DialogPatternProperties::InitSizes()
|
|
||||||
{
|
|
||||||
Init(ui->checkBoxAllSizes, static_cast<int>(GSizes::ALL), &DialogPatternProperties::SelectAll);
|
|
||||||
|
|
||||||
Init(ui->checkBoxS22, static_cast<int>(GSizes::S22), &DialogPatternProperties::CheckStateSize);
|
|
||||||
Init(ui->checkBoxS24, static_cast<int>(GSizes::S24), &DialogPatternProperties::CheckStateSize);
|
|
||||||
Init(ui->checkBoxS26, static_cast<int>(GSizes::S26), &DialogPatternProperties::CheckStateSize);
|
|
||||||
Init(ui->checkBoxS28, static_cast<int>(GSizes::S28), &DialogPatternProperties::CheckStateSize);
|
|
||||||
Init(ui->checkBoxS30, static_cast<int>(GSizes::S30), &DialogPatternProperties::CheckStateSize);
|
|
||||||
Init(ui->checkBoxS32, static_cast<int>(GSizes::S32), &DialogPatternProperties::CheckStateSize);
|
|
||||||
Init(ui->checkBoxS34, static_cast<int>(GSizes::S34), &DialogPatternProperties::CheckStateSize);
|
|
||||||
Init(ui->checkBoxS36, static_cast<int>(GSizes::S36), &DialogPatternProperties::CheckStateSize);
|
|
||||||
Init(ui->checkBoxS38, static_cast<int>(GSizes::S38), &DialogPatternProperties::CheckStateSize);
|
|
||||||
Init(ui->checkBoxS40, static_cast<int>(GSizes::S40), &DialogPatternProperties::CheckStateSize);
|
|
||||||
Init(ui->checkBoxS42, static_cast<int>(GSizes::S42), &DialogPatternProperties::CheckStateSize);
|
|
||||||
Init(ui->checkBoxS44, static_cast<int>(GSizes::S44), &DialogPatternProperties::CheckStateSize);
|
|
||||||
Init(ui->checkBoxS46, static_cast<int>(GSizes::S46), &DialogPatternProperties::CheckStateSize);
|
|
||||||
Init(ui->checkBoxS48, static_cast<int>(GSizes::S48), &DialogPatternProperties::CheckStateSize);
|
|
||||||
Init(ui->checkBoxS50, static_cast<int>(GSizes::S50), &DialogPatternProperties::CheckStateSize);
|
|
||||||
Init(ui->checkBoxS52, static_cast<int>(GSizes::S52), &DialogPatternProperties::CheckStateSize);
|
|
||||||
Init(ui->checkBoxS54, static_cast<int>(GSizes::S54), &DialogPatternProperties::CheckStateSize);
|
|
||||||
Init(ui->checkBoxS56, static_cast<int>(GSizes::S56), &DialogPatternProperties::CheckStateSize);
|
|
||||||
Init(ui->checkBoxS58, static_cast<int>(GSizes::S58), &DialogPatternProperties::CheckStateSize);
|
|
||||||
Init(ui->checkBoxS60, static_cast<int>(GSizes::S60), &DialogPatternProperties::CheckStateSize);
|
|
||||||
Init(ui->checkBoxS62, static_cast<int>(GSizes::S62), &DialogPatternProperties::CheckStateSize);
|
|
||||||
Init(ui->checkBoxS64, static_cast<int>(GSizes::S64), &DialogPatternProperties::CheckStateSize);
|
|
||||||
Init(ui->checkBoxS66, static_cast<int>(GSizes::S66), &DialogPatternProperties::CheckStateSize);
|
|
||||||
Init(ui->checkBoxS68, static_cast<int>(GSizes::S68), &DialogPatternProperties::CheckStateSize);
|
|
||||||
Init(ui->checkBoxS70, static_cast<int>(GSizes::S70), &DialogPatternProperties::CheckStateSize);
|
|
||||||
Init(ui->checkBoxS72, static_cast<int>(GSizes::S72), &DialogPatternProperties::CheckStateSize);
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogPatternProperties::InitComboBoxFormats(QComboBox *box, const QStringList &items,
|
void DialogPatternProperties::InitComboBoxFormats(QComboBox *box, const QStringList &items,
|
||||||
const QString ¤tFormat)
|
const QString ¤tFormat)
|
||||||
|
@ -568,14 +262,6 @@ void DialogPatternProperties::InitComboBoxFormats(QComboBox *box, const QStringL
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
void DialogPatternProperties::CheckApplyOk()
|
|
||||||
{
|
|
||||||
bool enable = !(heightsChecked == 0 || sizesChecked == 0);
|
|
||||||
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(enable);
|
|
||||||
ui->buttonBox->button(QDialogButtonBox::Apply)->setEnabled(enable);
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogPatternProperties::SaveDescription()
|
void DialogPatternProperties::SaveDescription()
|
||||||
{
|
{
|
||||||
|
@ -589,38 +275,6 @@ void DialogPatternProperties::SaveDescription()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
void DialogPatternProperties::SaveGradation()
|
|
||||||
{
|
|
||||||
if (gradationChanged)
|
|
||||||
{
|
|
||||||
doc->SetGradationHeights(heights);
|
|
||||||
doc->SetGradationSizes(sizes);
|
|
||||||
emit UpdateGradation();
|
|
||||||
gradationChanged = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
void DialogPatternProperties::SaveDefValues()
|
|
||||||
{
|
|
||||||
if (defaultChanged)
|
|
||||||
{
|
|
||||||
if (ui->radioButtonDefFromM->isChecked())
|
|
||||||
{
|
|
||||||
doc->SetDefCustom(false);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
doc->SetDefCustom(true);
|
|
||||||
doc->SetDefCustomHeight(ui->comboBoxHeight->currentText().toInt());
|
|
||||||
doc->SetDefCustomSize(ui->comboBoxSize->currentText().toInt());
|
|
||||||
}
|
|
||||||
defaultChanged = false;
|
|
||||||
emit doc->patternChanged(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogPatternProperties::SaveLabelData()
|
void DialogPatternProperties::SaveLabelData()
|
||||||
{
|
{
|
||||||
|
@ -672,114 +326,6 @@ void DialogPatternProperties::SaveReadOnlyState()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
void DialogPatternProperties::SetDefaultHeight(const QString &def)
|
|
||||||
{
|
|
||||||
int index = ui->comboBoxHeight->findText(def);
|
|
||||||
if (index != -1)
|
|
||||||
{
|
|
||||||
ui->comboBoxHeight->setCurrentIndex(index);
|
|
||||||
defaultChanged = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
const int height = static_cast<int>(pattern->height());
|
|
||||||
index = ui->comboBoxHeight->findText(QString().setNum(height));
|
|
||||||
if (index != -1)
|
|
||||||
{
|
|
||||||
ui->comboBoxHeight->setCurrentIndex(index);
|
|
||||||
defaultChanged = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
void DialogPatternProperties::SetDefaultSize(const QString &def)
|
|
||||||
{
|
|
||||||
int index = ui->comboBoxSize->findText(def);
|
|
||||||
if (index != -1)
|
|
||||||
{
|
|
||||||
ui->comboBoxSize->setCurrentIndex(index);
|
|
||||||
defaultChanged = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
const int size = static_cast<int>(pattern->size());
|
|
||||||
index = ui->comboBoxSize->findText(QString().setNum(size));
|
|
||||||
if (index != -1)
|
|
||||||
{
|
|
||||||
ui->comboBoxSize->setCurrentIndex(index);
|
|
||||||
defaultChanged = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
void DialogPatternProperties::UpdateDefHeight()
|
|
||||||
{
|
|
||||||
const QString def = ui->comboBoxHeight->currentText();
|
|
||||||
InitComboBox(ui->comboBoxHeight, heights);
|
|
||||||
SetDefaultHeight(def);
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
void DialogPatternProperties::UpdateDefSize()
|
|
||||||
{
|
|
||||||
const QString def = ui->comboBoxSize->currentText();
|
|
||||||
InitComboBox(ui->comboBoxSize, sizes);
|
|
||||||
SetDefaultSize(def);
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
template<typename Func>
|
|
||||||
void DialogPatternProperties::Init(QCheckBox *check, int val, Func slot)
|
|
||||||
{
|
|
||||||
connect(check, &QCheckBox::stateChanged, this, slot);
|
|
||||||
data.insert(check, val);
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
template<typename GVal>
|
|
||||||
void DialogPatternProperties::SetOptions(const QMap<GVal, bool> &option)
|
|
||||||
{
|
|
||||||
if (option.value(GVal::ALL) == false)
|
|
||||||
{
|
|
||||||
QMapIterator<GVal, bool> i(option);
|
|
||||||
while (i.hasNext())
|
|
||||||
{
|
|
||||||
i.next();
|
|
||||||
if (i.value() == false && i.key() != GVal::ALL)
|
|
||||||
{
|
|
||||||
QCheckBox *box = data.key(static_cast<int>(i.key()));
|
|
||||||
if (box != nullptr)
|
|
||||||
{
|
|
||||||
box->setCheckState(Qt::Unchecked);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
template<typename GVal>
|
|
||||||
void DialogPatternProperties::InitComboBox(QComboBox *box, const QMap<GVal, bool> &option)
|
|
||||||
{
|
|
||||||
SCASSERT(box != nullptr)
|
|
||||||
|
|
||||||
box->clear();
|
|
||||||
|
|
||||||
QMapIterator<GVal, bool> i(option);
|
|
||||||
while (i.hasNext())
|
|
||||||
{
|
|
||||||
i.next();
|
|
||||||
if (i.value() && i.key() != GVal::ALL)
|
|
||||||
{
|
|
||||||
box->addItem(QString().setNum(static_cast<int>(UnitConvertor(static_cast<int>(i.key()), Unit::Cm,
|
|
||||||
*pattern->GetPatternUnit()))));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QImage DialogPatternProperties::GetImage()
|
QImage DialogPatternProperties::GetImage()
|
||||||
{
|
{
|
||||||
|
|
|
@ -50,16 +50,10 @@ class DialogPatternProperties : public QDialog
|
||||||
public:
|
public:
|
||||||
explicit DialogPatternProperties(VPattern *doc, VContainer *pattern, QWidget *parent = nullptr);
|
explicit DialogPatternProperties(VPattern *doc, VContainer *pattern, QWidget *parent = nullptr);
|
||||||
virtual ~DialogPatternProperties() override;
|
virtual ~DialogPatternProperties() override;
|
||||||
signals:
|
|
||||||
void UpdateGradation();
|
|
||||||
private slots:
|
private slots:
|
||||||
void DefValueChanged();
|
|
||||||
void LabelDataChanged();
|
void LabelDataChanged();
|
||||||
void Apply();
|
void Apply();
|
||||||
void Ok();
|
void Ok();
|
||||||
void SelectAll(int state);
|
|
||||||
void CheckStateHeight(int state);
|
|
||||||
void CheckStateSize(int state);
|
|
||||||
void DescEdited();
|
void DescEdited();
|
||||||
void ChangeImage();
|
void ChangeImage();
|
||||||
void SaveImage();
|
void SaveImage();
|
||||||
|
@ -70,10 +64,6 @@ private:
|
||||||
Ui::DialogPatternProperties *ui;
|
Ui::DialogPatternProperties *ui;
|
||||||
VPattern *doc;
|
VPattern *doc;
|
||||||
VContainer *pattern;
|
VContainer *pattern;
|
||||||
int heightsChecked;
|
|
||||||
int sizesChecked;
|
|
||||||
QMap<GHeights, bool> heights;
|
|
||||||
QMap<GSizes, bool> sizes;
|
|
||||||
QMap<QCheckBox *, int> data;
|
QMap<QCheckBox *, int> data;
|
||||||
bool descriptionChanged;
|
bool descriptionChanged;
|
||||||
bool gradationChanged;
|
bool gradationChanged;
|
||||||
|
@ -91,31 +81,13 @@ private:
|
||||||
QVector<VLabelTemplateLine> templateLines;
|
QVector<VLabelTemplateLine> templateLines;
|
||||||
QMap<int, QString> patternMaterials;
|
QMap<int, QString> patternMaterials;
|
||||||
|
|
||||||
void SetHeightsChecked(bool enabled);
|
|
||||||
void SetSizesChecked(bool enabled);
|
|
||||||
void InitHeights();
|
|
||||||
void InitSizes();
|
|
||||||
template<typename Func>
|
|
||||||
void Init(QCheckBox *check, int val, Func slot);
|
|
||||||
template<typename GVal>
|
|
||||||
void SetOptions(const QMap<GVal, bool> &option);
|
|
||||||
template<typename GVal>
|
|
||||||
void InitComboBox(QComboBox *box, const QMap<GVal, bool> &option);
|
|
||||||
void InitComboBoxFormats(QComboBox *box, const QStringList &items, const QString ¤tFormat);
|
void InitComboBoxFormats(QComboBox *box, const QStringList &items, const QString ¤tFormat);
|
||||||
void CheckApplyOk();
|
|
||||||
void SaveDescription();
|
void SaveDescription();
|
||||||
void SaveGradation();
|
|
||||||
void SaveDefValues();
|
|
||||||
void SaveLabelData();
|
void SaveLabelData();
|
||||||
void SaveTemplateData();
|
void SaveTemplateData();
|
||||||
void SaveMaterialData();
|
void SaveMaterialData();
|
||||||
void SaveReadOnlyState();
|
void SaveReadOnlyState();
|
||||||
|
|
||||||
void SetDefaultHeight(const QString &def);
|
|
||||||
void SetDefaultSize(const QString &def);
|
|
||||||
|
|
||||||
void UpdateDefHeight();
|
|
||||||
void UpdateDefSize();
|
|
||||||
void InitImage();
|
void InitImage();
|
||||||
QImage GetImage();
|
QImage GetImage();
|
||||||
};
|
};
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -5909,7 +5909,7 @@ bool MainWindow::DoFMExport(const VCommandLinePtr &expParams)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
bool MainWindow::SetSize(const QString &text)
|
bool MainWindow::SetDimensionA(int value)
|
||||||
{
|
{
|
||||||
if (not VApplication::IsGUIMode())
|
if (not VApplication::IsGUIMode())
|
||||||
{
|
{
|
||||||
|
@ -5917,29 +5917,29 @@ bool MainWindow::SetSize(const QString &text)
|
||||||
{
|
{
|
||||||
if (qApp->GetMeasurementsType() == MeasurementsType::Multisize)
|
if (qApp->GetMeasurementsType() == MeasurementsType::Multisize)
|
||||||
{
|
{
|
||||||
const int size = static_cast<int>(UnitConvertor(text.toInt(), Unit::Cm, *pattern->GetPatternUnit()));
|
const qint32 index = dimensionA->findData(value);
|
||||||
const qint32 index = dimensionB->findText(QString().setNum(size));
|
|
||||||
if (index != -1)
|
if (index != -1)
|
||||||
{
|
{
|
||||||
dimensionB->setCurrentIndex(index);
|
dimensionA->setCurrentIndex(index);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
qCCritical(vMainWindow, "%s",
|
qCCritical(vMainWindow, "%s",
|
||||||
qUtf8Printable(tr("Not supported size value '%1' for this pattern file.").arg(text)));
|
qUtf8Printable(tr("Not supported dimension A value '%1' for this pattern file.")
|
||||||
|
.arg(value)));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
qCCritical(vMainWindow, "%s",
|
qCCritical(vMainWindow, "%s",
|
||||||
qUtf8Printable(tr("Couldn't set size. Need a file with multisize measurements.")));
|
qUtf8Printable(tr("Couldn't set dimension A. Need a file with multisize measurements.")));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
qCCritical(vMainWindow, "%s", qUtf8Printable(tr("Couldn't set size. File wasn't opened.")));
|
qCCritical(vMainWindow, "%s", qUtf8Printable(tr("Couldn't set dimension A. File wasn't opened.")));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5952,7 +5952,7 @@ bool MainWindow::SetSize(const QString &text)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
bool MainWindow::SetHeight(const QString &text)
|
bool MainWindow::SetDimensionB(int value)
|
||||||
{
|
{
|
||||||
if (not VApplication::IsGUIMode())
|
if (not VApplication::IsGUIMode())
|
||||||
{
|
{
|
||||||
|
@ -5960,29 +5960,72 @@ bool MainWindow::SetHeight(const QString &text)
|
||||||
{
|
{
|
||||||
if (qApp->GetMeasurementsType() == MeasurementsType::Multisize)
|
if (qApp->GetMeasurementsType() == MeasurementsType::Multisize)
|
||||||
{
|
{
|
||||||
const int height = static_cast<int>(UnitConvertor(text.toInt(), Unit::Cm, *pattern->GetPatternUnit()));
|
const qint32 index = dimensionB->findData(value);
|
||||||
const qint32 index = dimensionA->findText(QString().setNum(height));
|
|
||||||
if (index != -1)
|
if (index != -1)
|
||||||
{
|
{
|
||||||
dimensionA->setCurrentIndex(index);
|
dimensionB->setCurrentIndex(index);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
qCCritical(vMainWindow, "%s",
|
qCCritical(vMainWindow, "%s",
|
||||||
qUtf8Printable(tr("Not supported height value '%1' for this pattern file.").arg(text)));
|
qUtf8Printable(tr("Not supported dimension B value '%1' for this pattern file.")
|
||||||
|
.arg(value)));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
qCCritical(vMainWindow, "%s",
|
qCCritical(vMainWindow, "%s",
|
||||||
qUtf8Printable(tr("Couldn't set height. Need a file with multisize measurements.")));
|
qUtf8Printable(tr("Couldn't set dimension B. Need a file with multisize measurements.")));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
qCCritical(vMainWindow, "%s", qUtf8Printable(tr("Couldn't set height. File wasn't opened.")));
|
qCCritical(vMainWindow, "%s", qUtf8Printable(tr("Couldn't set dimension B. File wasn't opened.")));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
qCWarning(vMainWindow, "%s", qUtf8Printable(tr("The method %1 does nothing in GUI mode").arg(Q_FUNC_INFO)));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
bool MainWindow::SetDimensionC(int value)
|
||||||
|
{
|
||||||
|
if (not VApplication::IsGUIMode())
|
||||||
|
{
|
||||||
|
if (this->isWindowModified() || not qApp->GetPatternPath().isEmpty())
|
||||||
|
{
|
||||||
|
if (qApp->GetMeasurementsType() == MeasurementsType::Multisize)
|
||||||
|
{
|
||||||
|
const qint32 index = dimensionC->findData(value);
|
||||||
|
if (index != -1)
|
||||||
|
{
|
||||||
|
dimensionC->setCurrentIndex(index);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
qCCritical(vMainWindow, "%s",
|
||||||
|
qUtf8Printable(tr("Not supported dimension C value '%1' for this pattern file.")
|
||||||
|
.arg(value)));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
qCCritical(vMainWindow, "%s",
|
||||||
|
qUtf8Printable(tr("Couldn't set dimension C. Need a file with multisize measurements.")));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
qCCritical(vMainWindow, "%s", qUtf8Printable(tr("Couldn't set dimension C. File wasn't opened.")));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6029,19 +6072,25 @@ void MainWindow::ProcessCMD()
|
||||||
return; // process only one input file
|
return; // process only one input file
|
||||||
}
|
}
|
||||||
|
|
||||||
bool hSetted = true;
|
bool aSetted = true;
|
||||||
bool sSetted = true;
|
bool bSetted = true;
|
||||||
if (cmd->IsSetGradationSize())
|
bool cSetted = true;
|
||||||
|
if (cmd->IsSetDimensionA())
|
||||||
{
|
{
|
||||||
sSetted = SetSize(cmd->OptGradationSize());
|
aSetted = SetDimensionA(cmd->OptDimensionA());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cmd->IsSetGradationHeight())
|
if (cmd->IsSetDimensionB())
|
||||||
{
|
{
|
||||||
hSetted = SetHeight(cmd->OptGradationHeight());
|
bSetted = SetDimensionB(cmd->OptDimensionB());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (not (hSetted && sSetted))
|
if (cmd->IsSetDimensionC())
|
||||||
|
{
|
||||||
|
cSetted = SetDimensionB(cmd->OptDimensionC());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (not (aSetted && bSetted && cSetted))
|
||||||
{
|
{
|
||||||
qApp->exit(V_EX_DATAERR);
|
qApp->exit(V_EX_DATAERR);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -377,8 +377,9 @@ private:
|
||||||
bool DoExport(const VCommandLinePtr& expParams);
|
bool DoExport(const VCommandLinePtr& expParams);
|
||||||
bool DoFMExport(const VCommandLinePtr& expParams);
|
bool DoFMExport(const VCommandLinePtr& expParams);
|
||||||
|
|
||||||
bool SetSize(const QString &text);
|
bool SetDimensionA(int value);
|
||||||
bool SetHeight(const QString & text);
|
bool SetDimensionB(int value);
|
||||||
|
bool SetDimensionC(int value);
|
||||||
|
|
||||||
QString GetPatternFileName();
|
QString GetPatternFileName();
|
||||||
QString GetMeasurementFileName();
|
QString GetMeasurementFileName();
|
||||||
|
|
|
@ -4196,164 +4196,6 @@ QString VPattern::GenerateSuffix() const
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
bool VPattern::IsDefCustom() const
|
|
||||||
{
|
|
||||||
QDomNodeList tags = elementsByTagName(TagGradation);
|
|
||||||
if (tags.size() == 0)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
const QDomNode domNode = tags.at(0);
|
|
||||||
const QDomElement domElement = domNode.toElement();
|
|
||||||
if (domElement.isNull() == false)
|
|
||||||
{
|
|
||||||
return GetParametrBool(domElement, AttrCustom, falseStr);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
void VPattern::SetDefCustom(bool value)
|
|
||||||
{
|
|
||||||
CheckTagExists(TagGradation);
|
|
||||||
QDomNodeList tags = elementsByTagName(TagGradation);
|
|
||||||
if (tags.isEmpty())
|
|
||||||
{
|
|
||||||
qDebug()<<"Can't save attribute "<<AttrCustom<<Q_FUNC_INFO;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
QDomNode domNode = tags.at(0);
|
|
||||||
QDomElement domElement = domNode.toElement();
|
|
||||||
if (domElement.isNull() == false)
|
|
||||||
{
|
|
||||||
if (value == false)
|
|
||||||
{
|
|
||||||
domElement.removeAttribute(AttrDefHeight);
|
|
||||||
SetDefCustomHeight(0);
|
|
||||||
SetDefCustomSize(0);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SetAttribute(domElement, AttrCustom, value);
|
|
||||||
}
|
|
||||||
modified = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
qDebug()<<"Can't save attribute "<<AttrCustom<<Q_FUNC_INFO;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
int VPattern::GetDefCustomHeight() const
|
|
||||||
{
|
|
||||||
if (IsDefCustom())
|
|
||||||
{
|
|
||||||
QDomNodeList tags = elementsByTagName(TagGradation);
|
|
||||||
if (tags.size() == 0)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
const QDomNode domNode = tags.at(0);
|
|
||||||
const QDomElement domElement = domNode.toElement();
|
|
||||||
if (domElement.isNull() == false)
|
|
||||||
{
|
|
||||||
return static_cast<int>(GetParametrUInt(domElement, AttrDefHeight, QChar('0')));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
void VPattern::SetDefCustomHeight(int value)
|
|
||||||
{
|
|
||||||
CheckTagExists(TagGradation);
|
|
||||||
QDomNodeList tags = elementsByTagName(TagGradation);
|
|
||||||
if (tags.isEmpty())
|
|
||||||
{
|
|
||||||
qDebug()<<"Can't save attribute "<<AttrDefHeight<<Q_FUNC_INFO;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
QDomNode domNode = tags.at(0);
|
|
||||||
QDomElement domElement = domNode.toElement();
|
|
||||||
if (domElement.isNull() == false)
|
|
||||||
{
|
|
||||||
SetAttributeOrRemoveIf(domElement, AttrDefHeight, value, value == 0);
|
|
||||||
modified = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
qDebug()<<"Can't save attribute "<<AttrDefHeight<<Q_FUNC_INFO;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
int VPattern::GetDefCustomSize() const
|
|
||||||
{
|
|
||||||
if (IsDefCustom())
|
|
||||||
{
|
|
||||||
QDomNodeList tags = elementsByTagName(TagGradation);
|
|
||||||
if (tags.size() == 0)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
const QDomNode domNode = tags.at(0);
|
|
||||||
const QDomElement domElement = domNode.toElement();
|
|
||||||
if (domElement.isNull() == false)
|
|
||||||
{
|
|
||||||
return static_cast<int>(GetParametrUInt(domElement, AttrDefSize, QChar('0')));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
void VPattern::SetDefCustomSize(int value)
|
|
||||||
{
|
|
||||||
CheckTagExists(TagGradation);
|
|
||||||
QDomNodeList tags = elementsByTagName(TagGradation);
|
|
||||||
if (tags.isEmpty())
|
|
||||||
{
|
|
||||||
qDebug()<<"Can't save attribute "<<AttrDefSize<<Q_FUNC_INFO;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
QDomNode domNode = tags.at(0);
|
|
||||||
QDomElement domElement = domNode.toElement();
|
|
||||||
if (domElement.isNull() == false)
|
|
||||||
{
|
|
||||||
SetAttributeOrRemoveIf(domElement, AttrDefSize, value, value == 0);
|
|
||||||
modified = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
qDebug()<<"Can't save attribute "<<AttrDefSize<<Q_FUNC_INFO;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
bool VPattern::IsReadOnly() const
|
bool VPattern::IsReadOnly() const
|
||||||
{
|
{
|
||||||
|
|
|
@ -97,17 +97,6 @@ public:
|
||||||
virtual QString GenerateLabel(const LabelType &type, const QString &reservedName = QString())const override;
|
virtual QString GenerateLabel(const LabelType &type, const QString &reservedName = QString())const override;
|
||||||
virtual QString GenerateSuffix() const override;
|
virtual QString GenerateSuffix() const override;
|
||||||
|
|
||||||
bool IsDefCustom() const;
|
|
||||||
void SetDefCustom(bool value);
|
|
||||||
|
|
||||||
// TODO: remove
|
|
||||||
int GetDefCustomHeight() const;
|
|
||||||
void SetDefCustomHeight(int value);
|
|
||||||
|
|
||||||
// TODO: remove
|
|
||||||
int GetDefCustomSize() const;
|
|
||||||
void SetDefCustomSize(int value);
|
|
||||||
|
|
||||||
bool IsReadOnly() const;
|
bool IsReadOnly() const;
|
||||||
void SetReadOnly(bool rOnly);
|
void SetReadOnly(bool rOnly);
|
||||||
|
|
||||||
|
|
|
@ -59,6 +59,7 @@
|
||||||
<file>schema/pattern/v0.8.5.xsd</file>
|
<file>schema/pattern/v0.8.5.xsd</file>
|
||||||
<file>schema/pattern/v0.8.6.xsd</file>
|
<file>schema/pattern/v0.8.6.xsd</file>
|
||||||
<file>schema/pattern/v0.8.7.xsd</file>
|
<file>schema/pattern/v0.8.7.xsd</file>
|
||||||
|
<file>schema/pattern/v0.8.8.xsd</file>
|
||||||
<file>schema/multisize_measurements/v0.3.0.xsd</file>
|
<file>schema/multisize_measurements/v0.3.0.xsd</file>
|
||||||
<file>schema/multisize_measurements/v0.4.0.xsd</file>
|
<file>schema/multisize_measurements/v0.4.0.xsd</file>
|
||||||
<file>schema/multisize_measurements/v0.4.1.xsd</file>
|
<file>schema/multisize_measurements/v0.4.1.xsd</file>
|
||||||
|
|
1071
src/libs/ifc/schema/pattern/v0.8.8.xsd
Normal file
1071
src/libs/ifc/schema/pattern/v0.8.8.xsd
Normal file
File diff suppressed because it is too large
Load Diff
|
@ -82,9 +82,6 @@ const QString VAbstractPattern::TagArc = QStringLiteral("arc");
|
||||||
const QString VAbstractPattern::TagElArc = QStringLiteral("elArc");
|
const QString VAbstractPattern::TagElArc = QStringLiteral("elArc");
|
||||||
const QString VAbstractPattern::TagTools = QStringLiteral("tools");
|
const QString VAbstractPattern::TagTools = QStringLiteral("tools");
|
||||||
const QString VAbstractPattern::TagOperation = QStringLiteral("operation");
|
const QString VAbstractPattern::TagOperation = QStringLiteral("operation");
|
||||||
const QString VAbstractPattern::TagGradation = QStringLiteral("gradation");
|
|
||||||
const QString VAbstractPattern::TagHeights = QStringLiteral("heights");
|
|
||||||
const QString VAbstractPattern::TagSizes = QStringLiteral("sizes");
|
|
||||||
const QString VAbstractPattern::TagData = QStringLiteral("data");
|
const QString VAbstractPattern::TagData = QStringLiteral("data");
|
||||||
const QString VAbstractPattern::TagPatternInfo = QStringLiteral("patternInfo");
|
const QString VAbstractPattern::TagPatternInfo = QStringLiteral("patternInfo");
|
||||||
const QString VAbstractPattern::TagPatternName = QStringLiteral("patternName");
|
const QString VAbstractPattern::TagPatternName = QStringLiteral("patternName");
|
||||||
|
@ -138,65 +135,6 @@ const QString VAbstractPattern::AttrPassmarkLength = QStringLiteral("passmark
|
||||||
const QString VAbstractPattern::AttrOpacity = QStringLiteral("opacity");
|
const QString VAbstractPattern::AttrOpacity = QStringLiteral("opacity");
|
||||||
const QString VAbstractPattern::AttrTags = QStringLiteral("tags");
|
const QString VAbstractPattern::AttrTags = QStringLiteral("tags");
|
||||||
|
|
||||||
const QString VAbstractPattern::AttrAll = QStringLiteral("all");
|
|
||||||
|
|
||||||
const QString VAbstractPattern::AttrH50 = QStringLiteral("h50");
|
|
||||||
const QString VAbstractPattern::AttrH56 = QStringLiteral("h56");
|
|
||||||
const QString VAbstractPattern::AttrH62 = QStringLiteral("h62");
|
|
||||||
const QString VAbstractPattern::AttrH68 = QStringLiteral("h68");
|
|
||||||
const QString VAbstractPattern::AttrH74 = QStringLiteral("h74");
|
|
||||||
const QString VAbstractPattern::AttrH80 = QStringLiteral("h80");
|
|
||||||
const QString VAbstractPattern::AttrH86 = QStringLiteral("h86");
|
|
||||||
const QString VAbstractPattern::AttrH92 = QStringLiteral("h92");
|
|
||||||
const QString VAbstractPattern::AttrH98 = QStringLiteral("h98");
|
|
||||||
const QString VAbstractPattern::AttrH104 = QStringLiteral("h104");
|
|
||||||
const QString VAbstractPattern::AttrH110 = QStringLiteral("h110");
|
|
||||||
const QString VAbstractPattern::AttrH116 = QStringLiteral("h116");
|
|
||||||
const QString VAbstractPattern::AttrH122 = QStringLiteral("h122");
|
|
||||||
const QString VAbstractPattern::AttrH128 = QStringLiteral("h128");
|
|
||||||
const QString VAbstractPattern::AttrH134 = QStringLiteral("h134");
|
|
||||||
const QString VAbstractPattern::AttrH140 = QStringLiteral("h140");
|
|
||||||
const QString VAbstractPattern::AttrH146 = QStringLiteral("h146");
|
|
||||||
const QString VAbstractPattern::AttrH152 = QStringLiteral("h152");
|
|
||||||
const QString VAbstractPattern::AttrH158 = QStringLiteral("h158");
|
|
||||||
const QString VAbstractPattern::AttrH164 = QStringLiteral("h164");
|
|
||||||
const QString VAbstractPattern::AttrH170 = QStringLiteral("h170");
|
|
||||||
const QString VAbstractPattern::AttrH176 = QStringLiteral("h176");
|
|
||||||
const QString VAbstractPattern::AttrH182 = QStringLiteral("h182");
|
|
||||||
const QString VAbstractPattern::AttrH188 = QStringLiteral("h188");
|
|
||||||
const QString VAbstractPattern::AttrH194 = QStringLiteral("h194");
|
|
||||||
const QString VAbstractPattern::AttrH200 = QStringLiteral("h200");
|
|
||||||
|
|
||||||
const QString VAbstractPattern::AttrS22 = QStringLiteral("s22");
|
|
||||||
const QString VAbstractPattern::AttrS24 = QStringLiteral("s24");
|
|
||||||
const QString VAbstractPattern::AttrS26 = QStringLiteral("s26");
|
|
||||||
const QString VAbstractPattern::AttrS28 = QStringLiteral("s28");
|
|
||||||
const QString VAbstractPattern::AttrS30 = QStringLiteral("s30");
|
|
||||||
const QString VAbstractPattern::AttrS32 = QStringLiteral("s32");
|
|
||||||
const QString VAbstractPattern::AttrS34 = QStringLiteral("s34");
|
|
||||||
const QString VAbstractPattern::AttrS36 = QStringLiteral("s36");
|
|
||||||
const QString VAbstractPattern::AttrS38 = QStringLiteral("s38");
|
|
||||||
const QString VAbstractPattern::AttrS40 = QStringLiteral("s40");
|
|
||||||
const QString VAbstractPattern::AttrS42 = QStringLiteral("s42");
|
|
||||||
const QString VAbstractPattern::AttrS44 = QStringLiteral("s44");
|
|
||||||
const QString VAbstractPattern::AttrS46 = QStringLiteral("s46");
|
|
||||||
const QString VAbstractPattern::AttrS48 = QStringLiteral("s48");
|
|
||||||
const QString VAbstractPattern::AttrS50 = QStringLiteral("s50");
|
|
||||||
const QString VAbstractPattern::AttrS52 = QStringLiteral("s52");
|
|
||||||
const QString VAbstractPattern::AttrS54 = QStringLiteral("s54");
|
|
||||||
const QString VAbstractPattern::AttrS56 = QStringLiteral("s56");
|
|
||||||
const QString VAbstractPattern::AttrS58 = QStringLiteral("s58");
|
|
||||||
const QString VAbstractPattern::AttrS60 = QStringLiteral("s60");
|
|
||||||
const QString VAbstractPattern::AttrS62 = QStringLiteral("s62");
|
|
||||||
const QString VAbstractPattern::AttrS64 = QStringLiteral("s64");
|
|
||||||
const QString VAbstractPattern::AttrS66 = QStringLiteral("s66");
|
|
||||||
const QString VAbstractPattern::AttrS68 = QStringLiteral("s68");
|
|
||||||
const QString VAbstractPattern::AttrS70 = QStringLiteral("s70");
|
|
||||||
const QString VAbstractPattern::AttrS72 = QStringLiteral("s72");
|
|
||||||
|
|
||||||
const QString VAbstractPattern::AttrCustom = QStringLiteral("custom");
|
|
||||||
const QString VAbstractPattern::AttrDefHeight = QStringLiteral("defHeight");
|
|
||||||
const QString VAbstractPattern::AttrDefSize = QStringLiteral("defSize");
|
|
||||||
const QString VAbstractPattern::AttrExtension = QStringLiteral("extension");
|
const QString VAbstractPattern::AttrExtension = QStringLiteral("extension");
|
||||||
|
|
||||||
const QString VAbstractPattern::AttrFormula = QStringLiteral("formula");
|
const QString VAbstractPattern::AttrFormula = QStringLiteral("formula");
|
||||||
|
@ -953,395 +891,6 @@ QStringList VAbstractPattern::getPatternPieces() const
|
||||||
return patternPieces;
|
return patternPieces;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
QMap<GHeights, bool> VAbstractPattern::GetGradationHeights() const
|
|
||||||
{
|
|
||||||
QMap<GHeights, bool> map;
|
|
||||||
|
|
||||||
map.insert(GHeights::ALL, true);
|
|
||||||
map.insert(GHeights::H50, true);
|
|
||||||
map.insert(GHeights::H56, true);
|
|
||||||
map.insert(GHeights::H62, true);
|
|
||||||
map.insert(GHeights::H68, true);
|
|
||||||
map.insert(GHeights::H74, true);
|
|
||||||
map.insert(GHeights::H80, true);
|
|
||||||
map.insert(GHeights::H86, true);
|
|
||||||
map.insert(GHeights::H92, true);
|
|
||||||
map.insert(GHeights::H98, true);
|
|
||||||
map.insert(GHeights::H104, true);
|
|
||||||
map.insert(GHeights::H110, true);
|
|
||||||
map.insert(GHeights::H116, true);
|
|
||||||
map.insert(GHeights::H122, true);
|
|
||||||
map.insert(GHeights::H128, true);
|
|
||||||
map.insert(GHeights::H134, true);
|
|
||||||
map.insert(GHeights::H140, true);
|
|
||||||
map.insert(GHeights::H146, true);
|
|
||||||
map.insert(GHeights::H152, true);
|
|
||||||
map.insert(GHeights::H158, true);
|
|
||||||
map.insert(GHeights::H164, true);
|
|
||||||
map.insert(GHeights::H170, true);
|
|
||||||
map.insert(GHeights::H176, true);
|
|
||||||
map.insert(GHeights::H182, true);
|
|
||||||
map.insert(GHeights::H188, true);
|
|
||||||
map.insert(GHeights::H194, true);
|
|
||||||
map.insert(GHeights::H200, true);
|
|
||||||
|
|
||||||
QDomNodeList tags = elementsByTagName(TagGradation);
|
|
||||||
if (tags.size() == 0)
|
|
||||||
{
|
|
||||||
return map;
|
|
||||||
}
|
|
||||||
|
|
||||||
QStringList gTags = QStringList() << TagHeights << TagSizes;
|
|
||||||
QDomNode domNode = tags.at(0).firstChild();
|
|
||||||
while (domNode.isNull() == false)
|
|
||||||
{
|
|
||||||
if (domNode.isElement())
|
|
||||||
{
|
|
||||||
const QDomElement domElement = domNode.toElement();
|
|
||||||
if (domElement.isNull() == false)
|
|
||||||
{
|
|
||||||
const QString defValue = trueStr;
|
|
||||||
switch (gTags.indexOf(domElement.tagName()))
|
|
||||||
{
|
|
||||||
case 0: // TagHeights
|
|
||||||
if (GetParametrBool(domElement, AttrAll, defValue))
|
|
||||||
{
|
|
||||||
return map;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
map.insert(GHeights::ALL, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
map.insert(GHeights::H50, GetParametrBool(domElement, AttrH50, defValue));
|
|
||||||
map.insert(GHeights::H56, GetParametrBool(domElement, AttrH56, defValue));
|
|
||||||
map.insert(GHeights::H62, GetParametrBool(domElement, AttrH62, defValue));
|
|
||||||
map.insert(GHeights::H68, GetParametrBool(domElement, AttrH68, defValue));
|
|
||||||
map.insert(GHeights::H74, GetParametrBool(domElement, AttrH74, defValue));
|
|
||||||
map.insert(GHeights::H80, GetParametrBool(domElement, AttrH80, defValue));
|
|
||||||
map.insert(GHeights::H86, GetParametrBool(domElement, AttrH86, defValue));
|
|
||||||
map.insert(GHeights::H92, GetParametrBool(domElement, AttrH92, defValue));
|
|
||||||
map.insert(GHeights::H98, GetParametrBool(domElement, AttrH98, defValue));
|
|
||||||
map.insert(GHeights::H104, GetParametrBool(domElement, AttrH104, defValue));
|
|
||||||
map.insert(GHeights::H110, GetParametrBool(domElement, AttrH110, defValue));
|
|
||||||
map.insert(GHeights::H116, GetParametrBool(domElement, AttrH116, defValue));
|
|
||||||
map.insert(GHeights::H122, GetParametrBool(domElement, AttrH122, defValue));
|
|
||||||
map.insert(GHeights::H128, GetParametrBool(domElement, AttrH128, defValue));
|
|
||||||
map.insert(GHeights::H134, GetParametrBool(domElement, AttrH134, defValue));
|
|
||||||
map.insert(GHeights::H140, GetParametrBool(domElement, AttrH140, defValue));
|
|
||||||
map.insert(GHeights::H146, GetParametrBool(domElement, AttrH146, defValue));
|
|
||||||
map.insert(GHeights::H152, GetParametrBool(domElement, AttrH152, defValue));
|
|
||||||
map.insert(GHeights::H158, GetParametrBool(domElement, AttrH158, defValue));
|
|
||||||
map.insert(GHeights::H164, GetParametrBool(domElement, AttrH164, defValue));
|
|
||||||
map.insert(GHeights::H170, GetParametrBool(domElement, AttrH170, defValue));
|
|
||||||
map.insert(GHeights::H176, GetParametrBool(domElement, AttrH176, defValue));
|
|
||||||
map.insert(GHeights::H182, GetParametrBool(domElement, AttrH182, defValue));
|
|
||||||
map.insert(GHeights::H188, GetParametrBool(domElement, AttrH188, defValue));
|
|
||||||
map.insert(GHeights::H194, GetParametrBool(domElement, AttrH194, defValue));
|
|
||||||
map.insert(GHeights::H200, GetParametrBool(domElement, AttrH200, defValue));
|
|
||||||
return map;
|
|
||||||
case 1: // TagSizes
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
domNode = domNode.nextSibling();
|
|
||||||
}
|
|
||||||
return map;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
void VAbstractPattern::SetGradationHeights(const QMap<GHeights, bool> &options)
|
|
||||||
{
|
|
||||||
CheckTagExists(TagGradation);
|
|
||||||
QDomNodeList tags = elementsByTagName(TagGradation);
|
|
||||||
if (tags.isEmpty())
|
|
||||||
{
|
|
||||||
qDebug()<<"Can't save tag "<<TagGradation<<Q_FUNC_INFO;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
QStringList gTags = QStringList() << TagHeights << TagSizes;
|
|
||||||
QDomNode domNode = tags.at(0).firstChild();
|
|
||||||
while (domNode.isNull() == false)
|
|
||||||
{
|
|
||||||
if (domNode.isElement())
|
|
||||||
{
|
|
||||||
QDomElement domElement = domNode.toElement();
|
|
||||||
if (domElement.isNull() == false)
|
|
||||||
{
|
|
||||||
switch (gTags.indexOf(domElement.tagName()))
|
|
||||||
{
|
|
||||||
case 0: // TagHeights
|
|
||||||
SetAttribute(domElement, AttrAll, options.value(GHeights::ALL));
|
|
||||||
if (options.value(GHeights::ALL))
|
|
||||||
{
|
|
||||||
domElement.removeAttribute(AttrH50);
|
|
||||||
domElement.removeAttribute(AttrH56);
|
|
||||||
domElement.removeAttribute(AttrH62);
|
|
||||||
domElement.removeAttribute(AttrH68);
|
|
||||||
domElement.removeAttribute(AttrH74);
|
|
||||||
domElement.removeAttribute(AttrH80);
|
|
||||||
domElement.removeAttribute(AttrH86);
|
|
||||||
domElement.removeAttribute(AttrH92);
|
|
||||||
domElement.removeAttribute(AttrH98);
|
|
||||||
domElement.removeAttribute(AttrH104);
|
|
||||||
domElement.removeAttribute(AttrH110);
|
|
||||||
domElement.removeAttribute(AttrH116);
|
|
||||||
domElement.removeAttribute(AttrH122);
|
|
||||||
domElement.removeAttribute(AttrH128);
|
|
||||||
domElement.removeAttribute(AttrH134);
|
|
||||||
domElement.removeAttribute(AttrH140);
|
|
||||||
domElement.removeAttribute(AttrH146);
|
|
||||||
domElement.removeAttribute(AttrH152);
|
|
||||||
domElement.removeAttribute(AttrH158);
|
|
||||||
domElement.removeAttribute(AttrH164);
|
|
||||||
domElement.removeAttribute(AttrH170);
|
|
||||||
domElement.removeAttribute(AttrH176);
|
|
||||||
domElement.removeAttribute(AttrH182);
|
|
||||||
domElement.removeAttribute(AttrH188);
|
|
||||||
domElement.removeAttribute(AttrH194);
|
|
||||||
domElement.removeAttribute(AttrH200);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SetAttribute(domElement, AttrH50, options.value(GHeights::H50));
|
|
||||||
SetAttribute(domElement, AttrH56, options.value(GHeights::H56));
|
|
||||||
SetAttribute(domElement, AttrH62, options.value(GHeights::H62));
|
|
||||||
SetAttribute(domElement, AttrH68, options.value(GHeights::H68));
|
|
||||||
SetAttribute(domElement, AttrH74, options.value(GHeights::H74));
|
|
||||||
SetAttribute(domElement, AttrH80, options.value(GHeights::H80));
|
|
||||||
SetAttribute(domElement, AttrH86, options.value(GHeights::H86));
|
|
||||||
SetAttribute(domElement, AttrH92, options.value(GHeights::H92));
|
|
||||||
SetAttribute(domElement, AttrH98, options.value(GHeights::H98));
|
|
||||||
SetAttribute(domElement, AttrH104, options.value(GHeights::H104));
|
|
||||||
SetAttribute(domElement, AttrH110, options.value(GHeights::H110));
|
|
||||||
SetAttribute(domElement, AttrH116, options.value(GHeights::H116));
|
|
||||||
SetAttribute(domElement, AttrH122, options.value(GHeights::H122));
|
|
||||||
SetAttribute(domElement, AttrH128, options.value(GHeights::H128));
|
|
||||||
SetAttribute(domElement, AttrH134, options.value(GHeights::H134));
|
|
||||||
SetAttribute(domElement, AttrH140, options.value(GHeights::H140));
|
|
||||||
SetAttribute(domElement, AttrH146, options.value(GHeights::H146));
|
|
||||||
SetAttribute(domElement, AttrH152, options.value(GHeights::H152));
|
|
||||||
SetAttribute(domElement, AttrH158, options.value(GHeights::H158));
|
|
||||||
SetAttribute(domElement, AttrH164, options.value(GHeights::H164));
|
|
||||||
SetAttribute(domElement, AttrH170, options.value(GHeights::H170));
|
|
||||||
SetAttribute(domElement, AttrH176, options.value(GHeights::H176));
|
|
||||||
SetAttribute(domElement, AttrH182, options.value(GHeights::H182));
|
|
||||||
SetAttribute(domElement, AttrH188, options.value(GHeights::H188));
|
|
||||||
SetAttribute(domElement, AttrH194, options.value(GHeights::H194));
|
|
||||||
SetAttribute(domElement, AttrH200, options.value(GHeights::H200));
|
|
||||||
}
|
|
||||||
|
|
||||||
modified = true;
|
|
||||||
emit patternChanged(false);
|
|
||||||
return;
|
|
||||||
case 1: // TagSizes
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
domNode = domNode.nextSibling();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
QMap<GSizes, bool> VAbstractPattern::GetGradationSizes() const
|
|
||||||
{
|
|
||||||
QMap<GSizes, bool> map;
|
|
||||||
map.insert(GSizes::ALL, true);
|
|
||||||
map.insert(GSizes::S22, true);
|
|
||||||
map.insert(GSizes::S24, true);
|
|
||||||
map.insert(GSizes::S26, true);
|
|
||||||
map.insert(GSizes::S28, true);
|
|
||||||
map.insert(GSizes::S30, true);
|
|
||||||
map.insert(GSizes::S32, true);
|
|
||||||
map.insert(GSizes::S34, true);
|
|
||||||
map.insert(GSizes::S36, true);
|
|
||||||
map.insert(GSizes::S38, true);
|
|
||||||
map.insert(GSizes::S40, true);
|
|
||||||
map.insert(GSizes::S42, true);
|
|
||||||
map.insert(GSizes::S44, true);
|
|
||||||
map.insert(GSizes::S46, true);
|
|
||||||
map.insert(GSizes::S48, true);
|
|
||||||
map.insert(GSizes::S50, true);
|
|
||||||
map.insert(GSizes::S52, true);
|
|
||||||
map.insert(GSizes::S54, true);
|
|
||||||
map.insert(GSizes::S56, true);
|
|
||||||
map.insert(GSizes::S58, true);
|
|
||||||
map.insert(GSizes::S60, true);
|
|
||||||
map.insert(GSizes::S62, true);
|
|
||||||
map.insert(GSizes::S64, true);
|
|
||||||
map.insert(GSizes::S66, true);
|
|
||||||
map.insert(GSizes::S68, true);
|
|
||||||
map.insert(GSizes::S70, true);
|
|
||||||
map.insert(GSizes::S72, true);
|
|
||||||
|
|
||||||
QDomNodeList tags = elementsByTagName(TagGradation);
|
|
||||||
if (tags.size() == 0)
|
|
||||||
{
|
|
||||||
return map;
|
|
||||||
}
|
|
||||||
|
|
||||||
QStringList gTags = QStringList() << TagHeights << TagSizes;
|
|
||||||
QDomNode domNode = tags.at(0).firstChild();
|
|
||||||
while (domNode.isNull() == false)
|
|
||||||
{
|
|
||||||
if (domNode.isElement())
|
|
||||||
{
|
|
||||||
const QDomElement domElement = domNode.toElement();
|
|
||||||
if (domElement.isNull() == false)
|
|
||||||
{
|
|
||||||
const QString defValue = trueStr;
|
|
||||||
switch (gTags.indexOf(domElement.tagName()))
|
|
||||||
{
|
|
||||||
case 1: // TagSizes
|
|
||||||
if (GetParametrBool(domElement, AttrAll, defValue))
|
|
||||||
{
|
|
||||||
return map;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
map.insert(GSizes::ALL, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
map.insert(GSizes::S22, GetParametrBool(domElement, AttrS22, defValue));
|
|
||||||
map.insert(GSizes::S24, GetParametrBool(domElement, AttrS24, defValue));
|
|
||||||
map.insert(GSizes::S26, GetParametrBool(domElement, AttrS26, defValue));
|
|
||||||
map.insert(GSizes::S28, GetParametrBool(domElement, AttrS28, defValue));
|
|
||||||
map.insert(GSizes::S30, GetParametrBool(domElement, AttrS30, defValue));
|
|
||||||
map.insert(GSizes::S32, GetParametrBool(domElement, AttrS32, defValue));
|
|
||||||
map.insert(GSizes::S34, GetParametrBool(domElement, AttrS34, defValue));
|
|
||||||
map.insert(GSizes::S36, GetParametrBool(domElement, AttrS36, defValue));
|
|
||||||
map.insert(GSizes::S38, GetParametrBool(domElement, AttrS38, defValue));
|
|
||||||
map.insert(GSizes::S40, GetParametrBool(domElement, AttrS40, defValue));
|
|
||||||
map.insert(GSizes::S42, GetParametrBool(domElement, AttrS42, defValue));
|
|
||||||
map.insert(GSizes::S44, GetParametrBool(domElement, AttrS44, defValue));
|
|
||||||
map.insert(GSizes::S46, GetParametrBool(domElement, AttrS46, defValue));
|
|
||||||
map.insert(GSizes::S48, GetParametrBool(domElement, AttrS48, defValue));
|
|
||||||
map.insert(GSizes::S50, GetParametrBool(domElement, AttrS50, defValue));
|
|
||||||
map.insert(GSizes::S52, GetParametrBool(domElement, AttrS52, defValue));
|
|
||||||
map.insert(GSizes::S54, GetParametrBool(domElement, AttrS54, defValue));
|
|
||||||
map.insert(GSizes::S56, GetParametrBool(domElement, AttrS56, defValue));
|
|
||||||
map.insert(GSizes::S58, GetParametrBool(domElement, AttrS58, defValue));
|
|
||||||
map.insert(GSizes::S60, GetParametrBool(domElement, AttrS60, defValue));
|
|
||||||
map.insert(GSizes::S62, GetParametrBool(domElement, AttrS62, defValue));
|
|
||||||
map.insert(GSizes::S64, GetParametrBool(domElement, AttrS64, defValue));
|
|
||||||
map.insert(GSizes::S66, GetParametrBool(domElement, AttrS66, defValue));
|
|
||||||
map.insert(GSizes::S68, GetParametrBool(domElement, AttrS68, defValue));
|
|
||||||
map.insert(GSizes::S70, GetParametrBool(domElement, AttrS70, defValue));
|
|
||||||
map.insert(GSizes::S72, GetParametrBool(domElement, AttrS72, defValue));
|
|
||||||
return map;
|
|
||||||
case 0: // TagHeights
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
domNode = domNode.nextSibling();
|
|
||||||
}
|
|
||||||
return map;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
void VAbstractPattern::SetGradationSizes(const QMap<GSizes, bool> &options)
|
|
||||||
{
|
|
||||||
CheckTagExists(TagGradation);
|
|
||||||
QDomNodeList tags = elementsByTagName(TagGradation);
|
|
||||||
if (tags.isEmpty())
|
|
||||||
{
|
|
||||||
qDebug()<<"Can't save tag "<<TagGradation<<Q_FUNC_INFO;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
QStringList gTags = QStringList() << TagHeights << TagSizes;
|
|
||||||
QDomNode domNode = tags.at(0).firstChild();
|
|
||||||
while (domNode.isNull() == false)
|
|
||||||
{
|
|
||||||
if (domNode.isElement())
|
|
||||||
{
|
|
||||||
QDomElement domElement = domNode.toElement();
|
|
||||||
if (domElement.isNull() == false)
|
|
||||||
{
|
|
||||||
switch (gTags.indexOf(domElement.tagName()))
|
|
||||||
{
|
|
||||||
case 1: // TagSizes
|
|
||||||
SetAttribute(domElement, AttrAll, options.value(GSizes::ALL));
|
|
||||||
if (options.value(GSizes::ALL))
|
|
||||||
{
|
|
||||||
domElement.removeAttribute(AttrS22);
|
|
||||||
domElement.removeAttribute(AttrS24);
|
|
||||||
domElement.removeAttribute(AttrS26);
|
|
||||||
domElement.removeAttribute(AttrS28);
|
|
||||||
domElement.removeAttribute(AttrS30);
|
|
||||||
domElement.removeAttribute(AttrS32);
|
|
||||||
domElement.removeAttribute(AttrS34);
|
|
||||||
domElement.removeAttribute(AttrS36);
|
|
||||||
domElement.removeAttribute(AttrS38);
|
|
||||||
domElement.removeAttribute(AttrS40);
|
|
||||||
domElement.removeAttribute(AttrS42);
|
|
||||||
domElement.removeAttribute(AttrS44);
|
|
||||||
domElement.removeAttribute(AttrS46);
|
|
||||||
domElement.removeAttribute(AttrS48);
|
|
||||||
domElement.removeAttribute(AttrS50);
|
|
||||||
domElement.removeAttribute(AttrS52);
|
|
||||||
domElement.removeAttribute(AttrS54);
|
|
||||||
domElement.removeAttribute(AttrS56);
|
|
||||||
domElement.removeAttribute(AttrS58);
|
|
||||||
domElement.removeAttribute(AttrS60);
|
|
||||||
domElement.removeAttribute(AttrS62);
|
|
||||||
domElement.removeAttribute(AttrS64);
|
|
||||||
domElement.removeAttribute(AttrS66);
|
|
||||||
domElement.removeAttribute(AttrS68);
|
|
||||||
domElement.removeAttribute(AttrS70);
|
|
||||||
domElement.removeAttribute(AttrS72);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SetAttribute(domElement, AttrS22, options.value(GSizes::S22));
|
|
||||||
SetAttribute(domElement, AttrS24, options.value(GSizes::S24));
|
|
||||||
SetAttribute(domElement, AttrS26, options.value(GSizes::S26));
|
|
||||||
SetAttribute(domElement, AttrS28, options.value(GSizes::S28));
|
|
||||||
SetAttribute(domElement, AttrS30, options.value(GSizes::S30));
|
|
||||||
SetAttribute(domElement, AttrS32, options.value(GSizes::S32));
|
|
||||||
SetAttribute(domElement, AttrS34, options.value(GSizes::S34));
|
|
||||||
SetAttribute(domElement, AttrS36, options.value(GSizes::S36));
|
|
||||||
SetAttribute(domElement, AttrS38, options.value(GSizes::S38));
|
|
||||||
SetAttribute(domElement, AttrS40, options.value(GSizes::S40));
|
|
||||||
SetAttribute(domElement, AttrS42, options.value(GSizes::S42));
|
|
||||||
SetAttribute(domElement, AttrS44, options.value(GSizes::S44));
|
|
||||||
SetAttribute(domElement, AttrS46, options.value(GSizes::S46));
|
|
||||||
SetAttribute(domElement, AttrS48, options.value(GSizes::S48));
|
|
||||||
SetAttribute(domElement, AttrS50, options.value(GSizes::S50));
|
|
||||||
SetAttribute(domElement, AttrS52, options.value(GSizes::S52));
|
|
||||||
SetAttribute(domElement, AttrS54, options.value(GSizes::S54));
|
|
||||||
SetAttribute(domElement, AttrS56, options.value(GSizes::S56));
|
|
||||||
SetAttribute(domElement, AttrS58, options.value(GSizes::S58));
|
|
||||||
SetAttribute(domElement, AttrS60, options.value(GSizes::S60));
|
|
||||||
SetAttribute(domElement, AttrS62, options.value(GSizes::S62));
|
|
||||||
SetAttribute(domElement, AttrS64, options.value(GSizes::S64));
|
|
||||||
SetAttribute(domElement, AttrS66, options.value(GSizes::S66));
|
|
||||||
SetAttribute(domElement, AttrS68, options.value(GSizes::S68));
|
|
||||||
SetAttribute(domElement, AttrS70, options.value(GSizes::S70));
|
|
||||||
SetAttribute(domElement, AttrS72, options.value(GSizes::S72));
|
|
||||||
}
|
|
||||||
|
|
||||||
modified = true;
|
|
||||||
emit patternChanged(false);
|
|
||||||
return;
|
|
||||||
case 0: // TagHeights
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
domNode = domNode.nextSibling();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QString VAbstractPattern::GetDescription() const
|
QString VAbstractPattern::GetDescription() const
|
||||||
{
|
{
|
||||||
|
@ -1798,15 +1347,14 @@ QDomElement VAbstractPattern::CheckTagExists(const QString &tag)
|
||||||
TagImage, // 1
|
TagImage, // 1
|
||||||
TagDescription, // 2
|
TagDescription, // 2
|
||||||
TagNotes, // 3
|
TagNotes, // 3
|
||||||
TagGradation, // 4
|
TagPatternName, // 4
|
||||||
TagPatternName, // 5
|
TagPatternNum, // 5
|
||||||
TagPatternNum, // 6
|
TagCompanyName, // 6
|
||||||
TagCompanyName, // 7
|
TagCustomerName, // 7
|
||||||
TagCustomerName, // 8
|
TagPatternLabel, // 8
|
||||||
TagPatternLabel, // 9
|
TagWatermark, // 9
|
||||||
TagWatermark, // 10
|
TagPatternMaterials, // 10
|
||||||
TagPatternMaterials, // 11
|
TagFinalMeasurements // 11
|
||||||
TagFinalMeasurements // 12
|
|
||||||
};
|
};
|
||||||
|
|
||||||
switch (tags.indexOf(tag))
|
switch (tags.indexOf(tag))
|
||||||
|
@ -1820,41 +1368,28 @@ QDomElement VAbstractPattern::CheckTagExists(const QString &tag)
|
||||||
case 3: //TagNotes
|
case 3: //TagNotes
|
||||||
element = createElement(TagNotes);
|
element = createElement(TagNotes);
|
||||||
break;
|
break;
|
||||||
case 4: //TagGradation
|
case 4: // TagPatternName
|
||||||
{
|
|
||||||
element = createElement(TagGradation);
|
|
||||||
|
|
||||||
QDomElement heights = createElement(TagHeights);
|
|
||||||
heights.setAttribute(AttrAll, trueStr);
|
|
||||||
element.appendChild(heights);
|
|
||||||
|
|
||||||
QDomElement sizes = createElement(TagSizes);
|
|
||||||
sizes.setAttribute(AttrAll, trueStr);
|
|
||||||
element.appendChild(sizes);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 5: // TagPatternName
|
|
||||||
element = createElement(TagPatternName);
|
element = createElement(TagPatternName);
|
||||||
break;
|
break;
|
||||||
case 6: // TagPatternNum
|
case 5: // TagPatternNum
|
||||||
element = createElement(TagPatternNum);
|
element = createElement(TagPatternNum);
|
||||||
break;
|
break;
|
||||||
case 7: // TagCompanyName
|
case 6: // TagCompanyName
|
||||||
element = createElement(TagCompanyName);
|
element = createElement(TagCompanyName);
|
||||||
break;
|
break;
|
||||||
case 8: // TagCustomerName
|
case 7: // TagCustomerName
|
||||||
element = createElement(TagCustomerName);
|
element = createElement(TagCustomerName);
|
||||||
break;
|
break;
|
||||||
case 9: // TagPatternLabel
|
case 8: // TagPatternLabel
|
||||||
element = createElement(TagPatternLabel);
|
element = createElement(TagPatternLabel);
|
||||||
break;
|
break;
|
||||||
case 10: // TagWatermark
|
case 9: // TagWatermark
|
||||||
element = createElement(TagWatermark);
|
element = createElement(TagWatermark);
|
||||||
break;
|
break;
|
||||||
case 11: // TagPatternMaterials
|
case 10: // TagPatternMaterials
|
||||||
element = createElement(TagPatternMaterials);
|
element = createElement(TagPatternMaterials);
|
||||||
break;
|
break;
|
||||||
case 12: // TagFinalMeasurements
|
case 11: // TagFinalMeasurements
|
||||||
element = createElement(TagFinalMeasurements);
|
element = createElement(TagFinalMeasurements);
|
||||||
break;
|
break;
|
||||||
case 0: //TagUnit (Mandatory tag)
|
case 0: //TagUnit (Mandatory tag)
|
||||||
|
|
|
@ -147,12 +147,6 @@ public:
|
||||||
|
|
||||||
QStringList getPatternPieces() const;
|
QStringList getPatternPieces() const;
|
||||||
|
|
||||||
QMap<GHeights, bool> GetGradationHeights() const;
|
|
||||||
void SetGradationHeights(const QMap<GHeights, bool> &options);
|
|
||||||
|
|
||||||
QMap<GSizes, bool> GetGradationSizes() const;
|
|
||||||
void SetGradationSizes(const QMap<GSizes, bool> &options);
|
|
||||||
|
|
||||||
QString GetDescription() const;
|
QString GetDescription() const;
|
||||||
void SetDescription(const QString &text);
|
void SetDescription(const QString &text);
|
||||||
|
|
||||||
|
@ -252,9 +246,6 @@ public:
|
||||||
static const QString TagElArc;
|
static const QString TagElArc;
|
||||||
static const QString TagTools;
|
static const QString TagTools;
|
||||||
static const QString TagOperation;
|
static const QString TagOperation;
|
||||||
static const QString TagGradation;
|
|
||||||
static const QString TagHeights;
|
|
||||||
static const QString TagSizes;
|
|
||||||
static const QString TagData;
|
static const QString TagData;
|
||||||
static const QString TagPatternInfo;
|
static const QString TagPatternInfo;
|
||||||
static const QString TagPatternName;
|
static const QString TagPatternName;
|
||||||
|
@ -308,65 +299,6 @@ public:
|
||||||
static const QString AttrOpacity;
|
static const QString AttrOpacity;
|
||||||
static const QString AttrTags;
|
static const QString AttrTags;
|
||||||
|
|
||||||
static const QString AttrAll;
|
|
||||||
|
|
||||||
static const QString AttrH50;
|
|
||||||
static const QString AttrH56;
|
|
||||||
static const QString AttrH62;
|
|
||||||
static const QString AttrH68;
|
|
||||||
static const QString AttrH74;
|
|
||||||
static const QString AttrH80;
|
|
||||||
static const QString AttrH86;
|
|
||||||
static const QString AttrH92;
|
|
||||||
static const QString AttrH98;
|
|
||||||
static const QString AttrH104;
|
|
||||||
static const QString AttrH110;
|
|
||||||
static const QString AttrH116;
|
|
||||||
static const QString AttrH122;
|
|
||||||
static const QString AttrH128;
|
|
||||||
static const QString AttrH134;
|
|
||||||
static const QString AttrH140;
|
|
||||||
static const QString AttrH146;
|
|
||||||
static const QString AttrH152;
|
|
||||||
static const QString AttrH158;
|
|
||||||
static const QString AttrH164;
|
|
||||||
static const QString AttrH170;
|
|
||||||
static const QString AttrH176;
|
|
||||||
static const QString AttrH182;
|
|
||||||
static const QString AttrH188;
|
|
||||||
static const QString AttrH194;
|
|
||||||
static const QString AttrH200;
|
|
||||||
|
|
||||||
static const QString AttrS22;
|
|
||||||
static const QString AttrS24;
|
|
||||||
static const QString AttrS26;
|
|
||||||
static const QString AttrS28;
|
|
||||||
static const QString AttrS30;
|
|
||||||
static const QString AttrS32;
|
|
||||||
static const QString AttrS34;
|
|
||||||
static const QString AttrS36;
|
|
||||||
static const QString AttrS38;
|
|
||||||
static const QString AttrS40;
|
|
||||||
static const QString AttrS42;
|
|
||||||
static const QString AttrS44;
|
|
||||||
static const QString AttrS46;
|
|
||||||
static const QString AttrS48;
|
|
||||||
static const QString AttrS50;
|
|
||||||
static const QString AttrS52;
|
|
||||||
static const QString AttrS54;
|
|
||||||
static const QString AttrS56;
|
|
||||||
static const QString AttrS58;
|
|
||||||
static const QString AttrS60;
|
|
||||||
static const QString AttrS62;
|
|
||||||
static const QString AttrS64;
|
|
||||||
static const QString AttrS66;
|
|
||||||
static const QString AttrS68;
|
|
||||||
static const QString AttrS70;
|
|
||||||
static const QString AttrS72;
|
|
||||||
|
|
||||||
static const QString AttrCustom;
|
|
||||||
static const QString AttrDefHeight;
|
|
||||||
static const QString AttrDefSize;
|
|
||||||
static const QString AttrExtension;
|
static const QString AttrExtension;
|
||||||
|
|
||||||
static const QString AttrFormula;
|
static const QString AttrFormula;
|
||||||
|
|
|
@ -59,8 +59,8 @@ class QDomElement;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const QString VPatternConverter::PatternMinVerStr = QStringLiteral("0.1.4");
|
const QString VPatternConverter::PatternMinVerStr = QStringLiteral("0.1.4");
|
||||||
const QString VPatternConverter::PatternMaxVerStr = QStringLiteral("0.8.7");
|
const QString VPatternConverter::PatternMaxVerStr = QStringLiteral("0.8.8");
|
||||||
const QString VPatternConverter::CurrentSchema = QStringLiteral("://schema/pattern/v0.8.7.xsd");
|
const QString VPatternConverter::CurrentSchema = QStringLiteral("://schema/pattern/v0.8.8.xsd");
|
||||||
|
|
||||||
//VPatternConverter::PatternMinVer; // <== DON'T FORGET TO UPDATE TOO!!!!
|
//VPatternConverter::PatternMinVer; // <== DON'T FORGET TO UPDATE TOO!!!!
|
||||||
//VPatternConverter::PatternMaxVer; // <== DON'T FORGET TO UPDATE TOO!!!!
|
//VPatternConverter::PatternMaxVer; // <== DON'T FORGET TO UPDATE TOO!!!!
|
||||||
|
@ -237,7 +237,8 @@ QString VPatternConverter::XSDSchema(int ver) const
|
||||||
std::make_pair(FORMAT_VERSION(0, 8, 4), QStringLiteral("://schema/pattern/v0.8.4.xsd")),
|
std::make_pair(FORMAT_VERSION(0, 8, 4), QStringLiteral("://schema/pattern/v0.8.4.xsd")),
|
||||||
std::make_pair(FORMAT_VERSION(0, 8, 5), QStringLiteral("://schema/pattern/v0.8.5.xsd")),
|
std::make_pair(FORMAT_VERSION(0, 8, 5), QStringLiteral("://schema/pattern/v0.8.5.xsd")),
|
||||||
std::make_pair(FORMAT_VERSION(0, 8, 6), QStringLiteral("://schema/pattern/v0.8.6.xsd")),
|
std::make_pair(FORMAT_VERSION(0, 8, 6), QStringLiteral("://schema/pattern/v0.8.6.xsd")),
|
||||||
std::make_pair(FORMAT_VERSION(0, 8, 7), CurrentSchema)
|
std::make_pair(FORMAT_VERSION(0, 8, 7), QStringLiteral("://schema/pattern/v0.8.7.xsd")),
|
||||||
|
std::make_pair(FORMAT_VERSION(0, 8, 8), CurrentSchema)
|
||||||
};
|
};
|
||||||
|
|
||||||
if (schemas.contains(ver))
|
if (schemas.contains(ver))
|
||||||
|
@ -486,6 +487,10 @@ void VPatternConverter::ApplyPatches()
|
||||||
ValidateXML(XSDSchema(FORMAT_VERSION(0, 8, 7)));
|
ValidateXML(XSDSchema(FORMAT_VERSION(0, 8, 7)));
|
||||||
Q_FALLTHROUGH();
|
Q_FALLTHROUGH();
|
||||||
case (FORMAT_VERSION(0, 8, 7)):
|
case (FORMAT_VERSION(0, 8, 7)):
|
||||||
|
ToV0_8_8();
|
||||||
|
ValidateXML(XSDSchema(FORMAT_VERSION(0, 8, 8)));
|
||||||
|
Q_FALLTHROUGH();
|
||||||
|
case (FORMAT_VERSION(0, 8, 8)):
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
InvalidVersion(m_ver);
|
InvalidVersion(m_ver);
|
||||||
|
@ -503,7 +508,7 @@ void VPatternConverter::DowngradeToCurrentMaxVersion()
|
||||||
bool VPatternConverter::IsReadOnly() const
|
bool VPatternConverter::IsReadOnly() const
|
||||||
{
|
{
|
||||||
// Check if attribute readOnly was not changed in file format
|
// Check if attribute readOnly was not changed in file format
|
||||||
Q_STATIC_ASSERT_X(VPatternConverter::PatternMaxVer == FORMAT_VERSION(0, 8, 7),
|
Q_STATIC_ASSERT_X(VPatternConverter::PatternMaxVer == FORMAT_VERSION(0, 8, 8),
|
||||||
"Check attribute readOnly.");
|
"Check attribute readOnly.");
|
||||||
|
|
||||||
// Possibly in future attribute readOnly will change position etc.
|
// Possibly in future attribute readOnly will change position etc.
|
||||||
|
@ -1143,6 +1148,17 @@ void VPatternConverter::ToV0_8_7()
|
||||||
Save();
|
Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void VPatternConverter::ToV0_8_8()
|
||||||
|
{
|
||||||
|
// TODO. Delete if minimal supported version is 0.8.8
|
||||||
|
Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FORMAT_VERSION(0, 8, 8),
|
||||||
|
"Time to refactor the code.");
|
||||||
|
SetVersion(QStringLiteral("0.8.8"));
|
||||||
|
RemoveGradationV0_8_8();
|
||||||
|
Save();
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VPatternConverter::TagUnitToV0_2_0()
|
void VPatternConverter::TagUnitToV0_2_0()
|
||||||
{
|
{
|
||||||
|
@ -2662,6 +2678,20 @@ void VPatternConverter::AddTagPreviewCalculationsV0_6_2()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void VPatternConverter::RemoveGradationV0_8_8()
|
||||||
|
{
|
||||||
|
QDomElement patternElement = documentElement();
|
||||||
|
if (patternElement.isElement())
|
||||||
|
{
|
||||||
|
QDomElement gradationTag = patternElement.firstChildElement(*strGradation);
|
||||||
|
if (gradationTag.isElement())
|
||||||
|
{
|
||||||
|
patternElement.removeChild(gradationTag);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VPatternConverter::TagUnionDetailsToV0_4_0()
|
void VPatternConverter::TagUnionDetailsToV0_4_0()
|
||||||
{
|
{
|
||||||
|
|
|
@ -53,7 +53,7 @@ public:
|
||||||
static const QString PatternMaxVerStr;
|
static const QString PatternMaxVerStr;
|
||||||
static const QString CurrentSchema;
|
static const QString CurrentSchema;
|
||||||
static Q_DECL_CONSTEXPR const int PatternMinVer = FORMAT_VERSION(0, 1, 4);
|
static Q_DECL_CONSTEXPR const int PatternMinVer = FORMAT_VERSION(0, 1, 4);
|
||||||
static Q_DECL_CONSTEXPR const int PatternMaxVer = FORMAT_VERSION(0, 8, 7);
|
static Q_DECL_CONSTEXPR const int PatternMaxVer = FORMAT_VERSION(0, 8, 8);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual int MinVer() const override;
|
virtual int MinVer() const override;
|
||||||
|
@ -130,6 +130,7 @@ private:
|
||||||
void ToV0_8_5();
|
void ToV0_8_5();
|
||||||
void ToV0_8_6();
|
void ToV0_8_6();
|
||||||
void ToV0_8_7();
|
void ToV0_8_7();
|
||||||
|
void ToV0_8_8();
|
||||||
|
|
||||||
void TagUnitToV0_2_0();
|
void TagUnitToV0_2_0();
|
||||||
void TagIncrementToV0_2_0();
|
void TagIncrementToV0_2_0();
|
||||||
|
@ -182,6 +183,8 @@ private:
|
||||||
void RemoveUniqueTagV0_6_0(const QString &tag);
|
void RemoveUniqueTagV0_6_0(const QString &tag);
|
||||||
|
|
||||||
void AddTagPreviewCalculationsV0_6_2();
|
void AddTagPreviewCalculationsV0_6_2();
|
||||||
|
|
||||||
|
void RemoveGradationV0_8_8();
|
||||||
};
|
};
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -90,11 +90,9 @@ const QString SINGLE_OPTION_TEST = QStringLiteral("t");
|
||||||
|
|
||||||
const QString LONG_OPTION_PENDANTIC = QStringLiteral("pedantic");
|
const QString LONG_OPTION_PENDANTIC = QStringLiteral("pedantic");
|
||||||
|
|
||||||
const QString LONG_OPTION_GRADATIONSIZE = QStringLiteral("gsize");
|
const QString LONG_OPTION_DIMENSION_A = QStringLiteral("dimensionA");
|
||||||
const QString SINGLE_OPTION_GRADATIONSIZE = QStringLiteral("x");
|
const QString LONG_OPTION_DIMENSION_B = QStringLiteral("dimensionB");
|
||||||
|
const QString LONG_OPTION_DIMENSION_C = QStringLiteral("dimensionC");
|
||||||
const QString LONG_OPTION_GRADATIONHEIGHT = QStringLiteral("gheight");
|
|
||||||
const QString SINGLE_OPTION_GRADATIONHEIGHT = QStringLiteral("e");
|
|
||||||
|
|
||||||
const QString LONG_OPTION_USER_MATERIAL = QStringLiteral("userMaterial");
|
const QString LONG_OPTION_USER_MATERIAL = QStringLiteral("userMaterial");
|
||||||
|
|
||||||
|
@ -170,8 +168,9 @@ QStringList AllKeys()
|
||||||
LONG_OPTION_GROUPPING, SINGLE_OPTION_GROUPPING,
|
LONG_OPTION_GROUPPING, SINGLE_OPTION_GROUPPING,
|
||||||
LONG_OPTION_TEST, SINGLE_OPTION_TEST,
|
LONG_OPTION_TEST, SINGLE_OPTION_TEST,
|
||||||
LONG_OPTION_PENDANTIC,
|
LONG_OPTION_PENDANTIC,
|
||||||
LONG_OPTION_GRADATIONSIZE, SINGLE_OPTION_GRADATIONSIZE,
|
LONG_OPTION_DIMENSION_A,
|
||||||
LONG_OPTION_GRADATIONHEIGHT, SINGLE_OPTION_GRADATIONHEIGHT,
|
LONG_OPTION_DIMENSION_B,
|
||||||
|
LONG_OPTION_DIMENSION_C,
|
||||||
LONG_OPTION_USER_MATERIAL,
|
LONG_OPTION_USER_MATERIAL,
|
||||||
LONG_OPTION_IGNORE_MARGINS, SINGLE_OPTION_IGNORE_MARGINS,
|
LONG_OPTION_IGNORE_MARGINS, SINGLE_OPTION_IGNORE_MARGINS,
|
||||||
LONG_OPTION_LEFT_MARGIN, SINGLE_OPTION_LEFT_MARGIN,
|
LONG_OPTION_LEFT_MARGIN, SINGLE_OPTION_LEFT_MARGIN,
|
||||||
|
|
|
@ -87,11 +87,9 @@ extern const QString SINGLE_OPTION_TEST;
|
||||||
|
|
||||||
extern const QString LONG_OPTION_PENDANTIC;
|
extern const QString LONG_OPTION_PENDANTIC;
|
||||||
|
|
||||||
extern const QString LONG_OPTION_GRADATIONSIZE;
|
extern const QString LONG_OPTION_DIMENSION_A;
|
||||||
extern const QString SINGLE_OPTION_GRADATIONSIZE;
|
extern const QString LONG_OPTION_DIMENSION_B;
|
||||||
|
extern const QString LONG_OPTION_DIMENSION_C;
|
||||||
extern const QString LONG_OPTION_GRADATIONHEIGHT;
|
|
||||||
extern const QString SINGLE_OPTION_GRADATIONHEIGHT;
|
|
||||||
|
|
||||||
extern const QString LONG_OPTION_USER_MATERIAL;
|
extern const QString LONG_OPTION_USER_MATERIAL;
|
||||||
|
|
||||||
|
|
|
@ -275,19 +275,6 @@ enum class IncrementType : qint8 { Increment, Separator };
|
||||||
QString IncrementTypeToString(IncrementType type);
|
QString IncrementTypeToString(IncrementType type);
|
||||||
IncrementType StringToIncrementType(const QString &value);
|
IncrementType StringToIncrementType(const QString &value);
|
||||||
|
|
||||||
static const int heightStep = 6;
|
|
||||||
enum class GHeights : quint8 { ALL,
|
|
||||||
H50=50, H56=56, H62=62, H68=68, H74=74, H80=80, H86=86, H92=92,
|
|
||||||
H98=98, H104=104, H110=110, H116=116, H122=122, H128=128, H134=134, H140=140,
|
|
||||||
H146=146, H152=152, H158=158, H164=164, H170=170, H176=176, H182=182, H188=188,
|
|
||||||
H194=194, H200=200};
|
|
||||||
|
|
||||||
static const int sizeStep = 2;
|
|
||||||
enum class GSizes : quint8 { ALL,
|
|
||||||
S22=22, S24=24, S26=26, S28=28, S30=30, S32=32, S34=34, S36=36, S38=38, S40=40,
|
|
||||||
S42=42, S44=44, S46=46, S48=48, S50=50, S52=52, S54=54, S56=56, S58=58, S60=60,
|
|
||||||
S62=62, S64=64, S66=66, S68=68, S70=70, S72=72 };
|
|
||||||
|
|
||||||
enum class IMD: qint8 // Individual measurement dimension
|
enum class IMD: qint8 // Individual measurement dimension
|
||||||
{
|
{
|
||||||
N, // None
|
N, // None
|
||||||
|
|
|
@ -100,126 +100,6 @@ VMeasurement &VMeasurement::operator=(VMeasurement &&m) Q_DECL_NOTHROW
|
||||||
VMeasurement::~VMeasurement()
|
VMeasurement::~VMeasurement()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
QStringList VMeasurement::ListHeights(const QMap<GHeights, bool> &heights, Unit patternUnit)
|
|
||||||
{
|
|
||||||
QStringList list;
|
|
||||||
if (patternUnit == Unit::Inch)
|
|
||||||
{
|
|
||||||
qWarning()<<"Multisize table doesn't support inches.";
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
QMap<GHeights, bool>::const_iterator i = heights.constBegin();
|
|
||||||
while (i != heights.constEnd())
|
|
||||||
{
|
|
||||||
if (i.value() && i.key() != GHeights::ALL)
|
|
||||||
{
|
|
||||||
list.append(QString::number(UnitConvertor(static_cast<int>(i.key()), Unit::Cm, patternUnit)));
|
|
||||||
}
|
|
||||||
++i;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (list.isEmpty())
|
|
||||||
{
|
|
||||||
list = VMeasurement::WholeListHeights(patternUnit);
|
|
||||||
}
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
QStringList VMeasurement::ListSizes(const QMap<GSizes, bool> &sizes, Unit patternUnit)
|
|
||||||
{
|
|
||||||
QStringList list;
|
|
||||||
if (patternUnit == Unit::Inch)
|
|
||||||
{
|
|
||||||
qWarning()<<"Multisize table doesn't support inches.";
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
QMap<GSizes, bool>::const_iterator i = sizes.constBegin();
|
|
||||||
while (i != sizes.constEnd())
|
|
||||||
{
|
|
||||||
if (i.value() && i.key() != GSizes::ALL)
|
|
||||||
{
|
|
||||||
list.append(QString::number(UnitConvertor(static_cast<int>(i.key()), Unit::Cm, patternUnit)));
|
|
||||||
}
|
|
||||||
++i;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (list.isEmpty())
|
|
||||||
{
|
|
||||||
list = VMeasurement::WholeListSizes(patternUnit);
|
|
||||||
}
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
QStringList VMeasurement::WholeListHeights(Unit patternUnit)
|
|
||||||
{
|
|
||||||
QStringList list;
|
|
||||||
if (patternUnit == Unit::Inch)
|
|
||||||
{
|
|
||||||
qWarning()<<"Multisize table doesn't support inches.";
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
list.reserve((static_cast<int>(GHeights::H200) - static_cast<int>(GHeights::H50))/heightStep);
|
|
||||||
for (int i = static_cast<int>(GHeights::H50); i<= static_cast<int>(GHeights::H200); i = i+heightStep)
|
|
||||||
{
|
|
||||||
list.append(QString::number(UnitConvertor(i, Unit::Cm, patternUnit)));
|
|
||||||
}
|
|
||||||
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
QStringList VMeasurement::WholeListSizes(Unit patternUnit)
|
|
||||||
{
|
|
||||||
QStringList list;
|
|
||||||
if (patternUnit == Unit::Inch)
|
|
||||||
{
|
|
||||||
qWarning()<<"Multisize table doesn't support inches.";
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
list.reserve((static_cast<int>(GSizes::S72) - static_cast<int>(GSizes::S22))/sizeStep);
|
|
||||||
for (int i = static_cast<int>(GSizes::S22); i<= static_cast<int>(GSizes::S72); i = i+sizeStep)
|
|
||||||
{
|
|
||||||
list.append(QString::number(UnitConvertor(i, Unit::Cm, patternUnit)));
|
|
||||||
}
|
|
||||||
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
bool VMeasurement::IsGradationSizeValid(const QString &size)
|
|
||||||
{
|
|
||||||
if (not size.isEmpty())
|
|
||||||
{
|
|
||||||
const QStringList sizes = VMeasurement::WholeListSizes(Unit::Cm);
|
|
||||||
return sizes.contains(size);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
bool VMeasurement::IsGradationHeightValid(const QString &height)
|
|
||||||
{
|
|
||||||
if (not height.isEmpty())
|
|
||||||
{
|
|
||||||
const QStringList heights = VMeasurement::WholeListHeights(Unit::Cm);
|
|
||||||
return heights.contains(height);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QString VMeasurement::CorrectionHash(qreal baseA, qreal baseB, qreal baseC)
|
QString VMeasurement::CorrectionHash(qreal baseA, qreal baseB, qreal baseC)
|
||||||
{
|
{
|
||||||
|
|
|
@ -116,13 +116,6 @@ public:
|
||||||
QMap<QString, qreal> GetCorrections() const;
|
QMap<QString, qreal> GetCorrections() const;
|
||||||
void SetCorrections(const QMap<QString, qreal> &corrections);
|
void SetCorrections(const QMap<QString, qreal> &corrections);
|
||||||
|
|
||||||
// TODO: remove
|
|
||||||
static QStringList ListHeights(const QMap<GHeights, bool> &heights, Unit patternUnit);
|
|
||||||
static QStringList ListSizes(const QMap<GSizes, bool> &sizes, Unit patternUnit);
|
|
||||||
static QStringList WholeListHeights(Unit patternUnit);
|
|
||||||
static QStringList WholeListSizes(Unit patternUnit);
|
|
||||||
static bool IsGradationSizeValid(const QString &size);
|
|
||||||
static bool IsGradationHeightValid(const QString &height);
|
|
||||||
static QString CorrectionHash(qreal baseA, qreal baseB=0, qreal baseC=0);
|
static QString CorrectionHash(qreal baseA, qreal baseB=0, qreal baseC=0);
|
||||||
private:
|
private:
|
||||||
QSharedDataPointer<VMeasurementData> d;
|
QSharedDataPointer<VMeasurementData> d;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user