mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-01-09 15:19:58 +01:00
Mod doc set style de same
This commit is contained in:
@@ -29,8 +29,8 @@
|
||||
namespace autonum
|
||||
{
|
||||
/**
|
||||
* @brief sequentialNumbers::sequentialNumbers
|
||||
*/
|
||||
@brief sequentialNumbers::sequentialNumbers
|
||||
*/
|
||||
sequentialNumbers::sequentialNumbers()
|
||||
{}
|
||||
|
||||
@@ -83,12 +83,13 @@ namespace autonum
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief sequentialNumbers::toXml
|
||||
* export this sequential numbers into a QDomElement.
|
||||
* @param document : QDomDocument used to create the QDomElement
|
||||
* @param tag_name : the tag name used for the QDomElement.
|
||||
* @return A QDomElement, if this sequential have no value, the returned QDomELement is empty
|
||||
*/
|
||||
@brief sequentialNumbers::toXml
|
||||
export this sequential numbers into a QDomElement.
|
||||
@param document : QDomDocument used to create the QDomElement
|
||||
@param tag_name : the tag name used for the QDomElement.
|
||||
@return A QDomElement, if this sequential have no value,
|
||||
the returned QDomELement is empty
|
||||
*/
|
||||
QDomElement sequentialNumbers::toXml(QDomDocument &document, const QString& tag_name) const
|
||||
{
|
||||
QDomElement element = document.createElement(tag_name);
|
||||
@@ -110,10 +111,10 @@ namespace autonum
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief sequentialNumbers::fromXml
|
||||
* Import sequential values from a QDomElement
|
||||
* @param element
|
||||
*/
|
||||
@brief sequentialNumbers::fromXml
|
||||
Import sequential values from a QDomElement
|
||||
@param element
|
||||
*/
|
||||
void sequentialNumbers::fromXml(const QDomElement &element)
|
||||
{
|
||||
if (!element.hasChildNodes())
|
||||
@@ -152,14 +153,17 @@ namespace autonum
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief AssignVariables::formulaToLabel
|
||||
* Return the @formula with variable assigned (ready to be displayed)
|
||||
* @param formula - the formula to work
|
||||
* @param seqStruct - struct where is stocked int values (struct is passed as a reference and modified by this static method)
|
||||
* @param diagram - the diagram where occure the formula.
|
||||
* @param elmt - parent element (if any) of the formula
|
||||
* @return the string with variable assigned.
|
||||
*/
|
||||
@brief AssignVariables::formulaToLabel
|
||||
Return the @formula with variable assigned
|
||||
(ready to be displayed)
|
||||
@param formula - the formula to work
|
||||
@param seqStruct - struct where is stocked int values
|
||||
(struct is passed as a reference
|
||||
and modified by this static method)
|
||||
@param diagram - the diagram where occure the formula.
|
||||
@param elmt - parent element (if any) of the formula
|
||||
@return the string with variable assigned.
|
||||
*/
|
||||
QString AssignVariables::formulaToLabel(QString formula, sequentialNumbers &seqStruct, Diagram *diagram, const Element *elmt)
|
||||
{
|
||||
AssignVariables av(std::move(formula), seqStruct, diagram, elmt);
|
||||
@@ -168,12 +172,13 @@ namespace autonum
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief AssignVariables::replaceVariable
|
||||
* Replace the variables in @formula in form %{my-var} to the corresponding value stored in @dc
|
||||
* @param formula
|
||||
* @param dc
|
||||
* @return
|
||||
*/
|
||||
@brief AssignVariables::replaceVariable
|
||||
Replace the variables in @formula in form %{my-var}
|
||||
to the corresponding value stored in @dc
|
||||
@param formula
|
||||
@param dc
|
||||
@return
|
||||
*/
|
||||
QString AssignVariables::replaceVariable(const QString &formula, const DiagramContext &dc)
|
||||
{
|
||||
QString str = formula;
|
||||
@@ -297,12 +302,13 @@ namespace autonum
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief setSequentialToList
|
||||
* Append all sequential of type @type owned by @context in list
|
||||
* @param list : list to have value inserted
|
||||
* @param context : numerotation context to retrieve value
|
||||
* @param type : type of sequential (unit, unitfolio, ten, tenfolio, hundred, hundredfolio)
|
||||
*/
|
||||
@brief setSequentialToList
|
||||
Append all sequential of type @type owned by @context in list
|
||||
@param list : list to have value inserted
|
||||
@param context : numerotation context to retrieve value
|
||||
@param type : type of sequential
|
||||
(unit, unitfolio, ten, tenfolio, hundred, hundredfolio)
|
||||
*/
|
||||
void setSequentialToList(QStringList &list, NumerotationContext &context, const QString& type)
|
||||
{
|
||||
for (int i = 0; i < context.size(); i++)
|
||||
@@ -321,12 +327,12 @@ namespace autonum
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief setFolioSequentialToHash
|
||||
* Insert all value of @list in @hash with key @autoNumName
|
||||
* @param list : list to get values from
|
||||
* @param hash : hash to have values inserted
|
||||
* @param autoNumName : name to use as key of hash
|
||||
*/
|
||||
@brief setFolioSequentialToHash
|
||||
Insert all value of @list in @hash with key @autoNumName
|
||||
@param list : list to get values from
|
||||
@param hash : hash to have values inserted
|
||||
@param autoNumName : name to use as key of hash
|
||||
*/
|
||||
void setFolioSequentialToHash(QStringList &list, QHash<QString, QStringList> &hash, const QString& autoNumName)
|
||||
{
|
||||
if (hash.isEmpty() || !hash.contains(autoNumName))
|
||||
@@ -355,15 +361,20 @@ namespace autonum
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief setSequential
|
||||
* Fill seqStruct
|
||||
* @param label : label of sequential to fill (%sequ_, %sequf_, %seqt_, ect....)
|
||||
* @param seqStruct : struct to fill
|
||||
* @param context : numerotation context use to know the current sequential num.
|
||||
* @param diagram : diagram where the sequential occur, notably use when label is folio type (%sequf_, %seqtf_, %seqhf_),
|
||||
* to keep up to date the current sequential of folio.
|
||||
* @param hashKey : the hash key used to store the sequential for folio type.
|
||||
*/
|
||||
@brief setSequential
|
||||
Fill seqStruct
|
||||
@param label : label of sequential to fill
|
||||
(%sequ_, %sequf_, %seqt_, ect....)
|
||||
@param seqStruct : struct to fill
|
||||
@param context : numerotation context use
|
||||
to know the current sequential num.
|
||||
@param diagram : diagram where the sequential occur,
|
||||
notably use when label is folio type
|
||||
(%sequf_, %seqtf_, %seqhf_),
|
||||
to keep up to date the current sequential of folio.
|
||||
@param hashKey :
|
||||
the hash key used to store the sequential for folio type.
|
||||
*/
|
||||
void setSequential(const QString& label, sequentialNumbers &seqStruct, NumerotationContext &context, Diagram *diagram, const QString& hashKey)
|
||||
{
|
||||
if (!context.isEmpty())
|
||||
@@ -399,10 +410,10 @@ namespace autonum
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief numerotationContextToFormula
|
||||
* @param nc
|
||||
* @return the numerotation context, converted to formula
|
||||
*/
|
||||
@brief numerotationContextToFormula
|
||||
@param nc
|
||||
@return the numerotation context, converted to formula
|
||||
*/
|
||||
QString numerotationContextToFormula(const NumerotationContext &nc)
|
||||
{
|
||||
QString type;
|
||||
@@ -476,11 +487,13 @@ namespace autonum
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief elementPrefixForLocation
|
||||
* @param location
|
||||
* @return the prefix for an element represented by location, prefix can be null.
|
||||
* Search for a prefix only if @location represent an element embedded in a project
|
||||
*/
|
||||
@brief elementPrefixForLocation
|
||||
@param location
|
||||
@return the prefix for an element represented by location,
|
||||
prefix can be null.
|
||||
Search for a prefix only if @location represent
|
||||
an element embedded in a project
|
||||
*/
|
||||
QString elementPrefixForLocation(const ElementsLocation &location)
|
||||
{
|
||||
if (!location.isProject())
|
||||
|
||||
@@ -55,10 +55,10 @@ namespace autonum
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief The AssignVariables class
|
||||
* This class assign variable of a formula string.
|
||||
* Return the final string used to be displayed from a formula string.
|
||||
*/
|
||||
@brief The AssignVariables class
|
||||
This class assign variable of a formula string.
|
||||
Return the final string used to be displayed from a formula string.
|
||||
*/
|
||||
class AssignVariables
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -21,32 +21,32 @@
|
||||
#include "qet.h"
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Constructor
|
||||
*/
|
||||
NumerotationContext::NumerotationContext(){
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor from xml
|
||||
*/
|
||||
Constructor from xml
|
||||
*/
|
||||
NumerotationContext::NumerotationContext(QDomElement &e) {
|
||||
fromXml(e);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief NumerotationContext::clear, clear the content
|
||||
*/
|
||||
@brief NumerotationContext::clear, clear the content
|
||||
*/
|
||||
void NumerotationContext::clear () {
|
||||
content_.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief NumerotationContext::addValue, add a new value on the contexte
|
||||
* @param type the type of value
|
||||
* @param value the value itself
|
||||
* @param increase the increase number of value
|
||||
* @return true if value is append
|
||||
*/
|
||||
@brief NumerotationContext::addValue, add a new value on the contexte
|
||||
@param type the type of value
|
||||
@param value the value itself
|
||||
@param increase the increase number of value
|
||||
@return true if value is append
|
||||
*/
|
||||
bool NumerotationContext::addValue(const QString &type, const QVariant &value, const int increase, const int initialvalue) {
|
||||
if (!keyIsAcceptable(type) && !value.canConvert(QVariant::String)) return false;
|
||||
if (keyIsNumber(type) && !value.canConvert(QVariant::Int)) return false;
|
||||
@@ -58,80 +58,80 @@ bool NumerotationContext::addValue(const QString &type, const QVariant &value, c
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief NumerotationContext::operator []
|
||||
* @return the string at position @i
|
||||
*/
|
||||
@brief NumerotationContext::operator []
|
||||
@return the string at position @i
|
||||
*/
|
||||
QString NumerotationContext::operator [] (const int &i) const {
|
||||
return (content_.at(i));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief NumerotationContext::operator << , append other
|
||||
*/
|
||||
@brief NumerotationContext::operator << , append other
|
||||
*/
|
||||
void NumerotationContext::operator << (const NumerotationContext &other) {
|
||||
for (int i=0; i<other.size(); ++i) content_.append(other[i]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief NumerotationContext::size
|
||||
* @return size of context
|
||||
*/
|
||||
@brief NumerotationContext::size
|
||||
@return size of context
|
||||
*/
|
||||
int NumerotationContext::size() const {
|
||||
return (content_.size());
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief NumerotationContext::isEmpty
|
||||
* @return true if numerotation contet is empty
|
||||
*/
|
||||
@brief NumerotationContext::isEmpty
|
||||
@return true if numerotation contet is empty
|
||||
*/
|
||||
bool NumerotationContext::isEmpty() const {
|
||||
if (content_.size() > 0) return false;
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* @brief NumerotationContext::itemAt
|
||||
* @return the content at position @i 1:type 2:value 3:increase
|
||||
*/
|
||||
@brief NumerotationContext::itemAt
|
||||
@return the content at position @i 1:type 2:value 3:increase
|
||||
*/
|
||||
QStringList NumerotationContext::itemAt(const int i) const {
|
||||
return (content_.at(i).split("|"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief validRegExpNum
|
||||
* @return all type use to numerotation
|
||||
*/
|
||||
@brief validRegExpNum
|
||||
@return all type use to numerotation
|
||||
*/
|
||||
QString NumerotationContext::validRegExpNum () const {
|
||||
return ("unit|unitfolio|ten|tenfolio|hundred|hundredfolio|string|idfolio|folio|plant|locmach|elementline|elementcolumn|elementprefix");
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief NumerotationContext::validRegExpNumber
|
||||
* @return all type represents a number
|
||||
*/
|
||||
@brief NumerotationContext::validRegExpNumber
|
||||
@return all type represents a number
|
||||
*/
|
||||
QString NumerotationContext::validRegExpNumber() const {
|
||||
return ("unit|unitfolio|ten|tenfolio|hundred|hundredfolio");
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief NumerotationContext::keyIsAcceptable
|
||||
* @return true if @type is acceptable
|
||||
*/
|
||||
@brief NumerotationContext::keyIsAcceptable
|
||||
@return true if @type is acceptable
|
||||
*/
|
||||
bool NumerotationContext::keyIsAcceptable(const QString &type) const {
|
||||
return (type.contains(QRegExp(validRegExpNum())));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief NumerotationContext::keyIsNumber
|
||||
* @return true if @type represent a number
|
||||
*/
|
||||
@brief NumerotationContext::keyIsNumber
|
||||
@return true if @type represent a number
|
||||
*/
|
||||
bool NumerotationContext::keyIsNumber(const QString &type) const {
|
||||
return (type.contains(QRegExp(validRegExpNumber())));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief NumerotationContext::toXml
|
||||
* Save the numerotation context in a QDomElement under the element name @str
|
||||
*/
|
||||
@brief NumerotationContext::toXml
|
||||
Save the numerotation context in a QDomElement under the element name @str
|
||||
*/
|
||||
QDomElement NumerotationContext::toXml(QDomDocument &d, const QString& str) {
|
||||
QDomElement num_auto = d.createElement(str);
|
||||
for (int i=0; i<content_.size(); ++i) {
|
||||
@@ -151,20 +151,20 @@ QDomElement NumerotationContext::toXml(QDomDocument &d, const QString& str) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief NumerotationContext::fromXml
|
||||
* load numerotation context from @e
|
||||
*/
|
||||
@brief NumerotationContext::fromXml
|
||||
load numerotation context from @e
|
||||
*/
|
||||
void NumerotationContext::fromXml(QDomElement &e) {
|
||||
clear();
|
||||
foreach(QDomElement qde, QET::findInDomElement(e, "part")) addValue(qde.attribute("type"), qde.attribute("value"), qde.attribute("increase").toInt(), qde.attribute("initialvalue").toInt());
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief NumerotationContext::replaceValue
|
||||
* This class replaces the current NC field value with content
|
||||
* @param index of NC Item
|
||||
* @param QString content to replace current value
|
||||
*/
|
||||
@brief NumerotationContext::replaceValue
|
||||
This class replaces the current NC field value with content
|
||||
@param index of NC Item
|
||||
@param QString content to replace current value
|
||||
*/
|
||||
void NumerotationContext::replaceValue(int index, QString content) {
|
||||
QString sep = "|";
|
||||
QString type = content_[index].split("|").at(0);
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
This class represents a numerotation context, i.e. the data (type, value, increase)
|
||||
of a numerotation at a given time. It is notably used by conductor
|
||||
to store the informations they need to do their autonumerotation.
|
||||
*/
|
||||
*/
|
||||
class NumerotationContext
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
#include "diagram.h"
|
||||
|
||||
/**
|
||||
* @brief Constructor
|
||||
*/
|
||||
@brief Constructor
|
||||
*/
|
||||
NumerotationContextCommands::NumerotationContextCommands(const NumerotationContext &nc, Diagram *d):
|
||||
diagram_ (d),
|
||||
context_ (nc),
|
||||
@@ -28,16 +28,16 @@ NumerotationContextCommands::NumerotationContextCommands(const NumerotationConte
|
||||
{}
|
||||
|
||||
/**
|
||||
* @brief Destructor
|
||||
*/
|
||||
@brief Destructor
|
||||
*/
|
||||
NumerotationContextCommands::~NumerotationContextCommands() {
|
||||
if (strategy_) delete strategy_;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief NumerotationContextCommands::next
|
||||
* @return the next numerotation context
|
||||
*/
|
||||
@brief NumerotationContextCommands::next
|
||||
@return the next numerotation context
|
||||
*/
|
||||
NumerotationContext NumerotationContextCommands::next() {
|
||||
NumerotationContext contextnum;
|
||||
|
||||
@@ -50,9 +50,9 @@ NumerotationContext NumerotationContextCommands::next() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief NumerotationContextCommands::previous
|
||||
* @return the previous numerotation context
|
||||
*/
|
||||
@brief NumerotationContextCommands::previous
|
||||
@return the previous numerotation context
|
||||
*/
|
||||
NumerotationContext NumerotationContextCommands::previous() {
|
||||
NumerotationContext contextnum;
|
||||
|
||||
@@ -65,9 +65,9 @@ NumerotationContext NumerotationContextCommands::previous() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief NumerotationContextCommands::toFinalString
|
||||
* @return the string represented by the numerotation context
|
||||
*/
|
||||
@brief NumerotationContextCommands::toFinalString
|
||||
@return the string represented by the numerotation context
|
||||
*/
|
||||
QString NumerotationContextCommands::toRepresentedString() {
|
||||
QString num;
|
||||
if (context_.size()) {
|
||||
@@ -83,9 +83,9 @@ QString NumerotationContextCommands::toRepresentedString() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief NumerotationContextCommands::setNumStrategy
|
||||
* apply the good strategy relative to @str
|
||||
*/
|
||||
@brief NumerotationContextCommands::setNumStrategy
|
||||
apply the good strategy relative to @str
|
||||
*/
|
||||
void NumerotationContextCommands::setNumStrategy(const QString &str) {
|
||||
if (strategy_) delete strategy_;
|
||||
if (str == "unit") {
|
||||
@@ -149,8 +149,8 @@ void NumerotationContextCommands::setNumStrategy(const QString &str) {
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Constructor
|
||||
*/
|
||||
NumStrategy::NumStrategy (Diagram *d):
|
||||
diagram_ (d)
|
||||
{}
|
||||
@@ -158,9 +158,9 @@ NumStrategy::NumStrategy (Diagram *d):
|
||||
NumStrategy::~NumStrategy() {}
|
||||
|
||||
/**
|
||||
* @brief NumStrategy::nextString
|
||||
* @return the next value of @nc at position @i
|
||||
*/
|
||||
@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;
|
||||
@@ -169,9 +169,9 @@ NumerotationContext NumStrategy::nextString (const NumerotationContext &nc, cons
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief NumStrategy::nextNumber
|
||||
* @return the next value of @nc at position @i
|
||||
*/
|
||||
@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;
|
||||
@@ -181,9 +181,9 @@ NumerotationContext NumStrategy::nextNumber (const NumerotationContext &nc, cons
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief NumStrategy::previousNumber
|
||||
* @return the previous value of @nc at position @i
|
||||
*/
|
||||
@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;
|
||||
@@ -193,78 +193,78 @@ NumerotationContext NumStrategy::previousNumber(const NumerotationContext &nc, c
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Constructor
|
||||
*/
|
||||
UnitNum::UnitNum(Diagram *d):
|
||||
NumStrategy(d)
|
||||
{}
|
||||
|
||||
/**
|
||||
* @brief UnitNum::toRepresentedString
|
||||
* @return the represented string of num
|
||||
*/
|
||||
@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
|
||||
*/
|
||||
@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));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief UnitNum::previous
|
||||
* @return the previous NumerotationContext nc at posiiton i
|
||||
*/
|
||||
@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));
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Constructor
|
||||
*/
|
||||
UnitFNum::UnitFNum(Diagram *d):
|
||||
NumStrategy(d)
|
||||
{}
|
||||
|
||||
/**
|
||||
* @brief UnitFNum::toRepresentedString
|
||||
* @return the represented string of num
|
||||
*/
|
||||
@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
|
||||
*/
|
||||
@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
|
||||
*/
|
||||
@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));
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Constructor
|
||||
*/
|
||||
TenNum::TenNum (Diagram *d):
|
||||
NumStrategy (d)
|
||||
{}
|
||||
|
||||
/**
|
||||
* @brief TenNum::toRepresentedString
|
||||
* @return the represented string of num
|
||||
*/
|
||||
@brief TenNum::toRepresentedString
|
||||
@return the represented string of num
|
||||
*/
|
||||
QString TenNum::toRepresentedString(const QString num) const {
|
||||
int numint = num.toInt();
|
||||
QString numstr = num;
|
||||
@@ -273,32 +273,32 @@ QString TenNum::toRepresentedString(const QString num) const {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief TenNum::next
|
||||
* @return the next NumerotationContext nc at position i
|
||||
*/
|
||||
@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));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief TenNum::previous
|
||||
* @return the previous NumerotationContext nc at posiiton i
|
||||
*/
|
||||
@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));
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Constructor
|
||||
*/
|
||||
TenFNum::TenFNum (Diagram *d):
|
||||
NumStrategy (d)
|
||||
{}
|
||||
|
||||
/**
|
||||
* @brief TenFNum::toRepresentedString
|
||||
* @return the represented string of num
|
||||
*/
|
||||
@brief TenFNum::toRepresentedString
|
||||
@return the represented string of num
|
||||
*/
|
||||
QString TenFNum::toRepresentedString(const QString num) const {
|
||||
int numint = num.toInt();
|
||||
QString numstr = num;
|
||||
@@ -307,33 +307,33 @@ QString TenFNum::toRepresentedString(const QString num) const {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief TenFNum::next
|
||||
* @return the next NumerotationContext nc at position i
|
||||
*/
|
||||
@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
|
||||
*/
|
||||
@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));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Constructor
|
||||
*/
|
||||
HundredNum::HundredNum (Diagram *d):
|
||||
NumStrategy (d)
|
||||
{}
|
||||
|
||||
/**
|
||||
* @brief HundredNum::toRepresentedString
|
||||
* @return the represented string of num
|
||||
*/
|
||||
@brief HundredNum::toRepresentedString
|
||||
@return the represented string of num
|
||||
*/
|
||||
QString HundredNum::toRepresentedString(const QString num) const {
|
||||
int numint = num.toInt();
|
||||
QString numstr = num;
|
||||
@@ -347,32 +347,32 @@ QString HundredNum::toRepresentedString(const QString num) const {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief HundredNum::next
|
||||
* @return the next NumerotationContext nc at position i
|
||||
*/
|
||||
@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));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief HundredNum::previous
|
||||
* @return the previous NumerotationContext nc at posiiton i
|
||||
*/
|
||||
@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));
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Constructor
|
||||
*/
|
||||
HundredFNum::HundredFNum (Diagram *d):
|
||||
NumStrategy (d)
|
||||
{}
|
||||
|
||||
/**
|
||||
* @brief HundredFNum::toRepresentedString
|
||||
* @return the represented string of num
|
||||
*/
|
||||
@brief HundredFNum::toRepresentedString
|
||||
@return the represented string of num
|
||||
*/
|
||||
QString HundredFNum::toRepresentedString(const QString num) const {
|
||||
int numint = num.toInt();
|
||||
QString numstr = num;
|
||||
@@ -386,274 +386,274 @@ QString HundredFNum::toRepresentedString(const QString num) const {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief HundredFNum::next
|
||||
* @return the next NumerotationContext nc at position i
|
||||
*/
|
||||
@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
|
||||
*/
|
||||
@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));
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Constructor
|
||||
*/
|
||||
StringNum::StringNum (Diagram *d):
|
||||
NumStrategy (d)
|
||||
{}
|
||||
|
||||
/**
|
||||
* @brief StringNum::toRepresentedString
|
||||
* @return the represented string of num
|
||||
*/
|
||||
@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
|
||||
*/
|
||||
@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));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief StringNum::previous
|
||||
* @return the previous NumerotationContext nc at posiiton i
|
||||
*/
|
||||
@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));
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Constructor
|
||||
*/
|
||||
IdFolioNum::IdFolioNum (Diagram *d):
|
||||
NumStrategy (d)
|
||||
{}
|
||||
|
||||
/**
|
||||
* @brief IdFolioNum::toRepresentedString
|
||||
* @return the represented string of num
|
||||
*/
|
||||
@brief IdFolioNum::toRepresentedString
|
||||
@return the represented string of num
|
||||
*/
|
||||
QString IdFolioNum::toRepresentedString(const QString str) const {
|
||||
Q_UNUSED(str);
|
||||
return ("%id");
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief IdFolioNum::next
|
||||
* @return the next NumerotationContext nc at position i
|
||||
*/
|
||||
@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
|
||||
*/
|
||||
@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));
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Constructor
|
||||
*/
|
||||
FolioNum::FolioNum (Diagram *d):
|
||||
NumStrategy (d)
|
||||
{}
|
||||
|
||||
/**
|
||||
* @brief FolioNum::toRepresentedString
|
||||
* @return the represented string of folio
|
||||
*/
|
||||
@brief FolioNum::toRepresentedString
|
||||
@return the represented string of folio
|
||||
*/
|
||||
QString FolioNum::toRepresentedString(const QString str) const {
|
||||
Q_UNUSED(str);
|
||||
return ("%F");
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief FolioNum::next
|
||||
* @return the next NumerotationContext nc at position i
|
||||
*/
|
||||
@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));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief FolioNum::previous
|
||||
* @return the previous NumerotationContext nc at posiiton i
|
||||
*/
|
||||
@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));
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Constructor
|
||||
*/
|
||||
PlantNum::PlantNum (Diagram *d):
|
||||
NumStrategy (d)
|
||||
{}
|
||||
|
||||
/**
|
||||
* @brief PlantNum::toRepresentedString
|
||||
* @return the represented string of folio
|
||||
*/
|
||||
@brief PlantNum::toRepresentedString
|
||||
@return the represented string of folio
|
||||
*/
|
||||
QString PlantNum::toRepresentedString(const QString str) const {
|
||||
Q_UNUSED(str);
|
||||
return "%M";
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief PlantNum::next
|
||||
* @return the next NumerotationContext nc at position i
|
||||
*/
|
||||
@brief PlantNum::next
|
||||
@return the next NumerotationContext nc at position i
|
||||
*/
|
||||
NumerotationContext PlantNum::next (const NumerotationContext &nc, const int i) const {
|
||||
return (nextString(nc, i));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief PlantNum::previous
|
||||
* @return the previous NumerotationContext nc at posiiton i
|
||||
*/
|
||||
@brief PlantNum::previous
|
||||
@return the previous NumerotationContext nc at posiiton i
|
||||
*/
|
||||
NumerotationContext PlantNum::previous(const NumerotationContext &nc, const int i) const {
|
||||
return (nextString(nc, i));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Constructor
|
||||
*/
|
||||
LocmachNum::LocmachNum (Diagram *d):
|
||||
NumStrategy (d)
|
||||
{}
|
||||
|
||||
/**
|
||||
* @brief LocmachNum::toRepresentedString
|
||||
* @return the represented string of folio
|
||||
*/
|
||||
@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
|
||||
*/
|
||||
@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
|
||||
*/
|
||||
@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));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Constructor
|
||||
*/
|
||||
ElementLineNum::ElementLineNum (Diagram *d):
|
||||
NumStrategy (d)
|
||||
{}
|
||||
|
||||
/**
|
||||
* @brief ElementLineNum::toRepresentedString
|
||||
* @return the represented string of folio
|
||||
*/
|
||||
@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
|
||||
*/
|
||||
@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
|
||||
*/
|
||||
@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
|
||||
*/
|
||||
Constructor
|
||||
*/
|
||||
ElementColumnNum::ElementColumnNum (Diagram *d):
|
||||
NumStrategy (d)
|
||||
{}
|
||||
|
||||
/**
|
||||
* @brief ElementColumnNum::toRepresentedString
|
||||
* @return the represented string of folio
|
||||
*/
|
||||
@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
|
||||
*/
|
||||
@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
|
||||
*/
|
||||
@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
|
||||
*/
|
||||
Constructor
|
||||
*/
|
||||
ElementPrefixNum::ElementPrefixNum (Diagram *d):
|
||||
NumStrategy (d)
|
||||
{}
|
||||
|
||||
/**
|
||||
* @brief ElementPrefixNum::toRepresentedString
|
||||
* @return the represented string of folio
|
||||
*/
|
||||
@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
|
||||
*/
|
||||
@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
|
||||
*/
|
||||
@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));
|
||||
}
|
||||
|
||||
@@ -24,8 +24,9 @@ class NumStrategy;
|
||||
class Diagram;
|
||||
|
||||
/**
|
||||
* this class provide methods to handle content of NumerotationContext.
|
||||
*/
|
||||
@brief The NumerotationContextCommands class
|
||||
this class provide methods to handle content of NumerotationContext.
|
||||
*/
|
||||
class NumerotationContextCommands
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -25,10 +25,10 @@
|
||||
#include "projectpropertiesdialog.h"
|
||||
|
||||
/**
|
||||
* @brief AutoNumberingDockWidget::AutoNumberingDockWidget
|
||||
* Constructor
|
||||
* @param parent : parent widget
|
||||
*/
|
||||
@brief AutoNumberingDockWidget::AutoNumberingDockWidget
|
||||
Constructor
|
||||
@param parent : parent widget
|
||||
*/
|
||||
AutoNumberingDockWidget::AutoNumberingDockWidget(QWidget *parent) :
|
||||
QDockWidget(parent),
|
||||
ui(new Ui::AutoNumberingDockWidget)
|
||||
@@ -38,9 +38,9 @@ AutoNumberingDockWidget::AutoNumberingDockWidget(QWidget *parent) :
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief AutoNumberingDockWidget::~AutoNumberingDockWidget
|
||||
* Destructor
|
||||
*/
|
||||
@brief AutoNumberingDockWidget::~AutoNumberingDockWidget
|
||||
Destructor
|
||||
*/
|
||||
AutoNumberingDockWidget::~AutoNumberingDockWidget()
|
||||
{
|
||||
this->disconnect();
|
||||
@@ -48,9 +48,9 @@ AutoNumberingDockWidget::~AutoNumberingDockWidget()
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief AutoNumberingDockWidget::clear
|
||||
* Remove all combo box values
|
||||
*/
|
||||
@brief AutoNumberingDockWidget::clear
|
||||
Remove all combo box values
|
||||
*/
|
||||
void AutoNumberingDockWidget::clear()
|
||||
{
|
||||
ui->m_conductor_cb->clear();
|
||||
@@ -67,11 +67,11 @@ void AutoNumberingDockWidget::projectClosed()
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief AutoNumberingDockWidget::setProject
|
||||
* @param project: project to be setted
|
||||
* @param projectview: projectview to be setted
|
||||
* assign Project and ProjectView, connect all signals and setContext
|
||||
*/
|
||||
@brief AutoNumberingDockWidget::setProject
|
||||
@param project: project to be setted
|
||||
@param projectview: projectview to be setted
|
||||
assign Project and ProjectView, connect all signals and setContext
|
||||
*/
|
||||
void AutoNumberingDockWidget::setProject(QETProject *project, ProjectView *projectview)
|
||||
{
|
||||
//Disconnect previous project
|
||||
@@ -133,9 +133,9 @@ void AutoNumberingDockWidget::setProject(QETProject *project, ProjectView *proje
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief AutoNumberingDockWidget::setContext
|
||||
* Add all itens to comboboxes
|
||||
*/
|
||||
@brief AutoNumberingDockWidget::setContext
|
||||
Add all itens to comboboxes
|
||||
*/
|
||||
void AutoNumberingDockWidget::setContext() {
|
||||
|
||||
this->clear();
|
||||
@@ -165,9 +165,9 @@ void AutoNumberingDockWidget::setContext() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief AutoNumberingDockWidget::setConductorActive
|
||||
* @param dv: activated diagramview
|
||||
*/
|
||||
@brief AutoNumberingDockWidget::setConductorActive
|
||||
@param dv: activated diagramview
|
||||
*/
|
||||
void AutoNumberingDockWidget::setConductorActive(DiagramView* dv) {
|
||||
if (dv!=nullptr) {
|
||||
QString conductor_autonum = dv->diagram()->conductorsAutonumName();
|
||||
@@ -177,9 +177,9 @@ void AutoNumberingDockWidget::setConductorActive(DiagramView* dv) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief AutoNumberingDockWidget::setActive
|
||||
* Set current used autonumberings
|
||||
*/
|
||||
@brief AutoNumberingDockWidget::setActive
|
||||
Set current used autonumberings
|
||||
*/
|
||||
void AutoNumberingDockWidget::setActive() {
|
||||
|
||||
if (m_project_view!=nullptr) {
|
||||
@@ -206,9 +206,9 @@ void AutoNumberingDockWidget::setActive() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief AutoNumberingDockWidget::conductorAutoNumChanged
|
||||
* Add new or remove conductor auto num from combobox
|
||||
*/
|
||||
@brief AutoNumberingDockWidget::conductorAutoNumChanged
|
||||
Add new or remove conductor auto num from combobox
|
||||
*/
|
||||
void AutoNumberingDockWidget::conductorAutoNumChanged() {
|
||||
ui->m_conductor_cb->clear();
|
||||
|
||||
@@ -222,10 +222,10 @@ void AutoNumberingDockWidget::conductorAutoNumChanged() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief AutoNumberingDockWidget::on_m_conductor_cb_activated
|
||||
* @param unused
|
||||
* Set new conductor AutoNum
|
||||
*/
|
||||
@brief AutoNumberingDockWidget::on_m_conductor_cb_activated
|
||||
@param unused
|
||||
Set new conductor AutoNum
|
||||
*/
|
||||
void AutoNumberingDockWidget::on_m_conductor_cb_activated(int)
|
||||
{
|
||||
QString current_autonum = ui->m_conductor_cb->currentText();
|
||||
@@ -236,9 +236,9 @@ void AutoNumberingDockWidget::on_m_conductor_cb_activated(int)
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief AutoNumberingDockWidget::elementAutoNumChanged
|
||||
* Add new or remove element auto num from combobox
|
||||
*/
|
||||
@brief AutoNumberingDockWidget::elementAutoNumChanged
|
||||
Add new or remove element auto num from combobox
|
||||
*/
|
||||
void AutoNumberingDockWidget::elementAutoNumChanged() {
|
||||
|
||||
ui->m_element_cb->clear();
|
||||
@@ -253,10 +253,10 @@ void AutoNumberingDockWidget::elementAutoNumChanged() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief AutoNumberingDockWidget::on_m_element_cb_activated
|
||||
* @param unused
|
||||
* Set new element AutoNum
|
||||
*/
|
||||
@brief AutoNumberingDockWidget::on_m_element_cb_activated
|
||||
@param unused
|
||||
Set new element AutoNum
|
||||
*/
|
||||
void AutoNumberingDockWidget::on_m_element_cb_activated(int)
|
||||
{
|
||||
m_project->setCurrrentElementAutonum(ui->m_element_cb->currentText());
|
||||
@@ -264,9 +264,9 @@ void AutoNumberingDockWidget::on_m_element_cb_activated(int)
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief AutoNumberingDockWidget::folioAutoNumChanged
|
||||
* Add new or remove folio auto num from combobox
|
||||
*/
|
||||
@brief AutoNumberingDockWidget::folioAutoNumChanged
|
||||
Add new or remove folio auto num from combobox
|
||||
*/
|
||||
void AutoNumberingDockWidget::folioAutoNumChanged() {
|
||||
|
||||
ui->m_folio_cb->clear();
|
||||
@@ -281,10 +281,10 @@ void AutoNumberingDockWidget::folioAutoNumChanged() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief AutoNumberingDockWidget::on_m_folio_cb_activated
|
||||
* @param unused
|
||||
* Set new folio AutoNum
|
||||
*/
|
||||
@brief AutoNumberingDockWidget::on_m_folio_cb_activated
|
||||
@param unused
|
||||
Set new folio AutoNum
|
||||
*/
|
||||
void AutoNumberingDockWidget::on_m_folio_cb_activated(int) {
|
||||
QString current_autonum = ui->m_folio_cb->currentText();
|
||||
TitleBlockProperties ip = m_project -> defaultTitleBlockProperties();
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
#include "qetproject.h"
|
||||
#include "diagram.h"
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Constructor
|
||||
*/
|
||||
FolioAutonumberingW::FolioAutonumberingW(QETProject *project, QWidget *parent) :
|
||||
QWidget(parent),
|
||||
project_(project),
|
||||
@@ -39,56 +39,56 @@ FolioAutonumberingW::FolioAutonumberingW(QETProject *project, QWidget *parent) :
|
||||
}
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
Destructor
|
||||
*/
|
||||
FolioAutonumberingW::~FolioAutonumberingW()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief FolioAutonumberingW::setContext
|
||||
* construct autonums in the comboBox selected in the @autonum_chooser QcomboBox
|
||||
*/
|
||||
@brief FolioAutonumberingW::setContext
|
||||
construct autonums in the comboBox selected in the @autonum_chooser QcomboBox
|
||||
*/
|
||||
void FolioAutonumberingW::setContext(QList <QString> autonums) {
|
||||
foreach (QString str, autonums) { ui->m_autonums_cb->addItem(str);}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief FolioAutonumberingW::autoNumSelected
|
||||
* returns the current autonum selected
|
||||
*/
|
||||
@brief FolioAutonumberingW::autoNumSelected
|
||||
returns the current autonum selected
|
||||
*/
|
||||
QString FolioAutonumberingW::autoNumSelected(){
|
||||
return ui->m_autonums_cb->currentText();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief FolioAutonumberingW::fromFolio
|
||||
* returns the current "From Folio" index
|
||||
*/
|
||||
@brief FolioAutonumberingW::fromFolio
|
||||
returns the current "From Folio" index
|
||||
*/
|
||||
int FolioAutonumberingW::fromFolio(){
|
||||
return ui->m_from_cb->currentIndex()-1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief FolioAutonumberingW::toFolio
|
||||
* returns the current "To Folio" index
|
||||
*/
|
||||
@brief FolioAutonumberingW::toFolio
|
||||
returns the current "To Folio" index
|
||||
*/
|
||||
int FolioAutonumberingW::toFolio(){
|
||||
return ui->m_to_cb->currentIndex()+this->fromFolio()+1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief FolioAutonumberingW::newFoliosNumber
|
||||
* returns the number of folios to create
|
||||
*/
|
||||
@brief FolioAutonumberingW::newFoliosNumber
|
||||
returns the number of folios to create
|
||||
*/
|
||||
int FolioAutonumberingW::newFoliosNumber(){
|
||||
return ui->m_new_tabs_sb->value();
|
||||
}
|
||||
/**
|
||||
* @brief FolioAutonumberingW::updateFolioList
|
||||
* update Folio List in From and To ComboBox
|
||||
*/
|
||||
@brief FolioAutonumberingW::updateFolioList
|
||||
update Folio List in From and To ComboBox
|
||||
*/
|
||||
void FolioAutonumberingW::updateFolioList(){
|
||||
ui -> m_from_cb->clear();
|
||||
ui -> m_to_cb->clear();
|
||||
@@ -100,9 +100,9 @@ void FolioAutonumberingW::updateFolioList(){
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief FolioAutonumberingW::on_m_create_new_tabs_rb_clicked
|
||||
@brief FolioAutonumberingW::on_m_create_new_tabs_rb_clicked
|
||||
* Enable New Tabs SpinBox
|
||||
*/
|
||||
*/
|
||||
void FolioAutonumberingW::on_m_create_new_tabs_rb_clicked() {
|
||||
ui->m_from_cb->setEnabled(false);
|
||||
ui->m_to_cb->setEnabled(false);
|
||||
@@ -112,9 +112,9 @@ void FolioAutonumberingW::on_m_create_new_tabs_rb_clicked() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief FolioAutonumberingW::on_m_autonumber_tabs_rb_clicked
|
||||
@brief FolioAutonumberingW::on_m_autonumber_tabs_rb_clicked
|
||||
* Enable From ComboBox, fill From ComboBox
|
||||
*/
|
||||
*/
|
||||
void FolioAutonumberingW::on_m_autonumber_tabs_rb_clicked() {
|
||||
ui->m_new_tabs_sb->setEnabled(false);
|
||||
ui->m_from_cb->setEnabled(true);
|
||||
@@ -131,18 +131,18 @@ void FolioAutonumberingW::on_m_autonumber_tabs_rb_clicked() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief FolioAutonumberingW::on_m_new_tabs_sb_valueChanged
|
||||
@brief FolioAutonumberingW::on_m_new_tabs_sb_valueChanged
|
||||
* Enable Apply if any new folio is to be created
|
||||
*/
|
||||
*/
|
||||
void FolioAutonumberingW::on_m_new_tabs_sb_valueChanged(int){
|
||||
if (ui->m_new_tabs_sb->value()>0) applyEnable(true);
|
||||
else applyEnable(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief FolioAutonumberingW::on_m_from_cb_currentIndexChanged
|
||||
@brief FolioAutonumberingW::on_m_from_cb_currentIndexChanged
|
||||
* Enable To ComboBox
|
||||
*/
|
||||
*/
|
||||
void FolioAutonumberingW::on_m_from_cb_currentIndexChanged(int){
|
||||
int index = ui->m_from_cb->currentIndex();
|
||||
ui->m_to_cb->clear();
|
||||
@@ -159,9 +159,9 @@ void FolioAutonumberingW::on_m_from_cb_currentIndexChanged(int){
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief SelectAutonumW::on_buttonBox_clicked
|
||||
* Action on @buttonBox clicked
|
||||
*/
|
||||
@brief SelectAutonumW::on_buttonBox_clicked
|
||||
Action on @buttonBox clicked
|
||||
*/
|
||||
void FolioAutonumberingW::on_buttonBox_clicked(QAbstractButton *button) {
|
||||
//transform button to int
|
||||
int answer = ui -> buttonBox -> buttonRole(button);
|
||||
@@ -194,9 +194,9 @@ void FolioAutonumberingW::on_buttonBox_clicked(QAbstractButton *button) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief SelectAutonumW::applyEnable
|
||||
* enable/disable the apply button
|
||||
*/
|
||||
@brief SelectAutonumW::applyEnable
|
||||
enable/disable the apply button
|
||||
*/
|
||||
void FolioAutonumberingW::applyEnable(bool b) {
|
||||
if (b){
|
||||
bool valid = true;
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
#include <utility>
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Constructor
|
||||
*/
|
||||
FormulaAutonumberingW::FormulaAutonumberingW(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::FormulaAutonumberingW)
|
||||
@@ -35,41 +35,41 @@ FormulaAutonumberingW::FormulaAutonumberingW(QWidget *parent) :
|
||||
}
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
Destructor
|
||||
*/
|
||||
FormulaAutonumberingW::~FormulaAutonumberingW()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief FormulaAutonumberingW::setContext
|
||||
* @param formula to be inserted into context
|
||||
*/
|
||||
@brief FormulaAutonumberingW::setContext
|
||||
@param formula to be inserted into context
|
||||
*/
|
||||
void FormulaAutonumberingW::setContext(const QString& formula) {
|
||||
ui->m_formula_le->insert(formula);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief FormulaAutonumberingW::clearContext
|
||||
* @param clear formula line edit text
|
||||
*/
|
||||
@brief FormulaAutonumberingW::clearContext
|
||||
@param clear formula line edit text
|
||||
*/
|
||||
void FormulaAutonumberingW::clearContext() {
|
||||
ui->m_formula_le->clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief FormulaAutonumberingW::formula
|
||||
* @return formula to be stored into project
|
||||
*/
|
||||
@brief FormulaAutonumberingW::formula
|
||||
@return formula to be stored into project
|
||||
*/
|
||||
QString FormulaAutonumberingW::formula() {
|
||||
return ui->m_formula_le->text();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief FormulaAutonumberingW::on_m_formula_le_textChanged
|
||||
* Update Apply Button
|
||||
*/
|
||||
@brief FormulaAutonumberingW::on_m_formula_le_textChanged
|
||||
Update Apply Button
|
||||
*/
|
||||
void FormulaAutonumberingW::on_m_formula_le_textChanged(QString text) {
|
||||
emit (textChanged(std::move(text)));
|
||||
}
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
#include "ui_numparteditorw.h"
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Constructor
|
||||
*/
|
||||
NumPartEditorW::NumPartEditorW(int type, QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::NumPartEditorW),
|
||||
@@ -34,9 +34,9 @@ NumPartEditorW::NumPartEditorW(int type, QWidget *parent) :
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* Build with value of @context at position i
|
||||
*/
|
||||
Constructor
|
||||
Build with value of @context at position i
|
||||
*/
|
||||
NumPartEditorW::NumPartEditorW (NumerotationContext &context, int i, int type, QWidget *parent):
|
||||
QWidget(parent),
|
||||
ui(new Ui::NumPartEditorW),
|
||||
@@ -69,8 +69,8 @@ NumPartEditorW::NumPartEditorW (NumerotationContext &context, int i, int type, Q
|
||||
}
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
Destructor
|
||||
*/
|
||||
NumPartEditorW::~NumPartEditorW()
|
||||
{
|
||||
delete intValidator;
|
||||
@@ -102,9 +102,9 @@ void NumPartEditorW::setVisibleItems()
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief NumPartEditorW::toNumContext
|
||||
* @return the display to NumerotationContext
|
||||
*/
|
||||
@brief NumPartEditorW::toNumContext
|
||||
@return the display to NumerotationContext
|
||||
*/
|
||||
NumerotationContext NumPartEditorW::toNumContext() {
|
||||
NumerotationContext nc;
|
||||
QString type_str;
|
||||
@@ -160,9 +160,9 @@ NumerotationContext NumPartEditorW::toNumContext() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief NumPartEditorW::isValid
|
||||
* @return true if value field isn't empty or if type is folio
|
||||
*/
|
||||
@brief NumPartEditorW::isValid
|
||||
@return true if value field isn't empty or if type is folio
|
||||
*/
|
||||
bool NumPartEditorW::isValid() {
|
||||
if (type_ == folio || type_ == idfolio || type_ == elementline || type_ == plant || type_ == locmach ||
|
||||
type_ == elementcolumn || type_ == elementprefix) {return true;}
|
||||
@@ -171,9 +171,9 @@ bool NumPartEditorW::isValid() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief NumPartEditorW::on_type_cb_activated
|
||||
* Action when user change the type comboBox
|
||||
*/
|
||||
@brief NumPartEditorW::on_type_cb_activated
|
||||
Action when user change the type comboBox
|
||||
*/
|
||||
void NumPartEditorW::on_type_cb_activated(int) {
|
||||
if (ui->type_cb->currentText() == tr("Chiffre 1"))
|
||||
setType(unit);
|
||||
@@ -207,27 +207,27 @@ void NumPartEditorW::on_type_cb_activated(int) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief NumPartEditorW::on_value_field_textChanged
|
||||
* emit changed when @value_field text changed
|
||||
*/
|
||||
@brief NumPartEditorW::on_value_field_textChanged
|
||||
emit changed when @value_field text changed
|
||||
*/
|
||||
void NumPartEditorW::on_value_field_textEdited() {
|
||||
emit changed();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief NumPartEditorW::on_increase_spinBox_valueChanged
|
||||
* emit changed when @increase_spinBox value changed
|
||||
*/
|
||||
@brief NumPartEditorW::on_increase_spinBox_valueChanged
|
||||
emit changed when @increase_spinBox value changed
|
||||
*/
|
||||
void NumPartEditorW::on_increase_spinBox_valueChanged(int) {
|
||||
if (!ui -> value_field -> text().isEmpty()) emit changed();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief NumPartEditorW::setType
|
||||
* Set good behavior by type @t
|
||||
* @param t, type used
|
||||
* @param fnum, force the behavior of numeric type
|
||||
*/
|
||||
@brief NumPartEditorW::setType
|
||||
Set good behavior by type @t
|
||||
@param t, type used
|
||||
@param fnum, force the behavior of numeric type
|
||||
*/
|
||||
void NumPartEditorW::setType(NumPartEditorW::type t, bool fnum) {
|
||||
setCurrentIndex(t);
|
||||
|
||||
@@ -285,10 +285,10 @@ void NumPartEditorW::setType(NumPartEditorW::type t, bool fnum) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief NumPartEditorW::setCurrentIndex
|
||||
* Set Current Index of type_cb
|
||||
* @param t, type used
|
||||
*/
|
||||
@brief NumPartEditorW::setCurrentIndex
|
||||
Set Current Index of type_cb
|
||||
@param t, type used
|
||||
*/
|
||||
void NumPartEditorW::setCurrentIndex(NumPartEditorW::type t) {
|
||||
int i=-1;
|
||||
if (t == unit)
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
*This class represent a single part num widget. By this widget, we can define and edit
|
||||
*how the num auto must work .
|
||||
*This widget is called by selectautonumw.
|
||||
*/
|
||||
*/
|
||||
namespace Ui {
|
||||
class NumPartEditorW;
|
||||
}
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
#include "assignvariables.h"
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Constructor
|
||||
*/
|
||||
SelectAutonumW::SelectAutonumW(int type, QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::SelectAutonumW),
|
||||
@@ -72,17 +72,17 @@ SelectAutonumW::SelectAutonumW(const NumerotationContext &context, int type, QWi
|
||||
}
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
Destructor
|
||||
*/
|
||||
SelectAutonumW::~SelectAutonumW()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief SelectAutonumW::setCurrentContext
|
||||
* build the context of current diagram selected in the @diagram_chooser QcomboBox
|
||||
*/
|
||||
@brief SelectAutonumW::setCurrentContext
|
||||
build the context of current diagram selected in the @diagram_chooser QcomboBox
|
||||
*/
|
||||
void SelectAutonumW::setContext(const NumerotationContext &context) {
|
||||
m_context = context;
|
||||
|
||||
@@ -109,9 +109,9 @@ void SelectAutonumW::setContext(const NumerotationContext &context) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief SelectAutonumW::toNumContext
|
||||
* @return the content to @num_part_list to NumerotationContext
|
||||
*/
|
||||
@brief SelectAutonumW::toNumContext
|
||||
@return the content to @num_part_list to NumerotationContext
|
||||
*/
|
||||
NumerotationContext SelectAutonumW::toNumContext() const {
|
||||
NumerotationContext nc;
|
||||
foreach (NumPartEditorW *npew, num_part_list_) nc << npew -> toNumContext();
|
||||
@@ -119,9 +119,9 @@ NumerotationContext SelectAutonumW::toNumContext() const {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief SelectAutonumW::on_add_button_clicked
|
||||
@brief SelectAutonumW::on_add_button_clicked
|
||||
* Action on add_button, add a @NumPartEditor
|
||||
*/
|
||||
*/
|
||||
void SelectAutonumW::on_add_button_clicked()
|
||||
{
|
||||
applyEnable(false);
|
||||
@@ -133,9 +133,9 @@ void SelectAutonumW::on_add_button_clicked()
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief SelectAutonumW::on_remove_button_clicked
|
||||
@brief SelectAutonumW::on_remove_button_clicked
|
||||
* Action on remove button, remove the last @NumPartEditor
|
||||
*/
|
||||
*/
|
||||
void SelectAutonumW::on_remove_button_clicked() {
|
||||
//remove if @num_part_list contains more than one item
|
||||
if (num_part_list_.size() > 1) {
|
||||
@@ -150,9 +150,9 @@ void SelectAutonumW::on_remove_button_clicked() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief SelectAutonumW::formula
|
||||
* @return autonumbering widget formula
|
||||
*/
|
||||
@brief SelectAutonumW::formula
|
||||
@return autonumbering widget formula
|
||||
*/
|
||||
QString SelectAutonumW::formula()
|
||||
{
|
||||
if (m_edited_type == 0)
|
||||
@@ -169,9 +169,9 @@ QComboBox *SelectAutonumW::contextComboBox() const
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief SelectAutonumW::on_buttonBox_clicked
|
||||
* Action on @buttonBox clicked
|
||||
*/
|
||||
@brief SelectAutonumW::on_buttonBox_clicked
|
||||
Action on @buttonBox clicked
|
||||
*/
|
||||
void SelectAutonumW::on_buttonBox_clicked(QAbstractButton *button) {
|
||||
//transform button to int
|
||||
int answer = ui -> buttonBox -> buttonRole(button);
|
||||
@@ -233,9 +233,9 @@ void SelectAutonumW::on_buttonBox_clicked(QAbstractButton *button) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief SelectAutonumW::applyEnable
|
||||
* enable/disable the apply button
|
||||
*/
|
||||
@brief SelectAutonumW::applyEnable
|
||||
enable/disable the apply button
|
||||
*/
|
||||
void SelectAutonumW::applyEnable(bool b) {
|
||||
if (b){
|
||||
bool valid= true;
|
||||
@@ -252,9 +252,9 @@ void SelectAutonumW::applyEnable(bool b) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief SelectAutonumW::contextToFormula
|
||||
* Apply formula to ElementAutonumbering Widget
|
||||
*/
|
||||
@brief SelectAutonumW::contextToFormula
|
||||
Apply formula to ElementAutonumbering Widget
|
||||
*/
|
||||
void SelectAutonumW::contextToFormula()
|
||||
{
|
||||
FormulaAutonumberingW* m_faw = nullptr;
|
||||
@@ -271,9 +271,9 @@ void SelectAutonumW::contextToFormula()
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief SelectAutonumW::on_m_next_pb_clicked
|
||||
* Increase NumerotationContext
|
||||
*/
|
||||
@brief SelectAutonumW::on_m_next_pb_clicked
|
||||
Increase NumerotationContext
|
||||
*/
|
||||
void SelectAutonumW::on_m_next_pb_clicked()
|
||||
{
|
||||
NumerotationContextCommands ncc (toNumContext());
|
||||
@@ -282,9 +282,9 @@ void SelectAutonumW::on_m_next_pb_clicked()
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief SelectAutonumW::on_m_previous_pb_clicked
|
||||
* Decrease NumerotationContext
|
||||
*/
|
||||
@brief SelectAutonumW::on_m_previous_pb_clicked
|
||||
Decrease NumerotationContext
|
||||
*/
|
||||
void SelectAutonumW::on_m_previous_pb_clicked()
|
||||
{
|
||||
NumerotationContextCommands ncc (toNumContext());
|
||||
|
||||
Reference in New Issue
Block a user