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

View File

@@ -95,7 +95,7 @@ UnitOutputDir=
PackageDLLOutputDir=
PackageDCPOutputDir=
SearchPath=
Packages=
Packages=vcl;rtl;vclx;VclSmp;vclshlctrls
Conditionals=
DebugSourceDirs=
UsePackages=0

Binary file not shown.

Binary file not shown.

View File

@@ -1,6 +1,6 @@
object FormDebug: TFormDebug
Left = 302
Top = 166
Left = 286
Top = 39
BorderStyle = bsSingle
Caption = 'Fen'#234'tre de d'#233'bug'
ClientHeight = 639
@@ -98,7 +98,7 @@ object FormDebug: TFormDebug
end
object ButtonEcrLog: TButton
Left = 448
Top = 560
Top = 504
Width = 97
Height = 29
Caption = 'Sauvegarder le log'
@@ -131,8 +131,8 @@ object FormDebug: TFormDebug
OnClick = CheckAffSigClick
end
object ButtonRazTampon: TButton
Left = 448
Top = 520
Left = 688
Top = 592
Width = 97
Height = 33
Caption = 'Raz Tampon Ev'#232'nements'
@@ -142,7 +142,7 @@ object FormDebug: TFormDebug
end
object ButtonCherche: TButton
Left = 448
Top = 480
Top = 464
Width = 97
Height = 33
Caption = 'Chercher erreurs'
@@ -151,10 +151,10 @@ object FormDebug: TFormDebug
end
object ButtonAffEvtChrono: TButton
Left = 448
Top = 440
Top = 424
Width = 97
Height = 33
Caption = 'Affiche Evts chrono d'#233'tecteurs'
Caption = 'Affiche Evts d'#233'tecteurs et aig'
TabOrder = 7
WordWrap = True
OnClick = ButtonAffEvtChronoClick
@@ -207,7 +207,7 @@ object FormDebug: TFormDebug
end
object ButtonCop: TButton
Left = 448
Top = 384
Top = 368
Width = 97
Height = 49
Caption = 'Copie fen'#234'te principale dans debug'
@@ -221,11 +221,29 @@ object FormDebug: TFormDebug
Width = 225
Height = 241
HideScrollBars = False
PopupMenu = PopupMenuRE
ScrollBars = ssVertical
TabOrder = 12
end
object ButtonRazLog: TButton
Left = 448
Top = 544
Width = 97
Height = 25
Caption = 'Raz Tampon Log'
TabOrder = 13
OnClick = ButtonRazLogClick
end
object SaveDialog: TSaveDialog
Left = 680
Top = 8
end
object PopupMenuRE: TPopupMenu
Left = 752
Top = 16
object copier1: TMenuItem
Caption = 'copier'
OnClick = copier1Click
end
end
end

View File

@@ -4,7 +4,7 @@ interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls , ComCtrls;
Dialogs, StdCtrls , ComCtrls, Menus;
type
TFormDebug = class(TForm)
@@ -25,6 +25,9 @@ type
CheckTrame: TCheckBox;
ButtonCop: TButton;
RichEdit: TRichEdit;
PopupMenuRE: TPopupMenu;
copier1: TMenuItem;
ButtonRazLog: TButton;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormCreate(Sender: TObject);
procedure ButtonEcrLogClick(Sender: TObject);
@@ -37,6 +40,8 @@ type
procedure CheckBoxTraceLIsteClick(Sender: TObject);
procedure CheckTrameClick(Sender: TObject);
procedure ButtonCopClick(Sender: TObject);
procedure copier1Click(Sender: TObject);
procedure ButtonRazLogClick(Sender: TObject);
private
{ Déclarations privées }
public
@@ -44,7 +49,7 @@ type
end;
Const Max_Event_det_tick = 10000;
var
FormDebug: TFormDebug;
NivDebug : integer;
@@ -54,11 +59,12 @@ var
// tick 1/10s,détecteur
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
record
tick : longint;
detecteur : array[1..1100] of integer; // état du détecteur [...]
Aiguillage,position : integer ;
//train : integer ;
suivant : integer ; // d'ou vient le train
traite : boolean; // traité lors de a recherche d'une route
@@ -198,18 +204,26 @@ 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;
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;
if trouve then AfficheDebug(s,clyellow);
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.

Binary file not shown.

View File

