-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathHeadsetStatus.cs
156 lines (151 loc) · 5.05 KB
/
HeadsetStatus.cs
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
using System;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;
using EmotivTetris.Properties;
using Emotiv;
namespace EmotivTetris
{
public partial class HeadsetStatus : Form
{
public HeadsetStatus()
{
InitializeComponent();
sensorAf3Fp1.Parent =
sensorO2.Parent =
sensorO1.Parent =
sensorP8.Parent =
sensorP7.Parent =
sensorF8.Parent =
sensorF7.Parent =
sensorAf4Fp2.Parent =
sensorAf3Fp1.Parent =
sensorF4.Parent =
sensorF3.Parent =
sensorFc6.Parent =
sensorFc5.Parent =
sensorT7.Parent =
sensorT8.Parent =
sensorDrlP4.Parent =
sensorCmsP3.Parent = headImage;
}
private void Sensors_FormClosing(object sender, FormClosingEventArgs e)
{
e.Cancel = true;
Hide();
}
public void SetSignalStrength(EdkDll.IEE_SignalStrength_t val)
{
switch (val)
{
case EdkDll.IEE_SignalStrength_t.NO_SIG:
signalStrength.Image = Resources.sensorBlack30;
break;
case EdkDll.IEE_SignalStrength_t.BAD_SIG:
signalStrength.Image = Resources.sensorRed30;
break;
default:
signalStrength.Image = Resources.sensorGreen30;
break;
}
}
public void SetBatteryLevel(int val)
{
switch (val)
{
case 0:
batteryLevel.Image = Resources.sensorBlack30;
break;
case 1:
batteryLevel.Image = Resources.sensorRed30;
break;
case 2:
case 3:
batteryLevel.Image = Resources.sensorYellow30;
break;
case 4:
case 5:
batteryLevel.Image = Resources.sensorGreen30;
break;
default:
batteryLevel.Image = Resources.sensorEarBlack30;
break;
}
}
public void SetSensor(string sensorName, int val)
{
Image statusLight;
bool earSensor = "CMS,P3,DRL,P4".Split(',').Contains(sensorName);
switch (val)
{
case 0:
statusLight = earSensor ? Resources.sensorEarBlack30 : Resources.sensorBlack30;
break;
case 1:
statusLight = earSensor ? Resources.sensorEarRed30 : Resources.sensorRed30;
break;
case 2:
statusLight = earSensor ? Resources.sensorEarYellow30 : Resources.sensorYellow30;
break;
default:
statusLight = earSensor ? Resources.sensorEarGreen30 : Resources.sensorGreen30;
break;
}
switch (sensorName)
{
case "AF3":
case "FP1":
sensorAf3Fp1.Image = statusLight;
break;
case "AF4":
case "FP2":
sensorAf4Fp2.Image = statusLight;
break;
case "CMS":
case "P3":
sensorCmsP3.Image = statusLight;
break;
case "DRL":
case "P4":
sensorDrlP4.Image = statusLight;
break;
case "F3":
sensorF3.Image = statusLight;
break;
case "F4":
sensorF4.Image = statusLight;
break;
case "F7":
sensorF7.Image = statusLight;
break;
case "F8":
sensorF8.Image = statusLight;
break;
case "FC5":
sensorFc5.Image = statusLight;
break;
case "FC6":
sensorFc6.Image = statusLight;
break;
case "O1":
sensorO1.Image = statusLight;
break;
case "O2":
sensorO2.Image = statusLight;
break;
case "P7":
sensorP7.Image = statusLight;
break;
case "P8":
sensorP8.Image = statusLight;
break;
case "T7":
sensorT7.Image = statusLight;
break;
case "T8":
sensorT8.Image = statusLight;
break;
}
}
}
}