From c91e58bb903adeff1e8c0fff1868e80783010e58 Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Wed, 24 May 2017 17:50:36 -0300 Subject: Dynamic elements initialization implemented --- Project/PowerElement.h | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'Project/PowerElement.h') diff --git a/Project/PowerElement.h b/Project/PowerElement.h index 7399fe8..a5d65b1 100644 --- a/Project/PowerElement.h +++ b/Project/PowerElement.h @@ -77,6 +77,18 @@ struct SwitchingData { std::vector swTime; /**< Time of switching */ }; +/** + * @class IntegrationConstant + * @author Thales Lima Oliveira + * @date 24/05/2017 + * @file PowerElement.h + * @brief Integration constants to calculate dynamic elements through trapezoidal integration method + */ +struct IntegrationConstant { + double c; /**< C value */ + double m; /**< M value */ +}; + /** * @class PowerElement * @author Thales Lima Oliveira @@ -86,7 +98,7 @@ struct SwitchingData { */ class PowerElement : public Element { -public: + public: /** * @brief Constructor */ @@ -102,8 +114,9 @@ public: * @param parentPoint Position of node on parent. * @param secondPoint Next point in element. */ - virtual wxPoint2DDouble - GetSwitchPoint(Element* parent, wxPoint2DDouble parentPoint, wxPoint2DDouble secondPoint) const; + virtual wxPoint2DDouble GetSwitchPoint(Element* parent, + wxPoint2DDouble parentPoint, + wxPoint2DDouble secondPoint) const; /** * @brief Check if switch contains position. @@ -144,30 +157,26 @@ public: * @param data Switching data. */ virtual void SetSwitchingData(SwitchingData data) { m_swData = data; } - /** * @brief Returns the switching data of the element. * @return Element switching data. */ virtual SwitchingData GetSwitchingData() { return m_swData; } - /** * @brief Set the direction of the power flow. * @param pfDirection Power flow direction. */ virtual void SetPowerFlowDirection(PowerFlowDirection pfDirection) { m_pfDirection = pfDirection; } - /** * @brief Return the direction of the power flow. * @return Power flow direction. */ virtual PowerFlowDirection GetPowerFlowDirection() const { return m_pfDirection; } - -protected: + protected: SwitchingData m_swData; std::vector > m_powerFlowArrow; PowerFlowDirection m_pfDirection = PF_NONE; - + OpenGLColour m_busColour; OpenGLColour m_onlineElementColour; OpenGLColour m_offlineElementColour; @@ -176,4 +185,4 @@ protected: OpenGLColour m_powerFlowArrowColour; }; -#endif // POWERELEMENT_H +#endif // POWERELEMENT_H -- cgit From 734476bea0a2b85b131f5a4d2c9e2b219af7be41 Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Fri, 26 May 2017 02:21:15 -0300 Subject: Sync generator plot implemented Electromechanical calc not working --- Project/PowerElement.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Project/PowerElement.h') diff --git a/Project/PowerElement.h b/Project/PowerElement.h index a5d65b1..033d697 100644 --- a/Project/PowerElement.h +++ b/Project/PowerElement.h @@ -2,6 +2,7 @@ #define POWERELEMENT_H #include "Element.h" +#include "ElementPlotData.h" /** * @enum ElectricalUnit @@ -172,6 +173,13 @@ class PowerElement : public Element * @return Power flow direction. */ virtual PowerFlowDirection GetPowerFlowDirection() const { return m_pfDirection; } + + /** + * @brief Fill the plot data. + * @param plotData Plot data to be filled. + * @return true if the plot data was successfully filled, false otherwise. + */ + virtual bool GetPlotData(ElementPlotData& plotData) { return false; } protected: SwitchingData m_swData; std::vector > m_powerFlowArrow; -- cgit From 516cdb72d3ff99a1ee786d3ea24c9b579272fe76 Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Wed, 30 Aug 2017 20:42:27 -0300 Subject: COI (center of inertia) implemented See Milano's book p. 342 --- Project/PowerElement.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'Project/PowerElement.h') diff --git a/Project/PowerElement.h b/Project/PowerElement.h index 033d697..e1afc7a 100644 --- a/Project/PowerElement.h +++ b/Project/PowerElement.h @@ -173,13 +173,22 @@ class PowerElement : public Element * @return Power flow direction. */ virtual PowerFlowDirection GetPowerFlowDirection() const { return m_pfDirection; } - /** * @brief Fill the plot data. * @param plotData Plot data to be filled. * @return true if the plot data was successfully filled, false otherwise. */ virtual bool GetPlotData(ElementPlotData& plotData) { return false; } + /** + * @brief Check if the power element have dynamic event. + * @return true if the element have dynamic an event, false otherwise. + */ + virtual bool HaveDynamicEvent() const { return m_dynEvent; } + /** + * @brief Set if the power element have dynamic event. + * @param dynEvent Event occurrence. + */ + virtual void SetDynamicEvent(bool dynEvent = true) { m_dynEvent = dynEvent; } protected: SwitchingData m_swData; std::vector > m_powerFlowArrow; @@ -191,6 +200,9 @@ class PowerElement : public Element OpenGLColour m_closedSwitchColour; OpenGLColour m_openedSwitchColour; OpenGLColour m_powerFlowArrowColour; + OpenGLColour m_dynamicEventColour; + + bool m_dynEvent = false; }; #endif // POWERELEMENT_H -- cgit