\section{Design Description}
        \subsection{Data Description}
This section will describe what type of data is involved or moved
around within the program. In the initial startup of the program,
the user can specify the a file for the program to read from or start
a new file from the information that he/she has entered. The data used
to start the program ( The GUI interface ) will come from the Guide tool
and using the xview and xlib functionality. Data comming from the
file will contain the following information: the task description,
duration, planed start and end dates, actual start and end dates, forcast
start and end dates, earliest start and end dates, latest start and end
dates, the float time, a variable indecating wether the task is a milestone
or not, a variable indecating wether the task is a deliverable or not, each
of the resources for the task, the list of subtasks that deal with that
particular task, and a list of dependancies for that task. All of this data
will be included into the file for each task that the program produces.
This same data will be included into the database, but stored into a
database structure. This data from the file and the database will
ultimately be given by the user from the user interface. If the data has
already been stored into a file then the data from the database could come
from the file. Next, data that is routed from the database to
the calculations will consist of dates, dependancies, the task description.
Data going back to the database from the calculations consist of asking the
database for the next tasks dependancies,dates, and its task description.
Date going to the user interface and the the \LaTeX\ generator will consist
of formated chart data (positions on the screen or paper for each task,
each tasks' description, and its start and end dates.
        %
        % The following subsection describe the data flow and
        % structure from refined DFD and decomposition of tasks
        %
                \subsubsection{Review of data flow}
                Starting from the user interface, if the user is starting
the application with a file, then the flow of data will go from the user
interface through the database and to the file read/write functions. From
here the file read/write functions will access the file and fill up the
database. Within this process, the flow of data is going from the file
read/write functions to the database and back until the end of the file.
When the file is read and the database is filled, the flow of data will go
to the user interface. The data here is the task names, descriptions,
dates, milestones, resources, subtasks, and dependancies. This data will be
viewed by the user from the user interface. From the database, the data
could flow to the calculations, if the user wants to calculate the critical
path and dependancies. From the calculations, the \LaTeX\ generator can be
sent chart data to process a \LaTeX\ file or chart data could be sent to the
user interface to display the PERT and Gantt charts. If the user does not
start the application with a file, then the data will be typed in by the
user. Then the database will be filled up according to the task that is
modified or created by the user.

          \subsubsection{Review of data structure}

        %
        % Given the tasks and subtasks identified in Requirements
        % document, identify program structure (modules).
        %
        %
        \subsection{Derived Program Structure}
        The program structure will ultimately start out with the files
generated by the Guide tool. This is where most of the user interface will
be implemented. The use of the xlib functions will be used in generating
the PERT and Gantt charts for the user to view by the user interface. The
next segment will involve the set up of the database and it's
functionality. The database will be created by using pointers and structs.
Here task data will be stored. Functions will be created to add
, read, delete, and write to the database. These will be the only
functions that will retrieve and store data into and from the database. The
calculations model will be consisted of calculating to the  critical path,
finding the earliest and latest start date, and checking for dependancies.
The calculations will also be responsible for formating data in a way to
send it to the user interface and \LaTeX\ generator so those functions can
display it to the screen or generate a \LaTeX\ file. The calculations
section will be split up by allowing the parts of it to be easily
accessable by the functions that need to use them. Part of the calculations
portion will be closly tied to the database because it will calculate start
and ending dates given the start of the whole project and the duration for
each tasks. The file read/write will only read from the database and write
to the data base. All of the information that the user needs for the tasks
will be stored in the database. So the database functions will call the
read information from the read function of the file when the user wands to
read a file in to the program, and the database will call the write
function to write the information stored in the database to the file.
The calculations portion of the system will be responsible of calling the
\LaTeX\ generator when the user has ased for it. The \LaTeX\ generator will
then recieve a formated structure containing the positions that \LaTeX\ used
to create the file. The \LaTeX\ generator will then use its hard coded \LaTeX\
commands to generate the \LaTeX\ file.


 %
        % How do the modules fit together?
        %
        \subsection{Interfaces within structure}
   This section will explain the integration and how each major module will
be integrated with one another. First the user interface will only have
write access to the database using the store functions of the database. The
user interface will be able to recieve information from the data base and
the calculations only. The information recieved from the database consist of
the task information from the database to the screen, depending on what screen
the user is on. The information recieved from the calculations will consist of
a formated structure that will contain information for the viewing of the Gantt
and PERT charts. The file read/write will only access information from the
database and will put information to the file. The calculations section will
recieve data from the database to do its calculations and output data to either
the database (Calculation of begin,end dates), the user interface (Formated data
for the PERT and Gantt charts for the screen), or the \LaTeX\ generator (Formated
data for the generation of a \LaTeX\ file that will produce PERT and Gantt charts.
Lastly, the database will be accessed when the user types some
information on the screen (Information is stored to the database), the database
is updating the screen, the database is called by the calculations, the
calculations update the database, the read file is called by the read function
which is called by the database function to read the information from the file,
and the database calles the write function to write the information stored
within the database to the file.

%
% For each of modules (functions or procedures) identified above,
% provide the following information
%
\section{Modules}
        %
        % For the preliminary design, make the processing narrative
        % only textual. In the Detailed design, you will provide a
        % structural description.
        %
        \subsection{Processing narrative}
When the read/write function is invoked the user will specify the type
of processing that is to take place. A file that is to be read could
have been previously generated by the project planning tool, or could
be generated from another program or a person typing directly into an
ASCII file, provided that the file structure is correct.
When reading
the data, the control will come from the the database and into a
format function, then to the read function. The read is then invoked
from the directory and file specified by the user. The data is then
read, formatted, and put into the database. This process will be done using the
flex and bison tools. Flex will define the identifiers and bison will parse them
making sure that the file read in is in the correct format. Here is a sample
file containing one task. The files will look simular to this:
\begin{verbatim}
task1{
    name: The project description
    description: Describe the project and how it will work.
    duration: 5d
    planned_start_date: 6/10/92
    planned_end_date: 6/20/92
    actual_start_date: 6/11/92
    actual_end_date: 6/30/92
    forecast_start_date: 6/9/92
    forecast_end_date: 6/19/92
    earliest_start_date: 5/1/92
    earliest_end_date: 6/15/92
    latest_start_date: 6/15/92
    latest_end_date: 7/1/92
    float_time: 6d
    milestone: 1
    deliverable: 0
    resources: Mark,Brian
    subtasks: none
    dependencies: none}
\end{verbatim}
When the write is invoked,
then database will send data to a format function, where the data will
be formatted in a way that will be easy to read from the read
function. Then the format function will invoke the write function.
Here the file specified by the user, whether a new or old file, will
be created, and the formatted data will put in. The files will be read
and written to in a sequential manner.
        \subsection{Interface description}
        The user will be able to involke the read only if the database is empty.
If the database is not empty, then the read from a file command will not work
because this project will only allow one database at a time. At this point the
user will be warned of this notion. The write command will also be involked by
the user. At this point the user will be able to write over a pre-existing file
that has the same name or change the name. The user will be able to use these
commands from the main screen in the program under the file button menu.

%       The following section will be filled in during the detailed design
%       phase. For now, it is commented out.
%
%       \subsection{Design language description}
        %
        % Identify the modules to be used by different modules
        %
        \subsection{Modules used}
        The read,write function will contain four modules. From the read part of
the function,a module will be made to do the actual reading of the file using
bison and flex. This module will readone task and all of the information
contained within that one task. Then a call to the format routine will be made.
Here the task will be formated and another call will be made to put the
information into the database. Then the next task will be read, and so on.
The write function will also contain two modules. The write module will do the
actual writing of the formated data to the file, specified by the user. The
module used in formating the data from the database will be foemated in a way
that is described by the file in the processing narrative section of this
document. The format for the read will be called read-format. The
actual read from the file will be called read-data-from-file. The format module
for the write will be called write-format. The actual write module will be
called write-data-to-file.




        % Describe the data structures to be used for the software.
        % Give their organization.
        %
        \subsection{Data Organization}
         The data structures used within this function will consist of using a
record or struct type that will have all of the information for a given task.
The resources, subtasks, and dependancies within the task will havs record or
structure types of their own. This is to keep an organization within one task.
These data structures will only be able to hold one task, because once a task is
read it will be but into the database. Then it will read the next task, until
the end of the file.
        %
        % Create the skeleton for each of the modules by commenting
        % the purpose of each.
        %
        \subsection{Comments}
        \begin{enumerate}
        \item write-data-to-file - This module will take the formated data
that was made in the write-format module and actually write it to the file
specified by the user.
        \item write-format - This module will take a task from the database and
format it and send it to the write routine where it will then be written to the
file.
        \item read-data-from-file - This module will use flex and bison to
interpret the information in the file and send data to the read-format module.
        \item read-format - This module will recieve a task from the read,
format the task , and make a call to enter the task into the database.
        \end{enumerate}


%
% Explain how file structures are to be maintained, assign global
% data, establish cross reference between individual modules to
% files or global data.
%
\section{File structure and global data}
There will be two types of files that can created from the program. First, the
program can generate a \LaTeX\ file. When generating a <filename>.dvi file from
the following commands \LaTeX\ a graphical printout of the Gantt and PERT
charts, and Task Sheet can be made. Secondly, the user can save the information
that he/she has used from within the program (tasks, dates, durations,
dependancies, milestones, and subtasks) to a file so that it can be
re-initialuized again at a later time.






%
        \subsection{External file structure}
         The structure of the file from the \LaTeX\ generator will be in the form
of a \LaTeX\ file. This file can be used to incorperate other documentation using
the \LaTeX\ file structure. The structure of the file that is created by the
program is in ASCII form and will look like the following:
\begin{verbatim}
task1{
    name: The project description
    description: Describe the project and how it will work.
    duration: 5d
    planned_start_date: 6/10/92
    planned_end_date: 6/20/92
    actual_start_date: 6/11/92
    actual_end_date: 6/30/92
    forecast_start_date: 6/9/92
    forecast_end_date: 6/19/92
    earliest_start_date: 5/1/92
    earliest_end_date: 6/15/92
    latest_start_date: 6/15/92
    latest_end_date: 7/1/92
    float_time: 6d
    milestone: 1
    deliverable: 0
    resources: Mark,Brian
    subtasks: none
    dependencies: none}
\end{verbatim}
   This file only has one task, but the ones generated with the program can
contain as many as memory will permit for a file size. This file will
be read in using Bison and Flex, and written out to fit the format above.

               \subsubsection{Logical structure}
               The \LaTeX\ file generated will contain the code used in generating
a \LaTeX\ file. The program will format the \LaTeX\ code so it has a document begin,
all of the boxes and conections for the chart specified by the user, and the end
of document statement. The logical structure of the program file will start with
the first task on the first line then it will show a name, description, all of
the dates, the float time, the milestone value, the deliverable value, the
resources, the subtasks, and the dependancies for that one task. Then the next
task and all of its information will come next, and so on for all of the tasks
in the file. The order of the data within each task is in the correct order
specified in the example above.

                \subsubsection{Logical record description}
                The \LaTeX\ file will begin with the document begin command and
have many commands that will create printed charts and and end document command.
For the program file, each record within the file
will contain one whole task and all of its data information.  This record will
be multiple lines long and be formated in the same order as indecated above in
the sample file.

                \subsubsection{Access method}
                 The \LaTeX\ file will be generated using the basic methods of
file read/writes from within the current directories of the running of the
program. The program file, on the other hand, will use Flex to identify the
names within the tasks and the task itself and Bison to parse the
information within the tasks to make sure that what is being read is the correct
data and is in the correct format for the program.

                \subsection{Global data}
                 The only global data that is used are the ones that are made by
the programs Flex and Bison. This global data will consist of lookup tables and
data that is to be retrieved by the program.


                \subsection{File and data cross reference}
                  The data within the program file will come from the data that
is made by the program from the database and the file write routines. The user
must type in the data through the interface or by hand. If teh file is typed
out by hand or another method other than the program then the file must
be formated to the specifications in order for the program to read it correctly.

