From ee58faacaaaf83293ead87696847b018f9a1281d Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Wed, 26 Apr 2017 19:51:45 -0300 Subject: Element plot data class implemented --- Project/ElementPlotData.h | 82 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 Project/ElementPlotData.h (limited to 'Project/ElementPlotData.h') diff --git a/Project/ElementPlotData.h b/Project/ElementPlotData.h new file mode 100644 index 0000000..64bc03e --- /dev/null +++ b/Project/ElementPlotData.h @@ -0,0 +1,82 @@ +#ifndef ELEMENTPLOTDATA_H +#define ELEMENTPLOTDATA_H + +#include +#include +#include + +#include + +class PlotData : public wxTreeItemData +{ + public: + PlotData() {} + ~PlotData() {} + void SetAxis(int axis) { m_axis = axis; } + void SetColour(const wxColour& colour) { m_colour = colour; } + void SetName(const wxString& name) { m_name = name; } + void SetPenType(const wxPenStyle& penType) { m_penType = penType; } + void SetPlot(bool plot) { m_plot = plot; } + void SetThick(int thick) { m_thick = thick; } + void SetValues(const std::vector& values) { m_values = values; } + int GetAxis() const { return m_axis; } + wxColour GetColour() const { return m_colour; } + wxString GetName() const { return m_name; } + wxPenStyle GetPenType() const { return m_penType; } + bool IsPlot() const { return m_plot; } + int GetThick() const { return m_thick; } + std::vector GetValues() const { return m_values; } + protected: + std::vector m_values; + wxString m_name; + bool m_plot; + wxColour m_colour; + int m_thick; + wxPenStyle m_penType; + int m_axis; +}; + +class ElementPlotData +{ + public: + enum CurveType { + CT_TIME = 0, + CT_BUS, + CT_SYNC_GENERATOR, + CT_SYNC_COMPENSATOR, + CT_TRANSFORMER, + CT_LINE, + CT_IND_MOTOR, + CT_SHUNT_REACTOR, + CT_SHUNT_CAPACITOR, + CT_LOAD, + }; + ElementPlotData(wxString name, CurveType type); + ~ElementPlotData(); + + wxString GetName() const { return m_name; } + void SetName(wxString name) { m_name = name; } + CurveType GetCurveType() const { return m_curveType; } + PlotData* GetPlotData(int index) const { return m_elementData[index]; } + void AddData(std::vector values, wxString name); + + int GetElementDataNumber() const { return static_cast(m_elementData.size()); } + std::vector GetValues(int index) const { return m_elementData[index]->GetValues(); } + void SetValues(int index, std::vector values) { m_elementData[index]->SetValues(values); } + wxString GetDataName(int index) const { return m_elementData[index]->GetName(); } + void SetDataName(int index, wxString name) { m_elementData[index]->SetName(name); } + wxColour GetColour(int index) const { return m_elementData[index]->GetColour(); } + void SetColour(int index, wxColour colour) { m_elementData[index]->SetColour(colour); } + int GetThick(int index) const { return m_elementData[index]->GetThick(); } + void SetThick(int index, int thick) { m_elementData[index]->SetThick(thick); } + wxPenStyle GetPenType(int index) const { return m_elementData[index]->GetPenType(); } + void SetPenType(int index, wxPenStyle penType) { m_elementData[index]->SetPenType(penType); } + int GetAxis(int index) const { return m_elementData[index]->GetAxis(); } + void SetAxis(int index, int axis) { m_elementData[index]->SetAxis(axis); } + protected: + wxString m_name; + CurveType m_curveType; + std::vector m_elementData; +}; + +#endif // ELEMENTPLOTDATA_H -- cgit From 50f31898499d1d1e1ebc8ab9c9c26d3b4ec1b3c1 Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Thu, 27 Apr 2017 20:38:55 -0300 Subject: More methods implemented buggy --- Project/ElementPlotData.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'Project/ElementPlotData.h') diff --git a/Project/ElementPlotData.h b/Project/ElementPlotData.h index 64bc03e..1434664 100644 --- a/Project/ElementPlotData.h +++ b/Project/ElementPlotData.h @@ -40,18 +40,20 @@ class ElementPlotData { public: enum CurveType { - CT_TIME = 0, - CT_BUS, + CT_BUS = 0, CT_SYNC_GENERATOR, CT_SYNC_COMPENSATOR, CT_TRANSFORMER, CT_LINE, CT_IND_MOTOR, - CT_SHUNT_REACTOR, + CT_SHUNT_INDUCTOR, CT_SHUNT_CAPACITOR, CT_LOAD, + NUM_ELEMENTS, + CT_TIME }; - ElementPlotData(wxString name, CurveType type); + ElementPlotData() {}; + ElementPlotData(wxString name, CurveType curveType); ~ElementPlotData(); wxString GetName() const { return m_name; } -- cgit