Skip to content

Commit

Permalink
#39 Invoke returns new ITcoTaskStatus interface + refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Abcd4321 committed Apr 19, 2021
1 parent ba8bb22 commit 73837e2
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
</summary>
</docu>
~*)
METHOD Invoke : ITcoTask
METHOD Invoke : ITcoTaskStatus
]]></Declaration>
</Method>
</Itf>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.6">
<Itf Name="ITcoTaskStatus" Id="{6341a5e9-539f-07e2-2781-89effa0ed565}">
<Declaration><![CDATA[INTERFACE ITcoTaskStatus
]]></Declaration>
<Property Name="Busy" Id="{0f27cd62-9c61-0157-0eeb-42c4f74b66be}">
<Declaration><![CDATA[PROPERTY Busy : BOOL]]></Declaration>
<Get Name="Get" Id="{ae011746-e617-02b7-243e-e8509384b84f}">
<Declaration><![CDATA[]]></Declaration>
</Get>
</Property>
<Property Name="Done" Id="{e7e4f0d2-681c-0127-20a0-25e98eef98f1}">
<Declaration><![CDATA[PROPERTY Done : BOOL]]></Declaration>
<Get Name="Get" Id="{ad228e2d-55b7-001f-0fb1-ccc8383b9be3}">
<Declaration><![CDATA[]]></Declaration>
</Get>
</Property>
<Property Name="Error" Id="{e997df47-5359-0431-0d62-646922dde6fe}">
<Declaration><![CDATA[PROPERTY Error : BOOL]]></Declaration>
<Get Name="Get" Id="{1c91e88f-586c-08a8-3390-342071b85c00}">
<Declaration><![CDATA[]]></Declaration>
</Get>
</Property>
</Itf>
</TcPlcObject>
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</example>
</docu>
~*)
FUNCTION_BLOCK TcoTask EXTENDS TcoObject IMPLEMENTS ITcoTask
FUNCTION_BLOCK TcoTask EXTENDS TcoObject IMPLEMENTS ITcoTask, ITcoTaskStatus
VAR
{attribute clr [ReadOnly()]}
_taskState : eTaskState;
Expand Down Expand Up @@ -434,7 +434,7 @@ PROPERTY Identity : ULINT]]></Declaration>
</summary>
</docu>
~*)
METHOD Invoke : ITcoTask
METHOD Invoke : ITcoTaskStatus
VAR
_newInvokeCall : BOOL;
END_VAR]]></Declaration>
Expand Down
3 changes: 3 additions & 0 deletions src/TcoCore/src/XaeTcoCore/TcoCore/TcoCore.plcproj
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@
<Compile Include="POUs\Prototypes\TcoTask\eTaskState.TcDUT">
<SubType>Code</SubType>
</Compile>
<Compile Include="POUs\Prototypes\TcoTask\ITcoTaskStatus.TcIO">
<SubType>Code</SubType>
</Compile>
<Compile Include="POUs\Prototypes\TcoTask\ITcoTask.TcIO">
<SubType>Code</SubType>
</Compile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ END_VAR
</Implementation>
</Method>
<Method Name="MoveHome" Id="{ec08a57d-3edb-01f0-35bc-3c8a96242bb9}">
<Declaration><![CDATA[METHOD MoveHome : TcoCore.ITcoTask
<Declaration><![CDATA[METHOD MoveHome : TcoCore.ITcoTaskStatus
]]></Declaration>
<Implementation>
<ST><![CDATA[MoveHome := THIS^._moveHomeTask.Invoke();]]></ST>
</Implementation>
</Method>
<Method Name="MoveWork" Id="{e9e0be0c-566d-0749-1c75-1097c8dadecf}">
<Declaration><![CDATA[METHOD MoveWork : TcoCore.ITcoTask]]></Declaration>
<Declaration><![CDATA[METHOD MoveWork : TcoCore.ITcoTaskStatus]]></Declaration>
<Implementation>
<ST><![CDATA[MoveWork := THIS^._moveWorkTask.Invoke();]]></ST>
</Implementation>
Expand Down

0 comments on commit 73837e2

Please sign in to comment.