diff --git a/EVENTS/EarthquakeEventSelection.cpp b/EVENTS/EarthquakeEventSelection.cpp index e58ae5a1..c4ef895a 100644 --- a/EVENTS/EarthquakeEventSelection.cpp +++ b/EVENTS/EarthquakeEventSelection.cpp @@ -91,7 +91,8 @@ EarthquakeEventSelection::~EarthquakeEventSelection() void EarthquakeEventSelection::replyEventType(void) { - qDebug() << "EarthquakeEventSelection::replyEventType(void)- HUH"; + emit typeEVT("EQ"); + //qDebug() << "EarthquakeEventSelection::replyEventType(void)- HUH"; } diff --git a/EVENTS/physicsBasedSimulation/M9SingleSite.cpp b/EVENTS/physicsBasedSimulation/M9SingleSite.cpp index 9ec17ba9..aee7ecc4 100644 --- a/EVENTS/physicsBasedSimulation/M9SingleSite.cpp +++ b/EVENTS/physicsBasedSimulation/M9SingleSite.cpp @@ -34,15 +34,15 @@ UPDATES, ENHANCEMENTS, OR MODIFICATIONS. *************************************************************************** */ -// Written: fmckenna - +// Written: fmckenna, Amin Pakzad +#include "MainWindow.h" #include "M9SingleSite.h" #include #include #include #include #include - +#include #include #include #include @@ -51,7 +51,6 @@ UPDATES, ENHANCEMENTS, OR MODIFICATIONS. #include #include #include -#include #include #include @@ -63,6 +62,7 @@ UPDATES, ENHANCEMENTS, OR MODIFICATIONS. #include #include #include +#include M9SingleSite::M9SingleSite(QWidget *parent) :SimCenterAppWidget(parent), count(0), downloadedMotions(false), motionsDownloading(false) @@ -191,6 +191,50 @@ M9SingleSite::downloadMotions(void) { qDebug() << "M9SingleSite::downloadMotions called"; + // if user has not checked + if (!useAPI->isChecked()) { + // pop up a window to ask for username and password + QDialog *dialog = new QDialog(); + dialog->setWindowTitle("Login to Tapis"); + QVBoxLayout *layout = new QVBoxLayout(dialog); + QLineEdit *usernameEdit = new QLineEdit(dialog); + usernameEdit->setPlaceholderText("Username"); + layout->addWidget(usernameEdit); + QLineEdit *passwordEdit = new QLineEdit(dialog); + passwordEdit->setPlaceholderText("Password"); + passwordEdit->setEchoMode(QLineEdit::Password); + layout->addWidget(passwordEdit); + QPushButton *loginButton = new QPushButton("Login", dialog); + layout->addWidget(loginButton); + dialog->setLayout(layout); + connect(loginButton, &QPushButton::clicked, [=]() { + // check if the username and password are not empty + if (usernameEdit->text().isEmpty() || passwordEdit->text().isEmpty()) { + errorMessage("Error: Username and password cannot be empty"); + return; + } + // close the dialog + dialog->accept(); + + }); + // make the dialog appear in the center of the screen i nstead of the top left corner + // keep the dialog dimensions the same + QScreen *screen = qApp->primaryScreen(); + QRect screenGeometry = screen->availableGeometry(); + int x = (screenGeometry.width() - dialog->width()) / 2; + int y = (screenGeometry.height() - dialog->height()) / 2; + dialog->move(x, y); + dialog->exec(); + // save the username and password + username = usernameEdit->text(); + password = passwordEdit->text(); + + } + + + + + // // get tmp directory to store motions, if it exists remove // @@ -230,7 +274,9 @@ M9SingleSite::downloadMotions(void) << QString("-g") << currentGrid << QString("-n") << QString::number(numMotion) << QString("-o") << destDir - << QString("--API") << QString::number(useAPI->isChecked()); + << QString("--API") << QString::number(useAPI->isChecked()) + << "--username" << username + << "--password" << password; /* QJsonObject information; diff --git a/EVENTS/physicsBasedSimulation/M9SingleSite.h b/EVENTS/physicsBasedSimulation/M9SingleSite.h index 50c8b263..bd5f36a3 100644 --- a/EVENTS/physicsBasedSimulation/M9SingleSite.h +++ b/EVENTS/physicsBasedSimulation/M9SingleSite.h @@ -91,6 +91,8 @@ public slots: QPushButton *getMotions; bool downloadedMotions; bool motionsDownloading; + QString username; + QString password; }; #endif // M9_SINGLE_SITE_WIDGET_H diff --git a/WorkflowAppEE_UQ.cpp b/WorkflowAppEE_UQ.cpp index 63a551e1..1a1dee0a 100644 --- a/WorkflowAppEE_UQ.cpp +++ b/WorkflowAppEE_UQ.cpp @@ -87,6 +87,7 @@ UPDATES, ENHANCEMENTS, OR MODIFICATIONS. #include #include #include +#include #include #include "CustomizedItemModel.h" @@ -245,6 +246,15 @@ WorkflowAppEE_UQ::setMainWindow(MainWindowWorkflowApp* window) { theDialog->showTool("ShakerMaker"); }); + // DRM Model + DRM_Model *theDRM_Model = new DRM_Model(); + theToolDialog->addTool(theDRM_Model, "Domain Reduction Method Analysis"); + QAction *showDRM_Model = toolsMenu->addAction("&Domain Reduction Method Analysis"); + connect(showDRM_Model, &QAction::triggered, this,[this, theDialog=theToolDialog, theEmp = theDRM_Model] { + theDialog->showTool("Domain Reduction Method Analysis"); + }); + + // opensees@designsafe RemoteOpenSeesApp *theOpenSeesApp = new RemoteOpenSeesApp();