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

Method expandReportingFrequency

src/utilities/sql/SqlFile_Impl.cpp:3367–3411  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3365 }
3366
3367 SqlFileTimeSeriesQueryVector SqlFile_Impl::expandReportingFrequency(const SqlFileTimeSeriesQuery& query) {
3368 SqlFileTimeSeriesQueryVector result;
3369
3370 if (query.reportingFrequency()) {
3371 result.push_back(query);
3372 } else {
3373 ReportingFrequencySet rfSet;
3374 StringVector envNames;
3375 // get environment names
3376 if (query.environment()) {
3377 EnvironmentIdentifier envId = query.environment().get();
3378 if (envId.name()) {
3379 envNames.push_back(envId.name().get());
3380 } else {
3381 OS_ASSERT(envId.type());
3382 EnvironmentType envType = envId.type().get();
3383 for (const std::string& envName : availableEnvPeriods()) {
3384 OptionalEnvironmentType oEnvType = environmentType(envName);
3385 if (oEnvType && (*oEnvType == envType)) {
3386 envNames.push_back(envName);
3387 }
3388 }
3389 } // if-else
3390 } else {
3391 envNames = availableEnvPeriods();
3392 }
3393 // get reporting frequencies
3394 for (const std::string& envName : envNames) {
3395 ReportingFrequencySet tempSet = availableReportingFrequencySet(*this, envName);
3396 rfSet.insert(tempSet.begin(), tempSet.end());
3397 }
3398
3399 // make one query per rf
3400 for (const ReportingFrequency& rf : rfSet) {
3401 SqlFileTimeSeriesQuery wQuery(query);
3402 wQuery.setReportingFrequency(rf);
3403 result.push_back(wQuery);
3404 }
3405 }
3406
3407 // check result queries for consistency
3408 mf_makeConsistent(result);
3409
3410 return result;
3411 }
3412
3413 SqlFileTimeSeriesQueryVector SqlFile_Impl::expandTimeSeries(const SqlFileTimeSeriesQuery& query) {
3414 SqlFileTimeSeriesQueryVector result;

Callers

nothing calls this directly

Calls 11

environmentMethod · 0.80
beginMethod · 0.80
reportingFrequencyMethod · 0.45
push_backMethod · 0.45
getMethod · 0.45
nameMethod · 0.45
typeMethod · 0.45
insertMethod · 0.45
endMethod · 0.45
setReportingFrequencyMethod · 0.45

Tested by

no test coverage detected