Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
cell.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
22#pragma once
23
24#include <wx/string.h>
25#include "../renderer.h"
26#include <map>
27
28using namespace Yuni;
29
30namespace Antares
31{
32namespace Component
33{
34namespace Datagrid
35{
36namespace Renderer
37{
38using namespace Antares::Data;
39
40class Cell : public Yuni::IEventObserver<Cell>
41{
42public:
43 Cell(TimeSeriesType ts);
44 ~Cell();
45 virtual wxString cellValue() const = 0;
46 virtual double cellNumericValue() const = 0;
47 virtual bool setCellValue(const String& value) = 0;
48 virtual IRenderer::CellStyle cellStyle() const = 0;
49
50protected:
51 void onStudyLoaded();
52 virtual bool isTSgeneratorOn() const;
53
54protected:
55 Data::Study::Ptr study_;
56 TimeSeriesType tsKind_;
57};
58
59class blankCell : public Cell
60{
61public:
62 blankCell();
63 ~blankCell() = default;
64 wxString cellValue() const override;
65 double cellNumericValue() const override;
66 bool setCellValue(const String& value) override;
67 IRenderer::CellStyle cellStyle() const override;
68};
69
70class inactiveCell : public Cell
71{
72public:
73 inactiveCell(wxString toPrintInCell);
74 ~inactiveCell() = default;
75 wxString cellValue() const override;
76 double cellNumericValue() const override;
77 bool setCellValue(const String& value) override;
78 IRenderer::CellStyle cellStyle() const override;
79
80private:
81 wxString toBePrintedInCell_;
82};
83
84class readyMadeTSstatus : public Cell
85{
86public:
87 readyMadeTSstatus(TimeSeriesType ts);
88 ~readyMadeTSstatus() = default;
89 wxString cellValue() const override;
90 double cellNumericValue() const override;
91 bool setCellValue(const String& value) override;
92 IRenderer::CellStyle cellStyle() const override;
93};
94
95class generatedTSstatus : public Cell
96{
97public:
98 generatedTSstatus(TimeSeriesType ts);
99 ~generatedTSstatus() = default;
100 wxString cellValue() const override;
101 double cellNumericValue() const override;
102 bool setCellValue(const String& value) override;
103 IRenderer::CellStyle cellStyle() const override;
104};
105
106class NumberTsCell : public Cell
107{
108public:
109 NumberTsCell(TimeSeriesType ts);
110 ~NumberTsCell() = default;
111 wxString cellValue() const override;
112 double cellNumericValue() const override;
113 bool setCellValue(const String& value) override;
114 IRenderer::CellStyle cellStyle() const override;
115
116private:
117 void onStudyLoaded();
118
119private:
120 std::map<TimeSeriesType, uint*> tsToNumberTs_;
121};
122
124{
125public:
127 IRenderer::CellStyle cellStyle() const override;
128};
129
130class RefreshTsCell : public Cell
131{
132public:
133 RefreshTsCell(TimeSeriesType ts);
134 ~RefreshTsCell() = default;
135 wxString cellValue() const override;
136 double cellNumericValue() const override;
137 bool setCellValue(const String& value) override;
138 IRenderer::CellStyle cellStyle() const override;
139};
140
142{
143public:
145 IRenderer::CellStyle cellStyle() const override;
146};
147
148class RefreshSpanCell : public Cell
149{
150public:
151 RefreshSpanCell(TimeSeriesType ts);
152 ~RefreshSpanCell() = default;
153 wxString cellValue() const override;
154 double cellNumericValue() const override;
155 bool setCellValue(const String& value) override;
156 IRenderer::CellStyle cellStyle() const override;
157
158private:
159 void onStudyLoaded();
160
161private:
162 std::map<TimeSeriesType, uint*> tsToRefreshSpan_;
163};
164
166{
167public:
169 IRenderer::CellStyle cellStyle() const override;
170};
171
173{
174public:
175 SeasonalCorrelationCell(TimeSeriesType ts);
176 ~SeasonalCorrelationCell() = default;
177 virtual wxString cellValue() const override;
178 double cellNumericValue() const override;
179 bool setCellValue(const String& value) override;
180 IRenderer::CellStyle cellStyle() const override;
181
182private:
183 void onStudyLoaded();
184
185private:
186 std::map<TimeSeriesType, Correlation*> tsToCorrelation_;
187};
188
190{
191public:
193 wxString cellValue() const override;
194 IRenderer::CellStyle cellStyle() const override;
195};
196
197class storeToInputCell : public Cell
198{
199public:
200 storeToInputCell(TimeSeriesType ts);
201 ~storeToInputCell() = default;
202 wxString cellValue() const override;
203 double cellNumericValue() const override;
204 bool setCellValue(const String& value) override;
205 IRenderer::CellStyle cellStyle() const override;
206};
207
209{
210public:
211 storeToOutputCell(TimeSeriesType ts);
212 ~storeToOutputCell() = default;
213 wxString cellValue() const override;
214 double cellNumericValue() const override;
215 bool setCellValue(const String& value) override;
216 IRenderer::CellStyle cellStyle() const override;
217};
218
219class intraModalCell : public Cell
220{
221public:
222 intraModalCell(TimeSeriesType ts);
223 ~intraModalCell() = default;
224 wxString cellValue() const override;
225 double cellNumericValue() const override;
226 bool setCellValue(const String& value) override;
227 IRenderer::CellStyle cellStyle() const override;
228};
229
230class interModalCell : public Cell
231{
232public:
233 interModalCell(TimeSeriesType ts);
234 ~interModalCell() = default;
235 wxString cellValue() const override;
236 double cellNumericValue() const override;
237 bool setCellValue(const String& value) override;
238 IRenderer::CellStyle cellStyle() const override;
239};
240
241} // namespace Renderer
242} // namespace Datagrid
243} // namespace Component
244} // namespace Antares