Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
frame.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_WINDOWS_INSPECTOR_FRAME_H__
22#define __ANTARES_WINDOWS_INSPECTOR_FRAME_H__
23
24#include <wx/propgrid/propgrid.h>
25
26#include <antares/study/study.h>
27#include "../notes.h"
28#include "data.h"
29#include <ui/common/component/panel.h>
30
31namespace Antares
32{
33namespace Window
34{
35namespace Inspector
36{
37// Forward declaration
38class InspectorGrid;
39
40class Frame final : public Antares::Component::Panel, public Yuni::IEventObserver<Frame>
41{
42public:
44
45
51 explicit Frame(wxWindow* parent, bool allowAnyObject = false);
53 virtual ~Frame();
55
57
58
63 void apply(const InspectorData::Ptr& data);
64
69
73 void delayApply();
74
76
83
88
89public:
90 // Events
91 void onSelectAllLinks(wxCommandEvent& evt);
92 void onSelectLink(wxCommandEvent& evt);
93 void onSelectAllLinksFromArea(wxCommandEvent& evt);
94
95 void onSelectAllPlants(wxCommandEvent& evt);
96 void onSelectPlant(wxCommandEvent& evt);
97
98 void clearAssociatinsBetweenIDAndPtr()
99 {
100 mapIDPointer.clear();
101 }
102 void assign(int id, const void* p)
103 {
104 mapIDPointer[id] = const_cast<void*>(p);
105 }
106
107protected:
108 void onDelayApplyGlobalSelection();
109 void onDelayApply();
110 void onStudyClosed();
111 void onSelectProperties(void*);
112 void onSelectNotes(void*);
113 void onPropertyChanging(wxPropertyGridEvent& event);
114 void onLoadUserNotes();
115 void onInternalRefresh(const void* sender);
116
117private:
119 wxPropertyGrid* pPropertyGrid;
121 wxPanel* pMainPanel;
123 Window::Notes* pNotes;
125 // with the givel selection
126 bool pAllowAnyObject;
128 InspectorData::Ptr pCurrentSelection;
130 Yuni::Bind<void(const InspectorData::Ptr&)> pApplyPropertyGrid;
131
132 // Some property pointers are kept to speed-up the update
133 // About a Study
134 wxPGProperty* pPGCommonStudyName;
135 wxPGProperty* pPGCommonStudyAuthor;
136
137 // About studies
138 wxPGProperty* pPGStudySpace1;
139 wxPGProperty* pPGStudySpace2;
140 wxPGProperty* pPGStudyTitle;
141 wxPGProperty* pPGStudyGrpSimulation;
142 wxPGProperty* pPGStudyGrpCalendar;
143 wxPGProperty* pPGStudyMCScenarios;
144 wxPGProperty* pPGStudyOutputProfile;
145 wxPGProperty* pPGSimulationMode;
146 wxPGProperty* pPGStudyYears;
147 wxPGProperty* pPGStudyCalendarBegin;
148 wxPGProperty* pPGStudyCalendarEnd;
149 wxPGProperty* pPGStudy1rstJanuary;
150 wxPGProperty* pPGStudyHorizon;
151 wxPGProperty* pPGStudyCalendarMonth;
152 wxPGProperty* pPGStudyLeapYear;
153 wxPGProperty* pPGStudyCalendarWeek;
154 wxPGProperty* pPGStudyBuildMode;
155 wxPGProperty* pPGStudyPlaylist;
156 wxPGProperty* pPGStudySimulationSynthesis;
157 wxPGProperty* pPGStudyYearByYear;
158 wxPGProperty* pPGGeographicTrimming;
159 wxPGProperty* pPGThematicTrimming;
160 wxPGProperty* pPGStudyUseMCScenarios;
161
162 // About Areas
163 wxPGProperty* pPGAreaSeparator;
164 wxPGProperty* pPGAreaTitle;
165 wxPGProperty* pPGAreaGeneral;
166 wxPGProperty* pPGAreaOptimization;
167 wxPGProperty* pPGAreaLocalization;
168 wxPGProperty* pPGAreaFilteringStatus;
169 wxPGProperty* pPGAreaFilteringSynthesis[5];
170 wxPGProperty* pPGAreaFilteringYbY[5];
171 wxPGProperty* pPGAreaDeps;
172 wxPGProperty* pPGAreaResort;
173 wxPGProperty* pPGAreaResortNon;
174 wxPGProperty* pPGAreaResortHydroPower;
175 wxPGProperty* pPGAreaResortOther;
176 wxPGProperty* pPGUnsupplied;
177 wxPGProperty* pPGSpilled;
178 wxPGProperty* pPGAreaName;
179 wxPGProperty* pPGAreaAdequacyPatchTitle;
180 wxPGProperty* pPGAreaAdequacyPatchMode;
181 wxPGProperty* pPGAreaColor;
182 wxPGProperty* pPGAreaLinks;
183 wxPGProperty* pPGAreaPlants;
184
185 // About links
186 wxPGProperty* pPGLinkSeparator;
187 wxPGProperty* pPGLinkFilteringStatus;
188 wxPGProperty* pPGLinkFilteringSynthesis[5];
189 wxPGProperty* pPGLinkFilteringYbY[5];
190 wxPGProperty* pPGLinkColor;
191 wxPGProperty* pPGLinkStyle;
192 wxPGProperty* pPGLinkWidth;
193
194 // About Thermal clusters
195 wxPGProperty* pPGThClusterSeparator;
196 wxPGProperty* pPGThClusterGeneral;
197 wxPGProperty* pPGThClusterParams;
198 wxPGProperty* pPGThClusterReliabilityModel;
199 wxPGProperty* pPGThClusterCosts;
200 wxPGProperty* pPGThClusterName;
201 wxPGProperty* pPGThClusterDoGenerateTS;
202
203public:
204 wxPGProperty* pPGThClusterNominalCapacity;
205 wxPGProperty* pPGThClusterUnitCount;
206 wxPGProperty* pPGThClusterInstalled;
207
208private:
209 wxPGProperty* pPGThClusterEnabled;
210 wxPGProperty* pPGThClusterMustRun;
211 wxPGProperty* pPGThClusterGroup;
212 wxPGProperty* pPGThClusterArea;
213 wxPGProperty* pPGThClusterCO2;
214 wxPGProperty* pPGThClusterVolatilityForced;
215 wxPGProperty* pPGThClusterVolatilityPlanned;
216 wxPGProperty* pPGThClusterLawForced;
217 wxPGProperty* pPGThClusterLawPlanned;
218 wxPGProperty* pPGThClusterSpinning;
219 wxPGProperty* pPGThClusterEfficiency;
220
221 wxPGProperty* pPGThClusterCostGeneration;
222 wxPGProperty* pPGThClusterMarginalCost;
223 wxPGProperty* pPGThClusterFixedCost;
224 wxPGProperty* pPGThClusterStartupCost;
225 wxPGProperty* pPGThClusterOperatingCost;
226 wxPGProperty* pPGThClusterRandomSpread;
227 wxPGProperty* pPGThClusterVariableOMcost;
228
229 wxPGProperty* pPGThClusterMinStablePower;
230 wxPGProperty* pPGThClusterMinUpTime;
231 wxPGProperty* pPGThClusterMinDownTime;
232
233 // About Renewable clusters
234 wxPGProperty* pPGRnClusterSeparator;
235 wxPGProperty* pPGRnClusterGeneral;
236 wxPGProperty* pPGRnClusterName;
237 wxPGProperty* pPGRnClusterGroup;
238 wxPGProperty* pPGRnClusterArea;
239 wxPGProperty* pPGRnClusterParams;
240
241public:
242 wxPGProperty* pPGRnClusterUnitCount;
243 wxPGProperty* pPGRnClusterInstalled;
244 wxPGProperty* pPGRnClusterNominalCapacity;
245
246private:
247 wxPGProperty* pPGRnClusterEnabled;
248 wxPGProperty* pPGRnClusterTSMode;
249
250 // About constraints
251 wxPGProperty* pPGConstraintSeparator;
252 wxPGProperty* pPGConstraintTitle;
253 wxPGProperty* pPGConstraintName;
254 wxPGProperty* pPGConstraintGeneral;
255 wxPGProperty* pPGConstraintComments;
256 wxPGProperty* pPGConstraintEnabled;
257 wxPGProperty* pPGConstraintType;
258
259 // Association between id and a pointer
260 // This ugly map is required because wxMenuItem/Connect() does not support
261 // user-data........
262 std::map<int, void*> mapIDPointer;
263
264 Component::Button* pBtnInspector;
265 bool pAlreadyConnectedToSimulationChangesEvent;
266
267 // Friend !
268 friend class InspectorGrid;
269
270}; // class InspectorFramce
271
272// Singleton
273extern Frame* gInspector;
274
275} // namespace Inspector
276} // namespace Window
277} // namespace Antares
278
279#endif // __ANTARES_WINDOWS_INSPECTOR_FRAME_H__
Definition button.h:34
Panel implementation.
Definition panel.h:36
Frame(wxWindow *parent, bool allowAnyObject=false)
Default constructor.
Definition frame.cpp:196
void delayApplyGlobalSelection()
Apply the global selection (delayed)
Definition frame.cpp:93
void detachFromTheMainForm()
Detach this inspector from the main form.
Definition frame.cpp:578
void apply(const InspectorData::Ptr &data)
Prepare the inspector with the given selection of objects.
Definition frame.cpp:641
virtual ~Frame()
Destructor.
Definition frame.cpp:558
void delayApply()
Apply the current selection (delayed)
Definition frame.cpp:83
void attachToTheMainForm()
Attach this inspector to the main form.
Definition frame.cpp:586
std::shared_ptr< InspectorData > Ptr
The most suitable smart pointer for the class.
Definition data.h:44
Custom implementation of a property grid.
Definition grid.h:41
Save As Dialog
Definition notes.h:36