QElectroTech 0.200.1-dev
Loading...
Searching...
No Matches
ElementData Class Reference

The ElementData class WARNING This class inherit from PropertiesInterface but only fromXml is actually reimplemented. More...

#include <elementdata.h>

Inheritance diagram for ElementData:
Inheritance graph
Collaboration diagram for ElementData:
Collaboration graph

Classes

struct  PlcIO
 The PlcIO struct Represents a single IO entry in a PLC master element. More...
struct  PlcMasterData
 The PlcMasterData struct Stores all PLC master configuration: IO table, display settings, column visibility. All data is stored in the .elmt file for easy sharing between users. More...
struct  SlaveContactGroup
 The SlaveContactGroup struct Defines a contact group that a master element provides for slave elements. Each group specifies the type, subtype, number of displayed contacts, number of terminals, and the labels for each terminal (T1-T20). More...

Public Types

enum  Type {
  Simple = 1 , NextReport = 2 , PreviousReport = 4 , AllReport = 6 ,
  Master = 8 , Slave = 16 , Terminal = 32 , Thumbnail = 64 ,
  ConductorDefinition = 128
}
enum  MasterType { Coil , Protection , Commutator , PLC }
enum  SlaveType {
  SSimple , Power , DelayOn , DelayOff ,
  delayOnOff , PLCSlave
}
enum  SlaveState { NO , NC , SW , Other }
enum  PlcIOType {
  EntreeDigitale , SortieDigitale , EntreeAnalogique , SortieAnalogique ,
  EntreeUniverselle , SortieUniverselle
}
enum  TerminalType {
  TTGeneric , TTFuse , TTSectional , TTDiode ,
  TTGround
}
enum  TerminalFunction { TFGeneric , TFPhase , TFNeutral }

Public Member Functions

 ElementData ()
 ~ElementData () override
void toSettings (QSettings &settings, const QString prefix=QString()) const override
 toSettings Save properties to setting file.
void fromSettings (const QSettings &settings, const QString prefix=QString()) override
 fromSettings load properties to setting file.
QDomElement toXml (QDomDocument &xml_element) const override
 toXml Save properties to xml element
bool fromXml (const QDomElement &xml_element) override
 ElementData::fromXml load properties from xml element. The tag name of xml_element must be definition and have an attribute "type".
QDomElement kindInfoToXml (QDomDocument &document)
QDomElement plcMasterDataToXml (QDomDocument &document) const
 ElementData::plcMasterDataToXml Serialize PLC master data to XML (used by Element::toXml for diagram instances).
void plcMasterDataFromXml (const QDomElement &xml_plc)
 ElementData::plcMasterDataFromXml Deserialize PLC master data from XML.
void setTerminalType (ElementData::TerminalType t_type)
 ElementData::setTerminalType Override the terminal type by t_type.
ElementData::TerminalType terminalType () const
 ElementData::terminalType.
void setTerminalFunction (ElementData::TerminalFunction t_function)
 ElementData::setTerminalFunction Override the terminal function by t_function.
ElementData::TerminalFunction terminalFunction () const
 ElementData::terminalFunction.
void setTerminalLED (bool led)
 ElementData::setTerminalLED Override the terminal led by led.
bool terminalLed () const
 ElementData::terminalLed.
bool terminalPropertiesIsOverrided () const
 ElementData::terminalPropertiesIsOverrided.
bool operator== (const ElementData &data) const
bool operator!= (const ElementData &data) const
QString typeToString () const
QString masterTypeToString () const
PlcMasterData plcMasterData () const
void setPlcMasterData (const PlcMasterData &data)
Public Member Functions inherited from PropertiesInterface
 PropertiesInterface ()
 PropertiesInterface::PropertiesInterface.
virtual ~PropertiesInterface ()
 PropertiesInterface::~PropertiesInterface.

Static Public Member Functions

static QString plcIOTypeToString (PlcIOType type)
 ElementData::plcIOTypeToString Convert a PlcIOType to string for XML storage.
static PlcIOType plcIOTypeFromString (const QString &string)
 ElementData::plcIOTypeFromString Convert a string from XML to PlcIOType.
static QString translatedPlcIOType (PlcIOType type)
 ElementData::translatedPlcIOType Return translated string for PlcIOType.
static QStringList plcIOTypeList ()
 ElementData::plcIOTypeList Return list of all translated PLC IO type strings (for combo boxes).
