QElectroTech  0.8-dev
potentialselectordialog.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2020 The QElectroTech Team
3  This file is part of QElectroTech.
4 
5  QElectroTech is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 2 of the License, or
8  (at your option) any later version.
9 
10  QElectroTech is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #ifndef POTENTIALSELECTORDIALOG_H
19 #define POTENTIALSELECTORDIALOG_H
20 
21 #include <QDialog>
22 #include "conductorproperties.h"
23 #include "assignvariables.h"
24 class Conductor;
25 class QUndoCommand;
26 class Element;
27 
29 {
30  public:
33  , m_conductor_number_2(0) {}
35  virtual bool isValid() const = 0;
36 
39  QList<ConductorProperties> m_properties_list_1,
42 };
43 
44 namespace Ui {
46 }
47 
68 class PotentialSelectorDialog : public QDialog
69 {
70  Q_OBJECT
71 
72  public:
74  QList<ConductorProperties> list,
75  QWidget *parent = nullptr);
76 
77  public:
78  explicit PotentialSelectorDialog(
79  Conductor *conductor,
80  QUndoCommand *parent_undo = nullptr,
81  QWidget *parent = nullptr);
82  explicit PotentialSelectorDialog(
83  Element *report,
84  QUndoCommand *parent_undo = nullptr,
85  QWidget *parent = nullptr);
86  ~PotentialSelectorDialog() override;
87 
88 
89  private slots:
90  void on_buttonBox_accepted();
91 
92  private:
93  void buildWidget();
94 
95  private:
96  Ui::PotentialSelectorDialog *ui;
99  QUndoCommand *m_parent_undo;
102  QList <ConductorProperties> m_properties_list;
103  QList <Conductor *> m_conductors_to_change;
104  int m_selected = 0;
105 };
106 #endif // POTENTIALSELECTORDIALOG_H
Element::Terminale
@ Terminale
Definition: element.h:57
Terminal::conductors
QList< Conductor * > conductors() const
Terminal::conductors.
Definition: terminal.cpp:715
Conductor::sequenceNum
autonum::sequentialNumbers sequenceNum
Definition: conductor.h:49
Element::linkType
virtual kind linkType() const
Definition: element.h:159
Conductor::terminal2
Terminal * terminal2
Definition: conductor.h:68
PotentialSelectorDialog::PotentialSelectorDialog
PotentialSelectorDialog(Conductor *conductor, QUndoCommand *parent_undo=nullptr, QWidget *parent=nullptr)
PotentialSelectorDialog::PotentialSelectorDialog Constructor when we link two potentiels together,...
Definition: potentialselectordialog.cpp:242
FormulaAssistantDialog::setForbiddenVariables
void setForbiddenVariables(const QStringList &list)
Definition: formulaassistantdialog.cpp:35
autonum::sequentialNumbers
Definition: assignvariables.h:35
AbstractPotentialSelector::m_properties_list_2
QList< ConductorProperties > m_properties_list_2
Definition: potentialselectordialog.h:40
Element::linkedElements
QList< Element * > linkedElements()
Element::linkedElements.
Definition: element.h:258
reportelement.h
AbstractPotentialSelector::m_conductors_list_1
QList< Conductor * > m_conductors_list_1
Definition: potentialselectordialog.h:41
AbstractPotentialSelector
Definition: potentialselectordialog.h:29
PotentialSelectorDialog::on_buttonBox_accepted
void on_buttonBox_accepted()
PotentialSelectorDialog::on_buttonBox_accepted Action when user click on OK button.
Definition: potentialselectordialog.cpp:386
QetGraphicsItem::diagram
Diagram * diagram() const
Definition: qetgraphicsitem.cpp:40
conductor.h
PotentialSelectorDialog::m_properties_list
QList< ConductorProperties > m_properties_list
Definition: potentialselectordialog.h:102
PotentialSelectorDialog::buildWidget
void buildWidget()
PotentialSelectorDialog::buildWidget Build the dialog.
Definition: potentialselectordialog.cpp:288
AbstractPotentialSelector::~AbstractPotentialSelector
virtual ~AbstractPotentialSelector()
Definition: potentialselectordialog.h:34
PotentialSelectorDialog::m_report
Element * m_report
Definition: potentialselectordialog.h:98
Conductor::diagram
Diagram * diagram() const
Definition: conductor.cpp:559
NewConductorPotentialSelector::~NewConductorPotentialSelector
~NewConductorPotentialSelector() override
Definition: potentialselectordialog.cpp:131
NewConductorPotentialSelector
The NewConductorPotentialSelector class Use for get the conductor propertie when two potentials is li...
Definition: potentialselectordialog.cpp:37
Element::linkToElement
virtual void linkToElement(Element *)
Definition: element.h:154
FormulaAssistantDialog
Definition: formulaassistantdialog.h:29
Terminal::parentElement
Element * parentElement() const
Terminal::parentElement.
Definition: terminal.cpp:822
assignvariables.h
NewConductorPotentialSelector::m_is_valid
bool m_is_valid
Definition: potentialselectordialog.cpp:134
AbstractPotentialSelector::m_seq_num_1
autonum::sequentialNumbers m_seq_num_1
Definition: potentialselectordialog.h:37
Conductor::terminal1
Terminal * terminal1
Definition: conductor.h:67
AbstractPotentialSelector::m_conductor_number_2
int m_conductor_number_2
Definition: potentialselectordialog.h:38
Diagram
The Diagram class This class represents an electric diagram. It manages its various child elements,...
Definition: diagram.h:56
PotentialSelectorDialog::m_conductors_to_change
QList< Conductor * > m_conductors_to_change
Definition: potentialselectordialog.h:103
NewConductorPotentialSelector::getPotential
void getPotential(Terminal *terminal, autonum::sequentialNumbers &seq_num, int &number, QList< ConductorProperties > &properties_list, QList< Conductor * > &c_list)
getPotential Get the conductor propertie of the potential at terminal, and the number of wire in this...
Definition: potentialselectordialog.cpp:82
FormulaAssistantDialog::setFormula
void setFormula(const QString &text)
Definition: formulaassistantdialog.cpp:45
Terminal::removeConductor
void removeConductor(Conductor *conductor)
Terminal::removeConductor Remove a conductor from this terminal.
Definition: terminal.cpp:239
PotentialSelectorDialog::m_conductor
Conductor * m_conductor
Definition: potentialselectordialog.h:97
ConductorProperties::applyForEqualAttributes
void applyForEqualAttributes(QList< ConductorProperties > list)
ConductorProperties::applyForEqualAttributes Test each attribute of properties in the list separatly....
Definition: conductorproperties.cpp:464
PotentialSelectorDialog::ui
Ui::PotentialSelectorDialog * ui
Definition: potentialselectordialog.h:96
potentialselectordialog.h
element.h
Conductor::properties
ConductorProperties properties
Definition: conductor.h:48
qpropertyundocommand.h
PotentialSelectorDialog::chosenProperties
static ConductorProperties chosenProperties(QList< ConductorProperties > list, QWidget *parent=nullptr)
Definition: potentialselectordialog.cpp:187
AbstractPotentialSelector::m_conductors_list_2
QList< Conductor * > m_conductors_list_2
Definition: potentialselectordialog.h:41
Element
Definition: element.h:41
ConductorProperties::m_function
QString m_function
Definition: conductorproperties.h:90
Element::isFree
bool isFree() const
Definition: element.h:230
Element::terminals
QList< Terminal * > terminals() const
Element::terminals.
Definition: element.cpp:136
Diagram::undoStack
QUndoStack & undoStack()
Diagram::undoStack.
Definition: diagram.h:397
Element::AllReport
@ AllReport
Definition: element.h:54
Terminal::addConductor
bool addConductor(Conductor *conductor)
Terminal::addConductor Add a conductor to this terminal.
Definition: terminal.cpp:215
conductorproperties.h
NewConductorPotentialSelector::isValid
bool isValid() const override
Definition: potentialselectordialog.cpp:70
Element::unlinkAllElements
virtual void unlinkAllElements()
Definition: element.h:155
Ui
Definition: autonumberingdockwidget.h:25
PotentialSelectorDialog::m_selected
int m_selected
Definition: potentialselectordialog.h:104
Conductor::relatedPotentialConductors
QSet< Conductor * > relatedPotentialConductors(const bool all_diagram=true, QList< Terminal * > *t_list=nullptr)
Conductor::relatedPotentialConductors Return all conductors at the same potential of this conductor,...
Definition: conductor.cpp:1647
PotentialSelectorDialog::~PotentialSelectorDialog
~PotentialSelectorDialog() override
Definition: potentialselectordialog.cpp:278
PotentialSelectorDialog::m_sequential_num
autonum::sequentialNumbers m_sequential_num
Definition: potentialselectordialog.h:100
ConductorProperties::m_formula
QString m_formula
Definition: conductorproperties.h:94
PotentialSelectorDialog::m_potential_selector
AbstractPotentialSelector * m_potential_selector
Definition: potentialselectordialog.h:101
AbstractPotentialSelector::m_conductor_number_1
int m_conductor_number_1
Definition: potentialselectordialog.h:38
PotentialSelectorDialog
The PotentialSelectorDialog class This dialog is used when user try to connect two existing potential...
Definition: potentialselectordialog.h:69
ConductorProperties
The ConductorProperties class This class represents the functional properties of a particular conduct...
Definition: conductorproperties.h:68
AbstractPotentialSelector::m_seq_num_2
autonum::sequentialNumbers m_seq_num_2
Definition: potentialselectordialog.h:37
AbstractPotentialSelector::AbstractPotentialSelector
AbstractPotentialSelector()
Definition: potentialselectordialog.h:31
PotentialSelectorDialog::m_parent_undo
QUndoCommand * m_parent_undo
Definition: potentialselectordialog.h:99
AbstractPotentialSelector::m_properties_list_1
QList< ConductorProperties > m_properties_list_1
Definition: potentialselectordialog.h:39
FormulaAssistantDialog::formula
QString formula() const
Definition: formulaassistantdialog.cpp:50
Element::conductors
QList< Conductor * > conductors() const
Element::conductors.
Definition: element.cpp:146
Conductor
Definition: conductor.h:43
terminal.h
ConductorProperties::m_wire_color
QString m_wire_color
Definition: conductorproperties.h:92
Terminal
The Terminal class This class represents a terminal of an electrical element, i.e....
Definition: terminal.h:35
QPropertyUndoCommand
The QPropertyUndoCommand class This undo command manage QProperty of a QObject. This undo command can...
Definition: qpropertyundocommand.h:34
ConductorProperties::text
QString text
Definition: conductorproperties.h:89
ConductorProperties::m_tension_protocol
QString m_tension_protocol
Definition: conductorproperties.h:91
NewConductorPotentialSelector::NewConductorPotentialSelector
NewConductorPotentialSelector(Conductor *conductor)
Definition: potentialselectordialog.cpp:39
QET::Icons::tr
QIcon tr
Definition: qeticons.cpp:206
ConductorProperties::m_wire_section
QString m_wire_section
Definition: conductorproperties.h:93
diagram.h
FormulaAssistantDialog::setText
void setText(const QString &text)
Definition: formulaassistantdialog.cpp:40
AbstractPotentialSelector::isValid
virtual bool isValid() const =0
formulaassistantdialog.h