Смекни!
smekni.com

Технологическая реализация системы подготовки обработки детали станка с числовым программным управлением (стр. 15 из 17)

21. Системная интеграция/Машиностроение СТА 3/2002 Николай Панышев, Дмитрий Ялымов "Система числового программного управления технологическим оборудованием".

22. Интернет источник. CALS-технологии. www.calscenter.com.

23. Интернет источник. Всемирная интернет энциклопедия. www.wikipedia.ru.

24. Интернет источник. Информационные системы. http://revolution./programming.

25. Интернет источник. Уфимский государственный авиационный технический университет. www.twirpx.com.

26. Интернет источник. SiemensSinumerik 840D. www.chipmaker.ru.

27. Интернет источник. Филиппович К.В. "Идеология постпроцессирования в современных CAD/CAM-системах" Россия, ООО Евразия Лимитед, 2000. www.sapr2000.ru


Приложение А

Исходный текст программного модуля:

programProject2; //Имя программы

uses //Объявление прикрепленных к проекту файлов

Forms,

Unit1 in 'Unit1.pas' {Form1},

Unit2 in 'Unit2.pas' {Form2},

Unit3 in 'Unit3.pas' {Form3},

Unit4 in 'Unit4.pas' {Form4},

Unit5 in 'Unit5.pas' {Form5},

Unit6 in 'Unit6.pas',

Unit7 in 'Unit7.pas' {Form7},

Unit8 in 'Unit8.pas' {Form8},

Unit9 in 'Unit9.pas' {Form9},

Unit10 in 'Unit10.pas',

Unit11 in 'Unit11.pas' {Form11},

Unit12 in 'Unit12.pas' {Form12},

Unit13 in 'Unit13.pas' {Form13},

Unit14 in 'Unit14.pas' {Form14},

Unit15 in 'Unit15.pas' {Form15},

Unit16 in 'Unit16.pas' {Form16},

Unit17 in 'Unit17.pas' {Form17};

var //объявление переменных

s:string; //назначение и присвоение типа переменных

ff:textfile;

{$R *.res} //директива компилятору подключить файл ресурсов

procedureInit_All; //объявление процедуры, относящейся ко всему проекту

begin

N_Ses:=1;

Init_Form2;

Form2.Caption:='ОперацияN 1';

Init_St_Det_Kr;

AssignFile(ff,path+'DAT\Stanok.dat'); //все параметры в проекта сохраняются в файл

reset(ff);

readln(ff,Xst[0]);

readln(ff,Yst[0]);

readln(ff,Zst[0]);

readln(ff,Ast[0]);

readln(ff,Bst[0]);

readln(ff,Cst[0]);

CloseFile(ff);

Init_Zag; //инициализация пользовательских функций

Init_Poly;

Init_Chk_Box;

Init_Traect(1);

Traect(1);

//Profile;

Init_Moving;

//Moving_9484;

Load_Op;

N_St:=0; N_Fin:=N_Pos[N_Act]; N_Last:=0;

Init_Data3('DAT\9484.txt'); //чтение данных из файла

Form3.Caption:='Начапьные установки';

Fill_Str_Grid1_3; //вставка стандартный элементов Windows

Init_Data4;

Fill_Str_Grid1_4;

Init_BitMap;

Draw_All;

Init_Data5;

Init_Data12;

Init_BitMap12;

Fill_Str_Grid3_12(1);

Fill_Str_Grid1_5;

Init_Data7;

Fill_Str_Grid1_7;

Step:=1;

str(Step:1:3,s);

Form8.Memo1.Text:=s;

Form8.Button17.Caption:='';

Nst_Act:=0;

Init_Zag;

Init_Data8;

Fill_Str_Grid1_8;

Fill_Str_Grid2_8;

Init_BitMap8;

Nkr_Edit:=1;

Init_BitMap9;

Cooling;

Fill_Str_Grid1_13;

N_Buff:=1;

Put_Buff(N_Buff);

Form3.Visible:=true;

Write_Zag;

Init_Data14;

Init_Data_15;

Init_Data_16;

end;

begin

Application.Initialize;

