printViolationsToLogFile impure function

Requirements.Internal.printViolationsToLogFile  ยท source

Icon of printViolationsToLogFile

Print information about one requirement to log file

Extends Modelica.Icons.Function

Appends the verdict line of one requirement to the log file. It is called at the end of the run (at terminal(), or at evaluationTime of the inner PrintViolations) by every requirement block, Interfaces.PartialRequirement. The line is

Violated,<checkedComponentName>,<requirementName>,<firstFailureTime>,<attempts>,<text>
Untested,<checkedComponentName>,<requirementName>,<attempts>,<text>
Satisfied,<checkedComponentName>,<requirementName>,<attempts>,<text>

depending on atLeastOneFailure and untested; line breaks in the requirement text are replaced by blanks, so that each requirement takes exactly one line. Before writing, the log file is searched from line 2 for a line that contains ,<checkedComponentName>,<requirementName>, and does not start with Statistics,: if there is one, nothing is written, because a tool may evaluate the calling when-equation more than once at the same event instant (Modelon Impact does). The output ok is always 1; it orders the write before the summary of printViolationsToOutput through the SortingPort.

Inputs

NameTypeDescription
logFile inputStringName of log file
checkedComponentName inputStringFull path name of checked component
requirementName inputStringFull path name of requirement model
requirementText inputStringText of requirement
atLeastOneFailure inputBoolean= true, if requirement is violated (at least one failure)
untested inputBoolean= true, if requirement is untested, otherwise requirement is tested and satisfied
firstFailureTime inputSI.TimeTime instant of first failure (if atLeastOneFailure=true)
attempts inputIntegerNumber of phases in which the property was applicable (not Undefined)

Outputs

NameTypeDescription
ok outputRealDummy variable needed for sorting