Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
performer.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_EXT_SOURCE_PERFORMER_H__
22#define __ANTARES_APPLICATION_EXT_SOURCE_PERFORMER_H__
23
24#include <antares/study/study.h>
25#include <yuni/thread/thread.h>
26#include <wx/timer.h>
27#include <wx/dialog.h>
28#include <action/action.h>
29#include "../components/progressbar.h"
30#include <atomic>
31#include <mutex>
32
33namespace Antares
34{
35namespace Window
36{
37class PerformerDialog : public wxDialog
38{
39public:
41
42
45 PerformerDialog(wxWindow* parent,
46 const Antares::Action::Context::Ptr& context,
48
50 virtual ~PerformerDialog();
52
57
62
63 void notifyHasBeenModified();
64
65 void notifyProgression(int progress, int max);
66
67 void updateGUI();
68
69private:
71 void onCancel(void*);
72
73 void delegateUserInfo(const Yuni::String& text);
74
75 void closeWindow();
76
77private:
79 bool pHasBeenModified;
80
82 Antares::Action::Context::Ptr pContext;
88 wxButton* pBtnCancel;
89
90 wxStaticText* pLblMessage;
91
92 Yuni::String pNextMessage;
93
94 wxTimer* pTimer;
95
96 Yuni::Thread::IThread* pThread;
97 std::mutex pMutex;
98 std::atomic<int> pGUINeedRefresh;
99 std::atomic<int> pProgression;
100 std::atomic<int> pProgressionMax;
101
102}; // class PerformerDialog
103
104} // namespace Window
105} // namespace Antares
106
107#endif // __ANTARES_APPLICATION_EXT_SOURCE_PERFORMER_H__
AncestorType::Ptr Ptr
The most suitable smart ptr for the class.
Definition action.h:43
A simple panel with a caption.
Definition progressbar.h:34
Definition performer.h:38
void closeThenOpenActionsDialog()
Open the actions dialog.
Definition performer.cpp:282
virtual ~PerformerDialog()
Destructor.
Definition performer.cpp:266
void askForClosingTheWindow()
Close the window.
Definition performer.cpp:375
PerformerDialog(wxWindow *parent, const Antares::Action::Context::Ptr &context, const Antares::Action::IAction::Ptr &root)
Default Constructor.
Definition performer.cpp:160