ifctester - indicate optionality in report message

Previously for both cardinality optional/required ifctester would show same results.

E.g.
<ids:property dataType="IFCBOOLEAN" cardinality="required">
<ids:property dataType="IFCBOOLEAN" cardinality="optional">

Were resulting in something like
LoadBearing data shall be true and in the dataset Pset_WallCommon
LoadBearing data shall be true and in the dataset Pset_WallCommon

Now it will result in
LoadBearing data shall be true and in the dataset Pset_WallCommon
LoadBearing data may be true and in the dataset Pset_WallCommon
This commit is contained in:
Andrej730
2024-10-29 18:16:45 +05:00
parent 067203cb9a
commit fa07f184c3
+4
View File
@@ -133,6 +133,10 @@ class Facet:
if requirement.cardinality == "prohibited":
is_prohibited = not is_prohibited
templates = self.prohibited_templates if is_prohibited else self.requirement_templates
if requirement.cardinality == "optional":
templates = [
t.replace("shall", "may").replace("Shall", "May").replace("must", "may") for t in templates
]
for template in templates:
total_variables = len(template) - len(template.replace("{", ""))