Power System Platform  2024w23a
Loading...
Searching...
No Matches
Workspace Class Reference

This class manages the graphical and power elements. It is responsible for handling the user's interaction with the elements. More...

#include <Workspace.h>

Inheritance diagram for Workspace:
Collaboration diagram for Workspace:

Public Types

enum class  WorkspaceMode : int {
  MODE_EDIT = 0 , MODE_MOVE_ELEMENT , MODE_MOVE_PICKBOX , MODE_MOVE_NODE ,
  MODE_DRAG , MODE_DRAG_INSERT , MODE_DRAG_INSERT_TEXT , MODE_INSERT ,
  MODE_INSERT_TEXT , MODE_SELECTION_RECT , MODE_PASTE , MODE_DRAG_PASTE
}
 

Public Member Functions

 Workspace (wxWindow *parent, wxString name=wxEmptyString, wxStatusBar *statusBar=nullptr)
 
wxString GetName () const
 
std::vector< Element * > GetElementList () const
 
std::vector< Text * > GetTextList () const
 
std::vector< Element * > GetAllElements () const
 
WorkspaceMode GetWorkspaceMode () const
 
CameraGetCamera () const
 
void CopySelection ()
 
bool Paste ()
 
void SaveCurrentState ()
 
void SetNextState ()
 
void SetPreviousState ()
 
wxFileName GetSavedPath () const
 
void SetName (wxString name)
 
void SetElementList (std::vector< Element * > elementList)
 
void SetTextList (std::vector< Text * > textList)
 
void SetStatusBarText (wxString text)
 
void SetWorkspaceMode (WorkspaceMode mode)
 
void SetSavedPath (wxFileName savedPath)
 
void SetJustOpened (bool justOpened)
 
virtual void Redraw ()
 
void RotateSelectedElements (bool clockwise=true)
 
void DeleteSelectedElements ()
 
bool GetElementsCorners (wxPoint2DDouble &leftUpCorner, wxPoint2DDouble &rightDownCorner, std::vector< Element * > elementList)
 
void Fit ()
 
void UnselectAll ()
 
void EnableHeatMap (const bool &enable=true)
 
bool IsHeatMapEnable () const
 
HMPlaneGetHeatMap () const
 
void EnableAutoHeatMapLabel (const bool &enable=true)
 
bool IsHeatMapAutoLabelEnable () const
 
void ValidateBusesVoltages (Element *initialBus)
 
void ValidateElementsVoltages ()
 
void UpdateElementsID ()
 
bool UpdateTextElements ()
 
void UpdateHeatMap ()
 
int GetElementNumber (ElementID elementID)
 
void IncrementElementNumber (ElementID elementID)
 
PropertiesDataGetProperties () const
 
std::vector< double > GetStabilityTimeVector () const
 
bool IsContinuousCalculationActive () const
 
void SetContinuousCalculationActive (bool value=true)
 
bool RunPowerFlow ()
 
bool RunFault ()
 
bool RunSCPower ()
 
bool RunStaticStudies ()
 
bool RunStability ()
 
bool RunHarmonicDistortion ()
 
bool RunFrequencyResponse ()
 
virtual void OnMiddleDoubleClick (wxMouseEvent &event)
 
virtual void OnIdle (wxIdleEvent &event)
 
virtual void OnTimer (wxTimerEvent &event)
 
virtual void OnLeftDoubleClick (wxMouseEvent &event)
 
virtual void OnRightClickDown (wxMouseEvent &event)
 
virtual void OnLeftClickUp (wxMouseEvent &event)
 
virtual void OnScroll (wxMouseEvent &event)
 
virtual void OnMiddleDown (wxMouseEvent &event)
 
virtual void OnMiddleUp (wxMouseEvent &event)
 
virtual void OnMouseMotion (wxMouseEvent &event)
 
virtual void OnKeyDown (wxKeyEvent &event)
 
virtual void OnLeftClickDown (wxMouseEvent &event)
 
virtual void OnPaint (wxPaintEvent &event)
 
virtual void OnPopupClick (wxCommandEvent &event)
 
virtual void OnResize (wxSizeEvent &event)
 

Protected Member Functions

virtual void OnHeatMapTime (wxTimerEvent &event)
 
void UpdateStatusBar ()
 
int GetElementNumberFromList (Element *element)
 
void GetStateListsCopy (const std::vector< PowerElement * > &elementsList, const std::vector< Text * > &textList, std::vector< PowerElement * > &elementsListCopy, std::vector< Text * > &textListCopy)
 

Protected Attributes

wxStatusBar * m_statusBar = nullptr
 
Cameram_camera = nullptr
 
wxTipWindow * m_tipWindow = nullptr
 
wxString m_name
 
WorkspaceMode m_mode = WorkspaceMode::MODE_EDIT
 
std::vector< PowerElement * > m_elementList
 
int m_elementNumber [NUM_ELEMENTS]
 
std::vector< Text * > m_textList
 
std::vector< std::vector< PowerElement * > > m_elementListState
 
std::vector< std::vector< Text * > > m_textListState
 
int m_currenteState = -1
 
int m_maxStates = 100
 
wxFileName m_savedPath
 
wxRect2DDouble m_selectionRect
 
wxPoint2DDouble m_startSelRect
 
PropertiesDatam_properties = nullptr
 
std::vector< double > m_stabilityTimeVector
 
bool m_continuousCalc = false
 
bool m_disconnectedElement = false
 
bool m_justOpened = false
 
float m_width = 0.0
 
float m_height = 0.0
 
HMPlanem_hmPlane = nullptr
 
Shader * m_basicShader = nullptr
 
Shader * m_hmLabelShader = nullptr
 
Renderer * m_renderer = nullptr
 
bool m_showHM = false
 
bool m_showHMTimer = false
 
bool m_hmAutomaticLabel = false
 

Detailed Description

This class manages the graphical and power elements. It is responsible for handling the user's interaction with the elements.

Author
Thales Lima Oliveira thale.nosp@m.s@uf.nosp@m.u.br
Date
19/09/2017

The documentation for this class was generated from the following files: