Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
(EOD).Software topics.pdf
Скачиваний:
18
Добавлен:
23.08.2013
Размер:
1.55 Mб
Скачать

page 55

6.8.4 Flow Program:

main()

/*

*EXECUTIVE CONTROL LEVEL

*This is the main terminal point between the

*various stages of setup, input, revision

*and termination.

*

* January 29th, 1989. */

{

static int error;

if((error = setup()) != ERROR) { screen(NEW); screen(UPDATE);

while((error = input()) != DONE) { if(error == REVISED) {

screen(NEW);

screen(UPDATE);

}

}

error = NO_ERROR;

}

kill();

if(error == ERROR) {

printf(“EGA Graphics Driver Not Installed”);

}

}

6.8.5 Expand Program:

• The routines were written in a top down fashion, in a time of about 30 hours. These routines are listed below.

page 56

Routines Used In Package:

main() - to be used as the main program junction.

setup() - to set up graphics mode and printer.

screen() - A function to draw, or refresh part of the screen. In the interest of program speed, this function uses some low level commands.

calculations() - perform the calculations of outputs from the inputs

picture() - draws the beam cross section and deflection of beam. For the sake of speed, this section will use low level commands.

input() - A function which controls the main input loop for numbers, controls, error screening, and any calls to desired routines. Input uses both higher and lower level commands for the sake of speed.

printes() - A function to print the EGA screen.

printer() - A function to remove help messages from the screen, and then dumps the screen to the printer.

enter() - checks for entry error, against a set of limits for any input.

text() - A function to print text on the screen at normalized coords.

draw_line() - A Function to draw a line in normalized coords.

box() - A Function to draw a double lined box anywhere on screen.

kill() - deinitialize anything initialized in setup().

Condition and error flags were used to skip unnecessary operations, and thus speed up response. A response of more than 0.5 seconds will result in loss of attention by the user.

Соседние файлы в предмете Электротехника