mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
Add new conductors properties color and section
This commit is contained in:
@@ -400,6 +400,8 @@ ConductorProperties SearchAndReplaceWorker::applyChange(const ConductorPropertie
|
||||
new_properties.m_show_text = change.m_show_text;
|
||||
new_properties.m_function = applyChange(new_properties.m_function, change.m_function);
|
||||
new_properties.m_tension_protocol = applyChange(new_properties.m_tension_protocol, change.m_tension_protocol);
|
||||
new_properties.m_wire_color = applyChange(new_properties.m_wire_color, change.m_wire_color);
|
||||
new_properties.m_wire_section = applyChange(new_properties.m_wire_section, change.m_wire_section);
|
||||
if(change.m_vertical_alignment == Qt::AlignLeft ||
|
||||
change.m_vertical_alignment == Qt::AlignRight) {new_properties.m_vertical_alignment = change.m_vertical_alignment;}
|
||||
if(change.m_horizontal_alignment == Qt::AlignTop ||
|
||||
@@ -501,6 +503,8 @@ ConductorProperties SearchAndReplaceWorker::replaceAdvanced(Conductor *conductor
|
||||
else if (what == "text") {properties.text.replace(rx, replace);}
|
||||
else if (what == "function") {properties.m_function.replace(rx, replace);}
|
||||
else if (what == "tension/protocol") {properties.m_tension_protocol.replace(rx, replace);}
|
||||
else if (what == "couleur-conducteur") {properties.m_wire_color.replace(rx, replace);}
|
||||
else if (what == "section-conducteur") {properties.m_wire_section.replace(rx, replace);}
|
||||
}
|
||||
|
||||
return properties;
|
||||
|
||||
@@ -83,6 +83,8 @@ void ReplaceConductorDialog::setProperties(const ConductorProperties &properties
|
||||
sarw::setupLineEdit(ui->m_text_le, ui->m_erase_text_cb, m_properties.text);
|
||||
sarw::setupLineEdit(ui->m_function_le, ui->m_erase_function_cb, m_properties.m_function);
|
||||
sarw::setupLineEdit(ui->m_tension_protocol_le, ui->m_erase_tension_protocol_cb, m_properties.m_tension_protocol);
|
||||
sarw::setupLineEdit(ui->m_wire_color_le, ui->m_erase_wire_color_cb, m_properties.m_wire_color);
|
||||
sarw::setupLineEdit(ui->m_wire_section_le,ui->m_erase_wire_section_cb,m_properties.m_wire_section);
|
||||
switch (m_properties.m_vertical_alignment) {
|
||||
case Qt::AlignLeft: ui->m_vertical_align_cb->setCurrentIndex(1);break;
|
||||
case Qt::AlignRight: ui->m_vertical_align_cb->setCurrentIndex(2);break;
|
||||
@@ -140,6 +142,8 @@ ConductorProperties ReplaceConductorDialog::properties() const
|
||||
properties_.m_show_text = ui->m_show_text->isChecked();
|
||||
properties_.m_function = ui->m_function_le->text();
|
||||
properties_.m_tension_protocol = ui->m_tension_protocol_le->text();
|
||||
properties_.m_wire_color =ui->m_wire_color_le->text();
|
||||
properties_.m_wire_section =ui->m_wire_section_le->text();
|
||||
switch (ui->m_vertical_align_cb->currentIndex()) {
|
||||
case 0: properties_.m_vertical_alignment = Qt::AlignAbsolute; break;
|
||||
case 1: properties_.m_vertical_alignment = Qt::AlignLeft; break;
|
||||
@@ -227,6 +231,18 @@ void ReplaceConductorDialog::on_m_erase_tension_protocol_cb_clicked()
|
||||
ui->m_tension_protocol_le->setDisabled(ui->m_erase_tension_protocol_cb->isChecked());
|
||||
}
|
||||
|
||||
void ReplaceConductorDialog::on_m_erase_m_wire_color_cb_clicked()
|
||||
{
|
||||
ui->m_wire_color_le->setText(ui->m_erase_wire_color_cb->isChecked() ? SearchAndReplaceWorker::eraseText() : QString());
|
||||
ui->m_wire_color_le->setDisabled(ui->m_erase_wire_color_cb->isChecked());
|
||||
}
|
||||
|
||||
void ReplaceConductorDialog::on_m_erase_m_wire_section_cb_clicked()
|
||||
{
|
||||
ui->m_wire_section_le->setText(ui->m_erase_wire_section_cb->isChecked() ? SearchAndReplaceWorker::eraseText() : QString());
|
||||
ui->m_wire_section_le->setDisabled(ui->m_erase_wire_section_cb->isChecked());
|
||||
}
|
||||
|
||||
void ReplaceConductorDialog::on_m_earth_cb_toggled(bool checked)
|
||||
{
|
||||
if (checked && ui->m_neutral_cb -> isChecked()) {
|
||||
|
||||
@@ -51,6 +51,8 @@ class ReplaceConductorDialog : public QDialog
|
||||
void on_m_erase_text_cb_clicked();
|
||||
void on_m_erase_function_cb_clicked();
|
||||
void on_m_erase_tension_protocol_cb_clicked();
|
||||
void on_m_erase_m_wire_color_cb_clicked();
|
||||
void on_m_erase_m_wire_section_cb_clicked();
|
||||
void on_m_earth_cb_toggled(bool checked);
|
||||
void on_m_neutral_cb_toggled(bool checked);
|
||||
void on_m_update_preview_pb_clicked();
|
||||
|
||||
@@ -36,49 +36,6 @@
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout" columnstretch="0,1,0,0,0,0">
|
||||
<item row="7" column="1">
|
||||
<widget class="QComboBox" name="m_horizontal_align_cb">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Ne pas modifier</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>En haut</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>En bas</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>Texte sur conducteur horizontal :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1" colspan="4">
|
||||
<widget class="QLineEdit" name="m_formula_le">
|
||||
<property name="placeholderText">
|
||||
<string>Ne pas modifier</string>
|
||||
</property>
|
||||
<property name="clearButtonEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Tension / protocol :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1" colspan="4">
|
||||
<widget class="QLineEdit" name="m_function_le">
|
||||
<property name="placeholderText">
|
||||
@@ -89,83 +46,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="5">
|
||||
<widget class="QCheckBox" name="m_erase_text_cb">
|
||||
<property name="toolTip">
|
||||
<string>Supprimer ce texte</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Fonction :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Formule du texte :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="4">
|
||||
<widget class="QCheckBox" name="m_show_text">
|
||||
<property name="toolTip">
|
||||
<string>Texte visible</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="2">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string>Angle :</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1" colspan="4">
|
||||
<widget class="QLineEdit" name="m_tension_protocol_le">
|
||||
<property name="placeholderText">
|
||||
<string>Ne pas modifier</string>
|
||||
</property>
|
||||
<property name="clearButtonEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="4">
|
||||
<widget class="QSpinBox" name="m_text_size_sb">
|
||||
<property name="specialValueText">
|
||||
<string>Ne pas modifier</string>
|
||||
</property>
|
||||
<property name="accelerated">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>2</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>Texte sur conducteur vertical :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
@@ -173,34 +53,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Texte :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="5">
|
||||
<widget class="QCheckBox" name="m_erase_tension_protocol_cb">
|
||||
<property name="toolTip">
|
||||
<string>Supprimer ce texte</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="5">
|
||||
<widget class="QCheckBox" name="m_erase_function_cb">
|
||||
<property name="toolTip">
|
||||
<string>Supprimer ce texte</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<item row="8" column="1">
|
||||
<widget class="QComboBox" name="m_vertical_align_cb">
|
||||
<property name="currentText">
|
||||
<string>Ne pas modifier</string>
|
||||
@@ -222,6 +75,30 @@
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="2">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string>Angle :</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_15">
|
||||
<property name="text">
|
||||
<string>Couleur du conducteur</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Texte :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="5">
|
||||
<widget class="QCheckBox" name="m_erase_formula_cb">
|
||||
<property name="toolTip">
|
||||
@@ -232,17 +109,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="2">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>Angle :</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="3" colspan="2">
|
||||
<item row="8" column="3" colspan="2">
|
||||
<widget class="QSpinBox" name="m_vertical_angle_sb">
|
||||
<property name="wrapping">
|
||||
<bool>true</bool>
|
||||
@@ -267,7 +134,56 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="3" colspan="2">
|
||||
<item row="4" column="5">
|
||||
<widget class="QCheckBox" name="m_erase_function_cb">
|
||||
<property name="toolTip">
|
||||
<string>Supprimer ce texte</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<widget class="QComboBox" name="m_horizontal_align_cb">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Ne pas modifier</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>En haut</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>En bas</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="5">
|
||||
<widget class="QCheckBox" name="m_erase_text_cb">
|
||||
<property name="toolTip">
|
||||
<string>Supprimer ce texte</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1" colspan="4">
|
||||
<widget class="QLineEdit" name="m_formula_le">
|
||||
<property name="placeholderText">
|
||||
<string>Ne pas modifier</string>
|
||||
</property>
|
||||
<property name="clearButtonEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="3" colspan="2">
|
||||
<widget class="QSpinBox" name="m_horizontal_angle_sb">
|
||||
<property name="wrapping">
|
||||
<bool>true</bool>
|
||||
@@ -289,6 +205,23 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Formule du texte :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="5">
|
||||
<widget class="QCheckBox" name="m_erase_tension_protocol_cb">
|
||||
<property name="toolTip">
|
||||
<string>Supprimer ce texte</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" colspan="3">
|
||||
<widget class="QLineEdit" name="m_text_le">
|
||||
<property name="placeholderText">
|
||||
@@ -299,6 +232,107 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>Texte sur conducteur vertical :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="4">
|
||||
<widget class="QSpinBox" name="m_text_size_sb">
|
||||
<property name="specialValueText">
|
||||
<string>Ne pas modifier</string>
|
||||
</property>
|
||||
<property name="accelerated">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>2</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Fonction :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="2">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>Angle :</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="4">
|
||||
<widget class="QCheckBox" name="m_show_text">
|
||||
<property name="toolTip">
|
||||
<string>Texte visible</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1" colspan="4">
|
||||
<widget class="QLineEdit" name="m_tension_protocol_le">
|
||||
<property name="placeholderText">
|
||||
<string>Ne pas modifier</string>
|
||||
</property>
|
||||
<property name="clearButtonEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>Texte sur conducteur horizontal :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Tension / protocol :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="label_16">
|
||||
<property name="text">
|
||||
<string>Section du conducteur</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="5">
|
||||
<widget class="QCheckBox" name="m_erase_wire_color_cb">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="5">
|
||||
<widget class="QCheckBox" name="m_erase_wire_section_cb">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1" colspan="4">
|
||||
<widget class="QLineEdit" name="m_wire_color_le"/>
|
||||
</item>
|
||||
<item row="7" column="1" colspan="4">
|
||||
<widget class="QLineEdit" name="m_wire_section_le"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -793,6 +793,8 @@ QStringList SearchAndReplaceWidget::searchTerms(Conductor *conductor)
|
||||
list.append(properties.text);
|
||||
list.append(properties.m_function);
|
||||
list.append(properties.m_tension_protocol);
|
||||
list.append(properties.m_wire_color);
|
||||
list.append(properties.m_wire_section);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -262,6 +262,8 @@ void ConductorProperties::toXml(QDomElement &e) const
|
||||
e.setAttribute("formula", m_formula);
|
||||
e.setAttribute("function", m_function);
|
||||
e.setAttribute("tension-protocol", m_tension_protocol);
|
||||
e.setAttribute("couleur-conducteur", m_wire_color);
|
||||
e.setAttribute("section-conducteur", m_wire_section);
|
||||
e.setAttribute("numsize", QString::number(text_size));
|
||||
e.setAttribute("condsize", QString::number(cond_size));
|
||||
e.setAttribute("displaytext", m_show_text);
|
||||
@@ -314,6 +316,8 @@ void ConductorProperties::fromXml(QDomElement &e)
|
||||
m_formula = e.attribute("formula");
|
||||
m_function = e.attribute("function");
|
||||
m_tension_protocol = e.attribute("tension-protocol");
|
||||
m_wire_color = e.attribute("couleur-conducteur");
|
||||
m_wire_section = e.attribute("section-conducteur");
|
||||
text_size = e.attribute("numsize", QString::number(9)).toInt();
|
||||
cond_size = e.attribute("condsize", QString::number(1)).toDouble();
|
||||
m_show_text = e.attribute("displaytext", QString::number(1)).toInt();
|
||||
@@ -347,6 +351,8 @@ void ConductorProperties::toSettings(QSettings &settings, const QString &prefix)
|
||||
settings.setValue(prefix + "formula", m_formula);
|
||||
settings.setValue(prefix + "function", m_function);
|
||||
settings.setValue(prefix + "tension-protocol", m_tension_protocol);
|
||||
settings.setValue(prefix + "couleur-conducteur", m_wire_color);
|
||||
settings.setValue(prefix + "section-conducteur", m_wire_section);
|
||||
settings.setValue(prefix + "textsize", QString::number(text_size));
|
||||
settings.setValue(prefix + "size", QString::number(cond_size));
|
||||
settings.setValue(prefix + "displaytext", m_show_text);
|
||||
@@ -385,6 +391,8 @@ void ConductorProperties::fromSettings(QSettings &settings, const QString &prefi
|
||||
m_formula = settings.value(prefix + "formula", "").toString();
|
||||
m_function = settings.value(prefix + "function", "").toString();
|
||||
m_tension_protocol = settings.value(prefix + "tension-protocol", "").toString();
|
||||
m_wire_color = settings.value(prefix + "couleur-conducteur", "").toString();
|
||||
m_wire_section = settings.value(prefix + "section-conducteur", "").toString();
|
||||
text_size = settings.value(prefix + "textsize", "7").toInt();
|
||||
cond_size = settings.value(prefix + "size", "1").toInt();
|
||||
m_show_text = settings.value(prefix + "displaytext", true).toBool();
|
||||
@@ -436,6 +444,8 @@ void ConductorProperties::applyForEqualAttributes(QList<ConductorProperties> lis
|
||||
m_formula = cp.m_formula;
|
||||
m_function = cp.m_function;
|
||||
m_tension_protocol = cp.m_tension_protocol;
|
||||
m_wire_color = cp.m_wire_color;
|
||||
m_wire_section = cp.m_wire_section;
|
||||
text_size = cp.text_size;
|
||||
cond_size = cp.cond_size;
|
||||
m_show_text = cp.m_show_text;
|
||||
@@ -544,6 +554,29 @@ void ConductorProperties::applyForEqualAttributes(QList<ConductorProperties> lis
|
||||
m_tension_protocol = s_value;
|
||||
equal = true;
|
||||
|
||||
//couleur-conducteur
|
||||
s_value = clist.first().m_wire_color;
|
||||
for(ConductorProperties cp : clist)
|
||||
{
|
||||
if (cp.m_wire_color != s_value)
|
||||
equal = false;
|
||||
}
|
||||
if (equal)
|
||||
m_wire_color = s_value;
|
||||
equal = true;
|
||||
|
||||
//section-conducteur
|
||||
s_value = clist.first().m_wire_section;
|
||||
for(ConductorProperties cp : clist)
|
||||
{
|
||||
if (cp.m_wire_section != s_value)
|
||||
equal = false;
|
||||
}
|
||||
if (equal)
|
||||
m_wire_section = s_value;
|
||||
equal = true;
|
||||
|
||||
|
||||
//text size
|
||||
i_value = clist.first().text_size;
|
||||
for(ConductorProperties cp : clist)
|
||||
@@ -665,6 +698,8 @@ bool ConductorProperties::operator==(const ConductorProperties &other) const
|
||||
other.m_formula == m_formula &&\
|
||||
other.m_function == m_function &&\
|
||||
other.m_tension_protocol == m_tension_protocol &&\
|
||||
other.m_wire_color == m_wire_color && \
|
||||
other.m_wire_section == m_wire_section && \
|
||||
other.m_show_text == m_show_text &&\
|
||||
other.text_size == text_size &&\
|
||||
other.cond_size == cond_size &&\
|
||||
|
||||
@@ -85,6 +85,8 @@ class ConductorProperties
|
||||
QString text,
|
||||
m_function,
|
||||
m_tension_protocol,
|
||||
m_wire_color,
|
||||
m_wire_section,
|
||||
m_formula;
|
||||
|
||||
int text_size,
|
||||
|
||||
@@ -1478,6 +1478,8 @@ void Conductor::setPropertyToPotential(const ConductorProperties &property, bool
|
||||
other_properties.text = m_properties.text;
|
||||
other_properties.m_function = m_properties.m_function;
|
||||
other_properties.m_tension_protocol = m_properties.m_tension_protocol;
|
||||
other_properties.m_wire_color = m_properties.m_wire_color;
|
||||
other_properties.m_wire_section = m_properties.m_wire_section;
|
||||
other_conductor->setProperties(other_properties);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1150,6 +1150,10 @@ void DynamicElementTextItem::conductorPropertiesChanged()
|
||||
setPlainText(m_watched_conductor? m_watched_conductor.data()->properties().m_function : "");
|
||||
else if (m_info_name == "tension-protocol")
|
||||
setPlainText(m_watched_conductor? m_watched_conductor.data()->properties().m_tension_protocol : "");
|
||||
else if (m_info_name == "couleur-conducteur")
|
||||
setPlainText(m_watched_conductor? m_watched_conductor.data()->properties().m_wire_color : "");
|
||||
else if (m_info_name == "section-conducteur")
|
||||
setPlainText(m_watched_conductor? m_watched_conductor.data()->properties().m_wire_section : "");
|
||||
}
|
||||
else if (m_text_from == CompositeText) {
|
||||
setPlainText(reportReplacedCompositeText());
|
||||
@@ -1184,6 +1188,10 @@ QString DynamicElementTextItem::reportReplacedCompositeText() const
|
||||
string.replace("%{function}", m_watched_conductor.data()->properties().m_function);
|
||||
if(string.contains("%{tension-protocol}"))
|
||||
string.replace("%{tension-protocol}", m_watched_conductor.data()->properties().m_tension_protocol);
|
||||
if(string.contains("%{}couleur-conducteur"))
|
||||
string.replace("%{couleur-conducteur}", m_watched_conductor.data()->properties().m_wire_color);
|
||||
if(string.contains("%{}section-conducteur"))
|
||||
string.replace("%{section-conducteur}", m_watched_conductor.data()->properties().m_wire_section);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -82,6 +82,8 @@ void ConductorPropertiesWidget::setProperties(const ConductorProperties &propert
|
||||
ui->m_text_le -> setText (m_properties.text);
|
||||
ui->m_function_le -> setText (m_properties.m_function);
|
||||
ui->m_tension_protocol_le -> setText (m_properties.m_tension_protocol);
|
||||
ui->m_wire_color_le -> setText (m_properties.m_wire_color);
|
||||
ui->m_wire_section_le -> setText (m_properties.m_wire_section);
|
||||
ui->m_text_size_sb -> setValue (m_properties.text_size);
|
||||
ui->m_cond_size_sb -> setValue (m_properties.cond_size);
|
||||
ui->m_show_text_cb -> setChecked (m_properties.m_show_text);
|
||||
@@ -122,6 +124,8 @@ ConductorProperties ConductorPropertiesWidget::properties() const
|
||||
properties_.text = ui -> m_text_le -> text();
|
||||
properties_.m_function = ui -> m_function_le->text();
|
||||
properties_.m_tension_protocol = ui -> m_tension_protocol_le->text();
|
||||
properties_.m_wire_color = ui -> m_wire_color_le->text();
|
||||
properties_.m_wire_section = ui -> m_wire_section_le->text();
|
||||
properties_.text_size = ui -> m_text_size_sb -> value();
|
||||
properties_.cond_size = ui -> m_cond_size_sb -> value();
|
||||
properties_.m_show_text = ui -> m_show_text_cb -> isChecked();
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="type">
|
||||
<attribute name="title">
|
||||
@@ -37,7 +37,14 @@
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout_3" rowstretch="0,0,0,0,0,0,0">
|
||||
<layout class="QGridLayout" name="gridLayout_3" rowstretch="0,0,0,0,0,0,0,0,0">
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="m_autonum_label">
|
||||
<property name="text">
|
||||
<string>Autonumérotation</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
@@ -45,6 +52,26 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Couleur du conducteur</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QComboBox" name="m_available_autonum_cb"/>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="m_formula_le"/>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>Fonction :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QLineEdit" name="m_function_le">
|
||||
<property name="clearButtonEnabled">
|
||||
@@ -52,6 +79,16 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="m_text_le">
|
||||
<property name="toolTip">
|
||||
<string>Texte</string>
|
||||
</property>
|
||||
<property name="clearButtonEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QLineEdit" name="m_tension_protocol_le">
|
||||
<property name="clearButtonEnabled">
|
||||
@@ -59,6 +96,27 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string>Tension / Protocole :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Texte :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="text">
|
||||
<string>Formule du texte :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QCheckBox" name="m_show_text_cb">
|
||||
<property name="toolTip">
|
||||
@@ -104,57 +162,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="m_formula_le"/>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="m_text_le">
|
||||
<property name="toolTip">
|
||||
<string>Texte</string>
|
||||
</property>
|
||||
<property name="clearButtonEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Texte :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>Fonction :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="text">
|
||||
<string>Formule du texte :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string>Tension / Protocole :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="m_autonum_label">
|
||||
<property name="text">
|
||||
<string>Autonumérotation</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QComboBox" name="m_available_autonum_cb"/>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QPushButton" name="m_edit_autonum_pb">
|
||||
<property name="toolTip">
|
||||
@@ -169,6 +176,19 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Section du conducteur</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<widget class="QLineEdit" name="m_wire_color_le"/>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<widget class="QLineEdit" name="m_wire_section_le"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
|
||||
@@ -1782,6 +1782,10 @@ QStringList DynamicTextItemDelegate::availableInfo(DynamicElementTextItem *deti)
|
||||
qstrl << "function";
|
||||
if(!cond->properties().m_tension_protocol.isEmpty())
|
||||
qstrl << "tension-protocol";
|
||||
if(!cond->properties().m_wire_color.isEmpty())
|
||||
qstrl << "couleur-conducteur";
|
||||
if(!cond->properties().m_wire_section.isEmpty())
|
||||
qstrl << "section-conducteur";
|
||||
}
|
||||
|
||||
return qstrl;
|
||||
|
||||
@@ -279,6 +279,12 @@ void LinkSingleElementWidget::buildTree()
|
||||
str_list << cp.m_tension_protocol;
|
||||
if (!str_list.last().isEmpty())
|
||||
search_list << str_list.last();
|
||||
str_list << cp.m_wire_color;
|
||||
if (!str_list.last().isEmpty())
|
||||
search_list << str_list.last();
|
||||
str_list << cp.m_wire_section;
|
||||
if (!str_list.last().isEmpty())
|
||||
search_list << str_list.last();
|
||||
}
|
||||
else
|
||||
str_list << "" << "" << "";
|
||||
@@ -421,11 +427,11 @@ void LinkSingleElementWidget::setUpHeaderLabels()
|
||||
{
|
||||
if (settings.value("genericpanel/folio", false).toBool())
|
||||
{
|
||||
list << tr("N° de fil") << tr("Fonction") << tr("Tension / Protocole") << tr("Label de folio") << tr("Position") << tr("Titre de folio");
|
||||
list << tr("N° de fil") << tr("Fonction") << tr("Tension / Protocole") << tr("Couleur du conducteur") << tr("Section du conducteur") << tr("Label de folio") << tr("Position") << tr("Titre de folio");
|
||||
}
|
||||
else
|
||||
{
|
||||
list << tr("N° de fil") << tr("Fonction") << tr("Tension / Protocole") << tr("N° de folio") << tr("Position") << tr("Titre de folio");
|
||||
list << tr("N° de fil") << tr("Fonction") << tr("Tension / Protocole") << tr("Couleur du conducteur") << tr("Section du conducteur") << tr("N° de folio") << tr("Position") << tr("Titre de folio");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -191,6 +191,10 @@ ConductorProperties PotentialSelectorDialog::chosenProperties(QList<ConductorPro
|
||||
text.append(tr("\nFonction : %1").arg(cp.m_function));
|
||||
if(!cp.m_tension_protocol.isEmpty())
|
||||
text.append(tr("\nTension/protocole : %1").arg(cp.m_tension_protocol));
|
||||
if(!cp.m_wire_color.isEmpty())
|
||||
text.append(tr("\nCouleur du conducteur : %1").arg(cp.m_wire_color));
|
||||
if(!cp.m_wire_section.isEmpty())
|
||||
text.append(tr("\nSection du conducteur : %1").arg(cp.m_wire_section));
|
||||
|
||||
QRadioButton *b = new QRadioButton(text, &dialog);
|
||||
layout.addWidget(b);
|
||||
@@ -272,6 +276,10 @@ void PotentialSelectorDialog::buildWidget()
|
||||
text1.append(tr("\nFonction : %1").arg(cp1.m_function));
|
||||
if(!cp1.m_tension_protocol.isEmpty())
|
||||
text1.append(tr("\nTension/protocole : %1").arg(cp1.m_tension_protocol));
|
||||
if(!cp1.m_wire_color.isEmpty())
|
||||
text1.append(tr("\nCouleur du conducteur : %1").arg(cp1.m_wire_color));
|
||||
if(!cp1.m_wire_section.isEmpty())
|
||||
text1.append(tr("\nSection du conducteur : %1").arg(cp1.m_wire_section));
|
||||
|
||||
QString text2(tr("%n conducteurs composent le potentiel suivant :", "", m_potential_selector->m_conductor_number_2));
|
||||
ConductorProperties cp2;
|
||||
@@ -284,6 +292,10 @@ void PotentialSelectorDialog::buildWidget()
|
||||
text2.append(tr("\nFonction : %1").arg(cp2.m_function));
|
||||
if(!cp2.m_tension_protocol.isEmpty())
|
||||
text2.append(tr("\nTension/protocole : %1").arg(cp2.m_tension_protocol));
|
||||
if(!cp2.m_wire_color.isEmpty())
|
||||
text2.append(tr("\nCouleur du conducteur : %1").arg(cp2.m_wire_color));
|
||||
if(!cp2.m_wire_section.isEmpty())
|
||||
text2.append(tr("\nSection du conducteur : %1").arg(cp2.m_wire_section));
|
||||
|
||||
QRadioButton *rb1 = new QRadioButton(text1, this);
|
||||
QRadioButton *rb2 = new QRadioButton(text2, this);
|
||||
|
||||
@@ -205,6 +205,8 @@ void LinkElementCommand::redo()
|
||||
str_txt << c->properties().text;
|
||||
str_funct << c->properties().m_function;
|
||||
str_tens << c->properties().m_tension_protocol;
|
||||
str_tens << c->properties().m_wire_color;
|
||||
str_tens << c->properties().m_wire_section;
|
||||
}
|
||||
|
||||
//check text list, isn't same in potential, ask user what to do
|
||||
|
||||
Reference in New Issue
Block a user