Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions openstudiocore/src/analysisdriver/SimpleProject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
10 changes: 10 additions & 0 deletions openstudiocore/src/pat_app/PatApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
#include <utilities/core/Application.hpp>
#include <utilities/core/ApplicationPathHelpers.hpp>
#include <utilities/core/Assert.hpp>
#include <utilities/core/PathHelpers.hpp>
#include <utilities/core/System.hpp>
#include <utilities/core/ZipFile.hpp>

Expand Down Expand Up @@ -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)) {
Expand Down