21#include "../../forms/LineForm.h"
27 double nominalVoltage = 138.0;
29 double nominalPower = 100.0;
31 double resistance = 0.0;
33 double indReactance = 1.0;
35 double capSusceptance = 0.0;
37 double lineSize = 100.0;
38 bool useLinePower =
false;
41 std::complex<double> current[2] = {std::complex<double>(0.0, 0.0), std::complex<double>(0.0, 0.0)};
42 std::complex<double> powerFlow[2] = {std::complex<double>(0.0, 0.0), std::complex<double>(0.0, 0.0)};
45 double zeroResistance = 0.0;
46 double zeroIndReactance = 1.0;
47 double zeroCapSusceptance = 0.0;
49 std::complex<double> faultCurrent[2][3];
52 std::vector<int> harmonicOrder;
53 std::vector< std::complex<double> > harmonicCurrent[2];
69 virtual bool Contains(wxPoint2DDouble position)
const;
71 virtual void DrawDC(wxPoint2DDouble translation,
double scale, wxGraphicsContext* gc)
const;
72 virtual void DrawDC(wxPoint2DDouble translation,
double scale, wxDC& dc)
const;
73 virtual void Move(wxPoint2DDouble position);
74 virtual void StartMove(wxPoint2DDouble position);
80 virtual bool Intersects(wxRect2DDouble rect)
const;
83 virtual void AddPoint(wxPoint2DDouble point);
86 virtual void RemoveNode(wxPoint2DDouble point);
87 virtual void AddNode(wxPoint2DDouble point);
89 virtual void CalculateBoundaries(wxPoint2DDouble& leftUp, wxPoint2DDouble& rightBottom)
const;
94 virtual void SetElectricalData(
LineElectricalData electricalData) { m_electricalData = electricalData; }
95 virtual void SetNominalVoltage(std::vector<double> nominalVoltage, std::vector<ElectricalUnit> nominalVoltageUnit);
96 virtual void SetPointList(std::vector<wxPoint2DDouble> pointList);
98 virtual rapidxml::xml_node<>* SaveElement(rapidxml::xml_document<>& doc, rapidxml::xml_node<>* elementListNode);
99 virtual bool OpenElement(rapidxml::xml_node<>* elementNode, std::vector<Element*> parentList);
102 void UpdatePowerFlowArrowsPosition();
ElectricalUnit
Electrical units.
PowerFlowDirection
Direction of power flow arrows.
Abstract class for branch power elements.
Base class of all elements of the program. This class is responsible for manage graphical and his dat...
virtual void AddPoint(wxPoint2DDouble point)
Add point to the list of points that connect the element to the bus.
virtual bool Contains(wxPoint2DDouble position) const
Checks if the element contains a position.
virtual bool Intersects(wxRect2DDouble rect) const
Check if the element's rect intersects other rect.
virtual void SetNominalVoltage(std::vector< double > nominalVoltage, std::vector< ElectricalUnit > nominalVoltageUnit)
Set nominal voltage of the element.
virtual bool ShowForm(wxWindow *parent, Element *element)
Show element data form.
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,...
virtual void DrawDC(wxPoint2DDouble translation, double scale, wxGraphicsContext *gc) const
Draw the element using GDI+.
virtual void Move(wxPoint2DDouble position)
Move the element other position.
virtual void SetPowerFlowDirection(PowerFlowDirection pfDirection)
Set the direction of the power flow.
virtual wxString GetTipText() const
Get the tip text.
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...
virtual wxCursor GetBestPickboxCursor() const
Get the best cursor to shown to the user when the mouse is above a pickbox.
virtual bool GetContextMenu(wxMenu &menu)
Get the element contex menu.
virtual void CalculateBoundaries(wxPoint2DDouble &leftUp, wxPoint2DDouble &rightBottom) const
Calculate the element boundaries.
virtual void RotateNode(Element *parent, bool clockwise=true)
Rotate a node.
virtual void StartMove(wxPoint2DDouble position)
Update the element attributes related to the movement.
virtual void MoveNode(Element *parent, wxPoint2DDouble position)
Move a node. StartMove(wxPoint2DDouble position) before start moving.
virtual bool PickboxContains(wxPoint2DDouble position)
Check if a pickbox contains a point. If contains the attributes related to pickbox movement will be c...
virtual void SetPointList(std::vector< wxPoint2DDouble > pointList)
Set the list of points that connect the element to the bus.
virtual void MovePickbox(wxPoint2DDouble position)
Move the pickbox.
virtual Element * GetCopy()
Get a the element copy.