Power System Platform  2026w10a-beta
Loading...
Searching...
No Matches
Capacitor.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 CAPACITOR_H
19#define CAPACITOR_H
20
21#include "Shunt.h"
22
24
26 wxString name;
27 double reactivePower = 100.0;
28 ElectricalUnit reactivePowerUnit = ElectricalUnit::UNIT_Mvar;
29};
30
38class Capacitor : public Shunt
39{
40 public:
41 Capacitor();
42 Capacitor(wxString name);
43 ~Capacitor();
44
45 virtual Element* GetCopy();
46 virtual bool AddParent(Element* parent, wxPoint2DDouble position);
47 //virtual void Draw(wxPoint2DDouble translation, double scale) const;
48 virtual void DrawDC(wxPoint2DDouble translation, double scale, wxGraphicsContext* gc) const;
49 virtual void DrawDC(wxPoint2DDouble translation, double scale, wxDC& dc) const;
50 virtual bool Contains(wxPoint2DDouble position) const;
51 virtual bool Intersects(wxRect2DDouble rect) const;
52 virtual void Rotate(bool clockwise = true);
53 virtual bool GetContextMenu(wxMenu& menu);
54 virtual wxString GetTipText() const;
55 virtual bool ShowForm(wxWindow* parent, Element* element);
56 virtual CapacitorElectricalData GetElectricalData() { return m_electricalData; }
57 virtual CapacitorElectricalData GetPUElectricalData(double systemPowerBase);
58 virtual void SetElectricalData(CapacitorElectricalData electricalData) { m_electricalData = electricalData; }
59
60 virtual rapidxml::xml_node<>* SaveElement(rapidxml::xml_document<>& doc, rapidxml::xml_node<>* elementListNode);
61 virtual bool OpenElement(rapidxml::xml_node<>* elementNode, std::vector<Element*> parentList);
62
63 protected:
64 CapacitorElectricalData m_electricalData;
65};
66
67#endif // CAPACITOR_H
ElectricalUnit
Electrical units.
Shunt capactior power element.
Definition Capacitor.h:39
virtual wxString GetTipText() const
Get the tip text.
virtual bool GetContextMenu(wxMenu &menu)
Get the element contex menu.
virtual void Rotate(bool clockwise=true)
Rotate the element.
virtual Element * GetCopy()
Get a the element copy.
virtual bool ShowForm(wxWindow *parent, Element *element)
Show element data form.
virtual bool Intersects(wxRect2DDouble rect) const
Check if the element's rect intersects other rect.
virtual bool Contains(wxPoint2DDouble position) const
Checks if the element contains a position.
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 Capacitor.cpp:32
virtual void DrawDC(wxPoint2DDouble translation, double scale, wxGraphicsContext *gc) const
Draw the element using GDI+.
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 reactive shunt element power data.
Abstract class for shunt power elements.
Definition Shunt.h:32