summaryrefslogtreecommitdiffstats
path: root/Kod/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'Kod/scripts')
-rw-r--r--Kod/scripts/display_post_race_graphs.m36
1 files changed, 19 insertions, 17 deletions
diff --git a/Kod/scripts/display_post_race_graphs.m b/Kod/scripts/display_post_race_graphs.m
index 58145ee..4db9ffb 100644
--- a/Kod/scripts/display_post_race_graphs.m
+++ b/Kod/scripts/display_post_race_graphs.m
@@ -6,9 +6,9 @@ cd ../../..
pause(1);
matlabclient(1, get_smallpackage([ ...
- key(0 , 216, 107, 240, 51, 61, 'C', 'Varv'), ...
- key(107, 216, 213, 240, 52, 62, 'C', 'Segment'), ...
- key(213, 216, 320, 240, 53, 63, 'C', 'Avsluta') ...
+ key(0 , 216, 107, 240, 51, 61, 'C', 'Varv'), ...
+ key(107, 216, 213, 240, 52, 62, 'C', 'Segment'), ...
+ key(213, 216, 320, 240, 53, 63, 'C', 'Avsluta') ...
]));
pause(0.2);
@@ -18,8 +18,8 @@ done = false;
while 1
pause(0.1);
if toc(display.last_check) > 0.4
- display.last_check = tic;
-
+ display.last_check = tic;
+
% read internal mem from last send
[display.out, display.shm] = matlabclient(2);
[display.shm_interp.ack, display.shm_interp.start_code, display.shm_interp.data] = get_response(display.shm);
@@ -27,22 +27,24 @@ while 1
% request internal mem
matlabclient(1, hex2dec(['12'; '01'; '53'; '66']));
if isempty(display.shm_interp.data)
- continue
+ continue;
end
update_ref_time = false;
for i = 1:length(display.shm_interp.data)
disp(num2str(length(display.shm_interp.data)))
data = display.shm_interp.data(i);
- if data.data == 51
- draw_lap_graph([13 13 13.2 13.1 13 12.9 12.75], [], 13);
- elseif data.data == 52
- draw_segment_bars([1 2 3 4 5 6 7 8 9], []);
- elseif data.data == 53
- pause(0.2);
- matlabclient(1, get_smallpackage(clear_display()));
- pause(0.2);
- done = true;
- end
+ if data.data == 51
+ draw_lap_graph([13 13 13.2 13.1 13 12.9 12.75], [], 13, false);
+ elseif data.data == 52
+ draw_segment_bars([1 2 3 4 5 6 7 8 9], []);
+ elseif data.data == 53
+ pause(0.2);
+ matlabclient(1, get_smallpackage(clear_display()));
+ pause(0.2);
+ done = true;
+ elseif data.data == 70
+ draw_lap_graph([13 13 13.2 13.1 13 12.9 12.75], [], 13, true);
+ end
end
if done == true
break
@@ -55,4 +57,4 @@ while 1
end
end
-matlabclient(3); \ No newline at end of file
+matlabclient(3);