New option --manualPriority.

Helps to disable following manual priority without need to change settings for
each piece.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2019-07-21 16:26:21 +03:00
parent 95b9c3ed19
commit 44345085c2
13 changed files with 90 additions and 2 deletions

View File

@ -1,6 +1,6 @@
.\" Manpage for valentina.
.\" Contact dismine@gmail.com to correct errors.
.TH valentina 1 "4 July, 2019" "valentina man page"
.TH valentina 1 "21 July, 2019" "valentina man page"
.SH NAME
Valentina \- Pattern making program.
.SH SYNOPSIS
@ -188,6 +188,8 @@ The path to output destination folder. By default the directory at which the app
.RB "Page bottom margin in current units like 3.0 (" "export mode" "). If not set will be used value from default printer. Or 0 if none printers was found."
.IP "--followGrainline"
.RB "Order detail to follow grainline direction (" "export mode" ").
.IP "--manualPriority"
.RB "Follow manual priority over priority by square (" "export mode" ").
.IP "--nestQuantity"
.RB "Nest quantity copies of each piece (" "export mode" ").
.IP "-c, --crop"

View File

@ -234,6 +234,7 @@ VLayoutGeneratorPtr VCommandLine::DefaultGenerator() const
diag.SetFields(margins);
diag.SetFollowGrainline(IsOptionSet(LONG_OPTION_FOLLOW_GRAINLINE));
diag.SetManualPriority(IsOptionSet(LONG_OPTION_MANUAL_PRIORITY));
diag.SetNestQuantity(IsOptionSet(LONG_OPTION_NEST_QUANTITY));
diag.SetNestingTime(OptNestingTime());
diag.SetEfficiencyCoefficient(OptEfficiencyCoefficient());
@ -665,6 +666,8 @@ void VCommandLine::InitCommandLineOptions()
//=================================================================================================================
{LONG_OPTION_FOLLOW_GRAINLINE,
translate("VCommandLine", "Order detail to follow grainline direction (export mode).")},
{LONG_OPTION_MANUAL_PRIORITY,
translate("VCommandLine", "Follow manual priority over priority by square (export mode).")},
{LONG_OPTION_NEST_QUANTITY,
translate("VCommandLine", "Nest quantity copies of each piece (export mode).")},
{{SINGLE_OPTION_CROP, LONG_OPTION_CROP},

View File

@ -244,6 +244,18 @@ void DialogLayoutSettings::SetFollowGrainline(bool state)
ui->checkBoxFollowGrainline->setChecked(state);
}
//---------------------------------------------------------------------------------------------------------------------
bool DialogLayoutSettings::GetManualPriority() const
{
return ui->checkBoxManualPriority->isChecked();
}
//---------------------------------------------------------------------------------------------------------------------
void DialogLayoutSettings::SetManualPriority(bool state)
{
ui->checkBoxManualPriority->setChecked(state);
}
//---------------------------------------------------------------------------------------------------------------------
bool DialogLayoutSettings::GetAutoCrop() const
{
@ -572,6 +584,7 @@ void DialogLayoutSettings::DialogAccepted()
generator->SetNestingTime(GetNestingTime());
generator->SetEfficiencyCoefficient(GetEfficiencyCoefficient());
generator->SetFollowGrainline(GetFollowGrainline());
generator->SetManualPriority(GetManualPriority());
generator->SetAutoCrop(GetAutoCrop());
generator->SetSaveLength(IsSaveLength());
generator->SetUnitePages(IsUnitePages());
@ -662,6 +675,7 @@ void DialogLayoutSettings::RestoreDefaults()
SetLayoutWidth(VSettings::GetDefLayoutWidth());
SetGroup(VSettings::GetDefLayoutGroup());
SetFollowGrainline(VSettings::GetDefLayoutFollowGrainline());
SetManualPriority(VSettings::GetDefLayoutManualPriority());
SetFields(GetDefPrinterFields());
SetIgnoreAllFields(VSettings::GetDefIgnoreAllFields());
SetMultiplier(VSettings::GetDefMultiplier());
@ -988,6 +1002,7 @@ void DialogLayoutSettings::ReadSettings()
SheetSize(QSizeF(width, height));
SetGroup(settings->GetLayoutGroup());
SetFollowGrainline(settings->GetLayoutFollowGrainline());
SetManualPriority(settings->GetLayoutManualPriority());
SetAutoCrop(settings->GetLayoutAutoCrop());
SetSaveLength(settings->GetLayoutSaveLength());
SetUnitePages(settings->GetLayoutUnitePages());
@ -1013,6 +1028,7 @@ void DialogLayoutSettings::WriteSettings() const
settings->SetLayoutPaperHeight(GetPaperHeight());
settings->SetLayoutPaperWidth(GetPaperWidth());
settings->SetLayoutFollowGrainline(GetFollowGrainline());
settings->SetLayoutManualPriority(GetManualPriority());
settings->SetLayoutAutoCrop(GetAutoCrop());
settings->SetLayoutSaveLength(IsSaveLength());
settings->SetLayoutUnitePages(IsUnitePages());

View File

@ -74,6 +74,9 @@ public:
bool GetFollowGrainline() const;
void SetFollowGrainline(bool state);
bool GetManualPriority() const;
void SetManualPriority(bool state);
bool GetAutoCrop() const;
void SetAutoCrop(bool autoCrop);

View File

@ -462,6 +462,13 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBoxManualPriority">
<property name="text">
<string>Manual priority</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line_2">
<property name="orientation">

View File

@ -178,6 +178,18 @@ void VBank::SetLayoutWidth(qreal value)
Reset();
}
//---------------------------------------------------------------------------------------------------------------------
bool VBank::GetManualPriority() const
{
return m_manualPriority;
}
//---------------------------------------------------------------------------------------------------------------------
void VBank::SetManualPriority(bool value)
{
m_manualPriority = value;
}
//---------------------------------------------------------------------------------------------------------------------
bool VBank::IsNestQuantity() const
{
@ -324,7 +336,7 @@ bool VBank::PrepareUnsorted()
prepare = false;
return prepare;
}
const uint group = details.at(i).GetPriority();
const uint group = m_manualPriority ? details.at(i).GetPriority() : 0;
uniqueGroup.insert(group);
Insert(unsorted, group, i, square);
}

