Skip to content

Commit

Permalink
fmk - updating main for analytics, WorkflowApp for TapisMachine (stam…
Browse files Browse the repository at this point in the history
…pede3) and more connections for messages, makeEXE and makeDMG for a release mode
  • Loading branch information
fmckenna committed Oct 6, 2024
1 parent 981ce77 commit 4d6d951
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 47 deletions.
49 changes: 25 additions & 24 deletions WorkflowAppPBE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#include <QDir>
#include <QFile>
#include <RemoteService.h>
#include <Stampede3Machine.h>
#include <QtNetwork/QNetworkAccessManager>
#include <QtNetwork/QNetworkReply>
#include <QtNetwork/QNetworkRequest>
Expand Down Expand Up @@ -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);

//
Expand All @@ -163,39 +160,43 @@ 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 &)));

connect(remoteApp,SIGNAL(setupForRun(QString &,QString &)),
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)));
Expand Down
23 changes: 23 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -212,13 +213,35 @@ 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
//

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
//
Expand Down
41 changes: 20 additions & 21 deletions makeDMG.sh
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

#
Expand All @@ -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)
Expand Down Expand Up @@ -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
#
Expand Down Expand Up @@ -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"
12 changes: 10 additions & 2 deletions makeEXE.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -36,7 +43,8 @@ fi
# make
#

make
touch ../WorkflowAppPBE.cpp
make -j 4
status=$?;
if [[ $status != 0 ]]
then
Expand Down

0 comments on commit 4d6d951

Please sign in to comment.