Antares Simulator
Power System Simulator
connection.h
1 /*
2  * Copyright 2007-2025, RTE (https://www.rte-france.com)
3  * See AUTHORS.txt
4  * SPDX-License-Identifier: MPL-2.0
5  * This file is part of Antares-Simulator,
6  * Adequacy and Performance assessment for interconnected energy networks.
7  *
8  * Antares_Simulator is free software: you can redistribute it and/or modify
9  * it under the terms of the Mozilla Public Licence 2.0 as published by
10  * the Mozilla Foundation, either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * Antares_Simulator is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * Mozilla Public Licence 2.0 for more details.
17  *
18  * You should have received a copy of the Mozilla Public Licence 2.0
19  * along with Antares_Simulator. If not, see <https://opensource.org/license/mpl-2-0/>.
20  */
21 #ifndef __ANTARES_TOOLBOX_INPUT_CONNECTIONS_H__
22 #define __ANTARES_TOOLBOX_INPUT_CONNECTIONS_H__
23 
24 #include <wx/panel.h>
25 #include <antares/study/study.h>
26 #include "input.h"
27 #include <wx/arrstr.h>
28 #include <yuni/core/event.h>
29 #include <wx/treectrl.h>
30 #include <wx/combobox.h>
31 
32 namespace Antares::Toolbox::InputSelector
33 {
34 class Connections: public AInput, public Yuni::IEventObserver<Connections>
35 {
36 public:
37  Connections(wxWindow* parent);
38  virtual ~Connections();
39 
40  virtual void update();
41 
42  virtual wxPoint recommendedSize() const
43  {
44  return wxPoint(250, 70);
45  }
46 
47 public:
48  Yuni::Event<void(Antares::Data::AreaLink*)> onConnectionChanged;
49 
50 protected:
51  virtual void internalBuildSubControls();
52 
53 private:
54  void onStudyClosed();
55  void onStudyAreaUpdate(Data::Area*);
56  void onStudyLinkUpdate(Data::AreaLink*);
57 
58  void onSelectionChanged(wxTreeEvent& evt);
59  void delayedSelection(wxTreeItemData* data);
60 
61  void onMapLayerAdded(const wxString* text);
62  void onMapLayerRemoved(const wxString* text);
63  void onMapLayerChanged(const wxString* text);
64  void onMapLayerRenamed(const wxString* text);
65  void layerFilterChanged(wxCommandEvent& evt);
66 
67 private:
68  wxComboBox* pLayerFilter;
69  wxTreeCtrl* pListbox;
70  Antares::Data::AreaLink* pLastSelected;
71 
72 }; // class Area
73 
74 } // namespace Antares::Toolbox::InputSelector
75 
76 #endif // __ANTARES_TOOLBOX_INPUT_CONNECTIONS_H__
Definition for a single area.
Definition: area.h:51
virtual wxPoint recommendedSize() const
Get the recommended size for the control.
Definition: connection.h:42
virtual void update()
Clear then Update the input.
Definition: connection.cpp:290