Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

inf_meth_Delphi

.pdf
Скачиваний:
2
Добавлен:
12.05.2015
Размер:
1.55 Mб
Скачать

a)

b)

c)

Fig 1.3 Handling lists

Рис. 1.3 Компоненты-списки

 

a) ListBox; b) CheckListBox; c) ComboBox

Use the nonvisual TStringList and TImageList components to manage sets of strings and images.

List boxes and check-list boxes

List boxes (Fig 1.3, a) and check-list boxes (Fig 1.3, b) display lists from which users can select items.

Items uses a TStringList object to fill the control with values.

ItemIndex indicates which item in the list is selected.

MultiSelect specifies whether a user can select more than one item at a time.

Sorted determines whether the list is arranged alphabetically.

Columns specifies the number of columns in the list control.

IntegralHeight specifies whether the list box shows only entries that fit completely in the vertical space.

ItemHeight specifies the height of each item in pixels. The Style property can cause ItemHeight to be ignored.

The Style property determines how a list control displays its items.

Следует использовать невизуальные компоненты TStringList и TImageList для управления наборами строк и образов, соответственно.

Списки и списки выбора

Списки (рис. 1.3, а) и списки выбора (рис. 1.3, b) отображают варианты выбора для пользователей.

Items использует объект TStringList

для наполнения элемента управления.

ItemIndex указывает номер (индекс) выбранного элемента списка.

MultiSelect определяет возможность выбора нескольких элементов одновременно.

Sorted определяет, будет ли список в отсортирован в алфавитном порядке.

Columns определяет количество столбцов в списке.

IntegralHeight определяет, будут ли отображаться только записи, которые укладываются в вертикальном пространстве.

ItemHeight определяет высоту каждого элемента в пикселях. Свойство Style может привести кигнорированию ItemHeight.

Свойство Style определяет, как отображается список элементов.

Grouping components

A graphical interface is easier to use when related controls and information are presented in groups. Delphi provides several components for grouping components (Fig 1.4):

GroupBox – a standard group box with a

title.

RadioGroup – a simple group of radio

buttons.

Panel – a more visually flexible group of controls.

ScrollBox – a scrollable region containing controls.

TabControl – a set of mutually exclusive notebook-style tabs.

PageControl – a set of mutually exclusive notebook-style tabs with corresponding pages, each of which may contain other controls.

HeaderControl – resizable column

headers.

Групировка компонентов

Графический интерфейс будет простым если элементы управления сгруппированы. Delphi предоставляет несколько компонент для группировки (рис. 1.4):

GroupBox – стандартное окно с заголовком.

RadioGroup – простая группа переключателей.

Panel – визуально более гибкие группы элементов управления.

ScrollBox – прокручиваемой области, содержащей элементы управления.

TabControl – набор взаимоисключающих вкладок.

PageControl – набор взаимоисключающих вкладок страниц, каждая из которых может содержать другие элементы управления.

HeaderControl – изменение размера заголовков столбцов.

11

a )

b)

c)

d)

e)

f)

 

g)

 

Fig 1.4 Grouping components

 

Рис. 1.4 Группирующие компоненты

a)GroupBox; b) RadioGroup; c) TabControl; d) Panel;

e)ScrollBox; f) PageControl; g) HeaderControl

Group boxes and radio groups

A group box (Fig 1.4, a) is a standard Windows component that arranges related controls on a form. The most commonly grouped controls are radio buttons. After placing a group box on a form, select components from the Component palette and place them in the group box.

The Caption property contains text that labels the group box at runtime.

The radio group component (Fig 1.4, b) simplifies the task of assembling radio buttons and making them work together. To add radio buttons to a radio group, edit the Items property in the Object Inspector; each string in Items makes a radio button appear in the group box with the string as its caption. The value of the ItemIndex property determines which radio button is currently selected. Display the radio buttons in a single column or in multiple columns by setting the value of the Columns property.

Panels

The panel component (Fig 1.4, d) provides a generic container for other controls. Panels can be aligned with the form to maintain the same relative position when the form is resized. The BorderWidth property determines the width, in pixels, of the border around a panel.

Scroll boxes

Scroll boxes (Fig 1.4, e) create scrolling areas within a form. Applications often need to display more information than will fit in a particular area.

GroupBox и RadioGroup

 

GroupBox

(рис. 1.4, a)

является

