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

Method outputVariables

src/model/ModelObject.cpp:111–135  ·  view source on GitHub ↗

Get all output variables associated with this object, must run simulation to generate associate data. */

Source from the content-addressed store, hash-verified

109
110 /** Get all output variables associated with this object, must run simulation to generate associate data. */
111 OutputVariableVector ModelObject_Impl::outputVariables() const {
112 OutputVariableVector variables;
113 std::vector<std::string> variableNames = this->outputVariableNames();
114 OptionalString name = this->name();
115
116 for (OutputVariable& variable : this->model().getConcreteModelObjects<OutputVariable>()) {
117 std::string keyValue = variable.keyValue();
118 std::string variableName = variable.variableName();
119
120 if (name) {
121 if (istringEqual(*name, keyValue) || (keyValue == "*")) {
122 // match
123 } else {
124 continue; // no match
125 }
126 } else {
127 // match
128 }
129
130 if (std::find(variableNames.begin(), variableNames.end(), variableName) != variableNames.end()) {
131 variables.emplace_back(std::move(variable));
132 }
133 }
134 return variables;
135 }
136
137 /** Get data associated with this output variable and this object. */
138 openstudio::OptionalTimeSeries ModelObject_Impl::getData(const OutputVariable& variable, const std::string& envPeriod) const {

Callers 2

TEST_FFunction · 0.80

Calls 7

modelMethod · 0.95
istringEqualFunction · 0.85
keyValueMethod · 0.80
beginMethod · 0.80
nameMethod · 0.45
variableNameMethod · 0.45
endMethod · 0.45

Tested by 2

TEST_FFunction · 0.64