summaryrefslogtreecommitdiffstats
path: root/Kod/scripts/display_graphs.m
blob: a6e8f1c57c238c13c278f69b302ccf9a61a1d2b2 (plain) (blame)
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
addpath display/ClientServerApp/Release
cd display/ClientServerApp/Release
!startServer
cd ../../..

pause(1);

display = struct;
display.data = [];
display.out = 0;
display.shm = 0;
display.shm_interp = struct;
display.shm_interp.ack = 0;
display.shm_interp.start_code = '';
display.shm_interp.data = [];
display.last_send = tic;
display.send_interval = 0.5;

graphs = struct;
graphs.car1 = struct;
graphs.car2 = struct;
graphs.car1.lap_times = [];  % Nx1
graphs.car1.lap_deviation = std(graphs.car1.lap_times);
graphs.car1.seg_times = [];  % 9xM
graphs.car2.lap_times = [];  % Nx1
graphs.car2.lap_deviation = std(graphs.car2.lap_times);
graphs.car2.seg_times = [];  % 9xM
graphs.laps = max(length(graphs.car1.lap_times), length(graphs.car2.lap_times));

disp('Drawing frame');
% input('');
matlabclient(1, get_smallpackage([ ...
	line(32, 32, 32, 192), ...   % y-axis
	continue_line(298, 192), ... % x-axis
	line(28, 40, 32, 32), ...    % arrow on y
	continue_line(36, 40), ...   % arrow on y
	line(298, 188, 298, 196) ... % line on x
]));
pause(0.2);

disp('Drawing additional frames');
% input('');
matlabclient(1, get_smallpackage([ ...
	line(190, 0, 190, 70), ...
	continue_line(320, 70) ...
]));
pause(0.2);

disp('Putting text');
% input('');
matlabclient(1, get_smallpackage([
	text(304, 10, 'R', 'std: 0.15s'), ...
	text(304, 30, 'R', 'mean: 12.4s'), ...
	text(304, 50, 'R', 'target: 12.5s') ...
]));
pause(0.2);

disp('Drawing buttons');
% input('');
matlabclient(1, get_smallpackage([ ...
	key(0  , 216, 107, 240, 51, 61, 'C', 'Knapp 1'), ...
	key(107, 216, 213, 240, 52, 62, 'C', 'Knapp 2'), ...
	key(213, 216, 320, 240, 53, 63, 'C', 'Knapp 3') ...
]))
pause(0.2);

disp('');
% input('');
matlabclient(3);