Skip to content

Commit

Permalink
[BUG]Provide blocking information in Cylinders if suspend methods are…
Browse files Browse the repository at this point in the history
… called more than once. (#760)

* Create draft PR for #759

* * provide blocking information  into service view, fixed if suspend method is called more than one

* + Do not render Tasks GroupBox  if there are no tasks in component in generic service view

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: peterbarancek <62284244+peterbarancek@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and peterbarancek authored Dec 4, 2024
1 parent 383c4bf commit 02d2b04
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@

<RowDefinition />
</Grid.RowDefinitions>
<GroupBox Grid.ColumnSpan="2" Margin="10,0" Padding="10" Header="{x:Static p:strings.Tasks}" >
<GroupBox Grid.ColumnSpan="2" Margin="10,0" Padding="10" Header="{x:Static p:strings.Tasks}"
Visibility="{Binding HasTasks,Converter={tcoCore:BooleanToVisibilityConverter}}">
<ItemsControl ItemsPanel="{StaticResource HorizontalWraped}" HorizontalAlignment="Left" ItemsSource="{Binding Tasks}">

<ItemsControl.ItemTemplate>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ public bool HasComponents
get { return Components.Count()>0; }
}


public bool HasTask
{
get { return Tasks.Count() > 0; }
}

public object StatusControl
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ VAR
increment: INT;
_suspendedHome:BOOL;
_suspendedWork:BOOL;
{attribute 'hide'}
_suspendedHomeCounter:INT;
{attribute 'hide'}
_suspendedWorkCounter:INT;
END_VAR
VAR
_config : TcoCylinderConfig;
Expand All @@ -23,6 +27,8 @@ VAR
END_VAR]]></Declaration>
<Implementation>
<ST><![CDATA[SUPER^(inoAtHomePos := inoAtHomePos, inoAtWorkPos := inoAtWorkPos, inoToHomePos := inoToHomePos, inoToWorkPos := inoToWorkPos);
_suspendedHomeCounter:=0;
_suspendedWorkCounter:=0;
IF(_atHomePos AND _atWorkPos) THEN Messenger.Error('<#Home and work position sensors are both active. Check the position of sensors!#>'); END_IF;
Expand Down Expand Up @@ -309,7 +315,10 @@ VAR
_signalInfo : TcoSignalInfo;
END_VAR]]></Declaration>
<Implementation>
<ST><![CDATA[_suspendedHome:=inoDisableCondition;
<ST><![CDATA[IF inoDisableCondition THEN
_suspendedHomeCounter:=_suspendedHomeCounter+1;
END_IF
_suspendedHome:=_suspendedHomeCounter>0;
IF (_toHomePos OR _moveHomeDefault.Busy) AND inoDisableCondition THEN
_signalInfo.GetSignalInfo(SIZEOF(inoDisableCondition), ADR(inoDisableCondition));
Expand All @@ -328,7 +337,10 @@ VAR_INPUT
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[_suspendedHome:=inDisableCondition;
<ST><![CDATA[IF inDisableCondition THEN
_suspendedHomeCounter:=_suspendedHomeCounter+1;
END_IF
_suspendedHome:=_suspendedHomeCounter>0;
IF (_toHomePos OR _moveHomeDefault.Busy) AND inDisableCondition THEN
Messenger.Warning(CONCAT('<#Movement suspended due to#> : ' , inMessage));
Expand Down Expand Up @@ -366,7 +378,10 @@ VAR
_signalInfo : TcoSignalInfo;
END_VAR]]></Declaration>
<Implementation>
<ST><![CDATA[_suspendedHome:=inoDisableCondition;
<ST><![CDATA[IF inoDisableCondition THEN
_suspendedHomeCounter:=_suspendedHomeCounter+1;
END_IF
_suspendedHome:=_suspendedHomeCounter>0;
IF (_toHomePos OR _moveHomeDefault.Busy) AND not inoDisableCondition THEN
_signalInfo.GetSignalInfo(SIZEOF(inoDisableCondition), ADR(inoDisableCondition));
Expand Down Expand Up @@ -405,7 +420,11 @@ VAR
_signalInfo : TcoSignalInfo;
END_VAR]]></Declaration>
<Implementation>
<ST><![CDATA[_suspendedWork:=inoDisableCondition;
<ST><![CDATA[IF inoDisableCondition THEN
_suspendedWorkCounter:=_suspendedWorkCounter+1;
END_IF
_suspendedWork:=_suspendedWorkCounter>0;
IF (_toWorkPos OR _moveWorkDefault.Busy) AND inoDisableCondition THEN
_signalInfo.GetSignalInfo(SIZEOF(inoDisableCondition), ADR(inoDisableCondition));
Messenger.Warning(CONCAT('<#Movement suspended due to#> : ' , _signalInfo.SymbolPath));
Expand All @@ -423,7 +442,10 @@ VAR_INPUT
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[_suspendedWork := inDisableCondition;
<ST><![CDATA[IF inDisableCondition THEN
_suspendedWorkCounter:=_suspendedWorkCounter+1;
END_IF
_suspendedWork:=_suspendedWorkCounter>0;
IF (_toWorkPos OR _moveWorkDefault.Busy) AND inDisableCondition THEN
Messenger.Warning(CONCAT('<#Movement suspended due to#> : ', inMessage));
Expand Down Expand Up @@ -463,7 +485,10 @@ VAR
_signalInfo : TcoSignalInfo;
END_VAR]]></Declaration>
<Implementation>
<ST><![CDATA[_suspendedWork := inoDisableCondition;
<ST><![CDATA[IF inoDisableCondition THEN
_suspendedWorkCounter:=_suspendedWorkCounter+1;
END_IF
_suspendedWork:=_suspendedWorkCounter>0;
IF (_toWorkPos OR _moveWorkDefault.Busy) AND not inoDisableCondition THEN
_signalInfo.GetSignalInfo(SIZEOF(inoDisableCondition), ADR(inoDisableCondition));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ VAR
increment : INT;
_suspendedHome : BOOL;
_suspendedWork : BOOL;
{attribute 'hide'}
_suspendedHomeCounter:INT;
{attribute 'hide'}
_suspendedWorkCounter:INT;
END_VAR
VAR
_config : TcoCylinderConfig;
Expand All @@ -24,7 +27,8 @@ VAR
END_VAR]]></Declaration>
<Implementation>
<ST><![CDATA[SUPER^(inoAtHomePos1 := inoAtHomePos1,inoAtHomePos2 := inoAtHomePos2, inoAtWorkPos1 := inoAtWorkPos1,inoAtWorkPos2 := inoAtWorkPos2, inoToHomePos := inoToHomePos, inoToWorkPos := inoToWorkPos);
_suspendedHomeCounter:=0;
_suspendedWorkCounter:=0;
IF(_atHomePos AND _atWorkPos) THEN Messenger.Error('<#Home and work position sensors are both active. Check the position of sensors!#>'); END_IF;
Expand Down Expand Up @@ -308,7 +312,10 @@ VAR
_signalInfo : TcoSignalInfo;
END_VAR]]></Declaration>
<Implementation>
<ST><![CDATA[_suspendedHome:=inoDisableCondition;
<ST><![CDATA[IF inoDisableCondition THEN
_suspendedHomeCounter:=_suspendedHomeCounter+1;
END_IF
_suspendedHome:=_suspendedHomeCounter>0;
IF (_toHomePos OR _moveHomeDefault.Busy) AND inoDisableCondition THEN
_signalInfo.GetSignalInfo(SIZEOF(inoDisableCondition), ADR(inoDisableCondition));
Expand All @@ -328,8 +335,10 @@ VAR_INPUT
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[_suspendedHome := inDisableCondition;
<ST><![CDATA[IF inDisableCondition THEN
_suspendedHomeCounter:=_suspendedHomeCounter+1;
END_IF
_suspendedHome:=_suspendedHomeCounter>0;
IF (_toHomePos OR _moveHomeDefault.Busy) AND inDisableCondition THEN
Messenger.Warning(CONCAT('<#Movement suspended due to#> : ', inMessage));
_toHomePos := FALSE;
Expand Down Expand Up @@ -369,7 +378,10 @@ VAR
_signalInfo : TcoSignalInfo;
END_VAR]]></Declaration>
<Implementation>
<ST><![CDATA[_suspendedHome := inoDisableCondition;
<ST><![CDATA[IF inoDisableCondition THEN
_suspendedHomeCounter:=_suspendedHomeCounter+1;
END_IF
_suspendedHome:=_suspendedHomeCounter>0;
IF (_toHomePos OR _moveHomeDefault.Busy) AND NOT inoDisableCondition THEN
_signalInfo.GetSignalInfo(SIZEOF(inoDisableCondition), ADR(inoDisableCondition));
Expand Down Expand Up @@ -411,7 +423,10 @@ VAR
_signalInfo : TcoSignalInfo;
END_VAR]]></Declaration>
<Implementation>
<ST><![CDATA[_suspendedWork := inoDisableCondition;
<ST><![CDATA[IF inoDisableCondition THEN
_suspendedWorkCounter:=_suspendedWorkCounter+1;
END_IF
_suspendedWork:=_suspendedWorkCounter>0;
IF (_toWorkPos OR _moveWorkDefault.Busy) AND inoDisableCondition THEN
_signalInfo.GetSignalInfo(SIZEOF(inoDisableCondition), ADR(inoDisableCondition));
Expand All @@ -436,7 +451,10 @@ VAR
inoDisableCondition: BOOL;
END_VAR]]></Declaration>
<Implementation>
<ST><![CDATA[_suspendedWork := inDisableCondition;
<ST><![CDATA[IF inDisableCondition THEN
_suspendedWorkCounter:=_suspendedWorkCounter+1;
END_IF
_suspendedWork:=_suspendedWorkCounter>0;
IF (_toWorkPos OR _moveWorkDefault.Busy) AND inDisableCondition THEN
Messenger.Warning(CONCAT('<#Movement suspended due to#> : ', inMessage));
Expand Down Expand Up @@ -477,7 +495,10 @@ VAR
_signalInfo : TcoSignalInfo;
END_VAR]]></Declaration>
<Implementation>
<ST><![CDATA[_suspendedWork := inoDisableCondition;
<ST><![CDATA[IF inoDisableCondition THEN
_suspendedWorkCounter:=_suspendedWorkCounter+1;
END_IF
_suspendedWork:=_suspendedWorkCounter>0;
IF (_toWorkPos OR _moveWorkDefault.Busy) AND NOT inoDisableCondition THEN
_signalInfo.GetSignalInfo(SIZEOF(inoDisableCondition), ADR(inoDisableCondition));
Expand Down

0 comments on commit 02d2b04

Please sign in to comment.