diff options
| author | Gustav Sörnäs <gusso230@student.liu.se> | 2019-11-14 22:49:32 +0100 |
|---|---|---|
| committer | Gustav Sörnäs <gusso230@student.liu.se> | 2019-11-15 08:14:23 +0100 |
| commit | c99ec1964c71f4a1e69874498e4f91be99755ec4 (patch) | |
| tree | 4cce31df9d28b6bc2bc90903400eb566bde1bfea /Kod | |
| parent | 0108fb74ef6cf2dedc1043bee939aaa9c9ecc2ac (diff) | |
| download | tfyy51-c99ec1964c71f4a1e69874498e4f91be99755ec4.tar.gz | |
Add bar graph functions
Diffstat (limited to 'Kod')
| -rw-r--r-- | Kod/bilbana/yc4/display/define_bar_graph.m | 18 | ||||
| -rw-r--r-- | Kod/bilbana/yc4/display/delete_bar_graph.m | 7 | ||||
| -rw-r--r-- | Kod/bilbana/yc4/display/redraw_bar_graph.m | 3 | ||||
| -rw-r--r-- | Kod/bilbana/yc4/display/request_bar_graph_value.m | 3 | ||||
| -rw-r--r-- | Kod/bilbana/yc4/display/update_bar_graph.m | 3 |
5 files changed, 34 insertions, 0 deletions
diff --git a/Kod/bilbana/yc4/display/define_bar_graph.m b/Kod/bilbana/yc4/display/define_bar_graph.m new file mode 100644 index 0000000..c9a5999 --- /dev/null +++ b/Kod/bilbana/yc4/display/define_bar_graph.m @@ -0,0 +1,18 @@ +function pkg = define_bar_graph(direction, no, x1, y1, x2, y2, start_value, end_value, type, pattern) +pkg = [] +if direction == 'left' + direction = 'L' +elseif direction == 'right' + direction = 'R' +elseif direction == 'up' + direction == 'O' +elseif direction == 'down' + direction = 'U' +else + return + +args = [no, get_bytes(x1), get_bytes(y1), get_bytes(x2), get_bytes(y2)] +args = [args, start_value, end_value, type, pattern] %TODO get_bytes or no ? + +pkg = get_package(strjoin({'B', direction}, ''), args) +end diff --git a/Kod/bilbana/yc4/display/delete_bar_graph.m b/Kod/bilbana/yc4/display/delete_bar_graph.m new file mode 100644 index 0000000..093cb2b --- /dev/null +++ b/Kod/bilbana/yc4/display/delete_bar_graph.m @@ -0,0 +1,7 @@ +function pkg = define_bar_graph(num, keep_visible) +if keep_visible + keep_visible = 1 +else + keep_visible = 0 +pkg = get_package('BD', [num, keep_visible]) +end diff --git a/Kod/bilbana/yc4/display/redraw_bar_graph.m b/Kod/bilbana/yc4/display/redraw_bar_graph.m new file mode 100644 index 0000000..5541dff --- /dev/null +++ b/Kod/bilbana/yc4/display/redraw_bar_graph.m @@ -0,0 +1,3 @@ +function pkg = redraw_bar_graph(num) +pkg = get_package('BZ', [num]) +end diff --git a/Kod/bilbana/yc4/display/request_bar_graph_value.m b/Kod/bilbana/yc4/display/request_bar_graph_value.m new file mode 100644 index 0000000..d3cad11 --- /dev/null +++ b/Kod/bilbana/yc4/display/request_bar_graph_value.m @@ -0,0 +1,3 @@ +function pkg = request_bar_graph_value(num) +pkg = get_package('BS', [num]) +end diff --git a/Kod/bilbana/yc4/display/update_bar_graph.m b/Kod/bilbana/yc4/display/update_bar_graph.m new file mode 100644 index 0000000..ffca923 --- /dev/null +++ b/Kod/bilbana/yc4/display/update_bar_graph.m @@ -0,0 +1,3 @@ +function pkg = update_bar_graph(num, val) +pkg = get_package('BA', [num, val]) +end |
