From 9d1660270272180cd71147d6ddd53d1382643d2e Mon Sep 17 00:00:00 2001
From: wenxiangchao <wenxiangchao@ihengxin.com.cn>
Date: 星期一, 02 十一月 2026 18:00:14 +0800
Subject: [PATCH] merge: 并入远程 Initial commit 作为历史根节点

---
 HMI.LogViewer/LogViewer.xaml |  380 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 380 insertions(+), 0 deletions(-)

diff --git a/HMI.LogViewer/LogViewer.xaml b/HMI.LogViewer/LogViewer.xaml
new file mode 100644
index 0000000..55a5616
--- /dev/null
+++ b/HMI.LogViewer/LogViewer.xaml
@@ -0,0 +1,380 @@
+锘�<hb:PluginControl x:Class="HMI.LogViewer.LogViewer"
+             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:HMI.LogViewer"
+             mc:Ignorable="d" 
+             xmlns:hb="clr-namespace:HMI.Base;assembly=HMI.Base"
+             xmlns:uic="clr-namespace:HMI.UI.Converter;assembly=HMI.UI"
+             xmlns:pw="https://opensource.panuon.com/wpf"
+             xmlns:pu="https://opensource.panuon.com/wpf-ui"
+             xmlns:dp="clr-namespace:HMI.UI.DpUtil;assembly=HMI.UI"
+             Loaded="UserControl_Loaded"
+             Background="{DynamicResource WorkspaceBackground}"
+             d:DesignHeight="450" d:DesignWidth="800">
+    <UserControl.Resources>
+        <ResourceDictionary>
+            <ResourceDictionary.MergedDictionaries>
+                <ResourceDictionary Source="/HMI.UI;component/Style/PanuonListView.xaml"/>
+            </ResourceDictionary.MergedDictionaries>
+
+            <Style x:Key="TableBlock" TargetType="TextBlock">
+                <Setter Property="Padding" Value="0"/>
+                <Setter Property="Margin" Value="0"/>
+                <Setter Property="VerticalAlignment" Value="Center"/>
+                <Setter Property="TextWrapping" Value="Wrap"/>
+            </Style>
+
+            <Style x:Key="TableBox" TargetType="TextBox">
+                <Setter Property="Padding" Value="0"/>
+                <Setter Property="Margin" Value="0"/>
+                <Setter Property="VerticalAlignment" Value="Center"/>
+                <Setter Property="VerticalContentAlignment" Value="Center"/>
+                <Setter Property="TextWrapping" Value="Wrap"/>
+                <Setter Property="BorderThickness" Value="0"/>
+                <Setter Property="BorderBrush" Value="Transparent"/>
+                <Setter Property="Background" Value="Transparent"/>
+                <Setter Property="Foreground" Value="{Binding Foreground,RelativeSource={RelativeSource Mode=FindAncestor,
+AncestorLevel=1,AncestorType=ListViewItem}}"/>
+                <Style.Triggers>
+                    <DataTrigger Binding="{Binding IsSelected,RelativeSource={RelativeSource Mode=FindAncestor,
+                        AncestorLevel=1,AncestorType=ListViewItem}}" Value="True">
+                        <Setter Property="Foreground" Value="#FFF"/>
+                    </DataTrigger>
+                    <DataTrigger Binding="{Binding IsMouseOver,RelativeSource={RelativeSource Mode=FindAncestor,
+    AncestorLevel=1,AncestorType=ListViewItem}}" Value="True">
+                        <Setter Property="Foreground" Value="#FFF"/>
+                    </DataTrigger>
+                </Style.Triggers>
+            </Style>
+
+            <Style x:Key="sbCell" TargetType="DataGridCell" BasedOn="{StaticResource {x:Static pu:StyleKeys.DataGridCellStyle}}">
+                <Setter Property="Padding" Value="0"/>
+                <Setter Property="Margin" Value="0"/>
+            </Style>
+        </ResourceDictionary>
+    </UserControl.Resources>
+    <Border Style="{StaticResource CardBoarder}">
+        <Grid dp:GridHelper.Space="10" Cursor="">
+            <Grid.RowDefinitions>
+                <RowDefinition Height="Auto"/>
+                <RowDefinition Height="Auto"/>
+                <RowDefinition/>
+                <RowDefinition Height="Auto"/>
+            </Grid.RowDefinitions>
+
+            <TextBlock FontSize="{StaticResource TitleFontSize}" 
+VerticalAlignment="Center" HorizontalAlignment="Left" Text="{DynamicResource log.title}"/>
+
+            <DockPanel Grid.Row="1" Cursor="">
+                <StackPanel DockPanel.Dock="Right" Style="{StaticResource ButtonGroup}">
+                    <Button Style="{StaticResource QueryBtn}"
+                            x:Name="queryBtn" Click="Button_Click"/>
+                    <Button Style="{StaticResource ResetBtn}"
+                            x:Name="resetBtn" Click="Button_Click"/>
+                    <Button x:Name="exportBtn"
+                            Style="{StaticResource ExportBtn}" Click="Button_Click"/>
+                </StackPanel>
+
+                <StackPanel Style="{StaticResource ButtonGroup}" HorizontalAlignment="Left">
+                    <TextBlock Style="{StaticResource TitleBox}" FontSize="14" Text="{DynamicResource log.level}"/>
+                    <ComboBox Style="{StaticResource FormComboxStyle}" x:Name="levelInput" 
+                              Width="180"
+                              SelectedValuePath="Content">
+                        <ComboBoxItem Content="Debug"/>
+                        <ComboBoxItem Content="Info"/>
+                        <ComboBoxItem Content="Warn"/>
+                        <ComboBoxItem Content="Error"/>
+                    </ComboBox>
+
+                    <TextBlock Style="{StaticResource TitleBox}" FontSize="14" Text="{DynamicResource log.source}"/>
+                    <TextBox Style="{StaticResource EditorTextBoxStyle}" x:Name="sourceInput" Width="180"/>
+
+                    <TextBlock Style="{StaticResource TitleBox}" FontSize="14" Text="{DynamicResource App.StartTime}"/>
+                    <pu:DateTimePicker Style="{StaticResource TimePicker}" IsEnabled="{Binding AutoRfh,Converter={StaticResource reverseBool}}" 
+                                       x:Name="startTimeInput"/>
+
+                    <TextBlock Style="{StaticResource TitleBox}" FontSize="14" Text="{DynamicResource App.EndTime}"/>
+                    <pu:DateTimePicker Style="{StaticResource TimePicker}" IsEnabled="{Binding AutoRfh,Converter={StaticResource reverseBool}}" 
+                                       x:Name="endTimeInput"/>
+
+                    <TextBlock Style="{StaticResource TitleBox}" FontSize="14" Text="{DynamicResource log.autoRefresh}"/>
+                    <CheckBox x:Name="autoRfhInput" HorizontalAlignment="Center" VerticalAlignment="Center"
+                              IsChecked="{Binding AutoRfh,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
+                </StackPanel>
+            </DockPanel>
+
+            <ListView Grid.Row="2" Style="{StaticResource DefaultListTable}" x:Name="table"
+                                  VirtualizingPanel.VirtualizationMode="Standard" >
+                <ListView.ItemContainerStyle>
+                    <Style TargetType="ListViewItem" BasedOn="{StaticResource {x:Static pu:StyleKeys.ListViewItemStyle}}">
+                        <Setter Property="Height" Value="{StaticResource nanD}" />
+                        <Style.Triggers>
+                            <DataTrigger Binding="{Binding level}" Value="Warn">
+                                <Setter Property="Foreground" Value="{DynamicResource WarningColor}"/>
+                            </DataTrigger>
+                            <DataTrigger Binding="{Binding level}" Value="Error">
+                                <Setter Property="Foreground" Value="{DynamicResource DangerColor}"/>
+                            </DataTrigger>
+                            <Trigger Property="IsSelected" Value="True">
+                                <Setter Property="Background" Value="Transparent"/>
+                            </Trigger>
+                            <Trigger Property="IsMouseOver" Value="True">
+                                <Setter Property="Background" Value="Transparent"/>
+                            </Trigger>
+                        </Style.Triggers>
+                    </Style>
+                </ListView.ItemContainerStyle>
+
+                <ListView.View>
+                    <GridView>
+                        <GridViewColumn Width="50">
+                            <GridViewColumn.Header>
+                                <TextBlock Text="#"/>
+                            </GridViewColumn.Header>
+                            <GridViewColumn.CellTemplate>
+                                <DataTemplate>
+                                    <TextBlock Text="{Binding Converter={StaticResource lvRowNumber},
+RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ListViewItem,AncestorLevel=1}}"/>
+                                </DataTemplate>
+                            </GridViewColumn.CellTemplate>
+                        </GridViewColumn>
+
+                        <GridViewColumn Width="80">
+                            <GridViewColumn.Header>
+                                <TextBlock Text="{DynamicResource log.level}"/>
+                            </GridViewColumn.Header>
+                            <GridViewColumn.CellTemplate>
+                                <DataTemplate>
+                                    <Border Style="{StaticResource CellBorder}">
+                                        <TextBlock VerticalAlignment="Center" Text="{Binding level}"/>
+                                    </Border>
+                                </DataTemplate>
+                            </GridViewColumn.CellTemplate>
+                        </GridViewColumn>
+
+                        <GridViewColumn Width="150">
+                            <GridViewColumn.Header>
+                                <TextBlock Text="{DynamicResource log.time}"/>
+                            </GridViewColumn.Header>
+                            <GridViewColumn.CellTemplate>
+                                <DataTemplate>
+                                    <Border Style="{StaticResource CellBorder}">
+                                        <TextBlock VerticalAlignment="Center" Text="{Binding time,Converter={x:Static uic:DateStrConverter.Instance},ConverterParameter='yyyy-MM-dd HH:mm:ss.fff'}"/>
+                                    </Border>
+                                </DataTemplate>
+                            </GridViewColumn.CellTemplate>
+                        </GridViewColumn>
+
+                        <GridViewColumn Width="150">
+                            <GridViewColumn.Header>
+                                <TextBlock Text="{DynamicResource log.source}"/>
+                            </GridViewColumn.Header>
+                            <GridViewColumn.CellTemplate>
+                                <DataTemplate>
+                                    <Border Style="{StaticResource CellBorder}">
+                                        <TextBlock VerticalAlignment="Center" Text="{Binding source}"/>
+                                    </Border>
+                                </DataTemplate>
+                            </GridViewColumn.CellTemplate>
+                        </GridViewColumn>
+
+                        <GridViewColumn Width="1420">
+                            <GridViewColumn.Header>
+                                <TextBlock Text="{DynamicResource log.text}"/>
+                            </GridViewColumn.Header>
+                            <GridViewColumn.CellTemplate>
+                                <DataTemplate>
+                                    <Border Style="{StaticResource CellBorder}">
+                                        <TextBox IsReadOnly="True" Style="{StaticResource TableBox}"
+                                                 Text="{Binding text}"/>
+                                    </Border>
+                                </DataTemplate>
+                            </GridViewColumn.CellTemplate>
+                        </GridViewColumn>
+                    </GridView>
+                </ListView.View>
+            </ListView>
+
+            <StackPanel Grid.Row="3" HorizontalAlignment="Right">
+                <pu:Pagination Style="{StaticResource DefaultPage}" 
+                               CurrentPage="{Binding CurrentPage}" 
+                               MaxPage="{Binding MaxPage}"/>
+            </StackPanel>
+
+            <!--<DataGrid Grid.Row="2" x:Name="table" 
+                      CellStyle="{StaticResource sbCell}"
+                  RowHeight="{StaticResource nanD}" Style="{StaticResource DefaultDataGrid}">
+                <DataGrid.RowStyle>
+                    <Style TargetType="DataGridRow" BasedOn="{StaticResource {x:Static pu:StyleKeys.DataGridRowStyle}}">
+                        <Style.Triggers>
+                            <DataTrigger Binding="{Binding level}" Value="Warn">
+                                <Setter Property="Background" Value="{DynamicResource WarningColor}"/>
+                                <Setter Property="Foreground" Value="Black"/>
+                            </DataTrigger>
+                            <DataTrigger Binding="{Binding level}" Value="Error">
+                                <Setter Property="Background" Value="{DynamicResource DangerColor}"/>
+                                <Setter Property="Foreground" Value="Black"/>
+                            </DataTrigger>
+                            <Trigger Property="IsSelected" Value="True">
+                                <Setter Property="Background" Value="Transparent"/>
+                            </Trigger>
+                            <Trigger Property="IsMouseOver" Value="True">
+                                <Setter Property="Background" Value="Transparent"/>
+                            </Trigger>
+                        </Style.Triggers>
+                    </Style>
+                </DataGrid.RowStyle>
+                <DataGrid.Columns>
+                    <DataGridTemplateColumn Header="#" Width="60" CanUserResize="False">
+                        <DataGridTemplateColumn.CellTemplate>
+                            <DataTemplate>
+                                <TextBlock Style="{StaticResource TableBlock}" Text="{Binding Converter={StaticResource rowNumber},
+    RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type DataGridRow},AncestorLevel=1}}"/>
+                            </DataTemplate>
+                        </DataGridTemplateColumn.CellTemplate>
+                    </DataGridTemplateColumn>
+                    <DataGridTextColumn Width="80" Binding="{Binding level}"
+                                        ElementStyle="{StaticResource TableBlock}">
+                        <DataGridTextColumn.Header>
+                            <TextBlock Text="{DynamicResource log.level}"/>
+                        </DataGridTextColumn.Header>
+                    </DataGridTextColumn>
+                    <DataGridTextColumn Width="150" Binding="{Binding time}"
+                                        ElementStyle="{StaticResource TableBlock}">
+                        <DataGridTextColumn.Header>
+                            <TextBlock Text="{DynamicResource log.time}"/>
+                        </DataGridTextColumn.Header>
+                    </DataGridTextColumn>
+                    <DataGridTextColumn Width="150" Binding="{Binding source}"
+                                        ElementStyle="{StaticResource TableBlock}">
+                        <DataGridTextColumn.Header>
+                            <TextBlock Text="{DynamicResource log.source}"/>
+                        </DataGridTextColumn.Header>
+                    </DataGridTextColumn>
+                    <DataGridTemplateColumn Width="*">
+                        <DataGridTemplateColumn.Header>
+                            <TextBlock Text="{DynamicResource log.text}"/>
+                        </DataGridTemplateColumn.Header>
+                        <DataGridTemplateColumn.CellTemplate>
+                            <DataTemplate>
+                                <TextBox IsReadOnly="True" Style="{StaticResource TableBox}" Text="{Binding text}"/>
+                            </DataTemplate>
+                        </DataGridTemplateColumn.CellTemplate>
+                    </DataGridTemplateColumn>
+                </DataGrid.Columns>
+            </DataGrid>-->
+
+            <!--<StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Right">
+                <pu:Pagination 
+                            Height="36" Margin="10"
+HorizontalAlignment="Left"
+Foreground="Black"
+ItemsBackground="Transparent"
+ItemsCornerRadius="12"
+ItemsSelectedBackground="{DynamicResource SecondPrimaryColor}"
+                            x:Name="page"
+                            CurrentPage="{Binding CurrentPage}" 
+                                        MaxPage="{Binding MaxPage}"/>
+            </StackPanel>-->
+
+            <!--<ListView Grid.Row="2" Style="{StaticResource DefaultListTable}" x:Name="table" VirtualizingPanel.IsContainerVirtualizable="True"
+VirtualizingPanel.IsVirtualizing="True" 
+VirtualizingPanel.VirtualizationMode="Standard">
+                <ListView.ItemContainerStyle>
+                    <Style TargetType="ListViewItem" BasedOn="{StaticResource {x:Static pu:StyleKeys.ListViewItemStyle}}">
+                        <Style.Triggers>
+                            <DataTrigger Binding="{Binding level}" Value="Warn">
+                                <Setter Property="Background" Value="{DynamicResource WarningColor}"/>
+                                <Setter Property="Foreground" Value="Black"/>
+                            </DataTrigger>
+                            <DataTrigger Binding="{Binding level}" Value="Error">
+                                <Setter Property="Background" Value="{DynamicResource DangerColor}"/>
+                                <Setter Property="Foreground" Value="Black"/>
+                            </DataTrigger>
+                            <Trigger Property="IsSelected" Value="True">
+                                <Setter Property="Background" Value="Transparent"/>
+                            </Trigger>
+                            <Trigger Property="IsMouseOver" Value="True">
+                                <Setter Property="Background" Value="Transparent"/>
+                            </Trigger>
+                        </Style.Triggers>
+                    </Style>
+                </ListView.ItemContainerStyle>
+                <ListView.View>
+                    <GridView AllowsColumnReorder="False">
+                        <GridViewColumn Width="60" Header="#">
+                            <GridViewColumn.CellTemplate>
+                                <DataTemplate>
+                                    <TextBlock Text="{Binding Converter={StaticResource lvRowNumber},
+RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ListViewItem,AncestorLevel=1}}"/>
+                                </DataTemplate>
+                            </GridViewColumn.CellTemplate>
+                        </GridViewColumn>
+
+                        <GridViewColumn Width="80">
+                            <GridViewColumn.Header>
+                                <TextBlock Text="{DynamicResource log.level}"/>
+                            </GridViewColumn.Header>
+                            <GridViewColumn.CellTemplate>
+                                <DataTemplate>
+                                    <Border Style="{StaticResource CellBorder}">
+                                        <TextBlock Style="{StaticResource ListTableTextBlock}" 
+                                                           Text="{Binding level}"/>
+                                    </Border>
+                                </DataTemplate>
+                            </GridViewColumn.CellTemplate>
+                        </GridViewColumn>
+                        <GridViewColumn Width="150">
+                            <GridViewColumn.Header>
+                                <TextBlock Text="{DynamicResource log.time}"/>
+                            </GridViewColumn.Header>
+                            <GridViewColumn.CellTemplate>
+                                <DataTemplate>
+                                    <Border Style="{StaticResource CellBorder}">
+                                        <TextBlock Style="{StaticResource ListTableTextBlock}" 
+   Text="{Binding time}"/>
+                                    </Border>
+                                </DataTemplate>
+                            </GridViewColumn.CellTemplate>
+                        </GridViewColumn>
+                        <GridViewColumn Width="150">
+                            <GridViewColumn.Header>
+                                <TextBlock Text="{DynamicResource log.source}"/>
+                            </GridViewColumn.Header>
+                            <GridViewColumn.CellTemplate>
+                                <DataTemplate>
+                                    <Border Style="{StaticResource CellBorder}">
+                                        <TextBlock Style="{StaticResource ListTableTextBlock}" 
+                                                   Text="{Binding source}"/>
+                                    </Border>
+                                </DataTemplate>
+                            </GridViewColumn.CellTemplate>
+                        </GridViewColumn>
+                        <GridViewColumn Width="1410">
+                            <GridViewColumn.Header>
+                                <TextBlock Text="{DynamicResource log.text}"/>
+                            </GridViewColumn.Header>
+                            <GridViewColumn.CellTemplate>
+                                <DataTemplate>
+                                    <Border Style="{StaticResource CellBorder}">
+                                        <TextBlock Style="{StaticResource ListTableTextBlock}" 
+                                                   Text="{Binding text}"/>
+                                    </Border>
+                                </DataTemplate>
+                            </GridViewColumn.CellTemplate>
+                        </GridViewColumn>
+                    </GridView>
+                </ListView.View>
+            </ListView>-->
+            <!--<pu:Pagination HorizontalContentAlignment="Right" Grid.Row="3" Margin="0,10,0,0" Height="30"
+                       FontSize="14"
+HorizontalAlignment="Left"
+Foreground="Black"
+ItemsBackground="Transparent"
+ItemsCornerRadius="12"
+ItemsSelectedBackground="#36AAF7" CurrentPage="1"  MaxPage="10"/>-->
+        </Grid>
+    </Border>
+</hb:PluginControl>
\ No newline at end of file

--
Gitblit v1.9.1