DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦8a6edc8eb⟧ Ada Source

    Length: 9216 (0x2400)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Bgrb2_Generic_Robots, seg_04b33f

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« 
        └─⟦this⟧ 

E3 Source Code



with Bgrb2_Frames;
with Bgrb2_Working_Memory;

package body Bgrb2_Generic_Robots is


    task Object is
        entry Work (With_Robot      : Fact_Name;
                    With_Brick      : Fact_Name;
                    Destination_Box : Fact_Name;
                    Box_Number      : Slot.Object);  
        entry Kill (Which_Robot : Fact_Name);
    end Object;


    task body Object is
        use Bgrb2_Frames;

        Finish            : Boolean := False;
        The_Output_Window : Display.Window (Display.Output_Window);
        The_Robot         : Fact_Name;
        The_Brick         : Fact_Name;
        The_Box           : Fact_Name;
        The_Box_Number    : Slot.Object;
    begin

        Display.Open_Window (Window_Name, The_Output_Window,
                             Display.Output_Window);
        Display.New_Line (The_Output_Window);
        Display.Put_Line
           (" --------------------------------------------------------------",
            The_Output_Window);
        Display.Put_Line
           (" --             THE ROBOT WAITS FOR A JOB                    --",
            The_Output_Window);
        Display.Put_Line
           (" --------------------------------------------------------------",
            The_Output_Window);

        while not (Finish) loop
            select
                accept Work (With_Robot      : Fact_Name;
                             With_Brick      : Fact_Name;
                             Destination_Box : Fact_Name;
                             Box_Number      : Slot.Object) do

                    The_Robot      := With_Robot;
                    The_Brick      := The_Brick;
                    The_Box        := Destination_Box;
                    The_Box_Number := Box_Number;
                end Work;

                Display.New_Line (The_Output_Window);  
                Display.Put_Line
                   (" --------------------------------------------------------------",
                    The_Output_Window);
                Display.Put_Line
                   (" --                THE ROBOT IS WORKING                      --",
                    The_Output_Window);
                Display.Put_Line
                   (" --------------------------------------------------------------",
                    The_Output_Window);

                Robots_Server.Change (The_Robot, Action, Dropping);

                delay (Working_Time);

                Boxes_Server.Change  
                   (The_Box, State, Full);

                Robots_Server.Change (The_Robot, Action, Taking);

                Robots_Server.Change (The_Robot, Working, No);

                Display.New_Line (The_Output_Window);
                Display.Put_Line
                   (" --------------------------------------------------------------",
                    The_Output_Window);
                Display.Put_Line
                   (" --             THE ROBOT WAITS FOR A JOB                    --",
                    The_Output_Window);
                Display.Put_Line
                   (" --------------------------------------------------------------",
                    The_Output_Window);

            or

                accept Kill (Which_Robot : Fact_Name) do
                    The_Robot := Which_Robot;  
                end Kill;
                Robots_Server.Delete (The_Robot);
                Display.New_Line (The_Output_Window);
                Display.Put_Line
                   (" --------------------------------------------------------------",
                    The_Output_Window);
                Display.Put_Line
                   (" --             THE ROBOT HAS BEEN REMOVED                   --",
                    The_Output_Window);  
                Display.Put_Line
                   (" --------------------------------------------------------------",
                    The_Output_Window);
                Display.New_Line (The_Output_Window);
                Finish := True;

            end select;  
        end loop;  
        Display.Put_Line ("fin de la tache", The_Output_Window);
        Display.Close_Window (The_Output_Window);  
    end Object;


    procedure Work (With_Robot      : Fact_Name;
                    With_Brick      : Fact_Name;
                    Destination_Box : Fact_Name;
                    Box_Number      : Slot.Object) is
    begin  
        Object.Work (With_Robot, With_Brick, Destination_Box, Box_Number);
    end Work;

    procedure Kill (Which_Robot : Fact_Name) is
    begin
        Object.Kill (Which_Robot);  
    end Kill;

end Bgrb2_Generic_Robots;

E3 Meta Data

    nblk1=8
    nid=7
    hdr6=a
        [0x00] rec0=20 rec1=00 rec2=01 rec3=082
        [0x01] rec0=18 rec1=00 rec2=03 rec3=052
        [0x02] rec0=18 rec1=00 rec2=08 rec3=036
        [0x03] rec0=15 rec1=00 rec2=04 rec3=096
        [0x04] rec0=1a rec1=00 rec2=02 rec3=000
        [0x05] rec0=01 rec1=00 rec2=07 rec3=000
        [0x06] rec0=17 rec1=00 rec2=05 rec3=060
        [0x07] rec0=09 rec1=00 rec2=03 rec3=001
    tail 0x2174fdef4867b710b3172 0x42a00088462063c03
Free Block Chain:
  0x7: 0000  00 05 00 0e 80 08 5f 52 6f 62 6f 74 73 3b 08 00  ┆      _Robots;  ┆
  0x5: 0000  00 06 03 1e 80 29 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ┆     )----------┆
  0x6: 0000  00 00 00 04 80 01 42 01 02 03 04 05 06 07 08 09  ┆      B         ┆