Antares Simulator
Power System Simulator
ts-management.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 
22 #pragma once
23 
24 #include <vector>
25 #include "../renderer.h"
26 #include "column.h"
27 #include "../../../../application/study.h"
28 
29 namespace Antares::Component::Datagrid::Renderer
30 {
31 class TSmanagement: public IRenderer
32 {
33 public:
34  TSmanagement();
35  virtual ~TSmanagement();
36 
37  virtual wxString columnCaption(int colIndx) const override;
38 
39  virtual wxString rowCaption(int rowIndx) const;
40 
41  virtual wxString cellValue(int x, int y) const;
42 
43  virtual double cellNumericValue(int x, int y) const;
44 
45  virtual bool cellValue(int x, int y, const Yuni::String& value);
46 
47  virtual void resetColors(int, int, wxColour&, wxColour&) const
48  {
49  // Do nothing
50  }
51 
52  virtual bool valid() const
53  {
54  return !(!study);
55  }
56 
57  virtual uint maxWidthResize() const
58  {
59  return 0;
60  }
61 
62  virtual IRenderer::CellStyle cellStyle(int col, int row) const;
63 
64  virtual wxColour horizontalBorderColor(int x, int y) const;
65 
66  void control(wxWindow* control)
67  {
68  pControl = control;
69  }
70 
71 protected:
72  virtual int width() const;
73  int height() const;
74  void checkLineNumberInColumns();
75 
76 private:
77  void onSimulationTSManagementChanged();
78 
79 protected:
80  const int MAX_NB_OF_LINES = 13;
81  std::vector<Column*> columns_;
82  wxWindow* pControl;
83 
84 }; // class TSmanagement
85 
86 } // namespace Antares::Component::Datagrid::Renderer
Data provider for Datagrids.
Definition: renderer.h:50
Data::Study::Ptr study
Attached study (if any)
Definition: renderer.h:287
virtual uint maxWidthResize() const
The most suitable column count.
Definition: ts-management.h:57
virtual bool cellValue(int x, int y, const Yuni::String &value)
Try to modify a cell value.
virtual wxString rowCaption(int rowIndx) const
Get the caption of a row.
Definition: ts-management.cpp:76
virtual double cellNumericValue(int x, int y) const
Get the floating value of a Cell.
Definition: ts-management.cpp:112
int height() const
The effective height of the grid.
Definition: ts-management.cpp:62
virtual wxString columnCaption(int colIndx) const override
Get the caption of a column.
Definition: ts-management.cpp:67
virtual wxString cellValue(int x, int y) const
Get the string representation of a Cell.
Definition: ts-management.cpp:121
virtual wxColour horizontalBorderColor(int x, int y) const
Get the color of the horizontal bottom border.
Definition: ts-management.cpp:150
virtual int width() const
The effective width of the grid.
Definition: ts-management.cpp:57