стандартным компонентом Windows, которая организует связанные элементов управления в форме. Наиболее часто сгруппированы элементы управления RadioButton. После размещения GroupBox на форме, выберите компонент из палитры компонентов и поместите в группу. Свойство Caption содержит текст этикетки группы.

Компонент RadioGroup (рис. 1.4, b) упрощает монтаж RadioButton и делает совместной их работу. Для добавления переключателей RadioGroup следует редактировать свойство Items в Object Inspector. Каждая строка Items создает переключатель, появляющийся в поле группы со строкой в качестве заголовка. Значение свойства ItemIndex определяет, какой переключатель выбран в данный момент. Изменить количество колонок для отображения элементов можно в свойстве Columns.

Панели

Компонент панель (рис. 1.4, d) – общий контейнер для других элементов управления. Для поддержания относительной позиции при изменении размеров формы панель может быть выровнена на ней. Свойство BorderWidth определяет ширину в пикселях границы вокруг панели.

Scroll boxes

ScrollBboxes (рис. 1.4, e) создают области прокрутки в форме когда требуется отображать больше информации, чем может поместиться.

12

Some controls—such as list boxes, memos, and forms themselves—can automatically scroll their contents. Scroll boxes give you the additional flexibility to define arbitrary scrolling subregions of a form.

Like panels and group boxes, scroll boxes contain other controls. But a scroll box is normally invisible. If the controls in the scroll box cannot fit in its visible area, the scroll box automatically displays scroll bars.

Tab controls

The tab control (Fig 1.4, c) component looks like notebook dividers. You can create tabs by editing the Tabs property in the Object Inspector; each string in Tabs represents a tab.

The tab control is a single panel with one set of components on it. To change the appearance of the control when the tabs are clicked, you need to write an OnChange event handler.

Page controls

The page control component (Fig 1.4, f) is a page set suitable for multipage dialog boxes. To create a new page in a page control, rightclick the control and choose New Page.

Header controls

A header control (Fig 1.4, g) is a is a set of column headers that the user can select or resize at runtime. Edit the control’s Sections property to add or modify headers.

Visual feedback

There are many ways to provide users with information about the state of an application. For example, some components— including TForm—have a Caption property that can be set at runtime. You can also create dialog boxes to display messages. In addition, the following components are especially useful for providing visual feedback at runtime (Fig. 1.5):

Label and StaticText – display noneditable text.

StatusBar – display a status region (usually at the bottom of a window).

ProgressBar – show the amount of work completed for a particular task.

Hint and ShowHint – activate fly-by or

“tool-tip” help.

HelpContext and HelpFile – link context-sensitive online Help.

Некоторые элементы управления сами формы могут прокручивать автоматически. ScrollBboxes дает дополнительную гибкость для определения произвольных областей прокрутки формы.

ScrollBoxes может содержать другие элементы управления. Но прокрутки, как правило, невидимы. Если элементы управления не могут вписаться в видимой области, автоматически отображаются полосы прокрутки.

Вкладка

Вкладки (рис. 1.4, c) выглядят как перегородки записной книжки. Можно создать вкладки в свойстве Tabs в Object Inspector, каждая строка в Tabs представляет собой вкладку.

Вкладка это одна панель с одним набором компонентов на ней. Для изменения внешнего вида элемента управления при нажатии вкладки, вам нужно написать обработчик события OnChange.

Страница управления

Компонент управления страницей (рис. 1.4, f) подходит для многостраничных диалогов. Чтобы создать новую страницу щелкните правой кнопкой мыши элемент управления и выберите команду New Page.

Заголовок управления

Заголовок управления (рис. 1.4, g) представляет собой набор заголовков столбцов, которые пользователь может выбрать или изменить размер во время выполнения. Редактирование свойства Sections позволяет добавить или изменить заголовки.

Визуальная обратная связь

Есть много способов, чтобы предоставить пользователям информацию о состоянии приложения. Например, свойство Caption компонента TForm может быть изменено во время выполнения программы. Можно создавать диалоговые окна для отображения сообщений. Кроме того, для выода информации, могут быть полезны такие компоненты (рис. 1.5):

Label и StaticText – отображение текста без возможности редактирования.

StatusBar – отображение статуса области (как правило, в нижней части окна).

ProgressBar – показать объем выполненных работ для конкретной задачи.

Hint и ShowHint – непосредственнаяю

и«всплывающая» подсказка».

HelpContext и HelpFile – ссылка контекстно-зависимой справки.

13

a) b) c)

Fig 1.5 Components for visual feedback

