begin
per:=mash[i];
mash[i]:=mash[i+1];
mash[i+1]:=per; end;
ep93[1]:=(70/mash[6])*mas[1]; ep93[2]:=(70/mash[6])*mas[2]; ep93[3]:=(70/mash[6])*mas[3]; ep93[4]:=(70/mash[6])*(((l10*s1)+(l11*s2)+(l12*s3))/u4); ep93[5]:=(70/mash[6])*(((l11*s2)+(l12*s3))/u5); ep93[6]:=(70/mash[6])*((l12*s3)/u6);
pos9[1]:=abs(mas[1]); pos9[2]:=abs(mas[2]); pos9[3]:=abs(mas[3]); pos9[4]:=abs(((l10*s1)+(l11*s2)+(l12*s3))/u4); pos9[5]:=abs(((l11*s2)+(l12*s3))/u5); pos9[6]:=abs((l12*s3)/u6);
masif9[1]:=(mas[1]); masif9[2]:=(mas[2]); masif9[3]:=(mas[3]); masif9[4]:=(((l10*s1)+(l11*s2)+(l12*s3))/u4); masif9[5]:=(((l11*s2)+(l12*s3))/u5); masif9[6]:=((l12*s3)/u6);
for ii:=1 to 6 do
for i:=1 to 5 do
if ep91[i]<>0 then
if ep91[i]>ep91[i+1] then
begin
per:=ep91[i];
ep91[i]:=ep91[i+1];
ep91[i+1]:=per;
per:=ep92[i];
ep92[i]:=ep92[i+1];
ep92[i+1]:=per;
per:=ep93[i];
ep93[i]:=ep93[i+1];
ep93[i+1]:=per;
per:=masif9[i];
masif9[i]:=masif9[i+1];
masif9[i+1]:=per;
per:=pos9[i];
pos9[i]:=pos9[i+1];
pos9[i+1]:=per;
end;
masif9[1]:=masif9[1]*ep91[1]; masif9[2]:=masif9[1]+(masif9[2]*(ep91[2]-ep91[1])); masif9[3]:=masif9[2]+(masif9[3]*(ep91[3]-ep91[2])); masif9[4]:=masif9[3]+(masif9[4]*(ep91[4]-ep91[3])); masif9[5]:=masif9[4]+(masif9[5]*(ep91[5]-ep91[4])); masif9[6]:=masif9[5]+(masif9[6]*(ep91[6]-ep91[5]));
for i:=1 to 6 do chis9[i]:=masif9[i];
for i:=1 to 6 do mash[i]:=abs(masif9[i]);
for ii:=1 to 6 do
for i:=1 to 5 do
if mash[i]<>0 then
if mash[i]>mash[i+1] then
begin
per:=mash[i];
mash[i]:=mash[i+1];
mash[i+1]:=per; end;
for i:=1 to 6 do masif9[i]:=((70/mash[6])*masif9[i]);
end;
procedure TForm1.Button1Click(Sender: TObject); var Pic: TBitmap; i,prover:integer; dlin,kol:real; begin
if Form1.Edit1.Text<>'' then begin if Form1.Edit4.Text<>'' then begin if Form1.Edit2.Text<>'' then begin if Form1.Edit5.Text<>'' then begin if Form1.Edit3.Text<>'' then begin if Form1.Edit6.Text<>'' then begin if Form1.Edit7.Text<>'' then begin if Form1.Edit10.Text<>'' then begin if Form1.Edit8.Text<>'' then begin if Form1.Edit11.Text<>'' then begin if Form1.Edit9.Text<>'' then begin if Form1.Edit12.Text<>'' then begin
if (strtofloat(Form1.Edit4.Text)<>strtofloat(Form1.Edit5.Text)) and (strtofloat(Form1.Edit5.Text)<>strtofloat(Form1.Edit6.Text)) then begin if (Form1.Edit1.Text<>'0') and (Form1.Edit2.Text<>'0') and (Form1.Edit3.Text<>'0') then begin if (Form1.Edit7.Text<>'0') and (Form1.Edit8.Text<>'0') and (Form1.Edit9.Text<>'0') then begin if (Form1.Edit10.Text<>'0') and (Form1.Edit11.Text<>'0') and (Form1.Edit12.Text<>'0') then begin if Form1.Edit10.Text<>'0' then begin
if a=1 then dlin:=strtofloat(Form1.Edit1.Text); if a=2 then dlin:=strtofloat(Form1.Edit1.Text)+strtofloat(Form1.Edit2.Text); if a=3 then dlin:=strtofloat(Form1.Edit1.Text)+strtofloat(Form1.Edit2.Text)+strtofloat(Form1.Edit3.Text);
if b=1 then kol:=strtofloat(Form1.Edit7.Text); if b=2 then kol:=strtofloat(Form1.Edit8.Text); if b=3 then kol:=strtofloat(Form1.Edit9.Text);
prover:=0; if b=1 then prover:=1; if b=2 then begin
if strtofloat(Form1.Edit7.Text)<=strtofloat(Form1.Edit8.Text) then prover:=1;
end; if b=3 then begin
if (strtofloat(Form1.Edit7.Text)<=strtofloat(Form1.Edit8.Text)) and (strtofloat(Form1.Edit8.Text)<=strtofloat(Form1.Edit9.Text)) then prover:=1;
end;
if prover=1 then begin if dlin>=kol then begin
if Form4.ComboBox1.Text='Неограниченно' then else okr:=strtoint(Form4.ComboBox1.Text);
if a=1 then begin
ed1;
image2.Canvas.Brush.Color:=clWhite;
image2.Canvas.Brush.Style:=bsSolid;
image2.Canvas.Rectangle(0,0,600,667);
Form1.Memo1.Clear;
image1.Canvas.Brush.Color:=clWhite;
image1.Canvas.Brush.Style:=bsSolid;
image1.Canvas.Rectangle(0,0,630,667);
Pic:=Tbitmap.Create;
Pic.LoadFromFile('Fon.bmp');
Form1.image1.Canvas.Draw(60,105,Pic);
image1.Canvas.Brush.Color:=clBackground;
image1.Canvas.Brush.Style:=bsFDiagonal;
Form1.Image1.Canvas.Pen.Width:=2;
image1.Canvas.MoveTo(59,190);
image1.Canvas.LineTo(round(d12+58),190);
image1.Canvas.MoveTo(59,580);
image1.Canvas.LineTo(round(d12+58),580);
image1.Canvas.MoveTo(59,380);
image1.Canvas.LineTo(round(d12+58),380);
image1.Canvas.Rectangle(35,5,60,105);
image1.Canvas.Brush.Color:=clWindow;
image1.Canvas.Brush.Style:=bsClear;
image1.Canvas.Rectangle(59,30,round(d12+59),80);
Form1.Image1.Canvas.Pen.Width:=1;
Form1.Image1.Canvas.Pen.Style:=psDashDot;
image1.Canvas.MoveTo(59,5);
image1.Canvas.LineTo(59,667);
image1.Canvas.MoveTo(round(d12+58),30);
image1.Canvas.LineTo(round(d12+58),667);
Form1.Image1.Canvas.Pen.Style:=psSolid;
end; if a=2 then begin
ed2;
image2.Canvas.Brush.Color:=clWhite;
image2.Canvas.Brush.Style:=bsSolid;
image2.Canvas.Rectangle(0,0,600,667);
Form1.Memo1.Clear;
image1.Canvas.Brush.Color:=clWhite;
image1.Canvas.Brush.Style:=bsSolid;
image1.Canvas.Rectangle(0,0,630,667);
Pic:=Tbitmap.Create;
Pic.LoadFromFile('Fon.bmp');
Form1.image1.Canvas.Draw(60,105,Pic);
image1.Canvas.Brush.Color:=clBackground;
image1.Canvas.Brush.Style:=bsFDiagonal;
Form1.Image1.Canvas.Pen.Width:=2;
image1.Canvas.MoveTo(60,190);
image1.Canvas.LineTo(round(d22+58),190);
image1.Canvas.MoveTo(60,580);
image1.Canvas.LineTo(round(d22+58),580);
image1.Canvas.MoveTo(60,380);
image1.Canvas.LineTo(round(d22+58),380);
image1.Canvas.Rectangle(35,5,60,105);
image1.Canvas.Brush.Color:=clWindow;
image1.Canvas.Brush.Style:=bsClear;
image1.Canvas.Rectangle(59,round(r11),round(d12+60),round(r12));
image1.Canvas.Rectangle(round(d12+59),round(r21),round(d22+59),round(r22));
Form1.Image1.Canvas.Pen.Width:=1;
Form1.Image1.Canvas.Pen.Style:=psDashDot;
image1.Canvas.MoveTo(59,5);
image1.Canvas.LineTo(59,667);
image1.Canvas.MoveTo(round(d12+58),55);
image1.Canvas.LineTo(round(d12+58),667);
image1.Canvas.MoveTo(round(d22+58),55);
image1.Canvas.LineTo(round(d22+58),667);
Form1.Image1.Canvas.Pen.Style:=psSolid;
end; if a=3 then begin
ed3;
image2.Canvas.Brush.Color:=clWhite;
image2.Canvas.Brush.Style:=bsSolid;
image2.Canvas.Rectangle(0,0,600,667);
Form1.Memo1.Clear;
image1.Canvas.Brush.Color:=clWhite;
image1.Canvas.Brush.Style:=bsSolid;
image1.Canvas.Rectangle(0,0,630,667);
Pic:=Tbitmap.Create;
Pic.LoadFromFile('Fon.bmp');
Form1.image1.Canvas.Draw(60,105,Pic);
image1.Canvas.Brush.Color:=clBackground;
image1.Canvas.Brush.Style:=bsFDiagonal;
Form1.Image1.Canvas.Pen.Width:=2;
image1.Canvas.MoveTo(59,190);
image1.Canvas.LineTo(round(d32+58),190);
image1.Canvas.MoveTo(59,380);
image1.Canvas.LineTo(round(d32+58),380);
image1.Canvas.MoveTo(59,580);
image1.Canvas.LineTo(round(d32+58),580);
image1.Canvas.Rectangle(35,5,60,105);
image1.Canvas.Brush.Color:=clWindow;
image1.Canvas.Brush.Style:=bsClear;
image1.Canvas.Rectangle(59,round(r11),round(d12+59),round(r12));
image1.Canvas.Rectangle(round(d12+58),round(r21),round(d22+59),round(r22));
image1.Canvas.Rectangle(round(d22+58),round(r31),round(d32+59),round(r32));
Form1.Image1.Canvas.Pen.Width:=1;
Form1.Image1.Canvas.Pen.Style:=psDashDot;
image1.Canvas.MoveTo(59,5);
image1.Canvas.LineTo(59,667);
image1.Canvas.MoveTo(round(d32+58),55);
image1.Canvas.LineTo(round(d32+58),667);
image1.Canvas.MoveTo(round(d12+58),55);
image1.Canvas.LineTo(round(d12+58),667);
image1.Canvas.MoveTo(round(d22+58),55);
image1.Canvas.LineTo(round(d22+58),667);
Form1.Image1.Canvas.Pen.Style:=psSolid;
end;
Form1.Image1.Canvas.Pen.Style:=psDashDot; image1.Canvas.MoveTo(20,54); image1.Canvas.LineTo(585,54); Form1.Image1.Canvas.Pen.Style:=psSolid;
if s1=1 then begin
Pic:=Tbitmap.Create;
Pic.LoadFromFile('str2.bmp');
Form1.image1.Canvas.Draw(4,50,Pic);
end
else
begin
Pic:=Tbitmap.Create;
Pic.LoadFromFile('str1.bmp');
Form1.image1.Canvas.Draw(4,50,Pic);
end;
if b=1 then begin
si1;
if s1=1 then begin
image1.Canvas.MoveTo(round(58+p1),20);
image1.Canvas.LineTo(round(118+p1),20);
image1.Canvas.MoveTo(round(118+p1),20);
image1.Canvas.LineTo(round(113+p1),16);
image1.Canvas.MoveTo(round(118+p1),20);
image1.Canvas.LineTo(round(113+p1),24);
image1.Canvas.MoveTo(round(58+p1),20);
Form1.Image1.Canvas.Pen.Style:=psDashDot;
image1.Canvas.LineTo(round(58+p1),760);
Form1.Image1.Canvas.Pen.Style:=psSolid;
image1.Canvas.Rectangle(round(57+p1),19,round(60+p1),22);
Pic:=Tbitmap.Create;
Pic.LoadFromFile('F1.bmp');
Form1.image1.Canvas.Draw(round(48+p1),17,Pic);
end
else begin
image1.Canvas.MoveTo(round(58+p1),20);
image1.Canvas.LineTo(round(p1-10),20);
image1.Canvas.MoveTo(round(p1-10),20);
image1.Canvas.LineTo(round(p1-5),16);
image1.Canvas.MoveTo(round(p1-10),20);
image1.Canvas.LineTo(round(p1-5),24);
image1.Canvas.MoveTo(round(58+p1),20);
Form1.Image1.Canvas.Pen.Style:=psDashDot;
image1.Canvas.LineTo(round(58+p1),760);
Form1.Image1.Canvas.Pen.Style:=psSolid;
image1.Canvas.Rectangle(round(57+p1),19,round(60+p1),22);
Pic:=Tbitmap.Create;
Pic.LoadFromFile('F1.bmp');
Form1.image1.Canvas.Draw(round(62+p1),17,Pic);
end;
end;
if b=2 then begin
si2;
if s1=1 then begin
image1.Canvas.MoveTo(round(58+p1),11);
image1.Canvas.LineTo(round(58+p1+z1),11);
image1.Canvas.MoveTo(round(58+p1+z1),11);
image1.Canvas.LineTo(round(53+p1+z1),7);
image1.Canvas.MoveTo(round(58+p1+z1),11);
image1.Canvas.LineTo(round(53+p1+z1),15);
image1.Canvas.MoveTo(round(58+p1),11);
Form1.Image1.Canvas.Pen.Style:=psDashDot;
image1.Canvas.LineTo(round(58+p1),760);
Form1.Image1.Canvas.Pen.Style:=psSolid;
image1.Canvas.Rectangle(round(57+p1),10,round(60+p1),13);
Pic:=Tbitmap.Create;
Pic.LoadFromFile('F1.bmp');
Form1.image1.Canvas.Draw(round(48+p1),8,Pic);
end
else begin
image1.Canvas.MoveTo(round(58+p1),11);
image1.Canvas.LineTo(round(p1-z1+58),11);
image1.Canvas.MoveTo(round(p1-z1+58),11);
image1.Canvas.LineTo(round(p1-z1+64),7);
image1.Canvas.MoveTo(round(p1-z1+58),11);
image1.Canvas.LineTo(round(p1-z1+64),15);
image1.Canvas.MoveTo(round(58+p1),11);
Form1.Image1.Canvas.Pen.Style:=psDashDot;
image1.Canvas.LineTo(round(58+p1),760);
Form1.Image1.Canvas.Pen.Style:=psSolid;
image1.Canvas.Rectangle(round(57+p1),10,round(60+p1),13);
Pic:=Tbitmap.Create;
Pic.LoadFromFile('F1.bmp');
Form1.image1.Canvas.Draw(round(62+p1),8,Pic);
end;
if s2=1 then begin
image1.Canvas.MoveTo(round(58+p2),22);
image1.Canvas.LineTo(round(58+p2+z2),22);
image1.Canvas.MoveTo(round(58+p2+z2),22);
image1.Canvas.LineTo(round(53+p2+z2),18);
image1.Canvas.MoveTo(round(58+p2+z2),22);
image1.Canvas.LineTo(round(53+p2+z2),26);
image1.Canvas.MoveTo(round(58+p2),22);
Form1.Image1.Canvas.Pen.Style:=psDashDot;
image1.Canvas.LineTo(round(58+p2),760);
Form1.Image1.Canvas.Pen.Style:=psSolid;
image1.Canvas.Rectangle(round(57+p2),21,round(60+p2),24);
Pic:=Tbitmap.Create;
Pic.LoadFromFile('F2.bmp');
Form1.image1.Canvas.Draw(round(47+p2),19,Pic);
end
else begin
image1.Canvas.MoveTo(round(58+p2),22);
image1.Canvas.LineTo(round(p2-z2+58),22);
image1.Canvas.MoveTo(round(p2-z2+58),22);
image1.Canvas.LineTo(round(p2-z2+64),18);
image1.Canvas.MoveTo(round(p2-z2+58),22);
image1.Canvas.LineTo(round(p2-z2+64),26);
image1.Canvas.MoveTo(round(58+p2),22);
Form1.Image1.Canvas.Pen.Style:=psDashDot;
image1.Canvas.LineTo(round(58+p2),760);
Form1.Image1.Canvas.Pen.Style:=psSolid;
image1.Canvas.Rectangle(round(57+p2),21,round(60+p2),24);
Pic:=Tbitmap.Create;
Pic.LoadFromFile('F2.bmp');
Form1.image1.Canvas.Draw(round(62+p2),19,Pic);
end;
end;
if b=3 then begin
si3;
if s1=1 then begin
image1.Canvas.MoveTo(round(58+p1),5);
image1.Canvas.LineTo(round(58+p1+z1),5);
image1.Canvas.MoveTo(round(58+p1+z1),5);
image1.Canvas.LineTo(round(53+p1+z1),1);
image1.Canvas.MoveTo(round(58+p1+z1),5);
image1.Canvas.LineTo(round(53+p1+z1),9);
image1.Canvas.MoveTo(round(58+p1),5);
Form1.Image1.Canvas.Pen.Style:=psDashDot;
image1.Canvas.LineTo(round(58+p1),760);
Form1.Image1.Canvas.Pen.Style:=psSolid;
image1.Canvas.Rectangle(round(57+p1),4,round(60+p1),7);
Pic:=Tbitmap.Create;
Pic.LoadFromFile('F1.bmp');
Form1.image1.Canvas.Draw(round(48+p1),2,Pic);
end
else begin
image1.Canvas.MoveTo(round(58+p1),5);
image1.Canvas.LineTo(round(p1-z1+58),5);
image1.Canvas.MoveTo(round(p1-z1+58),5);
image1.Canvas.LineTo(round(p1-z1+64),1);
image1.Canvas.MoveTo(round(p1-z1+58),5);
image1.Canvas.LineTo(round(p1-z1+64),9);
image1.Canvas.MoveTo(round(58+p1),5);
Form1.Image1.Canvas.Pen.Style:=psDashDot;
image1.Canvas.LineTo(round(58+p1),760);
Form1.Image1.Canvas.Pen.Style:=psSolid;
image1.Canvas.Rectangle(round(57+p1),4,round(60+p1),7);
Pic:=Tbitmap.Create;
Pic.LoadFromFile('F1.bmp');
Form1.image1.Canvas.Draw(round(62+p1),2,Pic);
end;
if s2=1 then begin
image1.Canvas.MoveTo(round(58+p2),14);
image1.Canvas.LineTo(round(58+p2+z2),14);
image1.Canvas.MoveTo(round(58+p2+z2),14);
image1.Canvas.LineTo(round(53+p2+z2),18);
image1.Canvas.MoveTo(round(58+p2+z2),14);
image1.Canvas.LineTo(round(53+p2+z2),10);
image1.Canvas.MoveTo(round(58+p2),14);
Form1.Image1.Canvas.Pen.Style:=psDashDot;
image1.Canvas.LineTo(round(58+p2),760);
Form1.Image1.Canvas.Pen.Style:=psSolid;
image1.Canvas.Rectangle(round(57+p2),13,round(60+p2),16);
Pic:=Tbitmap.Create;
Pic.LoadFromFile('F2.bmp');
Form1.image1.Canvas.Draw(round(47+p2),11,Pic);
end
else begin
image1.Canvas.MoveTo(round(58+p2),14);
image1.Canvas.LineTo(round(p2-z2+58),14);
image1.Canvas.MoveTo(round(p2-z2+58),14);
image1.Canvas.LineTo(round(p2-z2+64),18);
image1.Canvas.MoveTo(round(p2-z2+58),14);
image1.Canvas.LineTo(round(p2-z2+64),10);
image1.Canvas.MoveTo(round(58+p2),14);
Form1.Image1.Canvas.Pen.Style:=psDashDot;
image1.Canvas.LineTo(round(58+p2),760);
Form1.Image1.Canvas.Pen.Style:=psSolid;
image1.Canvas.Rectangle(round(57+p2),13,round(60+p2),16);
Pic:=Tbitmap.Create;
Pic.LoadFromFile('F2.bmp');
Form1.image1.Canvas.Draw(round(62+p2),11,Pic);
end;
if s3=1 then begin
image1.Canvas.MoveTo(round(58+p3),23);
image1.Canvas.LineTo(round(58+p3+z3),23);
image1.Canvas.MoveTo(round(58+p3+z3),23);
image1.Canvas.LineTo(round(53+p3+z3),19);
image1.Canvas.MoveTo(round(58+p3+z3),23);
image1.Canvas.LineTo(round(53+p3+z3),27);
image1.Canvas.MoveTo(round(58+p3),23);
Form1.Image1.Canvas.Pen.Style:=psDashDot;
image1.Canvas.LineTo(round(58+p3),760);
Form1.Image1.Canvas.Pen.Style:=psSolid;
image1.Canvas.Rectangle(round(57+p3),22,round(60+p3),25);
Pic:=Tbitmap.Create;
Pic.LoadFromFile('F3.bmp');
Form1.image1.Canvas.Draw(round(47+p3),20,Pic);
end
else begin
image1.Canvas.MoveTo(round(58+p3),23);
image1.Canvas.LineTo(round(p3-z3+58),23);
image1.Canvas.MoveTo(round(p3-z3+58),23);
image1.Canvas.LineTo(round(p3-z3+64),19);
image1.Canvas.MoveTo(round(p3-z3+58),23);
image1.Canvas.LineTo(round(p3-z3+64),27);
image1.Canvas.MoveTo(round(58+p3),23);
Form1.Image1.Canvas.Pen.Style:=psDashDot;
image1.Canvas.LineTo(round(58+p3),760);
Form1.Image1.Canvas.Pen.Style:=psSolid;
image1.Canvas.Rectangle(round(57+p3),22,round(60+p3),25);
Pic:=Tbitmap.Create;
Pic.LoadFromFile('F3.bmp');
Form1.image1.Canvas.Draw(round(62+p3),20,Pic);
end;
end;
if b=1 then begin
si1;
Form1.Image1.Canvas.Pen.Width:=2;
Form1.Image1.Canvas.Pen.Color:=clRed;
Form1.Image1.Canvas.MoveTo(60,190);
Form1.Image1.Canvas.LineTo(60,190-round(sil7));
Form1.Image1.Canvas.LineTo(round(59+p1),190-round(sil7));