Skip to content

Commit

Permalink
***TcoData**
Browse files Browse the repository at this point in the history
* fixed layout in selector ( when data are too long)

***TcoElements***
+suspend method  with expression for blocking movement
  • Loading branch information
peterbarancek committed May 31, 2024
1 parent 5691cfa commit 42191bb
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,16 @@
CornerRadius="5">
<Grid DataContext="{Binding DataViewModel}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" MaxWidth="300" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition />

<ColumnDefinition Width="Auto"/>

</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
</Grid.RowDefinitions>
<WrapPanel Grid.Column="0">
<WrapPanel Orientation="Horizontal" Grid.Column="0">
<Label
Margin="10"
HorizontalAlignment="Left"
Expand All @@ -57,35 +58,38 @@
FontWeight="Bold"
Text="{Binding DataExchange._data._EntityId.Cyclic}"
TextWrapping="WrapWithOverflow" />
</WrapPanel>
<Grid Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="Auto"></ColumnDefinition>
</Grid.ColumnDefinitions>
<ComboBox
Grid.Column="0"
<ComboBox
Grid.Column="1"
MinHeight="40"
MinWidth="250"
Margin="10"
HorizontalAlignment="Stretch"
VerticalAlignment="Top"
ItemsSource="{Binding ObservableRecords, Mode=OneWay}"
SelectedItem="{Binding SelectedRecord}"
Visibility="{Binding Mode, Mode=OneWay, Converter={wpf:ModeConverter}, ConverterParameter=Display}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock
HorizontalAlignment="Center"
FontSize="20"
Text="{Binding _EntityId}" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</WrapPanel>

<Grid Grid.Column="2">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="Auto"></ColumnDefinition>
</Grid.ColumnDefinitions>

</Grid>
<Grid Grid.Column="1">
<Grid.ColumnDefinitions>
Expand All @@ -107,7 +111,7 @@
</Grid>
</Grid>
<Grid
Grid.Column="1"
Grid.Column="0"
Grid.Row="1"
Grid.ColumnSpan="2"
Margin="20,5,20,5"
Expand All @@ -125,8 +129,7 @@
HorizontalContentAlignment="Center"
HorizontalAlignment="Stretch"
VerticalContentAlignment="Stretch"
BorderBrush="{DynamicResource OnSecondary}"
Text="{Binding FilterByID}"/>
Text="{Binding FilterByID}"/>
<Button
Style="{DynamicResource MaterialDesignFlatMidBgButton}"
Grid.Column="1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@
<data name="___Turning_table_is_suspended_due_to_NOT___" xml:space="preserve">
<value>Turning table is suspended due to NOT </value>
</data>
<data name="___Rotating_is_suspended_due_to__" xml:space="preserve">
<value>Rotating is suspended due to</value>
</data>
<data name="___Check_On__" xml:space="preserve">
<value>Check On</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,23 @@ ELSIF (_turnTask.Busy OR _startTurn OR _enableTurn ) AND inoDisableCondition AND
END_IF]]></ST>
</Implementation>
</Method>
<Method Name="SuspendExpression" Id="{d8fc797a-9968-0ca9-180a-dcf844ea4441}">
<Declaration><![CDATA[METHOD SuspendExpression : BOOL
VAR_INPUT
inDisableCondition : BOOL;
inMessage:STRING;
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[IF (_turnTask.Busy OR _startTurn OR _enableTurn ) AND inDisableCondition THEN
Messenger.Warning(CONCAT('<#Rotating is suspended due to#> : ' , inMessage));
_startTurn := FALSE;
_enableTurn := FALSE;
IF(__ISVALIDREF(THIS^.inoStartTurn)) THEN THIS^.inoStartTurn := FALSE; END_IF;
IF(__ISVALIDREF(THIS^.inoEnableTurn)) THEN THIS^.inoEnableTurn := FALSE; END_IF;
END_IF;]]></ST>
</Implementation>
</Method>
<Property Name="TurnTask" Id="{edac1389-8e4f-0acd-2642-1f7433525494}" FolderPath="Tasks\">
<Declaration><![CDATA[(*~
<docu>
Expand All @@ -324,4 +341,4 @@ END_VAR
</Get>
</Property>
</POU>
</TcPlcObject>
</TcPlcObject>
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ _carousel(
_carousel.Suspend(inoDisableCondition:= _disableSignal1 ,Invert:=FALSE); //this might be signal from Light Curtain (safety is inerupted)
_carousel.Suspend(inoDisableCondition:=_disableSignal2 ,Invert:=TRUE);
_carousel.Suspend(inoDisableCondition:=_disableSignal2 ,Invert:=TRUE);
_carousel.SuspendExpression (inDisableCondition:=_disableSignal2 ,inMessage:='SOME BLOCKIKG ACTIVE');
_carousel.Service();
Expand Down

0 comments on commit 42191bb

Please sign in to comment.