Рис. 1.5 Компоненты

визуальной обратной связи

 

a) Label and StaticText; b) StatusBar; c) ProgressBar

Labels and static-text components

Labels (Fig. 1.5, a) display text and are usually placed next to other controls. The standard label component, TLabel, is a non windowed control, so it cannot receive focus; when you need a label with a window handle, use TStaticText instead.

Label properties include the following:

Caption contains the text string for the

label.

FocusControl links the label to another control on the form.

ShowAccelChar determines whether the label can display an underlined accelerator character.

Transparent determines whether items under the label (such as graphics) are visible.

Status bars

Although you can use a panel to make a status bar, it is simpler to use the status-bar component (Fig. 1.5, b) . By default, the status bar’s Align property is set to alBottom, which takes care of both position and size.

You will usually divide a status bar into several text areas. To create text areas, edit the Panels property in the Object Inspector, setting each panel’s Width, Alignment, and Text properties from the Panels editor. The Text property contains the text displayed in the panel.

Progress bars

When your application performs a timeconsuming operation, you can use a progress bar (Fig. 1.5, c) to show how much of the task is completed. A progress bar displays a dotted line that grows from left to right.

The Position property tracks the length of the dotted line. Max and Min determine the range of Position. To make the line grow, increment Position by calling the StepBy or StepIt method. The Step property determines the increment used by StepIt.

Компоненты Labels и StaticText

Метки (рис. 1.5, а) отображают текст и обычно располагаются рядом с другими элементами управления. Компонент метка (TLabel), не является оконным элементом, поэтому он не может получить фокус. Для этикетки с дескриптором окна, используйте

TStaticText.

Основные свойства меток:

Caption содержит текстовую строку заголовка метки.

FocusControl отсылает метку на другой элемент управления.

ShowAccelChar определяет, выводить ли подчеркнутый символ-ускоритель.

Transparent определяет прозрачность, т.е. будут ли видны элементы (например, графики) под этикеткой.

Строки состояния

Можно использовать панель для строк состояния, однако проще использовать компонент «строка состояния» (рис. 1.5, b). По умолчанию свойство Align имеет значение alBottom, которое определяет размер и положение.

Как правило, строка состояния состоит из нескольких областей текста. Для создания текстовых областей, следует использовать свойство Panels в Object Inspector, и свойства Width, Alignment и Text в редакторе панели.

Свойство Text содержит строку, отображаемую на панели.

Строка прогресса

Когда приложение выполняет трудоемкую операцию, можно использовать этот индикатор (рис. 1.5, c), чтобы показать степень выполнения задачи в виде полосы, которая растет слева направо.

Свойство Position определяет положение трека. Max и Min определить диапазон изменения Position. Прирост Position определяется методами StepBy или StepIt. Свойство Step определяет приращение, используемое методом StepIt.

14

Help and hint properties

Most visual controls can display contextsensitive Help as well as fly-by hints at runtime. The HelpContext and HelpFile properties establish a Help context number and Help file for the control.

The Hint property contains the text string that appears when the user moves the mouse pointer over a control or menu item. To enable hints, set ShowHint to True; setting

ParentShowHint to True causes the control’s

ShowHint property to have the same value as its parent’s.

Свойства помощи и подсказки

Большинство визуальных элементов управления во время выполнения могут отображать контекстно-зависимую справку, а также всплывающие подсказки. Свойства

HelpContext и HelpFile определяют контекст-

ную справку и файл справки для элемента управления.

Свойство Hint содержит текстовую строку, которая появляется, когда пользователь перемещает указатель мыши на элемент управления или пункт меню. Чтобы включить подсказки, установите для

ShowHint и ParentShowHint значение True, а

свойства ShowHint элемента управления, должно иметь то же значение, что и у его родителей.

15

 

2. PERFORMANCE

 

2. ВЫПОЛНЕНИЕ

 

OF PRACTICAL PART

 

ПРАКТИЧЕСКОЙ ЧАСТИ

 

OF THE SOFTWARE

ПРОГРАММНОЙ СИСТЕМЫ

 

The software should be performed in

 

Разработку программной системы

accordance with the following order:

будем проводить в соответствии с общими

 

 

рекомендациями в такой последовательности:

1.

Task statement

1.

Постановка задачи

2.

Task analysis

2.

Анализ задачи

3.

Design of algorithm

3.

Разработка алгоритма решения задачи

4.

Design of general structure, interface and

4.

