Skip to content

Commit f75da7f

Browse files
committed
misc modelDescription refactor
1 parent 9118358 commit f75da7f

2 files changed

Lines changed: 12 additions & 11 deletions

File tree

export/src/fmu4cpp/fmi2/fmi2_description.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ std::string fmu_base::make_description() const {
3939
if (!m.vendorAnnotations.empty()) {
4040
ss << "\t<VendorAnnotations>\n";
4141
for (const auto &annotation: m.vendorAnnotations) {
42-
std::string indentedAnnotation = indent_multiline_string(annotation, 3);
42+
std::string indentedAnnotation = indent_multiline_string(annotation, 2);
4343
ss << indentedAnnotation << "\n";
4444
}
4545
ss << "\t</VendorAnnotations>\n\n";

export/src/fmu4cpp/fmi3/fmi3_description.cpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,6 @@ std::string fmu_base::make_description() const {
5656
<< "\t\tprovidesEvaluateDiscreteStates=\"false\""
5757
<< "/>\n\n";
5858

59-
// if (!m.vendorAnnotations.empty()) {
60-
// ss << "\t<Annotations>\n";
61-
// for (const auto &annotation: m.vendorAnnotations) {
62-
// std::string indentedAnnotation = indent_multiline_string(annotation, 3);
63-
// ss << indentedAnnotation << "\n";
64-
// }
65-
// ss << "\t</Annotations>\n";
66-
// }
6759

6860
if (m.defaultExperiment) {
6961
ss << "\t<DefaultExperiment ";
@@ -152,7 +144,7 @@ std::string fmu_base::make_description() const {
152144

153145
if (!unknowns.empty()) {
154146
for (const auto &v: unknowns) {
155-
ss << "\t\t\t<Output valueReference=\"" << v->value_reference() << "\"";
147+
ss << "\t\t<Output valueReference=\"" << v->value_reference() << "\"";
156148
if (const auto deps = v->getDependencies(); !deps.empty()) {
157149
ss << " dependencies=\"";
158150
for (unsigned i = 0; i < deps.size(); i++) {
@@ -179,13 +171,22 @@ std::string fmu_base::make_description() const {
179171
});
180172
if (!initialUnknowns.empty()) {
181173
for (const auto &v: initialUnknowns) {
182-
ss << "\t\t\t<InitialUnknown valueReference=\"" << v->index() - 1 << "\"";
174+
ss << "\t\t<InitialUnknown valueReference=\"" << v->index() - 1 << "\"";
183175
ss << "/>\n";
184176
}
185177
}
186178

187179
ss << "\t</ModelStructure>\n\n";
188180

181+
// if (!m.vendorAnnotations.empty()) {
182+
// ss << "\t<Annotations>\n";
183+
// for (const auto &annotation: m.vendorAnnotations) {
184+
// std::string indentedAnnotation = indent_multiline_string(annotation, 2);
185+
// ss << indentedAnnotation << "\n";
186+
// }
187+
// ss << "\t</Annotations>\n\n";
188+
// }
189+
189190
ss << "</fmiModelDescription>\n";
190191

191192
return ss.str();

0 commit comments

Comments
 (0)