-
Notifications
You must be signed in to change notification settings - Fork 209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SaveAs in SketchUp plugin corrupts measures in model #754
Comments
@DavidGoldwasser @elainethale I would wait to fix this until we fix the model directory stuff, this is scheduled for this quarter but we could try to move it up ASAP |
@elainethale You and I should figure out the plan to get to the model dir refactor. We need to get the workflow serialized to something besides an OSP as one prerequisite, I'm not sure if there are others? |
@macumber Getting the workflow serialized to something else is a prerequisite, but that can already be done. The item that is not done is refactoring the code that manages measure libraries and a model's/project's scripts folder into one or more utilities-level classes. That can be done as part of https://www.pivotaltracker.com/story/show/62870462. Then I think we will be ready to make "ModelDir". An additional nice-to-have/may-be-necessary before making ModelDir is to pull WorkItem, Job, JobErrors, etc. down into utilities. |
@DavidGoldwasser the code involved here is a bit of a mess, looking at it i dont think save as is working in the app, specifically it does not appear to be moving m_simpleProject. Can you try the following tests: Create an osm, add some measures, without saving first call save as, close current model and open new model Create an osm, add some measures, without saving first call save as, run current model Do those workflows work? |
@elainethale Could you take a look at OSDocument::save C:\working\openstudio\openstudiocore\src\openstudio_lib\FileOperations.cpp to make sure we are doing the right things with the osp? |
@macumber It looks like maybe OSDocument::saveAs() needs to save m_project before calling saveModelTempDir. (Copying the osp is sufficient, but it needs to contain all the current data, and may not if we don't m_project->save() first.) OSDocument::save() contains the proper m_project->save() code (first checks to make sure the analysis is in a good state). |
@elainethale doesn't some sort of call to update paths need to happen too? |
@macumber That happens when you open an osp. Here, the real osp is in the temp dir. The updating for the saved version can happen whenever that file is re-opened (and also copied to a new temp dir). |
@macumber and @elainethale this may affect save as well, not just SaveAs. Lincoln has reported crashes in this this situation. |
@DavidGoldwasser I am not able to reproduce this on current develop. Can you retest with the release candidate next week and make sure this is still valid? |
@DavidGoldwasser it is true that if you change your OSP in the app but nothing in the OSM then save it the plugin will not detect this as a change if you have that OSM open in the plugin. In that case if you save from the plugin again you will lose the changes you made to your OSP. However, that is out of the scope of this ticket right? |
cc: @elainethale
Dan, I assigned this to you since it relates to the SketchUp Plugin. It seems that SaveAs in the plugin doesn't behave the same as SaveAs in the OS app.
I made a project that had reporting measures. I then went back to SketchUp to make changes, saved as another name. The reporting measures were now shown as OpenStudio measures. The left side of the image below is the before-SaveAs model. The right is the model after using SaveAs in the plugin, and then re-opening it in the Plugin.
I'm using the installed version of OpenStudio 1.2
I don't know about the stability of the model after deleting the measures. I may test and see how it behaves, but I may have to throw away the project and go back to just the OSM?
The text was updated successfully, but these errors were encountered: