This commit is contained in:
f1iwq2
2020-08-06 22:12:28 +02:00
parent 5c29a4d1aa
commit 933f55330f
12 changed files with 225 additions and 46 deletions

Binary file not shown.

View File

@@ -1536,6 +1536,13 @@ object FormConfig: TFormConfig
Height = 13 Height = 13
Caption = 'LabelTrain' Caption = 'LabelTrain'
end end
object Label10: TLabel
Left = 80
Top = 120
Width = 105
Height = 13
Caption = 'Verrouillable au carr'#233' :'
end
object ButtonAppliquerEtFermer: TButton object ButtonAppliquerEtFermer: TButton
Left = 384 Left = 384
Top = 440 Top = 440
@@ -1561,7 +1568,7 @@ object FormConfig: TFormConfig
Top = 8 Top = 8
Width = 585 Width = 585
Height = 417 Height = 417
ActivePage = TabSheetCDM ActivePage = TabSheet3
Font.Charset = DEFAULT_CHARSET Font.Charset = DEFAULT_CHARSET
Font.Color = clBackground Font.Color = clBackground
Font.Height = -11 Font.Height = -11
@@ -2348,6 +2355,7 @@ object FormConfig: TFormConfig
ReadOnly = True ReadOnly = True
ScrollBars = ssVertical ScrollBars = ssVertical
TabOrder = 0 TabOrder = 0
WordWrap = False
end end
end end
object TabSheet3: TTabSheet object TabSheet3: TTabSheet
@@ -2375,22 +2383,23 @@ object FormConfig: TFormConfig
Font.Style = [] Font.Style = []
ParentFont = False ParentFont = False
ReadOnly = True ReadOnly = True
ScrollBars = ssVertical ScrollBars = ssBoth
TabOrder = 0 TabOrder = 0
WordWrap = False
OnClick = MemoSignauxClick OnClick = MemoSignauxClick
end end
object GroupBox12: TGroupBox object GroupBox12: TGroupBox
Left = 304 Left = 304
Top = 40 Top = 40
Width = 257 Width = 257
Height = 257 Height = 313
Caption = 'Description du signal' Caption = 'Description du signal'
TabOrder = 1 TabOrder = 1
object ImageSignal: TImage object ImageSignal: TImage
Left = 8 Left = 8
Top = 72 Top = 72
Width = 65 Width = 65
Height = 137 Height = 105
end end
object LabelAdrSig: TLabel object LabelAdrSig: TLabel
Left = 13 Left = 13
@@ -2433,6 +2442,22 @@ object FormConfig: TFormConfig
Height = 13 Height = 13
Caption = 'Verrouillable au carr'#233' :' Caption = 'Verrouillable au carr'#233' :'
end end
object Label17: TLabel
Left = 80
Top = 144
Width = 131
Height = 26
Caption = 'Conditions suppl'#233'mentaires d'#39'affichage du carr'#233' :'
WordWrap = True
end
object MemoCarre: TMemo
Left = 8
Top = 184
Width = 241
Height = 97
ReadOnly = True
TabOrder = 0
end
end end
end end
object TabSheet4: TTabSheet object TabSheet4: TTabSheet
@@ -2462,6 +2487,7 @@ object FormConfig: TFormConfig
ReadOnly = True ReadOnly = True
ScrollBars = ssVertical ScrollBars = ssVertical
TabOrder = 0 TabOrder = 0
WordWrap = False
OnClick = MemoActClick OnClick = MemoActClick
end end
object GroupBox13: TGroupBox object GroupBox13: TGroupBox
@@ -2503,15 +2529,15 @@ object FormConfig: TFormConfig
Caption = 'Actionneur fonction de locomotive ' Caption = 'Actionneur fonction de locomotive '
TabOrder = 1 TabOrder = 1
object LabelActionneur: TLabel object LabelActionneur: TLabel
Left = 56 Left = 48
Top = 44 Top = 24
Width = 51 Width = 51
Height = 13 Height = 13
Caption = 'Actionneur' Caption = 'Actionneur'
end end
object LabelTrain: TLabel object LabelTrain: TLabel
Left = 72 Left = 72
Top = 20 Top = 46
Width = 24 Width = 24
Height = 13 Height = 13
Caption = 'Train' Caption = 'Train'
@@ -2525,14 +2551,14 @@ object FormConfig: TFormConfig
end end
object LabelFonction: TLabel object LabelFonction: TLabel
Left = 56 Left = 56
Top = 68 Top = 70
Width = 41 Width = 41
Height = 13 Height = 13
Caption = 'Fonction' Caption = 'Fonction'
end end
object LabelTempo: TLabel object LabelTempo: TLabel
Left = 40 Left = 40
Top = 84 Top = 94
Width = 55 Width = 55
Height = 13 Height = 13
Caption = 'Tempo (ms)' Caption = 'Tempo (ms)'
@@ -2548,7 +2574,7 @@ object FormConfig: TFormConfig
object EditTrain: TEdit object EditTrain: TEdit
Left = 112 Left = 112
Top = 44 Top = 44
Width = 121 Width = 105
Height = 21 Height = 21
TabOrder = 1 TabOrder = 1
Text = 'EditTrain' Text = 'EditTrain'

