Power System Platform  2026w34a-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, bool isOpening = false);
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(GUIColour* guiColour, wxPoint2DDouble translation, double scale, wxGraphicsContext* gc) const;
45 virtual void DrawDC(GUIColour* guiColour, 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 AlignToGrid(double gridSize = 20.0) override;
49 virtual void MoveNode(Element* element, wxPoint2DDouble position);
50 virtual void StartMove(wxPoint2DDouble position);
51 virtual void RotateNode(Element* parent, bool clockwise = true);
52 virtual void RemoveParent(Element* parent);
53 virtual bool NodeContains(wxPoint2DDouble position);
54 virtual bool SetNodeParent(Element* parent);
55 virtual void UpdateNodes();
56 virtual void Rotate(bool clockwise = true);
57 //virtual void DrawSymbol() const {}
58 virtual void DrawDCSymbol(wxGraphicsContext* gc) const {}
59 virtual void DrawDCSymbol(wxDC& dc) const {}
60 virtual void SetPowerFlowDirection(PowerFlowDirection pfDirection);
61 virtual void UpdateSwitchesPosition() override;
62 virtual void UpdatePowerFlowArrowsPosition() override;
63
64 protected:
65 //bool m_inserted = false;
66};
67
68#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:115
Abstract class for rotary machines power elements.
Definition Machines.h:34
virtual void RemoveParent(Element *parent)
Remove a parent.
Definition Machines.cpp:308
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:553
virtual void Move(wxPoint2DDouble position)
Move the element other position.
Definition Machines.cpp:250
virtual void UpdateNodes()
Update the nodes according to the parents. If a parent is removed, use this method.
Definition Machines.cpp:360
virtual bool NodeContains(wxPoint2DDouble position)
Check if a node contains a point. If contains, set the attributes related to node movement.
Definition Machines.cpp:318
virtual void DrawDC(GUIColour *guiColour, wxPoint2DDouble translation, double scale, wxGraphicsContext *gc) const
Draw the element using GDI+.
Definition Machines.cpp:122
virtual void RotateNode(Element *parent, bool clockwise=true)
Rotate a node.
Definition Machines.cpp:296
virtual bool AddParent(Element *parent, wxPoint2DDouble position, bool isOpening=false)
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:289
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:376
virtual void MoveNode(Element *element, wxPoint2DDouble position)
Move a node. StartMove(wxPoint2DDouble position) before start moving.
Definition Machines.cpp:266
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:332
Abstract class of power elements.