Add a new (Key, Var) group
| 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) { |