home *** CD-ROM | disk | FTP | other *** search
Text File | 1988-05-03 | 446.1 KB | 13,074 lines |
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --calendars.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- generic
- DAYS_IN_WEEK : positive := 5;
- HOURS_IN_DAY : float := 8.0;
- DAYS_OFF_IN_YEAR : natural := 0;
-
- package WORK_CALENDAR is
- subtype YEAR_NUMBER is integer range 1901..2099;
- subtype MONTH_NUMBER is integer range 1..12;
- subtype DAY_NUMBER is integer range 1..31;
- subtype HOUR_NUMBER is float range 0.0..HOURS_IN_DAY;
- type DATE_TYPE is record
- MONTH : month_number;
- DAY : day_number;
- YEAR : year_number;
- end record;
-
- NULL_DATE : constant date_type := (2,31,1902);
- UNDERFLOW_DATE : constant date_type := (2,30,1901);
-
- function "+" (DATE : in date_type; HOURS : in float) return DATE_TYPE;
- function "+" (HOURS : in float; DATE : in date_type) return DATE_TYPE;
- function "-" (DATE : in date_type; HOURS : in float) return DATE_TYPE;
- function "-" (DATE1, DATE2 : in date_type) return float;
- function "<" (DATE1, DATE2 : in date_type) return boolean;
- function "<=" (DATE1, DATE2 : in date_type) return boolean;
- function ">" (DATE1, DATE2 : in date_type) return boolean;
- function ">=" (DATE1, DATE2 : in date_type) return boolean;
- function VALID (MONTH, DAY, YEAR : in integer) return boolean;
- end WORK_CALENDAR;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --calendarb.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- with TEXT_IO; use TEXT_IO;
- with FLOAT_TEXT_IO; use FLOAT_TEXT_IO;
- with INTEGER_TEXT_IO; use INTEGER_TEXT_IO;
-
- Package body WORK_CALENDAR is
- ----------------------------------------------------------------------
- --| NAME: WORK_CALENDAR
- --|
- --| OVERVIEW:
- --| This package provides functions for manipulating time in a
- --| work week. It assumes that the date entered is the last day of
- --| the work week. This implies that when you are adding hours to a
- --| date, time for the weekend is added before the time for work.
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- ----------------------------------------------------------------------
-
- DAYS_IN_MONTH : array (1..12) of integer
- := (31,28,31,30,31,30,31,31,30,31,30,31);
- VACATION_FACTOR : float := float(52 * DAYS_IN_WEEK - DAYS_OFF_IN_YEAR)
- / float(52 * DAYS_IN_WEEK);
-
- procedure CALC_DAYS (YEAR : in year_number) is
- begin
- -- check if leap year
- if (YEAR mod 400 = 0) or ((YEAR mod 100 /= 0) and (YEAR mod 4 = 0)) then
- DAYS_IN_MONTH(2) := 29;
- else
- DAYS_IN_MONTH(2) := 28;
- end if;
- end CALC_DAYS;
-
- function "+" (DATE : in date_type; DAY : in integer) return DATE_TYPE is
- TOTAL_DAYS : integer := DATE.day + DAY;
- SUM_DATE : date_type := DATE;
- begin
- loop
- -- check if leap year
- CALC_DAYS(SUM_DATE.year);
- -- compute the final date
- if TOTAL_DAYS <= DAYS_IN_MONTH (SUM_DATE.month) then
- SUM_DATE.day := TOTAL_DAYS;
- return SUM_DATE;
-
- else -- move into next month
- TOTAL_DAYS := TOTAL_DAYS - DAYS_IN_MONTH (SUM_DATE.month);
- if SUM_DATE.month < 12 then
- SUM_DATE.month := SUM_DATE.month + 1;
- else -- move into next year
- SUM_DATE.month := 1;
- SUM_DATE.year := SUM_DATE.year + 1;
- end if;
- end if;
- end loop;
- end "+";
-
- function "-" (DATE : in date_type; DAY : in integer) return DATE_TYPE is
- TOTAL_DAYS : integer := DAY;
- DIF_DATE : date_type := DATE;
- begin
- loop
- -- check if leap year
- CALC_DAYS(DIF_DATE.year);
- -- compute the final date
- if DIF_DATE.day - TOTAL_DAYS > 0 then
- DIF_DATE.day := DIF_DATE.day - TOTAL_DAYS;
- return DIF_DATE;
-
- else -- move into previous month
- TOTAL_DAYS := TOTAL_DAYS - DAYS_IN_MONTH (DIF_DATE.month);
- if DIF_DATE.month > 1 then
- DIF_DATE.month := DIF_DATE.month - 1;
- else -- move into previous year
- DIF_DATE.month := 12;
- DIF_DATE.year := DIF_DATE.year - 1;
- end if;
- DIF_DATE.day := DAYS_IN_MONTH (DIF_DATE.month);
- end if;
- end loop;
- end "-";
-
- function "+" (DAY : in integer; DATE : in date_type) return DATE_TYPE is
- begin
- return DATE + DAY;
- end "+";
-
-
- function "+" (DATE : in date_type; HOURS : in float) return DATE_TYPE is
- TOTAL_DAYS : integer := 0;
- begin
- -- if the number of hours is negative, add the positive number of hours
- -- to the date
- if HOURS < 0.0 then
- return DATE - (-1.0 * HOURS);
- end if;
- -- calculate the number of days to be added
- -- the next four lines were added instead of the following commented line
- -- TOTAL_DAYS := truncate(HOURS / (HOURS_IN_DAY * VACATION_FACTOR) ) + 1;
- TOTAL_DAYS := integer(HOURS / (HOURS_IN_DAY * VACATION_FACTOR));
- if (HOURS/(HOURS_IN_DAY*VACATION_FACTOR)) > float(TOTAL_DAYS) then
- TOTAL_DAYS := TOTAL_DAYS + 1;
- end if;
- -- plus weekends
- TOTAL_DAYS := TOTAL_DAYS + (7 - DAYS_IN_WEEK) *
- ( (TOTAL_DAYS - DAYS_IN_WEEK/2) / DAYS_IN_WEEK + 1);
- -- calculate the final date
- return DATE + TOTAL_DAYS;
- end "+";
-
-
- function "+" (HOURS : in float; DATE : in date_type) return DATE_TYPE is
- begin
- return DATE + HOURS;
- end "+";
-
-
- function "-" (DATE : in date_type; HOURS : in float) return DATE_TYPE is
- TOTAL_DAYS : integer := 0;
- begin
- -- if HOURS is negative, add the positive number of hours to the date
- if HOURS < 0.0 then
- return DATE + (-1.0 * HOURS);
- end if;
- -- calculate the number of days to be subtracted
- -- the next four lines were added instead of the following commented line
- -- TOTAL_DAYS := truncate(HOURS / (HOURS_IN_DAY * VACATION_FACTOR) );
- TOTAL_DAYS := integer(HOURS / (HOURS_IN_DAY * VACATION_FACTOR));
- if (HOURS/(HOURS_IN_DAY*VACATION_FACTOR)) < float(TOTAL_DAYS) then
- TOTAL_DAYS := TOTAL_DAYS - 1;
- end if;
- -- add in the days in the weekends
- TOTAL_DAYS := TOTAL_DAYS + (7 - DAYS_IN_WEEK) *
- (TOTAL_DAYS-1) / DAYS_IN_WEEK;
- return DATE - TOTAL_DAYS;
- end "-";
-
-
-
- function "-" (DATE1, DATE2 : in date_type) return FLOAT is
- HOUR : float := 0.0;
- DAY : integer := 0;
- DATE_1 : date_type := DATE1;
- DATE_2 : date_type := DATE2;
- NEGATIVE : boolean := false;
- begin
- -- if the subtraction of the dates will result in a negative amount of
- -- hours, switch the dates and attach the negative sign at the end
- if DATE_1 < DATE_2 then
- DATE_1 := DATE2;
- DATE_2 := DATE1;
- NEGATIVE := true;
- end if;
- -- calculate time difference of years and months in days
- CALC_DAYS (DATE_2.year);
- If DATE_1.year = DATE_2.year and DATE_1.month = DATE_2.month then
- DAY := DATE_1.day - DATE_2.day;
- else
- DAY := DAYS_IN_MONTH(DATE_2.month) - DATE_2.day + 1;
- DATE_2 := DATE_2 + DAY;
- while DATE_1.year /= DATE_2.year or DATE_1.month /= DATE_2.month loop
- CALC_DAYS(DATE_2.year);
- DAY := DAY + DAYS_IN_MONTH(DATE_2.month);
- DATE_2 := DATE_2 + DAYS_IN_MONTH(DATE_2.month);
- end loop;
- DAY := DAY + DATE_1.day - DATE_2.day;
- end if;
- -- subtract out the number of days on the weekend
- DAY := DAY - (7 - DAYS_IN_WEEK) * ( (DAY - 4) / 7 + 1 );
- -- number of weekends
- -- compute the total difference in hours
- if NEGATIVE then
- return - float(DAY) * HOURS_IN_DAY * VACATION_FACTOR;
- else
- return float(DAY) * HOURS_IN_DAY * VACATION_FACTOR;
- end if;
- end "-";
-
-
- function "<" (DATE1, DATE2 : in date_type) return boolean is
- begin
- if DATE1.year < DATE2.year then
- return TRUE;
- elsif (DATE1.year = DATE2.year) and (DATE1.month < DATE2.month) then
- return TRUE;
- elsif (DATE1.year = DATE2.year) and (DATE1.month = DATE2.month) and
- (DATE1.day < DATE2.day) then
- return TRUE;
- else
- return FALSE;
- end if;
- end "<";
-
-
- function "<=" (DATE1, DATE2 : in date_type) return boolean is
- begin
- return not (DATE1 > DATE2);
- end "<=";
-
-
- function ">" (DATE1, DATE2 : in date_type) return boolean is
- begin
- if DATE1.year > DATE2.year then
- return TRUE;
- elsif (DATE1.year = DATE2.year) and (DATE1.month > DATE2.month) then
- return TRUE;
- elsif (DATE1.year = DATE2.year) and (DATE1.month = DATE2.month) and
- (DATE1.day > DATE2.day) then
- return TRUE;
- else
- return FALSE;
- end if;
- end ">";
-
-
- function ">=" (DATE1, DATE2 : in date_type) return boolean is
- begin
- return not (DATE1 < DATE2);
- end ">=";
-
-
- function VALID (MONTH, DAY, YEAR : in integer) return boolean is
- begin
- if YEAR in YEAR_NUMBER and MONTH in MONTH_NUMBER and
- DAY in DAY_NUMBER then
- CALC_DAYS (YEAR);
- if DAY <= DAYS_IN_MONTH(MONTH) then
- return true;
- end if;
- end if;
- return false;
- end VALID;
-
- end WORK_CALENDAR;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --listpkgs.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- generic
- type key is private; -- private means generic param to be instantiated
- type data is private;
-
- package LIST_PKG is
- type list_type is private;
- procedure ADD ( list : in out list_type; rec_key : in key; rec_ptr : in data);
- function EMPTY_LIST( list : in list_type) return boolean;
- procedure START_WALK ( list : in out list_type );
- procedure WALK ( list : in out list_type; rec_ptr : out data;
- end_list : out boolean);
- procedure FIND ( list : in out list_type; rec_key : in key; rec_ptr : out data;
- found : in out boolean);
- procedure CHANGE_LIST_KEY ( list : in out list_type; old_key : in key;
- new_key : in key );
- procedure CHANGE_LIST_DATA( list : in out list_type; a_key : in key;
- new_data : in data );
- procedure DELETE ( list : in out list_type; rec_key : in key;
- successful : out boolean);
- private
- type list_element;
- type list_ptr is access list_element;
- type list_element is
- record
- search_key : key;
- rec_data : data;
- next : list_ptr;
- end record;
- type list_type is
- record
- head, tail : list_ptr;
- current_ptr : list_ptr;
- prev_ptr : list_ptr;
- end record;
- end LIST_PKG;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --listpkgb.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- with text_io; use text_io;
- with unchecked_deallocation;
-
- package body LIST_PKG is
-
- ----------------------------------------------------------------------
- --| NAME: LIST_PKG
- --|
- --| OVERVIEW:
- --| This package defines the generic list used for all data types
- --| and the actions that can be performed on them. In TRACKER, each
- --| data type will have its own linked list instantiated in the
- --| respective data package. The rec_data field is a pointer to
- --| a record of data.
- --|
- --| For the generic case, the resulting data structure looks like this:
- --||
- --|| prev_ptr current_ptr
- --|| . .
- --|| | |
- --|| V V
- --|| _________ _________ _________ <-- tail
- --|| head -->| next +-|--->| next +-|--->| next +-|---> null
- --|| |_________| |_________| |_________|
- --|| | rec_key | | rec_key | | rec_key |
- --|| |_________| |_________| |_________|
- --|| | rec_data| | rec_data| | rec_data|
- --|| |_________| |_________| |_________|
- --||
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee February 1985
- --|
- ----------------------------------------------------------------------
-
- procedure FREE is new unchecked_deallocation( list_element, list_ptr);
-
- procedure ADD ( list : in out list_type;
- rec_key : in key; rec_ptr : in data) is
- ----------------------------------------------------------------------
- --|
- --| NAME: ADD
- --|
- --| OVERVIEW:
- --| This procedure adds a new list record onto the end of the
- --| linked list. This feature provides a simple method by which
- --| you could sort the list; DELETE the list elements in the order
- --| you want the list to be sorted. Once you have DELETEd it, ADD it
- --| back onto the end of the list. Loop until the list is sorted.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee February 1985
- --|
- ----------------------------------------------------------------------
-
- temp : list_ptr;
-
- begin
- temp := new list_element;
- temp.search_key := rec_key;
- temp.rec_data := rec_ptr;
- temp.next := null;
- if list.head = null then
- list.head := temp;
- list.tail := temp;
- else
- list.tail.next := temp;
- list.tail := list.tail.next;
- list.tail.next := null;
- end if;
- end ADD;
-
- function EMPTY_LIST( list : in list_type ) return boolean is
- ----------------------------------------------------------------------
- --|
- --| NAME: EMPTY_LIST
- --|
- --| OVERVIEW:
- --| This function determines if the list is empty by checking the
- --| pointer to the head of the list. If it is null, true is returned.
- --| Otherwise, the list is not empty.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- ----------------------------------------------------------------------
- begin
- if list.head = null then
- return true;
- else
- return false;
- end if;
- end EMPTY_LIST;
-
-
- procedure FIND ( list : in out list_type; rec_key : in key;
- rec_ptr : out data; found : in out boolean) is
- ----------------------------------------------------------------------
- --|
- --| NAME: FIND
- --|
- --| OVERVIEW:
- --| This procedure searches the entire list for a record by the
- --| rec_key and returns the record. Found = true if the record
- --| is found and false otherwise. If the record is found, it
- --| is pointed to by list.current_ptr.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee February 1985
- --|
- ----------------------------------------------------------------------
-
- begin
- -- list.current_ptr points to the current element
- -- If the record is found, it will be referenced by list.current_ptr
- found := false;
- list.prev_ptr := null; -- points to record before the one we want
- list.current_ptr := list.head;
-
- if list.current_ptr = null then -- empty list, exit procedure
- found := false;
-
- elsif list.current_ptr.search_key = rec_key then -- check list.head of list
- found := true;
- rec_ptr := list.current_ptr.rec_data;
-
- else -- not list.head, search rest of list
- list.prev_ptr := list.current_ptr;
- list.current_ptr := list.current_ptr.next;
- while not found and list.current_ptr /= null loop
-
- if list.current_ptr.search_key = rec_key then
- found := true;
- rec_ptr := list.current_ptr.rec_data;
- else
- list.prev_ptr := list.current_ptr;
- list.current_ptr := list.current_ptr.next;
- end if;
-
- end loop;
- end if;
- end FIND;
-
- procedure CHANGE_LIST_KEY( list : in out list_type; old_key : in key;
- new_key : in key ) is
- ----------------------------------------------------------------------
- --|
- --| NAME: CHANGE_LIST_KEY
- --|
- --| OVERVIEW:
- --| This procedure will change the old_key to the new_key for a list_type.
- --| Since this is a generic package, the programmer would otherwise
- --| not be able to access the key directly from the program.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee February 1985
- --|
- ----------------------------------------------------------------------
- found : boolean;
- rec_ptr : data;
-
- begin
- -- find old key
- FIND ( list, old_key, rec_ptr, found );
- if found then -- change the old_key to the new_key
- list.current_ptr.search_key := new_key;
- end if;
- end CHANGE_LIST_KEY;
-
-
- procedure CHANGE_LIST_DATA( list : in out list_type; a_key : in key;
- new_data : in data ) is
- ----------------------------------------------------------------------
- --|
- --| NAME: CHANGE_LIST_DATA
- --|
- --| OVERVIEW:
- --| This procedure will find a record and change the old_data to
- --| the new_data for a list type. Since this is a generic package,
- --| the programmer would otherwise not be able to access the data
- --| directly from the program.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- ----------------------------------------------------------------------
- found : boolean;
- old_data : data;
-
- begin
- -- find the record
- FIND ( list, a_key, old_data, found );
- if found then -- change the data
- list.current_ptr.rec_data := new_data;
- end if;
- end CHANGE_LIST_DATA;
-
-
- procedure DELETE ( list : in out list_type; rec_key : in key;
- successful : out boolean) is
- ----------------------------------------------------------------------
- --|
- --| NAME: DELETE
- --|
- --| OVERVIEW:
- --| This procedure deletes a record from the linked list by
- --| removing the links to that record. The record is first
- --| found by calling FIND. If it is found, the record is
- --| pointed to by list.current_ptr. The empty list record is
- --| deallocated by calling FREE.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee February 1985
- --|
- ----------------------------------------------------------------------
-
- found : boolean := false; -- if record found in list
- rec_ptr : data;
-
- begin
-
- FIND ( list, rec_key, rec_ptr, found );
- if found then
- if list.prev_ptr = null then -- delete list.head
- if list.head = list.tail then -- one element list
- -- after deletion, it is a null list
- -- list.head and list.tail are null
- FREE( list.head );
- list.head := null;
- list.tail := null;
- else
- list.head := list.head.next;
- FREE( list.current_ptr );
- end if;
-
- else -- not list.head of list, delete from the middle or end of list
- list.prev_ptr.next := list.current_ptr.next;
- FREE( list.current_ptr );
- if list.prev_ptr.next = null then -- just deleted the list.tail
- list.tail := list.prev_ptr; -- reassign the list.tail
- end if;
- end if;
-
- successful := true; -- successfully deleted record
-
- else
- successful := false; -- record not found, so not deleted
- end if;
- end DELETE;
-
- procedure START_WALK (list : in out list_type) is
- ----------------------------------------------------------------------
- --|
- --| NAME: START_WALK
- --|
- --| OVERVIEW:
- --| Start the pointer at the head of the list.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee February 1985
- --|
- ----------------------------------------------------------------------
-
- begin
- list.current_ptr := list.head;
- end START_WALK;
-
- procedure WALK ( list : in out list_type; rec_ptr : out data;
- end_list : out boolean) is
- ----------------------------------------------------------------------
- --|
- --| NAME: WALK
- --|
- --| OVERVIEW:
- --| This procedure walks a linked list one link at a time, returning
- --| the contents of that links data in rec_ptr. It can be used to
- --| write a linked list to file or to print the contents of the list's
- --| data.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee February 1985
- --|
- ----------------------------------------------------------------------
-
- begin
- if list.current_ptr = null then
- end_list := true;
- else
- end_list := false;
- rec_ptr := list.current_ptr.rec_data;
- list.current_ptr := list.current_ptr.next;
- end if;
- end WALK;
-
- end LIST_PKG;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --datapkg.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- with TEXT_IO; with WORK_CALENDAR; with list_pkg;
- use TEXT_IO;
-
- package DATA_PKG is
- --------------------------------------------------------------------------------
- --| NAME: DATA_PKG
- --|
- --| OVERVIEW:
- --| This package defines the five basic data types used in tracker:
- --| activity, element, milestone, personnel, and subsystem.
- --| Each one is a record with a pointer pointing to that record.
- --| The values for the fields are obtained by prompt/response sessions
- --| with the user. Milestone, personnel, and subsystem data each have
- --| as a field of their record, a pointer to the element list. This
- --| field is the list of elements to which that data belongs. The
- --| List_Pkg instantiations for each data type is also in this package.
- --|
- --| In addition to the data types, this package contains the global
- --| variables used in the Global_Package and the counters for each data
- --| type.
- --|
- --| Since most of the other packages with this package, instantiation of
- --| the Calendar_Package and other frequently needed packages is done
- --| in the data package to reduce the number of instantiations throughout
- --| the TRACKER modules.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee February 1985
- --| written by Bonnie Burkhardt March 1985
- --|
- --| NOTES:
- --| The function CONVERT, which is contained in this package, is only
- --| there to correct a quirk in Ada when dealing with enumeration
- --| types that are single characters. We have declared an enumeration
- --| type act_phase_char_set, which is a subset of the ascii character
- --| set. This enumeration type must appear with quotes around it when
- --| getting it from a file or a user, and will be printed with quotes
- --| when put to the screen. We want to be able to declare 1 as a member
- --| of act_phase_char_set, but it is handled literally as '1' (including
- --| the quotes).
- --------------------------------------------------------------------------------
-
- -- data constants
- act_name_max_len : constant natural := 10;
- el_key_max_len : constant natural := 6;
- max_num_activities : constant natural := 10;
- pr_name_max_len : constant natural := 20;
- pr_init_max_len : constant natural := 2;
- sub_name_max_len : constant natural := 10;
-
- package INTEGER_TEXT_IO is new INTEGER_IO(integer); use INTEGER_TEXT_IO;
- package FLOAT_TEXT_IO is new FLOAT_IO(float); use FLOAT_TEXT_IO;
- package BOOLEAN_TEXT_IO is new ENUMERATION_IO(boolean); use BOOLEAN_TEXT_IO;
-
- -- instantiate generic work calendar package
- days_in_work_week : constant integer := 5;
- hours_in_work_day : constant float := 8.0;
- work_days_off_in_year : constant integer := 10;
- package CALENDAR is new WORK_CALENDAR
- (days_in_work_week, hours_in_work_day, work_days_off_in_year);
- use CALENDAR;
-
- subtype ms_num_type is integer range 1..99;
- subtype pr_init_type is string(1..pr_init_max_len );
- subtype ss_name_type is string(1..sub_name_max_len);
- type act_phase_char_set is
- ('0','1','2','3','4','5','6','7','8','9',' ','d','D');
- type activity_phase_percent is array(1..10) of act_phase_char_set;
- AC_PCT_VALUE : constant array (act_phase_char_set) of float
- := (0.0,10.0,20.0,30.0,40.0,50.0,60.0,70.0,80.0,90.0,0.0,100.0,100.0);
-
- -- element data type
- subtype el_key_type is string (1..el_key_max_len);
- type dates_done_type is array (1..max_num_activities) of date_type;
- type hours_left_type is array (1..max_num_activities) of float;
- type people_initials_type is array (1..max_num_activities) of pr_init_type;
- type element_type (two_or_more_people : boolean := false);
- type element_pointer is access element_type;
- type element_type (two_or_more_people : boolean := false) is
- record
- description : string(1..35) := (others => ' ');
- desc_key : el_key_type := (others => ' ');
- subsystem_name : ss_name_type := (others => ' ');
- milestone_num : ms_num_type := 1;
- priority : ms_num_type := 1;
- original_size : integer range 0..99_999 := 0;
- size_done_at_start : integer range 0..99_999 := 0;
- current_size : integer range 0..99_999 := 0;
- complexity : float range 0.1..9.9 := 1.0;
- activity_completeness : activity_phase_percent := (others => ' ');
- hours_to_complete : float := 0.0;
- date_done : date_type := null_date;
- prev_date_done : date_type := null_date;
- date_size_verified : date_type := null_date;
- more_than_one_person : boolean := two_or_more_people;
- case two_or_more_people is
- when FALSE =>
- person_initials : pr_init_type := " ";
- when TRUE =>
- dates_done : dates_done_type := (others => null_date);
- hours_left : hours_left_type := (others => 0.0);
- people_initials : people_initials_type := (others => " ");
- end case;
- end record;
-
- -------------
-
- -- instantiate generic element list handler
- package el_list_pkg is
- new list_pkg (key=> el_key_type, data => element_pointer);
-
- -------------
-
- -- activity phase data
- subtype ac_name_type is string(1..act_name_max_len);
- type activity_type;
- type activity_pointer is access activity_type;
- type activity_type is
- record
- name : ac_name_type := (others => ' ');
- percent_tot_proj : float range 0.0..100.0 := 0.0;
- priority : integer range 1..10 := 1;
- consider_in_calc : boolean := true;
- percent_at_start : float range 0.0..100.0 := 0.0;
- end record;
-
- ------------
-
- -- instantiate generic activity list handler
- package ac_list_pkg is
- new list_pkg (key=> ac_name_type, data => activity_pointer);
-
- ------------
-
- -- milestone data type
- type milestone_type;
- type milestone_pointer is access milestone_type;
- type milestone_type is
- record
- number : ms_num_type := 1;
- completion_number : ms_num_type := 1;
- due_date : date_type := null_date;
- description : string(1..50) := (others => ' ');
- element_list : el_list_pkg.list_type;
- end record;
-
- ------------
-
- -- instantiate generic milestone list handler
- package ms_list_pkg is
- new list_pkg (key=> ms_num_type, data => milestone_pointer);
-
- ------------
-
- -- personnel data type
- type dates_list is array(1..3) of date_type;
- type personnel_type;
- type personnel_pointer is access personnel_type;
- type personnel_type is
- record
- name : string(1..pr_name_max_len ) := (others => ' ');
- initials : pr_init_type := " ";
- production_rate : float range 0.01..99.99 := 1.0;
- hours_per_week : integer range 1..84 := 40;
- start_dates : dates_list := (others => null_date);
- stop_dates : dates_list := (others => null_date);
- element_list : el_list_pkg.list_type;
- end record;
-
- ------------
-
- -- instantiate generic personnel list handler
- package pr_list_pkg is
- new list_pkg (key=> pr_init_type, data => personnel_pointer);
-
- ------------
-
- -- subsystem data type
- type task_numbers_type is array (1..max_num_activities)
- of integer range 0..9999;
- type subsystem_type;
- type subsystem_pointer is access subsystem_type;
- type subsystem_type is
- record
- name : ss_name_type := (others => ' ');
- percent_at_start: float range 0.0..100.0 := 0.0;
- task_numbers : task_numbers_type := (others => 0);
- element_list : el_list_pkg.list_type;
- end record;
-
- ------------
-
- -- instantiate generic subsystem list handler
- package ss_list_pkg is
- new list_pkg (key=> ss_name_type, data => subsystem_pointer);
-
- -----------
-
- -- make data lists visible to the report generator
- ac_list : ac_list_pkg.list_type;
- el_list : el_list_pkg.list_type;
- ms_list : ms_list_pkg.list_type;
- pr_list : pr_list_pkg.list_type;
- ss_list : ss_list_pkg.list_type;
-
- -----------
-
- project_name : string(1..30) := (others => ' ');
- project_number : integer range 0..999 := 0;
- manager_name : string(1..30) := (others => ' ');
- date : date_type := (month => 1, day => 1, year => 1980);
- num_of_activities : integer := 0;
- num_of_elements : integer := 0;
- num_of_milestones : integer := 0;
- num_of_people : integer := 0;
- num_of_subsystems : integer := 0;
-
- -----------
-
- function CONVERT (char : character) return act_phase_char_set;
- function CONVERT (quote_char : act_phase_char_set) return character;
-
- end DATA_PKG;
-
-
-
- with text_io; use text_io;
- package body DATA_PKG is
-
- package QUOTE_IO is new ENUMERATION_IO(act_phase_char_set);
- use QUOTE_IO;
-
- function CONVERT (char : character) return act_phase_char_set is
- ASTRING : string (1..3) := "' '";
- quote_char : act_phase_char_set := ' ';
- dumb : integer := 1; -- returns the number of the last char read
- begin
- astring (2) := char;
- -- read astring and return the enumeration value in quote_char
- get(astring,quote_char,dumb);
- return quote_char;
- end CONVERT;
-
- function CONVERT (quote_char : act_phase_char_set) return character is
- ASTRING : string (1..3) := "' '";
- char : character := ' ';
- begin
- -- output the value of quote_char to astring
- put(astring,quote_char);
- char := astring (2);
- return char;
- end CONVERT;
-
- end DATA_PKG;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --vt100s.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- with DATA_PKG; use DATA_PKG;
- package VT100 is
- print_report : array(1..12) of boolean := (others => false);
- procedure CLEAR_SCREEN;
- function PRINT_REPORT_MENU return integer;
- function PRINT_DATA_MENU return integer;
- function PRINT_GLOBAL_MENU return integer;
- function PRINT_OPERATION_MENU return integer;
- function PRINT_EL_OPERATION_MENU return integer;
- function PRINT_EL_GROUPS return integer;
- function PRINT_AC_MENU (AC_PTR : in activity_pointer) return integer;
- function PRINT_EL_MENU (EL_PTR : in element_pointer) return integer;
- function PRINT_MS_MENU (MS_PTR : in milestone_pointer) return integer;
- function PRINT_PR_MENU (PR_PTR : in personnel_pointer) return integer;
- function PRINT_SS_MENU (SS_PTR : in subsystem_pointer) return integer;
- procedure TRACKER_INTRO;
- procedure GOODBYE_MESSAGE;
- end VT100;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --vt100b.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- with DATA_PKG; use DATA_PKG;
- with text_io; use text_io;
-
- package body VT100 is
- ----------------------------------------------------------------------
- --|
- --| NAME: VT100
- --|
- --| OVERVIEW:
- --| This package maintains actions that affect the screen display.
- --| Various menus can be displayed by passing the appropriate
- --| parameter to the function PRINT. The user's selection from
- --| the displayed menu is returned.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- ----------------------------------------------------------------------
-
- use CALENDAR;
- use FLOAT_TEXT_IO;
- use INTEGER_TEXT_IO;
- use BOOLEAN_TEXT_IO;
-
- response : integer;
-
- procedure CLEAR_SCREEN is separate;
- function PRINT_REPORT_MENU return integer is separate;
- function PRINT_DATA_MENU return integer is separate;
- function PRINT_GLOBAL_MENU return integer is separate;
- function PRINT_OPERATION_MENU return integer is separate;
- function PRINT_EL_OPERATION_MENU return integer is separate;
- function PRINT_EL_GROUPS return integer is separate;
- function PRINT_AC_MENU (AC_PTR : in activity_pointer) return integer
- is separate;
- function PRINT_EL_MENU (EL_PTR : in element_pointer) return integer
- is separate;
- function PRINT_MS_MENU (MS_PTR : in milestone_pointer) return integer
- is separate;
- function PRINT_PR_MENU (PR_PTR : in personnel_pointer) return integer
- is separate;
- function PRINT_SS_MENU (SS_PTR : in subsystem_pointer) return integer
- is separate;
- procedure TRACKER_INTRO is separate;
- procedure GOODBYE_MESSAGE is separate;
-
- end VT100;
-
- separate( VT100 )
- procedure CLEAR_SCREEN is
- ----------------------------------------------------------------------
- --|
- --| NAME: CLEAR_SCREEN
- --|
- --| OVERVIEW:
- --| This procedure clears the screen on a vt100 using an escape code
- --| sequence.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- ----------------------------------------------------------------------
- escape : constant character := ascii.esc;
- l_bracket : constant character := ascii.l_bracket;
- clear_screen : string(1..80);
- begin
- put(escape);
- put(l_bracket);
- put('H');
- put(escape);
- put(l_bracket);
- put('J');
- end CLEAR_SCREEN;
-
- separate( VT100 )
- function PRINT_REPORT_MENU return integer is
- ----------------------------------------------------------------------
- --|
- --| NAME: PRINT_REPORT_MENU
- --|
- --| OVERVIEW:
- --| The report menu consists of the various reports a user is allowed
- --| to print.
- --|
- --| EXCEPTIONS HANDLED:
- --| others the user is reprompted
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- ----------------------------------------------------------------------
-
- begin
- loop
- begin
- CLEAR_SCREEN;
- put_line(" REPORT MENU ");
- put_line("==============================================================");
- new_line;
- put_line("Choose the number of the report that you would like generated.");
- put_line(" The star(s) indicate that you have already requested that ");
- put_line(" report to be generated. ");
- new_line(2);
-
- if print_report(1) then
- put_line(" * 1) Parameter Data List");
- else
- put_line(" 1) Parameter Data List");
- end if;
-
- if print_report(2) then
- put_line(" * 2) Comments File ");
- else
- put_line(" 2) Comments File ");
- end if;
-
- if print_report(3) then
- put_line(" * 3) All Element Status Report");
- else
- put_line(" 3) All Element Status Report");
- end if;
-
- if print_report(4) then
- put_line(" * 4) List By Subsystem");
- else
- put_line(" 4) List By Subsystem");
- end if;
-
- if print_report(5) then
- put_line(" * 5) List By Milestone ");
- else
- put_line(" 5) List By Milestone ");
- end if;
-
- if print_report(6) then
- put_line(" * 6) List By Person");
- else
- put_line(" 6) List By Person");
- end if;
-
- if print_report(7) then
- put_line(" * 7) Subsystem Summary");
- else
- put_line(" 7) Subsystem Summary");
- end if;
-
- if print_report(8) then
- put_line(" * 8) Milestone Summary");
- else
- put_line(" 8) Milestone Summary");
- end if;
-
- if print_report(9) then
- put_line(" * 9) Work Units Per Subsystem ");
- else
- put_line(" 9) Work Units Per Subsystem ");
- end if;
-
- if print_report(10) then
- put_line(" * 10) Percent Completion Of Work Within Subsystem ");
- else
- put_line(" 10) Percent Completion Of Work Within Subsystem ");
- end if;
-
- if print_report(11) then
- put_line(" * 11) Distribution Of Remaining Work Within Subsystems");
- else
- put_line(" 11) Distribution Of Remaining Work Within Subsystems");
- end if;
-
- if print_report(12) then
- put_line(" * 12) Completion Date For Milestones");
- else
- put_line(" 12) Completion Date For Milestones");
- end if;
-
- put_line(" 13) All Of The Above and EXIT ");
- new_line;
-
- put_line(" 14) EXIT FROM TRACKER ");
-
- get(response);
- skip_line;
- return response;
- exception
- when others =>
- skip_line;
- new_line;
- put_line(" Please enter a number between 1 and 14. ");
- delay 1.0;
- end;
- end loop;
- end PRINT_REPORT_MENU;
-
-
- separate( VT100 )
- function PRINT_DATA_MENU return integer is
- ----------------------------------------------------------------------
- --|
- --| NAME: PRINT_DATA_MENU
- --|
- --| OVERVIEW:
- --| This procedure displays the different types of data that can be
- --| manipulated.
- --|
- --| EXCEPTIONS HANDLED:
- --| others the user is reprompted
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- ----------------------------------------------------------------------
-
- begin
- loop
- begin
- CLEAR_SCREEN;
- put_line(" DATA MENU ");
- put_line("=======================================================");
- new_line(3);
- put_line("Choose the number of one of the following data types ");
- put_line("that you would like to manipulate: ");
- new_line(2);
- put_line(" 1) Global ");
- put_line(" 2) Activity ");
- put_line(" 3) Personnel ");
- put_line(" 4) Milestones ");
- put_line(" 5) Subsystem ");
- put_line(" 6) Element ");
- new_line;
- put_line(" 7) Done With Data - EXIT from Data Menu");
-
- get(response);
- skip_line;
- new_line(2);
- return response;
- exception
- when others =>
- skip_line;
- new_line;
- put_line(" Please enter a number between 1 and 7. ");
- delay 1.0;
- end;
- end loop;
- end PRINT_DATA_MENU;
-
-
- separate( VT100 )
- function PRINT_GLOBAL_MENU return integer is
- ----------------------------------------------------------------------
- --|
- --| NAME: PRINT_GLOBAL_MENU
- --|
- --| OVERVIEW:
- --| This procedure displays the global variables that can be manipulated.
- --|
- --| EXCEPTIONS HANDLED:
- --| others the user is reprompted
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- ----------------------------------------------------------------------
- begin
- loop
- begin
- CLEAR_SCREEN;
- put_line(" GLOBAL DATA MENU ");
- put_line("=======================================================");
- new_line(3);
- put_line("Choose the number of one of the following global ");
- put_line("variables that you would like to modify: ");
- new_line(2);
- put(" 1) Project Name "); put(project_name); new_line;
- put(" 2) Project Number "); put(project_number,3); new_line;
- put(" 3) Project Manager's Name "); put(manager_name); new_line;
- put(" 4) Date the TRACKER Run is Valid for ");
- if date = null_date then
- put(" null date ");
- else
- put( date.month,2 ); put("/");
- put( date.day ,2 ); put("/");
- put( date.year ,4 );
- end if;
- new_line(2);
- put_line(" 5) Done With Data - EXIT from Global Data Menu");
-
- get(response);
- skip_line;
- new_line(2);
- return response;
- exception
- when others =>
- skip_line;
- new_line;
- put_line(" Please enter a number between 1 and 5. ");
- delay 1.0;
- end;
- end loop;
- end PRINT_GLOBAL_MENU;
-
-
- separate( VT100 )
- function PRINT_OPERATION_MENU return integer is
- ----------------------------------------------------------------------
- --|
- --| NAME: PRINT_OPERATION_MENU
- --|
- --| OVERVIEW:
- --| This procedure displays the operations that can be performed on
- --| a data type.
- --|
- --| EXCEPTIONS HANDLED:
- --| others the user is reprompted
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- ----------------------------------------------------------------------
- begin
- loop
- begin
- CLEAR_SCREEN;
- put_line(" OPERATIONS MENU ");
- put_line("=======================================================");
- new_line(3);
- put_line("Choose the number of one of the following operations ");
- put_line("that you would like to perform: ");
- new_line(2);
- put_line(" 1) Add ");
- put_line(" 2) Delete ");
- put_line(" 3) Modify ");
- put_line(" 4) Display the Current Data");
- new_line;
- put_line(" 5) Done With Data - EXIT from Operations Menu");
-
- get(response);
- skip_line;
- new_line(2);
- return response;
- exception
- when others =>
- skip_line;
- new_line;
- put_line(" Please enter a number between 1 and 5. ");
- delay 1.0;
- end;
- end loop;
- end PRINT_OPERATION_MENU;
-
-
- separate( VT100 )
- function PRINT_EL_OPERATION_MENU return integer is
- ----------------------------------------------------------------------
- --|
- --| NAME: PRINT_EL_OPERATION_MENU
- --|
- --| OVERVIEW:
- --| This procedure displays the operations that can be performed on
- --| an element data type.
- --|
- --| EXCEPTIONS HANDLED:
- --| others the user is reprompted
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- ----------------------------------------------------------------------
- begin
- loop
- begin
- CLEAR_SCREEN;
- put_line(" ELEMENT DATA OPERATIONS MENU ");
- put_line("=======================================================");
- new_line(3);
- put_line("Choose the number of one of the following operations ");
- put_line("that you would like to perform: ");
- new_line(2);
- put_line(" 1) Add ");
- put_line(" 2) Delete ");
- put_line(" 3) Modify ");
- put_line(" 4) Display the Current Data");
- put_line(" 5) Quick Update of the Current Size");
- put_line(" 6) Quick Update of the Activity Percent Complete");
- new_line;
- put_line(" 7) Done With Data - EXIT from Operations Menu");
-
- get(response);
- skip_line;
- new_line(2);
- return response;
- exception
- when others =>
- skip_line;
- new_line;
- put_line(" Please enter a number between 1 and 7. ");
- delay 1.0;
- end;
- end loop;
- end PRINT_EL_OPERATION_MENU;
-
-
-
- separate( VT100 )
- function PRINT_EL_GROUPS return integer is
- ----------------------------------------------------------------------
- --|
- --| NAME: PRINT_EL_GROUPS
- --|
- --| OVERVIEW:
- --| This procedure displays the different groups of element data that
- --| can be updated with the quick update.
- --|
- --| EXCEPTIONS HANDLED:
- --| others the user is reprompted
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- ----------------------------------------------------------------------
- begin
- loop
- begin
- CLEAR_SCREEN;
- put_line(" ELEMENT DATA GROUPS MENU ");
- put_line("=======================================================");
- new_line(3);
- put_line("Choose the number of one of the following groups of");
- put_line("element data that you would like do a quick update on : ");
- new_line(2);
- put_line(" 1) All Elements ");
- put_line(" 2) Elements belonging to a Milestone ");
- put_line(" 3) Elements belonging to a Person ");
- put_line(" 4) Elements belonging to a Subsystem ");
- new_line;
- put_line(" 5) Done With Data - EXIT from Operations Menu");
-
- get(response);
- skip_line;
- new_line(2);
- return response;
- exception
- when others =>
- skip_line;
- new_line;
- put_line(" Please enter a number between 1 and 5. ");
- delay 1.0;
- end;
- end loop;
- end PRINT_EL_GROUPS;
-
-
- separate( VT100 )
- function PRINT_AC_MENU (AC_PTR : in activity_pointer) return integer is
- ----------------------------------------------------------------------
- --|
- --| NAME: PRINT_AC_MENU
- --|
- --| OVERVIEW:
- --| This procedure displays the fields that can be changed on
- --| an activity type.
- --|
- --| EXCEPTIONS HANDLED:
- --| others the user is reprompted
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- ----------------------------------------------------------------------
- begin
- loop
- begin
- CLEAR_SCREEN;
- put_line(" ACTIVITY DATA MENU ");
- put_line("==========================================================");
- new_line(3);
- put_line("Choose the number of one of the following activity fields ");
- put_line("that you would like to modify: ");
- new_line(2);
- put(" 1) Activity Name "); put(ac_ptr.name);
- new_line;
- put(" 2) Percentage of the Total Project ");
- put(ac_ptr.percent_tot_proj, 3, 1, 0 ); put("%"); new_line;
- put(" 3) Priority "); put(ac_ptr.priority, 2);
- new_line;
- put(" 4) Consider In Calculations ");
- put(ac_ptr.consider_in_calc); new_line;
- put(" 5) Percent At Start ");
- put(ac_ptr.percent_at_start, 3, 1, 0); put("%"); new_line;
- new_line;
- put_line(" 6) Done With Data - EXIT from Activity Data Menu");
- get(response);
- skip_line;
- new_line(2);
- return response;
- exception
- when others =>
- skip_line;
- new_line;
- put_line(" Please enter a number between 1 and 13. ");
- delay 1.0;
- end;
- end loop;
- end PRINT_AC_MENU;
-
-
-
- separate( VT100 )
- function PRINT_EL_MENU (EL_PTR : in element_pointer) return integer is
- ----------------------------------------------------------------------
- --|
- --| NAME: PRINT_EL_MENU
- --|
- --| OVERVIEW:
- --| This procedure displays the fields that can be changed on
- --| an element type.
- --|
- --| EXCEPTIONS HANDLED:
- --| others the user is reprompted
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- ----------------------------------------------------------------------
- begin
- loop
- begin
- CLEAR_SCREEN;
- put_line(" ELEMENT DATA MENU ");
- put_line("==========================================================");
- new_line(3);
- put_line("Choose the number of one of the following element fields ");
- put_line("that you would like to modify: ");
- new_line(2);
- put(" 1) Element Description "); put(el_ptr.description); new_line;
- put(" 2) Description Abbreviation "); put(el_ptr.desc_key); new_line;
- put(" 3) Subsystem Name "); put(el_ptr.subsystem_name);
- new_line;
- if not el_ptr.more_than_one_person then
- put(" 4) Person's Initials ");
- put(el_ptr.person_initials);
- else
- put(" 4) People's Initials ");
- for ac_index in 1..num_of_activities loop
- put (el_ptr.people_initials(ac_index));
- if ac_index < num_of_activities then
- put(',');
- end if;
- end loop;
- end if;
- new_line;
- put(" 5) Milestone Number "); put(el_ptr.milestone_num,2);
- new_line;
- put(" 6) Element Priority "); put(el_ptr.priority,2);
- new_line;
- put(" 7) Current Size "); put(el_ptr.current_size,7);
- new_line;
- put(" 8) Complexity "); put(el_ptr.complexity,1,2,0);
- new_line;
- put(" 9) Activity Completeness '");
- for i in 1..num_of_activities loop
- put( CONVERT( el_ptr.activity_completeness(i) ));
- end loop;
- put("'");
- new_line;
- put(" 10) More than one person assigned "); put(el_ptr.more_than_one_person);
- new_line;
- new_line(2);
- put_line(" 11) Done With Data - EXIT from Element Data Menu");
- get(response); skip_line;
- new_line(2);
- return response;
- exception
- when others =>
- skip_line;
- new_line;
- put_line(" Please enter a number between 1 and 10. ");
- delay 1.0;
- end;
- end loop;
- end PRINT_EL_MENU;
-
-
-
- separate( VT100 )
- function PRINT_MS_MENU (MS_PTR : in milestone_pointer) return integer is
- ----------------------------------------------------------------------
- --|
- --| NAME: PRINT_MS_MENU
- --|
- --| OVERVIEW:
- --| This procedure displays the fields that can be changed on
- --| a milestone type.
- --|
- --| EXCEPTIONS HANDLED:
- --| others the user is reprompted
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- ----------------------------------------------------------------------
- begin
- loop
- begin
- CLEAR_SCREEN;
- put_line(" MILESTONE DATA MENU ");
- put_line("=============================================================");
- new_line(3);
- put_line("Choose the number of one of the following milestone fields ");
- put_line("that you would like to modify: ");
- new_line(2);
- put(" 1) Milestone Number "); put(MS_ptr.number,2); new_line;
- put(" 2) Completion Number "); put(ms_ptr.completion_number,2); new_line;
- put(" 3) Due Date ");
- if ms_ptr.due_date = null_date then
- put("null date ");
- else
- put(ms_ptr.due_date.month,2); put("/");
- put(ms_ptr.due_date.day,2); put("/");
- put(ms_ptr.due_date.year,4);
- end if;
- new_line;
- put(" 4) Description "); put(ms_ptr.description); new_line;
- new_line;
- put_line(" 5) Done With Data - EXIT from Milestone Data Menu");
- get(response);
- skip_line;
- new_line(2);
- return response;
- exception
- when others =>
- skip_line;
- new_line;
- put_line(" Please enter a number between 1 and 5. ");
- delay 1.0;
- end;
- end loop;
- end PRINT_MS_MENU;
-
-
- separate( VT100 )
- function PRINT_PR_MENU (PR_PTR : in personnel_pointer) return integer is
- ----------------------------------------------------------------------
- --|
- --| NAME: PRINT_PR_MENU
- --|
- --| OVERVIEW:
- --| This procedure displays the fields that can be changed on
- --| a personnel type.
- --|
- --| EXCEPTIONS HANDLED:
- --| others the user is reprompted
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- ----------------------------------------------------------------------
- begin
- loop
- begin
- CLEAR_SCREEN;
- put_line(" PERSONNEL DATA MENU ");
- put_line("==========================================================");
- new_line(3);
- put_line("Choose the number of one of the following personnel fields ");
- put_line("that you would like to modify: ");
- new_line(2);
- put(" 1) Person's Name "); put(pr_ptr.name); new_line;
- put(" 2) Person's Initials "); put(pr_ptr.initials); new_line;
- put(" 3) Production Rate "); put(pr_ptr.production_rate, 2, 3, 0);
- new_line;
- put(" 4) Hours Per Week "); put(pr_ptr.hours_per_week,2); new_line;
- put(" 5) First Start/Stop Date ");
- if pr_ptr.start_dates(1) = null_date then
- put("null date ");
- else
- put(pr_ptr.start_dates(1).month,2); put("/");
- put(pr_ptr.start_dates(1).day,2); put("/");
- put(pr_ptr.start_dates(1).year,4);
- end if;
- put(" ");
- if pr_ptr.stop_dates(1) = null_date then
- put("null date ");
- else
- put(pr_ptr.stop_dates(1).month,2); put("/");
- put(pr_ptr.stop_dates(1).day,2); put("/");
- put(pr_ptr.stop_dates(1).year,4);
- end if;
- new_line;
- put(" 6) Second Start/Stop Date ");
- if pr_ptr.start_dates(2) = null_date then
- put("null date ");
- else
- put(pr_ptr.start_dates(2).month,2); put("/");
- put(pr_ptr.start_dates(2).day,2); put("/");
- put(pr_ptr.start_dates(2).year,4);
- end if;
- put(" ");
- if pr_ptr.stop_dates(2) = null_date then
- put("null date ");
- else
- put(pr_ptr.stop_dates(2).month,2); put("/");
- put(pr_ptr.stop_dates(2).day,2); put("/");
- put(pr_ptr.stop_dates(2).year,4);
- end if;
- new_line;
- put(" 7) Third Start/Stop Date ");
- if pr_ptr.start_dates(3) = null_date then
- put("null date ");
- else
- put(pr_ptr.start_dates(3).month,2); put("/");
- put(pr_ptr.start_dates(3).day,2); put("/");
- put(pr_ptr.start_dates(3).year,4);
- end if;
- put(" ");
- if pr_ptr.stop_dates(3) = null_date then
- put("null date ");
- else
- put(pr_ptr.stop_dates(3).month,2); put("/");
- put(pr_ptr.stop_dates(3).day,2); put("/");
- put(pr_ptr.stop_dates(3).year,4);
- end if;
- new_line(2);
- put_line(" 8) Done With Data - EXIT from Personnel Data Menu");
- get(response);
- skip_line;
- new_line(2);
- return response;
- exception
- when others =>
- skip_line;
- new_line;
- put_line(" Please enter a number between 1 and 8. ");
- delay 1.0;
- end;
- end loop;
- end PRINT_PR_MENU;
-
-
- separate( VT100 )
- function PRINT_SS_MENU (SS_PTR : in subsystem_pointer) return integer is
- ----------------------------------------------------------------------
- --|
- --| NAME: PRINT_SS_MENU
- --|
- --| OVERVIEW:
- --| This procedure displays the fields that can be changed on
- --| a subsystem type.
- --|
- --| EXCEPTIONS HANDLED:
- --| others the user is reprompted
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- ----------------------------------------------------------------------
- begin
- loop
- begin
- CLEAR_SCREEN;
- put_line(" SUBSYSTEM DATA MENU ");
- put_line("==========================================================");
- new_line(3);
- put_line("Choose the number of one of the following subsystem fields ");
- put_line("that you would like to modify: ");
- new_line(2);
- put(" 1) Subsystem Name "); put(ss_ptr.name); new_line;
- put(" 2) Task Numbers "); new_line;
- put(" 3) Percent At Start "); put(ss_ptr.percent_at_start,3,1,0);
- put("%");
- new_line(2);
- put_line(" 4) Done With Data - EXIT from Subsystem Data Menu");
- get(response);
- skip_line;
- new_line(2);
- return response;
- exception
- when others =>
- skip_line;
- new_line;
- put_line(" Please enter a number between 1 and 4. ");
- delay 1.0;
- end;
- end loop;
- end PRINT_SS_MENU;
-
- separate( VT100 )
- procedure TRACKER_INTRO is
- ----------------------------------------------------------------------
- --|
- --| NAME: TRACKER_INTRO
- --|
- --| OVERVIEW:
- --| This procedure prints the TRACKER banner introduction on the
- --| terminal screen.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- ----------------------------------------------------------------------
- begin
- CLEAR_SCREEN;
- new_line(6);
- put_line(" +-----------------------+ ");
- put_line(" | T R A C K E R | ");
- put_line(" +-----------------------+ ");
- new_line;
- put_line(" Ada Version 1.0 ");
- delay 1.0;
- CLEAR_SCREEN;
- end TRACKER_INTRO;
-
-
- separate( VT100 )
- procedure GOODBYE_MESSAGE is
- ----------------------------------------------------------------------
- --|
- --| NAME: GOODBYE_MESSAGE
- --|
- --| OVERVIEW:
- --| This procedure prints the TRACKER exit message on the
- --| terminal screen.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- ----------------------------------------------------------------------
- begin
- new_line(15);
- put_line(" BYE");
- new_line(15);
- end GOODBYE_MESSAGE;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --prompts.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- with DATA_PKG; use DATA_PKG;
- with TEXT_IO; use TEXT_IO;
-
- package PROMPT_PKG is
- use CALENDAR;
-
- function PROJECT_NAME return string;
- function PROJECT_NUM return integer;
- function TASK_NUMBERS( ss_record : in subsystem_pointer )
- return task_numbers_type;
- function TASK_NUMBER_BY_AC( ss_record : in subsystem_pointer )
- return integer;
- function MANAGER_NAME return string;
- function ELE_DESCRIPTION return string;
- procedure DISPLAY_ELEMENT_DATA;
- procedure EXISTING_ELE_KEY ( abort_proc : out boolean;
- key : out el_key_type );
- function NEW_ELE_KEY return el_key_type;
- procedure DISPLAY_SUBSYSTEM_DATA;
- procedure EXISTING_SUBSYS_NAME ( abort_proc : out boolean;
- key : out ss_name_type );
- function NEW_SUBSYS_NAME return ss_name_type;
- procedure DISPLAY_PERSONNEL_DATA;
- procedure EXISTING_PERSON_INITIALS ( abort_proc : out boolean;
- key : out pr_init_type );
- function NEW_PERSON_INITIALS return pr_init_type;
- procedure DISPLAY_MILESTONE_DATA;
- procedure EXISTING_MILSTONE_NUMBER ( abort_proc : out boolean;
- key : out ms_num_type );
- function NEW_MILSTONE_NUMBER return ms_num_type;
- function MILESTONE_COMPLETION_NUMBER (default : in ms_num_type)
- return ms_num_type;
- function ELEMENT_PRIORITY (default : in ms_num_type) return ms_num_type;
- function CURRENT_SIZE_EST return integer;
- function ORIG_SIZE_EST (default : in integer := 0) return integer;
- function UPDATE_CURRENT_SIZE (old_size : in integer) return integer;
- function COMPLEXITY_FACTOR return float;
- function ACTIV_COMPLETENESS return ACTIVITY_PHASE_PERCENT;
- function UPDATE_ACTIV_COMPLETENESS
- (old_pct_complete : in activity_phase_percent)
- return ACTIVITY_PHASE_PERCENT;
- procedure DISPLAY_ACTIVITY_DATA;
- procedure EXISTING_ACTIV_NAME ( abort_proc : out boolean;
- key : out ac_name_type );
- function NEW_ACTIV_NAME return ac_name_type;
- function ACTIV_PRIORITY return integer;
- function CONSIDER_AC_IN_CALC return boolean;
- function MS_DESCRIPTION return string;
- function PERSONS_NAME return string;
- function PR_PRODUCTION_RATE return float;
- function PR_HRS_PER_WEEK return integer;
- function PERCENT return float;
- function DATE return DATE_TYPE;
- end PROMPT_PKG;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --promptb.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- with DATA_PKG; use DATA_PKG;
- with TEXT_IO; use TEXT_IO;
-
- package body PROMPT_PKG is
- ----------------------------------------------------------------------
- --|
- --| NAME: PROMPT_PKG
- --|
- --| OVERVIEW:
- --| This package contains the user prompt messages that will be displayed
- --| on the screen. The prompts will only return valid data. The user is
- --| trapped until a valid entry is received. If the data being requested
- --| has a default value, the user may respond with a carriage return. If,
- --| the user responds with '?' ( or anything else that causes an exception),
- --| then the prompt will be expanded to give the user more information on
- --| the type of data to enter. For data that does not have a default value,
- --| a carriage return or '?' will display the extended prompt. Otherwise,
- --| the data is received from the user and processed accordingly. If the
- --| data is invalid, the user will be prompted again until valid data
- --| can be returned.
- --|
- --| EXCEPTIONS HANDLED:
- --| others any illegal input from the user
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- --| NOTES:
- --| The search key for each data type has two types of prompts :
- --| one for an existing key, and one for a new key that is not
- --| already in the list.
- --|
- --| This package also provides procedures to display the keys of each
- --| data list to the screen.
- ----------------------------------------------------------------------
-
- use INTEGER_TEXT_IO;
- use FLOAT_TEXT_IO;
-
- -- instantiation of generic list handler is done in data_pkg
- use AC_LIST_PKG; -- to get the activity completeness
- use EL_LIST_PKG;
- use MS_LIST_PKG;
- use PR_LIST_PKG;
- use SS_LIST_PKG;
-
- line_lngth : integer := 1;
- line : string (1..132) := (others => ' ');
- tab : constant character := ascii.ht;
-
- -- to convert the enumeration type activity_phase_percent to character
- -- for read and write into the file only
- type ac_phase_char_type is array(1..10) of character;
- char_ac_completeness : ac_phase_char_type := (others => ' ');
-
-
-
-
- function PROJECT_NAME return string is
- begin
- -- blank out the input line
- line := (others => ' ');
-
- -- ask abbreviated question
- put(" Project Name : ");
-
- loop
- while end_of_line loop
- skip_line;
- new_line;
- put_line(" What is the name of the project in 30 characters or less?");
- new_line;
- put(" Project Name : ");
- end loop;
-
- -- get the record field
- get_line(line,line_lngth);
- new_line(2);
- exit when line(1) /= '?';
-
- put_line(" What is the name of the project in 30 characters or less?");
- new_line;
- put(" Project Name : ");
- end loop;
- return line(1..DATA_PKG.project_name'last);
- end PROJECT_NAME;
-
- function PROJECT_NUM return integer is
- ---------------------------------
- -- Project Number
- ---------------------------------
- an_integer : integer range 0..999;
- valid_input : boolean := false; -- if user input was valid
-
- begin
- while not valid_input loop
- begin
- -- ask abbreviated question
- put (" Project Number : ");
-
- while end_of_line loop -- keep asking question if the user hits <cr>
- skip_line;
- new_line;
- put_line(" What is the 3 digit project number? ");
- put_line(" Enter an integer in the range 0 to 999 ");
- new_line;
- put (" Project Number : ");
- end loop;
- get( an_integer ); skip_line;
- new_line(2);
- valid_input := true;
- exception
- when others =>
- skip_line;
- new_line;
- put_line(" What is the 3 digit project number? ");
- put_line(" Enter an integer in the range 0 to 999 ");
- new_line;
- end;
- end loop;
- return an_integer;
- end PROJECT_NUM;
-
-
- function TASK_NUMBERS( ss_record : in subsystem_pointer ) return
- task_numbers_type is
- ac_record : activity_pointer;
- blanks : constant string (1..sub_name_max_len+2) := (others => ' ');
- end_list : boolean := true;
- input_line : string (1..80) := ( others => ' ');
- last_char : integer := 0;
- last : integer := 0;
- new_task_num : task_numbers_type := (others => 0);
- num_read : integer := 0; -- num of new task numbers read
- tasknum_end : integer := 1;
- tasknum_start: integer := 1;
-
- begin
- loop
- begin
- put_line(" Enter the new task numbers directly below the old task numbers. ");
- put_line(" You may enter blanks for the task numbers that you want to leave");
- put_line(" the same, so that you can change one task number at a time.");
- put_line(" DO NOT USE TABS! [ <cr> = no change ]");
- new_line;
- -- print header
- put(blanks);
- START_WALK( ac_list );
- loop
- WALK( ac_list, ac_record, end_list );
- exit when end_list;
- put(ac_record.name(1..4));
- put(" ");
- end loop;
- new_line;
- put(blanks);
- for i in 1..num_of_activities loop
- put ("---- ");
- end loop;
- new_line;
-
- -- output the task numbers
- put(ss_record.name); put(" ");
- for i in 1..num_of_activities loop
- put (ss_record.task_numbers(i),4);
- put (" ");
- end loop;
- new_line;
- put(ss_record.name); put(": ");
-
- if end_of_line then
- skip_line;
- return ss_record.task_numbers;
- else
- tasknum_start := 1;
- get_line( input_line, last_char );
- -- parse the line
- for i in 1..num_of_activities loop
- exit when tasknum_start > last_char;
- num_read := num_read + 1;
- tasknum_end := tasknum_start+3;
- if tasknum_end > last_char then
- tasknum_end := last_char;
- end if;
- if input_line(tasknum_start..tasknum_end) =
- blanks( 1..tasknum_end - tasknum_start + 1 )then
- -- default to old task number
- new_task_num(num_read) := ss_record.task_numbers(num_read);
- else
- -- get new task number
- get( input_line(tasknum_start..tasknum_end),
- new_task_num(num_read), last );
- end if;
- -- skip task num and blank
- tasknum_start := tasknum_start + 6;
- end loop;
- if num_read < num_of_activities then -- didn't change all task numbers
- -- leave the rest of the task numbers unchanged
- new_task_num(num_read+1..num_of_activities) :=
- ss_record.task_numbers(num_read+1..num_of_activities);
- end if;
- return new_task_num;
- end if;
- exception
- when others =>
- new_line;
- put_line(" That was not a valid input. Enter the four digit ");
- put_line(" task number for each activity. ");
- new_line;
- end;
- end loop;
- end TASK_NUMBERS;
-
-
- function TASK_NUMBER_BY_AC( ss_record : in subsystem_pointer ) return
- integer is
- ac_record : activity_pointer;
- a_task_num : integer range 0..9999 := 0;
- ac_index : integer := 0;
- blanks : constant string (1..sub_name_max_len+2) := (others => ' ');
- end_list : boolean := true;
-
- begin
- put_line(" Enter the new task number (range 0 to 9999).");
- put_line(" DO NOT USE TABS! [ <cr> = 0 ]");
- new_line;
- loop
- begin
- -- print header of the last activity
- put(blanks);
- START_WALK( ac_list );
- loop
- WALK( ac_list, ac_record, end_list );
- exit when end_list;
- ac_index := ac_index + 1;
- end loop;
-
- put(ac_record.name(1..4));
- put(" "); new_line;
- put(blanks); put ("---- "); new_line;
-
- -- output the task number prompt
- put(ss_record.name); put(": ");
-
- if end_of_line then
- skip_line; new_line;
- return a_task_num;
- else
- get(a_task_num);
- skip_line; new_line;
- return a_task_num;
- end if;
- exception
- when others => skip_line; new_line;
- put_line(" Enter the new task number (range 0 to 9999).");
- put_line(" DO NOT USE TABS! [ <cr> = 0 ]");
- new_line;
- end;
- end loop;
- end TASK_NUMBER_BY_AC;
-
-
- function MANAGER_NAME return string is
- begin
- -- blank out the input line
- line := (others => ' ');
-
- -- ask abbreviated question
- put(" Manager Name : ");
-
- loop
- while end_of_line loop -- keep asking question if the user hits <cr>
- new_line;
- skip_line;
- put_line(" What is the project manager's name in 30 characters or less?");
- new_line;
- put(" Manager Name : ");
- end loop;
-
- -- get the record field
- get_line(line,line_lngth);
- new_line(2);
- exit when line(1) /= '?';
-
- put_line(" What is the project manager's name in 30 characters or less?");
- new_line;
- put(" Manager Name : ");
- end loop;
- return line(1..DATA_PKG.manager_name'last);
- end MANAGER_NAME;
-
-
- function ELE_DESCRIPTION return string is
- ---------------------------------
- -- Element Description
- ---------------------------------
- begin
- -- blank out the input line
- line := (others => ' ');
-
- loop
- -- ask abbreviated question
- put(" Element description : ");
-
- while end_of_line loop -- keep asking question if the user hits <cr>
- skip_line;
- new_line;
- put_line(" What is the description of the element in 35 characters or less?");
- new_line;
- put(" Element description : ");
- end loop;
-
- -- get the record field
- get_line(line,line_lngth);
- new_line(2);
- exit when line(1) /= '?';
-
- new_line;
- put_line(" What is the description of the element in 35 characters or less?");
- new_line;
- end loop;
- return line(1..35);
- end ELE_DESCRIPTION;
-
-
- procedure DISPLAY_ELEMENT_DATA is
- ------------------------------------------------------------------------------
- --|
- --| NAME: DISPLAY_ELEMENT_DATA
- --|
- --| OVERVIEW:
- --| This procedure walks the list and prints the name of each element
- --| to the screen.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- ------------------------------------------------------------------------------
- tab : constant character := ascii.ht;
- el_record : element_pointer; -- pointer to the element record
- end_list : boolean := false; -- parameter to WALK
-
- begin
- if not EMPTY_LIST( el_list ) then
- put_line(" The existing elements are : ");
- new_line;
- START_WALK( el_list );
- end_list := false;
- loop
- WALK( el_list, el_record, end_list);
- exit when end_list;
- put(el_record.desc_key); put(tab); put(el_record.description); new_line;
- end loop;
- new_line;
- end if;
- end DISPLAY_ELEMENT_DATA;
-
-
-
- procedure EXISTING_ELE_KEY( abort_proc : out boolean; key : out el_key_type ) is
- ---------------------------------
- -- Description Key, Abbreviation
- ---------------------------------
- -- for modifying and deleting an element
- a_char : character; -- to see if the user wants to abort this function
- el_record : element_pointer;
- found : boolean; -- parameter to FIND
- valid_input : boolean := false; -- if user input was valid
-
- begin
- abort_proc := false;
-
- while not valid_input loop
- begin
- -- blank out the input line
- line := (others => ' ');
-
- -- ask abbreviated question
- put(" Description Abbreviation : ");
-
- while end_of_line loop -- keep asking question if the user hits <cr>
- skip_line;
- new_line;
- put_line(" Enter a unique description key of 6 characters or ");
- put_line(" less that abbreviates an existing element description. ");
- new_line;
- DISPLAY_ELEMENT_DATA;
- new_line;
- put(" Description Abbreviation: ");
- end loop;
-
- get_line(line,line_lngth);
- new_line(2);
-
- -- check if more information requested
- if line(1) = '?' then
- new_line;
- put_line(" Enter a unique description key of 6 characters or ");
- put_line(" less that abbreviates an existing element description. ");
- new_line;
- DISPLAY_ELEMENT_DATA;
- new_line;
- else
- -- checks to see if the element exists or not
- FIND( el_list, line(1..el_key_max_len), el_record, found );
- valid_input := found;
-
- if not valid_input then -- warn user, loop again
- put_line(" Sorry, but that element doesn't exists. ");
- new_line;
- put_line(" Press the return key to see the list of existing elements. ");
- put_line(" Enter 'a' to abort this procedure ");
- put_line(" Enter any other key to continue. ");
- if end_of_line then -- pressed <cr>, show list of desc_key
- skip_line;
- DISPLAY_ELEMENT_DATA;
- else -- loop again on any input except <cr> or 'a'
- get(a_char); skip_line;
- if a_char = 'a' or a_char = 'A' then
- abort_proc := true;
- valid_input := true;
- end if;
- end if;
- end if;
- end if;
-
- exception
- when others => skip_line;
- put_line(" That was not a valid abbreviation. TRY AGAIN! ");
- new_line;
- DISPLAY_ELEMENT_DATA;
- end;
- end loop; -- valid input
-
- key := line(1..el_key_max_len);
- end EXISTING_ELE_KEY;
-
-
-
- function NEW_ELE_KEY return el_key_type is
- -- prompt for adding an new element
- ---------------------------------
- -- Description Key, Abbreviation
- ---------------------------------
- found : boolean; -- parameter to FIND
- el_record : element_pointer;
- valid_input : boolean := false; -- if user input was valid
-
- begin
- while not valid_input loop
- begin
- -- blank out the input line
- line := (others => ' ');
- -- ask abbreviated question
- put(" Unique abbreviation : ");
-
- while end_of_line loop -- keep asking question if the user hits <cr>
- skip_line;
- put_line(" Enter a unique description key of 6 characters or ");
- put_line(" less that abbreviates the element description. ");
- new_line;
- DISPLAY_ELEMENT_DATA;
- new_line;
- put(" Unique Abbreviation : ");
- end loop;
-
- get_line(line,line_lngth);
- new_line(2);
-
- -- check if more information requested
- if line(1) = '?' then
- put_line(" Enter a unique description key of 6 characters or ");
- put_line(" less that abbreviates the element description. ");
- new_line;
- DISPLAY_ELEMENT_DATA;
- new_line;
- else
- -- want the element to be unique
- FIND( el_list, line(1..el_key_max_len), el_record, found );
- valid_input := not found;
-
- if not valid_input then -- warn user, loop again
- put(" Sorry, but element ");
- put( line(1..line_lngth) );
- put(" already exists. "); new_line;
- put_line(" You must enter a new unique element. ");
- new_line;
- put_line(" Press the return key to see the list of existing elements. ");
- put_line(" Enter any other key to continue. ");
- if end_of_line then -- pressed <cr>, show ss list
- skip_line;
- DISPLAY_ELEMENT_DATA;
- else -- loop again on any input except <cr>
- skip_line;
- end if;
- end if;
- end if;
-
- exception
- when others => skip_line;
- put_line(" That was not a valid abbreviation. TRY AGAIN! ");
- new_line;
- end;
- end loop; -- valid input
-
- return line(1..el_key_max_len);
- end NEW_ELE_KEY;
-
-
- procedure DISPLAY_SUBSYSTEM_DATA is
- ------------------------------------------------------------------------------
- --|
- --| NAME: DISPLAY_SUBSYSTEM_DATA
- --|
- --| OVERVIEW:
- --| This procedure walks the list and prints the name of each subsystem
- --| to the screen.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| Written by May Lee March 1985
- --|
- ------------------------------------------------------------------------------
- end_list : boolean := false;
- ss_record : subsystem_pointer;
-
- begin
- if not EMPTY_LIST( ss_list ) then
- put_line(" The existing subsystems are : ");
- new_line;
- START_WALK( ss_list);
- end_list := false;
- loop
- WALK( ss_list, ss_record, end_list);
- exit when end_list;
- put(ss_record.name); new_line;
- end loop;
- new_line;
- end if;
- end DISPLAY_SUBSYSTEM_DATA;
-
-
- procedure EXISTING_SUBSYS_NAME ( abort_proc : out boolean;
- key : out ss_name_type ) is
- -- to modify or delete
- ---------------------------------
- -- Subsystem Name
- ---------------------------------
- a_char : character; -- to see if the user wants to abort this function
- found : boolean; -- parameter to FIND
- ss_record : subsystem_pointer;
- valid_input : boolean := false; -- if user input was valid
-
- begin
- abort_proc := false;
- while not valid_input loop
- begin
- -- blank out the input line
- line := (others => ' ');
-
- -- ask abbreviated question
- put(" Subsystem Name : ");
-
- while end_of_line loop -- keep asking question if the user hits <cr>
- skip_line;
- new_line;
- put_line(" Enter the name of the subsystem, which is a ");
- put_line(" string of up to 10 characters.");
- new_line;
- DISPLAY_SUBSYSTEM_DATA;
- new_line;
- put(" Subsystem Name : ");
- end loop;
-
- get_line(line,line_lngth);
- new_line(2);
-
- -- check to see if more information is requested
- if line(1) = '?' then
- new_line;
- put_line(" Enter the name of the subsystem, which is a ");
- put_line(" string of up to 10 characters.");
- new_line;
- DISPLAY_SUBSYSTEM_DATA;
- new_line;
- else
- -- check to see if ss is defined
- FIND( ss_list, line(1..sub_name_max_len), ss_record, found );
-
- valid_input := found;
-
- if not valid_input then -- warn user, loop again
- put(" Sorry, but subsystem ");
- put( line(1..line_lngth) );
- put(" does not exist. "); new_line;
- put_line(" You must enter an existing subsystem. ");
- new_line;
- put_line(" Press the return key to see the list of existing elements. ");
- put_line(" Enter 'a' to abort this procedure ");
- put_line(" Enter any other key to continue. ");
- if end_of_line then -- pressed <cr>, show ss list
- skip_line;
- DISPLAY_SUBSYSTEM_DATA;
- else -- loop again on any input except <cr> or 'a'
- get(a_char); skip_line;
- if a_char = 'a' or a_char = 'A' then
- abort_proc := true;
- valid_input := true;
- end if;
- end if;
- end if;
- end if;
-
- exception
- when others => skip_line;
- put_line(" That was not a valid name. TRY AGAIN! ");
- end;
- end loop;
- key := line(1..sub_name_max_len);
- end EXISTING_SUBSYS_NAME;
-
-
-
- function NEW_SUBSYS_NAME return ss_name_type is
- -- to add a new ss
- ---------------------------------
- -- Subsystem Name
- ---------------------------------
- found : boolean; -- parameter to FIND
- ss_record : subsystem_pointer;
- valid_input : boolean := false; -- if user input was valid
-
- begin
- while not valid_input loop
- begin
- -- blank out the input line
- line := (others => ' ');
-
- -- ask abbreviated question
- put(" Subsystem Name : ");
-
- while end_of_line loop -- keep asking question if the user hits <cr>
- skip_line;
- new_line;
- put_line(" Enter the name of the subsystem, which is a ");
- put_line(" string of up to 10 characters.");
- new_line;
- DISPLAY_SUBSYSTEM_DATA;
- new_line;
- put(" Subsystem Name : ");
- end loop;
- get_line(line,line_lngth);
- new_line(2);
-
- -- check to see if more information is requested
- if line(1) = '?' then
- new_line;
- put_line(" Enter the name of the subsystem, which is a ");
- put_line(" string of up to 10 characters.");
- new_line;
- DISPLAY_SUBSYSTEM_DATA;
- else
- -- check to see if this ss is defined
- FIND( ss_list, line(1..sub_name_max_len), ss_record, found );
-
- valid_input := not found;
-
- if not valid_input then -- warn user, loop again
- put(" Sorry, but subsystem ");
- put( line(1..line_lngth) );
- put(" already exists. "); new_line;
- put_line(" You must enter a new unique subsystem. ");
- new_line;
- put_line(" Press the return key to see the list of existing subsystems. ");
- put_line(" Enter any other key to continue. ");
- if end_of_line then -- pressed <cr>, show ss list
- skip_line;
- DISPLAY_SUBSYSTEM_DATA;
- else -- loop again on any input except <cr>
- skip_line;
- end if;
- end if;
- end if;
- exception
- when others => skip_line;
- put_line(" That was not a valid name. TRY AGAIN! ");
- end;
- end loop;
- return line(1..sub_name_max_len);
- end NEW_SUBSYS_NAME;
-
-
- procedure DISPLAY_PERSONNEL_DATA is
- ------------------------------------------------------------------------------
- --|
- --| NAME: DISPLAY_PERSONNEL_DATA
- --|
- --| OVERVIEW:
- --| This procedure walks the list and prints the name of each person
- --| to the screen.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| Written by May Lee March 1985
- --|
- ------------------------------------------------------------------------------
- end_list : boolean := false;
- pr_record : personnel_pointer;
- tab : constant character := ascii.ht;
-
- begin
- if not EMPTY_LIST( pr_list ) then
- put_line(" The existing people are : ");
- new_line;
- START_WALK( pr_list);
- end_list := false;
- loop
- WALK( pr_list, pr_record, end_list);
- exit when end_list;
- put(pr_record.initials); put(tab); put(pr_record.name); new_line;
- end loop;
- new_line;
- end if;
- end DISPLAY_PERSONNEL_DATA;
-
- procedure EXISTING_PERSON_INITIALS ( abort_proc : out boolean;
- key : out pr_init_type )is
- ---------------------------------
- -- Person's Initials
- ---------------------------------
- a_char : character; -- to see if the user wants to abort this function
- found : boolean; -- parameter to FIND
- pr_record : personnel_pointer;
- valid_input : boolean := false; -- if user input was valid
-
- begin
- abort_proc := false;
- while not valid_input loop
- begin
- -- blank out the input line
- line := (others => ' ');
-
- -- ask abbreviated question
- put(" Person's Initials : ");
-
- while end_of_line loop -- keep asking question if the user hits <cr>
- skip_line;
- new_line;
- put_line(" Enter a string of up to 2 characters that represents the initials ");
- put_line(" of the person. ");
- new_line;
- DISPLAY_PERSONNEL_DATA;
- new_line;
- put(" Person's Initials : ");
- end loop;
- get_line(line,line_lngth);
- new_line(2);
-
- -- check if more information is requested
- if line(1) = '?' then
- new_line;
- put_line(" Enter a string of up to 2 characters that represents the initials ");
- put_line(" of the person. ");
- new_line;
- DISPLAY_PERSONNEL_DATA;
- new_line;
- else
- -- check to see if this person exists
- FIND( pr_list, line(1..pr_init_max_len), pr_record, found );
- valid_input := found;
-
- if not valid_input then -- warn user, loop again
- put_line(" Sorry, but no one with those initials exists. ");
- put_line(" You must enter an existing person. ");
- new_line;
- put_line(" Press the return key to see the list of defined people and their initials. ");
- put_line(" Enter 'a' to abort this procedure. ");
- put_line(" Enter any other key to continue. ");
- if end_of_line then -- pressed <cr>, show ss list
- skip_line;
- DISPLAY_PERSONNEL_DATA;
- else -- loop again on any input except <cr> or 'a'
- get(a_char); skip_line;
- if a_char = 'a' or a_char = 'A' then
- abort_proc := true;
- valid_input := true;
- end if;
- end if;
- new_line;
- end if;
- end if;
- exception
- when others => skip_line;
- put_line(" That was not a valid value. TRY AGAIN! ");
- end;
- end loop;
- key := line(1..pr_init_max_len);
- end EXISTING_PERSON_INITIALS;
-
-
-
- function NEW_PERSON_INITIALS return pr_init_type is
- ---------------------------------
- -- Person's Initials
- ---------------------------------
- found : boolean; -- parameter to FIND
- pr_record : personnel_pointer;
- valid_input : boolean := false; -- if user input was valid
-
- begin
- while not valid_input loop
- begin
- -- blank out the input line
- line := (others => ' ');
-
- -- ask abbreviated question
- put(" Person's Initials : ");
-
- while end_of_line loop -- keep asking question if the user hits <cr>
- skip_line;
- new_line;
- put_line(" Enter a string of up to 2 characters that represents the initials ");
- put_line(" of the person. ");
- new_line;
- DISPLAY_PERSONNEL_DATA;
- new_line;
- put(" Person's Initials : ");
- end loop;
- get_line(line,line_lngth);
- new_line(2);
-
- -- check if more information is requested
- if line(1) = '?' then
- new_line;
- put_line(" Enter a string of up to 2 characters that represents the initials ");
- put_line(" of the person. ");
- new_line;
- DISPLAY_PERSONNEL_DATA;
- new_line;
- else
- -- check to see if this person exists
- FIND( pr_list, line(1..pr_init_max_len), pr_record, found );
- valid_input := not found;
-
- if not valid_input then -- warn user, loop again
- put(" Sorry, but ");
- put( pr_record.initials);
- put(" already exists. "); new_line;
- put_line(" You must enter new unique initials. ");
- new_line;
- DISPLAY_PERSONNEL_DATA;
- new_line;
- end if;
- end if;
- exception
- when others => skip_line;
- put_line(" That was not a valid value. TRY AGAIN! ");
- end;
- end loop;
- return line(1..pr_init_max_len);
- end NEW_PERSON_INITIALS;
-
-
- procedure DISPLAY_MILESTONE_DATA is
- ------------------------------------------------------------------------------
- --|
- --| NAME: DISPLAY_MILESTONE_DATA
- --|
- --| OVERVIEW:
- --| This procedure walks the list and prints the number of each
- --| milestone to the screen.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| Written by May Lee March 1985
- --|
- ------------------------------------------------------------------------------
- end_list : boolean := false;
- ms_record : milestone_pointer;
-
- begin
- if not EMPTY_LIST( ms_list ) then
- put_line(" The existing milestones are : ");
- new_line;
- START_WALK( ms_list );
- end_list := false;
- loop
- WALK( ms_list, ms_record, end_list);
- exit when END_LIST;
- put(ms_record.number,2); put(" ");
- put(ms_record.description); new_line;
- end loop;
- new_line;
- end if;
- end DISPLAY_MILESTONE_DATA;
-
-
- procedure EXISTING_MILSTONE_NUMBER ( abort_proc : out boolean;
- key : out ms_num_type ) is
- ---------------------------------
- -- Milestone Number
- ---------------------------------
- a_char : character; -- to see if the user wants to abort this function
- an_integer : ms_num_type;
- found : boolean; -- parameter to FIND
- ms_record : milestone_pointer;
- valid_input : boolean := false; -- if user input was valid
-
- begin
- abort_proc := false;
- while not valid_input loop
- begin
- -- ask abbreviated question
- put(" Milestone Number : ");
-
- while end_of_line loop -- keep asking question if the user hits <cr>
- skip_line;
- new_line;
- put_line(" Enter an integer in the range 1..99 ");
- new_line;
- DISPLAY_MILESTONE_DATA;
- new_line;
- put(" Milestone Number : ");
- end loop;
- get( an_integer ); skip_line;
- new_line(2);
-
- -- make sure milestone exists
- FIND( ms_list, an_integer, ms_record, found );
- valid_input := found;
-
- if not valid_input then -- warn user, loop again
- put(" Sorry, but milestone ");
- put( an_integer, 2);
- put(" does not exist. "); new_line;
- put_line(" You must enter an existing milestone. ");
- new_line;
- put_line(" Press the return key to see the list of existing milestones. ");
- put_line(" Enter 'a' to abort this procedure. ");
- put_line(" Enter any other key to continue. ");
- if end_of_line then -- pressed <cr>, show ms list
- skip_line;
- DISPLAY_MILESTONE_DATA;
- else -- loop again on any input except <cr> or 'a'
- get(a_char); skip_line;
- if a_char = 'a' or a_char = 'A' then
- abort_proc := true;
- valid_input := true;
- end if;
- end if;
- end if;
- exception
- when others =>
- skip_line;
- new_line;
- put_line(" Enter an integer in the range 1..99 ");
- new_line;
- DISPLAY_MILESTONE_DATA;
- new_line;
- end;
- end loop;
- key := an_integer;
- end EXISTING_MILSTONE_NUMBER;
-
-
-
- function NEW_MILSTONE_NUMBER return ms_num_type is
- ---------------------------------
- -- Milestone Number
- ---------------------------------
- found : boolean; -- parameter to FIND
- an_integer : ms_num_type;
- ms_record : milestone_pointer;
- valid_input : boolean := false; -- if user input was valid
-
- begin
- while not valid_input loop
- begin
- -- ask abbreviated question
- put(" Milestone Number : ");
-
- while end_of_line loop -- keep asking question if the user hits <cr>
- skip_line;
- new_line;
- put_line(" Enter an integer in the range 1..99 ");
- new_line;
- DISPLAY_MILESTONE_DATA;
- new_line;
- put(" Milestone Number : ");
- end loop;
- get( an_integer ); skip_line;
- new_line(2);
-
- -- check to see if this milestone exists
- FIND( ms_list, an_integer, ms_record, found );
- valid_input := not found;
-
- if not valid_input then -- warn user, loop again
- put(" Sorry, but milestone ");
- put( an_integer, 2);
- put(" already exists. "); new_line;
- put_line(" You must enter a new unique milestone. ");
- new_line;
- put_line(" Press the return key to see the list of existing milestones. ");
- put_line(" Enter any other key to continue. ");
- if end_of_line then -- pressed <cr>, show ms list
- skip_line;
- DISPLAY_MILESTONE_DATA;
- else -- loop again
- skip_line;
- end if;
- end if;
- exception
- when others =>
- skip_line;
- new_line;
- put_line(" Enter an integer in the range 1..99 ");
- new_line;
- DISPLAY_MILESTONE_DATA;
- new_line;
- end;
- end loop;
- return an_integer;
- end NEW_MILSTONE_NUMBER;
-
- function ELEMENT_PRIORITY ( default : in ms_num_type ) return ms_num_type is
- an_integer : ms_num_type;
- begin
- loop
- begin
- -- ask abbreviated question
- put(" Element Priority ( <cr> = milestone number ) : ");
-
- if end_of_line then -- default
- skip_line;
- new_line(2);
- return default;
- end if;
- get( an_integer ); skip_line;
- new_line(2);
- return an_integer;
- exception
- when others =>
- skip_line;
- new_line;
- put_line(" Enter an integer in the range 1..99 ");
- new_line;
- end;
- end loop;
- end ELEMENT_PRIORITY;
-
-
- function MILESTONE_COMPLETION_NUMBER ( default : in ms_num_type )
- return ms_num_type is
- an_integer : ms_num_type;
- begin
- loop
- begin
- -- ask abbreviated question
- put(" Milestone Completion Number ( <cr> = milestone number ) : ");
-
- if end_of_line then -- default
- skip_line;
- new_line(2);
- return default;
- end if;
- get( an_integer ); skip_line;
- new_line(2);
- return an_integer;
- exception
- when others =>
- skip_line;
- new_line(2);
- put_line(" Enter an integer in the range 1..99 ");
- new_line;
- end;
- end loop;
- end MILESTONE_COMPLETION_NUMBER;
-
-
-
- function CURRENT_SIZE_EST return integer is
- ---------------------------------
- -- Current Size Estimate
- ---------------------------------
- an_integer : integer range 0..99_999;
- valid_input : boolean := false; -- if user input was valid
-
- begin
- while not valid_input loop
- begin
- -- ask abbreviated question
- put (" Current Size : ");
-
- while end_of_line loop -- keep asking question if the user hits <cr>
- skip_line;
- new_line;
- put_line(" What do you currently estimate the size of the element to be ? ");
- put_line(" Enter an integer in the range 0 to 99_999 ");
- new_line;
- put (" Current Size : ");
- end loop;
- get( an_integer ); skip_line;
- new_line(2);
- valid_input := true;
- exception
- when others =>
- skip_line;
- new_line;
- put_line(" What do you currently estimate the size of the element to be ? ");
- put_line(" Enter an integer in the range 0 to 99_999 ");
- new_line;
- end;
- end loop;
- return an_integer;
- end CURRENT_SIZE_EST;
-
-
-
-
- function ORIG_SIZE_EST (default : in integer := 0) return integer is
- ---------------------------------
- -- Original Size Estimate
- ---------------------------------
- an_integer : integer range 0..99_999;
-
- begin
- loop
- begin
- -- ask abbreviated question
- put (" Original size ( <cr> = current size) : ");
-
- if end_of_line then -- default
- skip_line;
- new_line(2);
- return default;
- end if;
- get( an_integer ); skip_line;
- new_line(2);
- return an_integer;
- exception
- when others =>
- skip_line;
- new_line(2);
- put_line(" What do you estimate the original size of the element to be ? ");
- put_line(" Enter an integer in the range 0 to 99_999 ");
- new_line;
- end;
- end loop;
- end ORIG_SIZE_EST;
-
- function UPDATE_CURRENT_SIZE (old_size : in integer) return integer is
- an_integer : integer range 0..99_999;
-
- begin
- loop
- begin
- -- ask abbreviated question
- set_col(51); put (" [ <cr> = no change ]"); new_line;
- put(" Old current size = ");
- put(old_size,1); new_line;
- put(" New current size : ");
-
- if end_of_line then -- don't change the value
- skip_line;
- new_line(2);
- return old_size;
- else
- get( an_integer ); skip_line;
- new_line(2);
- return an_integer;
- end if;
- exception
- when others => skip_line;
- put_line(" Try something in the range 0 to 99_999. ");
- new_line;
- end;
- end loop;
- end UPDATE_CURRENT_SIZE;
-
- function COMPLEXITY_FACTOR return float is
- ---------------------------------
- -- Complexity
- ---------------------------------
- a_float : float range 0.01..5.0 := 0.01;
-
- begin
- loop
- begin
- -- ask abbreviated question
- put (" Complexity [ <cr> = 1.0 ] : ");
-
- if end_of_line then -- default
- skip_line;
- a_float := 1.0;
- new_line(2);
- return a_float;
- end if;
- get( a_float ); skip_line;
- new_line(2);
- return a_float;
- exception
- when others =>
- skip_line;
- new_line;
- put_line(" Enter a real number in the range 0.01 to 5.00 ");
- new_line;
- end;
- end loop;
- end COMPLEXITY_FACTOR;
-
-
-
- function ACTIV_COMPLETENESS return ACTIVITY_PHASE_PERCENT is
- ---------------------------------
- -- Activity Completeness
- ---------------------------------
- a_char : character := ' ';
- ac_record : activity_pointer;
- count : integer := 1;
- end_list : boolean := false; -- parameter to WALK
- ac_comp_array : activity_phase_percent := (others => ' ');
- -- array of activity percents
- valid_input : boolean := false; -- if user input was valid
-
- begin
- begin
- -- ask abbreviated question, assuming the format is known.
- -- any fields not entered default to ' ' or 0
- put(" Activity Completeness : ");
-
- -- describe the input line in detail
- if end_of_line then -- default
- skip_line;
- ac_comp_array := (others => ' ');
- return ac_comp_array;
- end if;
-
- -- parse the input
- count := 1;
- while not end_of_line and count <= num_of_activities loop
- get( a_char );
- ac_comp_array(count) := convert(A_CHAR);
- count := count + 1;
- end loop;
- skip_line;
- new_line(2);
- return ac_comp_array;
- exception -- ask expanded question
- when others =>
- ac_comp_array := (others => ' ');
- skip_line;
- new_line(2);
- put_line(" For each activity, enter one character (0 through 9 or ' ', or 'd') ");
- put_line(" indicating that activity's completeness. Put all the data on");
- put_line(" one input line. ");
- new_line;
- put_line(" For Example: ");
- put_line(" If you have 5 activities: HLD, DD, CD, UT, and I, ");
- put_line(" and you enter ");
- new_line;
- put_line(" Activity Completeness : d86 1 ");
- new_line;
- put_line(" HLD is 100% done. DD is 80% done. CD is 60% done. ");
- put_line(" UT is 0% done. I is 10% done. ");
- new_line;
- put_line(" Enter '?' if you would still like more help on how to ");
- put_line(" enter this data. Otherwise, enter the data as described. ");
- new_line;
- put(" Activity Completeness : ");
- end;
-
- -- prompt with the expanded question
- begin
- if end_of_line then -- default
- skip_line;
- ac_comp_array := (others => ' ');
- return ac_comp_array;
- end if;
- count := 1;
- while not end_of_line and count <= num_of_activities loop
- get( a_char );
- ac_comp_array(count) := convert(A_CHAR);
- count := count + 1;
- end loop;
- skip_line;
- new_line(2);
- return ac_comp_array;
- exception
- when others =>
- -- prompt for each activity separately rather than on one line of input
- ac_comp_array := (others => ' ');
- skip_line;
- new_line(2);
- put_line("You will be prompted for the completeness of each activity. ");
- new_line;
- end;
-
- -- prompt for the individual activities
- START_WALK( ac_list );
- for i in 1..num_of_activities loop
- valid_input := false;
- WALK( ac_list, ac_record, end_list);
- while not end_list and not valid_input loop
- begin
- put(" How complete is activity ");
- put(ac_record.name); put(" : ");
- if end_of_line then
- skip_line;
- valid_input := false;
- else
- get(a_char);
- ac_comp_array(i) := CONVERT(a_char);
- skip_line;
- valid_input := true;
- end if;
- new_line(2);
- exception
- when others => skip_line;
- ac_comp_array(i) := ' ';
- new_line(2);
- put_line(" That was not a valid value. TRY AGAIN! ");
- put_line(" Enter a number from 0 to 9, or ' ', or 'd' to indicate the percent complete. ");
- put_line(" 'd' or 'D' means it is 100% complete or Done. ");
- put_line(" ' ' or '0' means it is 0% complete. ");
- put_line(" '1' means it is 10% complete. ");
- put_line(" '2' means it is 20% complete. etc. ");
- new_line;
- valid_input := false;
- end;
- end loop;
- end loop;
-
- return ac_comp_array;
- end ACTIV_COMPLETENESS;
-
-
- function UPDATE_ACTIV_COMPLETENESS
- (old_pct_complete : in activity_phase_percent)
- return ACTIVITY_PHASE_PERCENT is
- a_char : character := ' ';
- count : integer := 1;
- ac_comp_array : activity_phase_percent := (others => ' ');
- -- array of activity percents
-
- begin
- loop
- begin
- -- ask abbreviated question
-
- set_col(50); put (" [ <cr> = no change ]"); new_line;
- put(" Old percent complete = ");
- for i in 1..num_of_activities loop
- put( CONVERT(old_pct_complete(i)) );
- end loop;
- new_line;
- put(" New percent complete : ");
-
- if end_of_line then -- don't change the value
- skip_line;
- new_line(2);
- return old_pct_complete;
- else
- while not end_of_line and count <= num_of_activities loop
- get( a_char );
- ac_comp_array(count) := convert(A_CHAR);
- count := count + 1;
- end loop;
- skip_line;
- new_line(2);
- return ac_comp_array;
- end if;
- exception
- when others => skip_line;
- ac_comp_array := ( others => ' ');
- put_line(" That was not a valid value. ");
- put_line(" Enter a number from 0 to 9, or ' ', or 'd' ");
- put_line(" to indicate the percent complete for each activity. ");
- new_line;
- end;
- end loop;
- end UPDATE_ACTIV_COMPLETENESS;
-
-
- ----------------------------------------------------------------------------
- -- ACTIVITY DATA PROMPTS --
- ----------------------------------------------------------------------------
- procedure DISPLAY_ACTIVITY_DATA is
- ------------------------------------------------------------------------------
- --|
- --| NAME: DISPLAY_ACTIVITY_DATA
- --|
- --| OVERVIEW:
- --| This procedure walks the list and prints the name of each activity
- --| to the screen.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| Written by May Lee March 1985
- --|
- ------------------------------------------------------------------------------
- end_list : boolean := false;
- ac_record : activity_pointer;
-
- begin
- if not EMPTY_LIST( ac_list ) then
- put_line(" The existing activities are : ");
- new_line;
- START_WALK( ac_list );
- end_list := false;
- loop
- WALK( ac_list, ac_record, end_list);
- exit when end_list;
- put(ac_record.name); new_line;
- end loop;
- new_line;
- end if;
- end DISPLAY_ACTIVITY_DATA;
-
- procedure EXISTING_ACTIV_NAME ( abort_proc : out boolean;
- key : out ac_name_type ) is
- -- want to modify or delete and existing activity
- ---------------------------------
- -- Activity Name
- ---------------------------------
- a_char : character; -- to see if the user wants to abort this function
- ac_record : activity_pointer;
- found : boolean; -- parameter to FIND
- valid_input : boolean := false; -- if user input was valid
-
- begin
- abort_proc := false;
- while not valid_input loop
- begin
- -- blank out the input line
- line := (others => ' ');
-
- -- ask abbreviated question
- put(" Activity Name : ");
-
- while end_of_line loop -- keep asking question if the user hits <cr>
- skip_line;
- new_line;
- put_line(" Enter the name of the activity which is a ");
- put_line(" string of up to 10 characters.");
- new_line;
- DISPLAY_ACTIVITY_DATA;
- new_line;
- put(" Activity Name : ");
- end loop;
-
- get_line(line,line_lngth);
- new_line(2);
-
- if line(1) = '?' then
- new_line;
- put_line(" Enter the name of the activity which is a ");
- put_line(" string of up to 10 characters.");
- new_line;
- DISPLAY_ACTIVITY_DATA;
- new_line;
- else
- -- check to see if this activity exists
- FIND( ac_list, line(1..act_name_max_len), ac_record, found );
- valid_input := found;
-
- if not valid_input then -- warn user, loop again
- put(" Sorry, but activity ");
- put( line(1..line_lngth) );
- put(" does not exist. "); new_line;
- put_line(" You must enter an existing activity. ");
- new_line;
- put_line(" Press the return key to see the list of existing activities. ");
- put_line(" Enter 'a' to abort this procedure ");
- put_line(" Enter any other key to continue. ");
- if end_of_line then -- pressed <cr>, show ac list
- skip_line;
- DISPLAY_ACTIVITY_DATA;
- else -- loop again on any input except <cr> or 'a'
- get(a_char); skip_line;
- if a_char = 'a' or a_char = 'A' then
- abort_proc := true;
- valid_input := true;
- end if;
- end if;
- end if;
- end if;
-
- exception
- when others =>
- skip_line;
- new_line;
- put_line(" Enter the name of the activity which is a ");
- put_line(" string of up to 10 characters.");
- new_line;
- DISPLAY_ACTIVITY_DATA;
- new_line;
- end;
- end loop;
-
- key := line(1..act_name_max_len);
- end EXISTING_ACTIV_NAME;
-
-
-
- function NEW_ACTIV_NAME return ac_name_type is
- ---------------------------------
- -- Activity Name
- ---------------------------------
- found : boolean; -- parameter to FIND
- ac_record : activity_pointer;
- valid_input : boolean := false; -- if user input was valid
-
- begin
- while not valid_input loop
- begin
- -- blank out the input line
- line := (others => ' ');
-
- -- ask abbreviated question
- put(" Activity Name : ");
-
- while end_of_line loop -- keep asking question if the user hits <cr>
- skip_line;
- new_line;
- put_line(" Enter the name of the activity which is a ");
- put_line(" string of up to 10 characters.");
- new_line;
- DISPLAY_ACTIVITY_DATA;
- new_line;
- put(" Activity Name : ");
- end loop;
- get_line(line,line_lngth);
- new_line(2);
-
- if line(1) = '?' then
- new_line;
- put_line(" Enter the name of the activity which is a ");
- put_line(" string of up to 10 characters.");
- new_line;
- DISPLAY_ACTIVITY_DATA;
- new_line;
- else
- -- check to see if this ac is defined
- FIND( ac_list, line(1..act_name_max_len), ac_record, found );
- valid_input := not found;
-
- if not valid_input then -- warn user, loop again
- put(" Sorry, but activity ");
- put( line(1..line_lngth) );
- put(" already exists. "); new_line;
- put_line(" You must enter a new unique activity. ");
- new_line;
- put_line(" Press the return key to see the list of existing activities. ");
- put_line(" Enter any other key to continue. ");
- if end_of_line then -- pressed <cr>, show aclist
- skip_line;
- DISPLAY_ACTIVITY_DATA;
- else -- loop again on any input except <cr>
- skip_line;
- end if;
- end if;
- end if;
-
- exception
- when others =>
- skip_line;
- new_line;
- put_line(" Enter the name of the activity which is a ");
- put_line(" string of up to 10 characters.");
- new_line;
- end;
- end loop;
- return line(1..act_name_max_len);
- end NEW_ACTIV_NAME;
-
-
-
- function ACTIV_PRIORITY return integer is
- ---------------------------------
- -- Activity Priority
- ---------------------------------
- an_integer : integer range 1..10;
-
- begin
- loop
- begin
- -- ask abbreviated question
- put (" Priority : ");
-
- while end_of_line loop -- keep asking question if the user hits <cr>
- skip_line;
- new_line;
- put_line(" Enter the priority of the activity on a scale of 1 to 10. ");
- new_line;
- put (" Priority : ");
- end loop;
- get( an_integer ); skip_line;
- new_line(2);
- exit;
- exception
- when others =>
- skip_line;
- new_line;
- put_line(" Enter the priority of the activity on a scale of 1 to 10. ");
- new_line;
- end;
- end loop;
- return an_integer;
- end ACTIV_PRIORITY;
-
-
-
- function CONSIDER_AC_IN_CALC return boolean is
- ---------------------------------
- -- Consider this activity in the Tracker calculations
- ---------------------------------
- a_char : character := 'y';
-
- begin
- loop
- begin
- -- ask abbreviated question
- put (" Consider [ y or n <cr>=y ] : ");
-
- if end_of_line then -- keep asking question if the user hits <cr>
- skip_line;
- new_line(2);
- return true;
- end if;
- get( a_char); skip_line;
- new_line(2);
- if a_char = 'Y' or a_char = 'y' then
- return true;
- elsif a_char = 'N' or a_char = 'n' then
- return false;
- end if;
- put(" Do you want to consider this activity in the ");
- put_line("Tracker calculations? ");
- new_line;
- exception
- when others =>
- skip_line;
- new_line(2);
- put(" Do you want to consider this activity in the ");
- put_line("Tracker calculations? ");
- new_line;
- end;
- end loop;
- end CONSIDER_AC_IN_CALC;
-
-
-
- ----------------------------------------------------------------------------
- -- MILESTONE DATA
- ----------------------------------------------------------------------------
-
-
- function MS_DESCRIPTION return string is
- ---------------------------------
- -- Milestone Description
- ---------------------------------
- begin
- loop
- -- blank out the input line
- line := (others => ' ');
-
- -- ask abbreviated question
- put_line(" Milestone description : ");
- new_line;
-
- while end_of_line loop -- keep asking question if the user hits <cr>
- skip_line;
- put_line(" Enter the description of the milestone in 50 characters or less : ");
- new_line;
- end loop;
-
- -- get the record field
- get_line(line,line_lngth);
- new_line(2);
- if line(1) = '?' then
- put_line(" Enter the description of the milestone in 50 characters or less : ");
- new_line;
- else
- return line(1..50);
- end if;
- end loop;
- end MS_DESCRIPTION;
-
-
- ----------------------------------------------------------------------------
- -- PERSONNEL DATA PROMPTS
- ----------------------------------------------------------------------------
-
-
- function PERSONS_NAME return string is
- ---------------------------------
- -- Person's Name
- ---------------------------------
- begin
- loop
- -- blank out the input line
- line := (others => ' ');
-
- -- ask abbreviated question
- put(" Person's Name : ");
-
- while end_of_line loop -- keep asking question if the user hits <cr>
- skip_line;
- new_line;
- put_line(" Enter the name of the person in 20 characters or less. ");
- put_line(" Anything longer will be truncated. ");
- new_line;
- put(" Person's Name : ");
- end loop;
-
- -- get the record field
- get_line(line,line_lngth);
- new_line(2);
- if line(1) = '?' then
- new_line;
- put_line(" Enter the name of the person in 20 characters or less. ");
- put_line(" Anything longer will be truncated. ");
- new_line;
- else
- return line(1..20);
- end if;
- end loop;
- end PERSONS_NAME;
-
-
-
- function PR_PRODUCTION_RATE return float is
- ---------------------------------
- -- Person's production rate
- ---------------------------------
- a_float : float range 0.01..99.99 := 1.00;
-
- begin
- loop
- begin
- -- ask abbreviated question
- put (" Production Rate ( <cr> = 1.0) : ");
-
- if end_of_line then -- default
- skip_line;
- new_line(2);
- return 1.0;
- end if;
- get( a_float ); skip_line;
- new_line(2);
- return a_float;
- exception -- default value
- when others =>
- skip_line;
- new_line(2);
- put_line(" How many units of work can this person complete per hour ? ");
- put_line(" Enter a float in the range 0.01..99.99 ");
- new_line;
- end;
- end loop;
- end PR_PRODUCTION_RATE;
-
-
-
- function PR_HRS_PER_WEEK return integer is
- ---------------------------------
- -- Hours per week the person works
- ---------------------------------
- an_integer : integer range 1..84 := 40;
-
- begin
- loop
- begin
- -- ask abbreviated question
- put (" Hours Per Week ( <cr> = 40) : ");
-
- if end_of_line then -- default
- skip_line;
- new_line(2);
- return 40;
- end if;
- get( an_integer ); skip_line;
- new_line(2);
- return an_integer;
- exception -- default value
- when others =>
- skip_line;
- new_line;
- put_line(" How many hours per week (1..84) does this person work ? ");
- put_line(" The default is 40 hours. Press <cr> for the default. ");
- new_line;
- end;
- end loop;
- end PR_HRS_PER_WEEK;
-
-
-
- function PERCENT return float is
- ---------------------------------
- -- Percent value
- ---------------------------------
- a_float : float range 0.0..100.0 := 0.0;
-
- begin
- loop
- begin
- -- ask abbreviated question
- put (" Percent ( <cr> = 0.0) : ");
-
- if end_of_line then -- default
- skip_line;
- a_float := 0.0;
- new_line(2);
- else
- get( a_float ); skip_line;
- new_line(2);
- end if;
- exit;
- exception -- keep prompting the user until he enters a valid number
- when others =>
- skip_line;
- new_line;
- put_line(" Enter a number in the range 0.0 .. 100.0 ");
- new_line;
- end;
- end loop;
- return a_float;
- end PERCENT;
-
-
-
- function DATE return DATE_TYPE is
- -----------------------------------
- -- DATE
- -----------------------------------
- -- This function prompts for and returns a valid date (month, day and year).
-
- day_integer : integer := 0; -- user input date on one line
- default : boolean := false; -- if the user chooses the default date
- dummy_char : character; -- character to separate date '/'
- month_integer : integer := 0; -- user input date on one line
- user_input : boolean := false; -- if the user entered date on one line
- valid_date : date_type; -- the date returned
- valid_day : DAY_NUMBER; -- day from detailed item prompt
- valid_input : boolean := false; -- if input is within type range
- valid_month : MONTH_NUMBER; -- month from detailed item prompt
- valid_year : YEAR_NUMBER; -- year from detailed item prompt
- year_integer : integer := 0; -- user input date on one line
-
-
-
- function MONTH return MONTH_NUMBER is
- ---------------------------------
- -- Month for type date_type
- ---------------------------------
-
- begin
- valid_input := false;
- while not valid_input loop
- begin
- -- ask abbreviated question
- put (" Month (1..12) : ");
-
- while end_of_line loop -- keep asking question if the user hits <cr>
- skip_line;
- put (" Enter the month (1..12) : ");
- end loop;
- get( valid_month ); skip_line;
- new_line(2);
- valid_input := true;
- exception
- when others =>
- skip_line;
- put_line (" What is the number of the month?");
- new_line;
- valid_input := false;
- end;
- end loop;
- return valid_month;
- end MONTH;
-
-
-
- function DAY return DAY_NUMBER is
- ---------------------------------
- -- Day in date_type
- ---------------------------------
-
- begin
- valid_input := false;
- while not valid_input loop
- begin
- -- ask abbreviated question
- put (" Day (1..31) : ");
-
- while end_of_line loop -- keep asking question if the user hits <cr>
- skip_line;
- new_line;
- put (" Enter the day of the month (1..31) : ");
- end loop;
- get( valid_day ); skip_line;
- new_line(2);
- valid_input := true;
- exception
- when others => skip_line;
- new_line;
- put_line (" What is the day of the month? ");
- new_line;
- valid_input := false;
- end;
- end loop;
- return valid_day;
- end DAY;
-
-
-
- function YEAR return YEAR_NUMBER is
- ---------------------------------
- -- Year in date_type
- ---------------------------------
-
- begin
- valid_input := false;
- while not valid_input loop
- begin
- -- ask abbreviated question
- put (" Year (1901..2099) : ");
-
- while end_of_line loop -- keep asking question if the user hits <cr>
- skip_line;
- new_line;
- put (" Enter is the year (1901..2099) : ");
- end loop;
- get( valid_year ); skip_line;
- new_line(2);
- valid_input := true;
- exception
- when others => skip_line;
- valid_input := false;
- new_line;
- put_line (" What is the year ? ");
- new_line;
- end;
- end loop;
- return valid_year;
- end YEAR;
-
- begin
- loop
- put(" e.g. 12/6/1985 ( <cr> = null date) : ");
- if end_of_line then
- skip_line;
- new_line(2);
- return null_date;
- else
- begin
- -- get the date
- get( month_integer );
- if not end_of_line then
- get( dummy_char ); -- the slash between numbers
- end if;
- if not end_of_line then
- get( day_integer );
- end if;
- if not end_of_line then
- get( dummy_char ); -- the slash between numbers
- end if;
- if not end_of_line then
- get( year_integer );
- end if;
- skip_line;
- new_line(2);
-
- if not VALID( month_integer, day_integer, year_integer ) then
- put_line(" That was not a valid date! ");
- loop
- valid_month := MONTH;
- valid_day := DAY;
- valid_year := YEAR;
- if VALID( valid_month, valid_day, valid_year ) then
- return ( valid_month, valid_day, valid_year );
- end if;
- put_line(" That was not a valid date! ");
- end loop;
- end if;
- return ( month_integer, day_integer, year_integer );
- exception
- when others => -- user wants more information
- skip_line;
- put_line(" Enter month/day/year where the month is 1..12, the day ");
- put_line(" is 1..31, and the year is 1901..2099 ");
- new_line;
- end;
- end if;
- end loop;
- end DATE;
-
- end PROMPT_PKG;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --tracker.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- with vt100; use VT100;
- with text_io; use text_io;
- with data_pkg; use data_pkg;
-
- procedure TRACKER is
- ----------------------------------------------------------------------
- --| NAME: TRACKER - Main
- --|
- --| OVERVIEW:
- --| TRACKER is an ADA conversion of the original INPREP and TRACKR
- --| programs written in IFTRAN. The Ada version of TRACKER is one
- --| program that combines the two previous Iftran programs. It is
- --| written under the VAX/VMS Version 4.0 environment.
- --|
- --| The TRACKER program is a management tool used for estimating
- --| project cost and scheduling requirements, and tracking progress
- --| within projects by calculating dates of completion, amount of time
- --| required, amount of code, and other variable data.
- --| Reports can be produced that will show the status of the project
- --| from several different perspectives.
- --|
- --| EXCEPTIONS HANDLED:
- --| name_error error message is printed and program terminates
- --| ERROR_IN_INPUT_FILE error message is printed and program terminates
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- ----------------------------------------------------------------------
-
- -- instantiate I/O packages
- use FLOAT_TEXT_IO;
- use INTEGER_TEXT_IO;
-
- -- user response line
- max_line_lngth : natural := 200;
- line : string(1..max_line_lngth) := (others=>' ');
- line_lngth : natural;
-
- error_in_input_file : exception;
-
- report_file, -- internal filename for the tracker output
- -- file of reports generated
- tracker_file, -- internal filename for the tracker input
- -- file (in_file)
- output_file : file_type; -- internal filename for output file(out_file)
- -- it is the same name as the input file.
-
- report_filename : string(1..80) := (others => ' ');
- -- external name of the VAX tracker report file. It will be the same name
- -- as the input file with a ".rpt" extension instead.
-
- tracker_filename : string(1..80) := (others => ' ');
- -- external name of the VAX tracker file. This is the name for the input
- -- file and the output file, the output file being a new version of the input.
-
- filename_lngth : natural; -- length of the tracker filename
-
- -- package specifications
- package global_pkg is
- procedure GL_SET_UP;
- procedure GL_INITIALIZE;
- procedure GL_SAVE;
- end global_pkg;
-
- package activity_pkg is
- procedure AC_SET_UP;
- procedure AC_INITIALIZE;
- procedure AC_ADD;
- procedure AC_DELETE;
- procedure AC_MODIFY;
- procedure AC_SAVE;
- end activity_pkg;
-
- package element_pkg is
- procedure EL_SET_UP;
- procedure EL_INITIALIZE;
- procedure UPDATE_CURRENT;
- procedure UPDATE_PCT_DONE;
- procedure EL_ADD;
- procedure EL_DELETE;
- procedure EL_MODIFY;
- procedure EL_SAVE;
- end element_pkg;
-
- package milestone_pkg is
- procedure MS_SET_UP;
- procedure MS_INITIALIZE;
- procedure MS_ADD;
- procedure MS_DELETE;
- procedure MS_MODIFY;
- procedure MS_SAVE;
- end milestone_pkg;
-
- package personnel_pkg is
- procedure PR_SET_UP;
- procedure PR_INITIALIZE;
- procedure PR_ADD;
- procedure PR_DELETE;
- procedure PR_MODIFY;
- procedure PR_SAVE;
- end personnel_pkg;
-
- package subsystem_pkg is
- procedure SS_SET_UP;
- procedure SS_INITIALIZE;
- procedure SS_ADD;
- procedure SS_DELETE;
- procedure SS_MODIFY;
- procedure SS_SAVE;
- end subsystem_pkg;
-
- package body global_pkg is separate;
- package body activity_pkg is separate;
- package body element_pkg is separate;
- package body milestone_pkg is separate;
- package body personnel_pkg is separate;
- package body subsystem_pkg is separate;
-
- procedure WRITE_DATA_TO_FILE is separate;
- procedure SET_UP_TRACKER_DATA is separate;
- procedure INITIALIZE_TRACKER_DATA is separate;
- procedure DATA_MENU_DRIVER is separate;
- procedure GET_DATA is separate;
- procedure MANIPULATE_DATA is separate;
- procedure REPORT_GENERATOR is separate;
-
- use CALENDAR;
-
- begin
- TRACKER_INTRO;
- GET_DATA;
- MANIPULATE_DATA;
- WRITE_DATA_TO_FILE;
-
- -- TRACKER --
- -- if answer to "Do you want to change or modify data?" was No
- -- or if already manipulated data (done with INPREP) ...
- -- then go to report menu (TRACKR part).
- REPORT_GENERATOR;
-
- exception
- when name_error =>
- new_line(2);
- put("Sorry, TRACKER file ");put(tracker_filename(1..filename_lngth));
- put(" cannot be opened.");
- new_line(2);
- put(" * * * EXECUTION TERMINATED * * * ");
- new_line(2);
- when ERROR_IN_INPUT_FILE =>
- put("Sorry, error reading TRACKER file ");
- put(tracker_filename(1..filename_lngth));
- new_line(2);
- put(" * * * EXECUTION TERMINATED * * * ");
- end TRACKER;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --inittr.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- with text_io; use text_io;
- separate(tracker)
-
- procedure INITIALIZE_TRACKER_DATA is
- --------------------------------------------------------------------------------
- --|
- --| NAME: INITIALIZE_TRACKER_DATA
- --|
- --| OVERVIEW:
- --| This procedure calls the individual data initialize procedures in
- --| a specific order to obtain the tracker information needed to make a
- --| complete tracker file. The internal data structures are created
- --| and the data is written to the tracker file. The name of the output
- --| file is obtained in this procedure, but the file is actually created
- --| just before the write in the procedure WRITE_DATA_TO_FILE.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| Written by May Lee March 1985
- --|
- --------------------------------------------------------------------------------
- begin
- VT100.CLEAR_SCREEN;
- put_line("Please enter the TRACKER filename you want created");
- get_line(tracker_filename,filename_lngth);
- new_line;
- GLOBAL_PKG.GL_INITIALIZE;
- ACTIVITY_PKG.AC_INITIALIZE;
- MILESTONE_PKG.MS_INITIALIZE;
- PERSONNEL_PKG.PR_INITIALIZE;
- SUBSYSTEM_PKG.SS_INITIALIZE;
- ELEMENT_PKG.EL_INITIALIZE;
- CLEAR_SCREEN;
- end INITIALIZE_TRACKER_DATA;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --setuptr.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- with text_io; use text_io;
-
- separate(tracker)
- procedure SET_UP_TRACKER_DATA is
- ----------------------------------------------------------------------
- --|
- --| NAME: SET_UP_TRACKER_DATA
- --|
- --| OVERVIEW:
- --| This procedure opens the tracker input file and calls the
- --| individual data set_up procedures in a specified order to
- --| read in the tracker data from the file and set up the
- --| internal data structures.
- --|
- --| EXCEPTIONS HANDLED:
- --| name_error if the given file can't be opened
- --| . raised to the calling routine
- --| others ERROR_IN_INPUT_FILE is raised
- --|
- --| HISTORY:
- --| Written by May Lee March 1985
- --|
- ----------------------------------------------------------------------
-
- bad_data : boolean := false;
-
- begin
- VT100.CLEAR_SCREEN;
- put_line("Please enter the TRACKER filename: ");
- get_line(tracker_filename,filename_lngth);
- open(tracker_file, in_file, tracker_filename, "");
- new_line;
- put_line(" Reading the data from file .... ");
- new_line;
- begin
- GLOBAL_PKG.GL_SET_UP;
- exception
- when others => bad_data := true;
- end;
-
- begin
- ACTIVITY_PKG.AC_SET_UP;
- exception
- when others => bad_data := true;
- end;
-
- begin
- MILESTONE_PKG.MS_SET_UP;
- exception
- when others => bad_data := true;
- end;
-
- begin
- PERSONNEL_PKG.PR_SET_UP;
- exception
- when others => bad_data := true;
- end;
-
- begin
- SUBSYSTEM_PKG.SS_SET_UP;
- exception
- when others => bad_data := true;
- end;
-
- begin
- ELEMENT_PKG.EL_SET_UP;
- exception
- when others => bad_data := true;
- end;
-
- close(tracker_file);
- if bad_data then
- raise ERROR_IN_INPUT_FILE;
- end if;
- exception
- when NAME_ERROR => raise;
- when others =>
- if IS_OPEN(tracker_file) then
- close(tracker_file);
- end if;
- raise ERROR_IN_INPUT_FILE;
- end SET_UP_TRACKER_DATA;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --mandata.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- separate (TRACKER)
- procedure MANIPULATE_DATA is
- ----------------------------------------------------------------------
- --| NAME: MANIPULATE_DATA
- --|
- --| OVERVIEW:
- --| This is the main driver for manipulating and adding data.
- --| This procedure calls the menu driver and the other necessary
- --| routines to validate the data and calculate data needed to
- --| print reports before the data is written to file.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --| written by Bonnie Burkhardt March 1985
- ----------------------------------------------------------------------
-
- char_input : character; -- user response character
- valid_response : boolean := false; -- if user response to prompt is legal
-
- procedure CHECK_AC_PERCENT is separate;
- procedure GROUP_DATA_FIXES is separate;
- procedure PRIORITIZE is separate;
- procedure CALC_TIME_DONE is separate;
-
- begin
- while not valid_response loop
- put_line(" Would you like to modify the TRACKER data? ");
- put(" [ Y or N, <cr>=Y ] : ");
- begin
- if end_of_line then -- pressed return, default is yes
- skip_line;
- DATA_MENU_DRIVER;
- CHECK_AC_PERCENT;
- GROUP_DATA_FIXES;
- valid_response := true;
- else
- get( char_input ); skip_line;
- if char_input = 'Y' or char_input = 'y' then
- DATA_MENU_DRIVER;
- CHECK_AC_PERCENT;
- GROUP_DATA_FIXES;
- valid_response := true;
- elsif char_input = 'N' or char_input = 'n' then
- -- no changes, print the reports
- CHECK_AC_PERCENT;
- valid_response := true;
- else
- -- invalid entry
- put_line("Please enter 'Y' or 'N' ");
- delay 0.7;
- CLEAR_SCREEN;
- end if;
- end if;
- exception
- when name_error => raise;
- when ERROR_IN_INPUT_FILE => raise;
- when others =>
- skip_line;
- -- invalid entry
- put_line("Please enter 'Y' or 'N' ");
- delay 0.7;
- CLEAR_SCREEN;
- end;
- end loop;
- PRIORITIZE;
- CALC_TIME_DONE;
- end MANIPULATE_DATA;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --prior.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- separate(TRACKER.MANIPULATE_DATA)
- procedure PRIORITIZE is
- --------------------------------------------------------------------------------
- --|
- --| NAME: PRIORITIZE
- --|
- --| OVERVIEW:
- --| This procedure sorts the element lists according to milestone completion
- --| number and then element priority.
- --|
- --| EXCEPTIONS HANDLED:
- --| others an error message is printed and execution continues
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- --------------------------------------------------------------------------------
- use MS_LIST_PKG; use PR_LIST_PKG;
-
- COMPLETE_NUM : integer range ms_num_type'first..ms_num_type'last+1 := 100;
- END_LIST : boolean := false;
- IN_SORTED_LIST: boolean := false;
- LO_MS_PTR : milestone_pointer;
- LO_MS : ms_num_type := 1;
- HI_MS : ms_num_type := 1;
- MS_PTR : milestone_pointer;
- MS_PTR2 : milestone_pointer;
- MS_INDEX : integer := 0;
- PR_PTR : personnel_pointer;
- SORTED_MS_LIST: ms_list_pkg.list_type;
- SUCCEED : boolean := false;
-
- procedure SORT_EL_IN_MS is separate;
- procedure SORT_EL_IN_PR is separate;
-
- begin
- -- sort the milestone list by completion sequence number
- for MS_INDEX in 1..num_of_milestones loop
- start_walk(MS_LIST);
- COMPLETE_NUM := 100;
-
- loop
- walk(MS_LIST, MS_PTR, END_LIST);
- exit when END_LIST;
- find(SORTED_MS_LIST, MS_PTR.number, MS_PTR2, IN_SORTED_LIST);
- if not IN_SORTED_LIST and (MS_PTR.completion_number < COMPLETE_NUM) then
- COMPLETE_NUM := MS_PTR.completion_number;
- LO_MS_PTR := MS_PTR;
- end if;
- end loop;
-
- ADD (SORTED_MS_LIST, LO_MS_PTR.number, LO_MS_PTR);
- end loop;
-
- -- sort the element list for each milestone by priority number
- start_walk(SORTED_MS_LIST);
- loop
- walk(SORTED_MS_LIST, MS_PTR, END_LIST);
- exit when END_LIST;
- SORT_EL_IN_MS;
- end loop;
-
- -- sort the element list for each person according to the milestone and
- -- element lists created
- start_walk(PR_LIST);
- loop
- walk(PR_LIST, PR_PTR, END_LIST);
- exit when END_LIST;
- SORT_EL_IN_PR;
- end loop;
-
- exception
- when others => put_line("exception raise in PRIORITIZE");
- end PRIORITIZE;
-
-
-
- separate (TRACKER.MANIPULATE_DATA.PRIORITIZE)
- procedure SORT_EL_IN_MS is
- --------------------------------------------------------------------------------
- --|
- --| NAME: SORT_EL_IN_MS
- --|
- --| OVERVIEW:
- --| This procedure sorts the elements belonging to a given milestone by
- --| element priority. If all elements have the same priority, no sorting
- --| takes place. Otherwise, sorting is done by deleting the lowest
- --| priority elements and adding them to the end of the element list.
- --|
- --| EXCEPTIONS HANDLED:
- --| others an error message is printed and execution continues
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- --------------------------------------------------------------------------------
-
- use EL_LIST_PKG;
-
- ELE_PTR : element_pointer;
- END_LIST : boolean := false;
- HI_MS : ms_num_type := 1;
- LO_MS : ms_num_type := 1;
- SORTED_EL_LIST: el_list_pkg.list_type;
- SUCCEED : boolean := false;
-
- begin
- LO_MS := MS_PTR.number;
- HI_MS := MS_PTR.number;
-
- -- find the lowest and highest element priority
- start_walk(MS_PTR.element_list);
- loop
- walk(MS_PTR.element_list, ELE_PTR, END_LIST);
- exit when END_LIST;
- if ELE_PTR.priority < LO_MS then
- LO_MS := ELE_PTR.priority;
- end if;
- if ELE_PTR.priority > HI_MS then
- HI_MS := ELE_PTR.priority;
- end if;
- end loop;
-
- -- if elements have different priorities, sort them
- if LO_MS < HI_MS then
- for PRIORITY in LO_MS..HI_MS loop
-
- start_walk(MS_PTR.element_list);
- loop
- walk(MS_PTR.element_list, ELE_PTR, END_LIST);
- exit when END_LIST;
- if ELE_PTR.priority = PRIORITY then
- ADD (SORTED_EL_LIST, ELE_PTR.desc_key, ELE_PTR);
- end if;
- end loop;
-
- end loop;
- MS_PTR.element_list := SORTED_EL_LIST;
- end if;
-
- exception
- when others => put_line("exception raised in SORT_EL_IN_MS.");
- end SORT_EL_IN_MS;
-
-
- separate (TRACKER.MANIPULATE_DATA.PRIORITIZE)
- procedure SORT_EL_IN_PR is
- --------------------------------------------------------------------------------
- --|
- --| NAME: SORT_EL_IN_PR
- --|
- --| OVERVIEW:
- --| This procedure sorts the elements belonging to a given person using the
- --| milestones sorted by completion sequence and the milestone's elements
- --| sorted by element priority. Sorting is done by walking down each
- --| milestone's element list and deleting and adding any elements which
- --| belong to this person.
- --|
- --| EXCEPTIONS HANDLED:
- --| others an error message is printed and execution continues
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- --------------------------------------------------------------------------------
-
- use EL_LIST_PKG;
-
- ELE_PTR : element_pointer;
- ELE_PTR2 : element_pointer;
- END_LIST : boolean := false;
- PR_INITIALS : string (1..pr_init_max_len) := PR_PTR.initials;
- SORTED_EL_LIST: el_list_pkg.list_type;
- FOUND : boolean := false;
-
- begin
- -- check each milestone's element list for elements that belong to this person
- start_walk(SORTED_MS_LIST);
- loop
- walk(SORTED_MS_LIST, MS_PTR, END_LIST);
- exit when END_LIST;
-
- -- examine the milestone's list of elements for any elements belonging
- -- to this person
- start_walk(MS_PTR.element_list);
- loop
- walk(MS_PTR.element_list, ELE_PTR, END_LIST);
- exit when END_LIST;
-
- if ELE_PTR.more_than_one_person then
- for ac_index in 1..num_of_activities loop
- if ELE_PTR.people_initials(ac_index) = PR_INITIALS then
- FIND (SORTED_EL_LIST, ELE_PTR.desc_key, ELE_PTR2, FOUND);
- if not FOUND then
- ADD (SORTED_EL_LIST, ELE_PTR.desc_key, ELE_PTR);
- end if;
- end if;
- end loop;
-
- else -- only one person assigned
- if ELE_PTR.person_initials = PR_INITIALS then
- ADD (SORTED_EL_LIST, ELE_PTR.desc_key, ELE_PTR);
- end if;
- end if;
-
- end loop;
- end loop;
- PR_PTR.element_list := SORTED_EL_LIST;
-
- exception
- when others => put_line("exception raised in SORT_EL_IN_PR.");
- end SORT_EL_IN_PR;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --calctime.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- separate(TRACKER.MANIPULATE_DATA)
- procedure CALC_TIME_DONE is
- --------------------------------------------------------------------------------
- --|
- --| NAME: CALC_TIME_DONE
- --|
- --| OVERVIEW:
- --| This procedure calculates the date each element will be completed
- --| and the total number of hours left to completion.
- --|
- --| EXCEPTIONS HANDLED:
- --| others an error message is printed and execution continues
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- --|
- --| NOTES:
- --| The activities used in the calculations include all activities
- --| that were marked as being considered in the calculations and all
- --| activities whose priority is less than or equal to any activity
- --| marked as being considered.
- --|
- --------------------------------------------------------------------------------
- use CALENDAR;
- use EL_LIST_PKG; use PR_LIST_PKG; use AC_LIST_PKG;
-
- AC_PTR : activity_pointer;
- AC_INDEX : integer := 0;
- AC_PRIORITIES : array (1..max_num_activities) of integer range 1..10
- := (others => 1);
- BEGIN_DATE : date_type := null_date;
- BEGIN_DATE_USED : integer range 1..3 := 1;
- END_LIST : boolean := false;
- HI_AC_PRIORITY : integer := 1;
- PCT_TOT_PROJ : array (1..max_num_activities) of float range 0.0..100.0
- := (others => 0.0);
- PR_PTR : personnel_pointer;
- TEST_PRIORITY : integer := 1;
- TOTAL_TIME : float := 0.0;
-
- procedure GET_EL_TIME is separate;
-
- begin
- -- calculate the highest priority activity considered and
- -- initialize the PCT_TOT_PROJ array
- start_walk(AC_LIST);
- AC_INDEX := 0;
- loop
- walk(AC_LIST, AC_PTR, END_LIST);
- exit when END_LIST;
- AC_INDEX := AC_INDEX + 1;
- PCT_TOT_PROJ (AC_INDEX) := AC_PTR.percent_tot_proj;
- AC_PRIORITIES(AC_INDEX) := AC_PTR.priority;
- if AC_PTR.consider_in_calc and AC_PTR.priority > HI_AC_PRIORITY then
- HI_AC_PRIORITY := AC_PTR.priority;
- end if;
- end loop;
-
- -- compute each person's amount of work remaining and date completed
- start_walk(PR_LIST);
- loop
- walk(PR_LIST, PR_PTR, END_LIST);
- exit when END_LIST;
-
- -- compute the beginning date
- if (PR_PTR.start_dates(3) /= null_date) and
- (PR_PTR.stop_dates(2) < DATE) then -- starting in third time span
- BEGIN_DATE_USED := 3;
- if PR_PTR.start_dates(3) > DATE then
- BEGIN_DATE := PR_PTR.start_dates(3);
- else
- BEGIN_DATE := DATE;
- end if;
- elsif (PR_PTR.start_dates(2) /= null_date) and
- (PR_PTR.stop_dates(1) < DATE) then -- starting in second time span
- BEGIN_DATE_USED := 2;
- if PR_PTR.start_dates(2) > DATE then
- BEGIN_DATE := PR_PTR.start_dates(2);
- else
- BEGIN_DATE := DATE;
- end if;
- else -- starting in first time span
- BEGIN_DATE_USED := 1;
- if (PR_PTR.start_dates(1) /= null_date) and
- (PR_PTR.start_dates(1) > DATE) then
- BEGIN_DATE := PR_PTR.start_dates(1);
- else
- BEGIN_DATE := DATE;
- end if;
- end if;
-
- -- compute the completion date for each person's elements
- TOTAL_TIME := 0.0;
- for TEST in 1..HI_AC_PRIORITY loop
- TEST_PRIORITY := TEST;
- GET_EL_TIME;
- end loop;
- end loop;
-
- exception
- when others => put_line("exception raise in CALC_TIME_DONE");
- end CALC_TIME_DONE;
-
-
-
- separate (TRACKER.MANIPULATE_DATA.CALC_TIME_DONE)
- procedure GET_EL_TIME is
- --------------------------------------------------------------------------------
- --|
- --| NAME: GET_EL_TIME
- --|
- --| OVERVIEW:
- --| This procedure computes the total amount of time needed to complete
- --| the activities with TEST_PRIORITY of each element assigned to the
- --| current programmer, PR_PTR. It then adds this time to the total
- --| time the programmer works and to the total number of hours needed
- --| to complete the element, ELE_PTR.hours_to_complete. It also calculates
- --| the date this amount of work will be completed. The completion date
- --| is stored in the element field, DATE_DONE.
- --|
- --| EXCEPTIONS HANDLED:
- --| others an error message is printed and execution continues
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- --------------------------------------------------------------------------------
-
- use DATA_PKG;
-
- BIASED_TOTAL_TIME : float := 0.0;
- DATE_DONE : date_type := null_date;
- DATE_CALCULATED : boolean := false;
- ELE_PTR : element_pointer;
- ELE_SIZE : integer range 0..999_000;
- END_LIST : boolean := false;
- PROJECTED_DATE_DONE : date_type := null_date;
- TIME_SPAN_USED : integer range 1..3 := BEGIN_DATE_USED;
- STARTING_DATE : date_type := BEGIN_DATE;
- STANDARD_WORKWEEK : boolean := false;
- TIME_FOR_1_AC : float := 0.0;
- TIME_FOR_ELE : float := 0.0;
-
- begin
- STANDARD_WORKWEEK := float(PR_PTR.hours_per_week) = HOURS_IN_WORK_DAY
- * float(DAYS_IN_WORK_WEEK);
- start_walk(PR_PTR.element_list);
- loop
- walk(PR_PTR.element_list, ELE_PTR, END_LIST);
- exit when END_LIST;
-
- ELE_SIZE := ELE_PTR.current_size - ELE_PTR.size_done_at_start;
- TIME_FOR_ELE := 0.0;
-
- -- calculate the amount of time needed to complete this element's activities
- for AC_INDEX in 1..num_of_activities loop
- if AC_PRIORITIES(AC_INDEX) = TEST_PRIORITY then
-
- if not ELE_PTR.more_than_one_person then
- TIME_FOR_1_AC := ELE_PTR.complexity * float(ELE_SIZE)
- * (PCT_TOT_PROJ(AC_INDEX) / 100.0) * ((100.0 -
- AC_PCT_VALUE(ELE_PTR.activity_completeness(AC_INDEX))) /100.0)
- / PR_PTR.production_rate;
-
- elsif ELE_PTR.people_initials(AC_INDEX) = PR_PTR.initials then
- TIME_FOR_1_AC := ELE_PTR.complexity * float(ELE_SIZE)
- * (PCT_TOT_PROJ(AC_INDEX) / 100.0) * ((100.0 -
- AC_PCT_VALUE(ELE_PTR.activity_completeness(AC_INDEX))) /100.0)
- / PR_PTR.production_rate;
- ELE_PTR.hours_left(AC_INDEX) := TIME_FOR_1_AC;
- end if;
-
- TIME_FOR_ELE := TIME_FOR_ELE + TIME_FOR_1_AC;
- end if;
- end loop;
- TOTAL_TIME := TOTAL_TIME + TIME_FOR_ELE;
- ELE_PTR.hours_to_complete := ELE_PTR.hours_to_complete + TIME_FOR_ELE;
-
- -- calculate the date this element is completed
- if STANDARD_WORKWEEK then
- BIASED_TOTAL_TIME := TOTAL_TIME;
- else
- BIASED_TOTAL_TIME := TOTAL_TIME * float(DAYS_IN_WORK_WEEK)
- * HOURS_IN_WORK_DAY / float(PR_PTR.hours_per_week);
- end if;
- PROJECTED_DATE_DONE := STARTING_DATE + BIASED_TOTAL_TIME;
-
- STARTING_DATE := BEGIN_DATE;
- time_span_used := BEGIN_DATE_USED;
- DATE_CALCULATED := false;
- while not DATE_CALCULATED loop
- case time_span_used is
- when 1 | 2 =>
- -- it fits in the time span
- if (PR_PTR.stop_dates(time_span_used) = null_date) or
- (PR_PTR.stop_dates(time_span_used) >= PROJECTED_DATE_DONE) then
- DATE_DONE := PROJECTED_DATE_DONE;
- DATE_CALCULATED := true;
- -- another set of start/stop dates doesn't exits
- elsif PR_PTR.start_dates(time_span_used+1) = null_date then
- DATE_DONE := underflow_date;
- DATE_CALCULATED := true;
- else -- move on to next set of completion dates
- -- add in the total amount of work missed to the biased total time
- -- (the vacation is from this stop date to the next start date)
- BIASED_TOTAL_TIME := BIASED_TOTAL_TIME +
- (PR_PTR.start_dates(time_span_used+1) -
- PR_PTR.stop_dates(time_span_used));
- TIME_SPAN_USED := TIME_SPAN_USED + 1;
- PROJECTED_DATE_DONE := STARTING_DATE + BIASED_TOTAL_TIME;
- end if;
- when 3 =>
- -- it fits in the time span
- if (PR_PTR.stop_dates(time_span_used) = null_date) or
- (PR_PTR.stop_dates(time_span_used) >= PROJECTED_DATE_DONE) then
- DATE_DONE := PROJECTED_DATE_DONE;
- DATE_CALCULATED := true;
- else -- no time to finish the work
- DATE_DONE := underflow_date;
- DATE_CALCULATED := true;
- end if;
- end case;
- end loop;
-
- -- assign the newly completed completion date to the fields in the element
- if (ELE_PTR.date_done = null_date) or
- (ELE_PTR.date_done < DATE_DONE) or
- (DATE_DONE = underflow_date) then
- ELE_PTR.date_done := DATE_DONE;
- end if;
- if ELE_PTR.more_than_one_person then
- for AC_INDEX in 1..num_of_activities loop
- if (AC_PRIORITIES(AC_INDEX) = TEST_PRIORITY) and
- (ELE_PTR.people_initials (AC_INDEX) = PR_PTR.initials) then
- ELE_PTR.dates_done(AC_INDEX) := DATE_DONE;
- end if;
- end loop;
- end if;
- end loop;
-
- exception
- when others => put_line("exception raised in GET_EL_TIME.");
- end GET_EL_TIME;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --chkpct.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- separate ( TRACKER.MANIPULATE_DATA )
- procedure CHECK_AC_PERCENT is
- ----------------------------------------------------------------------
- --| NAME: CHECK_AC_PERCENT
- --|
- --| OVERVIEW:
- --| This procedure checks to see that the activity percent of project
- --| adds up to 100.0%.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- ----------------------------------------------------------------------
- use AC_LIST_PKG;
- ac_record : activity_pointer;
- end_list : boolean;
- total_percent : float := 0.0;
- begin
- loop -- until the activity percent = 100
- total_percent := 0.0;
- START_WALK( ac_list );
- loop -- walk the activity list and compute total percent
- WALK( ac_list, ac_record, end_list );
- exit when end_list;
- total_percent := total_percent + ac_record.percent_tot_proj ;
- end loop;
- if total_percent > 100.01 or total_percent < 99.99 then
- put_line(" The total of each activity's percent of the total project ");
- put_line(" does not add up to 100.0%.");
- put_line(" You must go back and change the activity data. ");
- new_line;
- START_WALK( ac_list );
- loop -- walk the activity list and compute total percent
- WALK( ac_list, ac_record, end_list );
- exit when end_list;
- put(ac_record.name); put(" ");
- put(ac_record.percent_tot_proj,3,1,0); put_line("%");
- end loop;
- put_line (" -------");
- put(" Total percent ="); put(total_percent,4,1,0);
- new_line(2);
- put_line(" Press <cr> to return to the Data Menu.");
- skip_line;
- DATA_MENU_DRIVER;
- else
- exit;
- end if;
- end loop;
- end CHECK_AC_PERCENT;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --fixdata.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- separate(TRACKER.MANIPULATE_DATA)
- procedure GROUP_DATA_FIXES is
- --------------------------------------------------------------------------------
- --|
- --| NAME: GROUP_DATA_FIXES
- --|
- --| OVERVIEW:
- --| This procedure is the driver for making changes to the entire set of
- --| element data. Two types of changes are possible, updating the original
- --| estimate to equal the current estimate or starting the project at this
- --| point and using this run as the starting point for the project.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- --------------------------------------------------------------------------------
-
- input_char : character := ' ';
-
- procedure UPDATE_ORIGINAL is separate;
- procedure RESET_DATA is separate;
-
- begin
- -- ask the user if he wants to re-originalize his data
- new_line;
- put_line(" Would you like to update the original size estimates for all");
- put_line(" the elements to reflect the current size estimate?");
- new_line;
- put(" Y or N ( <cr>=N ) : ");
- loop
- begin
- if END_OF_LINE then
- skip_line;
- new_line(2);
- exit;
- else
- get (input_char);
- if (input_char = 'n') or (input_char = 'N') then
- skip_line;
- new_line(2);
- exit;
- elsif (input_char = 'y') or (input_char = 'Y') then
- skip_line;
- new_line(2);
- UPDATE_ORIGINAL;
- exit;
- else -- give more information
- skip_line;
- new_line(2);
- put_line(" Tracker will step through each element and assign the");
- put_line(" original size to equal the current size.");
- put_line(" Would you like to update the original size?");
- new_line;
- put(" [ Y or N <cr>=N ] : ");
- end if;
- end if;
- exception
- when others =>
- skip_line;
- new_line(2);
- put_line(" Tracker will step through each element and assign the");
- put_line(" original size to equal the current size.");
- put_line(" Would you like to update the original size?");
- new_line;
- put(" [ Y or N ] : ");
- end;
- end loop;
-
- -- determine if the user wants to 'reset' his data file
- new_line;
- put_line(" Do you want to start tracking the project from this point onwards");
- put_line(" and use the current percent complete as the starting point?");
- new_line;
- put(" [ Y or N <cr>=N ] : ");
- loop
- begin
- if END_OF_LINE then
- skip_line;
- new_line(2);
- exit;
- else
- get(input_char);
- if (input_char = 'n') or (input_char = 'N') then
- skip_line;
- new_line(2);
- exit;
- elsif (input_char = 'y') or (input_char = 'Y') then
- skip_line;
- RESET_DATA;
- new_line(2);
- exit;
- else -- give more information
- skip_line;
- new_line;
- put_line(" Tracker will step through each element and compute the ");
- put_line(" amount of work that is completed on the element. It then");
- put_line(" subtracts this amount from the current size to obtain the");
- put_line(" EQUIVALENT NEW SIZE estimate. The percent complete for ");
- put_line(" that element is erased and set to ' '.");
- put_line(" Do you want to start tracking the project from this point?");
- new_line;
- put(" [ Y or N <cr>=N ] : ");
- end if;
- end if;
- exception
- when others =>
- skip_line;
- new_line;
- put_line(" Tracker will step through each element and compute the ");
- put_line(" amount of work that is completed on the element. It then");
- put_line(" subtracts this amount from the current size to obtain the");
- put_line(" EQUIVALENT NEW SIZE estimate. The percent complete for ");
- put_line(" that element is erased and set to ' '.");
- put_line(" Do you want to start tracking the project from this point?");
- new_line;
- put(" [ Y or N <cr>=N ] : ");
- end;
- end loop;
-
- end GROUP_DATA_FIXES;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --fixreset.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- separate(TRACKER.MANIPULATE_DATA.GROUP_DATA_FIXES)
- procedure RESET_DATA is
- --------------------------------------------------------------------------------
- --|
- --| NAME: RESET_DATA
- --|
- --| OVERVIEW:
- --| For each element, this procedure calculates the amount of work
- --| completed and stores this value in the SIZE_DONE_AT_START field.
- --| After this calculation, it erases the percent complete field in the
- --| element by setting it equal to " ".
- --|
- --| EXCEPTIONS HANDLED:
- --| others an error message is printed and execution continues
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- --|
- --| NOTE:
- --------------------------------------------------------------------------------
-
- use EL_LIST_PKG; use AC_LIST_PKG; use SS_LIST_PKG;
-
- AC_PTR : activity_pointer;
- AC_INDEX : integer := 0;
- ELE_PTR : element_pointer;
- ELE_DONE : float range 0.0..999_999.0;
- ELE_SIZE : float range 0.0..999_999.0;
- ELE_START : float range 0.0..999_999.0;
- END_LIST : boolean := false;
- 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);
- DONE : float range 0.0..9_999_999.0 := 0.0;
- NONE_COMPLETE : activity_phase_percent := (others => ' ');
- SIZE : float range 0.0..9_999_999.0 := 0.0;
- START : float range 0.0..9_999_999.0 := 0.0;
- SS_PTR : subsystem_pointer;
-
- 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;
-
- begin
- start_walk(SS_LIST);
- loop
- walk(SS_LIST, SS_PTR, END_LIST);
- exit when END_LIST;
-
- -- reset subsystem totals
- SS_TOT_SIZE := 0.0;
- SS_TOT_DONE := 0.0;
- SS_TOT_START := 0.0;
-
- -- set through each subsystem's element list and calculate each element
- start_walk(SS_PTR.element_list);
- loop
- walk(SS_PTR.element_list, ELE_PTR, END_LIST);
- exit when END_LIST;
-
- ELE_DONE := 0.0;
- ELE_START := float(ELE_PTR.size_done_at_start);
- ELE_SIZE := float(ELE_PTR.current_size) - ELE_START;
- SS_TOT_SIZE := SS_TOT_SIZE + ELE_SIZE * ELE_PTR.complexity;
- SS_TOT_START := SS_TOT_START + ELE_START * ELE_PTR.complexity;
-
- -- calculate the amount of work done for each activity in this element
- --| The SIZE_DONE_AT_START is equal to the old SIZE_DONE_AT_START plus
- --| any work that has been completed since the start of the project.
- --| This means that the data can be 'reset' or 'restarted' as many times
- --| as necessary with no loss in accuracy.
- start_walk(AC_LIST);
- AC_INDEX := 0;
- loop
- walk(AC_LIST, AC_PTR, END_LIST);
- exit when END_LIST;
- AC_INDEX := AC_INDEX + 1;
- SIZE := ELE_PTR.complexity * ELE_SIZE * AC_PTR.percent_tot_proj / 100.0;
- START:= ELE_PTR.complexity * ELE_START * AC_PTR.percent_tot_proj / 100.0;
- DONE := SIZE * AC_PCT_VALUE(ELE_PTR.activity_completeness(AC_INDEX)) / 100.0;
- GR_TOT_SIZE(AC_INDEX) := GR_TOT_SIZE(AC_INDEX) + SIZE;
- GR_TOT_DONE(AC_INDEX) := GR_TOT_DONE(AC_INDEX) + DONE;
- GR_TOT_START(AC_INDEX) := GR_TOT_START(AC_INDEX) + START;
- ELE_DONE := ELE_DONE + DONE;
- SS_TOT_DONE := SS_TOT_DONE + DONE;
- end loop;
-
- ELE_PTR.activity_completeness := NONE_COMPLETE;
- ELE_PTR.size_done_at_start := ELE_PTR.size_done_at_start
- + integer(ELE_DONE);
- -- adjust for round off error
- if ELE_PTR.size_done_at_start > ELE_PTR.current_size then
- ELE_PTR.size_done_at_start := ELE_PTR.current_size;
- end if;
- end loop;
-
- -- compute the percent complete at start for this subsystem
- if SS_TOT_SIZE + SS_TOT_START = 0.0 then
- SS_PTR.percent_at_start := 0.0;
- elsif SS_TOT_DONE <= SS_TOT_SIZE then
- SS_PTR.percent_at_start := 100.0 * (SS_TOT_DONE +
- SS_TOT_START) / (SS_TOT_START + SS_TOT_SIZE);
- else
- SS_PTR.percent_at_start := 100.0;
- end if;
- end loop;
-
- -- calculate the percent complete at start by activity
- AC_INDEX := 0;
- start_walk(AC_LIST);
- loop
- walk(AC_LIST, AC_PTR, END_LIST);
- exit when END_LIST;
- AC_INDEX := AC_INDEX + 1;
- if GR_TOT_START(AC_INDEX) + GR_TOT_SIZE(AC_INDEX) = 0.0 then
- AC_PTR.percent_at_start := 0.0;
- elsif GR_TOT_DONE(AC_INDEX) <= GR_TOT_SIZE(AC_INDEX) then
- AC_PTR.percent_at_start := 100.0 * (GR_TOT_START(AC_INDEX)
- + GR_TOT_DONE(AC_INDEX)) / (GR_TOT_START(AC_INDEX)
- + GR_TOT_SIZE(AC_INDEX));
- else
- AC_PTR.percent_at_start := 100.0;
- end if;
- end loop;
-
- exception
- when others => put_line("exception raise in RESET_DATA");
- end RESET_DATA;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --fixorig.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- separate(TRACKER.MANIPULATE_DATA.GROUP_DATA_FIXES)
- procedure UPDATE_ORIGINAL is
- --------------------------------------------------------------------------------
- --|
- --| NAME: UPDATE_ORIGINAL
- --|
- --| OVERVIEW:
- --| This procedure walks through the element data and for each element
- --| sets the original size estimate equal to the current size estimate.
- --|
- --| EXCEPTIONS HANDLED:
- --| others an error message is printed and execution continues
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- --------------------------------------------------------------------------------
- use EL_LIST_PKG;
-
- EL_PTR : element_pointer;
- END_LIST : boolean := false;
-
- begin
- start_walk (EL_LIST);
- loop
- walk (EL_LIST, EL_PTR, END_LIST);
- exit when END_LIST;
- EL_PTR.original_size := EL_PTR.current_size;
- end loop;
-
- exception
- when others => put_line("exception raised in UPDATE_ORIGINAL.");
- end UPDATE_ORIGINAL;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --wrdata.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- with text_io; use text_io;
-
- separate(tracker)
- procedure WRITE_DATA_TO_FILE is
- --------------------------------------------------------------------------------
- --|
- --| NAME: WRITE_DATA_TO_FILE
- --|
- --| OVERVIEW:
- --| This procedure writes all of the tracker data to a text file by
- --| calling the save procedures of each data type in a specified order.
- --| If the file already exists, then the output text file is a new
- --| VAX_VMS version of any existing tracker input file.
- --|
- --| The information is stored in a sequential text file. All of the
- --| data is read in at the beginning of the program, manipulated,
- --| and then written back out to the new file.
- --|
- --| The data is stored in the file in the following order:
- --|| +-----------------------+
- --|| | Global Data |
- --|| +-----------------------+
- --|| | Activity Data |
- --|| +-----------------------+
- --|| | Milestone Data |
- --|| +-----------------------+
- --|| | Personnel Data |
- --|| +-----------------------+
- --|| | Subsystem Data |
- --|| +-----------------------+
- --|| | Element Data |
- --|| +-----------------------+
- --|
- --| EXCEPTIONS HANDLED:
- --| name_error tracker file can't be created, raised to calling routine
- --|
- --| HISTORY:
- --| Written by May Lee March 1985
- --|
- --------------------------------------------------------------------------------
- begin
- new_line;
- put_line(" Writing the data to file.... ");
- new_line;
- -- create the output file to write the data to
- create (output_file, out_file, tracker_filename, "");
- GLOBAL_PKG.GL_SAVE;
- ACTIVITY_PKG.AC_SAVE;
- MILESTONE_PKG.MS_SAVE;
- PERSONNEL_PKG.PR_SAVE;
- SUBSYSTEM_PKG.SS_SAVE;
- ELEMENT_PKG.EL_SAVE;
- close (output_file);
- exception
- when name_error =>
- new_line(2);
- put("Sorry, tracker file "); put(tracker_filename(1..filename_lngth));
- put(" cannot be created. ");
- new_line(2);
- raise;
- end WRITE_DATA_TO_FILE;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --menudr.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- with PROMPT_PKG;
- with text_io; use text_io;
-
- separate(tracker)
-
- procedure DATA_MENU_DRIVER is
- --------------------------------------------------------------------------------
- --|
- --| NAME: DATA_MENU_DRIVER
- --|
- --| OVERVIEW:
- --| This procedure gets all the TRACKER data by controlling the printing
- --| of the data menus, and resolving the selections to those menus.
- --|
- --| The data menu displays different types of data. When a data type
- --| is chosen, an operations submenu appears, which allows the user
- --| to manipulate the data. Since the only operation that can be
- --| performed on global data is modification, the user is prompted
- --| for the new data, which is assigned directly to the global
- --| variable rather than calling a modify procedure in global_data.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| Written by May Lee March 1985
- --|
- --------------------------------------------------------------------------------
-
- use VT100; use CALENDAR;
- use SS_LIST_PKG; -- to get task numbers
-
- exit_data_menu : boolean := false;
- exit_submenu : boolean := false;
-
- last : natural; -- used for getting an integer from a string
- data_menu_selection : integer;
- menu_selection : integer;
- found : boolean := false; -- parameter to find
- ss_name : ss_name_type := (others => ' '); -- used to get task num
- ss_record : subsystem_pointer; -- used to get task numbers
-
- begin
- while not exit_data_menu loop
- exit_submenu := false;
- data_menu_selection := PRINT_DATA_MENU;
-
- case data_menu_selection is
-
- when 1 =>
- while not exit_submenu loop
- menu_selection := PRINT_GLOBAL_MENU;
-
- case menu_selection is
- when 1 =>
- put(" The current project name is "); put(project_name);
- new_line(2);
- put_line(" What would you like to change the project name to? ");
- project_name := PROMPT_PKG.PROJECT_NAME;
- when 2 =>
- put(" The current project number is "); put(project_number,3);
- new_line(2);
- put_line(" What would you like to change the project number to? ");
- project_number := PROMPT_PKG.PROJECT_NUM;
- when 3 =>
- put(" The current manager is "); put(manager_name); new_line;
- new_line(2);
- put_line(" Who would you like to be the new manager? ");
- manager_name := PROMPT_PKG.MANAGER_NAME;
- when 4 =>
- put(" The current date is ");
- if date = null_date then
- put("a null date ");
- else
- put(date.month,2); put('/');
- put(date.day,2); put('/');
- put(date.year,4);
- end if;
- new_line(2);
- put_line(" What would you like to change the date to? ");
- loop
- date := PROMPT_PKG.DATE;
- exit when date /= null_date;
- put_line(" The date of this run cannot be a null date.");
- put_line(" Try Again!");
- end loop;
- when 5 => exit_submenu := true;
- when others =>
- new_line;
- put_line("Please enter a number between 1 and 5. ");
- delay 1.0;
- end case;
- end loop;
-
- when 2 =>
- while not exit_submenu loop
- menu_selection := PRINT_OPERATION_MENU;
-
- case menu_selection is
- when 1 => ACTIVITY_PKG.AC_ADD;
- when 2 => ACTIVITY_PKG.AC_DELETE;
- when 3 => ACTIVITY_PKG.AC_MODIFY;
- when 4 => CLEAR_SCREEN;
- PROMPT_PKG.DISPLAY_ACTIVITY_DATA;
- new_line(2);
- put_line(" Press <cr> to continue");
- skip_line;
- new_line;
- when 5 => exit_submenu := true;
- when others =>
- new_line;
- put_line("Please enter a number between 1 and 5. ");
- delay 1.0;
- end case;
- end loop;
-
- when 3 =>
- while not exit_submenu loop
- menu_selection := PRINT_OPERATION_MENU;
-
- case menu_selection is
- when 1 => PERSONNEL_PKG.PR_ADD;
- when 2 => PERSONNEL_PKG.PR_DELETE;
- when 3 => PERSONNEL_PKG.PR_MODIFY;
- when 4 => CLEAR_SCREEN;
- PROMPT_PKG.DISPLAY_PERSONNEL_DATA;
- new_line(2);
- put_line(" Press <cr> to continue");
- skip_line;
- new_line;
- when 5 => exit_submenu := true;
- when others =>
- new_line;
- put_line("Please enter a number between 1 and 5. ");
- delay 1.0;
- end case;
- end loop;
-
- when 4 =>
- while not exit_submenu loop
- menu_selection := PRINT_OPERATION_MENU;
-
- case menu_selection is
- when 1 => MILESTONE_PKG.MS_ADD;
- when 2 => MILESTONE_PKG.MS_DELETE;
- when 3 => MILESTONE_PKG.MS_MODIFY;
- when 4 => CLEAR_SCREEN;
- PROMPT_PKG.DISPLAY_MILESTONE_DATA;
- new_line(2);
- put_line(" Press <cr> to continue");
- skip_line;
- new_line;
- when 5 => exit_submenu := true;
- when others =>
- new_line;
- put_line("Please enter a number between 1 and 5. ");
- delay 1.0;
- end case;
- end loop;
-
- when 5 =>
- while not exit_submenu loop
- menu_selection := PRINT_OPERATION_MENU;
-
- case menu_selection is
- when 1 => SUBSYSTEM_PKG.SS_ADD;
- when 2 => SUBSYSTEM_PKG.SS_DELETE;
- when 3 => SUBSYSTEM_PKG.SS_MODIFY;
- when 4 => CLEAR_SCREEN;
- PROMPT_PKG.DISPLAY_SUBSYSTEM_DATA;
- new_line(2);
- put_line(" Press <cr> to continue");
- skip_line;
- new_line;
- when 5 => exit_submenu := true;
- when others =>
- new_line;
- put_line("Please enter a number between 1 and 5. ");
- delay 1.0;
- end case;
- end loop;
-
- when 6 =>
- while not exit_submenu loop
- menu_selection := PRINT_EL_OPERATION_MENU;
-
- case menu_selection is
- when 1 => ELEMENT_PKG.EL_ADD;
- when 2 => ELEMENT_PKG.EL_DELETE;
- when 3 => ELEMENT_PKG.EL_MODIFY;
- when 4 => CLEAR_SCREEN;
- PROMPT_PKG.DISPLAY_ELEMENT_DATA;
- new_line(2);
- put_line(" Press <cr> to continue");
- skip_line;
- new_line;
- when 5 => ELEMENT_PKG.UPDATE_CURRENT;
- when 6 => ELEMENT_PKG.UPDATE_PCT_DONE;
- when 7 => exit_submenu := true;
- when others =>
- new_line;
- put_line("Please enter a number between 1 and 7. ");
- delay 1.0;
- end case;
- end loop;
-
- when 7 => VT100.CLEAR_SCREEN;
- exit_data_menu := true; --exit to report menu
-
- when others =>
- new_line;
- put_line("Please enter a number between 1 and 7. ");
- delay 1.0;
- end case;
-
- end loop;
-
- end DATA_MENU_DRIVER;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --getdata.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- separate( TRACKER )
- procedure GET_DATA is
- ----------------------------------------------------------------------
- --| NAME: GET_DATA
- --|
- --| OVERVIEW:
- --| The user is asked whether or not he has an existing TRACKER file.
- --| This procedure either calls INITIALIZE_TRACKER_DATA if the user
- --| does not have an existing TRACKER file, or calls SET_UP_TRACKER_DATA
- --| if the user does have a file.
- --|
- --| EXCEPTIONS HANDLED:
- --| name_error raised to the calling procedure
- --| ERROR_IN_INPUT_FILE raised to the calling procedure
- --| others indicates invalid user response so user reprompted
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- ----------------------------------------------------------------------
- valid_response : boolean := false;
- char_input : character := ' ';
-
- begin
- while not valid_response loop
- put_line("Do you have an existing TRACKER file that you ");
- new_line;
- put_line("would like to use for this run? ");
- put(" [Y or N, <cr>=N] : ");
- begin
- if end_of_line then -- pressed return, default is no
- skip_line; new_line;
- valid_response := true;
- INITIALIZE_TRACKER_DATA;
- else
- get( char_input );
- if char_input = 'Y' or char_input = 'y' then
- skip_line; new_line;
- valid_response := true;
- SET_UP_TRACKER_DATA;
- elsif char_input = 'N' or char_input = 'n' then
- skip_line; new_line;
- valid_response := true;
- INITIALIZE_TRACKER_DATA;
- else
- skip_line; new_line;
- put_line("Please enter 'Y' or 'N' ");
- delay 0.7;
- CLEAR_SCREEN;
- end if;
- end if;
- exception
- when name_error => raise;
- when ERROR_IN_INPUT_FILE => raise;
- when others =>
- skip_line; new_line;
- -- invalid entry
- put_line("Please enter 'Y' or 'N' ");
- delay 0.7;
- CLEAR_SCREEN;
- end;
- end loop;
-
- end GET_DATA;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --global.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- with PROMPT_PKG;
-
- separate (TRACKER)
- package body GLOBAL_PKG is
- ----------------------------------------------------------------------
- --|
- --| NAME: GLOBAL_PKG
- --|
- --| OVERVIEW:
- --| This package defines the global data and the actions that
- --| can be performed on them.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- ----------------------------------------------------------------------
-
- use CALENDAR;
-
- procedure GL_INITIALIZE is
- ----------------------------------------------------------------------
- --|
- --| NAME: GL_INITIALIZE
- --|
- --| OVERVIEW:
- --| This procedure prompts for global data by calling the Prompt_Pkg
- --| functions, which returns valid data only.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- ----------------------------------------------------------------------
- begin
- project_name := PROMPT_PKG.PROJECT_NAME;
- project_number:= PROMPT_PKG.PROJECT_NUM;
- manager_name := PROMPT_PKG.MANAGER_NAME;
- loop
- put_line(" The tracker calculations are based on the last day of a work week. ");
- put_line(" What is the date for this run? ");
- date := PROMPT_PKG.DATE;
- exit when date /= null_date;
- put_line(" You cannot use a null date. Try Again! ");
- new_line;
- end loop;
- end GL_INITIALIZE;
-
- procedure GL_SET_UP is
- ----------------------------------------------------------------------
- --|
- --| NAME: GL_SET_UP
- --|
- --| OVERVIEW:
- --| This procedure sets up the global variables read in from an input file.
- --| The global data line is read in from the input file, and broken down
- --| into the respective global variables. The data is read in the order
- --| specified by the GL_SAVE procedure.
- --|
- --| EXCEPTIONS HANDLED:
- --| others error reading the global data
- --| . raises ERROR_IN_INPUT_FILE
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- ----------------------------------------------------------------------
- begin
- get(tracker_file, project_name);
- get(tracker_file, project_number, width => 3 );
- get(tracker_file, manager_name);
- get(tracker_file, date.month, width => 2);
- get(tracker_file, date.day , width => 2);
- get(tracker_file, date.year , width => 4);
- get(tracker_file, num_of_activities, width => 2 ); -- integer
- get(tracker_file, num_of_milestones, width => 2 );
- get(tracker_file, num_of_people, width => 2 );
- get(tracker_file, num_of_subsystems, width => 2 );
- get(tracker_file, num_of_elements, width => 4 );
- skip_line(tracker_file);
- loop
- put_line(" The tracker calculations are based on the last day of a work week. ");
- put_line(" What is the date for this run? ");
- date := PROMPT_PKG.DATE;
- exit when date /= null_date;
- put_line(" You cannot use a null date. Try Again! ");
- new_line;
- end loop;
- exception
- when others => put_line(" Error reading global data.");
- raise ERROR_IN_INPUT_FILE;
- end GL_SET_UP;
-
- procedure GL_SAVE is
- ----------------------------------------------------------------------
- --|
- --| NAME: GL_SAVE
- --|
- --| OVERVIEW:
- --| This procedure will save the global data to an output file.
- --| The global data is composed of different types of variables.
- --| The variables are written to the first line of the output file
- --| in the following format:
- --||
- --|| +--------------+--------+---------------+--+--+----+--+--+--+--+----+
- --|| | project_name |proj_num| manager_name |mo|dy| yr |ac|ms|pr|ss| el |
- --|| +--------------+--------+---------------+--+--+----+--+--+--+--+----+
- --||
- --| See DATA_PKG for the full names and types of each variable.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- ----------------------------------------------------------------------
-
- begin
- put(output_file, project_name);
- put(output_file, project_number, width => 3 );
- put(output_file, manager_name);
- put(output_file, date.month, width => 2);
- put(output_file, date.day , width => 2);
- put(output_file, date.year , width => 4);
- put(output_file, num_of_activities, width => 2 );
- put(output_file, num_of_milestones, width => 2 );
- put(output_file, num_of_people, width => 2 );
- put(output_file, num_of_subsystems, width => 2 );
- put(output_file, num_of_elements, width => 4 );
- new_line(output_file);
- end GL_SAVE;
-
- end GLOBAL_PKG;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --ac.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- with PROMPT_PKG;
-
- separate(tracker)
- package body ACTIVITY_PKG is
-
- --------------------------------------------------------------------------------
- --| NAME: ACTIVITY_PKG
- --|
- --| OVERVIEW:
- --| This package defines the actions that can be performed on an
- --| activity (defined in DATA_PKG).
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- -------------------------------------------------------------------------------
-
- -- instantiation of generic list handler done in DATA_PKG
- use EL_LIST_PKG;
- use AC_LIST_PKG;
- use SS_LIST_PKG;
- use BOOLEAN_TEXT_IO;
-
- procedure AC_ADD is separate;
- procedure AC_INITIALIZE is separate;
- procedure AC_SET_UP is separate;
- procedure AC_DELETE is separate;
- procedure AC_MODIFY is separate;
- procedure AC_SAVE is separate;
-
- end ACTIVITY_PKG;
-
- --*****************************************************************************
-
- separate( TRACKER.ACTIVITY_PKG )
- procedure AC_ADD is
- ------------------------------------------------------------------------------
- --|
- --| NAME: AC_ADD
- --|
- --| OVERVIEW:
- --| This procedure sets up the record to be added to the list by
- --| user prompt/response. The prompts are called from the Prompt_pkg,
- --| which returns a valid response. The complete record is then added
- --| to the linked list by calling the generic List_pkg procedure ADD.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- --| NOTES:
- --| A check is made to insure that the maximum number of activities
- --| is not exceeded.
- --|
- --| The number of activities is incremented in this procedure.
- ------------------------------------------------------------------------------
- a_char : character := ' ';
- ac_record : activity_pointer;
- el_record : element_pointer;
- end_list : boolean := false;
- ss_record : subsystem_pointer;
-
- begin
- new_line;
- -- check if num of activities is > max num of activities
- if num_of_activities > max_num_activities then
- put_line(" You are not allowed to add another activity because ");
- put(" you already have "); put(max_num_activities,1); put(" activities, ");
- new_line;
- put_line(" which is the most you are allowed to have. ");
-
- else
- -- create a pointer to an activity record
- ac_record := new activity_type;
-
- put_line(" If you would like more information on the type of data ");
- put_line(" to enter for any of the following questions, enter '?'. ");
- put_line(" Otherwise, enter the data requested. ");
- new_line(2);
-
- -- get the record fields
- ac_record.name := PROMPT_PKG.NEW_ACTIV_NAME;
- put_line(" What is this activity's percent of the project? ");
- ac_record.percent_tot_proj := PROMPT_PKG.PERCENT;
- ac_record.priority := PROMPT_PKG.ACTIV_PRIORITY;
- ac_record.consider_in_calc := PROMPT_PKG.CONSIDER_AC_IN_CALC;
- put_line(" What percentage is available at start? ");
- ac_record.percent_at_start := PROMPT_PKG.PERCENT;
-
- -- add the record to the linked list by calling the generic add
- ADD ( ac_list, ac_record.name(1..act_name_max_len), ac_record);
-
- -- increment number of activities
- num_of_activities := num_of_activities + 1;
-
- -- walk ss list and prompt for extra task number
- START_WALK( ss_list );
- loop
- WALK( ss_list, ss_record, end_list );
- exit when end_list;
- ss_record.task_numbers(num_of_activities)
- := PROMPT_PKG.TASK_NUMBER_BY_AC( ss_record );
- end loop;
- new_line(2);
-
- -- Walk the element list and check each element.
- -- If multiple people on an element, default the person's initials
- -- for the new activity to be the person working on the previous ac
- START_WALK( el_list );
- loop
- WALK( el_list, el_record, end_list );
- exit when end_list;
- -- check if multiple people
- if el_record.more_than_one_person then
- el_record.people_initials( num_of_activities ) :=
- el_record.people_initials( num_of_activities - 1 );
- end if;
- end loop;
-
- new_line;
- put(" The number of activities = "); put( num_of_activities,1);
- new_line(2);
- delay 1.0;
-
- end if; -- allowed to add another activity
- end AC_ADD;
-
-
- separate( TRACKER.ACTIVITY_PKG )
- procedure AC_INITIALIZE is
- ------------------------------------------------------------------------------
- --|
- --| NAME: AC_INITIALIZE
- --|
- --| OVERVIEW:
- --| This procedure is called only when a new TRACKER file has to
- --| be created. It is part of a forced user response to fill in
- --| the necessary data to make TRACKER a complete report. The
- --| procedure AC_ADD is called to gather the information and put it
- --| into a linked list.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- ------------------------------------------------------------------------------
- add_another : character := 'N';
- done : boolean := false;
-
- begin
- -- get the data for the record and add to linked list
- while not done loop
- -- force the user to add at least one activity
- AC_ADD; -- data to the record and the record to the list
- loop
- put_line("Would you like to add another activity? ");
- put(" [ Y or N, <cr>=N ] : ");
- if end_of_line then -- pressed return, default to no
- skip_line;
- new_line(2);
- done := true;
- exit;
- else
- get(add_another); skip_line;
- new_line(2);
- if add_another = 'N' or add_another = 'n' then
- done := true;
- exit;
- elsif add_another = 'Y' or add_another = 'y' then
- exit;
- else
- put_line(" Please enter y or n. ");
- end if;
- end if;
- end loop;
- end loop;
- end AC_INITIALIZE;
-
-
- separate( TRACKER.ACTIVITY_PKG )
- procedure AC_SET_UP is
- ------------------------------------------------------------------------------
- --|
- --| NAME: AC_SET_UP
- --|
- --| OVERVIEW:
- --| This procedure is only called if there is an existing input file.
- --| The activity record is read from the input file by calling AC_READ.
- --| Each record is added to the linked list by calling the generic List_Pkg
- --| procedure ADD until there are no more activity records.
- --|
- --| EXCEPTIONS HANDLED:
- --| others Error reading the record from the file.
- --| . This exception raises ERROR_IN_INPUT_FILE.
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- --| NOTES:
- --| The number of activities records read in is determined by the
- --| global variable num_of_activities.
- --|
- --| If an error is detected reading the data, the rest of the input line
- --| is skipped and reading the rest of the data continues. All errors
- --| found are reported. Execution is not terminated until the entire
- --| input file has been read.
- --|
- ------------------------------------------------------------------------------
- ac_record : activity_pointer;
- ac_num : integer := 1; -- number of current activity
- bad_data : boolean := false;
-
- procedure AC_READ is separate;
-
- begin
- for i in 1..num_of_activities loop
- begin
- ac_num := i;
- -- create a null activity record
- ac_record := new activity_type;
- -- read the activity from the file
- AC_READ;
- -- add it to the linked list
- ADD(ac_list, ac_record.name, ac_record);
- exception
- when others =>
- skip_line(tracker_file);
- put(" Error reading activity record "); put( ac_num,1);
- put(" from the tracker file. "); new_line;
- bad_data := true;
- end;
- end loop;
- if bad_data then
- raise ERROR_IN_INPUT_FILE;
- end if;
- end AC_SET_UP;
-
-
- separate( TRACKER.ACTIVITY_PKG.AC_SET_UP )
- procedure AC_READ is
- --|
- --| NAME: AC_READ
- --|
- --| OVERVIEW:
- --| This procedure reads a record from the file. One line of data is
- --| read at a time and broken down into the fields of the
- --| activity record, which is made visible to the calling routine
- --| AC_SET_UP. The data is read in the format specified by the AC_WRITE
- --| procedure.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- --| NOTES:
- --| Any exceptions raised here are handled by AC_SET_UP.
- begin
- get( tracker_file, ac_record.name );
- get( tracker_file, ac_record.percent_tot_proj, 5 ); -- real type
- get( tracker_file, ac_record.priority, 2 ); -- integer type
- get( tracker_file, ac_record.percent_at_start, 5 ); -- real type
- get( tracker_file, ac_record.consider_in_calc ); -- boolean
- skip_line(tracker_file);
- end AC_READ;
-
-
- separate( TRACKER.ACTIVITY_PKG )
- procedure AC_DELETE is
- ------------------------------------------------------------------------------
- --|
- --| NAME: AC_DELETE
- --|
- --| OVERVIEW:
- --| This procedure is used to delete a record from the list by calling
- --| the generic procedure DELETE. The user is prompted for an existing
- --| activity to delete by a call to Prompt_pkg. When an activity is
- --| deleted, its completeness information, which is stored as a field
- --| in the element record, must also be deleted by calling the
- --| procedure DELETE_AC_COMPLETENESS.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- --| NOTES:
- --| The number of activities is decremented if the delete is successful.
- --|
- --| A check is made to insure the last activity is not deleted. There
- --| must be at least one activity at all times.
- ------------------------------------------------------------------------------
- abort_proc : boolean; -- abort getting an existing AC
- ac_number : integer := 0; -- number of the activity we are deleting
- ac_record : activity_pointer; -- activity record
- end_list : boolean; -- parameter to walk
- found : boolean; -- parameter to find
- key : ac_name_type; -- name of activity looking for
- new_number : ac_name_type; -- replacement ac
- successful : boolean := false; -- if key found in list
-
- procedure DELETE_AC_COMPLETENESS is separate;
- procedure DELETE_SS_TASK_NUM is separate;
- procedure DELETE_MULTIPLE_PEOPLE is separate;
-
- begin
- if num_of_activities > 1 then -- have to have at least one activity
- put_line("Which activity would you like to delete? ");
- -- get the name
- PROMPT_PKG.EXISTING_ACTIV_NAME( abort_proc, key );
-
- if not abort_proc then
- -- get the number of the activity so we can delete it from the
- -- activity completeness array and subsystem task number array
- START_WALK( ac_list );
- loop
- WALK( ac_list, ac_record, end_list );
- ac_number := ac_number + 1;
- if ac_record.name = key then
- exit;
- end if;
- end loop;
-
- -- delete the activity from the list
- DELETE( ac_list, key, successful );
-
- if successful then -- activity was found and deleted from the list
- -- delete activity completeness information from element data
- DELETE_AC_COMPLETENESS;
- DELETE_SS_TASK_NUM;
- -- if multiple people on an element, delete person's initials from ac
- DELETE_MULTIPLE_PEOPLE;
- -- decrement num of activities counter
- num_of_activities := num_of_activities - 1;
-
- new_line;
- put(" The number of activities = "); put(num_of_activities,1);
- new_line(2);
- delay 1.0;
-
- end if;
-
- end if; -- not abort
- else
- put_line(" You must have at least one activity at all times. ");
- put_line(" Since you only have one activity at this time, you ");
- put_line(" cannot delete it. ");
- end if;
- end AC_DELETE;
-
-
- separate( TRACKER.ACTIVITY_PKG.AC_DELETE )
- procedure DELETE_AC_COMPLETENESS is
- -----------------------------------------------------------------------------
- --|
- --| NAME: DELETE_AC_COMPLETENESS
- --|
- --| OVERVIEW:
- --| This procedure is called when an activity is deleted from the
- --| activity list. When an activity is deleted, the element list is
- --| walked and the activity completeness is deleted in each element
- --| to account for the missing activity. Since the activity completeness
- --| is stored as an array in a field of the element, the array cell
- --| corresponding to the number of the activity in the activity list
- --| is deleted. The remaining array cells are moved up one cell space.
- --| The number of the cell to be deleted is ac_number.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- -----------------------------------------------------------------------------
- end_list : boolean;
- el_record : element_pointer;
-
- begin
- START_WALK( el_list );
- loop
- WALK( el_list, el_record, end_list );
- exit when end_list;
- if ac_number = max_num_activities then
- -- last activity
- el_record.activity_completeness( ac_number ) := ' ';
- else
- -- delete ac from the activty completeness and move the rest up one
- el_record.activity_completeness( ac_number..max_num_activities - 1) :=
- el_record.activity_completeness( ac_number + 1..max_num_activities);
- -- blank out last activity completeness
- el_record.activity_completeness( max_num_activities ) := ' ';
- end if;
- end loop;
- end DELETE_AC_COMPLETENESS;
-
-
- separate( TRACKER.ACTIVITY_PKG.AC_DELETE )
- procedure DELETE_SS_TASK_NUM is
- -----------------------------------------------------------------------------
- --|
- --| NAME: DELETE_SS_TASK_NUM
- --|
- --| OVERVIEW:
- --| This procedure is called when an activity is deleted from the
- --| activity list. When an activity is deleted, the subsystem list is
- --| walked and the task number associated with that activity is deleted
- --| from each subsystem's task number field array. Since the task number
- --| is stored as an array in a field of the subsystem, the array cell
- --| corresponding to the number of the activity in the activity list
- --| is deleted. The remaining array cells are moved up one cell space.
- --| The number of the cell to be deleted is ac_number.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- -----------------------------------------------------------------------------
- end_list : boolean;
- ss_record : subsystem_pointer;
-
- begin
- START_WALK( ss_list );
- loop
- WALK( ss_list, ss_record, end_list );
- exit when end_list;
- if ac_number = max_num_activities then
- -- last activity
- ss_record.task_numbers( ac_number ) := 0;
- else
- -- delete task number from the array and move the rest up one
- ss_record.task_numbers( ac_number..max_num_activities - 1) :=
- ss_record.task_numbers( ac_number + 1..max_num_activities);
- -- zero out last task number
- ss_record.task_numbers( max_num_activities ) := 0;
- end if;
- end loop;
- end DELETE_SS_TASK_NUM;
-
- separate( TRACKER.ACTIVITY_PKG.AC_DELETE )
- procedure DELETE_MULTIPLE_PEOPLE is
- -----------------------------------------------------------------------------
- --|
- --| NAME: DELETE_MULTIPLE_PEOPLE
- --|
- --| OVERVIEW:
- --| This procedure is called when an activity is deleted from the
- --| activity list. The element list is walked. If it is a multiple person
- --| element, the person's inititals associated with that activity is
- --| deleted from that element record's people_initials variant field.
- --| Since the person's initials are stored as an array, the array cell
- --| corresponding to the number of the activity in the activity list
- --| is deleted. The remaining array cells are moved up one cell space.
- --| The number of the cell to be deleted is ac_number.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- -----------------------------------------------------------------------------
- end_list : boolean;
- el_record : element_pointer;
-
- begin
- START_WALK( el_list );
- loop
- WALK( el_list, el_record, end_list );
- exit when end_list;
- -- check if multiple element
- if el_record.more_than_one_person then
- if ac_number = max_num_activities then
- -- last activity
- el_record.people_initials( ac_number ) := " ";
- else
- -- delete person's initials from the array and move the rest up one
- el_record.people_initials( ac_number..max_num_activities - 1) :=
- el_record.people_initials( ac_number + 1..max_num_activities);
- -- blank out last person's initials
- el_record.people_initials( max_num_activities ) := " ";
- end if;
- end if;
- end loop;
- end DELETE_MULTIPLE_PEOPLE;
-
- separate( TRACKER.ACTIVITY_PKG )
- procedure AC_MODIFY is
- ------------------------------------------------------------------------------
- --|
- --| NAME: AC_MODIFY
- --|
- --| OVERVIEW:
- --| This procedure allows the user to modify an existing record.
- --| The user is prompted for an existing activity record by calling
- --| the appropriate Prompt_Pkg function. The generic FIND is used to
- --| get the record. The user is then allowed to change the fields by
- --| choosing a menu selection. The record fields are modified directly.
- --| If the activity name is modified, MODIFY_AC_KEY is called.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- ------------------------------------------------------------------------------
- abort_proc : boolean := false; -- abort getting existing ac
- activity_name : ac_name_type; -- name of activity looking for
- ac_record : activity_pointer;
- exit_field_menu : boolean := false; -- exit activity field menu
- field_selection : integer; -- selection from activity field menu
- found : boolean := false; -- if the record was found in the list
- key : ac_name_type; -- num of milestone looking for
-
-
- procedure MODIFY_AC_KEY is separate;
-
- begin
- put_line("Which activity would you like to modify?");
- PROMPT_PKG.EXISTING_ACTIV_NAME( abort_proc, key );
-
- if not abort_proc then
- -- set pointer to that activity, returned in ac_record
- FIND( ac_list, key, ac_record, found);
-
- while not exit_field_menu loop
- field_selection := VT100.PRINT_AC_MENU( ac_record );
- case field_selection is
-
- when 1 => -- get activity name, change key
- put(" The current activity name is : ");
- put( ac_record.name(1..act_name_max_len) ); new_line(2);
- put_line(" What would you like to change the activity name to? ");
- MODIFY_AC_KEY;
-
-
- when 2 => -- Get percentage of total project
- put(" The current percentage of the total project is : ");
- put( ac_record.percent_tot_proj, 3,1,0 ); new_line(2);
- put_line(" What would you like to change the percentage to? ");
- ac_record.percent_tot_proj := PROMPT_PKG.PERCENT;
-
- when 3 => -- Get priority
- put(" The current priority is : ");
- put( ac_record.priority, 2 ); new_line(2);
- put_line(" What would you like to change the priority to? ");
- ac_record.priority := PROMPT_PKG.ACTIV_PRIORITY;
-
- when 4 => -- Get consider in calculations
- if ac_record.consider_in_calc then
- put(" This activity is being considered ");
- put("in the tracker calculations. "); new_line(2);
- put_line(" Do you still want it to be considered ? ");
- else
- put(" This activity is not being considered ");
- put("in the tracker calculations. "); new_line(2);
- put_line(" Do you want it to be considered ? ");
- end if;
- ac_record.consider_in_calc := PROMPT_PKG.CONSIDER_AC_IN_CALC;
-
- when 5 => -- Get percent at start
- put(" The current percentage at start is : ");
- put( ac_record.percent_at_start, 3,1,0 ); new_line(2);
- put_line(" What would you like to change the percentage to? ");
- ac_record.percent_at_start := PROMPT_PKG.PERCENT;
-
- when 6 => exit_field_menu := true;
-
- when others => put_line("Please enter a number beween 1 and 6.");
- end case;
- end loop;
- end if;
-
- end AC_MODIFY;
-
-
- separate ( TRACKER.ACTIVITY_PKG.AC_MODIFY )
- procedure MODIFY_AC_KEY is
- ---------------------------------------------------------------------------
- --|
- --| NAME: MODIFY_AC_KEY
- --|
- --| OVERVIEW:
- --| This procedure is called if the activity name is modified.
- --| The name must be changed in the list search key by calling
- --| the List_pkg procedure CHANGE_LIST_KEY, as well as in the
- --| record data.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- ---------------------------------------------------------------------------
- new_name : ac_name_type;
- begin
- new_name := PROMPT_PKG.NEW_ACTIV_NAME;
- -- change the search key in the activity list
- CHANGE_LIST_KEY( ac_list, ac_record.name, new_name );
- -- change the name in the record
- ac_record.name := new_name;
- end MODIFY_AC_KEY;
-
-
-
- separate( TRACKER.ACTIVITY_PKG )
- procedure AC_SAVE is
- ------------------------------------------------------------------------------
- --|
- --| NAME: AC_SAVE
- --|
- --| OVERVIEW:
- --| This procedure saves a record to file by calling the AC_WRITE
- --| procedure. The generic procedures START_WALK and WALK are called
- --| to walk the linked list allowing one record at a time to be written.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- ------------------------------------------------------------------------------
- end_list : boolean := false;
- ac_record : activity_pointer;
-
- procedure AC_WRITE is separate;
-
- begin
- START_WALK( ac_list);
- loop
- WALK( ac_list, ac_record, end_list);
- exit when end_list;
- AC_WRITE;
- end loop;
- end AC_SAVE;
-
- separate( TRACKER.ACTIVITY_PKG.AC_SAVE )
- procedure AC_WRITE is
- --|
- --| NAME: AC_WRITE
- --|
- --| OVERVIEW:
- --| This procedure is passed in a record pointer. The record is written
- --| to one line of the output file in the following format:
- --||
- --|| +----------+-----+--+----+-----+
- --|| | name |p_tot|pr|cons|pc_st|
- --|| +----------+-----+--+----+-----+
- --||
- --|
- --| See DATA_PKG for the full names of the fields and their types.
- --| The activity records are the second type of data to be written to the
- --| output file.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
-
- begin
- put( output_file, ac_record.name );
- put( output_file, ac_record.percent_tot_proj,
- fore => 3, aft => 1, exp => 0 ); -- real type
- put( output_file, ac_record.priority, 2 ); -- integer type
- put( output_file, ac_record.percent_at_start,
- fore => 3, aft => 1, exp => 0 ); -- real type
- put( output_file, ac_record.consider_in_calc, 5 );-- boolean
- new_line(output_file);
- end AC_WRITE;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --ms.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- with PROMPT_PKG;
-
- separate(tracker)
- package body milestone_pkg is
- -------------------------------------------------------------------------------
- --|
- --| NAME: MILESTONE_PKG
- --|
- --| OVERVIEW:
- --| This package defines the actions that can be performed on
- --| milestone data types (defined in DATA_PKG).
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- -------------------------------------------------------------------------------
-
- -- instantiation of generic list handler done in DATA_PKG
- use EL_LIST_PKG;
- use MS_LIST_PKG;
-
- procedure CHANGE_MS_IN_EL( ms_record : in milestone_pointer;
- new_number : in MS_NUM_TYPE ) is separate;
- procedure MS_ADD is separate;
- procedure MS_INITIALIZE is separate;
- procedure MS_SET_UP is separate;
- procedure MS_DELETE is separate;
- procedure MS_MODIFY is separate;
- procedure MS_SAVE is separate;
-
- end MILESTONE_PKG;
-
- --*****************************************************************************
-
- separate( TRACKER.MILESTONE_PKG )
- procedure CHANGE_MS_IN_EL ( ms_record : in milestone_pointer;
- new_number : in ms_num_type ) is
- -----------------------------------------------------------------------------
- --|
- --| NAME: CHANGE_MS_IN_EL
- --|
- --| OVERVIEW:
- --| This procedure is called when a milestone is deleted from or modified
- --| in the milestone list. Before either of these actions can be taken,
- --| the element list that contains milestones with the same number is
- --| walked. This list is a field of the milestone data record.
- --| The milestone number field of each element record is reassigned
- --| the new milestone number.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- -----------------------------------------------------------------------------
- el_record : element_pointer; -- ms element list
- end_list : boolean;
-
- begin
- -- change the ms number field in el_record of the milestone's el list
- START_WALK( ms_record.element_list );
- loop
- WALK( ms_record.element_list, el_record, end_list );
- exit when end_list;
- el_record.milestone_num := new_number;
- end loop;
- end CHANGE_MS_IN_EL;
-
- separate( TRACKER.MILESTONE_PKG )
- procedure MS_ADD is
- -----------------------------------------------------------------------------
- --|
- --| NAME: MS_ADD
- --|
- --| OVERVIEW:
- --| This procedure sets up the record to be added to the list by
- --| user prompt/response. The function calls to Prompt_Pkg return
- --| only valid existing data. The complete record is
- --| then added to the linked list by calling the generic list procedure
- --| ADD.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- --| NOTES:
- --| The number of milestones is incremented in this procedure.
- -----------------------------------------------------------------------------
- ms_record : milestone_pointer; -- pointer to ms data
-
- begin
- -- create a null milestone record
- ms_record := new milestone_type;
-
- new_line;
- put_line(" If you would like more information on the type of data ");
- put_line(" to enter for any of the following questions, enter a '?'");
- put_line(" Otherwise, enter the data requested. ");
- new_line(2);
-
- -- get the record fields
- ms_record.number := PROMPT_PKG.NEW_MILSTONE_NUMBER;
- ms_record.completion_number :=
- PROMPT_PKG.MILESTONE_COMPLETION_NUMBER (default => ms_record.number);
- put_line(" What is the due date? ");
- ms_record.due_date := PROMPT_PKG.DATE;
- ms_record.description := PROMPT_PKG.MS_DESCRIPTION;
-
- -- add the record to the linked list by calling the generic add
- ADD ( ms_list, ms_record.number, ms_record);
-
- -- increment milestone counter
- num_of_milestones := num_of_milestones + 1;
-
- new_line;
- put(" The number of milestones = "); put( num_of_milestones,1);
- new_line(2);
- delay 1.0;
- end MS_ADD;
-
-
- separate( TRACKER.MILESTONE_PKG )
- procedure MS_INITIALIZE is
- -----------------------------------------------------------------------------
- --|
- --| NAME: MS_INITIALIZE
- --|
- --| OVERVIEW:
- --| This procedure is called only when a new TRACKER file has to
- --| be created. It is part of a forced user response to fill in
- --| the necessary data to make TRACKER a complete report. The
- --| procedure MS_ADD is called to gather the information and put it
- --| into a linked list.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- --| NOTES:
- --| The user is forced to add at least one milestone record and then
- --| is prompted to add another or not.
- -----------------------------------------------------------------------------
- add_another : character := 'N';
- done : boolean := false;
-
- begin
- while not done loop
- -- force the user to add at least one milestone
- MS_ADD; -- data to the record and the record to the list
- loop
- put_line("Would you like to add another milestone? ");
- put(" [ Y or N, <cr>=N ] : ");
- if end_of_line then -- pressed return, default to no
- skip_line;
- new_line(2);
- done := true;
- exit;
- else
- get(add_another); skip_line;
- new_line(2);
- if add_another = 'N' or add_another = 'n' then
- done := true;
- exit;
- elsif add_another = 'Y' or add_another = 'y' then
- exit;
- else
- put_line(" Please enter y or n. ");
- end if;
- end if;
- end loop;
- end loop;
- end MS_INITIALIZE;
-
- separate( TRACKER.MILESTONE_PKG )
- procedure MS_SET_UP is
- -----------------------------------------------------------------------------
- --|
- --| NAME: MS_SET_UP
- --|
- --| OVERVIEW:
- --| This procedure is only called if there is an existing input file.
- --| The milestone list is set up by reading the milestone record
- --| from the input file by calling MS_READ, and adding it to the linked
- --| list by calling the generic procedure ADD until there are no more
- --| milestone records.
- --|
- --| EXCEPTIONS HANDLED:
- --| others Error reading the record from the file.
- --| . This exception raises ERROR_IN_INPUT_FILE.
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- --| NOTES:
- --| The number of milestone records read in is determined by the
- --| global variable num_of_milestones.
- --|
- --| If an error is detected reading the data, the rest of the input line
- --| is skipped and reading of the rest of the data continues. All errors
- --| found are reported. Execution is not terminated until the entire
- --| input file has been read.
- --|
- -----------------------------------------------------------------------------
- ms_num : integer := 1; -- number of current milestone
- ms_record : milestone_pointer;
- bad_data : boolean := false;
-
- procedure MS_READ is separate;
-
- begin
- for i in 1..num_of_milestones loop
- begin
- ms_num := i;
- -- create a null milestone record
- ms_record := new milestone_type;
- -- read the milestone
- MS_READ;
- -- add it to the linked list
- ADD( ms_list, ms_record.number, ms_record);
- exception
- when others =>
- bad_data := true;
- skip_line (tracker_file);
- put(" Error reading milestone "); put(ms_num,1);
- put(" from the tracker file. "); new_line;
- end;
- end loop;
- if BAD_DATA then
- raise ERROR_IN_INPUT_FILE;
- end if;
- end MS_SET_UP;
-
- separate( TRACKER.MILESTONE_PKG.MS_SET_UP )
- procedure MS_READ is
- --|
- --| NAME: MS_READ
- --|
- --| OVERVIEW:
- --| This procedure reads a record from the file. One line of data is
- --| read at a time and broken down into the fields of the
- --| milestone record, which is made visible to the calling routine
- --| MS_SET_UP. The data is read in the format specified by the MS_WRITE
- --| procedure.
- --|
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- --| NOTES:
- --| Any exceptions raised here are handled by MS_SET_UP.
- begin
- get( tracker_file, ms_record.number, 2 ); -- integer
- get( tracker_file, ms_record.completion_number, 2 ); -- integer
- get( tracker_file, ms_record.due_date.month, 2 );
- get( tracker_file, ms_record.due_date.day, 2 );
- get( tracker_file, ms_record.due_date.year, 4 );
- get( tracker_file, ms_record.description(1..50) ); -- string
- skip_line (tracker_file);
- end MS_READ;
-
-
- separate( TRACKER.MILESTONE_PKG )
- procedure MS_DELETE is
- -----------------------------------------------------------------------------
- --|
- --| NAME: MS_DELETE
- --|
- --| OVERVIEW:
- --| This procedure is used to delete a milestone from the list by calling
- --| the List_Pkg procedure DELETE. When a milestone is deleted from the
- --| milestone list, the milestone number must also be changed in every
- --| element to which it belonged by calling the procedure
- --| CHANGE_MS_IN_EL.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- --| NOTES:
- --| The number of milestones is decremented after the record is deleted.
- --|
- --| A check is made to insure the last milestone is not deleted. There
- --| must be at least one milestone at all times.
- --|
- -----------------------------------------------------------------------------
-
- abort_proc : boolean; -- abort getting an existing ms
- end_list : boolean := false;
- ele_ptr : element_pointer;
- found : boolean; -- parameter to find
- ms_record : milestone_pointer; -- pointer to milestone record
- new_ms_record: milestone_pointer; -- pointer to new milestone record
- new_number : ms_num_type; -- replacement ms
- successful : boolean := false; -- parameter to delete
- key : ms_num_type; -- num of milestone looking for
-
-
- begin
- if num_of_milestones > 1 then -- have to have at least one milestone
- put_line("Which milestone would you like to delete? [ give milestone number] ");
-
- -- get the milestone number
- PROMPT_PKG.EXISTING_MILSTONE_NUMBER( abort_proc, key );
-
- if not abort_proc then
- --point to that record in the list
- FIND( ms_list, key, ms_record, found );
-
- -- delete the milestone from the list
- DELETE( ms_list, key, successful);
-
- -- check to see if this ms belonged to any elements
- START_WALK( ms_record.element_list );
- WALK( ms_record.element_list, ele_ptr, end_list );
-
- if not end_list then
- -- change milestone number in element data
- put(" When milestone "); put(ms_record.number, 1); put(" is deleted, "); new_line;
- put_line(" what milestone would you like to use in its place in the element data? ");
- -- prompt for new number
- loop
- PROMPT_PKG.EXISTING_MILSTONE_NUMBER( abort_proc, new_number );
- exit when not abort_proc;
- put_line(" You cannot abort the procedure at this time. ");
- put_line(" You must enter a valid milestone number.");
- new_line;
- end loop;
- FIND( ms_list, new_number, new_ms_record, found );
-
- -- change the milestone number in the element data
- CHANGE_MS_IN_EL( ms_record, new_number );
-
- -- append these elements to the new milestone's element list
- start_walk (ms_record.element_list);
- loop
- walk (ms_record.element_list, ele_ptr, end_list);
- exit when end_list;
- add (new_ms_record.element_list, ele_ptr.desc_key, ele_ptr);
- end loop;
- end if;
-
- -- decrement counter
- num_of_milestones := num_of_milestones - 1;
-
- new_line;
- put(" The number of milestones = "); put(num_of_milestones,1);
- new_line(2);
- delay 1.0;
-
- end if; -- not abort
-
- else
- put_line(" You must have at least one milestone at all times. ");
- put_line(" Since you only have one milestone at this time, you ");
- put_line(" cannot delete it. ");
- delay 2.0;
- end if;
- end MS_DELETE;
-
-
- separate( TRACKER.MILESTONE_PKG )
- procedure MS_MODIFY is
- -----------------------------------------------------------------------------
- --|
- --| NAME: MS_MODIFY
- --|
- --| OVERVIEW:
- --| This procedure allows the user to modify an existing milestone record.
- --| The user is prompted for an existing milestone record by calling
- --| the appropriate Prompt_Pkg function. The generic FIND is used to
- --| get the record. The user is then allowed to change the fields by
- --| choosing a menu selection. The record fields are modified directly.
- --| When a milestone number is modified in the milestone record, the
- --| milestone number must also be changed in every element to
- --| which it belonged by calling the procedure MODIFY_MILESTONE_KEY.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- -----------------------------------------------------------------------------
-
- use CALENDAR;
-
- abort_proc : boolean; -- abort getting existing ms
- exit_field_menu : boolean := false; -- exit milestone field menu
- field_selection : integer; -- selection from milestone field menu
- ms_record : milestone_pointer; -- pointer to milestone data record
- key : ms_num_type; -- num of milestone looking for
- found : boolean := false; -- if the record was found in the list
-
- procedure MODIFY_MILESTONE_KEY is separate;
-
- begin
- new_line;
- put_line("What is the number of the milestone you would like to modify?");
- PROMPT_PKG.EXISTING_MILSTONE_NUMBER( abort_proc, key );
-
- -- set pointer to that milstone, returned in ms_record
- FIND( ms_list, key, ms_record, found );
-
- if not abort_proc then
- while not exit_field_menu loop
- field_selection := VT100.PRINT_MS_MENU( ms_record );
- case field_selection is
- when 1 => -- get milestone number..change the key
- put(" The current milestone number is "); put( ms_record.number, 2);
- new_line;
- put_line(" What would you like to change it to? ");
- MODIFY_MILESTONE_KEY;
-
- when 2 => -- get milestone completion number
- put(" The current milestone completion sequence number is ");
- put( ms_record.completion_number, 2);
- new_line;
- put_line(" What would you like to change it to? ");
- ms_record.completion_number :=
- PROMPT_PKG.MILESTONE_COMPLETION_NUMBER
- (default => ms_record.number);
-
- when 3 => -- get the due date
- put(" The current due date is ");
- if ms_record.due_date = null_date then
- put("a null date. ");
- else
- put( ms_record.due_date.month,2 );
- put('/'); put( ms_record.due_date.day,2 ); put('/') ;
- put( ms_record.due_date.year,4 );
- end if;
- new_line;
- put_line(" What would you like to change it to? ");
- ms_record.due_date := PROMPT_PKG.DATE;
- when 4 => -- Getting new description
- put_line(" The current description is : ");
- put_line( ms_record.description(1..50) );
- new_line;
- put_line(" What would you like to change it to? ");
- ms_record.description := PROMPT_PKG.MS_DESCRIPTION;
- when 5 => exit_field_menu := true;
- when others => put_line(" Please enter a number beween 1 and 5.");
- end case;
- end loop;
-
- end if;
- end MS_MODIFY;
-
- separate( TRACKER.MILESTONE_PKG.MS_MODIFY )
- procedure MODIFY_MILESTONE_KEY is
- --|
- --| NAME: MODIFY_MILESTONE_KEY
- --|
- --| OVERVIEW:
- --| This procedure is called when the milestone number is modified.
- --| The user is prompted for a new unique key by calling the Prompt_Pkg
- --| function. The milestone number must be changed in the milestone
- --| record, the search key for the milestone list, and the field of the
- --| element record for each element in the milestone's element list.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- ---------------------------------------------------------------------------
- blank_key : ms_num_type; -- to blank out the key
- new_number : ms_num_type; -- replacement ms
-
- begin
- -- Change the key in the milestone list...
-
- -- get the new ms number
- new_number := PROMPT_PKG.NEW_MILSTONE_NUMBER;
-
- -- change milestone num in each element record of the ms_el_list
- CHANGE_MS_IN_EL( ms_record, new_number );
-
- -- change the search key in the milestone list
- CHANGE_LIST_KEY( ms_list, ms_record.number, new_number );
-
- -- change number in the milestone record
- ms_record.number := new_number;
-
- end MODIFY_MILESTONE_KEY;
-
-
- separate( TRACKER.MILESTONE_PKG )
- procedure MS_SAVE is
- -----------------------------------------------------------------------------
- --|
- --| NAME: MS_SAVE
- --|
- --| OVERVIEW:
- --| This procedure saves a record to file by calling the MS_WRITE
- --| procedure. The generic procedures START_WALK and WALK are called
- --| to walk the linked list allowing one record at a time to be written.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- -----------------------------------------------------------------------------
- end_list : boolean := false;
- ms_record : milestone_pointer;
-
- procedure MS_WRITE is separate;
-
- begin
- START_WALK( ms_list);
- -- walk the list one milestone at a time and write it to the file
- loop
- WALK( ms_list, ms_record, end_list);
- exit when end_list;
- MS_WRITE;
- end loop;
- end MS_SAVE;
-
- separate( TRACKER.MILESTONE_PKG.MS_SAVE )
- procedure MS_WRITE is
- --|
- --| NAME: MS_WRITE
- --|
- --| OVERVIEW:
- --| This procedure references the current record pointer. The record
- --| is written to one line of the output file in the following format:
- --||
- --|| +--+--+--+--+----+-------------------------+
- --|| |ms|cp|mm|dd|year| description |
- --|| +--+--+--+--+----+-------------------------+
- --||
- --| See DATA_PKG for the full names of the fields and their types.
- --| The milestone records are the third type of data to be written to the
- --| output file.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- begin
- put( output_file, ms_record.number, 2 ); -- integer
- put( output_file, ms_record.completion_number, 2 ); -- integer
- put( output_file, ms_record.due_date.month, 2 );
- put( output_file, ms_record.due_date.day, 2 );
- put( output_file, ms_record.due_date.year, 4 );
- put( output_file, ms_record.description ); -- string
- new_line( output_file );
- end MS_WRITE;
-
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --pr.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- with PROMPT_PKG;
-
- separate(tracker)
- package body PERSONNEL_PKG is
- --------------------------------------------------------------------------------
- --|
- --| NAME: PERSONNEL_PKG
- --|
- --| OVERVIEW:
- --| This package defines the actions that can be performed on a
- --| personnel type (defined in DATA_PKG).
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- --------------------------------------------------------------------------------
- -- instantiation of generic list handler done in DATA_PKG
- use EL_LIST_PKG;
- use PR_LIST_PKG;
- use CALENDAR;
-
-
- procedure CHANGE_PR_IN_EL( pr_record : in personnel_pointer;
- new_initials : in PR_INIT_TYPE ) is separate;
- procedure PR_ADD is separate;
- procedure PR_INITIALIZE is separate;
- procedure PR_SET_UP is separate;
- procedure PR_DELETE is separate;
- procedure PR_MODIFY is separate;
- procedure PR_SAVE is separate;
-
- end PERSONNEL_PKG;
-
- --******************************************************************************
-
- separate( TRACKER.PERSONNEL_PKG )
- procedure CHANGE_PR_IN_EL( pr_record : in personnel_pointer;
- new_initials : in PR_INIT_TYPE ) is
- -----------------------------------------------------------------------------
- --|
- --| NAME: CHANGE_PR_IN_EL
- --|
- --| OVERVIEW:
- --| This procedure is called when a person is deleted from or modified
- --| in the personnel list. Before either of these actions can be taken,
- --| the element list that contains people with the same name is walked.
- --| This list is a field of the personnel data record.
- --| The person's initials field of each element record is reassigned
- --| the new person.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| Written by May Lee March 1985
- --|
- -----------------------------------------------------------------------------
-
- el_record : element_pointer; -- pr element list
- end_list : boolean;
-
- begin
- -- change the pr number field in el_record of the person's el list
- START_WALK( pr_record.element_list );
- loop
- WALK( pr_record.element_list, el_record, end_list );
- exit when end_list;
- if el_record.more_than_one_person then
- for ac_index in 1..num_of_activities loop
- if el_record.people_initials(ac_index) = pr_record.initials then
- el_record.people_initials(ac_index) := new_initials;
- end if;
- end loop;
- else
- el_record.person_initials := new_initials;
- end if;
- end loop;
- end CHANGE_PR_IN_EL;
-
-
- separate( TRACKER.PERSONNEL_PKG )
- procedure PR_ADD is
- ------------------------------------------------------------------------------
- --|
- --| NAME: PR_ADD
- --|
- --| OVERVIEW:
- --| This procedure sets up the record to be added to the list by
- --| user prompt/response. The function calls to Prompt_Pkg return
- --| only valid existing data. The complete record is
- --| then added to the linked list by calling the generic list procedure
- --| ADD.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- --| NOTES:
- --| The number of people is incremented in this procedure.
- --|
- ------------------------------------------------------------------------------
- a_char : character := ' ';
- pr_record : personnel_pointer;
-
- begin
- -- create a null personnel record
- pr_record := new personnel_type;
-
- new_line;
- put_line(" If you would like more information on the type of data ");
- put_line(" to enter for any of the following questions, enter a '?'");
- put_line(" Otherwise, enter the data requested. ");
- new_line(2);
-
- -- get the record fields
- pr_record.name := PROMPT_PKG.PERSONS_NAME;
- pr_record.initials := PROMPT_PKG.NEW_PERSON_INITIALS;
- pr_record.production_rate := PROMPT_PKG.PR_PRODUCTION_RATE;
- pr_record.hours_per_week := PROMPT_PKG.PR_HRS_PER_WEEK;
- put_line(" What is this person's start date? ");
- pr_record.start_dates(1) := PROMPT_PKG.DATE;
-
- -- Get stop date
- loop -- until valid stop date
- new_line;
- put_line(" What is this person's stop date? ");
- pr_record.stop_dates(1) := PROMPT_PKG.DATE;
-
- -- check if valid stop date
- if pr_record.stop_dates(1) = null_date then
- for i in dates_list'first+1..dates_list'last loop
- pr_record.start_dates(i) := null_date;
- pr_record.stop_dates(i) := null_date;
- end loop;
- exit;
- elsif (pr_record.stop_dates(1) /= null_date) and
- (pr_record.start_dates(1) /= null_date) and
- (pr_record.stop_dates(1) < pr_record.start_dates(1) ) then
- put_line(" That is not a valid stop date. The stop date must be ");
- put_line(" a later date than the start date. TRY AGAIN! ");
- put(" The start date is ");
- put( pr_record.start_dates(1).month,2 );
- put('/'); put( pr_record.start_dates(1).day,2 ); put('/') ;
- put( pr_record.start_dates(1).year, 4 );
- new_line;
- else
- exit;
- end if;
- end loop;
-
- -- if not null, ask if user wants to add more start/stop dates
- if pr_record.stop_dates(1) /= null_date then
- START_STOP_DATES_LOOP:
- for i in dates_list'first + 1..dates_list'last loop
- new_line;
- put_line(" Would you like to add another set of start/stop dates? ");
- put(" [y or n, <cr>=n] : ");
- if end_of_line then
- skip_line;
- exit START_STOP_DATES_LOOP;
- else
- get( a_char ); skip_line;
- if a_char = 'y' or a_char = 'Y' then
- START_DATE_LOOP:
- loop -- until valid start date
- new_line;
- put_line(" What is this person's start date? ");
- pr_record.start_dates(i) := PROMPT_PKG.DATE;
- -- check if valid start date
- if pr_record.start_dates(i) = null_date then
- for j in i..dates_list'last loop
- pr_record.start_dates(j) := null_date;
- pr_record.stop_dates(j) := null_date;
- end loop;
- exit START_STOP_DATES_LOOP;
- elsif pr_record.start_dates(i) < pr_record.stop_dates(i-1) then
- put_line(" That is not a valid start date. The start date must be ");
- put_line(" a later date than the previous stop date. TRY AGAIN! ");
- put(" The previous stop date is ");
- put( pr_record.stop_dates(i-1).month,2 );
- put('/'); put( pr_record.stop_dates(i-1).day,2 ); put('/') ;
- put( pr_record.stop_dates(i-1).year, 4 );
- new_line;
- else -- valid start date
- exit START_DATE_LOOP;
- end if;
- end loop START_DATE_LOOP;
-
- -- get stop date
- STOP_DATE_LOOP:
- loop -- until valid stop date
- new_line;
- put_line(" What is this person's stop date? ");
- pr_record.stop_dates(i) := PROMPT_PKG.DATE;
- -- check if valid stop date
- if pr_record.stop_dates(i) = null_date then
- for j in i+1..dates_list'last loop
- pr_record.start_dates(j) := null_date;
- pr_record.stop_dates(j) := null_date;
- end loop;
- exit START_STOP_DATES_LOOP;
- elsif pr_record.stop_dates(i) < pr_record.start_dates(i) then
- put_line(" That is not a valid stop date. The stop date must be ");
- put_line(" a later date than the start date. TRY AGAIN! ");
- put(" The start date is ");
- put( pr_record.start_dates(i).month,2 );
- put('/'); put( pr_record.start_dates(i).day,2 ); put('/') ;
- put( pr_record.start_dates(i).year, 4 );
- new_line;
- else -- non-null and valid stop date
- exit STOP_DATE_LOOP;
- end if;
- end loop STOP_DATE_LOOP;
-
- else -- don't want to add another start/stop date
- exit START_STOP_DATES_LOOP;
- end if;
- end if; -- pressed <cr>
- end loop START_STOP_DATES_LOOP;
- end if; -- not null date
-
-
- -- add the record to the linked list by calling the generic add
- ADD ( pr_list, pr_record.initials, pr_record);
-
- -- increment people counter
- new_line;
- num_of_people := num_of_people + 1;
-
- new_line;
- put(" The number of people = "); put( num_of_people,2 ); new_line(2);
- delay 1.0;
- end PR_ADD;
-
-
- separate( TRACKER.PERSONNEL_PKG )
- procedure PR_INITIALIZE is
- ------------------------------------------------------------------------------
- --|
- --| NAME: PR_INITIALIZE
- --|
- --| OVERVIEW:
- --| This procedure is called only when a new TRACKER file has to
- --| be created. It is part of a forced user response to fill in
- --| the necessary data to make TRACKER a complete report. The
- --| procedure PR_ADD is called to gather the information and put it
- --| into a linked list.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- --| NOTES:
- --| The user is forced to add at least one person record and then
- --| is prompted to add another or not.
- --|
- ------------------------------------------------------------------------------
- add_another : character := 'N';
- done : boolean := false;
-
- begin
- while not done loop
- -- force the user to add at least one person
- PR_ADD; -- data to the recrd and the record to the list
- loop -- until y or n
- put_line("Would you like to add another person? ");
- put(" [ Y or N, <cr>=N ] : ");
- if end_of_line then -- pressed return, default to no
- skip_line;
- done := true;
- exit;
- else
- get(add_another); skip_line;
- if add_another = 'N' or add_another = 'n' then
- done := true;
- exit;
- elsif add_another = 'Y' or add_another = 'y' then
- exit;
- else
- put_line(" Please enter y or n. ");
- end if;
- end if;
- end loop;
- new_line;
- end loop;
- end PR_INITIALIZE;
-
-
- separate( TRACKER.PERSONNEL_PKG )
- procedure PR_SET_UP is
- ------------------------------------------------------------------------------
- --|
- --| NAME: PR_SET_UP
- --|
- --| OVERVIEW:
- --| This procedure is only called if there is an existing input file.
- --| The people list is set up by reading the personnel record
- --| from the input file by calling PR_READ, and adding it to the linked
- --| list by calling the generic procedure ADD until there are no more
- --| people records.
- --|
- --| EXCEPTIONS HANDLED:
- --| others Error reading the record from the file.
- --| . This exception raises ERROR_IN_INPUT_FILE.
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- --| NOTES:
- --| The number of people records read in is determined by the
- --| global variable num_of_people.
- --|
- --| If an error is detected reading the data, the rest of the input line
- --| is skipped and reading of the rest of the data continues. All errors
- --| found are reported. Execution is not terminated until the entire
- --| input file has been read.
- --|
- --|
- -----------------------------------------------------------------------------
- pr_num : integer := 1; -- number of person record in file
- pr_record : personnel_pointer;
- bad_data : boolean := false;
-
- procedure PR_READ is separate;
-
- begin
- for i in 1..num_of_people loop
- begin
- pr_num := i;
-
- -- create a null person record
- pr_record := new personnel_type;
-
- -- read the person
- PR_READ;
-
- -- add it to the linked list
- ADD( pr_list, pr_record.initials, pr_record);
- exception
- when others =>
- skip_line( tracker_file);
- put(" Error in reading person "); put(pr_num);
- put(" from the tracker file. "); new_line;
- bad_data := true;
- end;
- end loop;
- if bad_data then
- raise ERROR_IN_INPUT_FILE;
- end if;
- end PR_SET_UP;
-
- separate( TRACKER.PERSONNEL_PKG.PR_SET_UP )
- procedure PR_READ is
- ----------------------------------------------------------------------------
- --|
- --| NAME: PR_READ
- --|
- --| OVERVIEW:
- --| This procedure reads a record from the file. One line of data is
- --| read at a time and broken down into the fields of the
- --| personnel record, which is made visible to the calling routine
- --| PR_SET_UP. The data is read in the format specified by the PR_WRITE
- --| procedure.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- --| NOTES:
- --| Any exceptions raised here are handled by PR_SET_UP.
- ----------------------------------------------------------------------------
- begin
- get( tracker_file, pr_record.name ); -- string
- get( tracker_file, pr_record.initials );
- get( tracker_file, pr_record.production_rate, 7 ); -- real
- get( tracker_file, pr_record.hours_per_week, width => 2 ); -- integer
- for i in dates_list'first..dates_list'last loop
- -- get the sets of start/stop dates
- get( tracker_file, pr_record.start_dates(i).month,width => 2 );
- get( tracker_file, pr_record.start_dates(i).day, width => 2 );
- get( tracker_file, pr_record.start_dates(i).year, width => 4 );
- get( tracker_file, pr_record.stop_dates(i).month, width => 2 );
- get( tracker_file, pr_record.stop_dates(i).day, width => 2 );
- get( tracker_file, pr_record.stop_dates(i).year, width => 4 );
- end loop;
- skip_line( tracker_file);
- end PR_READ;
-
-
- separate( TRACKER.PERSONNEL_PKG )
- procedure PR_DELETE is
- ------------------------------------------------------------------------------
- --|
- --| NAME: PR_DELETE
- --|
- --| OVERVIEW:
- --| This procedure is used to delete a record from the list by calling
- --| the List_Pkg procedure delete. When a person is deleted from the
- --| personnel list, his initials also have to be changed in every
- --| element to which he belonged in the element list by calling the
- --| procedure CHANGE_PR_IN_EL.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- --| NOTES:
- --| The number of people is decremented after the record is deleted.
- --|
- --| A check is made to insure that the last person is not deleted. There
- --| must be at least one person at all times.
- --|
- -----------------------------------------------------------------------------
-
- abort_proc : boolean; -- abort getting an existing pr
- end_list : boolean := false;
- el_record : element_pointer;
- ele_ptr : element_pointer;
- found : boolean; -- parameter to find
- key : pr_init_type; -- initials of the person looking for
- new_initials : pr_init_type; -- replacement pr
- pr_record : personnel_pointer; -- person record
- new_pr_record: personnel_pointer; -- new person's record
- successful : boolean := false; -- if key found in list
-
- begin
- if num_of_people > 1 then -- have to have at least one person
- put_line("Which person would you like to delete? ");
-
- -- get the person's initials
- PROMPT_PKG.EXISTING_PERSON_INITIALS( abort_proc, key );
-
- if not abort_proc then
- --point to that record in the list
- FIND( pr_list, key, pr_record, found );
-
- -- delete the person from the list
- DELETE( pr_list, key, successful);
-
- -- check to see if person belonged to an element
- START_WALK( pr_record.element_list );
- WALK( pr_record.element_list, ele_ptr, end_list );
- if not end_list then
- -- change person's initials in element data
- put(" When person "); put(pr_record.initials); put(" is deleted, "); new_line;
- put_line(" who would you like to use in his place in the element data? ");
- -- prompt for new number
- loop
- PROMPT_PKG.EXISTING_PERSON_INITIALS( abort_proc, new_initials );
- exit when not abort_proc;
- put_line(" You cannot abort the procedure at this time. ");
- put_line(" You must enter valid initials. ");
- end loop;
- FIND( pr_list, new_initials, new_pr_record, found );
-
- -- change the person's initials in the element data
- CHANGE_PR_IN_EL( pr_record, new_initials );
-
- -- move these elements to the new person's element list
- start_walk (pr_record.element_list);
- loop
- walk(pr_record.element_list, ele_ptr, end_list);
- exit when end_list;
- -- add the element to the person's list only if it isn't already
- -- in the person's element list. This could happen if the element
- -- was assigned to several people.
- find(new_pr_record.element_list, ele_ptr.desc_key, el_record, found);
- if not found then
- add (new_pr_record.element_list, ele_ptr.desc_key, ele_ptr);
- end if;
- end loop;
- end if;
-
- -- decrement the person counter
- num_of_people := num_of_people - 1;
-
- new_line;
- put(" The number of people = "); put(num_of_people,1); new_line(2);
- delay 1.0;
- end if; -- not abort
-
- else
- put_line(" You must have at least one person at all times. ");
- put_line(" Since you only have one person at this time, you ");
- put_line(" cannot delete. ");
- delay 2.0;
- end if;
- end PR_DELETE;
-
-
- separate( TRACKER.PERSONNEL_PKG )
- procedure PR_MODIFY is
- ------------------------------------------------------------------------------
- --|
- --| NAME: PR_MODIFY
- --|
- --| OVERVIEW:
- --| This procedure allows the user to modify an existing person record.
- --| The user is prompted for an existing person record by calling
- --| the appropriate Prompt_Pkg function. The generic FIND is used to
- --| get the record. The user is then allowed to change the fields by
- --| choosing a menu selection. The record fields are modified directly.
- --| When a person's initials are modified in a personnel record,
- --| his initials also have to be changed in every element to which
- --| he belonged in the element list by calling the procedure
- --| MODIFY_PERSONNEL_KEY.
- --|
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- -----------------------------------------------------------------------------
-
- use CALENDAR;
-
- abort_proc : boolean; -- abort getting existing pr
- exit_field_menu : boolean := false; -- exit personnel field menu
- field_selection : integer; -- selection from personnel field menu
- pr_record : personnel_pointer; -- pointer to person data record
- key : pr_init_type; -- initials of person looking for
- found : boolean := false; -- if the record was found in the list
-
- procedure MODIFY_PERSONNEL_KEY is separate;
- procedure MODIFY_START_STOP_DATE ( PAIR : in integer ) is separate;
-
- begin
- new_line;
- put_line("Which person would you like to modify?");
- PROMPT_PKG.EXISTING_PERSON_INITIALS( abort_proc, key );
-
- -- set pointer to that person, returned in pr_record
- FIND( pr_list, key, pr_record, found);
-
- if not abort_proc then
- while not exit_field_menu loop
- field_selection := VT100.PRINT_PR_MENU( pr_record );
- case field_selection is
- when 1 => -- get person's name
- put(" The current person's name is "); put( pr_record.name );
- new_line;
- put_line(" What would you like to change it to? ");
- pr_record.name := PROMPT_PKG.PERSONS_NAME;
-
- when 2 => -- Getting new person's initials , change key
- put(" The current person's initials are ");
- put( pr_record.initials );
- new_line;
- put_line(" What would you like to change it to? ");
- MODIFY_PERSONNEL_KEY;
-
- when 3 => -- Get new production rate
- put(" The current production rate is ");
- put( pr_record.production_rate, 4 ); new_line;
- put_line(" What would you like to change it to? ");
- pr_record.production_rate := PROMPT_PKG.PR_PRODUCTION_RATE;
-
- when 4 => -- Get new hours per week
- put(" The hours per week is ");
- put( pr_record.hours_per_week, 2 ); new_line;
- put_line(" What would you like to change it to? ");
- pr_record.hours_per_week := PROMPT_PKG.PR_HRS_PER_WEEK;
-
- when 5 => -- Get new first set of start/stop dates
- MODIFY_START_STOP_DATE(1);
-
- when 6 => -- Get new second set of start/stop dates
- MODIFY_START_STOP_DATE(2);
-
- when 7 => -- Get new third set of start/stop dates
- MODIFY_START_STOP_DATE(3);
-
- when 8 => exit_field_menu := true;
-
- when others => put_line("Please enter a number beween 1 and 8.");
- end case;
-
- end loop;
- end if;
- end PR_MODIFY;
-
- separate( TRACKER.PERSONNEL_PKG.PR_MODIFY )
- procedure MODIFY_PERSONNEL_KEY is
- ----------------------------------------------------------------------------
- --|
- --| NAME: MODIFY_PERSONNEL_KEY
- --|
- --| OVERVIEW:
- --| This procedure is called when the person's initials are modified.
- --| The user is prompted for a new unique key by calling the Prompt_Pkg
- --| function. The person's initials must be changed in the person's
- --| record, the search key for the personnel list, and the field of the
- --| element record for each element in the person's element list.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| Written by May Lee March 1985
- --|
- ----------------------------------------------------------------------------
- blank_key : pr_init_type; -- to blank out the key
- new_initials : pr_init_type; -- replacement pr
-
- begin
- -- Change the key in the personnel list...
-
- -- get the new person's initials
- new_initials := PROMPT_PKG.NEW_PERSON_INITIALS;
-
- -- change person's initials in each element record of the pr_el_list
- CHANGE_PR_IN_EL( pr_record, new_initials );
-
- -- change the search key in the personnel list
- CHANGE_LIST_KEY( pr_list, pr_record.initials, new_initials );
-
- -- change initials in the person's record
- pr_record.initials := new_initials;
-
- end MODIFY_PERSONNEL_KEY;
-
-
-
-
-
- separate( TRACKER.PERSONNEL_PKG.PR_MODIFY )
- procedure MODIFY_START_STOP_DATE ( PAIR : in integer ) is
- ----------------------------------------------------------------------------
- --|
- --| NAME: MODIFY_START_STOP_DATE
- --|
- --| OVERVIEW:
- --| This procedure is called when a pair of start/stop dates is to be
- --| modified for a person. The user is prompted for a new set of dates
- --| by calling the Prompt_Pkg.date function. The date is then compared
- --| to others start/stop dates to see if it is valid. If not, the user
- --| is reprompted. If any start/stop date is assigned a null value, the
- --| other future start/stop dates will be modified to also be a null date
- --| as needed.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| Written by May Lee March 1985
- --| Written by Bonnie Burkhardt March 1985
- --|
- ----------------------------------------------------------------------------
-
- valid_start_date : boolean := false;
-
- begin
- START_DATES_LOOP:
- loop
- -- get new start date
- put(" The current start date for this set of dates is ");
- if pr_record.start_dates(PAIR) = null_date then
- put("a null date. ");
- else
- put( pr_record.start_dates(PAIR).month,2 );
- put('/'); put( pr_record.start_dates(PAIR).day,2 ); put('/') ;
- put( pr_record.start_dates(PAIR).year, 4 );
- end if;
- new_line;
-
- -- check if valid start date
- if (PAIR > dates_list'first) and then
- (pr_record.stop_dates (pair - 1) = null_date) then
- put_line(" You cannot assign a non null date to the this start ");
- put_line(" date until you change the previous null stop date. ");
- valid_start_date := false;
- delay 1.0;
- exit START_DATES_LOOP;
- end if;
-
- new_line;
- put_line(" What would you like to change it to? ");
- pr_record.start_dates(pair) := PROMPT_PKG.DATE;
-
- if PAIR = dates_list'first then
- valid_start_date := true;
- exit START_DATES_LOOP;
- elsif pr_record.start_dates(pair) = null_date then
- for j in pair..dates_list'last loop
- pr_record.start_dates(j) := null_date;
- pr_record.stop_dates(j) := null_date;
- end loop;
- valid_start_date := false;
- exit START_DATES_LOOP;
- elsif pr_record.start_dates(pair) < pr_record.stop_dates (pair - 1) then
- valid_start_date := false;
- new_line;
- put_line(" That is not a valid start date. The start date must be ");
- put_line(" a later date than the previous stop date. TRY AGAIN! ");
- put(" The previous stop date is ");
- put( pr_record.stop_dates(pair - 1).month,2 );
- put('/'); put( pr_record.stop_dates(pair - 1).day,2 ); put('/') ;
- put( pr_record.stop_dates(pair - 1).year, 4 );
- new_line;
- else
- valid_start_date := true;
- exit START_DATES_LOOP;
- end if;
- end loop START_DATES_LOOP;
-
- if valid_start_date then
- STOP_DATES_LOOP:
- loop
- -- Get new stop date
- put(" The current stop date for the second set of dates is ");
- if pr_record.stop_dates(pair) = null_date then
- put("a null date. ");
- else
- put( pr_record.stop_dates(pair).month,2 );
- put('/'); put( pr_record.stop_dates(pair).day,2 ); put('/') ;
- put( pr_record.stop_dates(pair).year, 4 );
- end if;
- new_line;
-
- -- check if valid stop date
- if (PAIR > dates_list'first) and then
- (pr_record.start_dates(pair) = null_date) then
- put_line(" You cannot assign a non null date to this stop ");
- put_line(" date until you change the previous null dates. ");
- delay 1.0;
- exit STOP_DATES_LOOP;
- end if;
-
- new_line;
- put_line(" What would you like to change it to? ");
- pr_record.stop_dates(pair) := PROMPT_PKG.DATE;
-
- if pr_record.stop_dates(pair) = null_date then
- for j in pair+1..dates_list'last loop
- pr_record.start_dates(j) := null_date;
- pr_record.stop_dates(j) := null_date;
- end loop;
- exit STOP_DATES_LOOP;
- elsif pr_record.start_dates(pair) = null_date then
- exit STOP_DATES_LOOP;
- elsif pr_record.stop_dates(pair) < pr_record.start_dates(pair) then
- put_line(" That is not a valid stop date. The stop date must be ");
- put_line(" a later date than the start date. TRY AGAIN! ");
- put(" The start date is ");
- put( pr_record.start_dates(pair).month,2 );
- put('/'); put( pr_record.start_dates(pair).day,2 ); put('/') ;
- put( pr_record.start_dates(pair).year, 4 );
- new_line;
- elsif (pair < dates_list'last) and then
- ((pr_record.start_dates(pair+1) /= null_date) and
- (pr_record.stop_dates(pair) > pr_record.start_dates(pair+1)) ) then
- put_line(" That is not a valid stop date. The stop date must be ");
- put_line(" an earlier date than the next start date. TRY AGAIN! ");
- put(" The next start date is ");
- put( pr_record.start_dates(pair+1).month,2 );
- put('/'); put( pr_record.start_dates(pair+1).day,2 ); put('/') ;
- put( pr_record.start_dates(pair+1).year, 4 );
- new_line;
- else
- exit STOP_DATES_LOOP;
- end if;
- end loop STOP_DATES_LOOP;
- end if;
- end MODIFY_START_STOP_DATE;
-
-
-
- separate( TRACKER.PERSONNEL_PKG )
- procedure PR_SAVE is
- ------------------------------------------------------------------------------
- --|
- --| NAME: PR_SAVE
- --|
- --| OVERVIEW:
- --| This procedure saves a record to file by calling the PR_WRITE
- --| procedure. The generic procedures START_WALK and WALK are called
- --| to walk the linked list allowing one record at a time to be written.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| Written by May Lee March 1985
- --|
- ------------------------------------------------------------------------------
- end_list : boolean := false;
- pr_record : personnel_pointer;
-
- procedure PR_WRITE is separate;
-
- begin
- START_WALK( pr_list);
- -- walk the list one person at a time and write it to the file
- loop
- WALK( pr_list, pr_record, end_list);
- exit when end_list;
- PR_WRITE;
- end loop;
- end PR_SAVE;
-
-
- separate( TRACKER.PERSONNEL_PKG.PR_SAVE )
- procedure PR_WRITE is
- --|
- --| NAME: PR_WRITE
- --|
- --| OVERVIEW:
- --| This procedure references the current record pointer. The record
- --| is written to one line of the output file in the following format:
- --||
- --|| +--------------------+--+-----+--+-----+----+-----+----+-----+----+
- --|| | name |in| rate|hr|start|stop|start|stop|start|stop|
- --|| +--------------------+--+-----+--+-----+----+-----+----+-----+----+
- --||
- --| See DATA_PKG for the full names of the fields and their types.
- --| The personnel records are the fourth type of data to be written to
- --| the output file.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| Written by May Lee March 1985
- --|
- begin
- put( output_file, pr_record.name ); -- string
- put( output_file, pr_record.initials );
- put( output_file, pr_record.production_rate, 3, 3, 0 ); -- real
- put( output_file, pr_record.hours_per_week, width => 2 ); -- integer
- for i in dates_list'first..dates_list'last loop
- -- write the sets of start/stop dates
- put( output_file, pr_record.start_dates(i).month,width => 2 );
- put( output_file, pr_record.start_dates(i).day, width => 2 );
- put( output_file, pr_record.start_dates(i).year, width => 4 );
- put( output_file, pr_record.stop_dates(i).month, width => 2 );
- put( output_file, pr_record.stop_dates(i).day, width => 2 );
- put( output_file, pr_record.stop_dates(i).year, width => 4 );
- end loop;
- new_line( output_file );
- end PR_WRITE;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --ss.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- with PROMPT_PKG;
-
- separate(tracker)
- package body SUBSYSTEM_PKG is
- --------------------------------------------------------------------------------
- --|
- --| NAME: SUBSYSTEM_PKG
- --|
- --| OVERVIEW:
- --| This package defines the actions that can be performed on a
- --| subsystem (defined in DATA_PKG).
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| Written by May Lee March 1985
- --|
- --------------------------------------------------------------------------------
-
- use EL_LIST_PKG;
- use SS_LIST_PKG;
-
- procedure CHANGE_SS_IN_EL( ss_record : in subsystem_pointer;
- new_name : in ss_name_type ) is separate;
- procedure SS_ADD is separate;
- procedure SS_INITIALIZE is separate;
- procedure SS_SET_UP is separate;
- procedure SS_DELETE is separate;
- procedure SS_MODIFY is separate;
- procedure SS_SAVE is separate;
-
- end SUBSYSTEM_PKG;
-
- --*****************************************************************************
-
- separate(TRACKER.SUBSYSTEM_PKG)
- procedure SS_ADD is
- ------------------------------------------------------------------------------
- --|
- --| NAME: SS_ADD
- --|
- --| OVERVIEW:
- --| This procedure sets up the record to be added to the list by
- --| user prompt/response. The function calls to Prompt_Pkg return
- --| only valid existing data. The complete record is
- --| then added to the linked list by calling the generic list procedure
- --| ADD.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- --| NOTES:
- --| The number of subsystems is incremented in this procedure.
- --|
- ------------------------------------------------------------------------------
- ss_record : subsystem_pointer;
-
- begin
- -- create a null subsystem record
- ss_record := new subsystem_type;
-
- new_line;
- put_line(" If you would like more information on the type of data ");
- put_line(" to enter for any of the following questions, enter a '?' ");
- put_line(" Otherwise, enter the data requested. ");
- new_line(2);
-
- -- get the record fields
- ss_record.name := PROMPT_PKG.NEW_SUBSYS_NAME;
- new_line;
-
- put_line(" What percentage of the total subsystem is available at start? ");
- ss_record.percent_at_start := PROMPT_PKG.PERCENT;
-
- ss_record.task_numbers := PROMPT_PKG.TASK_NUMBERS( ss_record );
-
- -- add the record to the linked list
- ADD ( ss_list, ss_record.name, ss_record);
-
- -- increment subsystem counter
- num_of_subsystems := num_of_subsystems + 1;
-
- new_line;
- put(" The number of subsystems = "); put( num_of_subsystems,1);
- new_line(2);
- delay 1.0;
- end SS_ADD;
-
-
- separate(TRACKER.SUBSYSTEM_PKG)
- procedure SS_INITIALIZE is
- ------------------------------------------------------------------------------
- --|
- --| NAME: SS_INITIALIZE
- --|
- --| OVERVIEW:
- --| This procedure is called only when a new TRACKER file has to
- --| be created. It is part of a forced user response to fill in
- --| the necessary data to make TRACKER a complete report. The
- --| procedure SS_ADD is called to gather the information and put it
- --| into a linked list.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- --| NOTES:
- --| The user is forced to add at least one subsystem record and then
- --| is prompted to add another or not.
- --|
- ------------------------------------------------------------------------------
- add_another : character := 'N';
- done : boolean := false;
-
- begin
- while not done loop
- -- force the user to add at least one subsystem
- SS_ADD; -- data to the record and the record to the list
- loop
- put_line("Would you like to add another subsystem? ");
- put(" [ Y or N, <cr>=N ] : ");
- if end_of_line then -- pressed return, default to no
- skip_line;
- new_line(2);
- done := true;
- exit;
- else
- get(add_another); skip_line;
- new_line(2);
- if add_another = 'N' or add_another = 'n' then
- done := true;
- exit;
- elsif add_another = 'Y' or add_another = 'y' then
- exit;
- else
- put_line(" Please enter y or n. ");
- end if;
- end if;
- end loop;
- end loop;
- end SS_INITIALIZE;
-
-
- separate(TRACKER.SUBSYSTEM_PKG)
- procedure SS_SET_UP is
- ------------------------------------------------------------------------------
- --|
- --| NAME: SS_SET_UP
- --|
- --| OVERVIEW:
- --| This procedure is only called if there is an existing input file.
- --| The subsystem list is set up by reading the subsystem record
- --| from the input file by calling SS_READ, and adding it to the linked
- --| list by calling the generic procedure ADD until there are no more
- --| subsystem records.
- --|
- --| EXCEPTIONS HANDLED:
- --| others Error reading the record from the file.
- --| . This exception raises ERROR_IN_INPUT_FILE.
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- --| NOTES:
- --| The number of subsystem records read in is determined by the
- --| global variable num_of_subsystems.
- --|
- --| If an error is detected reading the data, the rest of the input line
- --| is skipped and reading of the rest of the data continues. All errors
- --| found are reported. Execution is not terminated until the entire
- --| input file has been read.
- --|
- ------------------------------------------------------------------------------
- ss_record : subsystem_pointer;
- ss_num : integer := 1;
- bad_data : boolean := false;
-
- procedure SS_READ is separate;
-
- begin
- -- create a new subsystem, read it in, and add it to the list
- for i in 1.. num_of_subsystems loop
- begin
- -- counter for exception
- ss_num := i;
- -- create null record
- ss_record := new subsystem_type;
- -- get a record of data
- SS_READ;
- -- add to list
- ADD ( ss_list, ss_record.name, ss_record);
- exception
- when others =>
- skip_line( tracker_file );
- put(" Error reading subsystem"); put(ss_num,1);
- put(" from the tracker file. "); new_line;
- bad_data := true;
- end;
- end loop;
- if bad_data then
- raise ERROR_IN_INPUT_FILE;
- end if;
- end SS_SET_UP;
-
-
- separate(TRACKER.SUBSYSTEM_PKG.SS_SET_UP)
- procedure SS_READ is
- ---------------------------------------------------------------------------
- --|
- --| NAME: SS_READ
- --|
- --| OVERVIEW:
- --| This procedure reads a record from the file. One line of data is
- --| read at a time and broken down into the fields of the
- --| subsystem record, which is made visible to the calling routine
- --| SS_SET_UP. The data is read in the format specified by the SS_WRITE
- --| procedure.
- --|
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- --| NOTES:
- --| Any exceptions raised here are handled by SS_SET_UP.
- --|
- ---------------------------------------------------------------------------
- begin
- get( tracker_file, ss_record.name(1..10) ); -- string
- get( tracker_file, ss_record.percent_at_start, 5 ); -- real
- for ac_index in 1..num_of_activities loop
- get( tracker_file, ss_record.task_numbers(ac_index), 4 );
- end loop;
- skip_line( tracker_file );
- end SS_READ;
-
-
- separate(TRACKER.SUBSYSTEM_PKG)
- procedure SS_DELETE is
- ------------------------------------------------------------------------------
- --|
- --| NAME: SS_DELETE
- --|
- --| OVERVIEW:
- --| OVERVIEW:
- --| This procedure is used to delete a subsystem from the list by calling
- --| the List_Pkg procedure DELETE. When a subsystem is deleted from the
- --| subsystem list, the subsystem number must also be changed in every
- --| element to which it belonged by calling the procedure
- --| CHANGE_SS_IN_EL.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- --| NOTES:
- --| The number of subsystems is decremented after the record is deleted.
- --|
- --| A check is made to insure that the last subsystem is not deleted.
- --| There must be at least one subsystem at all times.
- --|
- --|
- ------------------------------------------------------------------------------
-
- abort_proc : boolean; -- abort getting an existing ss
- deleted_ss : boolean;
- end_list : boolean;
- ele_ptr : element_pointer;
- new_name : ss_name_type := (others => ' ');
- ss_record : subsystem_pointer;
- new_ss_record : subsystem_pointer;
- successful : boolean := false; -- if record was found in the list
- key : ss_name_type; -- name of subsystem looking for
-
- begin
- if num_of_subsystems > 1 then -- have to have at least one subsystem
- put_line("Which subsystem would you like to delete? ");
-
- -- get the subsystem name
- PROMPT_PKG.EXISTING_SUBSYS_NAME( abort_proc, key );
-
- if not abort_proc then
- --point to that record in the list
- FIND( ss_list, key, ss_record, successful);
-
- -- delete the subsystem from the list
- DELETE( ss_list, key, successful);
-
- start_walk (ss_record.element_list);
- walk (ss_record.element_list, ele_ptr, end_list);
- if not end_list then
- -- change subsystem name in element data
- put(" When subsystem "); put(ss_record.name); put(" is deleted, "); new_line;
- put_line(" what subsystem would you like to use in its place in the element data? ");
- -- prompt for subsystem name
- loop
- PROMPT_PKG.EXISTING_SUBSYS_NAME( abort_proc, new_name );
- exit when not abort_proc;
- put_line(" You cannot abort the procedure at this time. ");
- put_line(" You must enter a valid subsystem name!");
- new_line;
- end loop;
- find (ss_list, new_name, new_ss_record, successful);
-
- -- change the subsystem name in the element data
- CHANGE_SS_IN_EL( ss_record, new_name );
-
- -- append this subsystem's elements to the new subsystem's element list
- start_walk (SS_RECORD.element_list);
- loop
- walk(SS_RECORD.element_list, ELE_PTR, END_LIST);
- exit when END_LIST;
- ADD ( new_ss_record.element_list, ELE_PTR.desc_key, ELE_PTR);
- end loop;
- end if;
-
- -- decrement the subsystem counter
- num_of_subsystems := num_of_subsystems - 1;
-
- new_line;
- put(" The number of subsystems = "); put(num_of_subsystems,1);
- new_line(2);
- delay 1.0;
- end if; -- not abort
-
- else
- put_line(" You must have at least one subsystem at all times. ");
- put_line(" Since you only have one subsystem at this time, you ");
- put_line(" cannot delete it. ");
- delay 1.5;
- end if;
- end SS_DELETE;
-
-
- separate(TRACKER.SUBSYSTEM_PKG)
- procedure CHANGE_SS_IN_EL( ss_record : in subsystem_pointer;
- new_name : in ss_name_type ) is
- -----------------------------------------------------------------------------
- --|
- --| NAME: CHANGE_SS_IN_EL
- --|
- --| OVERVIEW:
- --| This procedure is called when a subsystem is deleted from or modified
- --| in the subsystem list. Before either of these actions can be taken,
- --| the element list that contains subsystems with the same name is walked.
- --| This list is a field of the subsystem data record.
- --| The subsystem name field of each element record is reassigned
- --| the new subsystem.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| Written by May Lee March 1985
- --|
- -----------------------------------------------------------------------------
-
- el_record : element_pointer; -- ms element list
- end_list : boolean;
-
- begin
- -- change the ss name field in el_record of the subsystem's el list
- START_WALK( ss_record.element_list );
- loop
- WALK( ss_record.element_list, el_record, end_list );
- exit when end_list;
- el_record.subsystem_name := new_name;
- end loop;
- end CHANGE_SS_IN_EL;
-
-
- separate(TRACKER.SUBSYSTEM_PKG)
- procedure SS_MODIFY is
- ------------------------------------------------------------------------------
- --|
- --| NAME: SS_MODIFY
- --|
- --| OVERVIEW:
- --| This procedure allows the user to modify an existing record.
- --| The user is prompted for an existing subsystem record by calling
- --| the appropriate Prompt_Pkg function. The generic FIND is used to
- --| get the record. The user is then allowed to change the fields by
- --| choosing a menu selection. The record fields are modified directly.
- --| When a subsystem name is modified in the subsystem record, the
- --| subsystem name must also be changed in every element to
- --| which it belonged by calling the procedure CHANGE_SS_IN_EL.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| Written by May Lee March 1985
- --|
- ------------------------------------------------------------------------------
- abort_proc : boolean; -- abort getting existing ss
- exit_field_menu : boolean := false; -- exit subsystem field menu
- field_selection : integer; -- selection from subsystem field menu
- key : ss_name_type; -- name of subsystem looking for
- new_name : ss_name_type; -- new subsystem name
- ss_record : subsystem_pointer; -- pointer to subsystem record
- length : natural; -- length of subsystem name
- found : boolean := false; -- if the record was found in the list
-
- begin
- new_line;
- put_line("Which subsystem would you like to modify?");
- PROMPT_PKG.EXISTING_SUBSYS_NAME( abort_proc, key );
-
- -- set pointer to that milstone, returned in ms_record
- FIND( ss_list, key, ss_record, found );
-
- if not abort_proc then
- while not exit_field_menu loop
- field_selection := VT100.PRINT_SS_MENU( ss_record );
- case field_selection is
- when 1 => -- get subsystem name .. change the key
- put_line(" The current subsystem name is "); put( ss_record.name);
- new_line;
- put_line(" What would you like to change it to? ");
- new_name := PROMPT_PKG.NEW_SUBSYS_NAME;
-
- -- change the key in the element data, subsystem list, and data
- CHANGE_SS_IN_EL( ss_record, new_name );
- CHANGE_LIST_KEY( ss_list, ss_record.name, new_name );
- ss_record.name := new_name;
-
- when 2 => -- get new task numbers
- ss_record.task_numbers := PROMPT_PKG.TASK_NUMBERS( ss_record );
-
- when 3 => put_line(" The current percent complete at start is: ");
- put( ss_record.percent_at_start,3,2,0 ); put('%');
- ss_record.percent_at_start := PROMPT_PKG.PERCENT;
- when 4 => exit_field_menu := true;
- when others => put_line("Please enter a number beween 1 and 4.");
- end case;
- end loop;
- end if;
- end SS_MODIFY;
-
-
- separate(TRACKER.SUBSYSTEM_PKG)
- procedure SS_SAVE is
- ------------------------------------------------------------------------------
- --|
- --| NAME: SS_SAVE
- --|
- --| OVERVIEW:
- --| This procedure saves a record to file by calling the SS_WRITE
- --| procedure. The generic procedures START_WALK and WALK are called
- --| to walk the linked list allowing one record at a time to be written.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| Written by May Lee March 1985
- --|
- ------------------------------------------------------------------------------
- end_of_list : boolean := false;
- ss_record : subsystem_pointer;
-
- procedure SS_WRITE is separate;
-
- begin
- START_WALK( ss_list);
- -- walk the list one subsystem at a time and write it to the file
- loop
- WALK( ss_list, ss_record, end_of_list);
- exit when end_of_list;
- SS_WRITE;
- end loop;
- end SS_SAVE;
-
-
- separate(TRACKER.SUBSYSTEM_PKG.SS_SAVE)
- procedure SS_WRITE is
- ---------------------------------------------------------------------------
- --|
- --| NAME: SS_WRITE
- --|
- --| OVERVIEW:
- --| This procedure is passed in a record pointer. The record is written
- --| to one line of the output file in the following format:
- --||
- --|| +----------+-----+------+
- --|| | name | prct|task #| ...
- --|| +----------+-----+------+
- --|| ^
- --|| |__ varies from 1..num_of_activities
- --||
- --| See DATA_PKG for the full names of the fields and their types.
- --| The subsystem records are the fifth type of data to be written to the
- --| output file.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| Written by May Lee March 1985
- --|
- ---------------------------------------------------------------------------
- begin
- put( output_file, ss_record.name(1..10) ); -- string
- put( output_file, ss_record.percent_at_start, 3, 1, 0 ); -- real
- for ac_index in 1..num_of_activities loop
- put( output_file, ss_record.task_numbers(ac_index), 4 );
- end loop;
- new_line( output_file );
- end SS_WRITE;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --el.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- with PROMPT_PKG;
-
- separate(TRACKER)
- package body ELEMENT_PKG is
- -----------------------------------------------------------------------------
- --| NAME: ELEMENT_PKG
- --|
- --| OVERVIEW:
- --| This package defines the actions that can be performed on
- --| element data types (defined in data_pkg).
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- -----------------------------------------------------------------------------
-
- -- instantiation of generic list handler is done in data_pkg
- use AC_LIST_PKG; -- to get the activity completeness
- use EL_LIST_PKG;
- use MS_LIST_PKG;
- use PR_LIST_PKG;
- use SS_LIST_PKG;
-
- -- to convert the enumeration type activity_phase_percent to character
- -- for read and write into the file only
- type ac_phase_char_type is array(1..10) of character;
- char_ac_completeness : ac_phase_char_type := (others => ' ');
-
- procedure MULTIPLE_PR_EL_RECORD( el_record : in out element_pointer)
- is separate;
- procedure SINGLE_PR_EL_RECORD( el_record : in out element_pointer)
- is separate;
- procedure ADD_RECORD_TO_LISTS( el_record : in element_pointer) is separate;
- procedure EL_ADD is separate;
- procedure EL_INITIALIZE is separate;
- procedure UPDATE_CURRENT is separate;
- procedure UPDATE_PCT_DONE is separate;
- procedure EL_SET_UP is separate;
- procedure EL_DELETE is separate;
- procedure EL_MODIFY is separate;
- procedure EL_SAVE is separate;
-
- end ELEMENT_PKG;
-
- --****************************************************************************
- separate(TRACKER.ELEMENT_PKG)
- procedure MULTIPLE_PR_EL_RECORD( el_record : in out element_pointer) is
- use CALENDAR;
- a_record : element_pointer;
- begin
- a_record := new element_type( true );
- a_record.all :=
- (two_or_more_people => true,
- description => el_record.description,
- desc_key => el_record.desc_key,
- subsystem_name => el_record.subsystem_name,
- milestone_num => el_record.milestone_num,
- priority => el_record.priority,
- original_size => el_record.original_size,
- size_done_at_start => el_record.size_done_at_start,
- current_size => el_record.current_size,
- complexity => el_record.complexity,
- activity_completeness => el_record.activity_completeness,
- hours_to_complete => el_record.hours_to_complete,
- date_done => el_record.date_done,
- prev_date_done => el_record.prev_date_done,
- date_size_verified => el_record.date_size_verified,
- more_than_one_person => true,
- dates_done => (others => null_date),
- hours_left => (others => 0.0),
- people_initials => (others => " ") );
- el_record := a_record;
- end MULTIPLE_PR_EL_RECORD;
-
- separate(TRACKER.ELEMENT_PKG)
- procedure SINGLE_PR_EL_RECORD( el_record : in out element_pointer) is
- a_record : element_pointer;
- begin
- a_record := new element_type(false);
- a_record.all :=
- (two_or_more_people => false,
- description => el_record.description,
- desc_key => el_record.desc_key,
- subsystem_name => el_record.subsystem_name,
- milestone_num => el_record.milestone_num,
- priority => el_record.priority,
- original_size => el_record.original_size,
- size_done_at_start => el_record.size_done_at_start,
- current_size => el_record.current_size,
- complexity => el_record.complexity,
- activity_completeness => el_record.activity_completeness,
- hours_to_complete => el_record.hours_to_complete,
- date_done => el_record.date_done,
- prev_date_done => el_record.prev_date_done,
- date_size_verified => el_record.date_size_verified,
- more_than_one_person => false,
- person_initials => " ");
- el_record := a_record;
- end SINGLE_PR_EL_RECORD;
-
-
- separate(TRACKER.ELEMENT_PKG)
- procedure ADD_RECORD_TO_LISTS( el_record : in element_pointer ) is
- -----------------------------------------------------------------------------
- --| NAME: ADD_RECORD_TO_LISTS
- --|
- --| OVERVIEW:
- --| This procedure is called by EL_SET_UP and EL_ADD. It
- --| adds the element record to every data's element list
- --| by calling the List_Pkg procedures FINDto find the record and
- --| return the pointer and ADD to append the record to the list.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- --| NOTES:
- --| The pointer to the current element record is passed as a parameter.
- -----------------------------------------------------------------------------
- found : boolean ; -- parameter to find
- el_record2 : element_pointer;
- ms_record : milestone_pointer; -- to add the element to the ms_el_list
- pr_record : personnel_pointer; -- to add the element to the pr_el_list
- ss_record : subsystem_pointer; -- to add the element to the ss_el_list
-
- begin
- -- add element to element list
- ADD( el_list, el_record.desc_key, el_record);
-
- -- Every element has every activity, so activity doesn't
- -- have an element list. Every other data has to have the
- -- element added to its own element list.
-
- -- find the correct milestone
- FIND( ms_list, el_record.milestone_num, ms_record, found );
- -- add element to milestone element list
- ADD( ms_record.element_list , el_record.desc_key, el_record);
-
- -- find the correct person
- if el_record.more_than_one_person then
- -- add the element to the person's list, if not already added
- for ac_index in 1..num_of_activities loop
- find (pr_list, el_record.people_initials(ac_index), pr_record, found);
- find (pr_record.element_list, el_record.desc_key, el_record2,
- found);
- if not found then
- add (pr_record.element_list, el_record.desc_key, el_record);
- end if;
- end loop;
- else
- FIND( pr_list, el_record.person_initials, pr_record, found );
- ADD( pr_record.element_list , el_record.desc_key, el_record);
- end if;
-
- -- find the correct subsystem
- FIND( ss_list, el_record.subsystem_name, ss_record, found );
- -- add element to subsystem element list
- ADD( ss_record.element_list , el_record.desc_key, el_record);
- end ADD_RECORD_TO_LISTS;
-
-
- separate(TRACKER.ELEMENT_PKG)
- procedure EL_ADD is
- -----------------------------------------------------------------------------
- --|
- --| NAME: EL_ADD
- --|
- --| OVERVIEW:
- --| This procedure sets up the record to be added to the list by
- --| user prompt/response. The function calls to Prompt_Pkg return
- --| only valid existing data. The complete record is
- --| then added to the linked list by calling the procedure
- --| ADD_RECORD_TO_LISTS.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- --| NOTES:
- --| The number of elements is incremented if the element has been
- --| successfully added to all the necessary data lists.
- -----------------------------------------------------------------------------
- abort_proc : boolean := false; -- parameter to key prompts
- a_char : character := ' '; -- used for getting char input
- count : integer := 1; -- used as a temp loop counter
- ac_index : integer := 1; -- number of the ac being referenced
- ac_record : activity_pointer; -- pointer to ac data record
- end_list : boolean := false; -- indicates the end of list was detected
- el_record : element_pointer; -- pointer to el data record
- found : boolean := false; -- whether or not a person was found on a list
- ms_key : ms_num_type; -- used to get key
- pr_record : personnel_pointer; -- pointer pr ac data record
- pr_key : pr_init_type; -- used to get key
- ss_key : ss_name_type; -- used to get key
-
- begin
- -- create a null record
- el_record := new element_type;
-
- new_line;
- put_line(" If you would like more information on the type of data ");
- put_line(" to enter for any of the following questions, enter a '?'. ");
- put_line(" Otherwise, enter the data requested. ");
- new_line(2);
-
- el_record.description := PROMPT_PKG.ELE_DESCRIPTION;
- el_record.desc_key := PROMPT_PKG.NEW_ELE_KEY;
-
- loop -- get ss name
- PROMPT_PKG.EXISTING_SUBSYS_NAME( abort_proc, ss_key );
- if abort_proc then
- put_line(" You MUST enter an existing subsystem. ");
- put_line(" You cannot abort the procedure at this time. ");
- else
- el_record.subsystem_name := ss_key;
- exit;
- end if;
- end loop;
-
- -- multiple people? determines which element record to use
- loop -- until y or n
- put_line(" Will more than one person be working on this element? ");
- put(" [y or n, <cr>=n)] : ");
- if end_of_line then
- skip_line;
- exit;
- else
- get( a_char ); skip_line;
- if a_char = 'Y' or a_char = 'y' then
- -- define the element record
- MULTIPLE_PR_EL_RECORD( el_record );
- exit;
- elsif a_char = '?' then
- put_line(" Please enter 'y' or 'n'. ");
- new_line;
- else
- exit;
- end if;
- end if;
- end loop;
-
- -- prompt for the person or people assigned to the element
- if el_record.more_than_one_person then
- put_line(" Enter the initials of the person assigned to each activity");
- put_line(" of this element... ");
- new_line;
- -- prompt for the person working on each activity in the element
- START_WALK (ac_list);
- ac_index := 0;
- loop
- WALK(ac_list, ac_record, end_list);
- exit when end_list;
- ac_index := ac_index + 1;
- put(" Who is assigned to ");
- put(ac_record.name); put_line("? ");
- loop
- PROMPT_PKG.EXISTING_PERSON_INITIALS( abort_proc, pr_key );
- exit when not abort_proc;
- put_line(" You cannot abort at this point!");
- put_line(" Enter the initials of a person assigned to the project.");
- end loop;
- el_record.people_initials(ac_index) := pr_key;
- end loop;
- else -- only one person is assigned
- put_line(" Enter the initials of the person assigned to this element");
- new_line;
- -- get new initials
- loop
- PROMPT_PKG.EXISTING_PERSON_INITIALS( abort_proc, pr_key );
- exit when not abort_proc;
- put_line(" You cannot abort at this point!");
- put_line(" Enter the initials of the person assigned to this element.");
- end loop;
- el_record.person_initials := pr_key;
- end if;
-
- -- enter the milestone number
- loop
- PROMPT_PKG.EXISTING_MILSTONE_NUMBER( abort_proc, ms_key );
- if abort_proc then
- put_line(" You MUST enter an existing milestone. ");
- put_line(" You cannot abort the procedure at this time. ");
- else
- el_record.milestone_num := ms_key;
- exit;
- end if;
- end loop;
-
- el_record.priority :=
- PROMPT_PKG.element_priority ( default => el_record.milestone_num );
- el_record.current_size := PROMPT_PKG.CURRENT_SIZE_EST;
- el_record.date_size_verified := DATA_PKG.date;
- el_record.original_size :=
- PROMPT_PKG.ORIG_SIZE_EST( default => el_record.current_size );
- el_record.complexity := PROMPT_PKG.COMPLEXITY_FACTOR;
- el_record.activity_completeness := PROMPT_PKG.ACTIV_COMPLETENESS;
-
- -- add data to lists
- ADD_RECORD_TO_LISTS( el_record );
-
- -- increment number of elements
- num_of_elements := num_of_elements + 1;
-
- end EL_ADD;
-
-
- separate( TRACKER.ELEMENT_PKG )
- procedure EL_INITIALIZE is
- -----------------------------------------------------------------------------
- --|
- --| NAME: EL_INITIALIZE
- --|
- --| OVERVIEW:
- --| This procedure is called only when a new TRACKER file has to
- --| be created. It is part of a forced user response to fill in
- --| the necessary data to make TRACKER a complete report. The
- --| procedure EL_ADD is called to gather the information and put it
- --| into a linked list.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- --| NOTES:
- --| The user is forced to add at least one element record and then
- --| is prompted to add another or not.
- -----------------------------------------------------------------------------
- add_another : character := 'N';
- done : boolean := false;
-
- begin
- while not done loop
- -- force the user to add at least one element
- EL_ADD; -- data to the record and the record to the list
- loop
- put_line("Would you like to add another element? ");
- put(" [ Y or N, <cr>=N ] : ");
- new_line;
- if end_of_line then
- skip_line;
- done := true;
- exit;
- else
- get(add_another); skip_line;
- if add_another = 'N' or add_another = 'n' then
- done := true;
- exit;
- elsif add_another = 'Y' or add_another = 'y' then
- exit; -- add another element
- else
- put_line(" Please enter y or n. ");
- end if;
- end if;
- end loop;
- end loop;
- end EL_INITIALIZE;
-
- separate ( TRACKER.ELEMENT_PKG )
- procedure UPDATE_CURRENT is
- -----------------------------------------------------------------------------
- --|
- --| NAME: UPDATE_CURRENT
- --|
- --| OVERVIEW:
- --| This procedure walks through a group of elements and asks the user
- --| to update the current size estimate. If no change is desired, the
- --| user presses <cr>. Otherwise he enters the new value for current
- --| size.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- --|
- -----------------------------------------------------------------------------
- selection : integer := 0;
- QUIT : boolean := false;
- EL_PTR : element_pointer;
- END_LIST : boolean := false;
- MS_PTR : milestone_pointer;
- MS_NUM : ms_num_type := 1;
- PR_PTR : personnel_pointer;
- PR_INITIALS : pr_init_type := (others => ' ');
- SS_PTR : subsystem_pointer;
- SS_NAME : ss_name_type := (others => ' ');
- SUCCEED : boolean := false;
-
- procedure FIX_EL_SIZE (EL_PTR : in element_pointer) is separate;
-
- begin
- loop
- selection := VT100.PRINT_EL_GROUPS;
- case SELECTION is
- when 1 => -- all elements
- start_walk (EL_LIST);
- loop
- walk (EL_LIST, EL_PTR, END_LIST);
- exit when END_LIST;
- FIX_EL_SIZE (EL_PTR);
- end loop;
-
- when 2 => -- milestone
- PROMPT_PKG.existing_milstone_number (QUIT, MS_NUM);
- if not QUIT then
- find (MS_LIST, MS_NUM, MS_PTR, succeed);
- start_walk (MS_PTR.element_list);
- loop
- walk (MS_PTR.element_list, EL_PTR, END_LIST);
- exit when END_LIST;
- FIX_EL_SIZE (EL_PTR);
- end loop;
- end if;
-
- when 3 => -- person
- PROMPT_PKG.existing_person_initials (QUIT, PR_INITIALS);
- if not QUIT then
- find (PR_LIST, PR_INITIALS, PR_PTR, succeed);
- start_walk (PR_PTR.element_list);
- loop
- walk (PR_PTR.element_list, EL_PTR, END_LIST);
- exit when END_LIST;
- FIX_EL_SIZE (EL_PTR);
- end loop;
- end if;
-
- when 4 => -- subsystem
- PROMPT_PKG.existing_subsys_name (QUIT, SS_NAME);
- if not QUIT then
- find (SS_LIST, SS_NAME, SS_PTR, succeed);
- start_walk (SS_PTR.element_list);
- loop
- walk (SS_PTR.element_list, EL_PTR, END_LIST);
- exit when END_LIST;
- FIX_EL_SIZE (EL_PTR);
- end loop;
- end if;
-
- when 5 => exit;
-
- when others => null;
- end case;
-
- end loop;
- end UPDATE_CURRENT;
-
-
- separate ( TRACKER.ELEMENT_PKG.UPDATE_CURRENT )
- procedure FIX_EL_SIZE (EL_PTR : in element_pointer) is
- -----------------------------------------------------------------------------
- --|
- --| NAME: FIX_EL_SIZE
- --|
- --| OVERVIEW:
- --| This procedure updates the element's current size.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- --|
- -----------------------------------------------------------------------------
-
- OLD_SIZE : integer range 0..999_999 := EL_PTR.current_size;
-
- begin
- put(" For "); put(EL_PTR.desc_key);
- put(" -- "); put(EL_PTR.description);
- EL_PTR.current_size :=
- PROMPT_PKG.update_current_size(EL_PTR.current_size);
-
- -- if the current size estimate decreased, then the percent of work
- -- done at start remains the same but the amount of work done at
- -- start decreases
- if (EL_PTR.current_size = 0) or (old_size = 0) then
- EL_PTR.size_done_at_start := 0;
- elsif old_size > EL_PTR.current_size then
- EL_PTR.size_done_at_start := EL_PTR.size_done_at_start
- * EL_PTR.current_size / old_size;
- end if;
- EL_PTR.date_size_verified := DATA_PKG.date;
- end FIX_EL_SIZE;
-
-
- separate ( TRACKER.ELEMENT_PKG )
- procedure UPDATE_PCT_DONE is
- -----------------------------------------------------------------------------
- --|
- --| NAME: UPDATE_PCT_DONE
- --|
- --| OVERVIEW:
- --| This procedure steps through a group of elements and updates the
- --| percent complete estimate.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --| written by Bonnie Burkhardt March 1985
- --|
- -----------------------------------------------------------------------------
-
- selection : integer := 0;
- QUIT : boolean := false;
- EL_PTR : element_pointer;
- END_LIST : boolean := false;
- MS_PTR : milestone_pointer;
- MS_NUM : ms_num_type := 1;
- PR_PTR : personnel_pointer;
- PR_INITIALS : pr_init_type := (others => ' ');
- SS_PTR : subsystem_pointer;
- SS_NAME : ss_name_type := (others => ' ');
- SUCCEED : boolean := false;
-
- begin
- loop
- selection := VT100.PRINT_EL_GROUPS;
- case SELECTION is
- when 1 => -- all elements
- start_walk (EL_LIST);
- loop
- walk (EL_LIST, EL_PTR, END_LIST);
- exit when END_LIST;
- put(" For "); put(EL_PTR.desc_key);
- put(" -- "); put(EL_PTR.description);
- EL_PTR.activity_completeness :=
- PROMPT_PKG.update_activ_completeness
- (EL_PTR.activity_completeness);
- end loop;
-
- when 2 => -- milestone
- PROMPT_PKG.existing_milstone_number (QUIT, MS_NUM);
- if not QUIT then
- find (MS_LIST, MS_NUM, MS_PTR, succeed);
- start_walk (MS_PTR.element_list);
- loop
- walk (MS_PTR.element_list, EL_PTR, END_LIST);
- exit when END_LIST;
- put(" For "); put(EL_PTR.desc_key);
- put(" -- "); put(EL_PTR.description);
- EL_PTR.activity_completeness :=
- PROMPT_PKG.update_activ_completeness
- (EL_PTR.activity_completeness);
- end loop;
- end if;
-
- when 3 => -- person
- PROMPT_PKG.existing_person_initials (QUIT, PR_INITIALS);
- if not QUIT then
- find (PR_LIST, PR_INITIALS, PR_PTR, succeed);
- start_walk (PR_PTR.element_list);
- loop
- walk (PR_PTR.element_list, EL_PTR, END_LIST);
- exit when END_LIST;
- put(" For "); put(EL_PTR.desc_key);
- put(" -- "); put(EL_PTR.description);
- EL_PTR.activity_completeness :=
- PROMPT_PKG.update_activ_completeness
- (EL_PTR.activity_completeness);
- end loop;
- end if;
-
- when 4 => -- subsystem
- PROMPT_PKG.existing_subsys_name (QUIT, SS_NAME);
- if not QUIT then
- find (SS_LIST, SS_NAME, SS_PTR, succeed);
- start_walk (SS_PTR.element_list);
- loop
- walk (SS_PTR.element_list, EL_PTR, END_LIST);
- exit when END_LIST;
- put(" For "); put(EL_PTR.desc_key);
- put(" -- "); put(EL_PTR.description);
- EL_PTR.activity_completeness :=
- PROMPT_PKG.update_activ_completeness
- (EL_PTR.activity_completeness);
- end loop;
- end if;
-
- when 5 => exit;
-
- when others => null;
- end case;
-
- end loop;
- end UPDATE_PCT_DONE;
-
-
-
- separate ( TRACKER.ELEMENT_PKG )
- procedure EL_SET_UP is
- -----------------------------------------------------------------------------
- --|
- --| NAME: EL_SET_UP
- --|
- --| OVERVIEW:
- --| This procedure is only called if there is an existing input file.
- --| The element list is set up by reading the element record
- --| from the input file by calling EL_READ, and adding it to the linked
- --| list by calling ADD_RECORD_TO_LISTS until there are no more element
- --| records.
- --|
- --| EXCEPTIONS HANDLED:
- --| others Error reading the record from the file.
- --| . This exception raises ERROR_IN_INPUT_FILE.
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- --| NOTES:
- --| The number of element records read in is determined by the
- --| global variable num_of_elements.
- --|
- --| If an error is detected reading the data, the rest of the input line
- --| is skipped and reading the rest of the data continues. All errors
- --| found are reported. Execution is not terminated until the entire
- --| input file has been read.
- --|
- -----------------------------------------------------------------------------
- el_record : element_pointer;
- el_num : integer := 0;
- bad_data : boolean := false;
-
- procedure EL_READ is separate;
-
- begin
- for i in 1..num_of_elements loop
- el_num := i;
- begin
- -- create a null record
- el_record := new element_type;
-
- -- read the element
- EL_READ;
-
- -- add the element record to the linked lists
- ADD_RECORD_TO_LISTS( el_record );
- exception
- when others =>
- skip_line (tracker_file);
- put(" Error reading element record "); put(el_num,1);
- put_line(" from the tracker file. ");
- bad_data := true;
- end;
- end loop;
- if bad_data then
- raise ERROR_IN_INPUT_FILE;
- end if;
- end EL_SET_UP;
-
- separate( TRACKER.ELEMENT_PKG.EL_SET_UP )
- procedure EL_READ is
- ----------------------------------------------------------------------------
- --|
- --| NAME: EL_READ
- --|
- --| OVERVIEW:
- --| This procedure reads a record from the file. One line of data is
- --| read at a time and broken down into the fields of the
- --| element record, which is made visible to the calling routine
- --| EL_SET_UP. The data is read in the format specified by the EL_WRITE
- --| procedure.
- --|
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- --| NOTES:
- --| Any exceptions raised here are handled by EL_SET_UP.
- --|
- ----------------------------------------------------------------------------
- multiple_people : character; -- true or false
-
- begin
- get( tracker_file, el_record.description ); -- string
- get( tracker_file, el_record.desc_key );
- get( tracker_file, el_record.subsystem_name );
- get( tracker_file, el_record.milestone_num, 2 ); -- integer
- get( tracker_file, el_record.priority, 2 ); -- integer
- get( tracker_file, el_record.original_size, 7 );
- get( tracker_file, el_record.size_done_at_start, 7 );
- get( tracker_file, el_record.current_size, 7 );
- get( tracker_file, el_record.complexity, 3 ); -- real
- for i in 1..num_of_activities loop
- get( tracker_file, char_ac_completeness(i) ); -- character
- -- convert char to enumeration type act_phase_char_set
- el_record.activity_completeness(i) := convert( char_ac_completeness(i) );
- end loop;
- get( tracker_file, el_record.prev_date_done.month , 2);
- get( tracker_file, el_record.prev_date_done.day , 2);
- get( tracker_file, el_record.prev_date_done.year , 4);
- get( tracker_file, el_record.date_size_verified.month , 2);
- get( tracker_file, el_record.date_size_verified.day , 2);
- get( tracker_file, el_record.date_size_verified.year , 4);
- get( tracker_file, multiple_people );
- if multiple_people = 'T' then
- MULTIPLE_PR_EL_RECORD( el_record );
- for i in 1..num_of_activities loop
- get( tracker_file, el_record.people_initials(i) );
- end loop;
- else
- get( tracker_file, el_record.person_initials );
- end if;
- skip_line (tracker_file);
- end EL_READ;
-
- separate ( TRACKER.ELEMENT_PKG )
- procedure EL_DELETE is
- -----------------------------------------------------------------------------
- --|
- --| NAME: EL_DELETE
- --|
- --| OVERVIEW:
- --| This procedure is used to delete an element record. The user is
- --| prompted to enter an existing element by a call to the Prompt_Pkg
- --| function, which returns a valid key. The element is deleted from
- --| each data's element list to which that element belonged. The
- --| element is then deleted from the element list by calling the List_pkg
- --| procedure DELETE.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- --| NOTES:
- --| The number of elements is decremented if the delete is successful.
- --|
- --| A check is made to insure the last element is not deleted. There
- --| must be at least one element at all times.
- --|
- -----------------------------------------------------------------------------
- abort_proc : boolean := false;
- el_record : element_pointer;
- found : boolean; -- parameter to find
- ms_record : milestone_pointer; -- to delete the element from ms_el_list
- pr_record : personnel_pointer; -- to delete the element from pr_el_list
- ss_record : subsystem_pointer; -- to delete the element from ss_el_list
- successful : boolean := false;
- key : el_key_type; -- element description key
-
- begin
- if num_of_elements > 1 then
- put_line("Which element would you like to delete? ");
- -- get the element description key
- PROMPT_PKG.EXISTING_ELE_KEY( abort_proc, key );
-
- if not abort_proc then
- FIND( el_list, key, el_record, found );
-
- -- find the milestone belonging to the deleted element
- FIND( ms_list, el_record.milestone_num, ms_record, found );
- -- delete the element from the milestone element list
- DELETE( ms_record.element_list, key, successful );
-
- -- find the person belonging to the deleted element
- if el_record.more_than_one_person then
- -- delete the element from all the personnel lists
- for ac in 1..num_of_activities loop
- find (pr_list, el_record.people_initials(ac), pr_record, found);
- delete (pr_record.element_list, key, found);
- end loop;
- else
- FIND( pr_list, el_record.person_initials, pr_record, found );
- DELETE( pr_record.element_list, key, successful );
- end if;
-
- -- find the subsystem belonging to the deleted element
- FIND( ss_list, el_record.subsystem_name, ss_record, found );
- -- delete from the subsystem element list
- DELETE( ss_record.element_list, key, successful );
-
- -- delete from the element list
- DELETE( el_list, key, successful );
-
- -- decrement the element counter
- num_of_elements := num_of_elements - 1;
- put("Number of elements = "); put(num_of_elements); new_line;
- delay 1.0;
- end if; -- if abort, don't do delete
- else
- put_line(" You must have at least one element at all times. ");
- put_line(" Since you have only one element at this time, you ");
- put_line(" cannot delete it. ");
- delay 2.0;
- end if;
- end EL_DELETE;
-
-
- separate ( TRACKER.ELEMENT_PKG )
- procedure EL_MODIFY is
- -----------------------------------------------------------------------------
- --|
- --| NAME: EL_MODIFY
- --|
- --| OVERVIEW:
- --| This procedure allows the user to modify an existing element record.
- --| The user is prompted for an existing element record by calling
- --| the appropriate Prompt_Pkg function. The generic FIND is used to
- --| get the record. The user is then allowed to change the fields by
- --| choosing a menu selection. The record fields are modified directly.
- --| If the element abbreviation is modified, MODIFY_ELEMENT_KEY is called.
- --| If a change is made to a field that affects another data type, then
- --| checks have to be made to insure that the change is valid. For
- --| example, if the person's initials are changed in the element data,
- --| checks have to be made to make sure that the new initials belong
- --| to a valid pre-defined person. This is taken care of by the
- --| Prompt_Pkg, which only returns valid values.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --| written by Bonnie Burkhardt March 1985
- --|
- -----------------------------------------------------------------------------
- abort_proc : boolean := false; -- don't want to change a field
- ac_index : integer := 0;
- ac_record : activity_pointer;
- end_list : boolean := false;
- el_record : element_pointer ; -- pointer to element record
- el_record2 : element_pointer;
- exit_field_menu : boolean := false; -- exit element field menu
- field_selection : integer; -- selection from element field menu
- found : boolean; -- parameter to find
- key : el_key_type; -- key to description of element
- -- we are looking for
- ms_record : milestone_pointer; -- to check if the milestone exists
- new_ms : ms_num_type; -- if modify ms
- new_pr : pr_init_type; -- if modify pr
- new_ss_name : ss_name_type; -- if modify ss name
- old_size : integer range 0..99_999 := 0;
- pr_key : pr_init_type; -- used to get key
- pr_record : personnel_pointer; -- to check if the person exists
- ss_record : subsystem_pointer; -- to check if the subsystem exists
-
- procedure MODIFY_ELEMENT_KEY is separate;
-
- begin
- -- get the element key
- new_line;
- put_line(" Which element would you like to modify?");
- PROMPT_PKG.EXISTING_ELE_KEY ( abort_proc, key );
-
- -- find the valid key in the list to get the pointer to that record
- FIND( el_list, key, el_record, found );
-
- if not abort_proc then
- -- display menu
- while not exit_field_menu loop
- field_selection := VT100.PRINT_EL_MENU( el_record );
- case field_selection is
- when 1 => -- get new element description
- put_line(" The current element description is : ");
- put_line( el_record.description );
- new_line;
- el_record.description := PROMPT_PKG.ELE_DESCRIPTION;
-
- when 2 => -- Getting new element key
- put(" What would you like to change "); put(key); put(" to? ");
- MODIFY_ELEMENT_KEY;
-
- when 3 => -- Getting new subsystem name
- -- show the old name
- put(" The current subsystem name is ");
- put( el_record.subsystem_name ); new_line;
- put_line(" What would you like to change it to? ");
- -- get new name
- PROMPT_PKG.EXISTING_SUBSYS_NAME( abort_proc, new_ss_name );
- if not abort_proc then
- el_record.subsystem_name := new_ss_name;
- end if;
-
- when 4 => -- Getting new person's initials
- -- show the old initials
- if el_record.more_than_one_person then
- -- delete the element from all the personnel lists
- for ac in 1..num_of_activities loop
- find (pr_list, el_record.people_initials(ac), pr_record, found);
- delete (pr_record.element_list, el_record.desc_key, found);
- end loop;
-
- -- prompt for the person working on each activity in the element
- start_walk (ac_list);
- ac_index := 0;
- loop
- walk(ac_list, ac_record, end_list);
- exit when end_list;
-
- ac_index := ac_index + 1;
- put(" The person assigned to ");
- put(ac_record.name);
- put(" is ");
- put(el_record.people_initials(ac_index));
- new_line;
-
- loop
- PROMPT_PKG.EXISTING_PERSON_INITIALS( abort_proc, pr_key );
- exit when not abort_proc;
- put_line(" You cannot abort at this point!");
- put_line(" Enter the initials of a person assigned to the project.");
- end loop;
- el_record.people_initials(ac_index) := pr_key;
-
- -- add the element to the person's list, if not already added
- find (pr_list, pr_key, pr_record, found);
- find (pr_record.element_list, el_record.desc_key, el_record2,
- found);
- if not found then
- add (pr_record.element_list, el_record.desc_key, el_record);
- end if;
- end loop;
- else -- only one person is assigned
- put(" The current person's initials are ");
- put( el_record.person_initials ); new_line;
- put_line(" Who would you like to change it to? ");
- -- get new initials
- PROMPT_PKG.EXISTING_PERSON_INITIALS( abort_proc, new_pr );
- if not abort_proc then
- el_record.person_initials := new_pr;
- end if;
- end if;
-
- when 5 => -- Getting new milestone number
- -- show the old number
- put(" The current milestone number is ");
- put( el_record.milestone_num,2 ); new_line;
- put_line(" What milestone would you like to replace it? ");
- -- get new number
- PROMPT_PKG.EXISTING_MILSTONE_NUMBER( abort_proc, new_ms );
- if not abort_proc then
- el_record.milestone_num := new_ms;
- end if;
-
- when 6 => -- Getting new element priority
- -- show the old number
- put(" The current element priority is ");
- put( el_record.priority, 2 ); new_line;
- put_line(" What would you like to change it to? ");
- -- get new priority
- el_record.priority :=
- PROMPT_PKG.element_priority( default => el_record.milestone_num );
-
- when 7 => -- Getting new current size
- -- show the old size
- put(" The current size is ");
- put( el_record.current_size, 1); new_line;
- put_line(" What would you like to change it to? ");
- -- get new size
- old_size := el_record.current_size;
- el_record.current_size := PROMPT_PKG.CURRENT_SIZE_EST;
-
- -- if the current size estimate decreased, then the percent of work
- -- done at start remains the same but the amount of work done at
- -- start decreases
- if (el_record.current_size = 0) or (old_size = 0) then
- el_record.size_done_at_start := 0;
- elsif old_size > el_record.current_size then
- el_record.size_done_at_start := el_record.size_done_at_start
- * el_record.current_size / old_size;
- end if;
- el_record.date_size_verified := DATA_PKG.date;
-
- when 8 => -- Getting new complexity
- -- show the old complexity
- put(" The current complexity is ");
- put( el_record.complexity, 2, 3, 0); new_line;
- put_line(" What would you like to change it to? ");
- -- get new complexity
- el_record.complexity := PROMPT_PKG.COMPLEXITY_FACTOR;
-
- when 9 => -- Getting new activity completeness
- -- show the old activity completeness
- put(" The current element's activity completeness is : ");
- for i in 1..num_of_activities loop
- put( CONVERT(el_record.activity_completeness(i)) );
- end loop;
- new_line;
- put_line(" What would you like to change it to? ");
- -- get new name
- el_record.activity_completeness := PROMPT_PKG.ACTIV_COMPLETENESS;
-
- when 10 => -- More than one element assigned
- if el_record.more_than_one_person then
- -- delete the element from all the personnel lists
- for ac in 1..num_of_activities loop
- find (pr_list, el_record.people_initials(ac), pr_record, found);
- delete (pr_record.element_list, el_record.desc_key, found);
- end loop;
-
- SINGLE_PR_EL_RECORD( el_record );
- put_line(" The element can now be assigned to one person.");
- put_line(" Who do you want assigned to this element?");
- loop
- PROMPT_PKG.EXISTING_PERSON_INITIALS( abort_proc, new_pr );
- exit when not abort_proc;
- put_line(" You cannot abort at this point!");
- put_line(" Enter the initials of a person assigned to the project.");
- end loop;
- el_record.person_initials := new_pr;
-
- -- add this element to the person's list
- find (pr_list, pr_key, pr_record, found);
- add (pr_record.element_list, el_record.desc_key, el_record);
-
- else -- only one person is assigned
- -- delete the element from the personnel lists
- find (pr_list, el_record.person_initials, pr_record, found);
- delete (pr_record.element_list, el_record.desc_key, found);
-
- MULTIPLE_PR_EL_RECORD( el_record );
-
- -- prompt for the person working on each activity in the element
- put_line(" The element can now be assigned to several people.");
- start_walk (ac_list);
- ac_index := 0;
- loop
- walk(ac_list, ac_record, end_list);
- exit when end_list;
-
- ac_index := ac_index + 1;
- put(" Who is assigned to ");
- put(ac_record.name); put('?');
- new_line;
- loop
- PROMPT_PKG.EXISTING_PERSON_INITIALS( abort_proc, pr_key );
- exit when not abort_proc;
- put_line(" You cannot abort at this point!");
- put_line(" Enter the initials of a person assigned to the project.");
- end loop;
- el_record.people_initials(ac_index) := pr_key;
-
- -- add the element to the person's list, if not already added
- find (pr_list, pr_key, pr_record, found);
- find (pr_record.element_list, el_record.desc_key, el_record2,
- found);
- if not found then
- add (pr_record.element_list, el_record.desc_key, el_record);
- end if;
- end loop;
- end if;
-
- -- change the element data in the subsystem element list
- find (ss_list, el_record.subsystem_name, ss_record, found);
- change_list_data (ss_record.element_list, el_record.desc_key,
- el_record);
-
- -- change the element in the milestone element list
- find (ms_list, el_record.milestone_num, ms_record, found);
- change_list_data (ms_record.element_list, el_record.desc_key,
- el_record);
-
- -- change the element data in the element list
- change_list_data (el_list, el_record.desc_key, el_record);
-
- when 11 => exit_field_menu := true;
- when others => put_line("Please enter a number between 1 and 11. ");
- end case;
- end loop;
- end if; -- not abort_proc
- end EL_MODIFY;
-
- separate ( TRACKER.ELEMENT_PKG.EL_MODIFY )
- procedure MODIFY_ELEMENT_KEY is
- ---------------------------------------------------------------------------
- --|
- --| NAME: MODIFY_ELEMENT_KEY
- --|
- --| OVERVIEW:
- --| This procedure is called when the element description abbreviation
- --| is modified. The user is prompted for a new unique key by calling
- --| the Prompt_Pkg function. The element key must be changed in the
- --| element record, the search key for the element list, and the search
- --| key for each data type's element list.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- --| NOTES:
- --| If an error is detected in finding the element in any of the
- --| data's element list, a message is output to the screen only.
- --| There is no data recovery or termination performed.
- ---------------------------------------------------------------------------
-
- blank_key : el_key_type := (others => ' '); -- to blank out key
- found : boolean; -- found in list
- new_key : el_key_type := (others => ' '); -- to get the new key
-
- begin
- -- Change the key in the element list...
-
- -- get the new key ( only a valid unique key will be returned )
- new_key := PROMPT_PKG.NEW_ELE_KEY;
-
- -- change key in element data record
- el_record.desc_key := new_key;
-
- -- got a valid key, change the old_key to the new key in the element list
- CHANGE_LIST_KEY( el_list, key, new_key );
-
- -- change the element key in the milestone's el list for the milestone
- -- belonging to the modified element
- FIND( ms_list, el_record.milestone_num, ms_record, found );
- if found then
- CHANGE_LIST_KEY( ms_record.element_list, key, new_key );
- else
- put_line(" Error in modify element - could not find el in the ms_el list ");
- end if;
-
- -- change the element key in the person's el list for the person
- -- belonging to the modified element
- FIND( pr_list, el_record.person_initials, pr_record, found );
- if found then
- CHANGE_LIST_KEY( pr_record.element_list, key, new_key );
- else
- put_line(" Error in modify element - could not find el in the pr_el list ");
- end if;
-
- -- change the element key in the subsystem's el list for the subsystem
- -- belonging to the modified element
- FIND( ss_list, el_record.subsystem_name, ss_record, found );
- if found then
- CHANGE_LIST_KEY( ss_record.element_list, key, new_key );
- else
- put_line(" Error in modify element - could not find el in the ss_el list ");
- end if;
- end MODIFY_ELEMENT_KEY;
-
-
- separate ( TRACKER.ELEMENT_PKG )
- procedure EL_SAVE is
- -----------------------------------------------------------------------------
- --|
- --| NAME: EL_SAVE
- --|
- --| OVERVIEW:
- --| This procedure saves a record to file by calling the EL_WRITE
- --| procedure. The user is first asked which date of completion
- --| to save to determine which date to write to the file. The generic
- --| procedures START_WALK and WALK are called to walk the linked list
- --| allowing one record at a time to be written.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- -----------------------------------------------------------------------------
- a_char : character := ' '; -- input character y or n
- el_record : element_pointer; -- pointer to the element record
- end_list : boolean := false; -- parameter to WALK
- update : boolean := true; -- update the previous date of completion
-
- procedure EL_WRITE is separate;
-
- begin
- START_WALK( el_list );
- -- find out which data to write to the file
- loop
- put_line(" Do you want to update the previous date of completion with the ");
- put_line(" newly computed date of completion?");
- put(" [Y or N, <cr>=Y] : ");
- if end_of_line then
- skip_line;
- exit;
- else
- get( a_char );
- skip_line;
- if a_char = 'N' or a_char = 'n' then
- update := false;
- exit;
- elsif a_char = 'Y' or a_char = 'y' then
- exit;
- else
- new_line;
- put_line(" When the data is written to the file for the next run of TRACKER,");
- put_line(" which set of element completion dates would you like stored in the ");
- put_line(" 'Previous Completion Date' column, the previous completion date ");
- put_line(" used in this run or the newly computed completion date? ");
- new_line;
- end if;
- end if;
- end loop;
- new_line(2);
-
- -- walk the list one element at a time and write it to the file
- loop
- WALK(el_list, el_record, end_list);
- exit when end_list;
- EL_WRITE;
- end loop;
- end EL_SAVE;
-
- separate ( TRACKER.ELEMENT_PKG.EL_SAVE )
- procedure EL_WRITE is
- ----------------------------------------------------------------------
- --|
- --| NAME: EL_WRITE
- --|
- --| OVERVIEW:
- --| This procedure is passed in a record pointer. The record is written
- --| to one line of the output file in the following format:
- --||
- --|| +--------------+------+----------+--+--+--+-------+-------+
- --|| | description | key | ss_name |pr|ms|pi| bs_ln | sz_st | . . .
- --|| +--------------+------+----------+--+--+--+-------+-------+
- --||
- --|| prev_date date_verif
- --|| +-------+---+----------+--+--+----+--+--+----+------+
- --|| . . . | cur_sz|com| ac_cmpltn|mo|dy|year|mo|dy|year|mul_pr| . . .
- --|| +-------+---+----------+--+--+----+--+--+----+------+
- --|| ^
- --|| this field varies from 1..num_of_activities
- --||
- --|| Since the element record is variant, the remaining data depends on
- --|| the value of more_than_one_person.
- --|| If true : +--+--+--+
- --|| |pr|pr|pr|...num_of_activities -- array of initials
- --|| +--+--+--+
- --||
- --|| If false: +--+
- --|| |pr| -- only one initial
- --|| +--+
- --||
- --| The element records are the last type of data to be written to the
- --| output file. There are no extra spaces between the record fields.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- --| NOTES:
- --| The boolean value more_than_one_person, is read and written to the
- --| file as an integer (1=true, 0=false). This is due to the problems
- --| with the way Ada reads an enumeration type from a file. The default
- --| width cannot be used if additional data follows the boolean value.
- --| If the width is used to allow for a trailing blank, then the boolean
- --| value can be read, but the following value is incorrect (unless you
- --| account for the blank).
- --|
- ----------------------------------------------------------------------
-
- is_true : constant character := 'T';
- is_false : constant character := 'F';
-
- begin
- put( output_file, el_record.description ); -- string
- put( output_file, el_record.desc_key );
- put( output_file, el_record.subsystem_name );
- put( output_file, el_record.milestone_num, 2 ); -- integer
- put( output_file, el_record.priority, 2 ); -- integer
- put( output_file, el_record.original_size, 7 );
- put( output_file, el_record.size_done_at_start, 7 );
- put( output_file, el_record.current_size, 7 );
- put( output_file, el_record.complexity, 1, 1, 0 );
- for i in 1..num_of_activities loop
- -- convert enumeration type act_phase_char_set to char for write
- char_ac_completeness(i) := convert( el_record.activity_completeness(i) );
- put( output_file, char_ac_completeness(i) );
- end loop;
- if update then -- update prev_date_done to date_done
- put( output_file, el_record.date_done.month , 2);
- put( output_file, el_record.date_done.day , 2);
- put( output_file, el_record.date_done.year , 4);
- else
- put( output_file, el_record.prev_date_done.month , 2);
- put( output_file, el_record.prev_date_done.day , 2);
- put( output_file, el_record.prev_date_done.year , 4);
- end if;
- put( output_file, el_record.date_size_verified.month , 2);
- put( output_file, el_record.date_size_verified.day , 2);
- put( output_file, el_record.date_size_verified.year , 4);
- if el_record.more_than_one_person then
- put( output_file, is_true );
- for i in 1..num_of_activities loop
- put( output_file, el_record.people_initials(i) );
- end loop;
- else
- put( output_file, is_false );
- put( output_file, el_record.person_initials );
- end if;
- new_line(output_file);
- end EL_WRITE;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --report.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- Separate(tracker)
-
- procedure REPORT_GENERATOR is
- --------------------------------------------------------------------------------
- --|
- --| NAME: REPORT_GENERATOR
- --|
- --| OVERVIEW:
- --| This procedure controls the report menu and resolves the selections the
- --| user makes, allowing the user to print any combination of reports.
- --|
- --| EXCEPTIONS HANDLED:
- --| end_error invalid user menu response
- --| data_error invalid user menu response
- --|
- --| HISTORY:
- --| written by May Lee February 1985
- --| written by Bonnie Burkhardt March 1985
- --------------------------------------------------------------------------------
-
- use VT100;
-
- comments_file : file_type;
- comments_filename : string (1..80) := (others => ' ');
-
- type ORIG_OR_CUR_TYPE is (ORIGINAL, CURRENT);
- type SS_AC_ARRAY is array (1..NUM_OF_SUBSYSTEMS, 1..NUM_OF_ACTIVITIES)
- of float range 0.0..100.0;
- type SS_ARRAY is array (1..NUM_OF_SUBSYSTEMS) of float range 0.0..100.0;
- type AC_ARRAY is array (1..NUM_OF_ACTIVITIES) of float range 0.0..100.0;
- type MS_ARRAY is array (ms_num_type) of float range 0.0..100.0;
-
- type PCT_DONE_TYPE is record
- BY_SS_AND_AC : SS_AC_ARRAY
- := (1..num_of_subsystems => (1..num_of_activities => 0.0));
- BY_SS : SS_ARRAY := (others => 0.0);
- BY_AC : AC_ARRAY := (others => 0.0);
- BY_MS : MS_ARRAY := (others => 0.0);
- START_BY_SS : SS_ARRAY := (others => 0.0);
- START_BY_AC : AC_ARRAY := (others => 0.0);
- ENTIRE_BY_SS : SS_ARRAY := (others => 0.0);
- ENTIRE_BY_AC : AC_ARRAY := (others => 0.0);
- CONTRACT : float range 0.0..100.0 := 0.0;
- START : float range 0.0..100.0 := 0.0;
- ENTIRE : float range 0.0..100.0 := 0.0;
- end record;
-
- MAX_DATA_LINES : constant integer := 43;
-
- EXIT_REPORT_MENU : boolean := false;
- CURRENT_PCT_DONE : PCT_DONE_TYPE;
- ORIGINAL_PCT_DONE : PCT_DONE_TYPE;
- menu_selection : integer := 0;
- a_report_printed : boolean := false;
-
- procedure CALC_PCT_DONE (ORIG_OR_CUR : in ORIG_OR_CUR_TYPE;
- PCT_DONE : in out PCT_DONE_TYPE) is separate;
- procedure START_PAGE (TITLE, SUBTITLE, HEADER1, HEADER2, HEADER_LINES
- : in string := "") is separate;
- procedure PARAMETER_DATA_LIST is separate;
- procedure PRINT_COMMENTS is separate;
- procedure ALL_ELMNT_STATUS_REP is separate;
- procedure LIST_BY_SUBSYSTEM is separate;
- procedure LIST_BY_MILESTONE is separate;
- procedure LIST_BY_PERSON is separate;
- procedure SUBSYSTEM_SUMMARY is separate;
- procedure MILESTONE_SUMMARY is separate;
- procedure WORK_UNITS_PER_SS is separate;
- procedure PERCENT_COMPLETION (ORIG_OR_CUR : in ORIG_OR_CUR_TYPE;
- PCT_DONE : in PCT_DONE_TYPE) is separate;
- procedure DISTRIBUTION_OF_WORK (ORIG_OR_CUR : in ORIG_OR_CUR_TYPE)
- is separate;
- procedure COMPLETION_DATE_FOR_MS is separate;
- procedure REPORTS_PRINTED_LIST is separate;
-
- begin
- -- get report file name (input file with ".rpt" extension)
-
- -- start at end of filename look right to left for '.' indicating extension
- while tracker_filename(filename_lngth) /= '.' loop
- filename_lngth := filename_lngth - 1;
- end loop;
-
- -- filename up to extension including the '.'
- report_filename(1..filename_lngth) := tracker_filename(1..filename_lngth);
-
- -- filename with ".rpt" extension
- report_filename(filename_lngth+1..filename_lngth+3) := "rpt";
- filename_lngth := filename_lngth + 3;
-
- create(report_file, out_file, report_filename, "");
- CALC_PCT_DONE(ORIGINAL, ORIGINAL_PCT_DONE);
- CALC_PCT_DONE(CURRENT, CURRENT_PCT_DONE);
- while not exit_report_menu loop
- REPORT_CASE:
- begin
- menu_selection := PRINT_REPORT_MENU;
-
- case menu_selection is
- when 1 => VT100.print_report(1) := true;
- PARAMETER_DATA_LIST;
- when 2 => PRINT_COMMENTS;
- VT100.print_report(2) := true;
- when 3 => VT100.print_report(3) := true;
- ALL_ELMNT_STATUS_REP;
- when 4 => VT100.print_report(4) := true;
- LIST_BY_SUBSYSTEM;
- when 5 => VT100.print_report(5) := true;
- LIST_BY_MILESTONE;
- when 6 => VT100.print_report(6) := true;
- LIST_BY_PERSON;
- when 7 => VT100.print_report(7) := true;
- SUBSYSTEM_SUMMARY;
- when 8 => VT100.print_report(8) := true;
- MILESTONE_SUMMARY;
- when 9 => VT100.print_report(9) := true;
- WORK_UNITS_PER_SS;
- when 10 => VT100.print_report(10) := true;
- PERCENT_COMPLETION(ORIGINAL, ORIGINAL_PCT_DONE);
- PERCENT_COMPLETION(CURRENT, CURRENT_PCT_DONE);
- when 11 => VT100.print_report(11) := true;
- DISTRIBUTION_OF_WORK (ORIGINAL);
- DISTRIBUTION_OF_WORK (CURRENT);
- when 12 => VT100.print_report(12) := true;
- COMPLETION_DATE_FOR_MS;
- when 13 => -- print all reports and exit
- VT100.print_report := (others => true);
- PARAMETER_DATA_LIST;
- PRINT_COMMENTS;
- VT100.CLEAR_SCREEN;
- new_line(10);
- put_line(" Writing reports ... ");
- ALL_ELMNT_STATUS_REP;
- LIST_BY_SUBSYSTEM;
- LIST_BY_MILESTONE;
- LIST_BY_PERSON;
- SUBSYSTEM_SUMMARY;
- MILESTONE_SUMMARY;
- WORK_UNITS_PER_SS;
- PERCENT_COMPLETION(ORIGINAL, ORIGINAL_PCT_DONE);
- PERCENT_COMPLETION(CURRENT, CURRENT_PCT_DONE);
- DISTRIBUTION_OF_WORK (ORIGINAL);
- DISTRIBUTION_OF_WORK (CURRENT);
- COMPLETION_DATE_FOR_MS;
- exit_report_menu := true;
- when 14 =>
- exit_report_menu := true;
- CLEAR_SCREEN;
- GOODBYE_MESSAGE;
- when others =>
- put_line("Enter a number between 1 and 14. ");
- delay(0.8);
- end case;
-
- exception
- when end_error =>
- new_line; new_line;
- put_line("Enter a number between 1 and 14.");
- delay(0.8);
- when data_error =>
- new_line; new_line;
- put_line("Enter a number between 1 and 14.");
- delay(0.8);
- when NAME_ERROR => null;
- end REPORT_CASE;
- end loop;
-
- -- determine if any reports were written
- for i in 1..12 loop
- a_report_printed := a_report_printed or VT100.print_report(i);
- end loop;
-
- if a_report_printed then
- -- last report printed will always be a list of the reports generated
- REPORTS_PRINTED_LIST;
- close(report_file);
- else
- delete( report_file );
- end if;
-
-
- end REPORT_GENERATOR;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --calcpct.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- 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;
-
-
-
- separate (TRACKER.REPORT_GENERATOR.CALC_PCT_DONE)
- procedure GET_SS_TOTALS is
- --------------------------------------------------------------------------------
- --|
- --| NAME: GET_SS_TOTALS
- --|
- --| OVERVIEW:
- --| This procedure computes the total amount of work, the amount done,
- --| and the amount available at start for a subsystem.
- --|
- --| EXCEPTIONS HANDLED:
- --| others error message is printed and execution continues
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- --------------------------------------------------------------------------------
-
- DONE : float range 0.0..999_999.0 := 0.0;
- SIZE : float range 0.0..999_999.0 := 0.0;
- START : float range 0.0..999_999.0 := 0.0;
- ELE_START : float range 0.0..99_999.0;
- ELE_SIZE : float range 0.0..99_999.0;
- MS_INDEX : ms_num_type;
-
- begin
- -- reset subsystem totals
- SS_TOT_SIZE := 0.0;
- SS_TOT_DONE := 0.0;
- SS_TOT_START := 0.0;
- SS_SIZE := (others => 0.0);
- SS_DONE := (others => 0.0);
- SS_START := (others => 0.0);
-
- -- set through each subsystem list and calculate each element
- start_walk(SS_PTR.element_list);
- loop
- walk(SS_PTR.element_list, ELE_PTR, END_LIST);
- exit when END_LIST;
- MS_INDEX := ELE_PTR.milestone_num;
-
- -- compute the size of this element (original or current)
- if ORIG_OR_CUR = CURRENT then
- ELE_START := float(ELE_PTR.size_done_at_start);
- ELE_SIZE := float(ELE_PTR.current_size) - ELE_START;
- elsif (ELE_PTR.original_size >= ELE_PTR.current_size)
- or (ELE_PTR.current_size = 0) then
- ELE_START := float(ELE_PTR.size_done_at_start);
- ELE_SIZE := float(ELE_PTR.original_size) - ELE_START;
- else
- ELE_START := float(ELE_PTR.original_size) *
- float(ELE_PTR.size_done_at_start) / float(ELE_PTR.current_size);
- ELE_SIZE := float(ELE_PTR.original_size) - ELE_START;
- end if;
-
- -- add the amount to the running totals for the subsystem
- SS_TOT_SIZE := SS_TOT_SIZE + ELE_SIZE * ELE_PTR.complexity;
- SS_TOT_START := SS_TOT_START + ELE_START * ELE_PTR.complexity;
-
- -- calculate the amount of work done for each activity in the subsystem
- -- and for each milestone
- start_walk(AC_LIST);
- AC_INDEX := 0;
- loop
- walk(AC_LIST, AC_PTR, END_LIST);
- exit when END_LIST;
- AC_INDEX := AC_INDEX + 1;
- SIZE := ELE_PTR.complexity * ELE_SIZE * AC_PTR.percent_tot_proj / 100.0;
- START := ELE_PTR.complexity * ELE_START * AC_PTR.percent_tot_proj / 100.0;
- DONE := SIZE * AC_PCT_VALUE(ELE_PTR.activity_completeness(AC_INDEX)) / 100.0;
- SS_SIZE(AC_INDEX) := SS_SIZE(AC_INDEX) + SIZE;
- SS_START(AC_INDEX) := SS_START(AC_INDEX) + START;
- SS_DONE(AC_INDEX) := SS_DONE(AC_INDEX) + DONE;
- MS_SIZE(MS_INDEX) := MS_SIZE(MS_INDEX) + SIZE;
- MS_DONE(MS_INDEX) := MS_DONE(MS_INDEX) + DONE;
- end loop;
- end loop;
-
- -- calculate the total amount of work done
- for AC_INDEX in 1..num_of_activities loop
- SS_TOT_DONE := SS_TOT_DONE + SS_DONE(AC_INDEX);
- end loop;
- exception
- when others => put_line("exception raised in GET_SS_TOTALS.");
- end GET_SS_TOTALS;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --rcomments.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- separate(TRACKER.REPORT_GENERATOR)
- procedure PRINT_COMMENTS is
- ----------------------------------------------------------------------
- --|
- --| NAME: PRINT_COMMENTS
- --|
- --| OVERVIEW:
- --| This procedure asks for the name of the comments file and copies
- --| the contents of the comments file to the tracker report file.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- --|
- ----------------------------------------------------------------------
-
- a_char : character := ' '; -- y or n
- dotted_line : string(1..132) := ( others => '=' );
-
- begin
- -- determine if a comments file exists
- put_line(" Do you have a comments file that you would ");
- put_line(" like to include? ");
- put(" [Y or N, default=N] : ");
- if end_of_line then -- default = n
- skip_line;
- else
- get( a_char );
- skip_line;
- if a_char = 'y' or a_char = 'Y' then
- put("Please enter the name of the comments file : ");
- get_line( comments_filename,filename_lngth);
- new_line;
- open( comments_file, in_file, comments_filename, "");
-
- -- print heading to report file
- new_page( report_file );
- set_col( report_file, 58 );
- put_line( report_file, "TRACKER COMMENTS" );
- put_line( report_file, dotted_line );
-
- -- copy the comments file to the report file
- while not end_of_file( comments_file ) loop
- get_line( comments_file, line, line_lngth );
- put_line( report_file, line(1..line_lngth) );
- end loop;
- close( comments_file);
- end if;
- end if;
- exception
- when NAME_ERROR =>
- put(" Error opening "); put(comments_filename(1..filename_lngth)); new_line;
- put_line(" File does not exist. ");
- delay 1.5;
- raise;
- when others =>
- put(" Error opening "); put(comments_filename(1..filename_lngth)); new_line;
- put_line(" File does not exist. ");
- delay 1.5;
- raise NAME_ERROR;
- end PRINT_COMMENTS;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --rdatedone.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- separate(TRACKER.report_generator)
- procedure COMPLETION_DATE_FOR_MS is
- ----------------------------------------------------------------------
- --|
- --| NAME: COMPLETION_DATE_FOR_MS
- --|
- --| OVERVIEW:
- --| This report is a matrix showing the finsh date of each person in
- --| relation to each defined milestone. The personnel are represented
- --| on the x-axis and the milestones on the y-axis. There are four
- --| possible values for a date : "...." means the person is not assigned
- --| to any elements with that milestone, "99/99/99" means the person did
- --| not have enough time to finish his work, "DONE" means the person has
- --| completed all work assigned to him on this milestone, otherwise, a
- --| calculated completion date will appear. The data in the report
- --| includes the date each person will complete a milestone, the latest
- --| date each person will finish all work, the latest date each of the
- --| milestones will be finished, and the date that the milestone is due.
- --| If more than 10 people are assigned to the project, the Completion
- --| Date for Milestone report is repeated until all people have been
- --| included on a report.
- --|
- --| EXCEPTIONS HANDLED:
- --| others error message printed and execution continues
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- --|
- ----------------------------------------------------------------------
-
- use CALENDAR;
- use AC_LIST_PKG; use EL_LIST_PKG; use MS_LIST_PKG; use PR_LIST_PKG;
-
- HEADER1 : string (1..132) := (others => ' ');
- HEADER2 : string (1..132) := (others => ' ');
- HEADER_LINES : string (1..132) := (others => ' ');
-
- END_LIST : boolean := false;
- MAX_PR_ON_PAGE : constant integer := 10;
- MS_PTR : milestone_pointer;
- PR_INITIALS : array (1..num_of_people) of pr_init_type
- := (others => " ");
- PR_INDEX : integer := 0;
- PR_PTR : personnel_pointer;
- START_PR : integer := 1;
- STOP_PR : integer := num_of_people;
- TITLE : constant string := "COMPLETION DATE FOR MILESTONES";
- DATE_DONE : array (1..num_of_people) of date_type
- := (others => null_date);
- TOT_DATE_DONE : array (1..num_of_people) of date_type
- := (others => null_date);
- WORK_IS_LEFT : array (1..num_of_people) of boolean := (others => false);
- WORK_IS_LEFT_TOT: array (1..num_of_people) of boolean := (others => false);
- MS_WORK_LEFT : boolean := false;
- TOT_WORK_LEFT : boolean := false;
- PREV_DATE_DONE : date_type := null_date;
- MS_DATE_DONE : date_type := null_date;
- MS_TOT_DATE_DONE: date_type := null_date;
-
- procedure CALC_DATE_TOTALS is separate;
- procedure INIT_DATE_HEADERS is separate;
- procedure PRINT_A_DATE (A_DATE : in date_type;
- ANY_WORK_LEFT : in boolean := true) is separate;
- procedure PRINT_MS_DATES is separate;
- procedure PRINT_TOT_MS_DATES is separate;
-
- begin
- -- initialize the initials array
- start_walk(PR_LIST);
- PR_INDEX := 0;
- loop
- walk (PR_LIST, PR_PTR, END_LIST);
- exit when END_LIST;
- PR_INDEX := PR_INDEX + 1;
- PR_INITIALS(PR_INDEX) := PR_PTR.initials;
- end loop;
-
-
- -- print out the report, only 10 personnel will fit on a page
- loop
- if STOP_PR - START_PR >= MAX_PR_ON_PAGE then
- STOP_PR := START_PR + MAX_PR_ON_PAGE - 1;
- else
- STOP_PR := num_of_people;
- end if;
- INIT_DATE_HEADERS;
- START_PAGE(TITLE,"",HEADER1,HEADER2,HEADER_LINES);
-
- -- print out each milestone's completion dates
- start_walk(MS_LIST);
- loop
- walk(MS_LIST, MS_PTR, END_LIST);
- exit when END_LIST;
- CALC_DATE_TOTALS;
- PRINT_MS_DATES;
- end loop;
- PRINT_TOT_MS_DATES;
-
- START_PR := START_PR + MAX_PR_ON_PAGE;
- exit when START_PR > num_of_people;
- end loop;
-
- exception
- when others => put_line("exception raised in LIST BY MILESTONE REPORT");
- end COMPLETION_DATE_FOR_MS;
-
-
-
- separate(TRACKER.report_generator.COMPLETION_DATE_FOR_MS)
- procedure INIT_DATE_HEADERS is
- ----------------------------------------------------------------------
- --| NAME: INIT_DATE_HEADERS
- --|
- --| OVERVIEW:
- --| This procedure initializes all the headers of the completion
- --| dates by milestone report.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- ----------------------------------------------------------------------
-
- DASHES : constant string(1..15) := (others => '-');
-
- begin
- HEADER1 := (others => ' ');
- HEADER2 := (others => ' ');
- HEADER_LINES := (others => ' ');
-
- HEADER1(2..6) := "MILE-";
- HEADER1(102..109) := "PREVIOUS";
- HEADER1(114..120) := "CURRENT";
- HEADER1(127..129) := "DUE";
-
- HEADER2(2..6) := "STONE";
- HEADER2(101..110) := "COMPL DATE";
- HEADER2(113..122) := "COMPL DATE";
- HEADER2(127..130) := "DATE";
-
- HEADER_LINES (2..6) := DASHES(1..5);
- HEADER_LINES (101..110) := DASHES(1..10);
- HEADER_LINES (113..122) := DASHES(1..10);
- HEADER_LINES (125..132) := DASHES(1..8);
-
- -- insert the person's initials into the headers
- for PR in 0 .. STOP_PR - START_PR loop
- HEADER2(12+PR*9..13+PR*9) := PR_INITIALS(PR+START_PR);
- HEADER_LINES(9+PR*9..16+PR*9) := DASHES(1..8);
- end loop;
- end INIT_DATE_HEADERS;
-
-
-
- separate(TRACKER.report_generator.COMPLETION_DATE_FOR_MS)
- procedure CALC_DATE_TOTALS is
- ----------------------------------------------------------------------
- --|
- --| NAME: CALC_DATE_TOTALS
- --|
- --| OVERVIEW:
- --| This procedure calculates the total amount of time left by
- --| MILESTONE and by person.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- --|
- ----------------------------------------------------------------------
-
- END_LIST : boolean := false;
- ELE_PTR : element_pointer;
- PR_INDEX : integer := 0;
- PR_PTR : personnel_pointer;
-
- begin
- WORK_IS_LEFT := (others => false);
- MS_WORK_LEFT := false;
- DATE_DONE := (others => null_date);
- PREV_DATE_DONE := null_date;
- MS_DATE_DONE := null_date;
-
- PR_INDEX := 0;
- start_walk(PR_LIST);
- loop
- walk(PR_LIST, PR_PTR, END_LIST);
- exit when END_LIST;
- PR_INDEX := PR_INDEX + 1;
-
- -- find the latest completion date for each element that has
- -- this milestone and this person
- start_walk(PR_PTR.element_list);
- loop
- walk(PR_PTR.element_list, ELE_PTR, END_LIST);
- exit when END_LIST;
-
- if (ELE_PTR.milestone_num = MS_PTR.number) then
- -- check if the current date done should be updated
- if ELE_PTR.more_than_one_person then
- for AC_INDEX in 1..num_of_activities loop
- if (ELE_PTR.people_initials(AC_INDEX) = PR_PTR.initials) and
- ((ELE_PTR.dates_done(AC_INDEX) = underflow_date) or
- (DATE_DONE(pr_index) = null_date) or
- (ELE_PTR.dates_done(AC_INDEX) > DATE_DONE(pr_index)) ) then
- DATE_DONE(pr_index) := ELE_PTR.dates_done(AC_INDEX);
- WORK_IS_LEFT(pr_index) := WORK_IS_LEFT(pr_index) or
- (ELE_PTR.hours_left(AC_INDEX) > 0.0);
- MS_WORK_LEFT := MS_WORK_LEFT or WORK_IS_LEFT(pr_index);
- end if;
- end loop;
- -- check if the total milestone completion date should be updated
- if ELE_PTR.date_done > MS_DATE_DONE then
- MS_DATE_DONE := ELE_PTR.date_done;
- end if;
- elsif (ELE_PTR.date_done = underflow_date) or
- (DATE_DONE(pr_index) = null_date) or
- (ELE_PTR.date_done > DATE_DONE(pr_index)) then
- DATE_DONE(pr_index) := ELE_PTR.date_done;
- -- check if the total milestone completion date should be updated
- if ELE_PTR.date_done > MS_DATE_DONE then
- MS_DATE_DONE := ELE_PTR.date_done;
- end if;
- WORK_IS_LEFT(pr_index) := WORK_IS_LEFT(pr_index) or
- (ELE_PTR.hours_to_complete > 0.0);
- MS_WORK_LEFT := MS_WORK_LEFT or WORK_IS_LEFT(pr_index);
- end if;
- -- update the milestone's previous date done
- if (ELE_PTR.prev_date_done = underflow_date) or
- (PREV_DATE_DONE = null_date) or
- (ELE_PTR.prev_date_done > PREV_DATE_DONE) then
- PREV_DATE_DONE := ELE_PTR.prev_date_done;
- end if;
- end if;
- end loop;
-
- -- update the grand total work_is_remaining flag for each person
- WORK_IS_LEFT_TOT(pr_index) := WORK_IS_LEFT_TOT(pr_index) or
- WORK_IS_LEFT(pr_index);
- TOT_WORK_LEFT := TOT_WORK_LEFT or WORK_IS_LEFT_TOT(pr_index);
-
- -- update the grand total date done by person
- if (DATE_DONE(pr_index) = underflow_date) or
- (TOT_DATE_DONE(pr_index) = null_date) or
- (DATE_DONE(pr_index) > TOT_DATE_DONE(pr_index)) then
- TOT_DATE_DONE(pr_index) := DATE_DONE(pr_index);
- if TOT_DATE_DONE(pr_index) > MS_TOT_DATE_DONE then
- MS_TOT_DATE_DONE := TOT_DATE_DONE(pr_index);
- end if;
- end if;
- end loop;
- end CALC_DATE_TOTALS;
-
-
-
- separate(TRACKER.report_generator.COMPLETION_DATE_FOR_MS)
- procedure PRINT_A_DATE (A_DATE : in date_type;
- ANY_WORK_LEFT : in boolean := true) is
- ----------------------------------------------------------------------
- --| NAME: PRINT_A_DATE
- --|
- --| OVERVIEW:
- --| This procedure prints a date to the report_file. The string
- --| "...." is printed for a null date and the string "99/99/99"
- --| is printed for an underflow date. If the date is neither an overflow
- --| date or a null date, the ANY_WORK_LEFT flag is checked to see if this
- --| entity is actually completed (ANY_WORK_LEFT = false), and a "DONE"
- --| printed instead of the actual completion date.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- ----------------------------------------------------------------------
-
- begin
- if A_DATE = null_date then
- put(report_file, " .... ");
- elsif A_DATE = underflow_date then
- put(report_file, "99/99/99");
- elsif not ANY_WORK_LEFT then
- put(report_file, " DONE ");
- else
- put(report_file, A_DATE.month,2); put(report_file, '/');
- put(report_file, A_DATE.day,2); put(report_file, '/');
- put(report_file, A_DATE.year mod 100,2);
- end if;
- end PRINT_A_DATE;
-
-
-
- separate(TRACKER.report_generator.COMPLETION_DATE_FOR_MS)
- procedure PRINT_MS_DATES is
- ----------------------------------------------------------------------
- --|
- --| NAME: PRINT_MS_DATES
- --|
- --| OVERVIEW:
- --| This procedure prints a milestone completion date line. This line
- --| includes the date complete for each person in the range
- --| START_PR..STOP_PR. If a person is not assigned to an element,
- --| in the milestone, a "...." is printed. If there is not enough time
- --| for the person to finish working on the milestone, "99/99/99" is
- --| printed. If the person is finished working on the mileston, "DONE"
- --| is printed. Otherwise the completion date is printed.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- --|
- ----------------------------------------------------------------------
-
- begin
- -- print out this milestone
- set_col(report_file, 3); put(report_file, MS_PTR.number,3);
- set_col(report_file, 9);
- for PR_INDEX in START_PR .. STOP_PR loop
- PRINT_A_DATE (DATE_DONE(pr_index), WORK_IS_LEFT(pr_index));
- put(report_file," ");
- end loop;
-
- -- output milestone total dates
- set_col(report_file, 102); PRINT_A_DATE(PREV_DATE_DONE);
- set_col(report_file, 114); PRINT_A_DATE(MS_DATE_DONE, MS_WORK_LEFT);
- set_col(report_file, 125); PRINT_A_DATE(MS_PTR.due_date);
- new_line(report_file);
- end PRINT_MS_DATES;
-
-
-
- separate(TRACKER.report_generator.COMPLETION_DATE_FOR_MS)
- procedure PRINT_TOT_MS_DATES is
- ----------------------------------------------------------------------
- --| NAME: PRINT_TOT_MS_DATES
- --|
- --| OVERVIEW:
- --| This procedure prints the total milestone completion date line. This
- --| line includes the date complete for each person in the range
- --| START_PR..STOP_PR. If a person is not assigned to an element,
- --| a "...." is printed. If there is not enough time to complete the
- --| milestone, "99/99/99" is printed. If the person is finished, "DONE"
- --| is printed, otherwise the completion date is printed.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- ----------------------------------------------------------------------
-
- begin
- -- output total dates
- set_col(report_file, 9); put(report_file, HEADER_LINES(9..132));
- new_line(report_file);
- set_col(report_file, 2); put(report_file, "TOTAL:");
- set_col(report_file, 9);
- for PR_INDEX in START_PR .. STOP_PR loop
- PRINT_A_DATE (TOT_DATE_DONE(pr_index), WORK_IS_LEFT_TOT(pr_index));
- put(report_file," ");
- end loop;
-
- set_col(report_file, 114); PRINT_A_DATE(MS_TOT_DATE_DONE, TOT_WORK_LEFT);
- new_line(report_file,2);
- end PRINT_TOT_MS_DATES;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --rlistel.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- separate(TRACKER.report_generator)
- procedure ALL_ELMNT_STATUS_REP is
- ----------------------------------------------------------------------
- --| NAME: ALL_ELMNT_STATUS_REP
- --|
- --| OVERVIEW:
- --| This report lists all of the element data, including the total
- --| original size, the total current size, and the average complexity.
- --|
- --| EXCEPTIONS HANDLED:
- --| others an error message is printed and execution continues
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- ----------------------------------------------------------------------
-
- use AC_LIST_PKG; use EL_LIST_PKG;
-
- DASHES : string (1..15) := (others => '-');
- HEADER1 : string (1..132) := (others => ' ');
- HEADER2 : string (1..132) := (others => ' ');
- HEADER_LINES : string (1..132) := (others => ' ');
-
- AC_INDEX : integer := 0;
- AC_PTR : activity_pointer;
- END_LIST : boolean := false;
- ELE_COUNT : integer := 0;
- ELE_PTR : element_pointer;
- LINE_COUNT : integer := 0;
- TITLE : constant string := "ALL ELEMENT STATUS REPORT";
- TOT_CURRNT : integer range 0..9_999_999 := 0;
- TOT_EQ_NEW : integer range 0..9_999_999 := 0;
- TOT_ORIG : integer range 0..9_999_999 := 0;
- TOT_CPXY : float := 0.0;
-
- procedure INIT_EL_HEADERS is separate;
- procedure PRINT_EL is separate;
-
- begin
- INIT_EL_HEADERS;
-
- START_PAGE(TITLE,"",HEADER1,HEADER2,HEADER_LINES);
- start_walk(EL_LIST);
- WALK_ELEMENTS:
- loop
- walk(EL_LIST, ELE_PTR, END_LIST);
- if END_LIST then
- -- end of list, write out totals
- if (ELE_COUNT > 0) then
- set_col(report_file, 90); put(report_file, HEADER_LINES(90..132));
- new_line(report_file);
- set_col(report_file, 74); put(report_file, "TOTALS");
- set_col(report_file, 90); put(report_file, TOT_ORIG,7);
- set_col(report_file, 99); put(report_file, TOT_CURRNT,7);
- set_col(report_file, 108); put(report_file, TOT_EQ_NEW,7);
- if ELE_COUNT > 0 then
- set_col(report_file, 127);
- put(report_file, TOT_CPXY/float(ELE_COUNT),2,3,0);
- end if;
- new_line(report_file);
- end if;
- exit WALK_ELEMENTS;
- end if;
-
- -- update running totals
- ELE_COUNT := ELE_COUNT + 1;
- TOT_CURRNT := TOT_CURRNT + ELE_PTR.current_size;
- TOT_EQ_NEW := TOT_EQ_NEW - ELE_PTR.size_done_at_start + ELE_PTR.current_size;
- TOT_ORIG := TOT_ORIG + ELE_PTR.original_size;
- TOT_CPXY := TOT_CPXY + ELE_PTR.complexity;
-
- PRINT_EL;
-
- -- check to see if another page is needed
- LINE_COUNT := LINE_COUNT + 1;
- if LINE_COUNT >= MAX_DATA_LINES-2 then
- START_PAGE(TITLE,"",HEADER1,HEADER2,HEADER_LINES);
- LINE_COUNT := 0;
- end if;
- end loop WALK_ELEMENTS;
- exception
- when others => put_line("exception raised in ALL ELEMENT STATUS REPORT");
- end ALL_ELMNT_STATUS_REP;
-
-
-
-
- separate(TRACKER.report_generator.ALL_ELMNT_STATUS_REP)
-
- procedure INIT_EL_HEADERS is
- ----------------------------------------------------------------------
- --| NAME: INIT_EL_HEADERS
- --|
- --| OVERVIEW:
- --| This report initializes the headers for the All Element Status
- --| report.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- ----------------------------------------------------------------------
-
- begin
- -- initialize the headers
- HEADER1(68..83) := "** ACTIVITIES **";
- HEADER1(90..96) := "ORIGINL";
- HEADER1(99..105) := "CURRENT";
- HEADER1(108..114) := "EQ. NEW";
- HEADER1(117..124) := "SIZE LST";
-
- HEADER2(2..3) := "MS";
- HEADER2(5..6) := "PR";
- HEADER2(8..16) := "SUBSYSTEM";
- HEADER2(20..30) := "DESCRIPTION";
- HEADER2(56..60) := "ABREV";
- HEADER2(63..64) := "RP";
- HEADER2(90..93) := "SIZE";
- HEADER2(99..102) := "SIZE";
- HEADER2(108..111) := "SIZE";
- HEADER2(117..124) := "VERIFIED";
- HEADER2(127..132) := "COMPXY";
-
- HEADER_LINES (2..3) := DASHES(1..2);
- HEADER_LINES (5..6) := DASHES(1..2);
- HEADER_LINES (8..16) := DASHES(1..9);
- HEADER_LINES (20..30) := DASHES(1..11);
- HEADER_LINES (56..61) := DASHES(1..6);
- HEADER_LINES (63..64) := DASHES(1..2);
- HEADER_LINES (90..96) := DASHES(1..7);
- HEADER_LINES (99..105) := DASHES(1..7);
- HEADER_LINES (108..114) := DASHES(1..7);
- HEADER_LINES (117..124) := DASHES(1..8);
- HEADER_LINES (127..132) := DASHES(1..6);
-
- -- initialize the header for the activity data
- start_walk(AC_LIST);
- AC_INDEX := 0;
- loop
- walk (AC_LIST, AC_PTR, END_LIST);
- exit when END_LIST;
- HEADER2(67+2*AC_INDEX) := AC_PTR.name(1);
- HEADER_LINES(67+2*AC_INDEX) := '-';
- AC_INDEX := AC_INDEX + 1;
- end loop;
- end INIT_EL_HEADERS;
-
-
- separate(TRACKER.report_generator.ALL_ELMNT_STATUS_REP)
- procedure PRINT_EL is
- ----------------------------------------------------------------------
- --| NAME: PRINT_EL
- --|
- --| OVERVIEW:
- --| This report prints out an element to the report file. If the
- --| element has more than one person assigned to it, one additional
- --| line is printed for each extra person. This line lists only the
- --| initials of the person assigned and the percent complete by
- --| activity. If the person is not assigned to a particular activity,
- --| a '*' is printed in that column.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- ----------------------------------------------------------------------
-
- ALL_PR_PRINTED : constant array (1..num_of_activities) of boolean
- := (others => true);
- PR_PRINTING_DONE : array (1..num_of_activities) of boolean
- := (others => false);
- NEXT_PERSON : integer range 1..num_of_activities := 1;
- DONE : boolean := true;
-
- begin
- set_col(report_file, 2); put(report_file, ELE_PTR.milestone_num,2);
- set_col(report_file, 5); put(report_file, ELE_PTR.priority,2);
- set_col(report_file, 8); put(report_file, ELE_PTR.subsystem_name);
- set_col(report_file, 20); put(report_file, ELE_PTR.description);
- set_col(report_file, 56); put(report_file, ELE_PTR.desc_key);
- if not ELE_PTR.more_than_one_person then
- set_col(report_file, 63); put(report_file, ELE_PTR.person_initials);
- set_col(report_file, 67);
- for AC_INDEX in 1..NUM_OF_ACTIVITIES loop
- put(report_file, convert(ELE_PTR.activity_completeness(AC_INDEX)));
- put(report_file,' ');
- end loop;
- else -- print out the first person assigned
- set_col(report_file, 63);
- put(report_file, ELE_PTR.people_initials(1) );
- set_col(report_file, 67);
- for AC_INDEX in 1..NUM_OF_ACTIVITIES loop
- if ELE_PTR.people_initials(AC_INDEX) = ELE_PTR.people_initials(1) then
- put(report_file, convert(ELE_PTR.activity_completeness(AC_INDEX)));
- put(report_file,' ');
- PR_PRINTING_DONE(AC_INDEX) := true;
- else
- put(report_file, "* ");
- end if;
- end loop;
- end if;
- set_col(report_file, 91); put(report_file, ELE_PTR.original_size,6);
- set_col(report_file, 100); put(report_file, ELE_PTR.current_size,6);
- set_col(report_file, 109);
- put(report_file, ELE_PTR.current_size - ELE_PTR.size_done_at_start,6);
- set_col(report_file, 117);
- put(report_file, ELE_PTR.date_size_verified.month,2);
- put(report_file,'/');
- put(report_file, ELE_PTR.date_size_verified.day,2);
- put(report_file,'/');
- put(report_file, ELE_PTR.date_size_verified.year mod 100,2);
- set_col(report_file, 127); put(report_file, ELE_PTR.complexity,2,3,0);
- new_line(report_file);
-
- -- print out additional lines if the element is assigned to more than
- -- one person
- if ELE_PTR.more_than_one_person then
- loop
- DONE := true;
- for AC_INDEX in 1..num_of_activities loop
- DONE := DONE and PR_PRINTING_DONE(AC_INDEX);
- end loop;
- exit when DONE;
-
- -- find the next person to be printed
- NEXT_PERSON := 1;
- while PR_PRINTING_DONE (NEXT_PERSON) loop
- NEXT_PERSON := NEXT_PERSON + 1;
- end loop;
- set_col(report_file, 63);
- put(report_file, ELE_PTR.people_initials(NEXT_PERSON) );
-
- -- print out the activity percent complete for this person
- set_col(report_file, 67);
- for AC_INDEX in 1..NUM_OF_ACTIVITIES loop
- if ELE_PTR.people_initials(AC_INDEX) =
- ELE_PTR.people_initials(NEXT_PERSON) then
- put(report_file, convert(ELE_PTR.activity_completeness(AC_INDEX)));
- put(report_file,' ');
- PR_PRINTING_DONE(AC_INDEX) := true;
- else
- put(report_file, "* ");
- end if;
- end loop;
-
- LINE_COUNT := LINE_COUNT + 1;
- new_line(report_file);
- end loop;
- end if;
- PR_PRINTING_DONE := (others => false);
- end PRINT_EL;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --rlistms.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- separate(TRACKER.report_generator)
- procedure LIST_BY_MILESTONE is
- ----------------------------------------------------------------------
- --| NAME: LIST_BY_MILESTONE
- --|
- --| OVERVIEW:
- --| One report is produced for each milestone which lists all the
- --| elements belonging to that milestone. The element data includes
- --| the remaining man-hours of work to complete each entity, the total
- --| original size, the total current size, the average complexity,
- --| and the total remaining man-hours of work to complete each
- --| milestone.
- --|
- --| EXCEPTIONS HANDLED:
- --| others an error message is printed and execution continues
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- ----------------------------------------------------------------------
-
- use AC_LIST_PKG; use EL_LIST_PKG; use MS_LIST_PKG; use CALENDAR;
-
- HEADER1 : string (1..132) := (others => ' ');
- HEADER2 : string (1..132) := (others => ' ');
- HEADER_LINES : string (1..132) := (others => ' ');
-
- AC_INDEX : integer := 0;
- AC_PTR : activity_pointer;
- DATE_STRING: string (1..8) := " / / ";
- END_LIST : boolean := false;
- ELE_COUNT : integer := 0;
- ELE_IN_MS : integer := 0;
- ELE_PTR : element_pointer;
- LINE_COUNT : integer := 0;
- MS_INDEX : integer := 0;
- MS_PTR : milestone_pointer;
- MS_STRING : string (1..2) := " ";
- TITLE : constant string := "LIST BY MILESTONE REPORT";
- TOT_CURRNT : integer range 0..9_999_999 := 0;
- TOT_EQ_NEW : integer range 0..9_999_999 := 0;
- TOT_ORIG : integer range 0..9_999_999 := 0;
- TOT_CPXY : float := 0.0;
- TOT_HOURS : float := 0.0;
-
- procedure INIT_HEADERS is separate;
- procedure PRINT_AN_ELEMENT is separate;
- procedure PRINT_MS_TOTAL is separate;
-
- begin
- INIT_HEADERS;
-
- start_walk(MS_LIST);
- loop
- walk(MS_LIST, MS_PTR, END_LIST);
- exit when END_LIST;
- LINE_COUNT := 0;
-
- -- create the subtitle string
- put (MS_STRING, MS_PTR.NUMBER);
- if MS_PTR.due_date = null_date then
- START_PAGE(TITLE, "Milestone # " & MS_STRING & " is due on a null date"
- & " -- " & MS_PTR.description ,HEADER1,HEADER2,HEADER_LINES);
- else
- put (DATE_STRING(1..2), MS_PTR.due_date.month);
- put (DATE_STRING(4..5), MS_PTR.due_date.day);
- put (DATE_STRING(7..8), MS_PTR.due_date.year mod 100);
- START_PAGE(TITLE, "Milestone # " & MS_STRING & " is due " & DATE_STRING
- & " -- " & MS_PTR.description ,HEADER1,HEADER2,HEADER_LINES);
- end if;
- start_walk(MS_PTR.element_list);
- ELE_IN_MS := 0;
- loop
- walk(MS_PTR.element_list, ELE_PTR, END_LIST);
-
- -- if end of list, print out totals
- if END_LIST then
- if (ELE_IN_MS > 0) then
- PRINT_MS_TOTAL;
- end if;
- exit;
- end if;
-
- -- update running totals
- ELE_COUNT := ELE_COUNT + 1;
- TOT_CURRNT := TOT_CURRNT + ELE_PTR.current_size;
- TOT_EQ_NEW := TOT_EQ_NEW - ELE_PTR.size_done_at_start + ELE_PTR.current_size;
- TOT_ORIG := TOT_ORIG + ELE_PTR.original_size;
- TOT_CPXY := TOT_CPXY + ELE_PTR.complexity;
- TOT_HOURS := TOT_HOURS + ELE_PTR.hours_to_complete;
-
- PRINT_AN_ELEMENT;
-
- ELE_IN_MS := ELE_IN_MS + 1;
- LINE_COUNT := LINE_COUNT + 1;
- if LINE_COUNT >= MAX_DATA_LINES-2 then
- if MS_PTR.due_date = null_date then
- START_PAGE(TITLE, "Milestone # " & MS_STRING & " is due on a null date"
- & " -- " & MS_PTR.description ,HEADER1,HEADER2,HEADER_LINES);
- else
- START_PAGE(TITLE, "Milestone # " & MS_STRING & " is due " & DATE_STRING
- & " -- " & MS_PTR.description ,HEADER1,HEADER2,HEADER_LINES);
- end if;
- LINE_COUNT := 0;
- end if;
- end loop;
- end loop;
- exception
- when others => put_line("exception raised in LIST BY MILESTONE REPORT");
- end LIST_BY_MILESTONE;
-
-
-
- separate(TRACKER.report_generator.LIST_BY_MILESTONE)
- procedure INIT_HEADERS is
- ----------------------------------------------------------------------
- --| NAME: INIT_HEADERS
- --|
- --| OVERVIEW:
- --| This procedure initializes all the headers of this List by
- --| Milestone Report.
- --|
- --| EXCEPTIONS HANDLED:
- --| others an error message is printed and execution continues
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- ----------------------------------------------------------------------
-
- DASHES : string (1..15) := (others => '-');
-
- begin
- -- initialize the headers
- HEADER1(65..80) := "** ACTIVITIES **";
- HEADER1(84..90) := "ORIGINL";
- HEADER1(93..99) := "CURRENT";
- HEADER1(102..108) := "EQ. NEW";
- HEADER1(110..117) := "SIZE LST";
- HEADER1(126..132) := "MAN-HRS";
-
- HEADER2(2..3) := "PR";
- HEADER2(5..13) := "SUBSYSTEM";
- HEADER2(17..27) := "DESCRIPTION";
- HEADER2(53..57) := "ABREV";
- HEADER2(60..61) := "RP";
- HEADER2(85..88) := "SIZE";
- HEADER2(94..97) := "SIZE";
- HEADER2(103..106) := "SIZE";
- HEADER2(110..117) := "VERIFIED";
- HEADER2(119..124) := "COMPXY";
- HEADER2(126..132) := "TO COMP";
-
- HEADER_LINES (2..3) := DASHES (1..2);
- HEADER_LINES (5..13) := DASHES (1..9);
- HEADER_LINES (17..27) := DASHES (1..11);
- HEADER_LINES (53..58) := DASHES (1..6);
- HEADER_LINES (60..61) := DASHES (1..2);
- HEADER_LINES (84..90) := DASHES (1..7);
- HEADER_LINES (93..99) := DASHES (1..7);
- HEADER_LINES (102..108) := DASHES (1..7);
- HEADER_LINES (110..117) := DASHES (1..8);
- HEADER_LINES (119..124) := DASHES (1..6);
- HEADER_LINES (126..132) := DASHES (1..7);
-
- -- initialize the header for the activity data
- start_walk(AC_LIST);
- AC_INDEX := 0;
- loop
- walk (AC_LIST, AC_PTR, END_LIST);
- exit when END_LIST;
- HEADER2(64+2*AC_INDEX) := AC_PTR.name(1);
- HEADER_LINES(64+2*AC_INDEX) := '-';
- AC_INDEX := AC_INDEX + 1;
- end loop;
- exception
- when others => put_line("exception raise in MS INIT_HEADERS");
- end INIT_HEADERS;
-
-
-
- separate(TRACKER.report_generator.LIST_BY_MILESTONE)
- procedure PRINT_AN_ELEMENT is
- ----------------------------------------------------------------------
- --| NAME: PRINT_AN_ELEMENT
- --|
- --| OVERVIEW:
- --| This procedure prints out an element line. This line of data
- --| includes the remaining man-hours of work to complete this
- --| element, the original size, the current size, the complexity, and
- --| the remaining man-hours of work to completion.
- --|
- --| EXCEPTIONS HANDLED:
- --| others an error message is printed and execution continues
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- ----------------------------------------------------------------------
-
- ALL_PR_PRINTED : constant array (1..num_of_activities) of boolean
- := (others => true);
- PR_PRINTING_DONE : array (1..num_of_activities) of boolean
- := (others => false);
- NEXT_PERSON : integer range 1..num_of_activities := 1;
- DONE : boolean := true;
-
- begin
- -- print out element
- set_col(report_file, 2); put(report_file, ELE_PTR.priority,2);
- set_col(report_file, 5); put(report_file, ELE_PTR.subsystem_name);
- set_col(report_file, 17); put(report_file, ELE_PTR.description);
- set_col(report_file, 53); put(report_file, ELE_PTR.desc_key);
- if not ELE_PTR.more_than_one_person then
- set_col(report_file, 60); put(report_file, ELE_PTR.person_initials);
- set_col(report_file, 64);
- for AC_INDEX in 1..NUM_OF_ACTIVITIES loop
- put(report_file, convert(ELE_PTR.activity_completeness(AC_INDEX)));
- put(report_file,' ');
- end loop;
- else -- print out the first person assigned
- set_col(report_file, 60);
- put(report_file, ELE_PTR.people_initials(1) );
- set_col(report_file, 64);
- for AC_INDEX in 1..NUM_OF_ACTIVITIES loop
- if ELE_PTR.people_initials(AC_INDEX) = ELE_PTR.people_initials(1) then
- put(report_file, convert(ELE_PTR.activity_completeness(AC_INDEX)));
- put(report_file,' ');
- PR_PRINTING_DONE(AC_INDEX) := true;
- else
- put(report_file, "* ");
- end if;
- end loop;
- end if;
- set_col(report_file, 85); put(report_file, ELE_PTR.original_size,6);
- set_col(report_file, 94); put(report_file, ELE_PTR.current_size,6);
- set_col(report_file, 103);
- put(report_file, ELE_PTR.current_size - ELE_PTR.size_done_at_start,6);
- set_col(report_file, 110);
- put(report_file, ELE_PTR.date_size_verified.month,2);
- put(report_file,'/');
- put(report_file, ELE_PTR.date_size_verified.day,2);
- put(report_file,'/');
- put(report_file, ELE_PTR.date_size_verified.year mod 100,2);
- set_col(report_file, 119); put(report_file, ELE_PTR.complexity,3,2,0);
- set_col(report_file, 126); put(report_file, ELE_PTR.hours_to_complete,5,1,0);
- new_line(report_file);
-
- -- print out additional lines if the element is assigned to more than
- -- one person
- if ELE_PTR.more_than_one_person then
- loop
- DONE := true;
- for AC_INDEX in 1..num_of_activities loop
- DONE := DONE and PR_PRINTING_DONE(AC_INDEX);
- end loop;
- exit when DONE;
-
- -- find the next person to be printed
- NEXT_PERSON := 1;
- while PR_PRINTING_DONE (NEXT_PERSON) loop
- NEXT_PERSON := NEXT_PERSON + 1;
- end loop;
- set_col(report_file, 60);
- put(report_file, ELE_PTR.people_initials(NEXT_PERSON) );
-
- -- print out the activity percent complete for this person
- set_col(report_file, 64);
- for AC_INDEX in 1..NUM_OF_ACTIVITIES loop
- if ELE_PTR.people_initials(AC_INDEX) =
- ELE_PTR.people_initials(NEXT_PERSON) then
- put(report_file, convert(ELE_PTR.activity_completeness(AC_INDEX)));
- put(report_file,' ');
- PR_PRINTING_DONE(AC_INDEX) := true;
- else
- put(report_file, "* ");
- end if;
- end loop;
-
- LINE_COUNT := LINE_COUNT + 1;
- new_line(report_file);
- end loop;
- end if;
- PR_PRINTING_DONE := (others => false);
- exception
- when others => put_line("exception raised in MS PRINT_AN_ELEMENT");
- end PRINT_AN_ELEMENT;
-
-
- separate(TRACKER.report_generator.LIST_BY_MILESTONE)
- procedure PRINT_MS_TOTAL is
- ----------------------------------------------------------------------
- --| NAME: PRINT_MS_TOTAL
- --|
- --| OVERVIEW:
- --| This procedure prints out the total statics for a milestone. This
- --| includes the total remaining man-hours of work to complete this
- --| milestone, the total original size, the total current size, and
- --| the average complexity.
- --|
- --| EXCEPTIONS HANDLED:
- --| others an error message is printed and execution continues
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- ----------------------------------------------------------------------
-
- begin
- -- underline columns
- set_col(report_file, 84); put(report_file, HEADER_LINES(84..132));
- new_line(report_file);
-
- -- print totals
- set_col(report_file, 74); put(report_file, "TOTALS");
- set_col(report_file, 84); put(report_file, TOT_ORIG,7);
- set_col(report_file, 93); put(report_file, TOT_CURRNT,7);
- set_col(report_file, 102); put(report_file, TOT_EQ_NEW,7);
- if ELE_IN_MS > 0 then
- set_col(report_file, 119);
- put(report_file, TOT_CPXY/float(ELE_COUNT),3,2,0);
- end if;
- set_col(report_file, 125); put(report_file, TOT_HOURS,6,1,0);
- new_line(report_file);
-
- -- reset counters
- ELE_COUNT := 0;
- TOT_CURRNT := 0;
- TOT_EQ_NEW := 0;
- TOT_ORIG := 0;
- TOT_CPXY := 0.0;
- TOT_HOURS := 0.0;
- exception
- when others => put_line("exception raised in PRINT_MS_TOTAL");
- end PRINT_MS_TOTAL;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --rlistpr.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- separate(TRACKER.report_generator)
- procedure LIST_BY_PERSON is
- ----------------------------------------------------------------------
- --|
- --| NAME: LIST_BY_PERSON
- --|
- --| OVERVIEW:
- --| One report is printed for each person on the project. Each report
- --| lists all the elements assigned to that person. The report includes
- --| information listed in the List by Milestone Report and also the date
- --| each element is due (its milestone due date) and the calculated
- --| finish date for each element. The finish date for each element was
- --| computed previously by CALC_TIME_DONE and stored in the element data.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- --|
- ----------------------------------------------------------------------
-
- use CALENDAR;
- use AC_LIST_PKG; use EL_LIST_PKG; use PR_LIST_PKG;
-
- HEADER1 : string (1..132) := (others => ' ');
- HEADER2 : string (1..132) := (others => ' ');
- HEADER_LINES : string (1..132) := (others => ' ');
-
- AC_INDEX : integer := 0;
- AC_PTR : activity_pointer;
- END_LIST : boolean := false;
- ELE_COUNT : integer := 0;
- ELE_IN_PR : integer := 0;
- ELE_PTR : element_pointer;
- LINE_COUNT : integer := 0;
- PR_INDEX : integer := 0;
- PR_PTR : personnel_pointer;
- TITLE : constant string := "LIST BY PERSON REPORT";
- TOT_CURRNT : integer range 0..9_999_999 := 0;
- TOT_EQ_NEW : integer range 0..9_999_999 := 0;
- TOT_ORIG : integer range 0..9_999_999 := 0;
- TOT_CPXY : float := 0.0;
- TOT_HOURS : float := 0.0;
-
- procedure INIT_PR_HEADERS is separate;
- procedure PRINT_PR_ELEMENT is separate;
- procedure PRINT_PR_TOTAL is separate;
-
- begin
- INIT_PR_HEADERS;
-
- start_walk(PR_LIST);
- loop
- walk(PR_LIST, PR_PTR, END_LIST);
- exit when END_LIST;
- LINE_COUNT := 0;
-
- -- create the subtitle string
- START_PAGE(TITLE,PR_PTR.name,HEADER1,HEADER2,HEADER_LINES);
- start_walk(PR_PTR.element_list);
- ELE_IN_PR := 0;
- loop
- walk(PR_PTR.element_list, ELE_PTR, END_LIST);
-
- -- if end of list, print out totals
- if END_LIST then
- if (ELE_IN_PR > 0) then
- PRINT_PR_TOTAL;
- end if;
- exit;
- end if;
-
- -- update running totals
- ELE_COUNT := ELE_COUNT + 1;
- TOT_CURRNT := TOT_CURRNT + ELE_PTR.current_size;
- TOT_EQ_NEW := TOT_EQ_NEW - ELE_PTR.size_done_at_start + ELE_PTR.current_size;
- TOT_ORIG := TOT_ORIG + ELE_PTR.original_size;
- TOT_CPXY := TOT_CPXY + ELE_PTR.complexity;
- TOT_HOURS := TOT_HOURS + ELE_PTR.hours_to_complete;
-
- PRINT_PR_ELEMENT;
-
- ELE_IN_PR := ELE_IN_PR + 1;
- LINE_COUNT := LINE_COUNT + 1;
- if LINE_COUNT >= MAX_DATA_LINES-2 then
- START_PAGE(TITLE,PR_PTR.name,HEADER1,HEADER2,HEADER_LINES);
- LINE_COUNT := 0;
- end if;
- end loop;
- end loop;
- exception
- when others => put_line("exception raised in LIST BY PERSON REPORT");
- end LIST_BY_PERSON;
-
-
-
- separate(TRACKER.report_generator.LIST_BY_PERSON)
- procedure INIT_PR_HEADERS is
- ----------------------------------------------------------------------
- --|
- --| NAME: INIT_PR_HEADERS
- --|
- --| OVERVIEW:
- --| This procedure initializes all the headers of this person report.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- --|
- ----------------------------------------------------------------------
-
- DASHES : constant string (1..15) := (others => '-');
- begin
- -- initialize the headers
- HEADER1(65..80) := "** ACTIVITIES **";
- HEADER1(84..87) := "ORIG";
- HEADER1(90..95) := "CURRNT";
- HEADER1(97..102) := "EQ NEW";
- HEADER1(108..114) := "MAN-HRS";
- HEADER1(117..122) := "FINISH";
- HEADER1(127..129) := "DUE";
-
- HEADER2(2..3) := "MS";
- HEADER2(5..6) := "PR";
- HEADER2(8..16) := "SUBSYSTEM";
- HEADER2(19..29) := "DESCRIPTION";
- HEADER2(55..59) := "ABREV";
- HEADER2(84..87) := "SIZE";
- HEADER2(91..94) := "SIZE";
- HEADER2(98..101) := "SIZE";
- HEADER2(104..106) := "CPX";
- HEADER2(108..114) := "TO COMP";
- HEADER2(118..121) := "DATE";
- HEADER2(127..130) := "DATE";
- HEADER_LINES (2..3) := DASHES(1..2);
- HEADER_LINES (5..6) := DASHES(1..2);
- HEADER_LINES (8..16) := DASHES(1..9);
- HEADER_LINES (19..29) := DASHES(1..11);
- HEADER_LINES (55..59) := DASHES(1..5);
- HEADER_LINES (83..88) := DASHES(1..6);
- HEADER_LINES (90..95) := DASHES(1..6);
- HEADER_LINES (97..102) := DASHES(1..6);
- HEADER_LINES (104..106) := DASHES(1..3);
- HEADER_LINES (108..114) := DASHES(1..7);
- HEADER_LINES (116..123) := DASHES(1..8);
- HEADER_LINES (125..132) := DASHES(1..8);
-
- -- initialize the header for the activity data
- start_walk(AC_LIST);
- AC_INDEX := 0;
- loop
- walk (AC_LIST, AC_PTR, END_LIST);
- exit when END_LIST;
- HEADER2(63+2*AC_INDEX) := AC_PTR.name(1);
- HEADER_LINES(63+2*AC_INDEX) := '-';
- AC_INDEX := AC_INDEX + 1;
- end loop;
- end INIT_PR_HEADERS;
-
-
-
- separate(TRACKER.report_generator.LIST_BY_PERSON)
- procedure PRINT_PR_ELEMENT is
- ----------------------------------------------------------------------
- --|
- --| NAME: PRINT_PR_ELEMENT
- --|
- --| OVERVIEW:
- --| This procedure prints out an element line. This line includes the
- --| element data plus the remaining man-hours of work to complete this
- --| element, the original size, the current size, the complexity,
- --| the remaining man-hours of work to complete this element, the due
- --| date and the projected completion date.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- --|
- ----------------------------------------------------------------------
-
- use MS_LIST_PKG;
-
- FOUND : boolean := false;
- MS_PTR : milestone_pointer;
-
- begin
- -- print out element
- set_col(report_file, 2); put(report_file, ELE_PTR.milestone_num,2);
- set_col(report_file, 5); put(report_file, ELE_PTR.priority,2);
- set_col(report_file, 8); put(report_file, ELE_PTR.subsystem_name);
- set_col(report_file, 19); put(report_file, ELE_PTR.description);
- set_col(report_file, 55); put(report_file, ELE_PTR.desc_key);
- set_col(report_file, 63);
- if not ELE_PTR.more_than_one_person then
- for AC_INDEX in 1..NUM_OF_ACTIVITIES loop
- put(report_file, convert(ELE_PTR.activity_completeness(AC_INDEX)));
- put(report_file,' ');
- end loop;
- else -- print out the first person assigned
- for AC_INDEX in 1..NUM_OF_ACTIVITIES loop
- if ELE_PTR.people_initials(AC_INDEX) = PR_PTR.initials then
- put(report_file, convert(ELE_PTR.activity_completeness(AC_INDEX)));
- put(report_file,' ');
- else
- put(report_file, "* ");
- end if;
- end loop;
- end if;
- set_col(report_file, 83); put(report_file, ELE_PTR.original_size,6);
- set_col(report_file, 90); put(report_file, ELE_PTR.current_size,6);
- set_col(report_file, 97);
- put(report_file, ELE_PTR.current_size - ELE_PTR.size_done_at_start,6);
- set_col(report_file, 104); put(report_file, ELE_PTR.complexity,1,1,0);
- set_col(report_file, 108); put(report_file, ELE_PTR.hours_to_complete,5,1,0);
- set_col(report_file, 116);
- if ELE_PTR.date_done = underflow_date then
- put(report_file, "99/99/99");
- elsif (ELE_PTR.hours_to_complete = 0.0) or
- (ELE_PTR.date_done = null_date) then
- put(report_file, " DONE ");
- else
- put(report_file, ELE_PTR.date_done.month,2); put(report_file,'/');
- put(report_file, ELE_PTR.date_done.day,2); put(report_file,'/');
- put(report_file, ELE_PTR.date_done.year mod 100,2);
- end if;
- find (MS_LIST, ELE_PTR.milestone_num, MS_PTR, FOUND);
- set_col(report_file, 125);
- if MS_PTR.due_date = null_date then
- put(report_file, " 0/ 0/ 0");
- else
- put(report_file, MS_PTR.due_date.month,2); put(report_file,'/');
- put(report_file, MS_PTR.due_date.day,2); put(report_file,'/');
- put(report_file, MS_PTR.due_date.year mod 100,2);
- end if;
- new_line(report_file);
- end PRINT_PR_ELEMENT;
-
-
- separate(TRACKER.report_generator.LIST_BY_PERSON)
- procedure PRINT_PR_TOTAL is
- ----------------------------------------------------------------------
- --|
- --| NAME: PRINT_PR_TOTAL
- --|
- --| OVERVIEW:
- --| This procedure prints out the total statics for the person. This
- --| includes the total remaining man-hours of work to complete this
- --| milestone, the total original size, the total current size, and
- --| the average complexity.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- --|
- ----------------------------------------------------------------------
-
- begin
- -- underline columns
- set_col(report_file, 84); put(report_file, HEADER_LINES(84..132));
- new_line(report_file);
-
- -- print totals
- set_col(report_file, 74); put(report_file, "TOTALS");
- set_col(report_file, 83); put(report_file, TOT_ORIG,6);
- set_col(report_file, 90); put(report_file, TOT_CURRNT,6);
- set_col(report_file, 97); put(report_file, TOT_EQ_NEW,6);
- if ELE_IN_PR > 0 then
- set_col(report_file, 104);
- put(report_file, TOT_CPXY/float(ELE_COUNT),1,1,0);
- end if;
- set_col(report_file, 107);
- put(report_file, TOT_HOURS,6,1,0);
- new_line(report_file);
-
- -- reset counters
- ELE_COUNT := 0;
- TOT_CURRNT := 0;
- TOT_EQ_NEW := 0;
- TOT_ORIG := 0;
- TOT_CPXY := 0.0;
- TOT_HOURS := 0.0;
- end PRINT_PR_TOTAL;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --rlistss.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- separate(TRACKER.report_generator)
- procedure LIST_BY_SUBSYSTEM is
- ----------------------------------------------------------------------
- --| NAME: LIST_BY_SUBSYSTEM
- --|
- --| OVERVIEW:
- --| A separate report is printed for each subsystem. All of the element
- --| data for each subsystem is displayed including the remaining man-hours
- --| of work to complete each element, the total original size, the total
- --| current size, the average complexity, and the total remaining man-hours
- --| of work to complete each subsystem.
- --|
- --| EXCEPTIONS HANDLED:
- --| others an error message is printed and execution continues
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- ----------------------------------------------------------------------
-
- use AC_LIST_PKG; use EL_LIST_PKG; use SS_LIST_PKG;
-
- HEADER1 : string (1..132) := (others => ' ');
- HEADER2 : string (1..132) := (others => ' ');
- HEADER_LINES : string (1..132) := (others => ' ');
-
- AC_INDEX : integer := 0;
- AC_PTR : activity_pointer;
- END_LIST : boolean := false;
- ELE_COUNT : integer := 0;
- ELE_IN_SS : integer := 0;
- ELE_PTR : element_pointer;
- LINE_COUNT : integer := 0;
- SS_INDEX : integer := 0;
- SS_PTR : SUBSYSTEM_pointer;
- TITLE : constant string := "LIST BY SUBSYSTEM REPORT";
- TOT_CURRNT : integer range 0..9_999_999 := 0;
- TOT_EQ_NEW : integer range 0..9_999_999 := 0;
- TOT_ORIG : integer range 0..9_999_999 := 0;
- TOT_CPXY : float := 0.0;
- TOT_HOURS : float := 0.0;
-
- procedure INIT_SS_HEADERS is separate;
- procedure PRINT_SS_ELEMENT is separate;
- procedure PRINT_SS_TOTAL is separate;
-
- begin
- INIT_SS_HEADERS;
-
- start_walk(SS_LIST);
- loop
- walk(SS_LIST, SS_PTR, END_LIST);
- exit when END_LIST;
- LINE_COUNT := 0;
-
- -- create the subtitle string
- START_PAGE(TITLE,SS_PTR.name,HEADER1,HEADER2,HEADER_LINES);
-
- -- print out each subsystem's list of elements
- start_walk(SS_PTR.element_list);
- ELE_IN_SS := 0;
- loop
- walk(SS_PTR.element_list, ELE_PTR, END_LIST);
- -- if end of list, print out totals
- if END_LIST then
- if (ELE_IN_SS > 0) then
- PRINT_SS_TOTAL;
- end if;
- exit;
- end if;
-
- -- update running totals
- ELE_COUNT := ELE_COUNT + 1;
- TOT_CURRNT := TOT_CURRNT + ELE_PTR.current_size;
- TOT_EQ_NEW := TOT_EQ_NEW - ELE_PTR.size_done_at_start + ELE_PTR.current_size;
- TOT_ORIG := TOT_ORIG + ELE_PTR.original_size;
- TOT_CPXY := TOT_CPXY + ELE_PTR.complexity;
- TOT_HOURS := TOT_HOURS + ELE_PTR.hours_to_complete;
-
- PRINT_SS_ELEMENT;
-
- ELE_IN_SS := ELE_IN_SS + 1;
- LINE_COUNT := LINE_COUNT + 1;
- if LINE_COUNT >= MAX_DATA_LINES-2 then
- START_PAGE(TITLE,SS_PTR.name,HEADER1,HEADER2,HEADER_LINES);
- LINE_COUNT := 0;
- end if;
- end loop;
- end loop;
- exception
- when others => put_line("exception raised in LIST BY SUBSYSTEM REPORT");
- end LIST_BY_SUBSYSTEM;
-
-
-
- separate(TRACKER.report_generator.LIST_BY_SUBSYSTEM)
- procedure INIT_SS_HEADERS is
- ----------------------------------------------------------------------
- --| NAME: INIT_SS_HEADERS
- --|
- --| OVERVIEW:
- --| This procedure initializes all the headers of this subsystem report.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- ----------------------------------------------------------------------
-
- DASHES : constant string(1..15) := (others => '-');
-
- begin
- -- initialize the headers
- HEADER1(59..74) := "** ACTIVITIES **";
- HEADER1(81..87) := "ORIGINL";
- HEADER1(90..96) := "CURRENT";
- HEADER1(99..105) := "EQ. NEW";
- HEADER1(108..115) := "SIZE LST";
- HEADER1(126..132) := "MAN-HRS";
-
- HEADER2(2..3) := "MS";
- HEADER2(5..6) := "PR";
- HEADER2(8..18) := "DESCRIPTION";
- HEADER2(46..50) := "ABREV";
- HEADER2(54..55) := "RP";
- HEADER2(81..84) := "SIZE";
- HEADER2(90..93) := "SIZE";
- HEADER2(99..102) := "SIZE";
- HEADER2(108..115) := "VERIFIED";
- HEADER2(118..123) := "COMPXY";
- HEADER2(126..132) := "TO COMP";
-
- HEADER_LINES (2..3) := DASHES(1..2);
- HEADER_LINES (5..6) := DASHES(1..2);
- HEADER_LINES (8..18) := DASHES(1..11);
- HEADER_LINES (46..50) := DASHES(1..5);
- HEADER_LINES (54..55) := DASHES(1..2);
- HEADER_LINES (81..87) := DASHES(1..7);
- HEADER_LINES (90..96) := DASHES(1..7);
- HEADER_LINES (99..105) := DASHES(1..7);
- HEADER_LINES (108..115) := DASHES(1..8);
- HEADER_LINES (118..123) := DASHES(1..6);
- HEADER_LINES (126..132) := DASHES(1..7);
-
- -- initialize the header for the activity data
- start_walk(AC_LIST);
- AC_INDEX := 0;
- loop
- walk (AC_LIST, AC_PTR, END_LIST);
- exit when END_LIST;
- HEADER2(58+2*AC_INDEX) := AC_PTR.name(1);
- HEADER_LINES(58+2*AC_INDEX) := '-';
- AC_INDEX := AC_INDEX + 1;
- end loop;
- end INIT_SS_HEADERS;
-
-
-
-
- separate(TRACKER.report_generator.LIST_BY_SUBSYSTEM)
- procedure PRINT_SS_ELEMENT is
- ----------------------------------------------------------------------
- --| NAME: PRINT_SS_ELEMENT
- --|
- --| OVERVIEW:
- --| This procedure prints out an element line. This line includes the
- --| element data, the remaining man-hours of work to complete this
- --| element, the original size, the current size, the complexity, and
- --| the remaining man-hours of work until completion.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- ----------------------------------------------------------------------
-
- ALL_PR_PRINTED : constant array (1..num_of_activities) of boolean
- := (others => true);
- PR_PRINTING_DONE : array (1..num_of_activities) of boolean
- := (others => false);
- NEXT_PERSON : integer range 1..num_of_activities := 1;
- DONE : boolean := true;
-
- begin
- -- print out element
- set_col(report_file, 2); put(report_file, ELE_PTR.milestone_num,2);
- set_col(report_file, 5); put(report_file, ELE_PTR.priority,2);
- set_col(report_file, 8); put(report_file, ELE_PTR.description);
- set_col(report_file, 46); put(report_file, ELE_PTR.desc_key);
- -- if the element has more than one person assigned to it, print out
- -- the first person
- if not ELE_PTR.more_than_one_person then
- set_col(report_file, 54); put(report_file, ELE_PTR.person_initials);
- set_col(report_file, 58);
- for AC_INDEX in 1..NUM_OF_ACTIVITIES loop
- put(report_file, convert(ELE_PTR.activity_completeness(AC_INDEX)));
- put(report_file,' ');
- end loop;
- else -- print out the first person assigned
- set_col(report_file, 54);
- put(report_file, ELE_PTR.people_initials(1) );
- set_col(report_file, 58);
- for AC_INDEX in 1..NUM_OF_ACTIVITIES loop
- if ELE_PTR.people_initials(AC_INDEX) = ELE_PTR.people_initials(1) then
- put(report_file, convert(ELE_PTR.activity_completeness(AC_INDEX)));
- put(report_file,' ');
- PR_PRINTING_DONE(AC_INDEX) := true;
- else
- put(report_file, "* ");
- end if;
- end loop;
- end if;
- set_col(report_file, 82); put(report_file, ELE_PTR.original_size,6);
- set_col(report_file, 91); put(report_file, ELE_PTR.current_size,6);
- set_col(report_file, 100);
- put(report_file, ELE_PTR.current_size - ELE_PTR.size_done_at_start,6);
- set_col(report_file, 108);
- put(report_file, ELE_PTR.date_size_verified.month,2);
- put(report_file,'/');
- put(report_file, ELE_PTR.date_size_verified.day,2);
- put(report_file,'/');
- put(report_file, ELE_PTR.date_size_verified.year mod 100,2);
- set_col(report_file, 118); put(report_file, ELE_PTR.complexity,3,2,0);
- set_col(report_file, 126); put(report_file, ELE_PTR.hours_to_complete,5,1,0);
-
-
- -- print out additional lines if the element is assigned to more than
- -- one person
- if ELE_PTR.more_than_one_person then
- loop
- DONE := true;
- for AC_INDEX in 1..num_of_activities loop
- DONE := DONE and PR_PRINTING_DONE(AC_INDEX);
- end loop;
- exit when DONE;
-
- -- find the next person to be printed
- NEXT_PERSON := 1;
- while PR_PRINTING_DONE (NEXT_PERSON) loop
- NEXT_PERSON := NEXT_PERSON + 1;
- end loop;
- set_col(report_file, 54);
- put(report_file, ELE_PTR.people_initials(NEXT_PERSON) );
-
- -- print out the activity percent complete for this person
- set_col(report_file, 58);
- for AC_INDEX in 1..NUM_OF_ACTIVITIES loop
- if ELE_PTR.people_initials(AC_INDEX) =
- ELE_PTR.people_initials(NEXT_PERSON) then
- put(report_file, convert(ELE_PTR.activity_completeness(AC_INDEX)));
- put(report_file,' ');
- PR_PRINTING_DONE(AC_INDEX) := true;
- else
- put(report_file, "* ");
- end if;
- end loop;
-
- LINE_COUNT := LINE_COUNT + 1;
- new_line(report_file);
- end loop;
- end if;
- PR_PRINTING_DONE := (others => false);
- end PRINT_SS_ELEMENT;
-
-
-
- separate(TRACKER.report_generator.LIST_BY_SUBSYSTEM)
- procedure PRINT_SS_TOTAL is
- ----------------------------------------------------------------------
- --| NAME: PRINT_SS_TOTAL
- --|
- --| OVERVIEW:
- --| This procedure prints out the total statics for a subsystem. This
- --| includes the total remaining man-hours of work to complete this
- --| subsystem, the total original size, the total current size, and
- --| the average complexity.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- ----------------------------------------------------------------------
-
- begin
- -- underline columns
- set_col(report_file, 81); put(report_file, HEADER_LINES(81..132));
- new_line(report_file);
-
- -- print totals
- set_col(report_file, 70); put(report_file, "TOTALS");
- set_col(report_file, 81); put(report_file, TOT_ORIG,7);
- set_col(report_file, 90); put(report_file, TOT_CURRNT,7);
- set_col(report_file, 99); put(report_file, TOT_EQ_NEW,7);
- if ELE_IN_SS > 0 then
- set_col(report_file, 118);
- put(report_file, TOT_CPXY/float(ELE_COUNT),3,2,0);
- end if;
- set_col(report_file, 125);
- put(report_file, TOT_HOURS,6,1,0);
- new_line(report_file);
-
- -- reset counters
- ELE_COUNT := 0;
- TOT_CURRNT := 0;
- TOT_EQ_NEW := 0;
- TOT_ORIG := 0;
- TOT_CPXY := 0.0;
- TOT_HOURS := 0.0;
- end PRINT_SS_TOTAL;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --rpage.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- separate(TRACKER.report_generator)
-
- procedure START_PAGE (TITLE, SUBTITLE, HEADER1, HEADER2, HEADER_LINES
- : in string := "") is
- ----------------------------------------------------------------------
- --|
- --| NAME: START_PAGE
- --|
- --| OVERVIEW:
- --| This routine starts the next report on a new page and prints the
- --| globalproject data on the report. It then centers the title and
- --| subtitle on the page. After leaving two blank lines, it prints
- --| the headers: HEADER1, HEADER2, and HEADER_LINES.
- --|
- --| EXCEPTIONS HANDLED:
- --| others an error message is printed and execution continues
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- --|
- ----------------------------------------------------------------------
-
- begin
- -- print out global information
- new_page(report_file);
- put(report_file, "Project Name: ");
- put(report_file, PROJECT_NAME); new_line(report_file, 2);
- put(report_file, "Project Manager: ");
- put(report_file, MANAGER_NAME); new_line(report_file, 2);
- put(report_file, "Status Date: "); put(report_file, DATE.month,2);
- put(report_file, "/"); put(report_file, DATE.day,2);
- put(report_file, "/"); put(report_file, DATE.year mod 100,2);
- new_line(report_file, 5);
-
- -- print out titles
- set_col(report_file,(128-TITLE'length)/2);
- put(report_file, "*** "); put(report_file, TITLE); put(report_file, " ***");
- new_line(report_file);
- set_col(report_file,(132-SUBTITLE'length)/2);
- put(report_file, SUBTITLE); new_line(report_file,3);
- put(report_file, HEADER1); new_line(report_file);
- put(report_file, HEADER2); new_line(report_file);
- put(report_file, HEADER_LINES); new_line(report_file);
- exception
- when others => put_line("exception raised in START PAGE");
- end START_PAGE;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --rparam.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- separate(TRACKER.report_generator)
-
- procedure PARAMETER_DATA_LIST is
- ----------------------------------------------------------------------
- --|
- --| NAME: PARAMETER_DATA_LIST
- --|
- --| OVERVIEW:
- --| This report prints all of the parameter data including global
- --| variables, activity data, milestone data, personnel data,
- --| subsystem data, and the milestone completion sequence.
- --|
- --| EXCEPTIONS HANDLED:
- --| others an error message is printed and execution continues
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- --|
- ----------------------------------------------------------------------
-
- use CALENDAR;
- use AC_LIST_PKG; use MS_LIST_PKG; use PR_LIST_PKG; use SS_LIST_PKG;
-
- BLANKS : constant string (1..30) := (others => ' ');
- DASHES : constant string (1..20) := (others => '-');
- END_LIST : boolean := false;
- MS_ON_LINE : integer := 0;
- NUM_OF_BLANKS : integer := 1;
-
- AC_PTR : activity_pointer;
- MS_PTR : milestone_pointer;
- PR_PTR : personnel_pointer;
- SS_PTR : subsystem_pointer;
-
- procedure PRINT_START_DATE (date : in date_type) is
- begin
- if date = null_date then
- put(report_file, " 0/ 0/ 0");
- else
- put(report_file, date.month,2); put(report_file, '/');
- put(report_file, date.day,2); put(report_file, '/');
- put(report_file, date.year,4);
- end if;
- end PRINT_START_DATE;
-
- procedure PRINT_STOP_DATE (date : in date_type) is
- begin
- if date = null_date then
- put(report_file, "99/99/99");
- else
- put(report_file, date.month,2); put(report_file, '/');
- put(report_file, date.day,2); put(report_file, '/');
- put(report_file, date.year,4);
- end if;
- end PRINT_STOP_DATE;
-
- begin
- -- print out global information
- put(report_file, "Project Name: ");
- put(report_file, PROJECT_NAME);
- put(report_file, " #");
- put(report_file, project_number,3);
- set_col(report_file, 80);
- put(report_file, "Status Date: "); put(report_file, DATE.month,2);
- put(report_file, "/"); put(report_file, DATE.day,2);
- put(report_file, "/"); put(report_file, DATE.year,4);
- new_line(report_file);
- put(report_file, "Project Manager: ");
- put(report_file, MANAGER_NAME); new_line(report_file);
-
- -- output total number of parameters
- put(report_file, "NUMBER OF ACTIVITIES : ");
- put(report_file, num_of_activities,4); new_line(report_File);
- put(report_file, "NUMBER OF MILESTONES : ");
- put(report_file, num_of_milestones,4); new_line(report_File);
- put(report_file, "NUMBER OF PERSONNEL : ");
- put(report_file, num_of_people,4); new_line(report_File);
- put(report_file, "NUMBER OF SUBSYSTEMS : ");
- put(report_file, num_of_subsystems,4); new_line(report_File);
- put(report_file, "NUMBER OF ELEMENTS : ");
- put(report_file, num_of_elements,4); new_line(report_File);
-
- -- output subsystem data
- new_line(report_file);
- set_col(report_file, 2); put(report_file, "SUBSYSTEM");
- set_col(report_file, 13); put(report_file, "% AVAILABLE AT START");
- new_line(report_file);
- set_col(report_file, 2); put(report_file, DASHES(1..9));
- set_col(report_file, 13); put(report_file, DASHES(1..20));
- new_line(report_file);
- start_walk (SS_LIST);
- loop
- walk (SS_LIST, SS_PTR, END_LIST);
- exit when END_LIST;
- put(report_file, SS_PTR.name);
- set_col(report_file, 20); put(report_file, SS_PTR.percent_at_start,3,2,0);
- put(report_file, '%');
- new_line(report_file);
- end loop;
-
- -- output personnel data
- new_line(report_file);
- set_col(report_file, 2); put(report_file, "PERSON'S NAME");
- set_col(report_file, 23); put(report_file, "INITIALS");
- set_col(report_file, 34); put(report_file, "RATE PER HOUR");
- set_col(report_file, 50); put(report_file, "HOURS PER WEEK");
- set_col(report_file, 67); put(report_file, "START DATE");
- set_col(report_file, 80); put(report_file, "STOP DATE");
- new_line(report_file);
- set_col(report_file, 2); put(report_file, DASHES(1..13));
- set_col(report_file, 23); put(report_file, DASHES(1..8));
- set_col(report_file, 34); put(report_file, DASHES(1..13));
- set_col(report_file, 50); put(report_file, DASHES(1..14));
- set_col(report_file, 67); put(report_file, DASHES(1..10));
- set_col(report_file, 80); put(report_file, DASHES(1..10));
- new_line(report_file);
- start_walk (PR_LIST);
- loop
- walk (PR_LIST, PR_PTR, END_LIST);
- exit when END_LIST;
- set_col(report_file, 2); put(report_file, PR_PTR.name);
- set_col(report_file, 26); put(report_file, PR_PTR.initials);
- set_col(report_file, 37); put(report_file, PR_PTR.production_rate,3,3,0);
- set_col(report_file, 55); put(report_file, PR_PTR.hours_per_week,4);
-
- -- write out all the start/stop dates for this person
- set_col(report_file, 67);
- print_start_date (PR_PTR.start_dates(PR_PTR.start_dates'first) );
- set_col (report_file, 80);
- print_stop_date (PR_PTR.stop_dates(PR_PTR.stop_dates'first) );
- new_line (report_file);
- for I in PR_PTR.start_dates'first+1..PR_PTR.start_dates'last loop
- if PR_PTR.start_dates(I) = null_date then
- exit; -- if there are no more start/stop dates, don't print them
- else
- set_col(report_file, 67);
- print_start_date (PR_PTR.start_dates(I) );
- set_col (report_file, 80);
- print_stop_date (PR_PTR.stop_dates(I) );
- new_line (report_file);
- end if;
- end loop;
- end loop;
-
- -- output activity data
- new_line(report_file);
- set_col(report_file, 2); put(report_file, "ACTIVITY NAME");
- set_col(report_file, 17); put(report_file, "% TOTAL PROJECT");
- set_col(report_file, 35); put(report_file, "PRIORITY");
- set_col(report_file, 46); put(report_file, "CONSIDERED");
- set_col(report_file, 59); put(report_file, "% AVAILABLE AT START");
- new_line(report_file);
- set_col(report_file, 2); put(report_file, DASHES(1..13));
- set_col(report_file, 17); put(report_file, DASHES(1..15));
- set_col(report_file, 35); put(report_file, DASHES(1..8));
- set_col(report_file, 46); put(report_file, DASHES(1..10));
- set_col(report_file, 59); put(report_file, DASHES(1..20));
- new_line(report_file);
- start_walk (AC_LIST);
- loop
- walk (AC_LIST, AC_PTR, END_LIST);
- exit when END_LIST;
- set_col(report_file, 2); put(report_file, AC_PTR.name);
- set_col(report_file, 21); put(report_file, AC_PTR.percent_tot_proj,3,2,0);
- put(report_file, '%');
- set_col(report_file, 37); put(report_file, AC_PTR.priority,3);
- set_col(report_file, 49);
- if AC_PTR.consider_in_calc then
- put(report_file, "YES");
- else
- put(report_file, "NO");
- end if;
- set_col(report_file, 59); put(report_file, AC_PTR.percent_at_start,3,2,0);
- put(report_file, '%');
- new_line(report_file);
- end loop;
-
- -- output the task numbers
- new_line(report_file);
- if num_of_activities > 2 then
- NUM_OF_BLANKS := NUM_OF_ACTIVITIES * 3 - 4;
- end if;
- put (report_file, BLANKS(1..NUM_OF_BLANKS) );
- put_line(report_file, "TASK NUMBERS");
- set_col(report_file, 2);
- start_walk (AC_LIST);
- loop
- walk (AC_LIST, AC_PTR, END_LIST);
- exit when END_LIST;
- put(report_file, AC_PTR.name(1..4));
- put (report_file, " ");
- end loop;
- new_line(report_file);
-
- set_col(report_file, 2);
- for AC_INDEX in 1..num_of_activities loop
- put (report_file, "---- ");
- end loop;
- new_line(report_file);
-
- start_walk (SS_LIST);
- loop
- walk(SS_LIST, SS_PTR, END_LIST);
- exit when END_LIST;
- set_col(report_file, 2);
- for AC_INDEX in 1..num_of_activities loop
- put (report_file, SS_PTR.task_numbers(AC_INDEX),4);
- put (report_file, " ");
- end loop;
- new_line(report_file);
- end loop;
-
- -- output milestone data
- new_line(report_file);
- set_col(report_file, 2); put(report_file, "MILESTONE");
- set_col(report_file, 14); put(report_file, "DUE DATE");
- set_col(report_file, 26); put(report_file, "DESCRIPTION");
- new_line(report_file);
- set_col(report_file, 2); put(report_file, DASHES(1..9));
- set_col(report_file, 13); put(report_file, DASHES(1..10));
- set_col(report_file, 26); put(report_file, DASHES(1..11));
- new_line(report_file);
- start_walk (MS_LIST);
- loop
- walk (MS_LIST, MS_PTR, END_LIST);
- exit when END_LIST;
- set_col(report_file, 4); put(report_file, MS_PTR.number,3);
- set_col(report_file, 13);
- if MS_PTR.due_date = null_date then
- put(report_file, " 0/ 0/ 0");
- else
- put(report_file, MS_PTR.due_date.month,2); put(report_file, '/');
- put(report_file, MS_PTR.due_date.day,2); put(report_file, '/');
- put(report_file, MS_PTR.due_date.year,4);
- end if;
- set_col(report_file, 26); put(report_file, MS_PTR.description);
- new_line(report_file);
- end loop;
-
- -- write out milestone completion sequence
- new_line(report_file, 2);
- set_col(report_file, 2); put(report_file, "MILESTONE COMPLETION SEQUENCE");
- new_line(report_file, 2);
- MS_ON_LINE := 0;
- start_walk (MS_LIST);
- loop
- walk (MS_LIST, MS_PTR, END_LIST);
- exit when END_LIST;
- MS_ON_LINE := MS_ON_LINE + 1;
- if MS_ON_LINE > 33 then
- MS_ON_LINE := 0;
- new_line(report_file);
- end if;
- put(report_file, ' '); put(report_file, MS_PTR.number, 2);
- end loop;
- new_line(report_file, 2);
-
- exception
- when others => put_line("exception raised in PARAMETER DATA LIST");
- end PARAMETER_DATA_LIST;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --rpctbyss.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- separate(TRACKER.report_generator)
- procedure PERCENT_COMPLETION (ORIG_OR_CUR : in ORIG_OR_CUR_TYPE;
- PCT_DONE : in PCT_DONE_TYPE) is
- ----------------------------------------------------------------------
- --|
- --| NAME: PERCENT_COMPLETION
- --|
- --| OVERVIEW:
- --| This report actually consists of two separate matrix reports. It
- --| shows the percentage complete of each activity in relation to each
- --| of the subsystems. One report is based on the original size and
- --| the other on the current size. The activities are represented on
- --| the x-axis and the subsystems on the y-axis. The data printed
- --| includes the percent completion of work for each activity by
- --| subsystem, the total percent completion on the contract for each
- --| activity and for each subsystem, the percent available at start for
- --| each subsystem and for each activity, and the percent completion of
- --| work for the entire project for each subsystem and activity.
- --|
- --| EXCEPTIONS HANDLED:
- --| others an error message is printed and execution continues
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- --|
- ----------------------------------------------------------------------
-
- use SS_LIST_PKG; use AC_LIST_PKG;
-
- HEADER1 : string (1..132) := (others => ' ');
- HEADER2 : string (1..132) := (others => ' ');
- HEADER_LINES : string (1..132) := (others => ' ');
-
- END_LIST : boolean := false;
- AC_PTR : activity_pointer;
- SS_INDEX : integer := 0;
- SS_PTR : subsystem_pointer;
- TITLE : string (1..54);
- TITLE_ORIG : constant string
- := "ORIGINAL ESTIMATE OF PERCENT COMPLETE WITHIN SUBSYSTEM";
- TITLE_CUR : constant string
- := "CURRENT ESTIMATE OF PERCENT COMPLETE WITHIN SUBSYSTEM ";
-
- procedure INIT_PCT_HEADERS is separate;
-
- begin
- INIT_PCT_HEADERS;
- if ORIG_OR_CUR = CURRENT then
- TITLE := TITLE_CUR;
- else
- TITLE := TITLE_ORIG;
- end if;
- START_PAGE(TITLE,"",HEADER1,HEADER2,HEADER_LINES);
-
- -- print out each line of the report
- start_walk(SS_LIST);
- loop
- walk(SS_LIST, SS_PTR, END_LIST);
- exit when END_LIST;
- SS_INDEX := SS_INDEX + 1;
-
- -- print out subsystem
- set_col(report_file, 2); put(report_file, SS_PTR.name);
- set_col(report_file, 14);
- for AC_INDEX in 1..num_of_activities loop
- put(report_file, PCT_DONE.BY_SS_AND_AC(SS_INDEX,AC_INDEX),3,2,0);
- put(report_file,"% ");
- end loop;
-
- -- print out totals for this subsystem
- set_col(report_file, 108);
- put(report_file, PCT_DONE.BY_SS(SS_INDEX),3,2,0); put(report_file,'%');
- set_col(report_file, 117);
- put(report_file, PCT_DONE.START_BY_SS(SS_INDEX),3,2,0); put(report_file,'%');
- set_col(report_file, 126);
- put(report_file, PCT_DONE.ENTIRE_BY_SS(SS_INDEX),3,2,0); put(report_file,'%');
- new_line(report_file);
- end loop;
-
- -- print out totals on contract by activity
- put(report_file, HEADER_LINES);
- new_line(report_file);
- set_col(report_file, 2); put(report_file, "TOTALS ON"); new_line(report_file);
- set_col(report_file, 2); put(report_file, "CONTRACT:");
- set_col(report_file, 14);
- for AC_INDEX in 1..num_of_activities loop
- put(report_file, PCT_DONE.BY_AC(AC_INDEX),3,2,0);
- put(report_file,"% ");
- end loop;
-
- -- print out grand totals for this subsystem
- set_col(report_file, 108);
- put(report_file, PCT_DONE.CONTRACT,3,2,0); put(report_file,'%');
- set_col(report_file, 117);
- put(report_file, PCT_DONE.START,3,2,0); put(report_file,'%');
- set_col(report_file, 126);
- put(report_file, PCT_DONE.ENTIRE,3,2,0); put(report_file,'%');
- new_line(report_file,2);
-
- -- print out totals at start by activity
- set_col(report_file, 2); put(report_file, "% AVAIL"); new_line(report_file);
- set_col(report_file, 2); put(report_file, "START:");
- set_col(report_file, 14);
- start_walk(AC_LIST);
- loop
- walk(AC_LIST, AC_PTR, END_LIST);
- exit when END_LIST;
- put(report_file, AC_PTR.percent_at_start,3,2,0);
- put(report_file,"% ");
- end loop;
- new_line(report_file,2);
-
- -- print out totals on entire project by activity
- set_col(report_file, 2); put(report_file, "% ENTIRE"); new_line(report_file);
- set_col(report_file, 2); put(report_file, "PROJECT:");
- set_col(report_file, 14);
- for AC_INDEX in 1..num_of_activities loop
- put(report_file, PCT_DONE.ENTIRE_BY_AC(AC_INDEX),3,2,0);
- put(report_file,"% ");
- end loop;
-
- exception
- when others => put_line("exception raised in PERCENT COMPLETION REPORT");
- end PERCENT_COMPLETION;
-
-
- separate(TRACKER.report_generator.percent_completion)
- procedure INIT_PCT_HEADERS is
- ----------------------------------------------------------------------
- --|
- --| NAME: INIT_PCT_HEADERS
- --|
- --| OVERVIEW:
- --| This procedure initalizes the headers for the Percent Complete
- --| by Subsystem Report.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- --|
- ----------------------------------------------------------------------
-
- DASHES : string (1..15) := (others => '-');
- AC_INDEX : integer := 0;
-
- begin
- -- initialize the headers
- HEADER1(108..113) := "% DONE";
- HEADER1(117..123) := "% AVAIL";
- HEADER1(126..132) := "%ENTIRE";
-
- HEADER2(2..10) := "SUBSYSTEM";
- HEADER2(108..115) := "CONTRACT";
- HEADER2(117..124) := "AT START";
- HEADER2(126..132) := "PROJECT";
-
- HEADER_LINES (2..10) := DASHES(1..9);
- HEADER_LINES (108..115) := DASHES(1..8);
- HEADER_LINES (117..124) := DASHES(1..8);
- HEADER_LINES (126..132) := DASHES(1..7);
-
- -- initialize the header for the activity data
- start_walk(AC_LIST);
- loop
- walk (AC_LIST, AC_PTR, END_LIST);
- exit when END_LIST;
- AC_INDEX := AC_INDEX + 1;
- HEADER2(5+9*AC_INDEX..11+9*AC_INDEX) := AC_PTR.name(1..7);
- HEADER_LINES(5+9*AC_INDEX..11+9*AC_INDEX) := DASHES(1..7);
- end loop;
-
- end INIT_PCT_HEADERS;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --rprinted.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- separate(TRACKER.REPORT_GENERATOR)
- procedure REPORTS_PRINTED_LIST is
- ----------------------------------------------------------------------
- --| NAME: REPORTS_PRINTED_LIST
- --|
- --| OVERVIEW:
- --| This procedure is not on the report menu, but is always the last
- --| report printed whenever two or more reports are output. The output
- --| of this report is simply a listing of all the reports printed in
- --| the current TRACKER run.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by May Lee March 1985
- ----------------------------------------------------------------------
-
- use VT100;
-
- dotted_line : string(1..132) := (others => '=');
- type rep_name is array(1..12) of string(1..50);
- report_name : rep_name;
-
- begin
- -- initialize the array of report names
- report_name(1) := " Parameter Data List ";
- report_name(2) := " Tracker Comments ";
- report_name(3) := " All Element Status Report ";
- report_name(4) := " List By Subsystem ";
- report_name(5) := " List By Milestone ";
- report_name(6) := " List By Person ";
- report_name(7) := " Subsystem Summary ";
- report_name(8) := " Milestone Summary ";
- report_name(9) := " Work Units Per Subsystem ";
- report_name(10) := " Percent Completion Of Work Within Subsystem ";
- report_name(11) := " Distribution Of Remaining Work Within Subsystems";
- report_name(12) := " Completion Date For Milestones ";
-
- -- print out the names of the reports printed
- new_page( report_file );
- set_col(report_file, 58); -- to center the title
- put_line(report_file, "REPORTS PRINTED");
- put(report_file, dotted_line);
- new_line(report_file,4);
- for i in 1..12 loop
- if VT100.print_report(i) then
- put(report_file, report_name(i));
- new_line(report_file);
- end if;
- end loop;
- end REPORTS_PRINTED_LIST;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --rsumms.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- separate(TRACKER.report_generator)
- procedure MILESTONE_SUMMARY is
- ----------------------------------------------------------------------
- --| NAME: MILESTONE_SUMMARY
- --|
- --| OVERVIEW:
- --| This report is a two dimensional matrix that presents a summary
- --| of the remaining man-hours of work for each person on the project
- --| in relation to each milestone. The personnel are on the x-axis
- --| and the milestones are on the y-axis. Calculations for man-hours
- --| are based upon current work units. The data printed includes
- --| remaining man-hours of work for each person by milestone, total
- --| remaining work in man-hours for each person, total remaining
- --| work in man-hours for each milestone, total remaining work for
- --| the entire project (sum of milestone totals), the percent complete
- --| for each milestone, and the percent complete for the entire project.
- --| If more than 10 people are assigned to the project, the Milestone
- --| Summary Report is repeated listin 10 people at a time until all
- --| people have been included on the report.
- --|
- --| EXCEPTIONS HANDLED:
- --| others an error message is printed and execution continues
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- ----------------------------------------------------------------------
-
- use AC_LIST_PKG; use EL_LIST_PKG; use MS_LIST_PKG; use PR_LIST_PKG;
-
- HEADER1 : string (1..132) := (others => ' ');
- HEADER2 : string (1..132) := (others => ' ');
- HEADER_LINES : string (1..132) := (others => ' ');
-
- END_LIST : boolean := false;
- MAX_PR_ON_PAGE : constant integer := 10;
- MS_INDEX : integer := 0;
- MS_PTR : MILESTONE_pointer;
- PR_INITIALS : array (1..num_of_people) of pr_init_type := (others => " ");
- PR_INDEX : integer := 0;
- PR_PTR : personnel_pointer;
- START_PR : integer := 1;
- STOP_PR : integer := num_of_people;
- TITLE : constant string := "MILESTONE SUMMARY REPORT";
- TIME_DONE : array (1..num_of_people) of float := (others => 0.0);
- TOT_TIME_DONE : array (1..num_of_people) of float := (others => 0.0);
- MS_TIME : float := 0.0;
- TOT_MS_TIME : float := 0.0;
-
- procedure CALC_SUMMS_TOTALS is separate;
- procedure INIT_SUMMS_HEADERS is separate;
- procedure PRINT_SUMMS is separate;
- procedure PRINT_SUMMS_TOTALS is separate;
-
- begin
- -- initialize the initials array
- start_walk(PR_LIST);
- PR_INDEX := 0;
- loop
- walk (PR_LIST, PR_PTR, END_LIST);
- exit when END_LIST;
- PR_INDEX := PR_INDEX + 1;
- PR_INITIALS(PR_INDEX) := PR_PTR.initials;
- end loop;
-
- -- print out each page of the report, only 10 personnel will fit on a page
- while START_PR <= num_of_people loop
- if STOP_PR - START_PR >= MAX_PR_ON_PAGE then
- STOP_PR := START_PR + MAX_PR_ON_PAGE - 1;
- else
- STOP_PR := num_of_people;
- end if;
- INIT_SUMMS_HEADERS;
- START_PAGE(TITLE,"",HEADER1,HEADER2,HEADER_LINES);
-
- -- print out each milestone's summary
- start_walk(MS_LIST);
- loop
- walk(MS_LIST, MS_PTR, END_LIST);
- exit when END_LIST;
- MS_INDEX := MS_INDEX + 1;
- CALC_SUMMS_TOTALS;
- PRINT_SUMMS;
- end loop;
- PRINT_SUMMS_TOTALS;
- START_PR := START_PR + MAX_PR_ON_PAGE;
- end loop;
- exception
- when others => put_line("exception raised in MILESTONE SUMMARY REPORT");
- end MILESTONE_SUMMARY;
-
-
-
- separate(TRACKER.report_generator.MILESTONE_SUMMARY)
- procedure INIT_SUMMS_HEADERS is
- ----------------------------------------------------------------------
- --| NAME: INIT_SUMMS_HEADERS
- --|
- --| OVERVIEW:
- --| This procedure initializes all the headers of the MILESTONE summary
- --| report.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- ----------------------------------------------------------------------
-
- DASHES : constant string(1..15) := (others => '-');
-
- begin
- HEADER1 := (others => ' ');
- HEADER2 := (others => ' ');
- HEADER_LINES := (others => ' ');
-
- -- initialize the headers
- HEADER1(115..121) := "MAN-HRS";
- HEADER1(125..131) := "PERCENT";
-
- HEADER2(2..10) := "MILESTONE";
- HEADER2(115..121) := "TO COMP";
- HEADER2(125..132) := "COMPLETE";
-
- HEADER_LINES (2..10) := DASHES(1..9);
- HEADER_LINES (115..121) := DASHES(1..7);
- HEADER_LINES (125..132) := DASHES(1..8);
-
- -- insert the person's initials into the headers
- for PR in 0 .. STOP_PR - START_PR loop
- HEADER2(16+PR*9..17+PR*9) := PR_INITIALS(PR+START_PR);
- HEADER_LINES(14+PR*9..20+PR*9) := DASHES(1..7);
- end loop;
- end INIT_SUMMS_HEADERS;
-
-
-
- separate(TRACKER.report_generator.MILESTONE_SUMMARY)
- procedure CALC_SUMMS_TOTALS is
- ----------------------------------------------------------------------
- --| NAME: CALC_SUMMS_TOTALS
- --|
- --| OVERVIEW:
- --| This procedure calculates the total amount of time left by
- --| MILESTONE and by person.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- ----------------------------------------------------------------------
-
- END_LIST : boolean := false;
- ELE_PTR : element_pointer;
- PR_INDEX : integer := 0;
- PR_PTR : personnel_pointer;
-
- begin
- TIME_DONE := (others => 0.0);
- MS_TIME := 0.0;
-
- -- find the totals for this milestone
- PR_INDEX := 0;
- start_walk(PR_LIST);
- loop
- walk(PR_LIST, PR_PTR, END_LIST);
- exit when END_LIST;
- PR_INDEX := PR_INDEX + 1;
-
- -- sum the time left to complete for each element that has
- -- this milestone and this person
- start_walk(PR_PTR.element_list);
- loop
- walk(PR_PTR.element_list, ELE_PTR, END_LIST);
- exit when END_LIST;
-
- if ELE_PTR.milestone_num = MS_PTR.number then
- if ELE_PTR.more_than_one_person then
- for AC_INDEX in 1..num_of_activities loop
- if ELE_PTR.people_initials(AC_INDEX) = PR_PTR.initials then
- TIME_DONE(PR_INDEX) := TIME_DONE(PR_INDEX) +
- ELE_PTR.hours_left(AC_INDEX);
- end if;
- end loop;
- else
- TIME_DONE(PR_INDEX) := TIME_DONE(PR_INDEX) + ELE_PTR.hours_to_complete;
- end if;
- end if;
-
- end loop;
- TOT_TIME_DONE(PR_INDEX) := TOT_TIME_DONE(PR_INDEX) + TIME_DONE(PR_INDEX);
- MS_TIME := MS_TIME + TIME_DONE(PR_INDEX);
- end loop;
- TOT_MS_TIME := TOT_MS_TIME + MS_TIME;
- end CALC_SUMMS_TOTALS;
-
-
-
- separate(TRACKER.report_generator.MILESTONE_SUMMARY)
- procedure PRINT_SUMMS is
- ----------------------------------------------------------------------
- --| NAME: PRINT_SUMMS
- --|
- --| OVERVIEW:
- --| This procedure prints out a milestone line. This line includes
- --| the amount of time needed to complete the milestone by person,
- --| the total time needed for the milestone, and the milestone's
- --| percent complete.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- ----------------------------------------------------------------------
-
- begin
- -- print out the milestone
- set_col(report_file, 5); put(report_file, MS_PTR.number,3);
- set_col(report_file, 14);
- for PR_INDEX in START_PR .. STOP_PR loop
- put(report_file, TIME_DONE(PR_INDEX),5,1,0);
- put(report_file," ");
- end loop;
-
- set_col(report_file, 115); put(report_file, MS_TIME,6,1,0);
- set_col(report_file, 125);
- put(report_file, CURRENT_PCT_DONE.BY_MS(MS_INDEX),3,2,0);
- put(report_file,'%'); new_line(report_file);
- end PRINT_SUMMS;
-
-
-
-
- separate(TRACKER.report_generator.MILESTONE_SUMMARY)
- procedure PRINT_SUMMS_TOTALS is
- ----------------------------------------------------------------------
- --| NAME: PRINT_SUMMS_TOTALS
- --|
- --| OVERVIEW:
- --| This procedure prints out the milestone totals. This data includes
- --| the total number of man-hours needed for each person to complete the
- --| project, the grand total man-hours left on the project, and the
- --| grand total percent complete on the project.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- ----------------------------------------------------------------------
-
- begin
- -- output totals
- set_col(report_file, 13); put_line(report_file, HEADER_LINES(13..132));
-
- set_col(report_file, 2); put(report_file, "TOTALS:");
- set_col(report_file, 13);
- for PR_INDEX in START_PR .. STOP_PR loop
- put(report_file, TOT_TIME_DONE(PR_INDEX),6,1,0);
- put(report_file," ");
- end loop;
-
- set_col(report_file, 115); put(report_file, TOT_MS_TIME,6,1,0);
- set_col(report_file, 125); put(report_file, CURRENT_PCT_DONE.CONTRACT,3,2,0);
- put(report_file,'%'); new_line(report_file);
- end PRINT_SUMMS_TOTALS;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --rsumss.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- separate(TRACKER.report_generator)
- procedure SUBSYSTEM_SUMMARY is
- ----------------------------------------------------------------------
- --| NAME: SUBSYSTEM_SUMMARY
- --|
- --| OVERVIEW:
- --| This report is a two dimensional matrix that presents a summary
- --| of the remaining man-hours of work for each person on the project
- --| in relation to each subsystem. The personnel are displayed on
- --| the x-axis and the subsytems on the y-axis. Man-hour calculations
- --| are based on current work units. The data printed includes
- --| remaining man-hours of work for each person by subsystem, the
- --| total remaining work in man-hours for each person, the total
- --| remaining work in man-hours to complete each subsystem, the total
- --| remaining work for the entire project (sum of subsystem totals),
- --| the percent complete for each subsystem, and the percent complete
- --| for the entire project. If more than 10 people are assigned to
- --| the project, the subsystem summary report is repeated listing 10
- --| people at a time until all people have been included on a report.
- --|
- --| EXCEPTIONS HANDLED:
- --| others an error message is printed and execution continues
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- ----------------------------------------------------------------------
-
- use AC_LIST_PKG; use EL_LIST_PKG; use SS_LIST_PKG; use PR_LIST_PKG;
-
- HEADER1 : string (1..132) := (others => ' ');
- HEADER2 : string (1..132) := (others => ' ');
- HEADER_LINES : string (1..132) := (others => ' ');
-
- END_LIST : boolean := false;
- MAX_PR_ON_PAGE : constant integer := 10;
- PR_INITIALS : array (1..num_of_people) of pr_init_type := (others => " ");
- PR_INDEX : integer := 0;
- PR_PTR : personnel_pointer;
- SS_INDEX : integer := 0;
- SS_PTR : subsystem_pointer;
- START_PR : integer := 1;
- STOP_PR : integer := num_of_people;
- TITLE : constant string := "SUBSYSTEM SUMMARY REPORT";
- TIME_DONE : array (1..num_of_people) of float := (others => 0.0);
- TOT_TIME_DONE : array (1..num_of_people) of float := (others => 0.0);
- SS_TIME : float := 0.0;
- TOT_SS_TIME : float := 0.0;
-
- procedure CALC_SUMSS_TOTALS is separate;
- procedure INIT_SUMSS_HEADERS is separate;
- procedure PRINT_SUMSS is separate;
- procedure PRINT_SUMSS_TOTALS is separate;
-
- begin
- -- initialize the initials array
- start_walk(PR_LIST);
- PR_INDEX := 0;
- loop
- walk (PR_LIST, PR_PTR, END_LIST);
- exit when END_LIST;
- PR_INDEX := PR_INDEX + 1;
- PR_INITIALS(PR_INDEX) := PR_PTR.initials;
- end loop;
-
- -- print out each page of the report, only 10 personnel will fit on a page
- while START_PR <= num_of_people loop
- if STOP_PR - START_PR >= MAX_PR_ON_PAGE then
- STOP_PR := START_PR + MAX_PR_ON_PAGE - 1;
- else
- STOP_PR := num_of_people;
- end if;
- INIT_SUMSS_HEADERS;
- START_PAGE(TITLE,"",HEADER1,HEADER2,HEADER_LINES);
-
- -- print out each subsystem's time left
- SS_INDEX := 0;
- start_walk(SS_LIST);
- loop
- SS_INDEX := SS_INDEX + 1;
- walk(SS_LIST, SS_PTR, END_LIST);
- exit when END_LIST;
- CALC_SUMSS_TOTALS;
- PRINT_SUMSS;
- end loop;
- PRINT_SUMSS_TOTALS;
- START_PR := START_PR + MAX_PR_ON_PAGE;
- end loop;
- exception
- when others => put_line("exception raised in LIST BY SUBSYSTEM REPORT");
- end SUBSYSTEM_SUMMARY;
-
-
-
- separate(TRACKER.report_generator.SUBSYSTEM_SUMMARY)
- procedure INIT_SUMSS_HEADERS is
- ----------------------------------------------------------------------
- --| NAME: INIT_SUMSS_HEADERS
- --|
- --| OVERVIEW:
- --| This procedure initializes all the headers of the subsystem summary
- --| report.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- ----------------------------------------------------------------------
-
- DASHES : constant string(1..15) := (others => '-');
-
- begin
- HEADER1 := (others => ' ');
- HEADER2 := (others => ' ');
- HEADER_LINES := (others => ' ');
-
- -- initialize the headers
- HEADER1(115..121) := "MAN-HRS";
- HEADER1(125..131) := "PERCENT";
-
- HEADER2(2..10) := "SUBSYSTEM";
- HEADER2(115..121) := "TO COMP";
- HEADER2(125..132) := "COMPLETE";
-
- HEADER_LINES (2..10) := DASHES(1..9);
- HEADER_LINES (115..121) := DASHES(1..7);
- HEADER_LINES (125..132) := DASHES(1..8);
-
- -- insert the person's initials into the headers
- for PR in 0 .. STOP_PR - START_PR loop
- HEADER2(16+PR*9..17+PR*9) := PR_INITIALS(PR+START_PR);
- HEADER_LINES(14+PR*9..20+PR*9) := DASHES(1..7);
- end loop;
- end INIT_SUMSS_HEADERS;
-
-
-
- separate(TRACKER.report_generator.SUBSYSTEM_SUMMARY)
- procedure CALC_SUMSS_TOTALS is
- ----------------------------------------------------------------------
- --| NAME: CALC_SUMSS_TOTALS
- --|
- --| OVERVIEW:
- --| This procedure calculates the total amount of time left by
- --| subsystem and by person.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- ----------------------------------------------------------------------
-
- END_LIST : boolean := false;
- ELE_PTR : element_pointer;
- PR_INDEX : integer := 0;
- PR_PTR : personnel_pointer;
-
- begin
- TIME_DONE := (others => 0.0);
- SS_TIME := 0.0;
-
- -- find the totals for each subsystem
- PR_INDEX := 0;
- start_walk(PR_LIST);
- loop
- walk(PR_LIST, PR_PTR, END_LIST);
- exit when END_LIST;
- PR_INDEX := PR_INDEX + 1;
-
- -- sum the time left to complete for each element that has
- -- this subsystem and this person
- start_walk(PR_PTR.element_list);
- loop
- walk(PR_PTR.element_list, ELE_PTR, END_LIST);
- exit when END_LIST;
-
- if ELE_PTR.subsystem_name = SS_PTR.name then
- if ELE_PTR.more_than_one_person then
- for AC_INDEX in 1..num_of_activities loop
- TIME_DONE(PR_INDEX) := TIME_DONE(PR_INDEX) +
- ELE_PTR.hours_left(AC_INDEX);
- end loop;
- else
- TIME_DONE(PR_INDEX) := TIME_DONE(PR_INDEX) +
- ELE_PTR.hours_to_complete;
- end if;
- end if;
-
- end loop;
- TOT_TIME_DONE(PR_INDEX) := TOT_TIME_DONE(PR_INDEX) + TIME_DONE(PR_INDEX);
- SS_TIME := SS_TIME + TIME_DONE(PR_INDEX);
- end loop;
- TOT_SS_TIME := TOT_SS_TIME + SS_TIME;
- end CALC_SUMSS_TOTALS;
-
-
-
- separate(TRACKER.report_generator.SUBSYSTEM_SUMMARY)
- procedure PRINT_SUMSS is
- ----------------------------------------------------------------------
- --| NAME: PRINT_SUMSS
- --|
- --| OVERVIEW:
- --| This procedure prints out an subsystem line. This line includes the
- --| the remaining man-hours of work to complete this subsystem by person,
- --| the current percent complete, and the total man-hours required to
- --| complete this subsystem.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- ----------------------------------------------------------------------
-
- begin
- -- print out this subsystem
- set_col(report_file, 2); put(report_file, SS_PTR.name);
- set_col(report_file, 14);
- for PR_INDEX in START_PR .. STOP_PR loop
- put(report_file, TIME_DONE(PR_INDEX),5,1,0);
- put(report_file," ");
- end loop;
-
- set_col(report_file, 115); put(report_file, SS_TIME,6,1,0);
- set_col(report_file, 125);
- put(report_file, CURRENT_PCT_DONE.BY_SS(SS_INDEX),3,2,0);
- put(report_file,'%'); new_line(report_file);
- end PRINT_SUMSS;
-
-
-
-
- separate(TRACKER.report_generator.SUBSYSTEM_SUMMARY)
- procedure PRINT_SUMSS_TOTALS is
- ----------------------------------------------------------------------
- --| NAME: PRINT_SUMSS_TOTALS
- --|
- --| OVERVIEW:
- --| This procedure prints out a subsystem line. This line includes the
- --| the remaining man-hours of work to complete this subsystem by person,
- --| the current percent complete, and the total man-hours required to
- --| complete this subsystem.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- ----------------------------------------------------------------------
-
- begin
- -- output totals
- set_col(report_file, 13); put_line(report_file, HEADER_LINES(13..132));
- set_col(report_file, 2); put(report_file, "TOTALS:");
- set_col(report_file, 13);
- for PR_INDEX in START_PR .. STOP_PR loop
- put(report_file, TOT_TIME_DONE(PR_INDEX),6,1,0);
- put(report_file," ");
- end loop;
-
- set_col(report_file, 115); put(report_file, TOT_SS_TIME,6,1,0);
- set_col(report_file, 125); put(report_file, CURRENT_PCT_DONE.CONTRACT,3,2,0);
- put(report_file,'%'); new_line(report_file);
- end PRINT_SUMSS_TOTALS;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --rworkbyss.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- separate(TRACKER.report_generator)
- procedure WORK_UNITS_PER_SS is
- ----------------------------------------------------------------------
- --|
- --| NAME: WORK_UNITS_PER_SS
- --|
- --| OVERVIEW:
- --| This report displays the total amount of original and current size
- --| units for each defined subsystem in the project. Total original
- --| and current size for the project are given as summary data at the
- --| bottom of the report.
- --|
- --| EXCEPTIONS HANDLED:
- --| others an error message is printed and processing continues
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- --|
- ----------------------------------------------------------------------
-
- use SS_LIST_PKG; use CALENDAR;
-
- HEADER1 : string (1..132) := (others => ' ');
- HEADER2 : string (1..132) := (others => ' ');
- HEADER_LINES : string (1..132) := (others => ' ');
-
- END_LIST : boolean := false;
- NEW_DATE : date_type := null_date;
- NEW_TOT_DATE : date_type := null_date;
- OLD_DATE : date_type := null_date;
- OLD_TOT_DATE : date_type := null_date;
- SS_INDEX : integer := 0;
- SS_PTR : subsystem_pointer;
- SS_ORIG_SIZE : integer range 0..999_999 := 0;
- SS_CUR_SIZE : integer range 0..999_999 := 0;
- SS_EQ_SIZE : integer range 0..999_999 := 0;
- TOT_ORIG_SIZE : integer range 0..999_999 := 0;
- TOT_CUR_SIZE : integer range 0..999_999 := 0;
- TOT_EQ_SIZE : integer range 0..999_999 := 0;
- TITLE : constant string := "LINES OF CODE PER SUBSYSTEM";
-
- procedure INIT_SIZE_HEADERS is separate;
- procedure CALC_SIZE is separate;
-
- begin
- INIT_SIZE_HEADERS;
- START_PAGE(TITLE,"",HEADER1,HEADER2,HEADER_LINES);
-
- -- print out each line of the report
- start_walk(SS_LIST);
- loop
- walk(SS_LIST, SS_PTR, END_LIST);
- exit when END_LIST;
- SS_INDEX := SS_INDEX + 1;
-
- CALC_SIZE;
-
- -- print out subsystem
- set_col(report_file, 2); put(report_file, SS_PTR.name);
- set_col(report_file, 14); put(report_file, SS_ORIG_SIZE,6);
- set_col(report_file, 24); put(report_file, SS_CUR_SIZE,6);
- set_col(report_file, 34); put(report_file, SS_EQ_SIZE,6);
- set_col(report_file, 45); put(report_file, OLD_DATE.month,2);
- put(report_file, '/'); put(report_file, OLD_DATE.day,2);
- put(report_file, '/'); put(report_file, OLD_DATE.year,4);
- set_col(report_file, 59); put(report_file, NEW_DATE.month,2);
- put(report_file, '/'); put(report_file, NEW_DATE.day,2);
- put(report_file, '/'); put(report_file, NEW_DATE.year,4);
- new_line(report_file);
- end loop;
-
-
- -- print out totals
- set_col(report_file, 14); put(report_file, HEADER_LINES(14..132));
- new_line(report_file);
- set_col(report_file, 2); put(report_file, "TOTALS: ");
- set_col(report_file, 14); put(report_file, TOT_ORIG_SIZE,6);
- set_col(report_file, 24); put(report_file, TOT_CUR_SIZE,6);
- set_col(report_file, 34); put(report_file, TOT_EQ_SIZE,6);
- set_col(report_file, 45); put(report_file, OLD_TOT_DATE.month,2);
- put(report_file, '/'); put(report_file, OLD_TOT_DATE.day,2);
- put(report_file, '/'); put(report_file, OLD_TOT_DATE.year,4);
- set_col(report_file, 59); put(report_file, NEW_TOT_DATE.month,2);
- put(report_file, '/'); put(report_file, NEW_TOT_DATE.day,2);
- put(report_file, '/'); put(report_file, NEW_TOT_DATE.year,4);
- new_line(report_file,2);
-
- exception
- when others => put_line("exception raised in WORK DISTRIBUTION REPORT");
- end WORK_UNITS_PER_SS;
-
-
- separate(TRACKER.report_generator.WORK_UNITS_PER_SS)
- procedure INIT_SIZE_HEADERS is
- ----------------------------------------------------------------------
- --|
- --| NAME: INIT_SIZE_HEADERS
- --|
- --| OVERVIEW:
- --| This procedure initalizes the headers for the Percent Complete
- --| by Subsystem Report.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- --|
- ----------------------------------------------------------------------
-
- DASHES : string (1..15) := (others => '-');
-
- begin
- -- initialize the headers
- HEADER1(14..21) := "ORIGINAL";
- HEADER1(24..30) := "CURRENT";
- HEADER1(34..40) := "EQ. NEW";
- HEADER1(46..51) := "OLDEST";
- HEADER1(58..68) := "MOST RECENT";
-
- HEADER2(2..10) := "SUBSYSTEM";
- HEADER2(16..19) := "SIZE";
- HEADER2(26..29) := "SIZE";
- HEADER2(36..39) := "SIZE";
- HEADER2(44..55) := "VERIFICATION";
- HEADER2(58..69) := "VERIFICATION";
-
- HEADER_LINES (2..10) := DASHES(1..9);
- HEADER_LINES (14..21) := DASHES(1..8);
- HEADER_LINES (24..31) := DASHES(1..8);
- HEADER_LINES (34..41) := DASHES(1..8);
- HEADER_LINES (44..55) := DASHES(1..12);
- HEADER_LINES (58..69) := DASHES(1..12);
-
- end INIT_SIZE_HEADERS;
-
-
-
- separate(TRACKER.report_generator.WORK_UNITS_PER_SS)
- procedure CALC_SIZE is
- ----------------------------------------------------------------------
- --|
- --| NAME: CALC_SIZE
- --|
- --| OVERVIEW:
- --| This procedure calculates the total size of a given subsystem
- --| and the earliest and most recent verification date.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- --|
- ----------------------------------------------------------------------
-
- use EL_LIST_PKG;
-
- END_LIST : boolean := false;
- ELE_PTR : element_pointer;
-
- begin
- SS_ORIG_SIZE := 0;
- SS_CUR_SIZE := 0;
- SS_EQ_SIZE := 0;
-
- -- compute the totals for each subsystem
- start_walk(SS_PTR.element_list);
- loop
- walk(SS_PTR.element_list, ELE_PTR, END_LIST);
- exit when END_LIST;
-
- SS_ORIG_SIZE := SS_ORIG_SIZE + ELE_PTR.original_size;
- SS_CUR_SIZE := SS_CUR_SIZE + ELE_PTR.current_size;
- SS_EQ_SIZE := SS_EQ_SIZE + ELE_PTR.current_size - ELE_PTR.size_done_at_start;
-
- if (NEW_DATE = null_date) or (ELE_PTR.date_size_verified > NEW_DATE) then
- NEW_DATE := ELE_PTR.date_size_verified;
- end if;
- if (OLD_DATE = null_date) or (ELE_PTR.date_size_verified < OLD_DATE) then
- OLD_DATE := ELE_PTR.date_size_verified;
- end if;
- end loop;
-
- -- update the grand total sizes
- TOT_ORIG_SIZE := TOT_ORIG_SIZE + SS_ORIG_SIZE;
- TOT_CUR_SIZE := TOT_CUR_SIZE + SS_CUR_SIZE;
- TOT_EQ_SIZE := TOT_EQ_SIZE + SS_EQ_SIZE;
-
- -- update the grand total oldest and most recent verification date
- if (NEW_TOT_DATE = null_date) or (NEW_DATE > NEW_TOT_DATE) then
- NEW_TOT_DATE := NEW_DATE;
- end if;
- if (OLD_TOT_DATE = null_date) or (OLD_DATE < OLD_TOT_DATE) then
- OLD_TOT_DATE := OLD_DATE;
- end if;
- end CALC_SIZE;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --rworkdist.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- separate(TRACKER.report_generator)
- procedure DISTRIBUTION_OF_WORK (ORIG_OR_CUR : in ORIG_OR_CUR_TYPE) is
- ----------------------------------------------------------------------
- --|
- --| NAME: DISTRIBUTION_OF_WORK
- --|
- --| OVERVIEW:
- --| This report actually consists of two separate matrix reports.
- --| It shows the total man-hours of work remaining for each activity
- --| in relation to each of the subsystems. One report is based on the
- --| original size and the other on the current size. The activities
- --| are represented on the x-axis and the subsystems on the y-axis.
- --| The data printed includes remaining man-hours of work for each
- --| activity by subsystem, the total remaining work in man-hours for
- --| each activity and for each subsystem, the percent complete for
- --| each subsystem, the grand total remaining work, the grand total
- --| percent complete, and the percentage of the total work remaining
- --| on the entire project by activity.
- --|
- --| EXCEPTIONS HANDLED:
- --| others an error message is printed and processing continues
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- --|
- ----------------------------------------------------------------------
-
- use SS_LIST_PKG;
-
- HEADER1 : string (1..132) := (others => ' ');
- HEADER2 : string (1..132) := (others => ' ');
- HEADER_LINES : string (1..132) := (others => ' ');
-
- END_LIST : boolean := false;
- SS_INDEX : integer := 0;
- SS_PTR : subsystem_pointer;
- SS_WORK_BY_AC : array (1..num_of_activities) of float := (others => 0.0);
- SS_WORK : float := 0.0;
- TOT_SS_WORK_BY_AC : array (1..num_of_activities) of float := (others => 0.0);
- TOT_SS_WORK : float := 0.0;
- SUBTITLE : constant string := "(in MAN-HOURS)";
- TITLE : string (1..56);
- TITLE_ORIG : constant string
- := "ORIGINAL DISTRIBUTION OF WORK REMAINING WITHIN SUBSYSTEM";
- TITLE_CUR : constant string
- := "CURRENT DISTRIBUTION OF WORK REMAINING WITHIN SUBSYSTEM ";
-
- procedure INIT_DIST_HEADERS is separate;
- procedure CALC_SS_WORK is separate;
-
- begin
- INIT_DIST_HEADERS;
- if ORIG_OR_CUR = CURRENT then
- TITLE := TITLE_CUR;
- else
- TITLE := TITLE_ORIG;
- end if;
- START_PAGE(TITLE,SUBTITLE,HEADER1,HEADER2,HEADER_LINES);
-
- -- print out each line of the report
- start_walk(SS_LIST);
- loop
- walk(SS_LIST, SS_PTR, END_LIST);
- exit when END_LIST;
- SS_INDEX := SS_INDEX + 1;
-
- CALC_SS_WORK;
-
- -- print out subsystem
- set_col(report_file, 2); put(report_file, SS_PTR.name);
- set_col(report_file, 14);
- for AC_INDEX in 1..num_of_activities loop
- put(report_file, SS_WORK_BY_AC(AC_INDEX),6,1,0);
- put(report_file," ");
- end loop;
-
- -- print out totals for this subsystem
- set_col(report_file, 115); put(report_file,SS_WORK,7,1,0);
- set_col(report_file, 126);
- if ORIG_OR_CUR = CURRENT then
- put(report_file, CURRENT_PCT_DONE.BY_SS(SS_INDEX),3,2,0);
- put(report_file,'%');
- else
- put(report_file, ORIGINAL_PCT_DONE.BY_SS(SS_INDEX),3,2,0);
- put(report_file,'%');
- end if;
- new_line(report_file);
- end loop;
-
-
- -- print out totals on contract by activity
- set_col(report_file, 14); put(report_file, HEADER_LINES(14..132));
- new_line(report_file);
- set_col(report_file, 2); put(report_file, "TOTALS: ");
- set_col(report_file, 13);
- for AC_INDEX in 1..num_of_activities loop
- put(report_file, TOT_SS_WORK_BY_AC(AC_INDEX),7,1,0);
- put(report_file," ");
- end loop;
- set_col(report_file, 115); put(report_file, TOT_SS_WORK,7,1,0);
- set_col(report_file, 126);
- if ORIG_OR_CUR = CURRENT then
- put(report_file, CURRENT_PCT_DONE.contract,3,2,0);
- put(report_file,'%');
- else
- put(report_file, ORIGINAL_PCT_DONE.contract,3,2,0);
- put(report_file,'%');
- end if;
- new_line(report_file,2);
-
- -- print out percent of total work left
- set_col(report_file, 2); put(report_file, "% OF TOTAL:");
- set_col(report_file, 15);
- for AC_INDEX in 1..num_of_activities loop
- if TOT_SS_WORK > 0.0 then
- put(report_file, 100.0 * TOT_SS_WORK_BY_AC(AC_INDEX) / TOT_SS_WORK,3,2,0);
- else
- put(report_file, 0.0,3,2,0);
- end if;
- if AC_INDEX < num_of_activities then
- put(report_file,"% + ");
- end if;
- end loop;
- put(report_file,"% = 100.00%");
- new_line(report_file);
-
- exception
- when others => put_line("exception raised in WORK DISTRIBUTION REPORT");
- end DISTRIBUTION_OF_WORK;
-
-
- separate(TRACKER.report_generator.distribution_of_work)
- procedure INIT_DIST_HEADERS is
- ----------------------------------------------------------------------
- --|
- --| NAME: INIT_DIST_HEADERS
- --|
- --| OVERVIEW:
- --| This procedure initalizes the headers for the Percent Complete
- --| by Subsystem Report.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- --|
- ----------------------------------------------------------------------
-
- use AC_LIST_PKG;
-
- DASHES : string (1..15) := (others => '-');
- AC_PTR : activity_pointer;
- AC_INDEX : integer := 0;
-
- begin
- -- initialize the headers
- HEADER1(117..121) := "TOTAL";
- HEADER1(126..132) := "PERCENT";
-
- HEADER2(2..10) := "SUBSYSTEM";
- HEADER2(115..123) := "REMAINING";
- HEADER2(126..132) := "COMPLET";
-
- HEADER_LINES (2..10) := DASHES(1..9);
- HEADER_LINES (115..123) := DASHES(1..9);
- HEADER_LINES (126..132) := DASHES(1..7);
-
- -- initialize the header for the activity data
- start_walk(AC_LIST);
- loop
- walk (AC_LIST, AC_PTR, END_LIST);
- exit when END_LIST;
- HEADER2(14+10*AC_INDEX..21+10*AC_INDEX) := AC_PTR.name(1..8);
- HEADER_LINES(14+10*AC_INDEX..21+10*AC_INDEX) := DASHES(1..8);
- AC_INDEX := AC_INDEX + 1;
- end loop;
-
- end INIT_DIST_HEADERS;
-
-
-
- separate(TRACKER.report_generator.DISTRIBUTION_OF_WORK)
- procedure CALC_SS_WORK is
- ----------------------------------------------------------------------
- --|
- --| NAME: CALC_SS_WORK
- --|
- --| OVERVIEW:
- --| This procedure calculates the total amount of work left in a
- --| subsystem by activity.
- --|
- --| EXCEPTIONS HANDLED:
- --| none
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- --|
- ----------------------------------------------------------------------
-
- use AC_LIST_PKG; use PR_LIST_PKG; use EL_LIST_PKG;
-
- AC_PTR : activity_pointer;
- AC_INDEX : integer := 0;
- END_LIST : boolean := false;
- ELE_PTR : element_pointer;
- ELE_SIZE : float range 0.0..99_999.0 := 0.0;
- FOUND : boolean := true;
- PR_PTR : personnel_pointer;
- PCT_TOT_PROJ : array (1..max_num_activities) of float range 0.0..100.0
- := (others => 0.0);
-
- begin
- -- initialize the PCT_TOT_PROJ array
- start_walk(AC_LIST);
- AC_INDEX := 0;
- loop
- walk(AC_LIST, AC_PTR, END_LIST);
- exit when END_LIST;
- AC_INDEX := AC_INDEX + 1;
- PCT_TOT_PROJ (AC_INDEX) := AC_PTR.percent_tot_proj;
- end loop;
-
- SS_WORK_BY_AC := (others => 0.0);
- SS_WORK := 0.0;
- start_walk(SS_PTR.element_list);
- loop
- walk(SS_PTR.element_list, ELE_PTR, END_LIST);
- exit when END_LIST;
-
- -- compute the size of this element (original or current)
- if ORIG_OR_CUR = CURRENT then
- ELE_SIZE := float(ELE_PTR.current_size - ELE_PTR.size_done_at_start);
- elsif (ELE_PTR.original_size >= ELE_PTR.current_size) or
- (ELE_PTR.current_size = 0) then
- ELE_SIZE := float(ELE_PTR.original_size - ELE_PTR.size_done_at_start);
- else
- ELE_SIZE := float(ELE_PTR.original_size) * (1.0 -
- float(ELE_PTR.size_done_at_start) / float(ELE_PTR.current_size));
- end if;
-
-
- -- add each element by activity to the totals
- if not ELE_PTR.more_than_one_person then
- find(PR_LIST,ELE_PTR.person_initials, PR_PTR, FOUND);
- end if;
- AC_INDEX := 0;
- start_walk(AC_LIST);
- loop
- walk(AC_LIST, AC_PTR, END_LIST);
- exit when END_LIST;
- AC_INDEX := AC_INDEX + 1;
- if ELE_PTR.more_than_one_person then
- find(PR_LIST,ELE_PTR.people_initials(ac_index), PR_PTR, FOUND);
- SS_WORK_BY_AC(AC_INDEX) := SS_WORK_BY_AC(AC_INDEX) + ELE_PTR.complexity
- * float(ELE_SIZE) * (PCT_TOT_PROJ(AC_INDEX) / 100.0) *
- (1.0 - AC_PCT_VALUE(ELE_PTR.activity_completeness(AC_INDEX))/100.0)
- / PR_PTR.production_rate;
- else -- only one person assigned
- SS_WORK_BY_AC(AC_INDEX) := SS_WORK_BY_AC(AC_INDEX) + ELE_PTR.complexity
- * float(ELE_SIZE) * (PCT_TOT_PROJ(AC_INDEX) / 100.0) *
- (1.0 - AC_PCT_VALUE(ELE_PTR.activity_completeness(AC_INDEX))/100.0)
- / PR_PTR.production_rate;
- end if;
- end loop;
- end loop;
-
- for AC_INDEX in 1..num_of_activities loop
- SS_WORK := SS_WORK + SS_WORK_BY_AC(AC_INDEX);
- TOT_SS_WORK_BY_AC(AC_INDEX) := TOT_SS_WORK_BY_AC(AC_INDEX)
- + SS_WORK_BY_AC(AC_INDEX);
- end loop ;
- TOT_SS_WORK := TOT_SS_WORK + SS_WORK;
- end CALC_SS_WORK;
-
-