164{
166
167 data.plotSyncMachine = m_checkBoxPlotSyncMachine->GetValue();
168
169 if (!m_syncGenerator->
DoubleFromString(m_parent, m_textCtrlInertia->GetValue(), data.inertia,
170 _("Value entered incorrectly in the field \"Inertia\".")))
171 return false;
172
173 if (!m_syncGenerator->
DoubleFromString(m_parent, m_textCtrlDamping->GetValue(), data.damping,
174 _("Value entered incorrectly in the field \"Damping factor\".")))
175 return false;
176
177 data.useAVR = m_checkBoxUseAVR->GetValue();
178 data.useSpeedGovernor = m_checkBoxUseSG->GetValue();
179
180 if (!m_syncGenerator->
DoubleFromString(m_parent, m_textCtrlRa->GetValue(), data.armResistance,
181 _("Value entered incorrectly in the field \"Armature resistance\".")))
182 return false;
183
184 if (!m_syncGenerator->
DoubleFromString(m_parent, m_textCtrlXp->GetValue(), data.potierReactance,
185 _("Value entered incorrectly in the field \"Potier reactance\".")))
186 return false;
187
188 if (!m_syncGenerator->
DoubleFromString(m_parent, m_textCtrlSat->GetValue(), data.satFactor,
189 _("Value entered incorrectly in the field \"Saturation factor\".")))
190 return false;
191
192 if (!m_syncGenerator->
DoubleFromString(m_parent, m_textCtrlOCFreq->GetValue(), data.ocFrequency,
193 _("Value entered incorrectly in the field \"Open-circuit frequency\".")))
194 return false;
195
196 if (!m_syncGenerator->
DoubleFromString(m_parent, m_textCtrlSyncXd->GetValue(), data.syncXd,
197 _("Value entered incorrectly in the field \"Synchronous direct-axis reactance\".")))
198 return false;
199
200 if (!m_syncGenerator->
DoubleFromString(m_parent, m_textCtrlSyncXq->GetValue(), data.syncXq,
201 _("Value entered incorrectly in the field \"Synchronous quadrature-axis reactance\".")))
202 return false;
203
204 if (!m_syncGenerator->
DoubleFromString(m_parent, m_textCtrlTranXd->GetValue(), data.transXd,
205 _("Value entered incorrectly in the field \"Transitory direct-axis reactance\".")))
206 return false;
207
208 if (!m_syncGenerator->
DoubleFromString(m_parent, m_textCtrlTranXq->GetValue(), data.transXq,
209 _("Value entered incorrectly in the field \"Transitory quadrature-axis reactance\".")))
210 return false;
211
212 if (!m_syncGenerator->
DoubleFromString(m_parent, m_textCtrlTranTd0->GetValue(), data.transTd0,
213 _("Value entered incorrectly in the field \"Transitory direct-axis time constant\".")))
214 return false;
215
216 if (!m_syncGenerator->
DoubleFromString(m_parent, m_textCtrlTranTq0->GetValue(), data.transTq0,
217 _("Value entered incorrectly in the field \"Transitory quadrature-axis time constant\".")))
218 return false;
219
220 if (!m_syncGenerator->
DoubleFromString(m_parent, m_textCtrlSubXd->GetValue(), data.subXd,
221 _("Value entered incorrectly in the field \"Subtransitory direct-axis reactance\".")))
222 return false;
223
224 if (!m_syncGenerator->
DoubleFromString(m_parent, m_textCtrlSubXq->GetValue(), data.subXq,
225 _("Value entered incorrectly in the field \"Subtransitory quadrature-axis reactance\".")))
226 return false;
227
228 if (!m_syncGenerator->
DoubleFromString(m_parent, m_textCtrlSubTd0->GetValue(), data.subTd0,
229 _("Value entered incorrectly in the field \"Subtransitory direct-axis time constant\".")))
230 return false;
231
232 if (!m_syncGenerator->
DoubleFromString(m_parent, m_textCtrlSubTq0->GetValue(), data.subTq0,
233 _("Value entered incorrectly in the field \"Subtransitory quadrature-axis time constant\".")))
234 return false;
235
236 m_syncGenerator->SetElectricalData(data);
237
238 return true;
239}
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.