-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.einstein
More file actions
executable file
·53 lines (40 loc) · 1.78 KB
/
script.einstein
File metadata and controls
executable file
·53 lines (40 loc) · 1.78 KB
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
<% NOW 10000000 %> '10_last_seconds' STORE
<% NOW -1 %> '1_last_points' STORE
'PkCdFG34fsfJ2S0dYLvhR5DQWFVgqSSk1zO..X3l4Pz5rjmVO.7sQe09NSzJn55DSNSH6gjxiO2hH5SFzfePDakLJX9kXju9tZ5DPE9kMjq_uZbb6w1o35m_XgTU6eIcW_QOjYYGfOc'
'~org.startupweekend.brest.punchingball.userId'
0 ->MAP
@1_last_points
FETCH
// On a deux punchs ici, non anonymes, il suffit de voir qu'il y a deux valeurs sur org.startupweekend.brest.punchingball.userId
// On va garder le premier et on va faire 10 secondes plus tard (en sachant que la vidéo ne fera que 6)
'gts_userId' STORE
$gts_userId TICKS 0 GET // Timestamp du premier scan de badge dans l'intervale
'timestamp' STORE
'PkCdFG34fsfJ2S0dYLvhR5DQWFVgqSSk1zO..X3l4Pz5rjmVO.7sQe09NSzJn55DSNSH6gjxiO2hH5SFzfePDakLJX9kXju9tZ5DPE9kMjq_uZbb6w1o35m_XgTU6eIcW_QOjYYGfOc'
'~org.startupweekend.brest.punchingball.videoUrl'
0 ->MAP
$timestamp 1
FETCH
0 GET 'gts_videoId' STORE
'PkCdFG34fsfJ2S0dYLvhR5DQWFVgqSSk1zO..X3l4Pz5rjmVO.7sQe09NSzJn55DSNSH6gjxiO2hH5SFzfePDakLJX9kXju9tZ5DPE9kMjq_uZbb6w1o35m_XgTU6eIcW_QOjYYGfOc'
'~org.startupweekend.brest.punchingball.acc'
0 ->MAP
$timestamp 10000000 + // Plus 10 secondes
10000000
FETCH
0 GET 'gts_acc' STORE
// Et voilà toutes les informations néccesaires...
$gts_acc $gts_userId $gts_videoId 3 ->LIST
// MACROMAPPER to transform everything to DOUBLE
// In theory not neccesary... but sometimes Arduino sends bad data
<%
'_list' STORE // We begin by storing the list
$_list 0 GET // We get the tick
NaN NaN NaN // We add NaN for positions and elevation
$_list 7 GET 0 GET TODOUBLE
%> 'to_double' STORE
$gts_acc $to_double MACROMAPPER 0 0 0 5 ->LIST MAP
0.0 INTEGRATE // Let's integrate
//0 GET VALUES 'integrated' STORE
// Let's take the last value
//$integrated $integrated SIZE 1 - GET