V1.11
This commit is contained in:
Binary file not shown.
@@ -31,12 +31,12 @@
|
||||
-M
|
||||
-$M16384,1048576
|
||||
-K$00400000
|
||||
-LE"c:\program files (x86)\borland\delphi7\Projects\Bpl"
|
||||
-LN"c:\program files (x86)\borland\delphi7\Projects\Bpl"
|
||||
-U"c:\program files (x86)\borland\delphi7\Lib\Debug"
|
||||
-O"c:\program files (x86)\borland\delphi7\Lib\Debug"
|
||||
-I"c:\program files (x86)\borland\delphi7\Lib\Debug"
|
||||
-R"c:\program files (x86)\borland\delphi7\Lib\Debug"
|
||||
-LE"c:\program files\borland\delphi7\Projects\Bpl"
|
||||
-LN"c:\program files\borland\delphi7\Projects\Bpl"
|
||||
-U"c:\program files\borland\delphi7\Lib\Debug"
|
||||
-O"c:\program files\borland\delphi7\Lib\Debug"
|
||||
-I"c:\program files\borland\delphi7\Lib\Debug"
|
||||
-R"c:\program files\borland\delphi7\Lib\Debug"
|
||||
-w-UNSAFE_TYPE
|
||||
-w-UNSAFE_CODE
|
||||
-w-UNSAFE_CAST
|
||||
|
||||
BIN
UnitDebug.dcu
BIN
UnitDebug.dcu
Binary file not shown.
@@ -1,8 +1,8 @@
|
||||
object FormDebug: TFormDebug
|
||||
Left = 313
|
||||
Top = 77
|
||||
Left = 514
|
||||
Top = 56
|
||||
BorderStyle = bsSingle
|
||||
Caption = 'FormDebug'
|
||||
Caption = 'Fen'#234'tre de d'#233'bug'
|
||||
ClientHeight = 639
|
||||
ClientWidth = 759
|
||||
Color = clWhite
|
||||
@@ -47,16 +47,16 @@ object FormDebug: TFormDebug
|
||||
ParentFont = False
|
||||
end
|
||||
object Label3: TLabel
|
||||
Left = 464
|
||||
Top = 200
|
||||
Left = 456
|
||||
Top = 88
|
||||
Width = 265
|
||||
Height = 101
|
||||
Height = 73
|
||||
AutoSize = False
|
||||
Caption = 'Label3'
|
||||
Color = clGray
|
||||
Font.Charset = ANSI_CHARSET
|
||||
Font.Color = clWindow
|
||||
Font.Height = -15
|
||||
Font.Height = -13
|
||||
Font.Name = 'Arial Narrow'
|
||||
Font.Style = []
|
||||
ParentColor = False
|
||||
@@ -80,26 +80,27 @@ object FormDebug: TFormDebug
|
||||
end
|
||||
object MemoEvtDet: TMemo
|
||||
Left = 564
|
||||
Top = 308
|
||||
Top = 416
|
||||
Width = 181
|
||||
Height = 281
|
||||
Height = 173
|
||||
Color = clBlack
|
||||
Font.Charset = DEFAULT_CHARSET
|
||||
Font.Charset = ANSI_CHARSET
|
||||
Font.Color = clYellow
|
||||
Font.Height = -11
|
||||
Font.Name = 'MS Sans Serif'
|
||||
Font.Name = 'Arial'
|
||||
Font.Style = []
|
||||
Lines.Strings = (
|
||||
'Tableau des '#233'v'#232'nements d'#233'tecteurs')
|
||||
'Tableau des '#233'v'#232'nements '
|
||||
'd'#233'tecteurs')
|
||||
ParentFont = False
|
||||
TabOrder = 1
|
||||
end
|
||||
object ButtonEcrLog: TButton
|
||||
Left = 448
|
||||
Top = 564
|
||||
Top = 560
|
||||
Width = 97
|
||||
Height = 25
|
||||
Caption = 'Ecrire le log'
|
||||
Height = 29
|
||||
Caption = 'Sauvegarder le log'
|
||||
TabOrder = 2
|
||||
OnClick = ButtonEcrLogClick
|
||||
end
|
||||
@@ -128,8 +129,52 @@ object FormDebug: TFormDebug
|
||||
TabOrder = 4
|
||||
OnClick = CheckAffSigClick
|
||||
end
|
||||
object SaveDialog: TSaveDialog
|
||||
Left = 480
|
||||
object ButtonRazTampon: TButton
|
||||
Left = 448
|
||||
Top = 520
|
||||
Width = 97
|
||||
Height = 33
|
||||
Caption = 'Raz Tampon Ev'#232'nements'
|
||||
TabOrder = 5
|
||||
WordWrap = True
|
||||
OnClick = ButtonRazTamponClick
|
||||
end
|
||||
object ButtonCherche: TButton
|
||||
Left = 448
|
||||
Top = 480
|
||||
Width = 97
|
||||
Height = 33
|
||||
Caption = 'Chercher erreurs'
|
||||
TabOrder = 6
|
||||
OnClick = ButtonChercheClick
|
||||
end
|
||||
object MemoDet: TMemo
|
||||
Left = 560
|
||||
Top = 176
|
||||
Width = 185
|
||||
Height = 225
|
||||
Color = clMaroon
|
||||
Font.Charset = ANSI_CHARSET
|
||||
Font.Color = clYellow
|
||||
Font.Height = -11
|
||||
Font.Name = 'Arial'
|
||||
Font.Style = []
|
||||
ParentFont = False
|
||||
ScrollBars = ssVertical
|
||||
TabOrder = 7
|
||||
end
|
||||
object ButtonAffEvtChrono: TButton
|
||||
Left = 448
|
||||
Top = 440
|
||||
Width = 97
|
||||
Height = 33
|
||||
Caption = 'Affiche Evts chrono d'#233'tecteurs'
|
||||
TabOrder = 8
|
||||
WordWrap = True
|
||||
OnClick = ButtonAffEvtChronoClick
|
||||
end
|
||||
object SaveDialog: TSaveDialog
|
||||
Left = 464
|
||||
Top = 336
|
||||
end
|
||||
end
|
||||
|
||||
@@ -17,26 +17,49 @@ type
|
||||
Label3: TLabel;
|
||||
MemoDebug: TMemo;
|
||||
CheckAffSig: TCheckBox;
|
||||
ButtonRazTampon: TButton;
|
||||
ButtonCherche: TButton;
|
||||
MemoDet: TMemo;
|
||||
ButtonAffEvtChrono: TButton;
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure ButtonEcrLogClick(Sender: TObject);
|
||||
procedure EditNivDebugKeyPress(Sender: TObject; var Key: Char);
|
||||
procedure CheckAffSigClick(Sender: TObject);
|
||||
procedure ButtonRazTamponClick(Sender: TObject);
|
||||
procedure ButtonChercheClick(Sender: TObject);
|
||||
procedure ButtonAffEvtChronoClick(Sender: TObject);
|
||||
private
|
||||
{ Déclarations privées }
|
||||
public
|
||||
{ Déclarations publiques }
|
||||
end;
|
||||
|
||||
Const Max_Event_det_tick = 10000;
|
||||
|
||||
var
|
||||
FormDebug: TFormDebug;
|
||||
NivDebug : integer;
|
||||
AffSignal : boolean;
|
||||
N_event_det : integer; // index du dernier évènement (de 1 à 20)
|
||||
event_det : array[1..20] of integer;
|
||||
// tick 1/10s,détecteur
|
||||
N_Event_tick : integer ; // dernier index
|
||||
event_det_tick : array[1..Max_Event_det_tick] of
|
||||
record
|
||||
tick : longint;
|
||||
detecteur : array[1..1100] of integer;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
|
||||
procedure AfficheDebug(s : string;lacouleur : TColor);
|
||||
|
||||
implementation
|
||||
|
||||
uses UnitPrinc;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure AfficheDebug(s : string;lacouleur : TColor);
|
||||
@@ -70,6 +93,8 @@ var s : string;
|
||||
begin
|
||||
s:=GetCurrentDir;
|
||||
SaveDialog.InitialDir:=s;
|
||||
SaveDialog.DefaultExt:='txt';
|
||||
SaveDialog.Filter:='Fichiers texte (*.txt)|*.txt|Tous fichiers (*.*)|*.*';
|
||||
if SaveDialog.Execute then
|
||||
begin
|
||||
s:=SaveDialog.FileName;
|
||||
@@ -109,4 +134,53 @@ begin
|
||||
AffSignal:=checkAffSig.Checked;
|
||||
end;
|
||||
|
||||
procedure TFormDebug.ButtonRazTamponClick(Sender: TObject);
|
||||
begin
|
||||
N_event_det:=0;
|
||||
Event_det[1]:=0;
|
||||
MemoEvtDet.Clear;
|
||||
memoEvtDet.Refresh;
|
||||
end;
|
||||
|
||||
procedure TFormDebug.ButtonChercheClick(Sender: TObject);
|
||||
var i : integer;
|
||||
trouve : boolean;
|
||||
begin
|
||||
|
||||
with MemoDebug do
|
||||
begin
|
||||
i:=0;
|
||||
repeat
|
||||
trouve:= pos('erreur',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;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
procedure TFormDebug.ButtonAffEvtChronoClick(Sender: TObject);
|
||||
var i,j,etat : integer;
|
||||
s : string;
|
||||
trouve : boolean;
|
||||
begin
|
||||
for i:=1 to N_Event_tick do
|
||||
begin
|
||||
s:=IntToSTR(i)+' Tick='+IntToSTR(event_det_tick[i].tick)+' Det=';
|
||||
trouve:=false;
|
||||
for j:=1 to 1100 do
|
||||
begin
|
||||
etat:=event_det_tick[i].detecteur[j];
|
||||
if etat<>-1 then begin s:=s+IntToSTR(j)+'='+intToSTR(etat);trouve:=true;end;
|
||||
end;
|
||||
if trouve then AfficheDebug(s,clyellow);
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
BIN
UnitPrinc.dcu
BIN
UnitPrinc.dcu
Binary file not shown.
@@ -1,6 +1,6 @@
|
||||
object FormPrinc: TFormPrinc
|
||||
Left = 14
|
||||
Top = 184
|
||||
Left = 172
|
||||
Top = 78
|
||||
BorderStyle = bsSingle
|
||||
Caption = 'Client TCP-IP CDM Rail ou USB - syst'#232'me LENZ'
|
||||
ClientHeight = 607
|
||||
@@ -1422,8 +1422,14 @@ object FormPrinc: TFormPrinc
|
||||
Caption = 'Afficher'
|
||||
object Etatdesdtecteurs1: TMenuItem
|
||||
Caption = 'Etat des d'#233'tecteurs'
|
||||
Hint = 'Affiche l'#39#233'tat des d'#233'tecteurs'
|
||||
OnClick = AffEtatDetecteurs
|
||||
end
|
||||
object ChronoDetect: TMenuItem
|
||||
Caption = 'Chronologie des d'#233'tecteurs'
|
||||
Hint = 'Affiche la chronologie des d'#233'tecteurs'
|
||||
OnClick = ChronoDetectClick
|
||||
end
|
||||
object Etatdesaiguillages1: TMenuItem
|
||||
Caption = 'Etat des aiguillages'
|
||||
OnClick = Etatdesaiguillages1Click
|
||||
@@ -1481,6 +1487,7 @@ object FormPrinc: TFormPrinc
|
||||
Caption = 'Divers'
|
||||
object Versions1: TMenuItem
|
||||
Caption = 'Versions'
|
||||
Hint = 'Versions'
|
||||
OnClick = Versions1Click
|
||||
end
|
||||
end
|
||||
|
||||
334
UnitPrinc.pas
334
UnitPrinc.pas
@@ -9,10 +9,8 @@ Unit UnitPrinc;
|
||||
- 1 = aiguillage dévié
|
||||
*)
|
||||
|
||||
|
||||
interface
|
||||
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, StdCtrls, OleCtrls, ExtCtrls, jpeg, ComCtrls,
|
||||
@@ -76,6 +74,7 @@ type
|
||||
Codificationdesfeux1: TMenuItem;
|
||||
Divers1: TMenuItem;
|
||||
Versions1: TMenuItem;
|
||||
ChronoDetect: TMenuItem;
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure MSComm1Comm(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
@@ -118,6 +117,7 @@ type
|
||||
procedure Versions1Click(Sender: TObject);
|
||||
procedure ClientSocketLenzDisconnect(Sender: TObject;
|
||||
Socket: TCustomWinSocket);
|
||||
procedure ChronoDetectClick(Sender: TObject);
|
||||
|
||||
private
|
||||
{ Déclarations privées }
|
||||
@@ -187,8 +187,7 @@ var ancien_tablo_signalCplx,EtatsignalCplx : array[0..MaxAcc] of word;
|
||||
dem_calcul_zone,Hors_tension2,traceSign,TraceZone,Ferme,ParUSB,parSocket,ackCdm,
|
||||
NackCDM : boolean;
|
||||
clignotant,nack,Maj_feux_cours,avecMSCom : boolean;
|
||||
N_event_det : integer; // index du dernier évènement (de 1 à 20)
|
||||
event_det : array[1..20] of integer;
|
||||
|
||||
branche : array [1..100] of string;
|
||||
parcours : array[1..MaxElParcours] of TBranche ; // parcours des locos en fonction des détecteurs
|
||||
|
||||
@@ -217,7 +216,7 @@ var
|
||||
couleur : Tcolor;
|
||||
fichier : text;
|
||||
recuCDML : array of string;
|
||||
|
||||
tick : longint;
|
||||
|
||||
// l'indice du tableau aiguillage est son adresse
|
||||
aiguillage : array[0..MaxAcc] of Taiguillage;
|
||||
@@ -2923,7 +2922,7 @@ begin
|
||||
// taille de fonte
|
||||
s:=lit_ligne;
|
||||
i:=StrToINT(s);
|
||||
with FormPrinc.ListBox1 do
|
||||
with FormPrinc.ListBox1 do
|
||||
begin
|
||||
Font.Height:=i;
|
||||
ItemHeight:=i+1;
|
||||
@@ -3892,7 +3891,8 @@ 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)
|
||||
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;
|
||||
@@ -3917,8 +3917,8 @@ begin
|
||||
if aiguillage[Adr].Adevie=prec then
|
||||
begin
|
||||
A:=aiguillage[AdrTjdP].AdroitB;
|
||||
Adr:=aiguillage[AdrTjdP].Adroit;
|
||||
Abis:=aiguillage[AdrTjdP].AdroitBis;
|
||||
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;
|
||||
@@ -3943,8 +3943,8 @@ begin
|
||||
if (aiguillage[Adr].Adroit=prec) then
|
||||
begin
|
||||
A:=aiguillage[Adr].AdevieB;
|
||||
Adr:=aiguillage[Adr].Adevie;
|
||||
Abis:=aiguillage[Adr].AdevieBis;
|
||||
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;
|
||||
@@ -3969,8 +3969,8 @@ begin
|
||||
if aiguillage[Adr].Adevie=prec then
|
||||
begin
|
||||
A:=aiguillage[AdrtjdP].AdevieB;
|
||||
Adr:=aiguillage[AdrtjdP].Adevie;
|
||||
Abis:=aiguillage[AdrtjdP].AdevieBis;
|
||||
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;
|
||||
@@ -4081,7 +4081,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;
|
||||
@@ -4092,7 +4092,7 @@ begin
|
||||
if AdrSuiv=actuel then
|
||||
begin
|
||||
AdrSuiv:=suivant_alg3(prec,TypeElPrec,actuel,TypeElActuel,1);
|
||||
end;
|
||||
end;
|
||||
if NivDebug=3 then AfficheDebug('Le suivant est le '+intToSTR(AdrSuiv),clYellow);
|
||||
detecteur_suivant:=AdrSuiv;
|
||||
end;
|
||||
@@ -4144,6 +4144,7 @@ begin
|
||||
//trouve_element(det1,FALSE);
|
||||
Adr:=BrancheN[branche_trouve_det1,i].Adresse; // élément suivant le det1
|
||||
AdrFonc:=Adr;
|
||||
Btype:=BrancheN[branche_trouve_det1,i].BType; // élément suivant/précédent
|
||||
BisFonc:=Btype;
|
||||
i:=0;
|
||||
if (el2<>Adr) then
|
||||
@@ -4152,8 +4153,9 @@ begin
|
||||
if (Adr>=9997) then begin detecteur_suivant_el:=Adr;exit;end;
|
||||
if (NivDebug=3) then AfficheDebug('trouvé '+intToSTR(Adr)+' '+intToSTR(typeGen),clorange);
|
||||
trouve_element(Adr,typeGen);
|
||||
Btype:=BrancheN[branche_trouve,IndexBranche_trouve].BType;
|
||||
Btype:=BrancheN[branche_trouve,IndexBranche_trouve].BType;
|
||||
BisSuiv:=Btype; // si aiguillage bis
|
||||
//Affiche(intToSTR(adr)+'/'+intToStr(Btype),clorange);
|
||||
AdrPrec:=AdrFonc;AdrFonc:=Adr;
|
||||
BisPrec:=BisFonc;BisFonc:=typeGen;
|
||||
i:=i+1;
|
||||
@@ -4183,6 +4185,11 @@ begin
|
||||
begin
|
||||
// trouvé la route si j=2 : - si j=3 : +
|
||||
if (NivDebug=3) then AfficheDebug('El - Route trouvée',clyellow);
|
||||
i:=0;
|
||||
AdrFonc:=Adr;
|
||||
BisFonc:=1;
|
||||
//typeGen:=0; //?
|
||||
repeat
|
||||
Adr:=suivant_alg3(AdrPrec,BisPrec,AdrFonc,BisFonc,1);
|
||||
if Adr>9997 then
|
||||
begin
|
||||
@@ -4314,16 +4321,18 @@ begin
|
||||
actuel:=feux[i].Adr_el_suiv1;
|
||||
if feux[i].Btype_suiv1=1 then BisActuel:=1;
|
||||
if feux[i].Btype_suiv1=2 then BisActuel:=2;
|
||||
if feux[i].Btype_suiv1=4 then BisActuel:=2; // aiguillage triple
|
||||
if feux[i].Btype_suiv1=4 then BisActuel:=2; // aiguillage triple
|
||||
if feux[i].Btype_suiv1=5 then BisActuel:=3; // le type du feu 1=détécteur 2=aig 5=bis
|
||||
// si actuel est un détecteur, regarder si il ya un feu
|
||||
repeat
|
||||
inc(j);
|
||||
// à la première itération, si "actuel" est déja un détecteur, ne pas faire de recherche sur le suivant
|
||||
repeat
|
||||
inc(j);
|
||||
// à la première itération, si "actuel" est déja un détecteur, ne pas faire de recherche sur le suivant
|
||||
if (j=1) and (bisActuel=1) then
|
||||
AdrSuiv:=actuel;
|
||||
actuel:=prec;
|
||||
begin
|
||||
AdrSuiv:=actuel;
|
||||
actuel:=prec;BisActuel:=1;
|
||||
BisPrec:=1;
|
||||
end
|
||||
else
|
||||
begin
|
||||
AdrSuiv:=suivant_alg3(prec,BisPrec,actuel,BisActuel,1);
|
||||
@@ -4336,12 +4345,10 @@ begin
|
||||
exit;
|
||||
end;
|
||||
if (AdrSuiv=0) then
|
||||
begin
|
||||
if NivDebug=3 then AfficheDebug('Le suivant est un buttoir',clyellow);
|
||||
begin
|
||||
if NivDebug=3 then AfficheDebug('Le suivant est un buttoir',clyellow);
|
||||
Etat_signal_suivant:=carre_F; // faire comme si c'était un signal au carré
|
||||
|
||||
exit;
|
||||
end;
|
||||
|
||||
// si le suivant est un détecteur comporte t-il un signal?
|
||||
@@ -4397,7 +4404,7 @@ begin
|
||||
BisPrec:=1;
|
||||
actuel:=feux[i].Adr_el_suiv1;
|
||||
if feux[i].Btype_suiv1=1 then BisActuel:=1;
|
||||
if feux[i].Btype_suiv1=2 then BisActuel:=2;
|
||||
if feux[i].Btype_suiv1=2 then BisActuel:=2;
|
||||
if feux[i].Btype_suiv1=5 then BisActuel:=3; // le type du feu 1=détécteur 2=aig 5=bis
|
||||
|
||||
//Affiche(IntToSTR(actuel),clyellow);
|
||||
@@ -4410,13 +4417,11 @@ begin
|
||||
|
||||
repeat
|
||||
inc(j);
|
||||
// 3=demande si le suivant est un aiguillage en pointe dévié oui si AdrSuiv=9997
|
||||
// dans ce cas la variable globale AdrDevie est mise à jour
|
||||
AdrSuiv:=suivant_alg3(prec,BisPrec,actuel,BisActuel,3);
|
||||
if NivDebug=3 then AfficheDebug('701 - Suivant signalaig='+IntToSTR(AdrSuiv),clyellow);
|
||||
// 3=demande si le suivant est un aiguillage en pointe dévié oui si AdrSuiv=9997
|
||||
// dans ce cas la variable globale AdrDevie est mise à jour
|
||||
AdrSuiv:=suivant_alg3(prec,BisPrec,actuel,BisActuel,3);
|
||||
if NivDebug=3 then AfficheDebug('701 - Suivant signalaig='+IntToSTR(AdrSuiv),clyellow);
|
||||
prec:=actuel;
|
||||
if ADrSuiv<>9997 then
|
||||
begin
|
||||
prec:=actuel;BisPrec:=BisActuel;
|
||||
actuel:=AdrSuiv;BisActuel:=typeGen;
|
||||
@@ -4493,7 +4498,6 @@ begin
|
||||
begin
|
||||
// Affiche('i='+intToSTR(i),clyellow);
|
||||
dec(i,2); // i correspond au nombre de feux à allumer
|
||||
pilote_direction(Adr,i);
|
||||
pilote_direction(Adr,i);
|
||||
end;
|
||||
|
||||
@@ -4519,27 +4523,33 @@ begin
|
||||
Pres_train:=FALSE;
|
||||
ife:=1; // index feu de 1 à 4 pour explorer les 4 détecteurs d'un feu
|
||||
repeat
|
||||
j:=0;
|
||||
j:=0;
|
||||
if NivDebug=3 then AfficheDebug('Boucle de test feu '+intToSTR(ife)+'/4',clred);
|
||||
if (ife=1) then
|
||||
begin prec:=feux[i].Adr_det1;actuel:=feux[i].Adr_el_suiv1;
|
||||
if feux[i].Btype_suiv1=1 then BisActuel:=1;
|
||||
if feux[i].Btype_suiv1=1 then BisActuel:=1;
|
||||
if feux[i].Btype_suiv1=2 then BisActuel:=2;
|
||||
if feux[i].Btype_suiv1=5 then BisActuel:=3; // le type du feu 1=détécteur 2=aig 5=bis
|
||||
if feux[i].Btype_suiv1=2 then BisActuel:=2;
|
||||
if feux[i].Btype_suiv1=4 then BisActuel:=2; // aiguillage triple
|
||||
if feux[i].Btype_suiv1=5 then BisActuel:=3; // le type du feu 1=détecteur 2=aig 5=bis
|
||||
end; //détecteur sur le signal courant
|
||||
if (ife=2) then
|
||||
begin prec:=feux[i].Adr_det2;actuel:=feux[i].Adr_el_suiv2;
|
||||
if feux[i].Btype_suiv2=1 then BisActuel:=1;
|
||||
if feux[i].Btype_suiv1=1 then BisActuel:=1;
|
||||
if feux[i].Btype_suiv1=2 then BisActuel:=2;
|
||||
if feux[i].Btype_suiv1=5 then BisActuel:=3; // le type du feu 1=détécteur 2=aig 5=bis
|
||||
end; // détecteur sur le signal courant
|
||||
if feux[i].Btype_suiv2=2 then BisActuel:=2;
|
||||
if feux[i].Btype_suiv2=4 then BisActuel:=2; // aiguillage triple
|
||||
if feux[i].Btype_suiv2=5 then BisActuel:=3; // le type du feu 1=détecteur 2=aig 5=bis
|
||||
end; // détecteur sur le signal courant
|
||||
if (ife=3) then
|
||||
begin
|
||||
prec:=feux[i].Adr_det3;
|
||||
actuel:=feux[i].Adr_el_suiv3;
|
||||
if feux[i].Btype_suiv3=1 then BisActuel:=1;
|
||||
if feux[i].Btype_suiv1=1 then BisActuel:=1;
|
||||
if feux[i].Btype_suiv1=2 then BisActuel:=2;
|
||||
if feux[i].Btype_suiv1=5 then BisActuel:=3; // le type du feu 1=détécteur 2=aig 5=bis
|
||||
end; // détecteur sur le signal courant
|
||||
if feux[i].Btype_suiv3=2 then BisActuel:=2;
|
||||
if feux[i].Btype_suiv3=4 then BisActuel:=2; // aiguillage triple
|
||||
if feux[i].Btype_suiv3=5 then BisActuel:=3; // le type du feu 1=détecteur 2=aig 5=bis
|
||||
end; // détecteur sur le signal courant
|
||||
if (ife=4) then
|
||||
begin
|
||||
prec:=feux[i].Adr_det4;
|
||||
actuel:=feux[i].Adr_el_suiv4;
|
||||
if feux[i].Btype_suiv4=1 then BisActuel:=1;
|
||||
@@ -4554,24 +4564,26 @@ begin
|
||||
test_memoire_zones:=Pres_train;
|
||||
exit;
|
||||
end;
|
||||
BisPrec:=1;
|
||||
BisPrec:=1;
|
||||
|
||||
repeat
|
||||
inc(j);
|
||||
// à la première itération, si "actuel" est déja un détecteur, ne pas faire de recherche sur le suivant
|
||||
// à la première itération, si "actuel" est déja un détecteur, ne pas faire de recherche sur le suivant
|
||||
// et chaîner mémoire de zone
|
||||
// et chaîner mémoire de zone
|
||||
if (j=1) and (Bisactuel=1) then // si détecteur
|
||||
begin
|
||||
//AfficheDebug('C''est un détecteur',clred);
|
||||
AdrSuiv:=actuel;
|
||||
actuel:=prec;
|
||||
BisPrec:=1;
|
||||
BisActuel:=1;
|
||||
BisActuel:=0;
|
||||
Pres_train:=MemZone[prec,actuel];
|
||||
if Pres_Train and (NivDebug=3) then Affiche('Présence train de '+intToSTR(prec)+' à '+intToSTR(actuel),clyellow);
|
||||
Detecteur_precedent:=actuel;
|
||||
end
|
||||
else
|
||||
AdrSuiv:=suivant_alg3(prec,BisPrec,actuel,BisActuel,1);
|
||||
//TypeGen:=1;
|
||||
Pres_train:=MemZone[prec,actuel];
|
||||
if Pres_Train and (NivDebug=3) then Affiche('Présence train de '+intToSTR(prec)+' à '+intToSTR(actuel),clyellow);
|
||||
Detecteur_precedent:=actuel;
|
||||
end
|
||||
else
|
||||
begin
|
||||
AdrSuiv:=suivant_alg3(prec,BisPrec,actuel,BisActuel,1);
|
||||
//AfficheDebug('A:'+IntToSTR(BisActuel);
|
||||
prec:=actuel;BisPrec:=BisActuel;
|
||||
@@ -4580,7 +4592,7 @@ begin
|
||||
//AfficheDebug('A suivant='+IntToSTR(adrsuiv),clred);
|
||||
if AdrSuiv=0 then
|
||||
begin
|
||||
// si c'est un buttoir
|
||||
// si c'est un buttoir
|
||||
test_memoire_zones:=false;
|
||||
exit;
|
||||
end;
|
||||
@@ -4626,9 +4638,27 @@ begin
|
||||
sort:=(j=10) or (AdrFeu<>0) ;
|
||||
until (sort);
|
||||
inc(ife);
|
||||
until ife>=5;
|
||||
if (NivDebug=3) and (Etat=0) then AfficheDebug('Pas trouvé de signal suivant au '+intToSTR(adresse),clyellow);
|
||||
|
||||
test_memoire_zones:=Pres_train;
|
||||
end;
|
||||
|
||||
// trouve une séquence chronologique 010 sur un détecteur
|
||||
function trouve_seq_chrono_010(Adresse : integer) : boolean;
|
||||
var i,etat : integer;
|
||||
etat0_seq1,etat1_seq2,etat0_seq3 : boolean;
|
||||
begin
|
||||
i:=N_Event_tick;
|
||||
if i<2 then exit;
|
||||
Affiche('test si seq 010 sur det '+intToSTR(Adresse),clyellow);
|
||||
etat0_seq1:=false; etat1_seq2:=false; etat0_seq3:=false;
|
||||
if (event_det_tick[i].detecteur[Adresse]=0) then begin etat0_seq1:=true;end;
|
||||
repeat
|
||||
// if (event_det_tick[i].detecteur[Adresse]=0) then etat0_seq1:=true;
|
||||
|
||||
if (event_det_tick[i].detecteur[Adresse]=1) and etat0_seq1 then begin etat1_seq2:=true;end;
|
||||
dec(i); // remonter le temps ...
|
||||
until (i=0) or (etat1_seq2);
|
||||
trouve_seq_chrono_010:=etat1_seq2;
|
||||
end;
|
||||
@@ -4641,15 +4671,16 @@ end;
|
||||
// Actuel,Suivant : nouveaux détecteurs du canton suivant
|
||||
// Résultat:
|
||||
// si 0 : pas de route
|
||||
// si 1 : détecteur det1 non trouvé
|
||||
// si 2 : détecteur det2 non trouvé
|
||||
// si 3 : erreur fatale
|
||||
// si 10 : ok route trouvée
|
||||
// si 1 : détecteur det1 non trouvé
|
||||
// si 2 : détecteur det2 non trouvé
|
||||
// si 3 : erreur fatale
|
||||
// si 10 : ok route trouvée
|
||||
function calcul_zones_det(det1,det2 : integer) : integer;
|
||||
var
|
||||
i,i1,i2,j,k,IndexBranche_det1,IndexBranche_det2,index_i1,index_i2,
|
||||
branche_trouve_det1,branche_trouve_det2,Adr,AdrPrec,position,Btype,BTypePrec,
|
||||
branche_trouve_det1,branche_trouve_det2,Adr,AdrPrec,position,Btype,BTypePrec,
|
||||
AdrFonc,BisPrec,BisSuiv,BisFonc,AdrSuiv : integer;
|
||||
sortie : boolean;
|
||||
s : string;
|
||||
|
||||
begin
|
||||
@@ -4688,19 +4719,24 @@ begin
|
||||
end;
|
||||
AdrPrec:=det1;
|
||||
BisPrec:=1;
|
||||
if (j=1) then i:=IndexBranche_det1-1 else i:=IndexBranche_det1+1;
|
||||
//trouve_element(det1,FALSE);
|
||||
Adr:=BrancheN[branche_trouve_det1,i].Adresse;
|
||||
AdrFonc:=Adr;
|
||||
Btype:=BrancheN[branche_trouve_det1,i].BType; // élément suivant/précédent
|
||||
BisFonc:=Btype;
|
||||
i:=0;
|
||||
if (det2<>Adr) then
|
||||
repeat
|
||||
Adr:=suivant_alg3(AdrPrec,BisPrec,AdrFonc,BisFonc,1); // donne l'élément suivant de AdrPrec à AdrFonc et dans Bis si c'est un aig bis
|
||||
trouve_element(Adr,typeGen);
|
||||
Btype:=BrancheN[branche_trouve,IndexBranche_trouve].BType;
|
||||
BisSuiv:=Btype; // si aiguillage bis
|
||||
if (j=1) then i:=IndexBranche_det1-1 else i:=IndexBranche_det1+1;
|
||||
//trouve_element(det1,FALSE);
|
||||
Adr:=BrancheN[branche_trouve_det1,i].Adresse;
|
||||
AdrFonc:=Adr;
|
||||
Btype:=BrancheN[branche_trouve_det1,i].BType; // élément suivant/précédent
|
||||
BisFonc:=Btype;
|
||||
|
||||
// si l'élémént suivant est un détecteur et il est différent de det2, c'est pas le bon sens : inutile de traiter le cas
|
||||
if (Btype<>1) or (Adr=Det2) then
|
||||
begin
|
||||
i:=0;
|
||||
if (det2<>Adr) then
|
||||
repeat
|
||||
Adr:=suivant_alg3(AdrPrec,BisPrec,AdrFonc,BisFonc,1); // donne l'élément suivant de AdrPrec à AdrFonc et dans Bis si c'est un aig bis
|
||||
trouve_element(Adr,typeGen);
|
||||
Btype:=BrancheN[branche_trouve,IndexBranche_trouve].BType;
|
||||
BisSuiv:=Btype; // si aiguillage bis
|
||||
//Affiche(intToSTR(adr)+'/'+intToStr(Btype),clorange);
|
||||
AdrPrec:=AdrFonc;AdrFonc:=Adr;
|
||||
BisPrec:=BisFonc;BisFonc:=typeGen;
|
||||
i:=i+1;
|
||||
@@ -4715,11 +4751,13 @@ begin
|
||||
inc(j);
|
||||
sortie:=((Adr=det2) and (Btype=1)) or (j=3);
|
||||
until sortie;
|
||||
|
||||
if ((j=3) and (Adr<>det2)) then
|
||||
begin
|
||||
if (NivDebug=3) then AfficheDebug('Pas de suivant sur séquence '+IntToSTR(det1)+' à '+intToStr(det2),clyellow);
|
||||
calcul_zones_det:=0;exit;
|
||||
end;
|
||||
|
||||
// étape 2 : on a trouvé le sens de progression, trouver le détecteur suivant
|
||||
if (Adr=det2) then
|
||||
begin
|
||||
@@ -4737,23 +4775,29 @@ begin
|
||||
trouve_element(Adr,typeGen);
|
||||
Btype:=BrancheN[branche_trouve,IndexBranche_trouve].BType;
|
||||
BisSuiv:=Btype; // si aiguillage bis
|
||||
if (NivDebug=3) then AfficheDebug('Suivant='+IntToSTR(Adr)+ '('+intToSTR(Btype)+')',clyellow);
|
||||
AdrPrec:=AdrFonc;AdrFonc:=Adr;
|
||||
BisPrec:=BisFonc;BisFonc:=typeGen;
|
||||
inc(i);
|
||||
sortie:=(Btype=1) or (Adr=0) or (i=20);
|
||||
until sortie;
|
||||
|
||||
if (i=20) then begin Affiche('Erreur fatale 201 : Itération trop longue',clred);
|
||||
AfficheDebug('Erreur fatale 201 : Itération trop longue',clred);calcul_zones_det:=3;end;
|
||||
*)
|
||||
sortie:=(Btype=1) or (Adr=0) or (i=20);
|
||||
until sortie;
|
||||
if (i=20) then begin Affiche('Erreur fatale 201 : Itération trop longue',clred);
|
||||
AfficheDebug('Erreur fatale 201 : Itération trop longue',clred);calcul_zones_det:=3;end;
|
||||
|
||||
// le train vient de det1, quitte det2 et va vers Adr
|
||||
Mem[det1]:=false;
|
||||
Mem[det2]:=true;
|
||||
MemZone[det1,det2]:=FALSE; // efface canton précédent
|
||||
|
||||
AdrSuiv:=detecteur_suivant_El(det1,1,det2,1);
|
||||
AdrPrec:=detecteur_suivant_El(det2,1,det1,1);
|
||||
precedent:=det1;
|
||||
|
||||
//Mem[det2]:=true;
|
||||
// le train vient de det1, quitte det2 et va vers Adr
|
||||
if Mem[AdrPrec]=FALSE then begin calcul_zones_det:=10;exit; end;
|
||||
Mem[AdrPrec]:=false;
|
||||
|
||||
MemZone[det1,det2]:=FALSE; // efface zone précédente
|
||||
MemZone[det2,AdrSuiv]:=TRUE; // valide la nouveau zone
|
||||
With FormDebug.MemoDet do
|
||||
begin
|
||||
Suivant:=Adr;
|
||||
Lines.Add('route ok '+intToStr(det1)+' à '+intToStr(det2));
|
||||
s:='Mem '+IntToSTR(det2)+' à '+IntTOStr(AdrSuiv);
|
||||
Lines.Add(s);
|
||||
@@ -4761,7 +4805,7 @@ end;
|
||||
Affiche(s,clyellow);
|
||||
|
||||
calcul_zones_det:=10;
|
||||
exit; // réussi
|
||||
exit; // réussi
|
||||
end;
|
||||
end;
|
||||
|
||||
@@ -4880,13 +4924,13 @@ begin
|
||||
begin
|
||||
det_initial:=feux[i].Adr_det4;Adr_El_Suiv:=feux[i].Adr_el_suiv4;
|
||||
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
|
||||
end;
|
||||
if (det_initial<>0) then
|
||||
if (det_initial<>0) then
|
||||
begin
|
||||
DetPrec1:=detecteur_suivant(Adr_El_Suiv,Btype_el_suivant,det_initial,1);
|
||||
if DetPrec1<>9999 then // route bloquée par aiguillage mal positionné
|
||||
if DetPrec1<9997 then // route bloquée par aiguillage mal positionné
|
||||
begin
|
||||
DetPrec2:=detecteur_suivant_El(det_initial,1,DetPrec1,1);
|
||||
if DetPrec2<9997 then
|
||||
@@ -5092,6 +5136,7 @@ begin
|
||||
det1:=event_det[index_1];
|
||||
det2:=event_det[index_2];
|
||||
if det1=det2 then // si détecteurs identiques, supprimer le 2eme
|
||||
begin
|
||||
if traceListe then Affiche('trouvé doublon',clyellow);
|
||||
supprime_event(index_2);
|
||||
if traceListe then for index_3:=1 to N_event_det do affiche(intToSTR(event_det[index_3]),clyellow);
|
||||
@@ -5153,6 +5198,20 @@ begin
|
||||
var i : integer;
|
||||
begin
|
||||
Affiche('Demande état des aiguillages',ClYellow);
|
||||
for i:=1 to maxaiguillage do
|
||||
begin
|
||||
demande_info_acc(i);
|
||||
end;
|
||||
end;
|
||||
|
||||
// stocke les changements d'état des détecteurs dans le tableau chronologique
|
||||
// et la mémoire de zone
|
||||
procedure stocke_chrono_event_det(Adr,etat : integer);
|
||||
begin
|
||||
if (N_Event_tick<Max_Event_det_tick) then
|
||||
begin
|
||||
inc(N_Event_tick);
|
||||
event_det_tick[N_event_tick].tick:=tick;
|
||||
event_det_tick[N_event_tick].detecteur[Adr]:=etat;
|
||||
end;
|
||||
if etat=1 then Mem[Adr]:=true; // mémoriser l'état à 1
|
||||
@@ -5185,6 +5244,8 @@ begin
|
||||
detecteur[i]:=(valeur and $8) = $8;
|
||||
detecteur_chgt:=i;
|
||||
// mise a jour du tableau evt
|
||||
if ancien_detecteur[i] and not(detecteur[i]) and (N_Event_det<20) then
|
||||
begin
|
||||
inc(N_event_det);
|
||||
event_det[N_event_det]:=i;
|
||||
dem_calcul_zone:=true;
|
||||
@@ -5201,6 +5262,8 @@ begin
|
||||
detecteur[i]:=(valeur and $4) = $4;
|
||||
detecteur_chgt:=i;
|
||||
// mise a jour du tableau evt
|
||||
if ancien_detecteur[i] and not(detecteur[i]) and (N_Event_det<20) then
|
||||
begin
|
||||
inc(N_event_det);
|
||||
event_det[N_event_det]:=i;
|
||||
dem_calcul_zone:=true;
|
||||
@@ -5217,6 +5280,8 @@ begin
|
||||
detecteur[i]:=(valeur and $2) = $2;
|
||||
detecteur_chgt:=i;
|
||||
// mise a jour du tableau evt
|
||||
if ancien_detecteur[i] and not(detecteur[i]) and (N_Event_det<20) then
|
||||
begin
|
||||
inc(N_event_det);
|
||||
event_det[N_event_det]:=i;
|
||||
dem_calcul_zone:=true;
|
||||
@@ -5233,6 +5298,8 @@ begin
|
||||
detecteur[i]:=(valeur and $1) = $1;
|
||||
detecteur_chgt:=i;
|
||||
// mise a jour du tableau evt
|
||||
if ancien_detecteur[i] and not(detecteur[i]) and (N_Event_det<20) then
|
||||
begin
|
||||
inc(N_event_det);
|
||||
event_det[N_event_det]:=i;
|
||||
dem_calcul_zone:=true;
|
||||
@@ -5283,9 +5350,10 @@ begin
|
||||
detecteur[i]:=(valeur and $8) = $8;
|
||||
detecteur_chgt:=i;
|
||||
// mise a jour du tableau evt
|
||||
if ancien_detecteur[i] and not(detecteur[i]) and (N_Event_det<20) then
|
||||
begin
|
||||
inc(N_event_det);
|
||||
event_det[N_event_det]:=i;
|
||||
inc(N_event_det);
|
||||
dem_calcul_zone:=true;
|
||||
end;
|
||||
if ancien_detecteur[i] and not(detecteur[i]) then stocke_chrono_event_det(i,0);
|
||||
@@ -5299,6 +5367,8 @@ begin
|
||||
detecteur[i]:=(valeur and $4) = $4;
|
||||
detecteur_chgt:=i;
|
||||
// mise a jour du tableau evt
|
||||
if ancien_detecteur[i] and not(detecteur[i]) and (N_Event_det<20) then
|
||||
begin
|
||||
inc(N_event_det);
|
||||
event_det[N_event_det]:=i;
|
||||
dem_calcul_zone:=true;
|
||||
@@ -5315,6 +5385,8 @@ begin
|
||||
detecteur[i]:=(valeur and $2) = $2;
|
||||
detecteur_chgt:=i;
|
||||
// mise a jour du tableau evt
|
||||
if ancien_detecteur[i] and not(detecteur[i]) and (N_Event_det<20) then
|
||||
begin
|
||||
inc(N_event_det);
|
||||
event_det[N_event_det]:=i;
|
||||
dem_calcul_zone:=true;
|
||||
@@ -5331,6 +5403,8 @@ begin
|
||||
detecteur[i]:=(valeur and $1) = $1;
|
||||
detecteur_chgt:=i;
|
||||
// mise a jour du tableau evt
|
||||
if ancien_detecteur[i] and not(detecteur[i]) and (N_Event_det<20) then
|
||||
begin
|
||||
inc(N_event_det);
|
||||
event_det[N_event_det]:=i;
|
||||
dem_calcul_zone:=true;
|
||||
@@ -5653,7 +5727,7 @@ end;
|
||||
FreeLibrary(DLL);
|
||||
end;
|
||||
Result:=IsWow64;
|
||||
end;
|
||||
end;
|
||||
{$J-}
|
||||
|
||||
|
||||
@@ -5726,8 +5800,17 @@ begin
|
||||
|
||||
// Initialisation des images des signaux
|
||||
NbreImagePLigne:=Formprinc.ScrollBox1.Width div (largImg+5);
|
||||
|
||||
|
||||
// ajoute une image dynamiquement
|
||||
for i:=1 to NbreFeux do
|
||||
begin
|
||||
cree_image(i); // et initialisation tableaux signaux
|
||||
end;
|
||||
Tempo_init:=10; // démarre les initialisation des signaux et des aiguillages dans 1 s
|
||||
for i:=1 to Max_Event_det_tick do
|
||||
begin
|
||||
for j:=1 to 1100 do
|
||||
event_det_tick[i].detecteur[j]:=-1;
|
||||
end;
|
||||
|
||||
tick:=0;
|
||||
@@ -5754,15 +5837,17 @@ begin
|
||||
// event_det[2]:=520;
|
||||
// N_event_det:=2;
|
||||
//aiguillage[31].Position:=2;
|
||||
//aiguillage[10].Position:=1;
|
||||
//traceDet:=true;
|
||||
// calcul_zones;
|
||||
//maj_feu(201);
|
||||
//etat_signal_suivant(201,1);
|
||||
//Aiguille_deviee(462);
|
||||
//aiguillage[10].Position:=1;
|
||||
//traceDet:=true;
|
||||
// calcul_zones;
|
||||
//maj_feu(201);
|
||||
//etat_signal_suivant(201,1);
|
||||
//Aiguille_deviee(462);
|
||||
//NivDebug:=3;
|
||||
//formdebug.Show;
|
||||
//AfficheDet:=true;
|
||||
NivDebug:=3;
|
||||
aiguillageB[1].Position:=1;
|
||||
//aiguillageB[1].Position:=1;
|
||||
//i:=suivant_alg3(553,1,1,3,1);
|
||||
//Affichedebug(intToSTr(i),clred);
|
||||
//Affiche(IntToSTR(calcul_zones_det(522,514)),clyellow);
|
||||
//test_memoire_zones(1011);
|
||||
@@ -6006,6 +6091,8 @@ end;
|
||||
|
||||
|
||||
end;
|
||||
|
||||
|
||||
// timer à 100 ms
|
||||
procedure TFormPrinc.Timer1Timer(Sender: TObject);
|
||||
var i,a : integer;
|
||||
@@ -6419,14 +6506,29 @@ begin
|
||||
i:=posEx('AD=',recuCDM,j);ss:=copy(recuCDM,i+3,10);
|
||||
val(ss,adr,erreur);
|
||||
i:=posEx('STATE=',recuCDM,j);ss:=copy(recuCDM,i+6,10);
|
||||
Delete(recuCDM,j,i+5-j);
|
||||
Delete(recuCDM,j,i+5-j);
|
||||
val(ss,etat,erreur);
|
||||
|
||||
ancien_detecteur[adr]:=detecteur[adr];
|
||||
Detecteur[adr]:=etat=1;
|
||||
detecteur_chgt:=adr;
|
||||
// stockage du premier état du détecteur
|
||||
//if N_Event_tick=0 then stocke_chrono_event_det(Adr,etat);
|
||||
// front montant sur détecteur
|
||||
if not(ancien_detecteur[adr]) and (detecteur[adr]) then
|
||||
begin
|
||||
ancien_detecteur[adr]:=detecteur[adr];
|
||||
Detecteur[adr]:=etat=1;
|
||||
detecteur_chgt:=adr;
|
||||
FormDebug.MemoDet.Lines.Add(IntToSTR(adr)+' 1');
|
||||
stocke_chrono_event_det(Adr,1);
|
||||
end;
|
||||
// front descendant sur détecteur
|
||||
if ancien_detecteur[adr] and not(detecteur[adr]) and (N_Event_det<20) then
|
||||
begin
|
||||
if N_Event_det<20 then
|
||||
begin
|
||||
inc(N_event_det);
|
||||
event_det[N_event_det]:=adr;
|
||||
dem_calcul_zone:=true;
|
||||
FormDebug.MemoDet.Lines.Add(IntToSTR(adr)+' 0');
|
||||
end;
|
||||
stocke_chrono_event_det(Adr,0);
|
||||
end;
|
||||
@@ -6436,7 +6538,7 @@ begin
|
||||
end ;
|
||||
|
||||
inc(k);
|
||||
//traite:=(k<30) or (pos('CMDACC-ST_TO',recuCDM)<>0) or (pos('CMDACC-ST_DT',recuCDM)<>0) ;
|
||||
//traite:=(k<30) or (pos('CMDACC-ST_TO',recuCDM)<>0) or (pos('CMDACC-ST_DT',recuCDM)<>0) ;
|
||||
sort:=(k>70) or (pos('CMDACC-ST_TO',recuCDM)=0) and (pos('CMDACC-ST_DT',recuCDM)=0);
|
||||
until (sort);
|
||||
|
||||
@@ -6511,8 +6613,10 @@ begin
|
||||
end;
|
||||
|
||||
procedure TFormPrinc.Versions1Click(Sender: TObject);
|
||||
begin
|
||||
begin
|
||||
Affiche('Version 1.0 : première version',clLime);
|
||||
Affiche('Version 1.01 : gestion des trajectoires vers les buttoirs',clLime);
|
||||
Affiche('Version 1.02 : vérification automatique des versions',clLime);
|
||||
Affiche('Version 1.1 : gestion des tableaux indicateurs de direction',clLime);
|
||||
Affiche(' gestion du décodeur de signaux Unisemaf Paco (expérimental)',clLime);
|
||||
Affiche(' changement dynamique des feux en cliquant sur son image',clLime);
|
||||
@@ -6521,5 +6625,25 @@ begin
|
||||
|
||||
end;
|
||||
|
||||
procedure TFormPrinc.ClientSocketLenzDisconnect(Sender: TObject;
|
||||
Socket: TCustomWinSocket);
|
||||
begin
|
||||
parSocket:=False;
|
||||
end;
|
||||
|
||||
|
||||
procedure TFormPrinc.ChronoDetectClick(Sender: TObject);
|
||||
var i,j,etat : integer;
|
||||
s : string;
|
||||
trouve : boolean;
|
||||
begin
|
||||
for i:=1 to N_Event_tick do
|
||||
begin
|
||||
s:=IntToSTR(i)+' Tick='+IntToSTR(event_det_tick[i].tick)+' Det=';
|
||||
trouve:=false;
|
||||
for j:=1 to 1100 do
|
||||
begin
|
||||
etat:=event_det_tick[i].detecteur[j];
|
||||
if etat<>-1 then begin s:=s+IntToSTR(j)+'='+intToSTR(etat);trouve:=true;end;
|
||||
end;
|
||||
if trouve then Affiche(s,clyellow);
|
||||
|
||||
189
config.cfg
189
config.cfg
@@ -1,112 +1,115 @@
|
||||
/******************************************
|
||||
/ fichier de configuration de signaux complexes
|
||||
/ cap de bouheyre avec signaux - 2018
|
||||
/****************************************
|
||||
/ fichier de configuration de signaux_complexes
|
||||
/ gily - f1iwq - 2018
|
||||
/******************************************
|
||||
/ Sans Log=0 / Avec Log=1 : génère un fichier log
|
||||
Log=0
|
||||
/ Affichage du débug du calcul des routes, et enregistrement dans le log si la variable précédente est à 1
|
||||
TraceDet=0
|
||||
/ si 1 envoie un 0 après le pilotage des décodeurs LEB
|
||||
RazSignaux=0
|
||||
/ Envoie un 0 après le pilotage des décodeurs
|
||||
/ Mettre 1 si utilisation de décodeurs LEB
|
||||
RazSignaux=1
|
||||
/
|
||||
/ modélisation des aiguillages : détermine les éléments connectés aux 3 branches des aiguilles (Pointe, Droit, Dévié (S)
|
||||
/ adresse d'aiguillage[B],P=élément vers pointe D=élément vers Droit, S=élément vers dévié
|
||||
/ B pour adresse d'aiguillage déja utilisée
|
||||
/ Elément = détecteur (valeur uniquement numérique) ou aiguillage (adresse [TRI,TJS,TJD]+branche de connexion (P S ou D)
|
||||
/ Exemples : 1,P518,D523,S3P signifie : définition de l'aiguillage @1 : sur pointe relié au détecteur 518
|
||||
/ adresse d'aiguillage,P=élément vers pointe D=élément vers Droit, S=élément vers dévié.
|
||||
/ [60 ou 30 dans le cas d'un aiguillage en position déviée qui doit être fanchie à 30 ou 60]
|
||||
/ Elément = détecteur (valeur uniquement numérique) ou aiguillage (adresse+branche de connexion (P S ou D)
|
||||
/ Exemple : 1,P518,D523,S3P signifie : définition de l'aiguillage @1 : sur pointe relié au détecteur 518
|
||||
/ sur Droit relié au détecteur 518
|
||||
/ sur Dévié, relié à l'aiguillage 3 en pointe
|
||||
/ Voir la documentation des signaux complexes pour une description complete
|
||||
/ Pour une TJD : 26TJD,D530,S529,P28
|
||||
/ P désigne l'autre adresse de la TJD
|
||||
/ Aiguillage triple
|
||||
/
|
||||
/ S'il n'y a pas de détecteur connecté à une branche d'aiguillage, mettre 0.
|
||||
1,P2P,D3P,S1BS
|
||||
1B,P553,D16P,S1S
|
||||
2,P1P,D4P,S2BS
|
||||
2B,P521,D16D,S2S
|
||||
3,P1D,D522,S5BP
|
||||
4,P2D,D554,S6BP
|
||||
5,P9P,S15P,D5BS
|
||||
5B,P3S,S5D,D545
|
||||
6,P10P,S546,D6BS
|
||||
6B,P4S,D545,S6D
|
||||
7,P15S,D566,S565
|
||||
8,P20P,D566,S565
|
||||
9,P5P,D530,S17P
|
||||
10,P6P,D530,S18P
|
||||
13,P17S,D563,S564
|
||||
14,P18S,D563,S564
|
||||
15,P5S,D546,S7P
|
||||
16,P1BD,S16BS,D2BD
|
||||
16B,P0,S16S,D557
|
||||
17,P9S,D531,S13P
|
||||
18,P10S,D562,S14P
|
||||
20,P8P,D547,S0
|
||||
21,P25P,S537,D23S
|
||||
22,P24P,S561,D25S
|
||||
23,P569,S21D,D538
|
||||
24,P22P,S26P,D513
|
||||
25,P21P,S22D,D570
|
||||
26,P24S,S515,D514
|
||||
28,P30P,S29P,D570
|
||||
29,P28S,D516,S31P
|
||||
30,P28P,D32S,S539
|
||||
31TRI,27,P28S,D518,S0,S2-517
|
||||
32,P571,D538,S30D
|
||||
1,P518,S3P,D523,30
|
||||
2,P12S,S5S,D519
|
||||
3,P1S,S5D,D4P
|
||||
4,P3D,S514,D6S
|
||||
5,P515,S2S,D3S
|
||||
6,P516,S4D,D0
|
||||
7,P527,S520,D519
|
||||
8,P527,S522,D521
|
||||
9,P526,S515,D513,60
|
||||
10,P19P,S528,D29P,30
|
||||
11,P18P,D30D,S525
|
||||
12,P517,D20S,S2P
|
||||
17,P525,D535,S528
|
||||
18,P11P,S517,D23P
|
||||
19,P10P,S531,D22P
|
||||
20,P520,D21P,S12D
|
||||
21,P20D,S28D,D28D
|
||||
22,P19D,S538,D537
|
||||
23,P18D,S534,D538
|
||||
24,P538,S533,D32S
|
||||
25,P31S,D529,S27P
|
||||
26TJD,D530,S529,P28
|
||||
28TJD,D21D,S21S,P26
|
||||
27,P25S,D530,S537
|
||||
29,P10D,S30S,D513,60
|
||||
30,P524,S29D,D11D
|
||||
31,P534,S25P,D0
|
||||
32,P22S,S24D,D0
|
||||
0
|
||||
//
|
||||
/ modélisation du réseau par branche
|
||||
/ 1 ligne par branche - le sens de parcours de la description n'a pas d'importance.
|
||||
/ Chaque ligne (branche) doit comporter au moins un détecteur et au moins aiguillage
|
||||
/ 1 ligne par branche - le sens de parcours de la branche est arbitraire.
|
||||
/ Chaque ligne (branche) doit commmencer et finir par un aiguillage
|
||||
/ Une ligne qui finit par un 0 signifie un heurtoir
|
||||
/ @ détecteur A=@aiguillage
|
||||
/ chaque ligne doit commencer par un aiguillage et se terminer par un aiguillage
|
||||
/ Terminer par les brances par 0
|
||||
/ Exemple : 519 est un détecteur - A2 est l'aiguillage 2 - A1B est l'aiguillage 1bis
|
||||
/ Terminer par 0
|
||||
/ Exemple : 519 est un détecteur - A2 est l'aiguillage 2
|
||||
/
|
||||
/ rouge - jaune
|
||||
A20,547,561,A22,A24,A26,515,518,A31,A29,A28,A30,539,522,A3,A1,A2,A4,A6B,545,A5B,A3
|
||||
A26,514,517,A31
|
||||
A26,515,518,A31
|
||||
A24,513,516,A29
|
||||
/grande boucle extérieure départ de couche rouge: de 569 à 569
|
||||
A23,538,A32,571,553,A1B,A16,A2B,521,569,A23
|
||||
/ grande boucle intérieure
|
||||
A21,A25,570,A28
|
||||
A4,554,537,A21
|
||||
/ couche jaune
|
||||
A10,530,A9,A5,A15,546,A6
|
||||
A18,562,531,A17
|
||||
A14,563,A13
|
||||
A14,564,A13
|
||||
/
|
||||
A7,565,A8
|
||||
A7,566,A8
|
||||
A16B,557,0
|
||||
A2,A12,517,A18,A11,A30,524,521,A8,527,A7,519,A2
|
||||
A7,520,A20,A12
|
||||
A1,A3,A4,514,522,A8
|
||||
A1,523,526,A9,513,A29,A10,A19,531,518,A1
|
||||
A9,515,A5
|
||||
A11,525,A17,528,A10
|
||||
A17,535,533,A24,538,A23
|
||||
A7,520,A20,A21,A28,A26,530,A27,A25,A31,534,A23,A18
|
||||
A26,529,A25
|
||||
A22,537,A27
|
||||
A22,A32,A24
|
||||
A6,516,0
|
||||
A31,0
|
||||
0
|
||||
/
|
||||
/ liste des signaux
|
||||
/ liste des adresses des signaux et leur forme, pour affichage de l'image correspondante ,
|
||||
/ avec ou sans bouton de commande pour le feu blanc, type de décodeur [, type de cible (pour les décodeurs Unisemaf uniquement)]
|
||||
/ la liste doit être terminée par une adresse à 0
|
||||
/ forme : 2=2 feux(carré violet/blanc) / 3=3 feux / 4=4 feux (carré) / 5=5 feux (carré + blanc)
|
||||
/ 7=7 feux (carré+blanc + ralentissement / 9=9 feux (blanc ou violet + rappel ralentissement)
|
||||
/ type de décodeur : 0=feu virtuel 1=digital Bahn 2=CDF 3=LDT 4=LEB
|
||||
/ l'énumération des détecteurs ne nécessite pas de parenthèses si il est seul, mais il faut des parenthèses si
|
||||
/ le signal concerne plusieurs voies (donc détecteurs)
|
||||
/ forme : 2=2 feux(carré violet/blanc) / 3=3 feux / 4=4 feux / 5=5 feux (carré + blanc ou violet)
|
||||
/ 7=7 feux (blanc ou violet + ralentissement / 9=9 feux (blanc ou violet + rappel ralentissement)
|
||||
/ Dx : signal directionnel à x feux
|
||||
/ type de décodeur : 1=digital Bahn 2=CDF 3=LDT 4=LEB 5=NMRA 6=Unisemaf
|
||||
/ Notation de chaque ligne:
|
||||
/ adresse de base du signal, forme, réserve, type de décodeur [, (détecteur,..detecteur , élément suivant ..) ,
|
||||
/ avec ou sans demande de verrouillage du feu au carré (0 ou 1)]
|
||||
161,4,0,4,(538,A32),0
|
||||
169,9,0,4,(539,A30),0,
|
||||
177,9,0,4,(569,A23),0
|
||||
185,4,0,4,(570,A25),0
|
||||
193,4,0,4,(516,A29),0
|
||||
201,2,0,4,(517,31TRI,518,31TRI),0
|
||||
209,9,0,4,(561,547),0
|
||||
217,2,0,4,(514,A26,515,A26),0
|
||||
225,9,0,4,(516,A29),0
|
||||
233,4,0,4,(547,A20),0
|
||||
1001,3,0,0,(537,554),0
|
||||
1003,3,0,0,(553,A1B),0
|
||||
1005,3,0,0,(571,553),0
|
||||
1007,3,0,0,(554,A4),0
|
||||
1009,3,0,0,(522,539),0
|
||||
1011,3,0,0,(521,569),0
|
||||
1013,3,0,0,(565,A7),0
|
||||
/ adresse de base du signal, forme, avec ou sans bouton de commande du feu blanc, type de décodeur [, détecteur (det2, det3, ...) , élément suivant ,
|
||||
/ avec ou sans demande de verrouillage du feu au carré]
|
||||
/
|
||||
176,7,0,1,(520,A20),1
|
||||
190,7,0,1,(523,526),1
|
||||
204,9,0,1,(527,A7),1
|
||||
218,7,0,1,(525,A17),1
|
||||
232,2,1,1,(516,A6),1
|
||||
260,9,1,1,(518,A1),1
|
||||
274,3,0,1,(524,521),1
|
||||
288,7,0,1,(522,A8),1
|
||||
302,9,0,1,(526,A9),1
|
||||
316,7,1,1,(515,A5),1
|
||||
330,7,0,1,(519,A2),1
|
||||
344,9,0,1,(528,A10),1
|
||||
358,9,0,1,(517,A18),1
|
||||
372,D3,1,(A10D)(A19S)(A19D,A22D)(A19D,A22S)
|
||||
382,D3,1,(A29S,A10S)(A19S)(A19D,A22D)(A19D,A22S)
|
||||
392,3,0,1,(535,533),1
|
||||
420,7,0,1,(529,A25,530,A27,537,A27),1
|
||||
448,7,0,1,(533,A24),1
|
||||
462,9,0,1,(513,A29),1
|
||||
476,9,0,1,(538,A23),1
|
||||
497,9,0,4,(531,A19),1
|
||||
600,7,0,0,(521,A8),1
|
||||
610,9,0,6,(520,A20),0,7
|
||||
0
|
||||
/
|
||||
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
@@ -26,6 +26,8 @@ Const Version='1.11';// sert
|
||||
|
||||
implementation
|
||||
|
||||
uses UnitPrinc;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
Procedure Aff(s : string);
|
||||
@@ -172,7 +174,7 @@ begin
|
||||
else formVersion.Free;
|
||||
end;
|
||||
|
||||
//if V_utile=V_publie then Affiche('Version Actuelle=Version publiée : votre version est à jour',clLime);
|
||||
if V_utile=V_publie then Formprinc.Hint:='Votre version '+Version_p+' est à jour';
|
||||
|
||||
end;
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user