<UserControl x:Class="MainShell.DeviceMaintance.View.CameraAccuracyCalibrationView"
             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:MainShell.DeviceMaintance.View"
             xmlns:mwControls="http://www.maxwell-gp.com/"
             xmlns:customControl="clr-namespace:MainShell.Resources.CustomControl"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="700">
    <UserControl.Resources>
        <Style TargetType="GroupBox" BasedOn="{StaticResource GroupStepControl}"/>
        <Style TargetType="Label" BasedOn="{StaticResource {x:Type Label}}">
            <Setter Property="HorizontalContentAlignment" Value="Right"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="HorizontalAlignment" Value="Right"/>
            <Setter Property="Margin" Value="5"/>
            <Setter Property="Height" Value="35"/>
        </Style>
        <Style TargetType="Button" BasedOn="{StaticResource {x:Type Button}}" >
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="HorizontalAlignment" Value="Center"/>
            <Setter Property="Margin" Value="3"/>
            <Setter Property="Height" Value="35"/>
            <Setter Property="Width" Value="90"/>
        </Style>
    </UserControl.Resources>
    <Grid mwControls:ParameterAttach.DelayAcceptValue ="{Binding ParameterHelper}">
        <StackPanel>
            <GroupBox IsEnabled="{Binding UiEnable}" Header="【第一步】针尖高度设置">
                <customControl:AxisMoveControl LableContent1="Z1(mm)：" 
                           Value1="{Binding QuickNeedlePrintParameter.Z1InkHeight}"
                           IsAllShow="False"
                           ReadCommand="{mwControls:Action TeachZ1Pos}"
                           IsReadOnly="False"
                           MoveCommand="{mwControls:Action MoveToZ1Pos}"/>      
                
            </GroupBox>
            <GroupBox IsEnabled="{Binding UiEnable}"  Header="【第二步】WS避让位">
                <GroupBox.Content>
                    <customControl:AxisMoveControl LableContent1="X2(mm)："
                               Value1="{Binding QuickNeedlePrintParameter.AvoidancePoint.PointX}"
                               LableContent2="Y2(mm)："
                               Value2="{Binding QuickNeedlePrintParameter.AvoidancePoint.PointY}"      
                               ReadCommand="{mwControls:Action TeachWSPos}"
                               MoveCommand="{mwControls:Action MoveToWsPos}"
                               IsReadOnly="True"/>
                    <!--<StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
                        <Label VerticalAlignment="Center" Content="X2:"/>
                        <mwControls:NumberBox Value="{Binding QuickNeedlePrintParameter.AvoidancePoint.PointX}" IsReadOnly="True" Width="80" Margin="4,0" />
                        <Label VerticalAlignment="Center" Content="Y2:"/>
                        <mwControls:NumberBox Value="{Binding QuickNeedlePrintParameter.AvoidancePoint.PointY}" IsReadOnly="True" Width="80" Margin="4,0" />
                        <Button Margin="2,0" Click="{mwControls:Action TeachWSPos}" Content="示教"/>
                        <Button Margin="2,0" Click="{mwControls:Action MoveToWsPos}" Content="移动"/>
                    </StackPanel>-->
                </GroupBox.Content>
            </GroupBox>
            <GroupBox IsEnabled="{Binding UiEnable}" Margin="2" Header="【第三步】墨水位置">
                <GroupBox.Content>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <customControl:AxisMoveControl LableContent1="X2(mm)："
                                Value1="{Binding QuickNeedlePrintParameter.InkPos.PointX}"
                                LableContent2="Y2(mm)："
                                Value2="{Binding QuickNeedlePrintParameter.InkPos.PointY}"      
                                ReadCommand="{mwControls:Action TeachInkPos}"
                                MoveCommand="{mwControls:Action MoveToInkPos}"
                                IsReadOnly="True"/>     
                       
                        <Button Margin="2,0" HorizontalAlignment="Right" Click="{mwControls:Action InkSmearing}" Content="涂墨"/>
                    </Grid>
                </GroupBox.Content>
            </GroupBox>
            <GroupBox Header="【第四步】快打针印参数设置">
                <StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <Label VerticalAlignment="Center" HorizontalAlignment="Left" Content="打件颗数："/>
                        <mwControls:IntNumberBox Value="{Binding BondingNumber}" IsReadOnly="True" Width="75" Margin="4,0" />
                        <Button IsEnabled="{Binding UiEnable}" Margin="2,0" Click="{mwControls:Action PositiveBonding}" Content="快打正向"/>
                        <Button IsEnabled="{Binding UiEnable}" Margin="2,0" Click="{mwControls:Action NegativeBonding}" Content="快打反向"/>
                        <Button IsEnabled="{Binding UiEnable}" Margin="2,0" Click="{mwControls:Action SlowBonding}" Content="补打"/>
                        <Button Margin="2,0" Content="停止打件" Click="{mwControls:Action StopBonding}"/>
                    </StackPanel>
                    <Label Content="正向针印查看：" HorizontalAlignment="Left"/>
                    <StackPanel IsEnabled="{Binding UiEnable}" HorizontalAlignment="Left" Orientation="Horizontal">
                        <Button Margin="2,0" IsEnabled="{Binding CanLastPositiveIndex}" Click="{mwControls:Action LastPositiveIndex}" Content="上一个"/>
                        <Button Margin="2,0" IsEnabled="{Binding CanNextPositiveIndex}" Click="{mwControls:Action NextPositiveIndex}" Content="下一个"/>
                    </StackPanel>
                    <Label Content="反向针印查看：" HorizontalAlignment="Left"/>
                    <StackPanel IsEnabled="{Binding UiEnable}" HorizontalAlignment="Left" Orientation="Horizontal">
                        <Button Margin="2,0" IsEnabled="{Binding CanLastNegativeIndex}" Click="{mwControls:Action LastNegativeIndex}" Content="上一个"/>
                        <Button Margin="2,0" IsEnabled="{Binding CanNextNegativeIndex}" Click="{mwControls:Action NextNegativeIndex}" Content="下一个"/>
                    </StackPanel>
                    <Label Content="补打针印查看：" HorizontalAlignment="Left"/>
                    <StackPanel IsEnabled="{Binding UiEnable}" HorizontalAlignment="Left" Orientation="Horizontal">
                        <Button Margin="2,0" IsEnabled="{Binding CanLastSlowIndex}" Click="{mwControls:Action LastSlowIndex}" Content="上一个"/>
                        <Button Margin="2,0" IsEnabled="{Binding CanNextSlowIndex}" Click="{mwControls:Action NextSlowIndex}" Content="下一个"/>
                    </StackPanel>
                    <Button IsEnabled="{Binding UiEnable}" HorizontalAlignment="Right" Click="{mwControls:Action SaveParameter}" Margin="10,2" Content="保存"/>
                </StackPanel>

            </GroupBox>
        </StackPanel>

    </Grid>
</UserControl>
