From 4d6d9513104e0ed7cd843e15ca5b2fc8dd993656 Mon Sep 17 00:00:00 2001 From: fmckenna Date: Sat, 5 Oct 2024 22:36:37 -0700 Subject: [PATCH] fmk - updating main for analytics, WorkflowApp for TapisMachine (stampede3) and more connections for messages, makeEXE and makeDMG for a release mode --- WorkflowAppPBE.cpp | 49 +++++++++++++++++++++++----------------------- main.cpp | 23 ++++++++++++++++++++++ makeDMG.sh | 41 +++++++++++++++++++------------------- makeEXE.sh | 12 ++++++++++-- 4 files changed, 78 insertions(+), 47 deletions(-) diff --git a/WorkflowAppPBE.cpp b/WorkflowAppPBE.cpp index 77c8780..e24fb65 100644 --- a/WorkflowAppPBE.cpp +++ b/WorkflowAppPBE.cpp @@ -63,6 +63,7 @@ UPDATES, ENHANCEMENTS, OR MODIFICATIONS. #include #include #include +#include #include #include #include @@ -138,17 +139,13 @@ WorkflowAppPBE::WorkflowAppPBE(RemoteService *theService, QWidget *parent) thePrfMethodSelection = new PerformanceMethodSelection(); theResults = new ResultsPelicun(); + TapisMachine *theMachine = new Stampede3Machine(); + localApp = new LocalApplication("sWHALE.py"); - remoteApp = new RemoteApplication("sWHALE.py", theService); - // localApp = new LocalApplication("femUQ.py"); - // remoteApp = new RemoteApplication("femUQ.py", theService); + remoteApp = new RemoteApplication("sWHALE.py", theService, theMachine); theJobManager = new RemoteJobManager(theService); - // theRunLocalWidget = new RunLocalWidget(theUQ_Method); SimCenterWidget *theWidgets[1]; - // theWidgets[0] = theAnalysis; - // theWidgets[1] = theUQ_Method; - //int numWidgets = 2; theRunWidget = new RunWidget(localApp, remoteApp, theWidgets, 0); // @@ -163,7 +160,8 @@ WorkflowAppPBE::WorkflowAppPBE(RemoteService *theService, QWidget *parent) this,SLOT(statusMessage(QString))); connect(localApp,SIGNAL(sendFatalMessage(QString)), this,SLOT(fatalMessage(QString))); - connect(localApp,SIGNAL(runComplete()), this, SLOT(runComplete())); + connect(localApp,SIGNAL(runComplete()), + this, SLOT(runComplete())); connect(localApp, SIGNAL(processResults(QString &)), this, SLOT(processResults(QString &))); @@ -171,31 +169,34 @@ WorkflowAppPBE::WorkflowAppPBE(RemoteService *theService, QWidget *parent) this, SLOT(setUpForApplicationRun(QString &,QString &))); connect(remoteApp,SIGNAL(successfullJobStart()), this, SLOT(runComplete())); + connect(remoteApp,SIGNAL(successfullJobStart()), theRunWidget, SLOT(hide())); + connect(remoteApp,SIGNAL(sendErrorMessage(QString)), this,SLOT(errorMessage(QString))); connect(remoteApp,SIGNAL(sendStatusMessage(QString)), this,SLOT(statusMessage(QString))); connect(remoteApp,SIGNAL(sendFatalMessage(QString)), this,SLOT(fatalMessage(QString))); - - connect(this, SIGNAL(setUpForApplicationRunDone(QString&, QString &)), - theRunWidget, SLOT(setupForRunApplicationDone(QString&, QString &))); - connect(theService, SIGNAL(closeDialog()), this, SLOT(runComplete())); - - connect(theJobManager, SIGNAL(closeDialog()), this, SLOT(runComplete())); - connect(theJobManager, - SIGNAL(processResults(QString &)), - this, - SLOT(processResults(QString &))); - - connect(theJobManager,SIGNAL(loadFile(QString&)), this, SLOT(loadFile(QString&))); + connect(theJobManager, SIGNAL(closeDialog()), + this, SLOT(runComplete())); + connect(theJobManager,SIGNAL(processResults(QString &)), + this, SLOT(processResults(QString &))); + connect(theJobManager,SIGNAL(loadFile(QString&)), + this, SLOT(loadFile(QString&))); + connect(theJobManager,SIGNAL(sendErrorMessage(QString)), + this,SLOT(errorMessage(QString))); + connect(theJobManager,SIGNAL(sendStatusMessage(QString)), + this,SLOT(statusMessage(QString))); + connect(theJobManager,SIGNAL(sendFatalMessage(QString)), + this,SLOT(fatalMessage(QString))); - //connect(theJobManager,SIGNAL(sendErrorMessage(QString)), this,SLOT(errorMessage(QString))); - // connect(theJobManager,SIGNAL(sendStatusMessage(QString)), this,SLOT(statusMessage(QString))); + connect(this,SIGNAL(setUpForApplicationRunDone(QString&, QString &)), + theRunWidget, SLOT(setupForRunApplicationDone(QString&, QString &))); + + connect(theService, SIGNAL(closeDialog()), + this, SLOT(runComplete())); - connect(remoteApp,SIGNAL(successfullJobStart()), theRunWidget, SLOT(hide())); - // SY connect queryEVT and the reply connect(theUQ_Selection, SIGNAL(queryEVT()), theEventSelection, SLOT(replyEventType())); connect(theEventSelection, SIGNAL(typeEVT(QString)), theUQ_Selection, SLOT(setEventType(QString))); diff --git a/main.cpp b/main.cpp index cd7d6b1..2c86b3e 100644 --- a/main.cpp +++ b/main.cpp @@ -197,6 +197,7 @@ int main(int argc, char *argv[]) //Setting Google Analytics Tracking Information #ifdef _SC_RELEASE + qDebug() << "Running a Release Version of PBE"; GoogleAnalytics::SetMeasurementId("G-JWNPJMZVTK"); GoogleAnalytics::SetAPISecret("CL5znZLfQv6N2Tk1RJVMWg"); GoogleAnalytics::CreateSessionId(); @@ -212,6 +213,16 @@ int main(int argc, char *argv[]) #endif +#ifdef _ANALYTICS + + qDebug() << "compiled with: ANALYTICS"; + GoogleAnalytics::SetMeasurementId("G-JWNPJMZVTK"); + GoogleAnalytics::SetAPISecret("CL5znZLfQv6N2Tk1RJVMWg"); + GoogleAnalytics::CreateSessionId(); + GoogleAnalytics::StartSession(); + +#endif + // // RUN the GUI @@ -219,6 +230,18 @@ int main(int argc, char *argv[]) int res = a.exec(); +#ifdef _GA_AFTER + + qDebug() << "compiled with: _GA_AFTER"; + // Opening a QWebEngineView and using github to get app geographic usage + QWebEngineView view; + view.setUrl(QUrl("https://nheri-simcenter.github.io/PBE/GA4.html")); + view.resize(1024, 750); + view.show(); + view.hide(); + +#endif + // // on done with event loop, logout & stop the thread // diff --git a/makeDMG.sh b/makeDMG.sh index ec28766..8809326 100755 --- a/makeDMG.sh +++ b/makeDMG.sh @@ -1,21 +1,10 @@ - - # # parse args # METHOD="new" -while [[ "${1:0:1}" = "-" ]]; do - case $1 in - --old) - METHOD="old" - shift;; - --new) - METHOD="new" - shift;; - esac -done +release=${1:-"NO_RELEASE"} # # Paramaters @@ -29,15 +18,14 @@ QTDIR="/Users/fmckenna/Qt/5.15.2/clang_64/" pathToBackendApps="/Users/fmckenna/NHERI/SimCenterBackendApplications" pathToOpenSees="/Users/fmckenna/bin/OpenSees3.6.0" -pathToDakota="/Users/fmckenna/dakota-6.12.0" +pathToDakota="/Users/fmckenna/dakota/dakota-6.16.0" pathToQuaZip="/Users/fmckenna/NHERI/quazip/build/quazip" - # # build it # -./makeEXE.sh +./makeEXE.sh $version cd build # @@ -49,13 +37,13 @@ if ! [ -x "$(command -v open $pathApp)" ]; then exit fi -cp -fr $HOME/NHERI/s3hark/resources ./PBE.app/Contents/MacOS +cp -fr $HOME/NHERI/QS3hark/resources ./PBE.app/Contents/MacOS # # macdeployqt it # -macdeployqt ./PBE.app -qmldir=$HOME/NHERI/s3hark +macdeployqt ./PBE.app -qmldir=$HOME/NHERI/QS3hark # # add missing files from macdeployqt (a known bug) @@ -105,6 +93,18 @@ do rm -fr ./$APP_FILE/Contents/MacOS/applications/$app done + +# +# remove redunadant files +# + +find ./$APP_FILE -name __pycache__ -exec rm -rf {} +; +find ./$APP_FILE -name *rst -exec rm -rf {} +; +find ./$APP_FILE -name *png -exec rm -rf {} +; +find ./$APP_FILE -name figures -exec rm -rf {} +; +find ./$APP_FILE -name meta.yaml -exec rm -rf {} +; + + # # copy applications folder opensees, dakota and quazip # @@ -222,11 +222,10 @@ else fi -echo "xcrun altool --notarize-app -u $appleID -p $appleAppPassword -f ./$DMG_FILENAME --primary-bundle-id altool --verbose" +echo "xcrun notarytool submit ./$DMG_FILENAME --apple-id $appleID --team-id $appleCredential --password $appleAppPAssword" +echo "xcrun notarytool log ID --apple-id $appleID --team-id $appleCredential --password $appleAppPAssword" echo "" -echo "returns id: ID .. wait for email indicating success" -echo "To check status" -echo "xcrun altool --notarization-info ID -u $appleID -p $appleAppPassword" +echo "NO MORE EMAILS .. have to check the log file" echo "" echo "Finally staple the dmg" echo "xcrun stapler staple \"$APP_NAME\" $DMG_FILENAME" diff --git a/makeEXE.sh b/makeEXE.sh index f95591c..c514681 100755 --- a/makeEXE.sh +++ b/makeEXE.sh @@ -24,7 +24,14 @@ fi # qmake # -qmake ../PBE.pro +if [ -n "$release" ] && [ "$release" = "release" ]; then + echo "******** RELEASE BUILD *************" + qmake QMAKE_CXXFLAGS+="-D_SC_RELEASE" ../PBE.pro +else + echo "********* NON RELEASE BUILD ********" + qmake ../PBE.pro +fi + status=$? if [[ $status != 0 ]] then @@ -36,7 +43,8 @@ fi # make # -make +touch ../WorkflowAppPBE.cpp +make -j 4 status=$?; if [[ $status != 0 ]] then