1 2 3 4 5 6 7 8 9 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
|
procedure TForm1.StartProcess();
var sqlr,sqli:TSQLQuery;
I,J,K,H:integer;
tbs : TTabSheet;
tf : TFrame1;
begin
sqlr := TSQLQuery.Create(Owner);
sqlr.SQLConnection := pingerdbconn;
sqlr.SQL.Clear;
sqli := TSQLQuery.Create(Owner);
sqli.SQLConnection := pingerdbconn;
sqlr.SQL.Add('SELECT * FROM W_CLASSE_PING WHERE W_CL_PING_ACTIF = 1');
sqlr.ExecSQL(true);
sqlr.Active:=true;
for I := 0 to sqlr.RecordCount - 1 do
begin
tv.Items.Add(nil,sqlr.Fields.FindField('W_CL_PING_NAME').AsString);
tbs := TTabSheet.Create(Self);
tf := TFrame1.Create(self);
tf.Name := sqlr.Fields.FindField('W_CL_PING_NAME').AsString;
tf.Align := alClient;
tf.Parent := tbs;
tf.CLPINGID := sqlr.Fields.FindField('W_CL_PING_ID').AsInteger;
tf.min := 1000;
tf.max := 0;
tf.tt.Interval := sqlr.Fields.FindField('W_CL_PING_POLLING').AsInteger;
tf.gb.Caption := ' Panneau de controle du processus ' + sqlr.Fields.FindField('W_CL_PING_NAME').AsString + ' ';
tf.l.Caption := 'Le processus ' + sqlr.Fields.FindField('W_CL_PING_NAME').AsString + ' est actif depuis '+ datetostr(now) + ' '+timetostr(now);
tf.sb.Panels[0].Text := sqlr.Fields.FindField('W_CL_PING_NAME').AsString + '('+datetostr(now) + ' '+timetostr(now)+')';
tbs.PageControl := pc;
tbs.Caption := sqlr.Fields.FindField('W_CL_PING_NAME').AsString;
for J := 0 to tv.Items.Count - 1 do
begin
if tv.Items[J].Text = sqlr.Fields.FindField('W_CL_PING_NAME').AsString then
begin
tv.Items[J].ImageIndex:= 0;
tv.Items[J].SelectedIndex:= 0;
tv.Items[J].Data := tbs;
tbs.Tag := Longint(tv.Items[J]);
sqli.SQL.Clear;
sqli.SQL.Add('SELECT * FROM W_INTERFACE WHERE W_CL_PING_ID = '+ inttostr(sqlr.Fields.FindField('W_CL_PING_ID').AsInteger) + ' AND W_INTER_ACTIF = 1');
sqli.ExecSQL(true);
sqli.Active:=true;
for K := 0 to sqli.RecordCount - 1 do
begin
tv.Items.AddChild(tv.Items.Item[J],sqli.Fields.FindField('W_INTER_IPADD').AsString);
for H := 0 to tv.Items.Count - 1 do
begin
if tv.Items[H].Parent = tv.Items[J] then
begin
tv.Items[H].ImageIndex := 1;
tv.Items[H].SelectedIndex := 1;
end;
end;
sqli.Next;
end;
end;
end;
sqlr.Next;
end;
sqlr.Close;
sqlr.Free;
sqli.Close;
sqli.Free;
end; |
Partager