Application.CreateForm(TForm1, Form1); //создание вспомогательных окон

Application.CreateForm(TForm2, Form2);

Application.CreateForm(TForm3, Form3);

Application.CreateForm(TForm4, Form4);

Application.CreateForm(TForm5, Form5);

Application.CreateForm(TForm7, Form7);

Application.CreateForm(TForm8, Form8);

Application.CreateForm(TForm9, Form9);

Application.CreateForm(TForm11, Form11);

Application.CreateForm(TForm12, Form12);

Application.CreateForm(TForm13, Form13);

Application.CreateForm(TForm14, Form14);

Application.CreateForm(TForm15, Form15);

Application.CreateForm(TForm16, Form16);

Application.CreateForm(TForm17, Form17);

Init_All;

Application.Run;

end.

unit Unit1;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, StdCtrls, ComCtrls, Buttons, CheckLst, Grids,Math;

type

TForm1 = class(TForm)

Button1: TButton;

Memo1: TMemo;

Button8: TButton;

CheckListBox1: TCheckListBox;

Button2: TButton;

Button3: TButton;

StringGrid1: TStringGrid;

Button4: TButton;

Button5: TButton;

CheckListBox2: TCheckListBox;

Button6: TButton;

Button7: TButton;

Button9: TButton;

CheckListBox3: TCheckListBox;

Button10: TButton;

Button11: TButton;

Button12: TButton;

Button13: TButton;

Button14: TButton;

Button15: TButton;

Button16: TButton;

procedure Button3Click(Sender: TObject); //функциинажатиякнопок

procedure Button2Click(Sender: TObject);

procedure Button8Click(Sender: TObject);

procedure CheckListBox1ClickCheck(Sender: TObject);

procedure StringGrid1KeyPress(Sender: TObject; var Key: Char);

procedure Button4Click(Sender: TObject);

procedure Button5Click(Sender: TObject);

procedure Button6Click(Sender: TObject);

procedure CheckListBox2ClickCheck(Sender: TObject);

procedure Button7Click(Sender: TObject);

procedure Button9Click(Sender: TObject);

procedure CheckListBox3ClickCheck(Sender: TObject);

procedure Button10Click(Sender: TObject);

procedure Button12Click(Sender: TObject);

procedure Button13Click(Sender: TObject);

procedure Button14Click(Sender: TObject);

procedure CheckListBox1MouseDown(Sender: TObject; Button: TMouseButton;

Shift: TShiftState; X, Y: Integer);

procedure Button15Click(Sender: TObject);

procedure Button16Click(Sender: TObject);

procedure FormClose(Sender: TObject; var Action: TCloseAction);

private

{ Private declarations }

public

{ Public declarations }

end;

type

XYZ=record

x:real;

y:real;

Z:real;

end;

var

Form1: TForm1;

XYZ_D:XYZ;

X,Y,Z,A,B,C:real;

//start

Type_Tool:integer;

SM_X,SM_Y,SM_Z,POV_A,POV_B,SM_C:array[0..500] of real; //объявлениемассивов

Dkr,Rkr,Skr,Akr:array [1..11] ofreal; //для хранения вводимых параметров в сетке

Xkr,Ykr,Zkr,X1,Y1,Z1,dX,dY,dZ,XB1,YB1,ZB1,XB,YB,ZB:real;

{Ddet,}Rdet,Zst_B,Obr_Kon,FPL,Alf1,Alf2,Apodt,Dpodt,Wdet:real;

U_X,U_Y,U_Z1,U_Z2,UB_X,dRdet:array [1..11] of real;

N_Zub:integer;

Rvp,Lz,Lo,Lzt,Arp,Rp:real;

Zp_Kr:array [1..6,1..2] of real;

Np_Kr,Sb_Int:array [1..11] of integer;

FiC,Ftr,Teta,Ltr_P,Ltr_R,LC,X0,Y0,Z0:array[0..11] of real;

XC,YC,ZC,XT,YT,ZT,XD,YD,ZD,dA,dB,dC,V_D:real;

Xst,Yst,Zst,Ast,Bst,Cst:array [0..500] of real;

