Get all output variables associated with this object, must run simulation to generate associate data. */
| 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 { |