@@ -1,6 +1,6 @@
object FormPrinc: TFormPrinc
Left = 47
Top = 193
Left = 64
Top = 170
AutoSize = True
BorderStyle = bsSingle
Caption = 'Client TCP-IP CDM Rail ou USB - syst'#232'me LENZ'
@@ -597,7 +597,7 @@ object FormPrinc: TFormPrinc
Visible = False
end
object Image3feux: TImage
Left = 616
Left = 600
Top = 8
Width = 33
Height = 57
@@ -1200,14 +1200,14 @@ object FormPrinc: TFormPrinc
end
object Label1: TLabel
Left = 656
Top = 116
Top = 148
Width = 89
Height = 13
Caption = 'Nombre de trains : '
end
object LabelNbTrains: TLabel
Left = 760
Top = 112
Top = 144
Width = 9
Height = 19
Caption = '0'
@@ -1255,9 +1255,9 @@ object FormPrinc: TFormPrinc
end
object ScrollBox1: TScrollBox
Left = 648
Top = 136
Top = 168
Width = 537
Height = 437
Height = 405
Color = clWhite
ParentColor = False
TabOrder = 3
@@ -1266,7 +1266,7 @@ object FormPrinc: TFormPrinc
Left = 656
Top = 8
Width = 249
Height = 97
Height = 129
Caption = 'Commande d'#39'accessoires'
TabOrder = 4
object Label2: TLabel
@@ -1295,7 +1295,7 @@ object FormPrinc: TFormPrinc
Top = 32
Width = 57
Height = 21
Hint = 'Adresse accessoire'
Hint = 'Adresse accessoire ou de CV'
TabOrder = 0
Text = '1'
end
@@ -1331,6 +1331,17 @@ object FormPrinc: TFormPrinc
WordWrap = True
OnClick = ButtonEcrCVClick
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
object ButtonTest: TButton
Left = 912
@@ -1399,33 +1410,14 @@ object FormPrinc: TFormPrinc
TabOrder = 11
OnClick = ButtonRepriseClick
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
Left = 992
Top = 96
Width = 97
Height = 25
Caption = 'Demande '#233'tat CTS'
TabOrder = 14
TabOrder = 12
Visible = False
OnClick = Button2Click
end
object Timer1: TTimer
Interval = 100
@@ -1454,7 +1446,7 @@ object FormPrinc: TFormPrinc
OnClick = AffEtatDetecteurs
end
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'
OnClick = ChronoDetectClick
end
@@ -1547,13 +1539,6 @@ object FormPrinc: TFormPrinc
' sur la voie de programmation'
OnClick = LireunfichierdeCV1Click
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
object ClientSocketCDM: TClientSocket

View File

