136{
138
139 data.plotSyncMachine = m_checkBoxPlotSyncMachine->GetValue();
140
141 if (!m_syncGenerator->
DoubleFromString(m_parent, m_textCtrlInertia->GetValue(), data.inertia,
142 _("Value entered incorrectly in the field \"Inertia\".")))
143 return false;
144
145 if (!m_syncGenerator->
DoubleFromString(m_parent, m_textCtrlDamping->GetValue(), data.damping,
146 _("Value entered incorrectly in the field \"Damping factor\".")))
147 return false;
148
149 data.useAVR = m_checkBoxUseAVR->GetValue();
150 data.useSpeedGovernor = m_checkBoxUseSG->GetValue();
151
152 if (!m_syncGenerator->
DoubleFromString(m_parent, m_textCtrlRa->GetValue(), data.armResistance,
153 _("Value entered incorrectly in the field \"Armature resistance\".")))
154 return false;
155
156 if (!m_syncGenerator->
DoubleFromString(m_parent, m_textCtrlXp->GetValue(), data.potierReactance,
157 _("Value entered incorrectly in the field \"Potier reactance\".")))
158 return false;
159
160 if (!m_syncGenerator->
DoubleFromString(m_parent, m_textCtrlSat->GetValue(), data.satFactor,
161 _("Value entered incorrectly in the field \"Saturation factor\".")))
162 return false;
163
164 if (!m_syncGenerator->
DoubleFromString(m_parent, m_textCtrlOCFreq->GetValue(), data.ocFrequency,
165 _("Value entered incorrectly in the field \"Open-circuit frequency\".")))
166 return false;
167
168 if (!m_syncGenerator->
DoubleFromString(m_parent, m_textCtrlSyncXd->GetValue(), data.syncXd,
169 _("Value entered incorrectly in the field \"Synchronous direct-axis reactance\".")))
170 return false;
171
172 if (!m_syncGenerator->
DoubleFromString(m_parent, m_textCtrlSyncXq->GetValue(), data.syncXq,
173 _("Value entered incorrectly in the field \"Synchronous quadrature-axis reactance\".")))
174 return false;
175
176 if (!m_syncGenerator->
DoubleFromString(m_parent, m_textCtrlTranXd->GetValue(), data.transXd,
177 _("Value entered incorrectly in the field \"Transitory direct-axis reactance\".")))
178 return false;
179
180 if (!m_syncGenerator->
DoubleFromString(m_parent, m_textCtrlTranXq->GetValue(), data.transXq,
181 _("Value entered incorrectly in the field \"Transitory quadrature-axis reactance\".")))
182 return false;
183
184 if (!m_syncGenerator->
DoubleFromString(m_parent, m_textCtrlTranTd0->GetValue(), data.transTd0,
185 _("Value entered incorrectly in the field \"Transitory direct-axis time constant\".")))
186 return false;
187
188 if (!m_syncGenerator->
DoubleFromString(m_parent, m_textCtrlTranTq0->GetValue(), data.transTq0,
189 _("Value entered incorrectly in the field \"Transitory quadrature-axis time constant\".")))
190 return false;
191
192 if (!m_syncGenerator->
DoubleFromString(m_parent, m_textCtrlSubXd->GetValue(), data.subXd,
193 _("Value entered incorrectly in the field \"Subtransitory direct-axis reactance\".")))
194 return false;
195
196 if (!m_syncGenerator->
DoubleFromString(m_parent, m_textCtrlSubXq->GetValue(), data.subXq,
197 _("Value entered incorrectly in the field \"Subtransitory quadrature-axis reactance\".")))
198 return false;
199
200 if (!m_syncGenerator->
DoubleFromString(m_parent, m_textCtrlSubTd0->GetValue(), data.subTd0,
201 _("Value entered incorrectly in the field \"Subtransitory direct-axis time constant\".")))
202 return false;
203
204 if (!m_syncGenerator->
DoubleFromString(m_parent, m_textCtrlSubTq0->GetValue(), data.subTq0,
205 _("Value entered incorrectly in the field \"Subtransitory quadrature-axis time constant\".")))
206 return false;
207
208 m_syncGenerator->SetElectricalData(data);
209
210 return true;
211}
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.