View File

@@ -153,6 +153,9 @@ type
EditV1O: TEdit; EditV1O: TEdit;
EditV2O: TEdit; EditV2O: TEdit;
EditV3O: TEdit; EditV3O: TEdit;
Label10: TLabel;
Label17: TLabel;
MemoCarre: TMemo;
procedure ButtonAppliquerEtFermerClick(Sender: TObject); procedure ButtonAppliquerEtFermerClick(Sender: TObject);
procedure Button2Click(Sender: TObject); procedure Button2Click(Sender: TObject);
procedure FormActivate(Sender: TObject); procedure FormActivate(Sender: TObject);
@@ -928,7 +931,7 @@ begin
end; end;
Procedure aff_champs_sig; Procedure aff_champs_sig;
var i,d, ligne, adresse,erreur : integer; var i,d,l,k, ligne, adresse,erreur,condCarre : integer;
s,ss : string; s,ss : string;
begin begin
with formConfig.MemoSignaux do with formConfig.MemoSignaux do
@@ -973,6 +976,27 @@ begin
LabelVerrou.caption:=''; LabelVerrou.caption:='';
end; end;
end; end;
// conditions de carré
formConfig.MemoCarre.Lines.clear;
CondCarre:=Length(feux[i].condcarre[1]);
l:=1;
while condCarre<>0 do
begin
if condcarre<>0 then dec(condcarre);
ss:='';
for k:=1 to condCarre do
begin
ss:=ss+'A'+IntToSTR(feux[i].condcarre[l][k].Adresse);
if feux[i].condcarre[l][k].PosAig='S' then ss:=ss+' dévié ' else ss:=ss+' droit ';
if k<CondCarre then ss:=ss+'et ';
end;
formConfig.MemoCarre.Lines.add(ss);
inc(l);
CondCarre:=Length(feux[i].condcarre[l]);
if condCarre<>0 then formConfig.MemoCarre.Lines.add('ou');
end;
end; end;
@@ -1116,4 +1140,6 @@ end;
end. end.

Binary file not shown.

View File

@@ -202,15 +202,15 @@ begin
begin begin
i:=0; i:=0;
repeat repeat
trouve:=pos('erreur',Lines[i])<>0; trouve:=pos('erreur',uppercase(Lines[i]))<>0;
inc(i); inc(i);
until (i>=Lines.Count) or trouve; until (i>=Lines.Count) or trouve;
if trouve then if trouve then
begin begin
Lines.Add('trouvé en '+intToSTR(i)); Affiche('trouvé en '+intToSTR(i),clyellow);
SelStart:=Perform(EM_LINEINDEX,5,0); SelStart := I - 1;
perform(EM_SCROLLCARET,0,0); SelLength := Length('erreur');
setfocus; SetFocus;
end; end;
end; end;
end; end;

Binary file not shown.

View File

