Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
connection.h
1/*
2** Copyright 2007-2024, 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
32namespace Antares
33{
34namespace Toolbox
35{
36namespace InputSelector
37{
38class Connections : public AInput, public Yuni::IEventObserver<Connections>
39{
40public:
41 Connections(wxWindow* parent);
42 virtual ~Connections();
43
44 virtual void update();
45
46 virtual wxPoint recommendedSize() const
47 {
48 return wxPoint(250, 70);
49 }
50
51public:
52 Yuni::Event<void(Antares::Data::AreaLink*)> onConnectionChanged;
53
54protected:
55 virtual void internalBuildSubControls();
56
57private:
58 void onStudyClosed();
59 void onStudyAreaUpdate(Data::Area*);
60 void onStudyLinkUpdate(Data::AreaLink*);
61
62 void onSelectionChanged(wxTreeEvent& evt);
63 void delayedSelection(wxTreeItemData* data);
64
65 void onMapLayerAdded(const wxString* text);
66 void onMapLayerRemoved(const wxString* text);
67 void onMapLayerChanged(const wxString* text);
68 void onMapLayerRenamed(const wxString* text);
69 void layerFilterChanged(wxCommandEvent& evt);
70
71private:
72 wxComboBox* pLayerFilter;
73 wxTreeCtrl* pListbox;
74 Antares::Data::AreaLink* pLastSelected;
75
76}; // class Area
77
78} // namespace InputSelector
79} // namespace Toolbox
80} // namespace Antares
81
82#endif // __ANTARES_TOOLBOX_INPUT_CONNECTIONS_H__
Definition for a single area.
Definition area.h:52
virtual wxPoint recommendedSize() const
Get the recommended size for the control.
Definition connection.h:46
virtual void update()
Clear then Update the input.
Definition connection.cpp:278