Antares Simulator
Power System Simulator
bindingconstraint.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_APPLICATION_WINDOW_BINDING_CONSTRAINT_H__
22 #define __ANTARES_APPLICATION_WINDOW_BINDING_CONSTRAINT_H__
23 
24 #include "../../toolbox/components/notebook/notebook.h"
25 #include "../../toolbox/components/datagrid/component.h"
26 #include "../../toolbox/input/bindingconstraint.h"
27 #include <ui/common/component/panel.h>
28 
29 namespace Antares::Window
30 {
31 class BindingConstraintWeightsPanel;
32 class BindingConstraintOffsetsPanel;
33 
37 class BindingConstraint: public Component::Panel, public Yuni::IEventObserver<BindingConstraint>
38 {
39 public:
41 
42 
47  BindingConstraint(wxWindow* parent);
49  virtual ~BindingConstraint();
51 
52  void selectDefaultPage();
53 
54 private:
55  void onPageChanged(Component::Notebook::Page& page);
56 
57  void onSelectedConstraint(Data::BindingConstraint* contraint);
58  void onDblClickConstraint(Data::BindingConstraint* contraint);
59 
60  void onAdd(void*);
61  void onAddFromMouse(wxMouseEvent&);
62  void onDelete(void*);
63  void onDeleteFromMouse(wxMouseEvent&);
64  void onEdit(void*);
65  void onDeleteAll(void*);
66  void onEditFromMouse(wxMouseEvent&);
67 
68 private:
69  Component::Notebook::Page* pPageList;
70  Component::Notebook::Page* pPageWeights;
71  Component::Notebook::Page* pPageOffsets;
73  Data::BindingConstraint* pSelected;
74 
75  BindingConstraintWeightsPanel* pWeightsPanel;
76  BindingConstraintOffsetsPanel* pOffsetsPanel;
77 
78 public:
79  // Event table
80  DECLARE_EVENT_TABLE()
81 
82 }; // class BindingConstraint
83 
84 } // namespace Antares::Window
85 
86 #endif // __ANTARES_APPLICATION_WINDOW_BINDING_CONSTRAINT_H__
Definition: notebook.h:61
Panel implementation.
Definition: panel.h:34
Definition: BindingConstraint.h:49
Definition: bindingconstraint.h:31
Definition: bindingconstraint.cpp:146
Definition: bindingconstraint.cpp:52
Settings for a single Binding constraint.
Definition: bindingconstraint.h:38
virtual ~BindingConstraint()
Destructor.
Definition: bindingconstraint.cpp:346
BindingConstraint(wxWindow *parent)
Constructor.
Definition: bindingconstraint.cpp:237