Antares Simulator
Power System Simulator
renewable-cluster.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_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 
39 namespace Antares::Toolbox::InputSelector
40 {
41 using namespace Component::HTMLListbox::Datasource;
42 
46 class RenewableCluster final: public AInput, public Yuni::IEventObserver<RenewableCluster>
47 {
48 public:
50 
51 
54  RenewableCluster(wxWindow* parent, InputSelector::Area* area);
56  virtual ~RenewableCluster();
58 
59  virtual void update();
60 
61  // gp : to be adapted
62  /*
63  virtual wxPoint recommendedSize() const
64  {
65  return wxPoint(150, 240);
66  }
67  */
68 
69  void updateInnerValues();
70 
71  // gp : should be removed
79  // void renameAggregate(Antares::Data::ThermalCluster* cluster,
80  // const wxString& newName,
81  // const bool broadcast = true);
82 
83 public:
85 
86 protected:
90  virtual void internalBuildSubControls();
91  // gp : to be adapted
93  // void onThermalGroupChanged(Antares::Data::Area* area);
94 
95 private:
100  void areaHasChanged(Antares::Data::Area* area);
101 
103  void onStudyEndUpdate();
104 
106  void internalAddPlant(void*);
108  void internalDeletePlant(void*);
110  void internalClonePlant(void*);
111 
112  void internalDeleteAll(void*);
113 
118  void onApplicationOnQuit();
119 
123  void onStudyClosed();
124 
129  void onRnSelected(Component::HTMLListbox::Item::IItem::Ptr item);
130 
131  void onStudyRenewableClusterCommonSettingsChanged();
132 
133  void onStudyRenewableClusterRenamed(Antares::Data::RenewableCluster* cluster);
134 
135  void onStudyRenewableClusterGroupChanged(Antares::Data::Area* area);
136 
137  void onDeleteDropdown(Antares::Component::Button&, wxMenu& menu, void*);
138 
139  void evtPopupDelete(wxCommandEvent&);
140 
141  void evtPopupDeleteAll(wxCommandEvent&);
142 
143  void delayedSelection(Component::HTMLListbox::Item::IItem::Ptr item);
144 
145  void updateWhenGroupChanges();
146 
147 private:
149  Antares::Data::Area* pArea;
151  wxStaticText* pTotalMW;
153  wxImageList pImageList;
157  InputSelector::Area* pAreaNotifier;
159  Component::HTMLListbox::Item::RenewableClusterItem::Ptr pLastSelectedRenewableCluster;
160 
161  RenewableClustersByAlphaOrder* pDataSourceAZ;
163 
164 }; // class Area
165 
166 } // namespace Antares::Toolbox::InputSelector
167 
168 #endif // __ANTARES_TOOLBOX_INPUT_RENEWABLE_CLUSTER_H__
Definition: button.h:32
Listbox with HTML content.
Definition: component.h:46
std::shared_ptr< IItem > Ptr
The most suitable smartptr for this class.
Definition: item.h:47
Definition for a single area.
Definition: area.h:51
Definition: cluster.h:40
Visual Component for displaying all available areas (and groups)
Definition: area.h:37
Visual Component for displaying renewable clusters of an arbitrary area.
Definition: renewable-cluster.h:47
Yuni::Event< void(Antares::Data::RenewableCluster *)> onClusterChanged
Rename a thermal cluster and refresh inner values.
Definition: renewable-cluster.h:84