From 2b7409b5dd3714d14112e40a1ead8776a6da1576 Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Wed, 11 Apr 2018 20:00:20 -0300 Subject: Some minor improvements --- Project/MainFrame.cpp | 2 ++ Project/SimulationsSettingsForm.cpp | 1 + 2 files changed, 3 insertions(+) (limited to 'Project') diff --git a/Project/MainFrame.cpp b/Project/MainFrame.cpp index 7d129b4..5afff94 100644 --- a/Project/MainFrame.cpp +++ b/Project/MainFrame.cpp @@ -63,6 +63,7 @@ MainFrame::MainFrame(wxWindow* parent, wxLocale* locale, PropertiesData* initPro m_auiNotebook->Layout(); newWorkspace->Redraw(); newWorkspace->SetJustOpened(true); + newWorkspace->Fit(); m_projectNumber++; } } @@ -299,6 +300,7 @@ void MainFrame::OnOpenClick(wxRibbonButtonBarEvent& event) m_auiNotebook->Layout(); newWorkspace->Redraw(); newWorkspace->SetJustOpened(true); + newWorkspace->Fit(); m_projectNumber++; } else { wxMessageDialog msgDialog(this, _("It was not possible to open the selected file."), _("Error"), diff --git a/Project/SimulationsSettingsForm.cpp b/Project/SimulationsSettingsForm.cpp index 1e32b1d..b7878d5 100644 --- a/Project/SimulationsSettingsForm.cpp +++ b/Project/SimulationsSettingsForm.cpp @@ -56,6 +56,7 @@ SimulationsSettingsForm::SimulationsSettingsForm(wxWindow* parent, PropertiesDat m_textCtrlAccFactor->SetValue(Element::StringFromDouble(data.accFator)); m_textCtrlPFTolerance->SetValue(wxString::Format("%g", data.powerFlowTolerance)); m_textCtrlPFMaxIterations->SetValue(wxString::Format("%d", data.powerFlowMaxIterations)); + m_textCtrlPFSlackBusAngle->SetValue(Element::StringFromDouble(data.initAngle)); m_textCtrlTimeStep->SetValue(wxString::Format("%g", data.timeStep)); m_textCtrlSimTime->SetValue(Element::StringFromDouble(data.stabilitySimulationTime)); m_textCtrlFreq->SetValue(Element::StringFromDouble(data.stabilityFrequency)); -- cgit From 726ec7832947397e61196e94f2f3ee66d6f6340d Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Thu, 3 May 2018 17:22:22 -0300 Subject: Clipboard fix --- Project/DataReport.cpp | 11 ++++++----- Project/Project.project | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'Project') diff --git a/Project/DataReport.cpp b/Project/DataReport.cpp index 2742471..1511079 100644 --- a/Project/DataReport.cpp +++ b/Project/DataReport.cpp @@ -1030,11 +1030,12 @@ void DataReport::GridKeyHandler(wxGrid* grid, wxKeyEvent& event) } } } - - wxOpenClipboard(); - wxEmptyClipboard(); - wxSetClipboardData(wxDF_TEXT, copyData.mb_str(), 0, 0); // In Windows need this for UNICODE - wxCloseClipboard(); + + if (wxTheClipboard->Open()) + { + wxTheClipboard->SetData(new wxTextDataObject(copyData)); + wxTheClipboard->Close(); + } } else if(event.GetKeyCode() == 'A' && event.GetModifiers() == wxMOD_CONTROL) { // Select all grid->SelectAll(); } diff --git a/Project/Project.project b/Project/Project.project index 1447966..2d8fb46 100644 --- a/Project/Project.project +++ b/Project/Project.project @@ -513,7 +513,7 @@ - + -- cgit From 7ddd1d26ad13ad23f520dff08485ef2794d5958b Mon Sep 17 00:00:00 2001 From: Thales Lima Date: Tue, 15 May 2018 13:42:48 -0300 Subject: Linux bugfixes --- Project/MathExpression.cpp | 2 +- Project/Project.project | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'Project') diff --git a/Project/MathExpression.cpp b/Project/MathExpression.cpp index 1657880..066825f 100644 --- a/Project/MathExpression.cpp +++ b/Project/MathExpression.cpp @@ -122,7 +122,7 @@ void MathExpression::Draw(wxPoint2DDouble translation, double scale) const DrawNodes(); } -bool MathExpression::ShowForm(wxWindowMSW* parent, Element* element) +bool MathExpression::ShowForm(wxWindow* parent, Element* element) { MathExpressionForm* mathExprForm = new MathExpressionForm(parent, this); if(mathExprForm->ShowModal() == wxID_OK) { diff --git a/Project/Project.project b/Project/Project.project index 2d8fb46..882f7a2 100644 --- a/Project/Project.project +++ b/Project/Project.project @@ -428,7 +428,7 @@ - + -- cgit From 73e934c17098281ffccd214f7517cd0f6ce03ab6 Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Sat, 14 Jul 2018 09:04:40 -0300 Subject: fault and control system implementation error fixed --- Project/ElectricCalculation.cpp | 5 +++-- Project/ElectricCalculation.h | 3 ++- Project/Electromechanical.cpp | 2 +- Project/Fault.cpp | 6 +++--- Project/TransferFunction.cpp | 5 +++-- 5 files changed, 12 insertions(+), 9 deletions(-) (limited to 'Project') diff --git a/Project/ElectricCalculation.cpp b/Project/ElectricCalculation.cpp index 36e7a9a..af3173b 100644 --- a/Project/ElectricCalculation.cpp +++ b/Project/ElectricCalculation.cpp @@ -74,7 +74,8 @@ bool ElectricCalculation::GetYBus(std::vector > double systemPowerBase, YBusSequence sequence, bool includeSyncMachines, - bool allLoadsAsImpedances) + bool allLoadsAsImpedances, + bool usePowerFlowVoltagesOnImpedances) { if(m_busList.size() == 0) return false; @@ -106,7 +107,7 @@ bool ElectricCalculation::GetYBus(std::vector > LoadElectricalData data = load->GetPUElectricalData(systemPowerBase); if(data.loadType == CONST_IMPEDANCE || allLoadsAsImpedances) { std::complex yLoad = std::complex(data.activePower, -data.reactivePower); - if(allLoadsAsImpedances) { + if(allLoadsAsImpedances && usePowerFlowVoltagesOnImpedances) { std::complex v = static_cast(load->GetParentList()[0])->GetElectricalData().voltage; yLoad /= (std::abs(v) * std::abs(v)); } diff --git a/Project/ElectricCalculation.h b/Project/ElectricCalculation.h index 9dee71a..855f02f 100644 --- a/Project/ElectricCalculation.h +++ b/Project/ElectricCalculation.h @@ -94,7 +94,8 @@ class ElectricCalculation double systemPowerBase, YBusSequence sequence = POSITIVE_SEQ, bool includeSyncMachines = false, - bool allLoadsAsImpedances = false); + bool allLoadsAsImpedances = false, + bool usePowerFlowVoltagesOnImpedances = false); /** * @brief Invert a matrix. diff --git a/Project/Electromechanical.cpp b/Project/Electromechanical.cpp index ea8b1bb..d140215 100644 --- a/Project/Electromechanical.cpp +++ b/Project/Electromechanical.cpp @@ -73,7 +73,7 @@ bool Electromechanical::RunStabilityCalculation() SetSyncMachinesModel(); // Calculate the admittance matrix with the synchronous machines. - if(!GetYBus(m_yBus, m_powerSystemBase, POSITIVE_SEQ, false, true)) { + if(!GetYBus(m_yBus, m_powerSystemBase, POSITIVE_SEQ, false, true, true)) { m_errorMsg = _("It was not possible to build the admittance matrix."); return false; } diff --git a/Project/Fault.cpp b/Project/Fault.cpp index 3d335fd..a71d2ce 100644 --- a/Project/Fault.cpp +++ b/Project/Fault.cpp @@ -34,11 +34,11 @@ bool Fault::RunFaultCalculation(double systemPowerBase) // Get adimittance matrices. std::vector > > yBusPos; - GetYBus(yBusPos, systemPowerBase, POSITIVE_SEQ, true); + GetYBus(yBusPos, systemPowerBase, POSITIVE_SEQ, true, true); std::vector > > yBusNeg; - GetYBus(yBusNeg, systemPowerBase, NEGATIVE_SEQ, true); + GetYBus(yBusNeg, systemPowerBase, NEGATIVE_SEQ, true, true); std::vector > > yBusZero; - GetYBus(yBusZero, systemPowerBase, ZERO_SEQ, true); + GetYBus(yBusZero, systemPowerBase, ZERO_SEQ, true, true); // Calculate the impedance matrices. if(!InvertMatrix(yBusPos, m_zBusPos)) { diff --git a/Project/TransferFunction.cpp b/Project/TransferFunction.cpp index 8e7b68f..b78d74a 100644 --- a/Project/TransferFunction.cpp +++ b/Project/TransferFunction.cpp @@ -291,10 +291,11 @@ void TransferFunction::CalculateSpaceState(int maxIteration, double error) } for(int i = 0; i < order - 1; i++) { ss.A[order - 2][i] = -(denominator[order - 1 - i] / denominator[0]); - ss.C[i] = (numerator[order - 1 - i] - denominator[order - 1 - i] * numerator[0]) / denominator[0]; + ss.C[i] = numerator[order - 1 - i] / denominator[0] - + (denominator[order - 1 - i] / denominator[0]) * (numerator[0] / denominator[0]); } ss.B[order - 2] = 1.0; - ss.D = numerator[0]; + ss.D = numerator[0] / denominator[0]; m_ss = ss; -- cgit From f4de628c999810808d961899299686a9f0c50b5b Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Sat, 14 Jul 2018 13:08:45 -0300 Subject: Some vector pre-allocation and test curves implementation --- Project/Electromechanical.cpp | 57 ++++++++++++++++++++++++++++++++++--------- Project/Electromechanical.h | 8 ++++++ Project/Workspace.cpp | 6 +++++ 3 files changed, 60 insertions(+), 11 deletions(-) (limited to 'Project') diff --git a/Project/Electromechanical.cpp b/Project/Electromechanical.cpp index ea8b1bb..5bb9a1d 100644 --- a/Project/Electromechanical.cpp +++ b/Project/Electromechanical.cpp @@ -15,8 +15,8 @@ * along with this program. If not, see . */ -#include "Electromechanical.h" #include "ControlElementSolver.h" +#include "Electromechanical.h" Electromechanical::Electromechanical(wxWindow* parent, std::vector elementList, SimulationData data) { @@ -70,6 +70,7 @@ bool Electromechanical::RunStabilityCalculation() wxProgressDialog pbd(_("Running simulation"), _("Initializing..."), 100, m_parent, wxPD_APP_MODAL | wxPD_AUTO_HIDE | wxPD_CAN_ABORT | wxPD_SMOOTH); + PreallocateVectors(); // Reserve the vectors' memory with a estimated size, this can optimize the simulation. SetSyncMachinesModel(); // Calculate the admittance matrix with the synchronous machines. @@ -996,6 +997,7 @@ bool Electromechanical::SolveSynchronousMachines() return false; } } + m_iterationsNum = iterations; // Solve controllers. int ctrlRatio = static_cast(1 / m_ctrlTimeStepMultiplier); @@ -1006,7 +1008,8 @@ bool Electromechanical::SolveSynchronousMachines() data.avrSolver->SetSwitchStatus(syncGenerator->IsOnline()); data.avrSolver->SetCurrentTime(m_currentTime); data.avrSolver->SetTerminalVoltage(std::abs(data.terminalVoltage)); - data.avrSolver->SetDeltaActivePower((data.electricalPower.real() - data.avrSolver->GetActivePower()) / m_timeStep); + data.avrSolver->SetDeltaActivePower((data.electricalPower.real() - data.avrSolver->GetActivePower()) / + m_timeStep); data.avrSolver->SetActivePower(data.electricalPower.real()); data.avrSolver->SetReactivePower(data.electricalPower.imag()); data.avrSolver->SetDeltaVelocity((data.speed - data.avrSolver->GetVelocity()) / m_timeStep); @@ -1066,6 +1069,7 @@ void Electromechanical::SaveData() load->SetElectricalData(data); } } + m_iterationsNumVector.push_back(m_iterationsNum); } void Electromechanical::SetSyncMachinesModel() @@ -1089,9 +1093,7 @@ bool Electromechanical::CalculateSyncMachineNonIntVariables(SyncGenerator* syncG auto data = syncGenerator->GetElectricalData(); int n = static_cast(syncGenerator->GetParentList()[0])->GetElectricalData().number; - if(syncGenerator->IsOnline()) { - data.terminalVoltage = m_vBus[n]; - } + if(syncGenerator->IsOnline()) { data.terminalVoltage = m_vBus[n]; } double vd, vq; ABCtoDQ0(data.terminalVoltage, data.delta, vd, vq); @@ -1287,9 +1289,7 @@ bool Electromechanical::CalculateSyncMachineSaturation(SyncGenerator* syncMachin auto smDataModel = GetSyncMachineModelData(syncMachine); int n = static_cast(syncMachine->GetParentList()[0])->GetElectricalData().number; - if(syncMachine->IsOnline()) { - data.terminalVoltage = m_vBus[n]; - } + if(syncMachine->IsOnline()) { data.terminalVoltage = m_vBus[n]; } double idCalc = id; double iqCalc = iq; double sdCalc = sd; @@ -1394,9 +1394,7 @@ SyncMachineModelData Electromechanical::GetSyncMachineModelData(SyncGenerator* s smModelData.xq = data.transXq * k; if(smModelData.xq == 0.0) { smModelData.xq = data.syncXq * k; - if(smModelData.xq == 0.0) { - smModelData.xq = data.syncXd * k; - } + if(smModelData.xq == 0.0) { smModelData.xq = data.syncXd * k; } } } break; case Machines::SM_MODEL_3: { @@ -1418,3 +1416,40 @@ SyncMachineModelData Electromechanical::GetSyncMachineModelData(SyncGenerator* s } return smModelData; } + +void Electromechanical::PreallocateVectors() +{ + int numPoints = static_cast(m_simTime / m_plotTime); + + m_timeVector.reserve(numPoints); + for(auto it = m_syncGeneratorList.begin(), itEnd = m_syncGeneratorList.end(); it != itEnd; ++it) { + SyncGenerator* syncGenerator = *it; + auto data = syncGenerator->GetElectricalData(); + if(data.plotSyncMachine) { + data.terminalVoltageVector.reserve(numPoints); + data.electricalPowerVector.reserve(numPoints); + data.mechanicalPowerVector.reserve(numPoints); + data.freqVector.reserve(numPoints); + data.fieldVoltageVector.reserve(numPoints); + data.deltaVector.reserve(numPoints); + syncGenerator->SetElectricalData(data); + } + } + for(auto it = m_busList.begin(), itEnd = m_busList.end(); it != itEnd; ++it) { + Bus* bus = *it; + auto data = bus->GetElectricalData(); + if(data.plotBus) { + data.stabVoltageVector.reserve(numPoints); + bus->SetElectricalData(data); + } + } + for(auto it = m_loadList.begin(), itEnd = m_loadList.end(); it != itEnd; ++it) { + Load* load = *it; + auto data = load->GetElectricalData(); + if(data.plotLoad) { + data.voltageVector.reserve(numPoints); + data.electricalPowerVector.reserve(numPoints); + load->SetElectricalData(data); + } + } +} diff --git a/Project/Electromechanical.h b/Project/Electromechanical.h index 4c82bb6..573c0c2 100644 --- a/Project/Electromechanical.h +++ b/Project/Electromechanical.h @@ -57,6 +57,9 @@ class Electromechanical : public ElectricCalculation bool RunStabilityCalculation(); wxString GetErrorMessage() const { return m_errorMsg; } std::vector GetTimeVector() const { return m_timeVector; } + + // For tests + std::vector GetIterationVector() const { return m_iterationsNumVector; } protected: void SetEventTimeList(); @@ -98,6 +101,7 @@ class Electromechanical : public ElectricCalculation double k = 1.0); void SaveData(); + void PreallocateVectors(); wxWindow* m_parent = NULL; wxString m_errorMsg = _("Unknown error"); @@ -127,6 +131,10 @@ class Electromechanical : public ElectricCalculation std::vector m_eventOccurrenceList; std::vector m_timeVector; + + // For tests + int m_iterationsNum = 0.0; + std::vector m_iterationsNumVector; }; #endif // ELECTROMECHANICAL_H diff --git a/Project/Workspace.cpp b/Project/Workspace.cpp index 45944ab..8a67456 100644 --- a/Project/Workspace.cpp +++ b/Project/Workspace.cpp @@ -1449,6 +1449,12 @@ bool Workspace::RunStability() ElementPlotData plotData; if(element->GetPlotData(plotData)) plotDataList.push_back(plotData); } + + ElementPlotData plotData; + plotData.SetName(_("Simulation parameters")); + plotData.SetCurveType(ElementPlotData::CT_TEST); + plotData.AddData(stability.GetIterationVector(), _("Iterations number")); + plotDataList.push_back(plotData); ChartView* cView = new ChartView(this, plotDataList, m_stabilityTimeVector); cView->Show(); -- cgit From aad89bf4d16d45c0790bd2fc010d9ec06cc35430 Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Sat, 29 Dec 2018 13:38:13 -0200 Subject: wxWidgets update (3.1.2) and bugfixes --- Project/Electromechanical.cpp | 4 +- Project/data/lang/pt_BR/pt_BR.mo | Bin 49821 -> 50145 bytes Project/data/lang/pt_BR/pt_BR.po | 166 +++++++++++++++++++++------------------ Project/main.cpp | 27 ++++--- 4 files changed, 109 insertions(+), 88 deletions(-) (limited to 'Project') diff --git a/Project/Electromechanical.cpp b/Project/Electromechanical.cpp index 4ebb3b3..66d5bb2 100644 --- a/Project/Electromechanical.cpp +++ b/Project/Electromechanical.cpp @@ -235,7 +235,7 @@ void Electromechanical::SetEvent(double currentTime) Bus* parentBus = static_cast(load->GetParentList()[0]); int n = parentBus->GetElectricalData().number; std::complex v = parentBus->GetElectricalData().voltage; - m_yBus[n][n] -= std::complex(data.activePower, -data.reactivePower) / (v * v); + m_yBus[n][n] -= std::complex(data.activePower, -data.reactivePower) / (std::abs(v) * std::abs(v)); } // Insert load (only disconnected load) @@ -245,7 +245,7 @@ void Electromechanical::SetEvent(double currentTime) Bus* parentBus = static_cast(load->GetParentList()[0]); int n = parentBus->GetElectricalData().number; std::complex v = parentBus->GetElectricalData().voltage; - m_yBus[n][n] += std::complex(data.activePower, -data.reactivePower) / (v * v); + m_yBus[n][n] += std::complex(data.activePower, -data.reactivePower) / (std::abs(v) * std::abs(v)); } } } diff --git a/Project/data/lang/pt_BR/pt_BR.mo b/Project/data/lang/pt_BR/pt_BR.mo index 288b51e..3e2d0ef 100644 Binary files a/Project/data/lang/pt_BR/pt_BR.mo and b/Project/data/lang/pt_BR/pt_BR.mo differ diff --git a/Project/data/lang/pt_BR/pt_BR.po b/Project/data/lang/pt_BR/pt_BR.po index c92479c..ed2caea 100644 --- a/Project/data/lang/pt_BR/pt_BR.po +++ b/Project/data/lang/pt_BR/pt_BR.po @@ -1,15 +1,15 @@ msgid "" msgstr "" "Project-Id-Version: PSP-UFU pt_BR 0.0.1\n" -"POT-Creation-Date: 2018-04-11 00:56-0300\n" -"PO-Revision-Date: 2018-04-11 01:00-0300\n" +"POT-Creation-Date: 2018-12-29 12:15-0200\n" +"PO-Revision-Date: 2018-12-29 12:16-0200\n" "Last-Translator: \n" "Language-Team: Thales Lima Oliveira \n" "Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 2.0.5\n" +"X-Generator: Poedit 2.2\n" "X-Poedit-Basepath: ../../..\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" "X-Poedit-KeywordsList: _\n" @@ -377,11 +377,11 @@ msgstr "Não foi possível enviar para a área de transferência" #: ControlSystemTest.cpp:60 ControlSystemTest.cpp:67 ControlSystemTest.cpp:74 #: Element.cpp:294 Element.cpp:308 GeneralPropertiesForm.cpp:74 #: ImportForm.cpp:53 Line.cpp:157 Line.cpp:386 LoadForm.cpp:189 -#: LoadForm.cpp:196 MainFrame.cpp:304 MathExpressionForm.cpp:85 -#: SimulationsSettingsForm.cpp:191 SimulationsSettingsForm.cpp:198 +#: LoadForm.cpp:196 MainFrame.cpp:306 MathExpressionForm.cpp:85 +#: SimulationsSettingsForm.cpp:192 SimulationsSettingsForm.cpp:199 #: SumForm.cpp:58 SumForm.cpp:74 TextForm.cpp:1225 Workspace.cpp:1121 #: Workspace.cpp:1182 Workspace.cpp:1290 Workspace.cpp:1394 Workspace.cpp:1416 -#: Workspace.cpp:1434 +#: Workspace.cpp:1434 main.cpp:87 msgid "Error" msgstr "Erro" @@ -557,7 +557,7 @@ msgstr "Salvar arquivo CTL" msgid "Open CTL file" msgstr "Abrir arquivo CTL" -#: ControlEditor.cpp:796 MainFrame.cpp:304 +#: ControlEditor.cpp:796 MainFrame.cpp:306 msgid "It was not possible to open the selected file." msgstr "Não foi possível abrir o arquivo selecionado." @@ -734,11 +734,11 @@ msgstr "Valor inserido incorretamente no campo \"Tempo de início\"." msgid "Value entered incorrectly in the field \"Slope\"." msgstr "Valor inserido incorretamente no campo \"Inclinação\"." -#: ControlSystemTest.cpp:67 SimulationsSettingsForm.cpp:130 +#: ControlSystemTest.cpp:67 SimulationsSettingsForm.cpp:131 msgid "Value entered incorrectly in the field \"Time step\"." msgstr "Valor inserido incorretamente no campo \"Passo de integração\"." -#: ControlSystemTest.cpp:74 SimulationsSettingsForm.cpp:133 +#: ControlSystemTest.cpp:74 SimulationsSettingsForm.cpp:134 msgid "Value entered incorrectly in the field \"Simulation time\"." msgstr "Valor inserido incorretamente no campo \"Tempo de simulação\"." @@ -927,32 +927,32 @@ msgstr "Relatório de dados" msgid "Running simulation" msgstr "Simulação em andamento" -#: Electromechanical.cpp:77 +#: Electromechanical.cpp:78 msgid "It was not possible to build the admittance matrix." msgstr "Não foi possível construir a matriz admitância." -#: Electromechanical.cpp:118 +#: Electromechanical.cpp:119 #, c-format msgid "Simulation cancelled at %.2fs." msgstr "Simulação cancelada em %.2fs." -#: Electromechanical.cpp:572 +#: Electromechanical.cpp:573 msgid "Error on initializate the saturation values of \"" msgstr "Erro ao inicializar os valores de saturação de \"" -#: Electromechanical.cpp:572 +#: Electromechanical.cpp:573 msgid "\"." msgstr "\"." -#: Electromechanical.cpp:675 +#: Electromechanical.cpp:676 msgid "Error on initializate the AVR of \"" msgstr "Erro ao inicializar o AVR de \"" -#: Electromechanical.cpp:694 +#: Electromechanical.cpp:695 msgid "Error on initializate the speed governor of \"" msgstr "Erro ao inicializar o regulador de velocidade de \"" -#: Electromechanical.cpp:994 +#: Electromechanical.cpp:995 msgid "" "Impossible to solve the synchronous generators.\n" "Check the system parameters and/or decrease the time step." @@ -965,7 +965,7 @@ msgid "" "It was not possible to solve the saturation of the synchronous machine \"" msgstr "Não foi possível solucionar a saturação da máquina síncrona \"" -#: Electromechanical.h:103 +#: Electromechanical.h:107 msgid "Unknown error" msgstr "Erro desconhecido" @@ -1695,7 +1695,7 @@ msgstr "Variação de potência ativa" msgid "It was not possible to import the selected files." msgstr "Não foi possível importar os arquivo selecionados." -#: ImportForm.h:206 MainFrame.cpp:470 +#: ImportForm.h:206 MainFrame.cpp:472 msgid "Imported project" msgstr "Projeto importado" @@ -1887,177 +1887,177 @@ msgstr "" "Valor inserido incorretamente no campo \"Parcela de potência constante da " "potência ativa\"." -#: LoadForm.cpp:189 SimulationsSettingsForm.cpp:191 +#: LoadForm.cpp:189 SimulationsSettingsForm.cpp:192 msgid "The sum of active power load composition must be 100%." msgstr "A soma da composição de carga da potência ativa deve ser 100%." -#: LoadForm.cpp:196 SimulationsSettingsForm.cpp:198 +#: LoadForm.cpp:196 SimulationsSettingsForm.cpp:199 msgid "The sum of reactive power load composition must be 100%." msgstr "A soma da composição de carga da potência reativa deve ser 100%." -#: MainFrame.cpp:50 MainFrame.cpp:286 +#: MainFrame.cpp:50 MainFrame.cpp:287 msgid "Open project" msgstr "Abrir projeto" -#: MainFrame.cpp:133 +#: MainFrame.cpp:134 msgid "&Bus\tB" msgstr "&Barramento\tB" -#: MainFrame.cpp:133 +#: MainFrame.cpp:134 msgid "Adds a bus at the circuit" msgstr "Adiciona um barramento no circuito" -#: MainFrame.cpp:136 +#: MainFrame.cpp:137 msgid "&Line\tL" msgstr "&Linha\tL" -#: MainFrame.cpp:136 +#: MainFrame.cpp:137 msgid "Adds a power line at the circuit" msgstr "Adiciona uma linha no circuito" -#: MainFrame.cpp:137 +#: MainFrame.cpp:138 msgid "&Transformer\tT" msgstr "&Transformador\tT" -#: MainFrame.cpp:138 +#: MainFrame.cpp:139 msgid "Adds a transformer at the circuit" msgstr "Adiciona um transformador no circuito" -#: MainFrame.cpp:139 +#: MainFrame.cpp:140 msgid "&Generator\tG" msgstr "&Gerador\tG" -#: MainFrame.cpp:140 +#: MainFrame.cpp:141 msgid "Adds a generator at the circuit" msgstr "Adiciona um gerador no circuito" -#: MainFrame.cpp:141 +#: MainFrame.cpp:142 msgid "&Induction motor\tI" msgstr "&Motor de indução\tI" -#: MainFrame.cpp:142 MainFrame.cpp:145 +#: MainFrame.cpp:143 MainFrame.cpp:146 msgid "Adds an induction motor at the circuit" msgstr "Adiciona um motor de indução no circuito" -#: MainFrame.cpp:144 +#: MainFrame.cpp:145 msgid "&Synchronous compensator \tK" msgstr "&Compensador síncrono \tK" -#: MainFrame.cpp:147 +#: MainFrame.cpp:148 msgid "&Load\tShift-L" msgstr "&Carga\tShift-L" -#: MainFrame.cpp:147 +#: MainFrame.cpp:148 msgid "Adds a load at the circuit" msgstr "Adiciona uma carga no circuito" -#: MainFrame.cpp:148 +#: MainFrame.cpp:149 msgid "&Capacitor\tShift-C" msgstr "&Capacitor\tShift-C" -#: MainFrame.cpp:149 +#: MainFrame.cpp:150 msgid "Adds a shunt capacitor at the circuit" msgstr "Adiciona um capacitor shunt no circuito" -#: MainFrame.cpp:150 +#: MainFrame.cpp:151 msgid "&Inductor\tShift-I" msgstr "&Inductor\tShift-I" -#: MainFrame.cpp:151 +#: MainFrame.cpp:152 msgid "Adds a shunt inductor at the circuit" msgstr "Adiciona um indutor shunt no circuito" -#: MainFrame.cpp:170 +#: MainFrame.cpp:171 #, c-format msgid "New project %d" msgstr "Novo projeto %d" -#: MainFrame.cpp:279 +#: MainFrame.cpp:280 msgid "Open PSP file" msgstr "Abrir arquivo do PSP" -#: MainFrame.cpp:339 MainFrame.cpp:360 +#: MainFrame.cpp:341 MainFrame.cpp:362 msgid "Save PSP file" msgstr "Salvar arquivo do PSP" -#: MainFrame.cpp:388 Workspace.cpp:703 +#: MainFrame.cpp:390 Workspace.cpp:703 #, c-format msgid "Bus %d" msgstr "Barra %d" -#: MainFrame.cpp:391 Workspace.cpp:707 +#: MainFrame.cpp:393 Workspace.cpp:707 msgid "Insert Bus: Click to insert, ESC to cancel." msgstr "Inserir Barramento: Clique para inserir, ESC para cancelar." -#: MainFrame.cpp:395 Workspace.cpp:720 +#: MainFrame.cpp:397 Workspace.cpp:720 #, c-format msgid "Line %d" msgstr "Linha %d" -#: MainFrame.cpp:398 Workspace.cpp:724 +#: MainFrame.cpp:400 Workspace.cpp:724 msgid "Insert Line: Click on two buses, ESC to cancel." msgstr "Inserir Linha: Clique em duas barras, ESC para cancelar." -#: MainFrame.cpp:403 Workspace.cpp:734 +#: MainFrame.cpp:405 Workspace.cpp:734 #, c-format msgid "Transformer %d" msgstr "Transformador %d" -#: MainFrame.cpp:406 Workspace.cpp:738 +#: MainFrame.cpp:408 Workspace.cpp:738 msgid "Insert Transformer: Click on two buses, ESC to cancel." msgstr "Inserir Transformador: Clique em duas barras, ESC para cancelar." -#: MainFrame.cpp:411 Workspace.cpp:746 +#: MainFrame.cpp:413 Workspace.cpp:746 #, c-format msgid "Generator %d" msgstr "Gerador %d" -#: MainFrame.cpp:414 Workspace.cpp:750 +#: MainFrame.cpp:416 Workspace.cpp:750 msgid "Insert Generator: Click on a buses, ESC to cancel." msgstr "Inserir Gerador: Clique em uma barra, ESC para cancelar." -#: MainFrame.cpp:418 Workspace.cpp:714 +#: MainFrame.cpp:420 Workspace.cpp:714 #, c-format msgid "Load %d" msgstr "Carga %d" -#: MainFrame.cpp:421 Workspace.cpp:718 +#: MainFrame.cpp:423 Workspace.cpp:718 msgid "Insert Load: Click on a buses, ESC to cancel." msgstr "Inserir Carga: Clique em uma barra, ESC para cancelar." -#: MainFrame.cpp:426 Workspace.cpp:791 +#: MainFrame.cpp:428 Workspace.cpp:791 #, c-format msgid "Capacitor %d" msgstr "Capacitor %d" -#: MainFrame.cpp:429 Workspace.cpp:795 +#: MainFrame.cpp:431 Workspace.cpp:795 msgid "Insert Capacitor: Click on a buses, ESC to cancel." msgstr "Inserir Capacitor: Clique em uma barra, ESC para cancelar." -#: MainFrame.cpp:434 Workspace.cpp:758 +#: MainFrame.cpp:436 Workspace.cpp:758 #, c-format msgid "Inductor %d" msgstr "Indutor %d" -#: MainFrame.cpp:437 Workspace.cpp:762 +#: MainFrame.cpp:439 Workspace.cpp:762 msgid "Insert Inductor: Click on a buses, ESC to cancel." msgstr "Inserir Indutor: Clique em uma barra, ESC para cancelar." -#: MainFrame.cpp:442 Workspace.cpp:766 +#: MainFrame.cpp:444 Workspace.cpp:766 #, c-format msgid "Induction motor %d" msgstr "Motor de indução %d" -#: MainFrame.cpp:445 Workspace.cpp:770 +#: MainFrame.cpp:447 Workspace.cpp:770 msgid "Insert Induction Motor: Click on a buses, ESC to cancel." msgstr "Inserir Motor de indução: Clique em uma barra, ESC para cancelar." -#: MainFrame.cpp:450 Workspace.cpp:779 +#: MainFrame.cpp:452 Workspace.cpp:779 #, c-format msgid "Synchronous condenser %d" msgstr "Compensador síncrono %d" -#: MainFrame.cpp:453 Workspace.cpp:783 +#: MainFrame.cpp:455 Workspace.cpp:783 msgid "Insert Synchronous Condenser: Click on a buses, ESC to cancel." msgstr "Inserir Compensador síncrono: Clique em uma barra, ESC para cancelar." @@ -2572,53 +2572,53 @@ msgstr "Capacitor: Chaveamento" msgid "Inductor: Switching" msgstr "Indutor: Chaveamento" -#: SimulationsSettingsForm.cpp:94 +#: SimulationsSettingsForm.cpp:95 msgid "Value entered incorrectly in the field \"Base power\"." msgstr "Valor inserido incorretamente no campo \"Potência base\"." -#: SimulationsSettingsForm.cpp:118 +#: SimulationsSettingsForm.cpp:119 msgid "Value entered incorrectly in the field \"Acceleration factor\"." msgstr "Valor inserido incorretamente no campo \"Fator de aceleração\"." -#: SimulationsSettingsForm.cpp:121 +#: SimulationsSettingsForm.cpp:122 msgid "Value entered incorrectly in the field \"Tolerance (Power flow)\"." msgstr "" "Valor inserido incorretamente no campo \"Tolerância (Fluxo de carga)\"." -#: SimulationsSettingsForm.cpp:124 +#: SimulationsSettingsForm.cpp:125 msgid "" "Value entered incorrectly in the field \"Max. iterations (Power flow)\"." msgstr "" "Valor inserido incorretamente no campo \"Iterações máx (Fluxo de carga)\"." -#: SimulationsSettingsForm.cpp:127 +#: SimulationsSettingsForm.cpp:128 msgid "Value entered incorrectly in the field \"Slack bus angle\"." msgstr "" "Valor inserido incorretamente no campo \"Ângulo da barra de referência\"." -#: SimulationsSettingsForm.cpp:136 +#: SimulationsSettingsForm.cpp:137 msgid "Value entered incorrectly in the field \"System frequency\"." msgstr "Valor inserido incorretamente no campo \"Frequência do sistema\"." -#: SimulationsSettingsForm.cpp:139 +#: SimulationsSettingsForm.cpp:140 msgid "Value entered incorrectly in the field \"Tolerance (Stability)\"." msgstr "Valor inserido incorretamente no campo \"Tolerância (estabilidade)\"." -#: SimulationsSettingsForm.cpp:142 +#: SimulationsSettingsForm.cpp:143 msgid "Value entered incorrectly in the field \"Max. iterations (Stability)\"." msgstr "" "Valor inserido incorretamente no campo \"Iterações máx (Estabilidade)\"." -#: SimulationsSettingsForm.cpp:145 +#: SimulationsSettingsForm.cpp:146 msgid "Value entered incorrectly in the field \"Controls step ratio\"." msgstr "" "Valor inserido incorretamente no campo \"Razão do passo dos controles\"." -#: SimulationsSettingsForm.cpp:148 +#: SimulationsSettingsForm.cpp:149 msgid "Value entered incorrectly in the field \"Plot time\"." msgstr "Valor inserido incorretamente no campo \"Tempo de impressão\"." -#: SimulationsSettingsForm.cpp:156 +#: SimulationsSettingsForm.cpp:157 msgid "" "Value entered incorrectly in the field \"Constant impedance portion of " "active power (ZIP load)\"." @@ -2626,7 +2626,7 @@ msgstr "" "Valor inserido incorretamente no campo \"Parcela de impedância constante da " "potência ativa (Carga ZIP)\"." -#: SimulationsSettingsForm.cpp:160 +#: SimulationsSettingsForm.cpp:161 msgid "" "Value entered incorrectly in the field \"Constant current portion of active " "power (ZIP load)\"." @@ -2634,7 +2634,7 @@ msgstr "" "Valor inserido incorretamente no campo \"Parcela de corrente constante da " "potência ativa (Carga ZIP)\"." -#: SimulationsSettingsForm.cpp:164 +#: SimulationsSettingsForm.cpp:165 msgid "" "Value entered incorrectly in the field \"Constant power portion of active " "power (ZIP load)\"." @@ -2642,7 +2642,7 @@ msgstr "" "Valor inserido incorretamente no campo \"Parcela de potência constante da " "potência ativa (Carga ZIP)\"." -#: SimulationsSettingsForm.cpp:168 +#: SimulationsSettingsForm.cpp:169 msgid "" "Value entered incorrectly in the field \"Constant impedance portion of " "reactive power (ZIP load)\"." @@ -2650,7 +2650,7 @@ msgstr "" "Valor inserido incorretamente no campo \"Parcela de impedância constante da " "potência reativa (Carga ZIP)\"." -#: SimulationsSettingsForm.cpp:172 +#: SimulationsSettingsForm.cpp:173 msgid "" "Value entered incorrectly in the field \"Constant current portion of " "reactive power (ZIP load)\"." @@ -2658,7 +2658,7 @@ msgstr "" "Valor inserido incorretamente no campo \"Parcela de corrente constante da " "potência reativa (Carga ZIP)\"." -#: SimulationsSettingsForm.cpp:176 +#: SimulationsSettingsForm.cpp:177 msgid "" "Value entered incorrectly in the field \"Constant power portion of reactive " "power (ZIP load)\"." @@ -2666,7 +2666,7 @@ msgstr "" "Valor inserido incorretamente no campo \"Parcela de potência constante da " "potência reativa (Carga ZIP)\"." -#: SimulationsSettingsForm.cpp:181 +#: SimulationsSettingsForm.cpp:182 msgid "" "Value entered incorrectly in the field \"Constant current undervoltage limit " "(ZIP load)\"." @@ -2674,7 +2674,7 @@ msgstr "" "Valor inserido incorretamente no campo \"Limite de subtensão da corrente " "constante (Carga ZIP)\"." -#: SimulationsSettingsForm.cpp:186 +#: SimulationsSettingsForm.cpp:187 msgid "" "Value entered incorrectly in the field \"Constant power undervoltage limit " "(ZIP load)\"." @@ -2979,6 +2979,18 @@ msgstr "Você deseja abrir os gráficos do estudo de estabilidade?" msgid "Question" msgstr "Pergunta" +#: Workspace.cpp:1454 +msgid "Simulation parameters" +msgstr "Parâmetros de simulação" + +#: Workspace.cpp:1456 +msgid "Iterations number" +msgstr "Número de iterações" + +#: main.cpp:87 +msgid "Fail to load brazilian portuguese language catalog." +msgstr "Falhou em carregar o catálogo de português do Brasil." + #~ msgid "OK!" #~ msgstr "OK!" diff --git a/Project/main.cpp b/Project/main.cpp index 536ef57..61b7fc2 100644 --- a/Project/main.cpp +++ b/Project/main.cpp @@ -1,9 +1,10 @@ #include +#include #include #include +#include #include #include -#include #include "MainFrame.h" #include "PropertiesData.h" @@ -76,13 +77,23 @@ class MainApp : public wxApp void LoadCatalogs(wxLocale* locale, PropertiesData* propertiesData) { - locale->Init(propertiesData->GetGeneralPropertiesData().language, wxLOCALE_DONT_LOAD_DEFAULT); + if(!locale->Init(propertiesData->GetGeneralPropertiesData().language, wxLOCALE_DONT_LOAD_DEFAULT)) { + wxMessageDialog msgDialog(NULL, _("This language is not supported by the system."), _("Error"), + wxOK | wxCENTRE | wxICON_ERROR); + msgDialog.ShowModal(); + } wxFileName fn(wxStandardPaths::Get().GetExecutablePath()); wxString langPath = fn.GetPath() + wxFileName::DirName("\\..\\data\\lang", wxPATH_WIN).GetPath(); locale->AddCatalogLookupPathPrefix(langPath); - // Load translation catalogs. - locale->AddCatalog(wxT("pt_BR"), wxLANGUAGE_PORTUGUESE_BRAZILIAN); + //pt_BR + if(propertiesData->GetGeneralPropertiesData().language == wxLANGUAGE_PORTUGUESE_BRAZILIAN) { + if(!locale->AddCatalog(wxT("pt_BR"))) { + wxMessageDialog msgDialog(NULL, _("Fail to load brazilian portuguese language catalog."), _("Error"), + wxOK | wxCENTRE | wxICON_ERROR); + msgDialog.ShowModal(); + } + } } virtual bool OnInit() @@ -104,15 +115,13 @@ class MainApp : public wxApp if(cmdLineParser.Parse() == 0) { wxCmdLineArgs args = cmdLineParser.GetArguments(); for(auto it = args.begin(), itEnd = args.end(); it != itEnd; ++it) { - if(it->GetKind() == wxCMD_LINE_PARAM) { - openFilePath = it->GetStrVal(); - } + if(it->GetKind() == wxCMD_LINE_PARAM) { openFilePath = it->GetStrVal(); } } } MainFrame* mainFrame = new MainFrame(NULL, locale, propertiesData, openFilePath); - #ifdef __WXMSW__ +#ifdef __WXMSW__ mainFrame->SetIcon(wxICON(aaaaprogicon)); - #endif +#endif SetTopWindow(mainFrame); return GetTopWindow()->Show(); } -- cgit From fc820e8a03cd670835ac7fc7434226fad1c8e444 Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Fri, 11 Jan 2019 10:20:43 -0200 Subject: ZIP load bugfix --- Project/Electromechanical.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Project') diff --git a/Project/Electromechanical.cpp b/Project/Electromechanical.cpp index 4ebb3b3..0504bab 100644 --- a/Project/Electromechanical.cpp +++ b/Project/Electromechanical.cpp @@ -235,7 +235,7 @@ void Electromechanical::SetEvent(double currentTime) Bus* parentBus = static_cast(load->GetParentList()[0]); int n = parentBus->GetElectricalData().number; std::complex v = parentBus->GetElectricalData().voltage; - m_yBus[n][n] -= std::complex(data.activePower, -data.reactivePower) / (v * v); + m_yBus[n][n] -= std::complex(data.activePower, -data.reactivePower) / (abs(v) * abs(v)); } // Insert load (only disconnected load) @@ -245,7 +245,7 @@ void Electromechanical::SetEvent(double currentTime) Bus* parentBus = static_cast(load->GetParentList()[0]); int n = parentBus->GetElectricalData().number; std::complex v = parentBus->GetElectricalData().voltage; - m_yBus[n][n] += std::complex(data.activePower, -data.reactivePower) / (v * v); + m_yBus[n][n] += std::complex(data.activePower, -data.reactivePower) / (abs(v) * abs(v)); } } } -- cgit From db3fadbcc9f396ca22c4578101bbcd0a7e81609e Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Wed, 16 Jan 2019 09:35:35 -0200 Subject: Stability and site updates --- Project/Electromechanical.cpp | 9 +- Project/icons.svg | 4153 +++++++++++++++++++++++++++++++++++++++++ Project/main.cpp | 7 +- 3 files changed, 4160 insertions(+), 9 deletions(-) create mode 100644 Project/icons.svg (limited to 'Project') diff --git a/Project/Electromechanical.cpp b/Project/Electromechanical.cpp index de30184..50ce4e5 100644 --- a/Project/Electromechanical.cpp +++ b/Project/Electromechanical.cpp @@ -235,11 +235,8 @@ void Electromechanical::SetEvent(double currentTime) Bus* parentBus = static_cast(load->GetParentList()[0]); int n = parentBus->GetElectricalData().number; std::complex v = parentBus->GetElectricalData().voltage; -<<<<<<< HEAD - m_yBus[n][n] -= std::complex(data.activePower, -data.reactivePower) / (abs(v) * abs(v)); -======= m_yBus[n][n] -= std::complex(data.activePower, -data.reactivePower) / (std::abs(v) * std::abs(v)); ->>>>>>> aad89bf4d16d45c0790bd2fc010d9ec06cc35430 + } // Insert load (only disconnected load) @@ -249,11 +246,7 @@ void Electromechanical::SetEvent(double currentTime) Bus* parentBus = static_cast(load->GetParentList()[0]); int n = parentBus->GetElectricalData().number; std::complex v = parentBus->GetElectricalData().voltage; -<<<<<<< HEAD - m_yBus[n][n] += std::complex(data.activePower, -data.reactivePower) / (abs(v) * abs(v)); -======= m_yBus[n][n] += std::complex(data.activePower, -data.reactivePower) / (std::abs(v) * std::abs(v)); ->>>>>>> aad89bf4d16d45c0790bd2fc010d9ec06cc35430 } } } diff --git a/Project/icons.svg b/Project/icons.svg new file mode 100644 index 0000000..41fa813 --- /dev/null +++ b/Project/icons.svg @@ -0,0 +1,4153 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100 MVA + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Project/main.cpp b/Project/main.cpp index 61b7fc2..718dd06 100644 --- a/Project/main.cpp +++ b/Project/main.cpp @@ -17,6 +17,8 @@ class MainApp : public wxApp virtual ~MainApp() {} bool LoadInitFile(PropertiesData* propertiesData) { + // Load configuration file, if don't exists create it. + // Find the executable location path. wxFileName fn(wxStandardPaths::Get().GetExecutablePath()); wxTextFile file(fn.GetPath() + wxFileName::GetPathSeparator() + "config.ini"); auto data = propertiesData->GetGeneralPropertiesData(); @@ -77,6 +79,7 @@ class MainApp : public wxApp void LoadCatalogs(wxLocale* locale, PropertiesData* propertiesData) { + // Load language catalogs according the propertiesData attribute. if(!locale->Init(propertiesData->GetGeneralPropertiesData().language, wxLOCALE_DONT_LOAD_DEFAULT)) { wxMessageDialog msgDialog(NULL, _("This language is not supported by the system."), _("Error"), wxOK | wxCENTRE | wxICON_ERROR); @@ -109,7 +112,8 @@ class MainApp : public wxApp LoadCatalogs(locale, propertiesData); wxString openFilePath = ""; - + + // Load command line attributes. This is used to directly open saved files (.psp). wxCmdLineParser cmdLineParser(wxApp::argc, wxApp::argv); cmdLineParser.AddParam("", wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL); if(cmdLineParser.Parse() == 0) { @@ -120,6 +124,7 @@ class MainApp : public wxApp } MainFrame* mainFrame = new MainFrame(NULL, locale, propertiesData, openFilePath); #ifdef __WXMSW__ + //Set application icon for windows mainFrame->SetIcon(wxICON(aaaaprogicon)); #endif SetTopWindow(mainFrame); -- cgit