V2.31
This commit is contained in:
Binary file not shown.
Binary file not shown.
+8
-2
@@ -1776,7 +1776,7 @@ object FormConfig: TFormConfig
|
|||||||
Top = 8
|
Top = 8
|
||||||
Width = 585
|
Width = 585
|
||||||
Height = 441
|
Height = 441
|
||||||
ActivePage = TabSheetCDM
|
ActivePage = TabSheetSig
|
||||||
Font.Charset = DEFAULT_CHARSET
|
Font.Charset = DEFAULT_CHARSET
|
||||||
Font.Color = clBackground
|
Font.Color = clBackground
|
||||||
Font.Height = -11
|
Font.Height = -11
|
||||||
@@ -2783,7 +2783,7 @@ object FormConfig: TFormConfig
|
|||||||
Top = 48
|
Top = 48
|
||||||
Width = 129
|
Width = 129
|
||||||
Height = 21
|
Height = 21
|
||||||
ItemHeight = 0
|
ItemHeight = 13
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
OnChange = ComboBoxDecChange
|
OnChange = ComboBoxDecChange
|
||||||
end
|
end
|
||||||
@@ -2812,6 +2812,7 @@ object FormConfig: TFormConfig
|
|||||||
Height = 21
|
Height = 21
|
||||||
TabOrder = 4
|
TabOrder = 4
|
||||||
Text = 'Edit1'
|
Text = 'Edit1'
|
||||||
|
OnChange = EditDet2Change
|
||||||
end
|
end
|
||||||
object EditSuiv2: TEdit
|
object EditSuiv2: TEdit
|
||||||
Left = 184
|
Left = 184
|
||||||
@@ -2820,6 +2821,7 @@ object FormConfig: TFormConfig
|
|||||||
Height = 21
|
Height = 21
|
||||||
TabOrder = 5
|
TabOrder = 5
|
||||||
Text = 'Edit2'
|
Text = 'Edit2'
|
||||||
|
OnChange = EditSuiv2Change
|
||||||
end
|
end
|
||||||
object EditDet3: TEdit
|
object EditDet3: TEdit
|
||||||
Left = 120
|
Left = 120
|
||||||
@@ -2828,6 +2830,7 @@ object FormConfig: TFormConfig
|
|||||||
Height = 21
|
Height = 21
|
||||||
TabOrder = 6
|
TabOrder = 6
|
||||||
Text = 'Edit1'
|
Text = 'Edit1'
|
||||||
|
OnChange = EditDet3Change
|
||||||
end
|
end
|
||||||
object EditSuiv3: TEdit
|
object EditSuiv3: TEdit
|
||||||
Left = 184
|
Left = 184
|
||||||
@@ -2836,6 +2839,7 @@ object FormConfig: TFormConfig
|
|||||||
Height = 21
|
Height = 21
|
||||||
TabOrder = 7
|
TabOrder = 7
|
||||||
Text = 'Edit2'
|
Text = 'Edit2'
|
||||||
|
OnChange = EditSuiv3Change
|
||||||
end
|
end
|
||||||
object EditDet4: TEdit
|
object EditDet4: TEdit
|
||||||
Left = 120
|
Left = 120
|
||||||
@@ -2844,6 +2848,7 @@ object FormConfig: TFormConfig
|
|||||||
Height = 21
|
Height = 21
|
||||||
TabOrder = 8
|
TabOrder = 8
|
||||||
Text = 'Edit1'
|
Text = 'Edit1'
|
||||||
|
OnChange = EditDet4Change
|
||||||
end
|
end
|
||||||
object EditSuiv4: TEdit
|
object EditSuiv4: TEdit
|
||||||
Left = 184
|
Left = 184
|
||||||
@@ -2852,6 +2857,7 @@ object FormConfig: TFormConfig
|
|||||||
Height = 21
|
Height = 21
|
||||||
TabOrder = 9
|
TabOrder = 9
|
||||||
Text = 'Edit2'
|
Text = 'Edit2'
|
||||||
|
OnChange = EditSuiv4Change
|
||||||
end
|
end
|
||||||
object CheckVerrouCarre: TCheckBox
|
object CheckVerrouCarre: TCheckBox
|
||||||
Left = 112
|
Left = 112
|
||||||
|
|||||||
+276
-88
@@ -207,6 +207,12 @@ type
|
|||||||
procedure EditDet1Change(Sender: TObject);
|
procedure EditDet1Change(Sender: TObject);
|
||||||
procedure EditSuiv1Change(Sender: TObject);
|
procedure EditSuiv1Change(Sender: TObject);
|
||||||
procedure CheckVerrouCarreClick(Sender: TObject);
|
procedure CheckVerrouCarreClick(Sender: TObject);
|
||||||
|
procedure EditDet2Change(Sender: TObject);
|
||||||
|
procedure EditSuiv2Change(Sender: TObject);
|
||||||
|
procedure EditDet3Change(Sender: TObject);
|
||||||
|
procedure EditSuiv3Change(Sender: TObject);
|
||||||
|
procedure EditDet4Change(Sender: TObject);
|
||||||
|
procedure EditSuiv4Change(Sender: TObject);
|
||||||
private
|
private
|
||||||
{ Déclarations privées }
|
{ Déclarations privées }
|
||||||
public
|
public
|
||||||
@@ -215,14 +221,32 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
const
|
const
|
||||||
TitreAig='Description de l''aiguillage ';
|
// variables du fichier de configuration "config-gl.cfg"
|
||||||
|
section_init='[section_init]';
|
||||||
|
nb_det_dist_ch='nb_det_dist';
|
||||||
|
IpV4_PC_ch='IpV4_PC';
|
||||||
|
retro_ch='retro';
|
||||||
|
Init_aig_ch='Init_Aig';
|
||||||
|
LAY_ch='Lay';
|
||||||
|
IPV4_INTERFACE_ch='IPV4_INTERFACE';
|
||||||
|
PROTOCOLE_SERIE_ch='PROTOCOLE_SERIE';
|
||||||
|
INTER_CAR_ch='INTER_CAR';
|
||||||
|
Tempo_maxi_ch='Tempo_maxi';
|
||||||
|
Entete_ch='Entete';
|
||||||
|
TCO_ch='TCO';
|
||||||
|
CDM_ch='CDM';
|
||||||
|
Serveur_interface_ch='Serveur_interface';
|
||||||
|
fenetre_ch='Fenetre';
|
||||||
|
NOTIF_VERSION_ch='NOTIF_VERSION';
|
||||||
|
verif_version_ch='verif_version';
|
||||||
|
Fonte_ch='Fonte';
|
||||||
|
|
||||||
var
|
var
|
||||||
FormConfig: TFormConfig;
|
FormConfig: TFormConfig;
|
||||||
AdresseIPCDM,AdresseIP,PortCom,recuCDM,residuCDM : string;
|
AdresseIPCDM,AdresseIP,PortCom,recuCDM,residuCDM : string;
|
||||||
portCDM,TempoOctet,TimoutMaxInterface,Valeur_entete,Port,protocole,NumPort,
|
portCDM,TempoOctet,TimoutMaxInterface,Valeur_entete,Port,protocole,NumPort,
|
||||||
LigneCliquee,AncLigneCliquee : integer;
|
LigneCliquee,AncLigneCliquee : integer;
|
||||||
clicliste : boolean;
|
ack_cdm,clicliste : boolean;
|
||||||
|
|
||||||
function config_com(s : string) : boolean;
|
function config_com(s : string) : boolean;
|
||||||
function envoi_CDM(s : string) : boolean;
|
function envoi_CDM(s : string) : boolean;
|
||||||
@@ -268,6 +292,7 @@ begin
|
|||||||
place_id:=s;
|
place_id:=s;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
// demande les services à CDM
|
||||||
function services_CDM : boolean;
|
function services_CDM : boolean;
|
||||||
var s,ss : string;
|
var s,ss : string;
|
||||||
i : integer;
|
i : integer;
|
||||||
@@ -291,8 +316,9 @@ begin
|
|||||||
delete(s,26,3);
|
delete(s,26,3);
|
||||||
insert(ss,s,26);
|
insert(ss,s,26);
|
||||||
//Affiche(s,clyellow);
|
//Affiche(s,clyellow);
|
||||||
|
|
||||||
envoi_CDM(s);sleep(100);
|
envoi_CDM(s);sleep(100);
|
||||||
if pos('_ACK',recuCDM)<>0 then
|
if ack_cdm then
|
||||||
begin
|
begin
|
||||||
s:='Services acceptés: ';
|
s:='Services acceptés: ';
|
||||||
if Srvc_Aig then s:=s+'- aiguillages ';
|
if Srvc_Aig then s:=s+'- aiguillages ';
|
||||||
@@ -302,7 +328,8 @@ begin
|
|||||||
if Srvc_sig then s:=s+'- état des signaux ';
|
if Srvc_sig then s:=s+'- état des signaux ';
|
||||||
Affiche(s,clYellow);
|
Affiche(s,clYellow);
|
||||||
end;
|
end;
|
||||||
services_CDM:=pos('_ACK',recuCDM)<>0;
|
services_CDM:=ack_cdm;
|
||||||
|
ack_cdm:=false;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure connecte_CDM;
|
procedure connecte_CDM;
|
||||||
@@ -329,14 +356,15 @@ begin
|
|||||||
Application.processMessages;
|
Application.processMessages;
|
||||||
until (i>10) or SocketCDM_connecte ;
|
until (i>10) or SocketCDM_connecte ;
|
||||||
//if i>30 then affiche('Timeout',clred);
|
//if i>30 then affiche('Timeout',clred);
|
||||||
if not(SocketCDM_connecte) then Affiche('Socket CDM non connecté',clOrange);
|
if not(SocketCDM_connecte) then begin Affiche('Socket CDM non connecté',clOrange);exit;end;
|
||||||
|
|
||||||
// connexion à CDM rail
|
// connexion à CDM rail
|
||||||
recuCDM:='';
|
recuCDM:='';
|
||||||
s:='C-C-00-0001-CMDGEN-_CNCT|000|';
|
s:='C-C-00-0001-CMDGEN-_CNCT|000|';
|
||||||
envoi_cdm(s);
|
envoi_cdm(s);
|
||||||
if pos('_ACK',recuCDM)<>0 then
|
if ack_cdm then
|
||||||
begin
|
begin
|
||||||
|
ack_cdm:=false;
|
||||||
Id_CDM:=copy(recuCDM,5,2); // récupère l'ID reçu de CDM, à utiliser dans toutes les futures trames
|
Id_CDM:=copy(recuCDM,5,2); // récupère l'ID reçu de CDM, à utiliser dans toutes les futures trames
|
||||||
recucdm:='';
|
recucdm:='';
|
||||||
s:='Connecté au serveur CDM rail avec l''ID='+Id_CDM;
|
s:='Connecté au serveur CDM rail avec l''ID='+Id_CDM;
|
||||||
@@ -537,7 +565,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
// modifie les fichiers de config en fonction du paramétrage
|
// modifie les fichiers de config en fonction du paramétrage
|
||||||
procedure genere_config2;
|
procedure genere_config;
|
||||||
var s: string;
|
var s: string;
|
||||||
fichier,fichierN : text;
|
fichier,fichierN : text;
|
||||||
i,j : integer;
|
i,j : integer;
|
||||||
@@ -572,79 +600,79 @@ begin
|
|||||||
// entête
|
// entête
|
||||||
copie_commentaire;
|
copie_commentaire;
|
||||||
// taille de la fonte
|
// taille de la fonte
|
||||||
writeln(fichierN,'Fonte=',TailleFonte);
|
writeln(fichierN,Fonte_ch+'=',TailleFonte);
|
||||||
copie_commentaire;
|
copie_commentaire;
|
||||||
|
|
||||||
// adresse ip et port de CDM
|
// adresse ip et port de CDM
|
||||||
writeln(fichierN,'IpV4_PC=',adresseIPCDM+':'+intToSTR(portCDM));
|
writeln(fichierN,IpV4_PC_ch+'=',adresseIPCDM+':'+intToSTR(portCDM));
|
||||||
copie_commentaire;
|
copie_commentaire;
|
||||||
|
|
||||||
// adresse ip interface XpressNet
|
// adresse ip interface XpressNet
|
||||||
writeln(fichierN,'IPV4_Interface=',adresseIP+':'+intToSTR(port));
|
writeln(fichierN,IPV4_Interface_ch+'=',adresseIP+':'+intToSTR(port));
|
||||||
copie_commentaire;
|
copie_commentaire;
|
||||||
|
|
||||||
// port com
|
// port com
|
||||||
writeln(fichierN,'Protocole_serie=',portcom);
|
writeln(fichierN,Protocole_serie_ch+'=',portcom);
|
||||||
copie_commentaire;
|
copie_commentaire;
|
||||||
|
|
||||||
// temporisation caractère TempoOctet
|
// temporisation caractère TempoOctet
|
||||||
writeln(fichierN,'Inter_Car=',IntToSTR(TempoOctet));
|
writeln(fichierN,Inter_Car_ch+'=',IntToSTR(TempoOctet));
|
||||||
copie_commentaire;
|
copie_commentaire;
|
||||||
|
|
||||||
// temporisation attente maximale interface
|
// temporisation attente maximale interface
|
||||||
writeln(fichierN,'Tempo_maxi=',IntToSTR(TimoutMaxInterface));
|
writeln(fichierN,Tempo_maxi_ch+'=',IntToSTR(TimoutMaxInterface));
|
||||||
copie_commentaire;
|
copie_commentaire;
|
||||||
|
|
||||||
// entete Valeur_entete
|
// entete Valeur_entete
|
||||||
writeln(fichierN,'Entete=',intToSTR(Valeur_entete));
|
writeln(fichierN,Entete_ch+'=',intToSTR(Valeur_entete));
|
||||||
copie_commentaire;
|
copie_commentaire;
|
||||||
|
|
||||||
// avec ou sans initialisation des aiguillages
|
// avec ou sans initialisation des aiguillages
|
||||||
writeln(fichierN,'Init_Aig=',IntToSTR(AvecInitAiguillages));
|
writeln(fichierN,Init_Aig_ch+'=',IntToSTR(AvecInitAiguillages));
|
||||||
copie_commentaire;
|
copie_commentaire;
|
||||||
|
|
||||||
// plein écran
|
// plein écran
|
||||||
writeln(fichierN,'Fenetre=',fenetre);
|
writeln(fichierN,Fenetre_ch+'=',fenetre);
|
||||||
copie_commentaire;
|
copie_commentaire;
|
||||||
|
|
||||||
// Nombre maxi de détecteurs considérés distants
|
// Nombre maxi de détecteurs considérés distants
|
||||||
writeln(fichierN,'Nb_Det_Dist=',Nb_Det_Dist);
|
writeln(fichierN,nb_det_dist_ch+'=',Nb_Det_Dist);
|
||||||
copie_commentaire;
|
copie_commentaire;
|
||||||
|
|
||||||
|
|
||||||
// Vérification des versions au démarrage
|
// Vérification des versions au démarrage
|
||||||
if verifVersion then s:='1' else s:='0';
|
if verifVersion then s:='1' else s:='0';
|
||||||
writeln(fichierN,'verif_version=',s);
|
writeln(fichierN,verif_version_ch+'=',s);
|
||||||
copie_commentaire;
|
copie_commentaire;
|
||||||
|
|
||||||
// Notification de nouvelle version
|
// Notification de nouvelle version
|
||||||
if notificationVersion then s:='1' else s:='0';
|
if notificationVersion then s:='1' else s:='0';
|
||||||
writeln(fichierN,'notif_version=',s);
|
writeln(fichierN,notif_version_ch+'=',s);
|
||||||
copie_commentaire;
|
copie_commentaire;
|
||||||
|
|
||||||
// Avec TCO
|
// Avec TCO
|
||||||
if AvecTCO then s:='1' else s:='0';
|
if AvecTCO then s:='1' else s:='0';
|
||||||
writeln(fichierN,'TCO=',s);
|
writeln(fichierN,TCO_ch+'=',s);
|
||||||
copie_commentaire;
|
copie_commentaire;
|
||||||
|
|
||||||
// lancement de CDM
|
// lancement de CDM
|
||||||
if LanceCDM then s:='1' else s:='0';
|
if LanceCDM then s:='1' else s:='0';
|
||||||
writeln(fichierN,'CDM=',s);
|
writeln(fichierN,CDM_ch+'=',s);
|
||||||
copie_commentaire;
|
copie_commentaire;
|
||||||
|
|
||||||
// Nom du LAY
|
// Nom du LAY
|
||||||
writeln(fichierN,'LAY=',Lay);
|
writeln(fichierN,lay_ch+'=',Lay);
|
||||||
copie_commentaire;
|
copie_commentaire;
|
||||||
|
|
||||||
// Serveur d'interface de CDM
|
// Serveur d'interface de CDM
|
||||||
writeln(fichierN,'Serveur_interface=',intToSTR(ServeurInterfaceCDM));
|
writeln(fichierN,Serveur_interface_ch+'=',intToSTR(ServeurInterfaceCDM));
|
||||||
copie_commentaire;
|
copie_commentaire;
|
||||||
|
|
||||||
// Serveur de rétrosignalisation Lenz de CDM
|
// Serveur de rétrosignalisation Lenz de CDM
|
||||||
writeln(fichierN,'retro=',intToSTR(ServeurRetroCDM));
|
writeln(fichierN,retro_ch+'=',intToSTR(ServeurRetroCDM));
|
||||||
copie_commentaire;
|
copie_commentaire;
|
||||||
|
|
||||||
// section init est copié ici
|
// [section init] est copié ici
|
||||||
|
if pos(section_init,lowercase(s))=0 then writeln(fichierN,section_init);
|
||||||
writeln(fichierN,s);
|
writeln(fichierN,s);
|
||||||
// valeurs des initialisations
|
// valeurs des initialisations
|
||||||
repeat
|
repeat
|
||||||
@@ -751,7 +779,7 @@ begin
|
|||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
// sauvegarder la config dans les fichiers cfg
|
||||||
procedure Sauve_config;
|
procedure Sauve_config;
|
||||||
var i,erreur : integer;
|
var i,erreur : integer;
|
||||||
s : string;
|
s : string;
|
||||||
@@ -876,7 +904,7 @@ begin
|
|||||||
if change_srv then services_CDM;
|
if change_srv then services_CDM;
|
||||||
|
|
||||||
// générer le fichiers config.cfg et clieng-GL.cfg
|
// générer le fichiers config.cfg et clieng-GL.cfg
|
||||||
genere_config2;
|
genere_config;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -1086,7 +1114,7 @@ begin
|
|||||||
|
|
||||||
RE_ColorLine(Formconfig.RichAig,ligneCliquee,Clyellow);
|
RE_ColorLine(Formconfig.RichAig,ligneCliquee,Clyellow);
|
||||||
|
|
||||||
ss:=TitreAig+InttoSTr(Adresse);
|
ss:='Description de l''aiguillage '+InttoSTr(Adresse);
|
||||||
formconfig.LabelAdresse.Caption:= ss;
|
formconfig.LabelAdresse.Caption:= ss;
|
||||||
|
|
||||||
tjd:=pos('TJD',s)<>0 ;
|
tjd:=pos('TJD',s)<>0 ;
|
||||||
@@ -1760,61 +1788,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure change_det1;
|
|
||||||
var s : string;
|
|
||||||
i,erreur : integer;
|
|
||||||
begin
|
|
||||||
if clicliste then exit;
|
|
||||||
|
|
||||||
if FormConfig.PageControl.ActivePage=FormConfig.TabSheetSig then
|
|
||||||
with Formconfig do
|
|
||||||
begin
|
|
||||||
s:=EditDet1.Text;
|
|
||||||
Val(s,i,erreur);
|
|
||||||
if erreur<>0 then begin LabelInfo.caption:='Erreur détecteur1 ';exit;end;
|
|
||||||
LabelInfo.caption:=' ';
|
|
||||||
feux[lignecliquee+1].Adr_det1:=i;
|
|
||||||
s:=encode_sig(lignecliquee+1);
|
|
||||||
RichSig.Lines[lignecliquee]:=s;
|
|
||||||
feux[lignecliquee+1].modifie:=true;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure change_Suiv1;
|
|
||||||
var s : string;
|
|
||||||
i,erreur : integer;
|
|
||||||
B : char;
|
|
||||||
begin
|
|
||||||
if clicliste then exit;
|
|
||||||
|
|
||||||
if FormConfig.PageControl.ActivePage=FormConfig.TabSheetSig then
|
|
||||||
with Formconfig do
|
|
||||||
begin
|
|
||||||
s:=EditSuiv1.Text;
|
|
||||||
if s='' then begin LabelInfo.caption:='Erreur élément suivant 1';exit;end;
|
|
||||||
Val(s,i,erreur);
|
|
||||||
//if erreur<>0 then
|
|
||||||
if erreur<>0 then
|
|
||||||
begin
|
|
||||||
if (s[erreur]='A') and (erreur=1) then
|
|
||||||
begin
|
|
||||||
feux[lignecliquee+1].Btype_suiv1:=2; // type de l'élément suivant (1=détecteur 2=aig ou TJD ou TJS 4=tri
|
|
||||||
delete(s,erreur,1);
|
|
||||||
Val(s,i,erreur);
|
|
||||||
end
|
|
||||||
else begin LabelInfo.caption:='Erreur élément suivant 1';exit;end;
|
|
||||||
end
|
|
||||||
else feux[lignecliquee+1].Btype_suiv1:=1;
|
|
||||||
|
|
||||||
LabelInfo.caption:=' ';
|
|
||||||
|
|
||||||
feux[lignecliquee+1].Adr_el_suiv1:=i;
|
|
||||||
s:=encode_sig(lignecliquee+1);
|
|
||||||
RichSig.Lines[lignecliquee]:=s;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
procedure TFormConfig.EditPointe_BGChange(Sender: TObject);
|
procedure TFormConfig.EditPointe_BGChange(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
@@ -1898,16 +1871,78 @@ begin
|
|||||||
clicliste:=false;
|
clicliste:=false;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
procedure TFormConfig.EditDet1Change(Sender: TObject);
|
procedure TFormConfig.EditDet1Change(Sender: TObject);
|
||||||
|
var s : string;
|
||||||
|
i,erreur : integer;
|
||||||
begin
|
begin
|
||||||
change_det1;
|
if clicliste then exit;
|
||||||
|
|
||||||
|
if FormConfig.PageControl.ActivePage=FormConfig.TabSheetSig then
|
||||||
|
with Formconfig do
|
||||||
|
begin
|
||||||
|
s:=EditDet1.Text;
|
||||||
|
Val(s,i,erreur);
|
||||||
|
if erreur<>0 then begin LabelInfo.caption:='Erreur détecteur1 ';exit;end;
|
||||||
|
LabelInfo.caption:=' ';
|
||||||
|
feux[lignecliquee+1].Adr_det1:=i;
|
||||||
|
s:=encode_sig(lignecliquee+1);
|
||||||
|
RichSig.Lines[lignecliquee]:=s;
|
||||||
|
feux[lignecliquee+1].modifie:=true;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TFormConfig.EditSuiv1Change(Sender: TObject);
|
procedure TFormConfig.EditSuiv1Change(Sender: TObject);
|
||||||
|
var s : string;
|
||||||
|
i,erreur : integer;
|
||||||
|
B : char;
|
||||||
begin
|
begin
|
||||||
change_Suiv1;
|
if clicliste then exit;
|
||||||
|
|
||||||
|
if FormConfig.PageControl.ActivePage=FormConfig.TabSheetSig then
|
||||||
|
with Formconfig do
|
||||||
|
begin
|
||||||
|
s:=EditSuiv1.Text;
|
||||||
|
if s='' then begin LabelInfo.caption:='Erreur élément suivant 1';exit;end;
|
||||||
|
Val(s,i,erreur);
|
||||||
|
//if erreur<>0 then
|
||||||
|
if erreur<>0 then
|
||||||
|
begin
|
||||||
|
if (s[erreur]='A') and (erreur=1) then
|
||||||
|
begin
|
||||||
|
feux[lignecliquee+1].Btype_suiv1:=2; // type de l'élément suivant (1=détecteur 2=aig ou TJD ou TJS 4=tri
|
||||||
|
delete(s,erreur,1);
|
||||||
|
Val(s,i,erreur);
|
||||||
|
end
|
||||||
|
else begin LabelInfo.caption:='Erreur élément suivant 1';exit;end;
|
||||||
|
end
|
||||||
|
else feux[lignecliquee+1].Btype_suiv1:=1;
|
||||||
|
|
||||||
|
LabelInfo.caption:=' ';
|
||||||
|
|
||||||
|
feux[lignecliquee+1].Adr_el_suiv1:=i;
|
||||||
|
s:=encode_sig(lignecliquee+1);
|
||||||
|
RichSig.Lines[lignecliquee]:=s;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TFormConfig.EditDet2Change(Sender: TObject);
|
||||||
|
var s : string;
|
||||||
|
i,erreur : integer;
|
||||||
|
begin
|
||||||
|
if clicliste then exit;
|
||||||
|
|
||||||
|
if FormConfig.PageControl.ActivePage=FormConfig.TabSheetSig then
|
||||||
|
with Formconfig do
|
||||||
|
begin
|
||||||
|
s:=EditDet2.Text;
|
||||||
|
Val(s,i,erreur);
|
||||||
|
//if erreur<>0 then begin LabelInfo.caption:='Erreur détecteur2 ';exit;end;
|
||||||
|
LabelInfo.caption:=' ';
|
||||||
|
feux[lignecliquee+1].Adr_det2:=i;
|
||||||
|
s:=encode_sig(lignecliquee+1);
|
||||||
|
RichSig.Lines[lignecliquee]:=s;
|
||||||
|
feux[lignecliquee+1].modifie:=true;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TFormConfig.CheckVerrouCarreClick(Sender: TObject);
|
procedure TFormConfig.CheckVerrouCarreClick(Sender: TObject);
|
||||||
@@ -1924,7 +1959,160 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TFormConfig.EditSuiv2Change(Sender: TObject);
|
||||||
|
var s : string;
|
||||||
|
erreur,Btype,Adr : integer;
|
||||||
|
B : char;
|
||||||
|
begin
|
||||||
|
if clicliste then exit;
|
||||||
|
|
||||||
|
if FormConfig.PageControl.ActivePage=FormConfig.TabSheetSig then
|
||||||
|
with Formconfig do
|
||||||
|
begin
|
||||||
|
s:=EditSuiv2.Text;
|
||||||
|
if s='' then
|
||||||
|
begin
|
||||||
|
Btype:=0;
|
||||||
|
Adr:=0;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
Val(s,Adr,erreur);
|
||||||
|
if (erreur<>0) and (s<>'') then
|
||||||
|
begin
|
||||||
|
if (s[erreur]='A') and (erreur=1) then
|
||||||
|
begin
|
||||||
|
Btype:=2; // type de l'élément suivant (1=détecteur 2=aig ou TJD ou TJS 4=tri
|
||||||
|
delete(s,erreur,1);
|
||||||
|
Val(s,Adr,erreur);
|
||||||
|
end
|
||||||
|
else begin LabelInfo.caption:='Erreur élément suivant 2';exit;end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
feux[lignecliquee+1].Btype_suiv2:=Btype;
|
||||||
|
feux[lignecliquee+1].Adr_el_suiv2:=Adr;
|
||||||
|
LabelInfo.caption:=' ';
|
||||||
|
s:=encode_sig(lignecliquee+1);
|
||||||
|
RichSig.Lines[lignecliquee]:=s;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TFormConfig.EditDet3Change(Sender: TObject);
|
||||||
|
var s : string;
|
||||||
|
i,erreur : integer;
|
||||||
|
begin
|
||||||
|
if clicliste then exit;
|
||||||
|
|
||||||
|
if FormConfig.PageControl.ActivePage=FormConfig.TabSheetSig then
|
||||||
|
with Formconfig do
|
||||||
|
begin
|
||||||
|
s:=EditDet3.Text;
|
||||||
|
Val(s,i,erreur);
|
||||||
|
// if erreur<>0 then begin LabelInfo.caption:='Erreur détecteur3 ';exit;end;
|
||||||
|
LabelInfo.caption:=' ';
|
||||||
|
feux[lignecliquee+1].Adr_det3:=i;
|
||||||
|
s:=encode_sig(lignecliquee+1);
|
||||||
|
RichSig.Lines[lignecliquee]:=s;
|
||||||
|
feux[lignecliquee+1].modifie:=true;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TFormConfig.EditSuiv3Change(Sender: TObject);
|
||||||
|
var s : string;
|
||||||
|
erreur,Btype,Adr : integer;
|
||||||
|
B : char;
|
||||||
|
begin
|
||||||
|
if clicliste then exit;
|
||||||
|
|
||||||
|
if FormConfig.PageControl.ActivePage=FormConfig.TabSheetSig then
|
||||||
|
with Formconfig do
|
||||||
|
begin
|
||||||
|
s:=EditSuiv3.Text;
|
||||||
|
if s='' then
|
||||||
|
begin
|
||||||
|
Btype:=0;
|
||||||
|
Adr:=0;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
Val(s,Adr,erreur);
|
||||||
|
if (erreur<>0) and (s<>'') then
|
||||||
|
begin
|
||||||
|
if (s[erreur]='A') and (erreur=1) then
|
||||||
|
begin
|
||||||
|
Btype:=2; // type de l'élément suivant (1=détecteur 2=aig ou TJD ou TJS 4=tri
|
||||||
|
delete(s,erreur,1);
|
||||||
|
Val(s,Adr,erreur);
|
||||||
|
end
|
||||||
|
else begin LabelInfo.caption:='Erreur élément suivant 3';exit;end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
feux[lignecliquee+1].Btype_suiv3:=Btype;
|
||||||
|
feux[lignecliquee+1].Adr_el_suiv3:=Adr;
|
||||||
|
LabelInfo.caption:=' ';
|
||||||
|
s:=encode_sig(lignecliquee+1);
|
||||||
|
RichSig.Lines[lignecliquee]:=s;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TFormConfig.EditDet4Change(Sender: TObject);
|
||||||
|
var s : string;
|
||||||
|
i,erreur : integer;
|
||||||
|
begin
|
||||||
|
if clicliste then exit;
|
||||||
|
|
||||||
|
if FormConfig.PageControl.ActivePage=FormConfig.TabSheetSig then
|
||||||
|
with Formconfig do
|
||||||
|
begin
|
||||||
|
s:=EditDet4.Text;
|
||||||
|
Val(s,i,erreur);
|
||||||
|
//if erreur<>0 then begin LabelInfo.caption:='Erreur détecteur4 ';exit;end;
|
||||||
|
LabelInfo.caption:=' ';
|
||||||
|
feux[lignecliquee+1].Adr_det4:=i;
|
||||||
|
s:=encode_sig(lignecliquee+1);
|
||||||
|
RichSig.Lines[lignecliquee]:=s;
|
||||||
|
feux[lignecliquee+1].modifie:=true;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TFormConfig.EditSuiv4Change(Sender: TObject);
|
||||||
|
var s : string;
|
||||||
|
erreur,Btype,Adr : integer;
|
||||||
|
B : char;
|
||||||
|
begin
|
||||||
|
if clicliste then exit;
|
||||||
|
|
||||||
|
if FormConfig.PageControl.ActivePage=FormConfig.TabSheetSig then
|
||||||
|
with Formconfig do
|
||||||
|
begin
|
||||||
|
s:=EditSuiv4.Text;
|
||||||
|
if s='' then
|
||||||
|
begin
|
||||||
|
Btype:=0;
|
||||||
|
Adr:=0;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
Val(s,Adr,erreur);
|
||||||
|
if (erreur<>0) and (s<>'') then
|
||||||
|
begin
|
||||||
|
if (s[erreur]='A') and (erreur=1) then
|
||||||
|
begin
|
||||||
|
Btype:=2; // type de l'élément suivant (1=détecteur 2=aig ou TJD ou TJS 4=tri
|
||||||
|
delete(s,erreur,1);
|
||||||
|
Val(s,Adr,erreur);
|
||||||
|
end
|
||||||
|
else begin LabelInfo.caption:='Erreur élément suivant 4';exit;end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
feux[lignecliquee+1].Btype_suiv4:=Btype;
|
||||||
|
feux[lignecliquee+1].Adr_el_suiv4:=Adr;
|
||||||
|
LabelInfo.caption:=' ';
|
||||||
|
s:=encode_sig(lignecliquee+1);
|
||||||
|
RichSig.Lines[lignecliquee]:=s;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
+142
-73
@@ -143,6 +143,7 @@ type
|
|||||||
procedure ButtonAffTCOClick(Sender: TObject);
|
procedure ButtonAffTCOClick(Sender: TObject);
|
||||||
procedure ButtonLanceCDMClick(Sender: TObject);
|
procedure ButtonLanceCDMClick(Sender: TObject);
|
||||||
procedure Affichefentredebug1Click(Sender: TObject);
|
procedure Affichefentredebug1Click(Sender: TObject);
|
||||||
|
procedure Button1Click(Sender: TObject);
|
||||||
private
|
private
|
||||||
{ Déclarations privées }
|
{ Déclarations privées }
|
||||||
procedure DoHint(Sender : Tobject);
|
procedure DoHint(Sender : Tobject);
|
||||||
@@ -289,7 +290,7 @@ var
|
|||||||
mod_branches,mod_act : array[1..100] of string;
|
mod_branches,mod_act : array[1..100] of string;
|
||||||
// l'indice du tableau aiguillage est son adresse
|
// l'indice du tableau aiguillage est son adresse
|
||||||
aiguillage : array[0..MaxAcc] of Taiguillage;
|
aiguillage : array[0..MaxAcc] of Taiguillage;
|
||||||
// signaux de la fenêtre de droite - L'index du tableau n'est pas l'adresse du feu
|
// signaux - L'index du tableau n'est pas l'adresse du feu
|
||||||
feux : array[1..MaxAcc] of record
|
feux : array[1..MaxAcc] of record
|
||||||
adresse, aspect : integer; // adresse du feu, aspect (2 feux..9 feux 12=direction 2 feux .. 16=direction 6 feux)
|
adresse, aspect : integer; // adresse du feu, aspect (2 feux..9 feux 12=direction 2 feux .. 16=direction 6 feux)
|
||||||
Img : TImage; // Pointeur sur structure TImage du feu
|
Img : TImage; // Pointeur sur structure TImage du feu
|
||||||
@@ -413,6 +414,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
brush.Color:=couleur;
|
brush.Color:=couleur;
|
||||||
Pen.Color:=clBlack;
|
Pen.Color:=clBlack;
|
||||||
|
//Affiche('clignote '+IntToSTR(x)+' '+intToSTR(y),clyellow);
|
||||||
Ellipse(x-rayon,y-rayon,x+rayon,y+rayon);
|
Ellipse(x-rayon,y-rayon,x+rayon,y+rayon);
|
||||||
end;
|
end;
|
||||||
//Affiche(IntToSTR(y),clyellow);
|
//Affiche(IntToSTR(y),clyellow);
|
||||||
@@ -1490,11 +1492,12 @@ begin
|
|||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// pilotage par USB ou par réseau de la centrale
|
// pilotage par USB ou par éthernet de la centrale
|
||||||
// test si pilotage inversé
|
|
||||||
// Affiche('Accessoire '+intToSTR(adresse),clLime);
|
// Affiche('Accessoire '+intToSTR(adresse),clLime);
|
||||||
if hors_tension2=false then
|
if (hors_tension2=false) and (portCommOuvert or parSocketLenz) then
|
||||||
begin
|
begin
|
||||||
|
// test si pilotage aiguillage inversé
|
||||||
if aiguillage[adresse].inversion=1 then
|
if aiguillage[adresse].inversion=1 then
|
||||||
begin
|
begin
|
||||||
if octet=1 then octet:=2 else octet:=1;
|
if octet=1 then octet:=2 else octet:=1;
|
||||||
@@ -1595,8 +1598,6 @@ begin
|
|||||||
SetBit:=n or (1 shl position);
|
SetBit:=n or (1 shl position);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// renvoie la chaîne de l'état du signal
|
// renvoie la chaîne de l'état du signal
|
||||||
function chaine_signal(etat : word) : string;
|
function chaine_signal(etat : word) : string;
|
||||||
var aspect,combine : word;
|
var aspect,combine : word;
|
||||||
@@ -1780,16 +1781,16 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{==========================================================================
|
{==========================================================================
|
||||||
envoie les données au décodeur CDF pour un signal
|
envoie les données au décodeur CDF
|
||||||
===========================================================================*}
|
===========================================================================*}
|
||||||
procedure envoi_CDF(adresse : integer);
|
procedure envoi_CDF(adresse : integer);
|
||||||
var index : integer;
|
var index : integer;
|
||||||
code,aspect,combine : word;
|
code,aspect,combine : word;
|
||||||
s : string;
|
s : string;
|
||||||
begin
|
begin
|
||||||
//***if (ancien_tablo_signalCplx[adresse]<>EtatSignalCplx[adresse]) then //; && (stop_cmd==FALSE))
|
if (ancien_tablo_signalCplx[adresse]<>EtatSignalCplx[adresse]) then //; && (stop_cmd==FALSE))
|
||||||
begin
|
begin
|
||||||
//***ancien_tablo_signalCplx[adresse]:=EtatSignalCplx[adresse];
|
ancien_tablo_signalCplx[adresse]:=EtatSignalCplx[adresse];
|
||||||
code:=EtatSignalCplx[adresse];
|
code:=EtatSignalCplx[adresse];
|
||||||
code_to_aspect(code,aspect,combine);
|
code_to_aspect(code,aspect,combine);
|
||||||
s:='Signal CDF: ad'+IntToSTR(adresse)+'='+chaine_signal(code);
|
s:='Signal CDF: ad'+IntToSTR(adresse)+'='+chaine_signal(code);
|
||||||
@@ -1810,7 +1811,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{==========================================================================
|
{==========================================================================
|
||||||
envoie les données au décodeur LEB pour un signal
|
envoie les données au décodeur LEB
|
||||||
===========================================================================*}
|
===========================================================================*}
|
||||||
procedure envoi_LEB(adresse : integer);
|
procedure envoi_LEB(adresse : integer);
|
||||||
var code,aspect,combine : word;
|
var code,aspect,combine : word;
|
||||||
@@ -1832,9 +1833,9 @@ var code,aspect,combine : word;
|
|||||||
end;
|
end;
|
||||||
begin
|
begin
|
||||||
|
|
||||||
//***if (ancien_tablo_signalCplx[adresse]<>EtatSignalCplx[adresse]) then //; && (stop_cmd==FALSE))
|
if (ancien_tablo_signalCplx[adresse]<>EtatSignalCplx[adresse]) then //; && (stop_cmd==FALSE))
|
||||||
begin
|
begin
|
||||||
//***ancien_tablo_signalCplx[adresse]:=EtatSignalCplx[adresse];
|
ancien_tablo_signalCplx[adresse]:=EtatSignalCplx[adresse];
|
||||||
code:=EtatSignalCplx[adresse];
|
code:=EtatSignalCplx[adresse];
|
||||||
code_to_aspect(code,aspect,combine);
|
code_to_aspect(code,aspect,combine);
|
||||||
s:='Signal LEB: ad'+IntToSTR(adresse)+'='+chaine_signal(code);
|
s:='Signal LEB: ad'+IntToSTR(adresse)+'='+chaine_signal(code);
|
||||||
@@ -1909,9 +1910,9 @@ begin
|
|||||||
//index:=Index_feu(adresse); // tranforme l'adresse du feu en index tableau
|
//index:=Index_feu(adresse); // tranforme l'adresse du feu en index tableau
|
||||||
//code:=feux[index].aspect; // aspect du feu;
|
//code:=feux[index].aspect; // aspect du feu;
|
||||||
|
|
||||||
//***if (ancien_tablo_signalCplx[adresse]<>EtatSignalCplx[adresse]) then
|
if (ancien_tablo_signalCplx[adresse]<>EtatSignalCplx[adresse]) then
|
||||||
begin
|
begin
|
||||||
//***ancien_tablo_signalCplx[adresse]:=EtatSignalCplx[adresse];
|
ancien_tablo_signalCplx[adresse]:=EtatSignalCplx[adresse];
|
||||||
code:=EtatSignalCplx[adresse];
|
code:=EtatSignalCplx[adresse];
|
||||||
code_to_aspect(code,aspect,combine);
|
code_to_aspect(code,aspect,combine);
|
||||||
s:='Signal NMRA: ad'+IntToSTR(adresse)+'='+chaine_signal(code);
|
s:='Signal NMRA: ad'+IntToSTR(adresse)+'='+chaine_signal(code);
|
||||||
@@ -1955,9 +1956,9 @@ var modele,index: integer ;
|
|||||||
begin
|
begin
|
||||||
index:=Index_feu(adresse); // tranforme l'adresse du feu en index tableau
|
index:=Index_feu(adresse); // tranforme l'adresse du feu en index tableau
|
||||||
|
|
||||||
//***if (ancien_tablo_signalCplx[adresse]<>EtatSignalCplx[adresse]) then
|
if (ancien_tablo_signalCplx[adresse]<>EtatSignalCplx[adresse]) then
|
||||||
begin
|
begin
|
||||||
//***ancien_tablo_signalCplx[adresse]:=EtatSignalCplx[adresse];
|
ancien_tablo_signalCplx[adresse]:=EtatSignalCplx[adresse];
|
||||||
code:=EtatSignalCplx[adresse];
|
code:=EtatSignalCplx[adresse];
|
||||||
code_to_aspect(code,aspect,combine);
|
code_to_aspect(code,aspect,combine);
|
||||||
s:='Signal Unisemaf: ad'+IntToSTR(adresse)+'='+chaine_signal(code);
|
s:='Signal Unisemaf: ad'+IntToSTR(adresse)+'='+chaine_signal(code);
|
||||||
@@ -2248,9 +2249,9 @@ procedure envoi_LDT(adresse : integer);
|
|||||||
var code,aspect,combine,mode : word;
|
var code,aspect,combine,mode : word;
|
||||||
s : string;
|
s : string;
|
||||||
begin
|
begin
|
||||||
//***if (ancien_tablo_signalCplx[adresse]<>EtatSignalCplx[adresse]) then //; && (stop_cmd==FALSE))
|
if (ancien_tablo_signalCplx[adresse]<>EtatSignalCplx[adresse]) then //; && (stop_cmd==FALSE))
|
||||||
begin
|
begin
|
||||||
//***ancien_tablo_signalCplx[adresse]:=EtatSignalCplx[adresse];
|
ancien_tablo_signalCplx[adresse]:=EtatSignalCplx[adresse];
|
||||||
code:=EtatSignalCplx[adresse];
|
code:=EtatSignalCplx[adresse];
|
||||||
code_to_aspect(code,aspect,combine);
|
code_to_aspect(code,aspect,combine);
|
||||||
s:='Signal LDT: ad'+IntToSTR(adresse)+'='+chaine_signal(code);
|
s:='Signal LDT: ad'+IntToSTR(adresse)+'='+chaine_signal(code);
|
||||||
@@ -2323,9 +2324,8 @@ var aspect,code,combine : word;
|
|||||||
ralrap, jau ,Ancralrap,Ancjau : boolean;
|
ralrap, jau ,Ancralrap,Ancjau : boolean;
|
||||||
s : string;
|
s : string;
|
||||||
begin
|
begin
|
||||||
//***if (ancien_tablo_signalCplx[adresse]<>EtatSignalCplx[adresse]) then //; && (stop_cmd==FALSE))
|
if (ancien_tablo_signalCplx[adresse]<>EtatSignalCplx[adresse]) then //; && (stop_cmd==FALSE))
|
||||||
begin
|
begin
|
||||||
|
|
||||||
code:=EtatSignalCplx[adresse];
|
code:=EtatSignalCplx[adresse];
|
||||||
code_to_aspect(code,aspect,combine);
|
code_to_aspect(code,aspect,combine);
|
||||||
s:='Signal Bahn: ad'+IntToSTR(adresse)+'='+chaine_signal(code);
|
s:='Signal Bahn: ad'+IntToSTR(adresse)+'='+chaine_signal(code);
|
||||||
@@ -2367,7 +2367,7 @@ begin
|
|||||||
sleep(40);
|
sleep(40);
|
||||||
pilote_ACC(adresse+Combine,2,feu) ;
|
pilote_ACC(adresse+Combine,2,feu) ;
|
||||||
end;
|
end;
|
||||||
|
ancien_tablo_signalCplx[adresse]:=EtatSignalCplx[adresse];
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -3456,12 +3456,13 @@ begin
|
|||||||
IndexBranche_trouve:=i;
|
IndexBranche_trouve:=i;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
procedure lit_config;
|
procedure lit_config;
|
||||||
var s,sa,chaine,SOrigine: string;
|
var s,sa,chaine,SOrigine: string;
|
||||||
c,paig : char;
|
c,paig : char;
|
||||||
tec,tjd,tjs,s2,trouve,triple,debugConfig,multiple,fini,finifeux,trouve_NbDetDist,trouve_ipv4_PC : boolean;
|
tec,tjd,tjs,s2,trouve,triple,debugConfig,multiple,fini,finifeux,trouve_NbDetDist,trouve_ipv4_PC,trouve_retro,
|
||||||
|
trouve_sec_init,trouve_init_aig,trouve_lay,trouve_IPV4_INTERFACE,trouve_PROTOCOLE_SERIE,trouve_INTER_CAR,
|
||||||
|
trouve_Tempo_maxi,trouve_Entete,trouve_tco,trouve_cdm,trouve_Serveur_interface,trouve_fenetre,
|
||||||
|
trouve_NOTIF_VERSION,trouve_verif_version,trouve_fonte : boolean;
|
||||||
bd,virgule,i_detect,i,erreur,aig,aig2,detect,offset,index, adresse,j,position,temporisation,invers,indexPointe,indexDevie,indexDroit,
|
bd,virgule,i_detect,i,erreur,aig,aig2,detect,offset,index, adresse,j,position,temporisation,invers,indexPointe,indexDevie,indexDroit,
|
||||||
ComptEl,Compt_IT,Num_Element,k,modele,adr,adr2,erreur2,l,t,Nligne,postriple,
|
ComptEl,Compt_IT,Num_Element,k,modele,adr,adr2,erreur2,l,t,Nligne,postriple,
|
||||||
postjd,postjs,nv,it : integer;
|
postjd,postjs,nv,it : integer;
|
||||||
@@ -3511,6 +3512,23 @@ begin
|
|||||||
debugConfig:=false;
|
debugConfig:=false;
|
||||||
trouve_NbDetDist:=false;
|
trouve_NbDetDist:=false;
|
||||||
trouve_ipv4_PC:=false;
|
trouve_ipv4_PC:=false;
|
||||||
|
trouve_retro:=false;
|
||||||
|
trouve_sec_init:=false;
|
||||||
|
trouve_init_aig:=false;
|
||||||
|
trouve_INTER_CAR:=false;
|
||||||
|
trouve_entete:=false;
|
||||||
|
trouve_IPV4_INTERFACE:=false;
|
||||||
|
trouve_lay:=false;
|
||||||
|
trouve_Tempo_maxi:=false;
|
||||||
|
trouve_PROTOCOLE_SERIE:=false;
|
||||||
|
trouve_TCO:=false;
|
||||||
|
trouve_Serveur_interface:=false;
|
||||||
|
trouve_cdm:=false;
|
||||||
|
trouve_NOTIF_VERSION:=false;
|
||||||
|
trouve_fenetre:=false;
|
||||||
|
trouve_verif_version:=false;
|
||||||
|
trouve_Fonte:=false;
|
||||||
|
|
||||||
Nb_Det_Dist:=3;
|
Nb_Det_Dist:=3;
|
||||||
// initialisation des aiguillages avec des valeurs par défaut
|
// initialisation des aiguillages avec des valeurs par défaut
|
||||||
for i:=1 to MaxAcc do
|
for i:=1 to MaxAcc do
|
||||||
@@ -3544,11 +3562,12 @@ begin
|
|||||||
repeat
|
repeat
|
||||||
s:=lit_ligne;
|
s:=lit_ligne;
|
||||||
//affiche(s,cllime);
|
//affiche(s,cllime);
|
||||||
sa:='FONTE=';
|
sa:=uppercase(Fonte_ch)+'=';
|
||||||
i:=pos(sa,s);
|
i:=pos(sa,s);
|
||||||
if i<>0 then
|
if i<>0 then
|
||||||
begin
|
begin
|
||||||
inc(nv);
|
inc(nv);
|
||||||
|
trouve_fonte:=true;
|
||||||
delete(s,i,length(sa));
|
delete(s,i,length(sa));
|
||||||
TailleFonte:=StrToINT(s);
|
TailleFonte:=StrToINT(s);
|
||||||
with FormPrinc.ListBox1 do
|
with FormPrinc.ListBox1 do
|
||||||
@@ -3559,7 +3578,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
// adresse ip et port de CDM
|
// adresse ip et port de CDM
|
||||||
sa:='IPV4_PC=';
|
sa:=uppercase(IpV4_PC_ch)+'=';
|
||||||
i:=pos(sa,s);
|
i:=pos(sa,s);
|
||||||
if i<>0 then
|
if i<>0 then
|
||||||
begin
|
begin
|
||||||
@@ -3572,11 +3591,12 @@ begin
|
|||||||
|
|
||||||
// adresse ip et port de la centrale
|
// adresse ip et port de la centrale
|
||||||
// AfficheDet:=true;
|
// AfficheDet:=true;
|
||||||
sa:='IPV4_INTERFACE=';
|
sa:=uppercase(IPV4_INTERFACE_ch)+'=';
|
||||||
i:=pos(sa,s);
|
i:=pos(sa,s);
|
||||||
if i<>0 then
|
if i<>0 then
|
||||||
begin
|
begin
|
||||||
inc(nv);
|
inc(nv);
|
||||||
|
trouve_IPV4_INTERFACE:=true;
|
||||||
delete(s,i,length(sa));
|
delete(s,i,length(sa));
|
||||||
i:=pos(':',s);
|
i:=pos(':',s);
|
||||||
if i<>0 then begin adresseIP:=copy(s,1,i-1);Delete(s,1,i);port:=StrToINT(s);end
|
if i<>0 then begin adresseIP:=copy(s,1,i-1);Delete(s,1,i);port:=StrToINT(s);end
|
||||||
@@ -3584,45 +3604,49 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
// configuration du port com
|
// configuration du port com
|
||||||
sa:='PROTOCOLE_SERIE=';
|
sa:=uppercase(PROTOCOLE_SERIE_ch)+'=';
|
||||||
i:=pos(sa,s);
|
i:=pos(sa,s);
|
||||||
if i<>0 then
|
if i<>0 then
|
||||||
begin
|
begin
|
||||||
inc(nv);
|
inc(nv);
|
||||||
|
trouve_PROTOCOLE_SERIE:=true;
|
||||||
delete(s,i,length(sa));
|
delete(s,i,length(sa));
|
||||||
if not(config_com(s)) then Affiche('Erreur port com mal déclaré : '+s,clred);
|
if not(config_com(s)) then Affiche('Erreur port com mal déclaré : '+s,clred);
|
||||||
portcom:=s;
|
portcom:=s;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// temporisation entre 2 caractères
|
// temporisation entre 2 caractères
|
||||||
sa:='INTER_CAR=';
|
sa:=uppercase(INTER_CAR_ch)+'=';
|
||||||
i:=pos(sa,s);
|
i:=pos(sa,s);
|
||||||
if i<>0 then
|
if i<>0 then
|
||||||
begin
|
begin
|
||||||
inc(nv);
|
inc(nv);
|
||||||
delete(s,i,length(sa));
|
delete(s,i,length(sa));
|
||||||
|
trouve_INTER_CAR:=true;
|
||||||
val(s,TempoOctet,erreur);
|
val(s,TempoOctet,erreur);
|
||||||
if erreur<>0 then Affiche('Erreur temporisation entre 2 octets',clred);
|
if erreur<>0 then Affiche('Erreur temporisation entre 2 octets',clred);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// temporisation attente maximale interface
|
// temporisation attente maximale interface
|
||||||
sa:='TEMPO_MAXI=';
|
sa:=uppercase(TEMPO_MAXI_ch)+'=';
|
||||||
i:=pos(sa,s);
|
i:=pos(sa,s);
|
||||||
if i<>0 then
|
if i<>0 then
|
||||||
begin
|
begin
|
||||||
inc(nv);
|
inc(nv);
|
||||||
delete(s,i,length(sa));
|
delete(s,i,length(sa));
|
||||||
|
trouve_Tempo_maxi:=true;
|
||||||
val(s,TimoutMaxInterface,erreur);
|
val(s,TimoutMaxInterface,erreur);
|
||||||
if erreur<>0 then Affiche('Erreur temporisation maximale interface',clred);
|
if erreur<>0 then Affiche('Erreur temporisation maximale interface',clred);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// entete
|
// entete
|
||||||
sa:='ENTETE=';
|
sa:=uppercase(ENTETE_ch)+'=';
|
||||||
i:=pos(sa,s);
|
i:=pos(sa,s);
|
||||||
if i<>0 then
|
if i<>0 then
|
||||||
begin
|
begin
|
||||||
inc(nv);
|
inc(nv);
|
||||||
delete(s,i,length(sa));
|
delete(s,i,length(sa));
|
||||||
|
trouve_Entete:=true;
|
||||||
val(s,Valeur_entete,erreur);
|
val(s,Valeur_entete,erreur);
|
||||||
entete:='';
|
entete:='';
|
||||||
case Valeur_entete of
|
case Valeur_entete of
|
||||||
@@ -3630,41 +3654,44 @@ begin
|
|||||||
1 : begin entete:=#$FF+#$FE;suffixe:='';end;
|
1 : begin entete:=#$FF+#$FE;suffixe:='';end;
|
||||||
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_ch,clred);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// avec ou sans initialisation des aiguillages
|
// avec ou sans initialisation des aiguillages
|
||||||
sa:='INIT_AIG=';
|
sa:=uppercase(INIT_AIG_ch)+'=';
|
||||||
i:=pos(sa,s);
|
i:=pos(sa,s);
|
||||||
if i<>0 then
|
if i<>0 then
|
||||||
begin
|
begin
|
||||||
|
trouve_init_aig:=true;
|
||||||
inc(nv);
|
inc(nv);
|
||||||
delete(s,i,length(sa));
|
delete(s,i,length(sa));
|
||||||
AvecInitAiguillages:=StrToINT(s);
|
AvecInitAiguillages:=StrToINT(s);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
sa:='FENETRE=';
|
sa:=uppercase(fenetre_ch)+'=';
|
||||||
i:=pos(sa,s);
|
i:=pos(sa,s);
|
||||||
if i<>0 then
|
if i<>0 then
|
||||||
begin
|
begin
|
||||||
inc(nv);
|
inc(nv);
|
||||||
|
trouve_fenetre:=true;
|
||||||
delete(s,i,length(sa));
|
delete(s,i,length(sa));
|
||||||
val(s,fenetre,erreur);
|
val(s,fenetre,erreur);
|
||||||
if fenetre=1 then Formprinc.windowState:=wsMaximized;
|
if fenetre=1 then Formprinc.windowState:=wsMaximized;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
sa:='SECTION_INIT';
|
i:=pos(uppercase(section_init),s);
|
||||||
i:=pos(sa,s);
|
|
||||||
if i<>0 then
|
if i<>0 then
|
||||||
begin
|
begin
|
||||||
inc(nv);
|
inc(nv);
|
||||||
|
trouve_sec_init:=true;
|
||||||
compile_section_init;
|
compile_section_init;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
sa:='VERIF_VERSION=';
|
sa:=uppercase(verif_version_ch)+'=';
|
||||||
i:=pos(sa,s);
|
i:=pos(sa,s);
|
||||||
if i<>0 then
|
if i<>0 then
|
||||||
begin
|
begin
|
||||||
|
trouve_verif_version:=true;
|
||||||
inc(nv);
|
inc(nv);
|
||||||
delete(s,i,length(sa));
|
delete(s,i,length(sa));
|
||||||
// vérification de la version au démarrage
|
// vérification de la version au démarrage
|
||||||
@@ -3673,35 +3700,38 @@ begin
|
|||||||
if erreur=0 then verifVersion:=i=1;
|
if erreur=0 then verifVersion:=i=1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
sa:='NOTIF_VERSION=';
|
sa:=uppercase(NOTIF_VERSION_ch)+'=';
|
||||||
i:=pos(sa,s);
|
i:=pos(sa,s);
|
||||||
if i<>0 then
|
if i<>0 then
|
||||||
begin
|
begin
|
||||||
inc(nv);
|
inc(nv);
|
||||||
delete(s,i,length(sa));
|
delete(s,i,length(sa));
|
||||||
|
trouve_NOTIF_VERSION:=true;
|
||||||
// vérification de la version au démarrage
|
// vérification de la version au démarrage
|
||||||
i:=0;
|
i:=0;
|
||||||
val(s,i,erreur);
|
val(s,i,erreur);
|
||||||
notificationVersion:=i=1;
|
notificationVersion:=i=1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
sa:='TCO=';
|
sa:=uppercase(TCO_ch)+'=';
|
||||||
i:=pos(sa,s);
|
i:=pos(sa,s);
|
||||||
if i<>0 then
|
if i<>0 then
|
||||||
begin
|
begin
|
||||||
inc(nv);
|
inc(nv);
|
||||||
delete(s,i,length(sa));
|
delete(s,i,length(sa));
|
||||||
|
trouve_TCO:=true;
|
||||||
// vérification de la version au démarrage
|
// vérification de la version au démarrage
|
||||||
i:=0;
|
i:=0;
|
||||||
val(s,i,erreur);
|
val(s,i,erreur);
|
||||||
AvecTCO:=i=1;
|
AvecTCO:=i=1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
sa:='CDM=';
|
sa:=uppercase(CDM_ch)+'=';
|
||||||
i:=pos(sa,s);
|
i:=pos(sa,s);
|
||||||
if i<>0 then
|
if i<>0 then
|
||||||
begin
|
begin
|
||||||
inc(nv);
|
inc(nv);
|
||||||
|
trouve_CDM:=true;
|
||||||
delete(s,i,length(sa));
|
delete(s,i,length(sa));
|
||||||
// vérification de la version au démarrage
|
// vérification de la version au démarrage
|
||||||
i:=0;
|
i:=0;
|
||||||
@@ -3709,38 +3739,41 @@ begin
|
|||||||
LanceCDM:=i=1;
|
LanceCDM:=i=1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
sa:='LAY=';
|
sa:=uppercase(LAY_ch)+'=';
|
||||||
i:=pos(sa,s);
|
i:=pos(sa,s);
|
||||||
if i<>0 then
|
if i<>0 then
|
||||||
begin
|
begin
|
||||||
inc(nv);
|
inc(nv);
|
||||||
|
trouve_lay:=true;
|
||||||
delete(s,i,length(sa));
|
delete(s,i,length(sa));
|
||||||
lay:=s;
|
lay:=s;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
sa:='SERVEUR_INTERFACE=';
|
sa:=uppercase(SERVEUR_INTERFACE_ch)+'=';
|
||||||
i:=pos(sa,s);
|
i:=pos(sa,s);
|
||||||
if i<>0 then
|
if i<>0 then
|
||||||
begin
|
begin
|
||||||
inc(nv);
|
inc(nv);
|
||||||
|
trouve_serveur_interface:=true;
|
||||||
delete(s,i,length(sa));
|
delete(s,i,length(sa));
|
||||||
i:=0;
|
i:=0;
|
||||||
val(s,i,erreur);
|
val(s,i,erreur);
|
||||||
ServeurInterfaceCDM:=i;
|
ServeurInterfaceCDM:=i;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
sa:='RETRO=';
|
sa:=uppercase(RETRO_ch)+'=';
|
||||||
i:=pos(sa,s);
|
i:=pos(sa,s);
|
||||||
if i<>0 then
|
if i<>0 then
|
||||||
begin
|
begin
|
||||||
inc(nv);
|
inc(nv);
|
||||||
|
trouve_retro:=true;
|
||||||
delete(s,i,length(sa));
|
delete(s,i,length(sa));
|
||||||
i:=0;
|
i:=0;
|
||||||
val(s,i,erreur);
|
val(s,i,erreur);
|
||||||
ServeurRetroCDM:=i;
|
ServeurRetroCDM:=i;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
sa:='NB_DET_DIST=';
|
sa:=uppercase(nb_det_dist_ch)+'=';
|
||||||
i:=pos(sa,s);
|
i:=pos(sa,s);
|
||||||
if i<>0 then
|
if i<>0 then
|
||||||
begin
|
begin
|
||||||
@@ -3749,21 +3782,36 @@ begin
|
|||||||
delete(s,i,length(sa));
|
delete(s,i,length(sa));
|
||||||
i:=0;
|
i:=0;
|
||||||
val(s,i,erreur);
|
val(s,i,erreur);
|
||||||
if i<2 then i:=2;
|
if i<2 then begin i:=2;Affiche('Attention '+nb_det_dist_ch+' ramené à '+IntToSTR(i),clOrange); end;
|
||||||
Nb_Det_Dist:=i;
|
Nb_Det_Dist:=i;
|
||||||
end;
|
end;
|
||||||
inc(it);
|
inc(it);
|
||||||
|
|
||||||
until (Nv>=18) or (it>30);
|
until (Nv>=18) or (it>30);
|
||||||
//affiche(IntToSTR(Nv)+' variables',cyan);
|
|
||||||
if (it>30) then
|
|
||||||
begin
|
|
||||||
s:='ERREUR: manque variables dans config-gl.cfg';
|
|
||||||
if not(trouve_NbDetDist) then s:=s+' : NB_DET_DIST';
|
|
||||||
if not(trouve_ipv4_PC) then s:=s+' : IpV4_PC';
|
|
||||||
|
|
||||||
affiche(s,clred);
|
//affiche(IntToSTR(Nv)+' variables',cyan);
|
||||||
end;
|
s:='';
|
||||||
|
if (it>30) then s:='ERREUR: manque variables dans config-gl.cfg :';
|
||||||
|
|
||||||
|
if not(trouve_NbDetDist) then s:=s+' '+nb_det_dist_ch;
|
||||||
|
if not(trouve_ipv4_PC) then s:=s+' '+IpV4_PC_ch;
|
||||||
|
if not(trouve_retro) then s:=s+' '+retro_ch;
|
||||||
|
if not(trouve_sec_init) then s:=s+' '+section_init;
|
||||||
|
if not(trouve_init_aig) then s:=s+' '+INIT_AIG_ch;
|
||||||
|
if not(trouve_lay) then s:=s+' '+LAY_ch;
|
||||||
|
if not(trouve_INTER_CAR) then s:=s+' '+INTER_CAR_ch;
|
||||||
|
if not(trouve_Tempo_maxi) then s:=s+' '+Tempo_maxi_ch;
|
||||||
|
if not(trouve_Entete) then s:=s+' '+Entete_ch;
|
||||||
|
if not(trouve_TCO) then s:=s+' '+TCO_ch;
|
||||||
|
if not(trouve_CDM) then s:=s+' '+CDM_ch;
|
||||||
|
if not(trouve_Serveur_interface) then s:=s+' '+Serveur_interface_ch;
|
||||||
|
if not(trouve_fenetre) then s:=s+' '+fenetre_ch;
|
||||||
|
if not(trouve_NOTIF_VERSION) then s:=s+' '+NOTIF_VERSION_ch;
|
||||||
|
if not(trouve_verif_version) then s:=s+' '+verif_version_ch;
|
||||||
|
if not(trouve_fonte) then s:=s+' '+fonte_ch;
|
||||||
|
|
||||||
|
if s<>'' then affiche(s,clred);
|
||||||
|
|
||||||
//Affiche('Valeurs d''initialisation des aiguillages',clyellow);
|
//Affiche('Valeurs d''initialisation des aiguillages',clyellow);
|
||||||
|
|
||||||
closefile(fichier);
|
closefile(fichier);
|
||||||
@@ -6781,6 +6829,8 @@ begin
|
|||||||
begin
|
begin
|
||||||
formTCO.Maj_TCO(Adresse);
|
formTCO.Maj_TCO(Adresse);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
// l'évaluation des routes est à faire selon conditions
|
||||||
if faire_event then evalue;
|
if faire_event then evalue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -7464,6 +7514,7 @@ var
|
|||||||
V_utile : real;
|
V_utile : real;
|
||||||
CibleHandle : Thandle;
|
CibleHandle : Thandle;
|
||||||
begin
|
begin
|
||||||
|
//DoubleBuffered:=true;
|
||||||
TraceSign:=True;
|
TraceSign:=True;
|
||||||
PremierFD:=false;
|
PremierFD:=false;
|
||||||
// services commIP CDM par défaut
|
// services commIP CDM par défaut
|
||||||
@@ -7651,10 +7702,13 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
// positionnement des aiguillages au démarrage : seulement en mode autonome
|
||||||
procedure init_aiguillages;
|
procedure init_aiguillages;
|
||||||
var i,pos : integer;
|
var i,pos : integer;
|
||||||
s : string;
|
s : string;
|
||||||
begin
|
begin
|
||||||
|
if portCommOuvert or parSocketLenz then
|
||||||
|
begin
|
||||||
Affiche('Positionnement aiguillages',cyan);
|
Affiche('Positionnement aiguillages',cyan);
|
||||||
for i:=1 to maxaiguillage do
|
for i:=1 to maxaiguillage do
|
||||||
begin
|
begin
|
||||||
@@ -7668,11 +7722,7 @@ begin
|
|||||||
application.processMessages;
|
application.processMessages;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
with formprinc do
|
|
||||||
begin
|
|
||||||
//Menu_interface(valide);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// timer à 100 ms
|
// timer à 100 ms
|
||||||
@@ -7686,11 +7736,10 @@ begin
|
|||||||
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
|
||||||
if not(ConfigNulle) then Affiche('Positionnement des feux',clYellow);
|
|
||||||
if not(ferme) and not(ConfigNulle) then envoi_signauxCplx; // initialisation des feux
|
|
||||||
if not(ConfigNulle) and not(ferme) and (AvecInitAiguillages=1) then
|
if not(ConfigNulle) and not(ferme) and (AvecInitAiguillages=1) then
|
||||||
begin
|
begin
|
||||||
Affiche('Positionnement des aiguillages',clYellow);
|
Affiche('Positionnement des feux',clYellow);
|
||||||
|
envoi_signauxCplx; // initialisation des feux
|
||||||
init_aiguillages; // initialisation des aiguillages
|
init_aiguillages; // initialisation des aiguillages
|
||||||
end;
|
end;
|
||||||
if (AvecInitAiguillages=0) and not(ferme) and (parSocketLenz or portCommOuvert) then
|
if (AvecInitAiguillages=0) and not(ferme) and (parSocketLenz or portCommOuvert) then
|
||||||
@@ -7720,6 +7769,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
//Affiche(IntToSTR(adresse),clOrange);
|
//Affiche(IntToSTR(adresse),clOrange);
|
||||||
Dessine_feu_mx(Feux[i].Img.Canvas,0,0,1,1,adresse,1);
|
Dessine_feu_mx(Feux[i].Img.Canvas,0,0,1,1,adresse,1);
|
||||||
|
//Affiche('Clignote feu '+IntToSTR(adresse),clyellow);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -8164,10 +8214,17 @@ var i,j,objet,posST,posAC,posDT,posSG,posXY,k,l,erreur, adr,adr2,etat,etataig,
|
|||||||
traite,sort : boolean;
|
traite,sort : boolean;
|
||||||
begin
|
begin
|
||||||
{
|
{
|
||||||
recuCDM:='S-E-52-6601-CMDACC-ST_TO|037|05|NAME=2;OBJ=2;AD=126;AD2=0;STATE=0;S-E-52-6602-CMDACC';
|
trame_CDM:='S-R-14-0004-CMDACC-__ACK|000|S-E-14-5162-CMDACC-ST_DT|052|05|NAME=2756;OBJ=2756;AD=518;TRAIN=CC406526;STATE=1;';
|
||||||
recuCDM:=recuCDM+'-ST_TO|037|05|NAME=6;OBJ=6;AD=127;AD2=0;STATE=0;S-E-52-6603-CMDACC-ST_TO|039|05|NAME=10;OBJ=10;AD=128;AD2=0;STATE=0;S-E-52-6604-CMDACC-ST_TO|039|05|';
|
trame_cdm:=trame_cdm+'S-E-14-5163-CMDACC-ST_DT|049|05|NAME=2757;OBJ=2757;AD=518;TRAIN=_NONE;STATE=1;';
|
||||||
recuCDM:=recuCDM+'NAME=14;OBJ=14;AD=129;OBJ=10;AD=128;AD2=0;STATE=0;S-E-52-6604-CMDACC-ST_TO|039|05|NAME=14;OBJ=14;AD=129;AD2=0;STATE=0;';
|
trame_cdm:=trame_cdm+'S-E-14-5164-CMDACC-ST_DT|049|05|NAME=2758;OBJ=2758;AD=519;TRAIN=_NONE;STATE=0;';
|
||||||
|
trame_cdm:=trame_cdm+'S-E-14-5165-CMDACC-ST_DT|049|05|NAME=2759;OBJ=2759;AD=519;TRAIN=_NONE;STATE=0';
|
||||||
|
trame_cdm:=trame_cdm+'S-E-14-5166-CMDACC-ST_DT|049|05|NAME=7060;OBJ=7060;AD=520;TRAIN=_NONE;STATE=0';
|
||||||
|
trame_cdm:=trame_cdm+'S-E-14-5167-CMDACC-ST_DT|051|05|NAME=7061;OBJ=7061;AD=520;TRAIN=BB25531;STATE=0';
|
||||||
|
trame_cdm:=trame_cdm+'S-E-14-5168-CMDACC-ST_DT|049|05|NAME=7057;OBJ=7057;AD=517;TRAIN=_NONE;STATE=0';
|
||||||
|
trame_cdm:=trame_cdm+'S-E-14-5169-CMDACC-ST_DT|049|05|NAME=7058;OBJ=7058;AD=517;TRAIN=_NONE;STATE=0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//debugtrames:=true;
|
||||||
AckCDM:=trame_CDM<>'';
|
AckCDM:=trame_CDM<>'';
|
||||||
if pos('ACK',trame_CDM)=0 then
|
if pos('ACK',trame_CDM)=0 then
|
||||||
begin
|
begin
|
||||||
@@ -8183,16 +8240,20 @@ begin
|
|||||||
//Affiche('long chaine param='+intToSTR(long),clyellow);
|
//Affiche('long chaine param='+intToSTR(long),clyellow);
|
||||||
if long=0 then
|
if long=0 then
|
||||||
begin
|
begin
|
||||||
if debugTrames then Affiche('Longueur nulle',clYellow);
|
//if debugTrames then Affiche('Longueur nulle',clYellow);
|
||||||
Nbre_recu_cdm:=0;
|
if pos('ACK',trame_cdm)<>0 then Ack_cdm:=true;
|
||||||
exit;
|
i:=posEx('|',trame_CDM,i+1);
|
||||||
|
if i=0 then begin Affiche('Erreur trames CDM manque 2ème |',clred);exit;end;
|
||||||
|
delete(trame_cdm,1,i);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
if long<>0 then
|
||||||
|
begin
|
||||||
// trouver le nombre de paramètres
|
// trouver le nombre de paramètres
|
||||||
i:=posEx('|',trame_CDM,i+1);
|
i:=posEx('|',trame_CDM,i+1);
|
||||||
if i=0 then
|
if i=0 then
|
||||||
begin
|
begin
|
||||||
if debugTrames then Affiche('0 paramètres '+trame_CDM,clyellow);
|
if debugTrames then AfficheDebug('0 paramètres '+trame_CDM,clyellow);
|
||||||
Nbre_recu_cdm:=0;
|
Nbre_recu_cdm:=0;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
@@ -8207,17 +8268,16 @@ begin
|
|||||||
until (i=0) or (NbreVir=nbre);
|
until (i=0) or (NbreVir=nbre);
|
||||||
if i=0 then
|
if i=0 then
|
||||||
begin
|
begin
|
||||||
if debugTrames then Affiche('tronqué : '+trame_CDM,clyellow);
|
if debugTrames then AfficheDebug('tronqué : '+trame_CDM,clyellow);
|
||||||
residuCDM:=trame_CDM;
|
residuCDM:=trame_CDM;
|
||||||
Nbre_recu_cdm:=0;
|
Nbre_recu_cdm:=0;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
CommandeCDM:=copy(trame_CDM,1,i);
|
CommandeCDM:=copy(trame_CDM,1,i);
|
||||||
if debugTrames then Affiche(commandeCDM,clorange);
|
if debugTrames then AfficheDebug(commandeCDM,clorange);
|
||||||
Delete(trame_CDM,1,i);
|
Delete(trame_CDM,1,i);
|
||||||
|
|
||||||
// Affiche('K='+intToSTR(k)+' longueur='+intToSTR(length(recuCDM)),clyellow);
|
|
||||||
// évènement aiguillage. Le champ AD2 n'est pas forcément présent
|
// évènement aiguillage. Le champ AD2 n'est pas forcément présent
|
||||||
posST:=pos('CMDACC-ST_TO',commandeCDM);
|
posST:=pos('CMDACC-ST_TO',commandeCDM);
|
||||||
if posST<>0 then
|
if posST<>0 then
|
||||||
@@ -8312,7 +8372,7 @@ begin
|
|||||||
|
|
||||||
if (train='_NONE') then train:=detecteur[Adr].train;
|
if (train='_NONE') then train:=detecteur[Adr].train;
|
||||||
Event_detecteur(Adr,etat=1,train);
|
Event_detecteur(Adr,etat=1,train);
|
||||||
//Affiche(IntToSTR(adr)+' '+IntToSTR(etat),clyellow);
|
//AfficheDebug(IntToSTR(adr)+' '+IntToSTR(etat),clyellow);
|
||||||
if AfficheDet then Affiche('Rétro Détecteur '+intToSTR(adr)+'='+IntToStr(etat),clYellow);
|
if AfficheDet then Affiche('Rétro Détecteur '+intToSTR(adr)+'='+IntToStr(etat),clYellow);
|
||||||
end ;
|
end ;
|
||||||
|
|
||||||
@@ -8403,6 +8463,8 @@ begin
|
|||||||
|
|
||||||
inc(k);
|
inc(k);
|
||||||
//Affiche('k='+intToSTR(k),clyellow);
|
//Affiche('k='+intToSTR(k),clyellow);
|
||||||
|
end;
|
||||||
|
|
||||||
sort:=(length(trame_CDM)<10) or (k>=2000);// or (posST=0) and (posDT=0) and (posAC=0) and (posSG=0);
|
sort:=(length(trame_CDM)<10) or (k>=2000);// or (posST=0) and (posDT=0) and (posAC=0) and (posSG=0);
|
||||||
until (sort);
|
until (sort);
|
||||||
|
|
||||||
@@ -8420,14 +8482,15 @@ procedure TFormPrinc.ClientSocketCDMRead(Sender: TObject;Socket: TCustomWinSocke
|
|||||||
traite,sort : boolean;
|
traite,sort : boolean;
|
||||||
begin
|
begin
|
||||||
inc(Nbre_recu_cdm);
|
inc(Nbre_recu_cdm);
|
||||||
//if Nbre_recu_cdm>1 then Affiche('Empilement de trames CDM: '+RecuCDM,clred);
|
//if Nbre_recu_cdm>1 then Affiche('Empilement de trames CDM: '+intToSTR(Nbre_recu_cdm),clred);
|
||||||
recuCDM:=residuCDM+ClientSocketCDM.Socket.ReceiveText; // commandeCDM est le morceau tronquée de la fin de la réception précédente
|
recuCDM:=ClientSocketCDM.Socket.ReceiveText; // commandeCDM est le morceau tronquée de la fin de la réception précédente
|
||||||
//if residuCDM<>'' then Affiche(recuCDM,clLime);
|
//if residuCDM<>'' then Affiche(recuCDM,clLime);
|
||||||
residuCDM:='';
|
residuCDM:='';
|
||||||
if trace then
|
if trace then
|
||||||
begin
|
begin
|
||||||
n:=80;
|
n:=80;
|
||||||
Affiche('recu de CDM Tick='+IntToSTR(tick)+' '+IntToSTR(length(recuCDM))+' car',clWhite);Affiche(copy(recuCDM,1,n),clWhite);
|
Affiche('recu de CDM Tick='+IntToSTR(tick)+' '+IntToSTR(length(recuCDM))+' car',clWhite);Affiche(copy(recuCDM,1,n),clWhite);
|
||||||
|
AfficheDebug(recuCDM,clWhite);
|
||||||
l:=length(recuCDM);
|
l:=length(recuCDM);
|
||||||
i:=1;
|
i:=1;
|
||||||
repeat
|
repeat
|
||||||
@@ -8819,6 +8882,11 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TFormPrinc.Button1Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Interprete_trameCDM('yfytrf');
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
|
||||||
@@ -8826,4 +8894,5 @@ begin
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|||||||
Binary file not shown.
BIN
Binary file not shown.
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
object FormVersion: TFormVersion
|
object FormVersion: TFormVersion
|
||||||
Left = 500
|
Left = 497
|
||||||
Top = 341
|
Top = 186
|
||||||
Width = 468
|
Width = 468
|
||||||
Height = 194
|
Height = 194
|
||||||
Caption = 'V'#233'rification de version'
|
Caption = 'V'#233'rification de version'
|
||||||
|
|||||||
+1
-1
@@ -43,7 +43,7 @@ Version 2.2 : Correction d'un bug sur le verrouillage des signaux au carr
|
|||||||
version 2.21 : Paramétrage du nombre de détecteurs considérés comme trop distants
|
version 2.21 : Paramétrage du nombre de détecteurs considérés comme trop distants
|
||||||
Correction d'un bug de la 2.2
|
Correction d'un bug de la 2.2
|
||||||
version 2.3 : Changement de la méthode de réception des trames du protocole IPC de CDM-Rail
|
version 2.3 : Changement de la méthode de réception des trames du protocole IPC de CDM-Rail
|
||||||
|
Affichage au démarrage des variables manquantes du fichier config-gl.cfg
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user