printViolationsToOutput impure function
Requirements.Internal.printViolationsToOutput
ยท source
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
| Name | Type | Description |
|---|---|---|
logFile input | String | Name of log file where the data is present |
htmlFile input | String | Name of html file where log shall be written in a nicely formatted form |
rootName input | String | Name of root model (used to print heading) |
ok input | Real | Only provided to guarantee that printViolationsToOutput is called after logFile was generated |
satisfaction input | Real | Satisfaction of all requirements in % (0% ... 100%) |
satisfactionTime input | SI.Time | Input satisfaction is with respect to satisfactionTime |
printViolated input | Boolean | = true, if violated requirements shall be printed |
printUntested input | Boolean | = true, if untested requirements shall be printed |
printSatisfied input | Boolean | = true, if satisfied requirements shall be printed |