QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Private Attributes | List of all members
TerminalData Class Reference

The TerminalData class Data of the terminal. Stored in extra class so it can be used by PartTerminal and Terminal without defining everything again. More...

#include <terminaldata.h>

Inheritance diagram for TerminalData:
Inheritance graph
Collaboration diagram for TerminalData:
Collaboration graph

Public Types

enum  Type { Generic , Inner , Outer }
 

Public Member Functions

 TerminalData ()
 
 TerminalData (QGraphicsObject *parent)
 
 ~TerminalData () override
 
void init ()
 
void setParent (QGraphicsObject *parent)
 TerminalData::setParent.
 
void toSettings (QSettings &settings, const QString prefix=QString()) const override
 TerminalData::toSettings Save properties to settings file.
 
void fromSettings (const QSettings &settings, const QString prefix=QString()) override
 TerminalData::fromSettings load properties to settings file.
 
QDomElement toXml (QDomDocument &xml_element) const override
 TerminalData::toXml Save properties to xml element write the name, number, position and orientation of the terminal to xml_element.
 
bool fromXml (const QDomElement &xml_element) override
 TerminalData::fromXml load properties to xml element.
 
- Public Member Functions inherited from PropertiesInterface
 PropertiesInterface ()
 PropertiesInterface::PropertiesInterface.
 
virtual ~PropertiesInterface ()
 PropertiesInterface::~PropertiesInterface.
 

Static Public Member Functions

static QString typeToString (TerminalData::Type type)
 TerminalData::typeToString.
 
static TerminalData::Type typeFromString (const QString &string)
 TerminalData::typeFromString.
 

Public Attributes

Qet::Orientation m_orientation
 m_orientation Orientation of the terminal
 
QPointF m_second_point
 second_point Position of the second point of the terminal in scene coordinates
 
QUuid m_uuid
 m_uuid Uuid of the terminal.
 
QString m_name
 m_name Name of the element. It can be used to create wiring harness tables
 
QPointF m_pos
 m_pos Position of the terminal. The second point is calculated from this position and the orientation
 
TerminalData::Type m_type = TerminalData::Generic
 

Private Attributes

QGraphicsObject * q {nullptr}
 

Detailed Description

The TerminalData class Data of the terminal. Stored in extra class so it can be used by PartTerminal and Terminal without defining everything again.

Note
tis class needs to be work on

Member Enumeration Documentation

◆ Type

Enumerator
Generic 
Inner 
Outer 

Constructor & Destructor Documentation

◆ TerminalData() [1/2]

TerminalData::TerminalData ( )
Here is the call graph for this function:

◆ TerminalData() [2/2]

TerminalData::TerminalData ( QGraphicsObject *  parent)
Here is the call graph for this function:

◆ ~TerminalData()

TerminalData::~TerminalData ( )
override

Member Function Documentation

◆ fromSettings()

void TerminalData::fromSettings ( const QSettings &  settings,
const QString  prefix = QString() 
)
overridevirtual

TerminalData::fromSettings load properties to settings file.

QString is used to prefix a word before the name of each parameter

Parameters
settingsUNUSED
prefixUNUSED

Implements PropertiesInterface.

◆ fromXml()

bool TerminalData::fromXml ( const QDomElement &  xml_element)
overridevirtual

TerminalData::fromXml load properties to xml element.

Note
This method is only called from the PartTerminal and should never be called from the Terminal class
Parameters
xml_element
Returns
true if succeeded / false if the attribute is not real

Implements PropertiesInterface.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init()

void TerminalData::init ( )
Here is the caller graph for this function:

◆ setParent()

void TerminalData::setParent ( QGraphicsObject *  parent)

TerminalData::setParent.

Parameters
parent
Here is the caller graph for this function:

◆ toSettings()

void TerminalData::toSettings ( QSettings &  settings,
const QString  prefix = QString() 
) const
overridevirtual

TerminalData::toSettings Save properties to settings file.

QString is used to prefix a word before the name of each parameter

Parameters
settingsUNUSED
prefixUNUSED

Implements PropertiesInterface.

◆ toXml()

QDomElement TerminalData::toXml ( QDomDocument &  xml_document) const
overridevirtual

TerminalData::toXml Save properties to xml element write the name, number, position and orientation of the terminal to xml_element.

Note
This method is only called from the PartTerminal and should never be called from the Terminal class
Parameters
xml_document
Returns
xml_element : DomElement with the name, number, position and orientation of the terminal

Implements PropertiesInterface.

Here is the call graph for this function:

◆ typeFromString()

TerminalData::Type TerminalData::typeFromString ( const QString &  string)
static

TerminalData::typeFromString.

Parameters
string
Returns
The type describe in string to TerminalData::Type. if string doesn't describe a type, TerminalData::Generic is returned
Here is the caller graph for this function:

◆ typeToString()

QString TerminalData::typeToString ( TerminalData::Type  type)
static

TerminalData::typeToString.

Parameters
type
Returns
type into a QString
Here is the caller graph for this function:

Member Data Documentation

◆ m_name

QString TerminalData::m_name

m_name Name of the element. It can be used to create wiring harness tables

◆ m_orientation

Qet::Orientation TerminalData::m_orientation

m_orientation Orientation of the terminal

◆ m_pos

QPointF TerminalData::m_pos

m_pos Position of the terminal. The second point is calculated from this position and the orientation

Note
Important: this variable is only updated during read from xml and not during mouse move! It is used to store the initial position so that PartTerminal and Terminal have access to it.

◆ m_second_point

QPointF TerminalData::m_second_point

second_point Position of the second point of the terminal in scene coordinates

◆ m_type

TerminalData::Type TerminalData::m_type = TerminalData::Generic

◆ m_uuid

QUuid TerminalData::m_uuid

m_uuid Uuid of the terminal.

In elementscene.cpp an element gets a new uuid when saving the element. In the current state each connection is made by using the local position of the terminal and a dynamic id. In the new case, each terminal should have it's own uuid to identify it uniquely. When changing each time this uuid, the conductor after updating the part is anymore valid. So if in the loaded document a uuid exists, use this one and don't create a new one.

◆ q

QGraphicsObject* TerminalData::q {nullptr}
private

The documentation for this class was generated from the following files: