mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-23 15:34:12 +02:00
29a8f018f4
The strip graphic fanned the wires out again after the cable, which shows each core leaving the cable but says nothing about where it is going -- the far end was unnamed. Keep the bundle together at the end now: a short stub and a box with the Installation, Location and Label (BMK) of the piece the cable lands on, the same three fields the cable list computes for a target (cablelistrows.cpp), so the strip and the list can never disagree. The target is the first piece past the strip's own terminals the wires of the cable land on, in plan order; a report is no arrival (the cable continues on the linked sheet), several cores on one piece are one landing, and a cable which lands on nothing but the strip itself gets no box. The lines shrink to the end zone the Terminal plan settings give (Cable end length), so the box never grows past the strip the bounding rect reserved. RealTerminal::cableTarget() works the whole out: the cable is the one the wires drawn to the terminal carry, a name typed by hand is looked up among the cables of the project, and the box is drawn for the first wire of the cable group. tst_cabletarget checks the value rule (own strip no target, spare no target, no cable no target) and that painting with and without a target gives two different pictures.
90 lines
2.6 KiB
C++
90 lines
2.6 KiB
C++
/*
|
|
Copyright 2006-2026 The QElectroTech Team
|
|
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/>.
|
|
*/
|
|
#ifndef TRUETERMINALSTRIP_H
|
|
#define TRUETERMINALSTRIP_H
|
|
|
|
#include "terminalstripdrawer.h"
|
|
|
|
class TerminalStrip;
|
|
class PhysicalTerminal;
|
|
class RealTerminal;
|
|
class TerminalStripBridge;
|
|
|
|
namespace TerminalStripDrawer
|
|
{
|
|
class TrueTerminalStrip : public AbstractTerminalStripInterface
|
|
{
|
|
public:
|
|
TrueTerminalStrip(TerminalStrip *strip);
|
|
|
|
QString installation() const override;
|
|
QString location() const override;
|
|
QString name() const override;
|
|
QVector<QSharedPointer<AbstractPhysicalTerminalInterface>> physicalTerminal() const override;
|
|
|
|
private:
|
|
QPointer<TerminalStrip> m_strip;
|
|
};
|
|
|
|
class TruePhysicalTerminal : public AbstractPhysicalTerminalInterface
|
|
{
|
|
public:
|
|
TruePhysicalTerminal(QSharedPointer<PhysicalTerminal> physical);
|
|
QVector<QSharedPointer<AbstractRealTerminalInterface>> realTerminals() const override;
|
|
|
|
private:
|
|
QSharedPointer<PhysicalTerminal> m_physical;
|
|
};
|
|
|
|
class TrueRealTerminal : public AbstractRealTerminalInterface
|
|
{
|
|
public:
|
|
TrueRealTerminal(QSharedPointer<RealTerminal> real);
|
|
QString label() const override;
|
|
bool isBridged() const override;
|
|
AbstractBridgeInterface* bridge() const override;
|
|
QString xref() const override;
|
|
ElementData::TerminalType type() const override;
|
|
bool isLed() const override;
|
|
QString cable() const override;
|
|
QString cableWire() const override;
|
|
bool isShield() const override;
|
|
QVector<QString> cableTarget() const override;
|
|
QColor color() const override;
|
|
QColor stripeColor() const override;
|
|
qreal widthMm() const override;
|
|
QString catalogEntry() const override;
|
|
bool hasSeparatorAfter() const override;
|
|
|
|
private:
|
|
QSharedPointer<RealTerminal> m_real;
|
|
};
|
|
|
|
class TrueBridge : public AbstractBridgeInterface
|
|
{
|
|
public:
|
|
TrueBridge(QSharedPointer<TerminalStripBridge> bridge);
|
|
QUuid uuid() const override;
|
|
|
|
private:
|
|
QSharedPointer<TerminalStripBridge> m_bridge;
|
|
};
|
|
}
|
|
|
|
#endif // TRUETERMINALSTRIP_H
|