diff options
author | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2017-09-04 20:05:30 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-04 20:05:30 -0300 |
commit | 926af7f34aaf5aebdbac0cbc550ed75647874258 (patch) | |
tree | 4df26f8c631aeeeed6e5c9e8aab87c4c663bd30f /Project/PowerElement.h | |
parent | 17d1dd82ec065eff08546ef1fd2a188ce77471b2 (diff) | |
parent | 6f3421c4150e49af026432a2a2be0171d741ad03 (diff) | |
download | PSP.git-926af7f34aaf5aebdbac0cbc550ed75647874258.tar.gz PSP.git-926af7f34aaf5aebdbac0cbc550ed75647874258.tar.xz PSP.git-926af7f34aaf5aebdbac0cbc550ed75647874258.zip |
Merge pull request #33 from Thales1330/wip/electromechanical-calc
Wip electromechanical calc
Diffstat (limited to 'Project/PowerElement.h')
-rw-r--r-- | Project/PowerElement.h | 49 |
1 files changed, 39 insertions, 10 deletions
diff --git a/Project/PowerElement.h b/Project/PowerElement.h index 7399fe8..e1afc7a 100644 --- a/Project/PowerElement.h +++ b/Project/PowerElement.h @@ -2,6 +2,7 @@ #define POWERELEMENT_H #include "Element.h" +#include "ElementPlotData.h" /** * @enum ElectricalUnit @@ -78,6 +79,18 @@ struct SwitchingData { }; /** + * @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 * @date 18/01/2017 @@ -86,7 +99,7 @@ struct SwitchingData { */ class PowerElement : public Element { -public: + public: /** * @brief Constructor */ @@ -102,8 +115,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,36 +158,51 @@ 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: + /** + * @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<std::vector<wxPoint2DDouble> > m_powerFlowArrow; PowerFlowDirection m_pfDirection = PF_NONE; - + OpenGLColour m_busColour; OpenGLColour m_onlineElementColour; OpenGLColour m_offlineElementColour; OpenGLColour m_closedSwitchColour; OpenGLColour m_openedSwitchColour; OpenGLColour m_powerFlowArrowColour; + OpenGLColour m_dynamicEventColour; + + bool m_dynEvent = false; }; -#endif // POWERELEMENT_H +#endif // POWERELEMENT_H |