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 - metrics - download
Index: B T

⟦16a0a5cb9⟧ TextFile

    Length: 7379 (0x1cd3)
    Types: TextFile
    Names: »B«

Derivation

└─⟦180fe333a⟧ Bits:30000405 8mm tape, Rational 1000, SW CATALOG, 10_20_0
└─⟦180fe333a⟧ Bits:30000537 8mm tape, Rational 1000, SW Catalog 10_20_0
    └─⟦5cb1d1d7f⟧ »DATA« 
        └─⟦3b1ee7bd8⟧ 
            └─⟦this⟧ 

TextFile

with Data_Pkg;
use Data_Pkg;

separate (Tracker.Report_Generator)
procedure Calc_Pct_Done (Orig_Or_Cur : in Orig_Or_Cur_Type;
                         Pct_Done : in out Pct_Done_Type) is
    --------------------------------------------------------------------------------
    --|
    --|  NAME:  CALC_PCT_DONE
    --|
    --|  OVERVIEW:
    --|    This procedure calculates the percent complete by subsystem and
    --|    activity, total percent done by subsystem and activity, total percent
    --|    available at start by subsystem and activity, and the total percent
    --|    complete on the entire project.  The grand total percent done, percent
    --|    available at start, and percent complete on the entire project are
    --|    also calculated.
    --|
    --|    The percent complete by milestone is also calculated in a similar
    --|    manner.
    --|
    --|  EXCEPTIONS HANDLED:
    --|    others   an error message is printed and the execution continues
    --|
    --|  HISTORY:
    --|    written by   Bonnie Burkhardt   March 1985
    --|
    --|  NOTES:
    --|    The percentage calculations are performed one subsystem at a time.
    --|    For each subsystem, its element list is walked and the total size,
    --|    total size available at start, and total amount done is tabulated.
    --|    Grand total accumulators are also updated from the subsystem totals.
    --|    From these totals, the percent complete for the subsystem and for
    --|    the entire project is calculated.
    --|
    --------------------------------------------------------------------------------

    use El_List_Pkg;
    use Ss_List_Pkg;
    use Pr_List_Pkg;
    use Ac_List_Pkg;

    Ele_Ptr : Element_Pointer;
    Ac_Ptr : Activity_Pointer;
    Ac_Index : Integer := 0;
    Ss_Ptr : Subsystem_Pointer;
    Ss_Index : Integer := 0;
    Pr_Ptr : Personnel_Pointer;
    End_List : Boolean := False;

    Ms_Size : array (Ms_Num_Type) of Float range 0.0 .. 999_999.0 :=
       (others => 0.0);
    Ms_Done : array (Ms_Num_Type) of Float range 0.0 .. 999_999.0 :=
       (others => 0.0);
    Ss_Size : array (1 .. Num_Of_Activities) of Float range 0.0 .. 999_999.0 :=
       (others => 0.0);
    Ss_Done : array (1 .. Num_Of_Activities) of Float range 0.0 .. 999_999.0 :=
       (others => 0.0);
    Ss_Start : array (1 .. Num_Of_Activities) of Float range 0.0 .. 999_999.0 :=
       (others => 0.0);
    Gr_Tot_Size : array (1 .. Num_Of_Activities) of
                     Float range 0.0 .. 999_999.0 := (others => 0.0);
    Gr_Tot_Done : array (1 .. Num_Of_Activities) of
                     Float range 0.0 .. 999_999.0 := (others => 0.0);
    Gr_Tot_Start : array (1 .. Num_Of_Activities) of
                      Float range 0.0 .. 999_999.0 := (others => 0.0);
    Ss_Tot_Size : Float range 0.0 .. 999_999.0 := 0.0;
    Ss_Tot_Done : Float range 0.0 .. 999_999.0 := 0.0;
    Ss_Tot_Start : Float range 0.0 .. 999_999.0 := 0.0;
    Grand_Tot_Size : Float range 0.0 .. 999_999.0 := 0.0;
    Grand_Tot_Done : Float range 0.0 .. 999_999.0 := 0.0;
    Grand_Tot_Start : Float range 0.0 .. 999_999.0 := 0.0;

    procedure Get_Ss_Totals is separate;

