Antares Simulator
Power System Simulator
infos.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_MAP_PANEL_INFOS_H__
22 #define __ANTARES_TOOLBOX_MAP_PANEL_INFOS_H__
23 
24 #include <wx/panel.h>
25 #include <wx/sizer.h>
26 #include "nodes/item.h"
27 #include <wx/clrpicker.h>
28 #include <wx/checkbox.h>
29 
30 namespace Antares::Map
31 {
35 class PanelInfos: public wxPanel
36 {
37 public:
39  using ItemList = std::vector<Item*>;
40 
42  enum IDs
43  {
44  idChangeColor = 10000,
45  idDefaultColor,
46  idOrientation,
47  idAreaName,
48  };
49 
50 public:
52 
53 
57  PanelInfos(wxWindow* parent);
59  virtual ~PanelInfos();
61 
71  void refresh(ItemList& newList, const bool force = false);
72 
73 private:
77  bool listIsEquals(const ItemList& list) const;
78 
82  wxBoxSizer* createColorPicker(const wxColour& color);
83 
87  void countItemSpecies(const ItemList& list, int& nodes, int& connections) const;
88 
92  wxColour findCommonColour(const ItemList& list) const;
93 
97  wxCheckBoxState findConnectionOrientation(const ItemList& list) const;
98 
99  void onChangeColor(wxColourPickerEvent& evt);
100  void onChangeToDefaultColor(wxCommandEvent& evt);
101  void onChangeOrientation(wxCommandEvent& evt);
102  void onChangeAreaName(wxCommandEvent& evt);
103 
104  void layoutAddTitle(const wxString& title);
105 
107  void layoutNoSelection();
109  void layoutPropertiesForNodes(const int nodeCount);
111  void layoutPropertiesForConnections(const int connectionCount);
113  void layoutFiltersForNodes(const int nodeCount);
115  void layoutFiltersForConnections(const int connectionCount);
116 
117 private:
123  ItemList pItemList;
125  wxColourPickerCtrl* pColorPicker;
126 
127  // Event table
128  DECLARE_EVENT_TABLE()
129 
130 }; // class PanelInfos
131 
132 } // namespace Antares::Map
133 
134 #endif // __ANTARES_TOOLBOX_MAP_PANEL_INFOS_H__
Informations about the selected items on the map.
Definition: infos.h:36
PanelInfos(wxWindow *parent)
Default constructor.
Definition: infos.cpp:65
void refresh(ItemList &newList, const bool force=false)
Refresh all information about a list of nodes.
Definition: infos.cpp:385
IDs
IDs.
Definition: infos.h:43
std::vector< Item * > ItemList
List of item.
Definition: infos.h:39
virtual ~PanelInfos()
Destructor.
Definition: infos.cpp:75