@@ -78,16 +78,14 @@ type
OpenDialog: TOpenDialog;
N1: TMenuItem;
LireunfichierdeCV1: TMenuItem;
LireunaccessoireversunfichierdeCV1: TMenuItem;
SaveDialog: TSaveDialog;
N5: TMenuItem;
Quitter1: TMenuItem;
EditGenli: TEdit;
Button1: TButton;
Button2: TButton;
Config: TMenuItem;
Label1: TLabel;
LabelNbTrains: TLabel;
ButtonLitCV: TButton;
procedure FormCreate(Sender: TObject);
procedure MSCommUSBLenzComm(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
@@ -134,11 +132,9 @@ type
procedure ButtonEcrCVClick(Sender: TObject);
procedure ButtonRepriseClick(Sender: TObject);
procedure LireunfichierdeCV1Click(Sender: TObject);
procedure LireunaccessoireversunfichierdeCV1Click(Sender: TObject);
procedure Quitter1Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure ConfigClick(Sender: TObject);
procedure ButtonLitCVClick(Sender: TObject);
private
{ Déclarations privées }
@@ -156,7 +152,10 @@ tempoFeu = 100;
MaxAcc = 2048;
LargImg=50;HtImg=91;
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;
@@ -171,7 +170,7 @@ type TBranche = record
Taiguillage = record
modele : integer; // 0=n'existe pas 1=aiguillage 2=TJD 3=TJS 4=aiguillage triple
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)
inversion : integer; // pilotage inversé 0=normal 1=inversé
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;
AvecInitAiguillages,tempsCli,combine,NbreFeux,pasreponse,AdrDevie,precedent ,
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,
NackCDM,MsgSim : boolean;
NackCDM,MsgSim,succes,recu_cv,
TraceListe,clignotant,nack,Maj_feux_cours : boolean;
branche : array [1..100] of string;
@@ -219,8 +218,9 @@ const
GrisF=$414141;
clOrange=$0077FF;
Feu_X=50;Feu_Y=91;
Max_Simule=1000;
couleurTrain : array[1..8] of Tcolor = (clYellow,clLime,clOrange,clAqua,clFuchsia,clLtGray,clred,clWhite);
var
FormPrinc: TFormPrinc;
ack,portCommOuvert,trace,AffMem,AfficheDet,CDM_connecte,parSocketCDM,
@@ -240,11 +240,12 @@ var
route : array[1..2000] of record
Mem1,Mem2 : integer;
end;
end;
Tablo_Simule : array[0..200] of
end;
Tablo_Simule : array[0..Max_Simule] of
record
tick : longint;
Detecteur,etat : integer ;
Detecteur,Aiguillage,etat : integer ;
end;
Route : array[1..2000] of record
Mem1,Mem2 : integer;
@@ -3719,6 +3720,8 @@ begin
suivant_alg3:=9999;exit;
end;
indexBranche_actuel:=IndexBranche_trouve;
branche_trouve_actuel:=branche_trouve;
Adr:=actuel;
Btype:=BrancheN[branche_trouve_actuel,indexBranche_actuel].Btype;
@@ -3967,10 +3970,11 @@ begin
trouve_element(adr,TypeEl); // branche_trouve IndexBranche_trouve
typeGen:=BrancheN[branche_trouve,IndexBranche_trouve].Btype;
suivant_alg3:=adr;
exit;
exit;
end;
end;
if (aiguillage[Adr].modele=2) or (aiguillage[Adr].modele=3) then // TJD ou TJS
begin
// récupérer les élements de la TJD/S
AdrTjdP:=aiguillage[Adr].Apointe; // 2eme adresse de la TJD/S
@@ -4122,43 +4126,108 @@ begin
Abis:=aiguillage[AdrTjdP].AdevieBis;
if A='Z' then typeGen:=1 else typeGen:=2; //TypeEL=(1=détécteur 2=aig 3=aig Bis)
if Abis=1 then typeGen:=3;
suivant_alg3:=adr;exit;
end;
Affiche('139 - Erreur fatale - Aucun cas TJD/S : adr='+IntToSTR(Adr)+' '+intToSTR(AdrTJDP)+' prec='+IntTOSTR(prec),clred);
Affiche('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;
end;
if (aiguillage[Adr].modele=4) then // aiguillage triple
begin
// aiguillage triple pris en pointe
Adr2:=aiguillage[Adr].AdrTriple;
// attention la lecture d'un aiguillage triple est différente suivant la connexion avec CDM
// ou avec l'interface
if ( CDM_connecte and (aiguillage[Adr].position=const_droit) ) or
( not(CDM_connecte) and (aiguillage[Adr].position=const_droit) and (aiguillage[Adr2].position=const_droit) ) then
begin
if NivDebug=3 then AfficheDebug('Aiguillage triple droit',clYellow);
typeGen:=aiguillage[Adr].AdroitBis+1;
//TSuiv=aiguillage[Adr].AdroitB;
Adr:=aiguillage[Adr].Adroit;
end;
if ( CDM_connecte and (aiguillage[Adr].position=const_devieG) ) or
( not(CDM_connecte) and (aiguillage[Adr].position<>const_droit) and (aiguillage[Adr2].position=const_droit) ) then
begin
if NivDebug=3 then AfficheDebug('Aiguillage triple dévié1 (gauche)',clYellow);
typeGen:=aiguillage[Adr].AdevieBis+1;
//TSuiv=aiguillage[Adr].AdevieB;
Adr:=aiguillage[Adr].Adevie;
end;
if ( CDM_connecte and (aiguillage[Adr].position=const_devieG) ) or
( not(CDM_connecte) and (aiguillage[Adr].position=const_droit) and (aiguillage[Adr2].position<>const_droit) ) then
begin
if NivDebug=3 then AfficheDebug('Aiguillage triple dévié2 (droit)',clYellow);
typeGen:=aiguillage[Adr].Adevie2Bis+1;
//TSuiv=aiguillage[Adr].Adevie2B;
Adr:=aiguillage[Adr].Adevie2;
end;
if ((aiguillage[Adr].position<>const_droit) and (aiguillage[Adr2].position<>const_droit) ) then
AfficheDebug('139 - Erreur fatale - Aucun cas TJD/S : adr='+IntToSTR(Adr)+' '+intToSTR(AdrTJDP)+' prec='+IntTOSTR(prec),clred);
suivant_alg3:=9999;exit;
end;
if (aiguillage[Adr].modele=4) then // aiguillage triple
begin
Adr2:=aiguillage[Adr].AdrTriple;
if (aiguillage[adr].Apointe=prec) then
begin
// aiguillage triple pris en pointe
//Affiche('position='+intToSTR(aiguillage[Adr].position),clyellow);
if (aiguillage[Adr].position=const_droit) and (aiguillage[Adr2].position=const_droit) then
begin
if NivDebug=3 then AfficheDebug('Aiguillage triple pris en pointe droit',clYellow);
typeGen:=aiguillage[Adr].AdroitBis+1;
A:=aiguillage[Adr].AdroitB;
Adr:=aiguillage[Adr].Adroit;
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;
if (aiguillage[Adr].position<>const_droit) and (aiguillage[Adr2].position=const_droit) then
begin
if NivDebug=3 then AfficheDebug('Aiguillage triple dévié1 (à gauche)',clYellow);
typeGen:=aiguillage[Adr].AdevieBis+1;
A:=aiguillage[Adr].AdevieB;
Adr:=aiguillage[Adr].Adevie;
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;
if (aiguillage[Adr].position=const_droit) and (aiguillage[Adr2].position<>const_droit) then
begin
if NivDebug=3 then AfficheDebug('Aiguillage triple dévié2 (à droite)',clYellow);
typeGen:=aiguillage[Adr].Adevie2Bis+1;
A:=aiguillage[Adr].Adevie2B;
Adr:=aiguillage[Adr].Adevie2;
if A='Z' then TypeEl:=1 else TypeEL:=2; //TypeEL=(1=détécteur 2=aig 3=aig Bis)
if Abis=1 then TypeEl:=3;
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
@@ -5122,8 +5191,6 @@ begin
Signal_direction(AdrFeu);
exit;
end;
etat:=etat_signal_suivant(AdrFeu,1) ; // état du signal suivant + adresse du signal suivant dans Signal_Suivant
etat:=etat_signal_suivant(AdrFeu,1) ; // état du signal suivant + adresse du signal suivant dans Signal_Suivant
@@ -5508,7 +5575,7 @@ begin
end;
if Traceliste then AfficheDebug('--------------------- détecteur '+intToSTR(Adresse)+' à '+intToSTR(etat01)+'-----------------------------',clOrange);
//if etat then Mem[Adresse]:=true; // mémoriser l'état à 1
ancien_detecteur[Adresse]:=detecteur[Adresse];
@@ -5517,7 +5584,7 @@ begin
// mise a jour du tableau evt de fronts descendants
if ancien_detecteur[Adresse] and not(detecteur[Adresse]) and (N_Event_det<20) then
begin
begin
//Affiche('front descendant',clyellow);
inc(N_event_det);
event_det[N_event_det]:=Adresse;
@@ -5529,6 +5596,12 @@ begin
begin
inc(N_Event_tick);
// event_det_tick[N_event_tick].train:=0;
event_det_tick[N_event_tick].tick:=tick;
event_det_tick[N_event_tick].detecteur[Adresse]:=etat01;
// Affiche('stockage de '+intToSTR(N_event_tick)+' à '+intToSTR(etat01),clyellow);
end;
// Mettre à jour le TCO
if AvecTCO then
begin
@@ -5564,11 +5637,16 @@ begin
afficheDebug(s,clyellow);
end;
event_det_tick[N_event_tick].train:=N_trains;
end;
end;
}
end;
end;
end;
}
end;
// évènement d'aiguillage
procedure Event_Aig(adresse,pos : 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].aiguillage:=adresse;
@@ -5706,25 +5784,25 @@ begin
end;
// état de l'aiguillage
if bitsITT=$00 then // module d'aiguillages, N=1
if bitsITT=$00 then // module d'aiguillages, N=1
begin
adraig:=((adresse * 4)+1 ); // *4 car N=1, c'est le "poids fort"
if (valeur and $C)=$8 then
begin
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;
end;
if (valeur and $C)=$4 then
begin
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;
end;
if (valeur and $3)=$2 then
begin
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;
end;
if (valeur and $3)=$1 then
@@ -5766,25 +5844,25 @@ begin
end;
end;
if bitsITT=$00 then // module d'aiguillages
if bitsITT=$00 then // module d'aiguillages
begin
adraig:=(adresse * 4)+1;
if (valeur and $C)=$8 then
begin
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;
end;
if (valeur and $C)=$4 then
begin
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;
end;
if (valeur and $3)=$2 then
begin
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;
end;
if (valeur and $3)=$1 then
@@ -5855,7 +5933,7 @@ end;
end;
end;
end;
Xdecode_chaine_retro:=chaineint;
Xdecode_chaine_retro:=chaineint;
end;
// décodage d'une chaine simple de la rétrosignalisation
@@ -5867,7 +5945,7 @@ begin
msg:='';
ack:=true;nack:=false;
// décodage du 3eme octet de la chaîne
if chaineINT[1]=#1 then
if chaineINT[1]=#1 then
begin
case chaineINT[2] of // page 13 doc XpressNet
#1 : begin nack:=true;msg:='erreur timout transmission';end;
@@ -5909,17 +5987,19 @@ begin
end;
if nack then affiche(msg,clred) else affiche(msg,clyellow);
delete(chaineINT,1,2);
decode_chaine_retro:=chaineINT;
decode_chaine_retro:=chaineINT;
exit;
end;
if ((chaineINT[1]=#$63) and (chaineINT[2]=#$14)) then // V3.6 uniquement
begin
if ((chaineINT[1]=#$63) and (chaineINT[2]=#$14)) then // V3.6 uniquement
begin
// réception d'un CV. DocXpressNet p26 63 14 01 03 chk
delete(chaineInt,1,2);
delete(chaineInt,1,2);
cvLoc:=ord(chaineINT[1]);
//Affiche('Réception CV'+IntToSTR(cvLoc)+' à '+IntToSTR(ord(chaineINT[2])),clyellow);
if cvLoc>255 then Affiche('Erreur Recu CV>255',clRed)
else
begin
tablo_cv[cvLoc]:=ord(chaineINT[2]);
inc(N_Cv); // nombre de CV recus
@@ -6067,7 +6147,7 @@ begin
{$J-}
procedure connecte_USB;
begin
begin
// initialisation de la comm USB
if NumPort<>0 then
begin
@@ -6168,8 +6248,8 @@ begin
// lecture fichier de configuration config.cfg
lit_config;
// TCO
if avectco then
// TCO
if avectco then
begin
//créée la fenêtre TCO
FormTCO:=TformTCO.Create(Self);
@@ -6203,14 +6283,14 @@ begin
end
end;
end;
if portCommOuvert or parsocket then
With Formprinc do
begin
ButtonEcrCV.Enabled:=true;
LireunfichierdeCV1.enabled:=true;
ButtonLitCV.Enabled:=true;
end
end
else
With Formprinc do
begin
@@ -6226,6 +6306,7 @@ begin
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
// initialisation de la chronologie des évènements détecteurs
@@ -6236,14 +6317,13 @@ begin
event_det_tick[i].detecteur[j]:=-1; // initialiser les détecteurs à -1
event_det_tick[i].traite:=false ; // non traité
end;
I_Simule:=0;
tick:=0;
N_Event_tick:=0 ; // dernier index
NombreImages:=0;
// énumération des ports USB
// énumération des ports USB
//EnumerateDevices;
//for i:=1 to NumLine do
@@ -6253,11 +6333,10 @@ begin
//essai
// event_det[1]:=527;
// event_det[2]:=520;
// N_event_det:=2;
//aiguillage[20].Position:=const_droit+1;
//aiguillage[12].Position:=const_droit+1;
//traceDet:=true;
// N_event_det:=2;
//aiguillage[20].Position:=const_droit+1;
//aiguillage[12].Position:=const_droit+1;
//traceDet:=true;
// calcul_zones;
//maj_feu(201);
// formdebug.Show;
@@ -6275,10 +6354,8 @@ begin
//i:=Aiguille_deviee(176);
//signal_direction(372);
//FormDebug.show;
//NivDebug:=3;
//NivDebug:=3;
//test_memoire_zones(218);
//Affiche(' Adj1='+intToStr(Adj1)+' Adj2='+intToStr(Adj2),clyellow);
//Det_Adj(520);
//Affiche(' Adj1='+intToStr(Adj1)+' Adj2='+intToStr(Adj2),clyellow);
//trace:=true;
@@ -6408,14 +6485,25 @@ begin
TpsRecuCom:=6;
end;
if (not(Maj_feux_cours) and (Tempo_chgt_feux=1)) then Maj_feux(); // mise à jour des feux sur chgt aiguillage
if (not(Maj_feux_cours) and (Tempo_chgt_feux=1)) then Maj_feux(); // mise à jour des feux sur chgt aiguillage
if (not(Maj_feux_cours) and (Tempo_chgt_feux>0)) then dec(Tempo_chgt_feux);
//simulation
if index_simule<>0 then
begin
if index_simule<>0 then
begin
if not(MsgSim) then begin Affiche('Simulation en cours ',Cyan);MsgSim:=true;end;
while tick=Tablo_simule[i_simule+1].tick do
begin
inc(I_simule);
// evt 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);
@@ -6441,7 +6529,19 @@ procedure TFormPrinc.ButtonCommandeClick(Sender: TObject);
s:=checksum(s);
envoi(s);
end;
// bouton de commande d'un accessoire
procedure TFormPrinc.ButtonCommandeClick(Sender: TObject);
var adr,valeur,erreur : integer;
begin
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);
if (erreur<>0) or (valeur<0) or (valeur>255) then
begin
EditVal.text:='1';
@@ -6595,7 +6695,6 @@ begin
Hors_tension2:=false;
end;
end;
procedure TFormPrinc.MenuDeconnecterEthernetClick(Sender: TObject);
begin
@@ -6603,8 +6702,6 @@ begin
end;
function cde_cdm(s : string) : string;
var i : integer;
begin
var i : integer;
begin
i:=length(s)-1;
@@ -6626,16 +6723,23 @@ begin
s:='Dét '+intToSTR(Adresse_detecteur[j])+'=';
if Detecteur[adresse_detecteur[j]] then s:=s+'1' else s:=s+'0';
s:=s+' Mem=';
if Mem[adresse_detecteur[j]] then s:=s+'1' else s:=s+'0';
if Mem[adresse_detecteur[j]] then s:=s+'1' else s:=s+'0';
Affiche(s,clYellow);
end;
end;
procedure TFormPrinc.Etatdesaiguillages1Click(Sender: TObject);
var i : integer;
var i,j,model : integer;
s : string;
begin
Affiche('les positions des aiguillages BIS sont les mêmes que leurs homologues non bis',Cyan);
for i:=1 to MaxAcc do
begin
model:=aiguillage[i].modele ;
if model<>0 then
begin
s:='Aiguillage '+IntToSTR(i)+' : '+intToSTR(aiguillage[i].position);
if aiguillage[i].position=1 then s:=s+' (dévié)' else s:=s+' (droit)';
if model=4 then
begin
j:=aiguillage[i].AdrTriple;
@@ -6696,8 +6800,8 @@ begin
end;
procedure TFormPrinc.ClientSocketLenzConnect(Sender: TObject;Socket: TCustomWinSocket);
begin
begin
Affiche('Lenz connecté ',clYellow);
AfficheDebug('Lenz connecté ',clYellow);
parSocket:=True;
@@ -6717,7 +6821,7 @@ end;
parSocketCDM:=True;
MenuConnecterUSB.enabled:=false;
DeConnecterUSB.enabled:=false;
ConnecterCDMRail.enabled:=false;
ConnecterCDMRail.enabled:=false;
end;
@@ -6756,14 +6860,50 @@ begin
if i+5-j>0 then begin Delete(recuCDM,j,i+5-j) ;end else
begin
Affiche('Erreur 95',clred);
Affiche('j='+IntToSTR(j)+' i='+intToSTR(i),clred);
Nbre_recu_cdm:=0;
Affiche(recuCDM,clred);
exit;
end;
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;
Nbre_recu_cdm:=0;
Affiche(recuCDM,clred);
exit;
end;
val(ss,etat,erreur);
if etat=2 then etatAig2:=1;
// conversion en position : 1=dévié (CDM envoie 2 ou 1) 2=droit (CDM envoie 0)
aiguillage[adr2].Position:=etatAig2;
Event_Aig(adr,etatAig);
Event_Aig(adr2,etatAig2);
end;
@@ -6874,7 +7014,7 @@ begin
Affiche('Version 1.1 : gestion des tableaux indicateurs de direction',clLime);
Affiche(' gestion du décodeur de signaux Unisemaf Paco (expérimental)',clLime);
Affiche(' changement dynamique des feux en cliquant sur son image',clLime);
Affiche('Version 1.11 : compatibilité pour la rétrosignalisation non XpressNet (intellibox)',clLime);
Affiche('Version 1.11 : compatibilité pour la rétrosignalisation non XpressNet (intellibox)',clLime);
Affiche(' verrouillages routes pour trains consécutifs',clLime);
Affiche('Version 1.2 : Renforcement de l''algorithme de suivi des trains',clLime);
Affiche('Version 1.3 : Décodeur Unisemaf fonctionnel - Lecture/écriture des CV',clLime);
@@ -6886,25 +7026,29 @@ end;
procedure TFormPrinc.ClientSocketLenzDisconnect(Sender: TObject;
Socket: TCustomWinSocket);
begin
parSocket:=False;
parSocket:=False;
end;
var i,j,etat : integer;
s : string;
procedure TFormPrinc.ChronoDetectClick(Sender: TObject);
var i,j,etat : integer;
s : string;
begin
for i:=1 to N_Event_tick do
begin
trouve:=false;
for j:=1 to 1100 do
for j:=1 to 1100 do
begin
etat:=event_det_tick[i].detecteur[j];
if etat<>-1 then
etat:=event_det_tick[i].detecteur[j];
if etat<>-1 then
begin
//s:=s+' Train n°'+intTostr(event_det_tick[i].Train);
s:=IntToSTR(i)+' Tick='+IntToSTR(event_det_tick[i].tick);
s:=s+' Det='+IntToSTR(j)+'='+intToSTR(etat);
s:=s+' Det suiv='+intTostr(event_det_tick[i].suivant);
Affiche(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);
@@ -6922,8 +7066,19 @@ var adr,valeur,erreur : integer;
//TraceListe:=true;
end;
procedure TFormPrinc.ButtonEcrCVClick(Sender: TObject);
var adr,valeur,erreur : integer;
s : string;
begin
// doc XpressNet page 55
val(EditAdresse.text,adr,erreur);
if (erreur<>0) or (Adr>255) or (Adr<0) then
var adr,valeur,erreur : integer;
begin
EditAdresse.Text:='1';
exit;
end;
val(EditVal.Text,valeur,erreur);
if (erreur<>0) or (valeur<0) or (valeur>255) then
begin
EditAdresse.text:='1';
@@ -6996,7 +7151,7 @@ begin
end;
end;
procedure TFormPrinc.LireunfichierdeCV1Click(Sender: TObject);
begin
Lire_fichier_CV;
@@ -7005,66 +7160,56 @@ begin
procedure TFormPrinc.ButtonLitCVClick(Sender: TObject);
var s,sa: string;
fte : textfile;
i,cv,valeur,erreur : integer;
i,cv,valeur,erreur : integer;
begin
s:=GetCurrentDir;
//s:='C:\Program Files (x86)\Borland\Delphi7\Projects\Signaux_complexes_GL';
N_Cv:=0; // nombre de CV recus à 0
s:=GetCurrentDir;
//s:='C:\Program Files (x86)\Borland\Delphi7\Projects\Signaux_complexes_GL';
N_Cv:=0; // nombre de CV recus à 0
sa:='';
//for cv:=1 to 255 do
begin
cv:=3;
trace:=true;
sa:='';
Affiche('Lecture CV',clyellow);
val(EditAdresse.Text,cv,erreur);
if (erreur<>0) or (cv>255) or (cv<0) then
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);
begin
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])+' ';
EditAdresse.Text:='1';
exit;
end;
//trace:=true;
begin
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;
end;
end;
Affiche(sa,clyellow);sa:='';
with FormPrinc.SaveDialog do
begin
Sleep(100);
inc(i);
until succes or (i>20);
if succes then
begin
recu_cv:=false;
//Affiche('reçu trame succes',clyellow);
s:=#$21+#$10; // 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
i:=0;
title:='Ecrire un nom de fichier dans lequel sauvegarder les CV';
DefaultExt:='txt';
Filter:='Fichiers texte (*.txt)|*.txt|Tous fichiers (*.*)|*.*';
if Execute then
begin
s:=FileName;
assignFile(fte,s);
rewrite(fte);
Writeln(fte,'cv valeur');
repeat
Tempo(2); // attend 200 ms
inc(i);
begin
until recu_cv or (i>4);
if (i>4) then
begin
Affiche('Erreur attente trop longue CV',clred);
exit;
end;
sa:=sa+'Cv'+IntToSTR(cv)+'='+IntToSTR(Tablo_cv[cv])+' ';
Affiche(sa,clyellow);sa:='';
@@ -7073,25 +7218,6 @@ begin
Affiche('Pas de réponse de l''interface',clOrange);
end;
procedure TFormPrinc.Quitter1Click(Sender: TObject);
begin
close;
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);
procedure TFormPrinc.Quitter1Click(Sender: TObject);
begin
@@ -7100,5 +7226,7 @@ begin
procedure TFormPrinc.ConfigClick(Sender: TObject);
begin
Tformconfig.create(self);
formconfig.showmodal;
formconfig.close;
end;

