Context Object Parameters
Parameter Name | Type | Read/Write | Comments |
---|
SegmentFillingRatio: Output (Real) | Real |
Read | Segment filling ratio to compute. |
Sample
The following sample explains how to use an opening ID to
customize the filling ratio computation of a whole segment.
/* CATRule signature (do not edit) : (ThisObject : #In Segment, Parameters : #In RuleContext) : #Void */
/* Rule created by ABC MM/DD/YYYY */
Let result (BOOLEAN)
Let FillingRatio (REAL)
Let sMessage (STRING)
Let severity (INTEGER)
set FillingRatio = 0.0
result = ThisObject->Elec_FillingRatio(FillingRatio)
/* Though the severity and message has no impact on behavior, we set it */
if(FillingRatio >= 0.8)
{
severity = 1
set sMessage = "Some sections are filled more than 80%"
}
else if( (FillingRatio < 0.8) and (FillingRatio >= 0.5) )
{
set severity = 1
set sMessage = "All sections are filled less than 80% but more than 50%"
}
else
{
set severity = 0
set sMessage = "All sections are filled less than 50%"
}
Parameters.SetAttributeReal("SegmentFillingRatio", FillingRatio)
Parameters.Severity = severity
Parameters.Message = sMessage