When remove an element with several conductors connected to the same terminal, the electrical potential is partially or totally destroyed.

This commit fix it : When element is removed one or several conductors are created (if needed) to conserve the electrical potential.


git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5703 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2019-01-09 18:08:49 +00:00
parent 98b4188ded
commit ba0a85c166
2 changed files with 131 additions and 1 deletions

View File

@@ -23,14 +23,19 @@
class Diagram;
class ElementTextItemGroup;
class Terminal;
class DeleteQGraphicsItemCommand : public QUndoCommand
{
public:
DeleteQGraphicsItemCommand(Diagram *diagram, const DiagramContent &content, QUndoCommand * parent = nullptr);
~DeleteQGraphicsItemCommand() override;
private:
DeleteQGraphicsItemCommand(const DeleteQGraphicsItemCommand &);
void setPotentialsOfRemovedElements();
Terminal *terminalInSamePotential(Terminal *terminal, Conductor *conductor_to_exclude);
public:
void undo() override;
@@ -43,6 +48,7 @@ class DeleteQGraphicsItemCommand : public QUndoCommand
QHash <Element *, QList<Element *> > m_link_hash; /// keep linked element for each removed element linked to other element.
QHash <DynamicElementTextItem *, Element *> m_elmt_text_hash; /// Keep the parent element of each deleted dynamic element text item
QHash <DynamicElementTextItem *, ElementTextItemGroup *> m_grp_texts_hash; ///Keep the parent group of each deleted element text item
QList <QPair<Terminal *, Terminal *>> m_connected_terminals;
};
#endif // DELETEQGRAPHICSITEMCOMMAND_H