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
|
||||
Width = 585
|
||||
Height = 441
|
||||
ActivePage = TabSheetCDM
|
||||
ActivePage = TabSheetSig
|
||||
Font.Charset = DEFAULT_CHARSET
|
||||
Font.Color = clBackground
|
||||
Font.Height = -11
|
||||
@@ -2783,7 +2783,7 @@ object FormConfig: TFormConfig
|
||||
Top = 48
|
||||
Width = 129
|
||||
Height = 21
|
||||
ItemHeight = 0
|
||||
ItemHeight = 13
|
||||
TabOrder = 1
|
||||
OnChange = ComboBoxDecChange
|
||||
end
|
||||
@@ -2812,6 +2812,7 @@ object FormConfig: TFormConfig
|
||||
Height = 21
|
||||
TabOrder = 4
|
||||
Text = 'Edit1'
|
||||
OnChange = EditDet2Change
|
||||
end
|
||||
object EditSuiv2: TEdit
|
||||
Left = 184
|
||||
@@ -2820,6 +2821,7 @@ object FormConfig: TFormConfig
|
||||
Height = 21
|
||||
TabOrder = 5
|
||||
Text = 'Edit2'
|
||||
OnChange = EditSuiv2Change
|
||||
end
|
||||
object EditDet3: TEdit
|
||||
Left = 120
|
||||
@@ -2828,6 +2830,7 @@ object FormConfig: TFormConfig
|
||||
Height = 21
|
||||
TabOrder = 6
|
||||
Text = 'Edit1'
|
||||
OnChange = EditDet3Change
|
||||
end
|
||||
object EditSuiv3: TEdit
|
||||
Left = 184
|
||||
@@ -2836,6 +2839,7 @@ object FormConfig: TFormConfig
|
||||
Height = 21
|
||||
TabOrder = 7
|
||||
Text = 'Edit2'
|
||||
OnChange = EditSuiv3Change
|
||||
end
|
||||
object EditDet4: TEdit
|
||||
Left = 120
|
||||
@@ -2844,6 +2848,7 @@ object FormConfig: TFormConfig
|
||||
Height = 21
|
||||
TabOrder = 8
|
||||
Text = 'Edit1'
|
||||
OnChange = EditDet4Change
|
||||
end
|
||||
object EditSuiv4: TEdit
|
||||
Left = 184
|
||||
@@ -2852,6 +2857,7 @@ object FormConfig: TFormConfig
|
||||
Height = 21
|
||||
TabOrder = 9
|
||||
Text = 'Edit2'
|
||||
OnChange = EditSuiv4Change
|
||||
end
|
||||
object CheckVerrouCarre: TCheckBox
|
||||
Left = 112
|
||||
|
||||
+276
-88
@@ -207,6 +207,12 @@ type
|
||||
procedure EditDet1Change(Sender: TObject);
|
||||
procedure EditSuiv1Change(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
|
||||
{ Déclarations privées }
|
||||
public
|
||||
@@ -215,14 +221,32 @@ type
|
||||
end;
|
||||
|
||||
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
|
||||
FormConfig: TFormConfig;
|
||||
AdresseIPCDM,AdresseIP,PortCom,recuCDM,residuCDM : string;
|
||||
portCDM,TempoOctet,TimoutMaxInterface,Valeur_entete,Port,protocole,NumPort,
|
||||
LigneCliquee,AncLigneCliquee : integer;
|
||||
clicliste : boolean;
|
||||
ack_cdm,clicliste : boolean;
|
||||
|
||||
function config_com(s : string) : boolean;
|
||||
function envoi_CDM(s : string) : boolean;
|
||||
@@ -268,6 +292,7 @@ begin
|
||||
place_id:=s;
|
||||
end;
|
||||
|
||||
// demande les services à CDM
|
||||
function services_CDM : boolean;
|
||||
var s,ss : string;
|
||||
i : integer;
|
||||
@@ -291,8 +316,9 @@ begin
|
||||
delete(s,26,3);
|
||||
insert(ss,s,26);
|
||||
//Affiche(s,clyellow);
|
||||
|
||||
envoi_CDM(s);sleep(100);
|
||||
if pos('_ACK',recuCDM)<>0 then
|
||||
if ack_cdm then
|
||||
begin
|
||||
s:='Services acceptés: ';
|
||||
if Srvc_Aig then s:=s+'- aiguillages ';
|
||||
@@ -302,7 +328,8 @@ begin
|
||||
if Srvc_sig then s:=s+'- état des signaux ';
|
||||
Affiche(s,clYellow);
|
||||
end;
|
||||
services_CDM:=pos('_ACK',recuCDM)<>0;
|
||||
services_CDM:=ack_cdm;
|
||||
ack_cdm:=false;
|
||||
end;
|
||||
|
||||
procedure connecte_CDM;
|
||||
@@ -329,14 +356,15 @@ begin
|
||||
Application.processMessages;
|
||||
until (i>10) or SocketCDM_connecte ;
|
||||
//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
|
||||
recuCDM:='';
|
||||
s:='C-C-00-0001-CMDGEN-_CNCT|000|';
|
||||
envoi_cdm(s);
|
||||
if pos('_ACK',recuCDM)<>0 then
|
||||
if ack_cdm then
|
||||
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
|
||||
recucdm:='';
|
||||
s:='Connecté au serveur CDM rail avec l''ID='+Id_CDM;
|
||||
@@ -537,7 +565,7 @@ begin
|
||||
end;
|
||||
|
||||
// modifie les fichiers de config en fonction du paramétrage
|
||||
procedure genere_config2;
|
||||
procedure genere_config;
|
||||
var s: string;
|
||||
fichier,fichierN : text;
|
||||
i,j : integer;
|
||||
@@ -572,79 +600,79 @@ begin
|
||||
// entête
|
||||
copie_commentaire;
|
||||
// taille de la fonte
|
||||
writeln(fichierN,'Fonte=',TailleFonte);
|
||||
writeln(fichierN,Fonte_ch+'=',TailleFonte);
|
||||
copie_commentaire;
|
||||
|
||||
// adresse ip et port de CDM
|
||||
writeln(fichierN,'IpV4_PC=',adresseIPCDM+':'+intToSTR(portCDM));
|
||||
writeln(fichierN,IpV4_PC_ch+'=',adresseIPCDM+':'+intToSTR(portCDM));
|
||||
copie_commentaire;
|
||||
|
||||
// adresse ip interface XpressNet
|
||||
writeln(fichierN,'IPV4_Interface=',adresseIP+':'+intToSTR(port));
|
||||
writeln(fichierN,IPV4_Interface_ch+'=',adresseIP+':'+intToSTR(port));
|
||||
copie_commentaire;
|
||||
|
||||
// port com
|
||||
writeln(fichierN,'Protocole_serie=',portcom);
|
||||
writeln(fichierN,Protocole_serie_ch+'=',portcom);
|
||||
copie_commentaire;
|
||||
|
||||
// temporisation caractère TempoOctet
|
||||
writeln(fichierN,'Inter_Car=',IntToSTR(TempoOctet));
|
||||
writeln(fichierN,Inter_Car_ch+'=',IntToSTR(TempoOctet));
|
||||
copie_commentaire;
|
||||
|
||||
// temporisation attente maximale interface
|
||||
writeln(fichierN,'Tempo_maxi=',IntToSTR(TimoutMaxInterface));
|
||||
writeln(fichierN,Tempo_maxi_ch+'=',IntToSTR(TimoutMaxInterface));
|
||||
copie_commentaire;
|
||||
|
||||
// entete Valeur_entete
|
||||
writeln(fichierN,'Entete=',intToSTR(Valeur_entete));
|
||||
writeln(fichierN,Entete_ch+'=',intToSTR(Valeur_entete));
|
||||
copie_commentaire;
|
||||
|
||||
// avec ou sans initialisation des aiguillages
|
||||
writeln(fichierN,'Init_Aig=',IntToSTR(AvecInitAiguillages));
|
||||
writeln(fichierN,Init_Aig_ch+'=',IntToSTR(AvecInitAiguillages));
|
||||
copie_commentaire;
|
||||
|
||||
// plein écran
|
||||
writeln(fichierN,'Fenetre=',fenetre);
|
||||
writeln(fichierN,Fenetre_ch+'=',fenetre);
|
||||
copie_commentaire;
|
||||
|
||||
// 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;
|
||||
|
||||
|
||||
// Vérification des versions au démarrage
|
||||
if verifVersion then s:='1' else s:='0';
|
||||
writeln(fichierN,'verif_version=',s);
|
||||
writeln(fichierN,verif_version_ch+'=',s);
|
||||
copie_commentaire;
|
||||
|
||||
// Notification de nouvelle version
|
||||
if notificationVersion then s:='1' else s:='0';
|
||||
writeln(fichierN,'notif_version=',s);
|
||||
writeln(fichierN,notif_version_ch+'=',s);
|
||||
copie_commentaire;
|
||||
|
||||
// Avec TCO
|
||||
if AvecTCO then s:='1' else s:='0';
|
||||
writeln(fichierN,'TCO=',s);
|
||||
writeln(fichierN,TCO_ch+'=',s);
|
||||
copie_commentaire;
|
||||
|
||||
// lancement de CDM
|
||||
if LanceCDM then s:='1' else s:='0';
|
||||
writeln(fichierN,'CDM=',s);
|
||||
writeln(fichierN,CDM_ch+'=',s);
|
||||
copie_commentaire;
|
||||
|
||||
// Nom du LAY
|
||||
writeln(fichierN,'LAY=',Lay);
|
||||
writeln(fichierN,lay_ch+'=',Lay);
|
||||
copie_commentaire;
|
||||
|
||||
// Serveur d'interface de CDM
|
||||
writeln(fichierN,'Serveur_interface=',intToSTR(ServeurInterfaceCDM));
|
||||
writeln(fichierN,Serveur_interface_ch+'=',intToSTR(ServeurInterfaceCDM));
|
||||
copie_commentaire;
|
||||
|
||||
// Serveur de rétrosignalisation Lenz de CDM
|
||||
writeln(fichierN,'retro=',intToSTR(ServeurRetroCDM));
|
||||
writeln(fichierN,retro_ch+'=',intToSTR(ServeurRetroCDM));
|
||||
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);
|
||||
// valeurs des initialisations
|
||||
repeat
|
||||
@@ -751,7 +779,7 @@ begin
|
||||
|
||||
end;
|
||||
|
||||
|
||||
// sauvegarder la config dans les fichiers cfg
|
||||
procedure Sauve_config;
|
||||
var i,erreur : integer;
|
||||
s : string;
|
||||
@@ -876,7 +904,7 @@ begin
|
||||
if change_srv then services_CDM;
|
||||
|
||||
// générer le fichiers config.cfg et clieng-GL.cfg
|
||||
genere_config2;
|
||||
genere_config;
|
||||
|
||||
end;
|
||||
|
||||
@@ -1086,7 +1114,7 @@ begin
|
||||
|
||||
RE_ColorLine(Formconfig.RichAig,ligneCliquee,Clyellow);
|
||||
|
||||
ss:=TitreAig+InttoSTr(Adresse);
|
||||
ss:='Description de l''aiguillage '+InttoSTr(Adresse);
|
||||
formconfig.LabelAdresse.Caption:= ss;
|
||||
|
||||
tjd:=pos('TJD',s)<>0 ;
|
||||
@@ -1760,61 +1788,6 @@ begin
|
||||
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);
|
||||
begin
|
||||
@@ -1898,16 +1871,78 @@ begin
|
||||
clicliste:=false;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
procedure TFormConfig.EditDet1Change(Sender: TObject);
|
||||
var s : string;
|
||||
i,erreur : integer;
|
||||
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;
|
||||
|
||||
procedure TFormConfig.EditSuiv1Change(Sender: TObject);
|
||||
var s : string;
|
||||
i,erreur : integer;
|
||||
B : char;
|
||||
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;
|
||||
|
||||
procedure TFormConfig.CheckVerrouCarreClick(Sender: TObject);
|
||||
@@ -1924,7 +1959,160 @@ begin
|
||||
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.
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
+142
-73
@@ -143,6 +143,7 @@ type
|
||||
procedure ButtonAffTCOClick(Sender: TObject);
|
||||
procedure ButtonLanceCDMClick(Sender: TObject);
|
||||
procedure Affichefentredebug1Click(Sender: TObject);
|
||||
procedure Button1Click(Sender: TObject);
|
||||
private
|
||||
{ Déclarations privées }
|
||||
procedure DoHint(Sender : Tobject);
|
||||
@@ -289,7 +290,7 @@ var
|
||||
mod_branches,mod_act : array[1..100] of string;
|
||||
// l'indice du tableau aiguillage est son adresse
|
||||
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
|
||||
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
|
||||
@@ -413,6 +414,7 @@ begin
|
||||
begin
|
||||
brush.Color:=couleur;
|
||||
Pen.Color:=clBlack;
|
||||
//Affiche('clignote '+IntToSTR(x)+' '+intToSTR(y),clyellow);
|
||||
Ellipse(x-rayon,y-rayon,x+rayon,y+rayon);
|
||||
end;
|
||||
//Affiche(IntToSTR(y),clyellow);
|
||||
@@ -1490,11 +1492,12 @@ begin
|
||||
exit;
|
||||
end;
|
||||
|
||||
// pilotage par USB ou par réseau de la centrale
|
||||
// test si pilotage inversé
|
||||
// pilotage par USB ou par éthernet de la centrale
|
||||
|
||||
// Affiche('Accessoire '+intToSTR(adresse),clLime);
|
||||
if hors_tension2=false then
|
||||
if (hors_tension2=false) and (portCommOuvert or parSocketLenz) then
|
||||
begin
|
||||
// test si pilotage aiguillage inversé
|
||||
if aiguillage[adresse].inversion=1 then
|
||||
begin
|
||||
if octet=1 then octet:=2 else octet:=1;
|
||||
@@ -1595,8 +1598,6 @@ begin
|
||||
SetBit:=n or (1 shl position);
|
||||
end;
|
||||
|
||||
|
||||
|
||||
// renvoie la chaîne de l'état du signal
|
||||
function chaine_signal(etat : word) : string;
|
||||
var aspect,combine : word;
|
||||
@@ -1780,16 +1781,16 @@ begin
|
||||
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);
|
||||
var index : integer;
|
||||
code,aspect,combine : word;
|
||||
s : string;
|
||||
begin
|
||||
//***if (ancien_tablo_signalCplx[adresse]<>EtatSignalCplx[adresse]) then //; && (stop_cmd==FALSE))
|
||||
if (ancien_tablo_signalCplx[adresse]<>EtatSignalCplx[adresse]) then //; && (stop_cmd==FALSE))
|
||||
begin
|
||||
//***ancien_tablo_signalCplx[adresse]:=EtatSignalCplx[adresse];
|
||||
ancien_tablo_signalCplx[adresse]:=EtatSignalCplx[adresse];
|
||||
code:=EtatSignalCplx[adresse];
|
||||
code_to_aspect(code,aspect,combine);
|
||||
s:='Signal CDF: ad'+IntToSTR(adresse)+'='+chaine_signal(code);
|
||||
@@ -1810,7 +1811,7 @@ begin
|
||||
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);
|
||||
var code,aspect,combine : word;
|
||||
@@ -1832,9 +1833,9 @@ var code,aspect,combine : word;
|
||||
end;
|
||||
begin
|
||||
|
||||
//***if (ancien_tablo_signalCplx[adresse]<>EtatSignalCplx[adresse]) then //; && (stop_cmd==FALSE))
|
||||
if (ancien_tablo_signalCplx[adresse]<>EtatSignalCplx[adresse]) then //; && (stop_cmd==FALSE))
|
||||
begin
|
||||
//***ancien_tablo_signalCplx[adresse]:=EtatSignalCplx[adresse];
|
||||
ancien_tablo_signalCplx[adresse]:=EtatSignalCplx[adresse];
|
||||
code:=EtatSignalCplx[adresse];
|
||||
code_to_aspect(code,aspect,combine);
|
||||
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
|
||||
//code:=feux[index].aspect; // aspect du feu;
|
||||
|
||||
//***if (ancien_tablo_signalCplx[adresse]<>EtatSignalCplx[adresse]) then
|
||||
if (ancien_tablo_signalCplx[adresse]<>EtatSignalCplx[adresse]) then
|
||||
begin
|
||||
//***ancien_tablo_signalCplx[adresse]:=EtatSignalCplx[adresse];
|
||||
ancien_tablo_signalCplx[adresse]:=EtatSignalCplx[adresse];
|
||||
code:=EtatSignalCplx[adresse];
|
||||
code_to_aspect(code,aspect,combine);
|
||||
s:='Signal NMRA: ad'+IntToSTR(adresse)+'='+chaine_signal(code);
|
||||
@@ -1955,9 +1956,9 @@ var modele,index: integer ;
|
||||
begin
|
||||
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
|
||||
//***ancien_tablo_signalCplx[adresse]:=EtatSignalCplx[adresse];
|
||||
ancien_tablo_signalCplx[adresse]:=EtatSignalCplx[adresse];
|
||||
code:=EtatSignalCplx[adresse];
|
||||
code_to_aspect(code,aspect,combine);
|
||||
s:='Signal Unisemaf: ad'+IntToSTR(adresse)+'='+chaine_signal(code);
|
||||
@@ -2248,9 +2249,9 @@ procedure envoi_LDT(adresse : integer);
|
||||
var code,aspect,combine,mode : word;
|
||||
s : string;
|
||||
begin
|
||||
//***if (ancien_tablo_signalCplx[adresse]<>EtatSignalCplx[adresse]) then //; && (stop_cmd==FALSE))
|
||||
if (ancien_tablo_signalCplx[adresse]<>EtatSignalCplx[adresse]) then //; && (stop_cmd==FALSE))
|
||||
begin
|
||||
//***ancien_tablo_signalCplx[adresse]:=EtatSignalCplx[adresse];
|
||||
ancien_tablo_signalCplx[adresse]:=EtatSignalCplx[adresse];
|
||||
code:=EtatSignalCplx[adresse];
|
||||
code_to_aspect(code,aspect,combine);
|
||||
s:='Signal LDT: ad'+IntToSTR(adresse)+'='+chaine_signal(code);
|
||||
@@ -2323,9 +2324,8 @@ var aspect,code,combine : word;
|
||||
ralrap, jau ,Ancralrap,Ancjau : boolean;
|
||||
s : string;
|
||||
begin
|
||||
//***if (ancien_tablo_signalCplx[adresse]<>EtatSignalCplx[adresse]) then //; && (stop_cmd==FALSE))
|
||||
if (ancien_tablo_signalCplx[adresse]<>EtatSignalCplx[adresse]) then //; && (stop_cmd==FALSE))
|
||||
begin
|
||||
|
||||
code:=EtatSignalCplx[adresse];
|
||||
code_to_aspect(code,aspect,combine);
|
||||
s:='Signal Bahn: ad'+IntToSTR(adresse)+'='+chaine_signal(code);
|
||||
@@ -2367,7 +2367,7 @@ begin
|
||||
sleep(40);
|
||||
pilote_ACC(adresse+Combine,2,feu) ;
|
||||
end;
|
||||
|
||||
ancien_tablo_signalCplx[adresse]:=EtatSignalCplx[adresse];
|
||||
end;
|
||||
end;
|
||||
|
||||
@@ -3456,12 +3456,13 @@ begin
|
||||
IndexBranche_trouve:=i;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
procedure lit_config;
|
||||
var s,sa,chaine,SOrigine: string;
|
||||
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,
|
||||
ComptEl,Compt_IT,Num_Element,k,modele,adr,adr2,erreur2,l,t,Nligne,postriple,
|
||||
postjd,postjs,nv,it : integer;
|
||||
@@ -3511,6 +3512,23 @@ begin
|
||||
debugConfig:=false;
|
||||
trouve_NbDetDist:=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;
|
||||
// initialisation des aiguillages avec des valeurs par défaut
|
||||
for i:=1 to MaxAcc do
|
||||
@@ -3544,11 +3562,12 @@ begin
|
||||
repeat
|
||||
s:=lit_ligne;
|
||||
//affiche(s,cllime);
|
||||
sa:='FONTE=';
|
||||
sa:=uppercase(Fonte_ch)+'=';
|
||||
i:=pos(sa,s);
|
||||
if i<>0 then
|
||||
begin
|
||||
inc(nv);
|
||||
trouve_fonte:=true;
|
||||
delete(s,i,length(sa));
|
||||
TailleFonte:=StrToINT(s);
|
||||
with FormPrinc.ListBox1 do
|
||||
@@ -3559,7 +3578,7 @@ begin
|
||||
end;
|
||||
|
||||
// adresse ip et port de CDM
|
||||
sa:='IPV4_PC=';
|
||||
sa:=uppercase(IpV4_PC_ch)+'=';
|
||||
i:=pos(sa,s);
|
||||
if i<>0 then
|
||||
begin
|
||||
@@ -3572,11 +3591,12 @@ begin
|
||||
|
||||
// adresse ip et port de la centrale
|
||||
// AfficheDet:=true;
|
||||
sa:='IPV4_INTERFACE=';
|
||||
sa:=uppercase(IPV4_INTERFACE_ch)+'=';
|
||||
i:=pos(sa,s);
|
||||
if i<>0 then
|
||||
begin
|
||||
inc(nv);
|
||||
trouve_IPV4_INTERFACE:=true;
|
||||
delete(s,i,length(sa));
|
||||
i:=pos(':',s);
|
||||
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;
|
||||
|
||||
// configuration du port com
|
||||
sa:='PROTOCOLE_SERIE=';
|
||||
sa:=uppercase(PROTOCOLE_SERIE_ch)+'=';
|
||||
i:=pos(sa,s);
|
||||
if i<>0 then
|
||||
begin
|
||||
inc(nv);
|
||||
trouve_PROTOCOLE_SERIE:=true;
|
||||
delete(s,i,length(sa));
|
||||
if not(config_com(s)) then Affiche('Erreur port com mal déclaré : '+s,clred);
|
||||
portcom:=s;
|
||||
end;
|
||||
|
||||
// temporisation entre 2 caractères
|
||||
sa:='INTER_CAR=';
|
||||
sa:=uppercase(INTER_CAR_ch)+'=';
|
||||
i:=pos(sa,s);
|
||||
if i<>0 then
|
||||
begin
|
||||
inc(nv);
|
||||
delete(s,i,length(sa));
|
||||
trouve_INTER_CAR:=true;
|
||||
val(s,TempoOctet,erreur);
|
||||
if erreur<>0 then Affiche('Erreur temporisation entre 2 octets',clred);
|
||||
end;
|
||||
|
||||
// temporisation attente maximale interface
|
||||
sa:='TEMPO_MAXI=';
|
||||
sa:=uppercase(TEMPO_MAXI_ch)+'=';
|
||||
i:=pos(sa,s);
|
||||
if i<>0 then
|
||||
begin
|
||||
inc(nv);
|
||||
delete(s,i,length(sa));
|
||||
trouve_Tempo_maxi:=true;
|
||||
val(s,TimoutMaxInterface,erreur);
|
||||
if erreur<>0 then Affiche('Erreur temporisation maximale interface',clred);
|
||||
end;
|
||||
|
||||
// entete
|
||||
sa:='ENTETE=';
|
||||
sa:=uppercase(ENTETE_ch)+'=';
|
||||
i:=pos(sa,s);
|
||||
if i<>0 then
|
||||
begin
|
||||
inc(nv);
|
||||
delete(s,i,length(sa));
|
||||
trouve_Entete:=true;
|
||||
val(s,Valeur_entete,erreur);
|
||||
entete:='';
|
||||
case Valeur_entete of
|
||||
@@ -3630,41 +3654,44 @@ begin
|
||||
1 : begin entete:=#$FF+#$FE;suffixe:='';end;
|
||||
2 : begin entete:=#228;suffixe:=#13+#13+#10;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;
|
||||
|
||||
// avec ou sans initialisation des aiguillages
|
||||
sa:='INIT_AIG=';
|
||||
sa:=uppercase(INIT_AIG_ch)+'=';
|
||||
i:=pos(sa,s);
|
||||
if i<>0 then
|
||||
begin
|
||||
trouve_init_aig:=true;
|
||||
inc(nv);
|
||||
delete(s,i,length(sa));
|
||||
AvecInitAiguillages:=StrToINT(s);
|
||||
end;
|
||||
|
||||
sa:='FENETRE=';
|
||||
sa:=uppercase(fenetre_ch)+'=';
|
||||
i:=pos(sa,s);
|
||||
if i<>0 then
|
||||
begin
|
||||
inc(nv);
|
||||
trouve_fenetre:=true;
|
||||
delete(s,i,length(sa));
|
||||
val(s,fenetre,erreur);
|
||||
if fenetre=1 then Formprinc.windowState:=wsMaximized;
|
||||
end;
|
||||
|
||||
sa:='SECTION_INIT';
|
||||
i:=pos(sa,s);
|
||||
i:=pos(uppercase(section_init),s);
|
||||
if i<>0 then
|
||||
begin
|
||||
inc(nv);
|
||||
trouve_sec_init:=true;
|
||||
compile_section_init;
|
||||
end;
|
||||
|
||||
sa:='VERIF_VERSION=';
|
||||
sa:=uppercase(verif_version_ch)+'=';
|
||||
i:=pos(sa,s);
|
||||
if i<>0 then
|
||||
begin
|
||||
trouve_verif_version:=true;
|
||||
inc(nv);
|
||||
delete(s,i,length(sa));
|
||||
// vérification de la version au démarrage
|
||||
@@ -3673,35 +3700,38 @@ begin
|
||||
if erreur=0 then verifVersion:=i=1;
|
||||
end;
|
||||
|
||||
sa:='NOTIF_VERSION=';
|
||||
sa:=uppercase(NOTIF_VERSION_ch)+'=';
|
||||
i:=pos(sa,s);
|
||||
if i<>0 then
|
||||
begin
|
||||
inc(nv);
|
||||
delete(s,i,length(sa));
|
||||
trouve_NOTIF_VERSION:=true;
|
||||
// vérification de la version au démarrage
|
||||
i:=0;
|
||||
val(s,i,erreur);
|
||||
notificationVersion:=i=1;
|
||||
end;
|
||||
|
||||
sa:='TCO=';
|
||||
sa:=uppercase(TCO_ch)+'=';
|
||||
i:=pos(sa,s);
|
||||
if i<>0 then
|
||||
begin
|
||||
inc(nv);
|
||||
delete(s,i,length(sa));
|
||||
trouve_TCO:=true;
|
||||
// vérification de la version au démarrage
|
||||
i:=0;
|
||||
val(s,i,erreur);
|
||||
AvecTCO:=i=1;
|
||||
end;
|
||||
|
||||
sa:='CDM=';
|
||||
sa:=uppercase(CDM_ch)+'=';
|
||||
i:=pos(sa,s);
|
||||
if i<>0 then
|
||||
begin
|
||||
inc(nv);
|
||||
trouve_CDM:=true;
|
||||
delete(s,i,length(sa));
|
||||
// vérification de la version au démarrage
|
||||
i:=0;
|
||||
@@ -3709,38 +3739,41 @@ begin
|
||||
LanceCDM:=i=1;
|
||||
end;
|
||||
|
||||
sa:='LAY=';
|
||||
sa:=uppercase(LAY_ch)+'=';
|
||||
i:=pos(sa,s);
|
||||
if i<>0 then
|
||||
begin
|
||||
inc(nv);
|
||||
trouve_lay:=true;
|
||||
delete(s,i,length(sa));
|
||||
lay:=s;
|
||||
end;
|
||||
|
||||
sa:='SERVEUR_INTERFACE=';
|
||||
sa:=uppercase(SERVEUR_INTERFACE_ch)+'=';
|
||||
i:=pos(sa,s);
|
||||
if i<>0 then
|
||||
begin
|
||||
inc(nv);
|
||||
trouve_serveur_interface:=true;
|
||||
delete(s,i,length(sa));
|
||||
i:=0;
|
||||
val(s,i,erreur);
|
||||
ServeurInterfaceCDM:=i;
|
||||
end;
|
||||
|
||||
sa:='RETRO=';
|
||||
sa:=uppercase(RETRO_ch)+'=';
|
||||
i:=pos(sa,s);
|
||||
if i<>0 then
|
||||
begin
|
||||
inc(nv);
|
||||
trouve_retro:=true;
|
||||
delete(s,i,length(sa));
|
||||
i:=0;
|
||||
val(s,i,erreur);
|
||||
ServeurRetroCDM:=i;
|
||||
end;
|
||||
|
||||
sa:='NB_DET_DIST=';
|
||||
sa:=uppercase(nb_det_dist_ch)+'=';
|
||||
i:=pos(sa,s);
|
||||
if i<>0 then
|
||||
begin
|
||||
@@ -3749,21 +3782,36 @@ begin
|
||||
delete(s,i,length(sa));
|
||||
i:=0;
|
||||
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;
|
||||
end;
|
||||
inc(it);
|
||||
|
||||
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);
|
||||
end;
|
||||
//affiche(IntToSTR(Nv)+' variables',cyan);
|
||||
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);
|
||||
|
||||
closefile(fichier);
|
||||
@@ -6781,6 +6829,8 @@ begin
|
||||
begin
|
||||
formTCO.Maj_TCO(Adresse);
|
||||
end;
|
||||
|
||||
// l'évaluation des routes est à faire selon conditions
|
||||
if faire_event then evalue;
|
||||
end;
|
||||
|
||||
@@ -7464,6 +7514,7 @@ var
|
||||
V_utile : real;
|
||||
CibleHandle : Thandle;
|
||||
begin
|
||||
//DoubleBuffered:=true;
|
||||
TraceSign:=True;
|
||||
PremierFD:=false;
|
||||
// services commIP CDM par défaut
|
||||
@@ -7651,10 +7702,13 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
// positionnement des aiguillages au démarrage : seulement en mode autonome
|
||||
procedure init_aiguillages;
|
||||
var i,pos : integer;
|
||||
s : string;
|
||||
begin
|
||||
if portCommOuvert or parSocketLenz then
|
||||
begin
|
||||
Affiche('Positionnement aiguillages',cyan);
|
||||
for i:=1 to maxaiguillage do
|
||||
begin
|
||||
@@ -7668,11 +7722,7 @@ begin
|
||||
application.processMessages;
|
||||
end;
|
||||
end;
|
||||
with formprinc do
|
||||
begin
|
||||
//Menu_interface(valide);
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
// timer à 100 ms
|
||||
@@ -7686,11 +7736,10 @@ begin
|
||||
if Tempo_init>0 then dec(Tempo_init);
|
||||
if (Tempo_init=1) and AvecInit then
|
||||
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
|
||||
begin
|
||||
Affiche('Positionnement des aiguillages',clYellow);
|
||||
Affiche('Positionnement des feux',clYellow);
|
||||
envoi_signauxCplx; // initialisation des feux
|
||||
init_aiguillages; // initialisation des aiguillages
|
||||
end;
|
||||
if (AvecInitAiguillages=0) and not(ferme) and (parSocketLenz or portCommOuvert) then
|
||||
@@ -7720,6 +7769,7 @@ begin
|
||||
begin
|
||||
//Affiche(IntToSTR(adresse),clOrange);
|
||||
Dessine_feu_mx(Feux[i].Img.Canvas,0,0,1,1,adresse,1);
|
||||
//Affiche('Clignote feu '+IntToSTR(adresse),clyellow);
|
||||
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;
|
||||
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';
|
||||
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|';
|
||||
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:='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;';
|
||||
trame_cdm:=trame_cdm+'S-E-14-5163-CMDACC-ST_DT|049|05|NAME=2757;OBJ=2757;AD=518;TRAIN=_NONE;STATE=1;';
|
||||
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<>'';
|
||||
if pos('ACK',trame_CDM)=0 then
|
||||
begin
|
||||
@@ -8183,16 +8240,20 @@ begin
|
||||
//Affiche('long chaine param='+intToSTR(long),clyellow);
|
||||
if long=0 then
|
||||
begin
|
||||
if debugTrames then Affiche('Longueur nulle',clYellow);
|
||||
Nbre_recu_cdm:=0;
|
||||
exit;
|
||||
//if debugTrames then Affiche('Longueur nulle',clYellow);
|
||||
if pos('ACK',trame_cdm)<>0 then Ack_cdm:=true;
|
||||
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;
|
||||
|
||||
if long<>0 then
|
||||
begin
|
||||
// trouver le nombre de paramètres
|
||||
i:=posEx('|',trame_CDM,i+1);
|
||||
if i=0 then
|
||||
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;
|
||||
exit;
|
||||
end;
|
||||
@@ -8207,17 +8268,16 @@ begin
|
||||
until (i=0) or (NbreVir=nbre);
|
||||
if i=0 then
|
||||
begin
|
||||
if debugTrames then Affiche('tronqué : '+trame_CDM,clyellow);
|
||||
if debugTrames then AfficheDebug('tronqué : '+trame_CDM,clyellow);
|
||||
residuCDM:=trame_CDM;
|
||||
Nbre_recu_cdm:=0;
|
||||
exit;
|
||||
end;
|
||||
|
||||
CommandeCDM:=copy(trame_CDM,1,i);
|
||||
if debugTrames then Affiche(commandeCDM,clorange);
|
||||
if debugTrames then AfficheDebug(commandeCDM,clorange);
|
||||
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
|
||||
posST:=pos('CMDACC-ST_TO',commandeCDM);
|
||||
if posST<>0 then
|
||||
@@ -8312,7 +8372,7 @@ begin
|
||||
|
||||
if (train='_NONE') then train:=detecteur[Adr].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);
|
||||
end ;
|
||||
|
||||
@@ -8403,6 +8463,8 @@ begin
|
||||
|
||||
inc(k);
|
||||
//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);
|
||||
until (sort);
|
||||
|
||||
@@ -8420,14 +8482,15 @@ procedure TFormPrinc.ClientSocketCDMRead(Sender: TObject;Socket: TCustomWinSocke
|
||||
traite,sort : boolean;
|
||||
begin
|
||||
inc(Nbre_recu_cdm);
|
||||
//if Nbre_recu_cdm>1 then Affiche('Empilement de trames CDM: '+RecuCDM,clred);
|
||||
recuCDM:=residuCDM+ClientSocketCDM.Socket.ReceiveText; // commandeCDM est le morceau tronquée de la fin de la réception précédente
|
||||
//if Nbre_recu_cdm>1 then Affiche('Empilement de trames CDM: '+intToSTR(Nbre_recu_cdm),clred);
|
||||
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);
|
||||
residuCDM:='';
|
||||
if trace then
|
||||
begin
|
||||
n:=80;
|
||||
Affiche('recu de CDM Tick='+IntToSTR(tick)+' '+IntToSTR(length(recuCDM))+' car',clWhite);Affiche(copy(recuCDM,1,n),clWhite);
|
||||
AfficheDebug(recuCDM,clWhite);
|
||||
l:=length(recuCDM);
|
||||
i:=1;
|
||||
repeat
|
||||
@@ -8819,6 +8882,11 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
procedure TFormPrinc.Button1Click(Sender: TObject);
|
||||
begin
|
||||
Interprete_trameCDM('yfytrf');
|
||||
end;
|
||||
|
||||
|
||||
begin
|
||||
|
||||
@@ -8826,4 +8894,5 @@ begin
|
||||
|
||||
|
||||
|
||||
|
||||
end.
|
||||
|
||||
Binary file not shown.
BIN
Binary file not shown.
+2
-2
@@ -1,6 +1,6 @@
|
||||
object FormVersion: TFormVersion
|
||||
Left = 500
|
||||
Top = 341
|
||||
Left = 497
|
||||
Top = 186
|
||||
Width = 468
|
||||
Height = 194
|
||||
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
|
||||
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
|
||||
|
||||
Affichage au démarrage des variables manquantes du fichier config-gl.cfg
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user