summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGustav Sörnäs <gusso230@student.liu.se>2019-11-20 18:13:27 +0100
committerGustav Sörnäs <gusso230@student.liu.se>2019-11-20 18:13:27 +0100
commit7ac5ec97bb9278f6e4c1fdd0d5bebc4bc49150a4 (patch)
tree5cf0edaa4b6ccb9b0ab690ddaf8bde0db59890bd
parent76e3773693e00ff69d5c6385f0301b9a0cb962b9 (diff)
downloadtfyy51-7ac5ec97bb9278f6e4c1fdd0d5bebc4bc49150a4.tar.gz
Add script to showcase bars
-rw-r--r--Kod/scripts/display_bars.m63
1 files changed, 63 insertions, 0 deletions
diff --git a/Kod/scripts/display_bars.m b/Kod/scripts/display_bars.m
new file mode 100644
index 0000000..2f3fbe8
--- /dev/null
+++ b/Kod/scripts/display_bars.m
@@ -0,0 +1,63 @@
+addpath display/ClientServerApp/Release
+cd display/ClientServerApp/Release
+!startServer
+cd ../../..
+
+pause(1);
+
+% values1 = [1 1 2 3 4 5 6 7 8];
+values1 = [];
+values2 = [1 1.5 2 2.5 3 3.5 4 4.5 5];
+
+matlabclient(1, get_smallpackage(put_text(160, 8, 'C', 'Genomsnittlig tid per segment')))
+pause(0.2);
+
+% input('');
+matlabclient(1, get_smallpackage([ ...
+ toggle(0 , 216, 107, 240, 51, 61, 'C', 'Varv'), ...
+ toggle(107, 216, 213, 240, 52, 62, 'C', 'Segment'), ...
+ toggle(213, 216, 320, 240, 53, 63, 'C', 'Knapp 3'), ...
+ get_package('AP', [52 1]) ...
+]));
+pause(0.2);
+
+matlabclient(1, get_smallpackage([ ...
+ draw_line(20, 24, 20, 200), ... % y-axis
+ continue_line(304, 200), ... % x-axis
+ draw_line(16, 32, 20, 24), ... % arrow on y, left part
+ continue_line(24, 32), ... % arrow on y, right part
+ draw_line(304, 196, 304, 204) ... % line on x
+]));
+pause(0.2);
+
+[bars, max_val, min_y, max_height] = get_bars_from_values(values1, values2);
+
+for bar = bars
+ matlabclient(1, get_smallpackage(fill_area(bar.x_lo, bar.y_lo, bar.x_hi, bar.y_hi)));
+ pause(0.2);
+end
+
+matlabclient(1, get_smallpackage(put_text(9, 25, 'C', 's')));
+pause(0.2);
+
+% matlabclient(1, get_smallpackage(set_line_pattern(2)))
+% pause(0.2);
+for i = 1:floor(max_val)
+ x = 20;
+ y = 200 - round(max_height * (i/max_val));
+ matlabclient(1, get_smallpackage([draw_line(x, y, 300, y), ...
+ put_text(x-6, y-2, 'C', num2str(i))]))
+ pause(0.2);
+end
+% matlabclient(1, get_smallpackage(set_line_pattern(1)))
+% pause(0.2);
+
+for i = 0:8
+ x = 16+13 + 10 + 30*i;
+ matlabclient(1, get_smallpackage(put_text(x, 204, 'C', num2str(i + 1))));
+ pause(0.2);
+end
+
+pause(0.8);
+
+matlabclient(3) \ No newline at end of file