feat: 重构项目结构,添加 WPF 应用
- 将核心功能提取到 WCTDataMiner.Core 类库 - 添加 WCTDataMiner.Wpf 桌面应用 - 支持数据解析、导出、统计等功能 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
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 }
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user