- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
//это как бы сортировка приоритетов
Try
Prior1:=StrToInt(Edit1.Text);
Prior2:=StrToInt(Edit2.Text);
Prior3:=StrToInt(Edit3.Text);
Prior4:=StrToInt(Edit4.Text);
Prior5:=StrToInt(Edit5.Text);
except
ShowMessage('Íåâåðíî çàäàíû ïðèîðèòåòû'); exit;
end;
min1:=100;
If prior1<min1 then begin min1:=prior1; nmin1:=1; end;
If prior2<min1 then begin min1:=prior2; nmin1:=2; end;
If prior3<min1 then begin min1:=prior3; nmin1:=3; end;
If prior4<min1 then begin min1:=prior4; nmin1:=4; end;
If prior5<min1 then begin min1:=prior5; nmin1:=5; end;
min2:=100;
If (prior1<min2)and(prior1>min1) then begin min2:=prior1; nmin2:=1; end;
If (prior2<min2)and(prior2>min1) then begin min2:=prior2; nmin2:=2; end;
If (prior3<min2)and(prior3>min1) then begin min2:=prior3; nmin2:=3; end;
If (prior4<min2)and(prior4>min1) then begin min2:=prior4; nmin2:=4; end;
If (prior5<min2)and(prior5>min1) then begin min2:=prior5; nmin2:=5; end;
min3:=100;
If (prior1<min3)and(prior1>min2) then begin min3:=prior1; nmin3:=1; end;
If (prior2<min3)and(prior2>min2) then begin min3:=prior2; nmin3:=2; end;
If (prior3<min3)and(prior3>min2) then begin min3:=prior3; nmin3:=3; end;
If (prior4<min3)and(prior4>min2) then begin min3:=prior4; nmin3:=4; end;
If (prior5<min3)and(prior5>min2) then begin min3:=prior5; nmin3:=5; end;
min4:=100;
If (prior1<min4)and(prior1>min3) then begin min4:=prior1; nmin4:=1; end;
If (prior2<min4)and(prior2>min3) then begin min4:=prior2; nmin4:=2; end;
If (prior3<min4)and(prior3>min3) then begin min4:=prior3; nmin4:=3; end;
If (prior4<min4)and(prior4>min3) then begin min4:=prior4; nmin4:=4; end;
If (prior5<min4)and(prior5>min3) then begin min4:=prior5; nmin4:=5; end;
min5:=100;
If (prior1<min5)and(prior1>min4) then begin min5:=prior1; nmin5:=1; end;
If (prior2<min5)and(prior2>min4) then begin min5:=prior2; nmin5:=2; end;
If (prior3<min5)and(prior3>min4) then begin min5:=prior3; nmin5:=3; end;
If (prior4<min5)and(prior4>min4) then begin min5:=prior4; nmin5:=4; end;
If (prior5<min5)and(prior5>min4) then begin min5:=prior5; nmin5:=5; end;
//далее горы подобного кода (где-то 20-30 страниц):
hile t<=60 do begin
Application.ProcessMessages;
t:=t+1;
Sleep(100);
If nmin1=1 then begin
If t-tpi1=t1 then begin
i1:=i1+1;
datetime:=now;
x1:=random(311)/10+29+random(10)/10;
table1.Insert;
table1.FieldByName('znachenie').AsFloat:=x1;
table1.FieldByName('datchik').AsInteger:=1;
table1.FieldByName('oshibka').AsBoolean:=False;
table1.FieldByName('krit').AsBoolean:=False;
table1.FieldByName('DateTime').AsDateTime:=Datetime;
series1.AddXY(i1, x1, '',clred);
if (x1>60)or(x1<30) then
begin
table1.FieldByName('oshibka').AsBoolean:=True;
if (x1>60.5)or(x1<29.5) then begin
table1.FieldByName('krit').AsBoolean:=True;
Label1.Visible:=True;
end;
end;
table1.Post;
tpi1:=t;
end; //end if
end;
If nmin1=2 then begin
If t-tpi2=t2 then begin
i2:=i2+1;
datetime:=now;
x2:=random(211)/10+9+random(10)/10;
table1.Insert;
table1.FieldByName('znachenie').AsFloat:=x2;
table1.FieldByName('datchik').AsInteger:=2;
table1.FieldByName('oshibka').AsBoolean:=False;
table1.FieldByName('krit').AsBoolean:=False;
table1.FieldByName('DateTime').AsDateTime:=Datetime;
series2.AddXY(i2, x2, '',clgreen);
if (x2>30)or(x2<10) then
begin
table1.FieldByName('oshibka').AsBoolean:=True;
if (x2>30.5)or(x2<9.5) then begin
table1.FieldByName('krit').AsBoolean:=True;
Label1.Visible:=True;
end;
end;
table1.Post;
tpi2:=t;
end;