This commit is contained in:
f1iwq2
2021-08-31 21:09:19 +02:00
parent b8453b49cc
commit e290a73dc1
15 changed files with 813 additions and 712 deletions
BIN
View File
Binary file not shown.
+26 -16
View File
@@ -1,6 +1,6 @@
object FormConfig: TFormConfig object FormConfig: TFormConfig
Left = 277 Left = 291
Top = 203 Top = 218
Hint = Hint =
'Modifie les fichiers de configuration selon les s'#233'lections chois' + 'Modifie les fichiers de configuration selon les s'#233'lections chois' +
'ies' 'ies'
@@ -958,8 +958,8 @@ object FormConfig: TFormConfig
ParentFont = False ParentFont = False
end end
object ImageAig: TImage object ImageAig: TImage
Left = 648 Left = 736
Top = 312 Top = 432
Width = 137 Width = 137
Height = 57 Height = 57
Picture.Data = { Picture.Data = {
@@ -1230,8 +1230,8 @@ object FormConfig: TFormConfig
Visible = False Visible = False
end end
object ImageTJD: TImage object ImageTJD: TImage
Left = 760 Left = 744
Top = 320 Top = 416
Width = 137 Width = 137
Height = 57 Height = 57
Picture.Data = { Picture.Data = {
@@ -1366,8 +1366,8 @@ object FormConfig: TFormConfig
Visible = False Visible = False
end end
object ImageTri: TImage object ImageTri: TImage
Left = 648 Left = 744
Top = 336 Top = 432
Width = 145 Width = 145
Height = 65 Height = 65
Picture.Data = { Picture.Data = {
@@ -1537,8 +1537,8 @@ object FormConfig: TFormConfig
Caption = 'Verrouillable au carr'#233' :' Caption = 'Verrouillable au carr'#233' :'
end end
object Image2: TImage object Image2: TImage
Left = 760 Left = 768
Top = 352 Top = 440
Width = 129 Width = 129
Height = 41 Height = 41
Picture.Data = { Picture.Data = {
@@ -1745,6 +1745,16 @@ object FormConfig: TFormConfig
Height = 13 Height = 13
Caption = #224 Caption = #224
end end
object Label20: TLabel
Left = 648
Top = 312
Width = 208
Height = 39
Caption =
'Tous les param'#232'tres doivent '#234'tre valid'#233's en appuyant sur la touc' +
'he ENTREE apr'#232's leur introduction/modification'
WordWrap = True
end
object ButtonAppliquerEtFermer: TButton object ButtonAppliquerEtFermer: TButton
Left = 384 Left = 384
Top = 472 Top = 472
@@ -1770,7 +1780,7 @@ object FormConfig: TFormConfig
Top = 8 Top = 8
Width = 633 Width = 633
Height = 457 Height = 457
ActivePage = TabSheetSig ActivePage = TabSheetAutonome
Font.Charset = DEFAULT_CHARSET Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack Font.Color = clBlack
Font.Height = -11 Font.Height = -11
@@ -2425,7 +2435,7 @@ object FormConfig: TFormConfig
end end
object GroupBox10: TGroupBox object GroupBox10: TGroupBox
Left = 8 Left = 8
Top = 88 Top = 80
Width = 273 Width = 273
Height = 73 Height = 73
Caption = 'Vitesse de franchissement d'#233'vi'#233' :' Caption = 'Vitesse de franchissement d'#233'vi'#233' :'
@@ -2460,7 +2470,7 @@ object FormConfig: TFormConfig
end end
object CheckInverse: TCheckBox object CheckInverse: TCheckBox
Left = 16 Left = 16
Top = 269 Top = 261
Width = 137 Width = 137
Height = 17 Height = 17
Hint = 'Cocher si l'#39'aiguillage est invers'#233' dans CDM rail' Hint = 'Cocher si l'#39'aiguillage est invers'#233' dans CDM rail'
@@ -2480,7 +2490,7 @@ object FormConfig: TFormConfig
end end
object ComboBoxAig: TComboBox object ComboBoxAig: TComboBox
Left = 8 Left = 8
Top = 64 Top = 48
Width = 145 Width = 145
Height = 21 Height = 21
ItemHeight = 13 ItemHeight = 13
@@ -2495,7 +2505,7 @@ object FormConfig: TFormConfig
end end
object GroupBox16: TGroupBox object GroupBox16: TGroupBox
Left = 8 Left = 8
Top = 168 Top = 160
Width = 273 Width = 273
Height = 97 Height = 97
Caption = 'Repr'#233'sentation' Caption = 'Repr'#233'sentation'
@@ -2683,7 +2693,7 @@ object FormConfig: TFormConfig
end end
object ButtonRestaureAig: TButton object ButtonRestaureAig: TButton
Left = 200 Left = 200
Top = 56 Top = 48
Width = 75 Width = 75
Height = 25 Height = 25
Hint = Hint =
+228 -188
View File
@@ -4,7 +4,7 @@ interface
uses uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls , verif_version, jpeg, ComCtrls ,StrUtils ; Dialogs, ExtCtrls, StdCtrls , verif_version, jpeg, ComCtrls ,StrUtils, Unitprinc ;
type type
TFormConfig = class(TForm) TFormConfig = class(TForm)
@@ -230,6 +230,7 @@ type
LabelL: TLabel; LabelL: TLabel;
EditL: TEdit; EditL: TEdit;
CheckBoxFB: TCheckBox; CheckBoxFB: TCheckBox;
Label20: TLabel;
procedure ButtonAppliquerEtFermerClick(Sender: TObject); procedure ButtonAppliquerEtFermerClick(Sender: TObject);
procedure FormActivate(Sender: TObject); procedure FormActivate(Sender: TObject);
procedure FormCreate(Sender: TObject); procedure FormCreate(Sender: TObject);
@@ -372,7 +373,7 @@ function compile_branche(s : string;i : integer) : boolean;
implementation implementation
uses UnitDebug,UnitPrinc, UnitTCO; uses UnitDebug, UnitTCO;
{$R *.dfm} {$R *.dfm}
@@ -413,7 +414,7 @@ var s : string;
begin begin
s:='@='+inttostr(feux[i].Adresse)+' Decodeur='+intToSTR(feux[i].Decodeur)+' Adresse détecteur associé='+intToSTR(feux[i].Adr_det1)+ s:='@='+inttostr(feux[i].Adresse)+' Decodeur='+intToSTR(feux[i].Decodeur)+' Adresse détecteur associé='+intToSTR(feux[i].Adr_det1)+
' Adresse élement suivant='+intToSTR(feux[i].Adr_el_suiv1); ' Adresse élement suivant='+intToSTR(feux[i].Adr_el_suiv1);
if feux[i].Btype_suiv1=2 then s:=s+' (aig)'; if feux[i].Btype_suiv1=aig then s:=s+' (aig)';
feux[i].Img.Hint:=s; feux[i].Img.Hint:=s;
end; end;
@@ -578,19 +579,19 @@ end;
function encode_aig(index : integer): string; function encode_aig(index : integer): string;
var s : string; var s : string;
c : char; c : char;
tjd,tjs,tri : boolean; tjdC,tjsC,triC : boolean;
begin begin
if index=0 then exit; if index=0 then exit;
s:=IntToSTR(aiguillage[index].Adresse); s:=IntToSTR(aiguillage[index].Adresse);
tjd:=aiguillage[index].modele=2; tjdC:=aiguillage[index].modele=tjd;
tjs:=aiguillage[index].modele=3; tjsC:=aiguillage[index].modele=tjs;
tri:=aiguillage[index].modele=4; triC:=aiguillage[index].modele=triple;
if tjd then s:=s+'TJD'; if tjdC then s:=s+'TJD';
if tjs then s:=s+'TJS'; if tjsC then s:=s+'TJS';
if tri then begin s:=s+'TRI,';s:=s+intToSTR(aiguillage[index].AdrTriple);end; if triC then begin s:=s+'TRI,';s:=s+intToSTR(aiguillage[index].AdrTriple);end;
s:=s+','; s:=s+',';
// aiguillage normal ou triple // aiguillage normal ou triple
if not(tjd) and not(tjs) then if not(tjdC) and not(tjsC) then
begin begin
// P // P
s:=s+'P';s:=s+intToSTR(aiguillage[index].Apointe); s:=s+'P';s:=s+intToSTR(aiguillage[index].Apointe);
@@ -608,7 +609,7 @@ begin
if (c<>'Z') and (c<>#0) then s:=s+c; if (c<>'Z') and (c<>#0) then s:=s+c;
//if c=#0 then s:=s+'Z'; //if c=#0 then s:=s+'Z';
// S2 aiguillage triple // S2 aiguillage triple
if tri then if triC then
begin begin
s:=s+',S2-'; s:=s+',S2-';
s:=s+intToSTR(aiguillage[index].Adevie2); s:=s+intToSTR(aiguillage[index].Adevie2);
@@ -619,7 +620,7 @@ begin
end; end;
// tjd / s // tjd / s
if tjd or tjs then if tjdC or tjsC then
begin begin
s:=s+'D('+intToSTR(aiguillage[index].Adroit); s:=s+'D('+intToSTR(aiguillage[index].Adroit);
c:=aiguillage[index].AdroitB;if c<>'Z' then s:=s+c; c:=aiguillage[index].AdroitB;if c<>'Z' then s:=s+c;
@@ -629,7 +630,7 @@ begin
s:=s+','+intToSTR(aiguillage[index].DDevie)+aiguillage[index].DDevieB+')'; s:=s+','+intToSTR(aiguillage[index].DDevie)+aiguillage[index].DDevieB+')';
end; end;
if tjs then if tjsC then
begin begin
s:=s+',L'+intToSTR(aiguillage[index].Tjsint)+aiguillage[index].TjsintB; s:=s+',L'+intToSTR(aiguillage[index].Tjsint)+aiguillage[index].TjsintB;
end; end;
@@ -746,11 +747,12 @@ begin
encode_aig_gfx:=s; encode_aig_gfx:=s;
end; end;
function TypeEl_to_char(i : integer) : string; // renvoie un A si BT est un aiguillage
function TypeEl_to_char(BT : TEquipement) : string;
begin begin
case i of // 1=détecteur 2=aig ou TJD ou TJS 4=tri case BT of // 1=détecteur 2=aig ou TJD ou TJS 4=tri
1 : TypeEl_to_char:=''; det : TypeEl_to_char:='';
2,3,4 : TypeEl_to_char:='A'; aig,tjd,tjs,triple : TypeEl_to_char:='A';
end; end;
end; end;
@@ -913,7 +915,7 @@ begin
val(s,Feux[i].decodeur,erreur); val(s,Feux[i].decodeur,erreur);
if j<>0 then delete(s,1,j); if j<>0 then delete(s,1,j);
feux[i].Adr_el_suiv1:=0;feux[i].Adr_el_suiv2:=0;feux[i].Adr_el_suiv3:=0;feux[i].Adr_el_suiv4:=0; feux[i].Adr_el_suiv1:=0;feux[i].Adr_el_suiv2:=0;feux[i].Adr_el_suiv3:=0;feux[i].Adr_el_suiv4:=0;
feux[i].Btype_Suiv1:=0;feux[i].Btype_Suiv2:=0;feux[i].Btype_Suiv3:=0;feux[i].Btype_Suiv4:=0; feux[i].Btype_Suiv1:=rien;feux[i].Btype_Suiv2:=rien;feux[i].Btype_Suiv3:=rien;feux[i].Btype_Suiv4:=rien;
feux[i].Adr_det1:=0;feux[i].Adr_det2:=0;feux[i].Adr_det3:=0;feux[i].Adr_det4:=0; feux[i].Adr_det1:=0;feux[i].Adr_det2:=0;feux[i].Adr_det3:=0;feux[i].Adr_det4:=0;
// éléments optionnels des voies supplémentaires // éléments optionnels des voies supplémentaires
if j<>0 then if j<>0 then
@@ -940,35 +942,20 @@ begin
if (j=3) then feux[i].Adr_det3:=adr; if (j=3) then feux[i].Adr_det3:=adr;
if (j=4) then feux[i].Adr_det4:=adr; if (j=4) then feux[i].Adr_det4:=adr;
//type de l'élément suivant (1=détecteur 2=aig ou TJD ou TJS 4=tri //type de l'élément suivant (1=détecteur 2=aig ou TJD ou TJS 4=tri
t:=0;
if s[1]='A' then if s[1]='A' then
begin begin
t:=2; if (j=1) then feux[i].Btype_Suiv1:=aig;
//Affiche('détecté aiguillage',clyellow); if (j=2) then feux[i].Btype_Suiv2:=aig;
if (j=1) then feux[i].Btype_Suiv1:=2; if (j=3) then feux[i].Btype_Suiv3:=aig;
if (j=2) then feux[i].Btype_Suiv2:=2; if (j=4) then feux[i].Btype_Suiv4:=aig;
if (j=3) then feux[i].Btype_Suiv3:=2;
if (j=4) then feux[i].Btype_Suiv4:=2;
delete(s,1,1); delete(s,1,1);
end; end
l:=pos('TRI',s); else
if l<>0 then begin // détecteur
begin if (j=1) then feux[i].Btype_Suiv1:=det;
t:=4; if (j=2) then feux[i].Btype_Suiv2:=det;
delete(s,l,3); if (j=3) then feux[i].Btype_Suiv3:=det;
//Affiche('détecté aiguillage tri',clyellow); if (j=4) then feux[i].Btype_Suiv4:=det;
if (j=1) then feux[i].Btype_Suiv1:=4;
if (j=2) then feux[i].Btype_Suiv2:=4;
if (j=3) then feux[i].Btype_Suiv3:=4;
if (j=4) then feux[i].Btype_Suiv4:=4;
end;
if t=0 then //détecteur
begin
if (j=1) then feux[i].Btype_Suiv1:=1;
if (j=2) then feux[i].Btype_Suiv2:=1;
if (j=3) then feux[i].Btype_Suiv3:=1;
if (j=4) then feux[i].Btype_Suiv4:=1;
end; end;
Val(s,adr,erreur); Val(s,adr,erreur);
//Affiche('Adr='+IntToSTR(Adr),clyellow); //Affiche('Adr='+IntToSTR(Adr),clyellow);
@@ -1001,7 +988,7 @@ begin
Delete(S,1,k); Delete(S,1,k);
Val(s,k,erreur); Val(s,k,erreur);
Feux[i].UniSemaf:=k; Feux[i].UniSemaf:=k;
erreur:=verif_UniSemaf(i,k); erreur:=verif_UniSemaf(adresse,k);
if erreur=1 then begin Affiche('Ligne '+chaine_signal,clred);Affiche('Erreur code Unisemaf',clred);end; if erreur=1 then begin Affiche('Ligne '+chaine_signal,clred);Affiche('Erreur code Unisemaf',clred);end;
if erreur=2 then if erreur=2 then
begin begin
@@ -2277,8 +2264,9 @@ end;
// on change la valeur de la description de la déviation de l'aiguillage // on change la valeur de la description de la déviation de l'aiguillage
procedure TFormConfig.EditDevie_HDKeyPress(Sender: TObject; var Key: Char); procedure TFormConfig.EditDevie_HDKeyPress(Sender: TObject; var Key: Char);
var AdrAig,adr,adr2,erreur,index,modele : integer; var AdrAig,adr,adr2,erreur,index : integer;
b : char; b : char;
modele:Tequipement;
s : string; s : string;
begin begin
// cliqué sur le edit dévié aiguillage // cliqué sur le edit dévié aiguillage
@@ -2298,7 +2286,7 @@ begin
if index=0 then exit; if index=0 then exit;
modele:=aiguillage[index].modele; modele:=aiguillage[index].modele;
if (modele=1) or (modele=4) then if (modele=aig) or (modele=triple) then
begin begin
if ((B='S') or (B='P') or (B='D') or (B=#0) or (b='Z')) and (s<>'') then if ((B='S') or (B='P') or (B='D') or (B=#0) or (b='Z')) and (s<>'') then
begin begin
@@ -2320,7 +2308,7 @@ begin
end; end;
end; end;
if (modele=2) or (modele=3) then if (modele=tjd) or (modele=tjs) then
begin begin
// TJD/TJS // TJD/TJS
adr2:=aiguillage[index].DDroit; // adresse homologue adr2:=aiguillage[index].DDroit; // adresse homologue
@@ -2338,8 +2326,9 @@ end;
// on change la valeur de la description du droit de l'aiguillage // on change la valeur de la description du droit de l'aiguillage
procedure TFormConfig.EditDroit_BDKeyPress(Sender: TObject; var Key: Char); procedure TFormConfig.EditDroit_BDKeyPress(Sender: TObject; var Key: Char);
var AdrAig,adr,erreur,index,modele,adr2 : integer; var AdrAig,adr,erreur,index,adr2 : integer;
b : char; b : char;
modele: TEquipement;
s : string; s : string;
begin begin
// cliqué sur le edit droit aiguillage // cliqué sur le edit droit aiguillage
@@ -2358,7 +2347,7 @@ begin
Index:=Index_Aig(AdrAig); Index:=Index_Aig(AdrAig);
if index=0 then exit; if index=0 then exit;
modele:=aiguillage[index].modele; modele:=aiguillage[index].modele;
if (modele=1) or (modele=4) then if (modele=aig) or (modele=triple) then
begin begin
if ((B='S') or (B='P') or (B='D') or (B=#0) or (b='Z')) and (s<>'') then if ((B='S') or (B='P') or (B='D') or (B=#0) or (b='Z')) and (s<>'') then
begin begin
@@ -2378,7 +2367,7 @@ begin
LabelInfo.caption:='Erreur droit aiguillage '+intToSTR(AdrAig); LabelInfo.caption:='Erreur droit aiguillage '+intToSTR(AdrAig);
end; end;
end; end;
if (modele=2) or (modele=3) then if (modele=tjd) or (modele=tjs) then
begin begin
// TJD/TJS // TJD/TJS
adr2:=aiguillage[index].DDroit; // adresse homologue adr2:=aiguillage[index].DDroit; // adresse homologue
@@ -2398,7 +2387,7 @@ procedure TFormConfig.EditPointe_BGKeyPress(Sender: TObject;
var Key: Char); var Key: Char);
var AdrAig,adr,erreur,index : integer; var AdrAig,adr,erreur,index : integer;
b : char; b : char;
normal,tjd,tjs,tri : boolean; normal,tjdC,tjsC,triC : boolean;
s : string; s : string;
begin begin
// cliqué sur le edit pointe aiguillage // cliqué sur le edit pointe aiguillage
@@ -2419,17 +2408,17 @@ begin
begin begin
RE_ColorLine(RichAig,ligneclicAig,ClWhite); RE_ColorLine(RichAig,ligneclicAig,ClWhite);
Index:=Index_Aig(AdrAig); Index:=Index_Aig(AdrAig);
normal:=aiguillage[index].modele=1; normal:=aiguillage[index].modele=aig;
tjd:=aiguillage[index].modele=2; tjdC:=aiguillage[index].modele=tjd;
tjs:=aiguillage[index].modele=3; tjsC:=aiguillage[index].modele=tjs;
tri:=aiguillage[index].modele=4; triC:=aiguillage[index].modele=triple;
Aiguillage[index].modifie:=true; Aiguillage[index].modifie:=true;
LabelInfo.caption:=''; LabelInfo.caption:='';
// modifier la base de données de l'aiguillage // modifier la base de données de l'aiguillage
if b=#0 then b:='Z'; if b=#0 then b:='Z';
if normal or tri then if normal or triC then
begin begin
Aiguillage[index].APointe:=adr; Aiguillage[index].APointe:=adr;
Aiguillage[index].APointeB:=B; Aiguillage[index].APointeB:=B;
@@ -2437,7 +2426,7 @@ begin
s:=encode_aig(index); s:=encode_aig(index);
formconfig.RichAig.Lines[ligneclicAig]:=s; formconfig.RichAig.Lines[ligneclicAig]:=s;
end; end;
if tjd or tjs then if tjdC or tjsC then
begin begin
Aiguillage[index].ADevie:=adr; Aiguillage[index].ADevie:=adr;
Aiguillage[index].ADevieB:=B; Aiguillage[index].ADevieB:=B;
@@ -2621,15 +2610,14 @@ var s : string;
i,erreur : integer; i,erreur : integer;
begin begin
if clicliste or (ligneClicSig<0) or (ord(Key)<>VK_RETURN) then exit; if clicliste or (ligneClicSig<0) or (ord(Key)<>VK_RETURN) then exit;
s:=RichSig.Lines[ligneClicSig]; if affevt then Affiche('Evt detecteur 1',clOrange);
if affevt then Affiche('Evt Détecteur 1',clOrange);
if FormConfig.PageControl.ActivePage=FormConfig.TabSheetSig then if FormConfig.PageControl.ActivePage=FormConfig.TabSheetSig then
with Formconfig do with Formconfig do
begin begin
s:=EditDet1.Text; s:=EditDet1.Text;
Val(s,i,erreur); Val(s,i,erreur);
if erreur<>0 then begin LabelInfo.caption:='Erreur détecteur1 ';exit;end; if (s<>'') and (erreur<>0) then begin LabelInfo.caption:='Erreur détecteur1 ';exit;end;
LabelInfo.caption:=' '; LabelInfo.caption:=' ';
feux[ligneClicSig+1].Adr_det1:=i; feux[ligneClicSig+1].Adr_det1:=i;
maj_hint_feu(ligneClicSig+1); maj_hint_feu(ligneClicSig+1);
@@ -2642,32 +2630,40 @@ end;
procedure TFormConfig.EditSuiv1KeyPress(Sender: TObject; var Key: Char); procedure TFormConfig.EditSuiv1KeyPress(Sender: TObject; var Key: Char);
var s : string; var s : string;
i,erreur : integer; i,erreur : integer;
bt : Tequipement;
begin begin
if clicliste or (comboBoxAsp.Itemindex>=6) or (ligneClicSig<0) or (ord(Key)<>VK_RETURN) then exit; if clicliste or (comboBoxAsp.Itemindex>=6) or (ligneClicSig<0) or (ord(Key)<>VK_RETURN) then exit;
if affevt then Affiche('Evt suivant1',clOrange); if affevt then Affiche('Evt Element suivant1',clOrange);
if FormConfig.PageControl.ActivePage=FormConfig.TabSheetSig then if FormConfig.PageControl.ActivePage=FormConfig.TabSheetSig then
with Formconfig do with Formconfig do
begin begin
s:=EditSuiv1.Text; s:=EditSuiv1.Text;
if s='' then begin LabelInfo.caption:='Erreur élément suivant 1';exit;end; if s<>'' then
Val(s,i,erreur);
if erreur<>0 then
begin begin
if (s[erreur]='A') and (erreur=1) then Val(s,i,erreur);
if erreur<>0 then
begin begin
feux[ligneClicSig+1].Btype_suiv1:=2; // type de l'élément suivant (1=détecteur 2=aig ou TJD ou TJS 4=tri if (s[erreur]='A') and (erreur=1) then
delete(s,erreur,1); begin
Val(s,i,erreur); bt:=aig;
delete(s,erreur,1);
Val(s,i,erreur);
end
else begin LabelInfo.caption:='Erreur élément suivant 1';exit;end;
end end
else begin LabelInfo.caption:='Erreur élément suivant 1';exit;end; else bt:=det;
end end
else feux[ligneClicSig+1].Btype_suiv1:=1; else
begin
i:=0;
bt:=rien;
end;
LabelInfo.caption:=' '; LabelInfo.caption:=' ';
feux[ligneClicSig+1].Adr_el_suiv1:=i; feux[ligneClicSig+1].Adr_el_suiv1:=i;
feux[ligneClicSig+1].Btype_suiv1:=bt;
s:=encode_sig_feux(ligneClicSig+1); s:=encode_sig_feux(ligneClicSig+1);
RichSig.Lines[ligneClicSig]:=s; RichSig.Lines[ligneClicSig]:=s;
maj_hint_feu(ligneClicSig+1);
end; end;
end; end;
@@ -2682,9 +2678,8 @@ begin
with Formconfig do with Formconfig do
begin begin
s:=EditDet2.Text; s:=EditDet2.Text;
if s='' then exit;
Val(s,i,erreur); Val(s,i,erreur);
if erreur<>0 then begin LabelInfo.caption:='Erreur détecteur2 ';exit;end; if (s<>'') and (erreur<>0) then begin LabelInfo.caption:='Erreur détecteur2 ';exit;end;
LabelInfo.caption:=' '; LabelInfo.caption:=' ';
feux[ligneClicSig+1].Adr_det2:=i; feux[ligneClicSig+1].Adr_det2:=i;
maj_hint_feu(ligneClicSig+1); maj_hint_feu(ligneClicSig+1);
@@ -2727,6 +2722,7 @@ end;
procedure TFormConfig.EditSuiv2KeyPress(Sender: TObject; var Key: Char); procedure TFormConfig.EditSuiv2KeyPress(Sender: TObject; var Key: Char);
var s : string; var s : string;
erreur,i: integer; erreur,i: integer;
bt : Tequipement;
begin begin
if clicliste or (comboBoxAsp.Itemindex>=6) or (ligneClicSig<0) or (ord(Key)<>VK_RETURN) then exit; if clicliste or (comboBoxAsp.Itemindex>=6) or (ligneClicSig<0) or (ord(Key)<>VK_RETURN) then exit;
if affevt then Affiche('Evt Element suivant2',clOrange); if affevt then Affiche('Evt Element suivant2',clOrange);
@@ -2735,22 +2731,29 @@ begin
with Formconfig do with Formconfig do
begin begin
s:=EditSuiv2.Text; s:=EditSuiv2.Text;
if s='' then begin LabelInfo.caption:='Erreur élément suivant 2';exit;end; if s<>'' then
Val(s,i,erreur);
if erreur<>0 then
begin begin
if (s[erreur]='A') and (erreur=1) then Val(s,i,erreur);
if erreur<>0 then
begin begin
feux[ligneClicSig+1].Btype_suiv2:=2; // type de l'élément suivant (1=détecteur 2=aig ou TJD ou TJS 4=tri if (s[erreur]='A') and (erreur=1) then
delete(s,erreur,1); begin
Val(s,i,erreur); bt:=aig;
delete(s,erreur,1);
Val(s,i,erreur);
end
else begin LabelInfo.caption:='Erreur élément suivant 2';exit;end;
end end
else begin LabelInfo.caption:='Erreur élément suivant 2';exit;end; else bt:=det;
end end
else feux[ligneClicSig+1].Btype_suiv2:=1; else
begin
i:=0;
bt:=rien;
end;
LabelInfo.caption:=' '; LabelInfo.caption:=' ';
feux[ligneClicSig+1].Adr_el_suiv2:=i; feux[ligneClicSig+1].Adr_el_suiv2:=i;
feux[ligneClicSig+1].Btype_suiv2:=bt;
s:=encode_sig_feux(ligneClicSig+1); s:=encode_sig_feux(ligneClicSig+1);
RichSig.Lines[ligneClicSig]:=s; RichSig.Lines[ligneClicSig]:=s;
end; end;
@@ -2760,15 +2763,16 @@ end;
procedure TFormConfig.EditDet3KeyPress(Sender: TObject; var Key: Char); procedure TFormConfig.EditDet3KeyPress(Sender: TObject; var Key: Char);
var s : string; var s : string;
i,erreur : integer; i,erreur : integer;
begin begin
if clicliste or (ligneClicSig<0) or (ord(Key)<>VK_RETURN) then exit; if clicliste or (ligneClicSig<0) or (ord(Key)<>VK_RETURN) then exit;
if affevt then Affiche('Evt Detecteur 3',clOrange); if affevt then Affiche('Evt detecteur 3',clOrange);
if FormConfig.PageControl.ActivePage=FormConfig.TabSheetSig then if FormConfig.PageControl.ActivePage=FormConfig.TabSheetSig then
with Formconfig do with Formconfig do
begin begin
s:=EditDet3.Text; s:=EditDet3.Text;
if s='' then exit; Val(s,i,erreur);
Val(s,i,erreur);if erreur<>0 then begin LabelInfo.caption:='Erreur détecteur3 ';exit;end; if (s<>'') and (erreur<>0) then begin LabelInfo.caption:='Erreur détecteur3 ';exit;end;
LabelInfo.caption:=' '; LabelInfo.caption:=' ';
feux[ligneClicSig+1].Adr_det3:=i; feux[ligneClicSig+1].Adr_det3:=i;
maj_hint_feu(ligneClicSig+1); maj_hint_feu(ligneClicSig+1);
@@ -2781,29 +2785,38 @@ end;
procedure TFormConfig.EditSuiv3KeyPress(Sender: TObject; var Key: Char); procedure TFormConfig.EditSuiv3KeyPress(Sender: TObject; var Key: Char);
var s : string; var s : string;
erreur,i : integer; erreur,i : integer;
bt : Tequipement;
begin begin
if clicliste or (comboBoxAsp.Itemindex>=6) or (ligneClicSig<0) or (ord(Key)<>VK_RETURN) then exit; if clicliste or (comboBoxAsp.Itemindex>=6) or (ligneClicSig<0) or (ord(Key)<>VK_RETURN) then exit;
if affevt then Affiche('Evt Element suivant3',clOrange);
if FormConfig.PageControl.ActivePage=FormConfig.TabSheetSig then if FormConfig.PageControl.ActivePage=FormConfig.TabSheetSig then
with Formconfig do with Formconfig do
begin begin
s:=EditSuiv3.Text; s:=EditSuiv3.Text;
if s='' then begin LabelInfo.caption:='Erreur élément suivant 3';exit;end; if s<>'' then
Val(s,i,erreur);
if erreur<>0 then
begin begin
if (s[erreur]='A') and (erreur=1) then Val(s,i,erreur);
if erreur<>0 then
begin begin
feux[ligneClicSig+1].Btype_suiv3:=2; // type de l'élément suivant (1=détecteur 2=aig ou TJD ou TJS 4=tri if (s[erreur]='A') and (erreur=1) then
delete(s,erreur,1); begin
Val(s,i,erreur); bt:=aig;
delete(s,erreur,1);
Val(s,i,erreur);
end
else begin LabelInfo.caption:='Erreur élément suivant 3';exit;end;
end end
else begin LabelInfo.caption:='Erreur élément suivant 3';exit;end; else bt:=det;
end end
else feux[ligneClicSig+1].Btype_suiv3:=1; else
begin
i:=0;
bt:=rien;
end;
LabelInfo.caption:=' '; LabelInfo.caption:=' ';
feux[ligneClicSig+1].Adr_el_suiv3:=i; feux[ligneClicSig+1].Adr_el_suiv3:=i;
feux[ligneClicSig+1].Btype_suiv3:=bt;
s:=encode_sig_feux(ligneClicSig+1); s:=encode_sig_feux(ligneClicSig+1);
RichSig.Lines[ligneClicSig]:=s; RichSig.Lines[ligneClicSig]:=s;
end; end;
@@ -2814,13 +2827,14 @@ var s : string;
i,erreur : integer; i,erreur : integer;
begin begin
if clicliste or (ligneClicSig<0) or (ord(Key)<>VK_RETURN) then exit; if clicliste or (ligneClicSig<0) or (ord(Key)<>VK_RETURN) then exit;
if affevt then Affiche('Evt detecteur 4',clOrange);
if FormConfig.PageControl.ActivePage=FormConfig.TabSheetSig then if FormConfig.PageControl.ActivePage=FormConfig.TabSheetSig then
with Formconfig do with Formconfig do
begin begin
s:=EditDet4.Text; s:=EditDet4.Text;
if s='' then exit; Val(s,i,erreur);
Val(s,i,erreur);if erreur<>0 then begin LabelInfo.caption:='Erreur détecteur4 ';exit;end; if (s<>'') and (erreur<>0) then begin LabelInfo.caption:='Erreur détecteur4 ';exit;end;
LabelInfo.caption:=' '; LabelInfo.caption:=' ';
feux[ligneClicSig+1].Adr_det4:=i; feux[ligneClicSig+1].Adr_det4:=i;
maj_hint_feu(ligneClicSig+1); maj_hint_feu(ligneClicSig+1);
@@ -2833,29 +2847,38 @@ end;
procedure TFormConfig.EditSuiv4KeyPress(Sender: TObject; var Key: Char); procedure TFormConfig.EditSuiv4KeyPress(Sender: TObject; var Key: Char);
var s : string; var s : string;
erreur,i : integer; erreur,i : integer;
bt : Tequipement;
begin begin
if clicliste or (comboBoxAsp.Itemindex>=6) or (ligneClicSig<0) or (ord(Key)<>VK_RETURN) then exit; if clicliste or (comboBoxAsp.Itemindex>=6) or (ligneClicSig<0) or (ord(Key)<>VK_RETURN) then exit;
if affevt then Affiche('Evt Element suivant4',clOrange);
if FormConfig.PageControl.ActivePage=FormConfig.TabSheetSig then if FormConfig.PageControl.ActivePage=FormConfig.TabSheetSig then
with Formconfig do with Formconfig do
begin begin
s:=EditSuiv4.Text; s:=EditSuiv4.Text;
if s='' then begin LabelInfo.caption:='Erreur élément suivant 4';exit;end; if s<>'' then
Val(s,i,erreur);
if erreur<>0 then
begin begin
if (s[erreur]='A') and (erreur=1) then Val(s,i,erreur);
if erreur<>0 then
begin begin
feux[ligneClicSig+1].Btype_suiv4:=2; // type de l'élément suivant (1=détecteur 2=aig ou TJD ou TJS 4=tri if (s[erreur]='A') and (erreur=1) then
delete(s,erreur,1); begin
Val(s,i,erreur); bt:=aig;
delete(s,erreur,1);
Val(s,i,erreur);
end
else begin LabelInfo.caption:='Erreur élément suivant 4';exit;end;
end end
else begin LabelInfo.caption:='Erreur élément suivant 4';exit;end; else bt:=det;
end end
else feux[ligneClicSig+1].Btype_suiv1:=1; else
begin
i:=0;
bt:=rien;
end;
LabelInfo.caption:=' '; LabelInfo.caption:=' ';
feux[ligneClicSig+1].Adr_el_suiv4:=i; feux[ligneClicSig+1].Adr_el_suiv4:=i;
feux[ligneClicSig+1].Btype_suiv4:=bt;
s:=encode_sig_feux(ligneClicSig+1); s:=encode_sig_feux(ligneClicSig+1);
RichSig.Lines[ligneClicSig]:=s; RichSig.Lines[ligneClicSig]:=s;
end; end;
@@ -3090,7 +3113,8 @@ end;
procedure TFormConfig.EditAdrAigKeyPress(Sender: TObject; var Key: Char); procedure TFormConfig.EditAdrAigKeyPress(Sender: TObject; var Key: Char);
var s : string; var s : string;
i,vide,erreur,index,adr2,modele : integer; i,vide,erreur,index,adr2 : integer;
modele: TEquipement;
c : char; c : char;
begin begin
if clicliste or (ord(Key)<>VK_RETURN) then exit; if clicliste or (ord(Key)<>VK_RETURN) then exit;
@@ -3110,11 +3134,11 @@ begin
modele:=aiguillage[index].modele; modele:=aiguillage[index].modele;
// si normal ou triple // si normal ou triple
if (modele=1) or (modele=4) then if (modele=aig) or (modele=triple) then
begin begin
if (erreur<>0) or (i>MaxAcc) then begin LabelInfo.caption:='Erreur adresse aiguillage ';exit;end; if (erreur<>0) or (i>MaxAcc) then begin LabelInfo.caption:='Erreur adresse aiguillage ';exit;end;
// vérifier si l'adresse de l'aiguillage existe déja // vérifier si l'adresse de l'aiguillage existe déja
if (aiguillage[Index_Aig(i)].modele<>0) then if (aiguillage[Index_Aig(i)].modele<>rien) then
begin begin
EditAdrAig.Color:=clred; EditAdrAig.Color:=clred;
LabelInfo.caption:='aiguillage '+IntToSTR(i)+' existe déja - ne sera pas écrasé' ; LabelInfo.caption:='aiguillage '+IntToSTR(i)+' existe déja - ne sera pas écrasé' ;
@@ -3128,7 +3152,7 @@ begin
aiguillage[index].modifie:=true; aiguillage[index].modifie:=true;
formconfig.RichAig.Lines[ligneclicAig]:=s; formconfig.RichAig.Lines[ligneclicAig]:=s;
end; end;
if (modele=2) or (modele=3) then if (modele=tjd) or (modele=tjs) then
begin begin
clicListe:=true; clicListe:=true;
// modifier les champs P1 et P2 avec la nouvelle adresse // modifier les champs P1 et P2 avec la nouvelle adresse
@@ -3854,7 +3878,8 @@ end;
function verif_coherence : boolean; function verif_coherence : boolean;
var i,j,k,l,aig,adr,adr2,detect,modele,condcarre,nc : integer; var i,j,k,l,Indexaig,adr,adr2,detect,condcarre,nc : integer;
modAig,model,km: TEquipement;
ok : boolean; ok : boolean;
begin begin
// vérification de la cohérence1 // vérification de la cohérence1
@@ -3865,91 +3890,91 @@ begin
j:=1; j:=1;
repeat repeat
detect:=BrancheN[i][j].Adresse; detect:=BrancheN[i][j].Adresse;
modele:=BrancheN[i][j].BType; // 1= détecteur 2= aiguillage 4=Buttoir model:=BrancheN[i][j].BType; // 1= détecteur 2= aiguillage 4=Buttoir
if (modele=2) then if (model=aig) then
begin begin
//affiche('trouvé aig '+intToSTR(detect),clyellow); //affiche('trouvé aig '+intToSTR(detect),clyellow);
modele:=aiguillage[Index_Aig(detect)].modele; modAig:=aiguillage[Index_Aig(detect)].modele;
if (modele=0) then if (model=rien) then
begin begin
Affiche('Erreur 1: Aiguillage '+intToStr(detect)+' non décrit mais présent en branche '+intToStr(i)+' pos. '+intToSTR(j),clred); Affiche('Erreur 1: Aiguillage '+intToStr(detect)+' non décrit mais présent en branche '+intToStr(i)+' pos. '+intToSTR(j),clred);
ok:=false; ok:=false;
end; end;
end; end;
j:=j+1; j:=j+1;
until((modele=0) and (detect=0)); until((model=rien) and (detect=0));
end; end;
// vérification de la cohérence2 // vérification de la cohérence2
// parcoure les aiguillages pour voir si les détecteurs sont en branches des détecteurs // parcoure les aiguillages pour voir si les détecteurs sont en branches des détecteurs
// et les tjd pour voir si pb de cohérence // et les tjd pour voir si pb de cohérence
for aig:=1 to maxaiguillage do for Indexaig:=1 to maxaiguillage do
begin begin
// tjd ou tjs // tjd ou tjs
if (aiguillage[aig].modele=2) or (aiguillage[aig].modele=3) then if (aiguillage[Indexaig].modele=tjd) or (aiguillage[Indexaig].modele=tjs) then
begin begin
if aiguillage[aig].Ddroit<>aiguillage[aig].Ddevie then if aiguillage[Indexaig].Ddroit<>aiguillage[Indexaig].Ddevie then
begin begin
Affiche('Erreur 7: la TJD/S '+IntToStr(aig)+' a des adresses de destination différentes ('+intToSTR(aiguillage[aig].Ddroit)+' et '+intToSTR(aiguillage[aig].Ddevie)+')',clred); Affiche('Erreur 7: la TJD/S '+IntToStr(Indexaig)+' a des adresses de destination différentes ('+intToSTR(aiguillage[Indexaig].Ddroit)+' et '+intToSTR(aiguillage[Indexaig].Ddevie)+')',clred);
ok:=false; ok:=false;
end; end;
// vérifier si son homologue est une tjd // vérifier si son homologue est une tjd
adr2:=aiguillage[aig].Ddroit; adr2:=aiguillage[Indexaig].Ddroit;
if (aiguillage[Index_Aig(adr2)].modele<>2) and (aiguillage[Index_Aig(adr2)].modele<>3) then if (aiguillage[Index_Aig(adr2)].modele<>tjd) and (aiguillage[Index_Aig(adr2)].modele<>tjs) then
begin begin
Affiche('Erreur 8: l''aiguillage '+intToStr(Adr2)+' n''est pas une TJD/S ou n''existe pas, mais apparait dans la TJD/S '+IntToSTR(aiguillage[aig].Adresse),clred); Affiche('Erreur 8: l''aiguillage '+intToStr(Adr2)+' n''est pas une TJD/S ou n''existe pas, mais apparait dans la TJD/S '+IntToSTR(aiguillage[Indexaig].Adresse),clred);
ok:=false; ok:=false;
end; end;
end; end;
// vérifier si l'aiguillage est dans les branches // vérifier si l'aiguillage est dans les branches
if aiguillage[aig].modele<>0 then if aiguillage[Indexaig].modele<>rien then
begin begin
trouve_aiguillage(aiguillage[aig].adresse); // passe l'adresse de l'aiguillage à trouver trouve_aiguillage(aiguillage[Indexaig].adresse); // passe l'adresse de l'aiguillage à trouver
if (IndexBranche_trouve=0) then if (IndexBranche_trouve=0) then
begin begin
Affiche('Avertissement 6: aiguillage '+intToSTR(aiguillage[aig].adresse)+' décrit dans les aiguillages ; absent dans la description des branches',clOrange); Affiche('Avertissement 6: aiguillage '+intToSTR(aiguillage[Indexaig].adresse)+' décrit dans les aiguillages ; absent dans la description des branches',clOrange);
ok:=false; ok:=false;
end; end;
end; end;
adr:=aiguillage[aig].Adroit; adr:=aiguillage[Indexaig].Adroit;
if (aiguillage[aig].AdroitB='Z') then if (aiguillage[Indexaig].AdroitB='Z') then
begin begin
trouve_detecteur(adr); trouve_detecteur(adr);
if IndexBranche_trouve=0 then if IndexBranche_trouve=0 then
begin begin
Affiche('Erreur 2: détecteur '+intToSTR(adr)+' décrit dans l''aiguillage '+intToSTR(aiguillage[aig].adresse)+' mais absent dans la description des branches',clred); Affiche('Erreur 2: détecteur '+intToSTR(adr)+' décrit dans l''aiguillage '+intToSTR(aiguillage[Indexaig].adresse)+' mais absent dans la description des branches',clred);
ok:=false; ok:=false;
end; end;
end; end;
adr:=aiguillage[aig].Adevie; adr:=aiguillage[Indexaig].Adevie;
if (aiguillage[aig].AdevieB='Z') then if (aiguillage[Indexaig].AdevieB='Z') then
begin begin
trouve_detecteur(adr); trouve_detecteur(adr);
if IndexBranche_trouve=0 then if IndexBranche_trouve=0 then
begin begin
Affiche('Erreur 3: détecteur '+intToSTR(adr)+' décrit dans l''aiguillage '+intToSTR(aiguillage[aig].adresse)+' mais absent dans la description des branches',clRed); Affiche('Erreur 3: détecteur '+intToSTR(adr)+' décrit dans l''aiguillage '+intToSTR(aiguillage[Indexaig].adresse)+' mais absent dans la description des branches',clRed);
ok:=false; ok:=false;
end; end;
end; end;
adr:=aiguillage[aig].Apointe; adr:=aiguillage[Indexaig].Apointe;
if ((aiguillage[aig].ApointeB='Z') and (aiguillage[aig].modele=1)) then if ((aiguillage[Indexaig].ApointeB='Z') and (aiguillage[Indexaig].modele=aig)) then
begin begin
trouve_detecteur(adr); trouve_detecteur(adr);
if IndexBranche_trouve=0 then if IndexBranche_trouve=0 then
begin begin
Affiche('Erreur 4 : détecteur '+intToSTR(adr)+' décrit dans l''aiguillage '+intToSTR(aiguillage[aig].adresse)+' mais absent dans la description des branches',clRed); Affiche('Erreur 4 : détecteur '+intToSTR(adr)+' décrit dans l''aiguillage '+intToSTR(aiguillage[Indexaig].adresse)+' mais absent dans la description des branches',clRed);
ok:=false; ok:=false;
end; end;
end; end;
if (aiguillage[aig].modele=4) then // aiguillage triple if (aiguillage[Indexaig].modele=triple) then // aiguillage triple
begin begin
if (aiguillage[aig].Adevie2B='Z') then if (aiguillage[Indexaig].Adevie2B='Z') then
begin begin
adr:=aiguillage[aig].Adevie2; adr:=aiguillage[Indexaig].Adevie2;
trouve_detecteur(adr); trouve_detecteur(adr);
if IndexBranche_trouve=0 then if IndexBranche_trouve=0 then
begin begin
Affiche('Erreur 5 : détecteur '+intToSTR(adr)+' décrit dans l''aiguillage '+intToSTR(aiguillage[aig].adresse)+' mais absent dans la description des branches',clRed); Affiche('Erreur 5 : détecteur '+intToSTR(adr)+' décrit dans l''aiguillage '+intToSTR(aiguillage[Indexaig].adresse)+' mais absent dans la description des branches',clRed);
ok:=false; ok:=false;
end; end;
end; end;
@@ -3957,18 +3982,18 @@ begin
end; end;
// cohérence 3 : vérifie si aiguillage triple ok et si doublon aiguillage // cohérence 3 : vérifie si aiguillage triple ok et si doublon aiguillage
for aig:=1 to maxaiguillage do for Indexaig:=1 to maxaiguillage do
begin begin
adr:=aiguillage[aig].Adresse; adr:=aiguillage[Indexaig].Adresse;
if aiguillage[aig].modele=4 then if aiguillage[Indexaig].modele=triple then
begin begin
if aiguillage[aig].AdrTriple=0 then if aiguillage[Indexaig].AdrTriple=0 then
begin begin
Affiche('Erreur 6.1 : 2ème adresse de l''aiguillage triple '+intToSTR(adr)+' non définie',clred); Affiche('Erreur 6.1 : 2ème adresse de l''aiguillage triple '+intToSTR(adr)+' non définie',clred);
ok:=false; ok:=false;
end; end;
end; end;
for i:=aig+1 to maxaiguillage do for i:=Indexaig+1 to maxaiguillage do
begin begin
if adr=aiguillage[i].Adresse then if adr=aiguillage[i].Adresse then
begin begin
@@ -4060,10 +4085,10 @@ begin
// élement suivant 1 // élement suivant 1
i:=feux[j].Adr_el_suiv1; i:=feux[j].Adr_el_suiv1;
k:=feux[j].Btype_suiv1; km:=feux[j].Btype_suiv1;
if i<>0 then if i<>0 then
begin begin
if k=1 then // détecteur if km=det then // détecteur
begin begin
trouve_detecteur(i); trouve_detecteur(i);
if IndexBranche_trouve=0 then if IndexBranche_trouve=0 then
@@ -4072,7 +4097,7 @@ begin
Affiche('Erreur : Détecteur '+intToSTR(i)+' non existant mais associé au signal '+IntToSTR(feux[j].adresse),clred); Affiche('Erreur : Détecteur '+intToSTR(i)+' non existant mais associé au signal '+IntToSTR(feux[j].adresse),clred);
end; end;
end; end;
if (k>=2) then if ((km=aig) or (km=tjs) or (km=tjd) or (km=triple)) then
begin begin
// aiguillage // aiguillage
if index_aig(i)=0 then if index_aig(i)=0 then
@@ -4085,10 +4110,10 @@ begin
// élement suivant 2 // élement suivant 2
i:=feux[j].Adr_el_suiv2; i:=feux[j].Adr_el_suiv2;
k:=feux[j].Btype_suiv2; km:=feux[j].Btype_suiv2;
if i<>0 then if i<>0 then
begin begin
if k=1 then // détecteur if km=det then // détecteur
begin begin
trouve_detecteur(i); trouve_detecteur(i);
if IndexBranche_trouve=0 then if IndexBranche_trouve=0 then
@@ -4097,7 +4122,7 @@ begin
Affiche('Erreur : Détecteur '+intToSTR(i)+' non existant mais associé au signal '+IntToSTR(feux[j].adresse),clred); Affiche('Erreur : Détecteur '+intToSTR(i)+' non existant mais associé au signal '+IntToSTR(feux[j].adresse),clred);
end; end;
end; end;
if (k>=2) then if ((km=aig) or (km=tjs) or (km=tjd) or (km=triple)) then
begin begin
// aiguillage // aiguillage
if index_aig(i)=0 then if index_aig(i)=0 then
@@ -4110,10 +4135,10 @@ begin
// élement suivant 3 // élement suivant 3
i:=feux[j].Adr_el_suiv3; i:=feux[j].Adr_el_suiv3;
k:=feux[j].Btype_suiv3; km:=feux[j].Btype_suiv3;
if i<>0 then if i<>0 then
begin begin
if k=1 then // détecteur if km=det then // détecteur
begin begin
trouve_detecteur(i); trouve_detecteur(i);
if IndexBranche_trouve=0 then if IndexBranche_trouve=0 then
@@ -4122,7 +4147,7 @@ begin
Affiche('Erreur : Détecteur '+intToSTR(i)+' non existant mais associé au signal '+IntToSTR(feux[j].adresse),clred); Affiche('Erreur : Détecteur '+intToSTR(i)+' non existant mais associé au signal '+IntToSTR(feux[j].adresse),clred);
end; end;
end; end;
if (k>=2) then if ((km=aig) or (km=tjs) or (km=tjd) or (km=triple)) then
begin begin
// aiguillage // aiguillage
if index_aig(i)=0 then if index_aig(i)=0 then
@@ -4135,10 +4160,10 @@ begin
// élement suivant 4 // élement suivant 4
i:=feux[j].Adr_el_suiv4; i:=feux[j].Adr_el_suiv4;
k:=feux[j].Btype_suiv4; km:=feux[j].Btype_suiv4;
if i<>0 then if i<>0 then
begin begin
if k=1 then // détecteur if km=det then // détecteur
begin begin
trouve_detecteur(i); trouve_detecteur(i);
if IndexBranche_trouve=0 then if IndexBranche_trouve=0 then
@@ -4147,7 +4172,7 @@ begin
Affiche('Erreur : Détecteur '+intToSTR(i)+' non existant mais associé au signal '+IntToSTR(feux[j].adresse),clred); Affiche('Erreur : Détecteur '+intToSTR(i)+' non existant mais associé au signal '+IntToSTR(feux[j].adresse),clred);
end; end;
end; end;
if (k>=2) then if ((km=aig) or (km=tjs) or (km=tjd) or (km=triple)) then
begin begin
// aiguillage // aiguillage
if index_aig(i)=0 then if index_aig(i)=0 then
@@ -4169,8 +4194,7 @@ begin
inc(MaxAiguillage); inc(MaxAiguillage);
i:=MaxAiguillage; i:=MaxAiguillage;
aiguillage[i].Adresse:=999; aiguillage[i].Adresse:=999;
aiguillage[i].modele:=1; aiguillage[i].modele:=aig;
aiguillage[i].modele:=1;
aiguillage[i].AdroitB:='Z'; aiguillage[i].AdevieB:='Z'; aiguillage[i].AdroitB:='Z'; aiguillage[i].AdevieB:='Z';
aiguillage[i].DdroitB:='D'; aiguillage[i].DdevieB:='S'; // préparation pour TJD/S aiguillage[i].DdroitB:='D'; aiguillage[i].DdevieB:='S'; // préparation pour TJD/S
aiguillage[i].ApointeB:='Z'; aiguillage[i].ApointeB:='Z';
@@ -4219,7 +4243,7 @@ begin
// efface les attributs de l'aiguillage supprimé // efface les attributs de l'aiguillage supprimé
aiguillage[index].Adresse:=0; aiguillage[index].Adresse:=0;
aiguillage[index].Modele:=0; aiguillage[index].Modele:=rien;
aiguillage[index].Adroit:=0; aiguillage[index].Adroit:=0;
aiguillage[index].Adevie:=0; aiguillage[index].Adevie:=0;
aiguillage[index].Ddroit:=0; aiguillage[index].Ddroit:=0;
@@ -4297,7 +4321,7 @@ begin
LabelInfo.caption:='Changement de l''adresse de la TJD de '+IntToSTR(adr2)+' à '+intToSTR(adr) ; LabelInfo.caption:='Changement de l''adresse de la TJD de '+IntToSTR(adr2)+' à '+intToSTR(adr) ;
id2:=Index_Aig(Adr); id2:=Index_Aig(Adr);
if (aiguillage[id2].modele<>0) then if (aiguillage[id2].modele<>rien) then
begin begin
LabelInfo.caption:='aiguillage '+IntToSTR(adr)+' existe déja - ne sera pas écrasé' ; LabelInfo.caption:='aiguillage '+IntToSTR(adr)+' existe déja - ne sera pas écrasé' ;
exit; exit;
@@ -4369,7 +4393,7 @@ begin
LabelInfo.caption:='Changement de l''adresse de la TJD de '+IntToSTR(adr2)+' à '+intToSTR(adr) ; LabelInfo.caption:='Changement de l''adresse de la TJD de '+IntToSTR(adr2)+' à '+intToSTR(adr) ;
id2:=Index_Aig(Adr); id2:=Index_Aig(Adr);
if (aiguillage[id2].modele<>0) then if (aiguillage[id2].modele<>rien) then
begin begin
LabelInfo.caption:='aiguillage '+IntToSTR(adr)+' existe déja - ne sera pas écrasé' ; LabelInfo.caption:='aiguillage '+IntToSTR(adr)+' existe déja - ne sera pas écrasé' ;
exit; exit;
@@ -4394,7 +4418,8 @@ begin
end; end;
procedure TFormConfig.EditP3KeyPress(Sender: TObject; var Key: Char); procedure TFormConfig.EditP3KeyPress(Sender: TObject; var Key: Char);
var AdrAig,adr,adr2,erreur,index,modele : integer; var AdrAig,adr,adr2,erreur,index : integer;
model: Tequipement;
b,c : char; b,c : char;
s : string; s : string;
begin begin
@@ -4422,9 +4447,9 @@ begin
LabelInfo.caption:=''; LabelInfo.caption:='';
RE_ColorLine(RichAig,ligneClicAig,ClWhite); RE_ColorLine(RichAig,ligneClicAig,ClWhite);
Index:=Index_Aig(AdrAig); Index:=Index_Aig(AdrAig);
modele:=aiguillage[Index].modele; model:=aiguillage[Index].modele;
if modele=3 then // TJS if model=tjs then // TJS
begin begin
LabelL.caption:=IntToSTR(adr); LabelL.caption:=IntToSTR(adr);
aiguillage[index].tjsint:=adr; aiguillage[index].tjsint:=adr;
@@ -4458,13 +4483,13 @@ begin
if index=0 then // si elle n'existe pas la créer if index=0 then // si elle n'existe pas la créer
begin begin
// créer homologue // créer homologue
if modele=2 then labelInfo.Caption:='Création de la TJD homologue '+IntToSTR(adr); if model=tjd then labelInfo.Caption:='Création de la TJD homologue '+IntToSTR(adr);
if modele=3 then labelInfo.Caption:='Création de la TJS homologue '+IntToSTR(adr); if model=tjs then labelInfo.Caption:='Création de la TJS homologue '+IntToSTR(adr);
inc(MaxAiguillage); inc(MaxAiguillage);
index:=MaxAiguillage; index:=MaxAiguillage;
aiguillage[index].Adresse:=Adr; aiguillage[index].Adresse:=Adr;
aiguillage[Index].modele:=modele; aiguillage[Index].modele:=model;
aiguillage[Index].Adroit:=0; aiguillage[Index].Adroit:=0;
aiguillage[Index].AdroitB:='D'; aiguillage[Index].AdroitB:='D';
aiguillage[Index].Adevie:=0; aiguillage[Index].Adevie:=0;
@@ -4491,8 +4516,8 @@ begin
else else
begin begin
// existe, vérifier si c'est bien une TJD/S // existe, vérifier si c'est bien une TJD/S
modele:=aiguillage[Index].modele; model:=aiguillage[Index].modele;
if (modele=2) or (modele=3) then if (model=tjd) or (model=tjs) then
begin begin
aiguillage[index].adresse:=adr; aiguillage[index].adresse:=adr;
s:=encode_aig(index); s:=encode_aig(index);
@@ -4580,7 +4605,7 @@ begin
inc(MaxAiguillage); inc(MaxAiguillage);
aiguillage[MaxAiguillage]:=Aig_supprime; aiguillage[MaxAiguillage]:=Aig_supprime;
Aig_Supprime.adresse:=0; // dévalider l'aiguillage sauvegardé Aig_Supprime.adresse:=0; // dévalider l'aiguillage sauvegardé
Aig_Supprime.modele:=0; Aig_Supprime.modele:=rien;
clicListe:=true; clicListe:=true;
config_modifie:=true; config_modifie:=true;
@@ -4625,7 +4650,17 @@ begin
if MaxAiguillage<ligneclicAig+1 then exit; if MaxAiguillage<ligneclicAig+1 then exit;
if affevt then Affiche('Evt ComboBox Aiguillage',clOrange); if affevt then Affiche('Evt ComboBox Aiguillage',clOrange);
i:=ligneclicAig+1; i:=ligneclicAig+1;
aiguillage[i].modele:=ComboBoxAig.ItemIndex+1; case ComboBoxAig.ItemIndex of
0 : aiguillage[i].modele:=aig;
1 : aiguillage[i].modele:=tjd;
2 : aiguillage[i].modele:=tjs;
3 : aiguillage[i].modele:=triple;
else aiguillage[i].modele:=rien;
end;
;
s:=encode_aig(i); s:=encode_aig(i);
formconfig.RichAig.Lines[ligneclicAig]:=s; formconfig.RichAig.Lines[ligneclicAig]:=s;
clicliste:=true; clicliste:=true;
@@ -4738,7 +4773,7 @@ begin
code:=false; code:=false;
end; end;
BrancheN[i,j].adresse:=adresse; BrancheN[i,j].adresse:=adresse;
BrancheN[i,j].btype:=2; // ident aiguillage BrancheN[i,j].btype:=aig; // ident aiguillage
end end
else else
begin begin
@@ -4751,8 +4786,8 @@ begin
if erreur=0 then if erreur=0 then
begin begin
BrancheN[i,j].adresse:=detect; // adresse BrancheN[i,j].adresse:=detect; // adresse
BrancheN[i,j].btype:=1;// ident détecteur BrancheN[i,j].btype:=det;// ident détecteur
if detect=0 then begin BrancheN[i,j].btype:=4;end; // buttoir if detect=0 then begin BrancheN[i,j].btype:=buttoir;end; // buttoir
// vérifier si le détecteur est déja stocké // vérifier si le détecteur est déja stocké
bd:=0; bd:=0;
repeat repeat
@@ -4767,7 +4802,7 @@ begin
end; end;
inc(j); inc(j);
BrancheN[i,j].adresse:=0; // préparer le suivant à 0 BrancheN[i,j].adresse:=0; // préparer le suivant à 0
BrancheN[i,j].BType:=0; BrancheN[i,j].BType:=rien;
//Affiche('branche '+intToSTR(i)+' index='+intToStr(j),clGreen); //Affiche('branche '+intToSTR(i)+' index='+intToStr(j),clGreen);
until (offset=0); until (offset=0);
compile_branche:=code; compile_branche:=code;
@@ -4911,7 +4946,8 @@ end;
procedure TFormConfig.EditAigTripleKeyPress(Sender: TObject; var Key: Char); procedure TFormConfig.EditAigTripleKeyPress(Sender: TObject; var Key: Char);
var s : string; var s : string;
i,modele,erreur,index : integer; i,erreur,index : integer;
model: TEquipement;
begin begin
if clicliste then exit; if clicliste then exit;
@@ -4923,12 +4959,12 @@ begin
index:=ligneclicAig+1; index:=ligneclicAig+1;
if index=0 then exit; if index=0 then exit;
modele:=aiguillage[index].modele; model:=aiguillage[index].modele;
if (modele=4) then if (model=triple) then
begin begin
if (erreur<>0) then begin LabelInfo.caption:='Erreur adresse aiguillage ';exit;end; if (erreur<>0) then begin LabelInfo.caption:='Erreur adresse aiguillage ';exit;end;
// vérifier si l'adresse de l'aiguillage existe déja // vérifier si l'adresse de l'aiguillage existe déja
if (aiguillage[Index_Aig(i)].modele<>0) then if (aiguillage[Index_Aig(i)].modele<>rien) then
begin begin
LabelInfo.caption:='aiguillage '+IntToSTR(i)+' existe déja - ne sera pas écrasé' ; LabelInfo.caption:='aiguillage '+IntToSTR(i)+' existe déja - ne sera pas écrasé' ;
EditAigTriple.Color:=clred; EditAigTriple.Color:=clred;
@@ -5122,6 +5158,10 @@ begin
end; end;
end. end.
BIN
View File
Binary file not shown.
+36 -16
View File
@@ -67,9 +67,9 @@ object FormDebug: TFormDebug
end end
object MemoEvtDet: TMemo object MemoEvtDet: TMemo
Left = 591 Left = 591
Top = 320 Top = 336
Width = 239 Width = 239
Height = 225 Height = 209
Anchors = [akTop, akRight] Anchors = [akTop, akRight]
Color = clBlack Color = clBlack
Font.Charset = ANSI_CHARSET Font.Charset = ANSI_CHARSET
@@ -88,7 +88,7 @@ object FormDebug: TFormDebug
end end
object ButtonEcrLog: TButton object ButtonEcrLog: TButton
Left = 487 Left = 487
Top = 312 Top = 328
Width = 97 Width = 97
Height = 29 Height = 29
Anchors = [akTop, akRight] Anchors = [akTop, akRight]
@@ -98,7 +98,7 @@ object FormDebug: TFormDebug
end end
object ButtonRazTampon: TButton object ButtonRazTampon: TButton
Left = 487 Left = 487
Top = 344 Top = 360
Width = 97 Width = 97
Height = 33 Height = 33
Anchors = [akTop, akRight] Anchors = [akTop, akRight]
@@ -109,7 +109,7 @@ object FormDebug: TFormDebug
end end
object ButtonCherche: TButton object ButtonCherche: TButton
Left = 487 Left = 487
Top = 280 Top = 296
Width = 97 Width = 97
Height = 25 Height = 25
Anchors = [akTop, akRight] Anchors = [akTop, akRight]
@@ -119,7 +119,7 @@ object FormDebug: TFormDebug
end end
object ButtonAffEvtChrono: TButton object ButtonAffEvtChrono: TButton
Left = 487 Left = 487
Top = 240 Top = 256
Width = 97 Width = 97
Height = 33 Height = 33
Anchors = [akTop, akRight] Anchors = [akTop, akRight]
@@ -130,7 +130,7 @@ object FormDebug: TFormDebug
end end
object ButtonCop: TButton object ButtonCop: TButton
Left = 487 Left = 487
Top = 192 Top = 208
Width = 97 Width = 97
Height = 41 Height = 41
Anchors = [akTop, akRight] Anchors = [akTop, akRight]
@@ -147,7 +147,7 @@ object FormDebug: TFormDebug
end end
object RichEdit: TRichEdit object RichEdit: TRichEdit
Left = 591 Left = 591
Top = 160 Top = 176
Width = 239 Width = 239
Height = 153 Height = 153
Anchors = [akTop, akRight] Anchors = [akTop, akRight]
@@ -166,7 +166,7 @@ object FormDebug: TFormDebug
end end
object ButtonRazLog: TButton object ButtonRazLog: TButton
Left = 487 Left = 487
Top = 384 Top = 400
Width = 97 Width = 97
Height = 33 Height = 33
Anchors = [akTop, akRight] Anchors = [akTop, akRight]
@@ -315,7 +315,7 @@ object FormDebug: TFormDebug
Left = 485 Left = 485
Top = 20 Top = 20
Width = 345 Width = 345
Height = 137 Height = 149
Anchors = [akTop, akRight] Anchors = [akTop, akRight]
Caption = 'S'#233'lections d'#39'affichage' Caption = 'S'#233'lections d'#39'affichage'
Color = cl3DLight Color = cl3DLight
@@ -359,7 +359,7 @@ object FormDebug: TFormDebug
end end
object CheckBoxTraceLIste: TCheckBox object CheckBoxTraceLIste: TCheckBox
Left = 8 Left = 8
Top = 112 Top = 128
Width = 185 Width = 185
Height = 17 Height = 17
Caption = 'Evaluations des routes des trains' Caption = 'Evaluations des routes des trains'
@@ -374,7 +374,7 @@ object FormDebug: TFormDebug
end end
object CheckTrame: TCheckBox object CheckTrame: TCheckBox
Left = 8 Left = 8
Top = 80 Top = 96
Width = 233 Width = 233
Height = 17 Height = 17
Caption = 'Trames '#233'chang'#233'es avec l'#39'interface ou CDM' Caption = 'Trames '#233'chang'#233'es avec l'#39'interface ou CDM'
@@ -404,7 +404,7 @@ object FormDebug: TFormDebug
end end
object CheckBoxAffFD: TCheckBox object CheckBoxAffFD: TCheckBox
Left = 8 Left = 8
Top = 96 Top = 112
Width = 193 Width = 193
Height = 17 Height = 17
Caption = 'Fronts descendants des d'#233'tecteurs' Caption = 'Fronts descendants des d'#233'tecteurs'
@@ -421,7 +421,7 @@ object FormDebug: TFormDebug
end end
object CheckBoxAffDebDecSig: TCheckBox object CheckBoxAffDebDecSig: TCheckBox
Left = 8 Left = 8
Top = 64 Top = 80
Width = 193 Width = 193
Height = 17 Height = 17
Caption = 'Pilotage des d'#233'codeurs de signaux' Caption = 'Pilotage des d'#233'codeurs de signaux'
@@ -438,7 +438,7 @@ object FormDebug: TFormDebug
Left = 168 Left = 168
Top = 12 Top = 12
Width = 33 Width = 33
Height = 18 Height = 21
Hint = Hint =
'Adresse du signal seul '#224' surveiller ou si 0 surveille tous les s' + 'Adresse du signal seul '#224' surveiller ou si 0 surveille tous les s' +
'ignaux' 'ignaux'
@@ -447,6 +447,26 @@ object FormDebug: TFormDebug
TabOrder = 7 TabOrder = 7
OnChange = EditDebugSignalChange OnChange = EditDebugSignalChange
end end
object CheckBoxTiers: TCheckBox
Left = 8
Top = 64
Width = 273
Height = 17
Hint =
'N'#233'cessite d'#39'activer les services "signaux" et "position des trai' +
'ns" dans la configuration g'#233'n'#233'rale'
Caption = 'Ev'#232'vements tiers (signaux et position des trains)'
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
ParentFont = False
ParentShowHint = False
ShowHint = True
TabOrder = 8
OnClick = CheckBoxTiersClick
end
end end
object RichDebug: TRichEdit object RichDebug: TRichEdit
Left = 8 Left = 8
@@ -509,7 +529,7 @@ object FormDebug: TFormDebug
end end
object ButtonRazTout: TButton object ButtonRazTout: TButton
Left = 488 Left = 488
Top = 160 Top = 176
Width = 97 Width = 97
Height = 25 Height = 25
Anchors = [akTop, akRight] Anchors = [akTop, akRight]
+12 -3
View File
@@ -51,6 +51,7 @@ type
EditSimuDet: TEdit; EditSimuDet: TEdit;
ButtonRazTout: TButton; ButtonRazTout: TButton;
EditDebugSignal: TEdit; EditDebugSignal: TEdit;
CheckBoxTiers: TCheckBox;
procedure FormCreate(Sender: TObject); procedure FormCreate(Sender: TObject);
procedure ButtonEcrLogClick(Sender: TObject); procedure ButtonEcrLogClick(Sender: TObject);
procedure EditNivDebugKeyPress(Sender: TObject; var Key: Char); procedure EditNivDebugKeyPress(Sender: TObject; var Key: Char);
@@ -80,6 +81,7 @@ type
procedure RichEditChange(Sender: TObject); procedure RichEditChange(Sender: TObject);
procedure MemoEvtDetChange(Sender: TObject); procedure MemoEvtDetChange(Sender: TObject);
procedure EditDebugSignalChange(Sender: TObject); procedure EditDebugSignalChange(Sender: TObject);
procedure CheckBoxTiersClick(Sender: TObject);
private private
{ Déclarations privées } { Déclarations privées }
public public
@@ -91,6 +93,7 @@ Max_Event_det_tick=30000;
Max_event_det=400; Max_event_det=400;
Max_Trains=50; Max_Trains=50;
var var
FormDebug: TFormDebug; FormDebug: TFormDebug;
NivDebug,signalDebug : integer; NivDebug,signalDebug : integer;
@@ -352,7 +355,8 @@ begin
end; end;
procedure TFormDebug.ButtonDetSuivClick(Sender: TObject); procedure TFormDebug.ButtonDetSuivClick(Sender: TObject);
var Adr,type1,type2,Prec,Actuel,erreur,ancdebug : integer ; var Adr,Prec,Actuel,erreur,ancdebug : integer ;
type1,type2 : tequipement;
s1,s2 : string; s1,s2 : string;
begin begin
ancdebug:=NivDebug; ancdebug:=NivDebug;
@@ -360,8 +364,8 @@ begin
s1:=EditPrec.Text; s1:=EditPrec.Text;
s2:=EditActuel.Text; s2:=EditActuel.Text;
if (s1='') or (s2='') then exit; if (s1='') or (s2='') then exit;
if s1[1]='A' then begin type1:=2;delete(s1,1,1);end else type1:=1; if s1[1]='A' then begin type1:=aig;delete(s1,1,1);end else type1:=det;
if s2[1]='A' then begin type2:=2;delete(s2,1,1);end else type2:=1; if s2[1]='A' then begin type2:=aig;delete(s2,1,1);end else type2:=det;
Val(s1,prec,erreur); if erreur<>0 then exit; Val(s1,prec,erreur); if erreur<>0 then exit;
Val(s2,Actuel,erreur); if erreur<>0 then exit; Val(s2,Actuel,erreur); if erreur<>0 then exit;
Adr:=detecteur_suivant_El(prec,type1,actuel,type2,1); Adr:=detecteur_suivant_El(prec,type1,actuel,type2,1);
@@ -458,4 +462,9 @@ begin
val(EditDebugSignal.text,signalDebug,erreur); val(EditDebugSignal.text,signalDebug,erreur);
end; end;
procedure TFormDebug.CheckBoxTiersClick(Sender: TObject);
begin
AffTiers:=checkBoxTiers.checked;
end;
end. end.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+4 -3
View File
@@ -1,6 +1,6 @@
object FormPrinc: TFormPrinc object FormPrinc: TFormPrinc
Left = 1294 Left = 13
Top = 168 Top = 175
Width = 1212 Width = 1212
Height = 664 Height = 664
Caption = 'Client TCP-IP CDM Rail ou USB - syst'#232'me LENZ' Caption = 'Client TCP-IP CDM Rail ou USB - syst'#232'me LENZ'
@@ -1305,8 +1305,9 @@ object FormPrinc: TFormPrinc
Width = 83 Width = 83
Height = 33 Height = 33
Hint = 'Demande la version XpressNet '#224' la centrale' Hint = 'Demande la version XpressNet '#224' la centrale'
Caption = 'Dem version' Caption = 'Dem version centrale'
TabOrder = 1 TabOrder = 1
WordWrap = True
OnClick = BoutVersionClick OnClick = BoutVersionClick
end end
object loco: TButton object loco: TButton
+394 -394
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+83 -82
View File
@@ -266,7 +266,7 @@ const
type type
// structure du TCO // structure du TCO
TTCO = array[1..MaxCellX] of array[1..MaxCellY] of record TTCO = array[1..MaxCellX] of array[1..MaxCellY] of record
BType : integer ; // 1= détecteur 2= aiguillage 3=bis 4=Buttoir BType : TEquipement ;
Adresse : integer ; // adresse du détecteur ou de l'aiguillage ou du feu Adresse : integer ; // adresse du détecteur ou de l'aiguillage ou du feu
BImage : integer ; // 0=rien 1=voie 2=aiguillage gauche gauche ... 30=feu BImage : integer ; // 0=rien 1=voie 2=aiguillage gauche gauche ... 30=feu
mode : integer; // 0=éteint 1=allumé mode : integer; // 0=éteint 1=allumé
@@ -321,7 +321,7 @@ procedure lire_fichier_tco;
var fichier : textfile; var fichier : textfile;
s : string; s : string;
x,y,i,j,adresse,Aspect,valeur,erreur,FeuOriente,PiedFeu : integer; x,y,i,j,adresse,Aspect,valeur,erreur,FeuOriente,PiedFeu : integer;
BT : TEquipement;
function lit_ligne : string ; function lit_ligne : string ;
var c : char; var c : char;
begin begin
@@ -384,7 +384,11 @@ begin
i:=pos(',',s); i:=pos(',',s);
if i=0 then begin closefile(fichier);exit;end; if i=0 then begin closefile(fichier);exit;end;
val(copy(s,1,i-1),valeur,erreur);if erreur<>0 then begin closefile(fichier);exit;end; val(copy(s,1,i-1),valeur,erreur);if erreur<>0 then begin closefile(fichier);exit;end;
tco[x,y].BType:=valeur; if valeur=1 then BT:=det;
if valeur=2 then BT:=aig;
if valeur=4 then BT:=buttoir;
tco[x,y].BType:=BT;
delete(s,1,i); delete(s,1,i);
// Adresse // Adresse
@@ -487,8 +491,9 @@ begin
s:=''; s:='';
for x:=1 to NbreCellX do for x:=1 to NbreCellX do
begin begin
s:=s+'('+IntToSTR(TCO[x,y].BType)+','+Format('%.*d',[3,TCO[x,y].Adresse])+','+ s:=s+'('+IntToSTR(BTypeToNum(TCO[x,y].BType))+','+Format('%.*d',[3,TCO[x,y].Adresse])+','+
IntToSTR(TCO[x,y].BImage)+','; IntToSTR(TCO[x,y].BImage)+',';
if TCO[x,y].inverse then s:=s+'1,' else s:=s+'0,'; if TCO[x,y].inverse then s:=s+'1,' else s:=s+'0,';
if TCO[x,y].BImage=30 then if TCO[x,y].BImage=30 then
@@ -2288,14 +2293,15 @@ end;
// transforme les branches en TCO // transforme les branches en TCO
// trop compliqué. Il faudra dessiner son TCO soit meme ! // trop compliqué. Il faudra dessiner son TCO soit meme !
procedure construit_TCO; procedure construit_TCO;
var x,y,i,j,Max,indexMax,Btype,Adresse,ligne,AdrSuiv,Bimage,index : integer; var x,y,i,j,Max,indexMax,Adresse,ligne,AdrSuiv,Bimage,index : integer;
BT: Tequipement;
begin begin
// étape 0 Raz du TCO // étape 0 Raz du TCO
for y:=1 to NbreCellY do for y:=1 to NbreCellY do
for x:=1 to NbreCellX do for x:=1 to NbreCellX do
begin begin
TCO[x,y].Adresse:=0; TCO[x,y].Adresse:=0;
TCO[x,y].Btype:=0; TCO[x,y].Btype:=rien;
end; end;
//étape 1 trouver la branche la plus longue //étape 1 trouver la branche la plus longue
@@ -2315,12 +2321,12 @@ begin
for i:=1 to Max do for i:=1 to Max do
begin begin
Adresse:=BrancheN[IndexMax,i].Adresse; Adresse:=BrancheN[IndexMax,i].Adresse;
Btype:=BrancheN[IndexMax,i].Btype; BT:=BrancheN[IndexMax,i].Btype;
TCO[i,ligne].Adresse:=Adresse; TCO[i,ligne].Adresse:=Adresse;
TCO[i,ligne].Btype:=Btype; TCO[i,ligne].Btype:=BT;
// Btype 1= détecteur 2= aiguillage 3=bis 4=Buttoir // Btype 1= détecteur 2= aiguillage 3=bis 4=Buttoir
if Btype=1 then TCO[i,ligne].BImage:=1; if Bt=det then TCO[i,ligne].BImage:=1;
if Btype=2 then if Bt=aig then
begin begin
// A20,547,561,A22,A24,A26,515,518,A31,A29,A28,A30,539,522,A3,A1,A2,A4,A6B,545,A5B,A3 // A20,547,561,A22,A24,A26,515,518,A31,A29,A28,A30,539,522,A3,A1,A2,A4,A6B,545,A5B,A3
//20,P8P,D547,S548 // 22,P24P,S561,D25S //20,P8P,D547,S548 // 22,P24P,S561,D25S
@@ -2342,17 +2348,18 @@ end;
// affiche la cellule x et y en cases // affiche la cellule x et y en cases
procedure TformTCO.affiche_cellule(x,y : integer); procedure TformTCO.affiche_cellule(x,y : integer);
var Xorg,Yorg,mode,adresse,btype,Bimage,aspect,oriente,pos : integer; var Xorg,Yorg,mode,adresse,Bimage,aspect,oriente,pos : integer;
Bt : TEquipement;
s : string; s : string;
begin begin
PcanvasTCO.pen.Mode:=PmCopy; PcanvasTCO.pen.Mode:=PmCopy;
adresse:=tco[x,y].Adresse; adresse:=tco[x,y].Adresse;
btype:=tco[x,y].Btype; bt:=tco[x,y].Btype;
BImage:=tco[x,y].BImage; BImage:=tco[x,y].BImage;
mode:=tco[x,y].mode; mode:=tco[x,y].mode;
// récupérer la position de l'aiguillage // récupérer la position de l'aiguillage
if (bImage>=2) and (btype<=15) then if (bImage>=2) then //????? and (btype<=15)
begin begin
if Adresse<>0 then pos:=Aiguillage[Index_Aig(adresse)].position if Adresse<>0 then pos:=Aiguillage[Index_Aig(adresse)].position
@@ -2398,7 +2405,7 @@ begin
// affiche le texte des aiguillages // affiche le texte des aiguillages
if ((BImage=2) or (BImage=3) or (BImage=4) or (BImage=5) or (BImage=12) or (BImage=13) or (BImage=14) or (BImage=15) or (BImage=21) or (BImage=22)) and (adresse<>0) then if ((BImage=2) or (BImage=3) or (BImage=4) or (BImage=5) or (BImage=12) or (BImage=13) or (BImage=14) or (BImage=15) or (BImage=21) or (BImage=22)) and (adresse<>0) then
begin begin
if Btype<>3 then s:='A'+s else s:='A'+s+'B'; if Bt<>tjs then s:='A'+s else s:='A'+s+'B';
with PCanvasTCO do with PCanvasTCO do
begin begin
Brush.Color:=fond; Brush.Color:=fond;
@@ -2674,7 +2681,7 @@ begin
YclicCellInserer:=YClicCell; YclicCellInserer:=YClicCell;
EditAdrElement.Text:=IntToSTR(tco[XClicCellInserer,YClicCellInserer].Adresse); EditAdrElement.Text:=IntToSTR(tco[XClicCellInserer,YClicCellInserer].Adresse);
EdittypeElement.Text:=IntToSTR(tco[XClicCellInserer,YClicCellInserer].BType); EdittypeElement.Text:=IntToSTR(BtypeToNum(tco[XClicCellInserer,YClicCellInserer].BType));
EdittypeImage.Text:=IntToSTR(BImage); EdittypeImage.Text:=IntToSTR(BImage);
if not(selectionaffichee) then _entoure_cell_clic; if not(selectionaffichee) then _entoure_cell_clic;
@@ -3031,7 +3038,7 @@ begin
LabelY.caption:=IntToSTR(YClicCell); LabelY.caption:=IntToSTR(YClicCell);
//Entoure_cell(XclicCell,YclicCell); //Entoure_cell(XclicCell,YclicCell);
EditAdrElement.Text:=IntToSTR(tco[XClicCell,YClicCell].Adresse); EditAdrElement.Text:=IntToSTR(tco[XClicCell,YClicCell].Adresse);
EdittypeElement.Text:=IntToSTR(tco[XClicCell,YClicCell].BType); EdittypeElement.Text:=IntToSTR(BtypeToNum(tco[XClicCell,YClicCell].BType));
end; end;
procedure TFormTCO.Elmentdroit1Click(Sender: TObject); procedure TFormTCO.Elmentdroit1Click(Sender: TObject);
@@ -3044,7 +3051,7 @@ begin
//Entoure_cell(XclicCell,YclicCell); //Entoure_cell(XclicCell,YclicCell);
EditAdrElement.Text:=IntToSTR(tco[XClicCellInserer,YClicCellInserer].Adresse); EditAdrElement.Text:=IntToSTR(tco[XClicCellInserer,YClicCellInserer].Adresse);
EdittypeElement.Text:=IntToSTR(tco[XClicCellInserer,YClicCellInserer].BType); EdittypeElement.Text:=IntToSTR(BtypeToNum(tco[XClicCellInserer,YClicCellInserer].BType));
end; end;
procedure TFormTCO.Courbegaucheversdroite1Click(Sender: TObject); procedure TFormTCO.Courbegaucheversdroite1Click(Sender: TObject);
@@ -3127,11 +3134,11 @@ begin
XclicCell:=Xclic div largeurCell +1; XclicCell:=Xclic div largeurCell +1;
YclicCell:=Yclic div hauteurCell +1; YclicCell:=Yclic div hauteurCell +1;
dessin_AigPD_AD(ImageTCO.Canvas,XClicCell,YClicCell,0,9); dessin_AigPD_AD(ImageTCO.Canvas,XClicCell,YClicCell,0,9);
tco[XClicCell,YClicCell].BType:=2; // aiguillage tco[XClicCell,YClicCell].BType:=aig; // aiguillage
tco[XClicCell,YClicCell].BImage:=5; // image 5 tco[XClicCell,YClicCell].BImage:=5; // image 5
_entoure_cell_clic; _entoure_cell_clic;
EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse);
EdittypeElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Btype); EdittypeElement.Text:=IntToSTR(BtypeToNum(tco[XClicCell,YClicCell].Btype));
EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage);
end; end;
@@ -3143,12 +3150,12 @@ begin
Xclic:=X;YClic:=Y; Xclic:=X;YClic:=Y;
XclicCell:=Xclic div largeurCell +1; XclicCell:=Xclic div largeurCell +1;
YclicCell:=Yclic div hauteurCell +1; YclicCell:=Yclic div hauteurCell +1;
tco[XClicCell,YClicCell].BType:=2; // aiguillage tco[XClicCell,YClicCell].BType:=aig; // aiguillage
tco[XClicCell,YClicCell].BImage:=2; // image 2 tco[XClicCell,YClicCell].BImage:=2; // image 2
dessin_AigG_PD(ImageTCO.Canvas,XClicCell,YClicCell,0,9); dessin_AigG_PD(ImageTCO.Canvas,XClicCell,YClicCell,0,9);
_entoure_cell_clic; _entoure_cell_clic;
EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse);
EdittypeElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Btype); EdittypeElement.Text:=IntToSTR(BtypeToNum(tco[XClicCell,YClicCell].Btype));
EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage);
end; end;
@@ -3167,11 +3174,11 @@ begin
XclicCell:=Xclic div largeurCell +1; XclicCell:=Xclic div largeurCell +1;
YclicCell:=Yclic div hauteurCell +1; YclicCell:=Yclic div hauteurCell +1;
dessin_AigPG_AG(ImageTCO.Canvas,XClicCell,YClicCell,0,9); dessin_AigPG_AG(ImageTCO.Canvas,XClicCell,YClicCell,0,9);
tco[XClicCell,YClicCell].BType:=2; // aiguillage tco[XClicCell,YClicCell].BType:=aig; // aiguillage
tco[XClicCell,YClicCell].BImage:=3; // image 3 tco[XClicCell,YClicCell].BImage:=3; // image 3
_entoure_cell_clic; _entoure_cell_clic;
EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse);
EdittypeElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Btype); EdittypeElement.Text:=IntToSTR(BtypeToNum(tco[XClicCell,YClicCell].Btype));
EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage);
end; end;
@@ -3190,11 +3197,11 @@ begin
XclicCell:=Xclic div largeurCell +1; XclicCell:=Xclic div largeurCell +1;
YclicCell:=Yclic div hauteurCell +1; YclicCell:=Yclic div hauteurCell +1;
dessin_AigD_PG(ImageTCO.Canvas,XClicCell,YClicCell,0,9); dessin_AigD_PG(ImageTCO.Canvas,XClicCell,YClicCell,0,9);
tco[XClicCell,YClicCell].BType:=2; // aiguillage tco[XClicCell,YClicCell].BType:=aig; // aiguillage
tco[XClicCell,YClicCell].BImage:=4; // image 4 tco[XClicCell,YClicCell].BImage:=4; // image 4
_entoure_cell_clic; _entoure_cell_clic;
EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse);
EdittypeElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Btype); EdittypeElement.Text:=IntToSTR(BtypeToNum(tco[XClicCell,YClicCell].Btype));
EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage);
end; end;
@@ -3214,12 +3221,12 @@ begin
XclicCell:=Xclic div largeurCell +1; XclicCell:=Xclic div largeurCell +1;
YclicCell:=Yclic div hauteurCell +1; YclicCell:=Yclic div hauteurCell +1;
dessin_voie(ImageTCO.Canvas,XClicCell,YClicCell,0); dessin_voie(ImageTCO.Canvas,XClicCell,YClicCell,0);
tco[XClicCell,YClicCell].BType:=1; // voie tco[XClicCell,YClicCell].BType:=voie; // voie (3)
tco[XClicCell,YClicCell].BImage:=1; // image 1 tco[XClicCell,YClicCell].BImage:=1; // image 1
tco[XClicCell,YClicCell].Adresse:=0; tco[XClicCell,YClicCell].Adresse:=0;
_entoure_cell_clic; _entoure_cell_clic;
EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse);
EdittypeElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Btype); EdittypeElement.Text:=IntToSTR(BtypeToNum(tco[XClicCell,YClicCell].Btype));
EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage);
end; end;
@@ -3238,12 +3245,12 @@ begin
XclicCell:=Xclic div largeurCell +1; XclicCell:=Xclic div largeurCell +1;
YclicCell:=Yclic div hauteurCell +1; YclicCell:=Yclic div hauteurCell +1;
dessin_SupG(ImageTCO.Canvas,XClicCell,YClicCell,0); dessin_SupG(ImageTCO.Canvas,XClicCell,YClicCell,0);
tco[XClicCell,YClicCell].BType:=0; // rien tco[XClicCell,YClicCell].BType:=rien; // rien
tco[XClicCell,YClicCell].BImage:=6; // image 6 tco[XClicCell,YClicCell].BImage:=6; // image 6
tco[XClicCell,YClicCell].Adresse:=0; tco[XClicCell,YClicCell].Adresse:=0;
_entoure_cell_clic; _entoure_cell_clic;
EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse);
EdittypeElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Btype); EdittypeElement.Text:=IntToSTR(BtypeToNum(tco[XClicCell,YClicCell].Btype));
EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage);
end; end;
@@ -3262,12 +3269,12 @@ begin
XclicCell:=Xclic div largeurCell +1; XclicCell:=Xclic div largeurCell +1;
YclicCell:=Yclic div hauteurCell +1; YclicCell:=Yclic div hauteurCell +1;
dessin_SupD(ImageTCO.Canvas,XClicCell,YClicCell,0); dessin_SupD(ImageTCO.Canvas,XClicCell,YClicCell,0);
tco[XClicCell,YClicCell].BType:=0; // rien tco[XClicCell,YClicCell].BType:=rien; // rien
tco[XClicCell,YClicCell].BImage:=7; // image 7 tco[XClicCell,YClicCell].BImage:=7; // image 7
tco[XClicCell,YClicCell].Adresse:=0; tco[XClicCell,YClicCell].Adresse:=0;
_entoure_cell_clic; _entoure_cell_clic;
EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse);
EdittypeElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Btype); EdittypeElement.Text:=IntToSTR(BtypeToNum(tco[XClicCell,YClicCell].Btype));
EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage);
end; end;
@@ -3287,12 +3294,12 @@ begin
XclicCell:=Xclic div largeurCell +1; XclicCell:=Xclic div largeurCell +1;
YclicCell:=Yclic div hauteurCell +1; YclicCell:=Yclic div hauteurCell +1;
dessin_infD(ImageTCO.Canvas,XClicCell,YClicCell,0); dessin_infD(ImageTCO.Canvas,XClicCell,YClicCell,0);
tco[XClicCell,YClicCell].BType:=0; // rien tco[XClicCell,YClicCell].BType:=rien; // rien
tco[XClicCell,YClicCell].BImage:=8; // image 8 tco[XClicCell,YClicCell].BImage:=8; // image 8
tco[XClicCell,YClicCell].Adresse:=0; tco[XClicCell,YClicCell].Adresse:=0;
_entoure_cell_clic; _entoure_cell_clic;
EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse);
EdittypeElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Btype); EdittypeElement.Text:=IntToSTR(BtypeToNum(tco[XClicCell,YClicCell].Btype));
EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage);
end; end;
@@ -3388,12 +3395,12 @@ begin
XclicCell:=Xclic div largeurCell +1; XclicCell:=Xclic div largeurCell +1;
YclicCell:=Yclic div hauteurCell +1; YclicCell:=Yclic div hauteurCell +1;
dessin_infG(ImageTCO.Canvas,XClicCell,YClicCell,0); dessin_infG(ImageTCO.Canvas,XClicCell,YClicCell,0);
tco[XClicCell,YClicCell].BType:=0; // rien tco[XClicCell,YClicCell].BType:=rien; // rien
tco[XClicCell,YClicCell].BImage:=9; // image 9 tco[XClicCell,YClicCell].BImage:=9; // image 9
tco[XClicCell,YClicCell].Adresse:=0; // rien tco[XClicCell,YClicCell].Adresse:=0; // rien
_entoure_cell_clic; _entoure_cell_clic;
EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse);
EdittypeElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Btype); EdittypeElement.Text:=IntToSTR(BtypeToNum(tco[XClicCell,YClicCell].Btype));
EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage);
end; end;
@@ -3407,12 +3414,12 @@ begin
XclicCell:=Xclic div largeurCell +1; XclicCell:=Xclic div largeurCell +1;
YclicCell:=Yclic div hauteurCell +1; YclicCell:=Yclic div hauteurCell +1;
dessin_Aig45PG_AG(ImageTCO.Canvas,XClicCell,YClicCell,0,9); dessin_Aig45PG_AG(ImageTCO.Canvas,XClicCell,YClicCell,0,9);
tco[XClicCell,YClicCell].BType:=0; // rien tco[XClicCell,YClicCell].BType:=rien; // rien
tco[XClicCell,YClicCell].BImage:=12; // image 12 tco[XClicCell,YClicCell].BImage:=12; // image 12
tco[XClicCell,YClicCell].Adresse:=0; // rien tco[XClicCell,YClicCell].Adresse:=0; // rien
_entoure_cell_clic; _entoure_cell_clic;
EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse);
EdittypeElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Btype); EdittypeElement.Text:=IntToSTR(BtypeToNum(tco[XClicCell,YClicCell].Btype));
EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage);
end; end;
@@ -3427,12 +3434,12 @@ begin
XclicCell:=Xclic div largeurCell +1; XclicCell:=Xclic div largeurCell +1;
YclicCell:=Yclic div hauteurCell +1; YclicCell:=Yclic div hauteurCell +1;
dessin_Aig45PD_AD(ImageTCO.Canvas,XClicCell,YClicCell,0,9); dessin_Aig45PD_AD(ImageTCO.Canvas,XClicCell,YClicCell,0,9);
tco[XClicCell,YClicCell].BType:=0; // rien tco[XClicCell,YClicCell].BType:=rien; // rien
tco[XClicCell,YClicCell].BImage:=13; // image 13 tco[XClicCell,YClicCell].BImage:=13; // image 13
tco[XClicCell,YClicCell].Adresse:=0; // rien tco[XClicCell,YClicCell].Adresse:=0; // rien
_entoure_cell_clic; _entoure_cell_clic;
EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse);
EdittypeElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Btype); EdittypeElement.Text:=IntToSTR(BtypeToNum(tco[XClicCell,YClicCell].Btype));
EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage);
end; end;
@@ -3446,16 +3453,15 @@ begin
XclicCell:=Xclic div largeurCell +1; XclicCell:=Xclic div largeurCell +1;
YclicCell:=Yclic div hauteurCell +1; YclicCell:=Yclic div hauteurCell +1;
dessin_Aig45PD_AG(ImageTCO.Canvas,XClicCell,YClicCell,0,9); dessin_Aig45PD_AG(ImageTCO.Canvas,XClicCell,YClicCell,0,9);
tco[XClicCell,YClicCell].BType:=0; // rien tco[XClicCell,YClicCell].BType:=rien; // rien
tco[XClicCell,YClicCell].BImage:=14; // image 14 tco[XClicCell,YClicCell].BImage:=14; // image 14
tco[XClicCell,YClicCell].Adresse:=0; // rien tco[XClicCell,YClicCell].Adresse:=0; // rien
_entoure_cell_clic; _entoure_cell_clic;
EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse);
EdittypeElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Btype); EdittypeElement.Text:=IntToSTR(BtypeToNum(tco[XClicCell,YClicCell].Btype));
EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage);
end; end;
procedure TFormTCO.ImageAig45PG_ADEndDrag(Sender, Target: TObject; X, procedure TFormTCO.ImageAig45PG_ADEndDrag(Sender, Target: TObject; X,
Y: Integer); Y: Integer);
begin begin
@@ -3466,16 +3472,15 @@ begin
XclicCell:=Xclic div largeurCell +1; XclicCell:=Xclic div largeurCell +1;
YclicCell:=Yclic div hauteurCell +1; YclicCell:=Yclic div hauteurCell +1;
Dessin_Aig45PG_AD(ImageTCO.Canvas,XClicCell,YClicCell,0,9); Dessin_Aig45PG_AD(ImageTCO.Canvas,XClicCell,YClicCell,0,9);
tco[XClicCell,YClicCell].BType:=0; // rien tco[XClicCell,YClicCell].BType:=rien; // rien
tco[XClicCell,YClicCell].BImage:=15; // image 15 tco[XClicCell,YClicCell].BImage:=15; // image 15
tco[XClicCell,YClicCell].Adresse:=0; // rien tco[XClicCell,YClicCell].Adresse:=0; // rien
_entoure_cell_clic; _entoure_cell_clic;
EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse);
EdittypeElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Btype); EdittypeElement.Text:=IntToSTR(BtypeToNum(tco[XClicCell,YClicCell].Btype));
EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage);
end; end;
procedure TFormTCO.ImagePalette16EndDrag(Sender, Target: TObject; X, Y: Integer); procedure TFormTCO.ImagePalette16EndDrag(Sender, Target: TObject; X, Y: Integer);
begin begin
if (x=0) and (y=0) then exit; if (x=0) and (y=0) then exit;
@@ -3485,12 +3490,12 @@ begin
XclicCell:=Xclic div largeurCell +1; XclicCell:=Xclic div largeurCell +1;
YclicCell:=Yclic div hauteurCell +1; YclicCell:=Yclic div hauteurCell +1;
Dessin_16(ImageTCO.Canvas,XClicCell,YClicCell,0); Dessin_16(ImageTCO.Canvas,XClicCell,YClicCell,0);
tco[XClicCell,YClicCell].BType:=0; // rien tco[XClicCell,YClicCell].BType:=rien; // rien
tco[XClicCell,YClicCell].BImage:=16; // image 16 tco[XClicCell,YClicCell].BImage:=16; // image 16
tco[XClicCell,YClicCell].Adresse:=0; // rien tco[XClicCell,YClicCell].Adresse:=0; // rien
_entoure_cell_clic; _entoure_cell_clic;
EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse);
EdittypeElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Btype); EdittypeElement.Text:=IntToSTR(BtypeToNum(tco[XClicCell,YClicCell].Btype));
EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage);
end; end;
@@ -3504,16 +3509,15 @@ begin
XclicCell:=Xclic div largeurCell +1; XclicCell:=Xclic div largeurCell +1;
YclicCell:=Yclic div hauteurCell +1; YclicCell:=Yclic div hauteurCell +1;
Dessin_17(ImageTCO.Canvas,XClicCell,YClicCell,0); Dessin_17(ImageTCO.Canvas,XClicCell,YClicCell,0);
tco[XClicCell,YClicCell].BType:=0; // rien tco[XClicCell,YClicCell].BType:=rien; // rien
tco[XClicCell,YClicCell].BImage:=17; // image 17 tco[XClicCell,YClicCell].BImage:=17; // image 17
tco[XClicCell,YClicCell].Adresse:=0; // rien tco[XClicCell,YClicCell].Adresse:=0; // rien
_entoure_cell_clic; _entoure_cell_clic;
EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse);
EdittypeElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Btype); EdittypeElement.Text:=IntToSTR(BtypeToNum(tco[XClicCell,YClicCell].Btype));
EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage);
end; end;
procedure TFormTCO.ImagePalette18EndDrag(Sender, Target: TObject; X, procedure TFormTCO.ImagePalette18EndDrag(Sender, Target: TObject; X,
Y: Integer); Y: Integer);
begin begin
@@ -3524,12 +3528,12 @@ begin
XclicCell:=Xclic div largeurCell +1; XclicCell:=Xclic div largeurCell +1;
YclicCell:=Yclic div hauteurCell +1; YclicCell:=Yclic div hauteurCell +1;
Dessin_18(ImageTCO.Canvas,XClicCell,YClicCell,0); Dessin_18(ImageTCO.Canvas,XClicCell,YClicCell,0);
tco[XClicCell,YClicCell].BType:=0; // rien tco[XClicCell,YClicCell].BType:=rien; // rien
tco[XClicCell,YClicCell].BImage:=18; // image 18 tco[XClicCell,YClicCell].BImage:=18; // image 18
tco[XClicCell,YClicCell].Adresse:=0; // rien tco[XClicCell,YClicCell].Adresse:=0; // rien
_entoure_cell_clic; _entoure_cell_clic;
EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse);
EdittypeElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Btype); EdittypeElement.Text:=IntToSTR(BtypeToNum(tco[XClicCell,YClicCell].Btype));
EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage);
end; end;
@@ -3543,12 +3547,12 @@ begin
XclicCell:=Xclic div largeurCell +1; XclicCell:=Xclic div largeurCell +1;
YclicCell:=Yclic div hauteurCell +1; YclicCell:=Yclic div hauteurCell +1;
Dessin_19(ImageTCO.Canvas,XClicCell,YClicCell,0); Dessin_19(ImageTCO.Canvas,XClicCell,YClicCell,0);
tco[XClicCell,YClicCell].BType:=0; // rien tco[XClicCell,YClicCell].BType:=rien; // rien
tco[XClicCell,YClicCell].BImage:=19; // image 19 tco[XClicCell,YClicCell].BImage:=19; // image 19
tco[XClicCell,YClicCell].Adresse:=0; // rien tco[XClicCell,YClicCell].Adresse:=0; // rien
_entoure_cell_clic; _entoure_cell_clic;
EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse);
EdittypeElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Btype); EdittypeElement.Text:=IntToSTR(BtypeToNum(tco[XClicCell,YClicCell].Btype));
EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage);
end; end;
@@ -3562,12 +3566,12 @@ begin
XclicCell:=Xclic div largeurCell +1; XclicCell:=Xclic div largeurCell +1;
YclicCell:=Yclic div hauteurCell +1; YclicCell:=Yclic div hauteurCell +1;
Dessin_20(ImageTCO.Canvas,XClicCell,YClicCell,0); Dessin_20(ImageTCO.Canvas,XClicCell,YClicCell,0);
tco[XClicCell,YClicCell].BType:=0; // rien tco[XClicCell,YClicCell].BType:=rien; // rien
tco[XClicCell,YClicCell].BImage:=20; // image 20 tco[XClicCell,YClicCell].BImage:=20; // image 20
tco[XClicCell,YClicCell].Adresse:=0; // rien tco[XClicCell,YClicCell].Adresse:=0; // rien
_entoure_cell_clic; _entoure_cell_clic;
EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse);
EdittypeElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Btype); EdittypeElement.Text:=IntToSTR(BtypeToNum(tco[XClicCell,YClicCell].Btype));
EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage);
end; end;
@@ -3581,12 +3585,12 @@ begin
XclicCell:=Xclic div largeurCell +1; XclicCell:=Xclic div largeurCell +1;
YclicCell:=Yclic div hauteurCell +1; YclicCell:=Yclic div hauteurCell +1;
Dessin_21(ImageTCO.Canvas,XClicCell,YClicCell,0); Dessin_21(ImageTCO.Canvas,XClicCell,YClicCell,0);
tco[XClicCell,YClicCell].BType:=0; // rien tco[XClicCell,YClicCell].BType:=rien; // rien
tco[XClicCell,YClicCell].BImage:=21; tco[XClicCell,YClicCell].BImage:=21;
tco[XClicCell,YClicCell].Adresse:=0; // rien tco[XClicCell,YClicCell].Adresse:=0; // rien
_entoure_cell_clic; _entoure_cell_clic;
EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse);
EdittypeElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Btype); EdittypeElement.Text:=IntToSTR(BtypeToNum(tco[XClicCell,YClicCell].Btype));
EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage);
end; end;
@@ -3600,12 +3604,12 @@ begin
XclicCell:=Xclic div largeurCell +1; XclicCell:=Xclic div largeurCell +1;
YclicCell:=Yclic div hauteurCell +1; YclicCell:=Yclic div hauteurCell +1;
Dessin_22(ImageTCO.Canvas,XClicCell,YClicCell,0); Dessin_22(ImageTCO.Canvas,XClicCell,YClicCell,0);
tco[XClicCell,YClicCell].BType:=0; // rien tco[XClicCell,YClicCell].BType:=rien; // rien
tco[XClicCell,YClicCell].BImage:=22; tco[XClicCell,YClicCell].BImage:=22;
tco[XClicCell,YClicCell].Adresse:=0; // rien tco[XClicCell,YClicCell].Adresse:=0; // rien
_entoure_cell_clic; _entoure_cell_clic;
EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse);
EdittypeElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Btype); EdittypeElement.Text:=IntToSTR(BtypeToNum(tco[XClicCell,YClicCell].Btype));
EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage);
end; end;
@@ -3655,8 +3659,7 @@ end;
// supprimer la sélection // supprimer la sélection
procedure TFormTCO.MenuCouperClick(Sender: TObject); procedure TFormTCO.MenuCouperClick(Sender: TObject);
var var x,y,XCell1,YCell1,xCell2,yCell2 : integer;
x,y,XCell1,YCell1,xCell2,yCell2 : integer;
begin begin
// couper sans sélection : on coupe une seule cellule // couper sans sélection : on coupe une seule cellule
if not(SelectionAffichee) then if not(SelectionAffichee) then
@@ -3702,7 +3705,7 @@ begin
TamponTCO_org.x1:=XclicCell;TamponTCO_org.y1:=YclicCell; TamponTCO_org.x1:=XclicCell;TamponTCO_org.y1:=YclicCell;
TamponTCO_org.x2:=XclicCell;TamponTCO_org.y2:=YclicCell; TamponTCO_org.x2:=XclicCell;TamponTCO_org.y2:=YclicCell;
tco[XclicCell,YClicCell].BType:=0; tco[XclicCell,YClicCell].BType:=rien;
tco[XclicCell,YClicCell].Adresse:=0; tco[XclicCell,YClicCell].Adresse:=0;
tco[XclicCell,YClicCell].Bimage:=0; tco[XclicCell,YClicCell].Bimage:=0;
efface_entoure; efface_entoure;
@@ -3727,7 +3730,7 @@ begin
for y:=yCell1 to yCell2 do for y:=yCell1 to yCell2 do
for x:=xCell1 to xCell2 do for x:=xCell1 to xCell2 do
begin begin
tco[x,y].BType:=0; tco[x,y].BType:=rien;
tco[x,y].Adresse:=0; tco[x,y].Adresse:=0;
tco[x,y].BImage:=0; tco[x,y].BImage:=0;
//Affiche('Efface cellules '+IntToSTR(X)+' '+intToSTR(y),clyellow); //Affiche('Efface cellules '+IntToSTR(X)+' '+intToSTR(y),clyellow);
@@ -3759,7 +3762,6 @@ begin
end; end;
end; end;
end; end;
end; end;
end; end;
Affiche_TCO; Affiche_TCO;
@@ -3768,8 +3770,7 @@ end;
// évènement qui se produit quand on clique gauche ou droit // évènement qui se produit quand on clique gauche ou droit
procedure TFormTCO.ImageTCOMouseDown(Sender: TObject; Button: TMouseButton;Shift: TShiftState; X, Y: Integer); procedure TFormTCO.ImageTCOMouseDown(Sender: TObject; Button: TMouseButton;Shift: TShiftState; X, Y: Integer);
var position : Tpoint; var position : Tpoint;
begin begin
// ImageTCO.BeginDrag(true); // ImageTCO.BeginDrag(true);
if button=mbLeft then if button=mbLeft then
@@ -3809,7 +3810,7 @@ begin
//Entoure_cell(XclicCellInserer,YclicCellInserer); //Entoure_cell(XclicCellInserer,YclicCellInserer);
EditAdrElement.Text:=IntToSTR(tco[XClicCellInserer,YClicCellInserer].Adresse); EditAdrElement.Text:=IntToSTR(tco[XClicCellInserer,YClicCellInserer].Adresse);
EdittypeElement.Text:=IntToSTR(tco[XClicCellInserer,YClicCellInserer].BType); EdittypeElement.Text:=IntToSTR(BtypeToNum(tco[XClicCellInserer,YClicCellInserer].BType));
end; end;
end; end;
@@ -3961,13 +3962,13 @@ begin
tco[XClicCell,YClicCell].Bimage:=Bimage; tco[XClicCell,YClicCell].Bimage:=Bimage;
case Bimage of case Bimage of
// aiguillages // aiguillages
2,3,4,5,12,13,14,15 : tco[XClicCell,YClicCell].Btype:=2; 2,3,4,5,12,13,14,15 : tco[XClicCell,YClicCell].Btype:=aig;
// détecteur ou voie // détecteur ou voie
1,10,11,20 : tco[XClicCell,YClicCell].Btype:=1; 1,10,11,20 : tco[XClicCell,YClicCell].Btype:=voie;
else tco[XClicCell,YClicCell].Btype:=0; else tco[XClicCell,YClicCell].Btype:=rien;
end; end;
EditTypeElement.text:=intToSTR(tco[XClicCell,YClicCell].Btype); EditTypeElement.text:=intToSTR(BtypeToNum(tco[XClicCell,YClicCell].Btype));
affiche_cellule(XClicCell,YClicCell); affiche_cellule(XClicCell,YClicCell);
end; end;
end; end;
@@ -4006,7 +4007,7 @@ begin
XclicCell:=Xclic div largeurCell +1; XclicCell:=Xclic div largeurCell +1;
YclicCell:=Yclic div hauteurCell +1; YclicCell:=Yclic div hauteurCell +1;
dessin_Diag1(ImageTCO.Canvas,XClicCell,YClicCell,0); dessin_Diag1(ImageTCO.Canvas,XClicCell,YClicCell,0);
tco[XClicCell,YClicCell].BType:=0; // rien tco[XClicCell,YClicCell].BType:=rien; // rien
tco[XClicCell,YClicCell].BImage:=10; // image 10 tco[XClicCell,YClicCell].BImage:=10; // image 10
tco[XClicCell,YClicCell].Adresse:=0; tco[XClicCell,YClicCell].Adresse:=0;
tco[XClicCell,YClicCell].FeuOriente:=1; tco[XClicCell,YClicCell].FeuOriente:=1;
@@ -4015,7 +4016,7 @@ begin
tco[XClicCell,YClicCell].y:=0; // YClicCell; //?? tco[XClicCell,YClicCell].y:=0; // YClicCell; //??
EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse);
EdittypeElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Btype); EdittypeElement.Text:=IntToSTR(BtypeToNum(tco[XClicCell,YClicCell].Btype));
EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage);
end; end;
@@ -4034,12 +4035,12 @@ begin
XclicCell:=Xclic div largeurCell +1; XclicCell:=Xclic div largeurCell +1;
YclicCell:=Yclic div hauteurCell +1; YclicCell:=Yclic div hauteurCell +1;
dessin_Diag2(ImageTCO.Canvas,XClicCell,YClicCell,0); dessin_Diag2(ImageTCO.Canvas,XClicCell,YClicCell,0);
tco[XClicCell,YClicCell].BType:=0; // rien tco[XClicCell,YClicCell].BType:=rien; // rien
tco[XClicCell,YClicCell].BImage:=11; tco[XClicCell,YClicCell].BImage:=11;
tco[XClicCell,YClicCell].Adresse:=0; tco[XClicCell,YClicCell].Adresse:=0;
_entoure_cell_clic; _entoure_cell_clic;
EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse);
EdittypeElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Btype); EdittypeElement.Text:=IntToSTR(BtypeToNum(tco[XClicCell,YClicCell].Btype));
EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage);
end; end;
@@ -4065,7 +4066,7 @@ begin
XclicCell:=Xclic div largeurCell +1; XclicCell:=Xclic div largeurCell +1;
YclicCell:=Yclic div hauteurCell +1; YclicCell:=Yclic div hauteurCell +1;
//PCanvasTCO.Draw((xClicCell-1)*LargeurCell,(yClicCell-1)*HauteurCell,ImageFeu.Picture.Bitmap); //PCanvasTCO.Draw((xClicCell-1)*LargeurCell,(yClicCell-1)*HauteurCell,ImageFeu.Picture.Bitmap);
tco[XClicCell,YClicCell].BType:=0; // rien tco[XClicCell,YClicCell].BType:=rien; // rien
tco[XClicCell,YClicCell].BImage:=30; tco[XClicCell,YClicCell].BImage:=30;
tco[XClicCell,YClicCell].Adresse:=0; tco[XClicCell,YClicCell].Adresse:=0;
tco[XClicCell,YClicCell].FeuOriente:=1; tco[XClicCell,YClicCell].FeuOriente:=1;
@@ -4075,7 +4076,7 @@ begin
// ne pas convertir l'adresse sinon evt changement du composant et on écrase l'aspect EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); // ne pas convertir l'adresse sinon evt changement du composant et on écrase l'aspect EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse);
EdittypeElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Btype); EdittypeElement.Text:=IntToSTR(BtypeToNum(tco[XClicCell,YClicCell].Btype));
EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage);
dessin_feu(PCanvasTCO,XclicCell,YClicCell); dessin_feu(PCanvasTCO,XclicCell,YClicCell);
@@ -4297,8 +4298,8 @@ begin
( FindComponent('No') as TButton).Caption:='dévié'; ( FindComponent('No') as TButton).Caption:='dévié';
end; end;
Result:=Msgdlg.ShowModal; Result:=Msgdlg.ShowModal;
if Result=MrYes then begin efface_entoure;SelectionAffichee:=false;pilote_acc(adresse,2,aig);end; // droit if Result=MrYes then begin efface_entoure;SelectionAffichee:=false;pilote_acc(adresse,2,aigP);end; // droit
if Result=MrNo then begin efface_entoure;SelectionAffichee:=false;pilote_acc(adresse,1,aig);end; // dévié if Result=MrNo then begin efface_entoure;SelectionAffichee:=false;pilote_acc(adresse,1,aigP);end; // dévié
sourisclic:=false; // évite de générer un cadre de sélection:=false; sourisclic:=false; // évite de générer un cadre de sélection:=false;
piloteAig:=true; piloteAig:=true;
Binary file not shown.
BIN
View File
Binary file not shown.
+30 -10
View File
@@ -23,7 +23,8 @@ var
Lance_verif : integer; Lance_verif : integer;
verifVersion,notificationVersion : boolean; verifVersion,notificationVersion : boolean;
Const Version='3.1'; // sert à la comparaison de la version publiée Const Version='3.2'; // sert à la comparaison de la version publiée
SousVersion=' '; // en cas d'absence de sous version mettre un espace
implementation implementation
@@ -102,8 +103,9 @@ procedure verifie_version;
var s,s2,s3,Version_p,Url,LocalFile : string; var s,s2,s3,Version_p,Url,LocalFile : string;
trouve_version,trouve_zip,zone_comm : boolean; trouve_version,trouve_zip,zone_comm : boolean;
fichier : text; fichier : text;
i,j,erreur,Ncomm,i2,i3 : integer; i,j,erreur,Ncomm,i2,i3,l : integer;
V_publie,V_utile : real; V_publie,V_utile : real;
SV_publie : char;
comm : array[1..10] of string; comm : array[1..10] of string;
begin begin
//Affiche('vérifie version',clLime); //Affiche('vérifie version',clLime);
@@ -122,18 +124,28 @@ begin
while not(eof(fichier)) and (not(trouve_version) or not(trouve_zip)) do while not(eof(fichier)) and (not(trouve_version) or not(trouve_zip)) do
begin begin
readln(fichier,s); readln(fichier,s);
//Affiche(s,clyellow);
s:=LowerCase(s); s:=LowerCase(s);
if not(trouve_version) then if not(trouve_version) then
begin begin
i:=pos('version ',s); i:=pos('version ',s);
trouve_version:=i<>0; trouve_version:=i<>0;
if trouve_version then begin s2:=s;zone_comm:=true;end; if trouve_version then
begin
s2:=s;zone_comm:=true;
//Affiche('trouvé version',clOrange);
end;
end; end;
if not(trouve_zip) then if not(trouve_zip) then
begin begin
i:=pos('.zip',s); i:=pos('.zip',s);
trouve_zip:=i<>0; trouve_zip:=i<>0;
if trouve_zip then begin s3:=s;zone_comm:=false;end; //if trouve_zip then Affiche(s,clyellow);
if trouve_zip then
begin
s3:=s;
//zone_comm:=false;
end;
end; end;
// commentaire en gras // commentaire en gras
if zone_comm then if zone_comm then
@@ -141,6 +153,7 @@ begin
i:=pos('bold">',s)+6;i2:=posEx('<br />',s,i+1); i:=pos('bold">',s)+6;i2:=posEx('<br />',s,i+1);
if i<>6 then if i<>6 then
begin begin
//Affiche(s,clred);
inc(ncomm); inc(ncomm);
comm[ncomm]:=UTF8Decode(copy(s,i,i2-i)); comm[ncomm]:=UTF8Decode(copy(s,i,i2-i));
Delete(s,1,i2-1); Delete(s,1,i2-1);
@@ -186,19 +199,26 @@ begin
s2:=version; s2:=version;
// i:=pos('.',s2);if i<>0 then s2[i]:=','; // i:=pos('.',s2);if i<>0 then s2[i]:=',';
val(s,V_publie,erreur); if erreur<>0 then exit; l:=length(s);
val(s2,V_utile,erreur); if erreur<>0 then exit; SV_publie:=s[l];
if Sv_publie in ['0'..'9'] then Sv_Publie:=' ' else s:=copy(s,1,l-1);
val(s,V_publie,erreur);
if erreur<>0 then exit;
val(s2,V_utile,erreur);
if erreur<>0 then exit;
if V_utile<V_publie then if (V_utile<V_publie) or
((V_utile=V_publie) and (SousVersion<SV_publie)) then
begin begin
FormVersion.Top:=1; FormVersion.Top:=1;
FormVersion.Left:=1; FormVersion.Left:=1;
FormVersion.show; FormVersion.show;
//aff(s3); // url dans s3 //aff(s3); // url dans s3
s:='Vous utilisez la version '+version+' mais il existe la version '+Version_p; s:='Vous utilisez la version '+version+SousVersion+' mais il existe la version '+Version_p+SV_publie;
if ncomm>0 then if ncomm>0 then
begin begin
Aff('Nouveautés de la V'+version_p+' de Signaux_Complexes_GL :'); Aff('Nouveautés de la V'+version_p+SV_publie+' de Signaux_Complexes_GL :');
Aff(' '); Aff(' ');
for i:=1 to ncomm do aff(comm[i]); for i:=1 to ncomm do aff(comm[i]);
end; end;
@@ -220,7 +240,7 @@ begin
else formVersion.Free; else formVersion.Free;
end; end;
if (V_utile=V_publie) and notificationVersion then Affiche('Votre version '+Version_p+' est à jour',clLime); if (V_utile=V_publie) and notificationVersion then Affiche('Votre version '+Version_p+SousVersion+' est à jour',clLime);
end; end;
end end