<UserControl x:Class="MXJM.SystemSetting.View.CameraFusionCali02AView"
             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:mwControls="http://www.maxwell-gp.com/"
             Loaded="{mwControls:Action viewLoad}" 
             Unloaded="{mwControls:Action viewUnLoad}"
              xmlns:view="clr-namespace:MXJM.Common.View"
             xmlns:local="clr-namespace:MXJM.SystemSetting.View"
              xmlns:testdemo="clr-namespace:MwFramework.Controls.SystemCalib;assembly=MwFramework.Controls.SystemCalib"
             mwControls:ParameterAttach.DelayAcceptValue ="{Binding ParameterHelper}"
             xmlns:convert="clr-namespace:MXJM.Common.Converter"
             mc:Ignorable="d" 
             d:DesignHeight="850" d:DesignWidth="1200">
    <UserControl.Resources>
        <convert:CameraTypeToBoolConverter x:Key="CameraTypeToBoolConverter"/>
        <Style x:Key="CommonLableStyle" TargetType="Label" BasedOn="{StaticResource {x:Type Label}}">
            <Setter Property="HorizontalContentAlignment" Value="Right"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Margin" Value="3"/>
            <Setter Property="Height" Value="35"/>
            <Setter Property="Width" Value="120"/>
        </Style>
        <Style TargetType="ComboBox" BasedOn="{StaticResource {x:Type ComboBox}}">
            <Setter Property="HorizontalContentAlignment" Value="Left"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Margin" Value="3"/>
            <Setter Property="Height" Value="35"/>
            <Setter Property="Width" Value="120"/>
        </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="110"/>
        </Style>
    </UserControl.Resources>
    <Grid >
        <Grid.ColumnDefinitions>
            <ColumnDefinition  Width="Auto"/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <view:CameraAxisView DataContext="{Binding }" IsEnabled="{Binding Motion.IsFinish}"/>
        <Grid Grid.Column="1">
            <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition Height="60"/>
            </Grid.RowDefinitions>
            <TabControl   mwControls:TabControlAttach.FontSize="12" mwControls:TabControlAttach.HeaderHeight="30"  mwControls:TabControlAttach.HeaderWidth="120"  Margin="5,0,0,0" >
                <TabItem Header="相机晶圆伺服融合">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="auto"/>
                            <RowDefinition Height="auto"/>
                            <RowDefinition Height="auto"/>
                            <RowDefinition Height="auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <GroupBox Style="{StaticResource GroupBoxSecondary}"  Margin="3,3,3,3" IsEnabled="{Binding Motion.IsFinish}" Grid.ColumnSpan="2">
                            <GroupBox.Header>
                                <TextBlock  Text="WS运动系标定位置" VerticalAlignment="Center" FontWeight="Bold" />
                            </GroupBox.Header>
                            <UniformGrid Grid.Row="0" Rows="2">
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="140"/>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                        <!--<ColumnDefinition/>-->
                                    </Grid.ColumnDefinitions>
                                    <Label Content="WS平台标定X1(mm)：" Width="200" Grid.Column="0" Style="{StaticResource CommonLableStyle}" HorizontalAlignment="Right" />
                                    <mwControls:NumberBox Tag="WS平台标定X1" Value="{Binding CameraWaferFusionCalibrationItem.WSPlatCalibXPos}" mwControls:NumericKeypadAttach.IsEnabled="True" Minimum="-1000" Maximum="1000"  Grid.Column="1"   HorizontalAlignment="Left" Margin="5" Width="75" Height="35" />
                                    <!--<mwControls:NumberBox  Value="{Binding CameraWaferFusionCalibrationItem.WSApproachXPos}" mwControls:NumericKeypadAttach.IsEnabled="True" Minimum="-1000" Maximum="1000"  Grid.Column="2"   HorizontalAlignment="Left" Margin="5" Width="80" Height="35" />
                                    <mwControls:NumberBox  Value="{Binding CameraWaferFusionCalibrationItem.WSApproachYPos}" mwControls:NumericKeypadAttach.IsEnabled="True" Minimum="-1000" Maximum="1000"  Grid.Column="3"   HorizontalAlignment="Left" Margin="5" Width="80" Height="35" />-->
                                    <Button Grid.Column="3" Tag="WS平台标定X1-移到此位置" Content="移到此位置" Click="{mwControls:Action btnMoveWSCalibPosPosition}" HorizontalAlignment="Left" />
                                </Grid>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="1.6*"/>
                                        <ColumnDefinition/>
                                        <ColumnDefinition />
                                        <ColumnDefinition/>
                                        <ColumnDefinition Width="1.5*"/>
                                    </Grid.ColumnDefinitions>
                                    <Label Content="X2：" Grid.Column="0" Style="{StaticResource CommonLableStyle}" HorizontalAlignment="Right" />
                                    <mwControls:NumberBox  Value="{Binding CameraWaferFusionCalibrationItem.WSApproachXPos}" IsReadOnly="True" Background="LightGray" mwControls:NumericKeypadAttach.IsEnabled="True" Minimum="-1000" Maximum="1000"  Grid.Column="1"   HorizontalAlignment="Left" Margin="5" Width="75" Height="35" />
                                    <Label Content="Y2：" Grid.Column="2" Style="{StaticResource CommonLableStyle}" HorizontalAlignment="Right" />
                                    <mwControls:NumberBox  Value="{Binding CameraWaferFusionCalibrationItem.WSApproachYPos}" IsReadOnly="True" Background="LightGray" mwControls:NumericKeypadAttach.IsEnabled="True" Minimum="-1000" Maximum="1000"  Grid.Column="3"   HorizontalAlignment="Left" Margin="5" Width="75" Height="35" />
                                    <Button Grid.Column="5" Tag="WS平台标定X1-中心对齐" Content="中心对齐" Click="{mwControls:Action btnGotoCalibPos}"  HorizontalAlignment="Left" />
                                </Grid>
                            </UniformGrid>
                        </GroupBox>
                        <GroupBox Grid.Row="1" Style="{StaticResource GroupBoxSecondary}"  Margin="3,3,3,3" IsEnabled="{Binding Motion.IsFinish}" Grid.ColumnSpan="2">
                            <GroupBox.Header>
                                <TextBlock  Text="相机起始位置" VerticalAlignment="Center" FontWeight="Bold" />
                            </GroupBox.Header>
                            <UniformGrid Grid.Row="0" Rows="2">
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                    </Grid.ColumnDefinitions>
                                    <Label Content="CameraX(mm)：" Grid.Column="0" Style="{StaticResource CommonLableStyle}" HorizontalAlignment="Center" />
                                    <mwControls:NumberBox Tag="CameraX"  Value="{Binding CameraWaferFusionCalibrationItem.CameraX}" mwControls:NumericKeypadAttach.IsEnabled="True" Minimum="-1000" Maximum="1000"  Grid.Column="1"   HorizontalAlignment="Center" Margin="5" Width="120" Height="35" />
                                    <!--<Label Content="CameraY(mm)：" Grid.Column="2" Style="{StaticResource CommonLableStyle}" HorizontalAlignment="Right" />
                                    <mwControls:NumberBox  Value="{Binding CameraWaferFusionCalibrationItem.CameraY}" mwControls:NumericKeypadAttach.IsEnabled="True" Minimum="-1000" Maximum="1000"  Grid.Column="3"   HorizontalAlignment="Left" Margin="5" Width="120" Height="35" />-->
                                    <Button Grid.Column="3" Tag="计算相机起始位置" Content="计算位置" Click="{mwControls:Action BtnCalculateCameraPosition}" HorizontalAlignment="Left" />
                                </Grid>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                    </Grid.ColumnDefinitions>
                                    <Button Grid.Column="1" Tag="相机起始位置-读取当前位置" Content="读取当前位置" Click="{mwControls:Action btnSetCameraPosition}" HorizontalAlignment="Left" />
                                    <Button Grid.Column="3" Tag="相机起始位置-移到此位置" Content="移到此位置" Click="{mwControls:Action btnMoveCameraPosition}" HorizontalAlignment="Left" />
                                </Grid>
                            </UniformGrid>
                        </GroupBox>
                        <GroupBox Grid.Row="2" Style="{StaticResource GroupBoxSecondary}"  Margin="3,3,3,3" IsEnabled="{Binding Motion.IsFinish}" Grid.ColumnSpan="2">
                            <GroupBox.Header>
                                <TextBlock  Text="WS起始位置" VerticalAlignment="Center" FontWeight="Bold" />
                            </GroupBox.Header>
                            <UniformGrid Rows="2">
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                    </Grid.ColumnDefinitions>
                                    <Label Content="StartX(mm)：" Grid.Column="0" Style="{StaticResource CommonLableStyle}" HorizontalAlignment="Right" />
                                    <mwControls:NumberBox  Value="{Binding CameraWaferFusionCalibrationItem.WaferStartX}" IsReadOnly="True" Background="LightGray" mwControls:NumericKeypadAttach.IsEnabled="True" Minimum="-1000" Maximum="1000"  Grid.Column="1"   HorizontalAlignment="Left" Margin="5" Width="120" Height="35" />
                                    <Label Content="StartY(mm)：" Grid.Column="2" Style="{StaticResource CommonLableStyle}" HorizontalAlignment="Right" />
                                    <mwControls:NumberBox  Value="{Binding CameraWaferFusionCalibrationItem.WaferStartY}" IsReadOnly="True" Background="LightGray" mwControls:NumericKeypadAttach.IsEnabled="True" Minimum="-1000" Maximum="1000"  Grid.Column="3"   HorizontalAlignment="Left" Margin="5" Width="120" Height="35" />
                                </Grid>

                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>
                                    <Button Grid.Column="0" Tag="WS起始位置-计算当前位置" Content="计算位置" Click="{mwControls:Action BtnCalculateWSPosition}" HorizontalAlignment="Left" Grid.ColumnSpan="2" Margin="3,0,0,0" />
                                    <Button Grid.Column="1" Tag="WS起始位置-读取当前位置" Content="读取当前位置" Click="{mwControls:Action btnSetWaferStartPosition}" HorizontalAlignment="Left" Grid.ColumnSpan="2" Margin="3,0,0,0" />
                                    <Button Grid.Column="2" Tag="WS起始位置-移到此位置" Content="移到此位置" Click="{mwControls:Action btnMoveWaferStartPosition}" HorizontalAlignment="Left" Margin="2,0,0,0" />
                                    <Button Grid.Column="3" Tag="WS起始位置-对齐中心" Content="对齐中心" Click="{mwControls:Action btnMoveToCenter}" HorizontalAlignment="Left" Margin="3,0,0,0" />
                                </Grid>
                            </UniformGrid>
                        </GroupBox>
                        <GroupBox Grid.Row="4" Style="{StaticResource GroupBoxSecondary}"  Margin="3,3,3,3" Grid.ColumnSpan="2">
                            <GroupBox.Header>
                                <TextBlock  Text="标定参数" VerticalAlignment="Center" FontWeight="Bold" />
                            </GroupBox.Header>
                            <Grid >
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="auto"/>
                                    <RowDefinition Height="auto"/>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="auto"/>
                                </Grid.RowDefinitions>
                                <!--<DataGrid Grid.Row="0"   ItemsSource="{Binding CameraWaferFusionCalibrationItem.AxisAndPixelPointItemList}" SelectedItem="CameraWaferFusionCalibrationItem.SelectedAxisAndPixelPointItem" Margin="3" AutoGenerateColumns="false"  SelectionMode="Single"
                              CanUserSortColumns="False">
                                    <DataGrid.Columns>
                                        <DataGridTextColumn Header="No" Binding="{Binding Id}" Width="1*" IsReadOnly="true"/>
                                        <DataGridTextColumn Header="AxisX1" Binding="{Binding AxisX1}" Width="2*" IsReadOnly="true"/>
                                        <DataGridTextColumn Header="AxisY1" Binding="{Binding AxisY1}" Width="2*" IsReadOnly="true"/>
                                        <DataGridTextColumn Header="AxisX2" Binding="{Binding AxisX2}" Width="2*" IsReadOnly="true"/>
                                        <DataGridTextColumn Header="AxisY2" Binding="{Binding AxisY2}" Width="2*" IsReadOnly="true"/>
                                        <DataGridTextColumn Header="RecognizeX" Binding="{Binding PixelX}" Width="2*" IsReadOnly="true"/>
                                        <DataGridTextColumn Header="RecognizeY" Binding="{Binding PixelY}" Width="2*" IsReadOnly="true"/>
                                    </DataGrid.Columns>
                                </DataGrid>-->
                                <Grid Grid.Row="1" IsEnabled="{Binding Motion.IsFinish}" >
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                    </Grid.ColumnDefinitions>
                                    <Label Content="WaferStepXY(mm)：" Grid.Column="0" Style="{StaticResource CommonLableStyle}" HorizontalAlignment="Right" />
                                    <mwControls:NumberBox  Value="{Binding CameraWaferFusionCalibrationItem.WaferStepXY}"  Tag="WaferStepXY(mm)"  mwControls:NumericKeypadAttach.IsEnabled="True" Minimum="0" Maximum="1000"  Grid.Column="1"   HorizontalAlignment="Left" Margin="5" Width="120" Height="35" />
                                    <Label Content="WaferCountXY：" Grid.Column="2" Style="{StaticResource CommonLableStyle}" HorizontalAlignment="Right" />
                                    <mwControls:IntNumberBox  Value="{Binding CameraWaferFusionCalibrationItem.WaferCountXY}" Tag="WaferCountXY" mwControls:NumericKeypadAttach.IsEnabled="True" Minimum="0" Maximum="1000"  Grid.Column="3"   HorizontalAlignment="Left" Margin="5" Width="120" Height="35" />
                                </Grid>
                                <Grid IsEnabled="{Binding Motion.IsFinish}" >
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                    </Grid.ColumnDefinitions>
                                    <Label Content="StepX1(mm)：" Grid.Column="0" Style="{StaticResource CommonLableStyle}" HorizontalAlignment="Right" />
                                    <mwControls:NumberBox Tag="StepX(mm)" Value="{Binding CameraWaferFusionCalibrationItem.StepX}" mwControls:NumericKeypadAttach.IsEnabled="True" Minimum="-1000" Maximum="1000"  Grid.Column="1"   HorizontalAlignment="Left" Margin="5" Width="120" Height="35" />
                                    <!--<Label Content="StepY(mm)：" Grid.Column="2" Style="{StaticResource CommonLableStyle}" HorizontalAlignment="Right" />
                                    <mwControls:NumberBox  Value="{Binding CameraWaferFusionCalibrationItem.StepY}" mwControls:NumericKeypadAttach.IsEnabled="True" Minimum="-1000" Maximum="1000"  Grid.Column="3"   HorizontalAlignment="Left" Margin="5" Width="120" Height="35" />-->
                                    <Label Content="CountX1：" Grid.Column="2" Style="{StaticResource CommonLableStyle}" HorizontalAlignment="Right" />
                                    <mwControls:IntNumberBox Tag="CountX" Value="{Binding CameraWaferFusionCalibrationItem.CountX}" mwControls:NumericKeypadAttach.IsEnabled="True" Minimum="1" Maximum="10000"  Grid.Column="3"   HorizontalAlignment="Left" Margin="5" Width="120" Height="35" />
                                </Grid>
                                <Grid Grid.Row="3">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                    </Grid.ColumnDefinitions>
                                    <!--<Button Grid.Column="0"  Content="移到此位置" Click="{mwControls:Action btnMovePosition}" HorizontalAlignment="Left" />
                                    <Button Grid.Column="1"  Content="识别" Click="{mwControls:Action btnRecognize}" HorizontalAlignment="Left" />-->

                                    <!--<Button Content="计算" Tag="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Content}" Click="{mwControls:Action btnFix}"  Grid.Column="0" />-->
                                    <!--<Button Content="验证" Click="{mwControls:Action btnVarify}"  Grid.Column="1" />-->
                                    <CheckBox x:Name="circleCk" Content="圆形标定" IsChecked="{Binding CameraWaferFusionCalibrationItem.UseCircleCalib}" />
                                    <Button Content="开始" Tag="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Content}" Click="{mwControls:Action btnStart}"   Grid.Column="2"  IsEnabled="{Binding Motion.IsFinish}" />
                                    <Button Content="停止" Tag="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Content}" Click="{mwControls:Action btnStop}" Grid.Column="3" />
                                </Grid>
                            </Grid>
                        </GroupBox>
                        <GroupBox Grid.Row="3" Visibility="{Binding ElementName=circleCk, Path=IsChecked, Converter={StaticResource boolToVisibleConverter}}" Style="{StaticResource GroupBoxSecondary}" IsEnabled="{Binding Motion.IsFinish}" Margin="3" Header="圆参数示教">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <UniformGrid  Columns="4">
                                    <!--<Label Margin="2,2" VerticalAlignment="Center" HorizontalAlignment="Center" Content="圆心X:"/>
                                    <mwControls:NumberBox Value="{Binding CameraWaferFusionCalibrationItem.CenterX}" Margin="2,2" HorizontalAlignment="Left" IsReadOnly="True"/>
                                    <Label Margin="2,2" VerticalAlignment="Center" HorizontalAlignment="Center" Content="圆心Y:"/>
                                    <mwControls:NumberBox Value="{Binding CameraWaferFusionCalibrationItem.CenterY}" Margin="2,2" HorizontalAlignment="Left" IsReadOnly="True"/>-->
                                    <Label Margin="2,2" VerticalAlignment="Center" HorizontalAlignment="Center" Content="半径:"/>
                                    <mwControls:NumberBox mwControls:NumericKeypadAttach.IsEnabled="True" Value="{Binding CameraWaferFusionCalibrationItem.Radius}" Margin="2,2" HorizontalAlignment="Left" IsReadOnly="False"/>
                                    <Label Margin="2,2" VerticalAlignment="Center" HorizontalAlignment="Center" Content="标定板行间距:"/>
                                    <mwControls:NumberBox mwControls:NumericKeypadAttach.IsEnabled="True" Value="{Binding CameraWaferFusionCalibrationItem.RowStep}" Margin="2,2" HorizontalAlignment="Left" IsReadOnly="False"/>
                                    <Label Margin="2,2" VerticalAlignment="Center" HorizontalAlignment="Center" Content="标定板列间距:"/>
                                    <mwControls:NumberBox mwControls:NumericKeypadAttach.IsEnabled="True" Value="{Binding CameraWaferFusionCalibrationItem.ColStep}" Margin="2,2" HorizontalAlignment="Left" IsReadOnly="False"/>
                                    <!--<Button Margin="2,2" Content="示教" Click="{mwControls:Action TeachCircleCenter}"/>
                                    <Button Margin="2,2" Content="导入圆坐标" Click="{mwControls:Action ImportCircleFile}"/>-->
                                </UniformGrid>
                            </Grid>
                        </GroupBox>
                    </Grid>
                </TabItem>
                <TabItem Header="验证" >
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="80"/>
                            <RowDefinition Height="80"/>
                            <RowDefinition Height="140"/>
                            <RowDefinition Height="190"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <GroupBox Style="{StaticResource GroupBoxSecondary}"  Margin="3" IsEnabled="{Binding Motion.IsFinish}">
                            <GroupBox.Header>
                                <TextBlock  Text="第一步：设定Die位置" VerticalAlignment="Center" FontWeight="Bold" />
                            </GroupBox.Header>
                            <UniformGrid Rows="1">
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition/>
                                        <!--<ColumnDefinition/>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>-->
                                    </Grid.ColumnDefinitions>
                                    <Button Grid.Column="0" Visibility="Collapsed" Content="移到相机位置" Click="{mwControls:Action btnMoveCameraPosition}" HorizontalAlignment="Left" />
                                    <Button Grid.Column="1" Visibility="Collapsed" Content="移到Wafer位置" Click="{mwControls:Action btnMoveWaferStartPosition}" HorizontalAlignment="Left" />
                                    <Button Grid.Column="0"  Content="设定Die位置" Click="{mwControls:Action btnSetDiePosition}" HorizontalAlignment="Center" />
                                </Grid>
                            </UniformGrid>
                        </GroupBox>
                        <GroupBox Grid.Row="1" Style="{StaticResource GroupBoxSecondary}"  Margin="3" IsEnabled="{Binding Motion.IsFinish}">
                            <GroupBox.Header>
                                <TextBlock  Text="第二步：设定Pad位置" VerticalAlignment="Center" FontWeight="Bold" />
                            </GroupBox.Header>
                            <UniformGrid Rows="1">
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition/>
                                        <!--<ColumnDefinition/>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>-->
                                    </Grid.ColumnDefinitions>
                                    <Button Grid.Column="0"  Content="设定Pad位置" Click="{mwControls:Action btnSetPadPosition}" HorizontalAlignment="Center" />
                                </Grid>
                            </UniformGrid>
                        </GroupBox>
                        <GroupBox Grid.Row="2" Style="{StaticResource GroupBoxSecondary}"  Margin="3" IsEnabled="{Binding Motion.IsFinish}">
                            <GroupBox.Header>
                                <TextBlock  Text="第三步：计算Wafer移动坐标" VerticalAlignment="Center" FontWeight="Bold" />
                            </GroupBox.Header>
                            <UniformGrid Rows="2">
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                    </Grid.ColumnDefinitions>
                                    <Label Content="X,Y(mm)：" Grid.Column="0" Style="{StaticResource CommonLableStyle}" HorizontalAlignment="Right" />
                                    <mwControls:NumberBox  Value="{Binding WaferVerifyX}" mwControls:NumericKeypadAttach.IsEnabled="True" Minimum="-1000" Maximum="1000"  Grid.Column="1"   HorizontalAlignment="Left" Margin="5" Width="120" Height="35" />
                                    <mwControls:NumberBox  Value="{Binding WaferVerifyY}" mwControls:NumericKeypadAttach.IsEnabled="True" Minimum="-1000" Maximum="1000"  Grid.Column="2"   HorizontalAlignment="Left" Margin="5" Width="120" Height="35" />
                                    <Button Grid.Column="3"  Content="计算" Click="{mwControls:Action btnCalculate}" HorizontalAlignment="Left" />
                                </Grid>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                    </Grid.ColumnDefinitions>
                                    <Button Grid.Column="3"  Content="移动到验证点" Click="{mwControls:Action btnMoveToVerifyPoint}" HorizontalAlignment="Left" />
                                </Grid>
                            </UniformGrid>
                        </GroupBox>
                        <GroupBox Grid.Row="3" Style="{StaticResource GroupBoxSecondary}"  Margin="3" IsEnabled="{Binding Motion.IsFinish}">
                            <GroupBox.Header>
                                <TextBlock  Text="相机畸变测试" VerticalAlignment="Center" FontWeight="Bold" />
                            </GroupBox.Header>
                            <UniformGrid Rows="3" Columns="4">
                                <Label Content="RealX,Y(mm)：" Grid.Column="0" Style="{StaticResource CommonLableStyle}" HorizontalAlignment="Right" />
                                    <mwControls:NumberBox  Value="{Binding DesPixelX}" mwControls:NumericKeypadAttach.IsEnabled="True" Minimum="-1000" Maximum="1000" DecimalPlaces="6"  Grid.Column="1"   HorizontalAlignment="Left" Margin="5" Width="120" Height="35" />
                                    <mwControls:NumberBox  Value="{Binding DesPixelY}" mwControls:NumericKeypadAttach.IsEnabled="True" Minimum="-1000" Maximum="1000" DecimalPlaces="6"   Grid.Column="2"   HorizontalAlignment="Left" Margin="5" Width="120" Height="35" />
                                    <Button Grid.Column="3"  Content="识别" Click="{mwControls:Action btnCameraTest}" HorizontalAlignment="Left" />
                                    <Label Content="RulerX,Y(mm)：" Style="{StaticResource CommonLableStyle}" HorizontalAlignment="Right" />
                                    <mwControls:NumberBox  Value="{Binding DesRulerX}" mwControls:NumericKeypadAttach.IsEnabled="True" Minimum="-1000" Maximum="1000" DecimalPlaces="6"  Grid.Column="1"   HorizontalAlignment="Left" Margin="5" Width="120" Height="35" />
                                    <mwControls:NumberBox  Value="{Binding DesRulerY}" mwControls:NumericKeypadAttach.IsEnabled="True" Minimum="-1000" Maximum="1000" DecimalPlaces="6"   Grid.Column="2"   HorizontalAlignment="Left" Margin="5" Width="120" Height="35" />
                                    <Label/>
                                    <RadioButton Content="定位相机" Margin="10,0,0,0" IsChecked="{Binding CameraTypeVM, Converter={StaticResource CameraTypeToBoolConverter}, ConverterParameter=1}"  GroupName="cameraType"/>
                                    <RadioButton Content="虚拟定位相机" Margin="10,0,0,0" IsChecked="{Binding CameraTypeVM, Converter={StaticResource CameraTypeToBoolConverter}, ConverterParameter=2}" GroupName="cameraType"/>
                            </UniformGrid>
                        </GroupBox>
                    </Grid>
                </TabItem>
                <TabItem Header="验证1" >
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="auto"/>
                            <RowDefinition Height="auto"/>
                            <RowDefinition Height="auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <GroupBox Style="{StaticResource GroupBoxSecondary}"  Margin="3" IsEnabled="{Binding Motion.IsFinish}">
                            <GroupBox.Header>
                                <TextBlock  Text="WS运动系标定位置" VerticalAlignment="Center" FontWeight="Bold" />
                            </GroupBox.Header>
                            <UniformGrid Grid.Row="0" Rows="2">
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="2*"/>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                        <!--<ColumnDefinition/>-->
                                    </Grid.ColumnDefinitions>
                                    <Label Content="WS平台标定X1,X2,Y2(mm)：" Width="200" Grid.Column="0" Style="{StaticResource CommonLableStyle}" HorizontalAlignment="Right" />
                                    <mwControls:NumberBox  Value="{Binding CameraWaferFusionCalibrationItem.WSPlatCalibXPos}" mwControls:NumericKeypadAttach.IsEnabled="True" Minimum="-1000" Maximum="1000"  Grid.Column="1"   HorizontalAlignment="Left" Margin="5" Width="80" Height="35" />
                                    <!--<mwControls:NumberBox  Value="{Binding CameraWaferFusionCalibrationItem.WSApproachXPos}" mwControls:NumericKeypadAttach.IsEnabled="True" Minimum="-1000" Maximum="1000"  Grid.Column="2"   HorizontalAlignment="Left" Margin="5" Width="80" Height="35" />
                                    <mwControls:NumberBox  Value="{Binding CameraWaferFusionCalibrationItem.WSApproachYPos}" mwControls:NumericKeypadAttach.IsEnabled="True" Minimum="-1000" Maximum="1000"  Grid.Column="3"   HorizontalAlignment="Left" Margin="5" Width="80" Height="35" />-->
                                    <Button Grid.Column="2"  Content="移到此位置" Click="{mwControls:Action btnMoveWSCalibPosPosition}" HorizontalAlignment="Left" />
                                </Grid>
                                <Grid Visibility="Collapsed">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                    </Grid.ColumnDefinitions>
                                    <Label Content="X：" Grid.Column="0" Style="{StaticResource CommonLableStyle}" HorizontalAlignment="Right" />
                                    <mwControls:NumberBox  Value="{Binding CameraWaferFusionCalibrationItem.WSApproachXPos}" mwControls:NumericKeypadAttach.IsEnabled="True" Minimum="-1000" Maximum="1000"  Grid.Column="1"   HorizontalAlignment="Left" Margin="5" Width="80" Height="35" />
                                    <Label Content="Y：" Grid.Column="2" Style="{StaticResource CommonLableStyle}" HorizontalAlignment="Right" />
                                    <mwControls:NumberBox  Value="{Binding CameraWaferFusionCalibrationItem.WSApproachYPos}" mwControls:NumericKeypadAttach.IsEnabled="True" Minimum="-1000" Maximum="1000"  Grid.Column="3"   HorizontalAlignment="Left" Margin="5" Width="80" Height="35" />
                                    <Button Grid.Column="5"  Content="中心对齐" Click="{mwControls:Action btnGotoCalibPos}" HorizontalAlignment="Left" />
                                </Grid>
                            </UniformGrid>
                        </GroupBox>
                        <GroupBox Grid.Row="2" Style="{StaticResource GroupBoxSecondary}"  Margin="3" IsEnabled="{Binding Motion.IsFinish}">
                            <GroupBox.Header>
                                <TextBlock  Text="WS运动位置" VerticalAlignment="Center" FontWeight="Bold" />
                            </GroupBox.Header>
                            <UniformGrid Rows="5" Columns="1">
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                    </Grid.ColumnDefinitions>
                                    <Label Content="StartX(mm)：" Grid.Column="0" Style="{StaticResource CommonLableStyle}" HorizontalAlignment="Right" />
                                    <mwControls:NumberBox  Value="{Binding CameraWaferFusionCalibrationItem.WaferStartVerifyX}" IsReadOnly="True" Background="LightGray" mwControls:NumericKeypadAttach.IsEnabled="True" Minimum="-1000" Maximum="1000"  Grid.Column="1"   HorizontalAlignment="Left" Margin="5" Width="120" Height="35" />
                                    <Label Content="StartY(mm)：" Grid.Column="2" Style="{StaticResource CommonLableStyle}" HorizontalAlignment="Right" />
                                    <mwControls:NumberBox  Value="{Binding CameraWaferFusionCalibrationItem.WaferStartVerifyY}" IsReadOnly="True" Background="LightGray" mwControls:NumericKeypadAttach.IsEnabled="True" Minimum="-1000" Maximum="1000"  Grid.Column="3"   HorizontalAlignment="Left" Margin="5" Width="120" Height="35" />
                                </Grid>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                    </Grid.ColumnDefinitions>
                                    <!--<Button Grid.Column="1"  Content="读取当前位置" Click="{mwControls:Action btnSetWaferStartPosition}" HorizontalAlignment="Left" />-->
                                    <Button Grid.Column="3"  Content="设置起点" Click="{mwControls:Action btnMoveToCenter}" HorizontalAlignment="Left" />
                                </Grid>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                    </Grid.ColumnDefinitions>
                                    <Label Content="Step(mm)：" Grid.Column="0" Style="{StaticResource CommonLableStyle}" HorizontalAlignment="Right" />
                                    <mwControls:NumberBox  Value="{Binding CameraWaferFusionCalibrationItem.WaferVerityStep}" mwControls:NumericKeypadAttach.IsEnabled="True" Minimum="-1000" Maximum="1000"  Grid.Column="1"   HorizontalAlignment="Left" Margin="5" Width="120" Height="35" />
                                    <Button Grid.Column="3"  Content="移动到起点" Click="{mwControls:Action btnMoveToStartPoint}" HorizontalAlignment="Left" />
                                    <!--<Label Content="StepY(mm)：" Grid.Column="2" Style="{StaticResource CommonLableStyle}" HorizontalAlignment="Right" />
                                    <mwControls:NumberBox  Value="{Binding CameraWaferFusionCalibrationItem.StepY}" mwControls:NumericKeypadAttach.IsEnabled="True" Minimum="-1000" Maximum="1000"  Grid.Column="3"   HorizontalAlignment="Left" Margin="5" Width="120" Height="35" />-->
                                </Grid>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                        <ColumnDefinition/>
                                    </Grid.ColumnDefinitions>
                                    <Label Content="CountX：" Grid.Column="0" Style="{StaticResource CommonLableStyle}" HorizontalAlignment="Right" />
                                    <mwControls:IntNumberBox  Value="{Binding CameraWaferFusionCalibrationItem.WaferVerityCountX}" mwControls:NumericKeypadAttach.IsEnabled="True" Minimum="-1000" Maximum="1000"  Grid.Column="1"   HorizontalAlignment="Left" Margin="5" Width="120" Height="35" />
                                    <Label Content="CountY：" Grid.Column="2" Style="{StaticResource CommonLableStyle}" HorizontalAlignment="Right" />
                                    <mwControls:IntNumberBox  Value="{Binding CameraWaferFusionCalibrationItem.WaferVerityCountY}" mwControls:NumericKeypadAttach.IsEnabled="True" Minimum="-1000" Maximum="1000"  Grid.Column="3"   HorizontalAlignment="Left" Margin="5" Width="120" Height="35" />
                                </Grid>
                                <Grid>
                                    <Button Content="开始飞拍" Click="{mwControls:Action btnMoveWafer}" Grid.Column="0"   Margin="10 5" IsEnabled="{Binding Motion.IsFinish}" />
                                </Grid>
                                <Grid>
                                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                                        <Button Content="以当前相机位置验证" Click="{mwControls:Action btnVerityWafer}"  Margin="10 5" IsEnabled="{Binding Motion.IsFinish}" Width="150"/>
                                        <Button Content="停止" Tag="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Content}" Click="{mwControls:Action btnStopVerityWafer}" HorizontalAlignment="Right"/>
                                    </StackPanel>
                                </Grid>
                            </UniformGrid>
                        </GroupBox>
                    </Grid>
                </TabItem>
                <TabItem Header="轴系精度验证">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="auto"/>
                            <RowDefinition Height="auto"/>
                            <RowDefinition Height="auto"/>
                            <RowDefinition Height="auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <view:AxisPrecisionCheckParamView Grid.Row="0" AxisPrecisionCheck="{Binding  AxisCheckItem.PHSPerpendicularityCheck}"/>
                        <GroupBox Grid.Row="1" Header="WS轴精度验证">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition/>
                                    <RowDefinition/>
                                </Grid.RowDefinitions>
                                <Button Content="X1移动到标定位置" Tag="X1移动到标定位置" Click="{mwControls:Action BtnMoveX1ToCalibPos}"></Button>
                                <view:AxisPrecisionCheckParamView Grid.Row="2" AxisPrecisionCheck="{Binding  AxisCheckItem.WSPerpendicularityCheck}"/>
                            </Grid>
                        </GroupBox>
                        
                        <view:AxisPrecisionCheckParamView Grid.Row="2" AxisPrecisionCheck="{Binding  AxisCheckItem.X1X2ParallelismCheck}"/>
                    </Grid>
                </TabItem>
            </TabControl>
            <Grid Grid.Row="1">
                <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right" >
                     <Button Content="保存" Tag="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Content}" Click="{mwControls:Action btnSave}"  Grid.Row="1" Grid.Column="4"  Margin="10 5"  IsEnabled="{Binding Motion.IsFinish}"/>
                </StackPanel>
            </Grid>
        </Grid>

    </Grid>
</UserControl>
