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