2026-06-30 12:10:29 +08:00
|
|
|
|
using CommunityToolkit.Mvvm.ComponentModel;
|
|
|
|
|
|
using SSPCTester.Logic.Models;
|
|
|
|
|
|
|
|
|
|
|
|
namespace SSPCTester.UI.ViewModels;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>测试主界面(TabControl 容器)。</summary>
|
|
|
|
|
|
public partial class TestHostViewModel : ObservableObject
|
|
|
|
|
|
{
|
|
|
|
|
|
[ObservableProperty] private Project? _project;
|
|
|
|
|
|
[ObservableProperty] private TestSessionViewModel? _session;
|
|
|
|
|
|
|
|
|
|
|
|
public BasicTestViewModel Basic { get; }
|
|
|
|
|
|
public CurveTestViewModel Curve { get; }
|
|
|
|
|
|
public PowerTestViewModel Power { get; }
|
|
|
|
|
|
public ProtectViewModel Protect { get; }
|
|
|
|
|
|
|
|
|
|
|
|
public TestHostViewModel(BasicTestViewModel basic, CurveTestViewModel curve, PowerTestViewModel power, ProtectViewModel protect)
|
|
|
|
|
|
{
|
|
|
|
|
|
Basic = basic; Curve = curve; Power = power; Protect = protect;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void SetProject(Project p)
|
|
|
|
|
|
{
|
|
|
|
|
|
Project = p;
|
|
|
|
|
|
Basic.SetProject(p);
|
|
|
|
|
|
Curve.SetProject(p);
|
|
|
|
|
|
Power.SetProject(p);
|
|
|
|
|
|
Protect.SetProject(p);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void AttachSession(TestSessionViewModel s)
|
|
|
|
|
|
{
|
|
|
|
|
|
Session = s;
|
|
|
|
|
|
Curve.AttachSession(s);
|
2026-07-02 21:38:25 +08:00
|
|
|
|
Protect.AttachSession(s);
|
2026-06-30 12:10:29 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|