V1.75
This commit is contained in:
Binary file not shown.
BIN
UnitConfig.dcu
BIN
UnitConfig.dcu
Binary file not shown.
@@ -1536,6 +1536,13 @@ object FormConfig: TFormConfig
|
||||
Height = 13
|
||||
Caption = 'LabelTrain'
|
||||
end
|
||||
object Label10: TLabel
|
||||
Left = 80
|
||||
Top = 120
|
||||
Width = 105
|
||||
Height = 13
|
||||
Caption = 'Verrouillable au carr'#233' :'
|
||||
end
|
||||
object ButtonAppliquerEtFermer: TButton
|
||||
Left = 384
|
||||
Top = 440
|
||||
@@ -1561,7 +1568,7 @@ object FormConfig: TFormConfig
|
||||
Top = 8
|
||||
Width = 585
|
||||
Height = 417
|
||||
ActivePage = TabSheetCDM
|
||||
ActivePage = TabSheet3
|
||||
Font.Charset = DEFAULT_CHARSET
|
||||
Font.Color = clBackground
|
||||
Font.Height = -11
|
||||
@@ -2348,6 +2355,7 @@ object FormConfig: TFormConfig
|
||||
ReadOnly = True
|
||||
ScrollBars = ssVertical
|
||||
TabOrder = 0
|
||||
WordWrap = False
|
||||
end
|
||||
end
|
||||
object TabSheet3: TTabSheet
|
||||
@@ -2375,22 +2383,23 @@ object FormConfig: TFormConfig
|
||||
Font.Style = []
|
||||
ParentFont = False
|
||||
ReadOnly = True
|
||||
ScrollBars = ssVertical
|
||||
ScrollBars = ssBoth
|
||||
TabOrder = 0
|
||||
WordWrap = False
|
||||
OnClick = MemoSignauxClick
|
||||
end
|
||||
object GroupBox12: TGroupBox
|
||||
Left = 304
|
||||
Top = 40
|
||||
Width = 257
|
||||
Height = 257
|
||||
Height = 313
|
||||
Caption = 'Description du signal'
|
||||
TabOrder = 1
|
||||
object ImageSignal: TImage
|
||||
Left = 8
|
||||
Top = 72
|
||||
Width = 65
|
||||
Height = 137
|
||||
Height = 105
|
||||
end
|
||||
object LabelAdrSig: TLabel
|
||||
Left = 13
|
||||
@@ -2433,6 +2442,22 @@ object FormConfig: TFormConfig
|
||||
Height = 13
|
||||
Caption = 'Verrouillable au carr'#233' :'
|
||||
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
|
||||
object TabSheet4: TTabSheet
|
||||
@@ -2462,6 +2487,7 @@ object FormConfig: TFormConfig
|
||||
ReadOnly = True
|
||||
ScrollBars = ssVertical
|
||||
TabOrder = 0
|
||||
WordWrap = False
|
||||
OnClick = MemoActClick
|
||||
end
|
||||
object GroupBox13: TGroupBox
|
||||
@@ -2503,15 +2529,15 @@ object FormConfig: TFormConfig
|
||||
Caption = 'Actionneur fonction de locomotive '
|
||||
TabOrder = 1
|
||||
object LabelActionneur: TLabel
|
||||
Left = 56
|
||||
Top = 44
|
||||
Left = 48
|
||||
Top = 24
|
||||
Width = 51
|
||||
Height = 13
|
||||
Caption = 'Actionneur'
|
||||
end
|
||||
object LabelTrain: TLabel
|
||||
Left = 72
|
||||
Top = 20
|
||||
Top = 46
|
||||
Width = 24
|
||||
Height = 13
|
||||
Caption = 'Train'
|
||||
@@ -2525,14 +2551,14 @@ object FormConfig: TFormConfig
|
||||
end
|
||||
object LabelFonction: TLabel
|
||||
Left = 56
|
||||
Top = 68
|
||||
Top = 70
|
||||
Width = 41
|
||||
Height = 13
|
||||
Caption = 'Fonction'
|
||||
end
|
||||
object LabelTempo: TLabel
|
||||
Left = 40
|
||||
Top = 84
|
||||
Top = 94
|
||||
Width = 55
|
||||
Height = 13
|
||||
Caption = 'Tempo (ms)'
|
||||
@@ -2548,7 +2574,7 @@ object FormConfig: TFormConfig
|
||||
object EditTrain: TEdit
|
||||
Left = 112
|
||||
Top = 44
|
||||
Width = 121
|
||||
Width = 105
|
||||
Height = 21
|
||||
TabOrder = 1
|
||||
Text = 'EditTrain'
|
||||
|
||||
@@ -153,6 +153,9 @@ type
|
||||
EditV1O: TEdit;
|
||||
EditV2O: TEdit;
|
||||
EditV3O: TEdit;
|
||||
Label10: TLabel;
|
||||
Label17: TLabel;
|
||||
MemoCarre: TMemo;
|
||||
procedure ButtonAppliquerEtFermerClick(Sender: TObject);
|
||||
procedure Button2Click(Sender: TObject);
|
||||
procedure FormActivate(Sender: TObject);
|
||||
@@ -928,7 +931,7 @@ begin
|
||||
end;
|
||||
|
||||
Procedure aff_champs_sig;
|
||||
var i,d, ligne, adresse,erreur : integer;
|
||||
var i,d,l,k, ligne, adresse,erreur,condCarre : integer;
|
||||
s,ss : string;
|
||||
begin
|
||||
with formConfig.MemoSignaux do
|
||||
@@ -974,6 +977,27 @@ begin
|
||||
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;
|
||||
|
||||
Procedure aff_champs_act;
|
||||
@@ -1116,4 +1140,6 @@ end;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
end.
|
||||
|
||||
BIN
UnitDebug.dcu
BIN
UnitDebug.dcu
Binary file not shown.
@@ -202,15 +202,15 @@ begin
|
||||
begin
|
||||
i:=0;
|
||||
repeat
|
||||
trouve:=pos('erreur',Lines[i])<>0;
|
||||
trouve:=pos('erreur',uppercase(Lines[i]))<>0;
|
||||
inc(i);
|
||||
until (i>=Lines.Count) or trouve;
|
||||
if trouve then
|
||||
begin
|
||||
Lines.Add('trouvé en '+intToSTR(i));
|
||||
SelStart:=Perform(EM_LINEINDEX,5,0);
|
||||
perform(EM_SCROLLCARET,0,0);
|
||||
setfocus;
|
||||
Affiche('trouvé en '+intToSTR(i),clyellow);
|
||||
SelStart := I - 1;
|
||||
SelLength := Length('erreur');
|
||||
SetFocus;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
BIN
UnitPrinc.dcu
BIN
UnitPrinc.dcu
Binary file not shown.
183
UnitPrinc.pas
183
UnitPrinc.pas
@@ -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
|
||||
EtatSignal : word ; // comme EtatSignalCplx
|
||||
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
|
||||
posAig : char;
|
||||
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;
|
||||
|
||||
BrancheN : array[1..100,1..200] of TBranche;
|
||||
@@ -1504,6 +1508,7 @@ begin
|
||||
// si l'accessoire est un feu et sans raz des signaux, sortir
|
||||
if (acc=feu) and not(Raz_Acc_signaux) then exit;
|
||||
|
||||
|
||||
// si aiguillage, faire une temporisation
|
||||
//if (index_feu(adresse)=0) or (Acc=aig) then
|
||||
if Acc=Aig then
|
||||
@@ -3888,7 +3893,7 @@ begin
|
||||
if j>1 then
|
||||
begin
|
||||
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);
|
||||
if j>1 then
|
||||
begin
|
||||
@@ -3920,7 +3925,7 @@ begin
|
||||
//Affiche('Boucle de Ligne',clyellow);
|
||||
//Affiche(s,clOrange);
|
||||
repeat
|
||||
//Affiche('Boucle de direction',clyellow);
|
||||
//Affiche('Boucle de direction',clyellow);
|
||||
//Affiche(s,clOrange);
|
||||
if s[1]<>'A' then begin Affiche('Erreur a la ligne',clred);exit;end;
|
||||
delete(s,1,1);
|
||||
@@ -3943,7 +3948,7 @@ begin
|
||||
dec(k);
|
||||
if k<>l+1 then
|
||||
begin
|
||||
Affiche('Ligne '+chaine,clred);
|
||||
Affiche('Ligne '+chaine,clred);
|
||||
Affiche('Nombre incorrect de description des aiguillages: '+intToSTR(k)+' pour '+intToSTR(l)+' feux directionnels',clred);
|
||||
end;
|
||||
|
||||
@@ -3956,7 +3961,7 @@ begin
|
||||
if (k=0) or (k=6) or (k>9) then
|
||||
Affiche('Fichier config.cfg: configuration aspect ('+intToSTR(k)+') feu incorrecte à la ligne '+chaine,clRed);
|
||||
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);
|
||||
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;
|
||||
@@ -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
|
||||
else
|
||||
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);
|
||||
until k=0;
|
||||
//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
|
||||
// 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 :
|
||||
// 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
|
||||
// code de sortie : élément suivant ou:
|
||||
// 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é
|
||||
// 9996: arrêt sur position inconnue d'aiguillage
|
||||
// typeGen : 1=detecteur 2=aiguillage 3=aiguillage bis
|
||||
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,
|
||||
tjsc1,tjsc2,AdrTjdP,Adr2,Abis,TypeEl,N_iteration : integer;
|
||||
tjscourbe1,tjscourbe2,tjd,tjs : boolean;
|
||||
A,Aprec,tjsc1B,tjsc2B: char;
|
||||
s : string;
|
||||
label recommence;
|
||||
begin
|
||||
@@ -4385,6 +4432,15 @@ begin
|
||||
suivant_alg3:=adr;
|
||||
exit;
|
||||
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';
|
||||
Affiche(s,clRed);
|
||||
AfficheDebug(s,clRed);
|
||||
@@ -4646,8 +4702,9 @@ begin
|
||||
begin
|
||||
A:=aiguillage[AdrTjdP].AdroitB;
|
||||
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)
|
||||
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;
|
||||
suivant_alg3:=adr;
|
||||
exit;
|
||||
end;
|
||||
@@ -4673,11 +4730,13 @@ begin
|
||||
if aiguillage[Adr].Adevie=prec then
|
||||
begin
|
||||
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;
|
||||
suivant_alg3:=adr;exit;
|
||||
end;
|
||||
suivant_alg3:=adr;exit;
|
||||
s:='Erreur 1022, TJD '+IntToSTR(Adr)+'/'+IntToSTR(AdrTjdP)+' mal positionnée';
|
||||
if nivDebug=3 then AfficheDebug(s,clred);
|
||||
Affiche(s,clred);
|
||||
Suivant_alg3:=9998;exit;
|
||||
@@ -4699,7 +4758,9 @@ begin
|
||||
if (aiguillage[Adr].Adroit=prec) then
|
||||
begin
|
||||
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;
|
||||
suivant_alg3:=adr;exit;
|
||||
end;
|
||||
@@ -4725,7 +4786,9 @@ begin
|
||||
if aiguillage[Adr].Adevie=prec then
|
||||
begin
|
||||
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;
|
||||
suivant_alg3:=adr;exit;
|
||||
end;
|
||||
@@ -4801,7 +4864,7 @@ begin
|
||||
A:=aiguillage[Adr].Adevie2B;
|
||||
Adr:=aiguillage[Adr].Adevie2;
|
||||
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
|
||||
typeGen:=BrancheN[branche_trouve,IndexBranche_trouve].BType;
|
||||
suivant_alg3:=adr;exit;
|
||||
@@ -4905,7 +4968,7 @@ begin
|
||||
// étape 1 trouver le sens
|
||||
repeat
|
||||
inc(j);
|
||||
AdrSuiv:=suivant_alg3(precCalc,BisPrecCalc,actuelCalc,BisActuelCalc,1);
|
||||
AdrSuiv:=suivant_alg3(precCalc,BisPrecCalc,actuelCalc,BisActuelCalc,1);
|
||||
precCalc:=actuelCalc;
|
||||
BisPrecCalc:=BisActuelCalc;
|
||||
actuelCalc:=AdrSuiv;
|
||||
@@ -5108,6 +5171,42 @@ begin
|
||||
until sortie;
|
||||
if NivDebug>=2 Then AfficheDebug('Détecteur suivant='+intToSTR(Adr),clOrange);
|
||||
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: ';
|
||||
if ResultatOU then s:=s+'vrai' else s:=s+'faux';
|
||||
AfficheDebug(s,clyellow);
|
||||
@@ -5138,7 +5237,7 @@ begin
|
||||
begin
|
||||
carre_signal:=FALSE; // pour l'instant verrouillé
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
//Affiche(IntToSTR(actuel),clyellow);
|
||||
repeat
|
||||
@@ -5234,7 +5333,7 @@ begin
|
||||
TypeActuel:=1;
|
||||
TypePrec:=1;
|
||||
end
|
||||
else
|
||||
else
|
||||
begin
|
||||
AdrSuiv:=suivant_alg3(prec,TypePrec,actuel,TypeActuel,1);
|
||||
prec:=actuel;TypePrec:=TypeActuel;
|
||||
@@ -5483,9 +5582,14 @@ begin
|
||||
begin
|
||||
Pres_train:=MemZone[Prec,actuel];
|
||||
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;
|
||||
if AdrSuiv>9990 then
|
||||
begin
|
||||
begin
|
||||
test_memoire_zones:=false;exit;
|
||||
end;
|
||||
|
||||
@@ -5702,7 +5806,7 @@ begin
|
||||
|
||||
//if AffSignal then AfficheDebug('Debut du traitement général',clYellow);
|
||||
// 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
|
||||
// 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
|
||||
@@ -5713,20 +5817,20 @@ begin
|
||||
PresTrain:=FALSE;
|
||||
|
||||
j:=1;
|
||||
repeat
|
||||
repeat
|
||||
if NivDebug=3 then afficheDebug('Séquence '+IntToSTR(j)+' de recherche des 4 détecteurs précédents-----',clOrange);
|
||||
if (j=1) then
|
||||
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=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
|
||||
end;
|
||||
end;
|
||||
if (j=2) then
|
||||
begin
|
||||
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=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;
|
||||
if (j=3) then
|
||||
begin det_initial:=feux[i].Adr_det3;Adr_El_Suiv:=feux[i].Adr_el_suiv3;
|
||||
@@ -5771,6 +5875,8 @@ begin
|
||||
end;
|
||||
inc(j);
|
||||
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);
|
||||
// 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é
|
||||
@@ -5907,6 +6013,7 @@ begin
|
||||
procedure calcul_zones;
|
||||
var AdrFeu,AdrDetFeu,Nbre,Nouveau_Det,i,resultat,det1,det2,det3,AdrSuiv,TypeSuiv,AdrPrec : integer ;
|
||||
creer_tableau : boolean;
|
||||
s : string;
|
||||
begin
|
||||
creer_tableau:=false;
|
||||
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
|
||||
for i:=1 to N_trains do
|
||||
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
|
||||
begin
|
||||
if traceListe then AfficheDebug('traitement Train n°'+intToSTR(i)+' 1 détecteur',clyellow);
|
||||
@@ -7011,7 +7118,7 @@ begin
|
||||
|
||||
// créée la fenetre debug
|
||||
FormDebug:=TFormDebug.Create(Self);
|
||||
FormDebug.Caption:=AF+' debug';
|
||||
FormDebug.Caption:=AF+' debug';
|
||||
N_Trains:=0;
|
||||
NivDebug:=0;
|
||||
TempoAct:=0;
|
||||
@@ -7833,11 +7940,11 @@ begin
|
||||
ss:=copy(recuCDM,i+3,10);
|
||||
val(ss,y2,erreur);
|
||||
//Affiche('Y2='+IntTostr(y2),clyellow);
|
||||
Delete(recuCDM,i,l-i+1);
|
||||
Delete(recuCDM,i,l-i+1);
|
||||
|
||||
Delete(recuCDM,posXY,12);
|
||||
end;
|
||||
|
||||
|
||||
inc(k);
|
||||
sort:=(k>100) or (posST=0) and (posDT=0) and (posAC=0) and (posSG=0);
|
||||
until (sort);
|
||||
@@ -7878,8 +7985,8 @@ end;
|
||||
CDM_connecte:=False;
|
||||
SocketCDM_connecte:=false;
|
||||
MenuConnecterUSB.enabled:=true;
|
||||
DeConnecterUSB.enabled:=true;
|
||||
ConnecterCDMRail.enabled:=true;
|
||||
DeConnecterUSB.enabled:=true;
|
||||
ConnecterCDMRail.enabled:=true;
|
||||
end;
|
||||
|
||||
|
||||
@@ -7901,6 +8008,23 @@ begin
|
||||
s:=s+' El_Suivant1='+IntToSTR(feux[i].Adr_el_suiv1)+' Type suivant1='+intToSTR(feux[i].Btype_suiv1);
|
||||
case feux[i].Btype_suiv1 of
|
||||
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;
|
||||
s2:=s2+'/';
|
||||
inc(l);
|
||||
@@ -7918,6 +8042,7 @@ begin
|
||||
s:=s+'(';
|
||||
for k:=1 to Length(feux[i].AigDirection[j])-1 do
|
||||
begin
|
||||
s:=s+IntToSTR(feux[i].AigDirection[j][k].adresse) + feux[i].AigDirection[j][k].posaig+' ';
|
||||
end;
|
||||
s:=s+')';
|
||||
end;
|
||||
|
||||
BIN
UnitTCO.dcu
BIN
UnitTCO.dcu
Binary file not shown.
Binary file not shown.
@@ -23,7 +23,7 @@ var
|
||||
Lance_verif : integer;
|
||||
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
|
||||
|
||||
|
||||
@@ -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
|
||||
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.75 : conditions supplémentaires permettant l'affichage d'un carré sur un signal en fonction des aiguillages dans le fichier config.cfg
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user