Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
sets.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_APPLICATION_WINDOWS_SETS_H__
22#define __ANTARES_APPLICATION_WINDOWS_SETS_H__
23
24#include <ui/common/component/panel.h>
25#include <wx/richtext/richtextctrl.h>
26#include <wx/richtext/richtextstyles.h>
27
28namespace Antares
29{
30namespace Window
31{
35class Sets final : public Antares::Component::Panel, public Yuni::IEventObserver<Sets>
36{
37public:
38 enum IDs
39 {
40 mnIDUserNotes = wxID_HIGHEST + 1,
41 };
42
46 static Yuni::Event<void(Sets* sender)> OnChanged;
47
48public:
49 // \name Constructors & Destructor
51
54 Sets(wxWindow* parent, uint margin = 18);
56 virtual ~Sets();
58
62 void saveToStudy();
63
67 void loadFromStudy();
68
73
78
79private:
80 void onNewSet(void*);
81
82 void onCaption(void*);
83 void onFilter(void*);
84 void onOutput(void*);
85 void onComments(void*);
86
87 void onAdd(void*);
88 void onRemove(void*);
89
90 void onCheck(void*);
91
92 void onUserNotesCharacter(wxRichTextEvent& evt);
93 void onUserNotesStyleChanged(wxRichTextEvent& evt);
94
95 void onSetsModified(Sets* sender);
96
97 void notifyChanges();
98
99 void onStudyClosed();
100
108 bool initializeTemporaryFile();
109
110private:
112 wxRichTextCtrl* pRichEdit;
113 wxRichTextStyleSheet* pStyleSheet;
114 uint pLocalRevision;
115 uint pUpdatesToSkip;
116
123 YString pTempFile;
124
125 // Event Table
126 DECLARE_EVENT_TABLE()
127
128}; // class Sets
129
130} // namespace Window
131} // namespace Antares
132
133#endif // __ANTARES_APPLICATION_WINDOWS_SETS_H__
Panel implementation.
Definition panel.h:36
Save As Dialog
Definition sets.h:36
void saveToStudy()
Save the sets to the study.
Definition sets.cpp:564
virtual ~Sets()
Destructor.
Definition sets.cpp:143
Sets(wxWindow *parent, uint margin=18)
Constructor with a parent window and a study.
Definition sets.cpp:61
void disconnectFromNotification()
Disconnect from the notifications of the sets updates.
Definition sets.cpp:519
void loadFromStudy()
Load the sets from the study.
Definition sets.cpp:524
static Yuni::Event< void(Sets *sender)> OnChanged
Event triggered when the sets are changed.
Definition sets.h:46
void connectToNotification()
Connect to the notification of sets updates.
Definition sets.cpp:513