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/Bus.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Project/Bus.h') diff --git a/Project/Bus.h b/Project/Bus.h index a7fa122..190f761 100644 --- a/Project/Bus.h +++ b/Project/Bus.h @@ -13,7 +13,7 @@ class Bus : public Element virtual bool Contains(wxPoint2DDouble position) const; virtual bool Intersects(wxRect2DDouble rect) const; virtual void Draw(wxPoint2DDouble translation, double scale) const; - virtual void Rotate(); + virtual void Rotate(bool clockwise = true); virtual wxCursor GetBestPickboxCursor() const; virtual void MovePickbox(wxPoint2DDouble position); virtual bool PickboxContains(wxPoint2DDouble position); -- cgit From 66fd00eda79d106d07617ebdeb90cdd46786e691 Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Fri, 9 Sep 2016 17:01:27 -0300 Subject: Bus form under implementation --- Project/Bus.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Project/Bus.h') diff --git a/Project/Bus.h b/Project/Bus.h index 190f761..ec18e93 100644 --- a/Project/Bus.h +++ b/Project/Bus.h @@ -1,6 +1,7 @@ #ifndef BUS_H #define BUS_H +#include "BusForm.h" #include "Element.h" class Bus : public Element @@ -18,6 +19,7 @@ class Bus : public Element virtual void MovePickbox(wxPoint2DDouble position); virtual bool PickboxContains(wxPoint2DDouble position); virtual bool GetContextMenu(wxMenu& menu); + virtual bool ShowForm(wxWindow* parent); }; #endif // BUS_H -- cgit From 1088617b8f1c31af3ad6a87f9934f7a55240b3a2 Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Mon, 12 Sep 2016 18:49:00 -0300 Subject: Bus form under implementation [2] --- Project/Bus.h | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'Project/Bus.h') diff --git a/Project/Bus.h b/Project/Bus.h index ec18e93..50bfa1a 100644 --- a/Project/Bus.h +++ b/Project/Bus.h @@ -4,11 +4,34 @@ #include "BusForm.h" #include "Element.h" +struct BusElectricalData +{ + wxString name = ""; + double nominalVoltage = 138.0; + ElectricalUnit nominalVoltageUnit = UNIT_kV; + bool isVoltageControlled = false; + double controlledVoltage = 1.0; + int controlledVoltageUnitChoice = 0; // 0 = p.u., 1 = same as nominalVoltageUnit (UNIT_V or UNIT_kV). + bool slackBus = false; + bool hasFault = false; + FaultData faultType = FAULT_THREEPHASE; + FaultData faultLocation = FAULT_LINE_A; + double faultResistance = 0.0; + double faultReactance = 0.0; + bool plotBus = false; + bool stabHasFault = false; + double stabFaultTime = 0.0; + double stabFaultLength = 0.0; + double stabFaultResistance = 0.0; + double stabFaultReactance = 0.0; +}; + class Bus : public Element { public: Bus(); Bus(wxPoint2DDouble position); + Bus(wxPoint2DDouble position, wxString name); ~Bus(); virtual bool AddParent(Element* parent, wxPoint2DDouble position) { return true; } virtual bool Contains(wxPoint2DDouble position) const; @@ -19,7 +42,12 @@ class Bus : public Element virtual void MovePickbox(wxPoint2DDouble position); virtual bool PickboxContains(wxPoint2DDouble position); virtual bool GetContextMenu(wxMenu& menu); - virtual bool ShowForm(wxWindow* parent); + virtual BusElectricalData GetEletricalData() const { return m_electricalData; } + virtual void SetElectricalData(BusElectricalData electricalData) { m_electricalData = electricalData; } + virtual bool ShowForm(wxWindow* parent, Element* element); + + private: + BusElectricalData m_electricalData; }; #endif // BUS_H -- cgit From a9dd78afddeb706df6652eb91f229a74fd073846 Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Fri, 23 Sep 2016 17:46:10 -0300 Subject: Generator form implemented --- Project/Bus.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Project/Bus.h') diff --git a/Project/Bus.h b/Project/Bus.h index 50bfa1a..90068d1 100644 --- a/Project/Bus.h +++ b/Project/Bus.h @@ -46,7 +46,7 @@ class Bus : public Element virtual void SetElectricalData(BusElectricalData electricalData) { m_electricalData = electricalData; } virtual bool ShowForm(wxWindow* parent, Element* element); - private: + protected: BusElectricalData 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/Bus.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'Project/Bus.h') diff --git a/Project/Bus.h b/Project/Bus.h index 90068d1..2776462 100644 --- a/Project/Bus.h +++ b/Project/Bus.h @@ -4,8 +4,7 @@ #include "BusForm.h" #include "Element.h" -struct BusElectricalData -{ +struct BusElectricalData { wxString name = ""; double nominalVoltage = 138.0; ElectricalUnit nominalVoltageUnit = UNIT_kV; @@ -13,11 +12,18 @@ struct BusElectricalData double controlledVoltage = 1.0; int controlledVoltageUnitChoice = 0; // 0 = p.u., 1 = same as nominalVoltageUnit (UNIT_V or UNIT_kV). bool slackBus = false; + + // Power flow (p.u.) + std::complex voltage = std::complex(1.0, 0.0); + + // Fault bool hasFault = false; FaultData faultType = FAULT_THREEPHASE; FaultData faultLocation = FAULT_LINE_A; double faultResistance = 0.0; double faultReactance = 0.0; + + // Stability bool plotBus = false; bool stabHasFault = false; double stabFaultTime = 0.0; @@ -31,7 +37,7 @@ class Bus : public Element public: Bus(); Bus(wxPoint2DDouble position); - Bus(wxPoint2DDouble position, wxString name); + Bus(wxPoint2DDouble position, wxString name); ~Bus(); virtual bool AddParent(Element* parent, wxPoint2DDouble position) { return true; } virtual bool Contains(wxPoint2DDouble position) const; -- 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/Bus.h | 1 + 1 file changed, 1 insertion(+) (limited to 'Project/Bus.h') diff --git a/Project/Bus.h b/Project/Bus.h index 2776462..836d2f7 100644 --- a/Project/Bus.h +++ b/Project/Bus.h @@ -5,6 +5,7 @@ #include "Element.h" struct BusElectricalData { + int number = 0; wxString name = ""; double nominalVoltage = 138.0; ElectricalUnit nominalVoltageUnit = UNIT_kV; -- cgit