This commit is contained in:
f1iwq2
2022-02-15 17:41:12 +01:00
parent 864a101dc5
commit e54910f5c0
16 changed files with 215 additions and 276 deletions

Binary file not shown.

View File

@@ -1578,7 +1578,7 @@ object FormConfig: TFormConfig
Top = 8 Top = 8
Width = 633 Width = 633
Height = 481 Height = 481
ActivePage = TabSheetSig ActivePage = TabSheetAig
Font.Charset = DEFAULT_CHARSET Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack Font.Color = clBlack
Font.Height = -11 Font.Height = -11
@@ -2886,7 +2886,7 @@ object FormConfig: TFormConfig
Top = 48 Top = 48
Width = 129 Width = 129
Height = 21 Height = 21
ItemHeight = 13 ItemHeight = 0
TabOrder = 1 TabOrder = 1
OnChange = ComboBoxDecChange OnChange = ComboBoxDecChange
end end

View File

@@ -1,4 +1,4 @@
unit UnitConfig; Unit UnitConfig;
interface interface
@@ -362,13 +362,13 @@ Tempo_Feu_ch='Tempo_Feu';
NOTIF_VERSION_ch='NOTIF_VERSION'; NOTIF_VERSION_ch='NOTIF_VERSION';
verif_version_ch='verif_version'; verif_version_ch='verif_version';
Fonte_ch='Fonte'; Fonte_ch='Fonte';
Raz_signaux_ch='RazSignaux';
// variables de config // sections de config
section_aig_ch='[section_aig]'; section_aig_ch='[section_aig]';
section_sig_ch='[section_sig]'; section_sig_ch='[section_sig]';
section_act_ch='[section_act]'; section_act_ch='[section_act]';
section_branches_ch='[section_branches]'; section_branches_ch='[section_branches]';
Raz_signaux_ch='RazSignaux';
var var
FormConfig: TFormConfig; FormConfig: TFormConfig;
@@ -392,7 +392,7 @@ procedure decode_ligne_feux(chaine_signal : string;i : integer);
function verif_coherence : boolean; function verif_coherence : boolean;
function compile_branche(s : string;i : integer) : boolean; function compile_branche(s : string;i : integer) : boolean;
function encode_sig_feux(i : integer): string; function encode_sig_feux(i : integer): string;
implementation implementation
uses UnitDebug,UnitTCO, UnitSR; uses UnitDebug,UnitTCO, UnitSR;
@@ -403,8 +403,7 @@ uses UnitDebug,UnitTCO, UnitSR;
function envoi_CDM(s : string) : boolean; function envoi_CDM(s : string) : boolean;
var temps : integer; var temps : integer;
begin begin
if SocketCDM_connecte=false then begin envoi_CDM:=false;exit;end; if CDM_connecte=false then begin envoi_CDM:=false;exit;end;
//Affiche('Envoi à CDM rail',clRed);Affiche(s,ClGreen);
if traceTrames then afficheDebug(s,clLime); if traceTrames then afficheDebug(s,clLime);
Formprinc.ClientSocketCDM.Socket.SendText(s); Formprinc.ClientSocketCDM.Socket.SendText(s);
// attend l'ack // attend l'ack
@@ -502,9 +501,9 @@ begin
Sleep(50); Sleep(50);
inc(i); inc(i);
Application.processMessages; Application.processMessages;
until (i>10) or SocketCDM_connecte ; until (i>10) or CDM_connecte ;
//if i>10 then affiche('Timeout',clred); //if i>10 then affiche('Timeout',clred);
if not(SocketCDM_connecte) then begin Affiche('Socket CDM non connecté',clOrange);exit;end; if not(CDM_connecte) then begin Affiche('Socket CDM non connecté',clOrange);exit;end;
// connexion à CDM rail // connexion à CDM rail
recuCDM:=''; recuCDM:='';
@@ -683,21 +682,23 @@ begin
end; end;
end; end;
//
function TypeElAIg_to_char(adr : integer;c : char) : string; function TypeElAIg_to_char(adr : integer;c : char) : string;
var s: string; var s: string;
begin begin
case c of if (adr=0) and (c<>'D') and (c<>'S') and (c<>'P') then s:='Buttoir';
'Z',#0 : s:='détecteur '+IntToSTR(adr);
'P' : s:='pointe de l''aiguillage '+IntToSTR(adr); if adr<>0 then
'S' : s:='position déviée de l''aiguillage '+IntToSTR(adr); begin
'D' : s:='position droite de l''aiguillage '+IntToSTR(adr); if c='P' then s:='pointe de l''aiguillage '+IntToSTR(adr) else
else s:='Erreur'; if c='S' then s:='position déviée de l''aiguillage '+IntToSTR(adr) else
if c='D' then s:='position droite de l''aiguillage '+IntToSTR(adr) else
if (c<>'D') and (c<>'S') and (c<>'P') then s:='détecteur '+IntToSTR(adr) else
s:='erreur';
end; end;
TypeElAIg_to_char:=s; TypeElAIg_to_char:=s;
end; end;
// transforme le signal du tableau feux[] en texte // transforme le signal du tableau feux[] en texte
function encode_sig_feux(i : integer): string; function encode_sig_feux(i : integer): string;
var s : string; var s : string;
adresse,aspect,j,k,NfeuxDir,CondCarre,nc : integer; adresse,aspect,j,k,NfeuxDir,CondCarre,nc : integer;
@@ -2741,7 +2742,7 @@ begin
b:=aiguillage[Index_Aig(adresse)].ADroitB; b:=aiguillage[Index_Aig(adresse)].ADroitB;
if b='Z' then b:=#0; if b='Z' then b:=#0;
Edit_HG.Text:=intToSTR(aiguillage[index].ADroit)+b; Edit_HG.Text:=intToSTR(aiguillage[index].ADroit)+b;
Edit_HG.Hint:=TypeElAIg_to_char(aiguillage[index].Adroit,b); Edit_HG.Hint:=TypeElAIg_to_char(aiguillage[index].Adroit,b);
// champ en bas à gauche // champ en bas à gauche
b:=aiguillage[Index].ADevieB; b:=aiguillage[Index].ADevieB;

Binary file not shown.

Binary file not shown.

View File

@@ -4,7 +4,7 @@ object FormPilote: TFormPilote
BorderStyle = bsDialog BorderStyle = bsDialog
Caption = 'Pilotage' Caption = 'Pilotage'
ClientHeight = 350 ClientHeight = 350
ClientWidth = 346 ClientWidth = 331
Color = clBtnFace Color = clBtnFace
Font.Charset = DEFAULT_CHARSET Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
@@ -19,7 +19,7 @@ object FormPilote: TFormPilote
TextHeight = 13 TextHeight = 13
object LabelTitrePilote: TLabel object LabelTitrePilote: TLabel
Left = 8 Left = 8
Top = 0 Top = 8
Width = 249 Width = 249
Height = 34 Height = 34
Caption = 'Pilotage du signal' Caption = 'Pilotage du signal'

View File

