123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243 |
- <UserControl x:Class="EfemDualSimulator.Views.SimulatorIOSystemView"
- 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:control="clr-namespace:MECF.Framework.UI.Core.Control;assembly=MECF.Framework.UI.Core"
- xmlns:ctrl="http://OpenSEMI.Ctrlib.com/presentation"
- xmlns:toolkit="clr-namespace:Xceed.Wpf.Toolkit;assembly=Xceed.Wpf.Toolkit"
- xmlns:views="clr-namespace:EfemDualSimulator.Views"
- mc:Ignorable="d"
- d:DesignHeight="450" d:DesignWidth="1900">
- <UserControl.Resources>
- <views:BoolBackgroundConverter x:Key="BoolBackgroundConverter"/>
- <SolidColorBrush x:Key="DataGrid_Cell_BD" Color="Gray"/>
- <Style x:Key="Lamp-Button" TargetType="{x:Type views:IoButton}">
- <Setter Property="Width" Value="16"/>
- <Setter Property="Height" Value="16"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type views:IoButton}">
- <Grid>
- <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" RecognizesAccessKey="True" Content=""/>
- <Ellipse Stroke="Gray" StrokeThickness="2"
- Fill="DarkGray" />
- <Ellipse x:Name="Highlight" Stroke="Gray" StrokeThickness="2"
- Fill="Lime" />
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsChecked" Value="True">
- <Setter Property="Visibility" TargetName="Highlight" Value="Visible"/>
- </Trigger>
- <Trigger Property="IsChecked" Value="False">
- <Setter Property="Visibility" TargetName="Highlight" Value="Collapsed"/>
- </Trigger>
- <Trigger Property="IsMouseOver" Value="False">
- <Setter Property="Opacity" TargetName="Highlight" Value="1"/>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </UserControl.Resources>
- <Grid ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Visible" >
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="480"/>
- <ColumnDefinition Width="480"/>
- <ColumnDefinition Width="500"/>
- <ColumnDefinition Width="480"/>
- </Grid.ColumnDefinitions>
- <TabControl Grid.Column="0" Margin="20,0,0,0" >
- <TabItem Header="DI">
- <ListView ItemsSource="{Binding Path=DIs}"
- Grid.Column="2"
- AlternationCount="2"
- VerticalAlignment="Top"
- FontSize="12"
- Name="DIListView">
- <ListView.View>
- <GridView>
- <GridViewColumn Width="30"
- Header="Index"
- DisplayMemberBinding="{Binding Path=Index}" />
- <GridViewColumn Width="250"
- Header="Name"
- DisplayMemberBinding="{Binding Path=Name}" />
- <GridViewColumn Width="70"
- Header="Address"
- DisplayMemberBinding="{Binding Path=Address}" />
- <GridViewColumn Width="50" Header="Status">
- <GridViewColumn.CellTemplate>
- <DataTemplate>
- <Grid Width="35">
- <views:IoButton HorizontalAlignment="Center"
- ON="{Binding Path=BoolValue}" Style="{StaticResource Lamp-Button}" IsChecked="{Binding BoolValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
- >
- </views:IoButton>
- </Grid>
- </DataTemplate>
- </GridViewColumn.CellTemplate>
- </GridViewColumn>
- <GridViewColumn Width="50" Header="Hold">
- <GridViewColumn.CellTemplate>
- <DataTemplate>
- <CheckBox x:Name="ckHold" IsChecked="{Binding Path=HoldValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="25" Height="25" ></CheckBox>
- </DataTemplate>
- </GridViewColumn.CellTemplate>
- </GridViewColumn>
- </GridView>
- </ListView.View>
- </ListView>
- </TabItem>
- </TabControl>
- <TabControl Grid.Column="1" Margin="20,0,0,0">
- <TabItem Header="DO">
- <ListView ItemsSource="{Binding Path=DOs}"
- Grid.Column="3"
- AlternationCount="2"
- VerticalAlignment="Top"
- FontSize="12"
- Name="DOListView">
- <ListView.View>
- <GridView>
- <GridViewColumn Width="30"
- Header="Index"
- DisplayMemberBinding="{Binding Path=Index}" />
- <GridViewColumn Width="250"
- Header="Name"
- DisplayMemberBinding="{Binding Path=Name}" />
- <GridViewColumn Width="70"
- Header="Address"
- DisplayMemberBinding="{Binding Path=Address}" />
- <GridViewColumn Width="50" Header="Status">
- <GridViewColumn.CellTemplate>
- <DataTemplate >
- <Grid Width="35">
- <views:IoButton HorizontalAlignment="Center"
- ON="{Binding Path=BoolValue}" Style="{StaticResource Lamp-Button}" IsChecked="{Binding BoolValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" >
- </views:IoButton>
- </Grid>
- </DataTemplate>
- </GridViewColumn.CellTemplate>
- </GridViewColumn>
- <GridViewColumn Width="50" Header="Hold">
- <GridViewColumn.CellTemplate>
- <DataTemplate>
- <CheckBox x:Name="ckHold" IsChecked="{Binding Path=HoldValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="25" Height="25" ></CheckBox>
- </DataTemplate>
- </GridViewColumn.CellTemplate>
- </GridViewColumn>
- </GridView>
- </ListView.View>
- </ListView>
- </TabItem>
- </TabControl>
- <TabControl Grid.Column="2" Margin="15,0,0,0">
- <TabItem Header="AI">
- <ListView ItemsSource="{Binding Path=AIs}"
- AlternationCount="2"
- Name="AIListView"
- FontSize="12"
-
- VerticalAlignment="Top" >
- <ListView.View>
- <GridView>
- <GridViewColumn Width="30"
- Header="Index"
- DisplayMemberBinding="{Binding Path=Index}" />
- <GridViewColumn Width="210"
- Header="Name"
- DisplayMemberBinding="{Binding Path=Name}" />
- <GridViewColumn Width="70"
- Header="Address"
- DisplayMemberBinding="{Binding Path=Address}" />
- <GridViewColumn Width="80" Header="Value">
- <GridViewColumn.CellTemplate>
- <DataTemplate >
- <TextBox Text="{Binding Path=FloatValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Padding="0" Margin="0" Width="60" Height="20"/>
- </DataTemplate>
- </GridViewColumn.CellTemplate>
- </GridViewColumn>
- <GridViewColumn Width="50" Header="Hold">
- <GridViewColumn.CellTemplate>
- <DataTemplate>
- <CheckBox x:Name="ckHold" IsChecked="{Binding Path=HoldValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="25" Height="25" ></CheckBox>
- </DataTemplate>
- </GridViewColumn.CellTemplate>
- </GridViewColumn>
- </GridView>
- </ListView.View>
- </ListView>
- </TabItem>
- </TabControl>
- <TabControl Grid.Column="3" Margin="20,0,0,0">
- <TabItem Header="AO">
- <ListView ItemsSource="{Binding Path=AOs}"
- Grid.Column="1"
- AlternationCount="2"
- FontSize="12"
- VerticalAlignment="Top"
- Name="AOListView">
- <ListView.View>
- <GridView>
- <GridViewColumn Width="30"
- Header="Index"
- DisplayMemberBinding="{Binding Path=Index}" />
- <GridViewColumn Width="210"
- Header="Name"
- DisplayMemberBinding="{Binding Path=Name}" />
- <GridViewColumn Width="70"
- Header="Address"
- DisplayMemberBinding="{Binding Path=Address}" />
- <GridViewColumn Width="80" Header="Value">
- <GridViewColumn.CellTemplate>
- <DataTemplate >
- <TextBox Text="{Binding Path=FloatValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Padding="0" Margin="0" Height="20" Width="60"/>
- </DataTemplate>
- </GridViewColumn.CellTemplate>
- </GridViewColumn>
- <GridViewColumn Width="50" Header="Hold">
- <GridViewColumn.CellTemplate>
- <DataTemplate>
- <CheckBox x:Name="ckHold" IsChecked="{Binding Path=HoldValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="25" Height="25" ></CheckBox>
- </DataTemplate>
- </GridViewColumn.CellTemplate>
- </GridViewColumn>
- </GridView>
- </ListView.View>
- </ListView>
- </TabItem>
- </TabControl>
- </Grid>
- </UserControl>
|