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

Method communicateResults

src/workflow/OSWorkflow.cpp:690–713  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

688}
689
690void OSWorkflow::communicateResults() const {
691 if (!workflowJSON.runOptions()->skipZipResults()) {
692 if (m_add_timings) {
693 m_timers->newTimer("Zip datapoint");
694 }
695 openstudio::workflow::util::zipResults(workflowJSON.absoluteRunDir());
696 if (m_add_timings) {
697 m_timers->tockCurrentTimer();
698 }
699 }
700
701 const Json::Value root = outputAttributesToJSON(output_attributes, true);
702 Json::StreamWriterBuilder wbuilder;
703 // mimic the old StyledWriter behavior:
704 wbuilder["indentation"] = " ";
705
706 const std::string result = Json::writeString(wbuilder, root);
707
708 auto jsonPath = workflowJSON.absoluteRunDir() / "data_point_out.json";
709 openstudio::filesystem::ofstream file(jsonPath);
710 OS_ASSERT(file.is_open());
711 file << result;
712 file.close();
713}
714
715} // namespace openstudio

Callers

nothing calls this directly

Calls 7

zipResultsFunction · 0.85
outputAttributesToJSONFunction · 0.85
skipZipResultsMethod · 0.80
runOptionsMethod · 0.80
absoluteRunDirMethod · 0.80
tockCurrentTimerMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected