
- •Содержание диплома
- •1. Введение 3
- •2. Специальная часть. 8
- •3. Технология интеграции Windows – и dos – приложений 47
- •Назначение и возможности системы имитационного моделирования микросим.
- •Назначение и возможности свпим
- •Обоснование необходимости разработки подсистемы визуального отображения
- •Назначение и возможности подсистемы визуального отображения
- •Специальная часть.
- •Понятие е-сетей.
- •Общая характеристика модифицированных е-сетей
- •Понятие элементарной сети
- •Правила функционирования элементарных сетей
- •Элементарная сеть типа t
- •Элементарная сеть типа y
- •Элементарная сеть типа X
- •Элементарная сеть типа g
- •Элементарная сеть типа I
- •Структура системы микросим.
- •Креативная подсистема
- •Запуск и работа в креативной среде
- •Выбор операции или серии операций
- •Исполнительная подсистема.
- •Модули исполнительной подсистемы микросим.
- •Взаимодействие микросим и свпим.
- •Определение способа взаимодействия
- •Взаимодействия микросим и свпим.
- •Запись состояния модели в файл.
- •Алгоритм функционирования интерпретатора сетевых моделей
- •Трассировка модели
- •Структура свпим
- •Общая структура программы
- •Графическое представление сегмента в свпим
- •Компоненты е-сети
- •Структура подсистемы визуального отображения
- •Обработка файла созданного микросим
- •Начальная маркировка модели
- •Визуальное отображение
- •Пошаговое выполнение
- •Коэффициент визуальной задержки
- •Заключение
- •Технология интеграции Windows – и dos – приложений
- •Введение
- •Интеграция Dos – и Windows – приложений
- •Объединение микросим и свпим
- •Создание программ на Delphi
- •Перевод приложения на язык Delphi
- •Создание нового интерфейса
- •Написание кода для обработчиков событий
- •Прохождение задания в интегрированной в свпим системе микросим
- •Работа в креативной подсистеме
- •Работа в исполнительной подсистеме
- •Процесс визуального отображения интерпретации модели
- •Просмотр результатов моделирования
- •Оценка конкурентоспособности изделий
- •Введение
- •Анализ конкурентоспособности изделий.
- •Порядок проведения оценки конкурентоспособности товара
- •Оценка конкурентоспособности моделирующей системы microsim.
- •Изучение рынка
- •Требования к программному обеспечению
- •Определение цели анализа конкурентоспособности
- •Анализ нормативных параметров
- •Сравнительные характеристики системы микросим и gpss
- •Сравнительные характеристики исследуемых моделей по экономическим параметрам.
- •Заключение
- •Санитарно – гигиенические условия труда на рабочем месте пользователя эвм
- •Введение
- •Неблагоприятные факторы
- •Электроопасность и пожароопасность
- •Шумы и вибрации
- •Микроклимат
- •Освещенность
- •Расчет искусственного освещения
- •Организационные мероприятия по созданию условий безопасного труда
- •Психофизиологические факторы
- •Используемая литература
- •Приложение а Подпрограмма визуального отображения.
Приложение а Подпрограмма визуального отображения.
procedure TMainForm.SpeedButtonModelierenClick(Sender: TObject);
label konets,konets1;
type
OneLine= Record
Segment: string;
Perehod: string;
Ttime: real;
Ddelay: real;
FromPos: String;
FromCount: integer;
ToPos: string;
ToCount:integer;
end;
var
TransitionList:TList;
OneRec,one1rec: OneLine;
POneRec: ^OneLine;
F: TextFile;
S,segm,perehod,inputpos,outpos,timestr,timeunit, delaystr, delayunit: string;
i,j,m,prevpos,tmppos,inputfish, outfish, timme, delay:integer;
enablearr:array[1..15] of boolean;
OldNet:TNetObj;
OldPos:TPosObj;
k,tiime:extended;
sr:TSearchRec;
found,found1,result:integer;
dl:char;
dir,per:string;
begin
ModelNameRequest.ShowModal;
if ModelNameRequest.ModalResult<>mrOk then
begin
// SpeedButtonModelieren.Enabled:=true;
exit;
end;
found1:=1;
dir:='';
for dl:='c' to 'z' do
if findfirst(uppercase(dl+':\microsim\bin'),faAnyFile,sr)=0 then
begin
dir:=dl+':\microsim\bin\';
found1:=0;
break;
end;
SysUtils.FindClose(sr);
AssignFile(F, dir+ModelNameRequest.Edit1.Text+'.log');
Reset(F);
SpeedButtonModelieren.Visible:=false;
SpeedButtonStop.Visible:=true;
DecimalSeparator:='.';
TransitionList:=TList.Create;
breakModelieren:=false;
Readln(F, S);
Readln(F, S);
while not(EOF(F)) do
begin
Readln(F, S);
new(POneRec);
OneRec.segment:=s[1];
delete(S,1,1);
prevpos:=pos(' ',s);
while (pos(' ',s)-prevpos)=0 do
begin
tmppos:=pos(' ',s);
delete(S,pos(' ',s),1);
prevpos:=tmppos;
end;
OneRec.perehod:=copy(S,1,(pos(' ',s)-prevpos));
delete(s,1,pos(' ',s)-prevpos);
prevpos:=pos(' ',s);
while (pos(' ',s)-prevpos)=0 do
begin
tmppos:=pos(' ',s);
delete(S,pos(' ',s),1);
prevpos:=tmppos;
end;
OneRec.Ttime:=strtofloat(copy(S,1,pos(' ',s)-prevpos));
delete(s,1,pos(' ',s)-prevpos);
prevpos:=pos(' ',s);
while (pos(' ',s)-prevpos)=0 do
begin
tmppos:=pos(' ',s);
delete(S,pos(' ',s),1);
prevpos:=tmppos;
end;
// timeunit:=copy(S,1,pos(' ',s)-prevpos);
delete(s,1,pos(' ',s)-prevpos);
prevpos:=pos(' ',s);
while (pos(' ',s)-prevpos)=0 do
begin
tmppos:=pos(' ',s);
delete(S,pos(' ',s),1);
prevpos:=tmppos;
end;
OneRec.Ddelay:=strtofloat(copy(S,1,pos(' ',s)-prevpos));
delete(s,1,pos(' ',s)-prevpos);
prevpos:=pos(' ',s);
while (pos(' ',s)-prevpos)=0 do
begin
tmppos:=pos(' ',s);
delete(S,pos(' ',s),1);
prevpos:=tmppos;
end;
// delayunit:=copy(S,1,pos(' ',s)-prevpos);
delete(s,1,pos(' ',s)-prevpos);
prevpos:=pos(' ',s);
while (pos(' ',s)-prevpos)=0 do
begin
tmppos:=pos(' ',s);
delete(S,pos(' ',s),1);
prevpos:=tmppos;
end;
OneRec.FromPos:=copy(S,1,pos(' ',s)-prevpos);
delete(s,1,pos(' ',s)-prevpos);
prevpos:=pos(' ',s);
while (pos(' ',s)-prevpos)=0 do
begin
tmppos:=pos(' ',s);
delete(S,pos(' ',s),1);
prevpos:=tmppos;
end;
OneRec.FromCount:=strtoint(copy(S,1,pos(' ',s)-prevpos));
delete(s,1,pos(' ',s)-prevpos);
prevpos:=pos(' ',s);
while (pos(' ',s)-prevpos)=0 do
begin
tmppos:=pos(' ',s);
delete(S,pos(' ',s),1);
prevpos:=tmppos;
end;
OneRec.ToPos:=copy(S,1,pos(' ',s)-prevpos);
delete(s,1,pos(' ',s)-prevpos);
prevpos:=pos(' ',s);
while (pos(' ',s)-prevpos)=0 do
begin
tmppos:=pos(' ',s);
delete(S,pos(' ',s),1);
prevpos:=tmppos;
end;
OneRec.ToCount:=strtoint(copy(S,1,length(s))); //last word
delete(s,1,pos(' ',s)-prevpos);
POneRec^:=OneRec;
TransitionList.Add(POneRec);
Application.ProcessMessages;
if breakModelieren then begin
CloseFile(F);
goto konets;
end;
end;
CloseFile(F);
for j:=0 to (ActiveMDIChild as TChildForm).GraphSegm.ListPos.Count-1 do
begin
TPosObj((ActiveMDIChild as TChildForm).GraphSegm.ListPos.Items[j]).NumPoints:=0;
TPosObj((ActiveMDIChild as TChildForm).GraphSegm.ListPos.Items[j]).ResetCurrent;
end;
for j:=0 to (ActiveMDIChild as TChildForm).GraphSegm.ListNet.Count-1 do
TNETObj((ActiveMDIChild as TChildForm).GraphSegm.ListNet.Items[j]).resetpassed;
//start points
for i:=0 to TransitionList.Count -1 do
begin
if (OneLine(TransitionList.Items[i]^). Ttime -OneLine(TransitionList.Items[i]^).Ddelay) = 0 then
begin
for j:=0 to (ActiveMDIChild as TChildForm).GraphSegm.ListPos.Count-1 do
begin
if TPosObj((ActiveMDIChild as TChildForm).GraphSegm.ListPos.Items[j]).GetObjectNameNum=OneLine(TransitionList.Items[i]^).FromPos then
begin
TPosObj((ActiveMDIChild as TChildForm).GraphSegm.ListPos.Items[j]).setcurrent;
(ActiveMDIChild as TChildForm).GraphSegm.paint;
end;
end;
//====
for j:=0 to (ActiveMDIChild as TChildForm).GraphSegm.ListNet.Count-1 do
begin
for m:=i+1 to TransitionList.Count -1 do
begin
if (OneLine(TransitionList.Items[m]^).ToPos)=OneLine(TransitionList.Items[i]^).FromPos then
begin
per:=OneLine(TransitionList.Items[m]^).Perehod;
break;
end;
end;
if TNetObj((ActiveMDIChild as TChildForm).GraphSegm.ListNet.Items[j]).GetObjectNameNum=OneLine(TransitionList.Items[i]^).Perehod then//per then
begin
TNetObj((ActiveMDIChild as TChildForm).GraphSegm.ListNet.Items[j]).setpassed;
(ActiveMDIChild as TChildForm).GraphSegm.paint;
end;
end;
//====
end;
end;
//delay
k:=0;
while k<119999 do
begin
k:=k+1;
application.processmessages;
if breakmodelieren then goto konets;
end;
i:=0;
while i< TransitionList.Count -1 do
begin
k:=0;
while k<OneLine(TransitionList.Items[i]^).Ddelay*29999 do
begin
k:=k+1;
application.processmessages;
if breakmodelieren then goto konets;
end;
tiime:=(OneLine(TransitionList.Items[i]^).Ttime);
StatusLine.SimpleText:='Current modeling time: '+floattostr(tiime);
while (OneLine(TransitionList.Items[i]^).Ttime) = tiime do
begin
k:=0;
while k<99999 do
begin
k:=k+1;
application.processmessages;
if breakmodelieren then goto konets;
end;
application.processmessages;
for j:=0 to (ActiveMDIChild as TChildForm).GraphSegm.ListPos.Count-1 do
begin
if TPosObj((ActiveMDIChild as TChildForm).GraphSegm.ListPos.Items[j]).GetObjectNameNum=OneLine(TransitionList.Items[i]^).FromPos then
begin
if TPosObj((ActiveMDIChild as TChildForm).GraphSegm.ListPos.Items[j]).TypePos=QPos then
TPosObj((ActiveMDIChild as TChildForm).GraphSegm.ListPos.Items[j]).removepoint;
if TPosObj((ActiveMDIChild as TChildForm).GraphSegm.ListPos.Items[j]).NumPoints=0 then
TPosObj((ActiveMDIChild as TChildForm).GraphSegm.ListPos.Items[j]).resetcurrent;
(ActiveMDIChild as TChildForm).GraphSegm.paint;
end;
if TPosObj((ActiveMDIChild as TChildForm).GraphSegm.ListPos.Items[j]).GetObjectNameNum=OneLine(TransitionList.Items[i]^).ToPos then
begin
TPosObj((ActiveMDIChild as TChildForm).GraphSegm.ListPos.Items[j]).setcurrent;
if TPosObj((ActiveMDIChild as TChildForm).GraphSegm.ListPos.Items[j]).TypePos=QPos then
TPosObj((ActiveMDIChild as TChildForm).GraphSegm.ListPos.Items[j]).addpoint;
(ActiveMDIChild as TChildForm).GraphSegm.paint;
end;
end;
for j:=0 to (ActiveMDIChild as TChildForm).GraphSegm.ListNet.Count-1 do
begin
for m:=i+1 to TransitionList.Count -1 do
begin
if (OneLine(TransitionList.Items[m]^).FromPos)=OneLine(TransitionList.Items[i]^).ToPos then
begin
per:=OneLine(TransitionList.Items[m]^).Perehod;
break;
end;
end;
if TNetObj((ActiveMDIChild as TChildForm).GraphSegm.ListNet.Items[j]).GetObjectNameNum=per then
begin
TNetObj((ActiveMDIChild as TChildForm).GraphSegm.ListNet.Items[j]).setpassed;
(ActiveMDIChild as TChildForm).GraphSegm.paint;
end;
if TNetObj((ActiveMDIChild as TChildForm).GraphSegm.ListNet.Items[j]).GetObjectNameNum=OneLine(TransitionList.Items[i]^).Perehod then
begin
for m:=0 to (ActiveMDIChild as TChildForm).GraphSegm.ListPos.Count-1 do
if TPosObj((ActiveMDIChild as TChildForm).GraphSegm.ListPos.Items[m]).GetObjectNameNum=OneLine(TransitionList.Items[i]^).FromPos then
if (TPosObj((ActiveMDIChild as TChildForm).GraphSegm.ListPos.Items[m]).TypePos<>QPos) or
(TPosObj((ActiveMDIChild as TChildForm).GraphSegm.ListPos.Items[m]).numpoints=0) then
TNetObj((ActiveMDIChild as TChildForm).GraphSegm.ListNet.Items[j]).resetpassed;
(ActiveMDIChild as TChildForm).GraphSegm.paint;
end;
end;
inc(i);
end;
//
end;
{ for j:=0 to (ActiveMDIChild as TChildForm).GraphSegm.ListNet.Count-1 do
begin
if TNetObj((ActiveMDIChild as TChildForm).GraphSegm.ListNet.Items[j]).GetObjectNameNum=perehod then
begin
if OldNet<>nil then OldNet.ResetPassed;
TNetObj((ActiveMDIChild as TChildForm).GraphSegm.ListNet.Items[j]).setpassed;
OldNet:=TNetObj((ActiveMDIChild as TChildForm).GraphSegm.ListNet.Items[j]);
(ActiveMDIChild as TChildForm).GraphSegm.paint;
end;
showmessage(TNetObj((ActiveMDIChild as TChildForm).GraphSegm.ListNet.Items[j]).GetObjectNameNum+' '+inttostr((ActiveMDIChild as TChildForm).GraphSegm.ListNet.Count));
end;
// showmessage('#'+segm+'# #'+perehod+'# #'+timestr+'# #'+timeunit+'# #'+delaystr+'# #'+delayunit+'# #'+inputpos+'# #'+inttostr(inputfish)+'# #'+outpos+'# #'+inttostr(outfish)+'#');
}
konets:
TransitionList.free;
if messagedlg('Удалить '+ModelNameRequest.Edit1.Text+'.log?', mtConfirmation,
[mbYEs,mbNo], 0)=mrOk then DeleteFile(pchar(dir+ModelNameRequest.Edit1.Text+'.log'));
SpeedButtonModelieren.Visible:=true;
SpeedButtonStop.Visible:=false;
end;
procedure TMainForm.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
// if key=VK_ESCAPE then breakModelieren:=true;
end;
procedure TMainForm.SpeedButtonStopClick(Sender: TObject);
begin
breakmodelieren:=true;
end;