Advertisement
Javic9

Untitled

May 24th, 2020
3,424
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ada 1.90 KB | None | 0 0
  1. with data_types, IO, control_procedures, Ada.Text_IO, Ada.Real_Time, system;
  2. use data_types, IO, control_procedures, Ada.Text_IO, Ada.Real_Time, system ;
  3. with recursoCompartido; use recursoCompartido;
  4. procedure sistema_control is
  5.    
  6.    ST2: Temperatura;
  7.    SD1 : Temperatura;
  8.    SC1, SC2: Caudal;
  9.    BDW : BBDD_Write;
  10.    BDR : BBDD_Read;
  11.    numero : Integer;
  12.    
  13.    task control_CS is pragma Priority(1); end;
  14.    task control_MD is pragma Priority(2); end;
  15.    task control_seguridad is pragma Priority(3); end;
  16.    
  17.    task body control_CS is
  18.       T:Time;
  19.       Periodo:Time_Span;
  20.    begin
  21.      
  22.       Put_Line("COMIENZO DE LA FASE DE CONTROL DEL CAMPO SOLAR");
  23.      
  24.       ST2 := 100.0;
  25.       SC1 := 200.0;
  26.       T:=Clock;
  27.       Periodo := Milliseconds(400);
  28.       for i in 1..5 loop
  29.      T:=T+periodo;
  30.      BDR.accesoBBDD_Read(numero);
  31.      BDR.ReadTemp(ST2);
  32.      BDW.WriteCau(1);
  33.      delay until(T);
  34.       end loop;
  35.      
  36.    end control_CS;
  37.    
  38.    task body control_MD is
  39.       T:Time;
  40.       Periodo:Time_Span;
  41.       begin
  42.      
  43.       Put_Line("COMIENZO DE LA FASE DE CONTROL DEL MODULO DE DESTILACIÓN");
  44.  
  45.      
  46.       SD1 := 100.0;
  47.       SC2 := 200.0;
  48.       T:=Clock;
  49.       Periodo := Milliseconds(400);
  50.  
  51.       for i in 1..5 loop
  52.      T:=T+periodo;
  53.      BDR.accesoBBDD_Read(numero);
  54.      BDR.ReadTemp(SD1);
  55.      BDW.WriteCau(2);
  56.      delay until(T);
  57.       end loop;
  58.      
  59.    end control_MD;
  60.    
  61.    task body control_seguridad is
  62.       T:Time;
  63.       Periodo:Time_Span;
  64.    begin
  65.      
  66.       Put_Line("COMIENZO DE LA FASE DE CONTROL DE SEGURIDAD");
  67.  
  68.      
  69.       ST2 := 100.0;
  70.       SC1 := 100.0;
  71.       SC2 := 200.0;
  72.       T:=Clock;
  73.       Periodo := Milliseconds(50);
  74.  
  75.       for i in 1..5 loop
  76.      T:=t+periodo;
  77.      control_procedures.Control_Seguridad(ST2, SC1, SC2);    
  78.      delay until(T);
  79.       end loop;
  80.    end control_seguridad;
  81.    
  82.      
  83. begin
  84.    null;
  85.    
  86. end sistema_control;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement