V2.1
This commit is contained in:
Binary file not shown.
BIN
UnitConfig.dcu
BIN
UnitConfig.dcu
Binary file not shown.
@@ -1,6 +1,6 @@
|
||||
object FormConfig: TFormConfig
|
||||
Left = 305
|
||||
Top = 330
|
||||
Left = 235
|
||||
Top = 312
|
||||
Hint =
|
||||
'Modifie les fichiers de configuration selon les s'#233'lections chois' +
|
||||
'ies'
|
||||
@@ -1744,6 +1744,13 @@ object FormConfig: TFormConfig
|
||||
Proportional = True
|
||||
Visible = False
|
||||
end
|
||||
object Label29: TLabel
|
||||
Left = 144
|
||||
Top = 68
|
||||
Width = 6
|
||||
Height = 13
|
||||
Caption = #224
|
||||
end
|
||||
object ButtonAppliquerEtFermer: TButton
|
||||
Left = 384
|
||||
Top = 440
|
||||
@@ -1769,7 +1776,7 @@ object FormConfig: TFormConfig
|
||||
Top = 8
|
||||
Width = 585
|
||||
Height = 417
|
||||
ActivePage = TabSheetAig
|
||||
ActivePage = TabSheetAct
|
||||
Font.Charset = DEFAULT_CHARSET
|
||||
Font.Color = clBackground
|
||||
Font.Height = -11
|
||||
@@ -2433,14 +2440,14 @@ object FormConfig: TFormConfig
|
||||
object LabelTJD1: TLabel
|
||||
Left = 112
|
||||
Top = 208
|
||||
Width = 28
|
||||
Width = 52
|
||||
Height = 13
|
||||
Caption = 'LabelTJD1'
|
||||
end
|
||||
object LabelTJD2: TLabel
|
||||
Left = 168
|
||||
Top = 208
|
||||
Width = 28
|
||||
Width = 52
|
||||
Height = 13
|
||||
Caption = 'LabelTJD1'
|
||||
end
|
||||
@@ -2739,7 +2746,7 @@ object FormConfig: TFormConfig
|
||||
Top = 48
|
||||
Width = 129
|
||||
Height = 21
|
||||
ItemHeight = 13
|
||||
ItemHeight = 0
|
||||
TabOrder = 1
|
||||
OnChange = ComboBoxDecChange
|
||||
end
|
||||
@@ -2879,26 +2886,37 @@ object FormConfig: TFormConfig
|
||||
TabOrder = 0
|
||||
object RadioButtonLoc: TRadioButton
|
||||
Left = 24
|
||||
Top = 24
|
||||
Top = 16
|
||||
Width = 193
|
||||
Height = 17
|
||||
Caption = 'Fonction F pour locomotive'
|
||||
Enabled = False
|
||||
TabOrder = 0
|
||||
end
|
||||
object RadioButtonPN: TRadioButton
|
||||
Left = 24
|
||||
Top = 40
|
||||
Top = 48
|
||||
Width = 193
|
||||
Height = 17
|
||||
Caption = 'Gestion de passage '#224' niveau'
|
||||
Enabled = False
|
||||
TabOrder = 1
|
||||
end
|
||||
object RadioButtonAccess: TRadioButton
|
||||
Left = 24
|
||||
Top = 32
|
||||
Width = 161
|
||||
Height = 17
|
||||
Caption = 'Fonction F pour accessoire'
|
||||
Enabled = False
|
||||
TabOrder = 2
|
||||
end
|
||||
end
|
||||
object GroupBoxAct: TGroupBox
|
||||
Left = 16
|
||||
Top = 208
|
||||
Left = 8
|
||||
Top = 200
|
||||
Width = 225
|
||||
Height = 129
|
||||
Height = 145
|
||||
Caption = 'Actionneur fonction de locomotive '
|
||||
TabOrder = 1
|
||||
object LabelActionneur: TLabel
|
||||
@@ -2936,6 +2954,13 @@ object FormConfig: TFormConfig
|
||||
Height = 13
|
||||
Caption = 'Tempo (ms)'
|
||||
end
|
||||
object Label30: TLabel
|
||||
Left = 168
|
||||
Top = 24
|
||||
Width = 6
|
||||
Height = 13
|
||||
Caption = #224
|
||||
end
|
||||
object EditAct: TEdit
|
||||
Left = 112
|
||||
Top = 20
|
||||
@@ -2952,15 +2977,15 @@ object FormConfig: TFormConfig
|
||||
TabOrder = 1
|
||||
Text = 'EditTrain'
|
||||
end
|
||||
object EditEtat: TEdit
|
||||
object EditEtatFoncSortie: TEdit
|
||||
Left = 160
|
||||
Top = 68
|
||||
Width = 25
|
||||
Height = 21
|
||||
TabOrder = 2
|
||||
Text = 'EditEtat'
|
||||
Text = 'EditEtatFoncSortie'
|
||||
end
|
||||
object EditFonction: TEdit
|
||||
object EditFonctionAccess: TEdit
|
||||
Left = 112
|
||||
Top = 68
|
||||
Width = 25
|
||||
@@ -2976,10 +3001,26 @@ object FormConfig: TFormConfig
|
||||
TabOrder = 4
|
||||
Text = 'EditTempo'
|
||||
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
|
||||
object GroupBoxPN: TGroupBox
|
||||
Left = 16
|
||||
Top = 104
|
||||
Left = 72
|
||||
Top = 8
|
||||
Width = 225
|
||||
Height = 193
|
||||
Caption = 'Actionneurs gestion passage '#224' niveau'
|
||||
|
||||
@@ -125,9 +125,9 @@ type
|
||||
EditAct: TEdit;
|
||||
EditTrain: TEdit;
|
||||
LabelTrain: TLabel;
|
||||
EditEtat: TEdit;
|
||||
EditEtatFoncSortie: TEdit;
|
||||
Labela: TLabel;
|
||||
EditFonction: TEdit;
|
||||
EditFonctionAccess: TEdit;
|
||||
LabelFonction: TLabel;
|
||||
EditTempo: TEdit;
|
||||
LabelTempo: TLabel;
|
||||
@@ -176,6 +176,11 @@ type
|
||||
Label28: TLabel;
|
||||
LabelTJD2: TLabel;
|
||||
CheckInverse: TCheckBox;
|
||||
RadioButtonAccess: TRadioButton;
|
||||
Label29: TLabel;
|
||||
Label30: TLabel;
|
||||
EditEtatActionneur: TEdit;
|
||||
CheckRAZ: TCheckBox;
|
||||
procedure ButtonAppliquerEtFermerClick(Sender: TObject);
|
||||
procedure Button2Click(Sender: TObject);
|
||||
procedure FormActivate(Sender: TObject);
|
||||
@@ -1323,14 +1328,11 @@ begin
|
||||
LabelDetAss.visible:=false;
|
||||
LabelElSuiv.visible:=false;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
end;
|
||||
end;
|
||||
|
||||
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;
|
||||
trouve : bool;
|
||||
begin
|
||||
@@ -1351,10 +1353,12 @@ begin
|
||||
begin
|
||||
GroupBoxact.Visible:=false;
|
||||
GroupBoxPN.Top:=104;
|
||||
GroupBoxPN.Left:=16;
|
||||
GroupBoxPN.Visible:=true;
|
||||
Visible:=true;
|
||||
RadioButtonPN.Checked:=true;
|
||||
RadioButtonLoc.Checked:=false;
|
||||
RadioButtonAccess.Checked:=false;
|
||||
end;
|
||||
// trouver l'index dans le tableau
|
||||
i:=pos('PN(',s);
|
||||
@@ -1409,15 +1413,16 @@ begin
|
||||
end;
|
||||
end
|
||||
else
|
||||
// actionneur fonction F locomotive
|
||||
|
||||
// actionneur fonction F locomotive ou Accessoire
|
||||
begin
|
||||
with formconfig do
|
||||
begin
|
||||
GroupBoxAct.Top:=104;
|
||||
GroupBoxAct.Left:=16;
|
||||
|
||||
GroupBoxact.Visible:=true;
|
||||
GroupBoxPN.Visible:=false;
|
||||
formconfig.RadioButtonPN.Checked:=false;
|
||||
formconfig.RadioButtonLoc.Checked:=true;
|
||||
GroupBoxPN.Visible:=false;
|
||||
end;
|
||||
// trouver l'index dans le tableau
|
||||
val(s,adresse,erreur);
|
||||
@@ -1428,20 +1433,60 @@ begin
|
||||
until trouve or (i>MaxTablo_act);
|
||||
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;
|
||||
s2:=Tablo_actionneur[i].train;
|
||||
tempo:=tablo_actionneur[i].Tempo;
|
||||
with formconfig do
|
||||
Access:=Tablo_actionneur[i].accessoire;
|
||||
if fonction<>0 then
|
||||
begin
|
||||
EditAct.text:=IntToSTR(Adresse);
|
||||
EditTrain.Text:=s;
|
||||
editFonction.Text:=intToSTR(fonction);
|
||||
editEtat.Text:=intToSTR(etatAct);
|
||||
editTempo.Text:=intToSTR(tempo);
|
||||
end;
|
||||
etatAct:=Tablo_actionneur[i].etat ;
|
||||
//etatFonc:=Tablo_actionneur[i].
|
||||
Adresse:=Tablo_actionneur[i].actionneur;
|
||||
s2:=Tablo_actionneur[i].train;
|
||||
tempo:=tablo_actionneur[i].Tempo;
|
||||
with formconfig do
|
||||
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);
|
||||
EditTrain.Text:=s2;
|
||||
editFonctionAccess.Text:=intToSTR(fonction);
|
||||
//editEtat.Text:=intToSTR(etatAct);
|
||||
editTempo.Text:=intToSTR(tempo);
|
||||
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);
|
||||
|
||||
BIN
UnitDebug.dcu
BIN
UnitDebug.dcu
Binary file not shown.
BIN
UnitPrinc.dcu
BIN
UnitPrinc.dcu
Binary file not shown.
@@ -18,7 +18,7 @@ object FormPrinc: TFormPrinc
|
||||
OnClose = FormClose
|
||||
OnCreate = FormCreate
|
||||
DesignSize = (
|
||||
1179
|
||||
1196
|
||||
606)
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 13
|
||||
@@ -667,7 +667,7 @@ object FormPrinc: TFormPrinc
|
||||
Visible = False
|
||||
end
|
||||
object Image2feux: TImage
|
||||
Left = 776
|
||||
Left = 984
|
||||
Top = 128
|
||||
Width = 33
|
||||
Height = 57
|
||||
@@ -741,8 +741,8 @@ object FormPrinc: TFormPrinc
|
||||
Visible = False
|
||||
end
|
||||
object Image2Dir: TImage
|
||||
Left = 696
|
||||
Top = 184
|
||||
Left = 936
|
||||
Top = 144
|
||||
Width = 41
|
||||
Height = 25
|
||||
Picture.Data = {
|
||||
@@ -1221,7 +1221,7 @@ object FormPrinc: TFormPrinc
|
||||
end
|
||||
object ScrollBox1: TScrollBox
|
||||
Left = 631
|
||||
Top = 176
|
||||
Top = 168
|
||||
Width = 537
|
||||
Height = 377
|
||||
HorzScrollBar.Smooth = True
|
||||
@@ -1317,8 +1317,8 @@ object FormPrinc: TFormPrinc
|
||||
end
|
||||
object StatusBar1: TStatusBar
|
||||
Left = 0
|
||||
Top = 577
|
||||
Width = 1179
|
||||
Top = 576
|
||||
Width = 1196
|
||||
Height = 30
|
||||
Panels = <>
|
||||
SimplePanel = True
|
||||
@@ -1459,19 +1459,12 @@ object FormPrinc: TFormPrinc
|
||||
object StaticText: TStaticText
|
||||
Left = 16
|
||||
Top = 560
|
||||
Width = 1145
|
||||
Width = 14
|
||||
Height = 17
|
||||
Anchors = [akLeft, akRight, akBottom]
|
||||
Caption = 'xx'
|
||||
TabOrder = 7
|
||||
end
|
||||
object StaticText1: TStaticText
|
||||
Left = 8
|
||||
Top = 560
|
||||
Width = 4
|
||||
Height = 4
|
||||
TabOrder = 8
|
||||
end
|
||||
object Timer1: TTimer
|
||||
Interval = 100
|
||||
OnTimer = Timer1Timer
|
||||
|
||||
233
UnitPrinc.pas
233
UnitPrinc.pas
@@ -91,7 +91,6 @@ type
|
||||
ButtonLanceCDM: TButton;
|
||||
Affichefentredebug1: TMenuItem;
|
||||
StaticText: TStaticText;
|
||||
StaticText1: TStaticText;
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure MSCommUSBLenzComm(Sender: TObject);
|
||||
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
|
||||
Tablo_actionneur : array[1..100] of
|
||||
record
|
||||
actionneur,etat,fonction,tempo : integer;
|
||||
actionneur,etat,fonction,tempo,
|
||||
accessoire,sortie : integer;
|
||||
Raz : boolean;
|
||||
train : string;
|
||||
end;
|
||||
KeyInputs: array of TInput;
|
||||
@@ -1418,7 +1419,7 @@ begin
|
||||
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
|
||||
// octet : numéro (1-2) de la sortie à cette adresse
|
||||
// etat : false (désactivé) true (activé)
|
||||
@@ -3892,7 +3893,7 @@ begin
|
||||
//Affiche(intTostr(adr),clblue);
|
||||
Aiguillage[aig].inversionCDM:=adr;
|
||||
end;
|
||||
|
||||
|
||||
//Affiche(s+'/'+Enregistrement,clLime);
|
||||
// si vitesse définie
|
||||
Val(enregistrement,adr,erreur);
|
||||
@@ -4210,13 +4211,85 @@ begin
|
||||
end;
|
||||
end;
|
||||
until (finifeux) or (s='0');
|
||||
NbreFeux:=i-1; if NbreFeux<0 then NbreFeux:=0;
|
||||
//Affiche('Nombre de feux='+IntToSTR(NbreFeux),clYellow);
|
||||
|
||||
configNulle:=(maxAiguillage=0) and (NbreBranches=0) and (Nbrefeux=0);
|
||||
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
|
||||
maxTablo_act:=1;
|
||||
NbrePN:=0;Nligne:=1;
|
||||
repeat
|
||||
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';
|
||||
// définition des actionneurs
|
||||
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);
|
||||
|
||||
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;
|
||||
|
||||
@@ -4258,6 +4331,7 @@ begin
|
||||
val(s,j,erreur);
|
||||
Tablo_actionneur[maxTablo_act].Tempo:=j;
|
||||
inc(maxTablo_act);
|
||||
end;
|
||||
end;
|
||||
s:='';i:=0;
|
||||
end;
|
||||
@@ -6376,27 +6450,45 @@ end;
|
||||
for i:=1 to maxaiguillage do
|
||||
begin
|
||||
demande_info_acc(i);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
// traitement des évènements actionneurs
|
||||
procedure Event_act(adr,etat : integer;train : string);
|
||||
var i,v,va,j,etatAct,Af,Ao,Access,sortie : integer;
|
||||
var i,v,va,j,etatAct,Af,Ao : integer;
|
||||
s : string;
|
||||
s : string;
|
||||
presTrain_PN : boolean;
|
||||
Ts : TAccessoire;
|
||||
begin
|
||||
// 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);
|
||||
|
||||
for i:=1 to maxTablo_act do
|
||||
begin
|
||||
s:=Tablo_actionneur[i].train;
|
||||
etatAct:=Tablo_actionneur[i].etat ;
|
||||
// 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
|
||||
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);
|
||||
TempoAct:=tablo_actionneur[i].Tempo div 100;
|
||||
RangActCours:=i;
|
||||
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;
|
||||
@@ -6461,7 +6553,7 @@ begin
|
||||
//Affiche(IntToSTR(Adresse)+' déja stocké',clorange);
|
||||
exit; // déja stocké
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
*)
|
||||
if Traceliste then AfficheDebug('--------------------- détecteur '+intToSTR(Adresse)+' à '+intToSTR(etat01)+'-----------------------------',clOrange);
|
||||
if AffAigDet then
|
||||
@@ -6474,15 +6566,18 @@ begin
|
||||
end;
|
||||
|
||||
//if etat then Mem[Adresse]:=true; // mémoriser l'état à 1
|
||||
|
||||
|
||||
ancien_detecteur[Adresse]:=detecteur[Adresse];
|
||||
detecteur[Adresse]:=etat;
|
||||
detecteur_chgt:=Adresse;
|
||||
|
||||
// stocke les changements d'état des détecteurs dans le tableau chronologique
|
||||
if (N_Event_tick<Max_Event_det_tick) then
|
||||
begin
|
||||
detecteur[Adresse]:=etat;
|
||||
detecteur_chgt:=Adresse;
|
||||
|
||||
// stocke les changements d'état des détecteurs dans le tableau chronologique
|
||||
if (N_Event_tick>=Max_Event_det_tick) then
|
||||
begin
|
||||
N_Event_tick:=0;
|
||||
Affiche('Raz Evts détecteurs',clLime);
|
||||
end;
|
||||
inc(N_Event_tick);
|
||||
event_det_tick[N_event_tick].tick:=tick;
|
||||
event_det_tick[N_event_tick].detecteur:=Adresse;
|
||||
event_det_tick[N_event_tick].etat:=etat01;
|
||||
@@ -6573,24 +6668,28 @@ begin
|
||||
// init objet
|
||||
if aiguillage[adresse].objet=0 then
|
||||
begin
|
||||
aiguillage[adresse].objet:=objet;
|
||||
//affiche('stockage Aiguillage '+intToSTR(adresse)+' objet='+intToSTR(objet),clYellow);
|
||||
//affiche('stockage Aiguillage '+intToSTR(adresse)+' objet='+intToSTR(objet),clYellow);
|
||||
end;
|
||||
|
||||
|
||||
aiguillage[adresse].position:=pos;
|
||||
|
||||
// ------------- stockage évènement aiguillage dans tampon event_det_tick -------------------------
|
||||
if (N_Event_tick<Max_Event_det_tick) then
|
||||
begin
|
||||
if AffAigDet then
|
||||
begin
|
||||
s:='Evt Aig '+intToSTR(adresse)+'='+intToSTR(pos);
|
||||
if pos=const_droit then s:=s+' droit' else s:=s+' dévié';
|
||||
if objet<>0 then s:=s+' objet='+IntToSTR(objet);
|
||||
Affiche(s,clyellow);
|
||||
AfficheDebug(s,clyellow);
|
||||
end;
|
||||
aiguillage[adresse].position:=pos;
|
||||
|
||||
|
||||
// ------------- stockage évènement aiguillage dans tampon event_det_tick -------------------------
|
||||
if (N_Event_tick>=Max_Event_det_tick) then
|
||||
begin
|
||||
N_Event_tick:=0;
|
||||
Affiche('Raz Evts détecteurs',clLime);
|
||||
end;
|
||||
s:='Evt Aig '+intToSTR(adresse)+'='+intToSTR(pos);
|
||||
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);
|
||||
Affiche(s,clyellow);
|
||||
AfficheDebug(s,clyellow);
|
||||
end;
|
||||
FormDebug.MemoEvtDet.lines.add(s) ;
|
||||
if (n_Event_tick mod 10) =0 then affiche_memoire;
|
||||
inc(N_Event_tick);
|
||||
event_det_tick[N_event_tick].tick:=tick;
|
||||
@@ -7292,7 +7391,7 @@ begin
|
||||
TraceSign:=True;
|
||||
PremierFD:=false;
|
||||
// services commIP CDM
|
||||
Srvc_Aig:=true;
|
||||
Srvc_Aig:=true;
|
||||
Srvc_Det:=true;
|
||||
Srvc_Act:=true;
|
||||
Srvc_PosTrain:=false;
|
||||
@@ -7312,7 +7411,7 @@ begin
|
||||
|
||||
// créée la fenetre debug
|
||||
FormDebug:=TFormDebug.Create(Self);
|
||||
FormDebug.Caption:=AF+' debug';
|
||||
FormDebug.Caption:=AF+' debug';
|
||||
N_Trains:=0;
|
||||
NivDebug:=0;
|
||||
TempoAct:=0;
|
||||
@@ -7409,7 +7508,7 @@ begin
|
||||
event_det_tick[i].traite:=false ; // non traité
|
||||
end;
|
||||
|
||||
I_Simule:=0;
|
||||
I_Simule:=0;
|
||||
tick:=0;
|
||||
|
||||
N_Event_tick:=0 ; // dernier index
|
||||
@@ -7422,41 +7521,20 @@ begin
|
||||
FormTCO:=TformTCO.Create(nil);
|
||||
FormTCO.show;
|
||||
end;
|
||||
|
||||
|
||||
//essai &&&&&&&&&&
|
||||
Affiche('Fin des initialisations',clyellow);
|
||||
LabelEtat.Caption:=' ';
|
||||
Affiche_memoire;
|
||||
//---------------------------------
|
||||
{
|
||||
aiguillage[20].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;
|
||||
|
||||
LabelEtat.Caption:=' ';
|
||||
Affiche_memoire;
|
||||
//---------------------------------
|
||||
{
|
||||
aiguillage[20].position:=const_droit;
|
||||
aiguillage[21].position:=const_droit;
|
||||
|
||||
|
||||
NivDebug:=3;
|
||||
FormDebug.show;
|
||||
//i:=Detecteur_suivant_El(591,1,602,1);
|
||||
|
||||
NivDebug:=3;
|
||||
FormDebug.show;
|
||||
//i:=Detecteur_suivant_El(591,1,602,1);
|
||||
//i:=Detecteur_suivant_El(597,1,601,1);
|
||||
// posent pb:
|
||||
// i:=Detecteur_suivant_El(598,1,599,1);
|
||||
@@ -7654,17 +7732,17 @@ begin
|
||||
end;
|
||||
while tick=Tablo_simule[i_simule+1].tick do
|
||||
//while i_simule<Index_simule do
|
||||
begin
|
||||
begin
|
||||
inc(I_simule);
|
||||
|
||||
|
||||
// evt détecteur ?
|
||||
if Tablo_simule[i_simule].detecteur<>0 then
|
||||
begin
|
||||
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
|
||||
// statusBar1.Hint:=' det='+intToSTR(Tablo_simule[i_simule].detecteur)+'='+IntToSTR(Tablo_simule[i_simule].etat);
|
||||
StaticText.caption:=s;
|
||||
end;
|
||||
|
||||
|
||||
// evt aiguillage ?
|
||||
if Tablo_simule[i_simule].aiguillage<>0 then
|
||||
begin
|
||||
@@ -7675,6 +7753,7 @@ begin
|
||||
|
||||
end;
|
||||
|
||||
if i_Simule>=Index_simule then
|
||||
begin
|
||||
Index_Simule:=0; // fin de simulation
|
||||
I_Simule:=0;
|
||||
@@ -8460,7 +8539,7 @@ end;
|
||||
procedure TFormPrinc.ConfigClick(Sender: TObject);
|
||||
begin
|
||||
Tformconfig.create(nil);
|
||||
formconfig.showmodal;
|
||||
formconfig.showmodal;
|
||||
formconfig.close;
|
||||
end;
|
||||
|
||||
@@ -8473,28 +8552,36 @@ begin
|
||||
begin
|
||||
Affiche('Aucun actionneur déclaré',clYellow);
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
for i:=1 to maxTablo_act do
|
||||
begin
|
||||
s:=Tablo_actionneur[i].train;
|
||||
etatAct:=Tablo_actionneur[i].etat ;
|
||||
AdrAct:=Tablo_actionneur[i].actionneur;
|
||||
s:=Tablo_actionneur[i].train;
|
||||
etatAct:=Tablo_actionneur[i].etat ;
|
||||
s2:=Tablo_actionneur[i].train;
|
||||
acc:=Tablo_actionneur[i].accessoire;
|
||||
sortie:=Tablo_actionneur[i].sortie;
|
||||
fonction:=Tablo_actionneur[i].fonction;
|
||||
if (s2<>'') then
|
||||
begin
|
||||
if fonction<>0 then
|
||||
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;
|
||||
|
||||
// dans le tableau des PN
|
||||
// dans le tableau des PN
|
||||
for i:=1 to NbrePN do
|
||||
begin
|
||||
s:='PN'+intToSTR(i)+' Adresse fermeture PN='+IntToSTR(Tablo_PN[i].AdresseFerme);
|
||||
s:=s+' Adresse ouverture PN='+IntToSTR(Tablo_PN[i].AdresseOuvre);
|
||||
Affiche(s,clyellow);
|
||||
s:=' Commande fermeture='+intToSTR(Tablo_PN[i].commandeFerme);
|
||||
s:=' Commande fermeture='+intToSTR(Tablo_PN[i].commandeFerme);
|
||||
s:=s+' Commande ouverture='+intToSTR(Tablo_PN[i].commandeOuvre);
|
||||
s:=s+' Nbre de voies='+intToSTR(Tablo_PN[i].nbVoies);
|
||||
Affiche(s,clyellow);
|
||||
|
||||
BIN
UnitSimule.dcu
BIN
UnitSimule.dcu
Binary file not shown.
@@ -53,7 +53,7 @@ begin
|
||||
index_simule:=1;
|
||||
repeat
|
||||
readln(fte,s);
|
||||
Affiche(s,clLime);
|
||||
//Affiche(s,clLime);
|
||||
i:=pos('Tick=',s);
|
||||
if i<>0 then
|
||||
begin
|
||||
|
||||
BIN
UnitTCO.dcu
BIN
UnitTCO.dcu
Binary file not shown.
Binary file not shown.
@@ -23,7 +23,7 @@ var
|
||||
Lance_verif : integer;
|
||||
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
|
||||
|
||||
|
||||
@@ -33,7 +33,10 @@ version 1.76 : Modification des aiguillages mod
|
||||
Correction d'un bug sur les feux dont l'élément suivant est un détecteur
|
||||
version 2.0 : Changement de description des TJD
|
||||
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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user