text
stringlengths
0
234
---------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------
procedure clear_protocoll(X_Start, Y_Start: in Integer; Which_Protocoll_Or_Both: in Integer) is
x : Integer := X_Start;
y : Integer := Y_Start;
widthcol1 : constant Integer := 13;
widthcol2 : constant Integer := 5;
begin
if Which_Protocoll_Or_Both = 0 or Which_Protocoll_Or_Both = 1 then
For I in 1..19 loop
Goto_XY(X_Start + 2 + widthcol1, Y_Start - 1 + I * 2);
case I is
when 1 => Set_Text_Modes(Off, Off, On);
when 2..7 => Put(" ");
when 8 => null;
when 9 => null;
when 10..18 => Put(" ");
when 19 => null;
when others => null;
end case;
end loop;
end if;
if Which_Protocoll_Or_Both = 0 or Which_Protocoll_Or_Both = 2 then
For I in 1..19 loop
Goto_XY(X_Start + 3 + widthcol1 + widthcol2, Y_Start - 1 + I * 2);
case I is
when 1 => Set_Text_Modes(Off, Off, On);
when 2..7 => Put(" ");
when 8 => null;
when 9 => null;
when 10..18 => Put(" ");
when 19 => null;
when others => null;
end case;
end loop;
end if;
end clear_protocoll;
procedure update_protocoll(X_Start, Y_Start: in Integer; prot1, prot2: in Protocoll_Type; Which_Protocoll_Or_Both: in Integer; Other_Color: in Integer) is
x : Integer := X_Start;
y : Integer := Y_Start;
widthcol1 : constant Integer := 13;
widthcol2 : constant Integer := 5;
widthcol3 : constant Integer := 5;
height: constant Integer := 39;
text_width: constant Integer := 12;
points_width: constant Integer := 5;
avail_place_text_color1: String := "[38;5;208m";
temp1, temp2 : Protocoll_Type;
procedure other_color_chk is
begin
if Other_Color = 1 then
Put(ASCII.ESC & avail_place_text_color1);
end if;
end other_color_chk;
procedure reset_black_color is
begin
Put(ASCII.ESC & "[38;5;0m");
end reset_black_color;
begin
-- Frame
Set_Background_Colour(White);
Set_Foreground_Colour(Black);
-- Skriver ut horisontella linjer
while y < Y_Start + height loop
Goto_XY(X_Start + 1, y);
Put(Horisontal_Line, Times => widthcol1);
Goto_XY(X_Start + 2 + widthcol1, y);
Put(Horisontal_Line, Times => widthcol2);
Goto_XY(X_Start + 3 + widthcol1 + widthcol2, y);
Put(Horisontal_Line, Times => widthcol3);
Goto_XY(X_Start + 4 + widthcol1 + widthcol2 + widthcol3, y);
y := y + 2;
end loop;
for I in Y_Start..(Y_Start+height -1) loop
Goto_XY(X_Start,I);
if (I + Y_Start) mod 2 /= 0 then
Put(Vertical_Line);
Goto_XY(X_Start + 1 + widthcol1,I);
Put(Vertical_Line);
Goto_XY(X_Start + 2 + widthcol1 + widthcol2,I);
Put(Vertical_Line);
Goto_XY(X_Start + 3 + widthcol1 + widthcol2 + widthcol3,I);
Put(Vertical_Line);
else
if I = Y_Start then
Put(Upper_Left_Corner);
Goto_XY(X_Start + 1 + widthcol1,I);
Put(Horisontal_Down);
Goto_XY(X_Start + 2 + widthcol1 + widthcol2,I);
Put(Horisontal_Down);
Goto_XY(X_Start + 3 + widthcol1 + widthcol2 + widthcol3,I);
Put(Upper_Right_Corner);