V2.31
This commit is contained in:
BIN
Notice avancée pour les signaux complexes GL.pdf
Normal file
BIN
Notice avancée pour les signaux complexes GL.pdf
Normal file
Binary file not shown.
BIN
UnitConfig.dcu
BIN
UnitConfig.dcu
Binary file not shown.
@@ -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
|
||||||
|
|||||||
364
UnitConfig.pas
364
UnitConfig.pas
@@ -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.
|
||||||
|
|
||||||
|
|||||||
BIN
UnitDebug.dcu
BIN
UnitDebug.dcu
Binary file not shown.
BIN
UnitPrinc.dcu
BIN
UnitPrinc.dcu
Binary file not shown.
215
UnitPrinc.pas
215
UnitPrinc.pas
@@ -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
|
|||||||
repeat
|
repeat
|
||||||
i:=index_aiguillage(Adresse,Nbranche);
|
i:=index_aiguillage(Adresse,Nbranche);
|
||||||
if i=0 then inc(NBranche);
|
if i=0 then inc(NBranche);
|
||||||
until (Nbranche>NbreBranches) or (i<>0);
|
|
||||||
//if (i<>0) then Affiche('aiguillage '+IntToSTR(adresse)+' trouvé en branche '+intToSTR(NBranche)+' index='+IntToSTR(i),clYellow);
|
|
||||||
until (Nbranche>NbreBranches) or (i<>0);
|
until (Nbranche>NbreBranches) or (i<>0);
|
||||||
//if (i<>0) then Affiche('aiguillage '+IntToSTR(adresse)+' trouvé en branche '+intToSTR(NBranche)+' index='+IntToSTR(i),clYellow);
|
//if (i<>0) then Affiche('aiguillage '+IntToSTR(adresse)+' trouvé en branche '+intToSTR(NBranche)+' index='+IntToSTR(i),clYellow);
|
||||||
branche_trouve:=NBranche;
|
branche_trouve:=NBranche;
|
||||||
|
IndexBranche_trouve:=i;
|
||||||
|
end;
|
||||||
|
|
||||||
|
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,trouve_retro,
|
tec,tjd,tjs,s2,trouve,triple,debugConfig,multiple,fini,finifeux,trouve_NbDetDist,trouve_ipv4_PC,trouve_retro,
|
||||||
@@ -3511,6 +3512,23 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
until (adresse=0);
|
until (adresse=0);
|
||||||
|
end;
|
||||||
|
|
||||||
|
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_cdm:=false;
|
||||||
trouve_NOTIF_VERSION:=false;
|
trouve_NOTIF_VERSION:=false;
|
||||||
trouve_fenetre:=false;
|
trouve_fenetre:=false;
|
||||||
@@ -3544,11 +3562,12 @@ begin
|
|||||||
Affiche('Fichier client-gl.cfg non trouvé',clred);
|
Affiche('Fichier client-gl.cfg non trouvé',clred);
|
||||||
end;
|
end;
|
||||||
{$I+}
|
{$I+}
|
||||||
nv:=0; it:=0;
|
nv:=0; it:=0;
|
||||||
{lecture du fichier de configuration}
|
{lecture du fichier de configuration}
|
||||||
// taille de fonte
|
// taille de fonte
|
||||||
repeat
|
repeat
|
||||||
s:=lit_ligne;
|
s:=lit_ligne;
|
||||||
|
//affiche(s,cllime);
|
||||||
sa:=uppercase(Fonte_ch)+'=';
|
sa:=uppercase(Fonte_ch)+'=';
|
||||||
i:=pos(sa,s);
|
i:=pos(sa,s);
|
||||||
if i<>0 then
|
if i<>0 then
|
||||||
@@ -3559,7 +3578,7 @@ begin
|
|||||||
TailleFonte:=StrToINT(s);
|
TailleFonte:=StrToINT(s);
|
||||||
with FormPrinc.ListBox1 do
|
with FormPrinc.ListBox1 do
|
||||||
begin
|
begin
|
||||||
Font.Height:=TailleFonte;
|
Font.Height:=TailleFonte;
|
||||||
ItemHeight:=TailleFonte+1;
|
ItemHeight:=TailleFonte+1;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@@ -3572,11 +3591,12 @@ begin
|
|||||||
inc(nv);
|
inc(nv);
|
||||||
trouve_ipv4_PC:=true;
|
trouve_ipv4_PC:=true;
|
||||||
delete(s,i,length(sa));
|
delete(s,i,length(sa));
|
||||||
i:=pos(':',s);
|
i:=pos(':',s);
|
||||||
if i<>0 then begin adresseIPCDM:=copy(s,1,i-1);Delete(s,1,i);portCDM:=StrToINT(s);end;
|
if i<>0 then begin adresseIPCDM:=copy(s,1,i-1);Delete(s,1,i);portCDM:=StrToINT(s);end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// adresse ip et port de la centrale
|
// adresse ip et port de la centrale
|
||||||
|
// AfficheDet:=true;
|
||||||
sa:=uppercase(IPV4_INTERFACE_ch)+'=';
|
sa:=uppercase(IPV4_INTERFACE_ch)+'=';
|
||||||
i:=pos(sa,s);
|
i:=pos(sa,s);
|
||||||
if i<>0 then
|
if i<>0 then
|
||||||
@@ -3584,45 +3604,49 @@ begin
|
|||||||
inc(nv);
|
inc(nv);
|
||||||
trouve_IPV4_INTERFACE:=true;
|
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
|
||||||
else begin adresseIP:='0';parSocketLenz:=false;end;
|
else begin adresseIP:='0';parSocketLenz:=false;end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
// configuration du port com
|
||||||
sa:=uppercase(PROTOCOLE_SERIE_ch)+'=';
|
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;
|
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:=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));
|
||||||
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:=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));
|
||||||
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:=uppercase(ENTETE_ch)+'=';
|
||||||
i:=pos(sa,s);
|
i:=pos(sa,s);
|
||||||
if i<>0 then
|
if i<>0 then
|
||||||
begin
|
begin
|
||||||
@@ -3630,41 +3654,44 @@ begin
|
|||||||
delete(s,i,length(sa));
|
delete(s,i,length(sa));
|
||||||
trouve_Entete:=true;
|
trouve_Entete:=true;
|
||||||
val(s,Valeur_entete,erreur);
|
val(s,Valeur_entete,erreur);
|
||||||
entete:='';
|
entete:='';
|
||||||
case Valeur_entete of
|
case Valeur_entete of
|
||||||
0 : begin entete:='';suffixe:='';end;
|
0 : begin entete:='';suffixe:='';end;
|
||||||
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_ch,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:=uppercase(INIT_AIG_ch)+'=';
|
sa:=uppercase(INIT_AIG_ch)+'=';
|
||||||
i:=pos(sa,s);
|
i:=pos(sa,s);
|
||||||
if i<>0 then
|
if i<>0 then
|
||||||
begin
|
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:=uppercase(fenetre_ch)+'=';
|
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);
|
||||||
inc(nv);
|
trouve_fenetre:=true;
|
||||||
delete(s,i,length(sa));
|
|
||||||
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;
|
||||||
|
|
||||||
i:=pos(uppercase(section_init),s);
|
i:=pos(uppercase(section_init),s);
|
||||||
if i<>0 then
|
if i<>0 then
|
||||||
if i<>0 then
|
begin
|
||||||
inc(nv);
|
inc(nv);
|
||||||
trouve_sec_init:=true;
|
trouve_sec_init:=true;
|
||||||
compile_section_init;
|
compile_section_init;
|
||||||
|
end;
|
||||||
|
|
||||||
sa:=uppercase(verif_version_ch)+'=';
|
sa:=uppercase(verif_version_ch)+'=';
|
||||||
i:=pos(sa,s);
|
i:=pos(sa,s);
|
||||||
@@ -3673,35 +3700,38 @@ begin
|
|||||||
trouve_verif_version:=true;
|
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
|
||||||
verifVersion:=true;
|
verifVersion:=true;
|
||||||
val(s,i,erreur);
|
val(s,i,erreur);
|
||||||
if erreur=0 then verifVersion:=i=1;
|
if erreur=0 then verifVersion:=i=1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
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;
|
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:=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;
|
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:=uppercase(CDM_ch)+'=';
|
sa:=uppercase(CDM_ch)+'=';
|
||||||
i:=pos(sa,s);
|
i:=pos(sa,s);
|
||||||
if i<>0 then
|
if i<>0 then
|
||||||
@@ -3709,38 +3739,41 @@ begin
|
|||||||
inc(nv);
|
inc(nv);
|
||||||
trouve_CDM:=true;
|
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;
|
||||||
val(s,i,erreur);
|
val(s,i,erreur);
|
||||||
LanceCDM:=i=1;
|
LanceCDM:=i=1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
sa:=uppercase(LAY_ch)+'=';
|
sa:=uppercase(LAY_ch)+'=';
|
||||||
i:=pos(sa,s);
|
i:=pos(sa,s);
|
||||||
if i<>0 then
|
if i<>0 then
|
||||||
begin
|
begin
|
||||||
begin
|
inc(nv);
|
||||||
trouve_lay:=true;
|
trouve_lay:=true;
|
||||||
delete(s,i,length(sa));
|
delete(s,i,length(sa));
|
||||||
lay:=s;
|
lay:=s;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
sa:=uppercase(SERVEUR_INTERFACE_ch)+'=';
|
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;
|
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:=uppercase(RETRO_ch)+'=';
|
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;
|
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;
|
||||||
@@ -3749,21 +3782,36 @@ begin
|
|||||||
sa:=uppercase(nb_det_dist_ch)+'=';
|
sa:=uppercase(nb_det_dist_ch)+'=';
|
||||||
i:=pos(sa,s);
|
i:=pos(sa,s);
|
||||||
if i<>0 then
|
if i<>0 then
|
||||||
begin
|
begin
|
||||||
inc(nv);
|
inc(nv);
|
||||||
trouve_NbDetDist:=true;
|
trouve_NbDetDist:=true;
|
||||||
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;
|
|
||||||
Nb_Det_Dist:=i;
|
|
||||||
end;
|
|
||||||
inc(it);
|
|
||||||
|
|
||||||
until (Nv>=18) or (it>30);
|
|
||||||
if i<2 then begin i:=2;Affiche('Attention '+nb_det_dist_ch+' ramené à '+IntToSTR(i),clOrange); end;
|
if i<2 then begin i:=2;Affiche('Attention '+nb_det_dist_ch+' ramené à '+IntToSTR(i),clOrange); end;
|
||||||
if (it>30) then
|
Nb_Det_Dist:=i;
|
||||||
begin
|
end;
|
||||||
|
inc(it);
|
||||||
|
|
||||||
|
until (Nv>=18) or (it>30);
|
||||||
|
|
||||||
|
//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_NOTIF_VERSION) then s:=s+' '+NOTIF_VERSION_ch;
|
||||||
if not(trouve_verif_version) then s:=s+' '+verif_version_ch;
|
if not(trouve_verif_version) then s:=s+' '+verif_version_ch;
|
||||||
if not(trouve_fonte) then s:=s+' '+fonte_ch;
|
if not(trouve_fonte) then s:=s+' '+fonte_ch;
|
||||||
@@ -6781,6 +6829,8 @@ begin
|
|||||||
event_det_tick[N_event_tick].aiguillage:=adresse;
|
event_det_tick[N_event_tick].aiguillage:=adresse;
|
||||||
event_det_tick[N_event_tick].etat:=pos;
|
event_det_tick[N_event_tick].etat:=pos;
|
||||||
event_det_tick[N_event_tick].objet:=objet;
|
event_det_tick[N_event_tick].objet:=objet;
|
||||||
|
|
||||||
|
// Mettre à jour le TCO
|
||||||
if AvecTCO then
|
if AvecTCO then
|
||||||
begin
|
begin
|
||||||
formTCO.Maj_TCO(Adresse);
|
formTCO.Maj_TCO(Adresse);
|
||||||
@@ -7464,6 +7514,7 @@ var
|
|||||||
|
|
||||||
procedure TFormPrinc.FormCreate(Sender: TObject);
|
procedure TFormPrinc.FormCreate(Sender: TObject);
|
||||||
var
|
var
|
||||||
|
i,j : integer;
|
||||||
s,s2,Url,LocalFile : string;
|
s,s2,Url,LocalFile : string;
|
||||||
trouve,AvecMaj : Boolean;
|
trouve,AvecMaj : Boolean;
|
||||||
V_utile : real;
|
V_utile : real;
|
||||||
@@ -7651,9 +7702,12 @@ begin
|
|||||||
portCommOuvert:=false;
|
portCommOuvert:=false;
|
||||||
ClientSocketCDM.close;
|
ClientSocketCDM.close;
|
||||||
ClientSocketLenz.close;
|
ClientSocketLenz.close;
|
||||||
|
if TCO_modifie then
|
||||||
if MessageDlg('Le TCO a été modifié. Voulez vous le sauvegarder ?',mtConfirmation,[mbYes,mbNo],0)=mrYes then
|
if MessageDlg('Le TCO a été modifié. Voulez vous le sauvegarder ?',mtConfirmation,[mbYes,mbNo],0)=mrYes then
|
||||||
sauve_fichier_tco;
|
sauve_fichier_tco;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
// positionnement des aiguillages au démarrage : seulement en mode autonome
|
// positionnement des aiguillages au démarrage : seulement en mode autonome
|
||||||
procedure init_aiguillages;
|
procedure init_aiguillages;
|
||||||
var i,pos : integer;
|
var i,pos : integer;
|
||||||
@@ -7668,11 +7722,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
pos:=aiguillage[i].position;
|
pos:=aiguillage[i].position;
|
||||||
s:='Init aiguillage '+intToSTR(i)+'='+intToSTR(pos);
|
s:='Init aiguillage '+intToSTR(i)+'='+intToSTR(pos);
|
||||||
if pos=1 then s:=s+' (dévié)' else s:=s+' (droit)';
|
|
||||||
Affiche(s,cyan);
|
|
||||||
pilote_acc(i,pos,aig);
|
|
||||||
if pos=1 then s:=s+' (dévié)' else s:=s+' (droit)';
|
if pos=1 then s:=s+' (dévié)' else s:=s+' (droit)';
|
||||||
end;
|
|
||||||
Affiche(s,cyan);
|
Affiche(s,cyan);
|
||||||
pilote_acc(i,pos,aig);
|
pilote_acc(i,pos,aig);
|
||||||
application.processMessages;
|
application.processMessages;
|
||||||
@@ -7686,11 +7736,10 @@ begin
|
|||||||
var index,aspect,i,a,x,y,x0,y0,Bimage,adresse,TailleX,TailleY,orientation : integer;
|
var index,aspect,i,a,x,y,x0,y0,Bimage,adresse,TailleX,TailleY,orientation : integer;
|
||||||
imageFeu : Timage;
|
imageFeu : Timage;
|
||||||
frx,fry : real;
|
frx,fry : real;
|
||||||
s : string;
|
|
||||||
begin
|
|
||||||
s : string;
|
s : string;
|
||||||
begin
|
begin
|
||||||
if (Tempo_init=1) and AvecInit then
|
inc(tick);
|
||||||
|
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) and not(ferme) and (AvecInitAiguillages=1) then
|
if not(ConfigNulle) and not(ferme) and (AvecInitAiguillages=1) then
|
||||||
@@ -7720,6 +7769,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
adresse:=feux[i].adresse;
|
adresse:=feux[i].adresse;
|
||||||
a:=EtatsignalCplx[adresse]; // a = état binaire du feu
|
a:=EtatsignalCplx[adresse]; // a = état binaire du feu
|
||||||
|
if TestBit(a,jaune_cli) or TestBit(a,ral_60) or
|
||||||
TestBit(a,rappel_60) or testBit(a,semaphore_cli) or
|
TestBit(a,rappel_60) or testBit(a,semaphore_cli) or
|
||||||
testBit(a,vert_cli) or testbit(a,blanc_cli) then
|
testBit(a,vert_cli) or testbit(a,blanc_cli) then
|
||||||
begin
|
begin
|
||||||
@@ -8164,10 +8214,17 @@ var i,j,objet,posST,posAC,posDT,posSG,posXY,k,l,erreur, adr,adr2,etat,etataig,
|
|||||||
|
|
||||||
procedure Interprete_trameCDM(trame_CDM:string);
|
procedure Interprete_trameCDM(trame_CDM:string);
|
||||||
var i,j,objet,posST,posAC,posDT,posSG,posXY,k,l,erreur, adr,adr2,etat,etataig,
|
var i,j,objet,posST,posAC,posDT,posSG,posXY,k,l,erreur, adr,adr2,etat,etataig,
|
||||||
vitesse,etatAig2,name,prv,nbre,nbreVir,long : integer ;
|
vitesse,etatAig2,name,prv,nbre,nbreVir,long : integer ;
|
||||||
x,y,x2,y2 : longint ;
|
x,y,x2,y2 : longint ;
|
||||||
s,ss,train,commandeCDM : string;
|
s,ss,train,commandeCDM : string;
|
||||||
|
traite,sort : boolean;
|
||||||
|
begin
|
||||||
|
{
|
||||||
|
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-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-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-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';
|
trame_cdm:=trame_cdm+'S-E-14-5169-CMDACC-ST_DT|049|05|NAME=7058;OBJ=7058;AD=517;TRAIN=_NONE;STATE=0';
|
||||||
@@ -8183,16 +8240,20 @@ begin
|
|||||||
k:=0;
|
k:=0;
|
||||||
//Affiche('L='+InTToSTR(length(recuCDM)),clyellow);
|
//Affiche('L='+InTToSTR(length(recuCDM)),clyellow);
|
||||||
repeat
|
repeat
|
||||||
// trouver la longueur de la chaîne de paramètres
|
// trouver la longueur de la chaîne de paramètres
|
||||||
i:=pos('|',trame_CDM);
|
i:=pos('|',trame_CDM);
|
||||||
val(copy(trame_CDM,i+1,5),long,erreur);
|
val(copy(trame_CDM,i+1,5),long,erreur);
|
||||||
|
//Affiche('long chaine param='+intToSTR(long),clyellow);
|
||||||
|
if long=0 then
|
||||||
begin
|
begin
|
||||||
//if debugTrames then Affiche('Longueur nulle',clYellow);
|
//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;
|
if i=0 then begin Affiche('Erreur trames CDM manque 2ème |',clred);exit;end;
|
||||||
delete(trame_cdm,1,i);
|
delete(trame_cdm,1,i);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end;
|
if long<>0 then
|
||||||
begin
|
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);
|
||||||
@@ -8207,17 +8268,16 @@ begin
|
|||||||
//Affiche('nbre='+IntToSTR(nbre),clyellow);
|
//Affiche('nbre='+IntToSTR(nbre),clyellow);
|
||||||
// compter le nombre de virgules qui doit être égal au nombre de paramètres
|
// compter le nombre de virgules qui doit être égal au nombre de paramètres
|
||||||
NbreVir:=0; // nombre de virgules
|
NbreVir:=0; // nombre de virgules
|
||||||
repeat
|
repeat
|
||||||
i:=posEx(';',trame_CDM,i+1);
|
i:=posEx(';',trame_CDM,i+1);
|
||||||
if i<>0 then inc(NbreVir);
|
if i<>0 then inc(NbreVir);
|
||||||
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 AfficheDebug('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;
|
end;
|
||||||
|
|
||||||
CommandeCDM:=copy(trame_CDM,1,i);
|
CommandeCDM:=copy(trame_CDM,1,i);
|
||||||
@@ -8312,7 +8372,7 @@ begin
|
|||||||
train:=copy(commandeCDM,i+6,j-i-6);
|
train:=copy(commandeCDM,i+6,j-i-6);
|
||||||
delete(commandeCDM,i,7);
|
delete(commandeCDM,i,7);
|
||||||
|
|
||||||
//Affiche('Train=*'+Train+'*',clOrange);
|
//Affiche('Train=*'+Train+'*',clOrange);
|
||||||
i:=posEx('STATE=',commandeCDM,posDT);ss:=copy(commandeCDM,i+6,10);
|
i:=posEx('STATE=',commandeCDM,posDT);ss:=copy(commandeCDM,i+6,10);
|
||||||
val(ss,etat,erreur); Delete(commandeCDM,i,7);
|
val(ss,etat,erreur); Delete(commandeCDM,i,7);
|
||||||
|
|
||||||
@@ -8403,6 +8463,8 @@ begin
|
|||||||
val(ss,y2,erreur);
|
val(ss,y2,erreur);
|
||||||
//Affiche('Y2='+IntTostr(y2),clyellow);
|
//Affiche('Y2='+IntTostr(y2),clyellow);
|
||||||
Delete(commandeCDM,i,l-i+1);
|
Delete(commandeCDM,i,l-i+1);
|
||||||
|
|
||||||
|
Delete(commandeCDM,posXY,12);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
inc(k);
|
inc(k);
|
||||||
@@ -8420,14 +8482,15 @@ procedure TFormPrinc.ClientSocketCDMRead(Sender: TObject;Socket: TCustomWinSocke
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
// réception d'un message de CDM rail
|
// réception d'un message de CDM rail
|
||||||
procedure TFormPrinc.ClientSocketCDMRead(Sender: TObject;Socket: TCustomWinSocket);
|
procedure TFormPrinc.ClientSocketCDMRead(Sender: TObject;Socket: TCustomWinSocket);
|
||||||
var i,l,n : integer ;
|
var i,l,n : integer ;
|
||||||
s,ss,train : string;
|
s,ss,train : string;
|
||||||
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: '+intToSTR(Nbre_recu_cdm),clred);
|
//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
|
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:='';
|
residuCDM:='';
|
||||||
if trace then
|
if trace then
|
||||||
begin
|
begin
|
||||||
@@ -8819,6 +8882,11 @@ begin
|
|||||||
|
|
||||||
procedure TFormPrinc.locoClick(Sender: TObject);
|
procedure TFormPrinc.locoClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
|
// vitesse et direction 18 pas
|
||||||
|
|
||||||
|
vitesse_loco(3,20,true);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TFormPrinc.Button1Click(Sender: TObject);
|
procedure TFormPrinc.Button1Click(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
@@ -8826,4 +8894,5 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
begin
|
||||||
|
|
||||||
|
|||||||
BIN
UnitSimule.dcu
BIN
UnitSimule.dcu
Binary file not shown.
BIN
UnitTCO.dcu
BIN
UnitTCO.dcu
Binary file not shown.
@@ -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'
|
||||||
|
|||||||
@@ -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