summaryrefslogtreecommitdiffstats
path: root/Project/BusForm.cpp
diff options
context:
space:
mode:
authorThales1330 <thaleslima.ufu@gmail.com>2016-09-23 17:46:10 -0300
committerThales1330 <thaleslima.ufu@gmail.com>2016-09-23 17:46:10 -0300
commita9dd78afddeb706df6652eb91f229a74fd073846 (patch)
treedfc6130a9c9c5022fcb2baae3f6cf238a99786e8 /Project/BusForm.cpp
parent1088617b8f1c31af3ad6a87f9934f7a55240b3a2 (diff)
downloadPSP.git-a9dd78afddeb706df6652eb91f229a74fd073846.tar.gz
PSP.git-a9dd78afddeb706df6652eb91f229a74fd073846.tar.xz
PSP.git-a9dd78afddeb706df6652eb91f229a74fd073846.zip
Generator form implemented
Diffstat (limited to 'Project/BusForm.cpp')
-rw-r--r--Project/BusForm.cpp71
1 files changed, 71 insertions, 0 deletions
diff --git a/Project/BusForm.cpp b/Project/BusForm.cpp
index 02497eb..c9d78a6 100644
--- a/Project/BusForm.cpp
+++ b/Project/BusForm.cpp
@@ -100,6 +100,77 @@ void BusForm::OnButtonOKClick(wxCommandEvent& event)
data.controlledVoltageUnitChoice = m_choiceCtrlVoltage->GetSelection();
}
data.slackBus = m_checkBoxSlackBus->GetValue();
+
+ data.hasFault = m_checkBoxFault->GetValue();
+ switch(m_choiceFaultType->GetSelection())
+ {
+ case 0:
+ {
+ data.faultType = FAULT_THREEPHASE;
+ }
+ break;
+ case 1:
+ {
+ data.faultType = FAULT_2LINE;
+ }
+ break;
+ case 2:
+ {
+ data.faultType = FAULT_2LINE_GROUND;
+ }
+ break;
+ case 3:
+ {
+ data.faultType = FAULT_LINE_GROUND;
+ }
+ break;
+ }
+
+ switch(m_choiceFaultPlace->GetSelection())
+ {
+ case 0:
+ {
+ data.faultLocation = FAULT_LINE_A;
+ }
+ break;
+ case 1:
+ {
+ data.faultLocation = FAULT_LINE_B;
+ }
+ break;
+ case 2:
+ {
+ data.faultLocation = FAULT_LINE_C;
+ }
+ break;
+ }
+
+ if(!m_bus->DoubleFromString(m_parent, m_textCtrlFaultResistance->GetValue(), data.faultResistance,
+ _("Value entered incorrectly in the field \"Fault resistance\".")))
+ return;
+
+ if(!m_bus->DoubleFromString(m_parent, m_textCtrlFaultReactance->GetValue(), data.faultReactance,
+ _("Value entered incorrectly in the field \"Fault reactance\".")))
+ return;
+
+ data.plotBus = m_checkBoxPlotData->GetValue();
+ data.stabHasFault = m_checkBoxStabFault->GetValue();
+
+ if(!m_bus->DoubleFromString(m_parent, m_textCtrlStabFaultTime->GetValue(), data.stabFaultTime,
+ _("Value entered incorrectly in the field \"Time\".")))
+ return;
+
+ if(!m_bus->DoubleFromString(m_parent, m_textCtrlStabFaultLength->GetValue(), data.stabFaultLength,
+ _("Value entered incorrectly in the field \"Fault lenght\".")))
+ return;
+
+ if(!m_bus->DoubleFromString(m_parent, m_textCtrlStabFaultResistance->GetValue(), data.stabFaultResistance,
+ _("Value entered incorrectly in the field \"Fault resistence (stability)\".")))
+ return;
+
+ if(!m_bus->DoubleFromString(m_parent, m_textCtrlStabFaultReactance->GetValue(), data.stabFaultReactance,
+ _("Value entered incorrectly in the field \"Fault reactance (stability)\".")))
+ return;
m_bus->SetElectricalData(data);