V1.41
This commit is contained in:
Binary file not shown.
BIN
UnitConfig.dcu
BIN
UnitConfig.dcu
Binary file not shown.
@@ -134,8 +134,8 @@ begin
|
|||||||
envoi_CDM(s);
|
envoi_CDM(s);
|
||||||
if pos('_ACK',recuCDM)<>0 then Affiche('Services acceptés: aiguillages - détecteurs - actionneurs',clYellow);
|
if pos('_ACK',recuCDM)<>0 then Affiche('Services acceptés: aiguillages - détecteurs - actionneurs',clYellow);
|
||||||
// demande les trains
|
// demande les trains
|
||||||
////s:=place_id('C-C-01-0002-DSCTRN-DLOAD|000|');
|
s:=place_id('C-C-01-0002-DSCTRN-DLOAD|000|');
|
||||||
//envoi_CDM(s);
|
envoi_CDM(s);
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
object FormDebug: TFormDebug
|
object FormDebug: TFormDebug
|
||||||
Left = 286
|
Left = 260
|
||||||
Top = 39
|
Top = 148
|
||||||
BorderStyle = bsSingle
|
BorderStyle = bsSingle
|
||||||
Caption = 'Fen'#234'tre de d'#233'bug'
|
Caption = 'Fen'#234'tre de d'#233'bug'
|
||||||
ClientHeight = 639
|
ClientHeight = 639
|
||||||
@@ -159,22 +159,6 @@ object FormDebug: TFormDebug
|
|||||||
WordWrap = True
|
WordWrap = True
|
||||||
OnClick = ButtonAffEvtChronoClick
|
OnClick = ButtonAffEvtChronoClick
|
||||||
end
|
end
|
||||||
object CheckAffAffecTrains: TCheckBox
|
|
||||||
Left = 448
|
|
||||||
Top = 64
|
|
||||||
Width = 289
|
|
||||||
Height = 17
|
|
||||||
Caption = 'Affichage d'#39'affectation des trains aux d'#233'tecteurs'
|
|
||||||
Enabled = False
|
|
||||||
Font.Charset = DEFAULT_CHARSET
|
|
||||||
Font.Color = clBlack
|
|
||||||
Font.Height = -11
|
|
||||||
Font.Name = 'MS Sans Serif'
|
|
||||||
Font.Style = []
|
|
||||||
ParentFont = False
|
|
||||||
TabOrder = 8
|
|
||||||
OnClick = CheckAffAffecTrainsClick
|
|
||||||
end
|
|
||||||
object CheckBoxTraceLIste: TCheckBox
|
object CheckBoxTraceLIste: TCheckBox
|
||||||
Left = 448
|
Left = 448
|
||||||
Top = 80
|
Top = 80
|
||||||
@@ -187,22 +171,22 @@ object FormDebug: TFormDebug
|
|||||||
Font.Name = 'MS Sans Serif'
|
Font.Name = 'MS Sans Serif'
|
||||||
Font.Style = []
|
Font.Style = []
|
||||||
ParentFont = False
|
ParentFont = False
|
||||||
TabOrder = 9
|
TabOrder = 8
|
||||||
OnClick = CheckBoxTraceLIsteClick
|
OnClick = CheckBoxTraceLIsteClick
|
||||||
end
|
end
|
||||||
object CheckTrame: TCheckBox
|
object CheckTrame: TCheckBox
|
||||||
Left = 448
|
Left = 448
|
||||||
Top = 96
|
Top = 96
|
||||||
Width = 281
|
Width = 321
|
||||||
Height = 17
|
Height = 17
|
||||||
Caption = 'Affichage des trames '#233'chang'#233'es avec l'#39'interface'
|
Caption = 'Affichage des trames '#233'chang'#233'es avec l'#39'interface ou CDM'
|
||||||
Font.Charset = DEFAULT_CHARSET
|
Font.Charset = DEFAULT_CHARSET
|
||||||
Font.Color = clBlack
|
Font.Color = clBlack
|
||||||
Font.Height = -11
|
Font.Height = -11
|
||||||
Font.Name = 'MS Sans Serif'
|
Font.Name = 'MS Sans Serif'
|
||||||
Font.Style = []
|
Font.Style = []
|
||||||
ParentFont = False
|
ParentFont = False
|
||||||
TabOrder = 10
|
TabOrder = 9
|
||||||
OnClick = CheckTrameClick
|
OnClick = CheckTrameClick
|
||||||
end
|
end
|
||||||
object ButtonCop: TButton
|
object ButtonCop: TButton
|
||||||
@@ -211,7 +195,7 @@ object FormDebug: TFormDebug
|
|||||||
Width = 97
|
Width = 97
|
||||||
Height = 49
|
Height = 49
|
||||||
Caption = 'Copie fen'#234'te principale dans debug'
|
Caption = 'Copie fen'#234'te principale dans debug'
|
||||||
TabOrder = 11
|
TabOrder = 10
|
||||||
WordWrap = True
|
WordWrap = True
|
||||||
OnClick = ButtonCopClick
|
OnClick = ButtonCopClick
|
||||||
end
|
end
|
||||||
@@ -223,7 +207,7 @@ object FormDebug: TFormDebug
|
|||||||
HideScrollBars = False
|
HideScrollBars = False
|
||||||
PopupMenu = PopupMenuRE
|
PopupMenu = PopupMenuRE
|
||||||
ScrollBars = ssVertical
|
ScrollBars = ssVertical
|
||||||
TabOrder = 12
|
TabOrder = 11
|
||||||
end
|
end
|
||||||
object ButtonRazLog: TButton
|
object ButtonRazLog: TButton
|
||||||
Left = 448
|
Left = 448
|
||||||
@@ -231,9 +215,26 @@ object FormDebug: TFormDebug
|
|||||||
Width = 97
|
Width = 97
|
||||||
Height = 25
|
Height = 25
|
||||||
Caption = 'Raz Tampon Log'
|
Caption = 'Raz Tampon Log'
|
||||||
TabOrder = 13
|
TabOrder = 12
|
||||||
OnClick = ButtonRazLogClick
|
OnClick = ButtonRazLogClick
|
||||||
end
|
end
|
||||||
|
object CheckBoxAct: TCheckBox
|
||||||
|
Left = 448
|
||||||
|
Top = 64
|
||||||
|
Width = 257
|
||||||
|
Height = 17
|
||||||
|
Caption = 'Affichage des actionneurs'
|
||||||
|
Color = clWhite
|
||||||
|
Font.Charset = DEFAULT_CHARSET
|
||||||
|
Font.Color = clBlack
|
||||||
|
Font.Height = -11
|
||||||
|
Font.Name = 'MS Sans Serif'
|
||||||
|
Font.Style = []
|
||||||
|
ParentColor = False
|
||||||
|
ParentFont = False
|
||||||
|
TabOrder = 13
|
||||||
|
OnClick = CheckBoxActClick
|
||||||
|
end
|
||||||
object SaveDialog: TSaveDialog
|
object SaveDialog: TSaveDialog
|
||||||
Left = 680
|
Left = 680
|
||||||
Top = 8
|
Top = 8
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ type
|
|||||||
ButtonRazTampon: TButton;
|
ButtonRazTampon: TButton;
|
||||||
ButtonCherche: TButton;
|
ButtonCherche: TButton;
|
||||||
ButtonAffEvtChrono: TButton;
|
ButtonAffEvtChrono: TButton;
|
||||||
CheckAffAffecTrains: TCheckBox;
|
|
||||||
CheckBoxTraceLIste: TCheckBox;
|
CheckBoxTraceLIste: TCheckBox;
|
||||||
CheckTrame: TCheckBox;
|
CheckTrame: TCheckBox;
|
||||||
ButtonCop: TButton;
|
ButtonCop: TButton;
|
||||||
@@ -28,6 +27,7 @@ type
|
|||||||
PopupMenuRE: TPopupMenu;
|
PopupMenuRE: TPopupMenu;
|
||||||
copier1: TMenuItem;
|
copier1: TMenuItem;
|
||||||
ButtonRazLog: TButton;
|
ButtonRazLog: TButton;
|
||||||
|
CheckBoxAct: TCheckBox;
|
||||||
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);
|
||||||
@@ -36,12 +36,12 @@ type
|
|||||||
procedure ButtonRazTamponClick(Sender: TObject);
|
procedure ButtonRazTamponClick(Sender: TObject);
|
||||||
procedure ButtonChercheClick(Sender: TObject);
|
procedure ButtonChercheClick(Sender: TObject);
|
||||||
procedure ButtonAffEvtChronoClick(Sender: TObject);
|
procedure ButtonAffEvtChronoClick(Sender: TObject);
|
||||||
procedure CheckAffAffecTrainsClick(Sender: TObject);
|
|
||||||
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 copier1Click(Sender: TObject);
|
||||||
procedure ButtonRazLogClick(Sender: TObject);
|
procedure ButtonRazLogClick(Sender: TObject);
|
||||||
|
procedure CheckBoxActClick(Sender: TObject);
|
||||||
private
|
private
|
||||||
{ Déclarations privées }
|
{ Déclarations privées }
|
||||||
public
|
public
|
||||||
@@ -227,10 +227,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TFormDebug.CheckAffAffecTrainsClick(Sender: TObject);
|
|
||||||
begin
|
|
||||||
AffAffect:=CheckAffAffecTrains.checked;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TFormDebug.CheckBoxTraceLIsteClick(Sender: TObject);
|
procedure TFormDebug.CheckBoxTraceLIsteClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
@@ -262,4 +258,9 @@ begin
|
|||||||
MemoDebug.Clear;
|
MemoDebug.Clear;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TFormDebug.CheckBoxActClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
AffActionneur:=CheckBoxAct.Checked;
|
||||||
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|||||||
BIN
UnitPrinc.dcu
BIN
UnitPrinc.dcu
Binary file not shown.
@@ -1,6 +1,6 @@
|
|||||||
object FormPrinc: TFormPrinc
|
object FormPrinc: TFormPrinc
|
||||||
Left = 64
|
Left = 84
|
||||||
Top = 170
|
Top = 109
|
||||||
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'
|
||||||
@@ -14,7 +14,7 @@ object FormPrinc: TFormPrinc
|
|||||||
Font.Style = []
|
Font.Style = []
|
||||||
Menu = MainMenu1
|
Menu = MainMenu1
|
||||||
OldCreateOrder = False
|
OldCreateOrder = False
|
||||||
Position = poMainFormCenter
|
Position = poScreenCenter
|
||||||
ShowHint = True
|
ShowHint = True
|
||||||
OnClose = FormClose
|
OnClose = FormClose
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
@@ -1371,8 +1371,8 @@ object FormPrinc: TFormPrinc
|
|||||||
SimplePanel = True
|
SimplePanel = True
|
||||||
end
|
end
|
||||||
object MSCommUSBLenz: TMSComm
|
object MSCommUSBLenz: TMSComm
|
||||||
Left = 1024
|
Left = 1144
|
||||||
Top = 136
|
Top = 120
|
||||||
Width = 32
|
Width = 32
|
||||||
Height = 32
|
Height = 32
|
||||||
OnComm = MSCommUSBLenzComm
|
OnComm = MSCommUSBLenzComm
|
||||||
|
|||||||
292
UnitPrinc.pas
292
UnitPrinc.pas
@@ -204,10 +204,10 @@ 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 : integer;
|
Nbre_recu_cdm,Tempo_chgt_feux,Adj1,Adj2,NbrePN : integer;
|
||||||
Hors_tension2,traceSign,TraceZone,Ferme,parSocket,ackCdm,
|
Hors_tension2,traceSign,TraceZone,Ferme,parSocket,ackCdm,
|
||||||
NackCDM,MsgSim,succes,recu_cv,
|
NackCDM,MsgSim,succes,recu_cv,AffActionneur,
|
||||||
TraceListe,clignotant,nack,Maj_feux_cours : boolean;
|
TraceListe,clignotant,nack,Maj_feux_cours,configNulle : boolean;
|
||||||
|
|
||||||
branche : array [1..100] of string;
|
branche : array [1..100] of string;
|
||||||
|
|
||||||
@@ -230,7 +230,7 @@ var
|
|||||||
entete,suffixe,ConfStCom : string;
|
entete,suffixe,ConfStCom : string;
|
||||||
maxaiguillage,detecteur_chgt,Temps,TpsRecuCom,Tempo_init,Suivant,TypeGen,
|
maxaiguillage,detecteur_chgt,Temps,TpsRecuCom,Tempo_init,Suivant,TypeGen,
|
||||||
NbreImagePligne,NbreBranches,Index2_det,branche_det,Index_det,
|
NbreImagePligne,NbreBranches,Index2_det,branche_det,Index_det,
|
||||||
I_simule : integer;
|
I_simule,maxTablo_act,NbreVoies : integer;
|
||||||
Ancien_detecteur,detecteur : array[0..1024] of boolean; // anciens état des détecteurs et adresses des détecteurs et leur état
|
Ancien_detecteur,detecteur : array[0..1024] of boolean; // anciens état des détecteurs et adresses des détecteurs et leur état
|
||||||
Adresse_detecteur : array[0..60] of integer; // adresses des détecteurs par index
|
Adresse_detecteur : array[0..60] of integer; // adresses des détecteurs par index
|
||||||
mem : array[0..1024] of boolean ; // mémoire des états des détecteurs
|
mem : array[0..1024] of boolean ; // mémoire des états des détecteurs
|
||||||
@@ -242,6 +242,25 @@ var
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Tablo_actionneur : array[1..100] of
|
||||||
|
record
|
||||||
|
actionneur,etat,fonction,tempo : integer;
|
||||||
|
train : string;
|
||||||
|
end;
|
||||||
|
|
||||||
|
Tablo_PN : array[1..20] of
|
||||||
|
record
|
||||||
|
AdresseFerme : integer; // adresse de pilotage DCC pour la fermeture
|
||||||
|
commandeFerme : integer; // commande de fermeture (1 ou 2)
|
||||||
|
AdresseOuvre : integer; // adresse de pilotage DCC pour l'ouverture
|
||||||
|
commandeOuvre : integer; // commande d'ouverture (1 ou 2)
|
||||||
|
NbVoies : integer; // Nombre de voies du PN
|
||||||
|
Voie : array [1..10] of record
|
||||||
|
ActFerme,ActOuvre : integer ; // actionneurs provoquant la fermeture et l'ouverture
|
||||||
|
PresTrain : boolean; // mémoire de présence de train sur la voie
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
Tablo_Simule : array[0..Max_Simule] of
|
Tablo_Simule : array[0..Max_Simule] of
|
||||||
record
|
record
|
||||||
tick : longint;
|
tick : longint;
|
||||||
@@ -250,7 +269,7 @@ var
|
|||||||
Route : array[1..2000] of record
|
Route : array[1..2000] of record
|
||||||
Mem1,Mem2 : integer;
|
Mem1,Mem2 : integer;
|
||||||
end;
|
end;
|
||||||
N_Cv,index_simule,NDetecteurs,N_Trains,N_routes : integer;
|
TempoAct,RangActCours,N_Cv,index_simule,NDetecteurs,N_Trains,N_routes : integer;
|
||||||
tablo_CV : array [1..255] of integer;
|
tablo_CV : array [1..255] of integer;
|
||||||
couleur : Tcolor;
|
couleur : Tcolor;
|
||||||
fichier : text;
|
fichier : text;
|
||||||
@@ -1037,7 +1056,25 @@ begin
|
|||||||
envoi:=ack;
|
envoi:=ack;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Function chaine_CDM_Func(fonction,etat : integer;train : string) : string;
|
||||||
|
var so,sx,s : string;
|
||||||
|
begin
|
||||||
|
{ exemple de commande envoyée au serveur pour une fonction
|
||||||
|
C-C-00-0002-CMDTRN-DCCSF|029|03|NAME=nomdutrain;CSTEP=0;FXnumfonction=etat;
|
||||||
|
|
||||||
|
C-C-00-0002-CMDTRN-DCCSF|029|03|NAME=train;CSTEP=0;FX0=0;
|
||||||
|
C-C-00-0002-CMDTRN-DCCSF|029|03|NAME=train;CSTEP=0;FX1=0;
|
||||||
|
C-C-00-0002-CMDTRN-DCCSF|047|06|NAME=train;CSTEP=0;FX0=1;FX1=1;FX2=1;FX3=1;
|
||||||
|
maxi=C-C-00-0002-CMDTRN-DCCSF|111|16|NAME=train;CSTEP=0;FX0=1;FX1=1;FX2=1;FX3=1;FX4=0;FX5=0;FX6=0;FX7=0;FX8=0;FX9=0;FX10=0;FX11=0;FX12=0;FX13=0;
|
||||||
|
}
|
||||||
|
so:=place_id('C-C-01-0004-CMDTRN-DCCSF');
|
||||||
|
s:=s+'NAME='+train+';';
|
||||||
|
s:=s+'CSTEP=0;';
|
||||||
|
s:=s+'FX'+intToSTR(fonction)+'='+intToSTR(etat)+';';
|
||||||
|
sx:=format('%.*d',[2,3])+'|'; // 3 paramètres
|
||||||
|
so:=so+ '|'+format('%.*d',[3,length(s)+length(sx)])+'|'+sx;
|
||||||
|
chaine_CDM_Func:=so+s;
|
||||||
|
end;
|
||||||
|
|
||||||
// prépare la chaîne de commande pour un accessoire via CDM
|
// prépare la chaîne de commande pour un accessoire via CDM
|
||||||
Function chaine_CDM_Acc(adresse,etat1 : integer) : string;
|
Function chaine_CDM_Acc(adresse,etat1 : integer) : string;
|
||||||
@@ -1067,6 +1104,13 @@ begin
|
|||||||
chaine_CDM_Acc:=so+s;
|
chaine_CDM_Acc:=so+s;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure envoie_fonction_CDM(fonction,etat : integer;train : string);
|
||||||
|
var s : string;
|
||||||
|
begin
|
||||||
|
s:=chaine_CDM_Func(fonction,etat,train);
|
||||||
|
if trace then affiche(s,clLime);
|
||||||
|
envoi_cdm(s);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
// active ou désactive une sortie. Une adresse comporte deux sorties identifiées par "octet"
|
// active ou désactive une sortie. Une adresse comporte deux sorties identifiées par "octet"
|
||||||
@@ -3013,8 +3057,13 @@ begin
|
|||||||
Aiguillage[i].inversion:=0;
|
Aiguillage[i].inversion:=0;
|
||||||
end;
|
end;
|
||||||
for i:=1 to 1024 do
|
for i:=1 to 1024 do
|
||||||
|
begin
|
||||||
Detecteur[i]:=false;
|
Detecteur[i]:=false;
|
||||||
Ancien_detecteur[i]:=false;
|
Ancien_detecteur[i]:=false;
|
||||||
|
end;
|
||||||
|
//ChDir(s);
|
||||||
|
Affiche('lecture du fichier de configuration client-GL.cfg',clyellow);
|
||||||
|
try
|
||||||
assign(fichier,'client-GL.cfg');
|
assign(fichier,'client-GL.cfg');
|
||||||
reset(fichier);
|
reset(fichier);
|
||||||
except
|
except
|
||||||
@@ -3069,7 +3118,7 @@ begin
|
|||||||
2 : begin entete:=#228;suffixe:=#13+#13+#10;end;
|
2 : begin entete:=#228;suffixe:=#13+#13+#10;end;
|
||||||
end;
|
end;
|
||||||
if (erreur<>0) or (valeur_entete>2) then Affiche('Erreur déclaration variable entete',clred);
|
if (erreur<>0) or (valeur_entete>2) then Affiche('Erreur déclaration variable entete',clred);
|
||||||
|
|
||||||
|
|
||||||
//avec ou sans initialisation des aiguillages
|
//avec ou sans initialisation des aiguillages
|
||||||
s:=lit_ligne;
|
s:=lit_ligne;
|
||||||
@@ -3104,8 +3153,12 @@ begin
|
|||||||
aiguillageB[adresse].inversion:=invers;
|
aiguillageB[adresse].inversion:=invers;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
until (adresse=0);
|
until (adresse=0);
|
||||||
|
|
||||||
|
closefile(fichier);
|
||||||
|
|
||||||
|
Affiche('lecture du fichier de configuration config.cfg',clyellow);
|
||||||
try
|
try
|
||||||
assign(fichier,'config.cfg');
|
assign(fichier,'config.cfg');
|
||||||
reset(fichier);
|
reset(fichier);
|
||||||
@@ -3282,6 +3335,8 @@ begin
|
|||||||
if erreur=0 then
|
if erreur=0 then
|
||||||
begin
|
begin
|
||||||
aiguillage[aig].vitesse:=adr;
|
aiguillage[aig].vitesse:=adr;
|
||||||
|
enregistrement:='';
|
||||||
|
end;
|
||||||
|
|
||||||
until enregistrement='' ;
|
until enregistrement='' ;
|
||||||
end;
|
end;
|
||||||
@@ -3351,13 +3406,15 @@ begin
|
|||||||
end;
|
end;
|
||||||
inc(j);
|
inc(j);
|
||||||
BrancheN[i,j].adresse:=0; // préparer le suivant à 0
|
BrancheN[i,j].adresse:=0; // préparer le suivant à 0
|
||||||
//Affiche('branche '+intToSTR(i)+' index='+intToStr(j),clGreen);
|
//Affiche('branche '+intToSTR(i)+' index='+intToStr(j),clGreen);
|
||||||
until (offset=0);
|
until (offset=0);
|
||||||
inc(i);
|
inc(i);
|
||||||
end;
|
end;
|
||||||
until (s='0');
|
until (s='0');
|
||||||
NbreBranches:=i-1;
|
NbreBranches:=i-1;
|
||||||
// Affiche(IntToSTR(NbreBranches)+' branches',clYellow);
|
// Affiche(IntToSTR(NbreBranches)+' branches',clYellow);
|
||||||
|
|
||||||
|
// feux
|
||||||
Affiche('Définition des feux',clyellow);
|
Affiche('Définition des feux',clyellow);
|
||||||
i:=1;
|
i:=1;
|
||||||
repeat
|
repeat
|
||||||
@@ -3541,11 +3598,107 @@ begin
|
|||||||
Val(s,k,erreur);
|
Val(s,k,erreur);
|
||||||
Feux[i].UniSemaf:=k;
|
Feux[i].UniSemaf:=k;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
inc(i);
|
inc(i);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
|
until (finifeux) or (s='0');
|
||||||
|
NbreFeux:=i-1; if NbreFeux<0 then NbreFeux:=0;
|
||||||
|
//Affiche('Nombre de feux='+IntToSTR(NbreFeux),clYellow);
|
||||||
|
|
||||||
|
configNulle:=(maxAiguillage=0) and (NbreBranches=0) and (Nbrefeux=0);
|
||||||
|
if configNulle then Affiche('Fonctionnement en config nulle',ClYellow);
|
||||||
|
// définition des actionneurs
|
||||||
|
maxTablo_act:=1;
|
||||||
|
NbrePN:=0;
|
||||||
|
repeat
|
||||||
|
s:=lit_ligne;
|
||||||
|
if pos('F',s)<>0 then
|
||||||
|
// -----------------fonction
|
||||||
|
begin
|
||||||
|
// 815,1,CC406526,F2,450
|
||||||
|
i:=pos(',',s);
|
||||||
|
if i<>0 then
|
||||||
|
begin
|
||||||
|
val(copy(s,1,i-1),j,erreur);
|
||||||
|
Tablo_actionneur[maxTablo_act].actionneur:=j;
|
||||||
|
Delete(s,1,i);
|
||||||
|
i:=pos(',',s);
|
||||||
|
if i<>0 then
|
||||||
|
begin
|
||||||
|
i:=pos(',',s);
|
||||||
|
val(copy(s,1,i-1),j,erreur);
|
||||||
|
Tablo_actionneur[maxTablo_act].etat:=j;
|
||||||
|
Delete(s,1,i);
|
||||||
|
|
||||||
|
i:=pos(',',s);
|
||||||
|
Tablo_actionneur[maxTablo_act].train:=copy(s,1,i-1);
|
||||||
|
Delete(s,1,i);
|
||||||
|
|
||||||
|
i:=pos('F',s);
|
||||||
|
if i<>0 then
|
||||||
|
begin
|
||||||
|
Delete(s,1,1);
|
||||||
|
val(s,j,erreur);
|
||||||
|
Tablo_actionneur[maxTablo_act].Fonction:=j;
|
||||||
|
|
||||||
|
i:=pos(',',s);
|
||||||
|
if i<>0 then
|
||||||
|
begin
|
||||||
|
Delete(S,1,i);
|
||||||
|
val(s,j,erreur);
|
||||||
|
Tablo_actionneur[maxTablo_act].Tempo:=j;
|
||||||
|
inc(maxTablo_act);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
s:='';i:=0;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
// Passage à niveau
|
||||||
|
// (815,820),(830,810)...,PN(121+,121-)
|
||||||
|
// (815,809),PN(121+,121-)
|
||||||
|
if (pos('PN',s)<>0) then
|
||||||
|
begin
|
||||||
|
inc(NbrePN);
|
||||||
|
NbreVoies:=0;
|
||||||
|
repeat
|
||||||
|
inc(NbreVoies);
|
||||||
|
//Affiche('NbreVoies='+intToSTR(NbreVoies),clyellow);
|
||||||
|
//SetLength(Tablo_PN[1].Voie,1);
|
||||||
|
Delete(s,1,1); // supprime (
|
||||||
|
val(s,j,erreur);
|
||||||
|
|
||||||
|
Tablo_PN[NbrePN].voie[NbreVoies].ActFerme:=j;
|
||||||
|
|
||||||
|
// Affiche('Ferme='+intToSTR(j),clyellow);
|
||||||
|
i:=pos(',',s);Delete(S,1,i);
|
||||||
|
val(s,j,erreur);
|
||||||
|
Tablo_PN[NbrePN].voie[NbreVoies].ActOuvre:=j;
|
||||||
|
// Affiche('Ouvre='+intToSTR(j),clyellow);
|
||||||
|
i:=pos(')',s);Delete(S,1,i);
|
||||||
|
i:=pos(',',s);Delete(S,1,i);
|
||||||
|
Tablo_PN[NbrePN].voie[NbreVoies].PresTrain:=false;
|
||||||
|
until (copy(s,1,2)='PN') or (NbreVoies=10);
|
||||||
|
|
||||||
|
Tablo_PN[NbrePN].NbVoies:=NbreVoies;
|
||||||
|
Delete(s,1,3); // Supprime PN(
|
||||||
|
val(s,j,erreur);
|
||||||
|
Tablo_PN[NbrePN].Adresseferme:=j;
|
||||||
|
Delete(s,1,erreur-1);
|
||||||
|
if s[1]='+' then Tablo_PN[NbrePN].CommandeFerme:=2;
|
||||||
|
if s[1]='-' then Tablo_PN[NbrePN].CommandeFerme:=1;
|
||||||
|
Delete(s,1,2); // supprime +,
|
||||||
|
|
||||||
|
val(s,j,erreur);
|
||||||
|
Tablo_PN[NbrePN].AdresseOuvre:=j;
|
||||||
|
Delete(s,1,erreur-1);
|
||||||
|
if s[1]='+' then Tablo_PN[NbrePN].CommandeOuvre:=2;
|
||||||
|
if s[1]='-' then Tablo_PN[NbrePN].CommandeOuvre:=1;
|
||||||
|
Delete(s,1,1); // supprime )
|
||||||
i:=0;
|
i:=0;
|
||||||
end;
|
end;
|
||||||
if pos('PN',s)<>0 then i:=0;
|
if pos('PN',s)<>0 then i:=0;
|
||||||
@@ -5554,6 +5707,66 @@ begin
|
|||||||
//event_det_tick[i].train:=0; // traité
|
//event_det_tick[i].train:=0; // traité
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
if AffAffect then AfficheDebug('Pas trouvé',clyellow);
|
||||||
|
affecte_train:=train;
|
||||||
|
end;
|
||||||
|
}
|
||||||
|
|
||||||
|
// traitement des évènements actionneurs
|
||||||
|
procedure Event_act(adr,etat : integer;train : string);
|
||||||
|
var i,v,va,j,etatAct,Af,Ao : integer;
|
||||||
|
s : string;
|
||||||
|
presTrain_PN : boolean;
|
||||||
|
begin
|
||||||
|
// vérifier si l'actionneur en évènement a été déclaré pour réagir
|
||||||
|
if AffActionneur then Affiche('Actionneur '+intToSTR(Adr)+'='+intToSTR(etat),clyellow);
|
||||||
|
// dans le tableau des actionneurs pour fonction train
|
||||||
|
for i:=1 to maxTablo_act do
|
||||||
|
begin
|
||||||
|
s:=Tablo_actionneur[i].train;
|
||||||
|
etatAct:=Tablo_actionneur[i].etat ;
|
||||||
|
if (Tablo_actionneur[i].actionneur=adr) and ((s=train) or (s='X')) and (etatAct=etat) then
|
||||||
|
begin
|
||||||
|
Affiche('Actionneur '+intToSTR(adr)+' Train='+train+' F'+IntToSTR(Tablo_actionneur[i].fonction)+':'+intToSTR(etat),clyellow);
|
||||||
|
envoie_fonction_CDM(Tablo_actionneur[i].fonction,etat,train);
|
||||||
|
TempoAct:=tablo_actionneur[i].Tempo div 100;
|
||||||
|
RangActCours:=i;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
// dans le tableau des PN
|
||||||
|
for i:=1 to NbrePN do
|
||||||
|
begin
|
||||||
|
for v:=1 to Tablo_PN[i].nbvoies do
|
||||||
|
begin
|
||||||
|
aO:=Tablo_PN[i].voie[v].actOuvre;
|
||||||
|
aF:=Tablo_PN[i].voie[v].actFerme;
|
||||||
|
|
||||||
|
if (aO=adr) and (etat=0) then // actionneur d'ouverture
|
||||||
|
begin
|
||||||
|
Tablo_PN[i].voie[v].PresTrain:=false;
|
||||||
|
// vérifier les présences train sur les autres voies du PN
|
||||||
|
presTrain_PN:=false;
|
||||||
|
for va:=1 to Tablo_PN[i].nbvoies do
|
||||||
|
begin
|
||||||
|
presTrain_PN:=presTrain_PN or Tablo_PN[i].voie[va].PresTrain;
|
||||||
|
end;
|
||||||
|
if not(presTrain_PN) then
|
||||||
|
begin
|
||||||
|
Affiche('Ouverture PN'+intToSTR(i),clOrange);
|
||||||
|
pilote_acc(Tablo_PN[i].AdresseOuvre,Tablo_PN[i].CommandeOuvre,Aig);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
if (aF=adr) and (etat=1) then // actionneur de fermeture
|
||||||
|
begin
|
||||||
|
Tablo_PN[i].voie[v].PresTrain:=true;
|
||||||
|
Affiche('Fermeture PN'+IntToSTR(i)+' (train voie '+IntToSTR(v)+')',clOrange);
|
||||||
|
pilote_acc(Tablo_PN[i].AdresseFerme,Tablo_PN[i].CommandeFerme,Aig);
|
||||||
|
end;
|
||||||
|
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@@ -5582,7 +5795,7 @@ begin
|
|||||||
detecteur[Adresse]:=etat;
|
detecteur[Adresse]:=etat;
|
||||||
detecteur_chgt:=Adresse;
|
detecteur_chgt:=Adresse;
|
||||||
|
|
||||||
// mise a jour du tableau evt de fronts descendants
|
// mise a jour du tableau evt de fronts descendants
|
||||||
if ancien_detecteur[Adresse] and not(detecteur[Adresse]) and (N_Event_det<20) then
|
if ancien_detecteur[Adresse] and not(detecteur[Adresse]) and (N_Event_det<20) then
|
||||||
begin
|
begin
|
||||||
//Affiche('front descendant',clyellow);
|
//Affiche('front descendant',clyellow);
|
||||||
@@ -6219,6 +6432,7 @@ begin
|
|||||||
LabelEtat.Caption:='Initialisations en cours';
|
LabelEtat.Caption:='Initialisations en cours';
|
||||||
|
|
||||||
//Menu_interface(devalide);
|
//Menu_interface(devalide);
|
||||||
|
|
||||||
// créée la fenetre debug
|
// créée la fenetre debug
|
||||||
FormDebug:=TFormDebug.Create(Self);
|
FormDebug:=TFormDebug.Create(Self);
|
||||||
FormDebug.Caption:=AF+' debug';
|
FormDebug.Caption:=AF+' debug';
|
||||||
@@ -6360,6 +6574,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);
|
||||||
|
Affiche('Fin des initialisations',clyellow);
|
||||||
//Menu_interface(valide);
|
//Menu_interface(valide);
|
||||||
//s:=#$f0;
|
//s:=#$f0;
|
||||||
//s:=checksum(s);
|
//s:=checksum(s);
|
||||||
@@ -6422,15 +6638,16 @@ end;
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// timer à 100 ms
|
// timer à 100 ms
|
||||||
procedure TFormPrinc.Timer1Timer(Sender: TObject);
|
procedure TFormPrinc.Timer1Timer(Sender: TObject);
|
||||||
var i,a : integer;
|
var i,a : integer;
|
||||||
s : string;
|
s : string;
|
||||||
begin
|
begin
|
||||||
inc(tick);
|
inc(tick);
|
||||||
|
|
||||||
if Tempo_init>0 then dec(Tempo_init);
|
if Tempo_init>0 then dec(Tempo_init);
|
||||||
if (Tempo_init=1) and AvecInit then
|
if (Tempo_init=1) and AvecInit then
|
||||||
begin
|
begin
|
||||||
@@ -6483,6 +6700,18 @@ begin
|
|||||||
if trace then Affiche_chaine_hex(chaine_recue,clFuchsia); // en hexa ascii
|
if trace then Affiche_chaine_hex(chaine_recue,clFuchsia); // en hexa ascii
|
||||||
chaine_recue:='';
|
chaine_recue:='';
|
||||||
TpsRecuCom:=6;
|
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>0)) then dec(Tempo_chgt_feux);
|
||||||
|
|
||||||
|
// tempo retombée actionneur
|
||||||
|
if TempoAct<>0 then
|
||||||
|
begin
|
||||||
|
dec(tempoAct);
|
||||||
|
if tempoAct=0 then
|
||||||
|
begin
|
||||||
A:=Tablo_actionneur[RangActCours].actionneur;
|
A:=Tablo_actionneur[RangActCours].actionneur;
|
||||||
s:=Tablo_actionneur[RangActCours].train;
|
s:=Tablo_actionneur[RangActCours].train;
|
||||||
Affiche('Actionneur '+intToSTR(a)+' F'+IntToSTR(Tablo_actionneur[RangActCours].fonction)+':0',clyellow);
|
Affiche('Actionneur '+intToSTR(a)+' F'+IntToSTR(Tablo_actionneur[RangActCours].fonction)+':0',clyellow);
|
||||||
@@ -6821,14 +7050,13 @@ end;
|
|||||||
parSocketCDM:=True;
|
parSocketCDM:=True;
|
||||||
MenuConnecterUSB.enabled:=false;
|
MenuConnecterUSB.enabled:=false;
|
||||||
DeConnecterUSB.enabled:=false;
|
DeConnecterUSB.enabled:=false;
|
||||||
ConnecterCDMRail.enabled:=false;
|
ConnecterCDMRail.enabled:=false;
|
||||||
|
|
||||||
end;
|
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,etatAig2 : integer ;
|
var i,j,k,l,erreur, adr,adr2,etat,etataig,etatAig2,name : integer ;
|
||||||
s,ss : string;
|
|
||||||
s,ss,train : string;
|
s,ss,train : string;
|
||||||
traite,sort : boolean;
|
traite,sort : boolean;
|
||||||
begin
|
begin
|
||||||
@@ -6860,7 +7088,7 @@ begin
|
|||||||
if i+5-j>0 then begin Delete(recuCDM,j,i+5-j) ;end else
|
if i+5-j>0 then begin Delete(recuCDM,j,i+5-j) ;end else
|
||||||
begin
|
begin
|
||||||
Affiche('Erreur 95',clred);
|
Affiche('Erreur 95',clred);
|
||||||
Affiche('j='+IntToSTR(j)+' i='+intToSTR(i),clred);
|
Affiche('j='+IntToSTR(j)+' i='+intToSTR(i),clred);
|
||||||
Nbre_recu_cdm:=0;
|
Nbre_recu_cdm:=0;
|
||||||
Affiche(recuCDM,clred);
|
Affiche(recuCDM,clred);
|
||||||
exit;
|
exit;
|
||||||
@@ -6919,13 +7147,34 @@ begin
|
|||||||
if j<>0 then
|
if j<>0 then
|
||||||
begin
|
begin
|
||||||
i:=posEx('AD=',recuCDM,j);ss:=copy(recuCDM,i+3,10);
|
i:=posEx('AD=',recuCDM,j);ss:=copy(recuCDM,i+3,10);
|
||||||
val(ss,adr,erreur);
|
|
||||||
val(ss,adr,erreur);
|
val(ss,adr,erreur);
|
||||||
i:=posEx('STATE=',recuCDM,j);ss:=copy(recuCDM,i+6,10);
|
i:=posEx('STATE=',recuCDM,j);ss:=copy(recuCDM,i+6,10);
|
||||||
Delete(recuCDM,j,i+5-j);
|
Delete(recuCDM,j,i+5-j);
|
||||||
|
val(ss,etat,erreur);
|
||||||
|
Event_detecteur(Adr,etat=1);
|
||||||
|
//FormDebug.MemoDet.Lines.Add(IntToSTR(adr)+' '+IntToSTR(etat));
|
||||||
|
if AfficheDet then Affiche('Rétro Détecteur '+intToSTR(adr)+'='+IntToStr(etat),clYellow);
|
||||||
|
end ;
|
||||||
|
|
||||||
|
// évènement actionneur
|
||||||
|
// attention un actionneur qui repasse à 0 ne contient pas de nom de train
|
||||||
|
//S-E-03-0157-CMDACC-ST_AC|049|05|NAME=0;OBJ=7101;AD=815;TRAIN=CC406526;STATE=1;
|
||||||
|
j:=pos('CMDACC-ST_AC',recuCDM);
|
||||||
|
if j<>0 then
|
||||||
|
begin
|
||||||
|
i:=posEx('AD=',recuCDM,j);ss:=copy(recuCDM,i+3,10);
|
||||||
|
val(ss,adr,erreur);
|
||||||
|
i:=posEx('NAME=',recuCDM,j);ss:=copy(recuCDM,i+5,10);
|
||||||
|
val(ss,name,erreur);
|
||||||
|
i:=posEx('TRAIN=',recuCDM,j);l:=PosEx(';',recuCDM,i);
|
||||||
|
train:=copy(recuCDM,i+6,l-i-6);
|
||||||
|
i:=posEx('STATE=',recuCDM,j);ss:=copy(recuCDM,i+6,10);
|
||||||
|
val(ss,etat,erreur);
|
||||||
|
Delete(recuCDM,j,i-j);
|
||||||
|
i:=pos(';',recuCDM);
|
||||||
if i<>0 then Delete(recuCDM,1,i);
|
if i<>0 then Delete(recuCDM,1,i);
|
||||||
if AfficheDet then
|
if AfficheDet then
|
||||||
|
Affiche('Actionneur AD='+intToSTR(adr)+' Nom='+intToSTR(name)+' Train='+train+' Etat='+IntToSTR(etat),clyellow);
|
||||||
Event_act(adr,etat,train); // déclenche évent actionneur
|
Event_act(adr,etat,train); // déclenche évent actionneur
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -7015,6 +7264,9 @@ begin
|
|||||||
Affiche(' gestion du décodeur de signaux Unisemaf Paco (expérimental)',clLime);
|
Affiche(' gestion du décodeur de signaux Unisemaf Paco (expérimental)',clLime);
|
||||||
Affiche(' changement dynamique des feux en cliquant sur son image',clLime);
|
Affiche(' changement dynamique des feux en cliquant sur son image',clLime);
|
||||||
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);
|
||||||
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);
|
Affiche('Version 1.31 : Correction des positions aiguillages triples et TJD',clLime);
|
||||||
|
|||||||
17
config.cfg
17
config.cfg
@@ -109,6 +109,21 @@ A31,0
|
|||||||
600,7,0,0,(521,A8),1
|
600,7,0,0,(521,A8),1
|
||||||
0
|
0
|
||||||
/
|
/
|
||||||
|
/ Section actionneurs. Ne fonctionne qu'en mode connecté à CDM en run
|
||||||
|
/ Fonctions Fx à envoyer aux locomotives sur passage d'un actionneur
|
||||||
|
/ actionneur,état,Nom du train,fonction,temporisation en ms avant remise à 0
|
||||||
|
/
|
||||||
|
/ Passages à niveau (PN)
|
||||||
|
/ (act_ferme_voie1,act_ouvre_voie1),(act_ferme_voie2,act_ouvre_voie2),...,PN(adresse_ferme,adresse_ouvre)
|
||||||
|
/
|
||||||
|
/ Klaxon (F2)
|
||||||
|
/ 815,1,CC406526,F2,400
|
||||||
|
/
|
||||||
|
/ passage à niveau à 2 voies
|
||||||
|
/(815,830),(820,840),PN(121+,121-)
|
||||||
|
/
|
||||||
|
/ passage à niveau à 1 voie
|
||||||
|
/(815,809),PN(121+,121-)
|
||||||
|
0
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@@ -22,7 +22,7 @@ var
|
|||||||
FormVersion: TFormVersion;
|
FormVersion: TFormVersion;
|
||||||
Lance_verif : integer;
|
Lance_verif : integer;
|
||||||
|
|
||||||
Const Version='1.31'; //Version='1.2';// sert à la comparaison de la version publiée
|
Const Version='1.41'; //Version='1.2';// sert à la comparaison de la version publiée
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
|||||||
@@ -10,4 +10,6 @@ Version 1.2 : Renforcement de l'algorithme de suivi des trains
|
|||||||
Version 1.3 : Décodeur Unisemaf fonctionnel - Lecture/écriture des CV
|
Version 1.3 : Décodeur Unisemaf fonctionnel - Lecture/écriture des CV
|
||||||
Protocoles variables de l'interface
|
Protocoles variables de l'interface
|
||||||
Configuration statique modifiable dans menu
|
Configuration statique modifiable dans menu
|
||||||
Version 1.31 : Correction gestion aiguillage triple
|
Version 1.31 : Correction des positions aiguillages triples et TJD
|
||||||
|
Version 1.4 : Gestion des Fonctions Fx vers les locomotives par actionneurs
|
||||||
|
Version 1.41 : Gestion des passages à niveaux par actionneurs
|
||||||
Reference in New Issue
Block a user