Проектирование структуры, интерфейса и

 

coding of the whole program and its separate

 

кодирование программы в целом и ее

 

blocks

 

отдельных блоков

5.

Debugging and verification of the program

5.

Отладка и верификация программы

6.

Receiving and interpretation of result

6.

Получение результата и его

7.

Presenting of work results to the customer

 

интерпретация

8.

System maintenance

7.

Передача заказчику результатов работы

 

 

8.

Сопровождение программы

 

2.1 Task statement

 

2.1 Постановка задачи

To design interactive system for calculation and modeling of crank-and-rocker mechanism, full kinematic scheme of which is displayed on fig. 2.1. Such system should provide data input about mechanism link length, determination of rocker slope and transmission ratio with any location of crank, display of full and simplified mechanism sketch and simulation of its operation, display of relation diagrams of rocker slope, transmission ratio and crank rotation angle.

Разработать диалоговую систему для расчета и моделирования кривошипно-коро- мыслового механизма, полная кинематическая схема которого представлена на рис. 2.1. Такая система должна обеспечивать ввод данных про длины звеньев механизмов, рассчитывать угол наклона коромысла и передаточное отношение при любом положении кривошипа, отображать упрощенный и полный эскиз механизма, имитировать работу, выводить графики зависимости угла наклона коромысла и передаточного отношения от угла поворота кривошипа.

 

 

 

 

 

Fig. 2.1 .Full kinematic scheme of

 

Рис. 2.1. Полная кинематическая

mechanism

 

схема механизма

 

16

 

The scheme analysis shows that driving link is crank 2 which is rotated round the body 1 axis.

Basic geometry of mechanism are:

L – distance between the centers of rotation;

R – distance between rotation axis of crank and a pin on it;

L1 – rocker length;

L2 – coupler link length.

Additional geometry of mechanism are:

D – crank diameter;

B – distance between the base of body and rotation axes of crank and rocker.

Ratio of mechanism dimensions, which determine the possibility of mechanism embodiment, is the following:

Part 1

– Body

L = 100..150 mm

 

 

B > D/2 mm

Part 2

– Crank

R = 10..L-20 mm

 

 

D=2*R+10 mm

Part 3

– Rocker

L1>=R+10 mm

Part 4

– Connecting rod

L22=(L-R)2+L12 mm

Mechanism position is determined by crank rotation angle ( ); and basic geometry influencing rocker slope angle ( ).

Проанализируем схему. Приводным звеном является кривошип 2, который вращается вокруг оси корпуса 1.

Основными геометрическими размера-

ми механизма являются:

L – расстояние между центрами вращения; R – расстояние между осью вращения кривошипа и шипом на нем;

L1 – длина коромысла;

L2 – длина шатуна.

Дополнительными геометрическими размерами механизма являются:

D – диаметр кривошипа;

B – расстояние от основания корпуса до осей вращения кривошипа и коромысла.

Соотношения размеров механизма,

определяющие возможность конструктивного выполнения механизма, приведены далее:

Деталь 1

– Корпус

L = 100..150 мм

 

 

B > D/2 мм

Деталь 2

– Кривошип

R = 10..L-20 мм

 

 

D=2*R+10 мм

Деталь 3

– Коромысло

L1>=R+10 мм

Деталь 4

– Шатун

L22=(L-R)2+L12 мм

Положение механизма определяется углом ( ) поворота кривошипа и основными геометрическими размерами, от которых зависит угол ( ) наклона коромысла.

Rocker slope function

 

 

 

Функция наклона коромысла:

arcsin

R sin

arccos

L12 Lk 2 L22

,

Lk

2 L1 Lk

 

 

 

 

 

 

 

 

 

 

Lk

R2 L2 2 R L cos

 

 

Transmission ratio function

u R sin( ) , L1 sin( )

 

R sin

 

 

arctan

 

 

arccos

 

 

L R cos

 

Lk R2 L2 2 R L cos

Функция передаточного отношения

L22 Lk 2 L12 ,

2 L2 Lk

Simplified kinematic scheme (fig. 2.2) symbolized the same mechanism in which the parts are changed into links connecting node points of mechanism.

There is no point to answer the following questions in this software: commercial interest of the system, in what way it differs from other systems etc., but it is important to specify algorithms and units we can use to solve set problem. In particular, one can use Delphi components and additional units stored on compact disk, folder „Kurs\Units”.

Упрощенная кинематическая схема

