diff options
author | Thales1330 <thaleslima.ufu@gmail.com> | 2016-11-04 18:02:03 -0200 |
---|---|---|
committer | Thales1330 <thaleslima.ufu@gmail.com> | 2016-11-04 18:02:03 -0200 |
commit | 9919f24692c1fe9b8e11fde5c6d5c18f169b5c10 (patch) | |
tree | b8980db8f053d38adcad362f08fce88541cf45bf | |
parent | 4799019fb948226daf5777d0d3ba41257dd55657 (diff) | |
download | PSP.git-9919f24692c1fe9b8e11fde5c6d5c18f169b5c10.tar.gz PSP.git-9919f24692c1fe9b8e11fde5c6d5c18f169b5c10.tar.xz PSP.git-9919f24692c1fe9b8e11fde5c6d5c18f169b5c10.zip |
Validation implemented
34 files changed, 286 insertions, 225 deletions
diff --git a/.codelite/.tern-port b/.codelite/.tern-port index d717729..7ce4b11 100644 --- a/.codelite/.tern-port +++ b/.codelite/.tern-port @@ -1 +1 @@ -50095
\ No newline at end of file +50042
\ No newline at end of file diff --git a/.codelite/PSP.session b/.codelite/PSP.session index c2719b0..0656946 100644 --- a/.codelite/PSP.session +++ b/.codelite/PSP.session @@ -1,19 +1,19 @@ <?xml version="1.0" encoding="UTF-8"?> <Session Name="C:\Users\Thales\Documents\GitHub\PSP\PSP.workspace"> - <int Value="6" Name="m_selectedTab"/> + <int Value="13" Name="m_selectedTab"/> <wxString Value="C:\Users\Thales\Documents\GitHub\PSP\PSP.workspace" Name="m_workspaceName"/> <TabInfoArray Name="TabInfoArray"> <TabInfo> <wxString Value="C:\Users\Thales\Documents\GitHub\PSP\Project\Workspace.cpp" Name="FileName"/> - <int Value="986" Name="FirstVisibleLine"/> + <int Value="998" Name="FirstVisibleLine"/> <int Value="1020" Name="CurrentLine"/> <wxArrayString Name="Bookmarks"/> <IntVector Name="CollapsedFolds"/> </TabInfo> <TabInfo> <wxString Value="C:\Users\Thales\Documents\GitHub\PSP\Project\Workspace.h" Name="FileName"/> - <int Value="54" Name="FirstVisibleLine"/> - <int Value="82" Name="CurrentLine"/> + <int Value="53" Name="FirstVisibleLine"/> + <int Value="71" Name="CurrentLine"/> <wxArrayString Name="Bookmarks"/> <IntVector Name="CollapsedFolds"/> </TabInfo> @@ -33,50 +33,78 @@ </TabInfo> <TabInfo> <wxString Value="C:\Users\Thales\Documents\GitHub\PSP\Project\Element.h" Name="FileName"/> - <int Value="168" Name="FirstVisibleLine"/> - <int Value="186" Name="CurrentLine"/> + <int Value="186" Name="FirstVisibleLine"/> + <int Value="203" Name="CurrentLine"/> <wxArrayString Name="Bookmarks"/> <IntVector Name="CollapsedFolds"/> </TabInfo> <TabInfo> <wxString Value="C:\Users\Thales\Documents\GitHub\PSP\Project\ElectricCalculation.h" Name="FileName"/> - <int Value="10" Name="FirstVisibleLine"/> - <int Value="31" Name="CurrentLine"/> + <int Value="4" Name="FirstVisibleLine"/> + <int Value="28" Name="CurrentLine"/> <wxArrayString Name="Bookmarks"/> <IntVector Name="CollapsedFolds"/> </TabInfo> <TabInfo> <wxString Value="C:\Users\Thales\Documents\GitHub\PSP\Project\ElectricCalculation.cpp" Name="FileName"/> - <int Value="336" Name="FirstVisibleLine"/> - <int Value="358" Name="CurrentLine"/> + <int Value="274" Name="FirstVisibleLine"/> + <int Value="284" Name="CurrentLine"/> <wxArrayString Name="Bookmarks"/> <IntVector Name="CollapsedFolds"/> </TabInfo> <TabInfo> <wxString Value="C:\Users\Thales\Documents\GitHub\PSP\Project\PowerFlow.h" Name="FileName"/> <int Value="0" Name="FirstVisibleLine"/> - <int Value="21" Name="CurrentLine"/> + <int Value="19" Name="CurrentLine"/> <wxArrayString Name="Bookmarks"/> <IntVector Name="CollapsedFolds"/> </TabInfo> <TabInfo> <wxString Value="C:\Users\Thales\Documents\GitHub\PSP\Project\PowerFlow.cpp" Name="FileName"/> - <int Value="191" Name="FirstVisibleLine"/> - <int Value="205" Name="CurrentLine"/> + <int Value="20" Name="FirstVisibleLine"/> + <int Value="0" Name="CurrentLine"/> + <wxArrayString Name="Bookmarks"/> + <IntVector Name="CollapsedFolds"/> + </TabInfo> + <TabInfo> + <wxString Value="C:\Users\Thales\Documents\GitHub\PSP\Project\Line.cpp" Name="FileName"/> + <int Value="417" Name="FirstVisibleLine"/> + <int Value="439" Name="CurrentLine"/> <wxArrayString Name="Bookmarks"/> <IntVector Name="CollapsedFolds"/> </TabInfo> <TabInfo> <wxString Value="C:\Users\Thales\Documents\GitHub\PSP\Project\Line.h" Name="FileName"/> - <int Value="0" Name="FirstVisibleLine"/> - <int Value="24" Name="CurrentLine"/> + <int Value="42" Name="FirstVisibleLine"/> + <int Value="55" Name="CurrentLine"/> + <wxArrayString Name="Bookmarks"/> + <IntVector Name="CollapsedFolds"/> + </TabInfo> + <TabInfo> + <wxString Value="C:\Users\Thales\Documents\GitHub\PSP\Project\SyncGenerator.cpp" Name="FileName"/> + <int Value="111" Name="FirstVisibleLine"/> + <int Value="124" Name="CurrentLine"/> <wxArrayString Name="Bookmarks"/> <IntVector Name="CollapsedFolds"/> </TabInfo> <TabInfo> - <wxString Value="C:\Users\Thales\Documents\GitHub\PSP\Project\Transformer.h" Name="FileName"/> - <int Value="18" Name="FirstVisibleLine"/> - <int Value="40" Name="CurrentLine"/> + <wxString Value="C:\Users\Thales\Documents\GitHub\PSP\Project\SyncGenerator.h" Name="FileName"/> + <int Value="57" Name="FirstVisibleLine"/> + <int Value="68" Name="CurrentLine"/> + <wxArrayString Name="Bookmarks"/> + <IntVector Name="CollapsedFolds"/> + </TabInfo> + <TabInfo> + <wxString Value="C:\Users\Thales\Documents\GitHub\PSP\Project\Machines.cpp" Name="FileName"/> + <int Value="216" Name="FirstVisibleLine"/> + <int Value="237" Name="CurrentLine"/> + <wxArrayString Name="Bookmarks"/> + <IntVector Name="CollapsedFolds"/> + </TabInfo> + <TabInfo> + <wxString Value="C:\Users\Thales\Documents\GitHub\PSP\Project\Machines.h" Name="FileName"/> + <int Value="0" Name="FirstVisibleLine"/> + <int Value="29" Name="CurrentLine"/> <wxArrayString Name="Bookmarks"/> <IntVector Name="CollapsedFolds"/> </TabInfo> diff --git a/.codelite/PSP.tags b/.codelite/PSP.tags Binary files differindex c3b31b5..99fb8f4 100644 --- a/.codelite/PSP.tags +++ b/.codelite/PSP.tags diff --git a/.codelite/compilation.db b/.codelite/compilation.db Binary files differindex e87f57b..df31f08 100644 --- a/.codelite/compilation.db +++ b/.codelite/compilation.db diff --git a/.codelite/compile_commands.json b/.codelite/compile_commands.json index e22e80a..17dd53e 100644 --- a/.codelite/compile_commands.json +++ b/.codelite/compile_commands.json @@ -1,11 +1,11 @@ [{ "directory": "C:\\Users\\Thales\\Documents\\GitHub\\PSP\\Project", - "command": "C:/TDM-GCC-64/bin/g++.exe -O2 -Wall -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -IC:/wxWidgets-3.1.0/lib/gcc_dll/mswu -IC:/wxWidgets-3.1.0/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -std=c++11 -DNDEBUG -DUNICODE -I. -I. -MG -MP -MT./Release/PowerFlow.cpp.o -MF./Release/PowerFlow.cpp.o.d -MM PowerFlow.cpp", - "file": "C:\\Users\\Thales\\Documents\\GitHub\\PSP\\Project\\PowerFlow.cpp" + "command": "C:/TDM-GCC-64/bin/g++.exe -O2 -Wall -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -IC:/wxWidgets-3.1.0/lib/gcc_dll/mswu -IC:/wxWidgets-3.1.0/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -std=c++11 -DNDEBUG -DUNICODE -I. -I. -MG -MP -MT./Release/SyncGenerator.cpp.o -MF./Release/SyncGenerator.cpp.o.d -MM SyncGenerator.cpp", + "file": "C:\\Users\\Thales\\Documents\\GitHub\\PSP\\Project\\SyncGenerator.cpp" }, { "directory": "C:\\Users\\Thales\\Documents\\GitHub\\PSP\\Project", - "command": "C:/TDM-GCC-64/bin/g++.exe -O2 -Wall -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -IC:/wxWidgets-3.1.0/lib/gcc_dll/mswu -IC:/wxWidgets-3.1.0/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -std=c++11 -DNDEBUG -DUNICODE -I. -I. -MG -MP -MT./Release/ElectricCalculation.cpp.o -MF./Release/ElectricCalculation.cpp.o.d -MM ElectricCalculation.cpp", - "file": "C:\\Users\\Thales\\Documents\\GitHub\\PSP\\Project\\ElectricCalculation.cpp" + "command": "C:/TDM-GCC-64/bin/g++.exe -O2 -Wall -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -IC:/wxWidgets-3.1.0/lib/gcc_dll/mswu -IC:/wxWidgets-3.1.0/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -std=c++11 -DNDEBUG -DUNICODE -I. -I. -MG -MP -MT./Release/Machines.cpp.o -MF./Release/Machines.cpp.o.d -MM Machines.cpp", + "file": "C:\\Users\\Thales\\Documents\\GitHub\\PSP\\Project\\Machines.cpp" }, { "directory": "C:\\Users\\Thales\\Documents\\GitHub\\PSP\\Project", "command": "C:/TDM-GCC-64/bin/g++.exe -c C:/Users/Thales/Documents/GitHub/PSP/Project/MainFrame.cpp -O2 -Wall -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -IC:/wxWidgets-3.1.0/lib/gcc_dll/mswu -IC:/wxWidgets-3.1.0/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -std=c++11 -DNDEBUG -DUNICODE -o ./Release/MainFrame.cpp.o -I. -I.", @@ -16,38 +16,38 @@ "file": "C:\\Users\\Thales\\Documents\\GitHub\\PSP\\Project\\Workspace.cpp" }, { "directory": "C:\\Users\\Thales\\Documents\\GitHub\\PSP\\Project", - "command": "C:/TDM-GCC-64/bin/g++.exe -c C:/Users/Thales/Documents/GitHub/PSP/Project/Bus.cpp -O2 -Wall -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -IC:/wxWidgets-3.1.0/lib/gcc_dll/mswu -IC:/wxWidgets-3.1.0/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -std=c++11 -DNDEBUG -DUNICODE -o ./Release/Bus.cpp.o -I. -I.", - "file": "C:\\Users\\Thales\\Documents\\GitHub\\PSP\\Project\\Bus.cpp" + "command": "C:/TDM-GCC-64/bin/g++.exe -c C:/Users/Thales/Documents/GitHub/PSP/Project/Machines.cpp -O2 -Wall -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -IC:/wxWidgets-3.1.0/lib/gcc_dll/mswu -IC:/wxWidgets-3.1.0/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -std=c++11 -DNDEBUG -DUNICODE -o ./Release/Machines.cpp.o -I. -I.", + "file": "C:\\Users\\Thales\\Documents\\GitHub\\PSP\\Project\\Machines.cpp" }, { "directory": "C:\\Users\\Thales\\Documents\\GitHub\\PSP\\Project", - "command": "C:/TDM-GCC-64/bin/g++.exe -c C:/Users/Thales/Documents/GitHub/PSP/Project/Line.cpp -O2 -Wall -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -IC:/wxWidgets-3.1.0/lib/gcc_dll/mswu -IC:/wxWidgets-3.1.0/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -std=c++11 -DNDEBUG -DUNICODE -o ./Release/Line.cpp.o -I. -I.", - "file": "C:\\Users\\Thales\\Documents\\GitHub\\PSP\\Project\\Line.cpp" + "command": "C:/TDM-GCC-64/bin/g++.exe -c C:/Users/Thales/Documents/GitHub/PSP/Project/SyncGenerator.cpp -O2 -Wall -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -IC:/wxWidgets-3.1.0/lib/gcc_dll/mswu -IC:/wxWidgets-3.1.0/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -std=c++11 -DNDEBUG -DUNICODE -o ./Release/SyncGenerator.cpp.o -I. -I.", + "file": "C:\\Users\\Thales\\Documents\\GitHub\\PSP\\Project\\SyncGenerator.cpp" }, { "directory": "C:\\Users\\Thales\\Documents\\GitHub\\PSP\\Project", - "command": "C:/TDM-GCC-64/bin/g++.exe -c C:/Users/Thales/Documents/GitHub/PSP/Project/Branch.cpp -O2 -Wall -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -IC:/wxWidgets-3.1.0/lib/gcc_dll/mswu -IC:/wxWidgets-3.1.0/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -std=c++11 -DNDEBUG -DUNICODE -o ./Release/Branch.cpp.o -I. -I.", - "file": "C:\\Users\\Thales\\Documents\\GitHub\\PSP\\Project\\Branch.cpp" + "command": "C:/TDM-GCC-64/bin/g++.exe -c C:/Users/Thales/Documents/GitHub/PSP/Project/ElectricCalculation.cpp -O2 -Wall -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -IC:/wxWidgets-3.1.0/lib/gcc_dll/mswu -IC:/wxWidgets-3.1.0/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -std=c++11 -DNDEBUG -DUNICODE -o ./Release/ElectricCalculation.cpp.o -I. -I.", + "file": "C:\\Users\\Thales\\Documents\\GitHub\\PSP\\Project\\ElectricCalculation.cpp" }, { "directory": "C:\\Users\\Thales\\Documents\\GitHub\\PSP\\Project", "command": "C:/TDM-GCC-64/bin/g++.exe -c C:/Users/Thales/Documents/GitHub/PSP/Project/PowerFlow.cpp -O2 -Wall -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -IC:/wxWidgets-3.1.0/lib/gcc_dll/mswu -IC:/wxWidgets-3.1.0/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -std=c++11 -DNDEBUG -DUNICODE -o ./Release/PowerFlow.cpp.o -I. -I.", "file": "C:\\Users\\Thales\\Documents\\GitHub\\PSP\\Project\\PowerFlow.cpp" }, { "directory": "C:\\Users\\Thales\\Documents\\GitHub\\PSP\\Project", - "command": "C:/TDM-GCC-64/bin/g++.exe -c C:/Users/Thales/Documents/GitHub/PSP/Project/ElectricCalculation.cpp -O2 -Wall -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -IC:/wxWidgets-3.1.0/lib/gcc_dll/mswu -IC:/wxWidgets-3.1.0/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -std=c++11 -DNDEBUG -DUNICODE -o ./Release/ElectricCalculation.cpp.o -I. -I.", - "file": "C:\\Users\\Thales\\Documents\\GitHub\\PSP\\Project\\ElectricCalculation.cpp" + "command": "C:/TDM-GCC-64/bin/g++.exe -c C:/Users/Thales/Documents/GitHub/PSP/Project/SyncMotor.cpp -O2 -Wall -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -IC:/wxWidgets-3.1.0/lib/gcc_dll/mswu -IC:/wxWidgets-3.1.0/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -std=c++11 -DNDEBUG -DUNICODE -o ./Release/SyncMotor.cpp.o -I. -I.", + "file": "C:\\Users\\Thales\\Documents\\GitHub\\PSP\\Project\\SyncMotor.cpp" }, { "directory": "C:\\Users\\Thales\\Documents\\GitHub\\PSP\\Project", - "command": "C:/TDM-GCC-64/bin/g++.exe -c C:/Users/Thales/Documents/GitHub/PSP/Project/Transformer.cpp -O2 -Wall -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -IC:/wxWidgets-3.1.0/lib/gcc_dll/mswu -IC:/wxWidgets-3.1.0/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -std=c++11 -DNDEBUG -DUNICODE -o ./Release/Transformer.cpp.o -I. -I.", - "file": "C:\\Users\\Thales\\Documents\\GitHub\\PSP\\Project\\Transformer.cpp" + "command": "C:/TDM-GCC-64/bin/g++.exe -c C:/Users/Thales/Documents/GitHub/PSP/Project/IndMotor.cpp -O2 -Wall -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -IC:/wxWidgets-3.1.0/lib/gcc_dll/mswu -IC:/wxWidgets-3.1.0/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -std=c++11 -DNDEBUG -DUNICODE -o ./Release/IndMotor.cpp.o -I. -I.", + "file": "C:\\Users\\Thales\\Documents\\GitHub\\PSP\\Project\\IndMotor.cpp" }, { "directory": "C:\\Users\\Thales\\Documents\\GitHub\\PSP\\Project", - "command": "C:/TDM-GCC-64/bin/g++.exe -c C:/Users/Thales/Documents/GitHub/PSP/Project/LineForm.cpp -O2 -Wall -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -IC:/wxWidgets-3.1.0/lib/gcc_dll/mswu -IC:/wxWidgets-3.1.0/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -std=c++11 -DNDEBUG -DUNICODE -o ./Release/LineForm.cpp.o -I. -I.", - "file": "C:\\Users\\Thales\\Documents\\GitHub\\PSP\\Project\\LineForm.cpp" + "command": "C:/TDM-GCC-64/bin/g++.exe -c C:/Users/Thales/Documents/GitHub/PSP/Project/GeneratorStabForm.cpp -O2 -Wall -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -IC:/wxWidgets-3.1.0/lib/gcc_dll/mswu -IC:/wxWidgets-3.1.0/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -std=c++11 -DNDEBUG -DUNICODE -o ./Release/GeneratorStabForm.cpp.o -I. -I.", + "file": "C:\\Users\\Thales\\Documents\\GitHub\\PSP\\Project\\GeneratorStabForm.cpp" }, { "directory": "C:\\Users\\Thales\\Documents\\GitHub\\PSP\\Project", - "command": "C:/TDM-GCC-64/bin/g++.exe -c C:/Users/Thales/Documents/GitHub/PSP/Project/BusForm.cpp -O2 -Wall -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -IC:/wxWidgets-3.1.0/lib/gcc_dll/mswu -IC:/wxWidgets-3.1.0/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -std=c++11 -DNDEBUG -DUNICODE -o ./Release/BusForm.cpp.o -I. -I.", - "file": "C:\\Users\\Thales\\Documents\\GitHub\\PSP\\Project\\BusForm.cpp" + "command": "C:/TDM-GCC-64/bin/g++.exe -c C:/Users/Thales/Documents/GitHub/PSP/Project/IndMotorForm.cpp -O2 -Wall -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -IC:/wxWidgets-3.1.0/lib/gcc_dll/mswu -IC:/wxWidgets-3.1.0/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -std=c++11 -DNDEBUG -DUNICODE -o ./Release/IndMotorForm.cpp.o -I. -I.", + "file": "C:\\Users\\Thales\\Documents\\GitHub\\PSP\\Project\\IndMotorForm.cpp" }, { "directory": "C:\\Users\\Thales\\Documents\\GitHub\\PSP\\Project", - "command": "C:/TDM-GCC-64/bin/g++.exe -c C:/Users/Thales/Documents/GitHub/PSP/Project/TransformerForm.cpp -O2 -Wall -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -IC:/wxWidgets-3.1.0/lib/gcc_dll/mswu -IC:/wxWidgets-3.1.0/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -std=c++11 -DNDEBUG -DUNICODE -o ./Release/TransformerForm.cpp.o -I. -I.", - "file": "C:\\Users\\Thales\\Documents\\GitHub\\PSP\\Project\\TransformerForm.cpp" + "command": "C:/TDM-GCC-64/bin/g++.exe -c C:/Users/Thales/Documents/GitHub/PSP/Project/SyncMachineForm.cpp -O2 -Wall -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -IC:/wxWidgets-3.1.0/lib/gcc_dll/mswu -IC:/wxWidgets-3.1.0/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport -std=c++11 -DNDEBUG -DUNICODE -o ./Release/SyncMachineForm.cpp.o -I. -I.", + "file": "C:\\Users\\Thales\\Documents\\GitHub\\PSP\\Project\\SyncMachineForm.cpp" }]
\ No newline at end of file diff --git a/.codelite/refactoring.db b/.codelite/refactoring.db Binary files differindex da913d6..f071aeb 100644 --- a/.codelite/refactoring.db +++ b/.codelite/refactoring.db diff --git a/Project/Bus.h b/Project/Bus.h index 2776462..836d2f7 100644 --- a/Project/Bus.h +++ b/Project/Bus.h @@ -5,6 +5,7 @@ #include "Element.h" struct BusElectricalData { + int number = 0; wxString name = ""; double nominalVoltage = 138.0; ElectricalUnit nominalVoltageUnit = UNIT_kV; diff --git a/Project/ElectricCalculation.cpp b/Project/ElectricCalculation.cpp index f018f74..3cda1af 100644 --- a/Project/ElectricCalculation.cpp +++ b/Project/ElectricCalculation.cpp @@ -51,104 +51,85 @@ bool ElectricCalculation::GetYBus(std::vector<std::vector<std::complex<double> > yBus.push_back(line); } - // Build connection map - std::vector<std::vector<int> > lineMap; - std::vector<std::vector<int> > transfomerMap; - lineMap.resize(m_lineList.size()); - transfomerMap.resize(m_transformerList.size()); - - // Get the connection map for + // Set buses numbers int busNumber = 0; for(auto itb = m_busList.begin(); itb != m_busList.end(); itb++) { Bus* bus = *itb; + BusElectricalData data = bus->GetEletricalData(); + data.number = busNumber; + bus->SetElectricalData(data); + busNumber++; + } - // Get power line connection map - for(int i = 0; i < (int)m_lineList.size(); i++) { - for(int j = 0; j < (int)m_lineList[i]->GetParentList().size(); j++) { - if(bus == m_lineList[i]->GetParentList()[j]) lineMap[i].push_back(busNumber); - } - } - - // Get transformer connection map - for(int i = 0; i < (int)m_transformerList.size(); i++) { - for(int j = 0; j < (int)m_transformerList[i]->GetParentList().size(); j++) { - if(bus == m_transformerList[i]->GetParentList()[j]) transfomerMap[i].push_back(busNumber); - } - } - - // Load - for(auto itlo = m_loadList.begin(); itlo != m_loadList.end(); itlo++) { - Load* load = *itlo; - if(bus == load->GetParentList()[0] && load->IsOnline()) { - LoadElectricalData data = load->GetPUElectricalData(systemPowerBase); - if(data.loadType == CONST_IMPEDANCE) - yBus[busNumber][busNumber] += std::complex<double>(data.activePower, -data.reactivePower); - } + // Load + for(auto itlo = m_loadList.begin(); itlo != m_loadList.end(); itlo++) { + Load* load = *itlo; + if(load->IsOnline()) { + int n = ((Bus*)load->GetParentList()[0])->GetEletricalData().number; + LoadElectricalData data = load->GetPUElectricalData(systemPowerBase); + if(data.loadType == CONST_IMPEDANCE) + yBus[n][n] += std::complex<double>(data.activePower, -data.reactivePower); } + } - // Capacitor - for(auto itca = m_capacitorList.begin(); itca != m_capacitorList.end(); itca++) { - Capacitor* capacitor = *itca; - if(bus == capacitor->GetParentList()[0] && capacitor->IsOnline()) { - CapacitorElectricalData data = capacitor->GetPUElectricalData(systemPowerBase); - yBus[busNumber][busNumber] += std::complex<double>(0.0, data.reactivePower); - } + // Capacitor + for(auto itca = m_capacitorList.begin(); itca != m_capacitorList.end(); itca++) { + Capacitor* capacitor = *itca; + if(capacitor->IsOnline()) { + int n = ((Bus*)capacitor->GetParentList()[0])->GetEletricalData().number; + CapacitorElectricalData data = capacitor->GetPUElectricalData(systemPowerBase); + yBus[n][n] += std::complex<double>(0.0, data.reactivePower); } + } - // Inductor - for(auto itin = m_inductorList.begin(); itin != m_inductorList.end(); itin++) { - Inductor* inductor = *itin; - if(bus == inductor->GetParentList()[0] && inductor->IsOnline()) { - InductorElectricalData data = inductor->GetPUElectricalData(systemPowerBase); - yBus[busNumber][busNumber] += std::complex<double>(0.0, -data.reactivePower); - } + // Inductor + for(auto itin = m_inductorList.begin(); itin != m_inductorList.end(); itin++) { + Inductor* inductor = *itin; + if(inductor->IsOnline()) { + int n = ((Bus*)inductor->GetParentList()[0])->GetEletricalData().number; + InductorElectricalData data = inductor->GetPUElectricalData(systemPowerBase); + yBus[n][n] += std::complex<double>(0.0, -data.reactivePower); } - - busNumber++; } // Power line - int lineNumber = 0; for(auto itl = m_lineList.begin(); itl != m_lineList.end(); itl++) { Line* line = *itl; - LineElectricalData data = line->GetElectricalData(); if(line->IsOnline()) { - yBus[lineMap[lineNumber][0]][lineMap[lineNumber][1]] -= - 1.0 / std::complex<double>(data.resistance, data.indReactance); - yBus[lineMap[lineNumber][1]][lineMap[lineNumber][0]] -= - 1.0 / std::complex<double>(data.resistance, data.indReactance); - - yBus[lineMap[lineNumber][0]][lineMap[lineNumber][0]] += - 1.0 / std::complex<double>(data.resistance, data.indReactance); - yBus[lineMap[lineNumber][1]][lineMap[lineNumber][1]] += - 1.0 / std::complex<double>(data.resistance, data.indReactance); - - yBus[lineMap[lineNumber][0]][lineMap[lineNumber][0]] += - std::complex<double>(0.0, data.capSusceptance / 2.0); - yBus[lineMap[lineNumber][1]][lineMap[lineNumber][1]] += - std::complex<double>(0.0, data.capSusceptance / 2.0); + LineElectricalData data = line->GetElectricalData(); + + int n1 = ((Bus*)line->GetParentList()[0])->GetEletricalData().number; + int n2 = ((Bus*)line->GetParentList()[1])->GetEletricalData().number; + + yBus[n1][n2] -= 1.0 / std::complex<double>(data.resistance, data.indReactance); + yBus[n2][n1] -= 1.0 / std::complex<double>(data.resistance, data.indReactance); + + yBus[n1][n1] += 1.0 / std::complex<double>(data.resistance, data.indReactance); + yBus[n2][n2] += 1.0 / std::complex<double>(data.resistance, data.indReactance); + + yBus[n1][n1] += std::complex<double>(0.0, data.capSusceptance / 2.0); + yBus[n2][n2] += std::complex<double>(0.0, data.capSusceptance / 2.0); } - lineNumber++; } - int transformerNumber = 0; + // Transformer for(auto itt = m_transformerList.begin(); itt != m_transformerList.end(); ++itt) { Transformer* transformer = *itt; - TransformerElectricalData data = transformer->GetElectricalData(); if(transformer->IsOnline()) { + TransformerElectricalData data = transformer->GetElectricalData(); + + int n1 = ((Bus*)transformer->GetParentList()[0])->GetEletricalData().number; + int n2 = ((Bus*)transformer->GetParentList()[1])->GetEletricalData().number; + // If the transformer have nominal turns ratio (1.0) and no phase shifting, it will be modelled as series // impedance. if(data.turnsRatio == 1.0 && data.phaseShift == 0.0) { - yBus[transfomerMap[transformerNumber][0]][transfomerMap[transformerNumber][1]] += - -1.0 / std::complex<double>(data.resistance, data.indReactance); - yBus[transfomerMap[transformerNumber][1]][transfomerMap[transformerNumber][0]] += - -1.0 / std::complex<double>(data.resistance, data.indReactance); - - yBus[transfomerMap[transformerNumber][0]][transfomerMap[transformerNumber][0]] += - 1.0 / std::complex<double>(data.resistance, data.indReactance); - yBus[transfomerMap[transformerNumber][1]][transfomerMap[transformerNumber][1]] += - 1.0 / std::complex<double>(data.resistance, data.indReactance); + yBus[n1][n2] += -1.0 / std::complex<double>(data.resistance, data.indReactance); + yBus[n2][n1] += -1.0 / std::complex<double>(data.resistance, data.indReactance); + + yBus[n1][n1] += 1.0 / std::complex<double>(data.resistance, data.indReactance); + yBus[n2][n2] += 1.0 / std::complex<double>(data.resistance, data.indReactance); } // If the transformer have no-nominal turn ratio and/or phase shifting, it will be modelled in a different // way (see references). @@ -164,15 +145,12 @@ bool ElectricCalculation::GetYBus(std::vector<std::vector<std::complex<double> > // Transformer admitance std::complex<double> y = 1.0 / std::complex<double>(data.resistance, data.indReactance); - yBus[transfomerMap[transformerNumber][0]][transfomerMap[transformerNumber][0]] += - y / std::pow(std::abs(a), 2.0); - yBus[transfomerMap[transformerNumber][0]][transfomerMap[transformerNumber][1]] += -(y / std::conj(a)); - yBus[transfomerMap[transformerNumber][1]][transfomerMap[transformerNumber][0]] += -(y / a); - yBus[transfomerMap[transformerNumber][1]][transfomerMap[transformerNumber][1]] += y; + yBus[n1][n1] += y / std::pow(std::abs(a), 2.0); + yBus[n1][n2] += -(y / std::conj(a)); + yBus[n2][n1] += -(y / a); + yBus[n2][n2] += y; } } - - transformerNumber++; } return true; @@ -180,40 +158,27 @@ bool ElectricCalculation::GetYBus(std::vector<std::vector<std::complex<double> > void ElectricCalculation::ValidateElementsPowerFlow(std::vector<std::complex<double> > voltage, std::vector<std::complex<double> > power, + std::vector<BusType> busType, double systemPowerBase) { - std::vector<std::vector<int> > lineMap; - std::vector<std::vector<int> > transfomerMap; - lineMap.resize(m_lineList.size()); - transfomerMap.resize(m_transformerList.size()); - - // Bus voltage and connections maps + // Buses voltages for(int i = 0; i < (int)m_busList.size(); i++) { - BusElectricalData data = m_busList[i]->GetEletricalData(); + Bus* bus = m_busList[i]; + BusElectricalData data = bus->GetEletricalData(); data.voltage = voltage[i]; - m_busList[i]->SetElectricalData(data); - - // Get power line connection map - for(int j = 0; j < (int)m_lineList.size(); j++) { - for(int k = 0; k < (int)m_lineList[j]->GetParentList().size(); k++) { - if(bus == m_lineList[j]->GetParentList()[k]) lineMap[j].push_back(i); - } - } - - // Get transformer connection map - for(int j = 0; j < (int)m_transformerList.size(); j++) { - for(int k = 0; k < (int)m_transformerList[j]->GetParentList().size(); k++) { - if(bus == m_transformerList[j]->GetParentList()[k]) transfomerMap[j].push_back(i); - } - } + bus->SetElectricalData(data); } // Power line for(int i = 0; i < (int)m_lineList.size(); i++) { - if(m_lineList[i]->IsOnline()) { - LineElectricalData data = m_lineList[i]->GetEletricalData(); - std::complex<double> v1 = voltage[lineMap[i][0]]; - std::complex<double> v2 = voltage[lineMap[i][1]]; + Line* line = m_lineList[i]; + if(line->IsOnline()) { + int n1 = ((Bus*)line->GetParentList()[0])->GetEletricalData().number; + int n2 = ((Bus*)line->GetParentList()[1])->GetEletricalData().number; + + LineElectricalData data = line->GetElectricalData(); + std::complex<double> v1 = voltage[n1]; + std::complex<double> v2 = voltage[n2]; data.current[0] = (v1 - v2) / std::complex<double>(data.resistance, data.indReactance) + v1 * std::complex<double>(0.0, data.capSusceptance / 2.0); @@ -223,16 +188,24 @@ void ElectricCalculation::ValidateElementsPowerFlow(std::vector<std::complex<dou data.powerFlow[0] = v1 * std::conj(data.current[0]); data.powerFlow[1] = v2 * std::conj(data.current[1]); - m_lineList[i]->SetElectricalData(data); + if(data.powerFlow[0].real() > data.powerFlow[1].real()) + line->SetPowerFlowDirection(PF_BUS1_TO_BUS2); + else + line->SetPowerFlowDirection(PF_BUS2_TO_BUS1); + + line->SetElectricalData(data); } } // Transformer for(int i = 0; i < (int)m_transformerList.size(); i++) { - if(m_transformerList[i]->IsOnline()) { - TransformerElectricalData data = m_transformerList[i]->GetElectricalData(); - std::complex<double> v1 = voltage[transfomerMap[i][0]]; // Primary voltage - std::complex<double> v2 = voltage[transfomerMap[i][1]]; // Secondary voltage + Transformer* transformer = m_transformerList[i]; + if(transformer->IsOnline()) { + TransformerElectricalData data = transformer->GetElectricalData(); + int n1 = ((Bus*)transformer->GetParentList()[0])->GetEletricalData().number; + int n2 = ((Bus*)transformer->GetParentList()[1])->GetEletricalData().number; + std::complex<double> v1 = voltage[n1]; // Primary voltage + std::complex<double> v2 = voltage[n2]; // Secondary voltage // Transformer admitance std::complex<double> y = 1.0 / std::complex<double>(data.resistance, data.indReactance); @@ -252,14 +225,19 @@ void ElectricCalculation::ValidateElementsPowerFlow(std::vector<std::complex<dou data.powerFlow[0] = v1 * std::conj(data.current[0]); data.powerFlow[1] = v2 * std::conj(data.current[1]); - m_transformerList[i]->SetElectricalData(data); + if(data.powerFlow[0].real() > data.powerFlow[1].real()) + transformer->SetPowerFlowDirection(PF_BUS1_TO_BUS2); + else + transformer->SetPowerFlowDirection(PF_BUS2_TO_BUS1); + + transformer->SetElectricaData(data); } } // Synchronous machines for(int i = 0; i < (int)m_busList.size(); i++) { Bus* bus = m_busList[i]; - BusElectricalData data = bus->GetElectricalData(); + BusElectricalData data = bus->GetEletricalData(); // Get the synchronous machines connected and calculate the load power on the bus. std::vector<SyncGenerator*> syncGeneratorsOnBus; @@ -267,95 +245,116 @@ void ElectricCalculation::ValidateElementsPowerFlow(std::vector<std::complex<dou std::complex<double> loadPower(0.0, 0.0); for(auto itsg = m_syncGeneratorList.begin(); itsg != m_syncGeneratorList.end(); itsg++) { SyncGenerator* syncGenerator = *itsg; - if(bus == syncGenerator->GetParentList()[0]) syncGeneratorsOnBus.push_back(syncGenerator); + if(bus == syncGenerator->GetParentList()[0] && syncGenerator->IsOnline()) + syncGeneratorsOnBus.push_back(syncGenerator); } for(auto itsm = m_syncMotorList.begin(); itsm != m_syncMotorList.end(); itsm++) { SyncMotor* syncMotor = *itsm; - if(bus == syncMotor->GetParentList()[0]) { + if(bus == syncMotor->GetParentList()[0] && syncMotor->IsOnline()) { syncMotorsOnBus.push_back(syncMotor); SyncMotorElectricalData childData = syncMotor->GetPUElectricalData(systemPowerBase); loadPower += std::complex<double>(childData.activePower, 0.0); } } for(auto itlo = m_loadList.begin(); itlo != m_loadList.end(); itlo++) { - Load* load = itlo; - if(bus == load->GetParentList()[0]) { + Load* load = *itlo; + if(bus == load->GetParentList()[0] && load->IsOnline()) { LoadElectricalData childData = load->GetPUElectricalData(systemPowerBase); - loadPower += std::complex<double>(childData.activePower, childData.reactivePower); - } - } - for(auto itim = m_indMotorList.begin(); itim != m_indMotorList.end(); itim++) { - IndMotor* indMotor = itim; - if(bus == indMotor->GetParentList()[0]) { - LoadElectricalData childData = indMotor->GetPUElectricalData(systemPowerBase); if(childData.loadType == CONST_POWER) loadPower += std::complex<double>(childData.activePower, childData.reactivePower); - else if(childData.loadType == CONST_IMPEDANCE) - loadPower += std::pow(std::abs(voltage[i]), 2) * - std::complex<double>(childData.activePower, childData.reactivePower); } } for(auto itim = m_indMotorList.begin(); itim != m_indMotorList.end(); itim++) { - IndMotor* indMotor = itim; - if(bus == indMotor->GetParentList()[0]) { + IndMotor* indMotor = *itim; + if(bus == indMotor->GetParentList()[0] && indMotor->IsOnline()) { IndMotorElectricalData childData = indMotor->GetPUElectricalData(systemPowerBase); loadPower += std::complex<double>(childData.activePower, childData.reactivePower); } } - for(auto itca = m_capacitorList.begin(); itca != m_capacitorList.end(); itca++) { - Capacitor* capacitor = itca; - if(bus == capacitor->GetParentList()[0]) { - CapacitorElectricalData childData = capacitor->GetPUElectricalData(systemPowerBase); - loadPower += std::pow(std::abs(voltage[i]), 2) * std::complex<double>(0.0, -childData.reactivePower); - } - } - for(auto itin = m_capacitorList.begin(); itin != m_capacitorList.end(); itin++) { - Inductor* inductor = itin; - if(bus == inductor->GetParentList()[0]) { - InductorElectricalData childData = inductor->GetPUElectricalData(systemPowerBase); - loadPower += std::pow(std::abs(voltage[i]), 2) * std::complex<double>(0.0, childData.reactivePower); - } - } - + // Set the sync generator power - for(auto itsg = syncGeneratorsOnBus.begin(); itsg != syncGeneratorsOnBus.end(); itsg++) { - SyncGenerator* generator = *itsg; - SyncGeneratorElectricalData childData = generator->GetElectricalData(); - - if(data.slackBus) { - double activePower = - (power[i].real() + loadPower.real()) * systemPowerBase / (double)(syncGeneratorsOnBus.size()); - - switch(childData.activePowerUnit) { - case UNIT_kW: { - activePower /= 1e3; - } break; - case UNIT_MW: { - activePower /= 1e6; - } break; - default: break; + if(busType[i] == BUS_SLACK || busType[i] == BUS_PV) { + for(auto itsg = syncGeneratorsOnBus.begin(); itsg != syncGeneratorsOnBus.end(); itsg++) { + SyncGenerator* generator = *itsg; + if(generator->IsOnline()) { + SyncGeneratorElectricalData childData = generator->GetElectricalData(); + + if(busType[i] == BUS_SLACK) { + double activePower = (power[i].real() + loadPower.real()) * systemPowerBase / + (double)(syncGeneratorsOnBus.size()); + + switch(childData.activePowerUnit) { + case UNIT_PU: { + activePower /= systemPowerBase; + } break; + case UNIT_kW: { + activePower /= 1e3; + } break; + case UNIT_MW: { + activePower /= 1e6; + } break; + default: + break; + } + + if(activePower >= 0.0) + generator->SetPowerFlowDirection(PF_TO_BUS); + else + generator->SetPowerFlowDirection(PF_TO_ELEMENT); + + childData.activePower = activePower; + } + if(busType[i] == BUS_PV || busType[i] == BUS_SLACK) { + double reactivePower = (power[i].imag() + loadPower.imag()) * systemPowerBase / + (double)(syncGeneratorsOnBus.size() + syncMotorsOnBus.size()); + switch(childData.reactivePowerUnit) { + case UNIT_PU: { + reactivePower /= systemPowerBase; + } break; + case UNIT_kVAr: { + reactivePower /= 1e3; + } break; + case UNIT_MVAr: { + reactivePower /= 1e6; + } break; + default: + break; + } + childData.reactivePower = reactivePower; + } + + generator->SetElectricalData(childData); } - childData.activePower = activePower; } - double reactivePower = (power[i].imag() + loadPower.imag()) * systemPowerBase / - (double)(syncGeneratorsOnBus.size() + syncMotorsOnBus.size()); - switch(childData.reactivePowerUnit) { - case UNIT_kVAr: { - reactivePower /= 1e3; - } break; - case UNIT_MVAr: { - reactivePower /= 1e6; - } break; - default: break; + } + + // Set the sync motor reactive power + if(busType[i] == BUS_PV) { + for(auto itmg = syncMotorsOnBus.begin(); itmg != syncMotorsOnBus.end(); itmg++) { + SyncMotor* syncMotor = *itmg; + if(syncMotor->IsOnline()) { + SyncMotorElectricalData childData = syncMotor->GetElectricalData(); + + double reactivePower = (power[i].imag() + loadPower.imag()) * systemPowerBase / + (double)(syncGeneratorsOnBus.size() + syncMotorsOnBus.size()); + switch(childData.reactivePowerUnit) { + case UNIT_PU: { + reactivePower /= systemPowerBase; + } break; + case UNIT_kVAr: { + reactivePower /= 1e3; + } break; + case UNIT_MVAr: { + reactivePower /= 1e6; + } break; + default: + break; + } + childData.reactivePower = reactivePower; + + syncMotor->SetElectricalData(childData); + } } - childData.reactivePower = reactivePower; - - generator->SetElectricalData(childData); } - - // continua... - // falta o compensador sincrono - // verificar se eh necessario os tipos de barra nesse metodo. - // Tavez soh pode mudar a potencia reative em maquinas conectadas em barras PV?? --> TESTAR } } diff --git a/Project/ElectricCalculation.h b/Project/ElectricCalculation.h index 16a761a..02a45e0 100644 --- a/Project/ElectricCalculation.h +++ b/Project/ElectricCalculation.h @@ -15,6 +15,8 @@ #include "SyncMotor.h" #include "Transformer.h" +enum BusType { BUS_SLACK = 0, BUS_PV, BUS_PQ }; + class ElectricCalculation { public: @@ -22,7 +24,10 @@ class ElectricCalculation ~ElectricCalculation(); virtual void GetElementsFromList(std::vector<Element*> elementList); virtual bool GetYBus(std::vector<std::vector<std::complex<double> > >& yBus, double systemPowerBase); - virtual void ValidateElementsPowerFlow(std::vector<std::complex<double> > voltage, std::vector<std::complex<double> > power, double systemPowerBase); + virtual void ValidateElementsPowerFlow(std::vector<std::complex<double> > voltage, + std::vector<std::complex<double> > power, + std::vector<BusType> busType, + double systemPowerBase); protected: std::vector<Bus*> m_busList; diff --git a/Project/Line.cpp b/Project/Line.cpp index a473562..b7b5ba7 100644 --- a/Project/Line.cpp +++ b/Project/Line.cpp @@ -420,6 +420,12 @@ bool Line::SetNodeParent(Element* parent) return false; } +void Line::SetPowerFlowDirection(PowerFlowDirection pfDirection) +{ + m_pfDirection = pfDirection; + UpdatePowerFlowArrowsPosition(); +} + void Line::UpdatePowerFlowArrowsPosition() { std::vector<wxPoint2DDouble> edges; diff --git a/Project/Line.h b/Project/Line.h index 7e50fc7..1a9aa2b 100644 --- a/Project/Line.h +++ b/Project/Line.h @@ -53,6 +53,7 @@ class Line : public Branch virtual void AddNode(wxPoint2DDouble point); virtual void RotateNode(Element* parent, bool clockwise = true); virtual void CalculateBoundaries(wxPoint2DDouble& leftUp, wxPoint2DDouble& rightBottom) const; + virtual void SetPowerFlowDirection(PowerFlowDirection pfDirection); virtual bool ShowForm(wxWindow* parent, Element* element); virtual LineElectricalData GetElectricalData() const { return m_electricaData; } virtual void SetElectricalData(LineElectricalData electricalData) { m_electricaData = electricalData; } diff --git a/Project/Machines.cpp b/Project/Machines.cpp index 12afe61..f859831 100644 --- a/Project/Machines.cpp +++ b/Project/Machines.cpp @@ -232,3 +232,9 @@ void Machines::UpdatePowerFlowArrowsPosition() CalculatePowerFlowPts(edges); } + +void Machines::SetPowerFlowDirection(PowerFlowDirection pfDirection) +{ + m_pfDirection = pfDirection; + UpdatePowerFlowArrowsPosition(); +} diff --git a/Project/Machines.h b/Project/Machines.h index b296f99..cecd78b 100644 --- a/Project/Machines.h +++ b/Project/Machines.h @@ -23,6 +23,7 @@ public: virtual void UpdateNodes(); virtual void Rotate(bool clockwise = true); virtual void DrawSymbol() const {} + virtual void SetPowerFlowDirection(PowerFlowDirection pfDirection); protected: void UpdateSwitchesPosition(); diff --git a/Project/PowerFlow.cpp b/Project/PowerFlow.cpp index 40ee498..ff79722 100644 --- a/Project/PowerFlow.cpp +++ b/Project/PowerFlow.cpp @@ -214,8 +214,8 @@ bool PowerFlow::RunGaussSeidel(double systemPowerBase, power[i] = sBus; } - /*wxString str = ""; - for(int i = 0; i < numberOfBuses; i++) { + wxString str = ""; + /*for(int i = 0; i < numberOfBuses; i++) { str += wxString::Format("%.5f/_%.2f\n", std::abs(voltage[i]), wxRadToDeg(std::arg(voltage[i]))); } wxLogMessage(str); @@ -228,7 +228,14 @@ bool PowerFlow::RunGaussSeidel(double systemPowerBase, wxLogMessage(wxString::Format("Num iteracoes = %d", iteration));*/ - ValidateElementsPowerFlow(voltage, power, systemPowerBase); + ValidateElementsPowerFlow(voltage, power, busType, systemPowerBase); + + for(auto itb = m_busList.begin(); itb != m_busList.end(); itb++) { + Bus* bus = *itb; + BusElectricalData data = bus->GetEletricalData(); + str += wxString::Format("%.5f/_%.2f\n", std::abs(data.voltage), wxRadToDeg(std::arg(data.voltage))); + } + wxLogMessage(str); return true; } diff --git a/Project/PowerFlow.h b/Project/PowerFlow.h index ac27c7e..1e5c621 100644 --- a/Project/PowerFlow.h +++ b/Project/PowerFlow.h @@ -7,8 +7,6 @@ #include <wx/intl.h> //_() #include <wx/log.h> //temp -enum BusType { BUS_SLACK = 0, BUS_PV, BUS_PQ }; - class PowerFlow : public ElectricCalculation { public: diff --git a/Project/Project.mk b/Project/Project.mk index dce9c8b..09c2818 100644 --- a/Project/Project.mk +++ b/Project/Project.mk @@ -13,7 +13,7 @@ CurrentFileName := CurrentFilePath := CurrentFileFullPath := User :=Thales -Date :=03/11/2016 +Date :=04/11/2016 CodeLitePath :="C:/Program Files/CodeLite" LinkerName :=C:/TDM-GCC-64/bin/g++.exe SharedObjectLinkerName :=C:/TDM-GCC-64/bin/g++.exe -shared -fPIC diff --git a/Project/Release/Bus.cpp.o b/Project/Release/Bus.cpp.o Binary files differindex 819b36a..d26c1c8 100644 --- a/Project/Release/Bus.cpp.o +++ b/Project/Release/Bus.cpp.o diff --git a/Project/Release/BusForm.cpp.o b/Project/Release/BusForm.cpp.o Binary files differindex 78956f9..18094c0 100644 --- a/Project/Release/BusForm.cpp.o +++ b/Project/Release/BusForm.cpp.o diff --git a/Project/Release/ElectricCalculation.cpp.o b/Project/Release/ElectricCalculation.cpp.o Binary files differindex 74bf55a..91c3101 100644 --- a/Project/Release/ElectricCalculation.cpp.o +++ b/Project/Release/ElectricCalculation.cpp.o diff --git a/Project/Release/IndMotor.cpp.o b/Project/Release/IndMotor.cpp.o Binary files differindex 912425b..457e288 100644 --- a/Project/Release/IndMotor.cpp.o +++ b/Project/Release/IndMotor.cpp.o diff --git a/Project/Release/Line.cpp.o b/Project/Release/Line.cpp.o Binary files differindex 4c29ca5..fa75f95 100644 --- a/Project/Release/Line.cpp.o +++ b/Project/Release/Line.cpp.o diff --git a/Project/Release/LineForm.cpp.o b/Project/Release/LineForm.cpp.o Binary files differindex 170955e..3de68d5 100644 --- a/Project/Release/LineForm.cpp.o +++ b/Project/Release/LineForm.cpp.o diff --git a/Project/Release/Machines.cpp.o b/Project/Release/Machines.cpp.o Binary files differindex 2e07bd4..cba99a6 100644 --- a/Project/Release/Machines.cpp.o +++ b/Project/Release/Machines.cpp.o diff --git a/Project/Release/MainFrame.cpp.o b/Project/Release/MainFrame.cpp.o Binary files differindex d1ed29c..14a4801 100644 --- a/Project/Release/MainFrame.cpp.o +++ b/Project/Release/MainFrame.cpp.o diff --git a/Project/Release/PSP-UFU.exe b/Project/Release/PSP-UFU.exe Binary files differindex d79044d..dceb0d5 100644 --- a/Project/Release/PSP-UFU.exe +++ b/Project/Release/PSP-UFU.exe diff --git a/Project/Release/PowerFlow.cpp.o b/Project/Release/PowerFlow.cpp.o Binary files differindex b9e6e19..0827969 100644 --- a/Project/Release/PowerFlow.cpp.o +++ b/Project/Release/PowerFlow.cpp.o diff --git a/Project/Release/SyncGenerator.cpp.o b/Project/Release/SyncGenerator.cpp.o Binary files differindex 38e96bb..de9598c 100644 --- a/Project/Release/SyncGenerator.cpp.o +++ b/Project/Release/SyncGenerator.cpp.o diff --git a/Project/Release/SyncMotor.cpp.o b/Project/Release/SyncMotor.cpp.o Binary files differindex fa5f101..9c9dc33 100644 --- a/Project/Release/SyncMotor.cpp.o +++ b/Project/Release/SyncMotor.cpp.o diff --git a/Project/Release/Transformer.cpp.o b/Project/Release/Transformer.cpp.o Binary files differindex ea4649a..8411f2c 100644 --- a/Project/Release/Transformer.cpp.o +++ b/Project/Release/Transformer.cpp.o diff --git a/Project/Release/TransformerForm.cpp.o b/Project/Release/TransformerForm.cpp.o Binary files differindex 8707099..adc3c49 100644 --- a/Project/Release/TransformerForm.cpp.o +++ b/Project/Release/TransformerForm.cpp.o diff --git a/Project/Release/Workspace.cpp.o b/Project/Release/Workspace.cpp.o Binary files differindex 54e888d..94d2379 100644 --- a/Project/Release/Workspace.cpp.o +++ b/Project/Release/Workspace.cpp.o diff --git a/Project/Transformer.cpp b/Project/Transformer.cpp index 8ebf4f3..93013e0 100644 --- a/Project/Transformer.cpp +++ b/Project/Transformer.cpp @@ -357,3 +357,9 @@ bool Transformer::SetNodeParent(Element* parent) } return false; } + +void Transformer::SetPowerFlowDirection(PowerFlowDirection pfDirection) +{ + m_pfDirection = pfDirection; + UpdatePowerFlowArrowsPosition(); +} diff --git a/Project/Transformer.h b/Project/Transformer.h index 7c6f14e..8c958a1 100644 --- a/Project/Transformer.h +++ b/Project/Transformer.h @@ -67,6 +67,7 @@ class Transformer : public Branch virtual bool GetContextMenu(wxMenu& menu); virtual void RotateNode(Element* parent, bool clockwise); virtual bool SetNodeParent(Element* parent); + virtual void SetPowerFlowDirection(PowerFlowDirection pfDirection); virtual bool ShowForm(wxWindow* parent, Element* element); virtual TransformerElectricalData GetElectricalData() { return m_electricalData; } virtual void SetElectricaData(TransformerElectricalData electricalData) { m_electricalData = electricalData; } diff --git a/Project/Workspace.cpp b/Project/Workspace.cpp index 9286add..2976c58 100644 --- a/Project/Workspace.cpp +++ b/Project/Workspace.cpp @@ -1021,6 +1021,8 @@ bool Workspace::RunPowerFlow() wxMessageDialog msgDialog(this, pf.GetErrorMessage(), _("Error"), wxOK | wxCENTRE | wxICON_ERROR); msgDialog.ShowModal(); } + + Redraw(); return result; } |