Aircraft Collision Avoidance System: Procedure Details
Classified in Other subjects
Written at on English with a size of 3.34 KB.
procedure Control_Collisions is
Current_Obstacle_Distance: Distance_Type := 0; Current_Light: Light_Type := 0;
Current_Pw : Power_Type := 0; Current_A: Altitude_Type :=0;
Current_S :Speed_Type :=0; Pilot_P: PilotPresence_Type;
Velocity_Seconds : integer := 0;
Time_To_Collision : integer := 0;
begin
if (Control_Button.Get_Mode) then
Read_Distance(Current_Obstacle_Distance);
Read_Power(Current_Pw);---Inicio
Current_S := Speed_Type (float (Current_Pw) * 1.2);
Time_To_Collision := integer(Current_Obstacle_Distance) * 3600;
Time_To_Collision := Time_To_Collision / 1000;
Time_To_Collision := Time_To_Collision / (integer(Current_S))
Pilot_P := Read_PilotPresence;
Read_Light_Intensity(Current_Light);
if (Control_Button.Get_Mode) then
if (Pilot_P = 1) then
if (Time_To_Collision < 10) then
Alarm(4);
end if;
if (Time_To_Collision < 5) then
Set_Maneuver(true);
end if;
elsif (Current_Light < 500 or Pilot_P = 0) then
if (Time_To_Collision < 15) then
Alarm(4);
end if;
if (Time_To_Collision < 10) then
Set_Maneuver(true);
end if;
end if;
--Control Maneuver
if (Get_Maneuver) then
Current_A := Read_Altitude;
if (Maneuver_Progress_Pitch > 1 or Current_A <= 8500) then
Maneuver_Progress_Pitch := Maneuver_Progress_Pitch + 1;
Set_Aircraft_Pitch(20);
end if;
if (Maneuver_Progress_Roll > 1 or Current_A > 8500) then
Maneuver_Progress_Roll := Maneuver_Progress_Roll + 1;
Set_Aircraft_Roll(45);
end if;
if (Maneuver_Progress_Pitch = 12) then
if (Maneuver_Progress_Roll = 1) then
Set_Maneuver(False);
end if;
Set_Aircraft_Pitch(0);
Maneuver_Progress_Pitch := 1;
end if;
if (Maneuver_Progress_Roll = 12) then
if (Maneuver_Progress_Pitch = 1) then
Set_Maneuver(False);
end if;
Set_Aircraft_Roll(0);
Maneuver_Progress_Roll := 1;
end if;
end if;
end if;
else
if (Time_To_Collision < 10) then
Alarm(4);
end if;
end if;
end Control_Collisions;