Extensions.TestResultHandling.TestResultState

From emotive
Jump to navigation Jump to search

Classification

Name TestResultState
Short Description An enumeration type describing the state of the test result evaluation
Class Simple Data Type
Base Data Type SimpleType
Default Value NOT_TESTED
Provide a Literal Yes
SpecifiedBy ISO 13209-4
Standard Compliant Yes

Description

TestResultState is an enumeration type describing the state of the test result evaluation.
All TestResultContainers in the TestResultHandling data model will have a defined TestResultState with NOT_TESTED as the initial value.
It is possible, that there are TestResultContainers, which have got no own test result but consist of child TestResultContainers. In this case the TestResultContainer gets the highest-order TestResultState of its childs. This rule leads to the following behaviour:
The parent TestResultContainer TestResultState will reflect the most critical TestResultState of its child TestResultContainer TestResultStates. E.g. the parent TestResultContainer TestResultState is OK, if at least one child TestResultContainer TestResultState is OK and no one is NOT_OK or ERROR or NOT_TESTED.

Exclamation.png Important: If a parent TestResultContainer gets an own TestResultState by one of the SetTestResult derived actions, the inherited TestResultState from its childs will be overwritten.
Exclamation.png Important: If a TestResultContainer can’t be tested (e.g. because of a low equipped vehicle), the TestResultState of the highest-order untestable TestResultContainer will be set manually by the SetValueTestResult action.

The list of allowed enumeration values is defined as follows:

Value Literal Description
OK @TestResultStates:OK The test result evaluation succeeded.
NOT_OK @TestResultStates:NOT_OK The test result evaluation failed.
ERROR @TestResultStates:ERROR An error has occurred while capturing or evaluating the test result, e.g. evaluation cannot take place because a diagService gave a negative response.
NOT_TESTED @TestResultStates:NOT_TESTED The TestResultContainer has not been tested yet. This is the most critical state.
INFO @TestResultStates:INFO The test result is only for documentation purposes without an evaluation.
NOT_AVAILABLE @TestResultStates:NOT_AVAILABLE The test result evaluation is not necessary because the feature is missing. This is the least critical state.

Order Relation

TestResultState values may occur as operands of comparisons (cf. ISO 13209-2, relational operations). For this case, the following order relation will apply:

NOT_TESTED < ERROR < NOT_OK < OK < INFO < NOT_AVAILABLE

Literal

The syntax for Literals for complex data types will be used, where the member value is one of the values in the list.

@TestResultState:NOT_TESTED|ERROR|NOT_OK|OK|INFO|NOT_AVAILABLE

Core Conversion

The following table shows the rules for conversion to another data type:

Conversion Result Sample
ToBoolean Undefined (should not be used)
ToInteger Return the index of the value in the TestResultStates enumeration (smallest index is 0) Integer val = ToInteger(@TestResultStates:NOT_TESTED); // Returns 0
ToFloat Undefined (should not be used)
ToString The resulting string will be the name of the enumeration value String s = ToString(@TestResultStates:NOT_OK); // Returns "NOT_OK"
ToByteField Undefined (should not be used)

Sample

TestResultHandling.TestResultState TestResultState1 = @TestResultState:NOT_TESTED;