84 lines
1.8 KiB
ObjectPascal

unit Upage;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Menus, ExtCtrls,
UInit, UEdit;
procedure Panneaux;
procedure ExecCouleur(i:integer);
function ClPotentiel(sp,sm:string):TColor;
function ClrPotentiel(ip,im:integer):TColor;
procedure ExecVisuel;
procedure ExecInteractif;
implementation
uses unit1,utest;
procedure Panneaux;
begin
With Form1 do begin
Pnl_Composants.Visible:= false;
Pnl_Editer.Visible:=bEdit;
Pnl_Composants.Visible:=bEdit and SBtn_Compo.Down;
if (SBtn_Compo.Down or SBtn_Relier.Down) then RAZSelection;
if not bEdit then RAZPanneauEdition;
end;
end;
procedure ExecInteractif;
begin
With Form1 do begin
Visuelinteractif.Checked:=not Visuelinteractif.Checked;
end; // With
end;
procedure ExecVisuel;
begin
With Form1 do begin
VisuelRelais.Checked:=not VisuelRelais.Checked;
end; // With
end;
procedure ExecCouleur(i:integer);
begin
With Form1 do begin
Noir1.Checked:=(i=1);
Potentiels1.Checked:=(i=2);
Courants1.Checked:=(i=3);
end; // With
end;
function ClPotentiel(sp,sm:string):TColor;
Var cl:TColor;
begin
cl:=RGB(160,0,160);
// test(sp+' '+sm);
if (sp='+0') and (sm<>'-0') then cl:=RGB(255,0,0);
if (sm='-0') and (sp<>'+0') then cl:=RGB(0,0,255);
if (sm<>'N') then cl:=RGB(0,100,255);
if (sp<>'N') then cl:=RGB(255,100,0);
if (sm='N') and (sp='N') then cl:=RGB(100,100,100);
// result:=cl;
end;
function ClrPotentiel(ip,im:integer):TColor;
Var cl:TColor;
begin
cl:=RGB(160,0,160);
if (im=rmax) then cl:=RGB(255,160,160);
if (ip=rmax) then cl:=RGB(160,160,255);
if (ip=0) and (im<>0) then cl:=RGB(255,0,0);
if (im=0) and (ip<>0) then cl:=RGB(0,0,255);
if (im=rmax) and (ip=rmax) then cl:=RGB(100,100,100);
result:=cl;
end;
end.