static QString typeToString (ElementData::Type type)
static ElementData::Type typeFromString (const QString &string)
static QString masterTypeToString (ElementData::MasterType type)
static ElementData::MasterType masterTypeFromString (const QString &string)
static QString slaveTypeToString (ElementData::SlaveType type)
static ElementData::SlaveType slaveTypeFromString (const QString &string)
static QString slaveStateToString (ElementData::SlaveState type)
static ElementData::SlaveState slaveStateFromString (const QString &string)
static QString terminalTypeToString (ElementData::TerminalType type)
static ElementData::TerminalType terminalTypeFromString (const QString &string)
static QString translatedTerminalType (ElementData::TerminalType type)
static QString terminalFunctionToString (ElementData::TerminalFunction function)
static ElementData::TerminalFunction terminalFunctionFromString (const QString &string)
static QString translatedTerminalFunction (ElementData::TerminalFunction function)
static QString slaveContactGroupTypeToString (ElementData::SlaveState type)
 ElementData::slaveContactGroupTypeToString Convert a SlaveState to string for XML storage in slave contact groups. Maps: NO -> "NO", NC -> "NC", SW -> "SW", Other -> "Other".
static ElementData::SlaveState slaveContactGroupTypeFromString (const QString &string)
 ElementData::slaveContactGroupTypeFromString Convert a string from XML to SlaveState for slave contact groups.
static QString slaveContactGroupSubtypeToString (ElementData::SlaveType type)
 ElementData::slaveContactGroupSubtypeToString Convert a SlaveType to string for XML storage in slave contact groups.
static ElementData::SlaveType slaveContactGroupSubtypeFromString (const QString &string)
 ElementData::slaveContactGroupSubtypeFromString Convert a string from XML to SlaveType for slave contact groups.

Public Attributes

ElementData::Type m_type = ElementData::Simple
ElementData::MasterType m_master_type = ElementData::Coil
int m_max_slaves {-1}
bool m_slave_contact_groups_enabled {false}
 Whether slave contact groups table is active.
QVector< SlaveContactGroupm_slave_contact_groups
 Contact groups defined by master.
PlcMasterData m_plc_master_data
 PLC master IO table and display settings.
ElementData::SlaveType m_slave_type = ElementData::SSimple
ElementData::SlaveState m_slave_state = ElementData::NO
ElementData::TerminalType m_terminal_type = ElementData::TTGeneric
ElementData::TerminalFunction m_terminal_function = ElementData::TFGeneric
int m_contact_count {1}
DiagramContext m_informations
NamesList m_names_list
QString m_drawing_information

Private Member Functions

void kindInfoFromXml (const QDomElement &xml_element)

Private Attributes

ElementData::TerminalType m_override_terminal_type = ElementData::TTGeneric
bool m_terminal_type_is_override = false
ElementData::TerminalFunction m_override_terminal_function = ElementData::TFGeneric
bool m_terminal_function_is_override = false
bool m_terminal_led = false
bool m_terminal_led_is_override = false
bool m_override_terminal_led = false

Detailed Description

The ElementData class WARNING This class inherit from PropertiesInterface but only fromXml is actually reimplemented.

Member Enumeration Documentation

◆ MasterType

Enumerator
Coil 
Protection 
Commutator 
PLC 

◆ PlcIOType

Enumerator
EntreeDigitale 
SortieDigitale 
EntreeAnalogique 
SortieAnalogique 
EntreeUniverselle 
SortieUniverselle 

◆ SlaveState

Enumerator
NO 
NC 
SW 
Other 

◆ SlaveType

Enumerator
SSimple 
Power 
DelayOn 
DelayOff 
delayOnOff 
PLCSlave 

◆ TerminalFunction

Enumerator
TFGeneric 
TFPhase 
TFNeutral 

◆ TerminalType

Enumerator
TTGeneric 
TTFuse 
TTSectional 
TTDiode 
TTGround 

◆ Type

Enumerator
Simple 
NextReport 
PreviousReport 
AllReport 
Master 
Slave 
Terminal 
Thumbnail 
ConductorDefinition 

Constructor & Destructor Documentation

◆ ElementData()

ElementData::ElementData ( )
inline
Here is the caller graph for this function:

◆ ~ElementData()

ElementData::~ElementData ( )
inlineoverride

Member Function Documentation

◆ fromSettings()

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

fromSettings load properties to setting file.

Parameters
settings: is use for prefix a word before the name of each parameter
QString

Implements PropertiesInterface.

◆ fromXml()

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

ElementData::fromXml load properties from xml element. The tag name of xml_element must be definition and have an attribute "type".

Parameters
xml_element: tagName must be 'definition'
Returns
true is successfully loaded

Implements PropertiesInterface.

