123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191 |
- <UserControl x:Class="MECF.Framework.UI.Client.CenterViews.Maitenances.IO1.IO1View"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
- xmlns:controls="clr-namespace:OpenSEMI.Ctrlib.Controls"
- xmlns:micro="clr-namespace:Caliburn.Micro"
- xmlns:c="clr-namespace:MECF.Framework.UI.Client.Ctrlib.Converter"
- xmlns:toolkit="http://schemas.xceed.com/wpf/xaml/toolkit"
- mc:Ignorable="d" >
- <UserControl.Resources>
- <c:DisplayNameConverter x:Key="DisplayConverter" />
- <DataTemplate x:Key="DOTemplate">
- <Grid Margin="5,-1,0,0" Height="23">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="50"></ColumnDefinition>
- <ColumnDefinition Width="200"></ColumnDefinition>
- <ColumnDefinition Width="50"></ColumnDefinition>
- <ColumnDefinition Width="45"></ColumnDefinition>
- <ColumnDefinition Width="45"></ColumnDefinition>
- </Grid.ColumnDefinitions>
- <Border BorderBrush="{DynamicResource DataGrid_Cell_BD}" BorderThickness="1" Padding="5,1">
- <TextBlock Text= "{Binding Path=Index}" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>
- </Border>
- <Border Grid.Column="1" BorderBrush="{DynamicResource DataGrid_Cell_BD}" BorderThickness="0,1,1,1" Padding="5,1">
- <TextBlock Text= "{Binding Path=DisplayName, Converter={StaticResource DisplayConverter}}" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>
- </Border>
- <Border Grid.Column="2" BorderBrush="{DynamicResource DataGrid_Cell_BD}" BorderThickness="0,1,1,1" Padding="5,1">
- <TextBlock Text= "{Binding Path=Address}" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>
- </Border>
- <Border Grid.Column="3" BorderBrush="{DynamicResource DataGrid_Cell_BD}" BorderThickness="0,1,1,1" Padding="5,1">
- <controls:SwitchButton ON="{Binding Value}" Style="{StaticResource Lamp-Button}" HorizontalAlignment="Center" />
- </Border>
- <Border Grid.Column="4" BorderBrush="{DynamicResource DataGrid_Cell_BD}" BorderThickness="0,1,1,1" Padding="5,1">
- <controls:SwitchButton ON="{Binding Value}" Style="{StaticResource OperationButton}" HorizontalAlignment="Center">
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="Click">
- <micro:ActionMessage MethodName="SetDO">
- <micro:Parameter Value="{Binding }" />
- </micro:ActionMessage>
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </controls:SwitchButton>
- </Border>
- </Grid>
- </DataTemplate>
- <DataTemplate x:Key="DITemplate">
- <Grid Margin="5,-1,0,0" Height="23">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="50"></ColumnDefinition>
- <ColumnDefinition Width="200"></ColumnDefinition>
- <ColumnDefinition Width="50"></ColumnDefinition>
- <ColumnDefinition Width="45"></ColumnDefinition>
- </Grid.ColumnDefinitions>
- <Border BorderBrush="{DynamicResource DataGrid_Cell_BD}" BorderThickness="1" Padding="5,1">
- <TextBlock Text= "{Binding Path=Index}" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>
- </Border>
- <Border Grid.Column="1" BorderBrush="{DynamicResource DataGrid_Cell_BD}" BorderThickness="0,1,1,1" Padding="5,1">
- <TextBlock Text= "{Binding Path=DisplayName, Converter={StaticResource DisplayConverter}}" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>
- </Border>
- <Border Grid.Column="2" BorderBrush="{DynamicResource DataGrid_Cell_BD}" BorderThickness="0,1,1,1" Padding="5,1">
- <TextBlock Text= "{Binding Path=Address}" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>
- </Border>
- <Border Grid.Column="3" BorderBrush="{DynamicResource DataGrid_Cell_BD}" BorderThickness="0,1,1,1" Padding="5,1">
- <controls:SwitchButton ON="{Binding Value}" Style="{StaticResource Lamp-Button}" HorizontalAlignment="Center" />
- </Border>
- </Grid>
- </DataTemplate>
- <DataTemplate x:Key="AOTemplate">
- <Grid Margin="5,-1,0,0" Height="23">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="30"></ColumnDefinition>
- <ColumnDefinition Width="200"></ColumnDefinition>
- <ColumnDefinition Width="auto"></ColumnDefinition>
- <ColumnDefinition Width="45"></ColumnDefinition>
- <ColumnDefinition Width="60"></ColumnDefinition>
- <ColumnDefinition Width="60"></ColumnDefinition>
- </Grid.ColumnDefinitions>
- <Border BorderBrush="{DynamicResource DataGrid_Cell_BD}" BorderThickness="1" Padding="5,1">
- <TextBlock Text= "{Binding Path=Index}" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>
- </Border>
- <Border Grid.Column="1" BorderBrush="{DynamicResource DataGrid_Cell_BD}" BorderThickness="0,1,1,1" Padding="5,1">
- <TextBlock Text= "{Binding Path=DisplayName, Converter={StaticResource DisplayConverter}}" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>
- </Border>
- <!--<Border Grid.Column="2" BorderBrush="{DynamicResource DataGrid_Cell_BD}" BorderThickness="0,1,1,1" Padding="5,1">
- <TextBlock Text= "{Binding Path=Address}" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>
- </Border>-->
- <Border Grid.Column="3" BorderBrush="{DynamicResource DataGrid_Cell_BD}" BorderThickness="0,1,1,1" Padding="5,1">
- <TextBlock Text= "{Binding Path=Value}" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>
- </Border>
- <Border Grid.Column="4" BorderBrush="{DynamicResource DataGrid_Cell_BD}" BorderThickness="0,1,1,1" Padding="5,1">
- <toolkit:IntegerUpDown Text="{Binding Path=NewValue}"/>
- </Border>
- <Border Grid.Column="5" BorderBrush="{DynamicResource DataGrid_Cell_BD}" BorderThickness="0,1,1,1" Padding="5,1">
- <Button Content="Set" FontSize="12" Height="22">
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="Click">
- <micro:ActionMessage MethodName="SetAO">
- <micro:Parameter Value="{Binding }" />
- </micro:ActionMessage>
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </Button>
- </Border>
- </Grid>
- </DataTemplate>
- <DataTemplate x:Key="AITemplate">
- <Grid Margin="5,-1,0,0" Height="23">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="30"></ColumnDefinition>
- <ColumnDefinition Width="200"></ColumnDefinition>
- <ColumnDefinition Width="auto"></ColumnDefinition>
- <ColumnDefinition Width="45"></ColumnDefinition>
- </Grid.ColumnDefinitions>
- <Border BorderBrush="{DynamicResource DataGrid_Cell_BD}" BorderThickness="1" Padding="5,1">
- <TextBlock Text= "{Binding Path=Index}" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>
- </Border>
- <Border Grid.Column="1" BorderBrush="{DynamicResource DataGrid_Cell_BD}" BorderThickness="0,1,1,1" Padding="5,1">
- <TextBlock Text= "{Binding Path=DisplayName, Converter={StaticResource DisplayConverter}}" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>
- </Border>
- <!--<Border Grid.Column="2" BorderBrush="{DynamicResource DataGrid_Cell_BD}" BorderThickness="0,1,1,1" Padding="5,1">
- <TextBlock Text= "{Binding Path=Address}" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>
- </Border>-->
- <Border Grid.Column="3" BorderBrush="{DynamicResource DataGrid_Cell_BD}" BorderThickness="0,1,1,1" Padding="5,1">
- <TextBlock Text= "{Binding Path=Value}" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>
- </Border>
- </Grid>
- </DataTemplate>
- </UserControl.Resources>
- <Grid HorizontalAlignment="Stretch">
- <TabControl HorizontalContentAlignment="Stretch">
- <TabItem Header="DI" Visibility="{Binding DIVisibility}">
- <ListBox ItemsSource="{Binding DIs}"
- ItemContainerStyle="{DynamicResource Sepcial_ListBoxItem}"
- AlternationCount="2" ItemTemplate="{StaticResource DITemplate}"
- ScrollViewer.VerticalScrollBarVisibility="Disabled"
- Width="{Binding DIWidth}"
- BorderThickness="0" Margin="5,0" HorizontalAlignment="Left" IsEnabled="{Binding IsPermission}">
- <ListBox.ItemsPanel>
- <ItemsPanelTemplate>
- <WrapPanel IsItemsHost="True" Orientation="Vertical" Margin="1,1,0,0"/>
- </ItemsPanelTemplate>
- </ListBox.ItemsPanel>
- </ListBox>
- </TabItem>
- <TabItem Header="DO" Visibility="{Binding DOVisibility}">
- <ListBox ItemContainerStyle="{DynamicResource Sepcial_ListBoxItem}" ItemsSource="{Binding DOs}" AlternationCount="2" ItemTemplate="{StaticResource DOTemplate}" IsEnabled="{Binding IsPermission}"
- ScrollViewer.VerticalScrollBarVisibility="Disabled" BorderThickness="0" Margin="5,0" HorizontalAlignment="Left">
- <ListBox.ItemsPanel>
- <ItemsPanelTemplate>
- <WrapPanel IsItemsHost="True" Orientation="Vertical" Margin="1,1,0,0"/>
- </ItemsPanelTemplate>
- </ListBox.ItemsPanel>
- </ListBox>
- </TabItem>
- <TabItem Header="AI" Visibility="{Binding AIVisibility}">
- <ListBox ItemsSource="{Binding AIs}"
- ItemContainerStyle="{DynamicResource Sepcial_ListBoxItem}"
- AlternationCount="2" ItemTemplate="{StaticResource AITemplate}"
- ScrollViewer.VerticalScrollBarVisibility="Disabled"
- Width="{Binding AIWidth}"
- BorderThickness="0" Margin="5,0" HorizontalAlignment="Left" IsEnabled="{Binding IsPermission}">
- <ListBox.ItemsPanel>
- <ItemsPanelTemplate>
- <WrapPanel IsItemsHost="True" Orientation="Vertical" Margin="1,1,0,0"/>
- </ItemsPanelTemplate>
- </ListBox.ItemsPanel>
- </ListBox>
- </TabItem>
- <TabItem Header="AO" Visibility="{Binding AOVisibility}">
- <ListBox ItemContainerStyle="{DynamicResource Sepcial_ListBoxItem}" ItemsSource="{Binding AOs}" AlternationCount="2" ItemTemplate="{StaticResource AOTemplate}" IsEnabled="{Binding IsPermission}"
- ScrollViewer.VerticalScrollBarVisibility="Disabled" BorderThickness="0" Margin="5,0" HorizontalAlignment="Left">
- <ListBox.ItemsPanel>
- <ItemsPanelTemplate>
- <WrapPanel IsItemsHost="True" Orientation="Vertical" Margin="1,1,0,0"/>
- </ItemsPanelTemplate>
- </ListBox.ItemsPanel>
- </ListBox>
- </TabItem>
- </TabControl>
- </Grid>
- </UserControl>
|