From 474b1f94ced70e1d183a79bb6df87603982755aa Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Fri, 19 Aug 2016 17:53:45 -0300 Subject: Line still under implementation --- Project/Line.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Project/Line.h') diff --git a/Project/Line.h b/Project/Line.h index 08a2b36..9293baa 100644 --- a/Project/Line.h +++ b/Project/Line.h @@ -24,10 +24,12 @@ class Line : public Element virtual void RotateNode(Element* parent); virtual void AddPoint(wxPoint2DDouble point); virtual bool GetContextMenu(wxMenu& menu); + virtual void RemoveNode(wxPoint2DDouble point); + virtual void AddNode(wxPoint2DDouble point); protected: void UpdateSwitchesPosition(); - double PointToLineDistance(wxPoint2DDouble point) const; + double PointToLineDistance(wxPoint2DDouble point, int* segmentNumber = NULL) const; std::vector m_pointList; bool m_inserted = false; std::vector m_movePts; -- cgit From 19c800c4f843081420ae6241017e439e7b6da132 Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Sun, 21 Aug 2016 22:14:56 -0300 Subject: Line implementation almost finished --- Project/Line.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Project/Line.h') diff --git a/Project/Line.h b/Project/Line.h index 9293baa..7374e29 100644 --- a/Project/Line.h +++ b/Project/Line.h @@ -15,6 +15,8 @@ class Line : public Element virtual void Move(wxPoint2DDouble position) {} virtual void StartMove(wxPoint2DDouble position); virtual void MoveNode(Element* parent, wxPoint2DDouble position); + virtual bool NodeContains(wxPoint2DDouble position); + virtual bool SetNodeParent(Element* parent); virtual wxCursor GetBestPickboxCursor() const; virtual bool AddParent(Element* parent, wxPoint2DDouble position); virtual bool Intersects(wxRect2DDouble rect) const; -- cgit From 8e00906e0517b335a6c33f682334bda3c1eadb69 Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Thu, 25 Aug 2016 18:09:39 -0300 Subject: Line finally done --- Project/Line.h | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'Project/Line.h') diff --git a/Project/Line.h b/Project/Line.h index 7374e29..596b1a4 100644 --- a/Project/Line.h +++ b/Project/Line.h @@ -12,29 +12,30 @@ class Line : public Element ~Line(); virtual bool Contains(wxPoint2DDouble position) const; virtual void Draw(wxPoint2DDouble translation, double scale) const; - virtual void Move(wxPoint2DDouble position) {} - virtual void StartMove(wxPoint2DDouble position); + virtual void Move(wxPoint2DDouble position); + virtual void StartMove(wxPoint2DDouble position); virtual void MoveNode(Element* parent, wxPoint2DDouble position); - virtual bool NodeContains(wxPoint2DDouble position); - virtual bool SetNodeParent(Element* parent); - virtual wxCursor GetBestPickboxCursor() const; + virtual bool NodeContains(wxPoint2DDouble position); + virtual bool SetNodeParent(Element* parent); + virtual void UpdateNodes(); + virtual wxCursor GetBestPickboxCursor() const { return wxCURSOR_SIZING; } virtual bool AddParent(Element* parent, wxPoint2DDouble position); virtual bool Intersects(wxRect2DDouble rect) const; virtual void MovePickbox(wxPoint2DDouble position); virtual bool PickboxContains(wxPoint2DDouble position); virtual void Rotate() {} - virtual void RotateNode(Element* parent); + virtual void RotateNode(Element* parent); virtual void AddPoint(wxPoint2DDouble point); - virtual bool GetContextMenu(wxMenu& menu); - virtual void RemoveNode(wxPoint2DDouble point); - virtual void AddNode(wxPoint2DDouble point); + virtual bool GetContextMenu(wxMenu& menu); + virtual void RemoveNode(wxPoint2DDouble point); + virtual void AddNode(wxPoint2DDouble point); -protected: - void UpdateSwitchesPosition(); - double PointToLineDistance(wxPoint2DDouble point, int* segmentNumber = NULL) const; + protected: + void UpdateSwitchesPosition(); + double PointToLineDistance(wxPoint2DDouble point, int* segmentNumber = NULL) const; std::vector m_pointList; bool m_inserted = false; - std::vector m_movePts; + std::vector m_movePts; }; #endif // LINE_H -- cgit From 06e57f5c75772dcba902e3032c756f79090f3424 Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Mon, 29 Aug 2016 17:26:50 -0300 Subject: Delete implemented --- Project/Line.h | 1 + 1 file changed, 1 insertion(+) (limited to 'Project/Line.h') diff --git a/Project/Line.h b/Project/Line.h index 596b1a4..983293a 100644 --- a/Project/Line.h +++ b/Project/Line.h @@ -17,6 +17,7 @@ class Line : public Element virtual void MoveNode(Element* parent, wxPoint2DDouble position); virtual bool NodeContains(wxPoint2DDouble position); virtual bool SetNodeParent(Element* parent); + virtual void RemoveParent(Element* parent); virtual void UpdateNodes(); virtual wxCursor GetBestPickboxCursor() const { return wxCURSOR_SIZING; } virtual bool AddParent(Element* parent, wxPoint2DDouble position); -- cgit From c478afa9fbef4b21ea85dbc266169b9eebf369a9 Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Tue, 30 Aug 2016 17:30:54 -0300 Subject: Transformer --- Project/Line.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'Project/Line.h') diff --git a/Project/Line.h b/Project/Line.h index 983293a..32ebdf8 100644 --- a/Project/Line.h +++ b/Project/Line.h @@ -1,8 +1,6 @@ #ifndef LINE_H #define LINE_H -#include - #include "Element.h" class Line : public Element -- 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/Line.h | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'Project/Line.h') diff --git a/Project/Line.h b/Project/Line.h index 32ebdf8..d2b3547 100644 --- a/Project/Line.h +++ b/Project/Line.h @@ -1,9 +1,9 @@ #ifndef LINE_H #define LINE_H -#include "Element.h" +#include "Branch.h" -class Line : public Element +class Line : public Branch { public: Line(); @@ -13,28 +13,18 @@ class Line : public Element virtual void Move(wxPoint2DDouble position); virtual void StartMove(wxPoint2DDouble position); virtual void MoveNode(Element* parent, wxPoint2DDouble position); - virtual bool NodeContains(wxPoint2DDouble position); - virtual bool SetNodeParent(Element* parent); - virtual void RemoveParent(Element* parent); - virtual void UpdateNodes(); virtual wxCursor GetBestPickboxCursor() const { return wxCURSOR_SIZING; } virtual bool AddParent(Element* parent, wxPoint2DDouble position); virtual bool Intersects(wxRect2DDouble rect) const; virtual void MovePickbox(wxPoint2DDouble position); virtual bool PickboxContains(wxPoint2DDouble position); - virtual void Rotate() {} - virtual void RotateNode(Element* parent); virtual void AddPoint(wxPoint2DDouble point); virtual bool GetContextMenu(wxMenu& menu); virtual void RemoveNode(wxPoint2DDouble point); virtual void AddNode(wxPoint2DDouble point); protected: - void UpdateSwitchesPosition(); double PointToLineDistance(wxPoint2DDouble point, int* segmentNumber = NULL) const; - std::vector m_pointList; - bool m_inserted = false; - std::vector m_movePts; }; #endif // LINE_H -- cgit From 122d124108384bb4579b6d96956b931d7221d3c1 Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Thu, 8 Sep 2016 18:54:52 -0300 Subject: Fit implemented --- Project/Line.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Project/Line.h') diff --git a/Project/Line.h b/Project/Line.h index d2b3547..edf4d07 100644 --- a/Project/Line.h +++ b/Project/Line.h @@ -3,6 +3,8 @@ #include "Branch.h" +#include + class Line : public Branch { public: @@ -22,6 +24,7 @@ class Line : public Branch virtual bool GetContextMenu(wxMenu& menu); virtual void RemoveNode(wxPoint2DDouble point); virtual void AddNode(wxPoint2DDouble point); + virtual void CalculateBoundaries(wxPoint2DDouble& leftUp, wxPoint2DDouble& rightBottom) const; protected: double PointToLineDistance(wxPoint2DDouble point, int* segmentNumber = NULL) const; -- cgit From ee27459748acee31a307604f6395ea31b4bf53ce Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Thu, 29 Sep 2016 17:01:02 -0300 Subject: Line form under implementation --- Project/Line.h | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) (limited to 'Project/Line.h') diff --git a/Project/Line.h b/Project/Line.h index edf4d07..8aa0c83 100644 --- a/Project/Line.h +++ b/Project/Line.h @@ -1,9 +1,33 @@ #ifndef LINE_H #define LINE_H +#include "LineForm.h" #include "Branch.h" -#include +class LineForm; + +struct LineElectricalData +{ + // 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 Line : public Branch { @@ -24,10 +48,13 @@ class Line : public Branch virtual bool GetContextMenu(wxMenu& menu); virtual void RemoveNode(wxPoint2DDouble point); virtual void AddNode(wxPoint2DDouble point); - virtual void CalculateBoundaries(wxPoint2DDouble& leftUp, wxPoint2DDouble& rightBottom) const; - + virtual void CalculateBoundaries(wxPoint2DDouble& leftUp, wxPoint2DDouble& rightBottom) const; + virtual bool ShowForm(wxWindow* parent, Element* element); + virtual LineElectricalData GetElectricalData() const { return m_electricaData; } + virtual void SetElectricalData(LineElectricalData electricalData) { m_electricaData = electricalData; } protected: double PointToLineDistance(wxPoint2DDouble point, int* segmentNumber = NULL) const; + LineElectricalData m_electricaData; }; #endif // LINE_H -- cgit From f6718ac24553ac99bf90f99a33543d6d6b96999b Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Fri, 30 Sep 2016 16:58:37 -0300 Subject: Line form implemented, voltages corrections under implementation --- Project/Line.h | 1 + 1 file changed, 1 insertion(+) (limited to 'Project/Line.h') diff --git a/Project/Line.h b/Project/Line.h index 8aa0c83..7dfe104 100644 --- a/Project/Line.h +++ b/Project/Line.h @@ -33,6 +33,7 @@ class Line : public Branch { public: Line(); + Line(wxString name); ~Line(); virtual bool Contains(wxPoint2DDouble position) const; virtual void Draw(wxPoint2DDouble translation, double scale) const; -- cgit From 0ad4701a05a1fb267ee58c3da89d897eba1d91ee Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Sat, 1 Oct 2016 17:33:43 -0300 Subject: Nominal voltage bug fixed --- Project/Line.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Project/Line.h') diff --git a/Project/Line.h b/Project/Line.h index 7dfe104..72f947d 100644 --- a/Project/Line.h +++ b/Project/Line.h @@ -40,6 +40,7 @@ class Line : public Branch virtual void Move(wxPoint2DDouble position); virtual void StartMove(wxPoint2DDouble position); virtual void MoveNode(Element* parent, wxPoint2DDouble position); + virtual bool SetNodeParent(Element* parent); virtual wxCursor GetBestPickboxCursor() const { return wxCURSOR_SIZING; } virtual bool AddParent(Element* parent, wxPoint2DDouble position); virtual bool Intersects(wxRect2DDouble rect) const; @@ -53,6 +54,7 @@ class Line : public Branch virtual bool ShowForm(wxWindow* parent, Element* element); virtual LineElectricalData GetElectricalData() const { return m_electricaData; } virtual void SetElectricalData(LineElectricalData electricalData) { m_electricaData = electricalData; } + virtual void SetNominalVoltage(double nominalVoltage, ElectricalUnit nominalVoltageUnit); protected: double PointToLineDistance(wxPoint2DDouble point, int* segmentNumber = NULL) const; LineElectricalData m_electricaData; -- 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/Line.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Project/Line.h') diff --git a/Project/Line.h b/Project/Line.h index 72f947d..fbd0184 100644 --- a/Project/Line.h +++ b/Project/Line.h @@ -54,7 +54,7 @@ class Line : public Branch virtual bool ShowForm(wxWindow* parent, Element* element); virtual LineElectricalData GetElectricalData() const { return m_electricaData; } virtual void SetElectricalData(LineElectricalData electricalData) { m_electricaData = electricalData; } - virtual void SetNominalVoltage(double nominalVoltage, ElectricalUnit nominalVoltageUnit); + virtual void SetNominalVoltage(std::vector nominalVoltage, std::vector nominalVoltageUnit); protected: double PointToLineDistance(wxPoint2DDouble point, int* segmentNumber = NULL) const; LineElectricalData m_electricaData; -- cgit From 0e3a45462bf8ce31be988679fd380baeecfb1b95 Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Tue, 25 Oct 2016 17:09:19 -0200 Subject: Capacitor and Inductor forms implemented --- Project/Line.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'Project/Line.h') diff --git a/Project/Line.h b/Project/Line.h index fbd0184..3e5a5a6 100644 --- a/Project/Line.h +++ b/Project/Line.h @@ -4,8 +4,6 @@ #include "LineForm.h" #include "Branch.h" -class LineForm; - struct LineElectricalData { // General -- cgit From 468ba7581675a23567746628d6777ca411b150d3 Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Fri, 28 Oct 2016 17:46:43 -0200 Subject: Power flow arrow under implementation --- Project/Line.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'Project/Line.h') diff --git a/Project/Line.h b/Project/Line.h index 3e5a5a6..afabb17 100644 --- a/Project/Line.h +++ b/Project/Line.h @@ -4,8 +4,7 @@ #include "LineForm.h" #include "Branch.h" -struct LineElectricalData -{ +struct LineElectricalData { // General wxString name = ""; double nominalVoltage = 138.0; @@ -21,6 +20,9 @@ struct LineElectricalData double lineSize = 100.0; bool useLinePower = false; + // Power flow + std::complex powerFlow[2] = {std::complex(0.0, 0.0), std::complex(0.0, 0.0)}; + // Fault double zeroResistance = 0.0; double zeroIndReactance = 1.0; @@ -31,14 +33,14 @@ class Line : public Branch { public: Line(); - Line(wxString name); + Line(wxString name); ~Line(); virtual bool Contains(wxPoint2DDouble position) const; virtual void Draw(wxPoint2DDouble translation, double scale) const; virtual void Move(wxPoint2DDouble position); virtual void StartMove(wxPoint2DDouble position); virtual void MoveNode(Element* parent, wxPoint2DDouble position); - virtual bool SetNodeParent(Element* parent); + virtual bool SetNodeParent(Element* parent); virtual wxCursor GetBestPickboxCursor() const { return wxCURSOR_SIZING; } virtual bool AddParent(Element* parent, wxPoint2DDouble position); virtual bool Intersects(wxRect2DDouble rect) const; @@ -52,7 +54,8 @@ class Line : public Branch virtual bool ShowForm(wxWindow* parent, Element* element); virtual LineElectricalData GetElectricalData() const { return m_electricaData; } virtual void SetElectricalData(LineElectricalData electricalData) { m_electricaData = electricalData; } - virtual void SetNominalVoltage(std::vector nominalVoltage, std::vector nominalVoltageUnit); + virtual void SetNominalVoltage(std::vector nominalVoltage, std::vector nominalVoltageUnit); + protected: double PointToLineDistance(wxPoint2DDouble point, int* segmentNumber = NULL) const; LineElectricalData m_electricaData; -- 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/Line.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Project/Line.h') diff --git a/Project/Line.h b/Project/Line.h index afabb17..2310126 100644 --- a/Project/Line.h +++ b/Project/Line.h @@ -50,6 +50,7 @@ class Line : public Branch virtual bool GetContextMenu(wxMenu& menu); virtual void RemoveNode(wxPoint2DDouble point); virtual void AddNode(wxPoint2DDouble point); + virtual void RotateNode(Element* parent, bool clockwise = true); virtual void CalculateBoundaries(wxPoint2DDouble& leftUp, wxPoint2DDouble& rightBottom) const; virtual bool ShowForm(wxWindow* parent, Element* element); virtual LineElectricalData GetElectricalData() const { return m_electricaData; } @@ -58,6 +59,7 @@ class Line : public Branch protected: double PointToLineDistance(wxPoint2DDouble point, int* segmentNumber = NULL) const; + void UpdatePowerFlowArrowsPosition(); LineElectricalData m_electricaData; }; -- 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/Line.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Project/Line.h') diff --git a/Project/Line.h b/Project/Line.h index 2310126..7e50fc7 100644 --- a/Project/Line.h +++ b/Project/Line.h @@ -20,7 +20,8 @@ struct LineElectricalData { double lineSize = 100.0; bool useLinePower = false; - // Power flow + // 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 -- 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/Line.h | 1 + 1 file changed, 1 insertion(+) (limited to 'Project/Line.h') diff --git a/Project/Line.h b/Project/Line.h index 7e50fc7..1a9aa2b 100644 --- a/Project/Line.h +++ b/Project/Line.h @@ -53,6 +53,7 @@ class Line : public Branch virtual void AddNode(wxPoint2DDouble point); virtual void RotateNode(Element* parent, bool clockwise = true); virtual void CalculateBoundaries(wxPoint2DDouble& leftUp, wxPoint2DDouble& rightBottom) const; + virtual void SetPowerFlowDirection(PowerFlowDirection pfDirection); virtual bool ShowForm(wxWindow* parent, Element* element); virtual LineElectricalData GetElectricalData() const { return m_electricaData; } virtual void SetElectricalData(LineElectricalData electricalData) { m_electricaData = electricalData; } -- cgit