diff --git a/openstudiocore/src/analysisdriver/SimpleProject.cpp b/openstudiocore/src/analysisdriver/SimpleProject.cpp index c4745237aea..c8d1ae66191 100644 --- a/openstudiocore/src/analysisdriver/SimpleProject.cpp +++ b/openstudiocore/src/analysisdriver/SimpleProject.cpp @@ -561,6 +561,16 @@ namespace detail { return result; } + // is not osm that made this osp + openstudio::path osmForThisOsp = projectDir().parent_path() / toPath(projectDir().stem()); + osmForThisOsp = setFileExtension(osmForThisOsp,"osm"); + if (currentSeedLocation.path() == osmForThisOsp) { + LOG(Warn,"Cannot set seed to " << toString(currentSeedLocation.path()) << + ", because this OSP file was created by that OSM. Saving this project elsewhere " + << "before setting the baseline to that file will break the circular reference."); + return result; + } + // compatible with analysis? bool ok = analysis().setSeed(currentSeedLocation); if (!ok) { diff --git a/openstudiocore/src/pat_app/PatApp.cpp b/openstudiocore/src/pat_app/PatApp.cpp index 1c2fa385c54..a887122b4d4 100644 --- a/openstudiocore/src/pat_app/PatApp.cpp +++ b/openstudiocore/src/pat_app/PatApp.cpp @@ -66,6 +66,7 @@ #include #include #include +#include #include #include @@ -1208,6 +1209,15 @@ bool PatApp::openFile(const QString& fileName) } else { QTimer::singleShot(0, this, SLOT(markAsUnmodified())); } + openstudio::path osmForThisOsp = project->projectDir().parent_path() / toPath(project->projectDir().stem()); + osmForThisOsp = setFileExtension(osmForThisOsp,"osm"); + if (boost::filesystem::exists(osmForThisOsp)) { + QMessageBox::warning(mainWindow, + "PAT Project Associated with an OSM", + QString("This project appears to be associated with the OpenStudio Application file '") + + toQString(osmForThisOsp) + + QString("'. For best results, 'Save as ...' this project elsewhere before continuing your work.")); + } return true; } else { if (analysisdriver::OptionalSimpleProject plainProject = analysisdriver::SimpleProject::open(projectDir,options)) {