Приложение 4
Листинг тестирующего приложения
{===== Проект " Шлюз ВТК-12 " =======}
{ Тестирующее приложение (эмулятор ИСУМ) }
{ ОАО "Морион" ИТЦ СТ 2003г. }
{ Автор: Бажгин М.С. }
{=========================================}
unit unittest;
interface
uses
Windows, SysUtils, Classes, StdCtrls, Controls, Forms,
shlusobj, ExtCtrls, FileCtrl;
type
TFormMain = class(TForm)
Edit: TEdit;
DirectoryListBox1: TDirectoryListBox;
MemoCfg: TMemo;
ButtonScan: TButton;
DriveComboBox1: TDriveComboBox;
ListBoxIP: TListBox;
ButtonView: TButton;
MemoUnit: TMemo;
procedure ButtonScanClick(Sender: TObject);
procedure DriveComboBox1Change(Sender: TObject);
procedure ButtonViewClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FormMain: TFormMain;
implementation
{$R *.DFM}
//описание интерфейсных функцию шлюза
Function GetGateInfo:PChar; stdcall; external 'gate.dll';
Function GetNEData(index: LongInt; var List: TList):Byte; stdcall; external 'gate.dll';
Procedure GateInit(idGate:word; Path:PChar; var NEList:TStringList); stdcall; external 'gate.dll';
Procedure GateClose; stdcall; external 'gate.dll';
//-------------------------------------------------------------------------
procedure TFormMain.FormCreate(Sender: TObject);
begin
MemoUnit.Lines.Add('Подключенные модули:');
MemoUnit.Lines.Add(' gate.dll - '+GetGateInfo);
end;
//-------------------------------------------------------------------------
procedure TFormMain.ButtonScanClick(Sender: TObject);
var i:longword;
s:string;
tmpList:TStringList;
begin
Edit.Text:='Ждите';
Edit.Update;
s:=DirectoryListBox1.Directory;
if s[length(s)]='\' then s:=copy(s,1,Length(s)-1);
tmpList:=TStringList.Create;
GateInit(1,PChar(s),tmpList);
Edit.Text:='Количество конфигураций: '+IntToStr(tmpList.Count);
ListBoxIP.Items.Clear;
for i:=1 to tmpList.Count do
ListBoxIP.Items.Add(tmpList.strings[i-1]);
end;
//-------------------------------------------------------------------------
procedure Encode(List:TList);
procedure AddMemo(s:string);
begin
FormMain.MemoCfg.Lines.Add(s);
end;
var i:integer;
s:string;
tmpNE:TNE;
tmpCPack:TCPack;
tmpAG: TAG;
tmpTTPBid:TTTPBid;
tmpTTPSink:TTTPSink;
tmpTTPSource:TTTPSource;
tmpLinkEndSource:TLinkEndSource;
tmpLinkEndSink:TLinkEndSink;
tmpCTPSource:TCTPSource;
tmpCTPSink:TCTPSink;
begin
if List.Count=0 then exit;
FormMain.MemoCfg.Visible:=false;
FormMain.MemoCfg.Lines.Clear;
for i:=0 to List.Count-1 do
begin
case TTop(List[i]).TypeOBJ of
cNE:
begin
tmpNE:=List[i];
AddMemo('NE ID:'+IntToStr(tmpNE.ID)+'; Type:'+tmpNE.TypeNE+'; Name:'+tmpNE.Name+'; Packs:'+IntToStr(tmpNE.numCPacks)+'; AG:'+IntToStr(tmpNE.numAGs)+'; LinkEnd:'+IntToStr(tmpNE.numLinkEnds));
end;
cCPack:
begin
tmpCPack:=List[i];
AddMemo(' CPack ID:'+IntToStr(tmpCPack.ID)+'; Type:'+tmpCPack.TypecPack);
end;
cAG:
begin
tmpAG:=List[i];
AddMemo(' AG ID:'+IntToStr(tmpAG.ID)+'; TTP Count:'+IntToStr(tmpAG.numTTPs));
end;
cTTPBid:
begin
tmpTTPBid:=List[i];
AddMemo(' TTPBid ID:'+IntToStr(tmpTTPBid.ID)+'; Name:'+tmpTTPBid.Name+'; TTPSource_ID:'+IntToStr(tmpTTPBid.TTPSource_ID)+'; TTPSink_ID:'+IntToStr(tmpTTPBid.TTPSink_ID));
end;
cTTPSource:
begin
tmpTTPSource:=List[i];
case tmpTTPSource.SignalID of
e0CI: s:='e0CI';
e1CI: s:='e1CI';
end;
AddMemo(' TTPSource ID:'+IntToStr(tmpTTPSource.ID)+'; Name:'+tmpTTPSource.Name+'; TP_ID:'+IntToStr(tmpTTPSource.tp_id)+'; CPack_ID:'+IntToStr(tmpTTPSource.cPack_id)+'; LE_ID:'+IntToStr(tmpTTPSource.linkend_id)+'; Signal:'+s);
end;
cTTPSink:
begin
tmpTTPSink:=List[i];
case tmpTTPSink.SignalID of
e0CI: s:='e0CI';
e1CI: s:='e1CI';
end;
AddMemo(' TTPSink ID:'+IntToStr(tmpTTPSink.ID)+'; Name:'+tmpTTPSink.Name+'; TP_ID:'+IntToStr(tmpTTPSink.tp_id)+'; CPack_ID:'+IntToStr(tmpTTPSink.cPack_id)+'; LE_ID:'+IntToStr(tmpTTPSink.linkend_id)+'; Signal:'+s);
end;
cLinkEndSource:
begin
tmpLinkEndSource:=List[i];
AddMemo(' LinkEndSource ID:'+IntToStr(tmpLinkEndSource.ID)+'; TP_ID:'+IntToStr(tmpLinkEndSource.TTP_id)+'; CTP Count:'+IntToStr(tmpLinkEndSource.numCTPs));
end;
cLinkEndSink:
begin
tmpLinkEndSink:=List[i];
AddMemo(' LinkEndSink ID:'+IntToStr(tmpLinkEndSink.ID)+'; TP_ID:'+IntToStr(tmpLinkEndSink.TTP_id)+'; CTP Count:'+IntToStr(tmpLinkEndSink.numCTPs));
end;
cCTPSource:
begin
tmpCTPSource:=List[i];
case tmpCTPSource.SignalID of
e0CI: s:='e0CI';
e1CI: s:='e1CI';
end;
AddMemo(' CTPSource ID:'+IntToStr(tmpCTPSource.ID)+'; TP_ID:'+IntToStr(tmpCTPSource.tp_id)+'; CPack_ID:'+IntToStr(tmpCTPSource.cPack_id)+'; Signal:'+s);
end;
cCTPSink:
begin
tmpCTPSink:=List[i];
case tmpCTPSink.SignalID of
e0CI: s:='e0CI';
e1CI: s:='e1CI';
end;
AddMemo(' CTPSink ID:'+IntToStr(tmpCTPSink.ID)+'; TP_ID:'+IntToStr(tmpCTPSink.tp_id)+'; CPack_ID:'+IntToStr(tmpCTPSink.cPack_id)+'; Signal:'+s);
end;
end;
end;
FormMain.MemoCfg.Visible:=true;
end;
//-------------------------------------------------------------------------
procedure TFormMain.ButtonViewClick(Sender: TObject);
var List:TList;
i:integer;
begin
List:=TList.Create;
i:=GetNEData(ListBoxIP.ItemIndex+1,List);
if i=0 then
Encode(List);
Edit.Text:='Код ошибки: '+IntToStr(i);
List.Clear;
List.Free;
end;
end.
- Аннотация
- Annotation введение.
- 1. Единая система мониторинга и администрирования (есма)
- 1.1. Цель создания и назначение есма
- 1.2. Основные принципы построения есма
- 1.3. Архитектура есма
- 1.3.1. Общая архитектура системы управления и мониторинга
- 1.3.2. Информационная модель есма
- 1.3.3. Агент-шлюз
- 1.3.4. Протокол взаимодействия
- 1.3.5. Структура сум
- 1.3.6. Структура асум-Пр
- 2.4. Требования к составу и параметрам технических средств
- 3. Разработка информационной модели втк-12
- 3.1. Аппаратура цифровой системы передачи данных втк-12
- 3.1.1. Назначение аппаратуры
- 3.1.2. Технические характеристики
- 3.1.3. Состав аппаратуры втк-12
- 3.1.4. Устройство аппаратуры втк-12
- 3.1.5. Описание и работа составных частей изделия
- 3.1.5.1. Описание и работа блока втк-12
- 3.1.5.2. Описание и работа платы вк-16
- 3.1.5.3. Описание и работа платы ок-14
- 3.1.5.4. Описание и работа платы вд-14
- 3.3. Определение классов для информационной модели
- 3.3.1. Классы объектов и наследование
- 3.3.2. Принципы включения и наследования
- 3.3.3. Выбор структуры объектов (классов).
- 3.3.3.1. Сетевой элемент (Network Element)
- 3.3.3.2. Платы канальных окончаний (Circuit Pack)
- 3.3.3.3. Группы доступа (Access Group)
- 3.3.3.4. Точки доступа в сеть (Trail Termination Point)
- 3.3.3.5. Link End
- 3.3.3.6. Точка окончания соединения (Connection Termination Point)
- 3.4. Правила присвоения идентификаторов.
- 4. Разработка шлюза
- 4.1. Принцип работы шлюза
- 4.2. Структура файлов конфигурации
- 4.2.1. Файл описания плат ок/вд (vtk.Cfg)
- 4.2.2. Файл коммутации (switch.Cfg)
- 4.3. Использование библиотек (dll)
- 4.4. Реализация интерфейсных функций
- 4.4.1. ФункцияGateInit
- 4.4.2. ФункцияGetNeData.
- 4.4. Создание тестирующего приложения.
- 5. Экономическое обоснование дипломного проекта
- 5.1. Расчет затрат на создание программного продукта.
- 5.1.1. Расчет трудоемкости
- 5.1.2. Определение себестоимости разработки
- 5.2. Сетевое планирование
- 6. Организация безопасных условий труда оператора эвм
- 6.1. Анализ условий труда оператора эвм
- 6.2. Оборудование рабочего места оператора эвм
- 6.3. Меры борьбы с вредными воздействиями.
- 6.3.1. Санитарные нормы и стандарты безопасности
- 6.3.2. Средства защиты пользователей от эмп
- 6.3.3. Требование к видеодисплейным терминалам и пэвм
- 6.3.4. Требования к помещениям с эвм.
- 6.3.5. Требования к микроклимату помещений эксплуатации мониторов и пэвм.
- 6.3.6. Требования к шуму
- 6.3.7. Требования к освещению помещений и рабочих мест с мониторами и пэвм.
- 6.4. Расчет системы искусственного освещения
- 6.4.1. Описание помещения, в котором располагается рабочее место.
- 6.4.2. Расчет освещения рабочего места.
- Заключение
- Список литературы
- Приложение 1
- Приложение 2 Блок-схема процедуры GateInit
- Приложение 3
- Приложение 3
- Приложение 4