Antares Simulator
Power System Simulator
execute.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_TOOLBOX_E_EXECUTE_H__
22 #define __ANTARES_TOOLBOX_E_EXECUTE_H__
23 
24 #include <wx/wx.h>
25 
26 namespace Antares::Toolbox::Process
27 {
28 class Execute
29 {
30 public:
32 
35  Execute();
39  ~Execute();
40 
42 
44 
45  const wxString& command() const
47  {
48  return pCommand;
49  }
50 
52  void command(const wxString& v)
53  {
54  pCommand = v;
55  }
56 
58 
60 
61  const wxString& workingDirectory() const
63  {
64  return pWDirectory;
65  }
66 
68  void workingDirectory(const wxString& v)
69  {
70  pWDirectory = v;
71  }
72 
74 
76 
77  const wxString& title() const
79  {
80  return pTitle;
81  }
82 
84  void title(const wxString& v)
85  {
86  pTitle = v;
87  }
88 
90 
92 
93  const wxString& subTitle() const
95  {
96  return pSubTitle;
97  }
98 
100  void subTitle(const wxString& v)
101  {
102  pSubTitle = v;
103  }
104 
106 
108 
109  bool displayProgressBar() const
111  {
112  return pDisplayProgressBar;
113  }
114 
116  void displayProgressBar(const bool v)
117  {
118  pDisplayProgressBar = v;
119  }
120 
122 
124 
125  const char* icon() const
127  {
128  return pIcon;
129  }
130 
132  void icon(const char* v)
133  {
134  pIcon = v;
135  }
136 
138 
140 
141 
144  bool run();
146 
147 private:
149  wxString pTitle;
151  wxString pSubTitle;
153  wxString pCommand;
155  wxString pWDirectory;
157  bool pDisplayProgressBar;
159  const char* pIcon;
160 
161 }; // class Execute
162 
163 } // namespace Antares::Toolbox::Process
164 
165 #endif // __ANTARES_TOOLBOX_E_EXECUTE_H__
Definition: execute.h:29
void title(const wxString &v)
Set the title.
Definition: execute.h:84
const wxString & command() const
Get the command.
Definition: execute.h:46
void displayProgressBar(const bool v)
Set if the progress bar can be displayed.
Definition: execute.h:116
const char * icon() const
Get the relative address to the icon in the resources folder.
Definition: execute.h:126
const wxString & subTitle() const
Get the sub-title value.
Definition: execute.h:94
const wxString & workingDirectory() const
Get the working directory to use before executing the command.
Definition: execute.h:62
void icon(const char *v)
Set the relative address to the icon in the resources folder.
Definition: execute.h:132
~Execute()
Destructor.
Definition: execute.cpp:262
Execute()
Default constructor.
Definition: execute.cpp:253
void command(const wxString &v)
Set the command to execute.
Definition: execute.h:52
void subTitle(const wxString &v)
Set the sub-title.
Definition: execute.h:100
const wxString & title() const
Get the sub-title value.
Definition: execute.h:78
bool run()
Run the command.
Definition: execute.cpp:266
bool displayProgressBar() const
Get if the progress bar can be displayed.
Definition: execute.h:110
void workingDirectory(const wxString &v)
Set the working directory.
Definition: execute.h:68