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/Element.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Project/Element.h') diff --git a/Project/Element.h b/Project/Element.h index eb89640..0b2d4be 100644 --- a/Project/Element.h +++ b/Project/Element.h @@ -24,8 +24,8 @@ enum ContextMenuID ID_LINE_ADD_NODE, ID_LINE_REMOVE_NODE, - - ID_ROTATE + + ID_ROTATE }; class Element @@ -68,11 +68,14 @@ class Element virtual void StartMove(wxPoint2DDouble position); virtual void Move(wxPoint2DDouble position); virtual void MoveNode(Element* parent, wxPoint2DDouble position){}; + virtual bool NodeContains(wxPoint2DDouble position) { return false; }; + virtual bool SetNodeParent(Element* parent) { return false; }; virtual void RotateNode(Element* parent) {} virtual wxPoint2DDouble GetSwitchPoint(Element* parent, wxPoint2DDouble parentPoint, wxPoint2DDouble secondPoint) const; virtual void ResetPickboxes() { m_activePickboxID = ID_PB_NONE; } + virtual void ResetNodes() { m_activeNodeID= 0; } virtual wxPoint2DDouble WorldToScreen(wxPoint2DDouble translation, double scale, double offsetX = 0.0, @@ -108,6 +111,7 @@ class Element bool m_showPickbox = false; int m_activePickboxID = ID_PB_NONE; + int m_activeNodeID = 0; wxPoint2DDouble m_moveStartPt; wxPoint2DDouble m_movePos; -- 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/Element.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Project/Element.h') diff --git a/Project/Element.h b/Project/Element.h index 0b2d4be..bccd993 100644 --- a/Project/Element.h +++ b/Project/Element.h @@ -67,9 +67,10 @@ class Element virtual void AddPoint(wxPoint2DDouble point) {} virtual void StartMove(wxPoint2DDouble position); virtual void Move(wxPoint2DDouble position); - virtual void MoveNode(Element* parent, wxPoint2DDouble position){}; - virtual bool NodeContains(wxPoint2DDouble position) { return false; }; - virtual bool SetNodeParent(Element* parent) { return false; }; + virtual void MoveNode(Element* parent, wxPoint2DDouble position){} + virtual bool NodeContains(wxPoint2DDouble position) { return false; } + virtual void UpdateNodes() {} + virtual bool SetNodeParent(Element* parent) { return false; } virtual void RotateNode(Element* parent) {} virtual wxPoint2DDouble GetSwitchPoint(Element* parent, wxPoint2DDouble parentPoint, -- 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/Element.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Project/Element.h') diff --git a/Project/Element.h b/Project/Element.h index bccd993..ec7496a 100644 --- a/Project/Element.h +++ b/Project/Element.h @@ -25,7 +25,8 @@ enum ContextMenuID ID_LINE_ADD_NODE, ID_LINE_REMOVE_NODE, - ID_ROTATE + ID_ROTATE, + ID_DELETE }; class Element @@ -71,6 +72,7 @@ class Element virtual bool NodeContains(wxPoint2DDouble position) { return false; } virtual void UpdateNodes() {} virtual bool SetNodeParent(Element* parent) { return false; } + virtual void RemoveParent(Element* parent) {} virtual void RotateNode(Element* parent) {} virtual wxPoint2DDouble GetSwitchPoint(Element* parent, wxPoint2DDouble parentPoint, -- cgit From c478afa9fbef4b21ea85dbc266169b9eebf369a9 Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Tue, 30 Aug 2016 17:30:54 -0300 Subject: Transformer --- Project/Element.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Project/Element.h') diff --git a/Project/Element.h b/Project/Element.h index ec7496a..e4f2116 100644 --- a/Project/Element.h +++ b/Project/Element.h @@ -59,9 +59,6 @@ class Element virtual void Rotate() = 0; virtual bool Contains(wxPoint2DDouble position) const = 0; virtual bool Intersects(wxRect2DDouble rect) const = 0; - virtual bool PickboxContains(wxPoint2DDouble position) = 0; - virtual void MovePickbox(wxPoint2DDouble position) = 0; - virtual wxCursor GetBestPickboxCursor() const = 0; // General methods virtual bool GetContextMenu(wxMenu& menu) { return false; } @@ -77,6 +74,9 @@ class Element virtual wxPoint2DDouble GetSwitchPoint(Element* parent, wxPoint2DDouble parentPoint, wxPoint2DDouble secondPoint) const; + virtual bool PickboxContains(wxPoint2DDouble position) { return false;} + virtual void MovePickbox(wxPoint2DDouble position) {} + virtual wxCursor GetBestPickboxCursor() const {return wxCURSOR_ARROW;} virtual void ResetPickboxes() { m_activePickboxID = ID_PB_NONE; } virtual void ResetNodes() { m_activeNodeID= 0; } virtual wxPoint2DDouble WorldToScreen(wxPoint2DDouble translation, -- 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/Element.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Project/Element.h') diff --git a/Project/Element.h b/Project/Element.h index e4f2116..5b7c09d 100644 --- a/Project/Element.h +++ b/Project/Element.h @@ -21,6 +21,7 @@ enum ContextMenuID { ID_EDIT_BUS = 0, ID_EDIT_LINE, + ID_EDIT_TRANSFORMER, ID_LINE_ADD_NODE, ID_LINE_REMOVE_NODE, @@ -88,9 +89,11 @@ class Element double scale, double offsetX = 0.0, double offsetY = 0.0) const; + virtual bool RotatedRectanglesIntersects(wxRect2DDouble rect1, wxRect2DDouble rect2, double angle1, double angle2) const; virtual void DrawCircle(wxPoint2DDouble position, double radius, int numSegments, GLenum mode = GL_LINE_LOOP) const; virtual void DrawRectangle(wxPoint2DDouble position, double width, double height, GLenum mode = GL_QUADS) const; virtual void DrawRectangle(wxPoint2DDouble* points, GLenum mode = GL_QUADS) const; + virtual void DrawPoint(wxPoint2DDouble position, double size) const; virtual void DrawLine(std::vector points, GLenum mode = GL_LINE_STRIP) const; virtual void DrawPickbox(wxPoint2DDouble position) const; virtual wxPoint2DDouble RotateAtPosition(wxPoint2DDouble pointToRotate, double angle, bool degrees = true) const; -- cgit From b817a3f0e398c7e938ed1a37ebdbfc5a03eb7471 Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Thu, 1 Sep 2016 18:23:35 -0300 Subject: generator under implementation --- Project/Element.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Project/Element.h') diff --git a/Project/Element.h b/Project/Element.h index 5b7c09d..4dc278f 100644 --- a/Project/Element.h +++ b/Project/Element.h @@ -22,6 +22,7 @@ enum ContextMenuID ID_EDIT_BUS = 0, ID_EDIT_LINE, ID_EDIT_TRANSFORMER, + ID_EDIT_GENERATOR, ID_LINE_ADD_NODE, ID_LINE_REMOVE_NODE, @@ -57,11 +58,11 @@ class Element // Pure-virtuals methods virtual bool AddParent(Element* parent, wxPoint2DDouble position) = 0; virtual void Draw(wxPoint2DDouble translation, double scale) const = 0; - virtual void Rotate() = 0; virtual bool Contains(wxPoint2DDouble position) const = 0; virtual bool Intersects(wxRect2DDouble rect) const = 0; // General methods + virtual void Rotate() {} virtual bool GetContextMenu(wxMenu& menu) { return false; } virtual void AddPoint(wxPoint2DDouble point) {} virtual void StartMove(wxPoint2DDouble position); -- 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/Element.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Project/Element.h') diff --git a/Project/Element.h b/Project/Element.h index 4dc278f..7eb90c9 100644 --- a/Project/Element.h +++ b/Project/Element.h @@ -22,7 +22,8 @@ enum ContextMenuID ID_EDIT_BUS = 0, ID_EDIT_LINE, ID_EDIT_TRANSFORMER, - ID_EDIT_GENERATOR, + ID_EDIT_SYNCGENERATOR, + ID_EDIT_INDMOTOR, ID_LINE_ADD_NODE, ID_LINE_REMOVE_NODE, -- cgit From 726686c9b378f3a727ded52226b13a760cba1e6c Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Sat, 3 Sep 2016 17:09:24 -0300 Subject: Inductor under implementation Ind motor, sync condenser and load implemented --- Project/Element.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Project/Element.h') diff --git a/Project/Element.h b/Project/Element.h index 7eb90c9..d15fc57 100644 --- a/Project/Element.h +++ b/Project/Element.h @@ -24,6 +24,8 @@ enum ContextMenuID ID_EDIT_TRANSFORMER, ID_EDIT_SYNCGENERATOR, ID_EDIT_INDMOTOR, + ID_EDIT_SYNCMOTOR, + ID_EDIT_LOAD, ID_LINE_ADD_NODE, ID_LINE_REMOVE_NODE, @@ -93,8 +95,10 @@ class Element double offsetY = 0.0) const; virtual bool RotatedRectanglesIntersects(wxRect2DDouble rect1, wxRect2DDouble rect2, double angle1, double angle2) const; virtual void DrawCircle(wxPoint2DDouble position, double radius, int numSegments, GLenum mode = GL_LINE_LOOP) const; + virtual void DrawArc(wxPoint2DDouble position, double radius, double initAngle, double finalAngle, int numSegments, GLenum mode = GL_LINE_LOOP) const; virtual void DrawRectangle(wxPoint2DDouble position, double width, double height, GLenum mode = GL_QUADS) const; virtual void DrawRectangle(wxPoint2DDouble* points, GLenum mode = GL_QUADS) const; + virtual void DrawTriangle(std::vector points, GLenum mode = GL_TRIANGLES) const; virtual void DrawPoint(wxPoint2DDouble position, double size) const; virtual void DrawLine(std::vector points, GLenum mode = GL_LINE_STRIP) const; virtual void DrawPickbox(wxPoint2DDouble position) const; -- cgit From c1aad656847602f7e4c7aead048f7465a76838d4 Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Sun, 4 Sep 2016 00:59:41 -0300 Subject: Inductor implemented --- Project/Element.h | 1 + 1 file changed, 1 insertion(+) (limited to 'Project/Element.h') diff --git a/Project/Element.h b/Project/Element.h index d15fc57..1a6b73e 100644 --- a/Project/Element.h +++ b/Project/Element.h @@ -26,6 +26,7 @@ enum ContextMenuID ID_EDIT_INDMOTOR, ID_EDIT_SYNCMOTOR, ID_EDIT_LOAD, + ID_EDIT_INDUCTOR, ID_LINE_ADD_NODE, ID_LINE_REMOVE_NODE, -- cgit From d93ef357da510f2515556ff2cb51688a4e068805 Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Mon, 5 Sep 2016 18:43:50 -0300 Subject: All elements implemented, switches implemented --- Project/Element.h | 62 ++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 43 insertions(+), 19 deletions(-) (limited to 'Project/Element.h') diff --git a/Project/Element.h b/Project/Element.h index 1a6b73e..6c07ec9 100644 --- a/Project/Element.h +++ b/Project/Element.h @@ -21,18 +21,19 @@ enum ContextMenuID { ID_EDIT_BUS = 0, ID_EDIT_LINE, - ID_EDIT_TRANSFORMER, - ID_EDIT_SYNCGENERATOR, - ID_EDIT_INDMOTOR, - ID_EDIT_SYNCMOTOR, - ID_EDIT_LOAD, - ID_EDIT_INDUCTOR, + ID_EDIT_TRANSFORMER, + ID_EDIT_SYNCGENERATOR, + ID_EDIT_INDMOTOR, + ID_EDIT_SYNCMOTOR, + ID_EDIT_LOAD, + ID_EDIT_INDUCTOR, + ID_EDIT_CAPACITOR, ID_LINE_ADD_NODE, ID_LINE_REMOVE_NODE, ID_ROTATE, - ID_DELETE + ID_DELETE }; class Element @@ -50,6 +51,7 @@ class Element void SetAngle(double angle) { this->m_angle = angle; } void ShowPickbox(bool showPickbox = true) { this->m_showPickbox = showPickbox; } void SetBorderSize(double borderSize) { this->m_borderSize = borderSize; } + void SetOnline(bool online = true); // Getters wxRect2DDouble GetRect() const { return m_rect; } wxPoint2DDouble GetPosition() const { return m_position; } @@ -59,6 +61,7 @@ class Element double GetWidth() const { return m_width; } double GetAngle() const { return m_angle; } bool IsPickboxShown() const { return m_showPickbox; } + bool IsOnline() const { return m_online; } // Pure-virtuals methods virtual bool AddParent(Element* parent, wxPoint2DDouble position) = 0; virtual void Draw(wxPoint2DDouble translation, double scale) const = 0; @@ -66,25 +69,29 @@ class Element virtual bool Intersects(wxRect2DDouble rect) const = 0; // General methods - virtual void Rotate() {} + virtual void Rotate() {} virtual bool GetContextMenu(wxMenu& menu) { return false; } virtual void AddPoint(wxPoint2DDouble point) {} virtual void StartMove(wxPoint2DDouble position); virtual void Move(wxPoint2DDouble position); - virtual void MoveNode(Element* parent, wxPoint2DDouble position){} + virtual void MoveNode(Element* parent, wxPoint2DDouble position) {} virtual bool NodeContains(wxPoint2DDouble position) { return false; } - virtual void UpdateNodes() {} - virtual bool SetNodeParent(Element* parent) { return false; } - virtual void RemoveParent(Element* parent) {} + virtual void UpdateNodes() {} + virtual bool SetNodeParent(Element* parent) { return false; } + virtual void RemoveParent(Element* parent) {} virtual void RotateNode(Element* parent) {} virtual wxPoint2DDouble GetSwitchPoint(Element* parent, wxPoint2DDouble parentPoint, wxPoint2DDouble secondPoint) const; - virtual bool PickboxContains(wxPoint2DDouble position) { return false;} + virtual bool SwitchesContains(wxPoint2DDouble position) const; + virtual void UpdateSwitches(); + virtual void DrawSwitches() const; + + virtual bool PickboxContains(wxPoint2DDouble position) { return false; } virtual void MovePickbox(wxPoint2DDouble position) {} - virtual wxCursor GetBestPickboxCursor() const {return wxCURSOR_ARROW;} + virtual wxCursor GetBestPickboxCursor() const { return wxCURSOR_ARROW; } virtual void ResetPickboxes() { m_activePickboxID = ID_PB_NONE; } - virtual void ResetNodes() { m_activeNodeID= 0; } + virtual void ResetNodes() { m_activeNodeID = 0; } virtual wxPoint2DDouble WorldToScreen(wxPoint2DDouble translation, double scale, double offsetX = 0.0, @@ -94,13 +101,22 @@ class Element double scale, double offsetX = 0.0, double offsetY = 0.0) const; - virtual bool RotatedRectanglesIntersects(wxRect2DDouble rect1, wxRect2DDouble rect2, double angle1, double angle2) const; + virtual bool RotatedRectanglesIntersects(wxRect2DDouble rect1, + wxRect2DDouble rect2, + double angle1, + double angle2) const; + virtual void DrawCircle(wxPoint2DDouble position, double radius, int numSegments, GLenum mode = GL_LINE_LOOP) const; - virtual void DrawArc(wxPoint2DDouble position, double radius, double initAngle, double finalAngle, int numSegments, GLenum mode = GL_LINE_LOOP) const; + virtual void DrawArc(wxPoint2DDouble position, + double radius, + double initAngle, + double finalAngle, + int numSegments, + GLenum mode = GL_LINE_LOOP) const; virtual void DrawRectangle(wxPoint2DDouble position, double width, double height, GLenum mode = GL_QUADS) const; virtual void DrawRectangle(wxPoint2DDouble* points, GLenum mode = GL_QUADS) const; - virtual void DrawTriangle(std::vector points, GLenum mode = GL_TRIANGLES) const; - virtual void DrawPoint(wxPoint2DDouble position, double size) const; + virtual void DrawTriangle(std::vector points, GLenum mode = GL_TRIANGLES) const; + virtual void DrawPoint(wxPoint2DDouble position, double size) const; virtual void DrawLine(std::vector points, GLenum mode = GL_LINE_STRIP) const; virtual void DrawPickbox(wxPoint2DDouble position) const; virtual wxPoint2DDouble RotateAtPosition(wxPoint2DDouble pointToRotate, double angle, bool degrees = true) const; @@ -118,6 +134,9 @@ class Element double m_angle = 0.0; double m_borderSize = 2.0; double m_rotationAngle = 45.0; + double m_switchSize = 10.0; + + std::vector m_switchRect; bool m_selected = false; bool m_dragging = false; @@ -126,8 +145,13 @@ class Element int m_activePickboxID = ID_PB_NONE; int m_activeNodeID = 0; + std::vector m_pointList; + std::vector m_movePts; + wxPoint2DDouble m_moveStartPt; wxPoint2DDouble m_movePos; + + bool m_online = true; }; #endif // ELEMENT_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/Element.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'Project/Element.h') diff --git a/Project/Element.h b/Project/Element.h index 6c07ec9..688a4e3 100644 --- a/Project/Element.h +++ b/Project/Element.h @@ -32,7 +32,8 @@ enum ContextMenuID ID_LINE_ADD_NODE, ID_LINE_REMOVE_NODE, - ID_ROTATE, + ID_ROTATE_CLOCK, + ID_ROTATE_COUNTERCLOCK, ID_DELETE }; @@ -69,7 +70,7 @@ class Element virtual bool Intersects(wxRect2DDouble rect) const = 0; // General methods - virtual void Rotate() {} + virtual void Rotate(bool clockwise = true) {} virtual bool GetContextMenu(wxMenu& menu) { return false; } virtual void AddPoint(wxPoint2DDouble point) {} virtual void StartMove(wxPoint2DDouble position); @@ -79,7 +80,7 @@ class Element virtual void UpdateNodes() {} virtual bool SetNodeParent(Element* parent) { return false; } virtual void RemoveParent(Element* parent) {} - virtual void RotateNode(Element* parent) {} + virtual void RotateNode(Element* parent, bool clockwise = true) {} virtual wxPoint2DDouble GetSwitchPoint(Element* parent, wxPoint2DDouble parentPoint, wxPoint2DDouble secondPoint) const; @@ -124,6 +125,8 @@ class Element virtual std::vector GetParentList() const { return m_parentList; } virtual wxPoint2DDouble GetMoveStartPosition() const { return m_moveStartPt; } virtual wxPoint2DDouble GetMovePosition() const { return m_movePos; } + + virtual void GeneralMenuItens(wxMenu& menu); protected: std::vector m_parentList; -- 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/Element.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Project/Element.h') diff --git a/Project/Element.h b/Project/Element.h index 688a4e3..4033b20 100644 --- a/Project/Element.h +++ b/Project/Element.h @@ -126,6 +126,8 @@ class Element virtual wxPoint2DDouble GetMoveStartPosition() const { return m_moveStartPt; } virtual wxPoint2DDouble GetMovePosition() const { return m_movePos; } + virtual void CalculateBoundaries(wxPoint2DDouble& leftUp, wxPoint2DDouble& rightBottom) const; + virtual void GeneralMenuItens(wxMenu& menu); protected: std::vector m_parentList; -- 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/Element.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Project/Element.h') diff --git a/Project/Element.h b/Project/Element.h index 4033b20..94d5cd7 100644 --- a/Project/Element.h +++ b/Project/Element.h @@ -129,6 +129,8 @@ class Element virtual void CalculateBoundaries(wxPoint2DDouble& leftUp, wxPoint2DDouble& rightBottom) const; virtual void GeneralMenuItens(wxMenu& menu); + + virtual bool ShowForm(wxWindow* parent) { return false; } protected: std::vector m_parentList; -- 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/Element.h | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) (limited to 'Project/Element.h') diff --git a/Project/Element.h b/Project/Element.h index 94d5cd7..899fb01 100644 --- a/Project/Element.h +++ b/Project/Element.h @@ -1,6 +1,7 @@ #ifndef ELEMENT_H #define ELEMENT_H +#include #include #include #include @@ -37,6 +38,35 @@ enum ContextMenuID ID_DELETE }; +enum ElectricalUnit +{ + UNIT_PU = 0, + UNIT_V, + UNIT_kV, + UNIT_A, + UNIT_kA, + UNIT_W, + UNIT_kW, + UNIT_MW, + UNIT_VA, + UNIT_kVA, + UNIT_MVA, + UNIT_VAr, + UNIT_kVAr, + UNIT_MVAr +}; + +enum FaultData +{ + FAULT_THREEPHASE = 0, + FAULT_2LINE, + FAULT_2LINE_GROUND, + FAULT_LINE_GROUND, + FAULT_LINE_A, + FAULT_LINE_B, + FAULT_LINE_C +}; + class Element { public: @@ -130,7 +160,11 @@ class Element virtual void GeneralMenuItens(wxMenu& menu); - virtual bool ShowForm(wxWindow* parent) { return false; } + virtual bool ShowForm(wxWindow* parent, Element* element) { return false; } + + bool DoubleFromString(wxWindow* parent, wxString strValue, double& value, wxString errorMsg); + bool IntFromString(wxWindow* parent, wxString strValue, int& value, wxString errorMsg); + protected: std::vector m_parentList; -- 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/Element.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Project/Element.h') diff --git a/Project/Element.h b/Project/Element.h index 899fb01..dff68f7 100644 --- a/Project/Element.h +++ b/Project/Element.h @@ -53,7 +53,11 @@ enum ElectricalUnit UNIT_MVA, UNIT_VAr, UNIT_kVAr, - UNIT_MVAr + UNIT_MVAr, + UNIT_OHM, + UNIT_OHM_km, + UNIT_S, + UNIT_S_km }; enum FaultData -- 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/Element.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Project/Element.h') diff --git a/Project/Element.h b/Project/Element.h index dff68f7..b1a7163 100644 --- a/Project/Element.h +++ b/Project/Element.h @@ -169,6 +169,8 @@ class Element bool DoubleFromString(wxWindow* parent, wxString strValue, double& value, wxString errorMsg); bool IntFromString(wxWindow* parent, wxString strValue, int& value, wxString errorMsg); + virtual void + protected: std::vector m_parentList; -- 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/Element.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Project/Element.h') diff --git a/Project/Element.h b/Project/Element.h index b1a7163..c1d887f 100644 --- a/Project/Element.h +++ b/Project/Element.h @@ -169,7 +169,7 @@ class Element bool DoubleFromString(wxWindow* parent, wxString strValue, double& value, wxString errorMsg); bool IntFromString(wxWindow* parent, wxString strValue, int& value, wxString errorMsg); - virtual void + virtual void SetNominalVoltage(double nominalVoltage, ElectricalUnit nominalVoltageUnit) {} protected: std::vector m_parentList; -- 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/Element.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'Project/Element.h') diff --git a/Project/Element.h b/Project/Element.h index c1d887f..0806947 100644 --- a/Project/Element.h +++ b/Project/Element.h @@ -71,6 +71,18 @@ enum FaultData FAULT_LINE_C }; +enum SwitchingType +{ + SW_INSERT = 0, + SW_REMOVE +}; + +struct SwitchingData +{ + std::vector swType; + std::vector swTime; +}; + class Element { public: @@ -169,7 +181,10 @@ class Element bool DoubleFromString(wxWindow* parent, wxString strValue, double& value, wxString errorMsg); bool IntFromString(wxWindow* parent, wxString strValue, int& value, wxString errorMsg); + //Electrical only methods virtual void SetNominalVoltage(double nominalVoltage, ElectricalUnit nominalVoltageUnit) {} + virtual void SetSwitchingData(SwitchingData data) { m_swData = data; } + virtual SwitchingData GetSwitchingData() { return m_swData; } protected: std::vector m_parentList; @@ -199,6 +214,8 @@ class Element wxPoint2DDouble m_movePos; bool m_online = true; + + SwitchingData m_swData; }; #endif // ELEMENT_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/Element.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Project/Element.h') diff --git a/Project/Element.h b/Project/Element.h index 0806947..17a8902 100644 --- a/Project/Element.h +++ b/Project/Element.h @@ -81,7 +81,7 @@ struct SwitchingData { std::vector swType; std::vector swTime; -}; +}; class Element { @@ -182,7 +182,7 @@ class Element bool IntFromString(wxWindow* parent, wxString strValue, int& value, wxString errorMsg); //Electrical only methods - virtual void SetNominalVoltage(double nominalVoltage, ElectricalUnit nominalVoltageUnit) {} + virtual void SetNominalVoltage(std::vector nominalVoltage, std::vector nominalVoltageUnit) {} virtual void SetSwitchingData(SwitchingData data) { m_swData = data; } virtual SwitchingData GetSwitchingData() { return m_swData; } -- 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/Element.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Project/Element.h') diff --git a/Project/Element.h b/Project/Element.h index 17a8902..51cb588 100644 --- a/Project/Element.h +++ b/Project/Element.h @@ -7,6 +7,8 @@ #include #include +#include + enum PickboxID { ID_PB_NONE = 0, @@ -185,6 +187,9 @@ class Element virtual void SetNominalVoltage(std::vector nominalVoltage, std::vector nominalVoltageUnit) {} virtual void SetSwitchingData(SwitchingData data) { m_swData = data; } virtual SwitchingData GetSwitchingData() { return m_swData; } + + //Static methods + static wxString StringFromDouble(double value, int minDecimal = 1); protected: std::vector m_parentList; -- 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/Element.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Project/Element.h') diff --git a/Project/Element.h b/Project/Element.h index 51cb588..ec18ccd 100644 --- a/Project/Element.h +++ b/Project/Element.h @@ -7,6 +7,8 @@ #include #include +#include + #include enum PickboxID @@ -135,6 +137,9 @@ class Element virtual bool SwitchesContains(wxPoint2DDouble position) const; virtual void UpdateSwitches(); virtual void DrawSwitches() const; + + virtual void CalculatePowerFlowPts(std::vector edges); + virtual void DrawPowerFlowPts() const; virtual bool PickboxContains(wxPoint2DDouble position) { return false; } virtual void MovePickbox(wxPoint2DDouble position) {} @@ -204,6 +209,7 @@ class Element double m_switchSize = 10.0; std::vector m_switchRect; + std::vector< std::vector > m_powerFlowArrow; bool m_selected = false; bool m_dragging = false; -- 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/Element.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'Project/Element.h') diff --git a/Project/Element.h b/Project/Element.h index ec18ccd..672723f 100644 --- a/Project/Element.h +++ b/Project/Element.h @@ -81,6 +81,15 @@ enum SwitchingType SW_REMOVE }; +enum PowerFlowDirection +{ + PF_NONE = 0, + PF_TO_BUS, + PF_TO_ELEMENT, + PF_BUS1_TO_BUS2, + PF_BUS2_TO_BUS1 +}; + struct SwitchingData { std::vector swType; @@ -192,6 +201,8 @@ class Element virtual void SetNominalVoltage(std::vector nominalVoltage, std::vector nominalVoltageUnit) {} virtual void SetSwitchingData(SwitchingData data) { m_swData = data; } virtual SwitchingData GetSwitchingData() { return m_swData; } + virtual void SetPowerFlowDirection(PowerFlowDirection pfDirection) { m_pfDirection = pfDirection; } + virtual PowerFlowDirection GetPowerFlowDirection() const { return m_pfDirection; } //Static methods static wxString StringFromDouble(double value, int minDecimal = 1); @@ -209,7 +220,9 @@ class Element double m_switchSize = 10.0; std::vector m_switchRect; + std::vector< std::vector > m_powerFlowArrow; + PowerFlowDirection m_pfDirection = PF_NONE; bool m_selected = false; bool m_dragging = false; -- cgit From 8e79aff80e56adbdcfd6a9be5a873c6bb4b1020a Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Wed, 23 Nov 2016 17:08:20 -0200 Subject: Text under implementation --- Project/Element.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Project/Element.h') diff --git a/Project/Element.h b/Project/Element.h index 672723f..f872267 100644 --- a/Project/Element.h +++ b/Project/Element.h @@ -124,11 +124,11 @@ class Element bool IsOnline() const { return m_online; } // Pure-virtuals methods virtual bool AddParent(Element* parent, wxPoint2DDouble position) = 0; - virtual void Draw(wxPoint2DDouble translation, double scale) const = 0; virtual bool Contains(wxPoint2DDouble position) const = 0; virtual bool Intersects(wxRect2DDouble rect) const = 0; // General methods + virtual void Draw(wxPoint2DDouble translation, double scale) const {}; virtual void Rotate(bool clockwise = true) {} virtual bool GetContextMenu(wxMenu& menu) { return false; } virtual void AddPoint(wxPoint2DDouble point) {} -- cgit From e266f5811403beea13c9cc5399c55db4a34fdd3c Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Thu, 1 Dec 2016 16:57:41 -0200 Subject: Text Form under implementation [3] --- Project/Element.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Project/Element.h') diff --git a/Project/Element.h b/Project/Element.h index f872267..0502e62 100644 --- a/Project/Element.h +++ b/Project/Element.h @@ -61,7 +61,9 @@ enum ElectricalUnit UNIT_OHM, UNIT_OHM_km, UNIT_S, - UNIT_S_km + UNIT_S_km, + UNIT_DEGREE, + UNIT_RADIAN }; enum FaultData -- cgit