summaryrefslogtreecommitdiffstats
path: root/Project/GeneratorStabForm.cpp
diff options
context:
space:
mode:
authorThales Lima Oliveira <thaleslima.ufu@gmail.com>2017-05-15 21:50:48 -0300
committerThales Lima Oliveira <thaleslima.ufu@gmail.com>2017-05-15 21:50:48 -0300
commitc6c3ff70bfceac839af471c11fc8aa04060517b0 (patch)
treee87dec2ca89d48098cf2cca4ca6df198c7a273d5 /Project/GeneratorStabForm.cpp
parent17d1dd82ec065eff08546ef1fd2a188ce77471b2 (diff)
downloadPSP.git-c6c3ff70bfceac839af471c11fc8aa04060517b0.tar.gz
PSP.git-c6c3ff70bfceac839af471c11fc8aa04060517b0.tar.xz
PSP.git-c6c3ff70bfceac839af471c11fc8aa04060517b0.zip
Control test and sync generator control implemented
Text buggy when opens
Diffstat (limited to 'Project/GeneratorStabForm.cpp')
-rw-r--r--Project/GeneratorStabForm.cpp62
1 files changed, 45 insertions, 17 deletions
diff --git a/Project/GeneratorStabForm.cpp b/Project/GeneratorStabForm.cpp
index a5f2098..d032520 100644
--- a/Project/GeneratorStabForm.cpp
+++ b/Project/GeneratorStabForm.cpp
@@ -1,6 +1,8 @@
#include "GeneratorStabForm.h"
#include "SwitchingForm.h"
#include "SyncGenerator.h"
+#include "ControlEditor.h"
+#include "ControlElementContainer.h"
GeneratorStabForm::GeneratorStabForm(wxWindow* parent, SyncGenerator* syncGenerator) : GeneratorStabFormBase(parent)
{
@@ -40,13 +42,39 @@ GeneratorStabForm::GeneratorStabForm(wxWindow* parent, SyncGenerator* syncGenera
GeneratorStabForm::~GeneratorStabForm() {}
void GeneratorStabForm::OnCancelButtonClick(wxCommandEvent& event) { EndModal(wxID_CANCEL); }
-void GeneratorStabForm::OnEditAVRButtonClick(wxCommandEvent& event) {}
+void GeneratorStabForm::OnEditAVRButtonClick(wxCommandEvent& event)
+{
+ SyncGeneratorElectricalData data = m_syncGenerator->GetElectricalData();
+ if(!data.avr) {
+ data.avr = new ControlElementContainer();
+ m_syncGenerator->SetElectricalData(data);
+ }
+ ControlEditor* cEditor = new ControlEditor(m_parent, IOControl::IN_TERMINAL_VOLTAGE | IOControl::OUT_FIELD_VOLTAGE);
+ cEditor->SetElementsList(data.avr->GetControlElementsList());
+ cEditor->SetConnectionsList(data.avr->GetConnectionLineList());
+ cEditor->SetControlContainer(data.avr);
+ cEditor->Show();
+}
+
void GeneratorStabForm::OnOKButtonClick(wxCommandEvent& event)
{
if(ValidateData()) EndModal(wxID_OK);
}
-void GeneratorStabForm::OnSpeedGovernorButtonClick(wxCommandEvent& event) {}
+void GeneratorStabForm::OnSpeedGovernorButtonClick(wxCommandEvent& event)
+{
+ SyncGeneratorElectricalData data = m_syncGenerator->GetElectricalData();
+ if(!data.speedGov) {
+ data.speedGov = new ControlElementContainer();
+ m_syncGenerator->SetElectricalData(data);
+ }
+ ControlEditor* cEditor = new ControlEditor(m_parent, IOControl::IN_VELOCITY | IOControl::OUT_MEC_POWER);
+ cEditor->SetElementsList(data.speedGov->GetControlElementsList());
+ cEditor->SetConnectionsList(data.speedGov->GetConnectionLineList());
+ cEditor->SetControlContainer(data.speedGov);
+ cEditor->Show();
+}
+
void GeneratorStabForm::OnSwitchingButtonClick(wxCommandEvent& event)
{
if(ValidateData()) {
@@ -65,76 +93,76 @@ bool GeneratorStabForm::ValidateData()
if(!m_syncGenerator->DoubleFromString(m_parent, m_textCtrlInertia->GetValue(), data.inertia,
_("Value entered incorrectly in the field \"Inertia\".")))
- return false;
+ return false;
if(!m_syncGenerator->DoubleFromString(m_parent, m_textCtrlDamping->GetValue(), data.damping,
_("Value entered incorrectly in the field \"Damping factor\".")))
- return false;
+ return false;
data.useAVR = m_checkBoxUseAVR->GetValue();
data.useSpeedGovernor = m_checkBoxUseSG->GetValue();
if(!m_syncGenerator->DoubleFromString(m_parent, m_textCtrlRa->GetValue(), data.armResistance,
_("Value entered incorrectly in the field \"Armature resistance\".")))
- return false;
+ return false;
if(!m_syncGenerator->DoubleFromString(m_parent, m_textCtrlXp->GetValue(), data.potierReactance,
_("Value entered incorrectly in the field \"Potier reactance\".")))
- return false;
+ return false;
if(!m_syncGenerator->DoubleFromString(m_parent, m_textCtrlSat->GetValue(), data.satFactor,
_("Value entered incorrectly in the field \"Saturation factor\".")))
- return false;
+ return false;
if(!m_syncGenerator->DoubleFromString(
m_parent, m_textCtrlSyncXd->GetValue(), data.syncXd,
_("Value entered incorrectly in the field \"Synchronous direct-axis reactance\".")))
- return false;
+ return false;
if(!m_syncGenerator->DoubleFromString(
m_parent, m_textCtrlSyncXq->GetValue(), data.syncXq,
_("Value entered incorrectly in the field \"Synchronous quadrature-axis reactance\".")))
- return false;
+ return false;
if(!m_syncGenerator->DoubleFromString(
m_parent, m_textCtrlTranXd->GetValue(), data.transXd,
_("Value entered incorrectly in the field \"Transitory direct-axis reactance\".")))
- return false;
+ return false;
if(!m_syncGenerator->DoubleFromString(
m_parent, m_textCtrlTranXq->GetValue(), data.transXq,
_("Value entered incorrectly in the field \"Transitory quadrature-axis reactance\".")))
- return false;
+ return false;
if(!m_syncGenerator->DoubleFromString(
m_parent, m_textCtrlTranTd0->GetValue(), data.transTd0,
_("Value entered incorrectly in the field \"Transitory direct-axis time constant\".")))
- return false;
+ return false;
if(!m_syncGenerator->DoubleFromString(
m_parent, m_textCtrlTranTq0->GetValue(), data.transTq0,
_("Value entered incorrectly in the field \"Transitory quadrature-axis time constant\".")))
- return false;
+ return false;
if(!m_syncGenerator->DoubleFromString(
m_parent, m_textCtrlSubXd->GetValue(), data.subXd,
_("Value entered incorrectly in the field \"Subtransitory direct-axis reactance\".")))
- return false;
+ return false;
if(!m_syncGenerator->DoubleFromString(
m_parent, m_textCtrlSubXq->GetValue(), data.subXq,
_("Value entered incorrectly in the field \"Subtransitory quadrature-axis reactance\".")))
- return false;
+ return false;
if(!m_syncGenerator->DoubleFromString(
m_parent, m_textCtrlSubTd0->GetValue(), data.subTd0,
_("Value entered incorrectly in the field \"Subtransitory direct-axis time constant\".")))
- return false;
+ return false;
if(!m_syncGenerator->DoubleFromString(
m_parent, m_textCtrlSubTq0->GetValue(), data.subTq0,
_("Value entered incorrectly in the field \"Subtransitory quadrature-axis time constant\".")))
- return false;
+ return false;
m_syncGenerator->SetElectricalData(data);