2014-01-29 19:31:34 +00:00
|
|
|
/*
|
2017-01-20 10:55:49 +00:00
|
|
|
Copyright 2006-2017 The QElectroTech Team
|
2014-01-29 19:31:34 +00:00
|
|
|
This file is part of QElectroTech.
|
|
|
|
|
|
|
|
QElectroTech is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
QElectroTech is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2013-05-03 16:21:25 +00:00
|
|
|
#include "numerotationcontextcommands.h"
|
2014-08-04 16:12:59 +00:00
|
|
|
#include "diagram.h"
|
2013-05-03 16:21:25 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Constructor
|
|
|
|
*/
|
2014-08-04 16:12:59 +00:00
|
|
|
NumerotationContextCommands::NumerotationContextCommands(const NumerotationContext &nc, Diagram *d):
|
2013-05-03 16:21:25 +00:00
|
|
|
diagram_ (d),
|
|
|
|
context_ (nc),
|
2017-08-05 02:06:59 +00:00
|
|
|
strategy_ (nullptr)
|
2013-05-03 16:21:25 +00:00
|
|
|
{}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Destructor
|
|
|
|
*/
|
|
|
|
NumerotationContextCommands::~NumerotationContextCommands() {
|
|
|
|
if (strategy_) delete strategy_;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief NumerotationContextCommands::next
|
|
|
|
* @return the next numerotation context
|
|
|
|
*/
|
|
|
|
NumerotationContext NumerotationContextCommands::next() {
|
|
|
|
NumerotationContext contextnum;
|
|
|
|
|
|
|
|
for (int i=0; i<context_.size(); ++i) {
|
|
|
|
QStringList str = context_.itemAt(i);
|
|
|
|
setNumStrategy(str.at(0));
|
|
|
|
contextnum << strategy_ -> next(context_, i);
|
|
|
|
}
|
|
|
|
return contextnum;
|
|
|
|
}
|
|
|
|
|
2014-08-04 16:12:59 +00:00
|
|
|
/**
|
|
|
|
* @brief NumerotationContextCommands::previous
|
|
|
|
* @return the previous numerotation context
|
|
|
|
*/
|
|
|
|
NumerotationContext NumerotationContextCommands::previous() {
|
|
|
|
NumerotationContext contextnum;
|
|
|
|
|
|
|
|
for (int i=0; i<context_.size(); ++i) {
|
|
|
|
QStringList str = context_.itemAt(i);
|
|
|
|
setNumStrategy(str.at(0));
|
|
|
|
contextnum << strategy_ -> previous(context_, i);
|
|
|
|
}
|
|
|
|
return contextnum;
|
|
|
|
}
|
|
|
|
|
2013-05-03 16:21:25 +00:00
|
|
|
/**
|
|
|
|
* @brief NumerotationContextCommands::toFinalString
|
|
|
|
* @return the string represented by the numerotation context
|
|
|
|
*/
|
|
|
|
QString NumerotationContextCommands::toRepresentedString() {
|
|
|
|
QString num;
|
|
|
|
if (context_.size()) {
|
|
|
|
for (int i=0; i<context_.size(); i++) {
|
|
|
|
QStringList str = context_.itemAt(i);
|
|
|
|
setNumStrategy(str.at(0));
|
|
|
|
num += strategy_ -> toRepresentedString(str.at(1));
|
|
|
|
}
|
|
|
|
return num;
|
|
|
|
}
|
2014-08-04 16:12:59 +00:00
|
|
|
if (diagram_) return (diagram_ -> defaultConductorProperties.text);
|
|
|
|
return QString();
|
2013-05-03 16:21:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief NumerotationContextCommands::setNumStrategy
|
|
|
|
* apply the good strategy relative to @str
|
|
|
|
*/
|
|
|
|
void NumerotationContextCommands::setNumStrategy(const QString &str) {
|
|
|
|
if (strategy_) delete strategy_;
|
|
|
|
if (str == "unit") {
|
|
|
|
strategy_ = new UnitNum(diagram_);
|
|
|
|
return;
|
|
|
|
}
|
2016-07-26 18:52:49 +00:00
|
|
|
else if (str == "unitfolio") {
|
|
|
|
strategy_ = new UnitFNum (diagram_);
|
|
|
|
return;
|
|
|
|
}
|
2013-05-03 16:21:25 +00:00
|
|
|
else if (str == "ten") {
|
|
|
|
strategy_ = new TenNum (diagram_);
|
|
|
|
return;
|
|
|
|
}
|
2016-07-26 18:52:49 +00:00
|
|
|
else if (str == "tenfolio") {
|
|
|
|
strategy_ = new TenFNum (diagram_);
|
|
|
|
return;
|
|
|
|
}
|
2013-05-03 16:21:25 +00:00
|
|
|
else if (str == "hundred") {
|
|
|
|
strategy_ = new HundredNum (diagram_);
|
|
|
|
return;
|
|
|
|
}
|
2016-07-26 18:52:49 +00:00
|
|
|
else if (str == "hundredfolio") {
|
|
|
|
strategy_ = new HundredFNum (diagram_);
|
|
|
|
return;
|
|
|
|
}
|
2013-05-03 16:21:25 +00:00
|
|
|
else if (str == "string") {
|
|
|
|
strategy_ = new StringNum (diagram_);
|
|
|
|
return;
|
|
|
|
}
|
2016-05-17 19:19:11 +00:00
|
|
|
else if (str == "idfolio") {
|
|
|
|
strategy_ = new IdFolioNum (diagram_);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
else if (str=="folio"){
|
2013-05-03 16:21:25 +00:00
|
|
|
strategy_ = new FolioNum (diagram_);
|
|
|
|
return;
|
|
|
|
}
|
2018-12-04 19:07:14 +00:00
|
|
|
else if (str=="plant"){
|
|
|
|
strategy_ = new PlantNum (diagram_);
|
2016-08-16 13:43:46 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
else if (str=="locmach"){
|
|
|
|
strategy_ = new LocmachNum (diagram_);
|
|
|
|
return;
|
|
|
|
}
|
2016-07-10 01:33:49 +00:00
|
|
|
else if (str=="elementline"){
|
|
|
|
strategy_ = new ElementLineNum (diagram_);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
else if (str=="elementcolumn"){
|
|
|
|
strategy_ = new ElementColumnNum (diagram_);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
else if (str=="elementprefix"){
|
|
|
|
strategy_ = new ElementPrefixNum (diagram_);
|
|
|
|
return;
|
|
|
|
}
|
2013-05-03 16:21:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
*/
|
|
|
|
NumStrategy::NumStrategy (Diagram *d):
|
|
|
|
diagram_ (d)
|
|
|
|
{}
|
|
|
|
|
|
|
|
NumStrategy::~NumStrategy() {}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief NumStrategy::nextString
|
|
|
|
* @return the next value of @nc at position @i
|
|
|
|
*/
|
|
|
|
NumerotationContext NumStrategy::nextString (const NumerotationContext &nc, const int i) const {
|
|
|
|
QStringList strl = nc.itemAt(i);
|
|
|
|
NumerotationContext newnc;
|
|
|
|
newnc.addValue(strl.at(0), strl.at(1), strl.at(2).toInt());
|
|
|
|
return (newnc);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief NumStrategy::nextNumber
|
|
|
|
* @return the next value of @nc at position @i
|
|
|
|
*/
|
|
|
|
NumerotationContext NumStrategy::nextNumber (const NumerotationContext &nc, const int i) const {
|
|
|
|
QStringList strl = nc.itemAt(i);
|
|
|
|
NumerotationContext newnc;
|
|
|
|
QString value = QString::number( (strl.at(1).toInt()) + (strl.at(2).toInt()) );
|
2016-07-26 18:52:49 +00:00
|
|
|
newnc.addValue(strl.at(0), value, strl.at(2).toInt(), strl.at(3).toInt());
|
2013-05-03 16:21:25 +00:00
|
|
|
return (newnc);
|
|
|
|
}
|
|
|
|
|
2014-08-04 16:12:59 +00:00
|
|
|
/**
|
|
|
|
* @brief NumStrategy::previousNumber
|
|
|
|
* @return the previous value of @nc at position @i
|
|
|
|
*/
|
|
|
|
NumerotationContext NumStrategy::previousNumber(const NumerotationContext &nc, const int i) const {
|
|
|
|
QStringList strl = nc.itemAt(i);
|
|
|
|
NumerotationContext newnc;
|
|
|
|
QString value = QString::number( (strl.at(1).toInt()) - (strl.at(2).toInt()) );
|
2016-07-26 18:52:49 +00:00
|
|
|
newnc.addValue(strl.at(0), value, strl.at(2).toInt(), strl.at(3).toInt());
|
2014-08-04 16:12:59 +00:00
|
|
|
return (newnc);
|
|
|
|
}
|
|
|
|
|
2013-05-03 16:21:25 +00:00
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
*/
|
|
|
|
UnitNum::UnitNum(Diagram *d):
|
|
|
|
NumStrategy(d)
|
|
|
|
{}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief UnitNum::toRepresentedString
|
|
|
|
* @return the represented string of num
|
|
|
|
*/
|
|
|
|
QString UnitNum::toRepresentedString(const QString num) const {
|
|
|
|
return (num);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief UnitNum::next
|
|
|
|
* @return the next NumerotationContext nc at position i
|
|
|
|
*/
|
|
|
|
NumerotationContext UnitNum::next (const NumerotationContext &nc, const int i) const {
|
|
|
|
return (nextNumber(nc, i));
|
|
|
|
}
|
|
|
|
|
2014-08-04 16:12:59 +00:00
|
|
|
/**
|
|
|
|
* @brief UnitNum::previous
|
|
|
|
* @return the previous NumerotationContext nc at posiiton i
|
|
|
|
*/
|
|
|
|
NumerotationContext UnitNum::previous(const NumerotationContext &nc, const int i) const {
|
|
|
|
return (previousNumber(nc, i));
|
|
|
|
}
|
|
|
|
|
2016-07-26 18:52:49 +00:00
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
*/
|
|
|
|
UnitFNum::UnitFNum(Diagram *d):
|
|
|
|
NumStrategy(d)
|
|
|
|
{}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief UnitFNum::toRepresentedString
|
|
|
|
* @return the represented string of num
|
|
|
|
*/
|
|
|
|
QString UnitFNum::toRepresentedString(const QString num) const {
|
|
|
|
return (num);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief UnitFNum::next
|
|
|
|
* @return the next NumerotationContext nc at position i
|
|
|
|
*/
|
|
|
|
NumerotationContext UnitFNum::next (const NumerotationContext &nc, const int i) const {
|
|
|
|
return (nextNumber(nc, i));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief UnitFNum::previous
|
|
|
|
* @return the previous NumerotationContext nc at posiiton i
|
|
|
|
*/
|
|
|
|
NumerotationContext UnitFNum::previous(const NumerotationContext &nc, const int i) const {
|
|
|
|
return (previousNumber(nc, i));
|
|
|
|
}
|
|
|
|
|
2013-05-03 16:21:25 +00:00
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
*/
|
|
|
|
TenNum::TenNum (Diagram *d):
|
|
|
|
NumStrategy (d)
|
|
|
|
{}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief TenNum::toRepresentedString
|
|
|
|
* @return the represented string of num
|
|
|
|
*/
|
|
|
|
QString TenNum::toRepresentedString(const QString num) const {
|
|
|
|
int numint = num.toInt();
|
|
|
|
QString numstr = num;
|
|
|
|
if (numint<10) numstr.prepend("0");
|
|
|
|
return (numstr);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief TenNum::next
|
|
|
|
* @return the next NumerotationContext nc at position i
|
|
|
|
*/
|
|
|
|
NumerotationContext TenNum::next (const NumerotationContext &nc, const int i) const {
|
|
|
|
return (nextNumber(nc, i));
|
|
|
|
}
|
|
|
|
|
2014-08-04 16:12:59 +00:00
|
|
|
/**
|
|
|
|
* @brief TenNum::previous
|
|
|
|
* @return the previous NumerotationContext nc at posiiton i
|
|
|
|
*/
|
|
|
|
NumerotationContext TenNum::previous(const NumerotationContext &nc, const int i) const {
|
|
|
|
return (previousNumber(nc, i));
|
|
|
|
}
|
|
|
|
|
2016-07-26 18:52:49 +00:00
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
*/
|
|
|
|
TenFNum::TenFNum (Diagram *d):
|
|
|
|
NumStrategy (d)
|
|
|
|
{}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief TenFNum::toRepresentedString
|
|
|
|
* @return the represented string of num
|
|
|
|
*/
|
|
|
|
QString TenFNum::toRepresentedString(const QString num) const {
|
|
|
|
int numint = num.toInt();
|
|
|
|
QString numstr = num;
|
|
|
|
if (numint<10) numstr.prepend("0");
|
|
|
|
return (numstr);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief TenFNum::next
|
|
|
|
* @return the next NumerotationContext nc at position i
|
|
|
|
*/
|
|
|
|
NumerotationContext TenFNum::next (const NumerotationContext &nc, const int i) const {
|
|
|
|
return (nextNumber(nc, i));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief TenFNum::previous
|
|
|
|
* @return the previous NumerotationContext nc at posiiton i
|
|
|
|
*/
|
|
|
|
NumerotationContext TenFNum::previous(const NumerotationContext &nc, const int i) const {
|
|
|
|
return (previousNumber(nc, i));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-05-03 16:21:25 +00:00
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
*/
|
|
|
|
HundredNum::HundredNum (Diagram *d):
|
|
|
|
NumStrategy (d)
|
|
|
|
{}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief HundredNum::toRepresentedString
|
|
|
|
* @return the represented string of num
|
|
|
|
*/
|
|
|
|
QString HundredNum::toRepresentedString(const QString num) const {
|
|
|
|
int numint = num.toInt();
|
|
|
|
QString numstr = num;
|
|
|
|
if (numint<100) {
|
|
|
|
if (numint<10) {
|
|
|
|
numstr.prepend("00");
|
|
|
|
}
|
|
|
|
else numstr.prepend("0");
|
|
|
|
}
|
|
|
|
return (numstr);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief HundredNum::next
|
|
|
|
* @return the next NumerotationContext nc at position i
|
|
|
|
*/
|
|
|
|
NumerotationContext HundredNum::next (const NumerotationContext &nc, const int i) const {
|
|
|
|
return (nextNumber(nc, i));
|
|
|
|
}
|
|
|
|
|
2014-08-04 16:12:59 +00:00
|
|
|
/**
|
|
|
|
* @brief HundredNum::previous
|
|
|
|
* @return the previous NumerotationContext nc at posiiton i
|
|
|
|
*/
|
|
|
|
NumerotationContext HundredNum::previous(const NumerotationContext &nc, const int i) const {
|
|
|
|
return (previousNumber(nc, i));
|
|
|
|
}
|
|
|
|
|
2016-07-26 18:52:49 +00:00
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
*/
|
|
|
|
HundredFNum::HundredFNum (Diagram *d):
|
|
|
|
NumStrategy (d)
|
|
|
|
{}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief HundredFNum::toRepresentedString
|
|
|
|
* @return the represented string of num
|
|
|
|
*/
|
|
|
|
QString HundredFNum::toRepresentedString(const QString num) const {
|
|
|
|
int numint = num.toInt();
|
|
|
|
QString numstr = num;
|
|
|
|
if (numint<100) {
|
|
|
|
if (numint<10) {
|
|
|
|
numstr.prepend("00");
|
|
|
|
}
|
|
|
|
else numstr.prepend("0");
|
|
|
|
}
|
|
|
|
return (numstr);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief HundredFNum::next
|
|
|
|
* @return the next NumerotationContext nc at position i
|
|
|
|
*/
|
|
|
|
NumerotationContext HundredFNum::next (const NumerotationContext &nc, const int i) const {
|
|
|
|
return (nextNumber(nc, i));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief HundredFNum::previous
|
|
|
|
* @return the previous NumerotationContext nc at posiiton i
|
|
|
|
*/
|
|
|
|
NumerotationContext HundredFNum::previous(const NumerotationContext &nc, const int i) const {
|
|
|
|
return (previousNumber(nc, i));
|
|
|
|
}
|
|
|
|
|
2013-05-03 16:21:25 +00:00
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
*/
|
|
|
|
StringNum::StringNum (Diagram *d):
|
|
|
|
NumStrategy (d)
|
|
|
|
{}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief StringNum::toRepresentedString
|
|
|
|
* @return the represented string of num
|
|
|
|
*/
|
|
|
|
QString StringNum::toRepresentedString(const QString str) const {
|
|
|
|
return (str);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief StringNum::next
|
|
|
|
* @return the next NumerotationContext nc at position i
|
|
|
|
*/
|
|
|
|
NumerotationContext StringNum::next (const NumerotationContext &nc, const int i) const {
|
|
|
|
return (nextString(nc, i));
|
|
|
|
}
|
|
|
|
|
2014-08-04 16:12:59 +00:00
|
|
|
/**
|
|
|
|
* @brief StringNum::previous
|
|
|
|
* @return the previous NumerotationContext nc at posiiton i
|
|
|
|
*/
|
|
|
|
NumerotationContext StringNum::previous(const NumerotationContext &nc, const int i) const {
|
|
|
|
return (nextString(nc, i));
|
|
|
|
}
|
|
|
|
|
2016-05-17 19:19:11 +00:00
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
*/
|
|
|
|
IdFolioNum::IdFolioNum (Diagram *d):
|
|
|
|
NumStrategy (d)
|
|
|
|
{}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief IdFolioNum::toRepresentedString
|
|
|
|
* @return the represented string of num
|
|
|
|
*/
|
|
|
|
QString IdFolioNum::toRepresentedString(const QString str) const {
|
|
|
|
Q_UNUSED(str);
|
2016-08-29 15:37:42 +00:00
|
|
|
return ("%id");
|
2016-05-17 19:19:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief IdFolioNum::next
|
|
|
|
* @return the next NumerotationContext nc at position i
|
|
|
|
*/
|
|
|
|
NumerotationContext IdFolioNum::next (const NumerotationContext &nc, const int i) const {
|
|
|
|
return (nextString(nc, i));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief IdFolioNum::previous
|
|
|
|
* @return the previous NumerotationContext nc at posiiton i
|
|
|
|
*/
|
|
|
|
NumerotationContext IdFolioNum::previous(const NumerotationContext &nc, const int i) const {
|
|
|
|
return (nextString(nc, i));
|
|
|
|
}
|
2013-05-03 16:21:25 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
*/
|
|
|
|
FolioNum::FolioNum (Diagram *d):
|
|
|
|
NumStrategy (d)
|
|
|
|
{}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief FolioNum::toRepresentedString
|
2016-05-17 19:19:11 +00:00
|
|
|
* @return the represented string of folio
|
2013-05-03 16:21:25 +00:00
|
|
|
*/
|
|
|
|
QString FolioNum::toRepresentedString(const QString str) const {
|
2013-06-13 17:06:37 +00:00
|
|
|
Q_UNUSED(str);
|
2016-07-26 18:52:49 +00:00
|
|
|
return ("%F");
|
2013-05-03 16:21:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief FolioNum::next
|
|
|
|
* @return the next NumerotationContext nc at position i
|
|
|
|
*/
|
|
|
|
NumerotationContext FolioNum::next (const NumerotationContext &nc, const int i) const {
|
|
|
|
return (nextString(nc, i));
|
|
|
|
}
|
|
|
|
|
2014-08-04 16:12:59 +00:00
|
|
|
/**
|
|
|
|
* @brief FolioNum::previous
|
|
|
|
* @return the previous NumerotationContext nc at posiiton i
|
|
|
|
*/
|
|
|
|
NumerotationContext FolioNum::previous(const NumerotationContext &nc, const int i) const {
|
|
|
|
return (nextString(nc, i));
|
|
|
|
}
|
|
|
|
|
2016-08-16 13:43:46 +00:00
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
*/
|
2018-12-04 19:07:14 +00:00
|
|
|
PlantNum::PlantNum (Diagram *d):
|
2016-08-16 13:43:46 +00:00
|
|
|
NumStrategy (d)
|
|
|
|
{}
|
|
|
|
|
|
|
|
/**
|
2018-12-04 19:07:14 +00:00
|
|
|
* @brief PlantNum::toRepresentedString
|
2016-08-16 13:43:46 +00:00
|
|
|
* @return the represented string of folio
|
|
|
|
*/
|
2018-12-04 19:07:14 +00:00
|
|
|
QString PlantNum::toRepresentedString(const QString str) const {
|
2016-08-16 13:43:46 +00:00
|
|
|
Q_UNUSED(str);
|
|
|
|
return "%M";
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2018-12-04 19:07:14 +00:00
|
|
|
* @brief PlantNum::next
|
2016-08-16 13:43:46 +00:00
|
|
|
* @return the next NumerotationContext nc at position i
|
|
|
|
*/
|
2018-12-04 19:07:14 +00:00
|
|
|
NumerotationContext PlantNum::next (const NumerotationContext &nc, const int i) const {
|
2016-08-16 13:43:46 +00:00
|
|
|
return (nextString(nc, i));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2018-12-04 19:07:14 +00:00
|
|
|
* @brief PlantNum::previous
|
2016-08-16 13:43:46 +00:00
|
|
|
* @return the previous NumerotationContext nc at posiiton i
|
|
|
|
*/
|
2018-12-04 19:07:14 +00:00
|
|
|
NumerotationContext PlantNum::previous(const NumerotationContext &nc, const int i) const {
|
2016-08-16 13:43:46 +00:00
|
|
|
return (nextString(nc, i));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
*/
|
|
|
|
LocmachNum::LocmachNum (Diagram *d):
|
|
|
|
NumStrategy (d)
|
|
|
|
{}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief LocmachNum::toRepresentedString
|
|
|
|
* @return the represented string of folio
|
|
|
|
*/
|
|
|
|
QString LocmachNum::toRepresentedString(const QString str) const {
|
|
|
|
Q_UNUSED(str);
|
|
|
|
return "%LM";
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief LocmachNum::next
|
|
|
|
* @return the next NumerotationContext nc at position i
|
|
|
|
*/
|
|
|
|
NumerotationContext LocmachNum::next (const NumerotationContext &nc, const int i) const {
|
|
|
|
return (nextString(nc, i));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief LocmachNum::previous
|
|
|
|
* @return the previous NumerotationContext nc at posiiton i
|
|
|
|
*/
|
|
|
|
NumerotationContext LocmachNum::previous(const NumerotationContext &nc, const int i) const {
|
|
|
|
return (nextString(nc, i));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-07-10 01:33:49 +00:00
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
*/
|
|
|
|
ElementLineNum::ElementLineNum (Diagram *d):
|
|
|
|
NumStrategy (d)
|
|
|
|
{}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief ElementLineNum::toRepresentedString
|
|
|
|
* @return the represented string of folio
|
|
|
|
*/
|
|
|
|
QString ElementLineNum::toRepresentedString(const QString str) const {
|
|
|
|
Q_UNUSED(str);
|
|
|
|
return "%l";
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief ElementLineNum::next
|
|
|
|
* @return the next NumerotationContext nc at position i
|
|
|
|
*/
|
|
|
|
NumerotationContext ElementLineNum::next (const NumerotationContext &nc, const int i) const {
|
|
|
|
return (nextString(nc, i));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief ElementLineNum::previous
|
|
|
|
* @return the previous NumerotationContext nc at posiiton i
|
|
|
|
*/
|
|
|
|
NumerotationContext ElementLineNum::previous(const NumerotationContext &nc, const int i) const {
|
|
|
|
return (nextString(nc, i));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
*/
|
|
|
|
ElementColumnNum::ElementColumnNum (Diagram *d):
|
|
|
|
NumStrategy (d)
|
|
|
|
{}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief ElementColumnNum::toRepresentedString
|
|
|
|
* @return the represented string of folio
|
|
|
|
*/
|
|
|
|
QString ElementColumnNum::toRepresentedString(const QString str) const {
|
|
|
|
Q_UNUSED(str);
|
|
|
|
return "%c";
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief ElementColumnNum::next
|
|
|
|
* @return the next NumerotationContext nc at position i
|
|
|
|
*/
|
|
|
|
NumerotationContext ElementColumnNum::next (const NumerotationContext &nc, const int i) const {
|
|
|
|
return (nextString(nc, i));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief ElementColumnNum::previous
|
|
|
|
* @return the previous NumerotationContext nc at posiiton i
|
|
|
|
*/
|
|
|
|
NumerotationContext ElementColumnNum::previous(const NumerotationContext &nc, const int i) const {
|
|
|
|
return (nextString(nc, i));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
*/
|
|
|
|
ElementPrefixNum::ElementPrefixNum (Diagram *d):
|
|
|
|
NumStrategy (d)
|
|
|
|
{}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief ElementPrefixNum::toRepresentedString
|
|
|
|
* @return the represented string of folio
|
|
|
|
*/
|
|
|
|
QString ElementPrefixNum::toRepresentedString(const QString str) const {
|
|
|
|
Q_UNUSED(str);
|
|
|
|
return "%prefix";
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief ElementPrefixNum::next
|
|
|
|
* @return the next NumerotationContext nc at position i
|
|
|
|
*/
|
|
|
|
NumerotationContext ElementPrefixNum::next (const NumerotationContext &nc, const int i) const {
|
|
|
|
return (nextString(nc, i));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief ElementPrefixNum::previous
|
|
|
|
* @return the previous NumerotationContext nc at posiiton i
|
|
|
|
*/
|
|
|
|
NumerotationContext ElementPrefixNum::previous(const NumerotationContext &nc, const int i) const {
|
|
|
|
return (nextString(nc, i));
|
|
|
|
}
|
|
|
|
|