Skip to content

Commit

Permalink
fmk - trying to see if removing dynamiccast to projectsettings gets r…
Browse files Browse the repository at this point in the history
…id of build failure on windows
  • Loading branch information
fmckenna committed Sep 25, 2024
1 parent 41226ca commit 3c9ca79
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
29 changes: 22 additions & 7 deletions EVENTS/WaveDigitalFlume/WaveDigitalFlume.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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
Expand All @@ -89,7 +93,7 @@ void WaveDigitalFlume::initialize()
simtype = 4;

// Activate wave flume
if (dynamic_cast<projectsettings *>(ui->stackedWidget->widget(0))->activateflume(simtype))
if (theSettings->activateflume(simtype))
{
qDebug() << "Error";
}
Expand All @@ -112,7 +116,7 @@ bool WaveDigitalFlume::outputToJSON(QJsonObject &jsonObject)
QMap<QString, QString> *singleData;
this->clearAllData();
singleData = new QMap<QString,QString>;
if (dynamic_cast<projectsettings *>(ui->stackedWidget->widget(0))->getData(*singleData,simtype))
if (theSettings->getData(*singleData,simtype))
{
allData.insert(0, singleData);
}
Expand Down Expand Up @@ -295,20 +299,31 @@ void WaveDigitalFlume::refresh_projsettings()
// singleData = new QMap<QString,QString>;
int numberOfPanes = 1;
simtype = 4;
for (int i=0;i<numberOfPanes;i++) {

/* numberOfPaes == 1 .. why a for loop
for (int i=0;i<numberOfPanes;i++) {
singleData = new QMap<QString,QString>;
if (dynamic_cast<projectsettings *>(ui->stackedWidget->widget(i))->getData(*singleData,simtype))
{
allData.insert(i, singleData);
}
// Activate wave flume
if (dynamic_cast<projectsettings *>(ui->stackedWidget->widget(0))->activateflume(simtype))
if (theSettings->activateflume(simtype))
{
qDebug() << "Error";
}

}
*/

singleData = new QMap<QString,QString>;
if (theSettings->getData(*singleData,simtype)) {
allData.insert(0, singleData);
}

if (theSettings->activateflume(simtype)) {
qDebug() << "Error";
}

// Search for simulation type
//QMap<QString, QString> *singleDataSet = allData.value(0);
//QString simty = singleDataSet->value("SimulationType");
Expand Down Expand Up @@ -369,7 +384,7 @@ void WaveDigitalFlume::on_SimOptions_itemDoubleClicked(QTreeWidgetItem *item, in

// Disable sim type
simtype = 4;
if (dynamic_cast<projectsettings *>(ui->stackedWidget->widget(0))->activateflume(simtype))
if (theSettings->activateflume(simtype))
{
qDebug() << "Error";
}
Expand Down
2 changes: 2 additions & 0 deletions EVENTS/WaveDigitalFlume/WaveDigitalFlume.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class WaveDigitalFlume;

class AgaveCurl;


class WaveDigitalFlume : public SimCenterAppWidget
{
Q_OBJECT
Expand Down Expand Up @@ -115,6 +116,7 @@ private slots:
QString applicationname = "Hydro-UQ";
QString applicationversion = "3.2.0";
AgaveCurl *theRemoteService;
projectsettings *theSettings;
};

#endif // WAVEDIGITALFLUME_H

0 comments on commit 3c9ca79

Please sign in to comment.