<!--
NavisworksTransport 系统管理页签视图 - 采用与其他页签一致的Navisworks 2026风格

功能说明：
1. 日志管理：查看、清空、导出日志，设置日志级别
2. 插件设置：设置选项、重置设置、导入配置、启用选项
3. 系统信息：插件版本、Navisworks版本、系统状态、内存使用、运行时间
4. 性能监控：性能信息和性能报告生成

设计原则：与Navisworks 2026风格一致，480像素宽度，现代化UI布局，采用Border分组
-->
<UserControl x:Class="NavisworksTransport.UI.WPF.Views.SystemManagementView"
             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" 
             d:DesignHeight="800" d:DesignWidth="480">
    
    <UserControl.Resources>
        <!-- 引用共享的Navisworks 2026样式资源 -->
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/NavisworksTransportPlugin;component/src/UI/WPF/Resources/NavisworksStyles.xaml"/>
            </ResourceDictionary.MergedDictionaries>
            
            <!-- 系统管理页面特有的样式 -->
            <Style x:Key="InfoTextStyle" TargetType="Label">
                <Setter Property="FontSize" Value="10"/>
                <Setter Property="Foreground" Value="{StaticResource NavisworksTextBrush}"/>
                <Setter Property="Padding" Value="0,2"/>
            </Style>

            <Style x:Key="StatusLabelStyle" TargetType="Label">
                <Setter Property="FontSize" Value="10"/>
                <Setter Property="FontWeight" Value="Normal"/>
                <Setter Property="Foreground" Value="{StaticResource NavisworksPrimaryBrush}"/>
                <Setter Property="Padding" Value="0,2"/>
            </Style>
        </ResourceDictionary>
    </UserControl.Resources>

    <ScrollViewer VerticalScrollBarVisibility="Auto" Padding="10">
        <StackPanel>
            <!-- 区域1: 日志管理 -->
            <Border BorderBrush="#FFD4E7FF" BorderThickness="1" CornerRadius="0" Margin="0,0,0,15" Padding="12">
                <StackPanel>
                    <Label Content="日志管理" Style="{StaticResource SectionHeaderStyle}"/>

                    <!-- 日志操作按钮 -->
                    <StackPanel Orientation="Horizontal" Margin="0,10,0,10">
                        <Button Content="查看日志"
                                Command="{Binding ViewLogCommand}"
                                Style="{StaticResource ActionButtonStyle}"/>
                    </StackPanel>

                    <!-- 日志级别设置 -->
                    <Grid Margin="0,5,0,10">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>

                        <Label Grid.Column="0" Content="日志级别:" Style="{StaticResource ParameterLabelStyle}" Width="80"/>
                        <ComboBox Grid.Column="1"
                                  ItemsSource="{Binding LogLevels}"
                                  SelectedItem="{Binding SelectedLogLevel}"
                                  Width="100"
                                  Margin="5,0,0,0"
                                  ToolTip="选择要记录的最低日志级别"/>
                    </Grid>
                </StackPanel>
            </Border>
            
            <!-- 区域2: 插件设置 -->
            <Border BorderBrush="#FFD4E7FF" BorderThickness="1" CornerRadius="0" Margin="0,0,0,15" Padding="12">
                <StackPanel>
                    <Label Content="插件设置" Style="{StaticResource SectionHeaderStyle}"/>

                    <!-- 设置操作按钮 -->
                    <StackPanel Orientation="Horizontal" Margin="0,10,0,10">
                        <Button Content="参数设置"
                                Command="{Binding OpenSettingsCommand}"
                                Style="{StaticResource ActionButtonStyle}"/>
                    </StackPanel>
                </StackPanel>
            </Border>
            
            <!-- 区域3: 系统信息 -->
            <Border BorderBrush="#FFD4E7FF" BorderThickness="1" CornerRadius="0" Margin="0,0,0,15" Padding="12">
                <StackPanel>
                    <Label Content="系统信息" Style="{StaticResource SectionHeaderStyle}"/>
                    
                    <!-- 系统信息表格 -->
                    <Grid Margin="0,10,0,15">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        
                        <Label Grid.Row="0" Grid.Column="0" Content="插件版本:" Style="{StaticResource ParameterLabelStyle}" Width="100"/>
                        <Label Grid.Row="0" Grid.Column="1" Content="{Binding PluginVersion}" Style="{StaticResource InfoTextStyle}"/>
                        
                        <Label Grid.Row="1" Grid.Column="0" Content="Navisworks版本:" Style="{StaticResource ParameterLabelStyle}" Width="100"/>
                        <Label Grid.Row="1" Grid.Column="1" Content="{Binding NavisworksVersion}" Style="{StaticResource InfoTextStyle}"/>
                        
                        
                        <Label Grid.Row="3" Grid.Column="0" Content="内存使用:" Style="{StaticResource ParameterLabelStyle}" Width="100"/>
                        <Label Grid.Row="3" Grid.Column="1" Content="{Binding MemoryUsage}" Style="{StaticResource InfoTextStyle}"/>
                        
                        <Label Grid.Row="4" Grid.Column="0" Content="运行时间:" Style="{StaticResource ParameterLabelStyle}" Width="100"/>
                        <Label Grid.Row="4" Grid.Column="1" Content="{Binding RunningTime}" Style="{StaticResource InfoTextStyle}"/>
                    </Grid>
                    
                    <!-- 更新检查按钮 -->
                    <StackPanel Orientation="Horizontal">
                        <Button Content="检查更新" 
                                Command="{Binding CheckUpdateCommand}" 
                                Style="{StaticResource SecondaryButtonStyle}"/>
                    </StackPanel>
                </StackPanel>
            </Border>
            
            <!-- 区域4: 性能监控 -->
            <Border BorderBrush="#FFD4E7FF" BorderThickness="1" CornerRadius="0" Margin="0,0,0,15" Padding="12">
                <StackPanel>
                    <Label Content="性能监控" Style="{StaticResource SectionHeaderStyle}"/>

                    <!-- 环境检查按钮 -->
                    <StackPanel Orientation="Horizontal" Margin="0,5,0,5">
                        <Button Content="环境检查"
                                Style="{StaticResource SecondaryButtonStyle}"
                                Command="{Binding DiagnosticCommand}"
                                ToolTip="检查运行环境和线程状态"/>
                    </StackPanel>
                </StackPanel>
            </Border>

            <!-- 区域5: 功能测试 -->
            <Border BorderBrush="#FFD4E7FF" BorderThickness="1" CornerRadius="0" Margin="0,0,0,15" Padding="12">
                <StackPanel>
                    <Label Content="功能测试" Style="{StaticResource SectionHeaderStyle}"/>

                    <TextBlock Text="测试新功能和实验性特性"
                               FontSize="10"
                               Foreground="{StaticResource NavisworksDarkBrush}"
                               Margin="0,5,0,10"
                               TextWrapping="Wrap"/>

                    <!-- 体素网格测试 -->
                    <StackPanel Orientation="Horizontal" Margin="0,5,0,5">
                        <!-- 测试体素网格按钮 -->
                        <Button Content="测试体素网格 (SDF方法)"
                                Command="{Binding TestVoxelGridSDFCommand}"
                                Style="{StaticResource ActionButtonStyle}"
                                ToolTip="使用 MeshSignedDistanceGrid 进行精确体素化，计算距离场"/>

                        <!-- 测试体素路径规划按钮 -->
                        <Button Content="测试体素路径规划 (3D A*)"
                                Command="{Binding TestVoxelPathFindingCommand}"
                                Style="{StaticResource ActionButtonStyle}"
                                ToolTip="使用3D A*算法在体素网格中规划路径，支持楼梯、坡道等垂直移动"/>

                        <!-- 读取Transform测试按钮 -->
                        <Button Content="读取Transform"
                                Command="{Binding ReadTransformTestCommand}"
                                Style="{StaticResource ActionButtonStyle}"
                                ToolTip="读取选中对象的Transform信息（包括旋转角度）"/>
                    </StackPanel>
                </StackPanel>
            </Border>
        </StackPanel>
    </ScrollViewer>
</UserControl>