Xst_Old,Yst_Old,Zst_Old,Ast_Old,Bst_Old,Cst_Old:real;

N_Act,N_St,N_Fin,N_Last,Obr:integer;

FTime:real;

F,Feed:integer;

Nt,N_Pos:array [0..500] of integer; //заполнениемассивов

Com:array [0..500] of string[20];

ff1:textfile;

FName,ABS_OTN:string;

Xtr,Ytr,Ztr,X0det,Y0det,Z0det:array [0..10] of real;

dXC1,dYC1,dZC1,dX_PR,dY_PR,dZ_PR,Atr,Btr:real;

Rpr:array[1..10,1..2] of real;

Num_Op,Nex,N_C,N_Op,Nop:integer;

OutMet:array [0..500] of integer;

dFiex,dYex, dZex:array [0..100] of real;

Rex,A0ex,A1ex,Yex,dRex,Hstr,Akan:real;

{D_Auto_Calc,}Ds,Hrk,Xrk:array [1..10] of real;

Gp,Gs:array [1..2,1..10] of real;

//N_Cycl:array [1..10,1..2] of integer;

//Amin,Amax,AStep:array [1..7] of integer;

Num_Check:integer;

Zel,Yel:real;

ddZ,ddY:real;

N_Ses:integer;

Beta,X_P1,Y_P1,X_P2,Y_P2,Ld1,Ld2:real;

XXtr,YYtr,ZZtr:real;

rad:real;

N_Kr:integer;

Nkr,N_Razb,N_Sech,N_Sech_X:array [1..11] of integer;

Z0_Kr,Ust_D,Ust_VD:real;

path:string;

W,Hv,Fit_Init:array [1..11] of real;

Xv,Yv,Zv,Xv1,Yv1,Zv1,XvT,YvT,ZvT,Y_X,Z_X:array [0..50,0..2,0..5,0..100] of real;

N_Tr:integer;

Cut_Kr:array [0..20] of integer;

N_Cut,Vozvr:array [0..500] of integer;

Xkr4,Ykr4:array [1..4,0..4,0..100] of real;

Name_Op:array [1..20] of string;

Viz_Vt,Viz_Dim,Auto_Calc:array [1..20] of integer;

A_Hrk:real;

dy_Ex,dz_Ex:array [0..100] of real;

Comp_Y,Comp_Z:array [0..100] of real;

x_Out,y_Out,z_Out:array [0..100] of real;

Move_Out:integer;

dfex:array [1..11] of real;

Cool:integer;

dotv_Cool,D_Cool,Fi_Cool,Sm_Kan,Fos_Kan,Frad_Kan,A_Cool:real;

Opt_Surf:array [0..3] of string;

N_Opt:array [1..11] of integer;

NC_Act:integer;

X_NC,Y_NC,Z_NC,A_NC,B_NC,C_NC,DX_NC,DY_NC,DZ_NC,DA_NC:array [1..10] of real;

N_Dop_Act:integer;

Adov:array [1..11] of real;

N_Feed:integer;

Napr:array [0..11] of integer;

S_Napr:array[0..11] of string;

Name_Napr:array [1..3] of string;

X_Arc,Y_Arc,Z_Arc: real;

XC1_0,YC1_0,ZC1_0,XC2_0,YC2_0,ZC2_0,XP_0,YP_0,ZP_0,XR_0,YR_0,ZR_0:real;

Nz_Act:array [1..20,1..20] of integer;

Nz_Fi:array [0..20] of real;

X_Dop,Y_Dop,Z_Dop,A_Dop,B_Dop,C_Dop:array [1..10] of real;

FX_Dop,FY_Dop,FZ_Dop,FA_Dop,FB_Dop,FC_Dop:array [1..10] of real;

X_Pr,Y_Pr,Z_Pr,A_Pr,B_Pr,C_Pr:array [1..10,1..3] of real;

FX_Pr,FY_Pr,FZ_Pr,FA_Pr,FB_Pr,FC_Pr:array [1..10,1..3] of real;

X_Otv,Y_Otv,Z_Otv,A_Otv,B_Otv,C_Otv:array [1..10] of real;

