chr
2026-04-08 53e656200368a983e563550e2cc1acbc6d86b729
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using CommunityToolkit.Mvvm.ComponentModel;
using OpenTap;
using OpenTap.Addin;
using System.Collections.ObjectModel;
using System.Windows;
 
namespace OpenTapEditor
{
    /// <summary>
    /// VariableSelector.xaml 的交互逻辑
    /// </summary>
    [ObservableObject]
    public partial class VariableSelector : Window
    {
        [ObservableProperty]
        private string result;
 
        [ObservableProperty]
        private ObservableCollection<TestVariable> variables;
 
        public VariableSelector()
        {
            DataContext = this;
            Variables = new ObservableCollection<TestVariable>() {
                new TestVariable(){
                    Name = "Locals",
                    Type = TestVariableType.Container
                },
                new TestVariable(){
                    Name = "FileGlobals",
                    Type = TestVariableType.Container
                },
                new TestVariable(){
                    Name = "StationGlobals",
                    Type = TestVariableType.Container,
                    Children = UIStationGlobalsManager.Instance.Datasource
                },
            };
            InitializeComponent();
        }
 
        public bool? Open(TestPlan plan, TestStepList seq)
        {
            Variables[0].Children = seq.Variables;
            Variables[1].Children = plan.Variables;
            return this.ShowDialog();
        }
 
    }
}