<Window x:Class="FLYAD7_Simulation_Wpf.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:FLYAD7_Simulation_Wpf"
        Title="MainWindow" Height="313" Width="539" Closed="Window_Closed">
    <Grid>
        <Grid.Resources>
            <ResourceDictionary>
                <local:IO2BinConverter x:Key="io2bconv" />
                <local:SimModeConverter x:Key="simmodeconv" />
            </ResourceDictionary>
        </Grid.Resources>
        <GroupBox Name="groupbox_ip" Header="连接" HorizontalAlignment="Left" Margin="12,12,0,0" VerticalAlignment="Top" Width="260">
            <Grid>
                <TextBlock Margin="5">
                    <TextBlock.Inlines>
                        <Run Text="LocalEP:"/>
                        <Run Text="{Binding LocalEP,Mode=OneWay}"/>
                    </TextBlock.Inlines>
                </TextBlock>
            </Grid>
        </GroupBox>
        <GroupBox Header="当前数据" Height="183" HorizontalAlignment="Left" Margin="12,71,0,0" Name="groupBox1" VerticalAlignment="Top" Width="254">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="auto" />
                    <RowDefinition Height="auto" />
                    <RowDefinition Height="auto" />
                    <RowDefinition Height="auto" />
                    <RowDefinition Height="auto" />
                    <RowDefinition Height="auto" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="67" />
                    <ColumnDefinition Width="181*" />
                </Grid.ColumnDefinitions>
                <Grid.Resources>
                    <ResourceDictionary>
                        <Style TargetType="TextBlock">
                            <Setter Property="Margin" Value="2"/>
                            <Setter Property="Height" Value="23"/>
                            <Setter Property="HorizontalAlignment" Value="Left"/>
                        </Style>
                        <Style TargetType="TextBox">
                            <Setter Property="Margin" Value="2"/>
                            <Setter Property="Height" Value="23"/>
                            <Setter Property="Width" Value="120"/>
                            <Setter Property="HorizontalAlignment" Value="Left"/>
                        </Style>
                    </ResourceDictionary>
                </Grid.Resources>


                <TextBox Grid.Row="0" Grid.Column="1"   Text="{Binding AD}" IsEnabled="False"/>
                <TextBlock Grid.Row="0"  Text="AD" />
                <TextBlock Grid.Row="1"  Text="POS" />
                <TextBox Grid.Row="1"  Grid.Column="1"  Text="{Binding Position}" IsEnabled="False" />

                <TextBox  Grid.Row="2" Grid.Column="1" Text="{Binding IStatus,Converter={StaticResource ResourceKey=io2bconv}}"/>
                <TextBlock Grid.Row="2" Text="IN"  />
                <TextBox Grid.Row="3" Grid.Column="1"  Text="{Binding OStatus,Converter={StaticResource ResourceKey=io2bconv}}"/>
                <TextBlock Grid.Row="3" Text="OUT" />
                <TextBox Grid.Row="4" Grid.Column="1"  Text="{Binding Surplus}"/>
                <TextBlock Grid.Row="4" Text="Hrs" />
                <TextBlock Grid.Row="5"  Text="POS2" />
                <TextBox Grid.Row="5"  Grid.Column="1"  Text="{Binding Position2}" IsEnabled="False" />

            </Grid>
        </GroupBox>
        <GroupBox Header="周期调试" Height="65" HorizontalAlignment="Left" Margin="278,12,0,0" Name="groupBox3" VerticalAlignment="Top" Width="227">
            <Grid>
                <TextBox Height="23" HorizontalAlignment="Left" Margin="103,8,0,0" Name="textBox5" Text="{Binding TimeSpan1ms}" IsEnabled="False" VerticalAlignment="Top" Width="105" />
                <TextBlock Height="23" HorizontalAlignment="Left" Margin="7,11,0,0" Name="textBlock5" Text="timegrid周期" VerticalAlignment="Top" />
            </Grid>
        </GroupBox>
        <Button Content="更多" Height="23" HorizontalAlignment="Left" Margin="420,157,0,0" Name="button1" VerticalAlignment="Top" Width="75" Click="button1_Click" />
        <ComboBox Height="23" HorizontalAlignment="Left" Margin="282,157,0,0" Name="comboBox1" VerticalAlignment="Top" Width="120" >

            <ComboBoxItem IsSelected="{Binding SimMode, Converter={StaticResource simmodeconv}, ConverterParameter=Blowing}">
                    <TextBlock Text="吹膜"/>
                </ComboBoxItem>
            <ComboBoxItem IsSelected="{Binding SimMode, Converter={StaticResource simmodeconv}, ConverterParameter=Coating}">
                    <TextBlock Text="涂布"/>
                </ComboBoxItem>
            <ComboBoxItem IsSelected="{Binding SimMode, Converter={StaticResource simmodeconv}, ConverterParameter=HeaderAndTailer}">
                <TextBlock Text="头尾部检测"/>
            </ComboBoxItem>
            <ComboBoxItem IsSelected="{Binding SimMode, Converter={StaticResource simmodeconv}, ConverterParameter=Casting}">
                <TextBlock Text="流延"/>
            </ComboBoxItem>
        </ComboBox>

        <Button Content="应用" Height="23" HorizontalAlignment="Left" Margin="282,195,0,0" Name="button2" VerticalAlignment="Top" Width="75" Click="button2_Click" />
        <Button Content="同步指令列表" Height="23" HorizontalAlignment="Left" Margin="282,232,0,0" Name="button3" VerticalAlignment="Top" Width="93" Click="button3_Click" />
        <GroupBox Header="周期调试2" Height="65" HorizontalAlignment="Left" Margin="281,82,0,0" Name="groupBox4" VerticalAlignment="Top" Width="227">
            <Grid>
                <TextBox Height="23" HorizontalAlignment="Left" IsEnabled="False" Margin="103,8,0,0" Text="{Binding OneSecCnt}" VerticalAlignment="Top" Width="105" />
                <TextBlock Height="23" HorizontalAlignment="Left" Margin="7,11,0,0" Text="1秒运行次数" VerticalAlignment="Top" />
            </Grid>
        </GroupBox>
    </Grid>
</Window>
