alielie
2026-09-10 f3889f2d36c50cf99468594854def9b7ed069fb5
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
using OpenTap;
using OpenTap.Addin;
using OpenTap.Addin.Annotation;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Xml.Serialization;
 
namespace AddInPlugin.Setting
{
    public enum ReportType
    {
        TXT = 0,
        HTML = 1
    }
    public class LangInfo
    {
        public LangInfo(string code, string name)
        {
            Code = code;
            Name = name;
        }
 
        public string Code { get; private set; }
        public string Name { get; private set; }
    }
 
    [Display("Station", "Station Settings")]
    public class StationSettings : ComponentSettings<StationSettings>
    {
        [Display("字体大小", Group: "General", Order: 1)]
        public double FontSize { get; set; } = 14;
 
 
        [Display("报告类型", Group: "General", Order: 2)]
        public ReportType ReportType { get; set; } = ReportType.HTML;
 
        /// <summary>
        /// Where the session logs are saved. Must be a valid path.
        /// </summary>
        [Display("报告路径", Group: "General", Order: 3, Description: "存放报告")]
        [FilePath(FilePathAttribute.BehaviorChoice.Save, IsFolder: true)]
        public string ReportPath { get; set; } = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Report");
 
        [Display("语言", Group: "General", Order: 3, Description: "系统语言")]
        [DynamicSelect("LangSource", "Name", "Code")]
        public string Lang { get; set; } = "zh-CN";
 
        [XmlIgnore]
        public ObservableCollection<LangInfo> LangSource { get; set; } = new ObservableCollection<LangInfo>() {
            new LangInfo("zh-CN","中文"),
            new LangInfo("en-US","English")
        };
 
        // public ObservableCollection<L>
 
        [Display("123", Group: "General", Order: 3, Description: "存放报告")]
 
        public ObservableCollection<TestVariable> StationGlobals = new ObservableCollection<TestVariable>() {
            new TestVariable() { Name = "StationGlobal1", Value = "Value1" },
        };
    }
}