DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

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 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ B T

⟦ed4cd16c9⟧ TextFile

    Length: 12447 (0x309f)
    Types: TextFile
    Names: »B«

Derivation

└─⟦f64eaa120⟧ Bits:30000752 8mm tape, Rational 1000, !projects 93 02 16
    └─ ⟦6f12a12be⟧ »DATA« 
        └─⟦this⟧ 

TextFile

package body Worker is

    function Create (Station : Frame.Station_Identification;
                     Task_Id : Frame.Task_Identification)
                    return Worker_Reference is
        A_Worker : Worker_Reference :=
           new Worker_Class'(Station => Station,
                             Task_Number => Task_Id,
                             Current_Work => Sleep,
                             Expected_Frame => None,
                             Format => Frame.Eight_Bits,
                             Number_Of_Transmissions => Frame.Infinity,
                             Lasting_Number_Of_Transmissions => 0,
                             others => 0);
    begin
        return A_Worker;
    end Create;


    procedure Sleep_Acknowledge (Self : Worker_Reference) is
    begin
        raise Program_Error;
    end Sleep_Acknowledge;

    procedure Reset_Acknowledge (Self : Worker_Reference) is
    begin
        if Self.Expected_Frame = Acknowledge then
            Self.Expected_Frame := None;
        else
            raise Program_Error;
        end if;
        Self.Current_Work := Sleep;
    end Reset_Acknowledge;

    procedure Autotest_Acknowledge (Self : Worker_Reference) is
    begin
        if Self.Expected_Frame = Acknowledge then
            Self.Expected_Frame := None;
        else
            raise Program_Error;
        end if;
        Self.Current_Work := Sleep;
    end Autotest_Acknowledge;

    procedure Single_Shot_Acknowledge (Self : Worker_Reference) is
    begin
        raise Program_Error;
    end Single_Shot_Acknowledge;

    procedure Flash_Acknowledge (Self : Worker_Reference) is
    begin
        raise Program_Error;
    end Flash_Acknowledge;

    procedure Free_Running_Acknowledge (Self : Worker_Reference) is
    begin
        if Self.Expected_Frame = Acknowledge then
            Self.Expected_Frame := Address;
        else
            raise Program_Error;
        end if;
    end Free_Running_Acknowledge;

    procedure Int_Value_Acknowledge (Self : Worker_Reference) is
    begin
        if Self.Expected_Frame = Acknowledge then
            Self.Expected_Frame := Address;
        else
            raise Program_Error;
        end if;
    end Int_Value_Acknowledge;

    procedure Int_Positive_Acknowledge (Self : Worker_Reference) is
    begin
        if Self.Expected_Frame = Acknowledge then
            Self.Expected_Frame := Address;
        else
            raise Program_Error;
        end if;
    end Int_Positive_Acknowledge;

    procedure Int_Negative_Acknowledge (Self : Worker_Reference) is
    begin
        if Self.Expected_Frame = Acknowledge then
            Self.Expected_Frame := Address;
        else
            raise Program_Error;
        end if;
    end Int_Negative_Acknowledge;


    procedure Acknowledge (Self : Worker_Reference) is
    begin
        case Self.Current_Work is
            when Sleep =>
                Sleep_Acknowledge (Self);
            when Reset =>
                Reset_Acknowledge (Self);
            when Autotest =>
                Autotest_Acknowledge (Self);
            when Single_Shot =>
                Single_Shot_Acknowledge (Self);
            when Flash =>
                Flash_Acknowledge (Self);
            when Free_Running =>
                Free_Running_Acknowledge (Self);
            when Int_Value =>
                Int_Value_Acknowledge (Self);
            when Int_Positive =>
                Int_Positive_Acknowledge (Self);
            when Int_Negative =>
                Int_Negative_Acknowledge (Self);
        end case;
    end Acknowledge;

    procedure Sleep_Accept_Message (Self : Worker_Reference;
                                    M : Frame.Message;
                                    Need_More : out Boolean) is
    begin
        raise Program_Error;
    end Sleep_Accept_Message;

    procedure Reset_Accept_Message (Self : Worker_Reference;
                                    M : Frame.Message;
                                    Need_More : out Boolean) is
    begin
        raise Program_Error;
    end Reset_Accept_Message;

    procedure Autotest_Accept_Message (Self : Worker_Reference;
                                       M : Frame.Message;
                                       Need_More : out Boolean) is
    begin
        raise Program_Error;
    end Autotest_Accept_Message;

    procedure Single_Shot_Accept_Message (Self : Worker_Reference;
                                          M : Frame.Message;
                                          Need_More : out Boolean) is
    begin
        case Self.Expected_Frame is
            when None | Acknowledge =>
                raise Program_Error;
            when Address =>
                if Frame."/=" (Frame.Get_Station (Frame.As_Address (M)),
                               Self.Station) or
                   Frame."/=" (Frame.Get_Task (Frame.As_Address (M)),
                               Self.Task_Number) then
                    raise Program_Error;
                end if;  
                Self.Expected_Frame := Value_Low;
                Need_More := True;
            when Value_Low =>
                Self.First_Message := M;
                Self.Value := Frame.As_Natural (M);
                case Self.Format is
                    when Frame.Eight_Bits =>
                        Self.Current_Work := Sleep;
                        Need_More := False;
                    when Frame.Sixteen_Bits =>
                        Self.Expected_Frame := Value_High;
                        Need_More := True;
                end case;
            when Value_High =>
                Self.Value := Self.Value + Frame.As_Natural (M) * 256;
                Self.Current_Work := Sleep;
                Need_More := False;
        end case;
    end Single_Shot_Accept_Message;

    procedure Flash_Accept_Message (Self : Worker_Reference;
                                    M : Frame.Message;
                                    Need_More : out Boolean) is
    begin
        case Self.Expected_Frame is
            when None | Acknowledge =>
                raise Program_Error;
            when Address =>
                if Frame."/=" (Frame.Get_Station (Frame.As_Address (M)),
                               Self.Station) or
                   Frame."/=" (Frame.Get_Task (Frame.As_Address (M)),
                               Self.Task_Number) then
                    raise Program_Error;
                end if;  
                Self.Expected_Frame := Value_Low;
                Need_More := True;
            when Value_Low =>
                Self.First_Message := M;
                Self.Value := Frame.As_Natural (M);
                case Self.Format is
                    when Frame.Eight_Bits =>
                        Self.Current_Work := Sleep;
                        Need_More := False;
                    when Frame.Sixteen_Bits =>
                        Self.Expected_Frame := Value_High;
                        Need_More := True;
                end case;
            when Value_High =>
                Self.Value := Self.Value + Frame.As_Natural (M) * 256;
                Self.Current_Work := Sleep;
                Need_More := False;
        end case;
    end Flash_Accept_Message;

    procedure Free_Running_Accept_Message (Self : Worker_Reference;
                                           M : Frame.Message;
                                           Need_More : out Boolean) is
    begin
        case Self.Expected_Frame is
            when None | Acknowledge =>
                raise Program_Error;
            when Address =>
                if Frame."/=" (Frame.Get_Station (Frame.As_Address (M)),
                               Self.Station) or
                   Frame."/=" (Frame.Get_Task (Frame.As_Address (M)),
                               Self.Task_Number) then
                    raise Program_Error;
                end if;  
                Self.Expected_Frame := Value_Low;
                Need_More := True;
            when Value_Low =>
                Self.First_Message := M;
                Self.Value := Frame.As_Natural (M);
                case Self.Format is
                    when Frame.Eight_Bits =>
                        Self.Expected_Frame := Address;
                        Need_More := False;
                    when Frame.Sixteen_Bits =>
                        Self.Expected_Frame := Value_High;
                        Need_More := True;
                end case;
            when Value_High =>
                Self.Value := Self.Value + Frame.As_Natural (M) * 256;
                Self.Expected_Frame := Address;
                Need_More := False;
        end case;
    end Free_Running_Accept_Message;

    procedure Int_Value_Accept_Message (Self : Worker_Reference;
                                        M : Frame.Message;
                                        Need_More : out Boolean) is
    begin
        case Self.Expected_Frame is
            when None | Acknowledge =>
                raise Program_Error;
            when Address =>
                if Frame."/=" (Frame.Get_Station (Frame.As_Address (M)),
                               Self.Station) or
                   Frame."/=" (Frame.Get_Task (Frame.As_Address (M)),
                               Self.Task_Number) then
                    raise Program_Error;
                end if;  
                Self.Expected_Frame := Address;
                Need_More := False;
            when Value_Low | Value_High =>
                raise Program_Error;
        end case;
    end Int_Value_Accept_Message;

    procedure Int_Positive_Accept_Message (Self : Worker_Reference;
                                           M : Frame.Message;
                                           Need_More : out Boolean) is
    begin
        case Self.Expected_Frame is
            when None | Acknowledge =>
                raise Program_Error;
            when Address =>
                if Frame."/=" (Frame.Get_Station (Frame.As_Address (M)),
                               Self.Station) or
                   Frame."/=" (Frame.Get_Task (Frame.As_Address (M)),
                               Self.Task_Number) then
                    raise Program_Error;
                end if;  
                Self.Expected_Frame := Address;
                Need_More := False;
            when Value_Low | Value_High =>
                raise Program_Error;
        end case;
    end Int_Positive_Accept_Message;

    procedure Int_Negative_Accept_Message (Self : Worker_Reference;
                                           M : Frame.Message;
                                           Need_More : out Boolean) is
    begin
        case Self.Expected_Frame is
            when None | Acknowledge =>
                raise Program_Error;
            when Address =>
                if Frame."/=" (Frame.Get_Station (Frame.As_Address (M)),
                               Self.Station) or
                   Frame."/=" (Frame.Get_Task (Frame.As_Address (M)),
                               Self.Task_Number) then
                    raise Program_Error;
                end if;  
                Self.Expected_Frame := Address;
                Need_More := False;
            when Value_Low | Value_High =>
                raise Program_Error;
        end case;
    end Int_Negative_Accept_Message;


    procedure Accept_Message (Self : Worker_Reference;
                              M : Frame.Message;
                              Need_More : out Boolean) is
    begin
        case Self.Current_Work is
            when Sleep =>
                Sleep_Accept_Message (Self, M, Need_More);
            when Reset =>
                Reset_Accept_Message (Self, M, Need_More);
            when Autotest =>
                Autotest_Accept_Message (Self, M, Need_More);
            when Single_Shot =>
                Single_Shot_Accept_Message (Self, M, Need_More);
            when Flash =>
                Flash_Accept_Message (Self, M, Need_More);
            when Free_Running =>
                Free_Running_Accept_Message (Self, M, Need_More);
            when Int_Value =>
                Int_Value_Accept_Message (Self, M, Need_More);
            when Int_Positive =>
                Int_Positive_Accept_Message (Self, M, Need_More);
            when Int_Negative =>
                Int_Negative_Accept_Message (Self, M, Need_More);
        end case;
    end Accept_Message;
end Worker;