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

⟦6ed21da76⟧ Ada Source

    Length: 11264 (0x2c00)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Cl35, seg_040ce7

Derivation

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

E3 Source Code



with Byte_Utility;
with Conversion;
with System;  
with Text_Io;
package body Cl35 is

    use Byte_Utility;

    Adresse_Invalide : exception;
    Commande_Inconnue : exception;
    Trame_Incompatible : exception;

--**** *********************************************************************

    function Coder_Entete_Trame return System.Byte_String is
    begin
        return Code_Entete;
    end Coder_Entete_Trame;

--***************************************************************************

    function Coder_Adresse_Trame
                (Un_Numero_Lecteur : Integer) return System.Byte_String is
    begin  
        if ((Un_Numero_Lecteur < Adresse_Min) and
            (Un_Numero_Lecteur < Adresse_Max)) then
            raise Adresse_Invalide;
        end if;

        return (Conversion.Integer_Byte_String
                   (Un_Numero_Lecteur, Taille_Adresse));

    end Coder_Adresse_Trame;

--***************************************************************************

    function Coder_Controle_Trame
                (La_Taille : Integer) return System.Byte_String is
    begin
        return (Conversion.Integer_Byte_String (La_Taille, Taille_Controle));
    end Coder_Controle_Trame;

--***************************************************************************

    function Coder_Commande_Trame (Une_Commande_Lecteur : Message.Commande)
                                  return System.Byte_String is
    begin
        case Une_Commande_Lecteur is
            when Message.Rapport_Horloge =>
                return (Code_Rapport_Horloge);
            when Message.Rapport_Site =>
                return (Code_Rapport_Site);
            when others =>
                null;
        end case;

    end Coder_Commande_Trame;

--***************************************************************************


    function Coder_Donnees_Trame
                (Des_Donnees : Integer) return System.Byte_String is
    begin
        return (1 => Conversion.Integer_Byte (Des_Donnees));
    end Coder_Donnees_Trame;

--***************************************************************************

    function Coder_Fin_Trame return System.Byte_String is
    begin
        return Code_Fin;
    end Coder_Fin_Trame;

--***************************************************************************

    function Coder_Message (Le_Message : Message.Objet)
                           return System.Byte_String is
        Chaine : Byte_String;
    begin

        Chaine := new System.Byte_String'
                         (Coder_Commande_Trame
                             (Message.Donner_La_Commande (Le_Message)));

        return (Coder_Entete_Trame &
                Coder_Adresse_Trame (Message.Donner_No_Lecteur (Le_Message)) &
                Coder_Controle_Trame (Chaine'Length) &
                Chaine.all & Coder_Fin_Trame);

    end Coder_Message;

--***************************************************************************

    procedure Decoder_Entete_Trame (La_Trame : System.Byte_String) is

    begin

        if not Compare (Code_Entete, La_Trame) then
            raise Trame_Incompatible;
        end if;


    end Decoder_Entete_Trame;

--***************************************************************************

    function Decoder_Adresse_Trame
                (La_Trame : in System.Byte_String) return Integer is
        L_Adresse : Integer;
    begin  
        L_Adresse := Conversion.Byte_String_Integer (La_Trame);

        if ((L_Adresse < Adresse_Min) and (L_Adresse < Adresse_Max)) then
            raise Adresse_Invalide;
        end if;

        return (L_Adresse);

    end Decoder_Adresse_Trame;

--***************************************************************************
    function Decoder_Controle_Trame
                (La_Trame : in System.Byte_String) return Integer is

    begin

        return (Conversion.Byte_String_Integer (La_Trame));

    end Decoder_Controle_Trame;

--***************************************************************************
    function Decoder_Commande_Trame
                (La_Trame : in System.Byte_String) return Message.Commande is


    begin

        if Compare (Code_Rapport_Site, La_Trame) then
            return (Message.Rapport_Site);
        end if;

        if Compare (Code_Rapport_Horloge, La_Trame) then
            return (Message.Rapport_Horloge);
        end if;

        return (Message.Unknown);

    end Decoder_Commande_Trame;

--****************************************************************************

    procedure Decoder_Fin_Trame (La_Trame : System.Byte_String) is

    begin

        if not Compare (Code_Fin, La_Trame) then
            raise Trame_Incompatible;
        end if;


    end Decoder_Fin_Trame;

--****************************************************************************

    function Decoder_Donnees_Trame
                (La_Trame : System.Byte_String) return Integer is

    begin
        return (0);
    end Decoder_Donnees_Trame;

--****************************************************************************

    function Decoder_Message
                (La_Trame : System.Byte_String) return Message.Objet is

        Le_Msg : Message.Objet;

        Index : Integer := 0;
        Le_Controle : Integer;

    begin

        Decoder_Entete_Trame (Extraire (La_Trame, Index, Taille_Entete));



        Index := Index + Taille_Entete;

        Message.Entrer_No_Lecteur
           (Decoder_Adresse_Trame (Extraire (La_Trame, Index, Taille_Adresse)),
            Le_Msg);


        Message.Afficher (Le_Msg);

        Index := Index + Taille_Adresse;

        Le_Controle := Decoder_Controle_Trame
                          (Extraire (La_Trame, Index, Taille_Controle)) - 1;



        Index := Index + Taille_Controle;

        Message.Entrer_La_Commande
           (Decoder_Commande_Trame
               (Extraire (La_Trame, Index, Taille_Commande)), Le_Msg);


        Message.Afficher (Le_Msg);


        Index := Index + Taille_Commande;


        --     if (Le_Controle > 2) then
        --
        --         Message.Entrer_Les_Donnees
        --            (Decoder_Donnees_Trame
        --                (Extraire (La_Trame, Index, Le_Controle - Taille_Commande)),
        --             Le_Msg);
        --
        --         Index := Index + Le_Controle - Taille_Commande;
        --
        --     end if;
        --
        --

        Decoder_Fin_Trame (Extraire (La_Trame, Index, Taille_Fin));




        Message.Entrer_Le_Lecteur (Message.Cl35, Le_Msg);

        return (Le_Msg);

    end Decoder_Message;

--****************************************************************************

end Cl35;

E3 Meta Data

    nblk1=a
    nid=9
    hdr6=12
        [0x00] rec0=24 rec1=00 rec2=01 rec3=046
        [0x01] rec0=1c rec1=00 rec2=06 rec3=058
        [0x02] rec0=1c rec1=00 rec2=05 rec3=02c
        [0x03] rec0=21 rec1=00 rec2=07 rec3=07a
        [0x04] rec0=28 rec1=00 rec2=03 rec3=030
        [0x05] rec0=25 rec1=00 rec2=02 rec3=070
        [0x06] rec0=00 rec1=00 rec2=08 rec3=010
        [0x07] rec0=29 rec1=00 rec2=04 rec3=090
        [0x08] rec0=03 rec1=00 rec2=0a rec3=001
        [0x09] rec0=15 rec1=0c rec2=00 rec3=5c4
    tail 0x2153b6f2c861255cdea85 0x42a00088462060003
Free Block Chain:
  0x9: 0000  00 00 01 ae 80 25 2e 42 79 74 65 5f 53 74 72 69  ┆     %.Byte_Stri┆