Here is the call graph for this function:

◆ kindInfoFromXml()

void ElementData::kindInfoFromXml ( const QDomElement & xml_element)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ kindInfoToXml()

QDomElement ElementData::kindInfoToXml ( QDomDocument & document)
Here is the call graph for this function:

◆ masterTypeFromString()

ElementData::MasterType ElementData::masterTypeFromString ( const QString & string)
static
Here is the caller graph for this function:

◆ masterTypeToString() [1/2]

QString ElementData::masterTypeToString ( ) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ masterTypeToString() [2/2]

QString ElementData::masterTypeToString ( ElementData::MasterType type)
static

◆ operator!=()

bool ElementData::operator!= ( const ElementData & data) const
Here is the call graph for this function:

◆ operator==()

bool ElementData::operator== ( const ElementData & data) const
Here is the call graph for this function:

◆ plcIOTypeFromString()

ElementData::PlcIOType ElementData::plcIOTypeFromString ( const QString & string)
static

ElementData::plcIOTypeFromString Convert a string from XML to PlcIOType.

Here is the caller graph for this function:

◆ plcIOTypeList()

QStringList ElementData::plcIOTypeList ( )
static

ElementData::plcIOTypeList Return list of all translated PLC IO type strings (for combo boxes).

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

◆ plcIOTypeToString()

QString ElementData::plcIOTypeToString ( PlcIOType type)
static

ElementData::plcIOTypeToString Convert a PlcIOType to string for XML storage.

Here is the caller graph for this function:

◆ plcMasterData()

PlcMasterData ElementData::plcMasterData ( ) const
inline
Here is the caller graph for this function:

◆ plcMasterDataFromXml()

void ElementData::plcMasterDataFromXml ( const QDomElement & xml_plc)

ElementData::plcMasterDataFromXml Deserialize PLC master data from XML.

Here is the call graph for this function:

◆ plcMasterDataToXml()

QDomElement ElementData::plcMasterDataToXml ( QDomDocument & document) const

ElementData::plcMasterDataToXml Serialize PLC master data to XML (used by Element::toXml for diagram instances).

Here is the call graph for this function:

◆ setPlcMasterData()

void ElementData::setPlcMasterData ( const PlcMasterData & data)
inline
Here is the caller graph for this function:

◆ setTerminalFunction()

void ElementData::setTerminalFunction ( ElementData::TerminalFunction t_function)

ElementData::setTerminalFunction Override the terminal function by t_function.

Parameters
t_function

◆ setTerminalLED()

void ElementData::setTerminalLED ( bool led)

ElementData::setTerminalLED Override the terminal led by led.

Parameters
led

◆ setTerminalType()

void ElementData::setTerminalType ( ElementData::TerminalType t_type)

ElementData::setTerminalType Override the terminal type by t_type.

Parameters
t_type

◆ slaveContactGroupSubtypeFromString()

ElementData::SlaveType ElementData::slaveContactGroupSubtypeFromString ( const QString & string)
static

ElementData::slaveContactGroupSubtypeFromString Convert a string from XML to SlaveType for slave contact groups.

Here is the call graph for this function:

◆ slaveContactGroupSubtypeToString()

QString ElementData::slaveContactGroupSubtypeToString ( ElementData::SlaveType type)
static

ElementData::slaveContactGroupSubtypeToString Convert a SlaveType to string for XML storage in slave contact groups.

Here is the call graph for this function:

◆ slaveContactGroupTypeFromString()

ElementData::SlaveState ElementData::slaveContactGroupTypeFromString ( const QString & string)
static

ElementData::slaveContactGroupTypeFromString Convert a string from XML to SlaveState for slave contact groups.

Here is the call graph for this function:

◆ slaveContactGroupTypeToString()

QString ElementData::slaveContactGroupTypeToString ( ElementData::SlaveState type)
static

ElementData::slaveContactGroupTypeToString Convert a SlaveState to string for XML storage in slave contact groups. Maps: NO -> "NO", NC -> "NC", SW -> "SW", Other -> "Other".

Here is the call graph for this function:

◆ slaveStateFromString()

ElementData::SlaveState ElementData::slaveStateFromString ( const QString & string)
static
Here is the caller graph for this function:

◆ slaveStateToString()

QString ElementData::slaveStateToString ( ElementData::SlaveState type)
static
Here is the caller graph for this function:

◆ slaveTypeFromString()

ElementData::SlaveType ElementData::slaveTypeFromString ( const QString & string)
static
Here is the caller graph for this function:

◆ slaveTypeToString()

