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

Method hoursSimulated

src/utilities/sql/SqlFile_Impl.cpp:922–941  ·  view source on GitHub ↗

hours simulated

Source from the content-addressed store, hash-verified

920
921 /// hours simulated
922 boost::optional<double> SqlFile_Impl::hoursSimulated() const {
923 const std::string& s = R"(SELECT Value FROM TabularDataWithStrings
924 WHERE ReportName='InputVerificationandResultsSummary'
925 AND ReportForString='Entire Facility'
926 AND TableName='General'
927 AND RowName='Hours Simulated'
928 AND Units='hrs')";
929 boost::optional<double> ret = execAndReturnFirstDouble(s);
930
931 if (ret) {
932 return ret;
933 }
934
935 // Otherwise, let's try to calculate it:
936 return execAndReturnFirstDouble(
937 "select "
938 " (select max(t.hour + ((t.simulationdays-1) * 24)) as mintime from time t join reportmeterdata r on (t.timeindex=r.timeindex))"
939 " - (select min(t.hour + ((t.simulationdays-1) * 24)) as mintime from time t join reportmeterdata r on (t.timeindex=r.timeindex))"
940 " + 1;");
941 }
942
943 boost::optional<double> SqlFile_Impl::netSiteEnergy() const {
944 boost::optional<double> hours = hoursSimulated();

Callers

nothing calls this directly

Calls 1

execAndReturnFirstDoubleFunction · 0.70

Tested by

no test coverage detected