diff options
author | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2017-01-10 16:12:44 -0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-10 16:12:44 -0200 |
commit | 76696ec9dca9d8b8f7eb01d03fb15b47cc6a8d5b (patch) | |
tree | 5b458c70a0cb301173d1b808374a0f367813dab5 | |
parent | b44aa5ce9401889d948149cc100d1b2ef3611d04 (diff) | |
parent | 568d04c7f692e64bc29b2ca195c2de6af7fdd43a (diff) | |
download | PSP.git-76696ec9dca9d8b8f7eb01d03fb15b47cc6a8d5b.tar.gz PSP.git-76696ec9dca9d8b8f7eb01d03fb15b47cc6a8d5b.tar.xz PSP.git-76696ec9dca9d8b8f7eb01d03fb15b47cc6a8d5b.zip |
Merge pull request #22 from Thales1330/wip/fault
Wip fault
-rw-r--r-- | .gitignore | 7 | ||||
-rw-r--r-- | PSP.workspace | 14 | ||||
-rw-r--r-- | Project/ElectricCalculation.cpp | 213 | ||||
-rw-r--r-- | Project/ElectricCalculation.h | 125 | ||||
-rw-r--r-- | Project/Fault.cpp | 373 | ||||
-rw-r--r-- | Project/Fault.h | 70 | ||||
-rw-r--r-- | Project/MainFrame.cpp | 13 | ||||
-rw-r--r-- | Project/PowerFlow.cpp | 55 | ||||
-rw-r--r-- | Project/PowerFlow.h | 19 | ||||
-rw-r--r-- | Project/Project.mk | 432 | ||||
-rw-r--r-- | Project/Project.project | 224 | ||||
-rw-r--r-- | Project/Project.txt | 1 | ||||
-rw-r--r-- | Project/SyncMotor.h | 3 | ||||
-rw-r--r-- | Project/Workspace.cpp | 16 | ||||
-rw-r--r-- | Project/Workspace.h | 2 |
15 files changed, 826 insertions, 741 deletions
@@ -4,6 +4,7 @@ .codelite/ Project/Release/ Project/Debug/ +doxygen/ # Compiled source # ################### @@ -43,4 +44,8 @@ Thumbs.db # Other files # ############### -*.xrc
\ No newline at end of file +*.xrc +*.workspace +*.project +Project/Project.mk +Project/Project.txt
\ No newline at end of file diff --git a/PSP.workspace b/PSP.workspace deleted file mode 100644 index 8132425..0000000 --- a/PSP.workspace +++ /dev/null @@ -1,14 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<CodeLite_Workspace Name="PSP" Database="" Version="10.0.0"> - <Project Name="Project" Path="Project/Project.project" Active="Yes"/> - <BuildMatrix> - <WorkspaceConfiguration Name="Debug" Selected="no"> - <Environment/> - <Project Name="Project" ConfigName="Debug"/> - </WorkspaceConfiguration> - <WorkspaceConfiguration Name="Release" Selected="yes"> - <Environment/> - <Project Name="Project" ConfigName="Release"/> - </WorkspaceConfiguration> - </BuildMatrix> -</CodeLite_Workspace> diff --git a/Project/ElectricCalculation.cpp b/Project/ElectricCalculation.cpp index c78864c..8f8fa35 100644 --- a/Project/ElectricCalculation.cpp +++ b/Project/ElectricCalculation.cpp @@ -37,7 +37,10 @@ void ElectricCalculation::GetElementsFromList(std::vector<Element*> elementList) } } -bool ElectricCalculation::GetYBus(std::vector<std::vector<std::complex<double> > >& yBus, double systemPowerBase) +bool ElectricCalculation::GetYBus(std::vector<std::vector<std::complex<double> > >& yBus, + double systemPowerBase, + YBusSequence sequence, + bool includeSyncMachines) { if(m_busList.size() == 0) return false; @@ -62,8 +65,8 @@ bool ElectricCalculation::GetYBus(std::vector<std::vector<std::complex<double> > } // Load - for(auto itlo = m_loadList.begin(); itlo != m_loadList.end(); itlo++) { - Load* load = *itlo; + for(auto it = m_loadList.begin(), itEnd = m_loadList.end(); it != itEnd; ++it) { + Load* load = *it; if(load->IsOnline()) { int n = static_cast<Bus*>(load->GetParentList()[0])->GetEletricalData().number; LoadElectricalData data = load->GetPUElectricalData(systemPowerBase); @@ -73,8 +76,8 @@ bool ElectricCalculation::GetYBus(std::vector<std::vector<std::complex<double> > } // Capacitor - for(auto itca = m_capacitorList.begin(); itca != m_capacitorList.end(); itca++) { - Capacitor* capacitor = *itca; + for(auto it = m_capacitorList.begin(), itEnd = m_capacitorList.end(); it != itEnd; ++it) { + Capacitor* capacitor = *it; if(capacitor->IsOnline()) { int n = static_cast<Bus*>(capacitor->GetParentList()[0])->GetEletricalData().number; CapacitorElectricalData data = capacitor->GetPUElectricalData(systemPowerBase); @@ -83,8 +86,8 @@ bool ElectricCalculation::GetYBus(std::vector<std::vector<std::complex<double> > } // Inductor - for(auto itin = m_inductorList.begin(); itin != m_inductorList.end(); itin++) { - Inductor* inductor = *itin; + for(auto it = m_inductorList.begin(), itEnd = m_inductorList.end(); it != itEnd; ++it) { + Inductor* inductor = *it; if(inductor->IsOnline()) { int n = static_cast<Bus*>(inductor->GetParentList()[0])->GetEletricalData().number; InductorElectricalData data = inductor->GetPUElectricalData(systemPowerBase); @@ -93,28 +96,43 @@ bool ElectricCalculation::GetYBus(std::vector<std::vector<std::complex<double> > } // Power line - for(auto itl = m_lineList.begin(); itl != m_lineList.end(); itl++) { - Line* line = *itl; + for(auto it = m_lineList.begin(), itEnd = m_lineList.end(); it != itEnd; ++it) { + Line* line = *it; if(line->IsOnline()) { LineElectricalData data = line->GetElectricalData(); int n1 = static_cast<Bus*>(line->GetParentList()[0])->GetEletricalData().number; int n2 = static_cast<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); + switch(sequence) { + case POSITIVE_SEQ: + case NEGATIVE_SEQ: { + 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] += 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); + yBus[n1][n1] += std::complex<double>(0.0, data.capSusceptance / 2.0); + yBus[n2][n2] += std::complex<double>(0.0, data.capSusceptance / 2.0); + } break; + case ZERO_SEQ: { + yBus[n1][n2] -= 1.0 / std::complex<double>(data.zeroResistance, data.zeroIndReactance); + yBus[n2][n1] -= 1.0 / std::complex<double>(data.zeroResistance, data.zeroIndReactance); + + yBus[n1][n1] += 1.0 / std::complex<double>(data.zeroResistance, data.zeroIndReactance); + yBus[n2][n2] += 1.0 / std::complex<double>(data.zeroResistance, data.zeroIndReactance); + + yBus[n1][n1] += std::complex<double>(0.0, data.zeroCapSusceptance / 2.0); + yBus[n2][n2] += std::complex<double>(0.0, data.zeroCapSusceptance / 2.0); + } + } } } // Transformer - for(auto itt = m_transformerList.begin(); itt != m_transformerList.end(); ++itt) { - Transformer* transformer = *itt; + for(auto it = m_transformerList.begin(), itEnd = m_transformerList.end(); it != itEnd; ++it) { + Transformer* transformer = *it; if(transformer->IsOnline()) { TransformerElectricalData data = transformer->GetElectricalData(); @@ -124,7 +142,7 @@ bool ElectricCalculation::GetYBus(std::vector<std::vector<std::complex<double> > // 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) { + if(data.turnsRatio == 1.0 && data.phaseShift == 0.0 && sequence != ZERO_SEQ) { yBus[n1][n2] += -1.0 / std::complex<double>(data.resistance, data.indReactance); yBus[n2][n1] += -1.0 / std::complex<double>(data.resistance, data.indReactance); @@ -136,7 +154,7 @@ bool ElectricCalculation::GetYBus(std::vector<std::vector<std::complex<double> > //[Ref. 1: Elementos de analise de sistemas de potencia - Stevenson - pg. 232] //[Ref. 2: http://www.ee.washington.edu/research/real/Library/Reports/Tap_Adjustments_in_AC_Load_Flows.pdf] //[Ref. 3: http://www.columbia.edu/~dano/courses/power/notes/power/andersson1.pdf] - else { + else if(sequence != ZERO_SEQ) { // Complex turns ratio double radPhaseShift = wxDegToRad(data.phaseShift); std::complex<double> a = std::complex<double>( @@ -145,10 +163,90 @@ 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[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; + if(sequence == POSITIVE_SEQ) { + 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; + } else if(sequence == NEGATIVE_SEQ) { + yBus[n1][n1] += y / std::pow(std::abs(a), 2.0); + yBus[n1][n2] += -(y / a); + yBus[n2][n1] += -(y / std::conj(a)); + yBus[n2][n2] += y; + } + } else if(sequence == ZERO_SEQ) { + switch(data.connection) { + case GWYE_GWYE: { + std::complex<double> y = + 1.0 / std::complex<double>(data.zeroResistance + + 3.0 * (data.primaryGrndResistance + data.secondaryGrndResistance), + data.zeroIndReactance + + 3.0 * (data.primaryGrndReactance + data.secondaryGrndReactance)); + std::complex<double> a = std::complex<double>(data.turnsRatio, 0.0); + + yBus[n1][n1] += y / (a * a); + yBus[n1][n2] += -(y / a); + yBus[n2][n1] += -(y / a); + yBus[n2][n2] += y; + } break; + case DELTA_GWYE: { + std::complex<double> y = + 1.0 / std::complex<double>(data.zeroResistance + 3.0 * (data.secondaryGrndResistance), + data.zeroIndReactance + 3.0 * (data.secondaryGrndReactance)); + yBus[n2][n2] += y; + break; + } + case GWYE_DELTA: { + std::complex<double> y = + 1.0 / std::complex<double>(data.zeroResistance + 3.0 * (data.primaryGrndResistance), + data.zeroIndReactance + 3.0 * (data.primaryGrndReactance)); + yBus[n1][n1] += y; + break; + } + default: + break; + } + } + } + } + + if(includeSyncMachines) { + // Synchronous generator + for(auto it = m_syncGeneratorList.begin(), itEnd = m_syncGeneratorList.end(); it != itEnd; ++it) { + SyncGenerator* syncGenerator = *it; + if(syncGenerator->IsOnline()) { + int n = static_cast<Bus*>(syncGenerator->GetParentList()[0])->GetEletricalData().number; + SyncGeneratorElectricalData data = syncGenerator->GetPUElectricalData(systemPowerBase); + switch(sequence) { + case POSITIVE_SEQ: { + yBus[n][n] += 1.0 / std::complex<double>(data.positiveResistance, data.positiveReactance); + } break; + case NEGATIVE_SEQ: { + yBus[n][n] += 1.0 / std::complex<double>(data.negativeResistance, data.negativeReactance); + } break; + case ZERO_SEQ: { + yBus[n][n] += 1.0 / std::complex<double>(data.zeroResistance, data.zeroReactance); + } break; + } + } + } + // Synchronous motor + for(auto it = m_syncMotorList.begin(), itEnd = m_syncMotorList.end(); it != itEnd; ++it) { + SyncMotor* syncMotor = *it; + if(syncMotor->IsOnline()) { + int n = static_cast<Bus*>(syncMotor->GetParentList()[0])->GetEletricalData().number; + SyncMotorElectricalData data = syncMotor->GetPUElectricalData(systemPowerBase); + switch(sequence) { + case POSITIVE_SEQ: { + yBus[n][n] += 1.0 / std::complex<double>(data.positiveResistance, data.positiveReactance); + } break; + case NEGATIVE_SEQ: { + yBus[n][n] += 1.0 / std::complex<double>(data.negativeResistance, data.negativeReactance); + } break; + case ZERO_SEQ: { + yBus[n][n] += 1.0 / std::complex<double>(data.zeroResistance, data.zeroReactance); + } break; + } } } } @@ -429,3 +527,72 @@ void ElectricCalculation::UpdateElementsPowerFlow(std::vector<std::complex<doubl } } } + +bool ElectricCalculation::InvertMatrix(std::vector<std::vector<std::complex<double> > > matrix, + std::vector<std::vector<std::complex<double> > >& inverse) +{ + int order = static_cast<int>(matrix.size()); + + inverse.clear(); + // Fill the inverse matrix with identity. + for(int i = 0; i < order; ++i) { + std::vector<std::complex<double> > line; + for(int j = 0; j < order; ++j) { + line.push_back(i == j ? std::complex<double>(1.0, 0.0) : std::complex<double>(0.0, 0.0)); + } + inverse.push_back(line); + } + + // Check if a main diagonal value of the matrix is zero, if one is zero, try a linear combination to remove it. + for(int i = 0; i < order; ++i) { + for(int j = 0; j < order; ++j) { + if(i == j && matrix[i][j] == std::complex<double>(0.0, 0.0)) { + int row = 0; + while(row < order) { + if(matrix[row][j] != std::complex<double>(0.0, 0.0)) { + for(int k = 0; k < order; ++k) { + matrix[i][k] += matrix[row][k]; + inverse[i][k] += inverse[row][k]; + } + break; + } + row++; + } + // If all line values are zero, the matrix is singular and the solution is impossible. + if(row == order) return false; + } + } + } + + // Linear combinations are made in both matrices, the goal is the input matrix become the identity. The final result + // have two matrices: the identity and the inverse of the input. + for(int i = 0; i < order; ++i) { + for(int j = 0; j < order; ++j) { + if(i != j) { + if(matrix[i][i] == std::complex<double>(0.0, 0.0)) return false; + + std::complex<double> factor = matrix[j][i] / matrix[i][i]; + for(int k = 0; k < order; ++k) { + matrix[j][k] -= factor * matrix[i][k]; + inverse[j][k] -= factor * inverse[i][k]; + } + } + } + } + // Main diagonal calculation. + for(int i = 0; i < order; ++i) { + for(int j = 0; j < order; ++j) { + if(i == j) { + if(matrix[i][j] == std::complex<double>(0.0, 0.0)) return false; + + std::complex<double> factor = (matrix[i][j] - std::complex<double>(1.0, 0.0)) / matrix[i][j]; + for(int k = 0; k < order; ++k) { + matrix[j][k] -= factor * matrix[i][k]; + inverse[j][k] -= factor * inverse[i][k]; + } + } + } + } + + return true; +} diff --git a/Project/ElectricCalculation.h b/Project/ElectricCalculation.h index e4e4ef7..3eea5dd 100644 --- a/Project/ElectricCalculation.h +++ b/Project/ElectricCalculation.h @@ -18,14 +18,16 @@ enum BusType { BUS_SLACK = 0, BUS_PV, BUS_PQ }; enum ReactiveLimitsType { - RL_UNLIMITED = 0, // The bus can generate any ammount of reactive power. - RL_LIMITED, // The bus reactive power generation is limited. - RL_UNLIMITED_SOURCE, // The bus have at least one source of infinite reative power. - RL_MAX_REACHED, // Max limit reached - RL_MIN_REACHED, // Min limit reached - RL_NONE_REACHED // No limits reached + RL_UNLIMITED = 0, // The bus can generate any ammount of reactive power. + RL_LIMITED, // The bus reactive power generation is limited. + RL_UNLIMITED_SOURCE, // The bus have at least one source of infinite reative power. + RL_MAX_REACHED, // Max limit reached + RL_MIN_REACHED, // Min limit reached + RL_NONE_REACHED // No limits reached }; +enum YBusSequence { POSITIVE_SEQ = 0, NEGATIVE_SEQ, ZERO_SEQ }; + struct ReactiveLimits { double maxLimit = 0.0; double minLimit = 0.0; @@ -34,30 +36,123 @@ struct ReactiveLimits { ReactiveLimitsType limitReached = RL_NONE_REACHED; }; +/** + * @class ElectricCalculation + * @author Thales Lima Oliveira + * @date 09/01/2017 + * @file ElectricCalculation.h + * @brief Base class of electric calculations, with general methods. + */ class ElectricCalculation { - public: +public: + /** + * @brief Constructor. + */ ElectricCalculation(); + + /** + * @brief Destructor. + */ ~ElectricCalculation(); + + /** + * @brief Separate the elements from a generic list. + * @param elementList List of generic elements. + */ virtual void GetElementsFromList(std::vector<Element*> elementList); - virtual bool GetYBus(std::vector<std::vector<std::complex<double> > >& yBus, double systemPowerBase); + + /** + * @brief Get the admittance matrix from the list of elements (use GetElementsFromList first). + * @param yBus Admittance matrix. The previous content will be erased. + * @param systemPowerBase Base power of the system. + * @param sequence Sequence of admittance matrix (positive, negative and zero). + * @param includeSyncMachines Include the synchronous machines on calculation. + * @return Return true if was possible to build the admittance matrix. + */ + virtual bool GetYBus(std::vector<std::vector<std::complex<double> > >& yBus, + double systemPowerBase, + YBusSequence sequence = POSITIVE_SEQ, + bool includeSyncMachines = false); + + /** + * @brief Invert a matrix. + * @param matrix Matrix to invert. + * @param inverse Inverted matrix. The previous content will be erased. + * @return Return true if was possible to invert the matrix. + */ + virtual bool InvertMatrix(std::vector<std::vector<std::complex<double> > > matrix, + std::vector<std::vector<std::complex<double> > >& inverse); + + /** + * @brief Update the elements after the power flow calculation. + * @param voltage Array with the buses voltages. + * @param power Array with the buses injected power. + * @param busType Array with the buses type. + * @param reactiveLimit Array with the reactive limit data. + * @param systemPowerBase Base power of the system. + */ virtual void UpdateElementsPowerFlow(std::vector<std::complex<double> > voltage, - std::vector<std::complex<double> > power, - std::vector<BusType> busType, - std::vector<ReactiveLimits> reactiveLimit, - double systemPowerBase); + std::vector<std::complex<double> > power, + std::vector<BusType> busType, + std::vector<ReactiveLimits> reactiveLimit, + double systemPowerBase); + /** + * @brief Get the buses of the system (use GetElementsFromList first). + * @return A list of bus elements. + */ const std::vector<Bus*> GetBusList() const { return m_busList; } + + /** + * @brief Get the capacitors of the system (use GetElementsFromList first). + * @return A list of capacitor elements. + */ const std::vector<Capacitor*> GetCapacitorList() const { return m_capacitorList; } + + /** + * @brief Get the induction motors of the system (use GetElementsFromList first). + * @return A list of induction motor elements. + */ const std::vector<IndMotor*> GetIndMotorList() const { return m_indMotorList; } + + /** + * @brief Get the inductors of the system (use GetElementsFromList first). + * @return A list of inductor elements. + */ const std::vector<Inductor*> GetInductorList() const { return m_inductorList; } + + /** + * @brief Get the lines of the system (use GetElementsFromList first). + * @return A list of line elements. + */ const std::vector<Line*> GetLineList() const { return m_lineList; } + + /** + * @brief Get the loads of the system (use GetElementsFromList first). + * @return A list of load elements. + */ const std::vector<Load*> GetLoadList() const { return m_loadList; } + + /** + * @brief Get the synchronous generators of the system (use GetElementsFromList first). + * @return A list of synchronous generator elements. + */ const std::vector<SyncGenerator*> GetSyncGeneratorList() const { return m_syncGeneratorList; } + + /** + * @brief Get the synchronous motors of the system (use GetElementsFromList first). + * @return A list of synchronous motor elements. + */ const std::vector<SyncMotor*> GetSyncMotorList() const { return m_syncMotorList; } - const std::vector<Transformer*> GetTransformerList() const { return m_transformerList; } - protected: + /** + * @brief Get the transformers of the system (use GetElementsFromList first). + * @return A list of transformer elements. + */ + const std::vector<Transformer*> GetTransformerList() const { return m_transformerList; } + +protected: std::vector<Bus*> m_busList; std::vector<Capacitor*> m_capacitorList; std::vector<IndMotor*> m_indMotorList; @@ -69,4 +164,4 @@ class ElectricCalculation std::vector<Transformer*> m_transformerList; }; -#endif // ELECTRICCALCULATION_H +#endif // ELECTRICCALCULATION_H diff --git a/Project/Fault.cpp b/Project/Fault.cpp new file mode 100644 index 0000000..77ff6de --- /dev/null +++ b/Project/Fault.cpp @@ -0,0 +1,373 @@ +#include "Fault.h" + +Fault::Fault() + : ElectricCalculation() +{ +} + +Fault::Fault(std::vector<Element*> elementList) { GetElementsFromList(elementList); } + +Fault::~Fault() {} + +bool Fault::RunFaultCalculation(double systemPowerBase) +{ + int numberOfBuses = static_cast<int>(m_busList.size()); + if(numberOfBuses == 0) { + m_errorMsg = _("There is no buses in the system."); + return false; + } + + // Get adimittance matrices. + std::vector<std::vector<std::complex<double> > > yBusPos; + GetYBus(yBusPos, systemPowerBase, POSITIVE_SEQ, true); + std::vector<std::vector<std::complex<double> > > yBusNeg; + GetYBus(yBusNeg, systemPowerBase, NEGATIVE_SEQ, true); + std::vector<std::vector<std::complex<double> > > yBusZero; + GetYBus(yBusZero, systemPowerBase, ZERO_SEQ, true); + + // Calculate the impedance matrices. + if(!InvertMatrix(yBusPos, m_zBusPos)) { + m_errorMsg = _("Fail to invert the positive sequence admittance matrix."); + return false; + } + if(!InvertMatrix(yBusNeg, m_zBusNeg)) { + m_errorMsg = _("Fail to invert the negative sequence admittance matrix."); + return false; + } + if(!InvertMatrix(yBusZero, m_zBusZero)) { + m_errorMsg = _("Fail to invert the zero sequence admittance matrix."); + return false; + } + + // Pre-fault voltages (power flow solution). + std::vector<std::complex<double> > preFaultVoltages; + + // Get fault parameters. + int fNumber = -1; + FaultData fType = FAULT_THREEPHASE; + FaultData fLocation = FAULT_LINE_A; + std::complex<double> fImpedance = std::complex<double>(0.0, 0.0); + for(auto it = m_busList.begin(), itEnd = m_busList.end(); it != itEnd; ++it) { + Bus* bus = *it; + BusElectricalData data = bus->GetEletricalData(); + preFaultVoltages.push_back(data.voltage); + if(data.hasFault) { + fNumber = data.number; + fType = data.faultType; + fLocation = data.faultLocation; + fImpedance = std::complex<double>(data.faultResistance, data.faultReactance); + } + } + + if(fNumber == -1) { + m_errorMsg = _("There is no fault in the system."); + return false; + } + + // Fault calculation. + std::complex<double> fCurrentPos = std::complex<double>(0.0, 0.0); + std::complex<double> fCurrentNeg = std::complex<double>(0.0, 0.0); + std::complex<double> fCurrentZero = std::complex<double>(0.0, 0.0); + + std::complex<double> preFaultVoltage = preFaultVoltages[fNumber]; + std::complex<double> a = std::complex<double>(-0.5, 0.866025403784); + std::complex<double> a2 = std::complex<double>(-0.5, -0.866025403784); + + switch(fType) { + case FAULT_THREEPHASE: { + fCurrentPos = preFaultVoltage / (m_zBusPos[fNumber][fNumber] + fImpedance); + } break; + case FAULT_2LINE: { + fCurrentPos = preFaultVoltage / (m_zBusPos[fNumber][fNumber] + m_zBusNeg[fNumber][fNumber] + fImpedance); + + switch(fLocation) { + case FAULT_LINE_A: { + fCurrentNeg = -a2 * fCurrentPos; + } break; + case FAULT_LINE_B: { + fCurrentNeg = -fCurrentPos; + } break; + case FAULT_LINE_C: { + fCurrentNeg = -a * fCurrentPos; + } break; + default: + break; + } + } break; + case FAULT_2LINE_GROUND: { + std::complex<double> z1 = m_zBusPos[fNumber][fNumber]; + std::complex<double> z2 = m_zBusNeg[fNumber][fNumber]; + std::complex<double> z0 = m_zBusZero[fNumber][fNumber]; + std::complex<double> zf_3 = std::complex<double>(3.0, 0.0) * fImpedance; + + fCurrentPos = (preFaultVoltage * (z2 + z0 + zf_3)) / (z1 * z2 + z2 * z0 + z2 * zf_3 + z1 * z0 + z1 * zf_3); + + switch(fLocation) { + case FAULT_LINE_A: { + fCurrentNeg = -a2 * ((preFaultVoltage - z1 * fCurrentPos) / z2); + fCurrentZero = -a * ((preFaultVoltage - z1 * fCurrentPos) / (z0 + zf_3)); + } break; + case FAULT_LINE_B: { + fCurrentNeg = -((preFaultVoltage - z1 * fCurrentPos) / z2); + fCurrentZero = -((preFaultVoltage - z1 * fCurrentPos) / (z0 + zf_3)); + } break; + case FAULT_LINE_C: { + fCurrentNeg = -a * ((preFaultVoltage - z1 * fCurrentPos) / z2); + fCurrentZero = -a2 * ((preFaultVoltage - z1 * fCurrentPos) / (z0 + zf_3)); + } break; + default: + break; + } + } break; + case FAULT_LINE_GROUND: { + fCurrentPos = + preFaultVoltage / (m_zBusPos[fNumber][fNumber] + m_zBusNeg[fNumber][fNumber] + + m_zBusZero[fNumber][fNumber] + std::complex<double>(3.0, 0.0) * fImpedance); + switch(fLocation) { + case FAULT_LINE_A: { + fCurrentNeg = fCurrentPos; + fCurrentZero = fCurrentPos; + } break; + case FAULT_LINE_B: { + fCurrentNeg = a * fCurrentPos; + fCurrentZero = a2 * fCurrentPos; + } break; + case FAULT_LINE_C: { + fCurrentNeg = a2 * fCurrentPos; + fCurrentZero = a * fCurrentPos; + } break; + default: + break; + } + } break; + default: + break; + } + + // Convert sequence currents to ABC. [Iabc] = [A]*[I012] + m_fCurrentA = fCurrentPos + fCurrentNeg + fCurrentZero; + m_fCurrentB = fCurrentPos + a2 * fCurrentNeg + a * fCurrentZero; + m_fCurrentC = fCurrentPos + a * fCurrentNeg + a2 * fCurrentZero; + + // Pos-fault voltages calculation + m_posFaultVoltagePos.clear(); + m_posFaultVoltageNeg.clear(); + m_posFaultVoltageZero.clear(); + m_posFaultVoltageA.clear(); + m_posFaultVoltageB.clear(); + m_posFaultVoltageC.clear(); + + for(int i = 0; i < numberOfBuses; ++i) { + m_posFaultVoltagePos.push_back(preFaultVoltages[i] - m_zBusPos[i][fNumber] * fCurrentPos); + m_posFaultVoltageNeg.push_back(-m_zBusNeg[i][fNumber] * fCurrentNeg); + m_posFaultVoltageZero.push_back(-m_zBusZero[i][fNumber] * fCurrentZero); + + // V012 -> Vabc + m_posFaultVoltageA.push_back(m_posFaultVoltagePos[i] + m_posFaultVoltageNeg[i] + m_posFaultVoltageZero[i]); + m_posFaultVoltageB.push_back( + m_posFaultVoltagePos[i] + a2 * m_posFaultVoltageNeg[i] + a * m_posFaultVoltageZero[i]); + m_posFaultVoltageC.push_back( + m_posFaultVoltagePos[i] + a * m_posFaultVoltageNeg[i] + a2 * m_posFaultVoltageZero[i]); + } + + UpdateElementsFault(systemPowerBase); + return true; +} + +void Fault::UpdateElementsFault(double systemPowerBase) +{ + std::complex<double> a = std::complex<double>(-0.5, 0.866025403784); + std::complex<double> a2 = std::complex<double>(-0.5, -0.866025403784); + + for(auto it = m_busList.begin(), itEnd = m_busList.end(); it != itEnd; ++it) { + Bus* bus = *it; + auto data = bus->GetEletricalData(); + if(data.hasFault) { + data.faultCurrent[0] = m_fCurrentA; + data.faultCurrent[1] = m_fCurrentB; + data.faultCurrent[2] = m_fCurrentC; + } else { + data.faultCurrent[0] = data.faultCurrent[1] = data.faultCurrent[2] = std::complex<double>(0.0, 0.0); + } + data.faultVoltage[0] = m_posFaultVoltageA[data.number]; + data.faultVoltage[1] = m_posFaultVoltageB[data.number]; + data.faultVoltage[2] = m_posFaultVoltageC[data.number]; + bus->SetElectricalData(data); + } + + for(auto it = m_lineList.begin(), itEnd = m_lineList.end(); it != itEnd; ++it) { + Line* line = *it; + if(line->IsOnline()) { + int n1 = static_cast<Bus*>(line->GetParentList()[0])->GetEletricalData().number; + int n2 = static_cast<Bus*>(line->GetParentList()[1])->GetEletricalData().number; + auto data = line->GetElectricalData(); + std::complex<double> vPos[2] = { m_posFaultVoltagePos[n1], m_posFaultVoltagePos[n2] }; + std::complex<double> vNeg[2] = { m_posFaultVoltageNeg[n1], m_posFaultVoltageNeg[n2] }; + std::complex<double> vZero[2] = { m_posFaultVoltageZero[n1], m_posFaultVoltageZero[n2] }; + std::complex<double> zPos(data.resistance, data.indReactance); + std::complex<double> bPos(0.0, data.capSusceptance / 2.0); + std::complex<double> zZero(data.zeroResistance, data.zeroIndReactance); + std::complex<double> bZero(0.0, data.zeroCapSusceptance / 2.0); + + std::complex<double> lineCurrentPos[2]; + std::complex<double> lineCurrentNeg[2]; + std::complex<double> lineCurrentZero[2]; + + lineCurrentPos[0] = ((vPos[0] - vPos[1]) / zPos) + (vPos[0] * bPos); + lineCurrentNeg[0] = ((vNeg[0] - vNeg[1]) / zPos) + (vNeg[0] * bPos); + lineCurrentZero[0] = ((vZero[0] - vZero[1]) / zZero) + (vZero[0] * bZero); + lineCurrentPos[1] = ((vPos[1] - vPos[0]) / zPos) + (vPos[1] * bPos); + lineCurrentNeg[1] = ((vNeg[1] - vNeg[0]) / zPos) + (vNeg[1] * bPos); + lineCurrentZero[1] = ((vZero[1] - vZero[0]) / zZero) + (vZero[1] * bZero); + + data.faultCurrent[0][0] = lineCurrentPos[0] + lineCurrentNeg[0] + lineCurrentZero[0]; + data.faultCurrent[1][0] = lineCurrentPos[0] + a2 * lineCurrentNeg[0] + a * lineCurrentZero[0]; + data.faultCurrent[2][0] = lineCurrentPos[0] + a * lineCurrentNeg[0] + a2 * lineCurrentZero[0]; + data.faultCurrent[0][1] = lineCurrentPos[1] + lineCurrentNeg[1] + lineCurrentZero[1]; + data.faultCurrent[1][1] = lineCurrentPos[1] + a2 * lineCurrentNeg[1] + a * lineCurrentZero[1]; + data.faultCurrent[2][1] = lineCurrentPos[1] + a * lineCurrentNeg[1] + a2 * lineCurrentZero[1]; + + line->SetElectricalData(data); + } + } + + for(auto it = m_transformerList.begin(), itEnd = m_transformerList.end(); it != itEnd; ++it) { + Transformer* transformer = *it; + if(transformer->IsOnline()) { + int n1 = static_cast<Bus*>(transformer->GetParentList()[0])->GetEletricalData().number; + int n2 = static_cast<Bus*>(transformer->GetParentList()[1])->GetEletricalData().number; + auto data = transformer->GetElectricalData(); + + std::complex<double> vPos[2] = { m_posFaultVoltagePos[n1], m_posFaultVoltagePos[n2] }; + std::complex<double> vNeg[2] = { m_posFaultVoltageNeg[n1], m_posFaultVoltageNeg[n2] }; + std::complex<double> vZero[2] = { m_posFaultVoltageZero[n1], m_posFaultVoltageZero[n2] }; + std::complex<double> zPos(data.resistance, data.indReactance); + std::complex<double> zZero(data.zeroResistance, data.zeroIndReactance); + + std::complex<double> transformerCurrentPos[2]; + std::complex<double> transformerCurrentNeg[2]; + std::complex<double> transformerCurrentZero[2]; + + if(data.turnsRatio == 1.0 && data.phaseShift == 0.0) { + transformerCurrentPos[0] = (vPos[0] - vPos[1]) / zPos; + transformerCurrentNeg[0] = (vNeg[0] - vNeg[1]) / zPos; + transformerCurrentZero[0] = (vZero[0] - vZero[1]) / zZero; + transformerCurrentPos[1] = (vPos[1] - vPos[0]) / zPos; + transformerCurrentNeg[1] = (vNeg[1] - vNeg[0]) / zPos; + transformerCurrentZero[1] = (vZero[1] - vZero[0]) / zZero; + } else { + double radPhaseShift = wxDegToRad(data.phaseShift); + std::complex<double> t = std::complex<double>( + data.turnsRatio * std::cos(radPhaseShift), -data.turnsRatio * std::sin(radPhaseShift)); + + transformerCurrentPos[0] = + vPos[0] * (1.0 / (std::pow(std::abs(t), 2.0) * zPos)) - vPos[1] * (1.0 / (std::conj(t) * zPos)); + transformerCurrentNeg[0] = + vNeg[0] * (1.0 / (std::pow(std::abs(t), 2.0) * zPos)) - vNeg[1] * (1.0 / (t * zPos)); + + transformerCurrentPos[1] = -vPos[0] * (1.0 / (t * zPos)) + vPos[1] / zPos; + transformerCurrentNeg[1] = -vNeg[0] * (1.0 / (std::conj(t) * zPos)) + vNeg[1] / zPos; + } + + switch(data.connection) { + case GWYE_GWYE: { + transformerCurrentZero[0] = (vZero[0] - vZero[1]) / zZero; + transformerCurrentZero[1] = (vZero[1] - vZero[0]) / zZero; + break; + } + case GWYE_DELTA: { + transformerCurrentZero[0] = vZero[0] / zZero; + transformerCurrentZero[1] = std::complex<double>(0.0, 0.0); + break; + } + case DELTA_GWYE: { + transformerCurrentZero[0] = std::complex<double>(0.0, 0.0); + transformerCurrentZero[1] = vZero[1] / zZero; + break; + } + default: { + transformerCurrentZero[0] = std::complex<double>(0.0, 0.0); + transformerCurrentZero[1] = std::complex<double>(0.0, 0.0); + break; + } + } + + data.faultCurrent[0][0] = transformerCurrentPos[0] + transformerCurrentNeg[0] + transformerCurrentZero[0]; + data.faultCurrent[1][0] = + transformerCurrentPos[0] + a2 * transformerCurrentNeg[0] + a * transformerCurrentZero[0]; + data.faultCurrent[2][0] = + transformerCurrentPos[0] + a * transformerCurrentNeg[0] + a2 * transformerCurrentZero[0]; + data.faultCurrent[0][1] = transformerCurrentPos[1] + transformerCurrentNeg[1] + transformerCurrentZero[1]; + data.faultCurrent[1][1] = + transformerCurrentPos[1] + a2 * transformerCurrentNeg[1] + a * transformerCurrentZero[1]; + data.faultCurrent[2][1] = + transformerCurrentPos[1] + a * transformerCurrentNeg[1] + a2 * transformerCurrentZero[1]; + + transformer->SetElectricaData(data); + } + } + + for(auto it = m_syncGeneratorList.begin(), itEnd = m_syncGeneratorList.end(); it != itEnd; ++it) { + SyncGenerator* syncGenerator = *it; + if(syncGenerator->IsOnline()) { + Bus* bus = static_cast<Bus*>(syncGenerator->GetParentList()[0]); + int n = bus->GetEletricalData().number; + std::complex<double> v = bus->GetEletricalData().voltage; // Pre-fault voltage. + auto data = syncGenerator->GetElectricalData(); + + std::complex<double> vPos = m_posFaultVoltagePos[n]; + std::complex<double> vNeg = m_posFaultVoltageNeg[n]; + std::complex<double> vZero = m_posFaultVoltageZero[n]; + + std::complex<double> zPos(data.positiveResistance, data.positiveReactance); + std::complex<double> zNeg(data.negativeResistance, data.negativeReactance); + std::complex<double> zZero( + data.zeroResistance + 3.0 * data.groundResistance, data.negativeReactance + 3.0 * data.groundReactance); + + std::complex<double> syncGeneratorCurrentPos = (v - vPos) / zPos; + std::complex<double> syncGeneratorCurrentNeg = (-vNeg) / zNeg; + std::complex<double> syncGeneratorCurrentZero(0.0, 0.0); + if(data.groundNeutral) syncGeneratorCurrentZero = (-vZero) / zZero; + + data.faultCurrent[0] = syncGeneratorCurrentPos + syncGeneratorCurrentNeg + syncGeneratorCurrentZero; + data.faultCurrent[1] = + syncGeneratorCurrentPos + a2 * syncGeneratorCurrentNeg + a * syncGeneratorCurrentZero; + data.faultCurrent[2] = + syncGeneratorCurrentPos + a * syncGeneratorCurrentNeg + a2 * syncGeneratorCurrentZero; + + syncGenerator->SetElectricalData(data); + } + } + + for(auto it = m_syncMotorList.begin(), itEnd = m_syncMotorList.end(); it != itEnd; ++it) { + SyncMotor* syncMotor = *it; + if(syncMotor->IsOnline()) { + Bus* bus = static_cast<Bus*>(syncMotor->GetParentList()[0]); + int n = bus->GetEletricalData().number; + std::complex<double> v = bus->GetEletricalData().voltage; // Pre-fault voltage. + auto data = syncMotor->GetElectricalData(); + + std::complex<double> vPos = m_posFaultVoltagePos[n]; + std::complex<double> vNeg = m_posFaultVoltageNeg[n]; + std::complex<double> vZero = m_posFaultVoltageZero[n]; + + std::complex<double> zPos(data.positiveResistance, data.positiveReactance); + std::complex<double> zNeg(data.negativeResistance, data.negativeReactance); + std::complex<double> zZero( + data.zeroResistance + 3.0 * data.groundResistance, data.negativeReactance + 3.0 * data.groundReactance); + + std::complex<double> syncGeneratorCurrentPos = (v - vPos) / zPos; + std::complex<double> syncGeneratorCurrentNeg = (-vNeg) / zNeg; + std::complex<double> syncGeneratorCurrentZero(0.0, 0.0); + if(data.groundNeutral) syncGeneratorCurrentZero = (-vZero) / zZero; + + data.faultCurrent[0] = syncGeneratorCurrentPos + syncGeneratorCurrentNeg + syncGeneratorCurrentZero; + data.faultCurrent[1] = + syncGeneratorCurrentPos + a2 * syncGeneratorCurrentNeg + a * syncGeneratorCurrentZero; + data.faultCurrent[2] = + syncGeneratorCurrentPos + a * syncGeneratorCurrentNeg + a2 * syncGeneratorCurrentZero; + + syncMotor->SetElectricalData(data); + } + } +} diff --git a/Project/Fault.h b/Project/Fault.h new file mode 100644 index 0000000..c3caef7 --- /dev/null +++ b/Project/Fault.h @@ -0,0 +1,70 @@ +#ifndef FAULT_H +#define FAULT_H + +#include "ElectricCalculation.h" +/** + * @class Fault + * @author Thales Lima Oliveira + * @date 10/01/2017 + * @file Fault.h + * @brief Calculate the fault of the system and update the elements data. + */ + +class Fault : public ElectricCalculation +{ +public: + /** + * @brief Contructor. + * @param elementList List of elements in workspace + */ + Fault(std::vector<Element*> elementList); + + /** + * @brief Default contructor. Use GetElementsFromList(std::vector<Element*> elementList). + */ + Fault(); + + /** + * @brief Destructor. + */ + ~Fault(); + + /** + * @brief Calculate the fault of the system. Return true if was possible the calculation. + * @param systemPowerBase System base of power. + */ + virtual bool RunFaultCalculation(double systemPowerBase); + + /** + * @brief Update the data of the elements. + * @param systemPowerBase System base of power. + */ + virtual void UpdateElementsFault(double systemPowerBase); + + /** + * @brief Get the error message generated in RunFaultCalculation(double systemPowerBase). + * @return Error message. + */ + virtual wxString GetErrorMessage() { return m_errorMsg; } + +protected: + wxString m_errorMsg = ""; + + std::vector<std::vector<std::complex<double> > > m_zBusPos; + std::vector<std::vector<std::complex<double> > > m_zBusNeg; + std::vector<std::vector<std::complex<double> > > m_zBusZero; + + std::vector<std::complex<double> > m_posFaultVoltagePos; + std::vector<std::complex<double> > m_posFaultVoltageNeg; + std::vector<std::complex<double> > m_posFaultVoltageZero; + + std::complex<double> m_fCurrentA; + std::complex<double> m_fCurrentB; + std::complex<double> m_fCurrentC; + + std::vector<std::complex<double> > m_posFaultVoltageA; + std::vector<std::complex<double> > m_posFaultVoltageB; + std::vector<std::complex<double> > m_posFaultVoltageC; +}; + +#endif // FAULT_H diff --git a/Project/MainFrame.cpp b/Project/MainFrame.cpp index ef9f327..254c081 100644 --- a/Project/MainFrame.cpp +++ b/Project/MainFrame.cpp @@ -151,6 +151,7 @@ void MainFrame::OnDisableSolutionClick(wxRibbonButtonBarEvent& event) } void MainFrame::OnDragClick(wxRibbonButtonBarEvent& event) {} + void MainFrame::OnEnableSolutionClick(wxRibbonButtonBarEvent& event) { m_ribbonButtonBarContinuous->ToggleButton(ID_RIBBON_ENABLESOL, true); @@ -158,7 +159,14 @@ void MainFrame::OnEnableSolutionClick(wxRibbonButtonBarEvent& event) } void MainFrame::OnExpImpClick(wxRibbonButtonBarEvent& event) {} -void MainFrame::OnFaultClick(wxRibbonButtonBarEvent& event) {} + +void MainFrame::OnFaultClick(wxRibbonButtonBarEvent& event) +{ + if(Workspace* workspace = dynamic_cast<Workspace*>(m_auiNotebook->GetCurrentPage())) { + workspace->RunFault(); + } +} + void MainFrame::OnFitClick(wxRibbonButtonBarEvent& event) { Workspace* workspace = static_cast<Workspace*>(m_auiNotebook->GetCurrentPage()); @@ -166,6 +174,7 @@ void MainFrame::OnFitClick(wxRibbonButtonBarEvent& event) workspace->Fit(); } } + void MainFrame::OnMoveClick(wxRibbonButtonBarEvent& event) { Workspace* workspace = static_cast<Workspace*>(m_auiNotebook->GetCurrentPage()); @@ -192,6 +201,7 @@ void MainFrame::OnMoveClick(wxRibbonButtonBarEvent& event) workspace->SetWorkspaceMode(MODE_MOVE_ELEMENT); } } + void MainFrame::OnOpenClick(wxRibbonButtonBarEvent& event) { wxFileDialog openFileDialog( @@ -234,6 +244,7 @@ void MainFrame::OnPowerFlowClick(wxRibbonButtonBarEvent& event) workspace->RunPowerFlow(); } } + void MainFrame::OnProjectSettingsClick(wxRibbonButtonBarEvent& event) {} void MainFrame::OnRedoClick(wxRibbonButtonBarEvent& event) {} void MainFrame::OnResetVoltagesClick(wxRibbonButtonBarEvent& event) {} diff --git a/Project/PowerFlow.cpp b/Project/PowerFlow.cpp index c94d8d8..bfee2af 100644 --- a/Project/PowerFlow.cpp +++ b/Project/PowerFlow.cpp @@ -1,12 +1,23 @@ #include "PowerFlow.h" -PowerFlow::PowerFlow(std::vector<Element*> elementList) : ElectricCalculation() { GetElementsFromList(elementList); } +PowerFlow::PowerFlow() + : ElectricCalculation() +{ +} + +PowerFlow::PowerFlow(std::vector<Element*> elementList) + : ElectricCalculation() +{ + GetElementsFromList(elementList); +} + PowerFlow::~PowerFlow() {} + bool PowerFlow::RunGaussSeidel(double systemPowerBase, - int maxIteration, - double error, - double initAngle, - double accFactor) + int maxIteration, + double error, + double initAngle, + double accFactor) { // Calculate the Ybus. if(!GetYBus(m_yBus, systemPowerBase)) { @@ -15,13 +26,13 @@ bool PowerFlow::RunGaussSeidel(double systemPowerBase, } // Number of buses on the system. - int numberOfBuses = (int)m_busList.size(); + int numberOfBuses = static_cast<int>(m_busList.size()); - std::vector<BusType> busType; // Bus type - std::vector<std::complex<double> > voltage; // Voltage of buses - std::vector<std::complex<double> > power; // Injected power - std::vector<std::complex<double> > loadPower; // Only the load power - std::vector<ReactiveLimits> reactiveLimit; // Limit of reactive power on PV buses + std::vector<BusType> busType; // Bus type + std::vector<std::complex<double> > voltage; // Voltage of buses + std::vector<std::complex<double> > power; // Injected power + std::vector<std::complex<double> > loadPower; // Only the load power + std::vector<ReactiveLimits> reactiveLimit; // Limit of reactive power on PV buses reactiveLimit.resize(numberOfBuses); @@ -61,7 +72,7 @@ bool PowerFlow::RunGaussSeidel(double systemPowerBase, } // Fill the power array - power.push_back(std::complex<double>(0.0, 0.0)); // Initial value + power.push_back(std::complex<double>(0.0, 0.0)); // Initial value loadPower.push_back(std::complex<double>(0.0, 0.0)); // Synchronous generator @@ -168,12 +179,12 @@ bool PowerFlow::RunGaussSeidel(double systemPowerBase, } // Gauss-Seidel method - std::vector<std::complex<double> > oldVoltage; // Old voltage array. + std::vector<std::complex<double> > oldVoltage; // Old voltage array. oldVoltage.resize(voltage.size()); auto oldBusType = busType; - int iteration = 0; // Current itaration number. + int iteration = 0; // Current itaration number. while(true) { // Reach the max number of iterations. @@ -203,7 +214,7 @@ bool PowerFlow::RunGaussSeidel(double systemPowerBase, // Apply the acceleration factor. newVolt = std::complex<double>(accFactor * (newVolt.real() - voltage[i].real()) + voltage[i].real(), - accFactor * (newVolt.imag() - voltage[i].imag()) + voltage[i].imag()); + accFactor * (newVolt.imag() - voltage[i].imag()) + voltage[i].imag()); voltage[i] = newVolt; } @@ -227,15 +238,15 @@ bool PowerFlow::RunGaussSeidel(double systemPowerBase, // Apply the acceleration factor. newVolt = std::complex<double>(accFactor * (newVolt.real() - voltage[i].real()) + voltage[i].real(), - accFactor * (newVolt.imag() - voltage[i].imag()) + voltage[i].imag()); + accFactor * (newVolt.imag() - voltage[i].imag()) + voltage[i].imag()); // Keep the same voltage magnitude. voltage[i] = std::complex<double>(std::abs(voltage[i]) * std::cos(std::arg(newVolt)), - std::abs(voltage[i]) * std::sin(std::arg(newVolt))); + std::abs(voltage[i]) * std::sin(std::arg(newVolt))); } - double busError = std::max(std::abs(voltage[i].real() - oldVoltage[i].real()), - std::abs(voltage[i].imag() - oldVoltage[i].imag())); + double busError = std::max( + std::abs(voltage[i].real() - oldVoltage[i].real()), std::abs(voltage[i].imag() - oldVoltage[i].imag())); if(busError > iterationError) iterationError = busError; } @@ -246,7 +257,8 @@ bool PowerFlow::RunGaussSeidel(double systemPowerBase, if(busType[i] == BUS_PV) { if(reactiveLimit[i].maxLimitType == RL_LIMITED) { if(power[i].imag() - loadPower[i].imag() > reactiveLimit[i].maxLimit) { - power[i] = std::complex<double>(power[i].real(), reactiveLimit[i].maxLimit + loadPower[i].imag()); + power[i] = + std::complex<double>(power[i].real(), reactiveLimit[i].maxLimit + loadPower[i].imag()); busType[i] = BUS_PQ; reactiveLimit[i].limitReached = RL_MAX_REACHED; limitReach = true; @@ -254,7 +266,8 @@ bool PowerFlow::RunGaussSeidel(double systemPowerBase, } if(reactiveLimit[i].minLimitType == RL_LIMITED) { if(power[i].imag() - loadPower[i].imag() < reactiveLimit[i].minLimit) { - power[i] = std::complex<double>(power[i].real(), reactiveLimit[i].minLimit + loadPower[i].imag()); + power[i] = + std::complex<double>(power[i].real(), reactiveLimit[i].minLimit + loadPower[i].imag()); busType[i] = BUS_PQ; reactiveLimit[i].limitReached = RL_MIN_REACHED; limitReach = true; diff --git a/Project/PowerFlow.h b/Project/PowerFlow.h index 1e5c621..29e205a 100644 --- a/Project/PowerFlow.h +++ b/Project/PowerFlow.h @@ -4,24 +4,25 @@ #include "ElectricCalculation.h" #include <wx/string.h> -#include <wx/intl.h> //_() -#include <wx/log.h> //temp +#include <wx/intl.h> //_() class PowerFlow : public ElectricCalculation { - public: +public: + PowerFlow(); PowerFlow(std::vector<Element*> elementList); ~PowerFlow(); virtual bool RunGaussSeidel(double systemPowerBase = 100e6, - int maxIteration = 5000, - double error = 1e-6, - double initAngle = 0.0, - double accFactor = 1.0); + int maxIteration = 5000, + double error = 1e-6, + double initAngle = 0.0, + double accFactor = 1.0); virtual wxString GetErrorMessage() { return m_errorMsg; } - protected: + +protected: std::vector<std::vector<std::complex<double> > > m_yBus; wxString m_errorMsg = ""; }; -#endif // POWERFLOW_H +#endif // POWERFLOW_H diff --git a/Project/Project.mk b/Project/Project.mk deleted file mode 100644 index ea938a7..0000000 --- a/Project/Project.mk +++ /dev/null @@ -1,432 +0,0 @@ -## -## Auto Generated makefile by CodeLite IDE -## any manual changes will be erased -## -## Release -ProjectName :=Project -ConfigurationName :=Release -WorkspacePath :=C:/Users/Thales/Documents/GitHub/PSP -ProjectPath :=C:/Users/Thales/Documents/GitHub/PSP/Project -IntermediateDirectory :=./Release -OutDir := $(IntermediateDirectory) -CurrentFileName := -CurrentFilePath := -CurrentFileFullPath := -User :=Thales -Date :=06/01/2017 -CodeLitePath :="C:/Program Files/CodeLite" -LinkerName :=C:/TDM-GCC-64/bin/g++.exe -SharedObjectLinkerName :=C:/TDM-GCC-64/bin/g++.exe -shared -fPIC -ObjectSuffix :=.o -DependSuffix :=.o.d -PreprocessSuffix :=.i -DebugSwitch :=-g -IncludeSwitch :=-I -LibrarySwitch :=-l -OutputSwitch :=-o -LibraryPathSwitch :=-L -PreprocessorSwitch :=-D -SourceSwitch :=-c -OutputFile :=$(IntermediateDirectory)/pspufu -Preprocessors :=$(PreprocessorSwitch)NDEBUG $(PreprocessorSwitch)UNICODE -ObjectSwitch :=-o -ArchiveOutputSwitch := -PreprocessOnlySwitch :=-E -ObjectsFileList :="Project.txt" -PCHCompileFlags := -MakeDirCommand :=makedir -RcCmpOptions := $(shell wx-config --rcflags) -RcCompilerName :=C:/TDM-GCC-64/bin/windres.exe -LinkOptions := $(shell wx-config --libs gl) -mwindows -IncludePath := $(IncludeSwitch). $(IncludeSwitch). -IncludePCH := -RcIncludePath := -Libs := -ArLibs := -LibPath := $(LibraryPathSwitch). - -## -## Common variables -## AR, CXX, CC, AS, CXXFLAGS and CFLAGS can be overriden using an environment variables -## -AR := C:/TDM-GCC-64/bin/ar.exe rcu -CXX := C:/TDM-GCC-64/bin/g++.exe -CC := C:/TDM-GCC-64/bin/gcc.exe -CXXFLAGS := -O2 -Wall $(shell wx-config --cflags) $(Preprocessors) -CFLAGS := -O2 -Wall $(Preprocessors) -ASFLAGS := -AS := C:/TDM-GCC-64/bin/as.exe - - -## -## User defined environment variables -## -CodeLiteDir:=C:\Program Files\CodeLite -WXWIN:=C:\wxWidgets-3.1.0 -WXCFG:=gcc_dll\mswu -Objects0=$(IntermediateDirectory)/main.cpp$(ObjectSuffix) $(IntermediateDirectory)/win_resources.rc$(ObjectSuffix) $(IntermediateDirectory)/Text.cpp$(ObjectSuffix) $(IntermediateDirectory)/ElementDataObject.cpp$(ObjectSuffix) $(IntermediateDirectory)/ArtMetro.cpp$(ObjectSuffix) $(IntermediateDirectory)/wxGLString.cpp$(ObjectSuffix) $(IntermediateDirectory)/MainFrame.cpp$(ObjectSuffix) $(IntermediateDirectory)/Workspace.cpp$(ObjectSuffix) $(IntermediateDirectory)/FileHanding.cpp$(ObjectSuffix) $(IntermediateDirectory)/MainFrameBitmaps.cpp$(ObjectSuffix) \ - $(IntermediateDirectory)/WorkspaceBitmaps.cpp$(ObjectSuffix) $(IntermediateDirectory)/BusFormBitmaps.cpp$(ObjectSuffix) $(IntermediateDirectory)/ElementFormBitmaps.cpp$(ObjectSuffix) $(IntermediateDirectory)/MainFrameBase.cpp$(ObjectSuffix) $(IntermediateDirectory)/WorkspaceBase.cpp$(ObjectSuffix) $(IntermediateDirectory)/ElementForm.cpp$(ObjectSuffix) $(IntermediateDirectory)/Bus.cpp$(ObjectSuffix) $(IntermediateDirectory)/Line.cpp$(ObjectSuffix) $(IntermediateDirectory)/Transformer.cpp$(ObjectSuffix) $(IntermediateDirectory)/Machines.cpp$(ObjectSuffix) \ - $(IntermediateDirectory)/SyncGenerator.cpp$(ObjectSuffix) $(IntermediateDirectory)/IndMotor.cpp$(ObjectSuffix) $(IntermediateDirectory)/Branch.cpp$(ObjectSuffix) $(IntermediateDirectory)/SyncMotor.cpp$(ObjectSuffix) $(IntermediateDirectory)/Shunt.cpp$(ObjectSuffix) $(IntermediateDirectory)/Load.cpp$(ObjectSuffix) $(IntermediateDirectory)/Inductor.cpp$(ObjectSuffix) $(IntermediateDirectory)/Capacitor.cpp$(ObjectSuffix) $(IntermediateDirectory)/Element.cpp$(ObjectSuffix) $(IntermediateDirectory)/ElectricCalculation.cpp$(ObjectSuffix) \ - $(IntermediateDirectory)/PowerFlow.cpp$(ObjectSuffix) $(IntermediateDirectory)/BusForm.cpp$(ObjectSuffix) $(IntermediateDirectory)/GeneratorStabForm.cpp$(ObjectSuffix) $(IntermediateDirectory)/LineForm.cpp$(ObjectSuffix) $(IntermediateDirectory)/SwitchingForm.cpp$(ObjectSuffix) $(IntermediateDirectory)/TransformerForm.cpp$(ObjectSuffix) $(IntermediateDirectory)/LoadForm.cpp$(ObjectSuffix) $(IntermediateDirectory)/ReactiveShuntElementForm.cpp$(ObjectSuffix) $(IntermediateDirectory)/IndMotorForm.cpp$(ObjectSuffix) $(IntermediateDirectory)/SyncMachineForm.cpp$(ObjectSuffix) \ - $(IntermediateDirectory)/TextForm.cpp$(ObjectSuffix) - - - -Objects=$(Objects0) - -## -## Main Build Targets -## -.PHONY: all clean PreBuild PrePreBuild PostBuild MakeIntermediateDirs -all: $(OutputFile) - -$(OutputFile): $(IntermediateDirectory)/.d $(Objects) - @$(MakeDirCommand) $(@D) - @echo "" > $(IntermediateDirectory)/.d - @echo $(Objects0) > $(ObjectsFileList) - $(LinkerName) $(OutputSwitch)$(OutputFile) @$(ObjectsFileList) $(LibPath) $(Libs) $(LinkOptions) - -MakeIntermediateDirs: - @$(MakeDirCommand) "./Release" - - -$(IntermediateDirectory)/.d: - @$(MakeDirCommand) "./Release" - -PreBuild: - - -## -## Objects -## -$(IntermediateDirectory)/main.cpp$(ObjectSuffix): main.cpp $(IntermediateDirectory)/main.cpp$(DependSuffix) - $(CXX) $(IncludePCH) $(SourceSwitch) "C:/Users/Thales/Documents/GitHub/PSP/Project/main.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/main.cpp$(ObjectSuffix) $(IncludePath) -$(IntermediateDirectory)/main.cpp$(DependSuffix): main.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/main.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/main.cpp$(DependSuffix) -MM main.cpp - -$(IntermediateDirectory)/main.cpp$(PreprocessSuffix): main.cpp - $(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/main.cpp$(PreprocessSuffix) main.cpp - -$(IntermediateDirectory)/win_resources.rc$(ObjectSuffix): win_resources.rc - $(RcCompilerName) -i "C:/Users/Thales/Documents/GitHub/PSP/Project/win_resources.rc" $(RcCmpOptions) $(ObjectSwitch)$(IntermediateDirectory)/win_resources.rc$(ObjectSuffix) $(RcIncludePath) -$(IntermediateDirectory)/Text.cpp$(ObjectSuffix): Text.cpp $(IntermediateDirectory)/Text.cpp$(DependSuffix) - $(CXX) $(IncludePCH) $(SourceSwitch) "C:/Users/Thales/Documents/GitHub/PSP/Project/Text.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/Text.cpp$(ObjectSuffix) $(IncludePath) -$(IntermediateDirectory)/Text.cpp$(DependSuffix): Text.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/Text.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/Text.cpp$(DependSuffix) -MM Text.cpp - -$(IntermediateDirectory)/Text.cpp$(PreprocessSuffix): Text.cpp - $(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/Text.cpp$(PreprocessSuffix) Text.cpp - -$(IntermediateDirectory)/ElementDataObject.cpp$(ObjectSuffix): ElementDataObject.cpp $(IntermediateDirectory)/ElementDataObject.cpp$(DependSuffix) - $(CXX) $(IncludePCH) $(SourceSwitch) "C:/Users/Thales/Documents/GitHub/PSP/Project/ElementDataObject.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/ElementDataObject.cpp$(ObjectSuffix) $(IncludePath) -$(IntermediateDirectory)/ElementDataObject.cpp$(DependSuffix): ElementDataObject.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/ElementDataObject.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/ElementDataObject.cpp$(DependSuffix) -MM ElementDataObject.cpp - -$(IntermediateDirectory)/ElementDataObject.cpp$(PreprocessSuffix): ElementDataObject.cpp - $(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/ElementDataObject.cpp$(PreprocessSuffix) ElementDataObject.cpp - -$(IntermediateDirectory)/ArtMetro.cpp$(ObjectSuffix): ArtMetro.cpp $(IntermediateDirectory)/ArtMetro.cpp$(DependSuffix) - $(CXX) $(IncludePCH) $(SourceSwitch) "C:/Users/Thales/Documents/GitHub/PSP/Project/ArtMetro.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/ArtMetro.cpp$(ObjectSuffix) $(IncludePath) -$(IntermediateDirectory)/ArtMetro.cpp$(DependSuffix): ArtMetro.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/ArtMetro.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/ArtMetro.cpp$(DependSuffix) -MM ArtMetro.cpp - -$(IntermediateDirectory)/ArtMetro.cpp$(PreprocessSuffix): ArtMetro.cpp - $(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/ArtMetro.cpp$(PreprocessSuffix) ArtMetro.cpp - -$(IntermediateDirectory)/wxGLString.cpp$(ObjectSuffix): wxGLString.cpp $(IntermediateDirectory)/wxGLString.cpp$(DependSuffix) - $(CXX) $(IncludePCH) $(SourceSwitch) "C:/Users/Thales/Documents/GitHub/PSP/Project/wxGLString.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/wxGLString.cpp$(ObjectSuffix) $(IncludePath) -$(IntermediateDirectory)/wxGLString.cpp$(DependSuffix): wxGLString.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/wxGLString.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/wxGLString.cpp$(DependSuffix) -MM wxGLString.cpp - -$(IntermediateDirectory)/wxGLString.cpp$(PreprocessSuffix): wxGLString.cpp - $(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/wxGLString.cpp$(PreprocessSuffix) wxGLString.cpp - -$(IntermediateDirectory)/MainFrame.cpp$(ObjectSuffix): MainFrame.cpp $(IntermediateDirectory)/MainFrame.cpp$(DependSuffix) - $(CXX) $(IncludePCH) $(SourceSwitch) "C:/Users/Thales/Documents/GitHub/PSP/Project/MainFrame.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/MainFrame.cpp$(ObjectSuffix) $(IncludePath) -$(IntermediateDirectory)/MainFrame.cpp$(DependSuffix): MainFrame.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/MainFrame.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/MainFrame.cpp$(DependSuffix) -MM MainFrame.cpp - -$(IntermediateDirectory)/MainFrame.cpp$(PreprocessSuffix): MainFrame.cpp - $(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/MainFrame.cpp$(PreprocessSuffix) MainFrame.cpp - -$(IntermediateDirectory)/Workspace.cpp$(ObjectSuffix): Workspace.cpp $(IntermediateDirectory)/Workspace.cpp$(DependSuffix) - $(CXX) $(IncludePCH) $(SourceSwitch) "C:/Users/Thales/Documents/GitHub/PSP/Project/Workspace.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/Workspace.cpp$(ObjectSuffix) $(IncludePath) -$(IntermediateDirectory)/Workspace.cpp$(DependSuffix): Workspace.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/Workspace.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/Workspace.cpp$(DependSuffix) -MM Workspace.cpp - -$(IntermediateDirectory)/Workspace.cpp$(PreprocessSuffix): Workspace.cpp - $(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/Workspace.cpp$(PreprocessSuffix) Workspace.cpp - -$(IntermediateDirectory)/FileHanding.cpp$(ObjectSuffix): FileHanding.cpp $(IntermediateDirectory)/FileHanding.cpp$(DependSuffix) - $(CXX) $(IncludePCH) $(SourceSwitch) "C:/Users/Thales/Documents/GitHub/PSP/Project/FileHanding.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/FileHanding.cpp$(ObjectSuffix) $(IncludePath) -$(IntermediateDirectory)/FileHanding.cpp$(DependSuffix): FileHanding.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/FileHanding.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/FileHanding.cpp$(DependSuffix) -MM FileHanding.cpp - -$(IntermediateDirectory)/FileHanding.cpp$(PreprocessSuffix): FileHanding.cpp - $(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/FileHanding.cpp$(PreprocessSuffix) FileHanding.cpp - -$(IntermediateDirectory)/MainFrameBitmaps.cpp$(ObjectSuffix): MainFrameBitmaps.cpp $(IntermediateDirectory)/MainFrameBitmaps.cpp$(DependSuffix) - $(CXX) $(IncludePCH) $(SourceSwitch) "C:/Users/Thales/Documents/GitHub/PSP/Project/MainFrameBitmaps.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/MainFrameBitmaps.cpp$(ObjectSuffix) $(IncludePath) -$(IntermediateDirectory)/MainFrameBitmaps.cpp$(DependSuffix): MainFrameBitmaps.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/MainFrameBitmaps.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/MainFrameBitmaps.cpp$(DependSuffix) -MM MainFrameBitmaps.cpp - -$(IntermediateDirectory)/MainFrameBitmaps.cpp$(PreprocessSuffix): MainFrameBitmaps.cpp - $(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/MainFrameBitmaps.cpp$(PreprocessSuffix) MainFrameBitmaps.cpp - -$(IntermediateDirectory)/WorkspaceBitmaps.cpp$(ObjectSuffix): WorkspaceBitmaps.cpp $(IntermediateDirectory)/WorkspaceBitmaps.cpp$(DependSuffix) - $(CXX) $(IncludePCH) $(SourceSwitch) "C:/Users/Thales/Documents/GitHub/PSP/Project/WorkspaceBitmaps.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/WorkspaceBitmaps.cpp$(ObjectSuffix) $(IncludePath) -$(IntermediateDirectory)/WorkspaceBitmaps.cpp$(DependSuffix): WorkspaceBitmaps.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/WorkspaceBitmaps.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/WorkspaceBitmaps.cpp$(DependSuffix) -MM WorkspaceBitmaps.cpp - -$(IntermediateDirectory)/WorkspaceBitmaps.cpp$(PreprocessSuffix): WorkspaceBitmaps.cpp - $(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/WorkspaceBitmaps.cpp$(PreprocessSuffix) WorkspaceBitmaps.cpp - -$(IntermediateDirectory)/BusFormBitmaps.cpp$(ObjectSuffix): BusFormBitmaps.cpp $(IntermediateDirectory)/BusFormBitmaps.cpp$(DependSuffix) - $(CXX) $(IncludePCH) $(SourceSwitch) "C:/Users/Thales/Documents/GitHub/PSP/Project/BusFormBitmaps.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/BusFormBitmaps.cpp$(ObjectSuffix) $(IncludePath) -$(IntermediateDirectory)/BusFormBitmaps.cpp$(DependSuffix): BusFormBitmaps.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/BusFormBitmaps.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/BusFormBitmaps.cpp$(DependSuffix) -MM BusFormBitmaps.cpp - -$(IntermediateDirectory)/BusFormBitmaps.cpp$(PreprocessSuffix): BusFormBitmaps.cpp - $(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/BusFormBitmaps.cpp$(PreprocessSuffix) BusFormBitmaps.cpp - -$(IntermediateDirectory)/ElementFormBitmaps.cpp$(ObjectSuffix): ElementFormBitmaps.cpp $(IntermediateDirectory)/ElementFormBitmaps.cpp$(DependSuffix) - $(CXX) $(IncludePCH) $(SourceSwitch) "C:/Users/Thales/Documents/GitHub/PSP/Project/ElementFormBitmaps.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/ElementFormBitmaps.cpp$(ObjectSuffix) $(IncludePath) -$(IntermediateDirectory)/ElementFormBitmaps.cpp$(DependSuffix): ElementFormBitmaps.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/ElementFormBitmaps.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/ElementFormBitmaps.cpp$(DependSuffix) -MM ElementFormBitmaps.cpp - -$(IntermediateDirectory)/ElementFormBitmaps.cpp$(PreprocessSuffix): ElementFormBitmaps.cpp - $(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/ElementFormBitmaps.cpp$(PreprocessSuffix) ElementFormBitmaps.cpp - -$(IntermediateDirectory)/MainFrameBase.cpp$(ObjectSuffix): MainFrameBase.cpp $(IntermediateDirectory)/MainFrameBase.cpp$(DependSuffix) - $(CXX) $(IncludePCH) $(SourceSwitch) "C:/Users/Thales/Documents/GitHub/PSP/Project/MainFrameBase.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/MainFrameBase.cpp$(ObjectSuffix) $(IncludePath) -$(IntermediateDirectory)/MainFrameBase.cpp$(DependSuffix): MainFrameBase.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/MainFrameBase.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/MainFrameBase.cpp$(DependSuffix) -MM MainFrameBase.cpp - -$(IntermediateDirectory)/MainFrameBase.cpp$(PreprocessSuffix): MainFrameBase.cpp - $(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/MainFrameBase.cpp$(PreprocessSuffix) MainFrameBase.cpp - -$(IntermediateDirectory)/WorkspaceBase.cpp$(ObjectSuffix): WorkspaceBase.cpp $(IntermediateDirectory)/WorkspaceBase.cpp$(DependSuffix) - $(CXX) $(IncludePCH) $(SourceSwitch) "C:/Users/Thales/Documents/GitHub/PSP/Project/WorkspaceBase.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/WorkspaceBase.cpp$(ObjectSuffix) $(IncludePath) -$(IntermediateDirectory)/WorkspaceBase.cpp$(DependSuffix): WorkspaceBase.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/WorkspaceBase.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/WorkspaceBase.cpp$(DependSuffix) -MM WorkspaceBase.cpp - -$(IntermediateDirectory)/WorkspaceBase.cpp$(PreprocessSuffix): WorkspaceBase.cpp - $(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/WorkspaceBase.cpp$(PreprocessSuffix) WorkspaceBase.cpp - -$(IntermediateDirectory)/ElementForm.cpp$(ObjectSuffix): ElementForm.cpp $(IntermediateDirectory)/ElementForm.cpp$(DependSuffix) - $(CXX) $(IncludePCH) $(SourceSwitch) "C:/Users/Thales/Documents/GitHub/PSP/Project/ElementForm.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/ElementForm.cpp$(ObjectSuffix) $(IncludePath) -$(IntermediateDirectory)/ElementForm.cpp$(DependSuffix): ElementForm.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/ElementForm.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/ElementForm.cpp$(DependSuffix) -MM ElementForm.cpp - -$(IntermediateDirectory)/ElementForm.cpp$(PreprocessSuffix): ElementForm.cpp - $(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/ElementForm.cpp$(PreprocessSuffix) ElementForm.cpp - -$(IntermediateDirectory)/Bus.cpp$(ObjectSuffix): Bus.cpp $(IntermediateDirectory)/Bus.cpp$(DependSuffix) - $(CXX) $(IncludePCH) $(SourceSwitch) "C:/Users/Thales/Documents/GitHub/PSP/Project/Bus.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/Bus.cpp$(ObjectSuffix) $(IncludePath) -$(IntermediateDirectory)/Bus.cpp$(DependSuffix): Bus.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/Bus.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/Bus.cpp$(DependSuffix) -MM Bus.cpp - -$(IntermediateDirectory)/Bus.cpp$(PreprocessSuffix): Bus.cpp - $(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/Bus.cpp$(PreprocessSuffix) Bus.cpp - -$(IntermediateDirectory)/Line.cpp$(ObjectSuffix): Line.cpp $(IntermediateDirectory)/Line.cpp$(DependSuffix) - $(CXX) $(IncludePCH) $(SourceSwitch) "C:/Users/Thales/Documents/GitHub/PSP/Project/Line.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/Line.cpp$(ObjectSuffix) $(IncludePath) -$(IntermediateDirectory)/Line.cpp$(DependSuffix): Line.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/Line.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/Line.cpp$(DependSuffix) -MM Line.cpp - -$(IntermediateDirectory)/Line.cpp$(PreprocessSuffix): Line.cpp - $(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/Line.cpp$(PreprocessSuffix) Line.cpp - -$(IntermediateDirectory)/Transformer.cpp$(ObjectSuffix): Transformer.cpp $(IntermediateDirectory)/Transformer.cpp$(DependSuffix) - $(CXX) $(IncludePCH) $(SourceSwitch) "C:/Users/Thales/Documents/GitHub/PSP/Project/Transformer.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/Transformer.cpp$(ObjectSuffix) $(IncludePath) -$(IntermediateDirectory)/Transformer.cpp$(DependSuffix): Transformer.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/Transformer.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/Transformer.cpp$(DependSuffix) -MM Transformer.cpp - -$(IntermediateDirectory)/Transformer.cpp$(PreprocessSuffix): Transformer.cpp - $(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/Transformer.cpp$(PreprocessSuffix) Transformer.cpp - -$(IntermediateDirectory)/Machines.cpp$(ObjectSuffix): Machines.cpp $(IntermediateDirectory)/Machines.cpp$(DependSuffix) - $(CXX) $(IncludePCH) $(SourceSwitch) "C:/Users/Thales/Documents/GitHub/PSP/Project/Machines.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/Machines.cpp$(ObjectSuffix) $(IncludePath) -$(IntermediateDirectory)/Machines.cpp$(DependSuffix): Machines.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/Machines.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/Machines.cpp$(DependSuffix) -MM Machines.cpp - -$(IntermediateDirectory)/Machines.cpp$(PreprocessSuffix): Machines.cpp - $(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/Machines.cpp$(PreprocessSuffix) Machines.cpp - -$(IntermediateDirectory)/SyncGenerator.cpp$(ObjectSuffix): SyncGenerator.cpp $(IntermediateDirectory)/SyncGenerator.cpp$(DependSuffix) - $(CXX) $(IncludePCH) $(SourceSwitch) "C:/Users/Thales/Documents/GitHub/PSP/Project/SyncGenerator.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/SyncGenerator.cpp$(ObjectSuffix) $(IncludePath) -$(IntermediateDirectory)/SyncGenerator.cpp$(DependSuffix): SyncGenerator.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/SyncGenerator.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/SyncGenerator.cpp$(DependSuffix) -MM SyncGenerator.cpp - -$(IntermediateDirectory)/SyncGenerator.cpp$(PreprocessSuffix): SyncGenerator.cpp - $(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/SyncGenerator.cpp$(PreprocessSuffix) SyncGenerator.cpp - -$(IntermediateDirectory)/IndMotor.cpp$(ObjectSuffix): IndMotor.cpp $(IntermediateDirectory)/IndMotor.cpp$(DependSuffix) - $(CXX) $(IncludePCH) $(SourceSwitch) "C:/Users/Thales/Documents/GitHub/PSP/Project/IndMotor.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/IndMotor.cpp$(ObjectSuffix) $(IncludePath) -$(IntermediateDirectory)/IndMotor.cpp$(DependSuffix): IndMotor.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/IndMotor.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/IndMotor.cpp$(DependSuffix) -MM IndMotor.cpp - -$(IntermediateDirectory)/IndMotor.cpp$(PreprocessSuffix): IndMotor.cpp - $(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/IndMotor.cpp$(PreprocessSuffix) IndMotor.cpp - -$(IntermediateDirectory)/Branch.cpp$(ObjectSuffix): Branch.cpp $(IntermediateDirectory)/Branch.cpp$(DependSuffix) - $(CXX) $(IncludePCH) $(SourceSwitch) "C:/Users/Thales/Documents/GitHub/PSP/Project/Branch.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/Branch.cpp$(ObjectSuffix) $(IncludePath) -$(IntermediateDirectory)/Branch.cpp$(DependSuffix): Branch.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/Branch.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/Branch.cpp$(DependSuffix) -MM Branch.cpp - -$(IntermediateDirectory)/Branch.cpp$(PreprocessSuffix): Branch.cpp - $(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/Branch.cpp$(PreprocessSuffix) Branch.cpp - -$(IntermediateDirectory)/SyncMotor.cpp$(ObjectSuffix): SyncMotor.cpp $(IntermediateDirectory)/SyncMotor.cpp$(DependSuffix) - $(CXX) $(IncludePCH) $(SourceSwitch) "C:/Users/Thales/Documents/GitHub/PSP/Project/SyncMotor.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/SyncMotor.cpp$(ObjectSuffix) $(IncludePath) -$(IntermediateDirectory)/SyncMotor.cpp$(DependSuffix): SyncMotor.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/SyncMotor.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/SyncMotor.cpp$(DependSuffix) -MM SyncMotor.cpp - -$(IntermediateDirectory)/SyncMotor.cpp$(PreprocessSuffix): SyncMotor.cpp - $(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/SyncMotor.cpp$(PreprocessSuffix) SyncMotor.cpp - -$(IntermediateDirectory)/Shunt.cpp$(ObjectSuffix): Shunt.cpp $(IntermediateDirectory)/Shunt.cpp$(DependSuffix) - $(CXX) $(IncludePCH) $(SourceSwitch) "C:/Users/Thales/Documents/GitHub/PSP/Project/Shunt.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/Shunt.cpp$(ObjectSuffix) $(IncludePath) -$(IntermediateDirectory)/Shunt.cpp$(DependSuffix): Shunt.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/Shunt.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/Shunt.cpp$(DependSuffix) -MM Shunt.cpp - -$(IntermediateDirectory)/Shunt.cpp$(PreprocessSuffix): Shunt.cpp - $(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/Shunt.cpp$(PreprocessSuffix) Shunt.cpp - -$(IntermediateDirectory)/Load.cpp$(ObjectSuffix): Load.cpp $(IntermediateDirectory)/Load.cpp$(DependSuffix) - $(CXX) $(IncludePCH) $(SourceSwitch) "C:/Users/Thales/Documents/GitHub/PSP/Project/Load.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/Load.cpp$(ObjectSuffix) $(IncludePath) -$(IntermediateDirectory)/Load.cpp$(DependSuffix): Load.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/Load.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/Load.cpp$(DependSuffix) -MM Load.cpp - -$(IntermediateDirectory)/Load.cpp$(PreprocessSuffix): Load.cpp - $(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/Load.cpp$(PreprocessSuffix) Load.cpp - -$(IntermediateDirectory)/Inductor.cpp$(ObjectSuffix): Inductor.cpp $(IntermediateDirectory)/Inductor.cpp$(DependSuffix) - $(CXX) $(IncludePCH) $(SourceSwitch) "C:/Users/Thales/Documents/GitHub/PSP/Project/Inductor.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/Inductor.cpp$(ObjectSuffix) $(IncludePath) -$(IntermediateDirectory)/Inductor.cpp$(DependSuffix): Inductor.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/Inductor.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/Inductor.cpp$(DependSuffix) -MM Inductor.cpp - -$(IntermediateDirectory)/Inductor.cpp$(PreprocessSuffix): Inductor.cpp - $(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/Inductor.cpp$(PreprocessSuffix) Inductor.cpp - -$(IntermediateDirectory)/Capacitor.cpp$(ObjectSuffix): Capacitor.cpp $(IntermediateDirectory)/Capacitor.cpp$(DependSuffix) - $(CXX) $(IncludePCH) $(SourceSwitch) "C:/Users/Thales/Documents/GitHub/PSP/Project/Capacitor.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/Capacitor.cpp$(ObjectSuffix) $(IncludePath) -$(IntermediateDirectory)/Capacitor.cpp$(DependSuffix): Capacitor.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/Capacitor.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/Capacitor.cpp$(DependSuffix) -MM Capacitor.cpp - -$(IntermediateDirectory)/Capacitor.cpp$(PreprocessSuffix): Capacitor.cpp - $(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/Capacitor.cpp$(PreprocessSuffix) Capacitor.cpp - -$(IntermediateDirectory)/Element.cpp$(ObjectSuffix): Element.cpp $(IntermediateDirectory)/Element.cpp$(DependSuffix) - $(CXX) $(IncludePCH) $(SourceSwitch) "C:/Users/Thales/Documents/GitHub/PSP/Project/Element.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/Element.cpp$(ObjectSuffix) $(IncludePath) -$(IntermediateDirectory)/Element.cpp$(DependSuffix): Element.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/Element.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/Element.cpp$(DependSuffix) -MM Element.cpp - -$(IntermediateDirectory)/Element.cpp$(PreprocessSuffix): Element.cpp - $(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/Element.cpp$(PreprocessSuffix) Element.cpp - -$(IntermediateDirectory)/ElectricCalculation.cpp$(ObjectSuffix): ElectricCalculation.cpp $(IntermediateDirectory)/ElectricCalculation.cpp$(DependSuffix) - $(CXX) $(IncludePCH) $(SourceSwitch) "C:/Users/Thales/Documents/GitHub/PSP/Project/ElectricCalculation.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/ElectricCalculation.cpp$(ObjectSuffix) $(IncludePath) -$(IntermediateDirectory)/ElectricCalculation.cpp$(DependSuffix): ElectricCalculation.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/ElectricCalculation.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/ElectricCalculation.cpp$(DependSuffix) -MM ElectricCalculation.cpp - -$(IntermediateDirectory)/ElectricCalculation.cpp$(PreprocessSuffix): ElectricCalculation.cpp - $(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/ElectricCalculation.cpp$(PreprocessSuffix) ElectricCalculation.cpp - -$(IntermediateDirectory)/PowerFlow.cpp$(ObjectSuffix): PowerFlow.cpp $(IntermediateDirectory)/PowerFlow.cpp$(DependSuffix) - $(CXX) $(IncludePCH) $(SourceSwitch) "C:/Users/Thales/Documents/GitHub/PSP/Project/PowerFlow.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/PowerFlow.cpp$(ObjectSuffix) $(IncludePath) -$(IntermediateDirectory)/PowerFlow.cpp$(DependSuffix): PowerFlow.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/PowerFlow.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/PowerFlow.cpp$(DependSuffix) -MM PowerFlow.cpp - -$(IntermediateDirectory)/PowerFlow.cpp$(PreprocessSuffix): PowerFlow.cpp - $(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/PowerFlow.cpp$(PreprocessSuffix) PowerFlow.cpp - -$(IntermediateDirectory)/BusForm.cpp$(ObjectSuffix): BusForm.cpp $(IntermediateDirectory)/BusForm.cpp$(DependSuffix) - $(CXX) $(IncludePCH) $(SourceSwitch) "C:/Users/Thales/Documents/GitHub/PSP/Project/BusForm.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/BusForm.cpp$(ObjectSuffix) $(IncludePath) -$(IntermediateDirectory)/BusForm.cpp$(DependSuffix): BusForm.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/BusForm.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/BusForm.cpp$(DependSuffix) -MM BusForm.cpp - -$(IntermediateDirectory)/BusForm.cpp$(PreprocessSuffix): BusForm.cpp - $(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/BusForm.cpp$(PreprocessSuffix) BusForm.cpp - -$(IntermediateDirectory)/GeneratorStabForm.cpp$(ObjectSuffix): GeneratorStabForm.cpp $(IntermediateDirectory)/GeneratorStabForm.cpp$(DependSuffix) - $(CXX) $(IncludePCH) $(SourceSwitch) "C:/Users/Thales/Documents/GitHub/PSP/Project/GeneratorStabForm.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/GeneratorStabForm.cpp$(ObjectSuffix) $(IncludePath) -$(IntermediateDirectory)/GeneratorStabForm.cpp$(DependSuffix): GeneratorStabForm.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/GeneratorStabForm.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/GeneratorStabForm.cpp$(DependSuffix) -MM GeneratorStabForm.cpp - -$(IntermediateDirectory)/GeneratorStabForm.cpp$(PreprocessSuffix): GeneratorStabForm.cpp - $(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/GeneratorStabForm.cpp$(PreprocessSuffix) GeneratorStabForm.cpp - -$(IntermediateDirectory)/LineForm.cpp$(ObjectSuffix): LineForm.cpp $(IntermediateDirectory)/LineForm.cpp$(DependSuffix) - $(CXX) $(IncludePCH) $(SourceSwitch) "C:/Users/Thales/Documents/GitHub/PSP/Project/LineForm.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/LineForm.cpp$(ObjectSuffix) $(IncludePath) -$(IntermediateDirectory)/LineForm.cpp$(DependSuffix): LineForm.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/LineForm.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/LineForm.cpp$(DependSuffix) -MM LineForm.cpp - -$(IntermediateDirectory)/LineForm.cpp$(PreprocessSuffix): LineForm.cpp - $(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/LineForm.cpp$(PreprocessSuffix) LineForm.cpp - -$(IntermediateDirectory)/SwitchingForm.cpp$(ObjectSuffix): SwitchingForm.cpp $(IntermediateDirectory)/SwitchingForm.cpp$(DependSuffix) - $(CXX) $(IncludePCH) $(SourceSwitch) "C:/Users/Thales/Documents/GitHub/PSP/Project/SwitchingForm.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/SwitchingForm.cpp$(ObjectSuffix) $(IncludePath) -$(IntermediateDirectory)/SwitchingForm.cpp$(DependSuffix): SwitchingForm.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/SwitchingForm.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/SwitchingForm.cpp$(DependSuffix) -MM SwitchingForm.cpp - -$(IntermediateDirectory)/SwitchingForm.cpp$(PreprocessSuffix): SwitchingForm.cpp - $(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/SwitchingForm.cpp$(PreprocessSuffix) SwitchingForm.cpp - -$(IntermediateDirectory)/TransformerForm.cpp$(ObjectSuffix): TransformerForm.cpp $(IntermediateDirectory)/TransformerForm.cpp$(DependSuffix) - $(CXX) $(IncludePCH) $(SourceSwitch) "C:/Users/Thales/Documents/GitHub/PSP/Project/TransformerForm.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/TransformerForm.cpp$(ObjectSuffix) $(IncludePath) -$(IntermediateDirectory)/TransformerForm.cpp$(DependSuffix): TransformerForm.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/TransformerForm.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/TransformerForm.cpp$(DependSuffix) -MM TransformerForm.cpp - -$(IntermediateDirectory)/TransformerForm.cpp$(PreprocessSuffix): TransformerForm.cpp - $(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/TransformerForm.cpp$(PreprocessSuffix) TransformerForm.cpp - -$(IntermediateDirectory)/LoadForm.cpp$(ObjectSuffix): LoadForm.cpp $(IntermediateDirectory)/LoadForm.cpp$(DependSuffix) - $(CXX) $(IncludePCH) $(SourceSwitch) "C:/Users/Thales/Documents/GitHub/PSP/Project/LoadForm.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/LoadForm.cpp$(ObjectSuffix) $(IncludePath) -$(IntermediateDirectory)/LoadForm.cpp$(DependSuffix): LoadForm.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/LoadForm.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/LoadForm.cpp$(DependSuffix) -MM LoadForm.cpp - -$(IntermediateDirectory)/LoadForm.cpp$(PreprocessSuffix): LoadForm.cpp - $(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/LoadForm.cpp$(PreprocessSuffix) LoadForm.cpp - -$(IntermediateDirectory)/ReactiveShuntElementForm.cpp$(ObjectSuffix): ReactiveShuntElementForm.cpp $(IntermediateDirectory)/ReactiveShuntElementForm.cpp$(DependSuffix) - $(CXX) $(IncludePCH) $(SourceSwitch) "C:/Users/Thales/Documents/GitHub/PSP/Project/ReactiveShuntElementForm.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/ReactiveShuntElementForm.cpp$(ObjectSuffix) $(IncludePath) -$(IntermediateDirectory)/ReactiveShuntElementForm.cpp$(DependSuffix): ReactiveShuntElementForm.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/ReactiveShuntElementForm.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/ReactiveShuntElementForm.cpp$(DependSuffix) -MM ReactiveShuntElementForm.cpp - -$(IntermediateDirectory)/ReactiveShuntElementForm.cpp$(PreprocessSuffix): ReactiveShuntElementForm.cpp - $(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/ReactiveShuntElementForm.cpp$(PreprocessSuffix) ReactiveShuntElementForm.cpp - -$(IntermediateDirectory)/IndMotorForm.cpp$(ObjectSuffix): IndMotorForm.cpp $(IntermediateDirectory)/IndMotorForm.cpp$(DependSuffix) - $(CXX) $(IncludePCH) $(SourceSwitch) "C:/Users/Thales/Documents/GitHub/PSP/Project/IndMotorForm.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/IndMotorForm.cpp$(ObjectSuffix) $(IncludePath) -$(IntermediateDirectory)/IndMotorForm.cpp$(DependSuffix): IndMotorForm.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/IndMotorForm.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/IndMotorForm.cpp$(DependSuffix) -MM IndMotorForm.cpp - -$(IntermediateDirectory)/IndMotorForm.cpp$(PreprocessSuffix): IndMotorForm.cpp - $(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/IndMotorForm.cpp$(PreprocessSuffix) IndMotorForm.cpp - -$(IntermediateDirectory)/SyncMachineForm.cpp$(ObjectSuffix): SyncMachineForm.cpp $(IntermediateDirectory)/SyncMachineForm.cpp$(DependSuffix) - $(CXX) $(IncludePCH) $(SourceSwitch) "C:/Users/Thales/Documents/GitHub/PSP/Project/SyncMachineForm.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/SyncMachineForm.cpp$(ObjectSuffix) $(IncludePath) -$(IntermediateDirectory)/SyncMachineForm.cpp$(DependSuffix): SyncMachineForm.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/SyncMachineForm.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/SyncMachineForm.cpp$(DependSuffix) -MM SyncMachineForm.cpp - -$(IntermediateDirectory)/SyncMachineForm.cpp$(PreprocessSuffix): SyncMachineForm.cpp - $(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/SyncMachineForm.cpp$(PreprocessSuffix) SyncMachineForm.cpp - -$(IntermediateDirectory)/TextForm.cpp$(ObjectSuffix): TextForm.cpp $(IntermediateDirectory)/TextForm.cpp$(DependSuffix) - $(CXX) $(IncludePCH) $(SourceSwitch) "C:/Users/Thales/Documents/GitHub/PSP/Project/TextForm.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/TextForm.cpp$(ObjectSuffix) $(IncludePath) -$(IntermediateDirectory)/TextForm.cpp$(DependSuffix): TextForm.cpp - @$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/TextForm.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/TextForm.cpp$(DependSuffix) -MM TextForm.cpp - -$(IntermediateDirectory)/TextForm.cpp$(PreprocessSuffix): TextForm.cpp - $(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/TextForm.cpp$(PreprocessSuffix) TextForm.cpp - - --include $(IntermediateDirectory)/*$(DependSuffix) -## -## Clean -## -clean: - $(RM) -r ./Release/ - - diff --git a/Project/Project.project b/Project/Project.project deleted file mode 100644 index 9c325b1..0000000 --- a/Project/Project.project +++ /dev/null @@ -1,224 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<CodeLite_Project Name="Project" InternalType="GUI" Version="10.0.0"> - <Plugins> - <Plugin Name="qmake"> - <![CDATA[00020001N0005Debug0000000000000001N0007Release000000000000]]> - </Plugin> - <Plugin Name="CppCheck"/> - </Plugins> - <Description/> - <Dependencies/> - <VirtualDirectory Name="src"> - <VirtualDirectory Name="model"> - <VirtualDirectory Name="electrical"> - <File Name="Bus.cpp"/> - <File Name="Line.cpp"/> - <File Name="Transformer.cpp"/> - <File Name="Machines.cpp"/> - <File Name="SyncGenerator.cpp"/> - <File Name="IndMotor.cpp"/> - <File Name="Branch.cpp"/> - <File Name="SyncMotor.cpp"/> - <File Name="Shunt.cpp"/> - <File Name="Load.cpp"/> - <File Name="Inductor.cpp"/> - <File Name="Capacitor.cpp"/> - <File Name="Element.cpp"/> - </VirtualDirectory> - <VirtualDirectory Name="calculations"> - <File Name="ElectricCalculation.cpp"/> - <File Name="PowerFlow.cpp"/> - </VirtualDirectory> - <File Name="Text.cpp"/> - <File Name="ElementDataObject.cpp"/> - </VirtualDirectory> - <VirtualDirectory Name="view"> - <File Name="ArtMetro.cpp"/> - <File Name="wxGLString.cpp"/> - </VirtualDirectory> - <VirtualDirectory Name="controller"> - <File Name="MainFrame.cpp"/> - <File Name="Workspace.cpp"/> - <VirtualDirectory Name="element forms"> - <File Name="BusForm.cpp"/> - <File Name="GeneratorStabForm.cpp"/> - <File Name="LineForm.cpp"/> - <File Name="SwitchingForm.cpp"/> - <File Name="TransformerForm.cpp"/> - <File Name="LoadForm.cpp"/> - <File Name="ReactiveShuntElementForm.cpp"/> - <File Name="IndMotorForm.cpp"/> - <File Name="SyncMachineForm.cpp"/> - <File Name="TextForm.cpp"/> - </VirtualDirectory> - <File Name="FileHanding.cpp"/> - </VirtualDirectory> - <File Name="main.cpp"/> - </VirtualDirectory> - <VirtualDirectory Name="include"> - <VirtualDirectory Name="model"> - <VirtualDirectory Name="electrical"> - <File Name="Bus.h"/> - <File Name="Line.h"/> - <File Name="Transformer.h"/> - <File Name="Machines.h"/> - <File Name="SyncGenerator.h"/> - <File Name="IndMotor.h"/> - <File Name="Branch.h"/> - <File Name="SyncMotor.h"/> - <File Name="Shunt.h"/> - <File Name="Load.h"/> - <File Name="Inductor.h"/> - <File Name="Capacitor.h"/> - <File Name="Element.h"/> - </VirtualDirectory> - <VirtualDirectory Name="calculations"> - <File Name="ElectricCalculation.h"/> - <File Name="PowerFlow.h"/> - </VirtualDirectory> - <File Name="Text.h"/> - <VirtualDirectory Name="rapidXML"> - <File Name="rapidXML/rapidxml.hpp"/> - <File Name="rapidXML/rapidxml_iterators.hpp"/> - <File Name="rapidXML/rapidxml_print.hpp"/> - <File Name="rapidXML/rapidxml_utils.hpp"/> - </VirtualDirectory> - <File Name="ElementDataObject.h"/> - </VirtualDirectory> - <VirtualDirectory Name="view"> - <File Name="ArtMetro.h"/> - <File Name="wxGLString.h"/> - </VirtualDirectory> - <VirtualDirectory Name="controller"> - <File Name="MainFrame.h"/> - <File Name="Workspace.h"/> - <VirtualDirectory Name="element forms"> - <File Name="BusForm.h"/> - <File Name="GeneratorStabForm.h"/> - <File Name="LineForm.h"/> - <File Name="SwitchingForm.h"/> - <File Name="TransformerForm.h"/> - <File Name="LoadForm.h"/> - <File Name="ReactiveShuntElementForm.h"/> - <File Name="IndMotorForm.h"/> - <File Name="SyncMachineForm.h"/> - <File Name="TextForm.h"/> - </VirtualDirectory> - <File Name="FileHanding.h"/> - </VirtualDirectory> - </VirtualDirectory> - <VirtualDirectory Name="resources"> - <File Name="win_resources.rc"/> - </VirtualDirectory> - <VirtualDirectory Name="wxcrafter"> - <VirtualDirectory Name="resources"> - <File Name="MainFrameBitmaps.cpp"/> - <File Name="WorkspaceBitmaps.cpp"/> - <File Name="BusFormBitmaps.cpp"/> - <File Name="ElementFormBitmaps.cpp"/> - </VirtualDirectory> - <VirtualDirectory Name="base"> - <File Name="MainFrameBase.h"/> - <File Name="MainFrameBase.cpp"/> - <File Name="WorkspaceBase.h"/> - <File Name="WorkspaceBase.cpp"/> - <File Name="ElementForm.h"/> - <File Name="ElementForm.cpp"/> - </VirtualDirectory> - <File Name="MainFrame.wxcp"/> - <File Name="Workspace.wxcp"/> - <File Name="ElementForm.wxcp"/> - </VirtualDirectory> - <Settings Type="Executable"> - <GlobalSettings> - <Compiler Options="" C_Options="" Assembler=""> - <IncludePath Value="."/> - </Compiler> - <Linker Options=""> - <LibraryPath Value="."/> - </Linker> - <ResourceCompiler Options=""/> - </GlobalSettings> - <Configuration Name="Debug" CompilerType="MinGW ( TDM-GCC-32 )" DebuggerType="GNU gdb debugger" Type="Executable" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append"> - <Compiler Options="-g;-O0;-Wall;$(shell wx-config --cflags) " C_Options="-g;-O0;-Wall" Assembler="" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" PCHFlags="" PCHFlagsPolicy="0"> - <IncludePath Value="."/> - <Preprocessor Value="UNICODE"/> - </Compiler> - <Linker Options="$(shell wx-config --libs gl);-mwindows" Required="yes"/> - <ResourceCompiler Options="$(shell wx-config --rcflags)" Required="no"/> - <General OutputFile="$(IntermediateDirectory)/pspufu" IntermediateDirectory="./Debug" Command="./pspufu" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="no" IsGUIProgram="yes" IsEnabled="yes"/> - <BuildSystem Name="Default"/> - <Environment EnvVarSetName="<Use Defaults>" DbgSetName="<Use Defaults>"> - <![CDATA[]]> - </Environment> - <Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath="" IsExtended="no"> - <DebuggerSearchPaths/> - <PostConnectCommands/> - <StartupCommands/> - </Debugger> - <PreBuild/> - <PostBuild/> - <CustomBuild Enabled="no"> - <RebuildCommand/> - <CleanCommand/> - <BuildCommand/> - <PreprocessFileCommand/> - <SingleFileCommand/> - <MakefileGenerationCommand/> - <ThirdPartyToolName>None</ThirdPartyToolName> - <WorkingDirectory/> - </CustomBuild> - <AdditionalRules> - <CustomPostBuild/> - <CustomPreBuild/> - </AdditionalRules> - <Completion EnableCpp11="no" EnableCpp14="no"> - <ClangCmpFlagsC/> - <ClangCmpFlags/> - <ClangPP/> - <SearchPaths/> - </Completion> - </Configuration> - <Configuration Name="Release" CompilerType="MinGW ( TDM-GCC-32 )" DebuggerType="GNU gdb debugger" Type="Executable" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append"> - <Compiler Options="-O2;-Wall;$(shell wx-config --cflags)" C_Options="-O2;-Wall" Assembler="" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" PCHFlags="" PCHFlagsPolicy="0"> - <IncludePath Value="."/> - <Preprocessor Value="NDEBUG"/> - <Preprocessor Value="UNICODE"/> - </Compiler> - <Linker Options="$(shell wx-config --libs gl);-mwindows" Required="yes"/> - <ResourceCompiler Options="$(shell wx-config --rcflags)" Required="no"/> - <General OutputFile="$(IntermediateDirectory)/pspufu" IntermediateDirectory="./Release" Command="./pspufu" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="no" IsGUIProgram="yes" IsEnabled="yes"/> - <BuildSystem Name="Default"/> - <Environment EnvVarSetName="<Use Defaults>" DbgSetName="<Use Defaults>"> - <![CDATA[]]> - </Environment> - <Debugger IsRemote="no" RemoteHostName="" RemoteHostPort="" DebuggerPath="" IsExtended="no"> - <DebuggerSearchPaths/> - <PostConnectCommands/> - <StartupCommands/> - </Debugger> - <PreBuild/> - <PostBuild/> - <CustomBuild Enabled="no"> - <RebuildCommand/> - <CleanCommand/> - <BuildCommand/> - <PreprocessFileCommand/> - <SingleFileCommand/> - <MakefileGenerationCommand/> - <ThirdPartyToolName>None</ThirdPartyToolName> - <WorkingDirectory/> - </CustomBuild> - <AdditionalRules> - <CustomPostBuild/> - <CustomPreBuild/> - </AdditionalRules> - <Completion EnableCpp11="no" EnableCpp14="no"> - <ClangCmpFlagsC/> - <ClangCmpFlags/> - <ClangPP/> - <SearchPaths/> - </Completion> - </Configuration> - </Settings> -</CodeLite_Project> diff --git a/Project/Project.txt b/Project/Project.txt deleted file mode 100644 index f3ca292..0000000 --- a/Project/Project.txt +++ /dev/null @@ -1 +0,0 @@ -./Release/main.cpp.o ./Release/win_resources.rc.o ./Release/Text.cpp.o ./Release/ElementDataObject.cpp.o ./Release/ArtMetro.cpp.o ./Release/wxGLString.cpp.o ./Release/MainFrame.cpp.o ./Release/Workspace.cpp.o ./Release/FileHanding.cpp.o ./Release/MainFrameBitmaps.cpp.o ./Release/WorkspaceBitmaps.cpp.o ./Release/BusFormBitmaps.cpp.o ./Release/ElementFormBitmaps.cpp.o ./Release/MainFrameBase.cpp.o ./Release/WorkspaceBase.cpp.o ./Release/ElementForm.cpp.o ./Release/Bus.cpp.o ./Release/Line.cpp.o ./Release/Transformer.cpp.o ./Release/Machines.cpp.o ./Release/SyncGenerator.cpp.o ./Release/IndMotor.cpp.o ./Release/Branch.cpp.o ./Release/SyncMotor.cpp.o ./Release/Shunt.cpp.o ./Release/Load.cpp.o ./Release/Inductor.cpp.o ./Release/Capacitor.cpp.o ./Release/Element.cpp.o ./Release/ElectricCalculation.cpp.o ./Release/PowerFlow.cpp.o ./Release/BusForm.cpp.o ./Release/GeneratorStabForm.cpp.o ./Release/LineForm.cpp.o ./Release/SwitchingForm.cpp.o ./Release/TransformerForm.cpp.o ./Release/LoadForm.cpp.o ./Release/ReactiveShuntElementForm.cpp.o ./Release/IndMotorForm.cpp.o ./Release/SyncMachineForm.cpp.o ./Release/TextForm.cpp.o diff --git a/Project/SyncMotor.h b/Project/SyncMotor.h index d6e9bf1..7018e5d 100644 --- a/Project/SyncMotor.h +++ b/Project/SyncMotor.h @@ -32,6 +32,9 @@ struct SyncMotorElectricalData { double groundResistance = 0.0; double groundReactance = 0.0; bool groundNeutral = true; + // p.u. fault data + std::complex<double> faultCurrent[3] = { std::complex<double>(0.0, 0.0), std::complex<double>(0.0, 0.0), + std::complex<double>(0.0, 0.0) }; // Stability bool plotSyncMachine = false; diff --git a/Project/Workspace.cpp b/Project/Workspace.cpp index e668bf3..d09efad 100644 --- a/Project/Workspace.cpp +++ b/Project/Workspace.cpp @@ -15,6 +15,7 @@ #include "Text.h" #include "PowerFlow.h" +#include "Fault.h" // Camera Camera::Camera() @@ -1413,3 +1414,18 @@ std::vector<Element*> Workspace::GetAllElements() const return allElements; } + +bool Workspace::RunFault() +{ + Fault fault(m_elementList); + bool result = fault.RunFaultCalculation(100e6); + if(!result) { + wxMessageDialog msgDialog(this, fault.GetErrorMessage(), _("Error"), wxOK | wxCENTRE | wxICON_ERROR); + msgDialog.ShowModal(); + } + + UpdateTextElements(); + Redraw(); + + return result; +} diff --git a/Project/Workspace.h b/Project/Workspace.h index e4e0a37..f138410 100644 --- a/Project/Workspace.h +++ b/Project/Workspace.h @@ -28,6 +28,7 @@ class ElementDataObject; class Text; class PowerFlow; +class Fault; enum WorkspaceMode { MODE_EDIT = 0, @@ -103,6 +104,7 @@ public: void IncrementElementNumber(ElementID elementID) { m_elementNumber[elementID]++; } bool RunPowerFlow(); + bool RunFault(); protected: virtual void OnIdle(wxIdleEvent& event); |