(рис. 2.2) символизирует этот же механизм, в котором соответствующие детали заменены звеньями, соединяющими узловые точки механизма.

Отметим, что в учебной программной системе нет смысла давать ответы на вопрос, имеет ли система коммерческий интерес, чем она отличается от существующих, и тому подобное, но важно выяснить, какие алгоритмы и модули мы можем позаимствовать для решения поставленного задания. Здесь, в частности, можем использовать компоненты Delphi, а также вспомогательные модули, которые находятся на компакт-диске в папке

Kurs\Units”.

17

Fig. 2.2. Simplified kinematic scheme of

Рис. 2.2. Упрощенная кинематическая

mechanism

схема механизма

2.2 Task analysis

2.2 Анализ задачи

Изм. Лист № докум.

Crank 2 which rotates round the axis of

body 1 is driving mechanismРазрабlink. Crank. Пасічник2 and В.А. rocker 3 are joined with connectingПров. rod 4 which

fulfils motion transfer. Thus,Т.контрhaving. rotary motion of crank 2, rocker 3 fulfils oscillatory

motions.

In the course work theН. significantконтр. of the range length is pointed-out Утвby the. teacher. We will agree that center distance L shall be within the scope of 100 and 150 mm. Other dimensions are calculated exactly (D) or entered from the keyboard in a range which substantially depends on center distance L. It should be noted that the designed program should provide strict control of input data since incorrect data make it impossible to receive correct result.

Analysis of calculated relations should be conducted considering undesirable points in calculations. Division by zero and extraction of a root of negative number are the first to be the reason of it. From this point of view it is necessary to fulfill the following:

L1<>0, Lk<>0, <> , L>R, L2<>0.

Analysis of mechanism dimensions shows that input data control makes it impossible to divide by zero or extract the root of negative number, i.e. corresponding functions do not require additional data analysis.

Subsequent analysis is not required for educational course work since task statement has been sufficiently formalized and contains mathematic mechanism model.

Подп. Дата Кривошипно-коромисловий

Приводным звеном механизма является

кривошип 2, вращающийся вокругмеханізмоси корпуса 1. С кривошипом 2 та коромыслом 3 соединен

шатун 4, передающий движение. При вращательном движении кривошипа 2 коромысло 3 выполняет качательные движения.

В курсовой работе значения диапазонов длин указываются преподавателем.

Договоримся, чтоКопдиапазонровал межцентрового расстояния L находится в пределах от 100 до

150 мм. Значения остальных размеров либо рассчитываются точно (D), либо вводятся с клавиатуры в диапазоне, которой существенно зависит от межцентрового расстояния L. Программа должна обеспечить контроль введенной информации.

Анализ расчетных зависимостей нужно проводить с точки зрения возникновения нежелательных ситуаций во время расчетов. К таким ситуациям, например, относится деление на нуль и извлечение корня отрицательного числа. Нам следует обеспечить следующее:

L1<>0, Lk<>0, , L>R, L2<>0.

Анализ размеров механизма показывает, что контроль введенной информации исключает ситуации деления на нуль или извлечение корня отрицательного числа и соответствующие функции не нуждаются в дополнительном анализе.

Последующий анализ в учебной курсовой работе можно не проводить, ведь постановка задачи достаточно формализована и содержит математическую модель механизма.

Л

Ли

Фо

2.3 Algorithm making

2.3 Разработка алгоритма решения

Mechanism model is based on classic branched and cycle algorithms, as well as algorithms for determination of minimum and maximum value. The problem should be divided into single procedures which have much simpler algorithms.

Наличие зависимостей, определяющих модель механизма, позволяет опираться на классические разветвленные и циклические алгоритмы, а также алгоритмы нахождения наименьшего и наибольшего значения. Целесообразно разбить задачу на отдельные процедуры, алгоритмы которых будут существенно проще.

18

2.4 Development of structure, interface and coding of a program

The interactive system should provide frequent implementation of certain actions, therefore general system framework should be created, and program parts should be implemented in the form of single units.

Delphi-project uses standard Delphi components, procedures and functions of additional unit PV_Add.

2.4 Разработка структуры, интерфейса и кодирование программы

Диалоговая система должна обеспечивать многократное выполнение действий, поэтому целесообразно создать общую оболочку системы, а части программы реализовать в виде отдельных модулей.

Проект Delphi будет использовать стандартные компоненты Delphi и процедуры и функции дополнительного модуля PV_Add.

2.4.1 General project structure

2.4.1 Общая структура проекта

 

