<Page x:Class="B20UVLog.Pages.RecipeBody"
      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:B20UVLog.Pages" xmlns:My="clr-namespace:MyWPFControl.Controls;assembly=MyWPFControl" xmlns:viewmodels="clr-namespace:B20UVLog.ViewModels"
      mc:Ignorable="d" 
      d:DesignHeight="450" d:DesignWidth="800"
      Title="RecipeBody">
    <Page.DataContext>
        <viewmodels:RecipeBodyViewModel/>
    </Page.DataContext>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <!--<TextBlock Grid.Row="0" Text="Recipe Body" FontSize="25" Margin="10 5"/>-->
        <StackPanel Grid.Row="1" Orientation="Horizontal" VerticalAlignment="Center">
            <!--<My:MTextBox x:Name="TextIndex" Title="Index_No"/>-->
            <My:MDateTimePicker x:Name="DTPStart" Title="开始时间"/>
            <TextBlock Text="--" VerticalAlignment="Center" Margin="2"/>
            <My:MDateTimePicker x:Name="DTPEnd" Title="结束时间"/>
            <My:MButton x:Name="BtnSearch" Content="查询" Type="Primary"  Click="BtnSearch_Click"/>
            <My:MButton x:Name="BtnReset" Content="条件重置"  Click="BtnReset_Click"/>
            <My:MButton x:Name="BtnExport" Content="导出报表"  Click="BtnExport_Click" Type="Warning"/>
        </StackPanel>
        <Grid Grid.Row="2">
            <Grid.RowDefinitions>
                <RowDefinition Height="*"/>
                <RowDefinition Height="auto"/>
            </Grid.RowDefinitions>
            <My:MDataGrid  ItemsSource="{Binding GridData}">
                <DataGrid.Columns>
                    <DataGridTextColumn Header="RecipeNo" Binding="{Binding RecipeNo}"/>
                    <DataGridTextColumn Header="WorkThickness(mm)" Binding="{Binding WorkThickness,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.001}"/>
                    <DataGridTextColumn Header="MaskThickness(mm)" Binding="{Binding MaskThickness,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.001}"/>
                    <DataGridTextColumn Header="Lamp电力" Binding="{Binding LampSet}"/>
                    <DataGridTextColumn Header="光照模式" Binding="{Binding IrradiationMode}"/>
                    <DataGridTextColumn Header="光照强度(W/cm²)" Binding="{Binding IrradiationSet}"/>
                    <DataGridTextColumn Header="累计光强(mJ/cm²)" Binding="{Binding LightSet}"/>
                    <DataGridTextColumn Header="光照时长(s)" Binding="{Binding IrradiationTime}"/>
                    <DataGridTextColumn Header="阶段电力" Binding="{Binding StagePowerSet}"/>
                    <DataGridTextColumn Header="Mask有无" Binding="{Binding Mask}"/>
                    <DataGridTextColumn Header="AlignmentKindNo" Binding="{Binding AlignmentKindNo}"/>
                    <DataGridTextColumn Header="Alignment XY容许值(μm)" Binding="{Binding AlignmentXY}"/>
                    <DataGridTextColumn Header="MarkPitch S容许值(μm)" Binding="{Binding MarkPitchS}"/>
                    <DataGridTextColumn Header="Alignment θ容许值(度)" Binding="{Binding AlignmentValue,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.0001}"/>
                    <DataGridTextColumn Header="Alignment次数" Binding="{Binding AlignmetCount}"/>
                    <DataGridTextColumn Header="SpiralSearch" Binding="{Binding SpiralSearch}"/>
                    <DataGridTextColumn Header="候补Search" Binding="{Binding SearchSet}"/>
                    <DataGridTextColumn Header="MaskID1" Binding="{Binding MaskID1}"/>
                    <DataGridTextColumn Header="MaskID2" Binding="{Binding MaskID2}"/>
                    <DataGridTextColumn Header="MaskID3" Binding="{Binding MaskID3}"/>
                    <DataGridTextColumn Header="MaskID4" Binding="{Binding MaskID4}"/>
                    <DataGridTextColumn Header="MaskID5" Binding="{Binding MaskID5}"/>
                    <DataGridTextColumn Header="MaskID6" Binding="{Binding MaskID6}"/>
                    <DataGridTextColumn Header="MaskID7" Binding="{Binding MaskID7}"/>
                    <DataGridTextColumn Header="MaskID8" Binding="{Binding MaskID8}"/>
                    <DataGridTextColumn Header="MaskID9" Binding="{Binding MaskID9}"/>
                    <DataGridTextColumn Header="MaskID10" Binding="{Binding MaskID10}"/>
                    <DataGridTextColumn Header="Gap测量计数" Binding="{Binding GapTimingCountor}"/>
                    <DataGridTextColumn Header="Gap传感器" Binding="{Binding GapSensorSetting}"/>
                    <DataGridTextColumn Header="Gap容许值(mm)" Binding="{Binding GapValue,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.1}"/>
                    <DataGridTextColumn Header="Gap Max-Min(mm)" Binding="{Binding GapMax,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.1}"/>
                    <DataGridTextColumn Header="Gap Bending Check" Binding="{Binding GapBendingCheck}"/>
                    <DataGridTextColumn Header="Mask Bending Timing" Binding="{Binding MaskBendingTiming}"/>
                    <DataGridTextColumn Header="Mask Bending容许值(mm)" Binding="{Binding MaskBendingValue,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.1}"/>
                    <DataGridTextColumn Header="静电检测" Binding="{Binding StaticElecCheck}"/>
                    <DataGridTextColumn Header="静电检测容许值(kV)" Binding="{Binding StaticElecValue,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.01}"/>
                    <DataGridTextColumn Header="上升速度切换位置1(mm)" Binding="{Binding RiseChangeSpeed1,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.001}"/>
                    <DataGridTextColumn Header="上升速度切换位置2(mm)" Binding="{Binding RiseChangeSpeed2,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.001}"/>
                    <DataGridTextColumn Header="上升速度切换位置3(mm)" Binding="{Binding RiseChangeSpeed3,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.001}"/>
                    <DataGridTextColumn Header="PIN/Stage切换位置(mm)" Binding="{Binding PINStage,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.001}"/>
                    <DataGridTextColumn Header="Alignment距离(μm)" Binding="{Binding AlignmentDistance}"/>
                    <DataGridTextColumn Header="照射距离(μm)" Binding="{Binding IrradiationDistance}"/>
                    <DataGridTextColumn Header="下降速度切换位置1(mm)" Binding="{Binding DeclineChangeSpeed1,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.001}"/>
                    <DataGridTextColumn Header="下降速度切换位置2(mm)" Binding="{Binding DeclineChangeSpeed2,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.001}"/>
                    <DataGridTextColumn Header="下降量(μm)" Binding="{Binding Decline}"/>
                    <DataGridTextColumn Header="下降次数" Binding="{Binding DeclineDrops}"/>
                    <DataGridTextColumn Header="下降Delay(s)" Binding="{Binding DeclineDelay,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.1}"/>
                    <DataGridTextColumn Header="高速速度(mm/s)" Binding="{Binding HighSpeed,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.001}"/>
                    <DataGridTextColumn Header="上升速度1(mm/s)" Binding="{Binding RiseSpeed1,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.001}"/>
                    <DataGridTextColumn Header="上升速度2(mm/s)" Binding="{Binding RiseSpeed2,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.001}"/>
                    <DataGridTextColumn Header="上升速度3(mm/s)" Binding="{Binding RiseSpeed3,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.001}"/>
                    <DataGridTextColumn Header="下降速度(mm/s)" Binding="{Binding DeclineSpeed1,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.001}"/>
                    <DataGridTextColumn Header="微下降速度(mm/s)" Binding="{Binding MicroDeclineSpeed1,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.001}"/>
                    <DataGridTextColumn Header="Q-Time(s)" Binding="{Binding QTime}"/>
                    <DataGridTextColumn Header="X-Ray照射时间(s)" Binding="{Binding X_Ray,
                        Converter={StaticResource ConverterMultipleDouble},ConverterParameter=0.001}"/>
                    <DataGridTextColumn Header="PIN吸着Pattern" Binding="{Binding PIN_Pattern}"/>
                    <DataGridTextColumn Header="PPID" Binding="{Binding PPID}"/>
                    <DataGridTextColumn Header="Alignment补正开关" Binding="{Binding IsAlignment}"/>
                    <DataGridTextColumn Header="Alignment补正X(μm)" Binding="{Binding AlignmentX}"/>
                    <DataGridTextColumn Header="Alignment补正Y(μm)" Binding="{Binding AlignmentY}"/>
                    <DataGridTextColumn Header="PPID" Binding="{Binding PPID}"/>
                    <DataGridTextColumn Header="记录时间" Binding="{Binding RecordTime,StringFormat=yyyy-MM-dd HH:mm:ss}"/>
                </DataGrid.Columns>
            </My:MDataGrid>
            <My:MPagination Grid.Row="1" x:Name="MyPagination" PageIndexChange="MyPagination_PageIndexChange" PageSizeChange="MyPagination_PageSizeChange"/>
        </Grid>

    </Grid>

</Page>
