-
Notifications
You must be signed in to change notification settings - Fork 0
/
phoseonfe300.cpp
77 lines (62 loc) · 1.89 KB
/
phoseonfe300.cpp
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
#include "phoseonfe300.h"
#include <QDebug>
/*
* from the data sheet
mm %
0 100
2 75
4 62
6 50
8 42
10 36
12 30
14 27
16 25
18 23
20 22
* */
#define LINES 12
#define X (77.1f)
#define Y (29.0f)
#define Z (122.0f)
#define EMITTING_X (70.0f)
#define EMITTING_Y (10.0f)
#define LED_COUNT (25)
#define WATT_PER_CM_QUBIC (5.0f)
PhoseonFE300::PhoseonFE300() :
vertices(LINES * 2)
{
//TODO remove LINES, and just add 'push_back()'
size_t i = 0;
vertices[i++] = glm::vec3(-X / 2, +Y / 2, 0);
vertices[i++] = glm::vec3(-X / 2, -Y / 2, 0);
vertices[i++] = glm::vec3(+X / 2, +Y / 2, 0);
vertices[i++] = glm::vec3(+X / 2, -Y / 2, 0);
vertices[i++] = glm::vec3(-X / 2, -Y / 2, 0);
vertices[i++] = glm::vec3(+X / 2, -Y / 2, 0);
vertices[i++] = glm::vec3(-X / 2, +Y / 2, 0);
vertices[i++] = glm::vec3(+X / 2, +Y / 2, 0);
vertices[i++] = glm::vec3(-X / 2, +Y / 2, Z);
vertices[i++] = glm::vec3(-X / 2, -Y / 2, Z);
vertices[i++] = glm::vec3(+X / 2, +Y / 2, Z);
vertices[i++] = glm::vec3(+X / 2, -Y / 2, Z);
vertices[i++] = glm::vec3(-X / 2, -Y / 2, Z);
vertices[i++] = glm::vec3(+X / 2, -Y / 2, Z);
vertices[i++] = glm::vec3(-X / 2, +Y / 2, Z);
vertices[i++] = glm::vec3(+X / 2, +Y / 2, Z);
vertices[i++] = glm::vec3(-X / 2, -Y / 2, 0);
vertices[i++] = glm::vec3(-X / 2, -Y / 2, Z);
vertices[i++] = glm::vec3(-X / 2, +Y / 2, 0);
vertices[i++] = glm::vec3(-X / 2, +Y / 2, Z);
vertices[i++] = glm::vec3(+X / 2, -Y / 2, 0);
vertices[i++] = glm::vec3(+X / 2, -Y / 2, Z);
vertices[i++] = glm::vec3(+X / 2, +Y / 2, 0);
vertices[i++] = glm::vec3(+X / 2, +Y / 2, Z);
for (i = 0; i < LED_COUNT; i++) {
glm::vec3 p;
p.x = (i+1) * EMITTING_X / (LED_COUNT+1) - EMITTING_X / 2;
p.y = 0;
p.z = 0;
leds.push_back(p);
}
}