Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with data_types, IO, control_procedures, Ada.Text_IO, Ada.Real_Time, system;
- use data_types, IO, control_procedures, Ada.Text_IO, Ada.Real_Time, system ;
- with recursoCompartido; use recursoCompartido;
- procedure sistema_control is
- ST2: Temperatura;
- SD1 : Temperatura;
- SC1, SC2: Caudal;
- BDW : BBDD_Write;
- BDR : BBDD_Read;
- numero : Integer;
- task control_CS is pragma Priority(1); end;
- task control_MD is pragma Priority(2); end;
- task control_seguridad is pragma Priority(3); end;
- task body control_CS is
- T:Time;
- Periodo:Time_Span;
- begin
- Put_Line("COMIENZO DE LA FASE DE CONTROL DEL CAMPO SOLAR");
- ST2 := 100.0;
- SC1 := 200.0;
- T:=Clock;
- Periodo := Milliseconds(400);
- for i in 1..5 loop
- T:=T+periodo;
- BDR.accesoBBDD_Read(numero);
- BDR.ReadTemp(ST2);
- BDW.WriteCau(1);
- delay until(T);
- end loop;
- end control_CS;
- task body control_MD is
- T:Time;
- Periodo:Time_Span;
- begin
- Put_Line("COMIENZO DE LA FASE DE CONTROL DEL MODULO DE DESTILACIÓN");
- SD1 := 100.0;
- SC2 := 200.0;
- T:=Clock;
- Periodo := Milliseconds(400);
- for i in 1..5 loop
- T:=T+periodo;
- BDR.accesoBBDD_Read(numero);
- BDR.ReadTemp(SD1);
- BDW.WriteCau(2);
- delay until(T);
- end loop;
- end control_MD;
- task body control_seguridad is
- T:Time;
- Periodo:Time_Span;
- begin
- Put_Line("COMIENZO DE LA FASE DE CONTROL DE SEGURIDAD");
- ST2 := 100.0;
- SC1 := 100.0;
- SC2 := 200.0;
- T:=Clock;
- Periodo := Milliseconds(50);
- for i in 1..5 loop
- T:=t+periodo;
- control_procedures.Control_Seguridad(ST2, SC1, SC2);
- delay until(T);
- end loop;
- end control_seguridad;
- begin
- null;
- end sistema_control;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement