Form to edit the reactive shunt element power data.
More...
#include <ReactiveShuntElementForm.h>
Form to edit the reactive shunt element power data.
- Author
- Thales Lima Oliveira thale.nosp@m.s@uf.nosp@m.u.br
- Date
- 05/10/2017
Definition at line 34 of file ReactiveShuntElementForm.h.
◆ ReactiveShuntElementForm() [1/2]
| ReactiveShuntElementForm::ReactiveShuntElementForm |
( |
wxWindow * |
parent, |
|
|
Capacitor * |
capacitor |
|
) |
| |
Definition at line 23 of file ReactiveShuntElementForm.cpp.
24 : ReactiveShuntElementFormBase(parent)
25{
26 SetSize(GetBestSize());
28
29 m_textCtrlName->SetValue(data.name);
30
32 switch(data.reactivePowerUnit) {
34 m_choiceReactivePower->SetSelection(0);
35 } break;
37 m_choiceReactivePower->SetSelection(1);
38 } break;
40 m_choiceReactivePower->SetSelection(2);
41 } break;
43 m_choiceReactivePower->SetSelection(3);
44 } break;
45 default:
46 break;
47 }
48
49 m_parent = parent;
50 m_capacitor = capacitor;
51}
static wxString StringFromDouble(double value, int minDecimal=1, int maxDecimals=13)
Convert a double value to string.
◆ ReactiveShuntElementForm() [2/2]
| ReactiveShuntElementForm::ReactiveShuntElementForm |
( |
wxWindow * |
parent, |
|
|
Inductor * |
inductor |
|
) |
| |
Definition at line 53 of file ReactiveShuntElementForm.cpp.
54 : ReactiveShuntElementFormBase(parent)
55{
57
58 m_textCtrlName->SetValue(data.name);
59
61 switch(data.reactivePowerUnit) {
63 m_choiceReactivePower->SetSelection(0);
64 } break;
66 m_choiceReactivePower->SetSelection(1);
67 } break;
69 m_choiceReactivePower->SetSelection(2);
70 } break;
72 m_choiceReactivePower->SetSelection(3);
73 } break;
74 default:
75 break;
76 }
77
78 m_parent = parent;
79 m_inductor = inductor;
80}
◆ ~ReactiveShuntElementForm()
| ReactiveShuntElementForm::~ReactiveShuntElementForm |
( |
| ) |
|
|
virtual |
◆ OnCancelButtonClick()
| virtual void ReactiveShuntElementForm::OnCancelButtonClick |
( |
wxCommandEvent & |
event | ) |
|
|
inlineprotectedvirtual |
◆ OnOKButtonClick()
| void ReactiveShuntElementForm::OnOKButtonClick |
( |
wxCommandEvent & |
event | ) |
|
|
protectedvirtual |
◆ OnStabilityButtonClick()
| void ReactiveShuntElementForm::OnStabilityButtonClick |
( |
wxCommandEvent & |
event | ) |
|
|
protectedvirtual |
Definition at line 88 of file ReactiveShuntElementForm.cpp.
89{
90 if(ValidateData()) {
91 if(m_capacitor) {
93 swForm.SetTitle(_("Capacitor: Switching"));
94 swForm.ShowModal();
95 } else if(m_inductor) {
97 swForm.SetTitle(_("Inductor: Switching"));
98 swForm.ShowModal();
99 }
100
101 EndModal(wxID_OK);
102 }
103}
◆ ValidateData()
| bool ReactiveShuntElementForm::ValidateData |
( |
| ) |
|
|
virtual |
Definition at line 105 of file ReactiveShuntElementForm.cpp.
106{
107 if(m_capacitor) {
109
110 data.name = m_textCtrlName->GetValue();
111
112 if(!m_capacitor->
DoubleFromString(m_parent, m_textCtrlReactivePower->GetValue(), data.reactivePower,
113 _("Value entered incorrectly in the field \"Reactive power\".")))
114 return false;
115 switch(m_choiceReactivePower->GetSelection()) {
116 case 0: {
118 } break;
119 case 1: {
121 } break;
122 case 2: {
124 } break;
125 case 3: {
127 } break;
128 }
129
130 m_capacitor->SetElectricalData(data);
131 } else if(m_inductor) {
133
134 data.name = m_textCtrlName->GetValue();
135
136 if(!m_inductor->
DoubleFromString(m_parent, m_textCtrlReactivePower->GetValue(), data.reactivePower,
137 _("Value entered incorrectly in the field \"Reactive power\".")))
138 return false;
139 switch(m_choiceReactivePower->GetSelection()) {
140 case 0: {
142 } break;
143 case 1: {
145 } break;
146 case 2: {
148 } break;
149 case 3: {
151 } break;
152 }
153
154 m_inductor->SetElectricalData(data);
155 }
156 return true;
157}
static bool DoubleFromString(wxWindow *parent, wxString strValue, double &value, wxString errorMsg)
Get a double value from a string. Show a error message if the conversion fail.
◆ m_capacitor
| Capacitor* ReactiveShuntElementForm::m_capacitor = nullptr |
|
protected |
◆ m_inductor
| Inductor* ReactiveShuntElementForm::m_inductor = nullptr |
|
protected |
◆ m_parent
| wxWindow* ReactiveShuntElementForm::m_parent |
|
protected |
The documentation for this class was generated from the following files: