<!--
路径配置对话框

功能说明：
1. 选择物体类型（虚拟物体或真实物体）
2. 配置虚拟物体尺寸
3. 选择真实物体（支持从视图或选择树中选择）
4. 选择被检测项（可选）
5. 配置覆盖参数（帧率、时长、检测间隙）
-->
<Window x:Class="NavisworksTransport.UI.WPF.Views.PathConfigDialog"
        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" 
        mc:Ignorable="d" 
        Title="路径配置" 
        Height="700" 
        Width="750"
        WindowStartupLocation="CenterScreen"
        ResizeMode="CanResize"
        Topmost="True">
    
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/TransportPlugin;component/src/UI/WPF/Resources/NavisworksStyles.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>

    <Grid Margin="20">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <!-- 物流类型选择 -->
        <Border Grid.Row="0" BorderBrush="#FFD4E7FF" BorderThickness="1" CornerRadius="0" Padding="12" Margin="0,0,0,10">
            <StackPanel>
                <Label Content="物流类型" Style="{StaticResource SectionHeaderStyle}"/>
                <StackPanel Orientation="Horizontal" Margin="0,10,0,0">
                    <RadioButton Name="rbVirtualObject" Content="使用虚拟物体" Margin="0,0,20,0" Checked="rbVirtualObject_Checked"/>
                    <RadioButton Name="rbRealObject" Content="使用真实物体" Checked="rbRealObject_Checked"/>
                </StackPanel>
            </StackPanel>
        </Border>

        <!-- 虚拟物体参数 -->
        <Border Grid.Row="1" BorderBrush="#FFD4E7FF" BorderThickness="1" CornerRadius="0" Padding="12" Margin="0,0,0,10"
                Name="borderVirtualObject">
            <StackPanel>
                <Label Content="虚拟物体尺寸（米）" Style="{StaticResource SectionHeaderStyle}"/>
                <Grid Margin="0,10,0,0">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="120"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="80"/>
                    </Grid.ColumnDefinitions>

                    <Label Grid.Row="0" Grid.Column="0" Content="长度（X轴）:" VerticalAlignment="Center"/>
                    <TextBox Grid.Row="0" Grid.Column="1" Name="txtObjectLength" Text="1.0" Margin="0,0,5,5"/>
                    <TextBlock Grid.Row="0" Grid.Column="2" Text="米" VerticalAlignment="Center" Margin="0,0,0,5"/>

                    <Label Grid.Row="1" Grid.Column="0" Content="宽度（Y轴）:" VerticalAlignment="Center"/>
                    <TextBox Grid.Row="1" Grid.Column="1" Name="txtObjectWidth" Text="1.0" Margin="0,0,5,5"/>
                    <TextBlock Grid.Row="1" Grid.Column="2" Text="米" VerticalAlignment="Center" Margin="0,0,0,5"/>

                    <Label Grid.Row="2" Grid.Column="0" Content="高度（Z轴）:" VerticalAlignment="Center"/>
                    <TextBox Grid.Row="2" Grid.Column="1" Name="txtObjectHeight" Text="2.0" Margin="0,0,5,5"/>
                    <TextBlock Grid.Row="2" Grid.Column="2" Text="米" VerticalAlignment="Center" Margin="0,0,0,5"/>
                </Grid>
            </StackPanel>
        </Border>

        <!-- 真实物体选择 -->
        <Border Grid.Row="2" BorderBrush="#FFD4E7FF" BorderThickness="1" CornerRadius="0" Padding="12" Margin="0,0,0,10" 
                Name="borderRealObject" Visibility="Collapsed">
            <StackPanel>
                <Label Content="选择运动物体" Style="{StaticResource SectionHeaderStyle}"/>
                <Grid Margin="0,10,0,0">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="120"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="120"/>
                    </Grid.ColumnDefinitions>
                    
                    <Label Grid.Row="0" Grid.Column="0" Content="已选择物体:" VerticalAlignment="Center"/>
                    <TextBox Grid.Row="0" Grid.Column="1" Name="txtSelectedObject" IsReadOnly="True" 
                             Text="（未选择）" Margin="0,0,5,5"/>
                    <Button Grid.Row="0" Grid.Column="2" Name="btnSelectFromView" Content="从视图选择" 
                            Click="btnSelectFromView_Click" Style="{StaticResource ActionButtonStyle}" Margin="0,0,0,5"/>
                    
                    <Label Grid.Row="1" Grid.Column="0" Content="物体ID:" VerticalAlignment="Center"/>
                    <TextBlock Grid.Row="1" Grid.Column="1" Name="txtObjectId" Text="-" VerticalAlignment="Center" Margin="0,0,0,5"/>
                </Grid>
            </StackPanel>
        </Border>

        <!-- 被检测项选择 -->
        <Border Grid.Row="3" BorderBrush="#FFD4E7FF" BorderThickness="1" CornerRadius="0" Padding="12" Margin="0,0,0,10">
            <StackPanel>
                <Label Content="被检测项（可选）" Style="{StaticResource SectionHeaderStyle}"/>
                <Grid Margin="0,10,0,0">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="120"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="120"/>
                    </Grid.ColumnDefinitions>
                    
                    <Label Grid.Row="0" Grid.Column="0" Content="已选择项数:" VerticalAlignment="Center"/>
                    <TextBlock Grid.Row="0" Grid.Column="1" Name="txtDetectionItemCount" Text="0" VerticalAlignment="Center" Margin="0,0,5,5"/>
                    <Button Grid.Row="0" Grid.Column="2" Name="btnSelectDetectionItems" Content="选择检测项" 
                            Click="btnSelectDetectionItems_Click" Style="{StaticResource ActionButtonStyle}" Margin="0,0,0,5"/>
                    
                    <Label Grid.Row="1" Grid.Column="0" Content="检测模式:" VerticalAlignment="Center"/>
                    <StackPanel Grid.Row="1" Grid.Column="1" Orientation="Horizontal" Margin="0,0,0,5">
                        <RadioButton Name="rbDetectAll" Content="检测所有物体" IsChecked="True" Margin="0,0,20,0"/>
                        <RadioButton Name="rbDetectSelected" Content="仅检测选中项"/>
                    </StackPanel>
                </Grid>
            </StackPanel>
        </Border>

        <!-- 配置覆盖 -->
        <Border Grid.Row="4" BorderBrush="#FFD4E7FF" BorderThickness="1" CornerRadius="0" Padding="12" Margin="0,0,0,10">
            <StackPanel>
                <Label Content="配置覆盖（可选）" Style="{StaticResource SectionHeaderStyle}"/>
                <CheckBox Name="cbOverrideConfig" Content="使用自定义配置" Margin="0,10,0,0" Checked="cbOverrideConfig_Checked" Unchecked="cbOverrideConfig_Unchecked"/>
                
                <Grid Name="gridOverrideConfig" Margin="0,10,0,0" IsEnabled="False">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="150"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="80"/>
                    </Grid.ColumnDefinitions>
                    
                    <Label Grid.Row="0" Grid.Column="0" Content="帧率:" VerticalAlignment="Center"/>
                    <TextBox Grid.Row="0" Grid.Column="1" Name="txtFrameRate" Text="30" Margin="0,0,5,5"/>
                    <TextBlock Grid.Row="0" Grid.Column="2" Text="fps" VerticalAlignment="Center" Margin="0,0,0,5"/>
                    
                    <Label Grid.Row="1" Grid.Column="0" Content="动画时长:" VerticalAlignment="Center"/>
                    <TextBox Grid.Row="1" Grid.Column="1" Name="txtDuration" Text="10.0" Margin="0,0,5,5"/>
                    <TextBlock Grid.Row="1" Grid.Column="2" Text="秒" VerticalAlignment="Center" Margin="0,0,0,5"/>
                    
                    <Label Grid.Row="2" Grid.Column="0" Content="检测间隙:" VerticalAlignment="Center"/>
                    <TextBox Grid.Row="2" Grid.Column="1" Name="txtDetectionGap" Text="0.05" Margin="0,0,5,5"/>
                    <TextBlock Grid.Row="2" Grid.Column="2" Text="米" VerticalAlignment="Center" Margin="0,0,0,5"/>
                </Grid>
            </StackPanel>
        </Border>

        <!-- 底部按钮 -->
        <StackPanel Grid.Row="5" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,10,0,0">
            <Button Content="确定" Name="btnOK" Click="btnOK_Click" 
                    Style="{StaticResource ActionButtonStyle}" Width="100" Margin="0,0,10,0"/>
            <Button Content="取消" Name="btnCancel" Click="btnCancel_Click" 
                    Style="{StaticResource SecondaryButtonStyle}" Width="100"/>
        </StackPanel>
    </Grid>
</Window>
