From c478afa9fbef4b21ea85dbc266169b9eebf369a9 Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Tue, 30 Aug 2016 17:30:54 -0300 Subject: Transformer --- Project/Transformer.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Project/Transformer.h (limited to 'Project/Transformer.h') diff --git a/Project/Transformer.h b/Project/Transformer.h new file mode 100644 index 0000000..02ad59c --- /dev/null +++ b/Project/Transformer.h @@ -0,0 +1,25 @@ +#ifndef TRANSFORMER_H +#define TRANSFORMER_H + +#include "Element.h" + +class Transformer : public Element +{ +public: + Transformer(); + virtual ~Transformer(); + + virtual bool AddParent(Element* parent, wxPoint2DDouble position); + virtual bool Contains(wxPoint2DDouble position) const; + virtual void Draw(wxPoint2DDouble translation, double scale) const; + virtual bool Intersects(wxRect2DDouble rect) const; + virtual void Rotate(); + + protected: + void UpdateSwitchesPosition(); + std::vector m_pointList; + bool m_inserted = false; + std::vector m_movePts; +}; + +#endif // TRANSFORMER_H -- cgit From 8f475833e585692544cb0f481b0dce0c3439a1a9 Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Wed, 31 Aug 2016 23:09:16 -0300 Subject: Transformer complete --- Project/Transformer.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Project/Transformer.h') diff --git a/Project/Transformer.h b/Project/Transformer.h index 02ad59c..ce694ad 100644 --- a/Project/Transformer.h +++ b/Project/Transformer.h @@ -14,6 +14,15 @@ public: virtual void Draw(wxPoint2DDouble translation, double scale) const; virtual bool Intersects(wxRect2DDouble rect) const; virtual void Rotate(); + virtual void Move(wxPoint2DDouble position); + virtual void MoveNode(Element* parent, wxPoint2DDouble position); + virtual void StartMove(wxPoint2DDouble position); + virtual void RemoveParent(Element* parent); + virtual bool NodeContains(wxPoint2DDouble position); + virtual bool SetNodeParent(Element* parent); + virtual void UpdateNodes(); + virtual void RotateNode(Element* parent); + virtual bool GetContextMenu(wxMenu& menu); protected: void UpdateSwitchesPosition(); -- cgit From 077270f0294d236c6047d850703c5d011cb4b711 Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Sat, 3 Sep 2016 01:10:18 -0300 Subject: Motor implementation done, elements classes reorganized --- Project/Transformer.h | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'Project/Transformer.h') diff --git a/Project/Transformer.h b/Project/Transformer.h index ce694ad..413b8d9 100644 --- a/Project/Transformer.h +++ b/Project/Transformer.h @@ -1,9 +1,9 @@ #ifndef TRANSFORMER_H #define TRANSFORMER_H -#include "Element.h" +#include "Branch.h" -class Transformer : public Element +class Transformer : public Branch { public: Transformer(); @@ -17,18 +17,7 @@ public: virtual void Move(wxPoint2DDouble position); virtual void MoveNode(Element* parent, wxPoint2DDouble position); virtual void StartMove(wxPoint2DDouble position); - virtual void RemoveParent(Element* parent); - virtual bool NodeContains(wxPoint2DDouble position); - virtual bool SetNodeParent(Element* parent); - virtual void UpdateNodes(); - virtual void RotateNode(Element* parent); virtual bool GetContextMenu(wxMenu& menu); - - protected: - void UpdateSwitchesPosition(); - std::vector m_pointList; - bool m_inserted = false; - std::vector m_movePts; }; #endif // TRANSFORMER_H -- cgit From 697baaa3cc92e945d2301238dc9bcabffdb465ef Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Tue, 6 Sep 2016 18:32:47 -0300 Subject: Counter clockwise rotation implemented --- Project/Transformer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Project/Transformer.h') diff --git a/Project/Transformer.h b/Project/Transformer.h index 413b8d9..4630d33 100644 --- a/Project/Transformer.h +++ b/Project/Transformer.h @@ -13,7 +13,7 @@ public: virtual bool Contains(wxPoint2DDouble position) const; virtual void Draw(wxPoint2DDouble translation, double scale) const; virtual bool Intersects(wxRect2DDouble rect) const; - virtual void Rotate(); + virtual void Rotate(bool clockwise = true); virtual void Move(wxPoint2DDouble position); virtual void MoveNode(Element* parent, wxPoint2DDouble position); virtual void StartMove(wxPoint2DDouble position); -- cgit From d60de5e4c4774c5b840c5cab2cb629a5bbe9df42 Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Fri, 14 Oct 2016 17:45:25 -0300 Subject: Switching implemented --- Project/Transformer.h | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'Project/Transformer.h') diff --git a/Project/Transformer.h b/Project/Transformer.h index 4630d33..835fc03 100644 --- a/Project/Transformer.h +++ b/Project/Transformer.h @@ -3,6 +3,44 @@ #include "Branch.h" +class TransformerForm; + +enum TransformerConnection +{ + GWYE_GWYE = 0, + WYE_GWYE, + GWYE_WYE, + WYE_WYE, + DELTA_GWYE, + DELTA_WYE, + GWYE_DELTA, + WYE_DELTA, + DELTA_DELTA +}; + +struct TransformerElectricalData +{ + // General + wxString name = ""; + double nominalVoltage = 138.0; + ElectricalUnit nominalVoltageUnit = UNIT_kV; + double nominalPower = 100.0; + ElectricalUnit nominalPowerUnit = UNIT_MVA; + double resistance = 0.0; + ElectricalUnit resistanceUnit = UNIT_PU; + double indReactance = 1.0; + ElectricalUnit indReactanceUnit = UNIT_PU; + double capSusceptance = 0.0; + ElectricalUnit capSusceptanceUnit = UNIT_PU; + double lineSize = 100.0; + bool useLinePower = false; + + // Fault + double zeroResistance = 0.0; + double zeroIndReactance = 1.0; + double zeroCapSusceptance = 0.0; +}; + class Transformer : public Branch { public: @@ -18,6 +56,7 @@ public: virtual void MoveNode(Element* parent, wxPoint2DDouble position); virtual void StartMove(wxPoint2DDouble position); virtual bool GetContextMenu(wxMenu& menu); + virtual bool ShowForm(wxWindow* parent, Element* element); }; #endif // TRANSFORMER_H -- cgit From c4f6b784f575b19506d3207d3f8fbf9496db5b43 Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Mon, 17 Oct 2016 17:27:49 -0200 Subject: Transformer form under implementation --- Project/Transformer.h | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'Project/Transformer.h') diff --git a/Project/Transformer.h b/Project/Transformer.h index 835fc03..fb23618 100644 --- a/Project/Transformer.h +++ b/Project/Transformer.h @@ -22,23 +22,29 @@ struct TransformerElectricalData { // General wxString name = ""; - double nominalVoltage = 138.0; - ElectricalUnit nominalVoltageUnit = UNIT_kV; + double primaryNominalVoltage = 138.0; + ElectricalUnit primaryNominalVoltageUnit = UNIT_kV; + double secondaryNominalVoltage = 138.0; + ElectricalUnit secondaryNominalVoltageUnit = UNIT_kV; + int baseVoltage = 0; double nominalPower = 100.0; ElectricalUnit nominalPowerUnit = UNIT_MVA; double resistance = 0.0; ElectricalUnit resistanceUnit = UNIT_PU; double indReactance = 1.0; ElectricalUnit indReactanceUnit = UNIT_PU; - double capSusceptance = 0.0; - ElectricalUnit capSusceptanceUnit = UNIT_PU; - double lineSize = 100.0; - bool useLinePower = false; + TransformerConnection connection = GWYE_GWYE; + double turnsRatio = 1.0; + double phaseShift = 0.0; + bool useTransformerPower = false; // Fault double zeroResistance = 0.0; double zeroIndReactance = 1.0; - double zeroCapSusceptance = 0.0; + double primaryGrndResistance = 0.0; + double primaryGrndReactance = 0.0; + double secondaryGrndResistance = 0.0; + double secondaryGrndReactance = 0.0; }; class Transformer : public Branch @@ -57,6 +63,12 @@ public: virtual void StartMove(wxPoint2DDouble position); virtual bool GetContextMenu(wxMenu& menu); virtual bool ShowForm(wxWindow* parent, Element* element); + virtual TransformerElectricalData GetElectricalData() { return m_electricalData; } + virtual void SetElectricaData(TransformerElectricalData electricalData) { m_electricalData = electricalData; } + virtual void SetNominalVoltage(std::vector nominalVoltage, std::vector nominalVoltageUnit); + +protected: + TransformerElectricalData m_electricalData; }; #endif // TRANSFORMER_H -- cgit From dc8e7b67eb2141cfbed0f26ac50a8d14104f391b Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Tue, 18 Oct 2016 16:59:36 -0200 Subject: Transformer form implemented --- Project/Transformer.h | 1 + 1 file changed, 1 insertion(+) (limited to 'Project/Transformer.h') diff --git a/Project/Transformer.h b/Project/Transformer.h index fb23618..86d4cf7 100644 --- a/Project/Transformer.h +++ b/Project/Transformer.h @@ -51,6 +51,7 @@ class Transformer : public Branch { public: Transformer(); + Transformer(wxString name); virtual ~Transformer(); virtual bool AddParent(Element* parent, wxPoint2DDouble position); -- cgit From 7d4df7195202eaea0e84f227e96f19dec4144081 Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Sat, 29 Oct 2016 17:46:00 -0200 Subject: Power flow arrows implemented --- Project/Transformer.h | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'Project/Transformer.h') diff --git a/Project/Transformer.h b/Project/Transformer.h index 86d4cf7..cf9393f 100644 --- a/Project/Transformer.h +++ b/Project/Transformer.h @@ -5,8 +5,7 @@ class TransformerForm; -enum TransformerConnection -{ +enum TransformerConnection { GWYE_GWYE = 0, WYE_GWYE, GWYE_WYE, @@ -18,8 +17,7 @@ enum TransformerConnection DELTA_DELTA }; -struct TransformerElectricalData -{ +struct TransformerElectricalData { // General wxString name = ""; double primaryNominalVoltage = 138.0; @@ -49,26 +47,29 @@ struct TransformerElectricalData class Transformer : public Branch { -public: - Transformer(); - Transformer(wxString name); + public: + Transformer(); + Transformer(wxString name); virtual ~Transformer(); - + virtual bool AddParent(Element* parent, wxPoint2DDouble position); virtual bool Contains(wxPoint2DDouble position) const; virtual void Draw(wxPoint2DDouble translation, double scale) const; virtual bool Intersects(wxRect2DDouble rect) const; virtual void Rotate(bool clockwise = true); - virtual void Move(wxPoint2DDouble position); - virtual void MoveNode(Element* parent, wxPoint2DDouble position); - virtual void StartMove(wxPoint2DDouble position); - virtual bool GetContextMenu(wxMenu& menu); + virtual void Move(wxPoint2DDouble position); + virtual void MoveNode(Element* parent, wxPoint2DDouble position); + virtual void StartMove(wxPoint2DDouble position); + virtual bool GetContextMenu(wxMenu& menu); + virtual void RotateNode(Element* parent, bool clockwise); + virtual bool SetNodeParent(Element* parent); virtual bool ShowForm(wxWindow* parent, Element* element); virtual TransformerElectricalData GetElectricalData() { return m_electricalData; } virtual void SetElectricaData(TransformerElectricalData electricalData) { m_electricalData = electricalData; } virtual void SetNominalVoltage(std::vector nominalVoltage, std::vector nominalVoltageUnit); - -protected: + + protected: + void UpdatePowerFlowArrowsPosition(); TransformerElectricalData m_electricalData; }; -- cgit From 4799019fb948226daf5777d0d3ba41257dd55657 Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Thu, 3 Nov 2016 16:26:55 -0200 Subject: Power flow validate method under implementation --- Project/Transformer.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Project/Transformer.h') diff --git a/Project/Transformer.h b/Project/Transformer.h index cf9393f..7c6f14e 100644 --- a/Project/Transformer.h +++ b/Project/Transformer.h @@ -35,6 +35,10 @@ struct TransformerElectricalData { double turnsRatio = 1.0; double phaseShift = 0.0; bool useTransformerPower = false; + + // Power flow (p.u.) + std::complex current[2] = {std::complex(0.0, 0.0), std::complex(0.0, 0.0)}; + std::complex powerFlow[2] = {std::complex(0.0, 0.0), std::complex(0.0, 0.0)}; // Fault double zeroResistance = 0.0; -- cgit From 9919f24692c1fe9b8e11fde5c6d5c18f169b5c10 Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Fri, 4 Nov 2016 18:02:03 -0200 Subject: Validation implemented --- Project/Transformer.h | 1 + 1 file changed, 1 insertion(+) (limited to 'Project/Transformer.h') diff --git a/Project/Transformer.h b/Project/Transformer.h index 7c6f14e..8c958a1 100644 --- a/Project/Transformer.h +++ b/Project/Transformer.h @@ -67,6 +67,7 @@ class Transformer : public Branch virtual bool GetContextMenu(wxMenu& menu); virtual void RotateNode(Element* parent, bool clockwise); virtual bool SetNodeParent(Element* parent); + virtual void SetPowerFlowDirection(PowerFlowDirection pfDirection); virtual bool ShowForm(wxWindow* parent, Element* element); virtual TransformerElectricalData GetElectricalData() { return m_electricalData; } virtual void SetElectricaData(TransformerElectricalData electricalData) { m_electricalData = electricalData; } -- cgit