@@ -1,6 +1,6 @@
unit UnitPilote; unit UnitPilote;
// cet unité utilise stocke l'état du signal de pilotage dans l'index 0 du tableau EtatSignalcplx // cette unité stocke l'état du signal de pilotage dans l'index 0 du tableau EtatSignalcplx
interface interface
@@ -9,7 +9,7 @@ uses
Dialogs, ExtCtrls, StdCtrls, UnitPrinc; Dialogs, ExtCtrls, StdCtrls, UnitPrinc;
type type
TFormPilote = class(TForm) TFormPilote = class(TForm)
LabelTitrePilote: TLabel; LabelTitrePilote: TLabel;
ImagePilote: TImage; ImagePilote: TImage;
GroupBox1: TGroupBox; GroupBox1: TGroupBox;
@@ -82,12 +82,12 @@ Disque_D =14; // pour d
ral_60_jaune_cli =15;ral_60_jaune_cli_F=16384; // pour décodeur LDT ral_60_jaune_cli =15;ral_60_jaune_cli_F=16384; // pour décodeur LDT
aspect8 =16 ; aspect8 =16 ;
var var
FormPilote: TFormPilote; FormPilote: TFormPilote;
EtatFeuPilote : word; EtatFeuPilote : word;
AdrPilote : integer; AdrPilote : integer;
procedure dessine_feu_pilote; procedure dessine_feu_pilote;
implementation implementation
@@ -266,4 +266,5 @@ begin
LabelDec.Caption:=decodeur[d]; LabelDec.Caption:=decodeur[d];
end; end;
end. end.

Binary file not shown.

View File

@@ -1,6 +1,6 @@
object FormPrinc: TFormPrinc object FormPrinc: TFormPrinc
Left = 24 Left = 15
Top = 203 Top = 195
Width = 1213 Width = 1213
Height = 664 Height = 664
Caption = 'Client TCP-IP CDM Rail ou USB - syst'#232'me LENZ' Caption = 'Client TCP-IP CDM Rail ou USB - syst'#232'me LENZ'
@@ -1538,7 +1538,6 @@ object FormPrinc: TFormPrinc
Width = 25 Width = 25
Height = 21 Height = 21
TabOrder = 1 TabOrder = 1
OnChange = EditAdrTrainChange
end end
object EditVitesse: TEdit object EditVitesse: TEdit
Left = 80 Left = 80

View File