begin
    Start_Walk (Ss_List);
    Ss_Index := 0;

    loop
        Walk (Ss_List, Ss_Ptr, End_List);
        exit when End_List;
        Ss_Index := Ss_Index + 1;

        Get_Ss_Totals;

        -- calculate the percent complete of each activity in the subsystem
        for Ac_Index in 1 .. Num_Of_Activities loop
            if (Ss_Done (Ac_Index) > 0.0) and (Ss_Size (Ac_Index) > 0.0) then
                Pct_Done.By_Ss_And_Ac (Ss_Index, Ac_Index) :=
                   100.0 * Ss_Done (Ac_Index) / Ss_Size (Ac_Index);
            else
                Pct_Done.By_Ss_And_Ac (Ss_Index, Ac_Index) := 0.0;
            end if;
        end loop;

        -- calculate the total percent complete for this subsystem
        if Ss_Tot_Size > 0.0 then
            Pct_Done.By_Ss (Ss_Index) := 100.0 * Ss_Tot_Done / Ss_Tot_Size;
        elsif Orig_Or_Cur = Current then
            Pct_Done.By_Ss (Ss_Index) := 0.0;
        else
            Pct_Done.By_Ss (Ss_Index) := 100.0;
        end if;

        -- compute the percent complete on contract for this subsystem
        if Ss_Tot_Size + Ss_Tot_Start = 0.0 then
            Pct_Done.Entire_By_Ss (Ss_Index) := 0.0;
            Pct_Done.Start_By_Ss (Ss_Index) := 0.0;
        elsif Pct_Done.By_Ss (Ss_Index) < 100.0 then
            Pct_Done.Entire_By_Ss (Ss_Index) :=
               100.0 * (Ss_Tot_Done + Ss_Tot_Start) /
                  (Ss_Tot_Start + Ss_Tot_Size);
            Pct_Done.Start_By_Ss (Ss_Index) :=
               100.0 * Ss_Tot_Start / (Ss_Tot_Start + Ss_Tot_Size);
        else
            Pct_Done.Entire_By_Ss (Ss_Index) := 100.0;
            Pct_Done.Start_By_Ss (Ss_Index) :=
               100.0 * Ss_Tot_Start / (Ss_Tot_Start + Ss_Tot_Size);
        end if;

        -- add total work done and total work for each record to the grand total
        -- accumulators
        Grand_Tot_Size := Grand_Tot_Size + Ss_Tot_Size;
        Grand_Tot_Done := Grand_Tot_Done + Ss_Tot_Done;
        Grand_Tot_Start := Grand_Tot_Start + Ss_Tot_Start;

        for Ac_Index in 1 .. Num_Of_Activities loop
            Gr_Tot_Size (Ac_Index) :=
               Gr_Tot_Size (Ac_Index) + Ss_Size (Ac_Index);
            Gr_Tot_Done (Ac_Index) :=
               Gr_Tot_Done (Ac_Index) + Ss_Done (Ac_Index);
            Gr_Tot_Start (Ac_Index) :=
               Gr_Tot_Start (Ac_Index) + Ss_Start (Ac_Index);
        end loop;
    end loop;



    -- calculate the total percent complete by milestone
    for Ms_Index in Ms_Num_Type loop
        if Ms_Size (Ms_Index) > 0.0 then
            Pct_Done.By_Ms (Ms_Index) :=
               100.0 * Ms_Done (Ms_Index) / Ms_Size (Ms_Index);
        end if;
    end loop;

    -- calculate the grand total percents by activity
    for Ac_Index in 1 .. Num_Of_Activities loop
        if (Gr_Tot_Done (Ac_Index) > 0.0) and
           (Gr_Tot_Size (Ac_Index) > 0.0) then
            Pct_Done.By_Ac (Ac_Index) :=
               100.0 * Gr_Tot_Done (Ac_Index) / Gr_Tot_Size (Ac_Index);
        end if;

        if Gr_Tot_Start (Ac_Index) + Gr_Tot_Size (Ac_Index) > 0.0 then
            Pct_Done.Start_By_Ac (Ac_Index) :=
               100.0 * Gr_Tot_Start (Ac_Index) /
                  (Gr_Tot_Start (Ac_Index) + Gr_Tot_Size (Ac_Index));
        end if;

        if Gr_Tot_Start (Ac_Index) + Gr_Tot_Size (Ac_Index) > 0.0 then
            Pct_Done.Entire_By_Ac (Ac_Index) :=
               100.0 * (Gr_Tot_Start (Ac_Index) + Gr_Tot_Done (Ac_Index)) /
                  (Gr_Tot_Start (Ac_Index) + Gr_Tot_Size (Ac_Index));
        end if;
    end loop;

    -- calculate the grand total percent complete for all activities
    if Grand_Tot_Size > 0.0 then
        Pct_Done.Contract := 100.0 * Grand_Tot_Done / Grand_Tot_Size;
    end if;

    if Grand_Tot_Start + Grand_Tot_Size > 0.0 then
        Pct_Done.Start := 100.0 * Grand_Tot_Start /
                             (Grand_Tot_Start + Grand_Tot_Size);
    end if;

    if Grand_Tot_Start + Grand_Tot_Size > 0.0 then
        Pct_Done.Entire := 100.0 * (Grand_Tot_Done + Grand_Tot_Start) /
                              (Grand_Tot_Start + Grand_Tot_Size);
    end if;

exception
    when others =>
        Put_Line ("exception raise in CALC_PCT_DONE");
end Calc_Pct_Done;