From 3c9ca7954e3bd11e77f6afd4f941f8addb3d0cd6 Mon Sep 17 00:00:00 2001 From: fmckenna Date: Tue, 24 Sep 2024 17:53:16 -0700 Subject: [PATCH] fmk - trying to see if removing dynamiccast to projectsettings gets rid of build failure on windows --- EVENTS/WaveDigitalFlume/WaveDigitalFlume.cpp | 29 +++++++++++++++----- EVENTS/WaveDigitalFlume/WaveDigitalFlume.h | 2 ++ 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/EVENTS/WaveDigitalFlume/WaveDigitalFlume.cpp b/EVENTS/WaveDigitalFlume/WaveDigitalFlume.cpp index 5448e251..8e0b2b5f 100644 --- a/EVENTS/WaveDigitalFlume/WaveDigitalFlume.cpp +++ b/EVENTS/WaveDigitalFlume/WaveDigitalFlume.cpp @@ -46,6 +46,8 @@ WaveDigitalFlume::WaveDigitalFlume(RandomVariablesContainer *theRV, QWidget *par : SimCenterAppWidget(parent), theRemoteService(NULL) , ui(new Ui::WaveDigitalFlume) { + theSettings = 0; + // Start the UI ui->setupUi(this); @@ -70,7 +72,9 @@ WaveDigitalFlume::~WaveDigitalFlume() void WaveDigitalFlume::initialize() { // Add project page - ui->stackedWidget->addWidget(new projectsettings(4)); // Project settings + theSettings = new projectsettings(4); + + ui->stackedWidget->addWidget(theSettings); // Project settings ui->stackedWidget->addWidget(new bathymetry(4)); // Bathymetry ui->stackedWidget->addWidget(new swcfdint(0)); // SW-CFD interface: Check this if working ui->stackedWidget->addWidget(new buildings(0)); // Buildings/Structures @@ -89,7 +93,7 @@ void WaveDigitalFlume::initialize() simtype = 4; // Activate wave flume - if (dynamic_cast(ui->stackedWidget->widget(0))->activateflume(simtype)) + if (theSettings->activateflume(simtype)) { qDebug() << "Error"; } @@ -112,7 +116,7 @@ bool WaveDigitalFlume::outputToJSON(QJsonObject &jsonObject) QMap *singleData; this->clearAllData(); singleData = new QMap; - if (dynamic_cast(ui->stackedWidget->widget(0))->getData(*singleData,simtype)) + if (theSettings->getData(*singleData,simtype)) { allData.insert(0, singleData); } @@ -295,20 +299,31 @@ void WaveDigitalFlume::refresh_projsettings() // singleData = new QMap; int numberOfPanes = 1; simtype = 4; - for (int i=0;i; if (dynamic_cast(ui->stackedWidget->widget(i))->getData(*singleData,simtype)) { allData.insert(i, singleData); } // Activate wave flume - if (dynamic_cast(ui->stackedWidget->widget(0))->activateflume(simtype)) + if (theSettings->activateflume(simtype)) { qDebug() << "Error"; } - } + */ + singleData = new QMap; + if (theSettings->getData(*singleData,simtype)) { + allData.insert(0, singleData); + } + + if (theSettings->activateflume(simtype)) { + qDebug() << "Error"; + } + // Search for simulation type //QMap *singleDataSet = allData.value(0); //QString simty = singleDataSet->value("SimulationType"); @@ -369,7 +384,7 @@ void WaveDigitalFlume::on_SimOptions_itemDoubleClicked(QTreeWidgetItem *item, in // Disable sim type simtype = 4; - if (dynamic_cast(ui->stackedWidget->widget(0))->activateflume(simtype)) + if (theSettings->activateflume(simtype)) { qDebug() << "Error"; } diff --git a/EVENTS/WaveDigitalFlume/WaveDigitalFlume.h b/EVENTS/WaveDigitalFlume/WaveDigitalFlume.h index a6de49b6..56bcb339 100644 --- a/EVENTS/WaveDigitalFlume/WaveDigitalFlume.h +++ b/EVENTS/WaveDigitalFlume/WaveDigitalFlume.h @@ -82,6 +82,7 @@ class WaveDigitalFlume; class AgaveCurl; + class WaveDigitalFlume : public SimCenterAppWidget { Q_OBJECT @@ -115,6 +116,7 @@ private slots: QString applicationname = "Hydro-UQ"; QString applicationversion = "3.2.0"; AgaveCurl *theRemoteService; + projectsettings *theSettings; }; #endif // WAVEDIGITALFLUME_H