Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
renewable-cluster.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_RENEWABLE_CLUSTER_H__
22#define __ANTARES_TOOLBOX_INPUT_RENEWABLE_CLUSTER_H__
23
24// gp : remove useless header includes
25// #include <yuni/core/event.h>
26// #include <antares/study/study.h>
27#include "input.h"
28#include "area.h"
29// #include <wx/panel.h>
30// #include <wx/arrstr.h>
31// #include <wx/stattext.h>
32#include <wx/imaglist.h>
33// #include "../components/htmllistbox/component.h"
34// #include "../components/htmllistbox/item/thermal-cluster.h"
35#include "../components/htmllistbox/item/renewable-cluster-item.h"
36#include "../components/htmllistbox/datasource/renewable-cluster-order.h"
37#include "../components/htmllistbox/item/renewable-cluster-item.h"
38
39namespace Antares
40{
41namespace Toolbox
42{
43namespace InputSelector
44{
45using namespace Component::HTMLListbox::Datasource;
46
50class RenewableCluster final : public AInput, public Yuni::IEventObserver<RenewableCluster>
51{
52public:
54
55
58 RenewableCluster(wxWindow* parent, InputSelector::Area* area);
60 virtual ~RenewableCluster();
62
63 virtual void update();
64
65 // gp : to be adapted
66 /*
67 virtual wxPoint recommendedSize() const
68 {
69 return wxPoint(150, 240);
70 }
71 */
72
73 void updateInnerValues();
74
75 // gp : should be removed
83 // void renameAggregate(Antares::Data::ThermalCluster* cluster,
84 // const wxString& newName,
85 // const bool broadcast = true);
86
87public:
89
90protected:
94 virtual void internalBuildSubControls();
95 // gp : to be adapted
97 // void onThermalGroupChanged(Antares::Data::Area* area);
98
99private:
104 void areaHasChanged(Antares::Data::Area* area);
105
107 void onStudyEndUpdate();
108
110 void internalAddPlant(void*);
112 void internalDeletePlant(void*);
114 void internalClonePlant(void*);
115
116 void internalDeleteAll(void*);
117
122 void onApplicationOnQuit();
123
127 void onStudyClosed();
128
133 void onRnSelected(Component::HTMLListbox::Item::IItem::Ptr item);
134
135 void onStudyRenewableClusterCommonSettingsChanged();
136
137 void onStudyRenewableClusterRenamed(Antares::Data::RenewableCluster* cluster);
138
139 void onStudyRenewableClusterGroupChanged(Antares::Data::Area* area);
140
141 void onDeleteDropdown(Antares::Component::Button&, wxMenu& menu, void*);
142
143 void evtPopupDelete(wxCommandEvent&);
144
145 void evtPopupDeleteAll(wxCommandEvent&);
146
147 void delayedSelection(Component::HTMLListbox::Item::IItem::Ptr item);
148
149 void updateWhenGroupChanges();
150
151private:
153 Antares::Data::Area* pArea;
155 wxStaticText* pTotalMW;
157 wxImageList pImageList;
161 InputSelector::Area* pAreaNotifier;
163 Component::HTMLListbox::Item::RenewableClusterItem::Ptr pLastSelectedRenewableCluster;
164
165 RenewableClustersByAlphaOrder* pDataSourceAZ;
167
168}; // class Area
169
170} // namespace InputSelector
171} // namespace Toolbox
172} // namespace Antares
173
174#endif // __ANTARES_TOOLBOX_INPUT_RENEWABLE_CLUSTER_H__
Definition button.h:34
Listbox with HTML content.
Definition component.h:50
std::shared_ptr< IItem > Ptr
The most suitable smartptr for this class.
Definition item.h:51
Definition for a single area.
Definition area.h:52
Definition cluster.h:42
Visual Component for displaying all available areas (and groups)
Definition area.h:41
Visual Component for displaying renewable clusters of an arbitrary area.
Definition renewable-cluster.h:51
RenewableCluster(wxWindow *parent, InputSelector::Area *area)
Default Constructor.
Definition renewable-cluster.cpp:45
Yuni::Event< void(Antares::Data::RenewableCluster *)> onClusterChanged
Rename a thermal cluster and refresh inner values.
Definition renewable-cluster.h:88
virtual void internalBuildSubControls()
Create all needed controls (called by the constructor)
Definition renewable-cluster.cpp:84
virtual ~RenewableCluster()
Destructor.
Definition renewable-cluster.cpp:79
virtual void update()
Clear then Update the input.
Definition renewable-cluster.cpp:154