This commit is contained in:
f1iwq2
2020-03-09 18:24:14 +01:00
parent 11cc298114
commit 0e52a60c2a
19 changed files with 2176 additions and 544 deletions
+1 -1
View File
@@ -95,7 +95,7 @@ UnitOutputDir=
PackageDLLOutputDir= PackageDLLOutputDir=
PackageDCPOutputDir= PackageDCPOutputDir=
SearchPath= SearchPath=
Packages= Packages=vcl;rtl;vclx;VclSmp;vclshlctrls
Conditionals= Conditionals=
DebugSourceDirs= DebugSourceDirs=
UsePackages=0 UsePackages=0
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+27 -9
View File
@@ -1,6 +1,6 @@
object FormDebug: TFormDebug object FormDebug: TFormDebug
Left = 302 Left = 286
Top = 166 Top = 39
BorderStyle = bsSingle BorderStyle = bsSingle
Caption = 'Fen'#234'tre de d'#233'bug' Caption = 'Fen'#234'tre de d'#233'bug'
ClientHeight = 639 ClientHeight = 639
@@ -98,7 +98,7 @@ object FormDebug: TFormDebug
end end
object ButtonEcrLog: TButton object ButtonEcrLog: TButton
Left = 448 Left = 448
Top = 560 Top = 504
Width = 97 Width = 97
Height = 29 Height = 29
Caption = 'Sauvegarder le log' Caption = 'Sauvegarder le log'
@@ -131,8 +131,8 @@ object FormDebug: TFormDebug
OnClick = CheckAffSigClick OnClick = CheckAffSigClick
end end
object ButtonRazTampon: TButton object ButtonRazTampon: TButton
Left = 448 Left = 688
Top = 520 Top = 592
Width = 97 Width = 97
Height = 33 Height = 33
Caption = 'Raz Tampon Ev'#232'nements' Caption = 'Raz Tampon Ev'#232'nements'
@@ -142,7 +142,7 @@ object FormDebug: TFormDebug
end end
object ButtonCherche: TButton object ButtonCherche: TButton
Left = 448 Left = 448
Top = 480 Top = 464
Width = 97 Width = 97
Height = 33 Height = 33
Caption = 'Chercher erreurs' Caption = 'Chercher erreurs'
@@ -151,10 +151,10 @@ object FormDebug: TFormDebug
end end
object ButtonAffEvtChrono: TButton object ButtonAffEvtChrono: TButton
Left = 448 Left = 448
Top = 440 Top = 424
Width = 97 Width = 97
Height = 33 Height = 33
Caption = 'Affiche Evts chrono d'#233'tecteurs' Caption = 'Affiche Evts d'#233'tecteurs et aig'
TabOrder = 7 TabOrder = 7
WordWrap = True WordWrap = True
OnClick = ButtonAffEvtChronoClick OnClick = ButtonAffEvtChronoClick
@@ -207,7 +207,7 @@ object FormDebug: TFormDebug
end end
object ButtonCop: TButton object ButtonCop: TButton
Left = 448 Left = 448
Top = 384 Top = 368
Width = 97 Width = 97
Height = 49 Height = 49
Caption = 'Copie fen'#234'te principale dans debug' Caption = 'Copie fen'#234'te principale dans debug'
@@ -221,11 +221,29 @@ object FormDebug: TFormDebug
Width = 225 Width = 225
Height = 241 Height = 241
HideScrollBars = False HideScrollBars = False
PopupMenu = PopupMenuRE
ScrollBars = ssVertical ScrollBars = ssVertical
TabOrder = 12 TabOrder = 12
end end
object ButtonRazLog: TButton
Left = 448
Top = 544
Width = 97
Height = 25
Caption = 'Raz Tampon Log'
TabOrder = 13
OnClick = ButtonRazLogClick
end
object SaveDialog: TSaveDialog object SaveDialog: TSaveDialog
Left = 680 Left = 680
Top = 8 Top = 8
end end
object PopupMenuRE: TPopupMenu
Left = 752
Top = 16
object copier1: TMenuItem
Caption = 'copier'
OnClick = copier1Click
end
end
end end
+33 -7
View File
@@ -4,7 +4,7 @@ interface
uses uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls , ComCtrls; Dialogs, StdCtrls , ComCtrls, Menus;
type type
TFormDebug = class(TForm) TFormDebug = class(TForm)
@@ -25,6 +25,9 @@ type
CheckTrame: TCheckBox; CheckTrame: TCheckBox;
ButtonCop: TButton; ButtonCop: TButton;
RichEdit: TRichEdit; RichEdit: TRichEdit;
PopupMenuRE: TPopupMenu;
copier1: TMenuItem;
ButtonRazLog: 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);
@@ -37,6 +40,8 @@ type
procedure CheckBoxTraceLIsteClick(Sender: TObject); procedure CheckBoxTraceLIsteClick(Sender: TObject);
procedure CheckTrameClick(Sender: TObject); procedure CheckTrameClick(Sender: TObject);
procedure ButtonCopClick(Sender: TObject); procedure ButtonCopClick(Sender: TObject);
procedure copier1Click(Sender: TObject);
procedure ButtonRazLogClick(Sender: TObject);
private private
{ Déclarations privées } { Déclarations privées }
public public
@@ -54,11 +59,12 @@ var
// tick 1/10s,détecteur // tick 1/10s,détecteur
N_Event_tick : integer ; // dernier index N_Event_tick : integer ; // dernier index
// tableau des évènements détecteurs // tableau des évènements détecteurs et aiguillages
event_det_tick : array[0..Max_Event_det_tick] of event_det_tick : array[0..Max_Event_det_tick] of
record record
tick : longint; tick : longint;
detecteur : array[1..1100] of integer; // état du détecteur [...] detecteur : array[1..1100] of integer; // état du détecteur [...]
Aiguillage,position : integer ;
//train : integer ; //train : integer ;
suivant : integer ; // d'ou vient le train suivant : integer ; // d'ou vient le train
traite : boolean; // traité lors de a recherche d'une route traite : boolean; // traité lors de a recherche d'une route
@@ -198,18 +204,26 @@ end;
procedure TFormDebug.ButtonAffEvtChronoClick(Sender: TObject); procedure TFormDebug.ButtonAffEvtChronoClick(Sender: TObject);
var i,j,etat : integer; var i,j,etat : integer;
s : string; s : string;
trouve : boolean;
begin begin
for i:=1 to N_Event_tick do for i:=1 to N_Event_tick do
begin begin
s:=IntToSTR(i)+' Tick='+IntToSTR(event_det_tick[i].tick)+' Det=';
trouve:=false;
for j:=1 to 1100 do for j:=1 to 1100 do
begin begin
etat:=event_det_tick[i].detecteur[j]; etat:=event_det_tick[i].detecteur[j];
if etat<>-1 then begin s:=s+IntToSTR(j)+'='+intToSTR(etat);trouve:=true;end; if etat<>-1 then
begin
s:=IntToSTR(i)+' Tick='+IntToSTR(event_det_tick[i].tick)+' Det='+IntToSTR(j)+'='+intToSTR(etat);
AfficheDebug(s,clyellow);
end;
end;
etat:=event_det_tick[i].aiguillage;
if etat<>-1 then
begin
s:=IntToSTR(i)+' Tick='+IntToSTR(event_det_tick[i].tick)+' Aig='+IntToSTR(etat)+'='+intToSTR(event_det_tick[i].position);
AfficheDebug(s,clyellow);
end; end;
if trouve then AfficheDebug(s,clyellow);
end; end;
end; end;
@@ -236,4 +250,16 @@ end;
procedure TFormDebug.copier1Click(Sender: TObject);
begin
RichEdit.SelectAll;
RichEdit.CopyToClipboard;
RichEdit.SetFocus;
end;
procedure TFormDebug.ButtonRazLogClick(Sender: TObject);
begin
MemoDebug.Clear;
end;
end. end.
BIN
View File
Binary file not shown.
+22 -37
View File
@@ -1,6 +1,6 @@
object FormPrinc: TFormPrinc object FormPrinc: TFormPrinc
Left = 47 Left = 64
Top = 193 Top = 170
AutoSize = True AutoSize = True
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'
@@ -597,7 +597,7 @@ object FormPrinc: TFormPrinc
Visible = False Visible = False
end end
object Image3feux: TImage object Image3feux: TImage
Left = 616 Left = 600
Top = 8 Top = 8
Width = 33 Width = 33
Height = 57 Height = 57
@@ -1200,14 +1200,14 @@ object FormPrinc: TFormPrinc
end end
object Label1: TLabel object Label1: TLabel
Left = 656 Left = 656
Top = 116 Top = 148
Width = 89 Width = 89
Height = 13 Height = 13
Caption = 'Nombre de trains : ' Caption = 'Nombre de trains : '
end end
object LabelNbTrains: TLabel object LabelNbTrains: TLabel
Left = 760 Left = 760
Top = 112 Top = 144
Width = 9 Width = 9
Height = 19 Height = 19
Caption = '0' Caption = '0'
@@ -1255,9 +1255,9 @@ object FormPrinc: TFormPrinc
end end
object ScrollBox1: TScrollBox object ScrollBox1: TScrollBox
Left = 648 Left = 648
Top = 136 Top = 168
Width = 537 Width = 537
Height = 437 Height = 405
Color = clWhite Color = clWhite
ParentColor = False ParentColor = False
TabOrder = 3 TabOrder = 3
@@ -1266,7 +1266,7 @@ object FormPrinc: TFormPrinc
Left = 656 Left = 656
Top = 8 Top = 8
Width = 249 Width = 249
Height = 97 Height = 129
Caption = 'Commande d'#39'accessoires' Caption = 'Commande d'#39'accessoires'
TabOrder = 4 TabOrder = 4
object Label2: TLabel object Label2: TLabel
@@ -1295,7 +1295,7 @@ object FormPrinc: TFormPrinc
Top = 32 Top = 32
Width = 57 Width = 57
Height = 21 Height = 21
Hint = 'Adresse accessoire' Hint = 'Adresse accessoire ou de CV'
TabOrder = 0 TabOrder = 0
Text = '1' Text = '1'
end end
@@ -1331,6 +1331,17 @@ object FormPrinc: TFormPrinc
WordWrap = True WordWrap = True
OnClick = ButtonEcrCVClick OnClick = ButtonEcrCVClick
end end
object ButtonLitCV: TButton
Left = 8
Top = 96
Width = 225
Height = 25
Hint = 'Lecture CV en mode direct sur voie de programmation'
Caption = 'Lecture CV - 1 '#224' 255 par le bus XpressNet'
Enabled = False
TabOrder = 4
OnClick = ButtonLitCVClick
end
end end
object ButtonTest: TButton object ButtonTest: TButton
Left = 912 Left = 912
@@ -1399,33 +1410,14 @@ object FormPrinc: TFormPrinc
TabOrder = 11 TabOrder = 11
OnClick = ButtonRepriseClick OnClick = ButtonRepriseClick
end end
object EditGenli: TEdit
Left = 880
Top = 160
Width = 121
Height = 21
TabOrder = 12
Visible = False
end
object Button1: TButton
Left = 1064
Top = 216
Width = 113
Height = 25
Caption = 'Envoi vers Genli'
TabOrder = 13
Visible = False
OnClick = Button1Click
end
object Button2: TButton object Button2: TButton
Left = 992 Left = 992
Top = 96 Top = 96
Width = 97 Width = 97
Height = 25 Height = 25
Caption = 'Demande '#233'tat CTS' Caption = 'Demande '#233'tat CTS'
TabOrder = 14 TabOrder = 12
Visible = False Visible = False
OnClick = Button2Click
end end
object Timer1: TTimer object Timer1: TTimer
Interval = 100 Interval = 100
@@ -1454,7 +1446,7 @@ object FormPrinc: TFormPrinc
OnClick = AffEtatDetecteurs OnClick = AffEtatDetecteurs
end end
object ChronoDetect: TMenuItem object ChronoDetect: TMenuItem
Caption = 'Chronologie des d'#233'tecteurs' Caption = 'Chronologie des d'#233'tecteurs et aiguillages'
Hint = 'Affiche la chronologie des d'#233'tecteurs' Hint = 'Affiche la chronologie des d'#233'tecteurs'
OnClick = ChronoDetectClick OnClick = ChronoDetectClick
end end
@@ -1547,13 +1539,6 @@ object FormPrinc: TFormPrinc
' sur la voie de programmation' ' sur la voie de programmation'
OnClick = LireunfichierdeCV1Click OnClick = LireunfichierdeCV1Click
end end
object LireunaccessoireversunfichierdeCV1: TMenuItem
Caption = 'Lire un accessoire vers un fichier de CV'
Hint =
'Lire les CV d'#39'un accessoire branch'#233' sur la voie de programmation' +
' vers un fichier'
OnClick = LireunaccessoireversunfichierdeCV1Click
end
end end
end end
object ClientSocketCDM: TClientSocket object ClientSocketCDM: TClientSocket
+309 -181
View File
@@ -78,16 +78,14 @@ type
OpenDialog: TOpenDialog; OpenDialog: TOpenDialog;
N1: TMenuItem; N1: TMenuItem;
LireunfichierdeCV1: TMenuItem; LireunfichierdeCV1: TMenuItem;
LireunaccessoireversunfichierdeCV1: TMenuItem;
SaveDialog: TSaveDialog; SaveDialog: TSaveDialog;
N5: TMenuItem; N5: TMenuItem;
Quitter1: TMenuItem; Quitter1: TMenuItem;
EditGenli: TEdit;
Button1: TButton;
Button2: TButton; Button2: TButton;
Config: TMenuItem; Config: TMenuItem;
Label1: TLabel; Label1: TLabel;
LabelNbTrains: TLabel; LabelNbTrains: TLabel;
ButtonLitCV: TButton;
procedure FormCreate(Sender: TObject); procedure FormCreate(Sender: TObject);
procedure MSCommUSBLenzComm(Sender: TObject); procedure MSCommUSBLenzComm(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormClose(Sender: TObject; var Action: TCloseAction);
@@ -134,11 +132,9 @@ type
procedure ButtonEcrCVClick(Sender: TObject); procedure ButtonEcrCVClick(Sender: TObject);
procedure ButtonRepriseClick(Sender: TObject); procedure ButtonRepriseClick(Sender: TObject);
procedure LireunfichierdeCV1Click(Sender: TObject); procedure LireunfichierdeCV1Click(Sender: TObject);
procedure LireunaccessoireversunfichierdeCV1Click(Sender: TObject);
procedure Quitter1Click(Sender: TObject); procedure Quitter1Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure ConfigClick(Sender: TObject); procedure ConfigClick(Sender: TObject);
procedure ButtonLitCVClick(Sender: TObject);
private private
{ Déclarations privées } { Déclarations privées }
@@ -156,7 +152,10 @@ tempoFeu = 100;
MaxAcc = 2048; MaxAcc = 2048;
LargImg=50;HtImg=91; LargImg=50;HtImg=91;
const_droit=2;const_devieD=1; // positions transmises par la centrale LENZ const_droit=2;const_devieD=1; // positions transmises par la centrale LENZ
const_devieG=3; const_devieG_CDM=3; // positions transmises par cdm
const_devieD_CDM=2; // positions transmises par cdm
const_droit_CDM=0; // positions transmises par cdm
MaxElParcours=4000; MaxElParcours=4000;
@@ -171,7 +170,7 @@ type TBranche = record
Taiguillage = record Taiguillage = record
modele : integer; // 0=n'existe pas 1=aiguillage 2=TJD 3=TJS 4=aiguillage triple modele : integer; // 0=n'existe pas 1=aiguillage 2=TJD 3=TJS 4=aiguillage triple
position, // position actuelle : 1=dévié 2=droit position, // position actuelle : 1=dévié 2=droit
Adrtriple, Adrtriple, // 2eme adresse pour un aiguillage triple
temps, // temps de pilotage (durée de l'impulsion en x 100 ms) temps, // temps de pilotage (durée de l'impulsion en x 100 ms)
inversion : integer; // pilotage inversé 0=normal 1=inversé inversion : integer; // pilotage inversé 0=normal 1=inversé
vitesse : integer; // vitesse de franchissement de l"aiguillage en position déviée (60 ou 90) vitesse : integer; // vitesse de franchissement de l"aiguillage en position déviée (60 ou 90)
@@ -205,9 +204,9 @@ TMA = (valide,devalide);
var ancien_tablo_signalCplx,EtatsignalCplx : array[0..MaxAcc] of word; var ancien_tablo_signalCplx,EtatsignalCplx : array[0..MaxAcc] of word;
AvecInitAiguillages,tempsCli,combine,NbreFeux,pasreponse,AdrDevie,precedent , AvecInitAiguillages,tempsCli,combine,NbreFeux,pasreponse,AdrDevie,precedent ,
NombreImages,signalCpx,branche_trouve,Indexbranche_trouve,Actuel,Signal_suivant, NombreImages,signalCpx,branche_trouve,Indexbranche_trouve,Actuel,Signal_suivant,
Nbre_recu_cdm,Tempo_chgt_feux,Adj1,Adj2,protocole : integer; Nbre_recu_cdm,Tempo_chgt_feux,Adj1,Adj2 : integer;
Hors_tension2,traceSign,TraceZone,Ferme,parSocket,ackCdm, Hors_tension2,traceSign,TraceZone,Ferme,parSocket,ackCdm,
NackCDM,MsgSim : boolean; NackCDM,MsgSim,succes,recu_cv,
TraceListe,clignotant,nack,Maj_feux_cours : boolean; TraceListe,clignotant,nack,Maj_feux_cours : boolean;
branche : array [1..100] of string; branche : array [1..100] of string;
@@ -219,6 +218,7 @@ const
GrisF=$414141; GrisF=$414141;
clOrange=$0077FF; clOrange=$0077FF;
Feu_X=50;Feu_Y=91; Feu_X=50;Feu_Y=91;
Max_Simule=1000;
couleurTrain : array[1..8] of Tcolor = (clYellow,clLime,clOrange,clAqua,clFuchsia,clLtGray,clred,clWhite); couleurTrain : array[1..8] of Tcolor = (clYellow,clLime,clOrange,clAqua,clFuchsia,clLtGray,clred,clWhite);
var var
@@ -241,10 +241,11 @@ var
Mem1,Mem2 : integer; Mem1,Mem2 : integer;
end; end;
end; end;
Tablo_Simule : array[0..200] of
Tablo_Simule : array[0..Max_Simule] of
record record
tick : longint; tick : longint;
Detecteur,etat : integer ; Detecteur,Aiguillage,etat : integer ;
end; end;
Route : array[1..2000] of record Route : array[1..2000] of record
Mem1,Mem2 : integer; Mem1,Mem2 : integer;
@@ -3719,6 +3720,8 @@ begin
Adr:=actuel; Adr:=actuel;
Btype:=BrancheN[branche_trouve_actuel,indexBranche_actuel].Btype; Btype:=BrancheN[branche_trouve_actuel,indexBranche_actuel].Btype;
//Affiche('Btype='+intToSTR(Btype)+' Actuel='+inTToSTR(actuel),clyellow);
if Btype=1 then // l'élément actuel est un détecteur if Btype=1 then // l'élément actuel est un détecteur
begin begin
// on part de l'actuel pour retomber sur le précédent // on part de l'actuel pour retomber sur le précédent
@@ -3967,10 +3970,11 @@ begin
if (aiguillage[Adr].modele=2) or (aiguillage[Adr].modele=3) then // TJD ou TJS if (aiguillage[Adr].modele=2) or (aiguillage[Adr].modele=3) then // TJD ou TJS
begin begin
AdrTjdP:=aiguillage[Adr].Apointe; // récupérer les élements de la TJD/S
AdrTjdP:=aiguillage[Adr].Apointe; // 2eme adresse de la TJD/S
tjd:=aiguillage[Adr].modele=2; tjd:=aiguillage[Adr].modele=2;
tjs:=aiguillage[Adr].modele=3; tjs:=aiguillage[Adr].modele=3;
tjsc1:=aiguillage[Adr].tjsint; // adresses de la courbe de la TJD tjsc1:=aiguillage[Adr].tjsint; // adresses de la courbe de la TJS
tjsc2:=aiguillage[AdrTjdP].tjsint; tjsc2:=aiguillage[AdrTjdP].tjsint;
tjsc1B:=aiguillage[Adr].tjsintB; tjsc1B:=aiguillage[Adr].tjsintB;
tjsc2B:=aiguillage[AdrTjdP].tjsintB; tjsc2B:=aiguillage[AdrTjdP].tjsintB;
@@ -4122,43 +4126,108 @@ begin
AfficheDebug('139 - Erreur fatale - Aucun cas TJD/S : adr='+IntToSTR(Adr)+' '+intToSTR(AdrTJDP)+' prec='+IntTOSTR(prec),clred); AfficheDebug('139 - Erreur fatale - Aucun cas TJD/S : adr='+IntToSTR(Adr)+' '+intToSTR(AdrTJDP)+' prec='+IntTOSTR(prec),clred);
suivant_alg3:=9999;exit; suivant_alg3:=9999;exit;
end; end;
if (aiguillage[Adr].modele=4) then // aiguillage triple if (aiguillage[Adr].modele=4) then // aiguillage triple
begin begin
// aiguillage triple pris en pointe Adr2:=aiguillage[Adr].AdrTriple;
Adr2:=aiguillage[Adr].AdrTriple; if (aiguillage[adr].Apointe=prec) then
// attention la lecture d'un aiguillage triple est différente suivant la connexion avec CDM begin
// ou avec l'interface // aiguillage triple pris en pointe
if ( CDM_connecte and (aiguillage[Adr].position=const_droit) ) or //Affiche('position='+intToSTR(aiguillage[Adr].position),clyellow);
( not(CDM_connecte) and (aiguillage[Adr].position=const_droit) and (aiguillage[Adr2].position=const_droit) ) then if (aiguillage[Adr].position=const_droit) and (aiguillage[Adr2].position=const_droit) then
begin begin
if NivDebug=3 then AfficheDebug('Aiguillage triple droit',clYellow); if NivDebug=3 then AfficheDebug('Aiguillage triple pris en pointe droit',clYellow);
typeGen:=aiguillage[Adr].AdroitBis+1; typeGen:=aiguillage[Adr].AdroitBis+1;
//TSuiv=aiguillage[Adr].AdroitB; A:=aiguillage[Adr].AdroitB;
Adr:=aiguillage[Adr].Adroit; Adr:=aiguillage[Adr].Adroit;
end; if A='Z' then TypeEl:=1 else TypeEL:=2; //TypeEL=(1=détécteur 2=aig 3=aig Bis)
if ( CDM_connecte and (aiguillage[Adr].position=const_devieG) ) or if Abis=1 then TypeEl:=3;
( not(CDM_connecte) and (aiguillage[Adr].position<>const_droit) and (aiguillage[Adr2].position=const_droit) ) then trouve_element(Adr,TypeEl); // branche_trouve IndexBranche_trouve
begin typeGen:=BrancheN[branche_trouve,IndexBranche_trouve].BType;
if NivDebug=3 then AfficheDebug('Aiguillage triple dévié1 (gauche)',clYellow); suivant_alg3:=adr;exit;
typeGen:=aiguillage[Adr].AdevieBis+1; end;
//TSuiv=aiguillage[Adr].AdevieB; if (aiguillage[Adr].position<>const_droit) and (aiguillage[Adr2].position=const_droit) then
Adr:=aiguillage[Adr].Adevie; begin
end; if NivDebug=3 then AfficheDebug('Aiguillage triple dévié1 (à gauche)',clYellow);
if ( CDM_connecte and (aiguillage[Adr].position=const_devieG) ) or typeGen:=aiguillage[Adr].AdevieBis+1;
( not(CDM_connecte) and (aiguillage[Adr].position=const_droit) and (aiguillage[Adr2].position<>const_droit) ) then A:=aiguillage[Adr].AdevieB;
begin Adr:=aiguillage[Adr].Adevie;
if NivDebug=3 then AfficheDebug('Aiguillage triple dévié2 (droit)',clYellow); if A='Z' then TypeEl:=1 else TypeEL:=2; //TypeEL=(1=détécteur 2=aig 3=aig Bis)
typeGen:=aiguillage[Adr].Adevie2Bis+1; if Abis=1 then TypeEl:=3;
//TSuiv=aiguillage[Adr].Adevie2B; trouve_element(Adr,TypeEl); // branche_trouve IndexBranche_trouve
Adr:=aiguillage[Adr].Adevie2; typeGen:=BrancheN[branche_trouve,IndexBranche_trouve].BType;
end; suivant_alg3:=adr;exit;
if ((aiguillage[Adr].position<>const_droit) and (aiguillage[Adr2].position<>const_droit) ) then end;
begin if (aiguillage[Adr].position=const_droit) and (aiguillage[Adr2].position<>const_droit) then
AfficheDebug('Aiguillage triple '+IntToSTR(Adr)+' : configuration des aiguilles interdite',clYellow); begin
Affiche('Aiguillage triple : '+IntToSTR(Adr)+' configuration des aiguilles interdite',clRed); if NivDebug=3 then AfficheDebug('Aiguillage triple dévié2 (à droite)',clYellow);
//TSuiv='Z'; typeGen:=aiguillage[Adr].Adevie2Bis+1;
suivant_alg3:=9999;exit; // pour échappement A:=aiguillage[Adr].Adevie2B;
end; Adr:=aiguillage[Adr].Adevie2;
if A='Z' then TypeEl:=1 else TypeEL:=2; //TypeEL=(1=détécteur 2=aig 3=aig Bis)
if Abis=1 then TypeEl:=3;
trouve_element(Adr,TypeEl); // branche_trouve IndexBranche_trouve
typeGen:=BrancheN[branche_trouve,IndexBranche_trouve].BType;
suivant_alg3:=adr;exit;
end;
begin
s:='Aiguillage triple '+IntToSTR(Adr)+' : configuration des aiguilles interdite';
if CDM_connecte then s:=s+': '+IntToSTR(aiguillage[Adr].position);
AfficheDebug(s,clYellow);
Affiche(s,clRed);
suivant_alg3:=9999;exit; // pour échappement
end;
end
else
begin
if NivDebug=3 then AfficheDebug('Aiguillage triple pris en talon',clyellow);
if alg=2 then // on demande d'arreter si l'aiguillage en talon est mal positionné
begin
if (aiguillage[adr].position=const_droit) and (aiguillage[adr2].position=const_droit) then
begin
if prec<>aiguillage[Adr].Adroit then
begin
if NivDebug=3 then AfficheDebug('135.3 - Aiguillage '+intToSTR(adr)+'triple mal positionné',clyellow);
suivant_alg3:=9998;exit;
end
else
begin
if NivDebug=3 then AfficheDebug('135.4 - Aiguillage '+intToSTR(adr)+'triple bien positionné',clyellow);
end;
end;
if (aiguillage[adr].position<>const_droit) and (aiguillage[adr2].position=const_droit) then
begin
if prec<>aiguillage[Adr].Adevie then
begin
if NivDebug=3 then AfficheDebug('135.3 - Aiguillage '+intToSTR(adr)+'triple mal positionné',clyellow);
suivant_alg3:=9998;exit;
end
else
begin
if NivDebug=3 then AfficheDebug('135.4 - Aiguillage '+intToSTR(adr)+'triple bien positionné',clyellow);
end;
end;
if (aiguillage[adr].position=const_droit) and (aiguillage[adr2].position<>const_droit) then
begin
if prec<>aiguillage[Adr].Adevie2 then
begin
if NivDebug=3 then AfficheDebug('135.3 - Aiguillage '+intToSTR(adr)+'triple mal positionné',clyellow);
suivant_alg3:=9998;exit;
end
else
begin
if NivDebug=3 then AfficheDebug('135.4 - Aiguillage '+intToSTR(adr)+'triple bien positionné',clyellow);
end;
end;
end;
A:=aiguillage[Adr].ApointeB;
Adr:=aiguillage[Adr].Apointe;
if A='Z' then TypeEl:=1 else TypeEL:=2; //TypeEL=(1=détécteur 2=aig 3=aig Bis)
if Abis=1 then TypeEl:=3;
trouve_element(Adr,TypeEl); // branche_trouve IndexBranche_trouve
typeGen:=BrancheN[branche_trouve,IndexBranche_trouve].BType;
suivant_alg3:=Adr;exit;
end;
end; end;
end; end;
suivant_alg3:=adr; suivant_alg3:=adr;
@@ -5122,8 +5191,6 @@ begin
// signaux traités spécifiquement // signaux traités spécifiquement
if (AdrFeu=201) then if (AdrFeu=201) then
begin begin
//sprintf(Affiche,"Aiguille 27=%d \r\n",aiguillage[27].position);Display(Affiche);
// sprintf(Affiche,"Aiguille 31=%d \r\n",aiguillage[31].position);Display(Affiche);
if ((aiguillage[28].position<>const_droit) and (aiguillage[29].position<>const_droit) and if ((aiguillage[28].position<>const_droit) and (aiguillage[29].position<>const_droit) and
(aiguillage[31].position=2)) then // attention spécial (aiguillage[31].position=2)) then // attention spécial
Maj_Etat_Signal(AdrFeu,blanc) else Maj_Etat_Signal(AdrFeu,violet); Maj_Etat_Signal(AdrFeu,blanc) else Maj_Etat_Signal(AdrFeu,violet);
@@ -5529,6 +5596,12 @@ begin
// Affiche('stockage de '+intToSTR(N_event_tick)+' à '+intToSTR(etat01),clyellow); // Affiche('stockage de '+intToSTR(N_event_tick)+' à '+intToSTR(etat01),clyellow);
end; end;
// Mettre à jour le TCO
if AvecTCO then
begin
formTCO.Maj_TCO(Adresse,etat);
end;
exit; exit;
//------------------------plus utilisé ---------------- //------------------------plus utilisé ----------------
{ {
@@ -5564,11 +5637,16 @@ begin
end; end;
// évènement d'aiguillage // évènement d'aiguillage
procedure Event_Aig(adresse : integer); procedure Event_Aig(adresse,pos : integer);
var i,index1,index2,AdresseE,Adet,det_suiv,pos,Btype,BtypeE,train1,train2,train,
index : integer;
trouve,trouve1,trouve2 : boolean;
begin 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].aiguillage:=adresse;
event_det_tick[N_event_tick].position:=pos;
end;
exit; exit;
{ {
// -------------------------plus utilisé ---------------- // -------------------------plus utilisé ----------------
@@ -5706,25 +5784,25 @@ begin
if (valeur and $C)=$8 then if (valeur and $C)=$8 then
begin begin
aiguillage[adraig+3].position:=2 ; // état aiguillage haut aiguillage[adraig+3].position:=2 ; // état aiguillage haut
Event_Aig(adraig+3); Event_Aig(adraig+3,2);
if trace then begin s:='accessoire '+intToSTR(adraig+3)+'=2';Affiche(s,clYellow);end; if trace then begin s:='accessoire '+intToSTR(adraig+3)+'=2';Affiche(s,clYellow);end;
end; end;
if (valeur and $C)=$4 then if (valeur and $C)=$4 then
begin begin
aiguillage[adraig+3].position:=1 ; // état aiguillage haut aiguillage[adraig+3].position:=1 ; // état aiguillage haut
Event_Aig(adraig+3); Event_Aig(adraig+3,1);
if trace then begin s:='accessoire '+intToSTR(adraig+3)+'=1';Affiche(s,clYellow);end; if trace then begin s:='accessoire '+intToSTR(adraig+3)+'=1';Affiche(s,clYellow);end;
end; end;
if (valeur and $3)=$2 then if (valeur and $3)=$2 then
begin begin
aiguillage[adraig+2].position:=2; // état aiguillage bas aiguillage[adraig+2].position:=2; // état aiguillage bas
Event_Aig(adraig+2); Event_Aig(adraig+2,2);
if trace then begin s:='accessoire '+intToSTR(adraig+2)+'=2';Affiche(s,clYellow);end; if trace then begin s:='accessoire '+intToSTR(adraig+2)+'=2';Affiche(s,clYellow);end;
end; end;
if (valeur and $3)=$1 then if (valeur and $3)=$1 then
begin begin
aiguillage[adraig+2].position:=1; // état aiguillage bas aiguillage[adraig+2].position:=1; // état aiguillage bas
Event_Aig(adraig+2); Event_Aig(adraig+2,1);
if trace then begin s:='accessoire '+intToSTR(adraig+2)+'=1';Affiche(s,clYellow);end; if trace then begin s:='accessoire '+intToSTR(adraig+2)+'=1';Affiche(s,clYellow);end;
end; end;
end; end;
@@ -5766,25 +5844,25 @@ begin
if (valeur and $C)=$8 then if (valeur and $C)=$8 then
begin begin
aiguillage[adraig+1].position:=2 ; // état aiguillage haut aiguillage[adraig+1].position:=2 ; // état aiguillage haut
Event_Aig(adraig+1); Event_Aig(adraig+1,2);
if trace then begin s:='accessoire '+intToSTR(adraig+1)+'=2';Affiche(s,clYellow);end; if trace then begin s:='accessoire '+intToSTR(adraig+1)+'=2';Affiche(s,clYellow);end;
end; end;
if (valeur and $C)=$4 then if (valeur and $C)=$4 then
begin begin
aiguillage[adraig+1].position:=1 ; // état aiguillage haut aiguillage[adraig+1].position:=1 ; // état aiguillage haut
Event_Aig(adraig+1); Event_Aig(adraig+1,1);
if trace then begin s:='accessoire '+intToSTR(adraig+1)+'=1';Affiche(s,clYellow);end; if trace then begin s:='accessoire '+intToSTR(adraig+1)+'=1';Affiche(s,clYellow);end;
end; end;
if (valeur and $3)=$2 then if (valeur and $3)=$2 then
begin begin
aiguillage[adraig].position:=2; // état aiguillage bas aiguillage[adraig].position:=2; // état aiguillage bas
Event_Aig(adraig); Event_Aig(adraig,2);
if trace then begin s:='accessoire '+intToSTR(adraig)+'=2';Affiche(s,clYellow);end; if trace then begin s:='accessoire '+intToSTR(adraig)+'=2';Affiche(s,clYellow);end;
end; end;
if (valeur and $3)=$1 then if (valeur and $3)=$1 then
begin begin
aiguillage[adraig].position:=1; // état aiguillage bas aiguillage[adraig].position:=1; // état aiguillage bas
Event_Aig(adraig); Event_Aig(adraig,1);
if trace then begin s:='accessoire '+intToSTR(adraig)+'=1';Affiche(s,clYellow);end; if trace then begin s:='accessoire '+intToSTR(adraig)+'=1';Affiche(s,clYellow);end;
end; end;
@@ -5855,7 +5933,7 @@ end;
// décodage d'une chaine simple de la rétrosignalisation // décodage d'une chaine simple de la rétrosignalisation
function decode_chaine_retro(chaineINT : string) : string ; function decode_chaine_retro(chaineINT : string) : string ;
var msg : string; var msg : string;
i,cv : integer; i,cvLoc : integer;
begin begin
//affiche(chaine_hex(chaine),clyellow); //affiche(chaine_hex(chaine),clyellow);
msg:=''; msg:='';
@@ -5867,7 +5945,7 @@ begin
#1 : begin nack:=true;msg:='erreur timout transmission';end; #1 : begin nack:=true;msg:='erreur timout transmission';end;
#2 : begin nack:=true;msg:='erreur timout centrale';end; #2 : begin nack:=true;msg:='erreur timout centrale';end;
#3 : begin nack:=true;msg:='erreur communication inconnue';end; #3 : begin nack:=true;msg:='erreur communication inconnue';end;
#4 : begin msg:='succès';end; #4 : begin succes:=true;msg:='succès';end;
#5 : begin nack:=true;msg:='plus de time slot';end; #5 : begin nack:=true;msg:='plus de time slot';end;
#6 : begin nack:=true;msg:='débordement tampon LI100';end; #6 : begin nack:=true;msg:='débordement tampon LI100';end;
end; end;
@@ -5909,17 +5987,19 @@ begin
if ((chaineINT[1]=#$63) and (chaineINT[2]=#$14)) then // V3.6 uniquement if ((chaineINT[1]=#$63) and (chaineINT[2]=#$14)) then // V3.6 uniquement
begin begin
// réception d'un CV. DocXpressNet p26 // réception d'un CV. DocXpressNet p26 63 14 01 03 chk
delete(chaineInt,1,2); delete(chaineInt,1,2);
cv:=ord(chaineINT[1]); cvLoc:=ord(chaineINT[1]);
Affiche('Réception CV'+IntToSTR(cv)+' à '+IntToSTR(ord(chaineINT[2])),clyellow); //Affiche('Réception CV'+IntToSTR(cvLoc)+' à '+IntToSTR(ord(chaineINT[2])),clyellow);
if cv>255 then Affiche('Erreur Recu CV>255',clRed) if cvLoc>255 then Affiche('Erreur Recu CV>255',clRed)
else else
begin begin
tablo_cv[cv]:=ord(chaineINT[2]); tablo_cv[cvLoc]:=ord(chaineINT[2]);
inc(N_Cv); // nombre de CV recus inc(N_Cv); // nombre de CV recus
end; end;
recu_cv:=true;
delete(chaineInt,1,3);
decode_chaine_retro:=chaineINT; decode_chaine_retro:=chaineINT;
exit; exit;
end; end;
@@ -6067,7 +6147,7 @@ begin
begin begin
With Formprinc.MSCommUSBLenz do With Formprinc.MSCommUSBLenz do
begin begin
Affiche('Demande ouverture com'+intToSTR(nuMPort)+':'+ConfStCom+','+IntToSTR(protocole),CLYellow); Affiche('Demande ouverture com'+intToSTR(nuMPort)+':'+ConfStCom+' protocole '+IntToSTR(protocole),CLYellow);
Settings:=ConfStCom; // COMx:vitesse,n,8,1 Settings:=ConfStCom; // COMx:vitesse,n,8,1
if protocole>=4 then Handshaking:=0 {0=aucun 1=Xon-Xoff 2=cts 3=RTS-Xon-Xoff 4=5=protocoles "maison"} if protocole>=4 then Handshaking:=0 {0=aucun 1=Xon-Xoff 2=cts 3=RTS-Xon-Xoff 4=5=protocoles "maison"}
else Handshaking:=protocole; else Handshaking:=protocole;
@@ -6168,8 +6248,8 @@ begin
//créée la fenêtre TCO //créée la fenêtre TCO
FormTCO:=TformTCO.Create(Self); FormTCO:=TformTCO.Create(Self);
FormTCO.show; FormTCO.show;
construit_TCO; //construit_TCO;
affiche_TCO; //affiche_TCO;
//Formprinc.Hide; //Formprinc.Hide;
end; end;
@@ -6203,14 +6283,14 @@ begin
begin begin
ButtonEcrCV.Enabled:=true; ButtonEcrCV.Enabled:=true;
LireunfichierdeCV1.enabled:=true; LireunfichierdeCV1.enabled:=true;
LireunaccessoireversunfichierdeCV1.Enabled:=true; ButtonLitCV.Enabled:=true;
end end
else else
With Formprinc do With Formprinc do
begin begin
ButtonEcrCV.Enabled:=false; ButtonEcrCV.Enabled:=false;
ButtonLitCV.Enabled:=false;
LireunfichierdeCV1.enabled:=false; LireunfichierdeCV1.enabled:=false;
LireunaccessoireversunfichierdeCV1.Enabled:=false;
end ; end ;
// Initialisation des images des signaux // Initialisation des images des signaux
@@ -6226,6 +6306,7 @@ begin
// initialisation de la chronologie des évènements détecteurs // initialisation de la chronologie des évènements détecteurs
for i:=0 to Max_Event_det_tick do for i:=0 to Max_Event_det_tick do
begin begin
event_det_tick[i].aiguillage:=-1;
for j:=1 to 1100 do for j:=1 to 1100 do
event_det_tick[i].detecteur[j]:=-1; // initialiser les détecteurs à -1 event_det_tick[i].detecteur[j]:=-1; // initialiser les détecteurs à -1
event_det_tick[i].traite:=false ; // non traité event_det_tick[i].traite:=false ; // non traité
@@ -6243,7 +6324,6 @@ begin
//begin //begin
// if pos('Ports',Line[i])<>0 then Affiche(Line[i],clyellow); // if pos('Ports',Line[i])<>0 then Affiche(Line[i],clyellow);
//end; //end;
//essai //essai
// event_det[1]:=527; // event_det[1]:=527;
// event_det[2]:=520; // event_det[2]:=520;
@@ -6253,11 +6333,10 @@ begin
//traceDet:=true; //traceDet:=true;
// calcul_zones; // calcul_zones;
//maj_feu(201); //maj_feu(201);
//etat_signal_suivant(201,1); // formdebug.Show;
//Aiguille_deviee(462);
//NivDebug:=3;
//formdebug.Show;
//AfficheDet:=true; //AfficheDet:=true;
//NivDebug:=3;
//Aiguille_deviee(462);
//aiguillageB[1].Position:=1; //aiguillageB[1].Position:=1;
//i:=suivant_alg3(553,1,1,3,1); //i:=suivant_alg3(553,1,1,3,1);
//Affichedebug(intToSTr(i),clred); //Affichedebug(intToSTr(i),clred);
@@ -6275,10 +6354,8 @@ begin
//Affiche(' Adj1='+intToStr(Adj1)+' Adj2='+intToStr(Adj2),clyellow); //Affiche(' Adj1='+intToStr(Adj1)+' Adj2='+intToStr(Adj2),clyellow);
//trace:=true; //trace:=true;
//TraceListe:=true; //TraceListe:=true;
//interprete_reponse(#$FF+#$FD+#$46+#$43+#$40+#$41+#$40+#$40+#$49+#$4D); //interprete_reponse(#$FF+#$FD+#$46+#$43+#$40+#$41+#$40+#$40+#$49+#$4D);
Affiche('Fin des initialisations',clyellow); Affiche('Fin des initialisations',clyellow);
//Menu_interface(valide); //Menu_interface(valide);
//s:=#$f0; //s:=#$f0;
//s:=checksum(s); //s:=checksum(s);
@@ -6414,8 +6491,19 @@ begin
while tick=Tablo_simule[i_simule+1].tick do while tick=Tablo_simule[i_simule+1].tick do
begin begin
inc(I_simule); inc(I_simule);
Affiche('Simulation tick='+IntToSTR(tick)+' det='+intToSTR(Tablo_simule[i_simule].detecteur)+'='+IntToSTR(Tablo_simule[i_simule].etat),Cyan); // evt détecteur ?
Event_Detecteur(Tablo_simule[i_simule].detecteur, Tablo_simule[i_simule].etat=1); // créer évt détecteur if Tablo_simule[i_simule].detecteur<>0 then
begin
Affiche('Simulation tick='+IntToSTR(tick)+' det='+intToSTR(Tablo_simule[i_simule].detecteur)+'='+IntToSTR(Tablo_simule[i_simule].etat),Cyan);
Event_Detecteur(Tablo_simule[i_simule].detecteur, Tablo_simule[i_simule].etat=1); // créer évt détecteur
end;
// evt aiguillage ?
if Tablo_simule[i_simule].aiguillage<>0 then
begin
Affiche('Simulation tick='+IntToSTR(tick)+' aig='+intToSTR(Tablo_simule[i_simule].aiguillage)+'='+IntToSTR(Tablo_simule[i_simule].etat),Cyan);
Event_Aig(Tablo_simule[i_simule].Aiguillage, Tablo_simule[i_simule].etat); // créer évt aiguillage
end;
end; end;
if i_Simule>=Index_simule then if i_Simule>=Index_simule then
begin begin
@@ -6441,7 +6529,19 @@ procedure TFormPrinc.ButtonCommandeClick(Sender: TObject);
var adr,valeur,erreur : integer; var adr,valeur,erreur : integer;
begin begin
val(EditAdresse.text,adr,erreur); val(EditAdresse.text,adr,erreur);
if (erreur<>0) or (adr<1) or (adr>2048) then
begin
EditAdresse.text:='1';
exit;
end;
val(EditVal.Text,valeur,erreur); val(EditVal.Text,valeur,erreur);
if (erreur<>0) or (valeur<0) or (valeur>255) then
begin
EditVal.text:='1';
exit;
end;
pilote_acc(adr,valeur,aig); pilote_acc(adr,valeur,aig);
end; end;
@@ -6595,7 +6695,6 @@ begin
ClientSocketLenz.Close; ClientSocketLenz.Close;
end; end;
function cde_cdm(s : string) : string; function cde_cdm(s : string) : string;
var i : integer; var i : integer;
begin begin
@@ -6603,8 +6702,6 @@ begin
cde_cdm:='0'+IntToSTR(i)+s; cde_cdm:='0'+IntToSTR(i)+s;
end; end;
procedure TFormPrinc.locoClick(Sender: TObject); procedure TFormPrinc.locoClick(Sender: TObject);
begin begin
// vitesse et direction 18 pas // vitesse et direction 18 pas
@@ -6626,16 +6723,23 @@ begin
end; end;
procedure TFormPrinc.Etatdesaiguillages1Click(Sender: TObject); procedure TFormPrinc.Etatdesaiguillages1Click(Sender: TObject);
var i : integer; var i,j,model : integer;
s : string; s : string;
begin begin
Affiche('les positions des aiguillages BIS sont les mêmes que leurs homologues non bis',Cyan); Affiche('les positions des aiguillages BIS sont les mêmes que leurs homologues non bis',Cyan);
for i:=1 to MaxAcc do for i:=1 to MaxAcc do
begin begin
if aiguillage[i].modele<>0 then model:=aiguillage[i].modele ;
if model<>0 then
begin begin
s:='Aiguillage '+IntToSTR(i)+' : '+intToSTR(aiguillage[i].position); s:='Aiguillage '+IntToSTR(i)+' : '+intToSTR(aiguillage[i].position);
if aiguillage[i].position=1 then s:=s+' (dévié)' else s:=s+' (droit)'; if aiguillage[i].position=1 then s:=s+' (dévié)' else s:=s+' (droit)';
if model=4 then
begin
j:=aiguillage[i].AdrTriple;
s:=s+' Aig '+IntToSTR(j)+': '+intToSTR(aiguillage[j].position);
if aiguillage[j].position=1 then s:=s+' (dévié)' else s:=s+' (droit)';
end;
Affiche(s,clWhite); Affiche(s,clWhite);
end; end;
end; end;
@@ -6696,8 +6800,8 @@ begin
AfficheDebug('Lenz connecté ',clYellow); AfficheDebug('Lenz connecté ',clYellow);
parSocket:=True; parSocket:=True;
ButtonEcrCV.Enabled:=true; ButtonEcrCV.Enabled:=true;
ButtonLitCV.Enabled:=true;
LireunfichierdeCV1.enabled:=true; LireunfichierdeCV1.enabled:=true;
LireunaccessoireversunfichierdeCV1.Enabled:=true;
LabelTitre.caption:=titre+' Interface connectée par Ethernet'; LabelTitre.caption:=titre+' Interface connectée par Ethernet';
end; end;
@@ -6717,7 +6821,7 @@ end;
// réception d'un message de CDM rail // réception d'un message de CDM rail
procedure TFormPrinc.ClientSocketCDMRead(Sender: TObject;Socket: TCustomWinSocket); procedure TFormPrinc.ClientSocketCDMRead(Sender: TObject;Socket: TCustomWinSocket);
var i,j,k,erreur, adr,adr2,etat,etataig : integer ; var i,j,k,erreur, adr,adr2,etat,etataig,etatAig2 : integer ;
s,ss : string; s,ss : string;
traite,sort : boolean; traite,sort : boolean;
begin begin
@@ -6756,14 +6860,50 @@ begin
exit; exit;
end; end;
val(ss,etat,erreur); val(ss,etat,erreur);
// Affiche('Aiguillage CDM'+intToSTR(adr)+'='+IntToStr(etat),clLime);
// conversion en position :
// CDM: 0=droit 1=droite 3=gauche
// logiciel : 1=dévié 2=droit
// aiguillage normal
if aiguillage[adr].modele=1 then
begin
if etat=0 then etatAig:=2 else etatAig:=1;
aiguillage[adr].position:=etatAig;
aiguillageB[adr].position:=etatAig;
Event_Aig(adr,etatAig);
end;
// TJD TJS
if (aiguillage[adr].modele=2) or (aiguillage[adr].modele=3) then
begin
adr2:=aiguillage[adr].Apointe; // 2eme adresse de la TJD
case etat of
1 : begin etatAig:=1;EtatAig2:=2;end;
4 : begin etatAig:=1;EtatAig2:=1;end;
5 : begin etatAig:=2;EtatAig2:=1;end;
0 : begin etatAig:=2;EtatAig2:=2;end;
end;
aiguillage[adr].position:=etatAig;aiguillage[adr2].position:=etatAig2;
Event_Aig(adr,etatAig);
Event_Aig(adr2,etatAig2);
end;
if aiguillage[adr].modele=4 then // aiguillage triple
begin
// état de l'aiguillage 1
if (etat=0) or (etat=2) then etatAig:=2;
if etat=3 then etatAig:=1;
aiguillage[adr].Position:=etatAig;
// état de l'aiguillage 2
adr2:=aiguillage[adr].AdrTriple;
if (etat=0) or (etat=3) then etatAig2:=2;
if etat=2 then etatAig2:=1;
aiguillage[adr2].Position:=etatAig2;
Event_Aig(adr,etatAig);
Event_Aig(adr2,etatAig2);
end;
// conversion en position : 1=dévié (CDM envoie 2 ou 1) 2=droit (CDM envoie 0)
if etat=0 then etatAig:=2 else etatAig:=1;
aiguillage[adr].position:=etatAig;
aiguillageB[adr].position:=etatAig;
Event_Aig(adr);
Tempo_chgt_feux:=10; // demander la mise à jour des feux Tempo_chgt_feux:=10; // demander la mise à jour des feux
//Affiche('Aiguillage '+intToSTR(adr)+'='+IntToStr(etatAig),clYellow);
//Affiche(recuCDM,CLOrange); //Affiche(recuCDM,CLOrange);
//if length(recuCDM)>80 then Affiche(copy(recuCDM,80,length(recuCDM)-80),clOrange); //if length(recuCDM)>80 then Affiche(copy(recuCDM,80,length(recuCDM)-80),clOrange);
end; end;
@@ -6874,7 +7014,7 @@ begin
Affiche('Version 1.3 : Décodeur Unisemaf fonctionnel - Lecture/écriture des CV',clLime); Affiche('Version 1.3 : Décodeur Unisemaf fonctionnel - Lecture/écriture des CV',clLime);
Affiche(' Protocoles variables de l''interface',clLime); Affiche(' Protocoles variables de l''interface',clLime);
Affiche(' Configuration statique modifiable dans menu',clLime); Affiche(' Configuration statique modifiable dans menu',clLime);
Affiche('Version 1.31 : Correction des positions aiguillages triples et TJD',clLime);
end; end;
procedure TFormPrinc.ClientSocketLenzDisconnect(Sender: TObject; procedure TFormPrinc.ClientSocketLenzDisconnect(Sender: TObject;
@@ -6886,25 +7026,29 @@ end;
procedure TFormPrinc.ChronoDetectClick(Sender: TObject); procedure TFormPrinc.ChronoDetectClick(Sender: TObject);
var i,j,etat : integer; var i,j,etat : integer;
s : string; s : string;
trouve : boolean;
begin begin
for i:=1 to N_Event_tick do for i:=1 to N_Event_tick do
begin begin
s:=IntToSTR(i)+' Tick='+IntToSTR(event_det_tick[i].tick)+' Det=';
trouve:=false;
for j:=1 to 1100 do for j:=1 to 1100 do
begin begin
etat:=event_det_tick[i].detecteur[j]; etat:=event_det_tick[i].detecteur[j];
if etat<>-1 then if etat<>-1 then
begin begin
s:=s+IntToSTR(j)+'='+intToSTR(etat); s:=IntToSTR(i)+' Tick='+IntToSTR(event_det_tick[i].tick);
//s:=s+' Train n°'+intTostr(event_det_tick[i].Train); s:=s+' Det='+IntToSTR(j)+'='+intToSTR(etat);
s:=s+' Det suiv='+intTostr(event_det_tick[i].suivant); s:=s+' Det suiv='+intTostr(event_det_tick[i].suivant);
Affiche(s,clyellow);
trouve:=true;
end; end;
end; end;
if trouve then Affiche(s,clyellow);
etat:=event_det_tick[i].aiguillage;
if etat<>-1 then
begin
s:=IntToSTR(i)+' Tick='+IntToSTR(event_det_tick[i].tick);
s:=s+' Aig='+intToSTR(etat)+'='+intToSTR(event_det_tick[i].position);
Affiche(s,clyellow);
end;
end; end;
end; end;
@@ -6922,8 +7066,19 @@ var adr,valeur,erreur : integer;
begin begin
// doc XpressNet page 55 // doc XpressNet page 55
val(EditAdresse.text,adr,erreur); val(EditAdresse.text,adr,erreur);
if (erreur<>0) or (Adr>255) or (Adr<0) then
begin
EditAdresse.Text:='1';
exit;
end;
val(EditVal.Text,valeur,erreur); val(EditVal.Text,valeur,erreur);
if (Adr>255) or (valeur>255) then exit; if (erreur<>0) or (valeur<0) or (valeur>255) then
begin
EditAdresse.text:='1';
exit;
end;
//s:=#$ff+#$fe+#$23+#$1e+Char(adr)+Char(valeur); //CV de 512 à 767 V3.4 //s:=#$ff+#$fe+#$23+#$1e+Char(adr)+Char(valeur); //CV de 512 à 767 V3.4
//s:=#$ff+#$fe+#$23+#$1d+Char(adr)+Char(valeur); //CV de 256 à 511 V3.4 //s:=#$ff+#$fe+#$23+#$1d+Char(adr)+Char(valeur); //CV de 256 à 511 V3.4
s:=#$23+#$16+Char(adr)+Char(valeur); //CV de 1 à 256 s:=#$23+#$16+Char(adr)+Char(valeur); //CV de 1 à 256
@@ -6996,7 +7151,7 @@ begin
Lire_fichier_CV; Lire_fichier_CV;
end; end;
procedure TFormPrinc.LireunaccessoireversunfichierdeCV1Click(Sender: TObject); procedure TFormPrinc.ButtonLitCVClick(Sender: TObject);
var s,sa: string; var s,sa: string;
fte : textfile; fte : textfile;
i,cv,valeur,erreur : integer; i,cv,valeur,erreur : integer;
@@ -7005,66 +7160,56 @@ begin
//s:='C:\Program Files (x86)\Borland\Delphi7\Projects\Signaux_complexes_GL'; //s:='C:\Program Files (x86)\Borland\Delphi7\Projects\Signaux_complexes_GL';
N_Cv:=0; // nombre de CV recus à 0 N_Cv:=0; // nombre de CV recus à 0
sa:=''; sa:='';
//for cv:=1 to 255 do Affiche('Lecture CV',clyellow);
val(EditAdresse.Text,cv,erreur);
if (erreur<>0) or (cv>255) or (cv<0) then
begin begin
cv:=3; EditAdresse.Text:='1';
trace:=true; exit;
//s:=#$ff+#$fe+#$22+#$15+Char(cv); //CV de 1 à 256 (V3.0)
s:=#$22+#$18+Char(cv); //CV de 1 à 255 + 1024 (V3.6)
s:=checksum(s);
// envoi(s); // envoi de la trame et attente Ack, la premiere trame fait passer la centrale en mode programmation (service)
envoi_ss_ack(s);
Tempo(1);
s:=#$21+#$10+Char(cv); // demande d'envoi du résultat du mode service
s:=checksum(s);
//envoi(s);
envoi_ss_ack(s);
Tempo(1);
// attente de la réponse de la centrale
tablo_CV[cv]:=0;
i:=0;
repeat
Tempo(2); // attend 200 ms
inc(i);
// N_cv:=cv;
until (N_cv=cv) or (i>4);
if (i>4) then
begin
Affiche('Erreur attente trop longue CV',clred);
exit;
end;
//tablo_cv[cv]:=123;
sa:=sa+'Cv'+IntToSTR(cv)+'='+IntToSTR(Tablo_cv[cv])+' ';
if cv mod 9=0 then
begin
Affiche(sa,clyellow);sa:='';
end;
end; end;
Affiche(sa,clyellow);sa:=''; //trace:=true;
with FormPrinc.SaveDialog do
s:=#$22+#$15+Char(cv); //CV de 1 à 256 (V3.0)
//s:=#$22+#$18+Char(cv); //CV de 1 à 255 + 1024 (V3.6)
s:=checksum(s);
// envoi de la trame : fait passer la centrale en mode programmation (service)
envoi_ss_ack(s);
// attendre la trame 01 04 05 (env 1s)
succes:=false;i:=0;
repeat
Application.processMessages;
Sleep(100);
inc(i);
until succes or (i>20);
if succes then
begin begin
InitialDir:=s; recu_cv:=false;
title:='Ecrire un nom de fichier dans lequel sauvegarder les CV'; //Affiche('reçu trame succes',clyellow);
DefaultExt:='txt'; s:=#$21+#$10; // demande d'envoi du résultat du mode service
Filter:='Fichiers texte (*.txt)|*.txt|Tous fichiers (*.*)|*.*'; s:=checksum(s);
//envoi(s);
if Execute then envoi_ss_ack(s);
Tempo(1);
// attente de la réponse de la centrale
i:=0;
repeat
Tempo(2); // attend 200 ms
inc(i);
until recu_cv or (i>4);
if (i>4) then
begin begin
s:=FileName; Affiche('Erreur attente trop longue CV',clred);
assignFile(fte,s); exit;
rewrite(fte);
Writeln(fte,'cv valeur');
for cv:=1 to 255 do
begin
s:=IntToSTR(cv)+' '+intToSTR(tablo_CV[cv]);
Writeln(fte,s);
end;
closeFile(fte);
end; end;
end; sa:=sa+'Cv'+IntToSTR(cv)+'='+IntToSTR(Tablo_cv[cv])+' ';
Affiche(sa,clyellow);sa:='';
end
else
Affiche('Pas de réponse de l''interface',clOrange);
end; end;
@@ -7073,25 +7218,6 @@ begin
close; close;
end; end;
procedure TFormPrinc.Button1Click(Sender: TObject);
var s : string;
begin
s:=EditGenli.text; //+#13+#10+#10;
terminal:=true;
if portCommOuvert then
begin
Affiche('Envoi a genli de '+ EditGenli.text,clorange);
envoi_ss_ack(s);
end;
end;
procedure TFormPrinc.Button2Click(Sender: TObject);
begin
if MSCommUSBLenz.CTSHolding=true then Affiche('CTS=1',Clyellow)
else Affiche('CTS=0',clyellow);
end;
procedure TFormPrinc.ConfigClick(Sender: TObject); procedure TFormPrinc.ConfigClick(Sender: TObject);
begin begin
Tformconfig.create(self); Tformconfig.create(self);
@@ -7100,5 +7226,7 @@ begin
end; end;
begin
end. end.
BIN
View File
Binary file not shown.
-8
View File
@@ -46,14 +46,6 @@ object FormSimulation: TFormSimulation
Text = '1' Text = '1'
OnKeyPress = EditIntervalleKeyPress OnKeyPress = EditIntervalleKeyPress
end end
object CheckBoxRapide: TCheckBox
Left = 56
Top = 56
Width = 97
Height = 17
Caption = 'Mode rapide'
TabOrder = 2
end
object OpenDialog: TOpenDialog object OpenDialog: TOpenDialog
Left = 48 Left = 48
Top = 96 Top = 96
+29 -5
View File
@@ -12,7 +12,6 @@ type
OpenDialog: TOpenDialog; OpenDialog: TOpenDialog;
EditIntervalle: TEdit; EditIntervalle: TEdit;
Label1: TLabel; Label1: TLabel;
CheckBoxRapide: TCheckBox;
procedure ButtonChargeClick(Sender: TObject); procedure ButtonChargeClick(Sender: TObject);
procedure FormCreate(Sender: TObject); procedure FormCreate(Sender: TObject);
procedure EditIntervalleKeyPress(Sender: TObject; var Key: Char); procedure EditIntervalleKeyPress(Sender: TObject; var Key: Char);
@@ -49,8 +48,8 @@ begin
index_simule:=1; index_simule:=1;
repeat repeat
readln(fte,s); readln(fte,s);
i:=pos('Tick=',s);
i:=pos('Tick=',s);
if i<>0 then if i<>0 then
begin begin
Delete(s,1,i+4); Delete(s,1,i+4);
@@ -58,6 +57,8 @@ begin
if intervalle<>0 then k:=Index_Simule*Intervalle*10+tick+80 else // démarre dans 8s if intervalle<>0 then k:=Index_Simule*Intervalle*10+tick+80 else // démarre dans 8s
k:=Index_Simule+tick+80 ; k:=Index_Simule+tick+80 ;
Tablo_simule[index_simule].tick:=k; Tablo_simule[index_simule].tick:=k;
// détecteur?
i:=pos('Det=',s); i:=pos('Det=',s);
if i<>0 then if i<>0 then
begin begin
@@ -71,7 +72,7 @@ begin
val(s,k,erreur); val(s,k,erreur);
Tablo_simule[index_simule].etat:=k; Tablo_simule[index_simule].etat:=k;
s:='Tick='+intToSTR(Tablo_simule[index_simule].tick)+ s:=IntToSTR(Index_simule)+' Tick='+intToSTR(Tablo_simule[index_simule].tick)+
' Detecteur='+intToSTR(Tablo_simule[index_simule].detecteur)+ ' Detecteur='+intToSTR(Tablo_simule[index_simule].detecteur)+
'='+intToSTR(Tablo_simule[index_simule].etat); '='+intToSTR(Tablo_simule[index_simule].etat);
Affiche(s,ClLime); Affiche(s,ClLime);
@@ -79,14 +80,37 @@ begin
inc(index_simule); inc(index_simule);
end; end;
end; end;
// aiguillage?
i:=pos('Aig=',s);
if i<>0 then
begin
Delete(s,1,i+3);
val(s,k,erreur);
Tablo_simule[index_simule].aiguillage:=k;
i:=pos('=',s);
if i<>0 then
begin
Delete(s,1,i);
val(s,k,erreur);
Tablo_simule[index_simule].etat:=k;
s:=IntToSTR(Index_simule)+' Tick='+intToSTR(Tablo_simule[index_simule].tick)+
' Aiguillage='+intToSTR(Tablo_simule[index_simule].aiguillage)+
'='+intToSTR(Tablo_simule[index_simule].etat);
Affiche(s,ClLime);
inc(index_simule);
end;
end;
end; end;
sortie:=eof(fte) or (index_simule>199); sortie:=eof(fte) or (index_simule>Max_Simule);
until sortie ; until sortie ;
if index_simule>Max_Simule then Affiche('Tableau maximal atteint',clred);
Affiche('Intervalle='+intToSTR(intervalle),clyellow); Affiche('Intervalle='+intToSTR(intervalle),clyellow);
dec(index_simule); dec(index_simule);
closeFile(fte); closeFile(fte);
FormSimulation.Close; FormSimulation.Close;
end; end;
end; end;
BIN
View File
Binary file not shown.
+420 -15
View File
@@ -1,10 +1,12 @@
object FormTCO: TFormTCO object FormTCO: TFormTCO
Left = 267 Left = 337
Top = 203 Top = 102
Width = 928 Width = 928
Height = 590 Height = 681
VertScrollBar.Visible = False
Caption = 'FormTCO' Caption = 'FormTCO'
Color = clBtnFace Color = clBtnFace
DragMode = dmAutomatic
Font.Charset = DEFAULT_CHARSET Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -11 Font.Height = -11
@@ -12,9 +14,9 @@ object FormTCO: TFormTCO
Font.Style = [] Font.Style = []
KeyPreview = True KeyPreview = True
OldCreateOrder = False OldCreateOrder = False
Position = poDefault
OnActivate = FormActivate OnActivate = FormActivate
OnCreate = FormCreate OnCreate = FormCreate
OnDockOver = FormDockOver
OnKeyDown = FormKeyDown OnKeyDown = FormKeyDown
PixelsPerInch = 96 PixelsPerInch = 96
TextHeight = 13 TextHeight = 13
@@ -65,21 +67,341 @@ object FormTCO: TFormTCO
Height = 13 Height = 13
Caption = 'Label1' Caption = 'Label1'
end end
object Button1: TButton object Label4: TLabel
Left = 320 Left = 24
Top = 16 Top = 480
Width = 75 Width = 175
Height = 25 Height = 25
Caption = 'Button1' Caption = 'Adresse de l'#39#233'l'#233'ment: '
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -21
Font.Name = 'Arial Narrow'
Font.Style = []
ParentFont = False
end
object Label5: TLabel
Left = 24
Top = 512
Width = 150
Height = 25
Caption = 'Type de l'#39#233'l'#233'ment: '
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -21
Font.Name = 'Arial Narrow'
Font.Style = []
ParentFont = False
end
object ImagePalette1: TImage
Left = 440
Top = 480
Width = 41
Height = 41
DragMode = dmAutomatic
OnEndDrag = ImagePalette1EndDrag
OnMouseDown = ImagePalette1MouseDown
end
object ImagePalette2: TImage
Left = 512
Top = 480
Width = 41
Height = 41
DragMode = dmAutomatic
OnEndDrag = ImagePalette2EndDrag
OnMouseDown = ImagePalette2MouseDown
end
object ImagePalette3: TImage
Left = 584
Top = 480
Width = 41
Height = 41
DragMode = dmAutomatic
OnEndDrag = ImagePalette3EndDrag
OnMouseDown = ImagePalette3MouseDown
end
object ImagePalette4: TImage
Left = 656
Top = 480
Width = 41
Height = 41
DragMode = dmAutomatic
OnEndDrag = ImagePalette4EndDrag
OnMouseDown = ImagePalette4MouseDown
end
object ImagePaletteDroit: TImage
Left = 440
Top = 528
Width = 41
Height = 41
DragMode = dmAutomatic
OnEndDrag = ImagePaletteDroitEndDrag
OnMouseDown = ImagePaletteDroitMouseDown
end
object ImageSupG: TImage
Left = 512
Top = 528
Width = 41
Height = 41
DragMode = dmAutomatic
OnEndDrag = ImageSupGEndDrag
OnMouseDown = ImageSupGMouseDown
end
object ImageSupD: TImage
Left = 584
Top = 528
Width = 41
Height = 41
DragMode = dmAutomatic
OnEndDrag = ImageSupDEndDrag
OnMouseDown = ImageSupDMouseDown
end
object ImageInfD: TImage
Left = 656
Top = 528
Width = 41
Height = 41
DragMode = dmAutomatic
OnEndDrag = ImageInfDEndDrag
OnMouseDown = ImageInfDMouseDown
end
object ImageInfG: TImage
Left = 728
Top = 528
Width = 41
Height = 41
DragMode = dmAutomatic
OnEndDrag = ImageInfGEndDrag
OnMouseDown = ImageInfGMouseDown
end
object Label6: TLabel
Left = 424
Top = 488
Width = 9
Height = 19
Caption = '1'
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -16
Font.Name = 'Arial'
Font.Style = [fsBold]
ParentFont = False
end
object Label7: TLabel
Left = 496
Top = 488
Width = 9
Height = 19
Caption = '2'
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -16
Font.Name = 'Arial'
Font.Style = [fsBold]
ParentFont = False
end
object Label8: TLabel
Left = 568
Top = 488
Width = 9
Height = 19
Caption = '3'
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -16
Font.Name = 'Arial'
Font.Style = [fsBold]
ParentFont = False
end
object Label9: TLabel
Left = 640
Top = 488
Width = 9
Height = 19
Caption = '4'
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -16
Font.Name = 'Arial'
Font.Style = [fsBold]
ParentFont = False
end
object Label10: TLabel
Left = 424
Top = 536
Width = 9
Height = 19
Caption = '5'
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -16
Font.Name = 'Arial'
Font.Style = [fsBold]
ParentFont = False
end
object Label11: TLabel
Left = 496
Top = 536
Width = 9
Height = 19
Caption = '6'
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -16
Font.Name = 'Arial'
Font.Style = [fsBold]
ParentFont = False
end
object Label12: TLabel
Left = 568
Top = 536
Width = 9
Height = 19
Caption = '7'
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -16
Font.Name = 'Arial'
Font.Style = [fsBold]
ParentFont = False
end
object Label13: TLabel
Left = 640
Top = 536
Width = 9
Height = 19
Caption = '8'
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -16
Font.Name = 'Arial'
Font.Style = [fsBold]
ParentFont = False
end
object Label14: TLabel
Left = 712
Top = 536
Width = 9
Height = 19
Caption = '9'
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -16
Font.Name = 'Arial'
Font.Style = [fsBold]
ParentFont = False
end
object Label15: TLabel
Left = 24
Top = 544
Width = 158
Height = 25
Caption = 'Image de l'#39#233'l'#233'ment: '
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -21
Font.Name = 'Arial Narrow'
Font.Style = []
ParentFont = False
end
object ImageDiag1: TImage
Left = 440
Top = 576
Width = 41
Height = 41
DragMode = dmAutomatic
OnEndDrag = ImageDiag1EndDrag
OnMouseDown = ImageDiag1MouseDown
end
object Label16: TLabel
Left = 416
Top = 584
Width = 18
Height = 19
Caption = '10'
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -16
Font.Name = 'Arial'
Font.Style = [fsBold]
ParentFont = False
end
object ImageDiag2: TImage
Left = 512
Top = 576
Width = 41
Height = 41
DragMode = dmAutomatic
OnEndDrag = ImageDiag2EndDrag
OnMouseDown = ImageDiag2MouseDown
end
object Label17: TLabel
Left = 488
Top = 584
Width = 17
Height = 19
Caption = '11'
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -16
Font.Name = 'Arial'
Font.Style = [fsBold]
ParentFont = False
end
object EditAdrElement: TEdit
Left = 200
Top = 480
Width = 89
Height = 33
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -21
Font.Name = 'Arial Narrow'
Font.Style = []
ParentFont = False
TabOrder = 1
OnChange = EditAdrElementChange
end
object EditTypeElement: TEdit
Left = 200
Top = 512
Width = 89
Height = 33
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -21
Font.Name = 'Arial Narrow'
Font.Style = []
ParentFont = False
ReadOnly = True
TabOrder = 0 TabOrder = 0
OnClick = Button1Click Text = 'EditTypeElement'
end
object ButtonSauveTCO: TButton
Left = 784
Top = 480
Width = 91
Height = 33
Caption = 'Sauvegarder TCO'
TabOrder = 2
WordWrap = True
OnClick = ButtonSauveTCOClick
end
object ButtonRedessine: TButton
Left = 784
Top = 520
Width = 89
Height = 33
Caption = 'Redessine'
TabOrder = 3
OnClick = ButtonRedessineClick
end end
object ScrollBox: TScrollBox object ScrollBox: TScrollBox
Left = 16 Left = 16
Top = 40 Top = 40
Width = 865 Width = 865
Height = 433 Height = 433
TabOrder = 1 TabOrder = 4
object ImageTCO: TImage object ImageTCO: TImage
Left = 0 Left = 0
Top = 0 Top = 0
@@ -88,13 +410,59 @@ object FormTCO: TFormTCO
PopupMenu = PopupMenu1 PopupMenu = PopupMenu1
OnClick = ImageTCOClick OnClick = ImageTCOClick
OnContextPopup = ImageTCOContextPopup OnContextPopup = ImageTCOContextPopup
OnDragOver = ImageTCODragOver
OnMouseDown = ImageTCOMouseDown
OnMouseMove = ImageTCOMouseMove
OnMouseUp = ImageTCOMouseUp
end end
end end
object EditTypeImage: TEdit
Left = 200
Top = 552
Width = 89
Height = 33
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -21
Font.Name = 'Arial Narrow'
Font.Style = []
ParentFont = False
TabOrder = 5
Text = 'EditTypeImage'
OnKeyPress = EditTypeImageKeyPress
end
object Button1: TButton
Left = 784
Top = 560
Width = 89
Height = 25
Caption = 'Simu det 1'
TabOrder = 6
OnClick = Button1Click
end
object Button2: TButton
Left = 320
Top = 520
Width = 75
Height = 25
Caption = 'Simu Det 0'
TabOrder = 7
OnClick = Button2Click
end
object PopupMenu1: TPopupMenu object PopupMenu1: TPopupMenu
Left = 568 Left = 352
Top = 296 Top = 472
object Position1: TMenuItem object MenuCouper: TMenuItem
Caption = 'Position' Caption = 'Couper'
OnClick = MenuCouperClick
end
object MenuCopier: TMenuItem
Caption = 'Copier'
OnClick = MenuCopierClick
end
object MenuColler: TMenuItem
Caption = 'Coller'
OnClick = MenuCollerClick
end end
object N1: TMenuItem object N1: TMenuItem
Caption = '-' Caption = '-'
@@ -109,6 +477,43 @@ object FormTCO: TFormTCO
Caption = 'Aiguillage droit ; pointe '#224' droite' Caption = 'Aiguillage droit ; pointe '#224' droite'
OnClick = aiguillageD_PDClick OnClick = aiguillageD_PDClick
end end
object N2: TMenuItem
Caption = '-'
end
object Aiguillagegauchepointedroite1: TMenuItem
Caption = 'Aiguillage gauche ; pointe '#224' droite'
OnClick = Aiguillagegauchepointedroite1Click
end
object Aiguillagedroitpointegauche1: TMenuItem
Caption = 'Aiguillage droit : pointe '#224' gauche'
OnClick = Aiguillagedroitpointegauche1Click
end
object N3: TMenuItem
Caption = '-'
end
object Elmentdroit1: TMenuItem
Caption = 'El'#233'ment droit'
OnClick = Elmentdroit1Click
end
object N4: TMenuItem
Caption = '-'
end
object Courbegaucheversdroite1: TMenuItem
Caption = 'Courbe infD'
OnClick = Courbegaucheversdroite1Click
end
object Courbedroiteversgauche1: TMenuItem
Caption = 'Courbe infG'
OnClick = Courbedroiteversgauche1Click
end
object CourbeSupD1: TMenuItem
Caption = 'Courbe SupD'
OnClick = CourbeSupD1Click
end
object CourbeSupG1: TMenuItem
Caption = 'Courbe SupG'
OnClick = CourbeSupG1Click
end
end end
end end
end end
+1274 -134
View File
File diff suppressed because it is too large Load Diff
-112
View File
@@ -1,112 +0,0 @@
/******************************************
/ fichier de configuration de signaux complexes
/ cap de bouheyre avec signaux - 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
/
/ 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
/ 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
/ 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
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
/ @ 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
/
/ 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
0
/
/ liste des signaux
/ 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)
/ 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
0
+12
View File
@@ -0,0 +1,12 @@
/type(0=rien 1=voie/détecteur 2=aig 3=aigBis , adresse , image=1 à 10
/Dalle TCO
(2,123,1)(2,100,1)(1,513,5)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)
(2,124,2)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)
(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,8)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)
(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,9)(1,000,5)(2,000,1)(1,000,5)(0,000,8)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)
(2,007,0)(1,520,0)(2,020,0)(2,021,0)(2,028,0)(2,026,0)(0,000,10)(2,027,0)(2,025,0)(2,031,0)(1,534,0)(2,023,0)(0,000,11)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)
(0,000,0)(0,000,0)(0,000,0)(0,000,0)(1,000,5)(2,000,3)(1,000,5)(1,000,5)(1,000,5)(1,000,5)(1,000,5)(1,000,5)(1,000,5)(2,000,1)(1,000,5)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)
(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)
(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)
(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)
(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)(0,000,0)
BIN
View File
Binary file not shown.
+3 -2
View File
@@ -22,7 +22,7 @@ var
FormVersion: TFormVersion; FormVersion: TFormVersion;
Lance_verif : integer; Lance_verif : integer;
Const Version='1.3'; //Version='1.2';// sert à la comparaison de la version publiée Const Version='1.31'; //Version='1.2';// sert à la comparaison de la version publiée
implementation implementation
@@ -105,7 +105,8 @@ var s,s2,s3,Version_p,Url,LocalFile : string;
V_publie,V_utile : real; V_publie,V_utile : real;
begin begin
//Affiche('vérifie version',clLime); //Affiche('vérifie version',clLime);
Url:='http://cdmrail.free.fr/ForumCDR/viewtopic.php?f=77&t=3906#p50499'; // exit ;//&&&&&&&&&&&&&&&&&&
Url:='http://cdmrail.free.fr/ForumCDR/viewtopic.php?f=77&t=3906#p50499';
LocalFile:='page.txt'; LocalFile:='page.txt';
trouve_version:=false; trouve_version:=false;
trouve_zip:=false; trouve_zip:=false;
+13
View File
@@ -0,0 +1,13 @@
Version 1.0 : première version
Version 1.01 : gestion des trajectoires vers les buttoirs
Version 1.02 : vérification automatique des versions
Version 1.1 : gestion des tableaux indicateurs de direction
gestion du décodeur de signaux Unisemaf Paco (expérimental)
changement dynamique des feux en cliquant sur son image
Version 1.11 : compatibilité pour la rétrosignalisation XpressNet tiers (genli)
verrouillages routes pour trains consécutifs
Version 1.2 : Renforcement de l'algorithme de suivi des trains
Version 1.3 : Décodeur Unisemaf fonctionnel - Lecture/écriture des CV
Protocoles variables de l'interface
Configuration statique modifiable dans menu
Version 1.31 : Correction gestion aiguillage triple