Skip to content

Commit

Permalink
VT for these fields + correctly filling "End Use Subcat" if not set
Browse files Browse the repository at this point in the history
  • Loading branch information
jmarrec committed Sep 25, 2019
1 parent d17cba3 commit 9716036
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions openstudiocore/src/osversion/VersionTranslator.cpp
Expand Up @@ -4710,6 +4710,33 @@ std::string VersionTranslator::update_2_8_1_to_2_9_0(const IdfFile& idf_2_8_1, c
m_refactored.push_back(RefactoredObjectData(object, newObject));
ss << newObject;


// Four fields were added but only the last (End Use Subcat) was implemented, but withotu transition rules either
} else if ((iddname == "OS:HeaderedPumps:ConstantSpeed") || (iddname == "OS:HeaderedPumps:VariableSpeed")) {
auto iddObject = idd_2_9_0.getObject(iddname);
IdfObject newObject(iddObject.get());

for (size_t i = 0; i < object.numFields() - 4; ++i) {
if ((value = object.getString(i))) {
newObject.setString(i, value.get());
}
}

unsigned i = object.numFields() - 4;
// DesignPowerSizingMethod
newObject.setString(i++, "PowerPerFlowPerPressure");
// DesignElectricPowerPerUnitFlowRate
newObject.setDouble(i++, 348701.1);
// DesignElectricPowerPerUnitFlowRate
newObject.setDouble(i++, 1.282051282);

// EndUseSubcategory
if (value = object.getString(i)) {
newObject.setString(i, value.get());
} else {
newObject.setString(i,"General");
}

// No-op
} else {
ss << object;
Expand Down

0 comments on commit 9716036

Please sign in to comment.