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
|
<krpano
debugmode="true" onstart="arranque();">
<preview type="grid(cube,128,128,512,0xCCCCCC,0xF6F6F6,0x999999);" />
<events onkeydown="keydown()"/>
<layer name="help"
type="text"
css="text-align:left; font-size:24px;"
align="centertop"
html="
Press key 1: To Play the count[br]
Press key 2: To Pause the count[br]
Press key 3: To Restart the count[br]
Press key 4: To Compare the current count with:[br]
0 , 2 , 3 , 7 , 9 and 10
"
/>
<action name="arranque">
set(videotime,0);
</action>
<action name="keydown">
<!-- key 1: -->
if(keycode == 49,
showlog();
trace('PLAY the count...');
incrementa_auto();
);
<!-- key 2: -->
if(keycode == 50,
trace('PAUSE the count...');
parar();
);
<!-- key 3: -->
if(keycode == 51,
trace('RESTART the count...');
set(videotime,0);
incrementa_auto();
);
<!-- key 4: -->
if(keycode == 52,
trace('CHECKING the array...');
for5();
);
</action>
<tiempos
name="ruta1"
t0="0" t1="2" t2="3" t3="7" t4="9" t5="10"
/>
<action name="incrementa">
inc(videotime);
trace(get(videotime));
</action>
<action name="incrementa_auto">
delayedcall(conteo,1.0, incrementa();incrementa_auto(); );
</action>
<action name="parar">
stopdelayedcall(conteo);
</action>
<action name="for5" >
for(set(i,0),i LT 5,inc(i),
copy(t1, i);
calc(t2, t1+1);
if(videotime GE calc('tiempos[ruta1].t'+t1) AND videotime LE calc('tiempos[ruta1].t'+t2),
trace('The Count:',videotime,' is greater or equal than ',calc('tiempos[ruta1].t'+t1),' and lower or equal than ',calc('tiempos[ruta1].t'+t2));
parar();,
trace('The Count:',videotime,' is NOT greater or equal than ',calc('tiempos[ruta1].t'+t1),' and is NOT lower or equal than ',calc('tiempos[ruta1].t'+t2));
parar();
);
);
</action>
</krpano>
|