Antares Simulator
Power System Simulator
thermal-cluster-order.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 "cluster-order.h"
25 #include <map>
26 #include <list>
27 
28 namespace Antares::Component::HTMLListbox::Datasource
29 {
30 using ThermalClusterList = std::list<Data::ThermalCluster*>;
31 using ThermalClusterMap = std::map<wxString, ThermalClusterList>;
32 
34 {
35 public:
37 
41  virtual ~ThermalClustersByOrder();
43 
44 private:
45  virtual void sortClustersInGroup(ThermalClusterList& clusterList) = 0;
46 
47  void reorderItemsList(const wxString& search) override;
48  void rebuildItemsList(const wxString& search) override;
49 
50 }; // ThermalClustersByOrder
51 
53 {
54 public:
56 
61 
63 
64  wxString name() const override
65  {
66  return wxT("Thermal clusters in alphabetical order");
67  }
68 
69  const char* icon() const override
70  {
71  return "images/16x16/sort_alphabet.png";
72  }
73 
74 private:
75  void sortClustersInGroup(ThermalClusterList& clusterList) override;
76 
77 }; // class ThermalClustersByAlphaOrder
78 
80 {
81 public:
83 
88 
90 
91  virtual wxString name() const
92  {
93  return wxT("Thermal clusters in reverse alphabetical order");
94  }
95 
96  virtual const char* icon() const
97  {
98  return "images/16x16/sort_alphabet_descending.png";
99  }
100 
101 private:
102  void sortClustersInGroup(ThermalClusterList& clusterList) override;
103 
104 }; // class ThermalClustersByAlphaReverseOrder
105 
106 } // namespace Antares::Component::HTMLListbox::Datasource
Listbox with HTML content.
Definition: component.h:46
const char * icon() const override
Get the relative path to the icon file.
Definition: thermal-cluster-order.h:69
virtual ~ThermalClustersByAlphaOrder()
Destructor.
Definition: thermal-cluster-order.cpp:163
wxString name() const override
Get the name of the datasource.
Definition: thermal-cluster-order.h:64
ThermalClustersByAlphaOrder(HTMLListbox::Component &parent)
Default Constructor.
Definition: thermal-cluster-order.cpp:158
virtual wxString name() const
Get the name of the datasource.
Definition: thermal-cluster-order.h:91
virtual ~ThermalClustersByAlphaReverseOrder()
Destructor.
Definition: thermal-cluster-order.cpp:181
virtual const char * icon() const
Get the relative path to the icon file.
Definition: thermal-cluster-order.h:96
ThermalClustersByAlphaReverseOrder(HTMLListbox::Component &parent)
Default Constructor.
Definition: thermal-cluster-order.cpp:175
virtual ~ThermalClustersByOrder()
Destructor.
Definition: thermal-cluster-order.cpp:36
ThermalClustersByOrder(HTMLListbox::Component &parent)
Default Constructor.
Definition: thermal-cluster-order.cpp:31