Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
xcast-translation.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#ifndef __ANTARES_TOOLBOX_COMPONENT_DATAGRID_RENDERER_AREA_XCAST_TRANSLATION_HXX__
22#define __ANTARES_TOOLBOX_COMPONENT_DATAGRID_RENDERER_AREA_XCAST_TRANSLATION_HXX__
23
24#include <antares/study/xcast/xcast.h>
25#include <antares/date/date.h>
26
27namespace Antares
28{
29namespace Component
30{
31namespace Datagrid
32{
33namespace Renderer
34{
35template<enum Data::TimeSeriesType T>
37 MatrixAncestorType(control), Renderer::ARendererArea(control, notifier)
38{
39}
40
41template<enum Data::TimeSeriesType T>
43{
44 destroyBoundEvents();
45}
46
47template<enum Data::TimeSeriesType T>
48inline wxString XCastTranslation<T>::columnCaption(int colIndx) const
49{
50 return MatrixAncestorType::columnCaption(colIndx);
51}
52
53template<enum Data::TimeSeriesType T>
54wxString XCastTranslation<T>::cellValue(int x, int y) const
55{
56 return MatrixAncestorType::cellValue(x, y);
57}
58
59template<enum Data::TimeSeriesType T>
60inline double XCastTranslation<T>::cellNumericValue(int x, int y) const
61{
62 return MatrixAncestorType::cellNumericValue(x, y);
63}
64
65template<enum Data::TimeSeriesType T>
66inline bool XCastTranslation<T>::cellValue(int x, int y, const Yuni::String& value)
67{
68 return MatrixAncestorType::cellValue(x, y, value);
69}
70
71template<enum Data::TimeSeriesType T>
73{
74 if (area)
75 {
76 auto* xcastData = area->xcastData<T>();
77 this->matrix(&(xcastData->translation));
78 }
79 else
80 this->matrix(nullptr);
81 // parent
82 Renderer::ARendererArea::internalAreaChanged(area);
83}
84
85template<enum Data::TimeSeriesType T>
86inline IRenderer::CellStyle XCastTranslation<T>::cellStyle(int col, int row) const
87{
88 return MatrixAncestorType::cellStyle(col, row);
89}
90
91template<enum Data::TimeSeriesType T>
92inline wxString XCastTranslation<T>::rowCaption(int rowIndx) const
93{
94 return MatrixAncestorType::rowCaption(rowIndx);
95}
96
97template<enum Data::TimeSeriesType T>
99{
100 // Getting informations about the next hour
101 // (because the returned color is about the bottom border of the cell,
102 // so the next hour for the user)
103 if (!(!study) && y + 1 < Date::Calendar::maxHoursInYear)
104 {
105 auto& hourinfo = study->calendar.hours[y + 1];
106
107 if (hourinfo.firstHourInMonth)
108 return Default::BorderMonthSeparator();
109 if (hourinfo.firstHourInDay)
110 return Default::BorderDaySeparator();
111 }
113}
114
115template<enum Data::TimeSeriesType T>
121
122template<enum Data::TimeSeriesType T>
128
129} // namespace Renderer
130} // namespace Datagrid
131} // namespace Component
132} // namespace Antares
133
134#endif // __ANTARES_TOOLBOX_COMPONENT_DATAGRID_RENDERER_AREA_XCAST_TRANSLATION_HXX__
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 wxColour verticalBorderColor(int x, int y) const
Get the color of the vertical right border.
Definition renderer.hxx:75
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
virtual wxString columnCaption(int colIndx) const
Get the column caption.
Definition xcast-translation.hxx:48
virtual wxString cellValue(int x, int y) const
Get the value of a cell.
Definition xcast-translation.hxx:54
virtual void onStudyClosed() override
Event: the study has been closed.
Definition xcast-translation.hxx:116
virtual wxString rowCaption(int rowIndx) const
Get the row caption.
Definition xcast-translation.hxx:92
virtual double cellNumericValue(int x, int y) const
Get the value of a cell.
Definition xcast-translation.hxx:60
virtual ~XCastTranslation()
Destructor.
Definition xcast-translation.hxx:42
virtual wxColour horizontalBorderColor(int x, int y) const
Get the color of the horizontal bottom border.
Definition xcast-translation.hxx:98
XCastTranslation(wxWindow *control, Toolbox::InputSelector::Area *notifier)
Constructor.
Definition xcast-translation.hxx:36
virtual void onStudyLoaded() override
Event: the study has been loaded.
Definition xcast-translation.hxx:123
Definition for a single area.
Definition area.h:52
@ maxHoursInYear
The maximum number of hours in a year.
Definition date.h:192
Visual Component for displaying all available areas (and groups)
Definition area.h:41