alielie
2026-06-04 771a0e7b6b1276087515bbe94de28358cb92963b
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
using HMI.Util;
using Panuon.WPF.UI;
using System.ComponentModel;
using System.IO;
using System.Windows;
using Util.SB;
 
namespace Plugin.BurnIn
{
    /// <summary>
    /// ManualDebugWindow.xaml 的交互逻辑
    /// </summary>
    public partial class ManualDebugWindow : WindowX
    {
 
        private ManualDebug debug;
 
        public ManualDebugWindow(string seqPath, string modelPath)
        {
            DataContext = this;
            InitializeComponent();
            debug = (ManualDebug)sb.Children[0];
            ReadBtns();
            //List<BtnConfig> settings = new List<BtnConfig> { new BtnConfig { Title = "上电激活", Name = "Active" } };
            debug.seqPath = seqPath;
            debug.modelPath = modelPath;
        }
 
        private string ovenName;
        public string OvenName
        {
            get => ovenName;
            set
            {
                Set(ref ovenName, value);
            }
        }
 
        private string cellName;
        public string CellName
        {
            get => cellName;
            set
            {
                Set(ref cellName, value);
            }
        }
 
        private int ovenIndex;
        public int OvenIndex
        {
            get => ovenIndex;
            set
            {
                Set(ref ovenIndex, value);
            }
        }
 
        private int cellIndex;
        public int CellIndex
        {
            get => cellIndex;
            set
            {
                Set(ref cellIndex, value);
            }
        }
 
        private void ReadBtns()
        {
            string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Settings.ini");
            var map = IniFileHelper.GetKeyValuesBySection(path, "Btns");
            List<BtnConfig> settings = new List<BtnConfig>();
            foreach (var kv in map)
            {
                settings.Add(new BtnConfig { Title = kv.Key, Name = kv.Value });
            }
            debug.RefreshButtons(settings);
        }
 
        private void Window_Closing(object sender, CancelEventArgs e)
        {
            if (MessageBox.Show("确定要关闭吗?", "提示", MessageBoxButton.OKCancel) == MessageBoxResult.OK)
            {
                debug.Stop();
            }
            else
            {
                e.Cancel = true;
            }
        }
    }
}