Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
thermal-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_THERMAL_CLUSTER_H__
22#define __ANTARES_TOOLBOX_INPUT_THERMAL_CLUSTER_H__
23
24#include <yuni/core/event.h>
25#include <antares/study/study.h>
26#include "input.h"
27#include "area.h"
28#include <wx/panel.h>
29#include <wx/arrstr.h>
30#include <wx/stattext.h>
31#include <wx/imaglist.h>
32#include "../components/htmllistbox/component.h"
33#include "../components/htmllistbox/item/thermal-cluster-item.h"
34#include "../components/htmllistbox/datasource/thermal-cluster-order.h"
35#include "../components/htmllistbox/item/thermal-cluster-item.h"
36
37namespace Antares
38{
39namespace Toolbox
40{
41namespace InputSelector
42{
43using namespace Component::HTMLListbox::Datasource;
44
48class ThermalCluster final : public AInput, public Yuni::IEventObserver<ThermalCluster>
49{
50public:
52
53
56 ThermalCluster(wxWindow* parent, InputSelector::Area* area);
58 virtual ~ThermalCluster();
60
61 virtual void update();
62
63 virtual wxPoint recommendedSize() const
64 {
65 return wxPoint(150, 240);
66 }
67
68 void updateInnerValues();
69
78 const wxString& newName,
79 const bool broadcast = true);
80
81public:
82 Yuni::Event<void(Antares::Data::ThermalCluster*)> onThermalClusterChanged;
83
84protected:
88 virtual void internalBuildSubControls();
91
92private:
97 void areaHasChanged(Antares::Data::Area* area);
98
100 void onStudyEndUpdate();
101
103 void internalAddPlant(void*);
105 void internalDeletePlant(void*);
107 void internalClonePlant(void*);
108
109 void internalDeleteAll(void*);
110
115 void onApplicationOnQuit();
116
120 void onStudyClosed();
121
126 void onThSelected(Component::HTMLListbox::Item::IItem::Ptr item);
127
128 void onStudyThermalClusterCommonSettingsChanged();
129
130 void onStudyThermalClusterRenamed(Antares::Data::ThermalCluster* cluster);
131
132 void onStudyThermalClusterGroupChanged(Antares::Data::Area* area);
133
134 void onDeleteDropdown(Antares::Component::Button&, wxMenu& menu, void*);
135
136 void evtPopupDelete(wxCommandEvent&);
137 void evtPopupDeleteAll(wxCommandEvent&);
138
139 void delayedSelection(Component::HTMLListbox::Item::IItem::Ptr item);
140
141 void updateWhenGroupChanges();
142
143private:
145 Antares::Data::Area* pArea;
147 wxStaticText* pTotalMW;
149 wxImageList pImageList;
153 InputSelector::Area* pAreaNotifier;
155 Component::HTMLListbox::Item::ThermalClusterItem::Ptr pLastSelectedThermalCluster;
156
157 ThermalClustersByAlphaOrder* pDataSourceAZ;
159
160}; // class Area
161
162} // namespace InputSelector
163} // namespace Toolbox
164} // namespace Antares
165
166#endif // __ANTARES_TOOLBOX_INPUT_THERMAL_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
A single thermal cluster.
Definition cluster.h:78
Visual Component for displaying all available areas (and groups)
Definition area.h:41
Visual Component for displaying thermal clusters of an arbitrary area.
Definition thermal-cluster.h:49
ThermalCluster(wxWindow *parent, InputSelector::Area *area)
Default Constructor.
Definition thermal-cluster.cpp:45
void renameAggregate(Antares::Data::ThermalCluster *cluster, const wxString &newName, const bool broadcast=true)
Rename a thermal cluster and refresh inner values.
Definition thermal-cluster.cpp:211
virtual ~ThermalCluster()
Destructor.
Definition thermal-cluster.cpp:79
void onThermalGroupChanged(Antares::Data::Area *area)
Event: a group has been changed.
virtual void internalBuildSubControls()
Create all needed controls (called by the constructor)
Definition thermal-cluster.cpp:84
virtual wxPoint recommendedSize() const
Get the recommended size for the control.
Definition thermal-cluster.h:63
virtual void update()
Clear then Update the input.
Definition thermal-cluster.cpp:151