QString ElementData::slaveTypeToString ( ElementData::SlaveType type)
static
Here is the caller graph for this function:

◆ terminalFunction()

ElementData::TerminalFunction ElementData::terminalFunction ( ) const

ElementData::terminalFunction.

Returns
the terminal function or overrided terminal function if set

◆ terminalFunctionFromString()

ElementData::TerminalFunction ElementData::terminalFunctionFromString ( const QString & string)
static
Here is the caller graph for this function:

◆ terminalFunctionToString()

QString ElementData::terminalFunctionToString ( ElementData::TerminalFunction function)
static
Here is the caller graph for this function:

◆ terminalLed()

bool ElementData::terminalLed ( ) const

ElementData::terminalLed.

Returns
if terminal have led or overrided led if set

◆ terminalPropertiesIsOverrided()

bool ElementData::terminalPropertiesIsOverrided ( ) const

ElementData::terminalPropertiesIsOverrided.

Returns
true if at least one sub properties of terminal type is overrided

◆ terminalType()

ElementData::TerminalType ElementData::terminalType ( ) const

ElementData::terminalType.

Returns
the terminal type or overrided terminal type if set

◆ terminalTypeFromString()

ElementData::TerminalType ElementData::terminalTypeFromString ( const QString & string)
static
Here is the caller graph for this function:

◆ terminalTypeToString()

QString ElementData::terminalTypeToString ( ElementData::TerminalType type)
static
Here is the caller graph for this function:

◆ toSettings()

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

toSettings Save properties to setting file.

Parameters
settings: is use for prefix a word before the name of each parameter
QString

Implements PropertiesInterface.

◆ toXml()

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

toXml Save properties to xml element

Parameters
xml_document
Returns
QDomElement

Implements PropertiesInterface.

◆ translatedPlcIOType()

QString ElementData::translatedPlcIOType ( PlcIOType type)
static

ElementData::translatedPlcIOType Return translated string for PlcIOType.

Here is the caller graph for this function:

◆ translatedTerminalFunction()

QString ElementData::translatedTerminalFunction ( ElementData::TerminalFunction function)
static
Here is the caller graph for this function:

◆ translatedTerminalType()

QString ElementData::translatedTerminalType ( ElementData::TerminalType type)
static
Here is the caller graph for this function:

◆ typeFromString()

ElementData::Type ElementData::typeFromString ( const QString & string)
static
Here is the caller graph for this function:

◆ typeToString() [1/2]

QString ElementData::typeToString ( ) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ typeToString() [2/2]

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

Member Data Documentation

◆ m_contact_count

int ElementData::m_contact_count {1}

◆ m_drawing_information

QString ElementData::m_drawing_information

◆ m_informations

DiagramContext ElementData::m_informations

◆ m_master_type

ElementData::MasterType ElementData::m_master_type = ElementData::Coil

◆ m_max_slaves

int ElementData::m_max_slaves {-1}

◆ m_names_list

NamesList ElementData::m_names_list

◆ m_override_terminal_function

ElementData::TerminalFunction ElementData::m_override_terminal_function = ElementData::TFGeneric
private

◆ m_override_terminal_led

bool ElementData::m_override_terminal_led = false
private

◆ m_override_terminal_type

ElementData::TerminalType ElementData::m_override_terminal_type = ElementData::TTGeneric
private

◆ m_plc_master_data

PlcMasterData ElementData::m_plc_master_data

PLC master IO table and display settings.

◆ m_slave_contact_groups

QVector<SlaveContactGroup> ElementData::m_slave_contact_groups

Contact groups defined by master.

◆ m_slave_contact_groups_enabled

bool ElementData::m_slave_contact_groups_enabled {false}

Whether slave contact groups table is active.

◆ m_slave_state

ElementData::SlaveState ElementData::m_slave_state = ElementData::NO

◆ m_slave_type

ElementData::SlaveType ElementData::m_slave_type = ElementData::SSimple

◆ m_terminal_function

ElementData::TerminalFunction ElementData::m_terminal_function = ElementData::TFGeneric

◆ m_terminal_function_is_override

bool ElementData::m_terminal_function_is_override = false
private

◆ m_terminal_led

bool ElementData::m_terminal_led = false
private

◆ m_terminal_led_is_override

bool ElementData::m_terminal_led_is_override = false
private

◆ m_terminal_type

ElementData::TerminalType ElementData::m_terminal_type = ElementData::TTGeneric

◆ m_terminal_type_is_override

bool ElementData::m_terminal_type_is_override = false
private

◆ m_type

ElementData::Type ElementData::m_type = ElementData::Simple

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