Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
xcast-k.hxx
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#include <antares/study/xcast/xcast.h>
23
24namespace Antares
25{
26namespace Component
27{
28namespace Datagrid
29{
30namespace Renderer
31{
32template<enum Data::TimeSeriesType T>
33XCastK<T>::XCastK(wxWindow* control, Toolbox::InputSelector::Area* notifier) :
34 MatrixAncestorType(control), Renderer::ARendererArea(control, notifier)
35{
36}
37
38template<enum Data::TimeSeriesType T>
40{
41 destroyBoundEvents();
42}
43
44template<enum Data::TimeSeriesType T>
45wxString XCastK<T>::columnCaption(int colIndx) const
46{
47 return (colIndx < 12) ? wxStringFromUTF8(Date::MonthToString(colIndx)) << wxT(" ")
48 : wxString();
49}
50
51template<enum Data::TimeSeriesType T>
52wxString XCastK<T>::cellValue(int x, int y) const
53{
54 return MatrixAncestorType::cellValue(x, y);
55}
56
57template<enum Data::TimeSeriesType T>
58double XCastK<T>::cellNumericValue(int x, int y) const
59{
60 return MatrixAncestorType::cellNumericValue(x, y);
61}
62
63template<enum Data::TimeSeriesType T>
64bool XCastK<T>::cellValue(int x, int y, const Yuni::String& value)
65{
66 return MatrixAncestorType::cellValue(x, y, value);
67}
68
69template<enum Data::TimeSeriesType T>
71{
72 if (area)
73 {
74 auto* xcastData = area->xcastData<T>();
75 this->matrix(&(xcastData->K));
76 }
77 else
78 this->matrix(nullptr);
79 // parent
80 Renderer::ARendererArea::internalAreaChanged(area);
81}
82
83template<enum Data::TimeSeriesType T>
84inline IRenderer::CellStyle XCastK<T>::cellStyle(int col, int row) const
85{
86 return MatrixAncestorType::cellStyle(col, row);
87}
88
89template<enum Data::TimeSeriesType T>
90inline wxString XCastK<T>::rowCaption(int rowIndx) const
91{
92 return wxString() << rowIndx;
93}
94
95template<enum Data::TimeSeriesType T>
96inline int XCastK<T>::width() const
97{
98 return MatrixAncestorType::width();
99}
100
101template<enum Data::TimeSeriesType T>
102inline int XCastK<T>::height() const
103{
104 return MatrixAncestorType::height();
105}
106
107template<enum Data::TimeSeriesType T>
108inline uint XCastK<T>::maxWidthResize() const
109{
110 return 0;
111}
112
113template<enum Data::TimeSeriesType T>
114inline bool XCastK<T>::valid() const
115{
116 return MatrixAncestorType::valid();
117}
118
119template<enum Data::TimeSeriesType T>
125
126template<enum Data::TimeSeriesType T>
132
133} // namespace Renderer
134} // namespace Datagrid
135} // namespace Component
136} // namespace Antares
virtual void onStudyClosed() override
The study has been closed.
Definition area.cpp:83
virtual void onStudyLoaded() override
Event: the study has been loaded.
Definition area.cpp:89
virtual void onStudyLoaded() override
Event: the study has been loaded.
Definition matrix.hxx:244
virtual void onStudyClosed() override
Event: the study has been closed.
Definition matrix.hxx:238
XCastK(wxWindow *control, Toolbox::InputSelector::Area *notifier)
Constructor.
Definition xcast-k.hxx:33
virtual void onStudyClosed() override
Event: the study has been closed.
Definition xcast-k.hxx:120
virtual wxString rowCaption(int rowIndx) const
Get the row caption.
Definition xcast-k.hxx:90
virtual double cellNumericValue(int x, int y) const
Get the value of a cell.
Definition xcast-k.hxx:58
virtual wxString cellValue(int x, int y) const
Get the value of a cell.
Definition xcast-k.hxx:52
virtual int width() const
Get the width of the datagrid.
Definition xcast-k.hxx:96
virtual uint maxWidthResize() const
The most suitable column count.
Definition xcast-k.hxx:108
virtual int height() const
Get the height of the datagrid.
Definition xcast-k.hxx:102
virtual void onStudyLoaded() override
Event: the study has been loaded.
Definition xcast-k.hxx:127
virtual ~XCastK()
Destructor.
Definition xcast-k.hxx:39
virtual wxString columnCaption(int colIndx) const
Get the column caption.
Definition xcast-k.hxx:45
Definition for a single area.
Definition area.h:52
Visual Component for displaying all available areas (and groups)
Definition area.h:41