alielie
2025-06-12 c1c3772a11b1f3fbad8846cc714120771d85fa53
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
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Globalization;
using System.Windows.Data;
 
namespace Plugin.TestResult_WPF.Constant
{
    public class CommonStatus
    {
        public static readonly string OK = "ok";
        public static readonly string NG = "ng";
        public static readonly string WAITING = "waiting";
        public static readonly string CHECKINFAILED = "checkInFailed";
        public static readonly string CHECK_IN = "checkIn";
        public static readonly string TESTING = "testing";
        public static readonly string ALERT = "alert";
        public static readonly string READY = "ready";
 
        private static string[] cache = new string[] { "ok", "ng", "waiting", "checkInFailed", "checkIn", "testing", "alert", "ready" };
 
        public static readonly Dictionary<string, string> STATUS_MAP = new Dictionary<string, string>() {
            { "ok","正常"},
            { "ng","异常"},
            { "waiting","等待中"},
            { "checkInFailed","CheckIn失败"},
            { "checkIn","CheckIn"},
            { "testing","测试中"},
            { "alert","报警"},
            { "ready","准备就绪"},
        };
 
        public static readonly Dictionary<string, SolidBrush> COLOR_MAP = new Dictionary<string, SolidBrush>() {
            { "ok",new SolidBrush(Color.FromArgb(0,0,0,0))},
            { "ng",new SolidBrush(Color.FromArgb(0,0,0,0))},
            { "waiting",new SolidBrush(Color.FromArgb(0,0,0,0))},
            { "testing",new SolidBrush(Color.FromArgb(0,0,0,0))},
            { "checkInFailed",new SolidBrush(Color.FromArgb(0,0,0,0))},
            { "checkIn",new SolidBrush(Color.FromArgb(0,0,0,0))},
        };
 
        public static string GetRandomStatus()
        {
            return cache[new Random().Next(cache.Length)];
        }
 
        public static string GetStatusDescription(string status)
        {
            if (STATUS_MAP.ContainsKey(status)) return STATUS_MAP[status];
            return "";
        }
    }
 
    public class StatusColorConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value is string status)
            {
 
            }
            return null;
        }
 
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}