mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-20 16:20:52 +01:00
Terminal : remove unused code
This commit is contained in:
@@ -21,7 +21,7 @@ class TerminalData : public PropertiesInterface
|
||||
public:
|
||||
TerminalData();
|
||||
TerminalData(QGraphicsObject* parent);
|
||||
~TerminalData();
|
||||
~TerminalData() override;
|
||||
|
||||
void init();
|
||||
|
||||
|
||||
@@ -41,8 +41,7 @@ const qreal Terminal::Z = 1000;
|
||||
@param name of terminal
|
||||
@param hiddenName
|
||||
*/
|
||||
void Terminal::init(
|
||||
QString number, QString name, bool hiddenName)
|
||||
void Terminal::init()
|
||||
{
|
||||
hovered_color_ = Terminal::neutralColor;
|
||||
|
||||
@@ -55,12 +54,6 @@ void Terminal::init(
|
||||
case Qet::South:
|
||||
default : dock_elmt_ += QPointF(0, -Terminal::terminalSize);
|
||||
}
|
||||
// Number of terminal
|
||||
number_terminal_ = std::move(number);
|
||||
// Name of terminal
|
||||
name_terminal_ = std::move(name);
|
||||
name_terminal_hidden = hiddenName;
|
||||
// par defaut : pas de conducteur
|
||||
|
||||
// QRectF null
|
||||
br_ = new QRectF();
|
||||
@@ -82,12 +75,7 @@ void Terminal::init(
|
||||
\param name
|
||||
\param hiddenName
|
||||
*/
|
||||
void Terminal::init(
|
||||
QPointF pf,
|
||||
Qet::Orientation o,
|
||||
QString number,
|
||||
QString name,
|
||||
bool hiddenName)
|
||||
void Terminal::init(QPointF pf, Qet::Orientation o)
|
||||
{
|
||||
// definition du pount d'amarrage pour un conducteur
|
||||
d->m_pos = pf;
|
||||
@@ -96,7 +84,7 @@ void Terminal::init(
|
||||
if (o < Qet::North || o > Qet::West) d->m_orientation = Qet::South;
|
||||
else d->m_orientation = o;
|
||||
|
||||
init(number, name, hiddenName);
|
||||
init();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -110,7 +98,7 @@ Terminal::Terminal(QPointF pf, Qet::Orientation o, Element *e) :
|
||||
d(new TerminalData(this)),
|
||||
parent_element_ (e)
|
||||
{
|
||||
init(pf, o, "_", "_", false);
|
||||
init(pf, o);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -125,30 +113,7 @@ Terminal::Terminal(qreal pf_x, qreal pf_y, Qet::Orientation o, Element *e) :
|
||||
d(new TerminalData(this)),
|
||||
parent_element_ (e)
|
||||
{
|
||||
init(QPointF(pf_x, pf_y), o, "_", "_", false);
|
||||
}
|
||||
|
||||
/**
|
||||
initialise une borne
|
||||
@param pf position du point d'amarrage pour un conducteur
|
||||
@param o orientation de la borne : Qt::Horizontal ou Qt::Vertical
|
||||
@param num number of terminal (ex 3 - 4 for NO)
|
||||
@param name of terminal
|
||||
@param hiddenName hide or show the name
|
||||
@param e Element auquel cette borne appartient
|
||||
*/
|
||||
Terminal::Terminal(
|
||||
QPointF pf,
|
||||
Qet::Orientation o,
|
||||
QString num,
|
||||
QString name,
|
||||
bool hiddenName,
|
||||
Element *e) :
|
||||
QGraphicsObject (e),
|
||||
d(new TerminalData(this)),
|
||||
parent_element_ (e)
|
||||
{
|
||||
init(pf, o, std::move(num), std::move(name), hiddenName);
|
||||
init(QPointF(pf_x, pf_y), o);
|
||||
}
|
||||
|
||||
Terminal::Terminal(TerminalData* data, Element* e) :
|
||||
@@ -161,7 +126,7 @@ Terminal::Terminal(TerminalData* data, Element* e) :
|
||||
#endif
|
||||
// TODO: what is when multiple parents exist. So the other relation is lost.
|
||||
d->setParent(this);
|
||||
init("_", "_", false);
|
||||
init();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -198,27 +163,6 @@ Qet::Orientation Terminal::orientation() const
|
||||
} else return(d->m_orientation);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@brief Terminal::setNumber
|
||||
@param number
|
||||
*/
|
||||
void Terminal::setNumber(QString number)
|
||||
{
|
||||
number_terminal_ = std::move(number);
|
||||
}
|
||||
|
||||
/**
|
||||
@brief Terminal::setName
|
||||
@param name : QString
|
||||
@param hiddenName : bool
|
||||
*/
|
||||
void Terminal::setName(QString name, bool hiddenName)
|
||||
{
|
||||
name_terminal_ = std::move(name);
|
||||
name_terminal_hidden = hiddenName;
|
||||
}
|
||||
|
||||
/**
|
||||
@brief Terminal::addConductor
|
||||
Add a conductor to this terminal
|
||||
@@ -771,9 +715,6 @@ QDomElement Terminal::toXml(QDomDocument &doc) const
|
||||
// end for backward compatibility
|
||||
|
||||
qdo.setAttribute("orientation", d->m_orientation);
|
||||
qdo.setAttribute("number", number_terminal_);
|
||||
qdo.setAttribute("name", name_terminal_);
|
||||
qdo.setAttribute("nameHidden", name_terminal_hidden);
|
||||
return(qdo);
|
||||
}
|
||||
|
||||
@@ -828,10 +769,6 @@ bool Terminal::valideXml(QDomElement &terminal)
|
||||
*/
|
||||
bool Terminal::fromXml(QDomElement &terminal)
|
||||
{
|
||||
number_terminal_ = terminal.attribute("number");
|
||||
name_terminal_ = terminal.attribute("name");
|
||||
name_terminal_hidden = terminal.attribute("nameHidden").toInt();
|
||||
|
||||
return (
|
||||
qFuzzyCompare(terminal.attribute("x").toDouble(), dock_elmt_.x()) &&
|
||||
qFuzzyCompare(terminal.attribute("y").toDouble(), dock_elmt_.y()) &&
|
||||
|
||||
@@ -45,8 +45,6 @@ class Terminal : public QGraphicsObject
|
||||
Terminal(QPointF, Qet::Orientation, Element * = nullptr);
|
||||
Terminal(qreal, qreal, Qet::Orientation, Element * = nullptr);
|
||||
Terminal(TerminalData* data, Element *e = nullptr);
|
||||
Terminal(QPointF, Qet::Orientation, QString number,
|
||||
QString name, bool hiddenName, Element * = nullptr);
|
||||
~Terminal() override;
|
||||
|
||||
private:
|
||||
@@ -82,10 +80,6 @@ class Terminal : public QGraphicsObject
|
||||
QList<Conductor *> conductors() const;
|
||||
Qet::Orientation orientation() const;
|
||||
QPointF dockConductor() const;
|
||||
QString number() const;
|
||||
QString name() const;
|
||||
void setNumber(QString number);
|
||||
void setName(QString name, bool hiddenName);
|
||||
void updateConductor();
|
||||
bool isLinkedTo(Terminal *);
|
||||
bool canBeLinkedTo(Terminal *);
|
||||
@@ -148,16 +142,10 @@ class Terminal : public QGraphicsObject
|
||||
bool hovered_;
|
||||
/// Color used for the hover effect
|
||||
QColor hovered_color_;
|
||||
/// Number of Terminal
|
||||
QString number_terminal_;
|
||||
/// Name of Terminal
|
||||
QString name_terminal_;
|
||||
bool name_terminal_hidden;
|
||||
|
||||
private:
|
||||
void init(QString number, QString name, bool hiddenName);
|
||||
void init(QPointF pf, Qet::Orientation o, QString number,
|
||||
QString name, bool hiddenName);
|
||||
void init();
|
||||
void init(QPointF pf, Qet::Orientation o);
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -169,24 +157,6 @@ inline int Terminal::conductorsCount() const
|
||||
return(conductors_.size());
|
||||
}
|
||||
|
||||
/**
|
||||
@brief Terminal::number
|
||||
@return the number of terminal.
|
||||
*/
|
||||
inline QString Terminal::number() const
|
||||
{
|
||||
return(number_terminal_);
|
||||
}
|
||||
|
||||
/**
|
||||
@brief Terminal::name
|
||||
@return the name of terminal.
|
||||
*/
|
||||
inline QString Terminal::name() const
|
||||
{
|
||||
return(name_terminal_);
|
||||
}
|
||||
|
||||
QList<Terminal *> relatedPotentialTerminal (const Terminal *terminal,
|
||||
const bool all_diagram = true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user