Skip to content
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

VersionTranslation of Component breaks when VersionTranslator adds/remove objects #4756

Closed
jmarrec opened this issue Nov 30, 2022 · 0 comments · Fixed by #4757
Closed

VersionTranslation of Component breaks when VersionTranslator adds/remove objects #4756

jmarrec opened this issue Nov 30, 2022 · 0 comments · Fixed by #4757

Comments

@jmarrec
Copy link
Collaborator

jmarrec commented Nov 30, 2022

Issue overview

If you VT for example from 3.4.0 to 3.5.0 a Component (.osc) that has a TableMultiVariableLookup, that TableMultiVariableLookup is changed to a TableLookup, ModelObjectList (=TableIndependentVariableList), and several TableIndependentVariables, so the number of objects changes. It then throws here:

int nNonTrivialObjects = numObjects() - getObjectsByType(IddObjectType::CommentOnly).size();
if (nNonTrivialObjects != static_cast<int>(componentData.numComponentObjects()) + 1) {
LOG_AND_THROW("Cannot construct Component from IdfFile because the file contains " << nNonTrivialObjects << " non-trivial objects, not "
<< componentData.numComponentObjects() + 1u
<< ", as expected. The file: " << '\n'
<< idfFile);

That is because the VT does NOT update the ComponentData

Current Behavior

Expected Behavior

Steps to Reproduce

Possible Solution

Details

Environment

Some additional details about your environment for this issue (if relevant):

  • Platform (Operating system, version):
  • Version of OpenStudio (if using an intermediate build, include SHA):

Context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant