Code_TYMPAN  4.4.0
Industrial site acoustic simulation
os.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) <2014> <EDF-R&D> <FRANCE>
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation; either version 2 of the License, or
6  * (at your option) any later version.
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10  * See the GNU General Public License for more details.
11  * You should have received a copy of the GNU General Public License along
12  * with this program; if not, write to the Free Software Foundation, Inc.,
13  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
14  */
15 
21 #include <QCoreApplication>
22 #include <qmessagebox.h>
23 
26 #include "Tympan/core/logging.h"
27 #include "os.h"
28 
29 bool python_gui(QStringList args)
30 {
31  // Disable GUI
32  getTYMainWnd()->setEnabled(false);
33  TYApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
34 
35  string error_msg;
36  bool computation_ok = python(args, error_msg);
37  if (!computation_ok)
38  {
40  logger.error("Echec du calcul acoustique: %s", error_msg.c_str());
41  QMessageBox msgBox;
42  msgBox.setText("Echec du calcul acoustique. Veuillez consulter le journal d'erreurs.\n");
43  msgBox.exec();
44  }
45  // Enable GUI
46  TYApplication::restoreOverrideCursor();
47  getTYMainWnd()->setEnabled(true);
48  return computation_ok;
49 }
TYMainWindow * getTYMainWnd()
Retourne le pointeur sur la fenetre principale.
pour l'application Tympan (fichier header)
virtual void error(const char *message,...)
Definition: logging.cpp:127
static OMessageManager * get()
Definition: logging.cpp:108
bool python_gui(QStringList args)
Definition: os.cpp:29
Utilitaires pour les interactions entre l'interface graphique et le système (headers)
bool python(QStringList args, std::string &error_msg)
Utilitaires pour les interactions entre l'application tympan et des sous- processus python.