Power System Platform  2026w10a-beta
Loading...
Searching...
No Matches
Machines.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17
18#ifndef MACHINES_H
19#define MACHINES_H
20
21#include "PowerElement.h"
22
25
33class Machines : public PowerElement
34{
35 public:
36 enum SyncMachineModel { SM_MODEL_1 = 0, SM_MODEL_2, SM_MODEL_3, SM_MODEL_4, SM_MODEL_5 };
37
38 Machines();
39 virtual ~Machines() {}
40
41 virtual bool AddParent(Element* parent, wxPoint2DDouble position);
42 virtual bool Contains(wxPoint2DDouble position) const { return m_rect.Contains(position); }
43 //virtual void Draw(wxPoint2DDouble translation, double scale) const;
44 virtual void DrawDC(wxPoint2DDouble translation, double scale, wxGraphicsContext* gc) const;
45 virtual void DrawDC(wxPoint2DDouble translation, double scale, wxDC& dc) const;
46 virtual bool Intersects(wxRect2DDouble rect) const { return m_rect.Intersects(rect); }
47 virtual void Move(wxPoint2DDouble position);
48 virtual void MoveNode(Element* element, wxPoint2DDouble position);
49 virtual void StartMove(wxPoint2DDouble position);
50 virtual void RotateNode(Element* parent, bool clockwise = true);
51 virtual void RemoveParent(Element* parent);
52 virtual bool NodeContains(wxPoint2DDouble position);
53 virtual bool SetNodeParent(Element* parent);
54 virtual void UpdateNodes();
55 virtual void Rotate(bool clockwise = true);
56 //virtual void DrawSymbol() const {}
57 virtual void DrawDCSymbol(wxGraphicsContext* gc) const {}
58 virtual void DrawDCSymbol(wxDC& dc) const {}
59 virtual void SetPowerFlowDirection(PowerFlowDirection pfDirection);
60
61 protected:
62 void UpdateSwitchesPosition();
63 void UpdatePowerFlowArrowsPosition();
64 //bool m_inserted = false;
65};
66
67#endif // MACHINES_H
PowerFlowDirection
Direction of power flow arrows.
Class that can contain all control elements. Can identify (using RTTI) the elements from a generic li...
Solves in the time the control system. Can solve the control system directly from a ControlEditor or ...
Base class of all elements of the program. This class is responsible for manage graphical and his dat...
Definition Element.h:112
Abstract class for rotary machines power elements.
Definition Machines.h:34
virtual void RemoveParent(Element *parent)
Remove a parent.
Definition Machines.cpp:277
virtual bool Intersects(wxRect2DDouble rect) const
Check if the element's rect intersects other rect.
Definition Machines.h:46
virtual void SetPowerFlowDirection(PowerFlowDirection pfDirection)
Set the direction of the power flow.
Definition Machines.cpp:379
virtual void Move(wxPoint2DDouble position)
Move the element other position.
Definition Machines.cpp:223
virtual void DrawDC(wxPoint2DDouble translation, double scale, wxGraphicsContext *gc) const
Draw the element using GDI+.
Definition Machines.cpp:100
virtual void UpdateNodes()
Update the nodes according to the parents. If a parent is removed, use this method.
Definition Machines.cpp:328
virtual bool NodeContains(wxPoint2DDouble position)
Check if a node contains a point. If contains, set the attributes related to node movement.
Definition Machines.cpp:287
virtual void RotateNode(Element *parent, bool clockwise=true)
Rotate a node.
Definition Machines.cpp:265
virtual bool AddParent(Element *parent, wxPoint2DDouble position)
Add a parent to the element. This method must be used on power elements that connect to a bus,...
Definition Machines.cpp:24
virtual void StartMove(wxPoint2DDouble position)
Update the element attributes related to the movement.
Definition Machines.cpp:258
virtual bool Contains(wxPoint2DDouble position) const
Checks if the element contains a position.
Definition Machines.h:42
virtual void Rotate(bool clockwise=true)
Rotate the element.
Definition Machines.cpp:344
virtual void MoveNode(Element *element, wxPoint2DDouble position)
Move a node. StartMove(wxPoint2DDouble position) before start moving.
Definition Machines.cpp:236
virtual bool SetNodeParent(Element *parent)
Set a perent to the node. If all conditions are met, a new parent are added to the element and the po...
Definition Machines.cpp:301
Abstract class of power elements.