V1.0.1
V1.0.1
This commit is contained in:
Binary file not shown.
+32
-27
@@ -121,7 +121,7 @@ type
|
|||||||
// L'oeilleton est cablé sur la sortie 4, il est géré directement par le décodeur. **/
|
// L'oeilleton est cablé sur la sortie 4, il est géré directement par le décodeur. **/
|
||||||
// code des aspects des signaux
|
// code des aspects des signaux
|
||||||
const
|
const
|
||||||
AF='Client TCP-IP CDM Rail ou USB - système LENZ - Version 1.0';
|
AF='Client TCP-IP CDM Rail ou USB - système LENZ - Version 1.01';
|
||||||
carre =0 ; carre_F=1;
|
carre =0 ; carre_F=1;
|
||||||
semaphore =1 ; semaphore_F=2;
|
semaphore =1 ; semaphore_F=2;
|
||||||
semaphore_cli =2 ; semaphore_cli_F=4;
|
semaphore_cli =2 ; semaphore_cli_F=4;
|
||||||
@@ -197,7 +197,7 @@ var ancien_tablo_signalCplx,EtatsignalCplx : array[0..MaxAcc] of word;
|
|||||||
Nbre_recu_cdm,NivDebug,Tempo_chgt_feux : integer;
|
Nbre_recu_cdm,NivDebug,Tempo_chgt_feux : integer;
|
||||||
dem_calcul_zone,Hors_tension2,traceSign,TraceZone,Ferme,ParUSB,parSocket,ackCdm,
|
dem_calcul_zone,Hors_tension2,traceSign,TraceZone,Ferme,ParUSB,parSocket,ackCdm,
|
||||||
NackCDM : boolean;
|
NackCDM : boolean;
|
||||||
clignotant,test_leb,nack,Maj_feux_cours,avecMSCom : boolean;
|
clignotant,nack,Maj_feux_cours,avecMSCom : boolean;
|
||||||
N_event_det : integer; // index du dernier évènement (de 1 à 20)
|
N_event_det : integer; // index du dernier évènement (de 1 à 20)
|
||||||
event_det : array[1..20] of integer;
|
event_det : array[1..20] of integer;
|
||||||
branche : array [1..100] of string;
|
branche : array [1..100] of string;
|
||||||
@@ -533,7 +533,7 @@ begin
|
|||||||
Parent:=Formprinc.ScrollBox1; // dire que l'image est dans la scrollBox1
|
Parent:=Formprinc.ScrollBox1; // dire que l'image est dans la scrollBox1
|
||||||
Top:=(HtImg+espY+20)*((rang-1) div NbreImagePLigne); // détermine les dimensions
|
Top:=(HtImg+espY+20)*((rang-1) div NbreImagePLigne); // détermine les dimensions
|
||||||
Left:=10+ (LargImg+5)*((rang-1) mod (NbreImagePLigne));
|
Left:=10+ (LargImg+5)*((rang-1) mod (NbreImagePLigne));
|
||||||
s:='Signal @'+IntToSTR(Feux[rang].adresse)+' Decodeur='+intToSTR(feux[rang].Decodeur)+' Adresse détecteur associé='+intToSTR(feux[rang].Adr_det1)+
|
s:='Decodeur='+intToSTR(feux[rang].Decodeur)+' Adresse détecteur associé='+intToSTR(feux[rang].Adr_det1)+
|
||||||
' Adresse élement suivant='+intToSTR(feux[rang].Adr_el_suiv1);
|
' Adresse élement suivant='+intToSTR(feux[rang].Adr_el_suiv1);
|
||||||
if feux[rang].Btype_suiv1=2 then s:=s+' (aig)';
|
if feux[rang].Btype_suiv1=2 then s:=s+' (aig)';
|
||||||
if feux[rang].Btype_suiv1=5 then s:=s+' (aig bis)';
|
if feux[rang].Btype_suiv1=5 then s:=s+' (aig bis)';
|
||||||
@@ -975,7 +975,6 @@ procedure envoi_directionCDF(adr : integer;code : integer);
|
|||||||
begin
|
begin
|
||||||
if (EtatSignalCplx[adr]<>code) then
|
if (EtatSignalCplx[adr]<>code) then
|
||||||
begin
|
begin
|
||||||
dessine_feu(adr);
|
|
||||||
if traceSign then Affiche('signal directionnel CDF: '+IntToSTR(adr)+' '+intToSTR(code),ClOrange);
|
if traceSign then Affiche('signal directionnel CDF: '+IntToSTR(adr)+' '+intToSTR(code),ClOrange);
|
||||||
|
|
||||||
case code of
|
case code of
|
||||||
@@ -1017,7 +1016,6 @@ begin
|
|||||||
code:=feux[index].aspect; // aspect du feu;
|
code:=feux[index].aspect; // aspect du feu;
|
||||||
if (ancien_tablo_signalCplx[adresse]<>EtatSignalCplx[adresse]) then //; && (stop_cmd==FALSE))
|
if (ancien_tablo_signalCplx[adresse]<>EtatSignalCplx[adresse]) then //; && (stop_cmd==FALSE))
|
||||||
begin
|
begin
|
||||||
dessine_feu(adresse);
|
|
||||||
ancien_tablo_signalCplx[adresse]:=EtatSignalCplx[adresse];
|
ancien_tablo_signalCplx[adresse]:=EtatSignalCplx[adresse];
|
||||||
aspect:=code_to_aspect(code);
|
aspect:=code_to_aspect(code);
|
||||||
if traceSign then affiche('Signal CDF: '+intToSTR(adresse)+' '+intToSTR(code),clOrange);
|
if traceSign then affiche('Signal CDF: '+intToSTR(adresse)+' '+intToSTR(code),clOrange);
|
||||||
@@ -1060,7 +1058,6 @@ begin
|
|||||||
|
|
||||||
if (ancien_tablo_signalCplx[adr]<>EtatSignalCplx[adr]) then //; && (stop_cmd==FALSE))
|
if (ancien_tablo_signalCplx[adr]<>EtatSignalCplx[adr]) then //; && (stop_cmd==FALSE))
|
||||||
begin
|
begin
|
||||||
dessine_feu(adr);
|
|
||||||
ancien_tablo_signalCplx[adr]:=EtatSignalCplx[adr];
|
ancien_tablo_signalCplx[adr]:=EtatSignalCplx[adr];
|
||||||
codebin:=EtatSignalCplx[adr];
|
codebin:=EtatSignalCplx[adr];
|
||||||
aspect:=code_to_aspect(codebin);
|
aspect:=code_to_aspect(codebin);
|
||||||
@@ -1102,6 +1099,7 @@ begin
|
|||||||
if ((Combine=rappel_60) and (aspect=jaune)) then envoi5_LEB($10);
|
if ((Combine=rappel_60) and (aspect=jaune)) then envoi5_LEB($10);
|
||||||
if ((Combine=rappel_60) and (aspect=jaune_cli)) then envoi5_LEB($11);
|
if ((Combine=rappel_60) and (aspect=jaune_cli)) then envoi5_LEB($11);
|
||||||
if ((Combine=ral_60) and (aspect=jaune_cli)) then envoi5_LEB($12);
|
if ((Combine=ral_60) and (aspect=jaune_cli)) then envoi5_LEB($12);
|
||||||
|
dessine_feu(adr);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -1180,7 +1178,6 @@ begin
|
|||||||
if (ancien_tablo_signalCplx[adr]<>EtatSignalCplx[adr]) then //; && (stop_cmd==FALSE))
|
if (ancien_tablo_signalCplx[adr]<>EtatSignalCplx[adr]) then //; && (stop_cmd==FALSE))
|
||||||
begin
|
begin
|
||||||
ancien_tablo_signalCplx[adr]:=EtatSignalCplx[adr];
|
ancien_tablo_signalCplx[adr]:=EtatSignalCplx[adr];
|
||||||
dessine_feu(adr);
|
|
||||||
//if (tempo_ACC>0) then sleep(100); // les commandes entre 2 feux successives doivent être séparées au minimum de 100 ms
|
//if (tempo_ACC>0) then sleep(100); // les commandes entre 2 feux successives doivent être séparées au minimum de 100 ms
|
||||||
if traceSign then affiche('Signal LDT: '+IntToSTR(adr)+' '+intToSTR(mode)+' '+intTOSTR(codebin),clOrange);
|
if traceSign then affiche('Signal LDT: '+IntToSTR(adr)+' '+intToSTR(mode)+' '+intTOSTR(codebin),clOrange);
|
||||||
if (aspect=semaphore) or (aspect=vert) or (aspect=carre) or (aspect=jaune) then mode:=1 else mode:=2;
|
if (aspect=semaphore) or (aspect=vert) or (aspect=carre) or (aspect=jaune) then mode:=1 else mode:=2;
|
||||||
@@ -1226,7 +1223,6 @@ begin
|
|||||||
code:=etatsignalcplx[adresse];
|
code:=etatsignalcplx[adresse];
|
||||||
if (ancien_tablo_signalCplx[adresse]<>EtatSignalCplx[adresse]) then //; && (stop_cmd==FALSE))
|
if (ancien_tablo_signalCplx[adresse]<>EtatSignalCplx[adresse]) then //; && (stop_cmd==FALSE))
|
||||||
begin
|
begin
|
||||||
dessine_feu(adresse);
|
|
||||||
ancien_tablo_signalCplx[adresse]:=EtatSignalCplx[adresse];
|
ancien_tablo_signalCplx[adresse]:=EtatSignalCplx[adresse];
|
||||||
aspect:=code_to_aspect(code); // transforme le motif de bits en numéro "code des aspects des signaux"
|
aspect:=code_to_aspect(code); // transforme le motif de bits en numéro "code des aspects des signaux"
|
||||||
if (tracesign) then Affiche('Signal virtuel: '+intToSTR(adresse)+' Etat '+etatSign[aspect],clyellow);
|
if (tracesign) then Affiche('Signal virtuel: '+intToSTR(adresse)+' Etat '+etatSign[aspect],clyellow);
|
||||||
@@ -1250,10 +1246,10 @@ begin
|
|||||||
// affiche(s,ClYellow);
|
// affiche(s,ClYellow);
|
||||||
if (ancien_tablo_signalCplx[adresse]<>EtatSignalCplx[adresse]) then //; && (stop_cmd==FALSE))
|
if (ancien_tablo_signalCplx[adresse]<>EtatSignalCplx[adresse]) then //; && (stop_cmd==FALSE))
|
||||||
begin
|
begin
|
||||||
dessine_feu(adresse);
|
|
||||||
codebin:=EtatSignalCplx[adresse];
|
codebin:=EtatSignalCplx[adresse];
|
||||||
aspect:=code_to_aspect(codebin); // transforme le motifs de bits en numéro "code des aspects des signaux"
|
aspect:=code_to_aspect(codebin); // transforme le motifs de bits en numéro "code des aspects des signaux"
|
||||||
combineLoc:=combine; // copier dans variable locale
|
combineLoc:=combine; // copier dans variable locale
|
||||||
|
//dessine_feu(adresse);
|
||||||
if traceSign then
|
if traceSign then
|
||||||
begin
|
begin
|
||||||
s:='Signal bahn: ad'+IntToSTR(adresse)+'='+etatSign[aspect];
|
s:='Signal bahn: ad'+IntToSTR(adresse)+'='+etatSign[aspect];
|
||||||
@@ -1279,6 +1275,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
Sleep(40);
|
Sleep(40);
|
||||||
pilote_acc(adresse+semaphore,2,feu) ;
|
pilote_acc(adresse+semaphore,2,feu) ;
|
||||||
|
// dessine_feu(adresse);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ancien_tablo_signalCplx[adresse]:=EtatSignalCplx[adresse];
|
ancien_tablo_signalCplx[adresse]:=EtatSignalCplx[adresse];
|
||||||
@@ -1294,6 +1291,7 @@ begin
|
|||||||
sleep(40);
|
sleep(40);
|
||||||
pilote_ACC(adresse+CombineLoc,2,feu) ;
|
pilote_ACC(adresse+CombineLoc,2,feu) ;
|
||||||
end;
|
end;
|
||||||
|
dessine_feu(adresse);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -4469,9 +4467,7 @@ begin
|
|||||||
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
//if test_leb=false then rafraichit;
|
|
||||||
if dem_calcul_zone then calcul_zones;
|
if dem_calcul_zone then calcul_zones;
|
||||||
//Affiche('Rafraichit',clorange);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function decode_chaine_retro(s : string) : string;
|
function decode_chaine_retro(s : string) : string;
|
||||||
@@ -4540,7 +4536,6 @@ var chaineInt,msg : string;
|
|||||||
i : integer;
|
i : integer;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
//if test_leb then exit;
|
|
||||||
chaineInt:=chaine;
|
chaineInt:=chaine;
|
||||||
//ack:=false;
|
//ack:=false;
|
||||||
//nack:=false;
|
//nack:=false;
|
||||||
@@ -4663,7 +4658,11 @@ begin
|
|||||||
portCommOuvert:=false;
|
portCommOuvert:=false;
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
else portCommOuvert:=false;
|
else
|
||||||
|
begin
|
||||||
|
portCommOuvert:=false;
|
||||||
|
Affiche('Port Com nul dans le fichier de configuration',clyellow);
|
||||||
|
end;
|
||||||
if portCommOuvert then affiche('port COM'+intToSTR(NumPort)+' ouvert',clGreen) else
|
if portCommOuvert then affiche('port COM'+intToSTR(NumPort)+' ouvert',clGreen) else
|
||||||
Affiche('port COM'+intToSTR(NumPort)+' NON ouvert',clRed) ;
|
Affiche('port COM'+intToSTR(NumPort)+' NON ouvert',clRed) ;
|
||||||
if portCommOuvert then ParUSB:=true else ParUSB:=false;
|
if portCommOuvert then ParUSB:=true else ParUSB:=false;
|
||||||
@@ -4779,8 +4778,6 @@ begin
|
|||||||
s:=DateToStr(date)+' '+TimeToStr(Time)+' '+s;
|
s:=DateToStr(date)+' '+TimeToStr(Time)+' '+s;
|
||||||
Affiche(s,clLime);AfficheDebug(s,ClLime);
|
Affiche(s,clLime);AfficheDebug(s,ClLime);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
NivDebug:=0;
|
NivDebug:=0;
|
||||||
// lecture fichier de configuration
|
// lecture fichier de configuration
|
||||||
ferme:=false;
|
ferme:=false;
|
||||||
@@ -4789,19 +4786,26 @@ begin
|
|||||||
lit_config;
|
lit_config;
|
||||||
Nbre_recu_cdm:=0;
|
Nbre_recu_cdm:=0;
|
||||||
|
|
||||||
connecte_USB;
|
|
||||||
|
|
||||||
AffMem:=true;
|
AffMem:=true;
|
||||||
|
|
||||||
// Initialisation de la comm socket LENZ
|
|
||||||
if AdresseIP<>'0' then
|
|
||||||
begin
|
|
||||||
ClientSocketLenz.port:=port;
|
|
||||||
ClientSocketLenz.Address:=AdresseIP;
|
|
||||||
ClientSocketLenz.Open;
|
|
||||||
end;
|
|
||||||
|
|
||||||
connecte_CDM;
|
connecte_CDM;
|
||||||
|
if CDM_connecte then // si CDM est connecté, on n'ouvre pas de liaison vers la centrale
|
||||||
|
begin
|
||||||
|
// sinon ouvrir socket vers la centrale
|
||||||
|
avecMScom:=false;
|
||||||
|
// Initialisation de la comm socket LENZ
|
||||||
|
if AdresseIP<>'0' then
|
||||||
|
begin
|
||||||
|
ClientSocketLenz.port:=port;
|
||||||
|
ClientSocketLenz.Address:=AdresseIP;
|
||||||
|
ClientSocketLenz.Open;
|
||||||
|
avecMSCom:=false;
|
||||||
|
end;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
AvecMsCom:=True;
|
||||||
|
|
||||||
|
connecte_USB; // connecte si avecMSCom=True;
|
||||||
|
|
||||||
// Initialisation des images des signaux
|
// Initialisation des images des signaux
|
||||||
NbreImagePLigne:=Formprinc.ScrollBox1.Width div (largImg+5);
|
NbreImagePLigne:=Formprinc.ScrollBox1.Width div (largImg+5);
|
||||||
@@ -4812,7 +4816,7 @@ begin
|
|||||||
cree_image(i); // et initialisation tableaux signaux
|
cree_image(i); // et initialisation tableaux signaux
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if test_leb then Tempo_init:=0 else Tempo_init:=10; // démarre les initialisation des signaux et des aiguillages dans 1 s
|
Tempo_init:=10; // démarre les initialisation des signaux et des aiguillages dans 1 s
|
||||||
|
|
||||||
NombreImages:=0;
|
NombreImages:=0;
|
||||||
|
|
||||||
@@ -4846,7 +4850,6 @@ begin
|
|||||||
//Affiche(IntToSTR(detecteur_suivant_El(531,false,518,false)),clyellow);
|
//Affiche(IntToSTR(detecteur_suivant_El(531,false,518,false)),clyellow);
|
||||||
//i:=Aiguille_deviee(176);
|
//i:=Aiguille_deviee(176);
|
||||||
|
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@@ -5094,6 +5097,8 @@ begin
|
|||||||
if not(ferme) and (AvecInitAiguillages=1) then init_aiguillages else // initialisation des aiguillages
|
if not(ferme) and (AvecInitAiguillages=1) then init_aiguillages else // initialisation des aiguillages
|
||||||
if not(ferme) then demande_etat_acc; // demande l'état des accessoires (position des aiguillages)
|
if not(ferme) then demande_etat_acc; // demande l'état des accessoires (position des aiguillages)
|
||||||
LabelEtat.Caption:=' ';
|
LabelEtat.Caption:=' ';
|
||||||
|
Menu_interface(valide);
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if temps>0 then dec(temps);
|
if temps>0 then dec(temps);
|
||||||
|
|||||||
Reference in New Issue
Block a user