Binary file not shown.

View File

@@ -46,14 +46,6 @@ object FormSimulation: TFormSimulation
Text = '1'
OnKeyPress = EditIntervalleKeyPress
end
object CheckBoxRapide: TCheckBox
Left = 56
Top = 56
Width = 97
Height = 17
Caption = 'Mode rapide'
TabOrder = 2
end
object OpenDialog: TOpenDialog
Left = 48
Top = 96

View File

@@ -12,7 +12,6 @@ type
OpenDialog: TOpenDialog;
EditIntervalle: TEdit;
Label1: TLabel;
CheckBoxRapide: TCheckBox;
procedure ButtonChargeClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure EditIntervalleKeyPress(Sender: TObject; var Key: Char);
@@ -49,44 +48,69 @@ begin
index_simule:=1;
repeat
readln(fte,s);
i:=pos('Tick=',s);
if i<>0 then
begin
if i<>0 then
begin
Delete(s,1,i+4);
val(s,k,erreur);
if intervalle<>0 then k:=Index_Simule*Intervalle*10+tick+80 else // démarre dans 8s
k:=Index_Simule+tick+80 ;
Tablo_simule[index_simule].tick:=k;
// détecteur?
i:=pos('Det=',s);
if i<>0 then
begin
if i<>0 then
begin
Delete(s,1,i+3);
val(s,k,erreur);
Tablo_simule[index_simule].detecteur:=k;
i:=pos('=',s);
if i<>0 then
begin
if i<>0 then
begin
Delete(s,1,i);
val(s,k,erreur);
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)+
'='+intToSTR(Tablo_simule[index_simule].etat);
Affiche(s,ClLime);
inc(index_simule);
inc(index_simule);
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;
sortie:=eof(fte) or (index_simule>199);
sortie:=eof(fte) or (index_simule>Max_Simule);
until sortie ;
if index_simule>Max_Simule then Affiche('Tableau maximal atteint',clred);
Affiche('Intervalle='+intToSTR(intervalle),clyellow);
dec(index_simule);
closeFile(fte);
FormSimulation.Close;
end;
end;
@@ -102,7 +126,7 @@ procedure TFormSimulation.EditIntervalleKeyPress(Sender: TObject;var Key: Char);
var erreur : integer;
begin
Val(EditIntervalle.Text,intervalle,erreur);
if (intervalle<0) then Intervalle:=1;
if (intervalle<0) then Intervalle:=1;
end;
end.

