Skip to content

Commit

Permalink
Update to version 3.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
tomas-soltys committed Nov 3, 2019
2 parents 472e5d6 + 49d5a4f commit 06b3563
Show file tree
Hide file tree
Showing 20 changed files with 330 additions and 54 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ $ ./scripts/build.sh --clean && ./scripts/create_package.sh
```
## Running the software
```
$ $HOME/bin/range-3.2.2/bin/Range
$ $HOME/bin/range-3.2.3/bin/Range
```

## Download
Expand Down
2 changes: 2 additions & 0 deletions range/Range/Range.pro
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ SOURCES += \
src/convergence_graph_dialog.cpp \
src/convergence_graph_object.cpp \
src/convergence_graph_widget.cpp \
src/crash_report_dialog.cpp \
src/cut_dialog.cpp \
src/direction_widget.cpp \
src/document_generator.cpp \
Expand Down Expand Up @@ -248,6 +249,7 @@ HEADERS += \
src/convergence_graph_dialog.h \
src/convergence_graph_object.h \
src/convergence_graph_widget.h \
src/crash_report_dialog.h \
src/cut_dialog.h \
src/direction_widget.h \
src/document_generator.h \
Expand Down
13 changes: 9 additions & 4 deletions range/Range/doc/RELEASE_NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
------------------------------------------------------------------
Version 3.2.3

* GUI: Detect and report application crash

------------------------------------------------------------------
Version 3.2.2

Expand All @@ -16,13 +21,13 @@ Bug fixes:
------------------------------------------------------------------
Version 3.2.1

* Display notification incons in output area tabs.
* Display notification incons in output area tabs

Bug fixes:

* Fixed incorrect numerical stabilization scale calculation in CFD calculation.
* CFD solver terminates with error if no volume elements are generated.
* Corrections in tutorials.
* Fixed incorrect numerical stabilization scale calculation in CFD calculation
* CFD solver terminates with error if no volume elements are generated
* Corrections in tutorials

------------------------------------------------------------------
Version 3.2.0
Expand Down
34 changes: 18 additions & 16 deletions range/Range/pixmaps/range-important.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 12 additions & 12 deletions range/Range/pixmaps/range-information.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
61 changes: 57 additions & 4 deletions range/Range/src/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
#include <QStyle>
#include <QPalette>
#include <QNetworkProxy>
#include <QMessageBox>

#include <rmlib.h>

#include "application.h"
#include "crash_report_dialog.h"
#include "locker.h"
#include "logger.h"
#include "progress.h"
Expand Down Expand Up @@ -190,25 +192,67 @@ void Application::onStarted(void)
return;
}

// Connect to aoutToQuit signal
// Connect to aboutToQuit signal
QObject::connect(this,&Application::aboutToQuit,this,&Application::onAboutToQuit);
// Connect to style change signal
QObject::connect(MainSettings::getInstance().getApplicationSettings(),&ApplicationSettings::styleChanged,this,&Application::onStyleChanged);

// Rotate log file.
QString rotatedLogFile = MainSettings::getInstance().getLogFileName() + "-" + QDateTime::currentDateTime().toString("yyMMdd_HHmmss");
if (QFile::exists(MainSettings::getInstance().getLogFileName()))
{
if (!QFile::rename(MainSettings::getInstance().getLogFileName(),rotatedLogFile))
{
RLogger::error("Failed to rename the log file \'%s\' to \'%s\'\n",
MainSettings::getInstance().getLogFileName().toUtf8().constData(),
rotatedLogFile.toUtf8().constData());
}
}

// Initialize lock file.
qint64 lockPid;
QString lockHostname;
QString lockAppname;

this->pLockFile = new QLockFile(MainSettings::getInstance().getTmpDir() + QDir::separator() + "range.lck");

bool previousLockStillValid = this->pLockFile->getLockInfo(&lockPid,&lockHostname,&lockAppname);

this->pLockFile->setStaleLockTime(0);
if (!this->pLockFile->tryLock(0))
{
QString lockMessage = "Failed to start.\nApplication " + lockAppname + " @ " + lockHostname + " (PID = " + QString::number(lockPid) + ") seems to be already running.\n";
QMessageBox::warning(nullptr,tr("Application is already running"), lockMessage);

this->exit(1);
return;
}

// Prepare main window
MainWindow::getInstance()->show();

// Set log file
RLogger::getInstance().setFile(MainSettings::getInstance().getLogDir() + QDir::separator() + "range.log");
RLogger::getInstance().setFile(MainSettings::getInstance().getLogFileName());

Logger::getInstance().unhalt();

// Set use system proxy settings
QNetworkProxyFactory::setUseSystemConfiguration(true);

// Print basic information
RLogger::info("Running on: %s\n",QSysInfo::productType().toUtf8().constData());
RLogger::info("Machine precision (float): %14g\n", RConstants::findMachineFloatEpsilon());
RLogger::info("System information\n");
RLogger::indent();
RLogger::info("Build ABI: %s\n",QSysInfo::buildAbi().toUtf8().constData());
RLogger::info("Build Cpu Architecture: %s\n",QSysInfo::buildCpuArchitecture().toUtf8().constData());
RLogger::info("Current Cpu Architecture: %s\n",QSysInfo::currentCpuArchitecture().toUtf8().constData());
RLogger::info("Kernel Type: %s\n",QSysInfo::kernelType().toUtf8().constData());
RLogger::info("Kernel Version: %s\n",QSysInfo::kernelVersion().toUtf8().constData());
RLogger::info("Machine HostName: %s\n",QSysInfo::machineHostName().toUtf8().constData());
RLogger::info("Product Name: %s\n",QSysInfo::prettyProductName().toUtf8().constData());
RLogger::info("Product Type: %s\n",QSysInfo::productType().toUtf8().constData());
RLogger::info("Product Version: %s\n",QSysInfo::productVersion().toUtf8().constData());
RLogger::unindent(false);
RLogger::info("Machine precision (float): %14g\n", double(RConstants::findMachineFloatEpsilon()));
RLogger::info("Machine precision (double): %14g\n", RConstants::findMachineDoubleEpsilon());
RLogger::info("Data directory: \'%s\'\n",MainSettings::getInstancePtr()->getDataDir().toUtf8().constData());
RLogger::info("Document directory: \'%s\'\n",MainSettings::getInstancePtr()->getDocDir().toUtf8().constData());
Expand Down Expand Up @@ -313,6 +357,12 @@ void Application::onStarted(void)
}
}
}

if (previousLockStillValid)
{
CrashReportDialog crashReportDialog(MainWindow::getInstance(),rotatedLogFile);
crashReportDialog.exec();
}
}

void Application::onAboutToQuit(void)
Expand All @@ -331,6 +381,9 @@ void Application::onAboutToQuit(void)
RLogger::error("Failed to write the session file \'%s\'. ERROR: %s\n",sessionFileName.toUtf8().constData(),error.getMessage().toUtf8().constData());
}

this->pLockFile->unlock();
delete this->pLockFile;

// Stop solver manager server.
RLogger::info("Stoping solver task server\n");
SolverManager::getInstance().stopServer();
Expand Down
6 changes: 6 additions & 0 deletions range/Range/src/application.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

#include <QApplication>
#include <QPalette>
#include <QLockFile>

#include <rblib.h>

Expand All @@ -21,6 +22,11 @@ class Application : public QApplication

Q_OBJECT

protected:

//! Lock file.
QLockFile *pLockFile;

public:

//! Constructor.
Expand Down
Loading

0 comments on commit 06b3563

Please sign in to comment.