unit unit1;
Interface
USES
Windows, Messages, sysutilils, variants, classes, graphics, controls, forms,
Dialogs, comctrls, stdctrls, extctrls, grids, calendar, gauges, JPEG;
type
Tform1 = Class (Tform)
Shape1: ford;
Shape2: for the tide;
Shape3: for the opposite;
Shape4: for the tide;
Shape5: tabs;
Shape6: for the tide;
Shape7: for the tide;
Shape8: for the opposite;
Shape9: for the tide;
Shape10: for a break;
Shape11: for the opposite;
Shape12: formore;
StaticText1: TstaticText;
StaticText2: TstaticText;
StaticText3: TstaticText;
StaticText4: TstaticText;
StaticText5: tstaticText;
StaticText6: TstaticText;
StaticText7: TstaticText;
EDIT1: TEDIT;
EDIT2: TITIT;
EDIT3: TEDIT;
EDIT4: TITIT;
EDIT5: TITIT;
EDIT6: TITIT;
Edit7: TEDED;
EDIT8: TITIT;
EDIT9: TITIT;
EDIT10: TITIT;
Edit11: TEDED;
EDIT12: TEDIT;
EDIT13: TITIT;
EDIT16: TEDIT;
EDIT15: TITIT;
Edit16: TEDIT;
EDIT17: TITIT;
Edit18: TEDIT;
EDIT19: TEDOD;
Edit20: TEDED;
EDITY21: TITIT;
Edit22: TEEP;
EDIT23: TITIT;
Edit24: tedit;
EDIT25: TITIT;
EDIT26: TITIT;
EDIT27: TITIT;
EDIT22: TITIT;
Button1: tbutton;
EDIT2T2: TITED;
Timer1: Timtimer;
Timer2: TIME;
ListBox1: TListbox;
Gauge1: Tgauge;
Gauge2: Tgauge;
Gauge3: Tgauge;
Gauge4: Tgg;
Label1: tlabel;
Label2: tlabel;
Label3: tlabel;
Label4: tlabel;
Edit30: tedit;
Image1: timage;
Label5: Tlabel;
Button2: tbutton;
Timer3: Timter;
Button4: tbutton;
Button5: tbutton;
Button3: Tbutton;
Label6: tlabel;
Button6: tbutton;
Timer4: Timter;
Procedure timer1Stimer (Sender: Tobject);
procedure Button1Click (Sender: Tobject);
procedure timer2timer (Sender: Tobject);
procedure Button2click (Sender: Tobject);
procedure timer33timer (Sender: Tobject);
procedure Button3Click (Sender: Tobject);
procedure Button4click (Sender: Tobject);
procedure Button5Click (Sender: Tobject);
procedure formcreate (Sender: Tobject);
procedure Button6Click (Sender: Tobject);
procedure timer4timer (Sender: Tobject);
Private
{Private declarations}
public
{Public declarations}
end;
type
PCB = record
Name: String;
arv: integer;
SVT: integer;
STT: Integer;
FNT: integer;
ZZSJ: integer;
DQSJ: Real;
fnhflflg: bool;
STTFLG: BOOB;
end;
PCBx = array [1.4] of PCB;
var
Nullflag: Bol = False;
Forword: Bol = False;
Subemp: integer = 0;
J: Integer = 1;
OpenFLG: BOLO = TRUE;
Tempid: Integer = 1;
fnehnum: integer = 0;
PCBum: Integer = 0;
NTP: Bol = False;
Tempok: Bol = False;
Flag: Bol = False;
Form1: tform1;
Show: Tdatetime;
Count: Integer = -1;
PRO: integer = 0;
// PCBAD: Integer = 1;
writflg: integer = 0;
PCBs: PCBx;
though, min, sec, msec: Word;
Method: integer = 1;
implementation
use unit3;
{$ R * .dfm}
procedure tform1.timer1p1.timer1timer (Sender: Tobject);
var
W: Integer;
F: Integer;
begin
if flag = true and nullflag = FALSE Then and FALSE 远为 TRUE
begin
Count: = Count + 1;
listboxes1.Items.add (Inttostr (count);
for w: = 1 to 4 do
begin
If PCBS [W] .arv = counten
begin
timer2.enabled: = FALSE;
PCBum: = PCBnum + 1;
timer2.enabled: = True;
end;
end;
IF OpenFLG = FALSE THEN
begin
If Count (Count = PCBS [tempid] .stt + PCBS [tempid] .svt) then
begin
PCBS [tempid] .fnhflg: = True;
fnehnum: = fnehre + 1;
IF fnehnum = 4 then
begin
Flag: = FALSE;
PCBs [1] .FNT: = PCBS [1] .stt + PCBS [1] .Svt;
PCBs [1] .ZZZsj: = PCBS [1] .FNT-PCBB [1] .arv;
PCBs [1] .dqsj: = PCBS [1] .zzsJ / (PCBS [1] .Lnt);
PCBs [2] .FNT: = PCBS [2] .stt + PCBS [2] .Svt;
PCBs [2] .ZZZsj: = PCBS [2] .Fnt-PCBS [2] .arv;
PCbs [2] .dqsj: = PCBS [2] .ZZSJ / (PCBS [2] .LTT);
PCBs [3] .FNT: = PCBS [3] .Stt + PCBS [3] .Svt;
PCBs [3] .ZZZsj: = PCBS [3] .Fnt-PCBs [3 .arv;
PCBs [3] .dqsj: = PCBS [3] .ZZSJ / (PCBS [3] .LTT);
PCBs [4] .FNT: = PCBS [4] .stt + PCBS [4] .Svt;
PCBs [4] .ZZZsj: = PCBS [4] .FNT-PCBS [4] .arv;
PCBs [4] .dqsj: = pcbs [4] .zzsj/ (PCBS [4] .tt);
EDIT13.Text: = Inttostr (PCBS [1] .Tt);
EDIT14.Text: = Inttostr (PCBS [1] .stt + PCBS [1] .Svt);
EDIT15.Text: = Inttostr (PCBS [1] .zzsj);
EDIT16.Text: = Flattostr (PCBS [1] .dqsj);
EDITI7.Text: = Inttostr (PCBS [2] .STT);
EDITI.Text: = Inttostr (PCBS [2] .stt + PCBS [2] .Svt);
EDIT19.Text: = Inttostr (PCBS [2] .zzsj);
EDIT20.Text: = Flattostr (PCBS [2] .dqsj);
EDIT21.Text: = Inttostr (PCBS [3] .Tt);
edit22.Text: = Inttostr (PCBS [3] .Stt + PCBS [3 .Svt);
EDIT23.Text: = Inttostr (PCBS [3] .zzsj);
edit24.text: = flattostr (pcbs [3] .dqsj);
edit25.Text: = Inttostr (PCBS [4] .tt);
EDIT26.Text: = Inttostr (PCBS [4] .stt + PCBS [4] .Svt);
EDIT27.Text: = Inttostr (PCBS [4] .zzsj);
EDIT22.Text: = Flofostr (PCBS [4] .dqsj);
end;
OpenFLG: = True; // 改 !!!!!!!! Key 应为 FALSE
Tempok: = FALSE;
end;
end;
for F: = 1 to 4 do
begin
if (count = pcbs [f] .stt + PCBS [F] .Svt) and PCBSVT1
ListBr.IdDs.add (PCBS [f] .Name + '完成 !!!!');
end; // for
end; // flag = ture
IF OpenFLG = FALSE THEN
begin
Case tempid of
1: Begin
ifcls [1] .svt = 1 then
begin
gauge1.maxvalue: = 2;
gauge1.progress: = 2;
end
else
begin
gauge1.maxvalue: = PCBS [1] .Svt;
gauge1.progress: = count-PCBs [1] .Stt;
end;
end; // 1;
2: Begin
gauge2.maxvalue: = PCBS [2] .Svt;
gauge2.progress: = count-PCbs [2] .stt;
end; // 2;
3: Begin
gauge3.maxvalue: = PCBS [3] .svt;
gauge3.progress: = count-PCBs [3] .Stt;
end; // 3;
4: Begin
gauge4.maxvalue: = PCBS [4] .Svt;
gauge4.progress: = count-PCBs [4] .tt;
end; // 4;
end; / / Case of over
end; // if openflg = FALSE ON OVER
If PCBS [1] .FNHFLG = True Then
gauge1.progress: = PCBS [1] .Svt;
If PCBS [2] .FNHFLG = TUE THEN
gauge2.progress: = pcbs [2] .svt;
If the PCS [3] .FNHFLG = TUE THEN
gauge3.progress: = pcbs [3] .svt;
Iff PCS [4] .FNHFLG = True Then
gauge4.progress: = pcbs [4] .svt;
end; // procedure over
procedure tform1.Button1Click (Sender: Tobject);
begin
Button2.Enabled: = FALSE;
timer3.enabled: = FALSE;
timer2.enabled: = True;
timer1.enabled: = True;
timer4.enabled: = FALSE;
try
flag: = true;
PCBs [1] .Name: = edit1.orthTaText;
PCBs [1] .arv: = strtint (EDIT2.Text);
PCBs [1] .Svt: = Strtouch (EDIT3.Text);
PCBs [1]. LSTTFLG: = FALSE;
PCBs [1] .Fnhflg: = FALSE;
PCBs [2] .Name: = edit4.Text;
PCBs [2] .arv: = strtint (EDITT5.Text);
PCBs [2] .Svt: = Strtouch.Text);
PCBs [2] .sttflg: = FALSE;
PCbs [2] .Fnhflg: = FALSE;
PCBs [3] .Name: = edit7.Text;
PCBs [3] .arv: = strtint (edit8.Text);
PCBs [3] .Svt: = Strtouch (EDIT9.Text);
PCBs [3] .sttflg: = FALSE;
PCbs [3] .Fnhflg: = FALSE;
PCBs [4] .Name: = edit90.Text;
PCBs [4] .arv: = strtint (edit11.Text);
PCBs [4] .Svt: = Strtoot (edit12.Text);
PCBs [4]. LSTTFLG: = FALSE;
PCBs [4] .Fnhflg: = FALSE;
Nullflag: = FALSE;
Except
nullflag: = true;
Showage ('请将数据填完整');
end;
end;
procedure tform1.timer2timer (Sender: Tobject);
var
i: integer;
begin
If fnehnum <pcbox then
begin
if (OpenFLG = True) and (PCBUMD> 0))))
begin
for i: = 1 to PcBruc stir
begin
If PCBS [i] .FNHFLG = FALSE
begin
IF Tempok = False Then
begin
Suremp: = Tempid;
Tempid: = i;
Tempok: = True;
end;
If PCBS [i] .Svt <PCBS [tempid] .svt then
begin
//timer1.Enabled:/false;
Tempid: = i;
//timer1.Enabled :Lue;
end; // if pcbs [i] .Svt <PCS [tempid] .svt then
end; // for
end;
OpenFLG: = FALSE;
PCBS [Tempid] .stt: = count;
PCBS [tempid] .sttflg: = True;
//listbox1.Idd.add ('进程' + pcbs [subtem] .name + 'fnh');
listboxes.AtMS.add ('进程' + pcbs [tempid] .name + '被调度');
end; // if (OpenFLG = TRUE AND PHBUMT> 0) THEN
end; // if fnhnum <PCBNum THEN
end; // procedure
procedure tform1.Button2Click (Sender: Tobject);
begin
Button1.Enabled: = FALSE;
timer1.enabled: = FALSE;
timer2.enabled: = FALSE;
timer3.enabled: = True;
timer4.enabled: = True;
try
flag: = true;
PCBs [1] .Name: = edit1.orthTaText;
PCBs [1] .arv: = strtint (EDIT2.Text);
PCBs [1] .Svt: = Strtouch (EDIT3.Text);
PCBs [1] .Sttflg: = True;
PCBs [1] .Fnhflg: = FALSE;
PCBs [2] .Name: = edit4.Text;
PCBs [2] .arv: = strtint (EDITT5.Text);
PCBs [2] .Svt: = Strtouch.Text);
PCBs [2] .sttflg: = FALSE;
PCbs [2] .Fnhflg: = FALSE;
PCBs [3] .Name: = edit7.Text;
PCBs [3] .arv: = strtint (edit8.Text);
PCBs [3] .Svt: = Strtouch (EDIT9.Text);
PCBs [3] .sttflg: = FALSE;
PCbs [3] .Fnhflg: = FALSE;
PCBs [4] .Name: = edit10.Text;
PCBs [4] .arv: = strtint (edit11.Text);
PCBs [4] .Svt: = Strtoot (edit12.Text);
PCBs [4]. LSTTFLG: = FALSE;
PCBs [4] .Fnhflg: = FALSE;
Nullflag: = FALSE;
Except
nullflag: = true;
Showage ('请将数据填完整');
end;
end;
procedure tform1.timer3timer3timerter (Sender: Tobject);
var
M: Integer;
begin
if (flag = true) and (NTP = FALSE) AND (Nullflag = FALSE)) THEN
Begin // if Falg = True Then
Count: = Count + 1;
listboxes1.Items.add (Inttostr (count);
for m: = 1 to 4do
Begin // for M: = 1 to 5 do
If ((PCBS [M] .STTFG = True) and (PCBS [M] .FNHFLG = FALSE))
Begin // if (pcb [m] .sttflg = True and PCB [M] .FNHFLG = FALSE)
IF Count = PCBS [M] .stT + PCBS [M] .svt then
Begin // if (Count = PCBS [M] .stt + PCBS [M] .svt) then
PCBs [m] .FNHFLG: = True;
//timer4.enportdi :=False;
PRO: = 0;
//timer4.enportd :=True;
ListBox1.ItMS.add ('进程:' + PCBS [M] .name + '完成 !!!!');
If m <4 then
Begin // if m <4 then
//pcbs losm+1 of.stttlg :=True;
//pcbs losm+1 of.stt :=Count;
forword: = True;
end; // if m <4 then
PCBs [m] .FNT: = Count;
PCBs [m] .ZZZsJ: = PCBS [M] .FNT-PCBS [M] .arv;
PCBs [m] .dqsj: = pcbs [m] .zzsj / (PCBS [M] .LDT);
end; // if (Count = PCBS [M] .stt + PCBS [M] .svt) then
end; // if (pcb [m] .sttflg = True and PCB [M] .FNHFLG = FALSE)
end; // for m: = 1 to 5 do
Iff PCS [4] .FNHFLG = True Then
begin
NTP: = True;
EDIT13.Text: = Inttostr (PCBS [1] .Tt);
EDIT14.Text: = Inttostr (PCBS [1] .stt + PCBS [1] .Svt);
EDIT15.Text: = Inttostr (PCBS [1] .zzsj);
EDIT16.Text: = Flattostr (PCBS [1] .dqsj);
EDITI7.Text: = Inttostr (PCBS [2] .STT);
EDITI.Text: = Inttostr (PCBS [2] .stt + PCBS [2] .Svt);
EDIT19.Text: = Inttostr (PCBS [2] .zzsj);
EDIT20.Text: = Flattostr (PCBS [2] .dqsj);
EDIT21.Text: = Inttostr (PCBS [3] .Tt);
edit22.Text: = Inttostr (PCBS [3] .Stt + PCBS [3 .Svt);
EDIT23.Text: = Inttostr (PCBS [3] .zzsj);
edit24.text: = flattostr (pcbs [3] .dqsj);
edit25.Text: = Inttostr (PCBS [4] .tt);
EDIT26.Text: = Inttostr (PCBS [4] .stt + PCBS [4] .Svt);
EDIT27.Text: = Inttostr (PCBS [4] .zzsj);
EDIT22.Text: = Flofostr (PCBS [4] .dqsj);
end;
for m: = 1 to 4 do
begin
If (Count> = PCBS [M] .arv) and (PCBS [M] .STTFG = FALSE)) THEN
IF forWord = True Then
begin
PCBs [m] .STTFG: = True;
PCBs [m] .STT: = Count;
forword: = FALSE;
end; //3and
end; // for m: = 1 to 4 do
gauge1.maxvalue: = PCBS [1] .Svt;
gauge2.maxvalue: = PCBS [2] .Svt;
gauge3.maxvalue: = PCBS [3] .svt;
gauge4.maxvalue: = PCBS [4] .Svt;
If PCBS [1] .SttflG = True and PCBS [1] .fnhflg = FALSE
begin
//gauge1.progressive:=Gaugh1.Maxvalue :=PCBS CES1 is available.Shtt;
gauge1.progress: = count-PCBs [1] .Stt;
End // iffbs [1] .sttflG = True and PCBs [1] .Fnhflg = FALSE
Else Iff PCS [1] .FnhFlg = True Then
gauge1.progress: = PCBS [1] .Svt;
If the PCS [2] .STTFG = True and PCBS [2] .Fnhflg = FALSE
begin
gauge2.progress: = count-PCbs [2] .stt;
End // iffbs [1] .sttflG = True and PCBs [1] .Fnhflg = FALSE
ELEE IF PCBS [2] .FNHFLG = TUE THEN
gauge2.progress: = pcbs [2] .svt;
If the PCS [3] .STTFG = True and PCBS [3 .FNHFlG = FALSE
begin
gauge3.progress: = count-PCBs [3] .Stt;
End // iffbs [1] .sttflG = True and PCBs [1] .Fnhflg = FALSE
ELEE IF PCBS [3] .FNHFLG = TUE THEN
gauge3.progress: = pcbs [3] .svt;
If the PCS [4] .SttflG = True and PCBS [4] .FNHFLG = FALSE
begin
gauge4.progress: = count-PCBs [4] .tt;
End // iffbs [1] .sttflG = True and PCBs [1] .Fnhflg = FALSE
ELEE IF PCBS [4] .FNHFLG = TUE THEN
gauge4.progress: = pcbs [4] .svt;
end; // if falg = true then
end; // procedure over
procedure tform1.Button3Click (Sender);
begin
Form1.Close;
//end.//DO OVER
end;
procedure tform1.Button4Click (Sender: Tobject);
begin
forword: = FALSE;
Subemp: = 0;
J: = 1;
OpenFLG: = True;
Tempid: = 1;
fnehnum: = 0;
PCBum: = 0;
NTP: = FALSE;
Tempok: = FALSE;
Flag: = FALSE;
gauge1.progress: = 0;
gauge2.progress: = 0;
gauge3.progress: = 0;
gauge4.progress: = 0;
Button2.enported: = True;
Button1.enabled: = True;
Count: = - 1;
PRO: = 0;
// PCBAD: Integer = 1;
writflg: = 0;
Flag: = FALSE;
Nullflag: = FALSE;
edit1.text: = ';
EDIT2.Text: = ';
EDIT3.Text: = ';
EDIT4.Text: = ';
EDIT5.Text: = ';
EDIT6.Text: = ';
edit7.text: = ';
edit8.Text: = ';
EDIT9.Text: = ';
edit9.text: = ';
edit11.Text: = ';
edit12.Text: = ';
EDIT13.Text: = '系统填写';
EDIT14.Text: = '系统填写';
EDIT15.Text: = '系统填写';
edit16.Text: = '系统填写';
EDITIAN.Text: = '系统填写';
EDITI.Text: = '系统填写';
EDIT19.Text: = '系统填写';
EDIT20.Text: = '系统填写';
EDIT21.Text: = '系统填写';
edit22.Text: = '系统填写';
EDIT23.Text: = '系统填写';
edit24.text: = '系统填写';
edit25.Text: = '系统填写';
EDIT26.Text: = '系统填写';
EDIT27.Text: = '系统填写';
EDIT22.Text: = '系统填写';
PCBs [1] .Fnhflg: = FALSE;
PCBs [1]. LSTTFLG: = FALSE;
PCbs [2] .Fnhflg: = FALSE;
PCBs [2] .sttflg: = FALSE;
PCbs [3] .Fnhflg: = FALSE;
PCBs [3] .sttflg: = FALSE;
PCBs [4] .Fnhflg: = FALSE;
PCBs [4]. LSTTFLG: = FALSE;
end;
procedure tform1.Button5Click (Sender: Tobject);
begin
form3.show;
end;
procedure tform1.Field: objecting);
begin
Form100Fieldstyle: = FSSSTSYontop;
EposATEWindow (Handle, 2000, AW_Center);
Form100formstyle: = FSNormal;
end;
procedure tform1.Button6click (Sender: Tobject);
begin
edit1.text: = 'a';
EDIT2.Text: = '0';
EDIT3.Text: = '3';
edit4.text: = 'b';
EDIT5.Text: = '5';
EDIT6.Text: = '2';
edit7.text: = 'c';
edit8.Text: = '5';
EDIT9.Text: = '3';
edit19.text: = 'd';
edit11.Text: = '5';
edit12.Text: = '2';
end;
procedure tform1.timer4timer4timer (Sender: Tobject);
begin
If ((PCBS [1] .arv = Count) and (PCBS [1] .Sttflg = FALSE)) THEN
begin
forword: = True;
end;
end;
End.
unit unit2;
Interface
USES
Windows, Messages, sysutilils, variants, classes, graphics, controls, forms,
Dialogs, jpeg, extctrls, stdctrls;
type
Tform2 = Class (Tform)
Image1: timage;
Label1: tlabel;
Label2: tlabel;
Label3: tlabel;
Private
{Private declarations}
public
{Public declarations}
end;
type
PCB = record
Name: String;
arv: integer;
SVT: integer;
STT: Integer;
FNT: integer;
ZZSJ: integer;
DQSJ: Real;
fnhflflg: bool;
STTFLG: BOOB;
end;
PCBx = array [1.4] of PCB;
var
Form2: tform2;
PCBs: PCBx;
implementation
Use Unit1;
{$ R * .dfm}
End.
unit unit3;
Interface
USES
Windows, Messages, sysutilils, variants, classes, graphics, controls, forms,
Dialogs, stdctrls, comCtrls, JPEG, extctrls;
type
Tform3 = Class (Tform)
Richedit1: TRichit;
Private
{Private declarations}
public
{Public declarations}
end;
var
Form3: tform3;
implementation
{$ R * .dfm}
End.