Binary file not shown.

View File

@@ -1,10 +1,12 @@
object FormTCO: TFormTCO
Left = 267
Top = 203
Left = 337
Top = 102
Width = 928
Height = 590
Height = 681
VertScrollBar.Visible = False
Caption = 'FormTCO'
Color = clBtnFace
DragMode = dmAutomatic
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
@@ -12,9 +14,9 @@ object FormTCO: TFormTCO
Font.Style = []
KeyPreview = True
OldCreateOrder = False
Position = poDefault
OnActivate = FormActivate
OnCreate = FormCreate
OnDockOver = FormDockOver
OnKeyDown = FormKeyDown
PixelsPerInch = 96
TextHeight = 13
@@ -65,21 +67,341 @@ object FormTCO: TFormTCO
Height = 13
Caption = 'Label1'
end
object Button1: TButton
Left = 320
Top = 16
Width = 75
object Label4: TLabel
Left = 24
Top = 480
Width = 175
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
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
object ScrollBox: TScrollBox
Left = 16
Top = 40
Width = 865
Height = 433
TabOrder = 1
TabOrder = 4
object ImageTCO: TImage
Left = 0
Top = 0
@@ -88,13 +410,59 @@ object FormTCO: TFormTCO
PopupMenu = PopupMenu1
OnClick = ImageTCOClick
OnContextPopup = ImageTCOContextPopup
OnDragOver = ImageTCODragOver
OnMouseDown = ImageTCOMouseDown
OnMouseMove = ImageTCOMouseMove
OnMouseUp = ImageTCOMouseUp
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
Left = 568
Top = 296
object Position1: TMenuItem
Caption = 'Position'
Left = 352
Top = 472
object MenuCouper: TMenuItem
Caption = 'Couper'
OnClick = MenuCouperClick
end
object MenuCopier: TMenuItem
Caption = 'Copier'
OnClick = MenuCopierClick
end
object MenuColler: TMenuItem
Caption = 'Coller'
OnClick = MenuCollerClick
end
object N1: TMenuItem
Caption = '-'
@@ -109,6 +477,43 @@ object FormTCO: TFormTCO
Caption = 'Aiguillage droit ; pointe '#224' droite'
OnClick = aiguillageD_PDClick
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

File diff suppressed because it is too large Load Diff

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
tco.cfg Normal file
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)

Binary file not shown.

View File

@@ -22,7 +22,7 @@ var
FormVersion: TFormVersion;
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
@@ -105,7 +105,8 @@ var s,s2,s3,Version_p,Url,LocalFile : string;
V_publie,V_utile : real;
begin
//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';
trouve_version:=false;
trouve_zip:=false;

13
versions.txt Normal file
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