View File

@ -57,6 +57,9 @@ public:
qreal GetLayoutWidth() const;
void SetLayoutWidth(qreal value);
bool GetManualPriority() const;
void SetManualPriority(bool value);
bool IsNestQuantity() const;
void SetNestQuantity(bool value);
@ -99,6 +102,7 @@ private:
bool prepare;
qreal diagonal;
bool m_nestQuantity{false};
bool m_manualPriority{false};
void PrepareGroup();

View File

@ -728,6 +728,18 @@ void VLayoutGenerator::SetFollowGrainline(bool value)
followGrainline = value;
}
//---------------------------------------------------------------------------------------------------------------------
bool VLayoutGenerator::GetManualPriority() const
{
return bank->GetManualPriority();
}
//---------------------------------------------------------------------------------------------------------------------
void VLayoutGenerator::SetManualPriority(bool value)
{
bank->SetManualPriority(value);
}
//---------------------------------------------------------------------------------------------------------------------
bool VLayoutGenerator::IsNestQuantity() const
{

View File

@ -99,6 +99,9 @@ public:
bool GetFollowGrainline() const;
void SetFollowGrainline(bool value);
bool GetManualPriority() const;
void SetManualPriority(bool value);
bool IsNestQuantity() const;
void SetNestQuantity(bool value);

View File

@ -127,6 +127,7 @@ const QString LONG_OPTION_TILED_PDF_BOTTOM_MARGIN = QStringLiteral("tiledbmargin
const QString LONG_OPTION_TILED_PDF_LANDSCAPE = QStringLiteral("tiledLandscape");
const QString LONG_OPTION_FOLLOW_GRAINLINE = QStringLiteral("followGrainline");
const QString LONG_OPTION_MANUAL_PRIORITY = QStringLiteral("manualPriority");
const QString LONG_OPTION_LANDSCAPE_ORIENTATION = QStringLiteral("landscapeOrientation");
@ -183,6 +184,7 @@ QStringList AllKeys()
LONG_OPTION_TILED_PDF_BOTTOM_MARGIN,
LONG_OPTION_TILED_PDF_LANDSCAPE,
LONG_OPTION_FOLLOW_GRAINLINE,
LONG_OPTION_MANUAL_PRIORITY,
LONG_OPTION_LANDSCAPE_ORIENTATION,
LONG_OPTION_NEST_QUANTITY
};

View File

@ -123,6 +123,7 @@ extern const QString LONG_OPTION_TILED_PDF_TOP_MARGIN;
extern const QString LONG_OPTION_TILED_PDF_BOTTOM_MARGIN;
extern const QString LONG_OPTION_TILED_PDF_LANDSCAPE;
extern const QString LONG_OPTION_FOLLOW_GRAINLINE;
extern const QString LONG_OPTION_MANUAL_PRIORITY;
extern const QString LONG_OPTION_LANDSCAPE_ORIENTATION;
extern const QString LONG_OPTION_NEST_QUANTITY;

View File

@ -83,6 +83,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutSorting, (QLatin1String("l
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutPaperHeight, (QLatin1String("layout/paperHeight")))
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutPaperWidth, (QLatin1String("layout/paperWidth")))
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutFollowGrainline, (QLatin1String("layout/followGrainline")))
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutManualPriority, (QLatin1String("layout/manualPriority")))
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutNestQuantity, (QLatin1String("layout/nestQuantity")))
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutAutoCrop, (QLatin1String("layout/autoCrop")))
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutSaveLength, (QLatin1String("layout/saveLength")))
@ -293,6 +294,24 @@ void VSettings::SetLayoutFollowGrainline(bool value)
setValue(*settingLayoutFollowGrainline, value);
}
//---------------------------------------------------------------------------------------------------------------------
bool VSettings::GetLayoutManualPriority() const
{
return value(*settingLayoutManualPriority, GetDefLayoutManualPriority()).toBool();
}
//---------------------------------------------------------------------------------------------------------------------
bool VSettings::GetDefLayoutManualPriority()
{
return false;
}
//---------------------------------------------------------------------------------------------------------------------
void VSettings::SetLayoutManualPriority(bool value)
{
setValue(*settingLayoutManualPriority, value);
}
//---------------------------------------------------------------------------------------------------------------------
bool VSettings::GetLayoutNestQuantity() const
{

View File

@ -92,6 +92,10 @@ public:
static bool GetDefLayoutFollowGrainline();
void SetLayoutFollowGrainline(bool value);
bool GetLayoutManualPriority() const;
static bool GetDefLayoutManualPriority();
void SetLayoutManualPriority(bool value);
bool GetLayoutNestQuantity() const;
static bool GetDefLayoutNestQuantity();
void SetLayoutNestQuantity(bool value);