MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / addKeyVarGroup

Method addKeyVarGroup

src/model/MeterCustom.cpp:70–85  ·  view source on GitHub ↗

Add a new (Key, Var) group

Source from the content-addressed store, hash-verified

68
69 // Add a new (Key, Var) group
70 bool MeterCustom_Impl::addKeyVarGroup(const std::string& keyName, const std::string& outputVariableorMeterName) {
71 auto eg = getObject<ModelObject>().pushExtensibleGroup().cast<WorkspaceExtensibleGroup>();
72
73 bool temp = eg.setString(OS_Meter_CustomExtensibleFields::KeyName, keyName);
74 bool ok = eg.setString(OS_Meter_CustomExtensibleFields::OutputVariableorMeterName, outputVariableorMeterName);
75
76 if (temp) {
77 temp = ok;
78 }
79
80 if (!temp) {
81 getObject<ModelObject>().eraseExtensibleGroup(eg.groupIndex());
82 return temp;
83 }
84 return temp;
85 }
86
87 // Remove the (Key, Var) group at given index
88 bool MeterCustom_Impl::removeKeyVarGroup(unsigned groupIndex) {

Callers 3

TEST_FFunction · 0.45
TEST_FFunction · 0.45

Calls 4

pushExtensibleGroupMethod · 0.80
eraseExtensibleGroupMethod · 0.80
groupIndexMethod · 0.80
setStringMethod · 0.45

Tested by 3

TEST_FFunction · 0.36
TEST_FFunction · 0.36