Delphi-project

Standards units and its

Main

components

 

Windows, Messages,

InputData

 

SysUtils, Variants,

OutputResult

Classes, Graphics,

 

Controls, Forms,

SimplyMech

Dialogs, StdCtrls,

 

Buttons

FullMech

 

 

Kinematika

Additional unit

Diagrams

 

PV_Add

AboutProgram

 

 

AboutAuthor

Fig. 2.3. General program structure

Рис. 2.3. Общая структура программы

Such structure is provided by using standard and additional units, as well as own user units in implementation section.

Такая структура может быть обеспечена тем, что в модуле Main в интерфейсной секции будут подключены стандартные и дополнительные модули, а в секции реализации – собственные модули пользователя.

unit Main; interface uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Menus, ImgList, PV_Add;

. . . . . . .

implementation

uses InputData, OutputResult, SimplyMech, FullMech, Kinematika, Diagrams, AboutProgram, AboutAuthor;

Main unit is assigned for making a whole system having the possibility of frequent implementation by means of certain actions. This unit contains basic variables and functions which describe mechanism work, as well as default parameter values.

.

Модуль Main предназначен для организации всей системы в единое целое с возможностью многократного вызова с помощью меню нужных действий. В модуле храняться базовые переменные и функции, описывающие работу механизма, а также значения параметров по умолчанию.

19

InputData unit is intended for the basic data input and viewing of checking information

OutputResult unit is assigned for output of results using 12 points, calculation and output of boundary values, saving results to text file.

SimplyMech unit is intended for drawing of simplified parametric scheme of mechanism with denotation of its parameters.

FullMech unit is intended for drawing of full parametric mechanism scheme with real dimensions.

Kinematics unit is intended for simulation of mechanism work according to simplified or full scheme.

Diagrams unit is intended for output of graphs showing relation between driven link and drving link position.

AboutProgram unit is intended for output of brief information about a mechanism and possibilities of program system.

AboutAuthor unit is intended for output of brief information about program author and organization program system is created in.

Such structuring allows step-by-step development of single units and connecting them with project afterwards.

Модуль InputData предназначен для ввода исходных данных и просмотра контрольной информации

Модуль OutputResult предназначен для вывода результатов по 12-ти точкам, расчета и вывода предельных значений, записи результатов в текстовый файл.

Модуль SimplyMech предназначен для рисования упрощенной параметрической схемы механизма с обозначением параметров.

Модуль FullMech предназначен для рисования полной параметрической схемы механизма с реальными размерами.

Модуль Kinematics предназначен для имитации работы упрощенной или полнойпараметрической схемы механизма.

Модуль Diagrams предназначен для рисования графиков зависимостей положения ведомого звена и передаточного отношения от положения ведущего звена.

Модуль AboutProgram предназначен для вывода краткой информации о механизме и возможностях программной системы.

Модуль AboutAuthor предназначен для вывода краткой информации об авторе программы и организации, в которой программная система была создана.

Такая структуризация позволит постепенно и независимо друг от друга разрабатывать модули, после чего подключать их проекту

2.4.2 Design of unit “Main”

2.4.2 Проектирование модуля Main

Main unit is intended for solving two

tasks.

The first task consists of discription of mechanism parameters, determination of defalt values, and record of functions determining mechanism work.

The second task consists of creating menu allowing implementation independent and frequent invoking of single system units.

Implementation of functions which determine mechanism operation are described as following:

Модуль Main предназначен для: решения двух задач.

Первая задача состоит в описании параметров механизма, определении их значений по умолчанию, записи функций, определяющих работу механизма.

Вторая задача состоит в создании меню, позволяющего реализовать независимый и многократный вызов отдельных модулей системы.

Рассмотрим, как в процессе решения первой задачи должны быть реализованы функции, определяющие работу механизма.

Mechanism parameters

Project implementation using Main unit requires description of variables of mechanism parameters and setting default values. Variable values are explained over the project creation. Program code with final variables and initial values is stated below.

Параметры механизма

Для реализации проекта в модуле Main следует описать переменные, соответствующие параметрам механизма и присвоить им значение по умолчанию. Значения переменных будут объясняться по ходу создания проекта. Ниже приведен код программы окончательного варианта переменных и их начальнх значений

.

var alfa,fi,u,R,D,B,L,L1,L2,Lk,mju:real;

alfaMin,alfaMax,fiMin,fiMax,uMin,UMax:real;

20

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]