Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
infos.h
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_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
30namespace Antares
31{
32namespace Map
33{
37class PanelInfos : public wxPanel
38{
39public:
41 using ItemList = std::vector<Item*>;
43 enum IDs
44 {
45 idChangeColor = 10000,
46 idDefaultColor,
47 idOrientation,
48 idAreaName,
49 };
50
51public:
53
54
58 PanelInfos(wxWindow* parent);
60 virtual ~PanelInfos();
62
72 void refresh(ItemList& newList, const bool force = false);
73
74private:
78 bool listIsEquals(const ItemList& list) const;
79
83 wxBoxSizer* createColorPicker(const wxColour& color);
84
88 void countItemSpecies(const ItemList& list, int& nodes, int& connections) const;
89
93 wxColour findCommonColour(const ItemList& list) const;
94
98 wxCheckBoxState findConnectionOrientation(const ItemList& list) const;
99
100 void onChangeColor(wxColourPickerEvent& evt);
101 void onChangeToDefaultColor(wxCommandEvent& evt);
102 void onChangeOrientation(wxCommandEvent& evt);
103 void onChangeAreaName(wxCommandEvent& evt);
104
105 void layoutAddTitle(const wxString& title);
106
108 void layoutNoSelection();
110 void layoutPropertiesForNodes(const int nodeCount);
112 void layoutPropertiesForConnections(const int connectionCount);
114 void layoutFiltersForNodes(const int nodeCount);
116 void layoutFiltersForConnections(const int connectionCount);
117
118private:
124 ItemList pItemList;
126 wxColourPickerCtrl* pColorPicker;
127
128 // Event table
129 DECLARE_EVENT_TABLE()
130
131}; // class PanelInfos
132
133} // namespace Map
134} // namespace Antares
135
136#endif // __ANTARES_TOOLBOX_MAP_PANEL_INFOS_H__
Informations about the selected items on the map.
Definition infos.h:38
PanelInfos(wxWindow *parent)
Default constructor.
Definition infos.cpp:67
void refresh(ItemList &newList, const bool force=false)
Refresh all information about a list of nodes.
Definition infos.cpp:358
IDs
IDs.
Definition infos.h:44
std::vector< Item * > ItemList
List of item.
Definition infos.h:41
virtual ~PanelInfos()
Destructor.
Definition infos.cpp:75