mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-20 16:20:52 +01:00
Change ElementData enum
Change enum value 'ground' from enum 'function' to enum 'type'
This commit is contained in:
@@ -140,14 +140,14 @@ void ElementPropertiesEditorWidget::setUpInterface()
|
|||||||
|
|
||||||
//Terminal option
|
//Terminal option
|
||||||
ui->m_terminal_type_cb->addItem(tr("Générique"), ElementData::TTGeneric);
|
ui->m_terminal_type_cb->addItem(tr("Générique"), ElementData::TTGeneric);
|
||||||
ui->m_terminal_type_cb->addItem(tr("Fusible"), ElementData::Fuse);
|
ui->m_terminal_type_cb->addItem(tr("Fusible"), ElementData::TTFuse);
|
||||||
ui->m_terminal_type_cb->addItem(tr("Séctionnable"), ElementData::Sectional);
|
ui->m_terminal_type_cb->addItem(tr("Séctionnable"), ElementData::TTSectional);
|
||||||
ui->m_terminal_type_cb->addItem(tr("Diode"), ElementData::Diode);
|
ui->m_terminal_type_cb->addItem(tr("Diode"), ElementData::TTDiode);
|
||||||
|
ui->m_terminal_type_cb->addItem(tr("Terre"), ElementData::TTGround);
|
||||||
|
|
||||||
ui->m_terminal_func_cb->addItem(tr("Générique"), ElementData::TFGeneric);
|
ui->m_terminal_func_cb->addItem(tr("Générique"), ElementData::TFGeneric);
|
||||||
ui->m_terminal_func_cb->addItem(tr("Phase"), ElementData::Phase);
|
ui->m_terminal_func_cb->addItem(tr("Phase"), ElementData::TFPhase);
|
||||||
ui->m_terminal_func_cb->addItem(tr("Neutre"), ElementData::Neutral);
|
ui->m_terminal_func_cb->addItem(tr("Neutre"), ElementData::TFNeutral);
|
||||||
ui->m_terminal_func_cb->addItem(tr("Terre"), ElementData::PE);
|
|
||||||
|
|
||||||
//Disable the edition of the first column of the information tree
|
//Disable the edition of the first column of the information tree
|
||||||
//by this little workaround
|
//by this little workaround
|
||||||
|
|||||||
@@ -307,26 +307,30 @@ QString ElementData::terminalTypeToString(ElementData::TerminalType type)
|
|||||||
{
|
{
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case ElementData::TTGeneric :
|
case ElementData::TTGeneric :
|
||||||
return QString("generic");
|
return QStringLiteral("generic");
|
||||||
case ElementData::Fuse :
|
case ElementData::TTFuse :
|
||||||
return QString("fuse");
|
return QStringLiteral("fuse");
|
||||||
case ElementData::Sectional:
|
case ElementData::TTSectional:
|
||||||
return QString("sectional");
|
return QStringLiteral("sectional");
|
||||||
case ElementData::Diode:
|
case ElementData::TTDiode:
|
||||||
return QString("diode");
|
return QStringLiteral("diode");
|
||||||
|
case ElementData::TTGround:
|
||||||
|
return QStringLiteral("ground");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ElementData::TerminalType ElementData::terminalTypeFromString(const QString &string)
|
ElementData::TerminalType ElementData::terminalTypeFromString(const QString &string)
|
||||||
{
|
{
|
||||||
if (string == "generic") {
|
if (string == QLatin1String("generic")) {
|
||||||
return ElementData::TTGeneric;
|
return ElementData::TTGeneric;
|
||||||
} else if (string == "fuse") {
|
} else if (string == QLatin1String("fuse")) {
|
||||||
return ElementData::Fuse;
|
return ElementData::TTFuse;
|
||||||
} else if (string == "sectional") {
|
} else if (string == QLatin1String("sectional")) {
|
||||||
return ElementData::Sectional;
|
return ElementData::TTSectional;
|
||||||
} else if (string == "diode") {
|
} else if (string == QLatin1String("diode")) {
|
||||||
return ElementData::Diode;
|
return ElementData::TTDiode;
|
||||||
|
} else if (string == QLatin1String("ground")) {
|
||||||
|
return ElementData::TTGround;
|
||||||
}
|
}
|
||||||
|
|
||||||
qDebug() << "ElementData::terminalTypeFromString : string : "
|
qDebug() << "ElementData::terminalTypeFromString : string : "
|
||||||
@@ -340,12 +344,10 @@ QString ElementData::terminalFunctionToString(ElementData::TerminalFunction func
|
|||||||
switch (function) {
|
switch (function) {
|
||||||
case ElementData::TFGeneric:
|
case ElementData::TFGeneric:
|
||||||
return QString("generic");
|
return QString("generic");
|
||||||
case ElementData::Phase:
|
case ElementData::TFPhase:
|
||||||
return QString ("phase");
|
return QString ("phase");
|
||||||
case ElementData::Neutral:
|
case ElementData::TFNeutral:
|
||||||
return QString("neutral");
|
return QString("neutral");
|
||||||
case ElementData::PE:
|
|
||||||
return QString("pe");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -354,11 +356,9 @@ ElementData::TerminalFunction ElementData::terminalFunctionFromString(const QStr
|
|||||||
if (string == "generic") {
|
if (string == "generic") {
|
||||||
return ElementData::TFGeneric;
|
return ElementData::TFGeneric;
|
||||||
} else if (string == "phase") {
|
} else if (string == "phase") {
|
||||||
return ElementData::Phase;
|
return ElementData::TFPhase;
|
||||||
} else if (string == "neutral") {
|
} else if (string == "neutral") {
|
||||||
return ElementData::Neutral;
|
return ElementData::TFNeutral;
|
||||||
} else if (string == "pe") {
|
|
||||||
return ElementData::PE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
qDebug() << "ElementData::terminalFunctionFromString : string : "
|
qDebug() << "ElementData::terminalFunctionFromString : string : "
|
||||||
|
|||||||
@@ -68,17 +68,17 @@ class ElementData : public PropertiesInterface
|
|||||||
|
|
||||||
enum TerminalType {
|
enum TerminalType {
|
||||||
TTGeneric,
|
TTGeneric,
|
||||||
Fuse,
|
TTFuse,
|
||||||
Sectional,
|
TTSectional,
|
||||||
Diode
|
TTDiode,
|
||||||
|
TTGround
|
||||||
};
|
};
|
||||||
Q_ENUM(TerminalType)
|
Q_ENUM(TerminalType)
|
||||||
|
|
||||||
enum TerminalFunction {
|
enum TerminalFunction {
|
||||||
TFGeneric,
|
TFGeneric,
|
||||||
Phase,
|
TFPhase,
|
||||||
Neutral,
|
TFNeutral,
|
||||||
PE
|
|
||||||
};
|
};
|
||||||
Q_ENUM(TerminalFunction)
|
Q_ENUM(TerminalFunction)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user