@@ -3,7 +3,7 @@ Unit UnitPrinc;
programme signaux complexes Graphique Lenz programme signaux complexes Graphique Lenz
delphi 7 + activeX Tmscomm + clientSocket delphi 7 + activeX Tmscomm + clientSocket
******************************************** ********************************************
13/2/2022 11h00 15/2/2022 10h00
note sur le pilotage des accessoires: note sur le pilotage des accessoires:
raquette octet sortie raquette octet sortie
+ 2 = aiguillage droit = sortie 2 de l'adresse d'accessoire + 2 = aiguillage droit = sortie 2 de l'adresse d'accessoire
@@ -171,7 +171,6 @@ type
procedure FenRichMouseDown(Sender: TObject; Button: TMouseButton; procedure FenRichMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer); Shift: TShiftState; X, Y: Integer);
procedure ButtonLocCVClick(Sender: TObject); procedure ButtonLocCVClick(Sender: TObject);
procedure EditAdrTrainChange(Sender: TObject);
procedure Button1Click(Sender: TObject); procedure Button1Click(Sender: TObject);
procedure ComboTrainsChange(Sender: TObject); procedure ComboTrainsChange(Sender: TObject);
private private
@@ -311,7 +310,7 @@ var
CDMhd : THandle; CDMhd : THandle;
FormPrinc: TFormPrinc; FormPrinc: TFormPrinc;
ack,portCommOuvert,traceTrames,AffMem,AfficheDet,CDM_connecte,SocketCDM_connecte, ack,portCommOuvert,traceTrames,AffMem,AfficheDet,CDM_connecte,
Raz_Acc_signaux,AvecInit,AvecTCO,terminal,Srvc_Aig,Srvc_Det,Srvc_Act, Raz_Acc_signaux,AvecInit,AvecTCO,terminal,Srvc_Aig,Srvc_Det,Srvc_Act,
Srvc_PosTrain,Srvc_Sig,debugtrames : boolean; Srvc_PosTrain,Srvc_Sig,debugtrames : boolean;
tablo : array of byte; // tableau rx usb tablo : array of byte; // tableau rx usb
@@ -1857,13 +1856,12 @@ end;
envoie les données au décodeur CDF envoie les données au décodeur CDF
===========================================================================*} ===========================================================================*}
procedure envoi_CDF(adresse : integer); procedure envoi_CDF(adresse : integer);
var var
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];
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);
@@ -1894,7 +1892,6 @@ var
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];
code:=EtatSignalCplx[adresse]; code:=EtatSignalCplx[adresse];
//code_to_aspect(code,aspect,combine); //code_to_aspect(code,aspect,combine);
s:='Signal SR: ad'+IntToSTR(adresse)+'='+chaine_signal(code); s:='Signal SR: ad'+IntToSTR(adresse)+'='+chaine_signal(code);
@@ -1953,7 +1950,6 @@ 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];
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);
@@ -2025,18 +2021,17 @@ var valeur : integer ;
aspect,combine,code : word; aspect,combine,code : word;
s : string; s : string;
begin 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 begin
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);
if traceSign then affiche(s,clOrange); if traceSign then affiche(s,clOrange);
if Affsignal then afficheDebug(s,clOrange); if Affsignal then afficheDebug(s,clOrange);
// attention: impossible d'envoyer des octets en XpressNet!!
// NMRA ne focntionnera pas..
case aspect of case aspect of
carre : valeur:=0; carre : valeur:=0;
semaphore : valeur:=1; semaphore : valeur:=1;
@@ -2049,7 +2044,7 @@ begin
jaune : valeur:=8; jaune : valeur:=8;
jaune_cli : valeur:=9; jaune_cli : valeur:=9;
end; end;
case combine of case combine of
ral_30 : valeur:=10; ral_30 : valeur:=10;
ral_60 : valeur:=11; ral_60 : valeur:=11;
rappel_30 : valeur:=13; rappel_30 : valeur:=13;
@@ -2076,7 +2071,6 @@ begin
if (ancien_tablo_signalCplx[adresse]<>EtatSignalCplx[adresse]) then if (ancien_tablo_signalCplx[adresse]<>EtatSignalCplx[adresse]) then
begin begin
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);
@@ -2089,8 +2083,7 @@ begin
//Affiche('Adresse='+intToSTR(Adresse)+' code='+intToSTR(code)+' combine'+intToSTR(combine),clyellow); //Affiche('Adresse='+intToSTR(Adresse)+' code='+intToSTR(code)+' combine'+intToSTR(combine),clyellow);
if modele=2 then // 2 feux if modele=2 then // 2 feux
begin begin
if aspect=blanc then pilote_acc(adresse,1,feu); if (aspect=blanc) or (aspect=blanc_cli) then pilote_acc(adresse,1,feu);
if aspect=blanc_cli then pilote_acc(adresse,1,feu);
if aspect=violet then pilote_acc(adresse,2,feu); if aspect=violet then pilote_acc(adresse,2,feu);
end; end;
@@ -2109,55 +2102,41 @@ begin
if modele=4 then if modele=4 then
begin begin
case aspect of case aspect of
vert : pilote_acc(adresse,1,feu); vert,vert_cli : begin pilote_acc(adresse+1,1,feu);pilote_acc(adresse+2,1,feu);end;
vert_cli : pilote_acc(adresse,1,feu); jaune,jaune_cli : begin pilote_acc(adresse,1,feu);pilote_acc(adresse+2,1,feu);end;
jaune : pilote_acc(adresse,2,feu); semaphore,semaphore_cli: begin pilote_acc(adresse,2,feu);pilote_acc(adresse+2,1,feu);end;
jaune_cli : pilote_acc(adresse,2,feu); carre : begin pilote_acc(adresse,2,feu);pilote_acc(adresse+1,2,feu);end;
semaphore : pilote_acc(adresse+1,1,feu);
semaphore_cli : pilote_acc(adresse+1,1,feu);
carre : pilote_acc(adresse+1,2,feu);
end; end;
end; end;
// 51=carré + blanc // 51=carré + blanc
if modele=51 then if modele=51 then
begin begin
case aspect of case aspect of
vert : pilote_acc(adresse,1,feu); vert,vert_cli : begin pilote_acc(adresse+1,1,feu);pilote_acc(adresse+2,2,feu);end;
vert_cli : pilote_acc(adresse,1,feu); jaune,jaune_cli : begin pilote_acc(adresse,1,feu);pilote_acc(adresse+2,2,feu);end;
jaune : pilote_acc(adresse,2,feu); semaphore,semaphore_cli: begin pilote_acc(adresse,2,feu);pilote_acc(adresse+2,2,feu);end;
jaune_cli : pilote_acc(adresse,2,feu); carre : begin pilote_acc(adresse,2,feu);pilote_acc(adresse+1,2,feu);end;
semaphore : pilote_acc(adresse+1,1,feu); blanc,blanc_cli : pilote_acc(adresse+2,1,feu);
semaphore_cli : pilote_acc(adresse+1,1,feu);
carre : pilote_acc(adresse+1,2,feu);
blanc : pilote_acc(adresse+2,1,feu);
blanc_cli : pilote_acc(adresse+2,1,feu);
end; end;
end; end;
// 52=VJR + blanc + violet // 52=VJR + blanc + violet
if modele=52 then if modele=52 then
begin begin
case aspect of case aspect of
vert : pilote_acc(adresse,1,feu); vert,vert_cli : begin pilote_acc(adresse+1,1,feu);pilote_acc(adresse+2,2,feu);end;
vert_cli : pilote_acc(adresse,1,feu); jaune,jaune_cli : begin pilote_acc(adresse,1,feu);pilote_acc(adresse+2,2,feu);end;
jaune : pilote_acc(adresse,2,feu); semaphore,semaphore_cli: begin pilote_acc(adresse,2,feu);pilote_acc(adresse+2,2,feu);end;
jaune_cli : pilote_acc(adresse,2,feu); blanc,blanc_cli : pilote_acc(adresse+1,2,feu);
semaphore : pilote_acc(adresse+1,1,feu);
semaphore_cli : pilote_acc(adresse+1,1,feu);
violet : pilote_acc(adresse+2,1,feu); violet : pilote_acc(adresse+2,1,feu);
blanc : pilote_acc(adresse+1,2,feu);
blanc_cli : pilote_acc(adresse+1,2,feu);
end; end;
end; end;
// 71=VJR + ralentissement 30 // 71=VJR + ralentissement 30
if modele=71 then if modele=71 then
begin begin
case aspect of case aspect of
vert : pilote_acc(adresse,1,feu); vert,vert_cli : pilote_acc(adresse+1,1,feu);
vert_cli : pilote_acc(adresse,1,feu); jaune,jaune_cli : pilote_acc(adresse,1,feu);
jaune : pilote_acc(adresse,2,feu); semaphore,semaphore_cli: pilote_acc(adresse,2,feu);
jaune_cli : pilote_acc(adresse,2,feu);
semaphore : pilote_acc(adresse+1,1,feu);
semaphore_cli : pilote_acc(adresse+1,1,feu);
end; end;
if combine=ral_30 then pilote_acc(adresse+1,2,feu); if combine=ral_30 then pilote_acc(adresse+1,2,feu);
end; end;
@@ -2165,191 +2144,151 @@ begin
if modele=72 then if modele=72 then
begin begin
case aspect of case aspect of
vert : pilote_acc(adresse,1,feu); vert,vert_cli : begin pilote_acc(adresse+1,1,feu);pilote_acc(adresse+2,2,feu);end;
vert_cli : pilote_acc(adresse,1,feu); jaune,jaune_cli : begin pilote_acc(adresse,1,feu);pilote_acc(adresse+2,2,feu);end;
jaune : pilote_acc(adresse,2,feu); semaphore,semaphore_cli: begin pilote_acc(adresse,2,feu);pilote_acc(adresse+2,2,feu);end;
jaune_cli : pilote_acc(adresse,2,feu); carre : begin pilote_acc(adresse,2,feu);pilote_acc(adresse+1,2,feu);end;
semaphore : pilote_acc(adresse+1,1,feu);
semaphore_cli : pilote_acc(adresse+1,1,feu);
carre : pilote_acc(adresse+1,2,feu);
end; end;
if combine=ral_30 then pilote_acc(adresse+2,1,feu); if combine=ral_30 then pilote_acc(adresse+2,1,feu); //pilote_acc(adresse+2,2,feu); impossible en lenz
end; end;
// 73=VJR + carré + ralentissement 60 // 73=VJR + carré + ralentissement 60
if modele=73 then if modele=73 then
begin begin
case aspect of case aspect of
vert : pilote_acc(adresse,1,feu); vert,vert_cli : begin pilote_acc(adresse+1,1,feu);pilote_acc(adresse+2,2,feu);end;
vert_cli : pilote_acc(adresse,1,feu); jaune,jaune_cli : begin pilote_acc(adresse,1,feu);pilote_acc(adresse+2,2,feu);end;
jaune : pilote_acc(adresse,2,feu); semaphore,semaphore_cli: begin pilote_acc(adresse,2,feu);pilote_acc(adresse+2,2,feu);end;
jaune_cli : pilote_acc(adresse,2,feu); carre : begin pilote_acc(adresse,2,feu);pilote_acc(adresse+1,2,feu);end;
semaphore : pilote_acc(adresse+1,1,feu);
semaphore_cli : pilote_acc(adresse+1,1,feu);
carre : pilote_acc(adresse+1,2,feu);
end; end;
if combine=ral_60 then pilote_acc(adresse+2,1,feu); if combine=ral_60 then pilote_acc(adresse+2,1,feu); //pilote_acc(adresse+2,2,feu); impossible en lenz
end; end;
// 91=VJR + carré + rappel 30 // 91=VJR + carré + rappel 30
if modele=91 then if modele=91 then
begin begin
case aspect of case aspect of
vert : pilote_acc(adresse,1,feu); vert,vert_cli : begin pilote_acc(adresse+1,1,feu);pilote_acc(adresse+2,2,feu);end;
vert_cli : pilote_acc(adresse,1,feu); jaune,jaune_cli : begin pilote_acc(adresse,1,feu);pilote_acc(adresse+2,2,feu);end;
jaune : pilote_acc(adresse,2,feu); semaphore,semaphore_cli: begin pilote_acc(adresse,2,feu);pilote_acc(adresse+2,2,feu);end;
jaune_cli : pilote_acc(adresse,2,feu); carre : begin pilote_acc(adresse,2,feu);pilote_acc(adresse+1,2,feu);end;
semaphore : pilote_acc(adresse+1,1,feu);
semaphore_cli : pilote_acc(adresse+1,1,feu);
carre : pilote_acc(adresse+1,2,feu);
end; end;
if combine=rappel_30 then pilote_acc(adresse+2,1,feu); if combine=rappel_30 then pilote_acc(adresse+2,1,feu);//pilote_acc(adresse+2,2,feu); impossible en lenz
end; end;
// 92=VJR + carré + rappel 60 // 92=VJR + carré + rappel 60
if modele=92 then if modele=92 then
begin begin
case aspect of case aspect of
vert : pilote_acc(adresse,1,feu); vert,vert_cli : begin pilote_acc(adresse+1,1,feu);pilote_acc(adresse+2,2,feu);end;
vert_cli : pilote_acc(adresse,1,feu); jaune,jaune_cli : begin pilote_acc(adresse,1,feu);pilote_acc(adresse+2,2,feu);end;
jaune : pilote_acc(adresse,2,feu); semaphore,semaphore_cli: begin pilote_acc(adresse,2,feu);pilote_acc(adresse+2,2,feu);end;
jaune_cli : pilote_acc(adresse,2,feu); carre : begin pilote_acc(adresse,2,feu);pilote_acc(adresse+1,2,feu);end;
semaphore : pilote_acc(adresse+1,1,feu);
semaphore_cli : pilote_acc(adresse+1,1,feu);
carre : pilote_acc(adresse+1,2,feu);
end; end;
if combine=rappel_60 then pilote_acc(adresse+2,1,feu); if combine=rappel_60 then pilote_acc(adresse+2,1,feu);//pilote_acc(adresse+2,2,feu); impossible en lenz
end; end;
// 93=VJR + carré + ral30 + rappel 30 // 93=VJR + carré + ral30 + rappel 30
if modele=93 then if modele=93 then
begin begin
if combine=16 then //pas de sig combinée case aspect of
begin vert,vert_cli : begin pilote_acc(adresse+1,1,feu);pilote_acc(adresse+3,1,feu);end;
if aspect=vert then pilote_acc(adresse,1,feu); jaune,jaune_cli : begin pilote_acc(adresse,1,feu);pilote_acc(adresse+3,1,feu);end;
if aspect=vert_cli then pilote_acc(adresse,1,feu); semaphore,semaphore_cli: begin pilote_acc(adresse,2,feu);pilote_acc(adresse+3,1,feu);end;
if aspect=jaune then pilote_acc(adresse,2,feu); carre : begin pilote_acc(adresse,2,feu);pilote_acc(adresse+1,2,feu);end;
if aspect=jaune_cli then pilote_acc(adresse,2,feu); end;
if aspect=semaphore then pilote_acc(adresse+1,1,feu); if combine=ral_30 then begin pilote_acc(adresse+2,1,feu);pilote_acc(adresse+3,1,feu);end;
if aspect=semaphore_cli then pilote_acc(adresse+1,1,feu); if combine=rappel_30 then begin pilote_acc(adresse+2,2,feu);pilote_acc(adresse+3,1,feu);end;
if aspect=carre then pilote_acc(adresse+1,2,feu); if ((aspect=jaune) or (aspect=jaune_cli)) and (combine=rappel_30) then begin pilote_acc(adresse,1,feu);pilote_acc(adresse+2,2,feu);pilote_acc(adresse+3,1,feu);end;
end;
if combine=ral_30 then pilote_acc(adresse+2,1,feu);
if combine=rappel_30 then pilote_acc(adresse+2,2,feu);
if (aspect=jaune) and (combine=rappel_30) then pilote_acc(adresse+3,1,feu);
end; end;
// 94=VJR + carré + ral60 + rappel60 // 94=VJR + carré + ral60 + rappel60
if modele=94 then if modele=94 then
begin begin
if combine=16 then case aspect of
begin vert,vert_cli : begin pilote_acc(adresse+1,1,feu);pilote_acc(adresse+3,1,feu);end;
if aspect=vert then pilote_acc(adresse,1,feu); jaune,jaune_cli : begin pilote_acc(adresse,1,feu);pilote_acc(adresse+3,1,feu);end;
if aspect=vert_cli then pilote_acc(adresse,1,feu); semaphore,semaphore_cli: begin pilote_acc(adresse,2,feu);pilote_acc(adresse+3,1,feu);end;
if aspect=jaune then pilote_acc(adresse,2,feu); carre : begin pilote_acc(adresse,2,feu);pilote_acc(adresse+1,2,feu);end;
if aspect=jaune_cli then pilote_acc(adresse,2,feu);
if aspect=semaphore then pilote_acc(adresse+1,1,feu);
if aspect=semaphore_cli then pilote_acc(adresse+1,1,feu);
if aspect=carre then pilote_acc(adresse+1,2,feu);
end; end;
if combine=ral_60 then pilote_acc(adresse+2,1,feu); if combine=ral_60 then begin pilote_acc(adresse+2,1,feu);pilote_acc(adresse+3,1,feu);end;
if combine=rappel_60 then pilote_acc(adresse+2,2,feu); if combine=rappel_60 then begin pilote_acc(adresse+2,2,feu);pilote_acc(adresse+3,1,feu);end;
if (aspect=jaune) and (combine=rappel_60) then pilote_acc(adresse+3,1,feu); if ((aspect=jaune) or (aspect=jaune_cli)) and (combine=rappel_60) then begin pilote_acc(adresse,1,feu);pilote_acc(adresse+2,2,feu);pilote_acc(adresse+3,1,feu);end;
end; end;
// 95=VJR + carré + ral30 + rappel 60 // 95=VJR + carré + ral30 + rappel 60
if modele=95 then if modele=95 then
begin begin
if combine=16 then case aspect of
begin vert,vert_cli : begin pilote_acc(adresse+1,1,feu);pilote_acc(adresse+3,1,feu);end;
if aspect=vert then pilote_acc(adresse,1,feu); jaune,jaune_cli : begin pilote_acc(adresse,1,feu);pilote_acc(adresse+3,1,feu);end;
if aspect=vert_cli then pilote_acc(adresse,1,feu); semaphore,semaphore_cli: begin pilote_acc(adresse,2,feu);pilote_acc(adresse+3,1,feu);end;
if aspect=jaune then pilote_acc(adresse,2,feu); carre : begin pilote_acc(adresse,2,feu);pilote_acc(adresse+1,2,feu);end;
if aspect=jaune_cli then pilote_acc(adresse,2,feu); end;
if aspect=semaphore then pilote_acc(adresse+1,1,feu); if combine=ral_30 then begin pilote_acc(adresse+2,1,feu);pilote_acc(adresse+3,1,feu);end;
if aspect=semaphore_cli then pilote_acc(adresse+1,1,feu); if combine=rappel_60 then begin pilote_acc(adresse+2,2,feu);pilote_acc(adresse+3,1,feu);end;
if aspect=carre then pilote_acc(adresse+1,2,feu); if ((aspect=jaune) or (aspect=jaune_cli)) and (combine=rappel_60)
end; then begin pilote_acc(adresse,1,feu);pilote_acc(adresse+2,2,feu);pilote_acc(adresse+3,1,feu);end;
if combine=ral_30 then pilote_acc(adresse+2,1,feu);
if combine=rappel_60 then pilote_acc(adresse+2,2,feu);
if (aspect=jaune) and (combine=rappel_60) then pilote_acc(adresse+3,1,feu);
end; end;
// 96=VJR + blanc + carré + ral30 + rappel30 // 96=VJR + blanc + carré + ral30 + rappel30
if modele=96 then if modele=96 then
begin begin
if combine=16 then case aspect of
begin vert,vert_cli : begin pilote_acc(adresse+1,1,feu);pilote_acc(adresse+3,2,feu);end;
if aspect=vert then pilote_acc(adresse,1,feu); jaune,jaune_cli : begin pilote_acc(adresse,1,feu);pilote_acc(adresse+3,2,feu);end;
if aspect=vert_cli then pilote_acc(adresse,1,feu); semaphore,semaphore_cli: begin pilote_acc(adresse,2,feu);pilote_acc(adresse+3,2,feu);end;
if aspect=jaune then pilote_acc(adresse,2,feu); carre : begin pilote_acc(adresse,2,feu);pilote_acc(adresse+1,2,feu);end;
if aspect=jaune_cli then pilote_acc(adresse,2,feu); blanc,blanc_cli : pilote_acc(adresse+3,1,feu);
if aspect=semaphore then pilote_acc(adresse+1,1,feu); end;
if aspect=semaphore_cli then pilote_acc(adresse+1,1,feu); if combine=ral_30 then begin pilote_acc(adresse+2,1,feu);pilote_acc(adresse+3,2,feu);end;
if aspect=carre then pilote_acc(adresse+1,2,feu); if combine=rappel_30 then begin pilote_acc(adresse+2,2,feu);pilote_acc(adresse+3,2,feu);end;
if aspect=blanc then pilote_acc(adresse+3,2,feu); if ((aspect=jaune) or (aspect=jaune_cli)) and (combine=rappel_30)
if aspect=blanc_cli then pilote_acc(adresse+3,2,feu); then begin pilote_acc(adresse,1,feu);pilote_acc(adresse+2,2,feu);pilote_acc(adresse+3,2,feu);end;
end;
if combine=ral_30 then pilote_acc(adresse+2,1,feu);
if combine=rappel_30 then pilote_acc(adresse+2,2,feu);
if (aspect=jaune) and (combine=rappel_30) then pilote_acc(adresse+3,1,feu);
end; end;
// 97=VJR + blanc + carré + ral30 + rappel60 // 97=VJR + blanc + carré + ral30 + rappel60
if modele=97 then if modele=97 then
begin begin
if combine=16 then case aspect of
begin vert,vert_cli : begin pilote_acc(adresse+1,1,feu);pilote_acc(adresse+3,2,feu);end;
if aspect=vert then pilote_acc(adresse,1,feu); jaune,jaune_cli : begin pilote_acc(adresse,1,feu);pilote_acc(adresse+3,2,feu);end;
if aspect=vert_cli then pilote_acc(adresse,1,feu); semaphore,semaphore_cli: begin pilote_acc(adresse,2,feu);pilote_acc(adresse+3,2,feu);end;
if aspect=jaune then pilote_acc(adresse,2,feu); carre : begin pilote_acc(adresse,2,feu);pilote_acc(adresse+1,2,feu);end;
if aspect=jaune_cli then pilote_acc(adresse,2,feu); blanc,blanc_cli : pilote_acc(adresse+3,1,feu);
if aspect=semaphore then pilote_acc(adresse+1,1,feu); end;
if aspect=semaphore_cli then pilote_acc(adresse+1,1,feu); if combine=ral_30 then begin pilote_acc(adresse+2,1,feu);pilote_acc(adresse+3,2,feu);end;
if aspect=carre then pilote_acc(adresse+1,2,feu); if combine=rappel_60 then begin pilote_acc(adresse+2,2,feu);pilote_acc(adresse+3,2,feu);end;
if aspect=blanc then pilote_acc(adresse+3,2,feu); if ((aspect=jaune) or (aspect=jaune_cli)) and (combine=rappel_60)
if aspect=blanc_cli then pilote_acc(adresse+3,2,feu); then begin pilote_acc(adresse,1,feu);pilote_acc(adresse+2,2,feu);pilote_acc(adresse+3,2,feu);end;
end;
if combine=ral_30 then pilote_acc(adresse+2,1,feu);
if combine=rappel_60 then pilote_acc(adresse+2,2,feu);
if (aspect=jaune) and (combine=rappel_60) then pilote_acc(adresse+3,1,feu);
end; end;
// 98=VJR + blanc + violet + ral30 + rappel30 // 98=VJR + blanc + violet + ral30 + rappel30
if modele=98 then if modele=98 then
begin begin
if combine=16 then case aspect of
begin vert,vert_cli : begin pilote_acc(adresse+1,1,feu);pilote_acc(adresse+3,2,feu);end;
if aspect=vert then pilote_acc(adresse,1,feu); jaune,jaune_cli : begin pilote_acc(adresse,1,feu);pilote_acc(adresse+3,2,feu);end;
if aspect=vert_cli then pilote_acc(adresse,1,feu); semaphore,semaphore_cli: begin pilote_acc(adresse,2,feu);pilote_acc(adresse+3,2,feu);end;
if aspect=jaune then pilote_acc(adresse,2,feu); blanc,blanc_cli : pilote_acc(adresse+1,2,feu);
if aspect=jaune_cli then pilote_acc(adresse,2,feu); violet : pilote_acc(adresse+3,1,feu);
if aspect=semaphore then pilote_acc(adresse+1,1,feu); end;
if aspect=semaphore_cli then pilote_acc(adresse+1,1,feu); if combine=ral_30 then begin pilote_acc(adresse+2,1,feu);pilote_acc(adresse+3,2,feu);end;
if aspect=violet then pilote_acc(adresse+1,2,feu); if combine=rappel_30 then begin pilote_acc(adresse+2,2,feu);pilote_acc(adresse+3,2,feu);end;
if aspect=blanc then pilote_acc(adresse+3,2,feu); if ((aspect=jaune) or (aspect=jaune_cli)) and (combine=rappel_30)
if aspect=blanc_cli then pilote_acc(adresse+3,2,feu); then begin pilote_acc(adresse,1,feu);pilote_acc(adresse+2,2,feu);pilote_acc(adresse+3,2,feu);end;
end; end;
if (aspect=jaune) and (combine=rappel_30) then pilote_acc(adresse+3,1,feu);
if combine=ral_30 then pilote_acc(adresse+2,1,feu);
if combine=rappel_30 then pilote_acc(adresse+2,2,feu);
end;
// 99=VJR + blanc + violet + ral30 + rappel60 // 99=VJR + blanc + violet + ral30 + rappel60
if modele=99 then if modele=99 then
begin begin
if combine=16 then case aspect of
begin vert,vert_cli : begin pilote_acc(adresse+1,1,feu);pilote_acc(adresse+3,2,feu);end;
if aspect=vert then pilote_acc(adresse,1,feu); jaune,jaune_cli : begin pilote_acc(adresse,1,feu);pilote_acc(adresse+3,2,feu);end;
if aspect=vert_cli then pilote_acc(adresse,1,feu); semaphore,semaphore_cli: begin pilote_acc(adresse,2,feu);pilote_acc(adresse+3,2,feu);end;
if aspect=jaune then pilote_acc(adresse,2,feu); blanc,blanc_cli : pilote_acc(adresse+1,2,feu);
if aspect=jaune_cli then pilote_acc(adresse,2,feu); violet : pilote_acc(adresse+3,1,feu);
if aspect=semaphore then pilote_acc(adresse+1,1,feu); end;
if aspect=semaphore_cli then pilote_acc(adresse+1,1,feu); if combine=ral_30 then begin pilote_acc(adresse+2,1,feu);pilote_acc(adresse+3,2,feu);end;
if aspect=violet then pilote_acc(adresse+1,2,feu); if combine=rappel_60 then begin pilote_acc(adresse+2,2,feu);pilote_acc(adresse+3,2,feu);end;
if aspect=blanc then pilote_acc(adresse+3,2,feu); if ((aspect=jaune) or (aspect=jaune_cli)) and (combine=rappel_60)
if aspect=blanc_cli then pilote_acc(adresse+3,2,feu); then begin pilote_acc(adresse,1,feu);pilote_acc(adresse+2,2,feu);pilote_acc(adresse+3,2,feu);end;
end;
if (aspect=jaune) and (combine=rappel_60) then pilote_acc(adresse+3,1,feu);
if combine=ral_30 then pilote_acc(adresse+2,1,feu);
if combine=rappel_60 then pilote_acc(adresse+2,2,feu);
end; end;
end; end;
end; end;
@@ -2369,7 +2308,6 @@ var code,aspect,combine,mode : word;
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];
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);
@@ -2420,7 +2358,6 @@ var
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];
code:=EtatSignalCplx[adresse]; code:=EtatSignalCplx[adresse];
code_to_aspect(code,aspect,combine); code_to_aspect(code,aspect,combine);
s:='Signal virtuel: ad'+IntToSTR(adresse)+'='+chaine_signal(code); s:='Signal virtuel: ad'+IntToSTR(adresse)+'='+chaine_signal(code);
@@ -2431,7 +2368,7 @@ end;
(*========================================================================== (*==========================================================================
envoie les données au décodeur digitalbahn équipé du logiciel "led_signal_10" envoie les données au décodeur digitalbahn équipé du logiciel "led_signal_10"
adresse=adresse sur le BUS DCC adresse=adresse sur le bus
codebin=motif de bits représentant l'état des feux L'allumage est fait en codebin=motif de bits représentant l'état des feux L'allumage est fait en
adressant l'une des 14 adresses pour les 14 leds possibles du feu. adressant l'une des 14 adresses pour les 14 leds possibles du feu.
Ici on met le bit 1 à 1 (état "vert" du programme hexmanipu Ici on met le bit 1 à 1 (état "vert" du programme hexmanipu
@@ -2458,8 +2395,6 @@ begin
// si ancien état du signal=jaune ou jaune cli // si ancien état du signal=jaune ou jaune cli
Ancjau:=(TestBit(ancien_tablo_signalCplx[adresse],jaune)) or (TestBit(ancien_tablo_signalCplx[adresse],jaune_cli)) ; Ancjau:=(TestBit(ancien_tablo_signalCplx[adresse],jaune)) or (TestBit(ancien_tablo_signalCplx[adresse],jaune_cli)) ;
//***ancien_tablo_signalCplx[adresse]:=EtatSignalCplx[adresse];
// si état demandé du signal=ralentissement ou rappel // si état demandé du signal=ralentissement ou rappel
ralrap:=(TestBit(code,ral_30)) or (TestBit(code,ral_60)) or ralrap:=(TestBit(code,ral_30)) or (TestBit(code,ral_60)) or
(TestBit(code,rappel_30)) or (TestBit(code,rappel_60)) ; (TestBit(code,rappel_30)) or (TestBit(code,rappel_60)) ;
@@ -2484,7 +2419,6 @@ 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;
@@ -2521,34 +2455,34 @@ begin
7 : envoi_SR(Adr); 7 : envoi_SR(Adr);
end; end;
// vérifier si on quitte le rouge // Gestion démarrage temporisé des trains si on quitte le rouge : ne fonctionne qu'avec CDM rail connecté
if Option_demarrage then if Option_demarrage and cdm_connecte then
begin begin
a:=ancien_tablo_signalCplx[adr]; a:=ancien_tablo_signalCplx[adr];
b:=EtatSignalCplx[adr]; b:=EtatSignalCplx[adr];
if ((a=semaphore_F) or (a=carre_F) or (a=violet_F)) and ((b<>semaphore_F) and (b<>carre_F) and (b<>violet_F)) then if ((a=semaphore_F) or (a=carre_F) or (a=violet_F)) and ((b<>semaphore_F) and (b<>carre_F) and (b<>violet_F)) then
if not(Diffusion) then Affiche('On quitte le rouge du signal '+intToSTR(adr),clyellow);
// y a t il un train en face du signal
if cdm_connecte then
begin
det:=feux[i].Adr_det1;
if det<>0 then
begin begin
// test si train sur le détecteur det if not(Diffusion) then Affiche('On quitte le rouge du signal '+intToSTR(adr),clyellow);
if detecteur[det].etat then // y a t il un train en face du signal
det:=feux[i].Adr_det1;
if det<>0 then
begin begin
detecteur[det].tempo:=20; // armer la tempo à 2s // test si train sur le détecteur det
// arreter le train if detecteur[det].etat then
s:=detecteur[det].train; begin
Affiche('et son détecteur '+IntToSTR(det)+'=1 tempo démarrage '+s,clYellow); detecteur[det].tempo:=20; // armer la tempo à 2s
s:=chaine_CDM_vitesseST(1,s); // 0% // arreter le train
envoi_cdm(s); s:=detecteur[det].train;
detecteur[det].train:=s;
//Affiche('et son détecteur '+IntToSTR(det)+'=1 tempo démarrage ; train '+s,clYellow);
s:=chaine_CDM_vitesseST(0,s); // 0%
envoi_cdm(s);
end;
end; end;
end; end;
end; end;
end;
ancien_tablo_signalCplx[adr]:=EtatSignalCplx[adr]; //*** ancien_tablo_signalCplx[adr]:=EtatSignalCplx[adr];
// allume les signaux du feu dans la fenêtre de droite // allume les signaux du feu dans la fenêtre de droite
Dessine_feu_mx(Feux[i].Img.Canvas,0,0,1,1,adr,1); Dessine_feu_mx(Feux[i].Img.Canvas,0,0,1,1,adr,1);
@@ -3365,7 +3299,7 @@ begin
if (NetatTJD=2) and tjdC then if (NetatTJD=2) and tjdC then
begin begin
Affiche('TJD 2 états',clOrange); Affiche('TJD 2 états',clOrange);
end; end;
end; end;
@@ -3392,7 +3326,7 @@ begin
if NivDebug=3 then AfficheDebug('Aiguillage triple dévié1 (à gauche)',clYellow); if NivDebug=3 then AfficheDebug('Aiguillage triple dévié1 (à gauche)',clYellow);
A:=aiguillage[index].AdevieB; A:=aiguillage[index].AdevieB;
Adr:=aiguillage[index].Adevie; Adr:=aiguillage[index].Adevie;
if A='Z' then TypeEl:=det else TypeEL:=aig; //TypeEL=(1=détécteur 2=aig if A='Z' then TypeEl:=det else TypeEL:=aig; //TypeEL=(1=détécteur 2=aig
trouve_element(Adr,TypeEl,1); // branche_trouve IndexBranche_trouve trouve_element(Adr,TypeEl,1); // branche_trouve IndexBranche_trouve
typeGen:=BrancheN[branche_trouve,IndexBranche_trouve].BType; typeGen:=BrancheN[branche_trouve,IndexBranche_trouve].BType;
suivant_alg3:=adr;exit; suivant_alg3:=adr;exit;
@@ -3402,7 +3336,7 @@ begin
if NivDebug=3 then AfficheDebug('Aiguillage triple dévié2 (à droite)',clYellow); if NivDebug=3 then AfficheDebug('Aiguillage triple dévié2 (à droite)',clYellow);
A:=aiguillage[index].Adevie2B; A:=aiguillage[index].Adevie2B;
Adr:=aiguillage[index].Adevie2; Adr:=aiguillage[index].Adevie2;
if A='Z' then TypeEl:=det else TypeEL:=aig; //TypeEL=(1=détécteur 2=aig if A='Z' then TypeEl:=det else TypeEL:=aig; //TypeEL=(1=détécteur 2=aig
trouve_element(Adr,TypeEl,1); // branche_trouve IndexBranche_trouve trouve_element(Adr,TypeEl,1); // branche_trouve IndexBranche_trouve
typeGen:=BrancheN[branche_trouve,IndexBranche_trouve].BType; typeGen:=BrancheN[branche_trouve,IndexBranche_trouve].BType;
suivant_alg3:=adr;exit; suivant_alg3:=adr;exit;
@@ -5107,21 +5041,21 @@ var i,AdrSuiv,AdrFeu,AdrDetfeu,index,Etat01,AdrPrec : integer;
s : string; s : string;
begin begin
if Etat then Etat01:=1 else Etat01:=0; if Etat then Etat01:=1 else Etat01:=0;
// vérifier si l'état du détecteur est déja stocké, car on peut reçevoir plusieurs évènements pour le même détecteur dans le même état // vérifier si l'état du détecteur est déja stocké, car on peut reçevoir plusieurs évènements pour le même détecteur dans le même état
// on reçoit un doublon dans deux index consécutifs. // on reçoit un doublon dans deux index consécutifs.
(* (*
if N_Event_tick>=1 then if N_Event_tick>=1 then
begin begin
if (event_det_tick[N_event_tick].etat=etat01) and (event_det_tick[N_event_tick].detecteur=Adresse) then if (event_det_tick[N_event_tick].etat=etat01) and (event_det_tick[N_event_tick].detecteur=Adresse) then
begin begin
//Affiche(IntToSTR(Adresse)+' déja stocké',clorange); //Affiche(IntToSTR(Adresse)+' déja stocké',clorange);
exit; // déja stocké exit; // déja stocké
end; end;
end; end;
*) *)
if Traceliste then AfficheDebug('--------------------- détecteur '+intToSTR(Adresse)+' à '+intToSTR(etat01)+'-----------------------------',clOrange); if Traceliste then AfficheDebug('--------------------- détecteur '+intToSTR(Adresse)+' à '+intToSTR(etat01)+'-----------------------------',clOrange);
if AffAigDet then if AffAigDet then
begin begin
//s:='Evt Det '+intToSTR(adresse)+'='+intToSTR(etat01); //s:='Evt Det '+intToSTR(adresse)+'='+intToSTR(etat01);
s:='Tick='+IntToSTR(tick)+' Evt Det='+IntToSTR(adresse)+'='+intToSTR(etat01); s:='Tick='+IntToSTR(tick)+' Evt Det='+IntToSTR(adresse)+'='+intToSTR(etat01);
@@ -5231,7 +5165,7 @@ end;
procedure Event_Aig(adresse,pos : integer); procedure Event_Aig(adresse,pos : integer);
var s: string; var s: string;
faire_event,inv : boolean; faire_event,inv : boolean;
prov,i,index : integer; prov,index : integer;
begin begin
// vérifier que l'évènement accessoire vient bien d'un aiguillage et pas d'un feu qu'on pilote (et que cdm renvoie) // vérifier que l'évènement accessoire vient bien d'un aiguillage et pas d'un feu qu'on pilote (et que cdm renvoie)
index:=index_aig(adresse); index:=index_aig(adresse);
@@ -5309,7 +5243,7 @@ var groupe,temps,index : integer ;
label mise0; label mise0;
begin begin
//Affiche(IntToSTR(adresse)+' '+intToSTr(octet),clYellow); //Affiche(IntToSTR(adresse)+' '+intToSTr(octet),clYellow);
// test si pilotage aiguillage inversé // test si pilotage aiguillage inversé
if (acc=aigP) then if (acc=aigP) then
begin begin
@@ -5318,7 +5252,7 @@ begin
begin begin
if octet=1 then octet:=2 else octet:=1; if octet=1 then octet:=2 else octet:=1;
end; end;
end; end;
// pilotage par CDM rail ----------------- // pilotage par CDM rail -----------------
if CDM_connecte then if CDM_connecte then
@@ -5330,8 +5264,9 @@ begin
if (acc=feu) and not(Raz_Acc_signaux) then exit; if (acc=feu) and not(Raz_Acc_signaux) then exit;
if debug_dec_sig and (acc=feu) then AfficheDebug('Tick='+IntToSTR(Tick)+' signal '+intToSTR(adresse)+' 0',clorange); if debug_dec_sig and (acc=feu) then AfficheDebug('Tick='+IntToSTR(Tick)+' signal '+intToSTR(adresse)+' 0',clorange);
sleep(50); sleep(50);
s:=chaine_CDM_Acc(adresse,0); s:=chaine_CDM_Acc(adresse,0);
envoi_CDM(s); envoi_CDM(s);
event_aig(adresse,octet);
exit; exit;
end; end;
@@ -5673,7 +5608,24 @@ end;
procedure deconnecte_CDM; procedure deconnecte_CDM;
begin begin
Formprinc.ClientSocketCDM.close; if Cdm_connecte then
begin
with formprinc do
begin
CDM_connecte:=False;
ClientSocketCDM.close;
LabelTitre.caption:=Titre;
caption:=AF;
MenuConnecterUSB.enabled:=true;
DeConnecterUSB.enabled:=true;
ConnecterCDMRail.enabled:=true;
comboTrains.clear;
ntrains:=0;
end;
Affiche('CDM rail déconnecté',Cyan);
AfficheDebug('CDM rail déconnecté',Cyan);
end;
end; end;
{$J+} {$J+}
@@ -5708,7 +5660,7 @@ var i,j : integer;
begin begin
if NumPort<>0 then if NumPort<>0 then
begin begin
With Formprinc.MSCommUSBLenz do With Formprinc.MSCommUSBLenz do // MSComm est le composant OCX TMSComm32
begin begin
i:=pos(':',portCom); i:=pos(':',portCom);
j:=pos(',',PortCom); j:=pos(',',PortCom);
@@ -5897,6 +5849,7 @@ begin
if (ProcessRunning(s)) then if (ProcessRunning(s)) then
begin begin
// CDM déja lancé; // CDM déja lancé;
Affiche('CDM déjà lancé',clOrange);
Lance_CDM:=true; Lance_CDM:=true;
if CDM_connecte then exit; if CDM_connecte then exit;
deconnecte_USB; deconnecte_USB;
@@ -6129,8 +6082,6 @@ begin
// Initialisation des images des signaux // Initialisation des images des signaux
NbreImagePLigne:=Formprinc.ScrollBox1.Width div (largImg+5); NbreImagePLigne:=Formprinc.ScrollBox1.Width div (largImg+5);
if not(diffusion) then LireunfichierdeCV1.enabled:=true;
// ajoute les images des feux dynamiquement // ajoute les images des feux dynamiquement
for i:=1 to NbreFeux do for i:=1 to NbreFeux do
begin begin
@@ -6414,11 +6365,10 @@ begin
dec(detecteur[i].tempo); dec(detecteur[i].tempo);
if detecteur[i].tempo=0 then if detecteur[i].tempo=0 then
begin begin
//Affiche('tempo 0 Detecteur '+intToSTR(i),clyellow);
s:=detecteur[i].train; s:=detecteur[i].train;
Affiche('Tempo 0 timer train '+s,clOrange); //Affiche('Tempo 0 timer train '+s+' det '+intToSTR(i),clOrange);
s:=chaine_CDM_vitesseST(100,s); // 100% s:=chaine_CDM_vitesseST(100,s); // 100%
envoi(s); envoi_cdm(s);
end; end;
end; end;
end; end;
@@ -6485,8 +6435,11 @@ var s : string;
begin begin
s:='Erreur '+IntToSTR(ErrorCode)+' socket IP Xpressnet'; s:='Erreur '+IntToSTR(ErrorCode)+' socket IP Xpressnet';
case ErrorCode of case ErrorCode of
10053 : s:=s+': Connexion avortée - Timeout'; 10053 : begin
10054 : s:=s+': Connexion avortée par tiers'; s:=s+': Connexion avortée - Timeout';
deconnecte_cdm;
end;
10054 : s:=s+': Connexion avortée par un tiers';
10060 : s:=s+': Timeout'; 10060 : s:=s+': Timeout';
10061 : s:=s+': Connexion refusée'; 10061 : s:=s+': Connexion refusée';
10065 : s:=s+': Port non connecté'; 10065 : s:=s+': Port non connecté';
@@ -6496,7 +6449,7 @@ begin
parSocketLenz:=false; parSocketLenz:=false;
ErrorCode:=0; ErrorCode:=0;
end; end;
procedure TFormPrinc.ClientSocketCDMError(Sender: TObject; procedure TFormPrinc.ClientSocketCDMError(Sender: TObject;
Socket: TCustomWinSocket; ErrorEvent: TErrorEvent; var ErrorCode: Integer); Socket: TCustomWinSocket; ErrorEvent: TErrorEvent; var ErrorCode: Integer);
var s : string; var s : string;
@@ -6511,7 +6464,7 @@ begin
end; end;
if errorcode<>10061 then affiche(s,ClOrange); if errorcode<>10061 then affiche(s,ClOrange);
afficheDebug(s,ClOrange); afficheDebug(s,ClOrange);
CDM_connecte:=false; deconnecte_cdm;
if (portCommOuvert=false) and (parSocketLenz=false) then LabelTitre.caption:=titre; if (portCommOuvert=false) and (parSocketLenz=false) then LabelTitre.caption:=titre;
caption:=AF; caption:=AF;
ErrorCode:=0; ErrorCode:=0;
@@ -6739,7 +6692,7 @@ begin
LabelTitre.caption:=titre+' '+s; LabelTitre.caption:=titre+' '+s;
Affiche(s,clYellow); Affiche(s,clYellow);
AfficheDebug(s,clYellow); AfficheDebug(s,clYellow);
SocketCDM_connecte:=True; CDM_connecte:=True;
MenuConnecterUSB.enabled:=false; MenuConnecterUSB.enabled:=false;
DeConnecterUSB.enabled:=false; DeConnecterUSB.enabled:=false;
ConnecterCDMRail.enabled:=false; ConnecterCDMRail.enabled:=false;
@@ -6999,7 +6952,7 @@ begin
if (train='_NONE') then train:=detecteur[Adr].train; if (train='_NONE') then train:=detecteur[Adr].train;
Event_detecteur(Adr,etat=1,train); Event_detecteur(Adr,etat=1,train);
//AfficheDebug(IntToSTR(adr)+' '+IntToSTR(etat),clyellow); //Affiche(IntToSTR(adr)+' '+IntToSTR(etat)+' '+train,clyellow);
if AfficheDet then Affiche('Rétro Détecteur '+intToSTR(adr)+'='+IntToStr(etat),clYellow); if AfficheDet then Affiche('Rétro Détecteur '+intToSTR(adr)+'='+IntToStr(etat),clYellow);
end ; end ;
@@ -7137,15 +7090,7 @@ end;
procedure TFormPrinc.ClientSocketCDMDisconnect(Sender: TObject; Socket: TCustomWinSocket); procedure TFormPrinc.ClientSocketCDMDisconnect(Sender: TObject; Socket: TCustomWinSocket);
begin begin
LabelTitre.caption:=Titre; deconnecte_cdm;
Affiche('CDM rail déconnecté',Cyan);
AfficheDebug('CDM rail déconnecté',Cyan);
caption:=AF;
CDM_connecte:=False;
SocketCDM_connecte:=false;
MenuConnecterUSB.enabled:=true;
DeConnecterUSB.enabled:=true;
ConnecterCDMRail.enabled:=true;
end; end;
procedure TFormPrinc.Codificationdesfeux1Click(Sender: TObject); procedure TFormPrinc.Codificationdesfeux1Click(Sender: TObject);
@@ -7581,6 +7526,7 @@ begin
if verif_coherence then affiche('La configuration est cohérente',clLime); if verif_coherence then affiche('La configuration est cohérente',clLime);
end; end;
// cliqué gauche dans la fenetre Fenrich
procedure TFormPrinc.FenRichMouseDown(Sender: TObject; procedure TFormPrinc.FenRichMouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer); Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var lc : integer; var lc : integer;
@@ -7608,8 +7554,6 @@ begin
ShellExecute(0,'open',Pchar(s),nil,nil,sw_shownormal); ShellExecute(0,'open',Pchar(s),nil,nil,sw_shownormal);
end; end;
end; end;
end; end;
procedure TFormPrinc.ButtonLocCVClick(Sender: TObject); procedure TFormPrinc.ButtonLocCVClick(Sender: TObject);
@@ -7618,13 +7562,6 @@ begin
else begin groupBox2.Visible:=false;groupBox3.Visible:=true;end; else begin groupBox2.Visible:=false;groupBox3.Visible:=true;end;
end; end;
procedure TFormPrinc.EditAdrTrainChange(Sender: TObject);
var i : integer;
s : string;
begin
end;
procedure TFormPrinc.Button1Click(Sender: TObject); procedure TFormPrinc.Button1Click(Sender: TObject);
begin begin

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -23,7 +23,7 @@ var
Lance_verif : integer; Lance_verif : integer;
verifVersion,notificationVersion : boolean; verifVersion,notificationVersion : boolean;
Const Version='3.62'; // sert à la comparaison de la version publiée Const Version='3.63'; // sert à la comparaison de la version publiée
SousVersion=' '; // en cas d'absence de sous version mettre un espace SousVersion=' '; // en cas d'absence de sous version mettre un espace
implementation implementation

View File

@@ -80,6 +80,7 @@ version 3.6 : Am
Changement des vitesses courantes des trains. Changement des vitesses courantes des trains.
version 3.61 : Correction de la non présentation de certains signaux s'ils sont séparés par plus d'un détecteur. version 3.61 : Correction de la non présentation de certains signaux s'ils sont séparés par plus d'un détecteur.
version 3.62 : Correction présence trains 3 cantons avant signaux et 1 canton après signaux. version 3.62 : Correction présence trains 3 cantons avant signaux et 1 canton après signaux.
version 3.63 : Gestion améliorée du décodeur Unisemaf