Skip to content

Commit

Permalink
Merge pull request #54 from fmckenna/master
Browse files Browse the repository at this point in the history
updating pro, placing debig.log in Documents, and removing json from debug log
  • Loading branch information
fmckenna authored Sep 27, 2019
2 parents 597d953 + 8e50bae commit dae5d6e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 46 deletions.
1 change: 1 addition & 0 deletions WE-UQ.pro
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ INCLUDEPATH += CFD/UI
INCLUDEPATH += CFD/Analysis
INCLUDEPATH += CFD/CFDAnalysis
INCLUDEPATH += CFD/SimCenter_widgets
DEFINES += _GRAPHICS_Qt3D

win32 {
RC_ICONS = icons/NHERI-WEuq-Icon.ico
Expand Down
2 changes: 0 additions & 2 deletions WindEDP_Selection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,6 @@ WindEDP_Selection::outputToJSON(QJsonObject &jsonObject)
bool
WindEDP_Selection::inputFromJSON(QJsonObject &jsonObject) {

qDebug() << "EDP_SELECTION - " << jsonObject;

if (theCurrentEDP != 0) {
return theCurrentEDP->inputFromJSON(jsonObject);
}
Expand Down
64 changes: 20 additions & 44 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@
#include <QTime>
#include <QTextStream>
#include <GoogleAnalytics.h>
#include <QStandardPaths>
#include <QDir>

// customMessgaeOutput code from web:
// https://stackoverflow.com/questions/4954140/how-to-redirect-qdebug-qwarning-qcritical-etc-output

const QString logFilePath = "debug.log";
bool logToFile = false;
static QString logFilePath;
static bool logToFile = false;

void customMessageOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg)
{
Expand Down Expand Up @@ -47,53 +49,17 @@ void customMessageOutput(QtMsgType type, const QMessageLogContext &context, cons
abort();
}

QString openStyleFiles()
{
QString ret;
QFile mainStyleFile(":/Resources/styleSheets/WEUQStyles.qss");

#ifdef Q_OS_WIN
QFile appendedStyle(":/Resources/styleSheets/WEUQWin.qss");
#endif

#ifdef Q_OS_MACOS
QFile appendedStyle(":/Resources/styleSheets/WEUQMac.qss");
#endif

#ifdef Q_OS_LINUX
QFile appendedStyle(":/Resources/styleSheets/WEUQLinux.qss");
#endif

if (!mainStyleFile.open(QFile::ReadOnly))
{
return ret;
}

if (!appendedStyle.open(QFile::ReadOnly))
{
return ret;
}

ret = ret.append(mainStyleFile.readAll());
ret = ret.append(appendedStyle.readAll());

mainStyleFile.close();
appendedStyle.close();

return ret;
}


int main(int argc, char *argv[])
{

//
//Setting Core Application Name, Organization, Version and Google Analytics Tracking Id
// Setting Core Application Name, Organization, Version and Google Analytics Tracking Id
//

QCoreApplication::setApplicationName("WE-UQ");
QCoreApplication::setOrganizationName("SimCenter");
QCoreApplication::setApplicationVersion("1.0.0");
QCoreApplication::setApplicationVersion("2.0.0");
// turn off while developing GoogleAnalytics::SetTrackingId("UA-121615795-1");
GoogleAnalytics::StartSession();
GoogleAnalytics::ReportStart();
Expand All @@ -102,8 +68,13 @@ int main(int argc, char *argv[])
// set up logging of output messages for user debugging
//

logFilePath = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)
+ QDir::separator() + QCoreApplication::applicationName()
+ QDir::separator() + QString("debug.log");


// remove old log file
QFile debugFile("debug.log");
QFile debugFile(logFilePath);
debugFile.remove();

QByteArray envVar = qgetenv("QTDIR"); // check if the app is run in Qt Creator
Expand All @@ -113,7 +84,11 @@ int main(int argc, char *argv[])

qInstallMessageHandler(customMessageOutput);

// window scaling for mac
qDebug() << "logFile: " << logFilePath;

//
// window scaling
//
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);

QApplication a(argc, argv);
Expand All @@ -132,6 +107,7 @@ int main(int argc, char *argv[])
//
// create the main window
//

WorkflowAppWidget *theInputApp = new WorkflowAppWE(theRemoteService);
MainWindowWorkflowApp w(QString("WE-UQ: Wind Engineering with Uncertainty Quantification"),theInputApp, theRemoteService);

Expand All @@ -141,7 +117,7 @@ int main(int argc, char *argv[])
aboutTXT.close();
w.setAbout(textAboutWE);

QString version("Version 1.0.0");
QString version("Version 2.0.0");
w.setVersion(version);

QString citeText("Frank McKenna, Peter Mackenzie-Helnwein, Wael Elhaddad, Michael Gardner, Jaiwei Wan, & Dae Kun Kwon. (2019, July 9). NHERI-SimCenter/WE-UQ: Release v1.0.0 (Version v1.0.0). Zenodo. http://doi.org/10.5281/zenodo.3274228");
Expand All @@ -163,7 +139,7 @@ int main(int argc, char *argv[])
thread->start();

//
// show the main window & start the event loop
// show the main window, set styles & start the event loop
//

w.show();
Expand Down

0 comments on commit dae5d6e

Please sign in to comment.