FX_Otv,FY_Otv,FZ_Otv,FA_Otv,FB_Otv,FC_Otv:array [1..10] of real;

X_Cst,Y_Cst,Z_Cst,A_Cst,B_Cst,C_Cst:array [1..10] of real;

X_Cfin,Y_Cfin,Z_Cfin,A_Cfin,B_Cfin,C_Cfin:array [1..10] of real;

X_Cex,Y_Cex,Z_Cex,A_Cex,B_Cex,C_Cex:array [1..10] of real;

FX_C,FY_C,FZ_C,FA_C,FB_C,FC_C:array [1..10] of real;

Num_C:array [1..10] of integer;

X_Vix,Y_Vix,Z_Vix,A_Vix,B_Vix,C_Vix:array [1..10] of real;

FX_Vix,FY_Vix,FZ_Vix,FA_Vix,FB_Vix,FC_Vix:array [1..10] of real;

FX_Kor,FY_Kor,FZ_Kor,FA_Kor,FB_Kor,FC_Kor:real;

FX_Ust,FY_Ust,FZ_Ust,FA_Ust,FB_Ust,FC_Ust:real;

PosTime:array [1..10] of real;

Num_Vix:array [1..10] of integer;

AutoCalc:boolean;

AHrk,Av,Ak,Ap,Sp:array [1..2,1..10] of real;

Avt,AHrkt:array [1..10] of real;

Xpx,Ypx:array [1..3,0..50] of real;

N_Proection,N_Profile,XSect:integer;

CrsAlfa:array [1..2] of real;

RminX,RminY:array [1..10] of real;

TwoFi:real;

FiRmin:array [1..2,1..10] of real;

CrsFiBeg,CrsFiEnd:array [1..10,1..2] of real;

CrsXbeg,CrsYbeg,CrsXend,CrsYend,CrsZend:array [1..10,1..2] of real;

x_Pol,y_Pol,z_Pol,R_Pol,Fit_Pol:array [1..10,1..2,0..300] of real;

N_Pol:integer;

NBeg,NEnd:array [1..10,1..2] of integer;

AsectK,RminS:array [1..10] of real;

NsectK,N_PolK:array [1..10] of integer;

N_Auto,Auto_Tang:array[1..10] of integer;

Lzat1,Lzat2,Rzat,Hzat:array [1..10] of real;

ExtdY:array [1..50,1..10] of real;

Xzat_c,Yzat_c:array [1..10,1..50] of real;

CrossSect,Ntr,Ntr1:integer;

Zcont,Ycont:array [0..50,1..2,0..3] of real;

LpS,LpR:real;

N_ZP_PL:integer;

HkZP,HfZP,SfZP,RfZP,FiZp:array [1..10] of real;

SLent,SnLent,ALent,APovL,BPovL,XPovL,YPovL,ZPovL:array [1..10] of real;

N_Sect:boolean;

Edit_Op:integer;

N_OpGr,N_Link:array [1..10] of integer;

X_ZP_PL,Y_ZP_PL,dY_ZP_PL,A_ZP_PL:array [1..10] of real;

Z_ZP_PL:array [1..2,1..10] of real;

Nop_ZP_PL:integer;

GlDv:array [1..6,1..10] of integer;

fiAmax:real;

procedure Init_Chk_Box; //описаниепроцедурпостроцессора

procedure Init_St_Det_Kr;

procedure Init_Moving;

procedure Zatilok;

Procedure Init_Traect(i:integer);

procedure Traect(N_Act:integer);

procedure Memo_Out;

procedure W_Str(com:string);

function w_r(val:real;f1,f2:integer):string;

procedure G90;

procedure G91;

procedure G01;

procedure Profile;

procedure Load_Op_All;

procedure Load_Op;

procedure Fix_Det(V_D,UB_X,Ddet:real);

procedure Make_Krug(N_kr,m:integer);

procedure UpDate_ChkBox2;

procedure Make_Spind;

procedure Init_All;

implementation

uses Unit2,Unit3,Unit4,Unit5,Unit6,Unit10,Unit14, Unit8,Unit13,Unit12,

Unit7,Unit9,Unit15,Unit16,Unit17;

