123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- <UserControl x:Class="S7NetModule.Views.S7ReadlView"
- 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:local="clr-namespace:S7NetModule.Views"
- mc:Ignorable="d"
- xmlns:prism="http://prismlibrary.com/"
- prism:ViewModelLocator.AutoWireViewModel="True"
- d:DesignHeight="450"
- d:DesignWidth="300">
- <UserControl.Resources>
- <Style x:Key="TextBlackStyle"
- TargetType="TextBlock">
- <Setter Property="FontSize"
- Value="15" />
- <Setter Property="Foreground"
- Value="White" />
- <Setter Property="Margin"
- Value="0,0,15,0" />
- <Setter Property="TextAlignment"
- Value="Right" />
- <Setter Property="Width"
- Value="80" />
- </Style>
- </UserControl.Resources>
- <Border>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="50" />
- <RowDefinition Height="50" />
- <RowDefinition Height="50" />
- <RowDefinition Height="50" />
- <RowDefinition Height="50" />
- <RowDefinition Height="50" />
- <RowDefinition Height="50" />
- <RowDefinition />
- </Grid.RowDefinitions>
- <!-- DB号 -->
- <StackPanel Orientation="Horizontal"
- VerticalAlignment="Center"
- Grid.Row="0">
- <TextBlock Text="DB号:"
- Style="{ StaticResource TextBlackStyle}" />
- <TextBox Width="150"
- Name="ip"
- Text="{Binding Read_Model.Db}" />
- </StackPanel>
- <!-- 数据类型 -->
- <StackPanel Orientation="Horizontal"
- VerticalAlignment="Center"
- Grid.Row="1">
- <TextBlock Text="数据类型:"
- Style="{ StaticResource TextBlackStyle}" />
- <ComboBox Width="{Binding ElementName=ip,Path=ActualWidth}"
- ItemsSource="{Binding DataTypes}"
- Text="{Binding Read_Model.VarType}" />
- </StackPanel>
- <!-- 起始地址 -->
- <StackPanel Orientation="Horizontal"
- VerticalAlignment="Center"
- Grid.Row="2">
- <TextBlock Text="起始地址:"
- Style="{ StaticResource TextBlackStyle}" />
- <TextBox Width="{Binding ElementName=ip,Path=ActualWidth}"
- Text="{Binding Read_Model.StartByteAdr}" />
- </StackPanel>
- <!-- 数据个数 -->
- <StackPanel Orientation="Horizontal"
- VerticalAlignment="Center"
- Grid.Row="3">
- <TextBlock Text="数据个数:"
- Style="{ StaticResource TextBlackStyle}" />
- <TextBox Width="{Binding ElementName=ip,Path=ActualWidth}"
- Text="{Binding Read_Model.VarCount}" />
- </StackPanel>
- <!-- bit位 -->
- <StackPanel Orientation="Horizontal"
- VerticalAlignment="Center"
- Grid.Row="4">
- <TextBlock Text="bit位:"
- Style="{ StaticResource TextBlackStyle}" />
- <TextBox Width="{Binding ElementName=ip,Path=ActualWidth}"
- Text="{Binding Read_Model.BitAdr}" />
- </StackPanel>
- <!-- 数据类型 -->
- <StackPanel Orientation="Horizontal"
- VerticalAlignment="Center"
- Grid.Row="5">
- <TextBlock Text="结果比对:"
- Style="{ StaticResource TextBlackStyle}" />
- <ComboBox Width="{Binding ElementName=ip,Path=ActualWidth}"
- ItemsSource="{Binding Res_Pass}"
- SelectedItem ="{Binding Read_Model.RefPass}" />
- </StackPanel>
- <StackPanel Orientation="Horizontal"
- Width="{Binding ElementName=ip,Path=ActualWidth}"
- VerticalAlignment="Center"
- HorizontalAlignment="Right"
- Grid.Row="6">
- <Button Content="读取"
- Width="100"
- Height="50"
- Command="{Binding S7Readcommand}"
- Style="{StaticResource HomeControlButtonStyle}" />
- </StackPanel>
- <StackPanel Orientation="Horizontal"
- VerticalAlignment="Center"
- HorizontalAlignment="Center"
- Grid.Row="7">
- <RichTextBox Width="{Binding ElementName=ip,Path=ActualWidth}">
- <FlowDocument>
- <Paragraph>
- <Run Text="{Binding OutMsg}" />
- </Paragraph>
- </FlowDocument>
- </RichTextBox>
- </StackPanel>
- </Grid>
- </Border>
- </UserControl>
|