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/Text.h | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 Project/Text.h (limited to 'Project/Text.h') diff --git a/Project/Text.h b/Project/Text.h new file mode 100644 index 0000000..0ff8d17 --- /dev/null +++ b/Project/Text.h @@ -0,0 +1,39 @@ +#ifndef TEXT_H +#define TEXT_H + +#include "Element.h" +#include "wxGLString.h" + +class wxGLString; +class Bus; +class Line; +class Transformer; +class SyncGenerator; +class IndMotor; +class SyncMotor; +class Load; +class Inductor; +class Capacitor; + +class Text : public Element +{ + public: + Text(); + Text(wxPoint2DDouble position); + ~Text(); + + virtual bool AddParent(Element* parent, wxPoint2DDouble position) { return true; }; + virtual bool Contains(wxPoint2DDouble position) const; + virtual void Draw(wxPoint2DDouble translation, double scale, wxDC& dc); + virtual bool Intersects(wxRect2DDouble rect) const; + virtual wxString GetText() const { return m_text; } + virtual void SetText(wxString text); + +protected: + + wxString m_text = _("Text"); + wxGLString glString; + bool consolidate = true; +}; + +#endif // TEXT_H -- cgit From 22f71caae9771b8279dcfdbd3842b45c4520b782 Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Thu, 24 Nov 2016 17:01:04 -0200 Subject: Text under implementation [2] --- Project/Text.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Project/Text.h') diff --git a/Project/Text.h b/Project/Text.h index 0ff8d17..d54d927 100644 --- a/Project/Text.h +++ b/Project/Text.h @@ -24,16 +24,16 @@ class Text : public Element virtual bool AddParent(Element* parent, wxPoint2DDouble position) { return true; }; virtual bool Contains(wxPoint2DDouble position) const; - virtual void Draw(wxPoint2DDouble translation, double scale, wxDC& dc); + virtual void Draw(wxPoint2DDouble translation, double scale); virtual bool Intersects(wxRect2DDouble rect) const; + virtual void Rotate(bool clockwise = true); virtual wxString GetText() const { return m_text; } virtual void SetText(wxString text); protected: - wxString m_text = _("Text"); - wxGLString glString; - bool consolidate = true; + wxString m_text = _("Barra 1"); + int m_fontSize = 10; }; #endif // TEXT_H -- cgit From 6b9054f1bb28b4ac1b0a7b682204baa0e2643220 Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Tue, 29 Nov 2016 18:27:32 -0200 Subject: Text form under implementation --- Project/Text.h | 66 ++++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 53 insertions(+), 13 deletions(-) (limited to 'Project/Text.h') diff --git a/Project/Text.h b/Project/Text.h index d54d927..24f9228 100644 --- a/Project/Text.h +++ b/Project/Text.h @@ -4,16 +4,34 @@ #include "Element.h" #include "wxGLString.h" -class wxGLString; -class Bus; -class Line; -class Transformer; -class SyncGenerator; -class IndMotor; -class SyncMotor; -class Load; -class Inductor; -class Capacitor; +class TextForm; + +enum ElementType { + TYPE_BUS, + TYPE_CAPACITOR, + TYPE_IND_MOTOR, + TYPE_INDUCTOR, + TYPE_LINE, + TYPE_LOAD, + TYPE_SYNC_GENERATOR, + TYPE_SYNC_MOTOR, + TYPE_TRANSFORMER +}; + +enum DataType { + DATA_NAME, + DATA_VOLTAGE, + DATA_ANGLE, + DATA_SC_CURRENT, + DATA_SC_VOLTAGE, + DATA_SC_POWER, + DATA_ACTIVE_POWER, + DATA_REACTIVE_POWER, + DATA_PF_ACTIVE, + DATA_PF_REACTIVE, + DATA_PF_LOSSES, + DATA_PF_CURRENT +}; class Text : public Element { @@ -27,13 +45,35 @@ class Text : public Element virtual void Draw(wxPoint2DDouble translation, double scale); virtual bool Intersects(wxRect2DDouble rect) const; virtual void Rotate(bool clockwise = true); + virtual bool ShowForm(wxWindow* parent, std::vector elementList); virtual wxString GetText() const { return m_text; } virtual void SetText(wxString text); - -protected: - wxString m_text = _("Barra 1"); + void SetDataType(const DataType& dataType) { m_dataType = dataType; } + void SetDirection(int direction) { m_direction = direction; } + void SetElement(Element* element) { m_element = element; } + void SetElementNumber(int elementNumber) { m_elementNumber = elementNumber; } + void SetElementType(const ElementType elementType) { m_elementType = elementType; } + void SetFontSize(int fontSize) { m_fontSize = fontSize; } + void SetUnit(const ElectricalUnit unit) { m_unit = unit; } + const DataType GetDataType() const { return m_dataType; } + int GetDirection() const { return m_direction; } + Element* GetElement() { return m_element; } + int GetElementNumber() const { return m_elementNumber; } + const ElementType GetElementType() const { return m_elementType; } + int GetFontSize() const { return m_fontSize; } + const ElectricalUnit GetUnit() const { return m_unit; } + + protected: + wxString m_text = _("Text"); int m_fontSize = 10; + + Element* m_element; + ElementType m_elementType; + int m_elementNumber; + DataType m_dataType; + ElectricalUnit m_unit; + int m_direction; }; #endif // TEXT_H -- 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/Text.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'Project/Text.h') diff --git a/Project/Text.h b/Project/Text.h index 24f9228..2b10380 100644 --- a/Project/Text.h +++ b/Project/Text.h @@ -6,6 +6,16 @@ class TextForm; +class Bus; +class Line; +class Transformer; +class SyncGenerator; +class IndMotor; +class SyncMotor; +class Load; +class Inductor; +class Capacitor; + enum ElementType { TYPE_BUS, TYPE_CAPACITOR, @@ -46,6 +56,7 @@ class Text : public Element virtual bool Intersects(wxRect2DDouble rect) const; virtual void Rotate(bool clockwise = true); virtual bool ShowForm(wxWindow* parent, std::vector elementList); + virtual void UpdateText(double systemPowerBase); virtual wxString GetText() const { return m_text; } virtual void SetText(wxString text); @@ -56,6 +67,7 @@ class Text : public Element void SetElementType(const ElementType elementType) { m_elementType = elementType; } void SetFontSize(int fontSize) { m_fontSize = fontSize; } void SetUnit(const ElectricalUnit unit) { m_unit = unit; } + void SetDecimalPlaces(int decimalPlaces) { m_decimalPlaces = decimalPlaces; } const DataType GetDataType() const { return m_dataType; } int GetDirection() const { return m_direction; } Element* GetElement() { return m_element; } @@ -63,17 +75,19 @@ class Text : public Element const ElementType GetElementType() const { return m_elementType; } int GetFontSize() const { return m_fontSize; } const ElectricalUnit GetUnit() const { return m_unit; } + int GetDecimalPlaces() const { return m_decimalPlaces; } protected: wxString m_text = _("Text"); int m_fontSize = 10; - Element* m_element; + Element* m_element = NULL; ElementType m_elementType; int m_elementNumber; DataType m_dataType; ElectricalUnit m_unit; int m_direction; + int m_decimalPlaces; }; #endif // TEXT_H -- cgit