Skip to content

Commit

Permalink
Merge pull request #70 from jinyan1214/jsonTransportAssetFile
Browse files Browse the repository at this point in the history
clear res widget before run again
  • Loading branch information
fmckenna authored Dec 21, 2023
2 parents 8fc0d41 + 74c89a4 commit a01b5e5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions UIWidgets/ResultsWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,9 @@ int ResultsWidget::processResults(QString resultsDirectory)
}
// type is Bridge/Tunnel/Road
QString type = assetProperties["type"].toString();
if (type.compare("")==0){
type = "Building";
}
if (!assetDictionary.contains(type))
{
assetDictionary[type] = QList<QJsonObject>({value});
Expand Down Expand Up @@ -579,6 +582,22 @@ void ResultsWidget::clear(void)
}
resTabWidget->clear();

auto resultLyr = theVisualizationWidget->getLayerGroup("Results");
if (resultLyr){
theVisualizationWidget->removeLayerGroup("Results");
}
auto DMGLyr = theVisualizationWidget->getLayerGroup("Most Likely Critical Damage State");
if (DMGLyr){
theVisualizationWidget->removeLayerGroup("Most Likely Damage State");
}
QgsProject *project = QgsProject::instance();
for (QgsMapLayer *layer : project->mapLayers().values()) {
// QString
if ((layer->name() == "Results")||(layer->name() == "Most Likely Critical Damage State")) {
theVisualizationWidget->removeLayer(layer);
}
}

resultsShow(false);
}

Expand Down
2 changes: 1 addition & 1 deletion WorkflowAppR2D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ void WorkflowAppR2D::setUpForApplicationRun(QString &workingDir, QString &subDir
else
destinationDirectory.mkpath(tmpDirectory);


theResultsWidget->clear();
//qDebug() << "WorkflowAppR2D is changinging subDir to input_data";
subDir = "input_data";

Expand Down

0 comments on commit a01b5e5

Please sign in to comment.