This commit is contained in:
f1iwq2
2020-10-22 11:32:07 +02:00
parent 1e91ee0126
commit c636f7ddfa
14 changed files with 298 additions and 129 deletions
BIN
View File
Binary file not shown.
+57 -16
View File
@@ -1,6 +1,6 @@
object FormConfig: TFormConfig object FormConfig: TFormConfig
Left = 305 Left = 235
Top = 330 Top = 312
Hint = Hint =
'Modifie les fichiers de configuration selon les s'#233'lections chois' + 'Modifie les fichiers de configuration selon les s'#233'lections chois' +
'ies' 'ies'
@@ -1744,6 +1744,13 @@ object FormConfig: TFormConfig
Proportional = True Proportional = True
Visible = False Visible = False
end end
object Label29: TLabel
Left = 144
Top = 68
Width = 6
Height = 13
Caption = #224
end
object ButtonAppliquerEtFermer: TButton object ButtonAppliquerEtFermer: TButton
Left = 384 Left = 384
Top = 440 Top = 440
@@ -1769,7 +1776,7 @@ object FormConfig: TFormConfig
Top = 8 Top = 8
Width = 585 Width = 585
Height = 417 Height = 417
ActivePage = TabSheetAig ActivePage = TabSheetAct
Font.Charset = DEFAULT_CHARSET Font.Charset = DEFAULT_CHARSET
Font.Color = clBackground Font.Color = clBackground
Font.Height = -11 Font.Height = -11
@@ -2433,14 +2440,14 @@ object FormConfig: TFormConfig
object LabelTJD1: TLabel object LabelTJD1: TLabel
Left = 112 Left = 112
Top = 208 Top = 208
Width = 28 Width = 52
Height = 13 Height = 13
Caption = 'LabelTJD1' Caption = 'LabelTJD1'
end end
object LabelTJD2: TLabel object LabelTJD2: TLabel
Left = 168 Left = 168
Top = 208 Top = 208
Width = 28 Width = 52
Height = 13 Height = 13
Caption = 'LabelTJD1' Caption = 'LabelTJD1'
end end
@@ -2739,7 +2746,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
@@ -2879,26 +2886,37 @@ object FormConfig: TFormConfig
TabOrder = 0 TabOrder = 0
object RadioButtonLoc: TRadioButton object RadioButtonLoc: TRadioButton
Left = 24 Left = 24
Top = 24 Top = 16
Width = 193 Width = 193
Height = 17 Height = 17
Caption = 'Fonction F pour locomotive' Caption = 'Fonction F pour locomotive'
Enabled = False
TabOrder = 0 TabOrder = 0
end end
object RadioButtonPN: TRadioButton object RadioButtonPN: TRadioButton
Left = 24 Left = 24
Top = 40 Top = 48
Width = 193 Width = 193
Height = 17 Height = 17
Caption = 'Gestion de passage '#224' niveau' Caption = 'Gestion de passage '#224' niveau'
Enabled = False
TabOrder = 1 TabOrder = 1
end end
object RadioButtonAccess: TRadioButton
Left = 24
Top = 32
Width = 161
Height = 17
Caption = 'Fonction F pour accessoire'
Enabled = False
TabOrder = 2
end
end end
object GroupBoxAct: TGroupBox object GroupBoxAct: TGroupBox
Left = 16 Left = 8
Top = 208 Top = 200
Width = 225 Width = 225
Height = 129 Height = 145
Caption = 'Actionneur fonction de locomotive ' Caption = 'Actionneur fonction de locomotive '
TabOrder = 1 TabOrder = 1
object LabelActionneur: TLabel object LabelActionneur: TLabel
@@ -2936,6 +2954,13 @@ object FormConfig: TFormConfig
Height = 13 Height = 13
Caption = 'Tempo (ms)' Caption = 'Tempo (ms)'
end end
object Label30: TLabel
Left = 168
Top = 24
Width = 6
Height = 13
Caption = #224
end
object EditAct: TEdit object EditAct: TEdit
Left = 112 Left = 112
Top = 20 Top = 20
@@ -2952,15 +2977,15 @@ object FormConfig: TFormConfig
TabOrder = 1 TabOrder = 1
Text = 'EditTrain' Text = 'EditTrain'
end end
object EditEtat: TEdit object EditEtatFoncSortie: TEdit
Left = 160 Left = 160
Top = 68 Top = 68
Width = 25 Width = 25
Height = 21 Height = 21
TabOrder = 2 TabOrder = 2
Text = 'EditEtat' Text = 'EditEtatFoncSortie'
end end
object EditFonction: TEdit object EditFonctionAccess: TEdit
Left = 112 Left = 112
Top = 68 Top = 68
Width = 25 Width = 25
@@ -2976,10 +3001,26 @@ object FormConfig: TFormConfig
TabOrder = 4 TabOrder = 4
Text = 'EditTempo' Text = 'EditTempo'
end end
object EditEtatActionneur: TEdit
Left = 184
Top = 20
Width = 25
Height = 21
TabOrder = 5
Text = 'EditEtat'
end
object CheckRAZ: TCheckBox
Left = 48
Top = 120
Width = 145
Height = 17
Caption = 'Remise '#224' 0 apr'#232's pilotage'
TabOrder = 6
end
end end
object GroupBoxPN: TGroupBox object GroupBoxPN: TGroupBox
Left = 16 Left = 72
Top = 104 Top = 8
Width = 225 Width = 225
Height = 193 Height = 193
Caption = 'Actionneurs gestion passage '#224' niveau' Caption = 'Actionneurs gestion passage '#224' niveau'
+60 -15
View File
@@ -125,9 +125,9 @@ type
EditAct: TEdit; EditAct: TEdit;
EditTrain: TEdit; EditTrain: TEdit;
LabelTrain: TLabel; LabelTrain: TLabel;
EditEtat: TEdit; EditEtatFoncSortie: TEdit;
Labela: TLabel; Labela: TLabel;
EditFonction: TEdit; EditFonctionAccess: TEdit;
LabelFonction: TLabel; LabelFonction: TLabel;
EditTempo: TEdit; EditTempo: TEdit;
LabelTempo: TLabel; LabelTempo: TLabel;
@@ -176,6 +176,11 @@ type
Label28: TLabel; Label28: TLabel;
LabelTJD2: TLabel; LabelTJD2: TLabel;
CheckInverse: TCheckBox; CheckInverse: TCheckBox;
RadioButtonAccess: TRadioButton;
Label29: TLabel;
Label30: TLabel;
EditEtatActionneur: TEdit;
CheckRAZ: TCheckBox;
procedure ButtonAppliquerEtFermerClick(Sender: TObject); procedure ButtonAppliquerEtFermerClick(Sender: TObject);
procedure Button2Click(Sender: TObject); procedure Button2Click(Sender: TObject);
procedure FormActivate(Sender: TObject); procedure FormActivate(Sender: TObject);
@@ -1324,13 +1329,10 @@ begin
LabelElSuiv.visible:=false; LabelElSuiv.visible:=false;
end; end;
end; end;
end; end;
Procedure aff_champs_act; Procedure aff_champs_act;
var i,v, ligne,etatact,erreur, adresse,fonction,tempo : integer; var i,v, ligne,etatact,erreur, adresse,sortie,fonction,tempo,access : integer;
s,s2,ss : string; s,s2,ss : string;
trouve : bool; trouve : bool;
begin begin
@@ -1351,10 +1353,12 @@ begin
begin begin
GroupBoxact.Visible:=false; GroupBoxact.Visible:=false;
GroupBoxPN.Top:=104; GroupBoxPN.Top:=104;
GroupBoxPN.Left:=16;
GroupBoxPN.Visible:=true; GroupBoxPN.Visible:=true;
Visible:=true; Visible:=true;
RadioButtonPN.Checked:=true; RadioButtonPN.Checked:=true;
RadioButtonLoc.Checked:=false; RadioButtonLoc.Checked:=false;
RadioButtonAccess.Checked:=false;
end; end;
// trouver l'index dans le tableau // trouver l'index dans le tableau
i:=pos('PN(',s); i:=pos('PN(',s);
@@ -1409,15 +1413,16 @@ begin
end; end;
end end
else else
// actionneur fonction F locomotive
// actionneur fonction F locomotive ou Accessoire
begin begin
with formconfig do with formconfig do
begin begin
GroupBoxAct.Top:=104; GroupBoxAct.Top:=104;
GroupBoxAct.Left:=16;
GroupBoxact.Visible:=true; GroupBoxact.Visible:=true;
GroupBoxPN.Visible:=false; GroupBoxPN.Visible:=false;
formconfig.RadioButtonPN.Checked:=false;
formconfig.RadioButtonLoc.Checked:=true;
end; end;
// trouver l'index dans le tableau // trouver l'index dans le tableau
val(s,adresse,erreur); val(s,adresse,erreur);
@@ -1428,22 +1433,62 @@ begin
until trouve or (i>MaxTablo_act); until trouve or (i>MaxTablo_act);
if not(trouve) then exit; if not(trouve) then exit;
s:=Tablo_actionneur[i].train;
etatAct:=Tablo_actionneur[i].etat ;
Adresse:=Tablo_actionneur[i].actionneur;
fonction:=Tablo_actionneur[i].fonction; fonction:=Tablo_actionneur[i].fonction;
Access:=Tablo_actionneur[i].accessoire;
if fonction<>0 then
begin
etatAct:=Tablo_actionneur[i].etat ;
//etatFonc:=Tablo_actionneur[i].
Adresse:=Tablo_actionneur[i].actionneur;
s2:=Tablo_actionneur[i].train; s2:=Tablo_actionneur[i].train;
tempo:=tablo_actionneur[i].Tempo; tempo:=tablo_actionneur[i].Tempo;
with formconfig do with formconfig do
begin begin
CheckRaz.Visible:=false;
GroupBoxAct.Caption:='Actionneur de fonction F de locomotive';
LabelTempo.Visible:=true; EditTempo.visible:=true; editEtatFoncSortie.visible:=false;LabelA.Visible:=false;
editEtatActionneur.Text:=IntToSTR(etatAct);
LabelFonction.caption:='Fonction';
RadioButtonPN.Checked:=false;
RadioButtonLoc.Checked:=true;
RadioButtonAccess.Checked:=false;
EditAct.text:=IntToSTR(Adresse); EditAct.text:=IntToSTR(Adresse);
EditTrain.Text:=s; EditTrain.Text:=s2;
editFonction.Text:=intToSTR(fonction); editFonctionAccess.Text:=intToSTR(fonction);
editEtat.Text:=intToSTR(etatAct); //editEtat.Text:=intToSTR(etatAct);
editTempo.Text:=intToSTR(tempo); editTempo.Text:=intToSTR(tempo);
end; end;
end; end;
if Access<>0 then
begin
etatAct:=Tablo_actionneur[i].etat ;
Adresse:=Tablo_actionneur[i].actionneur;
sortie:=Tablo_actionneur[i].sortie;
s2:=Tablo_actionneur[i].train;
tempo:=tablo_actionneur[i].Tempo;
with formconfig do
begin
GroupBoxAct.Caption:='Actionneur d''accessoire';
CheckRaz.Visible:=true;
CheckRaz.Checked:=Tablo_actionneur[i].Raz;
LabelTempo.Visible:=false; EditTempo.visible:=false;editEtatFoncSortie.visible:=true;LabelA.Visible:=true;
LabelFonction.caption:='Accessoire';
RadioButtonPN.Checked:=false;
RadioButtonLoc.Checked:=false;
RadioButtonAccess.Checked:=true;
EditAct.text:=IntToSTR(Adresse);
EditTrain.Text:=s2;
EditEtatActionneur.Text:=IntToSTR(etatAct);
editFonctionAccess.Text:=intToSTR(Access);
editEtatFoncSortie.Text:=intToSTR(sortie);
editTempo.Text:=intToSTR(tempo);
end;
end;
end;
ss:='Actionneur '+InttoSTr(Adresse); ss:='Actionneur '+InttoSTr(Adresse);
end; end;
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+8 -15
View File
@@ -18,7 +18,7 @@ object FormPrinc: TFormPrinc
OnClose = FormClose OnClose = FormClose
OnCreate = FormCreate OnCreate = FormCreate
DesignSize = ( DesignSize = (
1179 1196
606) 606)
PixelsPerInch = 96 PixelsPerInch = 96
TextHeight = 13 TextHeight = 13
@@ -667,7 +667,7 @@ object FormPrinc: TFormPrinc
Visible = False Visible = False
end end
object Image2feux: TImage object Image2feux: TImage
Left = 776 Left = 984
Top = 128 Top = 128
Width = 33 Width = 33
Height = 57 Height = 57
@@ -741,8 +741,8 @@ object FormPrinc: TFormPrinc
Visible = False Visible = False
end end
object Image2Dir: TImage object Image2Dir: TImage
Left = 696 Left = 936
Top = 184 Top = 144
Width = 41 Width = 41
Height = 25 Height = 25
Picture.Data = { Picture.Data = {
@@ -1221,7 +1221,7 @@ object FormPrinc: TFormPrinc
end end
object ScrollBox1: TScrollBox object ScrollBox1: TScrollBox
Left = 631 Left = 631
Top = 176 Top = 168
Width = 537 Width = 537
Height = 377 Height = 377
HorzScrollBar.Smooth = True HorzScrollBar.Smooth = True
@@ -1317,8 +1317,8 @@ object FormPrinc: TFormPrinc
end end
object StatusBar1: TStatusBar object StatusBar1: TStatusBar
Left = 0 Left = 0
Top = 577 Top = 576
Width = 1179 Width = 1196
Height = 30 Height = 30
Panels = <> Panels = <>
SimplePanel = True SimplePanel = True
@@ -1459,19 +1459,12 @@ object FormPrinc: TFormPrinc
object StaticText: TStaticText object StaticText: TStaticText
Left = 16 Left = 16
Top = 560 Top = 560
Width = 1145 Width = 14
Height = 17 Height = 17
Anchors = [akLeft, akRight, akBottom] Anchors = [akLeft, akRight, akBottom]
Caption = 'xx' Caption = 'xx'
TabOrder = 7 TabOrder = 7
end end
object StaticText1: TStaticText
Left = 8
Top = 560
Width = 4
Height = 4
TabOrder = 8
end
object Timer1: TTimer object Timer1: TTimer
Interval = 100 Interval = 100
OnTimer = Timer1Timer OnTimer = Timer1Timer
+136 -49
View File
@@ -91,7 +91,6 @@ type
ButtonLanceCDM: TButton; ButtonLanceCDM: TButton;
Affichefentredebug1: TMenuItem; Affichefentredebug1: TMenuItem;
StaticText: TStaticText; StaticText: TStaticText;
StaticText1: TStaticText;
procedure FormCreate(Sender: TObject); procedure FormCreate(Sender: TObject);
procedure MSCommUSBLenzComm(Sender: TObject); procedure MSCommUSBLenzComm(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormClose(Sender: TObject; var Action: TCloseAction);
@@ -251,7 +250,9 @@ var ancien_tablo_signalCplx,EtatsignalCplx : array[0..MaxAcc] of word;
MemZone : array[0..1024,0..1024] of boolean ; // mémoires de zones MemZone : array[0..1024,0..1024] of boolean ; // mémoires de zones
Tablo_actionneur : array[1..100] of Tablo_actionneur : array[1..100] of
record record
actionneur,etat,fonction,tempo : integer; actionneur,etat,fonction,tempo,
accessoire,sortie : integer;
Raz : boolean;
train : string; train : string;
end; end;
KeyInputs: array of TInput; KeyInputs: array of TInput;
@@ -1418,7 +1419,7 @@ begin
end; end;
// active ou désactive une sortie. Une adresse comporte deux sorties identifiées par "octet" // active ou désactive une sortie par xpressnet. Une adresse comporte deux sorties identifiées par "octet"
// Adresse : adresse de l'accessoire // Adresse : adresse de l'accessoire
// octet : numéro (1-2) de la sortie à cette adresse // octet : numéro (1-2) de la sortie à cette adresse
// etat : false (désactivé) true (activé) // etat : false (désactivé) true (activé)
@@ -3892,7 +3893,7 @@ begin
Val(enregistrement,adr,erreur); Val(enregistrement,adr,erreur);
if erreur=0 then if erreur=0 then
begin begin
Affiche('section vitesse définie aig='+intToSTR(aig)+'/'+intToSTR(adr),clyellow); //Affiche('section vitesse définie aig='+intToSTR(aig)+'/'+intToSTR(adr),clyellow);
aiguillage[aig].vitesse:=adr; aiguillage[aig].vitesse:=adr;
enregistrement:=''; enregistrement:='';
virgule:=pos(',',s);if virgule=0 then virgule:=length(s)+1; virgule:=pos(',',s);if virgule=0 then virgule:=length(s)+1;
@@ -4210,13 +4211,85 @@ begin
configNulle:=(maxAiguillage=0) and (NbreBranches=0) and (Nbrefeux=0); configNulle:=(maxAiguillage=0) and (NbreBranches=0) and (Nbrefeux=0);
if configNulle then Affiche('Fonctionnement en config nulle',ClYellow); if configNulle then Affiche('Fonctionnement en config nulle',ClYellow);
// raz des actionneurs
for i:=1 to maxTablo_act do
begin
Tablo_actionneur[i].train:='';
Tablo_actionneur[i].etat:=0;
Tablo_actionneur[i].actionneur:=0;
Tablo_actionneur[i].accessoire:=0;
Tablo_actionneur[i].sortie:=0;
end;
// définition des actionneurs // définition des actionneurs
maxTablo_act:=1; maxTablo_act:=1;
NbrePN:=0;Nligne:=1; NbrePN:=0;Nligne:=1;
repeat repeat
s:=lit_ligne; s:=lit_ligne;
// vérifier si F ou A au 4eme champ
sa:=s;
i:=pos(',',sa);
if i>0 then delete(sa,1,i) else s:='0';
i:=pos(',',sa);
if i>0 then delete(sa,1,i) else s:='0';
i:=pos(',',sa);
if i>0 then delete(sa,1,i) else s:='0';
mod_act[Nligne]:=s;inc(Nligne); mod_act[Nligne]:=s;inc(Nligne);
if pos('F',s)<>0 then
if length(sa)>1 then if (sa[1]='A') then
// -----------------accessoire
begin
// 815,1,CC406526,A600,1
i:=pos(',',s);
if i<>0 then
begin
val(copy(s,1,i-1),j,erreur);
Tablo_actionneur[maxTablo_act].actionneur:=j;
Delete(s,1,i);
i:=pos(',',s);
if i<>0 then
begin
i:=pos(',',s);
val(copy(s,1,i-1),j,erreur);
Tablo_actionneur[maxTablo_act].etat:=j;
Delete(s,1,i);
i:=pos(',',s);
Tablo_actionneur[maxTablo_act].train:=copy(s,1,i-1);
Delete(s,1,i);
i:=pos('A',s);
if i<>0 then
begin
Delete(s,1,1);
val(s,j,erreur);
Tablo_actionneur[maxTablo_act].Accessoire:=j;
i:=pos(',',s);
if i<>0 then
begin
Delete(S,1,i);
val(s,j,erreur);
Tablo_actionneur[maxTablo_act].sortie:=j;
end;
i:=pos(',',s);
if i<>0 then
begin
Delete(S,1,i);
Tablo_actionneur[maxTablo_act].RAZ:=s[1]='Z';
inc(maxTablo_act);
end;
end;
s:='';i:=0;
end;
end;
end;
if length(sa)>1 then if (sa[1]='F') then
// -----------------fonction // -----------------fonction
begin begin
// 815,1,CC406526,F2,450 // 815,1,CC406526,F2,450
@@ -4258,6 +4331,7 @@ begin
end; end;
end; end;
end; end;
// Passage à niveau // Passage à niveau
// (815,820),(830,810)...,PN(121+,121-) // (815,820),(830,810)...,PN(121+,121-)
// (815,809),PN(121+,121-) // (815,809),PN(121+,121-)
@@ -6376,27 +6450,45 @@ end;
// traitement des évènements actionneurs // traitement des évènements actionneurs
procedure Event_act(adr,etat : integer;train : string); procedure Event_act(adr,etat : integer;train : string);
var i,v,va,j,etatAct,Af,Ao : integer; var i,v,va,j,etatAct,Af,Ao,Access,sortie : integer;
s : string; s : string;
presTrain_PN : boolean; presTrain_PN : boolean;
Ts : TAccessoire;
begin begin
// vérifier si l'actionneur en évènement a été déclaré pour réagir // vérifier si l'actionneur en évènement a été déclaré pour réagir
if AffActionneur then Affiche('Actionneur '+intToSTR(Adr)+'='+intToSTR(etat),clyellow); if AffActionneur then Affiche('Actionneur '+intToSTR(Adr)+'='+intToSTR(etat),clyellow);
// dans le tableau des actionneurs pour fonction train
for i:=1 to maxTablo_act do for i:=1 to maxTablo_act do
begin begin
s:=Tablo_actionneur[i].train; s:=Tablo_actionneur[i].train;
etatAct:=Tablo_actionneur[i].etat ; etatAct:=Tablo_actionneur[i].etat ;
if (Tablo_actionneur[i].actionneur=adr) and ((s=train) or (s='X')) and (etatAct=etat) then // actionneur pour fonction train
if (Tablo_actionneur[i].actionneur=adr) and (Tablo_actionneur[i].fonction<>0) and ((s=train) or (s='X')) and (etatAct=etat) then
begin begin
Affiche('Actionneur '+intToSTR(adr)+' Train='+train+' F'+IntToSTR(Tablo_actionneur[i].fonction)+':'+intToSTR(etat),clyellow); Affiche('Actionneur '+intToSTR(adr)+' Train='+train+' F'+IntToSTR(Tablo_actionneur[i].fonction)+':'+intToSTR(etat),clyellow);
// exécutione la fonction F vers CDM
envoie_fonction_CDM(Tablo_actionneur[i].fonction,etat,train); envoie_fonction_CDM(Tablo_actionneur[i].fonction,etat,train);
TempoAct:=tablo_actionneur[i].Tempo div 100; TempoAct:=tablo_actionneur[i].Tempo div 100;
RangActCours:=i; RangActCours:=i;
end; end;
// actionneur pour accessoire
if (Tablo_actionneur[i].actionneur=adr) and (Tablo_actionneur[i].accessoire<>0) and ((s=train) or (s='X')) and (etatAct=etat) then
begin
access:=Tablo_actionneur[i].accessoire;
sortie:=Tablo_actionneur[i].sortie;
Affiche('Actionneur '+intToSTR(adr)+' Train='+train+' Accessoire '+IntToSTR(access)+':'+intToSTR(sortie),clyellow);
// exécution la fonction accessoire vers CDM
if Tablo_actionneur[i].RAZ then Ts:=aig else Ts:=Feu;
pilote_acc(access,sortie,Ts); // sans RAZ
RangActCours:=i;
end; end;
end;
// dans le tableau des PN // dans le tableau des PN
for i:=1 to NbrePN do for i:=1 to NbrePN do
begin begin
@@ -6461,7 +6553,7 @@ begin
if AffAigDet then if AffAigDet then
begin begin
//s:='Evt Det '+intToSTR(adresse)+'='+intToSTR(etat01); //s:='Evt Det '+intToSTR(adresse)+'='+intToSTR(etat01);
s:=IntToSTR(i)+' Tick='+IntToSTR(tick)+' Det='+IntToSTR(adresse)+'='+intToSTR(etat01); s:='Tick='+IntToSTR(tick)+' Det='+IntToSTR(adresse)+'='+intToSTR(etat01);
Affiche(s,clyellow); Affiche(s,clyellow);
if not(TraceListe) then AfficheDebug(s,clyellow); if not(TraceListe) then AfficheDebug(s,clyellow);
@@ -6474,15 +6566,18 @@ begin
detecteur_chgt:=Adresse; detecteur_chgt:=Adresse;
// stocke les changements d'état des détecteurs dans le tableau chronologique // stocke les changements d'état des détecteurs dans le tableau chronologique
if (N_Event_tick<Max_Event_det_tick) then if (N_Event_tick>=Max_Event_det_tick) then
begin begin
N_Event_tick:=0;
Affiche('Raz Evts détecteurs',clLime);
end;
inc(N_Event_tick); inc(N_Event_tick);
event_det_tick[N_event_tick].tick:=tick; event_det_tick[N_event_tick].tick:=tick;
event_det_tick[N_event_tick].detecteur:=Adresse; event_det_tick[N_event_tick].detecteur:=Adresse;
event_det_tick[N_event_tick].etat:=etat01; event_det_tick[N_event_tick].etat:=etat01;
if (n_Event_tick mod 10) =0 then affiche_memoire; if (n_Event_tick mod 10) =0 then affiche_memoire;
// Affiche('stockage de '+intToSTR(N_event_tick)+' '+IntToSTR(Adresse)+' à '+intToSTR(etat01),clyellow); // Affiche('stockage de '+intToSTR(N_event_tick)+' '+IntToSTR(Adresse)+' à '+intToSTR(etat01),clyellow);
end;
// détection front montant // détection front montant
if not(ancien_detecteur[Adresse]) and detecteur[Adresse] then if not(ancien_detecteur[Adresse]) and detecteur[Adresse] then
@@ -6573,24 +6668,28 @@ begin
aiguillage[adresse].position:=pos; aiguillage[adresse].position:=pos;
// ------------- stockage évènement aiguillage dans tampon event_det_tick ------------------------- // ------------- stockage évènement aiguillage dans tampon event_det_tick -------------------------
if (N_Event_tick<Max_Event_det_tick) then if (N_Event_tick>=Max_Event_det_tick) then
begin
if AffAigDet then
begin begin
N_Event_tick:=0;
Affiche('Raz Evts détecteurs',clLime);
end;
s:='Evt Aig '+intToSTR(adresse)+'='+intToSTR(pos); s:='Evt Aig '+intToSTR(adresse)+'='+intToSTR(pos);
if pos=const_droit then s:=s+' droit' else s:=s+' dévié'; if pos=const_droit then s:=s+' droit' else s:=s+' dévié';
if AffAigDet then
begin
if objet<>0 then s:=s+' objet='+IntToSTR(objet); if objet<>0 then s:=s+' objet='+IntToSTR(objet);
Affiche(s,clyellow); Affiche(s,clyellow);
AfficheDebug(s,clyellow); AfficheDebug(s,clyellow);
end; end;
FormDebug.MemoEvtDet.lines.add(s) ;
if (n_Event_tick mod 10) =0 then affiche_memoire; if (n_Event_tick mod 10) =0 then affiche_memoire;
inc(N_Event_tick); inc(N_Event_tick);
event_det_tick[N_event_tick].tick:=tick; event_det_tick[N_event_tick].tick:=tick;
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;
end;
// Mettre à jour le TCO // Mettre à jour le TCO
if AvecTCO then if AvecTCO then
@@ -7292,7 +7391,7 @@ begin
Srvc_PosTrain:=false; Srvc_PosTrain:=false;
Srvc_sig:=false; Srvc_sig:=false;
AF:='Client TCP-IP CDM Rail ou USB - système LENZ - Version '+Version+' en cours 3'; AF:='Client TCP-IP CDM Rail ou USB - système LENZ - Version '+Version;
Caption:=AF; Caption:=AF;
Application.onHint:=doHint; Application.onHint:=doHint;
@@ -7312,7 +7411,7 @@ begin
TempoAct:=0; TempoAct:=0;
DebugOuv:=True; DebugOuv:=True;
AvecInit:=false; //&&&& AvecInit:=true; //&&&&
Diffusion:=AvecInit; Diffusion:=AvecInit;
Application.processMessages; Application.processMessages;
@@ -7425,37 +7524,16 @@ begin
{ {
aiguillage[20].position:=const_droit; aiguillage[20].position:=const_droit;
aiguillage[21].position:=const_droit; aiguillage[21].position:=const_droit;
aiguillage[25].position:=const_devie;
aiguillage[26].position:=const_droit;
aiguillage[27].position:=const_droit;
aiguillage[28].position:=const_devie;
aiguillage[31].position:=const_devie;
aiguillage[77].position:=const_droit;
aiguillage[78].position:=const_droit;
aiguillage[79].position:=const_droit;
aiguillage[83].position:=const_devie;
aiguillage[85].position:=const_droit;
aiguillage[87].position:=const_devie;
aiguillage[89].position:=const_devie;
aiguillage[90].position:=const_droit;
aiguillage[91].position:=const_droit;
aiguillage[92].position:=const_devie;
aiguillage[105].position:=const_droit;
aiguillage[106].position:=const_devie;
aiguillage[111].position:=const_devie;
NivDebug:=3; NivDebug:=3;
FormDebug.show; FormDebug.show;
//i:=Detecteur_suivant_El(591,1,602,1); //i:=Detecteur_suivant_El(591,1,602,1);
//i:=Detecteur_suivant_El(597,1,601,1); //i:=Detecteur_suivant_El(597,1,601,1);
// posent pb: // posent pb:
i:=Detecteur_suivant_El(598,1,599,1); // i:=Detecteur_suivant_El(598,1,599,1);
//i:=Detecteur_suivant_El(520,1,518,1); i:=Detecteur_suivant_El(520,1,20,2);
AfficheDebug(IntToSTR(i),clyellow); // AfficheDebug(IntToSTR(i),clyellow);
} }
end; end;
@@ -7654,17 +7732,17 @@ begin
// evt détecteur ? // evt détecteur ?
if Tablo_simule[i_simule].detecteur<>0 then if Tablo_simule[i_simule].detecteur<>0 then
begin begin
if AffTickSimu then Affiche('Simulation '+intToSTR(I_simule)+' Tick='+IntToSTR(tick)+' det='+intToSTR(Tablo_simule[i_simule].detecteur)+'='+IntToSTR(Tablo_simule[i_simule].etat),Cyan); s:='Simulation '+intToSTR(I_simule)+' Tick='+IntToSTR(tick)+' det='+intToSTR(Tablo_simule[i_simule].detecteur)+'='+IntToSTR(Tablo_simule[i_simule].etat);
Event_Detecteur(Tablo_simule[i_simule].detecteur, Tablo_simule[i_simule].etat=1); // créer évt détecteur Event_Detecteur(Tablo_simule[i_simule].detecteur, Tablo_simule[i_simule].etat=1); // créer évt détecteur
// statusBar1.Hint:=' det='+intToSTR(Tablo_simule[i_simule].detecteur)+'='+IntToSTR(Tablo_simule[i_simule].etat); StaticText.caption:=s;
end; end;
// evt aiguillage ? // evt aiguillage ?
if Tablo_simule[i_simule].aiguillage<>0 then if Tablo_simule[i_simule].aiguillage<>0 then
begin begin
if AffTickSimu then Affiche('Simulation '+intToSTR(I_simule)+' Tick='+IntToSTR(tick)+' aig='+intToSTR(Tablo_simule[i_simule].aiguillage)+'='+IntToSTR(Tablo_simule[i_simule].etat),Cyan); s:='Simulation '+intToSTR(I_simule)+' Tick='+IntToSTR(tick)+' aig='+intToSTR(Tablo_simule[i_simule].aiguillage)+'='+IntToSTR(Tablo_simule[i_simule].etat);
Event_Aig(Tablo_simule[i_simule].Aiguillage,Tablo_simule[i_simule].etat,0); // créer évt aiguillage Event_Aig(Tablo_simule[i_simule].Aiguillage,Tablo_simule[i_simule].etat,0); // créer évt aiguillage
// statusBar1.Hint:=' aig='+intToSTR(Tablo_simule[i_simule].aiguillage)+'='+IntToSTR(Tablo_simule[i_simule].etat); StaticText.caption:=s;
end; end;
end; end;
@@ -7675,6 +7753,7 @@ begin
I_Simule:=0; I_Simule:=0;
MsgSim:=false; MsgSim:=false;
Affiche('Fin de simulation',Cyan); Affiche('Fin de simulation',Cyan);
StaticText.caption:='';
end; end;
end; end;
end; end;
@@ -8460,7 +8539,7 @@ end;
procedure TFormPrinc.Codificationdesactionneurs1Click(Sender: TObject); procedure TFormPrinc.Codificationdesactionneurs1Click(Sender: TObject);
var i,adr,etatAct,v,aO,aF : integer; var i,adract,etatAct,fonction,v,acc,aO,aF,accessoire,sortie : integer;
s,s2 : string; s,s2 : string;
begin begin
if (maxTablo_act=0) and (NbrePN=0) then if (maxTablo_act=0) and (NbrePN=0) then
@@ -8473,12 +8552,20 @@ begin
begin begin
s:=Tablo_actionneur[i].train; s:=Tablo_actionneur[i].train;
etatAct:=Tablo_actionneur[i].etat ; etatAct:=Tablo_actionneur[i].etat ;
Adr:=Tablo_actionneur[i].actionneur; AdrAct:=Tablo_actionneur[i].actionneur;
s2:=Tablo_actionneur[i].train; s2:=Tablo_actionneur[i].train;
acc:=Tablo_actionneur[i].accessoire;
sortie:=Tablo_actionneur[i].sortie;
fonction:=Tablo_actionneur[i].fonction;
if (s2<>'') then if (s2<>'') then
begin begin
Affiche('FonctionF Actionneur='+intToSTR(adr)+' Train='+s2+' F'+IntToSTR(Tablo_actionneur[i].fonction)+':'+intToSTR(etatAct)+ if fonction<>0 then
' Temporisation='+intToSTR(tablo_actionneur[i].Tempo),clyellow); s:='FonctionF Actionneur='+intToSTR(adrAct)+':'+intToSTR(etatAct)+' Train='+s2+' F'+IntToSTR(fonction)+
' Temporisation='+intToSTR(tablo_actionneur[i].Tempo);
if acc<>0 then
s:='Accessoire Actionneur='+intToSTR(adrAct)+':'+intToSTR(etatAct)+' Train='+s2+' A'+IntToSTR(acc)+
' sortie='+intToSTR(sortie);
Affiche(s,clYellow);
end; end;
end; end;
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -53,7 +53,7 @@ begin
index_simule:=1; index_simule:=1;
repeat repeat
readln(fte,s); readln(fte,s);
Affiche(s,clLime); //Affiche(s,clLime);
i:=pos('Tick=',s); i:=pos('Tick=',s);
if i<>0 then if i<>0 then
begin begin
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -23,7 +23,7 @@ var
Lance_verif : integer; Lance_verif : integer;
verifVersion,notificationVersion : boolean; verifVersion,notificationVersion : boolean;
Const Version='2.0'; // sert à la comparaison de la version publiée Const Version='2.1'; // sert à la comparaison de la version publiée
implementation implementation
+3
View File
@@ -33,6 +33,9 @@ version 1.76 : Modification des aiguillages mod
Correction d'un bug sur les feux dont l'élément suivant est un détecteur Correction d'un bug sur les feux dont l'élément suivant est un détecteur
version 2.0 : Changement de description des TJD version 2.0 : Changement de description des TJD
Amélioration de l'algorithme des routes Amélioration de l'algorithme des routes
Variables nommées dans config-GL.cfg
version 2.1 : Possibilité de piloter des accessoires par des actionneurs CDM