@@ -309,11 +309,15 @@ var ancien_tablo_signalCplx,EtatsignalCplx : array[0..MaxAcc] of word;
VerrouCarre : boolean ; // si vrai, le feu se verrouille au carré si pas de train avant le signal VerrouCarre : boolean ; // si vrai, le feu se verrouille au carré si pas de train avant le signal
EtatSignal : word ; // comme EtatSignalCplx EtatSignal : word ; // comme EtatSignalCplx
UniSemaf : integer ; // définition supplémentaire de la cible pour les décodeurs UNISEMAF UniSemaf : integer ; // définition supplémentaire de la cible pour les décodeurs UNISEMAF
AigDirection : array[1..6] of array of record // pour les signaux directionnels : contient la liste des aiguillages associés AigDirection : array[1..6] of array of record // pour les signaux directionnels : contient la liste des aiguillages associés
Adresse : integer; // 6 feux max associés à un tableau dynamique décrivant les aiguillages Adresse : integer; // 6 feux max associés à un tableau dynamique décrivant les aiguillages
posAig : char; posAig : char;
end; end;
end; CondCarre : array[1..6] of array of record // conditions supplémentaires d'aiguillages en position pour le carré
Adresse : integer; // aiguillage
posAig : char;
end;
end;
Fimage : Timage; Fimage : Timage;
BrancheN : array[1..100,1..200] of TBranche; BrancheN : array[1..100,1..200] of TBranche;
@@ -1503,6 +1507,7 @@ begin
envoi(s); // envoi de la trame et attente Ack envoi(s); // envoi de la trame et attente Ack
// si l'accessoire est un feu et sans raz des signaux, sortir // si l'accessoire est un feu et sans raz des signaux, sortir
if (acc=feu) and not(Raz_Acc_signaux) then exit; if (acc=feu) and not(Raz_Acc_signaux) then exit;
// si aiguillage, faire une temporisation // si aiguillage, faire une temporisation
//if (index_feu(adresse)=0) or (Acc=aig) then //if (index_feu(adresse)=0) or (Acc=aig) then
@@ -3888,7 +3893,7 @@ begin
if j>1 then if j>1 then
begin begin
adresse:=StrToINT(copy(s,1,j-1));Delete(s,1,j); // adresse de feu adresse:=StrToINT(copy(s,1,j-1));Delete(s,1,j); // adresse de feu
feux[i].adresse:=adresse; feux[i].adresse:=adresse;
j:=pos(',',s); j:=pos(',',s);
if j>1 then if j>1 then
begin begin
@@ -3920,7 +3925,7 @@ begin
//Affiche('Boucle de Ligne',clyellow); //Affiche('Boucle de Ligne',clyellow);
//Affiche(s,clOrange); //Affiche(s,clOrange);
repeat repeat
//Affiche('Boucle de direction',clyellow); //Affiche('Boucle de direction',clyellow);
//Affiche(s,clOrange); //Affiche(s,clOrange);
if s[1]<>'A' then begin Affiche('Erreur a la ligne',clred);exit;end; if s[1]<>'A' then begin Affiche('Erreur a la ligne',clred);exit;end;
delete(s,1,1); delete(s,1,1);
@@ -3943,7 +3948,7 @@ begin
dec(k); dec(k);
if k<>l+1 then if k<>l+1 then
begin begin
Affiche('Ligne '+chaine,clred); Affiche('Ligne '+chaine,clred);
Affiche('Nombre incorrect de description des aiguillages: '+intToSTR(k)+' pour '+intToSTR(l)+' feux directionnels',clred); Affiche('Nombre incorrect de description des aiguillages: '+intToSTR(k)+' pour '+intToSTR(l)+' feux directionnels',clred);
end; end;
@@ -3956,7 +3961,7 @@ begin
if (k=0) or (k=6) or (k>9) then if (k=0) or (k=6) or (k>9) then
Affiche('Fichier config.cfg: configuration aspect ('+intToSTR(k)+') feu incorrecte à la ligne '+chaine,clRed); Affiche('Fichier config.cfg: configuration aspect ('+intToSTR(k)+') feu incorrecte à la ligne '+chaine,clRed);
j:=pos(',',s); j:=pos(',',s);
if j>1 then begin Feux[i].FeuBlanc:=(copy(s,1,j-1))='1';delete(s,1,j);end; if j>1 then begin Feux[i].FeuBlanc:=(copy(s,1,j-1))='1';delete(s,1,j);end;
j:=pos(',',s); j:=pos(',',s);
if j=0 then begin Feux[i].decodeur:=StrToInt(s);end else begin Feux[i].decodeur:=StrToInt(copy(s,1,j-1));delete(s,1,j);end; if j=0 then begin Feux[i].decodeur:=StrToInt(s);end else begin Feux[i].decodeur:=StrToInt(copy(s,1,j-1));delete(s,1,j);end;
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;
@@ -4055,6 +4060,45 @@ begin
if k=0 then begin Affiche('Ligne '+chaine,clred);Affiche('Manque définition de la cible pour le décodeur UniSemaf',clred);end if k=0 then begin Affiche('Ligne '+chaine,clred);Affiche('Manque définition de la cible pour le décodeur UniSemaf',clred);end
else else
begin begin
Delete(S,1,k);
Val(s,k,erreur);
Feux[i].UniSemaf:=k;
end;
end;
end;
// voir si conditions supplémentaires de carré
l:=1; // nombre de parenthèses
repeat
t:=pos('(',s);
if t<>0 then
begin
//Affiche('Conditions supplémentaires pour le feu '+IntToSTR(adresse)+' parenthèse '+intToSTR(l),clyellow);
k:=pos(')',s);
sa:=copy(s,t+1,k-t-1); // contient l'intérieur des parenthèses sans les parenthèses
//Affiche(sa,clRed);
delete(s,1,k);//Affiche(s,clYellow);
// boucle dans la parenthèse
bd:=0;
repeat
inc(bd);
setlength(feux[i].condCarre[l],bd+1); // une condition en plus
k:=pos(',',sa);
if k<>0 then
chaine:=copy(sa,1,k-1)
else
chaine:=sa;
if chaine[1]='A' then
begin
delete(chaine,1,1);
val(chaine,adresse,erreur);
feux[i].condCarre[l][bd].Adresse:=adresse;
if erreur<>0 then feux[i].condCarre[l][bd].PosAig:=chaine[erreur] else
Affiche('Définition du feu '+IntToSTR(adresse)+': erreur dans les conditions de carré des aiguillages',clred);
end;
k:=pos(',',sa);if k<>0 then delete(sa,1,k);
//Affiche(sa,clyellow); //Affiche(sa,clyellow);
until k=0; until k=0;
//Affiche('Longueur tableau '+IntToSTR(l)+':'+intToSTR(length(feux[i].condCarre[l])),clyellow); //Affiche('Longueur tableau '+IntToSTR(l)+':'+intToSTR(length(feux[i].condCarre[l])),clyellow);
@@ -4293,19 +4337,22 @@ end;
// renvoie élément suivant entre deux éléments quels qu'ils soient mais contigus // renvoie élément suivant entre deux éléments quels qu'ils soient mais contigus
// et en variables globales: typeGen le type de l'élément // et en variables globales: typeGen le type de l'élément
// s'ils ne sont pas contigus, on aura une erreur // s'ils ne sont pas contigus, on aura une erreur
// alg= algorithme : // alg= algorithme :
// 1=arret sur suivant qu'il soit un détecteur ou un aiguillage // 1=arret sur suivant qu'il soit un détecteur ou un aiguillage
// 2=arret sur aiguillage en talon mal positionné
// 3=arret sur un aiguillage pris en pointe dévié et AdrDevie contient l'adresse de l'aiguillage dévié ainsi que typeGen // 3=arret sur un aiguillage pris en pointe dévié et AdrDevie contient l'adresse de l'aiguillage dévié ainsi que typeGen
// code de sortie : élément suivant ou: // code de sortie : élément suivant ou:
// 9999=erreur fatale ou itération trop longue // 9999=erreur fatale ou itération trop longue
// 9999=erreur fatale // 9998= arret sur aiguillage en talon mal positionnée
// 9997: arrêt sur aiguillage dévié // 9997: arrêt sur aiguillage dévié
// 9996: arrêt sur position inconnue d'aiguillage // 9996: arrêt sur position inconnue d'aiguillage
// typeGen : 1=detecteur 2=aiguillage 3=aiguillage bis // typeGen : 1=detecteur 2=aiguillage 3=aiguillage bis
function suivant_alg3(prec : integer;typeELprec : integer;actuel : integer;typeElActuel : integer;alg : integer) : integer; function suivant_alg3(prec : integer;typeELprec : integer;actuel : integer;typeElActuel : integer;alg : integer) : integer;
var Btype,Adr,AdrPrec,BtypePrec,indexBranche_prec,branche_trouve_prec,indexBranche_actuel,branche_trouve_actuel, var Btype,Adr,AdrPrec,BtypePrec,indexBranche_prec,branche_trouve_prec,indexBranche_actuel,branche_trouve_actuel,
tjsc1,tjsc2,AdrTjdP,Adr2,Abis,TypeEl,N_iteration : integer;
tjscourbe1,tjscourbe2,tjd,tjs : boolean; tjscourbe1,tjscourbe2,tjd,tjs : boolean;
A,Aprec,tjsc1B,tjsc2B: char;
s : string; s : string;
label recommence; label recommence;
begin begin
@@ -4385,6 +4432,15 @@ begin
suivant_alg3:=adr; suivant_alg3:=adr;
exit; exit;
end; end;
// ici, les éléments sont non consécutifs. voir si l'un des deux est une TJD/TJS
if (btypePrec=2) or (btypePrec=3) then
begin
if NivDebug=3 then AfficheDebug('Le précedent est une TJD/S - substitution du precédent par la pointe de la TJD',clYellow);
// changer l'adresse du précédent par l'autre adresse de la TJD/S
prec:=Aiguillage[prec].APointe;
inc(n_iteration);
if n_iteration>50 then
begin
s:='Erreur fatale 9999, trop d''itérations'; s:='Erreur fatale 9999, trop d''itérations';
Affiche(s,clRed); Affiche(s,clRed);
AfficheDebug(s,clRed); AfficheDebug(s,clRed);
@@ -4646,8 +4702,9 @@ begin
begin begin
A:=aiguillage[AdrTjdP].AdroitB; A:=aiguillage[AdrTjdP].AdroitB;
Adr:=aiguillage[AdrTjdP].Adroit; Adr:=aiguillage[AdrTjdP].Adroit;
Abis:=aiguillage[AdrTjdP].AdroitBis; Abis:=aiguillage[AdrTjdP].AdroitBis;
if A='Z' then typeGen:=1 else typeGen:=2; //TypeEL=(1=détécteur 2=aig 3=aig Bis) if A='Z' then typeGen:=1 else typeGen:=2; //TypeEL=(1=détécteur 2=aig 3=aig Bis)
if Abis=1 then typeGen:=3;
suivant_alg3:=adr; suivant_alg3:=adr;
exit; exit;
end; end;
@@ -4673,11 +4730,13 @@ begin
if aiguillage[Adr].Adevie=prec then if aiguillage[Adr].Adevie=prec then
begin begin
A:=aiguillage[AdrTjdP].AdroitB; A:=aiguillage[AdrTjdP].AdroitB;
Adr:=aiguillage[AdrTjdP].Adroit; Adr:=aiguillage[AdrTjdP].Adroit;
Abis:=aiguillage[AdrTjdP].AdroitBis;
if A='Z' then typeGen:=1 else typeGen:=2; //TypeEL=(1=détécteur 2=aig 3=aig Bis)
if Abis=1 then typeGen:=3; if Abis=1 then typeGen:=3;
suivant_alg3:=adr;exit; suivant_alg3:=adr;exit;
end; end;
suivant_alg3:=adr;exit; s:='Erreur 1022, TJD '+IntToSTR(Adr)+'/'+IntToSTR(AdrTjdP)+' mal positionnée';
if nivDebug=3 then AfficheDebug(s,clred); if nivDebug=3 then AfficheDebug(s,clred);
Affiche(s,clred); Affiche(s,clred);
Suivant_alg3:=9998;exit; Suivant_alg3:=9998;exit;
@@ -4699,7 +4758,9 @@ begin
if (aiguillage[Adr].Adroit=prec) then if (aiguillage[Adr].Adroit=prec) then
begin begin
A:=aiguillage[Adr].AdevieB; A:=aiguillage[Adr].AdevieB;
Adr:=aiguillage[Adr].Adevie; Adr:=aiguillage[Adr].Adevie;
Abis:=aiguillage[Adr].AdevieBis;
if A='Z' then typeGen:=1 else typeGen:=2; //TypeEL=(1=détécteur 2=aig 3=aig Bis)
if Abis=1 then typeGen:=3; if Abis=1 then typeGen:=3;
suivant_alg3:=adr;exit; suivant_alg3:=adr;exit;
end; end;
@@ -4725,7 +4786,9 @@ begin
if aiguillage[Adr].Adevie=prec then if aiguillage[Adr].Adevie=prec then
begin begin
A:=aiguillage[AdrtjdP].AdevieB; A:=aiguillage[AdrtjdP].AdevieB;
Adr:=aiguillage[AdrtjdP].Adevie; Adr:=aiguillage[AdrtjdP].Adevie;
Abis:=aiguillage[AdrtjdP].AdevieBis;
if A='Z' then typeGen:=1 else typeGen:=2; //TypeEL=(1=détécteur 2=aig 3=aig Bis)
if Abis=1 then typeGen:=3; if Abis=1 then typeGen:=3;
suivant_alg3:=adr;exit; suivant_alg3:=adr;exit;
end; end;
@@ -4801,7 +4864,7 @@ begin
A:=aiguillage[Adr].Adevie2B; A:=aiguillage[Adr].Adevie2B;
Adr:=aiguillage[Adr].Adevie2; Adr:=aiguillage[Adr].Adevie2;
if A='Z' then TypeEl:=1 else TypeEL:=2; //TypeEL=(1=détécteur 2=aig 3=aig Bis) if A='Z' then TypeEl:=1 else TypeEL:=2; //TypeEL=(1=détécteur 2=aig 3=aig Bis)
if Abis=1 then TypeEl:=3; if Abis=1 then TypeEl:=3;
trouve_element(Adr,TypeEl); // branche_trouve IndexBranche_trouve trouve_element(Adr,TypeEl); // branche_trouve IndexBranche_trouve
typeGen:=BrancheN[branche_trouve,IndexBranche_trouve].BType; typeGen:=BrancheN[branche_trouve,IndexBranche_trouve].BType;
suivant_alg3:=adr;exit; suivant_alg3:=adr;exit;
@@ -4905,7 +4968,7 @@ begin
// étape 1 trouver le sens // étape 1 trouver le sens
repeat repeat
inc(j); inc(j);
AdrSuiv:=suivant_alg3(precCalc,BisPrecCalc,actuelCalc,BisActuelCalc,1); AdrSuiv:=suivant_alg3(precCalc,BisPrecCalc,actuelCalc,BisActuelCalc,1);
precCalc:=actuelCalc; precCalc:=actuelCalc;
BisPrecCalc:=BisActuelCalc; BisPrecCalc:=BisActuelCalc;
actuelCalc:=AdrSuiv; actuelCalc:=AdrSuiv;
@@ -5108,6 +5171,42 @@ begin
until sortie; until sortie;
if NivDebug>=2 Then AfficheDebug('Détecteur suivant='+intToSTR(Adr),clOrange); if NivDebug>=2 Then AfficheDebug('Détecteur suivant='+intToSTR(Adr),clOrange);
if (bType=1) or (Adr=0) then detecteur_suivant_el:=Adr; if (bType=1) or (Adr=0) then detecteur_suivant_el:=Adr;
if (i=20) then begin
if NivDebug=3 then AfficheDebug('Erreur fatale 201 : Itération trop longue',clred);
Affiche('Erreur fatale 201 : Itération trop longue',clred);detecteur_suivant_el:=3;end;
end;
end;
function cond_carre(adresse : integer) : boolean;
var i,l,k,NCondCarre,adrAig : integer;
resultatET,resultatOU: boolean;
s : string;
begin
i:=index_feu(adresse);
NCondCarre:=Length(feux[i].condcarre[1]);
l:=1;
resultatOU:=false;
while NcondCarre<>0 do
begin
if Ncondcarre<>0 then dec(Ncondcarre);
resultatET:=true;
for k:=1 to NcondCarre do
begin
//s2:=s2+'A'+IntToSTR(feux[i].condcarre[l][k].Adresse)+feux[i].condcarre[l][k].PosAig+' ';
AdrAig:=feux[i].condcarre[l][k].Adresse;
resultatET:=((aiguillage[AdrAig].position=const_devie) and (feux[i].condcarre[l][k].PosAig='S') or (aiguillage[AdrAig].position=const_droit) and (feux[i].condcarre[l][k].PosAig='D'))
and resultatET;
end;
//if resultatET then Affiche('VRAI',clyellow) else affiche('FAUX',clred);
inc(l);
resultatOU:=resultatOU or resultatET;
NCondCarre:=Length(feux[i].condcarre[l]);
end;
//if resultatOU then Affiche('VRAI final',clyellow) else affiche('FAUX final',clred);
if NivDebug=3 then
begin
s:='Conditions de carré suivant aiguillages: '; s:='Conditions de carré suivant aiguillages: ';
if ResultatOU then s:=s+'vrai' else s:=s+'faux'; if ResultatOU then s:=s+'vrai' else s:=s+'faux';
AfficheDebug(s,clyellow); AfficheDebug(s,clyellow);
@@ -5138,7 +5237,7 @@ begin
begin begin
carre_signal:=FALSE; // pour l'instant verrouillé carre_signal:=FALSE; // pour l'instant verrouillé
exit; exit;
end; end;
//Affiche(IntToSTR(actuel),clyellow); //Affiche(IntToSTR(actuel),clyellow);
repeat repeat
@@ -5234,7 +5333,7 @@ begin
TypeActuel:=1; TypeActuel:=1;
TypePrec:=1; TypePrec:=1;
end end
else else
begin begin
AdrSuiv:=suivant_alg3(prec,TypePrec,actuel,TypeActuel,1); AdrSuiv:=suivant_alg3(prec,TypePrec,actuel,TypeActuel,1);
prec:=actuel;TypePrec:=TypeActuel; prec:=actuel;TypePrec:=TypeActuel;
@@ -5483,9 +5582,14 @@ begin
begin begin
Pres_train:=MemZone[Prec,actuel]; Pres_train:=MemZone[Prec,actuel];
if Pres_Train and (NivDebug=3) then Affiche('Présence train de '+intToSTR(prec)+' à '+intToSTR(actuel),clyellow); if Pres_Train and (NivDebug=3) then Affiche('Présence train de '+intToSTR(prec)+' à '+intToSTR(actuel),clyellow);
end
else
begin
AdrSuiv:=suivant_alg3(prec,TypePrec,actuel,TypeActuel,1);
prec:=actuel;TypePrec:=TypeActuel;
actuel:=AdrSuiv;TypeActuel:=typeGen; actuel:=AdrSuiv;TypeActuel:=typeGen;
if AdrSuiv>9990 then if AdrSuiv>9990 then
begin begin
test_memoire_zones:=false;exit; test_memoire_zones:=false;exit;
end; end;
@@ -5702,7 +5806,7 @@ begin
//if AffSignal then AfficheDebug('Debut du traitement général',clYellow); //if AffSignal then AfficheDebug('Debut du traitement général',clYellow);
// traitement des feux >3 feux différents de violet (cas général) // traitement des feux >3 feux différents de violet (cas général)
if (Feux[i].aspect>=3) and (EtatSignalCplx[AdrFeu]<>violet_F) then if (Feux[i].aspect>=3) and (EtatSignalCplx[AdrFeu]<>violet_F) then
begin begin
// détecteurs précédent le feu , pour déterminer si leurs mémoires de zones sont à 1 pour libérer le carré // détecteurs précédent le feu , pour déterminer si leurs mémoires de zones sont à 1 pour libérer le carré
if Feux[i].VerrouCarre then if Feux[i].VerrouCarre then
@@ -5713,20 +5817,20 @@ begin
PresTrain:=FALSE; PresTrain:=FALSE;
j:=1; j:=1;
repeat repeat
if NivDebug=3 then afficheDebug('Séquence '+IntToSTR(j)+' de recherche des 4 détecteurs précédents-----',clOrange); if NivDebug=3 then afficheDebug('Séquence '+IntToSTR(j)+' de recherche des 4 détecteurs précédents-----',clOrange);
if (j=1) then if (j=1) then
begin det_initial:=feux[i].Adr_det1;Adr_El_Suiv:=feux[i].Adr_el_suiv1; begin det_initial:=feux[i].Adr_det1;Adr_El_Suiv:=feux[i].Adr_el_suiv1;
if feux[i].Btype_suiv1=1 then Btype_el_suivant:=1; if feux[i].Btype_suiv1=1 then Btype_el_suivant:=1;
if feux[i].Btype_suiv1=2 then Btype_el_suivant:=2; if feux[i].Btype_suiv1=2 then Btype_el_suivant:=2;
if feux[i].Btype_suiv1=5 then Btype_el_suivant:=3; // 1=détécteur 2=aig 5=bis if feux[i].Btype_suiv1=5 then Btype_el_suivant:=3; // 1=détécteur 2=aig 5=bis
end; end;
if (j=2) then if (j=2) then
begin begin
det_initial:=feux[i].Adr_det2;Adr_El_Suiv:=feux[i].Adr_el_suiv2; det_initial:=feux[i].Adr_det2;Adr_El_Suiv:=feux[i].Adr_el_suiv2;
if feux[i].Btype_suiv1=1 then Btype_el_suivant:=1; if feux[i].Btype_suiv1=1 then Btype_el_suivant:=1;
if feux[i].Btype_suiv1=2 then Btype_el_suivant:=2; if feux[i].Btype_suiv1=2 then Btype_el_suivant:=2;
if feux[i].Btype_suiv1=5 then Btype_el_suivant:=3; // le type du feu 1=détécteur 2=aig 5=bis if feux[i].Btype_suiv1=5 then Btype_el_suivant:=3; // 1=détécteur 2=aig 5=bis
end; end;
if (j=3) then if (j=3) then
begin det_initial:=feux[i].Adr_det3;Adr_El_Suiv:=feux[i].Adr_el_suiv3; begin det_initial:=feux[i].Adr_det3;Adr_El_Suiv:=feux[i].Adr_el_suiv3;
@@ -5771,6 +5875,8 @@ begin
end; end;
inc(j); inc(j);
until (j>=5); until (j>=5);
if presTrain and AffSignal Then afficheDebug('présence train feu '+intToSTR(AdrFeu),clorange);
end;
if AffSignal then afficheDebug('Fin de la recherche des 4 détecteurs précédents-----',clOrange); if AffSignal then afficheDebug('Fin de la recherche des 4 détecteurs précédents-----',clOrange);
// si le signal peut afficher un carré et les aiguillages après le signal sont mal positionnées ou que pas présence train avant signal et signal // si le signal peut afficher un carré et les aiguillages après le signal sont mal positionnées ou que pas présence train avant signal et signal
// verrouillable au carré, afficher un carré // verrouillable au carré, afficher un carré
@@ -5907,6 +6013,7 @@ begin
procedure calcul_zones; procedure calcul_zones;
var AdrFeu,AdrDetFeu,Nbre,Nouveau_Det,i,resultat,det1,det2,det3,AdrSuiv,TypeSuiv,AdrPrec : integer ; var AdrFeu,AdrDetFeu,Nbre,Nouveau_Det,i,resultat,det1,det2,det3,AdrSuiv,TypeSuiv,AdrPrec : integer ;
creer_tableau : boolean; creer_tableau : boolean;
s : string;
begin begin
creer_tableau:=false; creer_tableau:=false;
det3:=event_det[N_event_det]; // c'est le nouveau détecteur det3:=event_det[N_event_det]; // c'est le nouveau détecteur
@@ -5980,7 +6087,7 @@ begin
// traiter pour les cas avec 1 élément // traiter pour les cas avec 1 élément
for i:=1 to N_trains do for i:=1 to N_trains do
begin begin
Nbre:=event_det_train[i].NbEl ; // Nombre d'éléments du tableau courant exploré Nbre:=event_det_train[i].NbEl ; // Nombre d'éléments du tableau courant exploré
if Nbre=1 then if Nbre=1 then
begin begin
if traceListe then AfficheDebug('traitement Train n°'+intToSTR(i)+' 1 détecteur',clyellow); if traceListe then AfficheDebug('traitement Train n°'+intToSTR(i)+' 1 détecteur',clyellow);
@@ -7011,7 +7118,7 @@ begin
// créée la fenetre debug // créée la fenetre debug
FormDebug:=TFormDebug.Create(Self); FormDebug:=TFormDebug.Create(Self);
FormDebug.Caption:=AF+' debug'; FormDebug.Caption:=AF+' debug';
N_Trains:=0; N_Trains:=0;
NivDebug:=0; NivDebug:=0;
TempoAct:=0; TempoAct:=0;
@@ -7833,11 +7940,11 @@ begin
ss:=copy(recuCDM,i+3,10); ss:=copy(recuCDM,i+3,10);
val(ss,y2,erreur); val(ss,y2,erreur);
//Affiche('Y2='+IntTostr(y2),clyellow); //Affiche('Y2='+IntTostr(y2),clyellow);
Delete(recuCDM,i,l-i+1); Delete(recuCDM,i,l-i+1);
Delete(recuCDM,posXY,12); Delete(recuCDM,posXY,12);
end; end;
inc(k); inc(k);
sort:=(k>100) or (posST=0) and (posDT=0) and (posAC=0) and (posSG=0); sort:=(k>100) or (posST=0) and (posDT=0) and (posAC=0) and (posSG=0);
until (sort); until (sort);
@@ -7878,8 +7985,8 @@ end;
CDM_connecte:=False; CDM_connecte:=False;
SocketCDM_connecte:=false; SocketCDM_connecte:=false;
MenuConnecterUSB.enabled:=true; MenuConnecterUSB.enabled:=true;
DeConnecterUSB.enabled:=true; DeConnecterUSB.enabled:=true;
ConnecterCDMRail.enabled:=true; ConnecterCDMRail.enabled:=true;
end; end;
@@ -7901,6 +8008,23 @@ begin
s:=s+' El_Suivant1='+IntToSTR(feux[i].Adr_el_suiv1)+' Type suivant1='+intToSTR(feux[i].Btype_suiv1); s:=s+' El_Suivant1='+IntToSTR(feux[i].Adr_el_suiv1)+' Type suivant1='+intToSTR(feux[i].Btype_suiv1);
case feux[i].Btype_suiv1 of case feux[i].Btype_suiv1 of
1 : s:=s+' (détecteur)'; 1 : s:=s+' (détecteur)';
2 : s:=s+' (aiguillage ou TJD-S)';
4 : s:=s+' (aiguillage triple)';
5 : s:=s+' (aiguillage bis)';
end;
if feux[i].decodeur=6 then
s:=s+' Cible unisemaf='+intToSTR(feux[i].Unisemaf);
// conditions sur carré
CondCarre:=Length(feux[i].condcarre[1]);
l:=1;
s2:='';
while condCarre<>0 do
begin
if condcarre<>0 then dec(condcarre);
for k:=1 to condCarre do
begin
s2:=s2+'A'+IntToSTR(feux[i].condcarre[l][k].Adresse)+feux[i].condcarre[l][k].PosAig+' ';
end; end;
s2:=s2+'/'; s2:=s2+'/';
inc(l); inc(l);
@@ -7918,6 +8042,7 @@ begin
s:=s+'('; s:=s+'(';
for k:=1 to Length(feux[i].AigDirection[j])-1 do for k:=1 to Length(feux[i].AigDirection[j])-1 do
begin begin
s:=s+IntToSTR(feux[i].AigDirection[j][k].adresse) + feux[i].AigDirection[j][k].posaig+' ';
end; end;
s:=s+')'; s:=s+')';
end; end;

