천호석
2022-11-21 14f07cdcb29fbae3cc55e217201c9cbfdd99e4d8
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
using System;
 
namespace SHARP_CLAS_UI
{
    public class Alarm
    {
        public En_Alarm_List Code { get; set; }
 
        public string Description { get; set; }
 
        public bool Heavy { get; set; }
 
        public bool Light { get; set; }
 
        public bool Use { get; set; }
 
        public Alarm()
        {
            this.Heavy = true;
            this.Light = false;
            this.Description = string.Empty;
            this.Use = true;
        }
 
        public Alarm(En_Alarm_List Code)
        {
            this.Code = Code;
            this.Heavy = true;
            this.Light = false;
            this.Description = string.Empty;
            this.Use = true;
        }
 
        public void Set_Heavy(string level)
        {
            switch(level.ToUpper())
            {
                case "TRUE":
                    {
                        Heavy = true;
                        Light = false;
                        break;
                    }
                case "FALSE":
                    {
                        Heavy = false;
                        Light = true;
                        break;
                    }
                default:
                    {
                        Heavy = true;
                        Light = false;
                        break;
                    }
            }
        }
 
        public void Set_Heavy(bool check)
        {
            this.Heavy = check;
            this.Light = !check;
        }
 
        public void Set_Light(bool check)
        {
            this.Light = check;
            this.Heavy = !check;
        }
 
        public void Set_Use(string use)
        {
            switch(use.ToUpper())
            {
                case "TRUE":
                    {
                        Use = true;
                        break;
                    }
                case "FALSE":
                    {
                        Use = false;
                        break;
                    }
                default:
                    {
                        Use = true;
                        break;
                    }
            }
        }
 
        public void Set_Use(bool check)
        {
            this.Use = check;
        }
 
        public void Set_Discription(string description)
        {
            Description = description;
        }
 
        public Alarm Clone()
        {
            Alarm alarm = new Alarm();
 
            alarm.Code = this.Code;
            alarm.Heavy = this.Heavy;
            alarm.Light = this.Light;
            alarm.Description = this.Description;
            alarm.Use = this.Use;
 
            return alarm;
        }
 
        public bool Equal(Alarm alarm)
        {
            if (alarm == null) return false;
            
            bool check = true;
 
            check &= alarm.Code == this.Code;
            check &= alarm.Heavy == this.Heavy;
            check &= alarm.Light == this.Light;
            check &= alarm.Description == this.Description;
            check &= alarm.Use == this.Use;
 
            return check;
        }
    }
}