Power System Platform  2026w23a-beta
Loading...
Searching...
No Matches
ControlEditorManager Class Reference

This class is responsible to manage the ControlEditor instances in the application. More...

#include <ControlEditorManager.h>

Collaboration diagram for ControlEditorManager:

Public Member Functions

 ControlEditorManager (Workspace *workspace)
 
ControlEditorOpen (ControlElementContainer *container, int plotLib, int ioFlags)
 
void Remove (ControlEditor *editor)
 
void CloseAll ()
 
bool IsOpen (ControlElementContainer *container) const
 
ControlEditorGetEditor (const ControlElementContainer *container) const
 

Private Attributes

Workspacem_workspace = nullptr
 
std::vector< ControlEditor * > m_editors
 

Detailed Description

This class is responsible to manage the ControlEditor instances in the application.

Author
Thales Lima Oliveira thale.nosp@m.s.ol.nosp@m.iveir.nosp@m.a@uf.nosp@m.tm.ed.nosp@m.u.br
Date
30/06/2026

Definition at line 34 of file ControlEditorManager.h.

Constructor & Destructor Documentation

◆ ControlEditorManager()

ControlEditorManager::ControlEditorManager ( Workspace workspace)
explicit

Definition at line 26 of file ControlEditorManager.cpp.

27 : m_workspace(workspace)
28{
29}

◆ ~ControlEditorManager()

ControlEditorManager::~ControlEditorManager ( )

Definition at line 31 of file ControlEditorManager.cpp.

32{
33 CloseAll();
34}

Member Function Documentation

◆ CloseAll()

void ControlEditorManager::CloseAll ( )

Definition at line 73 of file ControlEditorManager.cpp.

74{
75 auto editors = m_editors;
76
77 for (auto* editor : editors)
78 {
79 if (editor)
80 editor->Destroy();
81 }
82
83 m_editors.clear();
84}

◆ GetEditor()

ControlEditor * ControlEditorManager::GetEditor ( const ControlElementContainer container) const

Definition at line 91 of file ControlEditorManager.cpp.

92{
93 for (auto* editor : m_editors)
94 {
95 if (!editor)
96 continue;
97
98 if (editor->GetControlContainer() == container)
99 return editor;
100 }
101
102 return nullptr;
103}

◆ IsOpen()

bool ControlEditorManager::IsOpen ( ControlElementContainer container) const

Definition at line 86 of file ControlEditorManager.cpp.

87{
88 return GetEditor(container) != nullptr;
89}

◆ Open()

ControlEditor * ControlEditorManager::Open ( ControlElementContainer container,
int  plotLib,
int  ioFlags 
)

Definition at line 36 of file ControlEditorManager.cpp.

37{
38 ControlEditor* editor = GetEditor(container);
39
40 if (editor)
41 {
42 //editor->Raise();
43 //editor->SetFocus();
44 //return editor;
45 editor->Close();
46 editor = nullptr;
47 }
48
49 editor = new ControlEditor(m_workspace, m_workspace->GetProperties(), ioFlags);
50
51 editor->SetManager(this);
52 editor->SetElementsList(container->GetControlElementsList());
53 editor->SetConnectionsList(container->GetConnectionLineList());
54 editor->SetControlContainer(container);
55 editor->SetPlotLib(plotLib);
56
57 m_editors.push_back(editor);
58
59 editor->Show();
60 editor->SetJustOpened(true);
61
62 return editor;
63}

◆ Remove()

void ControlEditorManager::Remove ( ControlEditor editor)

Definition at line 65 of file ControlEditorManager.cpp.

66{
67 auto it = std::find(m_editors.begin(), m_editors.end(), editor);
68
69 if (it != m_editors.end())
70 m_editors.erase(it);
71}

Member Data Documentation

◆ m_editors

std::vector<ControlEditor*> ControlEditorManager::m_editors
private

Definition at line 53 of file ControlEditorManager.h.

◆ m_workspace

Workspace* ControlEditorManager::m_workspace = nullptr
private

Definition at line 51 of file ControlEditorManager.h.


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