Binary file not shown.

Binary file not shown.

View File

@@ -23,7 +23,7 @@ var
Lance_verif : integer; Lance_verif : integer;
verifVersion,notificationVersion : boolean; verifVersion,notificationVersion : boolean;
Const Version='1.74'; //Version='1.2';// sert à la comparaison de la version publiée Const Version='1.75'; // sert à la comparaison de la version publiée
implementation implementation

View File

@@ -27,6 +27,8 @@ version 1.72 : affichage message si configuration erronn
version 1.73 : Amélioration du couper du TCO - Ajout de détecteurs sur les élements de voies 1 10 11 et 20 pour le TCO version 1.73 : Amélioration du couper du TCO - Ajout de détecteurs sur les élements de voies 1 10 11 et 20 pour le TCO
Affichage d'aide sur les éléments décrits dans le panneau de configuration Affichage d'aide sur les éléments décrits dans le panneau de configuration
version 1.74 : Amélioration des affichages du TCO - Pilotage des aiguillages depuis le TCO - Amélioration du séquençage d'ouverture de CDM Rail version 1.74 : Amélioration des affichages du TCO - Pilotage des aiguillages depuis le TCO - Amélioration du séquençage d'ouverture de CDM Rail
Version 1.75 : conditions supplémentaires permettant l'affichage d'un carré sur un signal en fonction des aiguillages dans le fichier config.cfg