mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-19 14:50:53 +01:00
Ajout du type de conducteur "simple" : ni symbole ni champ de texte
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@173 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -23,6 +23,7 @@ Conductor::Conductor(Terminal *p1, Terminal* p2, Element *parent, QGraphicsScene
|
|||||||
terminal1(p1),
|
terminal1(p1),
|
||||||
terminal2(p2),
|
terminal2(p2),
|
||||||
destroyed(false),
|
destroyed(false),
|
||||||
|
type_(Multi),
|
||||||
segments(NULL),
|
segments(NULL),
|
||||||
previous_z_value(zValue()),
|
previous_z_value(zValue()),
|
||||||
modified_path(false),
|
modified_path(false),
|
||||||
@@ -416,7 +417,7 @@ void Conductor::paint(QPainter *qp, const QStyleOptionGraphicsItem */*qsogi*/, Q
|
|||||||
|
|
||||||
// dessin du conducteur
|
// dessin du conducteur
|
||||||
qp -> drawPath(path());
|
qp -> drawPath(path());
|
||||||
if (isSingleLine()) {
|
if (type_ == Single) {
|
||||||
if (isSelected()) qp -> setBrush(Qt::red);
|
if (isSelected()) qp -> setBrush(Qt::red);
|
||||||
singleLineProperties.draw(
|
singleLineProperties.draw(
|
||||||
qp,
|
qp,
|
||||||
@@ -791,15 +792,17 @@ bool Conductor::hasClickedOn(QPointF press_point, QPointF point) const {
|
|||||||
*/
|
*/
|
||||||
bool Conductor::fromXml(QDomElement &e) {
|
bool Conductor::fromXml(QDomElement &e) {
|
||||||
// recupere la "configuration" du conducteur
|
// recupere la "configuration" du conducteur
|
||||||
if (e.attribute("singleline") == "true") {
|
if (e.attribute("type") == typeToString(Single)) {
|
||||||
// recupere les parametres specifiques a un conducteur unifilaire
|
// recupere les parametres specifiques a un conducteur unifilaire
|
||||||
singleLineProperties.fromXml(e);
|
singleLineProperties.fromXml(e);
|
||||||
setSingleLine(true);
|
setConductorType(Conductor::Single);
|
||||||
|
} else if (e.attribute("type") == typeToString(Simple)) {
|
||||||
|
setConductorType(Conductor::Simple);
|
||||||
} else {
|
} else {
|
||||||
// recupere le champ de texte
|
// recupere le champ de texte
|
||||||
text_item -> setPlainText(e.attribute("num"));
|
text_item -> setPlainText(e.attribute("num"));
|
||||||
text_item -> previous_text = e.attribute("num");
|
text_item -> previous_text = e.attribute("num");
|
||||||
setSingleLine(false);
|
setConductorType(Conductor::Multi);
|
||||||
}
|
}
|
||||||
|
|
||||||
// parcourt les elements XML "segment" et en extrait deux listes de longueurs
|
// parcourt les elements XML "segment" et en extrait deux listes de longueurs
|
||||||
@@ -892,10 +895,10 @@ QDomElement Conductor::toXml(QDomDocument &d, QHash<Terminal *, int> &table_adr_
|
|||||||
}
|
}
|
||||||
|
|
||||||
// exporte la "configuration" du conducteur
|
// exporte la "configuration" du conducteur
|
||||||
e.setAttribute("singleline", isSingleLine() ? "true" : "false");
|
e.setAttribute("type", typeToString(type_));
|
||||||
if (isSingleLine()) {
|
if (type_ == Single) {
|
||||||
singleLineProperties.toXml(d, e);
|
singleLineProperties.toXml(d, e);
|
||||||
} else {
|
} else if (type_ == Multi) {
|
||||||
e.setAttribute("num", text_item -> toPlainText());
|
e.setAttribute("num", text_item -> toPlainText());
|
||||||
}
|
}
|
||||||
return(e);
|
return(e);
|
||||||
@@ -1011,8 +1014,9 @@ ConductorProfile Conductor::profile() const {
|
|||||||
return(conductor_profile);
|
return(conductor_profile);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Conductor::isSingleLine() const {
|
/// @return le type du conducteur
|
||||||
return(is_single_line);
|
Conductor::ConductorType Conductor::conductorType() const {
|
||||||
|
return(type_);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1021,9 +1025,10 @@ bool Conductor::isSingleLine() const {
|
|||||||
et vice-versa.
|
et vice-versa.
|
||||||
@param sl true pour un conducteur unifilaire, false pour un conducteur multifilaire
|
@param sl true pour un conducteur unifilaire, false pour un conducteur multifilaire
|
||||||
*/
|
*/
|
||||||
void Conductor::setSingleLine(bool sl) {
|
void Conductor::setConductorType(ConductorType t) {
|
||||||
is_single_line = sl;
|
if (typeToString(t).isNull()) return;
|
||||||
text_item -> setVisible(!is_single_line);
|
type_ = t;
|
||||||
|
text_item -> setVisible(type_ == Conductor::Multi);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @return le texte du conducteur
|
/// @return le texte du conducteur
|
||||||
@@ -1039,7 +1044,6 @@ void Conductor::setText(const QString &t) {
|
|||||||
text_item -> previous_text = t;
|
text_item -> previous_text = t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Constructeur par defaut
|
Constructeur par defaut
|
||||||
*/
|
*/
|
||||||
@@ -1203,3 +1207,15 @@ void SingleLineProperties::fromXml(QDomElement &e) {
|
|||||||
hasNeutral = e.attribute("neutral") == "true";
|
hasNeutral = e.attribute("neutral") == "true";
|
||||||
setPhasesCount(e.attribute("phase").toInt());
|
setPhasesCount(e.attribute("phase").toInt());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
|
||||||
|
*/
|
||||||
|
QString Conductor::typeToString(ConductorType t) {
|
||||||
|
switch(t) {
|
||||||
|
case Simple: return("simple");
|
||||||
|
case Single: return("single");
|
||||||
|
case Multi: return("mutli");
|
||||||
|
default: return(QString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
10
conductor.h
10
conductor.h
@@ -42,6 +42,7 @@ class Conductor : public QGraphicsPathItem {
|
|||||||
// attributs
|
// attributs
|
||||||
public:
|
public:
|
||||||
enum { Type = UserType + 1001 };
|
enum { Type = UserType + 1001 };
|
||||||
|
enum ConductorType { Simple, Single, Multi };
|
||||||
|
|
||||||
/// premiere borne a laquelle le fil est rattache
|
/// premiere borne a laquelle le fil est rattache
|
||||||
Terminal *terminal1;
|
Terminal *terminal1;
|
||||||
@@ -71,8 +72,8 @@ class Conductor : public QGraphicsPathItem {
|
|||||||
const QList<ConductorSegment *> segmentsList() const;
|
const QList<ConductorSegment *> segmentsList() const;
|
||||||
void setProfile(const ConductorProfile &);
|
void setProfile(const ConductorProfile &);
|
||||||
ConductorProfile profile() const;
|
ConductorProfile profile() const;
|
||||||
void setSingleLine(bool);
|
ConductorType conductorType() const;
|
||||||
bool isSingleLine() const;
|
void setConductorType(ConductorType);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void mousePressEvent(QGraphicsSceneMouseEvent *);
|
virtual void mousePressEvent(QGraphicsSceneMouseEvent *);
|
||||||
@@ -83,8 +84,8 @@ class Conductor : public QGraphicsPathItem {
|
|||||||
private:
|
private:
|
||||||
/// booleen indiquant si le fil est encore valide
|
/// booleen indiquant si le fil est encore valide
|
||||||
bool destroyed;
|
bool destroyed;
|
||||||
/// booleen indiquant le mode du conducteur : unifilaire ou non
|
/// enum indiquant le mode du conducteur : simple, unifilaire ou non
|
||||||
bool is_single_line;
|
ConductorType type_;
|
||||||
/// champ de texte editable pour les conducteurs non unifilaires
|
/// champ de texte editable pour les conducteurs non unifilaires
|
||||||
DiagramTextItem *text_item;
|
DiagramTextItem *text_item;
|
||||||
/// segments composant le conducteur
|
/// segments composant le conducteur
|
||||||
@@ -123,5 +124,6 @@ class Conductor : public QGraphicsPathItem {
|
|||||||
static QPointF extendTerminal(const QPointF &, QET::Orientation, qreal = 12.0);
|
static QPointF extendTerminal(const QPointF &, QET::Orientation, qreal = 12.0);
|
||||||
static qreal conductor_bound(qreal, qreal, qreal, qreal = 0.0);
|
static qreal conductor_bound(qreal, qreal, qreal, qreal = 0.0);
|
||||||
static qreal conductor_bound(qreal, qreal, bool);
|
static qreal conductor_bound(qreal, qreal, bool);
|
||||||
|
static QString typeToString(ConductorType);
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -6,7 +6,8 @@
|
|||||||
@param parent QWidget parent
|
@param parent QWidget parent
|
||||||
*/
|
*/
|
||||||
ConductorPropertiesWidget::ConductorPropertiesWidget(QWidget *parent) :
|
ConductorPropertiesWidget::ConductorPropertiesWidget(QWidget *parent) :
|
||||||
QWidget(parent)
|
QWidget(parent),
|
||||||
|
type_(Conductor::Multi)
|
||||||
{
|
{
|
||||||
buildInterface();
|
buildInterface();
|
||||||
}
|
}
|
||||||
@@ -14,7 +15,7 @@ ConductorPropertiesWidget::ConductorPropertiesWidget(QWidget *parent) :
|
|||||||
/// construit l'interface du widget
|
/// construit l'interface du widget
|
||||||
void ConductorPropertiesWidget::buildInterface() {
|
void ConductorPropertiesWidget::buildInterface() {
|
||||||
|
|
||||||
setFixedSize(380, 245);
|
setFixedSize(380, 270);
|
||||||
|
|
||||||
QVBoxLayout *main_layout = new QVBoxLayout(this);
|
QVBoxLayout *main_layout = new QVBoxLayout(this);
|
||||||
|
|
||||||
@@ -24,6 +25,7 @@ void ConductorPropertiesWidget::buildInterface() {
|
|||||||
QVBoxLayout *groupbox_layout = new QVBoxLayout();
|
QVBoxLayout *groupbox_layout = new QVBoxLayout();
|
||||||
groupbox -> setLayout(groupbox_layout);
|
groupbox -> setLayout(groupbox_layout);
|
||||||
|
|
||||||
|
simple = new QRadioButton(tr("Simple"));
|
||||||
multiline = new QRadioButton(tr("Multifilaire"));
|
multiline = new QRadioButton(tr("Multifilaire"));
|
||||||
|
|
||||||
QHBoxLayout *multiline_layout = new QHBoxLayout();
|
QHBoxLayout *multiline_layout = new QHBoxLayout();
|
||||||
@@ -60,13 +62,19 @@ void ConductorPropertiesWidget::buildInterface() {
|
|||||||
singleline_layout1 -> addWidget(preview);
|
singleline_layout1 -> addWidget(preview);
|
||||||
singleline_layout1 -> addLayout(singleline_layout2);
|
singleline_layout1 -> addLayout(singleline_layout2);
|
||||||
|
|
||||||
|
groupbox_layout -> addWidget(simple);
|
||||||
groupbox_layout -> addWidget(multiline);
|
groupbox_layout -> addWidget(multiline);
|
||||||
groupbox_layout -> addLayout(multiline_layout);
|
groupbox_layout -> addLayout(multiline_layout);
|
||||||
groupbox_layout -> addWidget(singleline);
|
groupbox_layout -> addWidget(singleline);
|
||||||
groupbox_layout -> addLayout(singleline_layout1);
|
groupbox_layout -> addLayout(singleline_layout1);
|
||||||
|
|
||||||
|
radio_buttons = new QButtonGroup(this);
|
||||||
|
radio_buttons -> addButton(simple, Conductor::Simple);
|
||||||
|
radio_buttons -> addButton(multiline, Conductor::Multi);
|
||||||
|
radio_buttons -> addButton(singleline, Conductor::Single);
|
||||||
|
|
||||||
buildConnections();
|
buildConnections();
|
||||||
setSingleLine(false);
|
setConductorType(Conductor::Multi);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Met en place les connexions signaux/slots
|
/// Met en place les connexions signaux/slots
|
||||||
@@ -77,8 +85,7 @@ void ConductorPropertiesWidget::buildConnections() {
|
|||||||
connect(neutral_checkbox, SIGNAL(toggled(bool)), this, SLOT(updateSingleLineConfig()));
|
connect(neutral_checkbox, SIGNAL(toggled(bool)), this, SLOT(updateSingleLineConfig()));
|
||||||
connect(phase_checkbox, SIGNAL(toggled(bool)), this, SLOT(updateSingleLineConfig()));
|
connect(phase_checkbox, SIGNAL(toggled(bool)), this, SLOT(updateSingleLineConfig()));
|
||||||
connect(phase_slider, SIGNAL(valueChanged(int)), this, SLOT(updateSingleLineConfig()));
|
connect(phase_slider, SIGNAL(valueChanged(int)), this, SLOT(updateSingleLineConfig()));
|
||||||
connect(singleline, SIGNAL(toggled(bool)), this, SLOT(setSingleLine(bool)));
|
connect(radio_buttons, SIGNAL(buttonClicked(int)), this, SLOT(setConductorType(int)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Enleve les connexions signaux/slots
|
/// Enleve les connexions signaux/slots
|
||||||
@@ -89,7 +96,7 @@ void ConductorPropertiesWidget::destroyConnections() {
|
|||||||
disconnect(neutral_checkbox, SIGNAL(toggled(bool)), this, SLOT(updateSingleLineConfig()));
|
disconnect(neutral_checkbox, SIGNAL(toggled(bool)), this, SLOT(updateSingleLineConfig()));
|
||||||
disconnect(phase_checkbox, SIGNAL(toggled(bool)), this, SLOT(updateSingleLineConfig()));
|
disconnect(phase_checkbox, SIGNAL(toggled(bool)), this, SLOT(updateSingleLineConfig()));
|
||||||
disconnect(phase_slider, SIGNAL(valueChanged(int)), this, SLOT(updateSingleLineConfig()));
|
disconnect(phase_slider, SIGNAL(valueChanged(int)), this, SLOT(updateSingleLineConfig()));
|
||||||
disconnect(singleline, SIGNAL(toggled(bool)), this, SLOT(setSingleLine(bool)));
|
disconnect(radio_buttons, SIGNAL(buttonClicked(int)), this, SLOT(setConductorType(int)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Destructeur
|
/// Destructeur
|
||||||
@@ -131,18 +138,26 @@ void ConductorPropertiesWidget::updatePreview() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// @return true si le widget est en mode unifilaire, false sinon
|
/// @return true si le widget est en mode unifilaire, false sinon
|
||||||
bool ConductorPropertiesWidget::isSingleLine() const {
|
Conductor::ConductorType ConductorPropertiesWidget::conductorType() const {
|
||||||
return(singleline -> isChecked());
|
return(type_);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Passe le widget en mode unifilaire ou multifilaire
|
Passe le widget en mode simple, unifilaire ou multifilaire
|
||||||
@param sl true pour passer le widget en mode "unifilaire", false sinon
|
@param t le type de conducteur
|
||||||
*/
|
*/
|
||||||
void ConductorPropertiesWidget::setSingleLine(bool sl) {
|
void ConductorPropertiesWidget::setConductorType(Conductor::ConductorType t) {
|
||||||
|
type_ = t;
|
||||||
|
// widgets lies au simple
|
||||||
|
simple -> setChecked(t == Conductor::Simple);
|
||||||
|
|
||||||
|
// widgets lies au mode multifilaire
|
||||||
|
multiline -> setChecked(t == Conductor::Multi);
|
||||||
|
text_field -> setEnabled(t == Conductor::Multi);
|
||||||
|
|
||||||
|
// widgets lies au mode unifilaire
|
||||||
|
bool sl = (t == Conductor::Single);
|
||||||
singleline -> setChecked(sl);
|
singleline -> setChecked(sl);
|
||||||
multiline -> setChecked(!sl);
|
|
||||||
text_field -> setEnabled(!sl);
|
|
||||||
preview -> setEnabled(sl);
|
preview -> setEnabled(sl);
|
||||||
phase_checkbox -> setEnabled(sl);
|
phase_checkbox -> setEnabled(sl);
|
||||||
phase_slider -> setEnabled(sl);
|
phase_slider -> setEnabled(sl);
|
||||||
@@ -152,6 +167,10 @@ void ConductorPropertiesWidget::setSingleLine(bool sl) {
|
|||||||
updateSingleLineDisplay();
|
updateSingleLineDisplay();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ConductorPropertiesWidget::setConductorType(int t) {
|
||||||
|
setConductorType(static_cast<Conductor::ConductorType>(t));
|
||||||
|
}
|
||||||
|
|
||||||
/// @param prop Les nouvelles proprietes unifilaires de ce conducteur
|
/// @param prop Les nouvelles proprietes unifilaires de ce conducteur
|
||||||
void ConductorPropertiesWidget::setSingleLineProperties(const SingleLineProperties &prop) {
|
void ConductorPropertiesWidget::setSingleLineProperties(const SingleLineProperties &prop) {
|
||||||
slp = prop;
|
slp = prop;
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class ConductorPropertiesWidget : public QWidget {
|
|||||||
|
|
||||||
// methodes
|
// methodes
|
||||||
public:
|
public:
|
||||||
bool isSingleLine() const;
|
Conductor::ConductorType conductorType() const;
|
||||||
void setSingleLineProperties(const SingleLineProperties &);
|
void setSingleLineProperties(const SingleLineProperties &);
|
||||||
SingleLineProperties singleLineProperties() const;
|
SingleLineProperties singleLineProperties() const;
|
||||||
QString conductorText() const;
|
QString conductorText() const;
|
||||||
@@ -24,10 +24,13 @@ class ConductorPropertiesWidget : public QWidget {
|
|||||||
void updatePreview();
|
void updatePreview();
|
||||||
void updateSingleLineConfig();
|
void updateSingleLineConfig();
|
||||||
void updateSingleLineDisplay();
|
void updateSingleLineDisplay();
|
||||||
void setSingleLine(bool);
|
void setConductorType(Conductor::ConductorType);
|
||||||
|
void setConductorType(int);
|
||||||
|
|
||||||
// attributs prives
|
// attributs prives
|
||||||
private:
|
private:
|
||||||
|
QButtonGroup *radio_buttons;
|
||||||
|
QRadioButton *simple;
|
||||||
QRadioButton *multiline;
|
QRadioButton *multiline;
|
||||||
QLineEdit *text_field;
|
QLineEdit *text_field;
|
||||||
QRadioButton *singleline;
|
QRadioButton *singleline;
|
||||||
@@ -38,6 +41,7 @@ class ConductorPropertiesWidget : public QWidget {
|
|||||||
QCheckBox *neutral_checkbox;
|
QCheckBox *neutral_checkbox;
|
||||||
QLabel *preview;
|
QLabel *preview;
|
||||||
|
|
||||||
|
Conductor::ConductorType type_;
|
||||||
SingleLineProperties slp;
|
SingleLineProperties slp;
|
||||||
QString conductor_text;
|
QString conductor_text;
|
||||||
|
|
||||||
|
|||||||
@@ -526,16 +526,16 @@ ChangeConductorPropertiesCommand::~ChangeConductorPropertiesCommand() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// definit l'ancienne configuration
|
/// definit l'ancienne configuration
|
||||||
void ChangeConductorPropertiesCommand::setOldSettings(bool single, const QString &text, const SingleLineProperties &slp) {
|
void ChangeConductorPropertiesCommand::setOldSettings(Conductor::ConductorType single, const QString &text, const SingleLineProperties &slp) {
|
||||||
old_is_single_line = single;
|
old_type = single;
|
||||||
old_conductor_text = text;
|
old_conductor_text = text;
|
||||||
old_slp = slp;
|
old_slp = slp;
|
||||||
old_settings_set = true;
|
old_settings_set = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// definit la nouvelle configuration
|
/// definit la nouvelle configuration
|
||||||
void ChangeConductorPropertiesCommand::setNewSettings(bool single, const QString &text, const SingleLineProperties &slp) {
|
void ChangeConductorPropertiesCommand::setNewSettings(Conductor::ConductorType single, const QString &text, const SingleLineProperties &slp) {
|
||||||
new_is_single_line = single;
|
new_type = single;
|
||||||
new_conductor_text = text;
|
new_conductor_text = text;
|
||||||
new_slp = slp;
|
new_slp = slp;
|
||||||
new_settings_set = true;
|
new_settings_set = true;
|
||||||
@@ -547,7 +547,7 @@ void ChangeConductorPropertiesCommand::setNewSettings(bool single, const QString
|
|||||||
*/
|
*/
|
||||||
void ChangeConductorPropertiesCommand::undo() {
|
void ChangeConductorPropertiesCommand::undo() {
|
||||||
if (old_settings_set && new_settings_set) {
|
if (old_settings_set && new_settings_set) {
|
||||||
conductor -> setSingleLine(old_is_single_line);
|
conductor -> setConductorType(old_type);
|
||||||
conductor -> setText(old_conductor_text);
|
conductor -> setText(old_conductor_text);
|
||||||
conductor -> singleLineProperties = old_slp;
|
conductor -> singleLineProperties = old_slp;
|
||||||
conductor -> update();
|
conductor -> update();
|
||||||
@@ -560,7 +560,7 @@ void ChangeConductorPropertiesCommand::undo() {
|
|||||||
*/
|
*/
|
||||||
void ChangeConductorPropertiesCommand::redo() {
|
void ChangeConductorPropertiesCommand::redo() {
|
||||||
if (old_settings_set && new_settings_set) {
|
if (old_settings_set && new_settings_set) {
|
||||||
conductor -> setSingleLine(new_is_single_line);
|
conductor -> setConductorType(new_type);
|
||||||
conductor -> setText(new_conductor_text);
|
conductor -> setText(new_conductor_text);
|
||||||
conductor -> singleLineProperties = new_slp;
|
conductor -> singleLineProperties = new_slp;
|
||||||
conductor -> update();
|
conductor -> update();
|
||||||
|
|||||||
@@ -335,19 +335,19 @@ class ChangeConductorPropertiesCommand : public QUndoCommand {
|
|||||||
public:
|
public:
|
||||||
virtual void undo();
|
virtual void undo();
|
||||||
virtual void redo();
|
virtual void redo();
|
||||||
virtual void setOldSettings(bool, const QString &, const SingleLineProperties &);
|
virtual void setOldSettings(Conductor::ConductorType, const QString &, const SingleLineProperties &);
|
||||||
virtual void setNewSettings(bool, const QString &, const SingleLineProperties &);
|
virtual void setNewSettings(Conductor::ConductorType, const QString &, const SingleLineProperties &);
|
||||||
|
|
||||||
// attributs
|
// attributs
|
||||||
private:
|
private:
|
||||||
/// conducteur modifie
|
/// conducteur modifie
|
||||||
Conductor *conductor;
|
Conductor *conductor;
|
||||||
/// anciennes proprietes
|
/// anciennes proprietes
|
||||||
bool old_is_single_line;
|
Conductor::ConductorType old_type;
|
||||||
QString old_conductor_text;
|
QString old_conductor_text;
|
||||||
SingleLineProperties old_slp;
|
SingleLineProperties old_slp;
|
||||||
/// nouvelles proprietes
|
/// nouvelles proprietes
|
||||||
bool new_is_single_line;
|
Conductor::ConductorType new_type;
|
||||||
QString new_conductor_text;
|
QString new_conductor_text;
|
||||||
SingleLineProperties new_slp;
|
SingleLineProperties new_slp;
|
||||||
/// booleens indiquant si les proprietes ont ete definies ou non
|
/// booleens indiquant si les proprietes ont ete definies ou non
|
||||||
|
|||||||
@@ -708,13 +708,13 @@ void DiagramView::editConductor() {
|
|||||||
|
|
||||||
// initialise l'editeur de proprietes pour le conducteur
|
// initialise l'editeur de proprietes pour le conducteur
|
||||||
ConductorPropertiesWidget *cpw = new ConductorPropertiesWidget();
|
ConductorPropertiesWidget *cpw = new ConductorPropertiesWidget();
|
||||||
cpw -> setSingleLine(edited_conductor -> isSingleLine());
|
cpw -> setConductorType(edited_conductor -> conductorType());
|
||||||
cpw -> setConductorText(edited_conductor -> text());
|
cpw -> setConductorText(edited_conductor -> text());
|
||||||
cpw -> setSingleLineProperties(edited_conductor -> singleLineProperties);
|
cpw -> setSingleLineProperties(edited_conductor -> singleLineProperties);
|
||||||
|
|
||||||
// initialise egalement l'objet UndoCommand correspondant
|
// initialise egalement l'objet UndoCommand correspondant
|
||||||
ChangeConductorPropertiesCommand *ccpc = new ChangeConductorPropertiesCommand(edited_conductor);
|
ChangeConductorPropertiesCommand *ccpc = new ChangeConductorPropertiesCommand(edited_conductor);
|
||||||
ccpc -> setOldSettings(edited_conductor -> isSingleLine(), edited_conductor -> text(), edited_conductor -> singleLineProperties);
|
ccpc -> setOldSettings(edited_conductor -> conductorType(), edited_conductor -> text(), edited_conductor -> singleLineProperties);
|
||||||
|
|
||||||
// l'insere dans un dialogue
|
// l'insere dans un dialogue
|
||||||
QDialog conductor_dialog;
|
QDialog conductor_dialog;
|
||||||
@@ -728,7 +728,7 @@ void DiagramView::editConductor() {
|
|||||||
|
|
||||||
// execute le dialogue et met a jour le conducteur
|
// execute le dialogue et met a jour le conducteur
|
||||||
if (conductor_dialog.exec() == QDialog::Accepted) {
|
if (conductor_dialog.exec() == QDialog::Accepted) {
|
||||||
ccpc -> setNewSettings(cpw -> isSingleLine(), cpw -> conductorText(), cpw -> singleLineProperties());
|
ccpc -> setNewSettings(cpw -> conductorType(), cpw -> conductorText(), cpw -> singleLineProperties());
|
||||||
diagram() -> undoStack().push(ccpc);
|
diagram() -> undoStack().push(ccpc);
|
||||||
} else {
|
} else {
|
||||||
delete ccpc;
|
delete ccpc;
|
||||||
|
|||||||
Reference in New Issue
Block a user