feat: 重构项目结构,添加 WPF 应用
- 将核心功能提取到 WCTDataMiner.Core 类库 - 添加 WCTDataMiner.Wpf 桌面应用 - 支持数据解析、导出、统计等功能 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
8
src/WCTDataMiner.Wpf/App.xaml
Normal file
8
src/WCTDataMiner.Wpf/App.xaml
Normal file
@@ -0,0 +1,8 @@
|
||||
<Application x:Class="WCTDataMiner.Wpf.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:WCTDataMiner.Wpf">
|
||||
<Application.Resources>
|
||||
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
52
src/WCTDataMiner.Wpf/App.xaml.cs
Normal file
52
src/WCTDataMiner.Wpf/App.xaml.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
using System.Windows;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using WCTDataMiner.Core.Extensions;
|
||||
using WCTDataMiner.Core.Services;
|
||||
using WCTDataMiner.Wpf.ViewModels;
|
||||
using WCTDataMiner.Wpf.Views;
|
||||
|
||||
namespace WCTDataMiner.Wpf;
|
||||
|
||||
/// <summary>
|
||||
/// Interaction logic for App.xaml
|
||||
/// </summary>
|
||||
public partial class App : Application
|
||||
{
|
||||
private IHost? _host;
|
||||
|
||||
protected override void OnStartup(StartupEventArgs e)
|
||||
{
|
||||
_host = Host.CreateDefaultBuilder()
|
||||
.ConfigureServices((context, services) =>
|
||||
{
|
||||
// 注册 Core 层服务
|
||||
services.AddDatabaseServices(context.Configuration);
|
||||
services.AddApplicationServices();
|
||||
|
||||
// 注册 ViewModels
|
||||
services.AddTransient<MainViewModel>();
|
||||
services.AddTransient<ScenarioListViewModel>();
|
||||
services.AddTransient<PlossChartViewModel>();
|
||||
services.AddTransient<QfodChartViewModel>();
|
||||
|
||||
// 注册 Views
|
||||
services.AddTransient<MainWindow>();
|
||||
services.AddTransient<ScenarioListView>();
|
||||
services.AddTransient<PlossChartView>();
|
||||
services.AddTransient<QfodChartView>();
|
||||
})
|
||||
.Build();
|
||||
|
||||
var mainWindow = _host.Services.GetRequiredService<MainWindow>();
|
||||
mainWindow.Show();
|
||||
|
||||
base.OnStartup(e);
|
||||
}
|
||||
|
||||
protected override void OnExit(ExitEventArgs e)
|
||||
{
|
||||
_host?.Dispose();
|
||||
base.OnExit(e);
|
||||
}
|
||||
}
|
||||
10
src/WCTDataMiner.Wpf/AssemblyInfo.cs
Normal file
10
src/WCTDataMiner.Wpf/AssemblyInfo.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using System.Windows;
|
||||
|
||||
[assembly:ThemeInfo(
|
||||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
||||
//(used if a resource is not found in the page,
|
||||
// or application resource dictionaries)
|
||||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
||||
//(used if a resource is not found in the page,
|
||||
// app, or any theme specific resource dictionaries)
|
||||
)]
|
||||
66
src/WCTDataMiner.Wpf/MainWindow.xaml
Normal file
66
src/WCTDataMiner.Wpf/MainWindow.xaml
Normal file
@@ -0,0 +1,66 @@
|
||||
<Window x:Class="WCTDataMiner.Wpf.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:WCTDataMiner.Wpf"
|
||||
xmlns:views="clr-namespace:WCTDataMiner.Wpf.Views"
|
||||
xmlns:viewmodels="clr-namespace:WCTDataMiner.Wpf.ViewModels"
|
||||
xmlns:lvc="clr-namespace:LiveChartsCore.SkiaSharpView.WPF;assembly=LiveChartsCore.SkiaSharpView.WPF"
|
||||
mc:Ignorable="d"
|
||||
Title="WCTDataMiner - FOD 数据分析工具" Height="600" Width="900"
|
||||
WindowStartupLocation="CenterScreen">
|
||||
<Window.DataContext>
|
||||
<viewmodels:MainViewModel/>
|
||||
</Window.DataContext>
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="200"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- 左侧导航栏 -->
|
||||
<Border Grid.Column="0" Background="#F5F5F5" BorderBrush="#DDD" BorderThickness="0,0,1,0">
|
||||
<StackPanel Margin="10">
|
||||
<TextBlock Text="导航" FontSize="16" FontWeight="Bold" Margin="0,0,0,15"/>
|
||||
|
||||
<Button Content="场景列表" Command="{Binding NavigateToScenariosCommand}"
|
||||
Margin="0,5" Padding="10,5" HorizontalAlignment="Stretch"/>
|
||||
|
||||
<TextBlock Text="筛选条件" FontSize="14" FontWeight="Bold" Margin="0,20,0,10"/>
|
||||
|
||||
<TextBlock Text="TX 面板:" Margin="0,5"/>
|
||||
<ComboBox ItemsSource="{Binding TxPanels}" SelectedItem="{Binding SelectedTxPanel}"
|
||||
Margin="0,0,0,10"/>
|
||||
|
||||
<TextBlock Text="TX 硬件:" Margin="0,5"/>
|
||||
<ComboBox ItemsSource="{Binding TxHardwares}" SelectedItem="{Binding SelectedTxHardware}"
|
||||
Margin="0,0,0,10"/>
|
||||
|
||||
<TextBlock Text="TX 软件:" Margin="0,5"/>
|
||||
<ComboBox ItemsSource="{Binding TxSoftwares}" SelectedItem="{Binding SelectedTxSoftware}"
|
||||
Margin="0,0,0,10"/>
|
||||
|
||||
<TextBlock Text="RX 类型:" Margin="0,5"/>
|
||||
<ComboBox ItemsSource="{Binding RxTypes}" SelectedItem="{Binding SelectedRxType}"
|
||||
Margin="0,0,0,10"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- 右侧内容区域 -->
|
||||
<ContentControl Grid.Column="1" Content="{Binding CurrentView}">
|
||||
<ContentControl.Resources>
|
||||
<DataTemplate DataType="{x:Type viewmodels:ScenarioListViewModel}">
|
||||
<views:ScenarioListView/>
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type viewmodels:PlossChartViewModel}">
|
||||
<views:PlossChartView/>
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type viewmodels:QfodChartViewModel}">
|
||||
<views:QfodChartView/>
|
||||
</DataTemplate>
|
||||
</ContentControl.Resources>
|
||||
</ContentControl>
|
||||
</Grid>
|
||||
</Window>
|
||||
23
src/WCTDataMiner.Wpf/MainWindow.xaml.cs
Normal file
23
src/WCTDataMiner.Wpf/MainWindow.xaml.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace WCTDataMiner.Wpf;
|
||||
|
||||
/// <summary>
|
||||
/// Interaction logic for MainWindow.xaml
|
||||
/// </summary>
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
54
src/WCTDataMiner.Wpf/ViewModels/MainViewModel.cs
Normal file
54
src/WCTDataMiner.Wpf/ViewModels/MainViewModel.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
|
||||
namespace WCTDataMiner.Wpf.ViewModels;
|
||||
|
||||
/// <summary>
|
||||
/// 主窗口 ViewModel - 导航控制
|
||||
/// </summary>
|
||||
public partial class MainViewModel : ObservableObject
|
||||
{
|
||||
[ObservableProperty]
|
||||
private ObservableObject _currentView = null!;
|
||||
|
||||
[ObservableProperty]
|
||||
private string? _selectedTxPanel;
|
||||
|
||||
[ObservableProperty]
|
||||
private string? _selectedTxHardware;
|
||||
|
||||
[ObservableProperty]
|
||||
private string? _selectedTxSoftware;
|
||||
|
||||
[ObservableProperty]
|
||||
private string? _selectedRxType;
|
||||
|
||||
// 筛选选项列表
|
||||
public List<string> TxPanels { get; } = new() { "全部", "singleMold", "dualMold" };
|
||||
public List<string> TxHardwares { get; } = new() { "全部", "v1.0", "v2.0" };
|
||||
public List<string> TxSoftwares { get; } = new() { "全部", "hex2_1", "hex2_2" };
|
||||
public List<string> RxTypes { get; } = new() { "全部", "iPhone15", "iPhone16", "Android" };
|
||||
|
||||
public MainViewModel()
|
||||
{
|
||||
_currentView = new ScenarioListViewModel();
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private void NavigateToScenarios()
|
||||
{
|
||||
CurrentView = new ScenarioListViewModel();
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private void NavigateToPlossChart(int scenarioId)
|
||||
{
|
||||
CurrentView = new PlossChartViewModel { ScenarioId = scenarioId };
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private void NavigateToQfodChart(int scenarioId)
|
||||
{
|
||||
CurrentView = new QfodChartViewModel { ScenarioId = scenarioId };
|
||||
}
|
||||
}
|
||||
49
src/WCTDataMiner.Wpf/ViewModels/PlossChartViewModel.cs
Normal file
49
src/WCTDataMiner.Wpf/ViewModels/PlossChartViewModel.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using LiveChartsCore;
|
||||
using LiveChartsCore.SkiaSharpView;
|
||||
|
||||
namespace WCTDataMiner.Wpf.ViewModels;
|
||||
|
||||
/// <summary>
|
||||
/// Ploss 折线图 ViewModel
|
||||
/// </summary>
|
||||
public partial class PlossChartViewModel : ObservableObject
|
||||
{
|
||||
[ObservableProperty]
|
||||
private int _scenarioId;
|
||||
|
||||
[ObservableProperty]
|
||||
private ISeries[] _series;
|
||||
|
||||
[ObservableProperty]
|
||||
private Axis[] _xAxes;
|
||||
|
||||
[ObservableProperty]
|
||||
private Axis[] _yAxes;
|
||||
|
||||
public PlossChartViewModel()
|
||||
{
|
||||
// 初始化图表配置
|
||||
Series = Array.Empty<ISeries>();
|
||||
XAxes = new Axis[] { new Axis { Name = "Trigger Count" } };
|
||||
YAxes = new Axis[] { new Axis { Name = "Power Loss (mW)" } };
|
||||
}
|
||||
|
||||
public async Task LoadDataAsync()
|
||||
{
|
||||
// TODO: 从数据库加载 Ploss 数据并构建图表
|
||||
Series = new ISeries[]
|
||||
{
|
||||
new LineSeries<double>
|
||||
{
|
||||
Name = "Ploss",
|
||||
Values = new double[] { -2882, -3500, -4200, -3800, -4500 }
|
||||
},
|
||||
new LineSeries<double>
|
||||
{
|
||||
Name = "Threshold",
|
||||
Values = new double[] { -3000, -3000, -3000, -3000, -3000 }
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
49
src/WCTDataMiner.Wpf/ViewModels/QfodChartViewModel.cs
Normal file
49
src/WCTDataMiner.Wpf/ViewModels/QfodChartViewModel.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using LiveChartsCore;
|
||||
using LiveChartsCore.SkiaSharpView;
|
||||
|
||||
namespace WCTDataMiner.Wpf.ViewModels;
|
||||
|
||||
/// <summary>
|
||||
/// Qfod 折线图 ViewModel
|
||||
/// </summary>
|
||||
public partial class QfodChartViewModel : ObservableObject
|
||||
{
|
||||
[ObservableProperty]
|
||||
private int _scenarioId;
|
||||
|
||||
[ObservableProperty]
|
||||
private ISeries[] _series;
|
||||
|
||||
[ObservableProperty]
|
||||
private Axis[] _xAxes;
|
||||
|
||||
[ObservableProperty]
|
||||
private Axis[] _yAxes;
|
||||
|
||||
public QfodChartViewModel()
|
||||
{
|
||||
// 初始化图表配置
|
||||
Series = Array.Empty<ISeries>();
|
||||
XAxes = new Axis[] { new Axis { Name = "Coil Index" } };
|
||||
YAxes = new Axis[] { new Axis { Name = "Q Value" } };
|
||||
}
|
||||
|
||||
public async Task LoadDataAsync()
|
||||
{
|
||||
// TODO: 从数据库加载 Qfod 数据并构建图表
|
||||
Series = new ISeries[]
|
||||
{
|
||||
new LineSeries<double>
|
||||
{
|
||||
Name = "DeltaQ",
|
||||
Values = new double[] { 25, 30, 28 }
|
||||
},
|
||||
new LineSeries<double>
|
||||
{
|
||||
Name = "CurrentQ",
|
||||
Values = new double[] { 45.5, 50.2, 48.8 }
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
36
src/WCTDataMiner.Wpf/ViewModels/ScenarioListViewModel.cs
Normal file
36
src/WCTDataMiner.Wpf/ViewModels/ScenarioListViewModel.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace WCTDataMiner.Wpf.ViewModels;
|
||||
|
||||
/// <summary>
|
||||
/// 场景列表 ViewModel
|
||||
/// </summary>
|
||||
public partial class ScenarioListViewModel : ObservableObject
|
||||
{
|
||||
[ObservableProperty]
|
||||
private List<ScenarioItem> _scenarios;
|
||||
|
||||
[ObservableProperty]
|
||||
private ScenarioItem? _selectedScenario;
|
||||
|
||||
public ScenarioListViewModel()
|
||||
{
|
||||
// TODO: 从数据库加载场景列表
|
||||
_scenarios = new List<ScenarioItem>();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 场景项数据模型
|
||||
/// </summary>
|
||||
public class ScenarioItem
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string TxPanel { get; set; } = "";
|
||||
public string TxHardware { get; set; } = "";
|
||||
public string TxSoftware { get; set; } = "";
|
||||
public string RxType { get; set; } = "";
|
||||
public string TestDate { get; set; } = "";
|
||||
public int QfodCount { get; set; }
|
||||
public int PlossCount { get; set; }
|
||||
}
|
||||
28
src/WCTDataMiner.Wpf/Views/PlossChartView.xaml
Normal file
28
src/WCTDataMiner.Wpf/Views/PlossChartView.xaml
Normal file
@@ -0,0 +1,28 @@
|
||||
<UserControl x:Class="WCTDataMiner.Wpf.Views.PlossChartView"
|
||||
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:lvc="clr-namespace:LiveChartsCore.SkiaSharpView.WPF;assembly=LiveChartsCore.SkiaSharpView.WPF"
|
||||
xmlns:local="clr-namespace:WCTDataMiner.Wpf.Views"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="400" d:DesignWidth="600">
|
||||
<Grid Margin="10">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel Grid.Row="0" Orientation="Horizontal" Margin="0,0,0,10">
|
||||
<TextBlock Text="Ploss 功率损耗趋势图" FontSize="18" FontWeight="Bold"/>
|
||||
<TextBlock Text="{Binding ScenarioId, StringFormat=' - 场景 {0}'}" FontSize="18" Margin="5,0,0,0"/>
|
||||
</StackPanel>
|
||||
|
||||
<lvc:CartesianChart Grid.Row="1"
|
||||
Series="{Binding Series}"
|
||||
XAxes="{Binding XAxes}"
|
||||
YAxes="{Binding YAxes}"
|
||||
LegendPosition="Bottom"
|
||||
Background="White"/>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
18
src/WCTDataMiner.Wpf/Views/PlossChartView.xaml.cs
Normal file
18
src/WCTDataMiner.Wpf/Views/PlossChartView.xaml.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace WCTDataMiner.Wpf.Views;
|
||||
|
||||
public partial class PlossChartView : UserControl
|
||||
{
|
||||
public PlossChartView()
|
||||
{
|
||||
InitializeComponent();
|
||||
Loaded += async (s, e) =>
|
||||
{
|
||||
if (DataContext is ViewModels.PlossChartViewModel vm)
|
||||
{
|
||||
await vm.LoadDataAsync();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
28
src/WCTDataMiner.Wpf/Views/QfodChartView.xaml
Normal file
28
src/WCTDataMiner.Wpf/Views/QfodChartView.xaml
Normal file
@@ -0,0 +1,28 @@
|
||||
<UserControl x:Class="WCTDataMiner.Wpf.Views.QfodChartView"
|
||||
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:lvc="clr-namespace:LiveChartsCore.SkiaSharpView.WPF;assembly=LiveChartsCore.SkiaSharpView.WPF"
|
||||
xmlns:local="clr-namespace:WCTDataMiner.Wpf.Views"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="400" d:DesignWidth="600">
|
||||
<Grid Margin="10">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel Grid.Row="0" Orientation="Horizontal" Margin="0,0,0,10">
|
||||
<TextBlock Text="Qfod Q值变化图" FontSize="18" FontWeight="Bold"/>
|
||||
<TextBlock Text="{Binding ScenarioId, StringFormat=' - 场景 {0}'}" FontSize="18" Margin="5,0,0,0"/>
|
||||
</StackPanel>
|
||||
|
||||
<lvc:CartesianChart Grid.Row="1"
|
||||
Series="{Binding Series}"
|
||||
XAxes="{Binding XAxes}"
|
||||
YAxes="{Binding YAxes}"
|
||||
LegendPosition="Bottom"
|
||||
Background="White"/>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
18
src/WCTDataMiner.Wpf/Views/QfodChartView.xaml.cs
Normal file
18
src/WCTDataMiner.Wpf/Views/QfodChartView.xaml.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace WCTDataMiner.Wpf.Views;
|
||||
|
||||
public partial class QfodChartView : UserControl
|
||||
{
|
||||
public QfodChartView()
|
||||
{
|
||||
InitializeComponent();
|
||||
Loaded += async (s, e) =>
|
||||
{
|
||||
if (DataContext is ViewModels.QfodChartViewModel vm)
|
||||
{
|
||||
await vm.LoadDataAsync();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
46
src/WCTDataMiner.Wpf/Views/ScenarioListView.xaml
Normal file
46
src/WCTDataMiner.Wpf/Views/ScenarioListView.xaml
Normal file
@@ -0,0 +1,46 @@
|
||||
<UserControl x:Class="WCTDataMiner.Wpf.Views.ScenarioListView"
|
||||
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:WCTDataMiner.Wpf.Views"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="400" d:DesignWidth="600">
|
||||
<Grid Margin="10">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Grid.Row="0" Text="测试场景列表" FontSize="18" FontWeight="Bold" Margin="0,0,0,10"/>
|
||||
|
||||
<DataGrid Grid.Row="1" ItemsSource="{Binding Scenarios}"
|
||||
SelectedItem="{Binding SelectedScenario}"
|
||||
AutoGenerateColumns="False"
|
||||
IsReadOnly="True"
|
||||
GridLinesVisibility="Horizontal"
|
||||
AlternatingRowBackground="#F9F9F9">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="TX 面板" Binding="{Binding TxPanel}" Width="*"/>
|
||||
<DataGridTextColumn Header="TX 硬件" Binding="{Binding TxHardware}" Width="*"/>
|
||||
<DataGridTextColumn Header="TX 软件" Binding="{Binding TxSoftware}" Width="*"/>
|
||||
<DataGridTextColumn Header="RX 类型" Binding="{Binding RxType}" Width="*"/>
|
||||
<DataGridTextColumn Header="测试日期" Binding="{Binding TestDate}" Width="*"/>
|
||||
<DataGridTextColumn Header="Qfod 数量" Binding="{Binding QfodCount}" Width="80"/>
|
||||
<DataGridTextColumn Header="Ploss 数量" Binding="{Binding PlossCount}" Width="80"/>
|
||||
<DataGridTemplateColumn Header="操作" Width="150">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Button Content="Ploss图" Margin="2" Padding="5,2"
|
||||
Click="OnViewPlossChart"/>
|
||||
<Button Content="Qfod图" Margin="2" Padding="5,2"
|
||||
Click="OnViewQfodChart"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
30
src/WCTDataMiner.Wpf/Views/ScenarioListView.xaml.cs
Normal file
30
src/WCTDataMiner.Wpf/Views/ScenarioListView.xaml.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace WCTDataMiner.Wpf.Views;
|
||||
|
||||
public partial class ScenarioListView : UserControl
|
||||
{
|
||||
public ScenarioListView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void OnViewPlossChart(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// TODO: 导航到 Ploss 图表页面
|
||||
if (DataContext is ViewModels.ScenarioListViewModel vm && vm.SelectedScenario != null)
|
||||
{
|
||||
// Navigation logic
|
||||
}
|
||||
}
|
||||
|
||||
private void OnViewQfodChart(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// TODO: 导航到 Qfod 图表页面
|
||||
if (DataContext is ViewModels.ScenarioListViewModel vm && vm.SelectedScenario != null)
|
||||
{
|
||||
// Navigation logic
|
||||
}
|
||||
}
|
||||
}
|
||||
29
src/WCTDataMiner.Wpf/WCTDataMiner.Wpf.csproj
Normal file
29
src/WCTDataMiner.Wpf/WCTDataMiner.Wpf.csproj
Normal file
@@ -0,0 +1,29 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net8.0-windows</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<UseWPF>true</UseWPF>
|
||||
<LangVersion>12.0</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<!-- LiveCharts2 -->
|
||||
<PackageReference Include="LiveChartsCore" Version="2.0.0-rc2" />
|
||||
<PackageReference Include="LiveChartsCore.SkiaSharpView.WPF" Version="2.0.0-rc2" />
|
||||
|
||||
<!-- MVVM -->
|
||||
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
|
||||
|
||||
<!-- DI -->
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\WCTDataMiner.Core\WCTDataMiner.Core.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user