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:
@@ -115,7 +115,7 @@ void ElementPropertiesEditorWidget::upDateInterface()
|
|||||||
*/
|
*/
|
||||||
void ElementPropertiesEditorWidget::setUpInterface()
|
void ElementPropertiesEditorWidget::setUpInterface()
|
||||||
{
|
{
|
||||||
// Type combo box
|
// Type combo box
|
||||||
ui->m_base_type_cb->addItem (tr("Simple"), ElementData::Simple);
|
ui->m_base_type_cb->addItem (tr("Simple"), ElementData::Simple);
|
||||||
ui->m_base_type_cb->addItem (tr("Maître"), ElementData::Master);
|
ui->m_base_type_cb->addItem (tr("Maître"), ElementData::Master);
|
||||||
ui->m_base_type_cb->addItem (tr("Esclave"), ElementData::Slave);
|
ui->m_base_type_cb->addItem (tr("Esclave"), ElementData::Slave);
|
||||||
@@ -123,7 +123,7 @@ void ElementPropertiesEditorWidget::setUpInterface()
|
|||||||
ui->m_base_type_cb->addItem (tr("Renvoi de folio précédent"), ElementData::PreviousReport);
|
ui->m_base_type_cb->addItem (tr("Renvoi de folio précédent"), ElementData::PreviousReport);
|
||||||
ui->m_base_type_cb->addItem (tr("Bornier"), ElementData::Terminale);
|
ui->m_base_type_cb->addItem (tr("Bornier"), ElementData::Terminale);
|
||||||
|
|
||||||
// Slave option
|
// Slave option
|
||||||
ui->m_state_cb->addItem(tr("Normalement ouvert"), ElementData::NO);
|
ui->m_state_cb->addItem(tr("Normalement ouvert"), ElementData::NO);
|
||||||
ui->m_state_cb->addItem(tr("Normalement fermé"), ElementData::NC);
|
ui->m_state_cb->addItem(tr("Normalement fermé"), ElementData::NC);
|
||||||
ui->m_state_cb->addItem(tr("Inverseur"), ElementData::SW);
|
ui->m_state_cb->addItem(tr("Inverseur"), ElementData::SW);
|
||||||
@@ -133,24 +133,24 @@ void ElementPropertiesEditorWidget::setUpInterface()
|
|||||||
ui->m_type_cb->addItem(tr("Temporisé repos"), ElementData::DelayOff);
|
ui->m_type_cb->addItem(tr("Temporisé repos"), ElementData::DelayOff);
|
||||||
ui->m_type_cb->addItem(tr("Temporisé travail & repos"), ElementData::delayOnOff);
|
ui->m_type_cb->addItem(tr("Temporisé travail & repos"), ElementData::delayOnOff);
|
||||||
|
|
||||||
//Master option
|
//Master option
|
||||||
ui->m_master_type_cb->addItem(tr("Bobine"), ElementData::Coil);
|
ui->m_master_type_cb->addItem(tr("Bobine"), ElementData::Coil);
|
||||||
ui->m_master_type_cb->addItem(tr("Organe de protection"), ElementData::Protection);
|
ui->m_master_type_cb->addItem(tr("Organe de protection"), ElementData::Protection);
|
||||||
ui->m_master_type_cb->addItem(tr("Commutateur / bouton"), ElementData::Commutator);
|
ui->m_master_type_cb->addItem(tr("Commutateur / bouton"), ElementData::Commutator);
|
||||||
|
|
||||||
//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
|
||||||
ui->m_tree->setItemDelegate(new EditorDelegate(this));
|
ui->m_tree->setItemDelegate(new EditorDelegate(this));
|
||||||
ui->m_tree->header()->resizeSection(0, 150);
|
ui->m_tree->header()->resizeSection(0, 150);
|
||||||
populateTree();
|
populateTree();
|
||||||
|
|||||||
@@ -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