|
@@ -0,0 +1,241 @@
|
|
|
+<UserControl x:Class="Venus_Simulator.Views.SimulatorIo4View"
|
|
|
+ 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:views="clr-namespace:Venus_Simulator.Views"
|
|
|
+ xmlns:toolkit="clr-namespace:Xceed.Wpf.Toolkit;assembly=Xceed.Wpf.Toolkit"
|
|
|
+ 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="250"
|
|
|
+ Header="Name"
|
|
|
+ DisplayMemberBinding="{Binding Path=Name}" />
|
|
|
+
|
|
|
+ <GridViewColumn Width="70"
|
|
|
+ Header="Address"
|
|
|
+ DisplayMemberBinding="{Binding Path=Address}" />
|
|
|
+ <GridViewColumn Width="80" Header="Value">
|
|
|
+ <GridViewColumn.CellTemplate>
|
|
|
+ <DataTemplate >
|
|
|
+ <toolkit:IntegerUpDown Text="{Binding Path=ShortValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" 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>
|
|
|
+ <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="50"
|
|
|
+ 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="80" Header="Value">
|
|
|
+ <GridViewColumn.CellTemplate>
|
|
|
+ <DataTemplate >
|
|
|
+ <toolkit:IntegerUpDown Text="{Binding Path=ShortValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" 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>
|