printViolationsToOutput impure function

Requirements.Internal.printViolationsToOutput  ยท source

Icon of printViolationsToOutput

Print violated, untested and satisfied requirements to output window

Extends Modelica.Icons.Function

Reads the log file written by the requirement blocks and prints the summary of the run, both to the output window (plain text) and to htmlFile (an HTML report with one table per section). It is called once, at the end of the run, by Verify.PrintViolations, whose sortingPort.one is passed as input ok so that the call is sorted after every requirement has written its line.

The lines from line 2 on are classified by their first element (Violated, Untested, Satisfied, Statistics, see printViolationsToLogFile and printStatisticsToLogFile) and split with getElements and removeFirstElement. The summary starts with a heading giving satisfaction in percent at satisfactionTime, followed by the sections of violated (with the instant of the first violation), untested and satisfied requirements, each listing the observation, the requirement, the number of attempts and the requirement text; a section is printed only if the corresponding input printViolated, printUntested or printSatisfied is true. If the log file holds Statistics lines (requirements with violation statistics, Verify.ViolationStatistics), a section with the number of violations, the total and longest violated time, the violated fraction and the worst margin follows; the values are printed with 6 significant digits.

If htmlFile exists already, the function returns at once: the report is removed at initialization (initializeLogFile), so its existence means that this run's summary has been printed, by an earlier evaluation of the calling when-equation at the same event instant.

Inputs

NameTypeDescription
logFile inputStringName of log file where the data is present
htmlFile inputStringName of html file where log shall be written in a nicely formatted form
rootName inputStringName of root model (used to print heading)
ok inputRealOnly provided to guarantee that printViolationsToOutput is called after logFile was generated
satisfaction inputRealSatisfaction of all requirements in % (0% ... 100%)
satisfactionTime inputSI.TimeInput satisfaction is with respect to satisfactionTime
printViolated inputBoolean= true, if violated requirements shall be printed
printUntested inputBoolean= true, if untested requirements shall be printed
printSatisfied inputBoolean= true, if satisfied requirements shall be printed