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

Method body

src/model/EnergyManagementSystemProgram.cpp:56–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54 }
55
56 std::string EnergyManagementSystemProgram_Impl::body() const {
57 //return program body as string
58
59 // loop through extensible groups and add ProgramLine to body string.
60 std::string body;
61 boost::optional<std::string> comment;
62
63 auto groups = extensibleGroups();
64 for (auto group = groups.begin(); group != groups.end(); ++group) {
65 //get program line content
66 const auto& line = group->getString(OS_EnergyManagementSystem_ProgramExtensibleFields::ProgramLine, true);
67 OS_ASSERT(line);
68 body += line.get();
69 //get non-default comments if they exist
70 comment = group->fieldComment(OS_EnergyManagementSystem_ProgramExtensibleFields::ProgramLine, false);
71 if (comment.is_initialized()) {
72 //remove space after !
73 boost::erase_first(comment.get(), " ");
74 //add space between end of program line and comment
75 if (!comment.get().empty()) {
76 body += " " + comment.get();
77 }
78 }
79 //add newline character
80 body += '\n';
81 }
82 return body;
83 }
84
85 bool EnergyManagementSystemProgram_Impl::setBody(const std::string& body) {
86 //set body of program to input string

Callers 15

resetFunction · 0.45
setFunction · 0.45
download_bcl_measureFunction · 0.45
bcl_measuresFunction · 0.45
update_measuresFunction · 0.45
compute_argumentsFunction · 0.45
create_measureFunction · 0.45
duplicate_measureFunction · 0.45
do_GETMethod · 0.45
do_POSTMethod · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45

Calls 6

beginMethod · 0.80
endMethod · 0.45
getStringMethod · 0.45
getMethod · 0.45
fieldCommentMethod · 0.45
emptyMethod · 0.45

Tested by 14

resetFunction · 0.36
setFunction · 0.36
download_bcl_measureFunction · 0.36
bcl_measuresFunction · 0.36
update_measuresFunction · 0.36
compute_argumentsFunction · 0.36
create_measureFunction · 0.36
duplicate_measureFunction · 0.36
TEST_FFunction · 0.36
TEST_FFunction · 0.36
TEST_FFunction · 0.36
prepareProgram_EMSFunction · 0.36