Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
run.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_SIMULATION_RUN_H__
22#define __ANTARES_APPLICATION_WINDOWS_SIMULATION_RUN_H__
23
24#include <yuni/thread/thread.h>
25#include <antares/study/study.h>
26
27#include <wx/dialog.h>
28#include <wx/sizer.h>
29#include <wx/checkbox.h>
30#include <wx/combobox.h>
31#include <wx/choice.h>
32#include <wx/stattext.h>
33#include <wx/timer.h>
34#include "../../toolbox/components/button.h"
35
36namespace Antares
37{
38namespace Window
39{
40namespace Simulation
41{
42class Run final : public wxDialog
43{
44public:
46
47
53 explicit Run(wxWindow* parent, bool preproOnly = false);
55 virtual ~Run();
57
58private:
59 void gridAppend(wxFlexGridSizer& sizer,
60 const wxString& title,
61 const wxString& key,
62 wxWindow* value,
63 bool bold = false);
64 void gridAppend(wxFlexGridSizer& sizer,
65 const wxString& title,
66 const wxString& key,
67 const wxString& value);
68 void gridAppend(wxFlexGridSizer& sizer, wxWindow* key, wxWindow* value);
69 void gridAppend(wxFlexGridSizer& sizer, wxWindow* key, wxSizer* value);
70 void gridAppend(wxFlexGridSizer& sizer, const wxString& key, wxWindow* value);
71 void gridAppend(wxFlexGridSizer& sizer, const wxString& key, const wxString& value);
72
74 void onCancel(void*);
76 void onRun(void*);
77
78 void evtOnPreprocessorsOnlyClick(wxCommandEvent& evt);
79
83 void prepareMenuSolverMode(Antares::Component::Button&, wxMenu& menu, void*);
84
88 void onSelectMode(wxCommandEvent& evt);
89
94 bool createCommentsFile(YString& filename) const;
95
96 void updateMonteCarloYears();
97
98 void updateNbCores();
99
105 int checkForLowResources();
106
108 void onInternalMotion(wxMouseEvent&);
109
110private:
112 wxWindow* pBigDaddy;
115 wxStaticText* pTitleOrtoolsSolverCombox;
116 wxComboBox* pOrtoolsSolverCombox;
117
118 wxTextCtrl* pSimulationName;
119 wxTextCtrl* pSimulationComments;
120 wxCheckBox* pIgnoreWarnings;
121 wxStaticText* pNbCores;
122 wxStaticText* pTitleSimCores;
123 wxStaticText* pLblEstimation;
124 wxStaticText* pLblEstimationAvailable;
125 wxStaticText* pLblDiskEstimation;
126 wxStaticText* pLblDiskEstimationAvailable;
127 wxCheckBox* pPreproOnly;
128 wxStaticText* pMonteCarloYears;
129 wxButton* pBtnRun;
130 wxSizerItem* pOptionSpacer;
131 wxSizerItem* pOrtoolsSolverOptionSpacer;
132
133 wxTimer* pTimer;
134 bool pWarnAboutMemoryLimit;
135 bool pWarnAboutDiskLimit;
136
137 bool pAlreadyWarnedNoMCYear;
138 uint pFeatureIndex;
139 std::map<long, uint> pMappingSolverMode;
140
141 Yuni::Thread::IThread::Ptr pThread;
142
143}; // class Run
144
145} // namespace Simulation
146} // namespace Window
147} // namespace Antares
148
149#endif // __ANTARES_APPLICATION_WINDOWS_SIMULATION_RUN_H__
Definition button.h:34
Run(wxWindow *parent, bool preproOnly=false)
Constructor.
Definition run.cpp:184
virtual ~Run()
Destructor.
Definition run.cpp:413