summaryrefslogtreecommitdiffstats
path: root/Project/ControlElement.h
diff options
context:
space:
mode:
authorThales Lima Oliveira <thaleslima.ufu@gmail.com>2017-05-13 16:15:22 -0300
committerGitHub <noreply@github.com>2017-05-13 16:15:22 -0300
commit17d1dd82ec065eff08546ef1fd2a188ce77471b2 (patch)
tree811c788656f71692ccb0b038215dab7a87c2c0dc /Project/ControlElement.h
parentfe4776d88169c048e06c142d81bfd42651c63d1d (diff)
parentd44c3a76943c90cfcbf336961d9ba3516a1c80dc (diff)
downloadPSP.git-17d1dd82ec065eff08546ef1fd2a188ce77471b2.tar.gz
PSP.git-17d1dd82ec065eff08546ef1fd2a188ce77471b2.tar.xz
PSP.git-17d1dd82ec065eff08546ef1fd2a188ce77471b2.zip
Merge pull request #32 from Thales1330/wip/controller-solver
Wip controller solver
Diffstat (limited to 'Project/ControlElement.h')
-rw-r--r--Project/ControlElement.h32
1 files changed, 16 insertions, 16 deletions
diff --git a/Project/ControlElement.h b/Project/ControlElement.h
index 1cf4e0b..1e60f97 100644
--- a/Project/ControlElement.h
+++ b/Project/ControlElement.h
@@ -5,7 +5,7 @@
class Node
{
-public:
+ public:
enum NodeType { NODE_IN = 0, NODE_OUT };
Node(wxPoint2DDouble position = wxPoint2DDouble(0, 0), NodeType nodeType = NODE_IN, double borderSize = 0.0);
@@ -13,39 +13,33 @@ public:
wxRect2DDouble GetRect() const { return m_rect; }
void SetRect(wxRect2DDouble rect) { m_rect = rect; }
-
wxPoint2DDouble GetPosition() const;
void SetPosition(wxPoint2DDouble position);
NodeType GetNodeType() const { return m_nodeType; }
void SetNodeType(NodeType nodeType) { m_nodeType = nodeType; }
-
double GetRadius() const { return m_radius; }
std::vector<wxPoint2DDouble> GetInTrianglePts() const { return m_triPts; }
-
double GetAngle() const { return m_angle; }
void SetAngle(double angle) { m_angle = angle; }
-
void Rotate(bool clockwise = true);
-
+
void RotateTriPt(double angle);
void StartMove(wxPoint2DDouble position);
void Move(wxPoint2DDouble position);
bool Contains(wxPoint2DDouble position) const;
-
+
bool IsConnected() const { return m_connected; }
void SetConnected(bool connected = true) { m_connected = connected; }
-
int GetID() const { return m_id; }
void SetID(int id) { m_id = id; }
-
-protected:
+ protected:
int m_id = -1;
-
+
wxRect2DDouble m_rect;
NodeType m_nodeType;
-
+
bool m_connected = false;
wxPoint2DDouble m_moveStartPt;
@@ -58,7 +52,7 @@ protected:
class ControlElement : public Element
{
-public:
+ public:
ControlElement(int id);
~ControlElement();
@@ -67,11 +61,17 @@ public:
void SetNodeList(std::vector<Node*> nodeList) { m_nodeList = nodeList; }
std::vector<Node*> GetNodeList() const { return m_nodeList; }
-
virtual void DrawNodes() const;
-protected:
+ virtual bool IsSolved() const { return m_solved; }
+ virtual void SetSolved(bool solved = true) { m_solved = solved; }
+ virtual bool Solve(double input, double timeStep);
+ virtual double GetOutput() const { return m_output; }
+ virtual void SetOutput(double output) { m_output = output; }
+ protected:
std::vector<Node*> m_nodeList;
+ bool m_solved = false;
+ double m_output = 0.0;
};
-#endif // CONTROLELEMENT_H
+#endif // CONTROLELEMENT_H