<UserControl x:Class="MainShell.AlgorithmCalib.View.CameraFusionPadCalibView"
             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.AlgorithmCalib.View"
             mc:Ignorable="d" 
             xmlns:mwControls="http://www.maxwell-gp.com/"
             d:DesignHeight="450" d:DesignWidth="800">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>

        <ContentControl Grid.Column="0" Content="{Binding CameraAxisViewModelSevice}"/>

        <Grid Grid.Column="1">

        <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="PHS运动系标定位置" VerticalAlignment="Center" FontWeight="Bold" />
            </GroupBox.Header>
            <UniformGrid Grid.Row="0" Rows="2">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="140"/>
                        <ColumnDefinition/>
                        <ColumnDefinition/>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>
                    <Label Content="PHS平台标定Y1(mm)：" Width="200" Grid.Column="0" Style="{StaticResource CommonLableStyle}" HorizontalAlignment="Right" />
                    <mwControls:NumberBox Tag="PHS平台标定Y1" Value="{Binding FusionCalibParItem.MoveAxisPos}" mwControls:NumericKeypadAttach.IsEnabled="True" Minimum="-1000" Maximum="1000"  Grid.Column="1"   HorizontalAlignment="Left" Margin="5" Width="75" Height="35" />
                    <Button Grid.Column="3" Tag="PHS平台标定Y1-移到此位置" Content="移到此位置" Click="{mwControls:Action btnMovePhsCalibPosPosition}" HorizontalAlignment="Left" />
                </Grid>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="1.6*"/>
                        <ColumnDefinition/>
                        <ColumnDefinition />
                        <ColumnDefinition/>
                        <ColumnDefinition Width="1.5*"/>
                    </Grid.ColumnDefinitions>
                    <Label Content="X1：" Grid.Column="0" Style="{StaticResource CommonLableStyle}" HorizontalAlignment="Right" />
                    <mwControls:NumberBox  Value="{Binding FusionCalibParItem.ApproachXPos}" 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 FusionCalibParItem.ApproachYPos}" 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 btnApproachPhsCalibPosition}"  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 FusionCalibParItem.CameraAxisPos}" mwControls:NumericKeypadAttach.IsEnabled="True" Minimum="-1000" Maximum="1000"  Grid.Column="1"   HorizontalAlignment="Center" 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="PHS起始位置" 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 FusionCalibParItem.StartX}" 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 FusionCalibParItem.StartY}" 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 btnCalculatePhsPosition}" HorizontalAlignment="Left" Grid.ColumnSpan="2" Margin="3,0,0,0" />
                    <Button Grid.Column="1" Tag="WS起始位置-读取当前位置" Content="读取当前位置" Click="{mwControls:Action btnSetStageStartPosition}" HorizontalAlignment="Left" Grid.ColumnSpan="2" Margin="3,0,0,0" />
                    <Button Grid.Column="2" Tag="WS起始位置-移到此位置" Content="移到此位置" Click="{mwControls:Action btnMoveStageStartPosition}" 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="3" 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>
                <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 FusionCalibParItem.CalibStep}"  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 FusionCalibParItem.CalibCount}" 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 FusionCalibParItem.Step}" mwControls:NumericKeypadAttach.IsEnabled="True" Minimum="-1000" Maximum="1000"  Grid.Column="1"   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 FusionCalibParItem.Count}" 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 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>
    </Grid>
    </Grid>
</UserControl>
