Antares Simulator
Power System Simulator
xcast-translation.h
1 /*
2  * Copyright 2007-2025, 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_H__
22 #define __ANTARES_TOOLBOX_COMPONENT_DATAGRID_RENDERER_AREA_XCAST_TRANSLATION_H__
23 
24 #include "../area.h"
25 #include "../matrix.h"
26 
27 namespace Antares::Component::Datagrid::Renderer
28 {
29 template<enum Data::TimeSeriesType T>
30 class XCastTranslation final: public Renderer::Matrix<int32_t>, public Renderer::ARendererArea
31 {
32 public:
35 
36 public:
38 
39 
43  XCastTranslation(wxWindow* control, Toolbox::InputSelector::Area* notifier);
44 
46  virtual ~XCastTranslation();
47 
49 
50  virtual int width() const
51  {
53  }
54 
55  virtual int height() const
56  {
58  }
59 
60  virtual wxString columnCaption(int colIndx) const;
61 
62  virtual wxString rowCaption(int rowIndx) const;
63 
64  virtual wxString cellValue(int x, int y) const;
65 
66  virtual double cellNumericValue(int x, int y) const;
67 
68  virtual bool cellValue(int x, int y, const Yuni::String& value);
69 
70  virtual void resetColors(int, int, wxColour&, wxColour&) const
71  { /*Do nothing*/
72  }
73 
74  virtual IRenderer::CellStyle cellStyle(int col, int row) const;
75 
76  virtual wxColour horizontalBorderColor(int x, int y) const;
77 
78  virtual uint maxWidthResize() const
79  {
80  return 0;
81  }
82 
83  virtual bool valid() const
84  {
85  return MatrixAncestorType::valid();
86  }
87 
88  virtual Date::Precision precision()
89  {
90  return Date::hourly;
91  }
92 
93 protected:
94  virtual void internalAreaChanged(Data::Area* area);
96  virtual void onStudyClosed() override;
98  virtual void onStudyLoaded() override;
99 
100 }; // class XCastTranslation
101 
102 } // namespace Antares::Component::Datagrid::Renderer
103 
104 #include "xcast-translation.hxx"
105 
106 #endif // __ANTARES_TOOLBOX_COMPONENT_DATAGRID_RENDERER_AREA_XCAST_TRANSLATION_H__
virtual int height() const override
Get the height of the datagrid.
virtual int width() const override
Get the width of the datagrid.
virtual wxString columnCaption(int colIndx) const
Get the column caption.
Definition: xcast-translation.hxx:43
virtual int width() const
Get the current width.
Definition: xcast-translation.h:50
virtual wxString cellValue(int x, int y) const
Get the string representation of a cell.
Definition: xcast-translation.hxx:49
virtual void onStudyClosed() override
Event: the study has been closed.
Definition: xcast-translation.hxx:117
virtual wxString rowCaption(int rowIndx) const
Get the row caption.
Definition: xcast-translation.hxx:89
virtual double cellNumericValue(int x, int y) const
Get the value of a cell.
Definition: xcast-translation.hxx:55
virtual uint maxWidthResize() const
The most suitable column count.
Definition: xcast-translation.h:78
virtual int height() const
Get the current height.
Definition: xcast-translation.h:55
virtual ~XCastTranslation()
Destructor.
Definition: xcast-translation.hxx:37
virtual Date::Precision precision()
Time Precision.
Definition: xcast-translation.h:88
virtual wxColour horizontalBorderColor(int x, int y) const
Get the color of the horizontal bottom border.
Definition: xcast-translation.hxx:95
XCastTranslation(wxWindow *control, Toolbox::InputSelector::Area *notifier)
Constructor.
Definition: xcast-translation.hxx:30
virtual void onStudyLoaded() override
Event: the study has been loaded.
Definition: xcast-translation.hxx:124
Definition for a single area.
Definition: area.h:51
A n-by-n matrix.
Definition: matrix.h:44
Visual Component for displaying all available areas (and groups)
Definition: area.h:37