Power System Platform  2026w10a-beta
Loading...
Searching...
No Matches
Limiter.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 LIMITER_H
19#define LIMITER_H
20
21#include "ControlElement.h"
22
23class LimiterForm;
24
32class Limiter : public ControlElement
33{
34 public:
35 Limiter(int id);
36 ~Limiter();
37
38 //virtual void Draw(wxPoint2DDouble translation, double scale) const;
39 virtual void DrawDC(wxPoint2DDouble translation, double scale, wxGraphicsContext* gc) const;
40 virtual bool Contains(wxPoint2DDouble position) const { return m_rect.Contains(position); }
41 virtual bool Intersects(wxRect2DDouble rect) const { return m_rect.Intersects(rect); }
42 virtual bool ShowForm(wxWindow* parent, Element* element);
43 virtual void Rotate(bool clockwise = true);
44 virtual bool Solve(double* input, double timeStep);
45
46 virtual void UpdatePoints();
47
48 double GetUpLimit() const { return m_upLimit; }
49 double GetLowLimit() const { return m_lowLimit; }
50 void SetUpLimit(double upLimit) { m_upLimit = upLimit; }
51 void SetLowLimit(double lowLimit) { m_lowLimit = lowLimit; }
52
53 virtual rapidxml::xml_node<>* SaveElement(rapidxml::xml_document<>& doc, rapidxml::xml_node<>* elementListNode);
54 virtual bool OpenElement(rapidxml::xml_node<>* elementNode);
55
56 virtual Element* GetCopy();
57
58 protected:
59 double m_upLimit = 5.0;
60 double m_lowLimit = -5.0;
61};
62
63#endif // LIMITER_H
Base class of a control element. Provide general methods to other control classes.
Base class of all elements of the program. This class is responsible for manage graphical and his dat...
Definition Element.h:112
Form to edit the limit control data.
Definition LimiterForm.h:32
Limits the input value by superior and inferior values.
Definition Limiter.h:33
virtual bool ShowForm(wxWindow *parent, Element *element)
Show element data form.
Definition Limiter.cpp:95
virtual Element * GetCopy()
Get a the element copy.
Definition Limiter.cpp:159
virtual void Rotate(bool clockwise=true)
Rotate the element.
Definition Limiter.cpp:105
virtual bool Contains(wxPoint2DDouble position) const
Checks if the element contains a position.
Definition Limiter.h:40
virtual bool Intersects(wxRect2DDouble rect) const
Check if the element's rect intersects other rect.
Definition Limiter.h:41
virtual void DrawDC(wxPoint2DDouble translation, double scale, wxGraphicsContext *gc) const
Draw the element using GDI+.
Definition Limiter.cpp:68