Difference between revisions of "Extensions.DiagCom.IsPositive"

From emotive
Jump to navigation Jump to search
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<big>Big text</big>[[Category:DiagCom]]
+
{{DISPLAYTITLE:OTX '''IsPositive'''}}[[Category:DiagCom]]
 
== Classification ==
 
== Classification ==
{{ClassificationActivity | IsPositive | Test, a response to positive or negative | [[Term]] | [[DiagCom|OTX DiagCom extension]] | [[Response related terms]] | - | - }}
+
{{ClassificationActivity | IsPositive | Checks whether a response is positive | [[Term]] | [[Extensions.DiagCom|OTX DiagCom extension]] | [[Extensions.DiagCom#Terms|Response related terms]] | - | - }}
  
== Pseudo-Code Syntax ==
+
== OTL Syntax ==
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
Boolean IsPositive(Response response);
+
BooleanTerm DiagCom.IsPositive(ResponseTerm response);
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
== Description ==
 
== Description ==
The '''IsPositive''' term tests whether the specified response is positive or negative.
+
The '''IsPositive''' term checks whether a response is positive. It accepts a '''ResponseTerm'''. For details on response states, please refer to the [[Extensions.DiagCom.ResponseState|ResponseState]] data type
  
{{TermReturnValue| [[Boolean]] | True if the response is positive, otherwise false.}}
+
{{TermReturnValue| [[Core.DataTypes.SimpleDataType.Boolean|Boolean]] | Returns True if the '''response''' is positive, otherwise false.}}
  
 
== Properties ==
 
== Properties ==
 
{| {{TableHeader}}
 
{| {{TableHeader}}
 
{{TableRowPropertiesHeader}}
 
{{TableRowPropertiesHeader}}
{{TableRowPropertie1| Response | [[Response]] | [[Term]] | - | [1] | Response object.}}
+
{{TableRowPropertie2| Response | [[Extensions.DiagCom.Response|Response]] | [[Term]] | - | [1] | The '''Response''' which will be checked for being positive.}}
 
|}
 
|}
  
 
== Examples ==
 
== Examples ==
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
Boolean isPositive = IsPositive(response);
+
/// Local Declarations
 +
 
 +
DiagCom.Result Result1;
 +
DiagCom.Response Response1;
 +
Boolean Boolean1 = false;
 +
DiagCom.ComChannel ComChannel1;
 +
 
 +
/// Flow
 +
 
 +
ComChannel1 = DiagCom.GetComChannel("LL_GatewUDS", "EV_GatewLear_006", false);
 +
[#MetaData(RequestPdu), <#Data>22 01 00</#Data>]
 +
DiagCom.ExecuteDiagService(DiagCom.CreateDiagServiceByName(ComChannel1, "DiagnServi_ReadDataByIdentActuaTestStatu"), {}, {}, Result1, NULL, false, false);
 +
Response1 = DiagCom.GetFirstResponse(Result1);
 +
Boolean1 = DiagCom.IsPositive(Response1);
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
== See also ==
 
== See also ==
[[GetAllResponses]] <br/>
+
[[Extensions.DiagCom.GetComChannel|GetComChannel]] <br/>
[[GetFirstResponse]] <br/>
+
[[Extensions.DiagCom.CreateDiagServiceByName|CreateDiagServiceByName]] <br/>
[[ExecuteDiagService]] <br/>
+
[[Extensions.DiagCom.CreateDiagServiceBySemantic|CreateDiagServiceBySemantic]] <br/>
[[GetFirstResult]] <br/>
+
[[Extensions.DiagCom.ExecuteDiagService|ExecuteDiagService]] <br/>
 +
[[Extensions.DiagCom.GetFirstResult|GetFirstResult]] <br/>
 +
[[Extensions.DiagCom.GetAllResults|GetAllResults]] <br/>
 +
[[Extensions.DiagCom.GetAllResponses|GetAllResponses]] <br/>
 +
[[Extensions.DiagCom.GetFirstResponse|GetFirstResponse]] <br/>
 +
[[Extensions.DiagCom.GetResponseState|GetResponseState]] <br/>

Latest revision as of 10:14, 12 September 2019

Classification

Name IsPositive
Short Description Checks whether a response is positive
Class Term
Extension OTX DiagCom extension
Group Response related terms
Exceptions -
Checker Rules -
Standard Compliant Yes

OTL Syntax

BooleanTerm DiagCom.IsPositive(ResponseTerm response);

Description

The IsPositive term checks whether a response is positive. It accepts a ResponseTerm. For details on response states, please refer to the ResponseState data type

Return Value

The Term returns the value, see table below.

Icons Note.png In OTX, Terms are categorized according to its return data type!
Data Type Description
Boolean Returns True if the response is positive, otherwise false.

Properties

Name Data Type Class Default Cardinality Description
Response Response Term - [1] The Response which will be checked for being positive.

Examples

/// Local Declarations

DiagCom.Result Result1;
DiagCom.Response Response1;
Boolean Boolean1 = false;
DiagCom.ComChannel ComChannel1;

/// Flow

ComChannel1 = DiagCom.GetComChannel("LL_GatewUDS", "EV_GatewLear_006", false);
[#MetaData(RequestPdu), <#Data>22 01 00</#Data>]
DiagCom.ExecuteDiagService(DiagCom.CreateDiagServiceByName(ComChannel1, "DiagnServi_ReadDataByIdentActuaTestStatu"), {}, {}, Result1, NULL, false, false);
Response1 = DiagCom.GetFirstResponse(Result1);
Boolean1 = DiagCom.IsPositive(Response1);

See also

GetComChannel
CreateDiagServiceByName
CreateDiagServiceBySemantic
ExecuteDiagService
GetFirstResult
GetAllResults
GetAllResponses
GetFirstResponse
GetResponseState