21#include "../../forms/BusForm.h"
27 double nominalVoltage = 138.0;
29 bool isVoltageControlled =
false;
30 double controlledVoltage = 1.0;
31 int controlledVoltageUnitChoice = 0;
32 bool slackBus =
false;
33 bool isConnected =
true;
36 std::complex<double> voltage = std::complex<double>(1.0, 0.0);
37 std::complex<double> power = std::complex<double>(0.0, 0.0);
41 bool hasFault =
false;
45 double faultResistance = 0.0;
46 double faultReactance = 0.0;
47 std::complex<double> faultCurrent[3] = { std::complex<double>(0.0, 0.0), std::complex<double>(0.0, 0.0),
48 std::complex<double>(0.0, 0.0) };
49 std::complex<double> faultVoltage[3] = { std::complex<double>(0.0, 0.0), std::complex<double>(0.0, 0.0),
50 std::complex<double>(0.0, 0.0) };
55 bool stabHasFault =
false;
56 double stabFaultTime = 0.0;
57 double stabFaultLength = 0.0;
58 double stabFaultResistance = 0.0;
59 double stabFaultReactance = 0.0;
60 double oldAngle = 0.0;
61 double filteredAngle = 0.0;
63 double filteredVelocity = 0.0;
65 double stabFreq = 60.0;
66 std::vector<std::complex<double> > stabVoltageVector;
67 std::vector<double> stabFreqVector;
70 bool plotPQData =
false;
71 std::vector<int> harmonicOrder;
72 std::vector< std::complex<double> > harmonicVoltage;
75 std::vector<double> absImpedanceVector;
98 Bus(wxPoint2DDouble position);
105 Bus(wxPoint2DDouble position, wxString name);
117 virtual bool Contains(wxPoint2DDouble position)
const;
118 virtual bool Intersects(wxRect2DDouble rect)
const;
120 virtual void DrawDC(wxPoint2DDouble translation,
double scale, wxGraphicsContext* gc)
const;
121 virtual void DrawDC(wxPoint2DDouble translation,
double scale, wxDC& dc)
const;
122 virtual void Rotate(
bool clockwise =
true);
124 virtual void MovePickbox(wxPoint2DDouble position);
129 virtual void SetElectricalData(
const BusElectricalData& electricalData) { m_electricalData = electricalData; }
133 virtual rapidxml::xml_node<>* SaveElement(rapidxml::xml_document<>& doc, rapidxml::xml_node<>* elementListNode);
134 virtual bool OpenElement(rapidxml::xml_node<>* elementNode);
ElectricalUnit
Electrical units.
FaultData
Information about fault (type and location).
Node for power elements. All others power elements are connected through this.
virtual bool PickboxContains(wxPoint2DDouble position)
Check if a pickbox contains a point. If contains the attributes related to pickbox movement will be c...
virtual wxString GetTipText() const
Get the tip text.
virtual bool GetPlotData(ElementPlotData &plotData, PlotStudy study=PlotStudy::STABILITY)
Fill the plot data.
virtual Element * GetCopy()
Get a the element copy.
virtual bool Intersects(wxRect2DDouble rect) const
Check if the element's rect intersects other rect.
virtual void DrawDC(wxPoint2DDouble translation, double scale, wxGraphicsContext *gc) const
Draw the element using GDI+.
virtual bool ShowForm(wxWindow *parent, Element *element)
Show element data form.
Bus()
Default constructor.
virtual bool AddParent(Element *parent, wxPoint2DDouble position)
Add a parent element to the Bus.
virtual wxCursor GetBestPickboxCursor() const
Get the best cursor to shown to the user when the mouse is above a pickbox.
virtual void Rotate(bool clockwise=true)
Rotate the element.
virtual bool Contains(wxPoint2DDouble position) const
Checks if the element contains a position.
virtual void MovePickbox(wxPoint2DDouble position)
Move the pickbox.
virtual bool GetContextMenu(wxMenu &menu)
Get the element contex menu.
Base class of all elements of the program. This class is responsible for manage graphical and his dat...
Abstract class of power elements.