{$R *.dfm} //процедурареализации

var

Str_Rel:array [0..500] of string;

ff:text;

procedure Init_All;

var

s:string;

begin

path:=GetCurrentDir+'\';

N_Ses:=1;

Init_Form2;

Form2.Caption:='ОперацияN 1';

Init_St_Det_Kr;

Init_Zag;

Init_Poly;

Init_Chk_Box;

Init_Traect(1);

Traect(1);

//Profile;

Init_Moving;

//Moving_9484;

Load_Op;

N_St:=0; N_Fin:=N_Pos[N_Act]; N_Last:=0;

//Init_Data3('DAT\9484.txt');

Form3.Caption:='Начальныеустановки';

Fill_Str_Grid1_3;

Init_Data4;

Fill_Str_Grid1_4;

Init_BitMap;

Draw_All;

Init_Data5;

Init_Data12;

Init_BitMap12;

Fill_Str_Grid3_12(1);

Fill_Str_Grid1_5;

Init_Data7;

Fill_Str_Grid1_7;

Step:=1;

//str(Step:1:3,s);

Form8.Memo1.Text:=s;

Form8.Button17.Caption:='';

Nst_Act:=0;

Init_Zag;

Init_Data8;

Fill_Str_Grid1_8;

Fill_Str_Grid2_8;

Init_BitMap8;

//Nkr_Edit:=1;

Init_BitMap9;

Cooling;

Fill_Str_Grid1_13;

N_Buff:=1;

Put_Buff(N_Buff);

Form3.Visible:=true;

Write_Zag;

Init_Data14;

Init_Data_15;

Init_Data_16;

end;

procedure W_Str(com:string);

begin

Form1.Memo1.Lines.Add(com);

end;

function w_r(val:real;f1,f2:integer):string;

var

s:string;

begin

str(val:f1:f2,s);

w_r:=s;

end;

function w_i(val:integer;f1:integer):string;

var

s:string;

begin

str(val:f1,s);

w_i:=s;

end;

procedure Memo_Out;

var

s:string;

i,j:integer;

TotTime:real;

begin

Form1.Memo1.Clear;

Form1.Memo1.Visible:=false;

str(N_Pos[N_Act]:2,s);

W_Str('Кол-во позиций:0-'+s);

for i:=0 to N_Pos[N_Act] do

begin

W_Str('');

if i=0 then s:='';

if i>0 then s:='G01 '+Str_Rel[i];

W_Str('Поз.'+w_i(i,2)+':'+s);

W_Str(' АбсОтн');

W_Str('X='+w_r(Xst[i],9,3)+' '+w_r(SM_X[i],9,3));

W_Str('Y='+w_r(Yst[i],9,3)+' '+w_r(SM_Y[i],9,3));

W_Str('Z='+w_r(Zst[i],9,3)+' '+w_r(SM_Z[i],9,3));

W_Str('A='+w_r(Ast[i],9,3)+' '+w_r(POV_A[i],9,3));

W_Str('B='+w_r(Bst[i],9,3)+' '+w_r(POV_B[i],9,3));

W_Str('C='+w_r(Cst[i],9,3)+' '+w_r(SM_C[i],9,3));

end;

W_Str('**********************');

str(N_Act:1,s);

W_Str('Времяоп.'+s+' :'+w_i(trunc(PosTime[N_Act]),1)+''''+

w_r(frac(PosTime[N_Act])*60,2,0)+'"');

TotTime:=0;

for j:=1 to N_op do

TotTime:=TotTime+PosTime[j];

W_Str('Времяобщее:'+w_r(TotTime,2,3));

Form1.Memo1.Visible:=true;

end;

procedure Move(Os:char;len:real;part_name:string); //созданиеструктурыкадра

begin

writeln(ff1,'(position_pa :part_assembly :start ','"',part_name,'" ',

':select_done :translate :dir_len :',Os,' :len ',len:8:6,' :done ',

':pos_dynamic :dynamo-done)');

writeln(ff1,'(redraw_vp "vport1")');

end;

procedure Rotate(Os:char;angle:real;part_name:string);

begin