QElectroTech  0.8-dev
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 Member Functions

 TerminalData ()
 
 TerminalData (QGraphicsObject *parent)
 
 ~TerminalData ()
 
void init ()
 
void setParent (QGraphicsObject *parent)
 TerminalData::setParent. More...
 
void toSettings (QSettings &settings, const QString prefix=QString()) const override
 TerminalData::toSettings Save properties to setting file. More...
 
void fromSettings (const QSettings &settings, const QString prefix=QString()) override
 TerminalData::fromSettings load properties to setting file. More...
 
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. More...
 
bool fromXml (const QDomElement &xml_element) override
 TerminalData::fromXml load properties to xml element. More...
 
- Public Member Functions inherited from PropertiesInterface
 PropertiesInterface ()
 PropertiesInterface::PropertiesInterface. More...
 
virtual ~PropertiesInterface ()
 PropertiesInterface::~PropertiesInterface. More...
 

Public Attributes

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

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

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 ( )

Member Function Documentation

◆ fromSettings()

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

TerminalData::fromSettings load properties to setting file.

QString is use for prefix a word befor the name of each paramètre

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 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 setting file.

QString is use for prefix a word befor the name of each paramètre

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 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:

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_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

◆ second_point

QPointF TerminalData::second_point

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


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