V3.5
This commit is contained in:
BIN
Binary file not shown.
@@ -31,5 +31,5 @@
|
||||
-M
|
||||
-$M16384,1048576
|
||||
-K$00400000
|
||||
-LE"c:\program files (x86)\borland\delphi7\Projects\Bpl"
|
||||
-LN"c:\program files (x86)\borland\delphi7\Projects\Bpl"
|
||||
-LE"c:\program files\borland\delphi7\Projects\Bpl"
|
||||
-LN"c:\program files\borland\delphi7\Projects\Bpl"
|
||||
|
||||
@@ -10,7 +10,7 @@ uses
|
||||
UnitTCO in 'UnitTCO.pas' {FormTCO},
|
||||
UnitConfig in 'UnitConfig.pas' {FormConfig},
|
||||
UnitConfigTCO in 'UnitConfigTCO.pas' {FormConfigTCO},
|
||||
UnitSR in '..\macro fichier\UnitSR.pas' {FormSR};
|
||||
UnitSR in 'UnitSR.pas' {FormSR};
|
||||
|
||||
{$R *.res}
|
||||
|
||||
|
||||
Binary file not shown.
+78
-25
@@ -1,6 +1,6 @@
|
||||
object FormConfig: TFormConfig
|
||||
Left = 268
|
||||
Top = 207
|
||||
Left = 281
|
||||
Top = 124
|
||||
Hint =
|
||||
'Modifie les fichiers de configuration selon les s'#233'lections chois' +
|
||||
'ies'
|
||||
@@ -1578,7 +1578,7 @@ object FormConfig: TFormConfig
|
||||
Top = 8
|
||||
Width = 633
|
||||
Height = 457
|
||||
ActivePage = TabSheetAig
|
||||
ActivePage = TabSheetCDM
|
||||
Font.Charset = DEFAULT_CHARSET
|
||||
Font.Color = clBlack
|
||||
Font.Height = -11
|
||||
@@ -2581,7 +2581,10 @@ object FormConfig: TFormConfig
|
||||
Top = 24
|
||||
Width = 65
|
||||
Height = 17
|
||||
Hint = 'TJD '#224' 1 moteur'
|
||||
Caption = '2 '#233'tats'
|
||||
ParentShowHint = False
|
||||
ShowHint = True
|
||||
TabOrder = 0
|
||||
OnClick = RadioButtonTJD2Click
|
||||
end
|
||||
@@ -2590,7 +2593,10 @@ object FormConfig: TFormConfig
|
||||
Top = 40
|
||||
Width = 65
|
||||
Height = 17
|
||||
Hint = 'TJD '#224' 2 moteurs'
|
||||
Caption = '4 '#233'tats'
|
||||
ParentShowHint = False
|
||||
ShowHint = True
|
||||
TabOrder = 1
|
||||
OnClick = RadioButtonTJD4Click
|
||||
end
|
||||
@@ -2876,7 +2882,7 @@ object FormConfig: TFormConfig
|
||||
Top = 48
|
||||
Width = 129
|
||||
Height = 21
|
||||
ItemHeight = 0
|
||||
ItemHeight = 13
|
||||
TabOrder = 1
|
||||
OnChange = ComboBoxDecChange
|
||||
end
|
||||
@@ -3085,7 +3091,7 @@ object FormConfig: TFormConfig
|
||||
end
|
||||
end
|
||||
object TabSheetAct: TTabSheet
|
||||
Caption = 'Actionneurs'
|
||||
Caption = 'Actionneurs/D'#233'tecteurs'
|
||||
ImageIndex = 5
|
||||
object Label16: TLabel
|
||||
Left = 0
|
||||
@@ -3105,12 +3111,12 @@ object FormConfig: TFormConfig
|
||||
TabOrder = 0
|
||||
object Label40: TLabel
|
||||
Left = 16
|
||||
Top = 344
|
||||
Top = 328
|
||||
Width = 222
|
||||
Height = 26
|
||||
Height = 39
|
||||
Caption =
|
||||
'Les actionneurs ne sont utilisables qu'#39'en mode connect'#233' avec CDM' +
|
||||
' Rail'
|
||||
'Les actionneurs ne sont utilisables qu'#39'en mode RUN avec CDM Rail' +
|
||||
'. Les d'#233'tecteurs sont utilisables en mode autonome.'
|
||||
WordWrap = True
|
||||
end
|
||||
object GroupBoxPN: TGroupBox
|
||||
@@ -3283,9 +3289,9 @@ object FormConfig: TFormConfig
|
||||
end
|
||||
object GroupBoxRadio: TGroupBox
|
||||
Left = 16
|
||||
Top = 40
|
||||
Top = 24
|
||||
Width = 225
|
||||
Height = 65
|
||||
Height = 81
|
||||
Caption = 'Type d'#39'actionneur '
|
||||
TabOrder = 0
|
||||
object RadioButtonLoc: TRadioButton
|
||||
@@ -3306,10 +3312,19 @@ object FormConfig: TFormConfig
|
||||
TabOrder = 1
|
||||
OnClick = RadioButtonAccessClick
|
||||
end
|
||||
object RadioButtonSon: TRadioButton
|
||||
Left = 24
|
||||
Top = 56
|
||||
Width = 161
|
||||
Height = 17
|
||||
Caption = 'Son'
|
||||
TabOrder = 2
|
||||
OnClick = RadioButtonSonClick
|
||||
end
|
||||
end
|
||||
object GroupBoxAct: TGroupBox
|
||||
Left = 64
|
||||
Top = 112
|
||||
Left = 16
|
||||
Top = 80
|
||||
Width = 225
|
||||
Height = 225
|
||||
Caption = 'Actionneur fonction de locomotive '
|
||||
@@ -3322,14 +3337,15 @@ object FormConfig: TFormConfig
|
||||
Caption = 'D'#233'clencheur '
|
||||
TabOrder = 0
|
||||
object LabelActionneur: TLabel
|
||||
Left = 32
|
||||
Top = 24
|
||||
Width = 51
|
||||
Height = 13
|
||||
Caption = 'Actionneur'
|
||||
Left = 16
|
||||
Top = 16
|
||||
Width = 54
|
||||
Height = 26
|
||||
Caption = 'Actionneur D'#233'tecteurZ'
|
||||
WordWrap = True
|
||||
end
|
||||
object Label30: TLabel
|
||||
Left = 152
|
||||
Left = 136
|
||||
Top = 24
|
||||
Width = 6
|
||||
Height = 13
|
||||
@@ -3337,23 +3353,25 @@ object FormConfig: TFormConfig
|
||||
end
|
||||
object LabelTrain: TLabel
|
||||
Left = 56
|
||||
Top = 46
|
||||
Top = 54
|
||||
Width = 24
|
||||
Height = 13
|
||||
Caption = 'Train'
|
||||
end
|
||||
object EditAct: TEdit
|
||||
Left = 96
|
||||
Left = 88
|
||||
Top = 20
|
||||
Width = 49
|
||||
Width = 41
|
||||
Height = 21
|
||||
ParentShowHint = False
|
||||
ShowHint = True
|
||||
TabOrder = 0
|
||||
OnChange = EditActChange
|
||||
end
|
||||
object EditEtatActionneur: TEdit
|
||||
Left = 168
|
||||
Left = 152
|
||||
Top = 20
|
||||
Width = 25
|
||||
Width = 17
|
||||
Height = 21
|
||||
TabOrder = 1
|
||||
OnChange = EditEtatActionneurChange
|
||||
@@ -3403,6 +3421,33 @@ object FormConfig: TFormConfig
|
||||
Height = 13
|
||||
Caption = #224
|
||||
end
|
||||
object LabelNomSon: TLabel
|
||||
Left = 16
|
||||
Top = 24
|
||||
Width = 91
|
||||
Height = 13
|
||||
Caption = 'Nom du fichier son:'
|
||||
end
|
||||
object SpeedButtonJoue: TSpeedButton
|
||||
Left = 88
|
||||
Top = 64
|
||||
Width = 41
|
||||
Height = 33
|
||||
Flat = True
|
||||
Glyph.Data = {
|
||||
4E010000424D4E010000000000003E0000002800000022000000220000000100
|
||||
010000000000100100000000000000000000020000000000000000000000FFFF
|
||||
FF00FFFFFFFFC0000000FFFFFFFFC0000000FFFFFFFFC0000000C0000000C000
|
||||
0000800000004000000000000000000000001FFFFFFE000000003FFFFFFF0000
|
||||
00003FFFFFFF000000003FFFFFFF000000003FF8FFFF000000003FF03FFF0000
|
||||
00003FF00FFF000000003FF303FF000000003FF3C0FF000000003FF3F07F0000
|
||||
00003FF3FC7F000000003FF3FC7F000000003FF3E07F000000003FF381FF0000
|
||||
00003FF207FF000000003FF01FFF000000003FF07FFF000000003FF9FFFF0000
|
||||
00003FFFFFFF000000003FFFFFFF000000003FFFFFFF000000001FFFFFFE0000
|
||||
000000000000000000008000000040000000C0000000C0000000FFFFFFFFC000
|
||||
0000FFFFFFFFC0000000FFFFFFFFC0000000}
|
||||
OnClick = SpeedButtonJoueClick
|
||||
end
|
||||
object EditTempo: TEdit
|
||||
Left = 112
|
||||
Top = 46
|
||||
@@ -3439,6 +3484,14 @@ object FormConfig: TFormConfig
|
||||
TabOrder = 3
|
||||
OnChange = EditEtatFoncSortieChange
|
||||
end
|
||||
object EditSon: TEdit
|
||||
Left = 16
|
||||
Top = 40
|
||||
Width = 177
|
||||
Height = 21
|
||||
TabOrder = 4
|
||||
OnChange = EditSonChange
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -3447,7 +3500,7 @@ object FormConfig: TFormConfig
|
||||
Top = 32
|
||||
Width = 345
|
||||
Height = 185
|
||||
Caption = 'Actionneurs locomotives ou accessoires'
|
||||
Caption = 'Actionneurs/d'#233'tecteurs locomotives ou accessoires'
|
||||
TabOrder = 1
|
||||
object ButtonNouvAcc: TButton
|
||||
Left = 8
|
||||
|
||||
+294
-78
@@ -4,7 +4,8 @@ interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, ExtCtrls, StdCtrls , verif_version, jpeg, ComCtrls ,StrUtils, Unitprinc ;
|
||||
Dialogs, ExtCtrls, StdCtrls , verif_version, jpeg, ComCtrls ,StrUtils, Unitprinc,
|
||||
MMSystem, Buttons ;
|
||||
|
||||
type
|
||||
TFormConfig = class(TForm)
|
||||
@@ -233,6 +234,10 @@ type
|
||||
GroupBoxEtatTJD: TGroupBox;
|
||||
RadioButtonTJD2: TRadioButton;
|
||||
RadioButtonTJD4: TRadioButton;
|
||||
RadioButtonSon: TRadioButton;
|
||||
EditSon: TEdit;
|
||||
LabelNomSon: TLabel;
|
||||
SpeedButtonJoue: TSpeedButton;
|
||||
procedure ButtonAppliquerEtFermerClick(Sender: TObject);
|
||||
procedure FormActivate(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
@@ -322,6 +327,9 @@ type
|
||||
procedure PageControlChange(Sender: TObject);
|
||||
procedure RadioButtonTJD2Click(Sender: TObject);
|
||||
procedure RadioButtonTJD4Click(Sender: TObject);
|
||||
procedure RadioButtonSonClick(Sender: TObject);
|
||||
procedure EditSonChange(Sender: TObject);
|
||||
procedure SpeedButtonJoueClick(Sender: TObject);
|
||||
private
|
||||
{ Déclarations privées }
|
||||
public
|
||||
@@ -992,26 +1000,34 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
// transforme l'actionneur type loco ou actionneur du tableau en texte
|
||||
// transforme l'actionneur type loco ou actionneur ou son du tableau en texte
|
||||
// paramètre d'entrée : index
|
||||
function encode_act_loc(i : integer): string;
|
||||
function encode_act_loc_son(i : integer): string;
|
||||
var s : string;
|
||||
adresse : integer;
|
||||
begin
|
||||
// adresse
|
||||
adresse:=Tablo_Actionneur[i].actionneur;
|
||||
adresse:=Tablo_Actionneur[i].adresse;
|
||||
s:=IntToSTR(adresse);
|
||||
if tablo_actionneur[i].det then s:=s+'Z';
|
||||
|
||||
if Tablo_Actionneur[i].loco then
|
||||
s:=IntToSTR(adresse)+','+IntToSTR(Tablo_Actionneur[i].Etat)+','+Tablo_Actionneur[i].train+',F'+IntToSTR(Tablo_Actionneur[i].fonction)+','+intToSTR(Tablo_Actionneur[i].tempo);
|
||||
s:=s+','+IntToSTR(Tablo_Actionneur[i].Etat)+','+Tablo_Actionneur[i].train+',F'+IntToSTR(Tablo_Actionneur[i].fonction)+','+intToSTR(Tablo_Actionneur[i].tempo);
|
||||
|
||||
if Tablo_Actionneur[i].act then
|
||||
begin
|
||||
s:=IntToSTR(adresse)+','+IntToSTR(Tablo_Actionneur[i].Etat)+','+Tablo_Actionneur[i].train+
|
||||
s:=s+','+IntToSTR(Tablo_Actionneur[i].Etat)+','+Tablo_Actionneur[i].train+
|
||||
',A'+IntToSTR(Tablo_Actionneur[i].accessoire)+','+intToSTR(Tablo_Actionneur[i].sortie)+',';
|
||||
if Tablo_Actionneur[i].Raz then s:=s+'Z' else s:=s+'S';
|
||||
end;
|
||||
encode_act_loc:=s;
|
||||
end;
|
||||
|
||||
if Tablo_Actionneur[i].son then
|
||||
s:=s+','+IntToSTR(Tablo_Actionneur[i].Etat)+','+Tablo_Actionneur[i].train+',"'+Tablo_Actionneur[i].FichierSon+'"';
|
||||
|
||||
encode_act_loc_son:=s;
|
||||
end;
|
||||
|
||||
// encode l'actioneur PN du tableau en texte
|
||||
// encode l'actionneur PN du tableau en texte
|
||||
function encode_act_pn(i : integer) : string;
|
||||
var s : string;
|
||||
voie,NbVoies : integer;
|
||||
@@ -1021,7 +1037,7 @@ begin
|
||||
NbVoies:=Tablo_PN[i].NbVoies;
|
||||
s:='';
|
||||
for voie:=1 to NbVoies do
|
||||
begin
|
||||
begin
|
||||
s:=s+'('+intToSTR(tablo_PN[i].Voie[voie].ActFerme)+','+intToSTR(tablo_PN[i].Voie[voie].ActOuvre)+')';
|
||||
if voie<NbVoies then s:=s+',';
|
||||
end;
|
||||
@@ -1183,7 +1199,7 @@ begin
|
||||
writeln(fichierN,section_act_ch);
|
||||
for i:=1 to maxTablo_act do
|
||||
begin
|
||||
s:=encode_act_loc(i);
|
||||
s:=encode_act_loc_son(i);
|
||||
if s<>'' then writeln(fichierN,s);
|
||||
end;
|
||||
|
||||
@@ -1280,19 +1296,24 @@ begin
|
||||
begin
|
||||
Tablo_actionneur[i].train:='';
|
||||
Tablo_actionneur[i].etat:=0;
|
||||
Tablo_actionneur[i].actionneur:=0;
|
||||
Tablo_actionneur[i].adresse:=0;
|
||||
Tablo_actionneur[i].accessoire:=0;
|
||||
Tablo_actionneur[i].sortie:=0;
|
||||
end;
|
||||
|
||||
Affiche('Définition des actionneurs',clyellow);
|
||||
Tablo_actionneur[i].fichierSon:='';
|
||||
Tablo_actionneur[i].det:=false;
|
||||
Tablo_actionneur[i].loco:=false;
|
||||
Tablo_actionneur[i].act:=false;
|
||||
Tablo_actionneur[i].son:=false;
|
||||
end;
|
||||
|
||||
Affiche('Définition des actionneurs/détecteurs',clyellow);
|
||||
maxTablo_act:=1;
|
||||
NbrePN:=0;Nligne:=1;
|
||||
|
||||
|
||||
// définition des actionneurs
|
||||
repeat
|
||||
repeat
|
||||
s:=lit_ligne;
|
||||
// vérifier si F ou A au 4eme champ
|
||||
// vérifier si F ou A ou " au 4eme champ
|
||||
sa:=s; sOrigine:=s;
|
||||
i:=pos(',',sa);
|
||||
if i>0 then delete(sa,1,i) else s:='0';
|
||||
@@ -1300,20 +1321,56 @@ begin
|
||||
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';
|
||||
|
||||
|
||||
inc(Nligne);
|
||||
|
||||
if length(sa)>1 then if (sa[1]='"') then
|
||||
// -----------------son
|
||||
begin
|
||||
Tablo_actionneur[maxtablo_act].act:=false;
|
||||
Tablo_actionneur[maxtablo_act].son:=true;
|
||||
Tablo_actionneur[maxtablo_act].loco:=false;
|
||||
i:=pos(',',s);
|
||||
if i<>0 then
|
||||
begin
|
||||
val(copy(s,1,i-1),j,erreur);
|
||||
Tablo_actionneur[maxTablo_act].det:=s[erreur]='Z';
|
||||
Tablo_actionneur[maxTablo_act].adresse:=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('"',s);
|
||||
Delete(s,1,i);
|
||||
i:=pos('"',s);
|
||||
Tablo_actionneur[maxTablo_act].fichierSon:=copy(s,1,i-1);
|
||||
inc(maxTablo_act);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
if length(sa)>1 then if (sa[1]='A') then
|
||||
// -----------------accessoire
|
||||
begin
|
||||
Tablo_actionneur[maxtablo_act].act:=true;
|
||||
Tablo_actionneur[maxtablo_act].son:=false;
|
||||
Tablo_actionneur[maxtablo_act].loco:=false;
|
||||
|
||||
|
||||
i:=pos(',',s);
|
||||
if i<>0 then
|
||||
begin
|
||||
val(copy(s,1,i-1),j,erreur);
|
||||
Tablo_actionneur[maxTablo_act].actionneur:=j;
|
||||
Tablo_actionneur[maxTablo_act].det:=s[erreur]='Z';
|
||||
Tablo_actionneur[maxTablo_act].adresse:=j;
|
||||
Delete(s,1,i);
|
||||
i:=pos(',',s);
|
||||
if i<>0 then
|
||||
@@ -1349,7 +1406,7 @@ begin
|
||||
Tablo_actionneur[maxTablo_act].RAZ:=s[1]='Z';
|
||||
inc(maxTablo_act);
|
||||
end;
|
||||
|
||||
|
||||
end;
|
||||
s:='';i:=0;
|
||||
end;
|
||||
@@ -1362,12 +1419,15 @@ begin
|
||||
begin
|
||||
Tablo_actionneur[maxtablo_act].act:=false;
|
||||
Tablo_actionneur[maxtablo_act].loco:=true;
|
||||
Tablo_actionneur[maxtablo_act].son:=false;
|
||||
|
||||
// 815,1,CC406526,F2,450
|
||||
i:=pos(',',s);
|
||||
if i<>0 then
|
||||
begin
|
||||
val(copy(s,1,i-1),j,erreur);
|
||||
Tablo_actionneur[maxTablo_act].actionneur:=j;
|
||||
Tablo_actionneur[maxTablo_act].det:=s[erreur]='Z';
|
||||
Tablo_actionneur[maxTablo_act].adresse:=j;
|
||||
Delete(s,1,i);
|
||||
i:=pos(',',s);
|
||||
if i<>0 then
|
||||
@@ -1948,33 +2008,41 @@ begin
|
||||
|
||||
// section aiguillages
|
||||
sa:=uppercase(section_aig_ch);
|
||||
i:=pos(sa,s);
|
||||
trouve_section_aig:=i<>0;
|
||||
if trouve_section_aig then compile_aiguillages;
|
||||
if pos(sa,s)<>0 then
|
||||
begin
|
||||
trouve_section_aig:=true;
|
||||
compile_aiguillages;
|
||||
end;
|
||||
|
||||
// section branche
|
||||
sa:=uppercase(section_branches_ch);
|
||||
i:=pos(sa,s);
|
||||
trouve_section_branche:=i<>0;
|
||||
if trouve_section_branche then compile_branches;
|
||||
if pos(sa,s)<>0 then
|
||||
begin
|
||||
trouve_section_branche:=true;
|
||||
compile_branches;
|
||||
end;
|
||||
|
||||
// section signaux
|
||||
sa:=uppercase(section_sig_ch);
|
||||
i:=pos(sa,s);
|
||||
trouve_section_sig:=i<>0;
|
||||
if trouve_section_sig then compile_signaux;
|
||||
if pos(sa,s)<>0 then
|
||||
begin
|
||||
trouve_section_sig:=true;
|
||||
compile_signaux;
|
||||
end;
|
||||
|
||||
// section actionneurs
|
||||
sa:=uppercase(section_act_ch);
|
||||
i:=pos(sa,s);
|
||||
trouve_section_act:=i<>0;
|
||||
if trouve_section_act then compile_actionneurs;
|
||||
|
||||
if pos(sa,s)<>0 then
|
||||
begin
|
||||
trouve_section_act:=true;
|
||||
compile_actionneurs;
|
||||
end;
|
||||
|
||||
inc(it);
|
||||
|
||||
until (eof(fichier));
|
||||
until (eof(fichier));
|
||||
|
||||
end;
|
||||
end;
|
||||
// procédure lit_config
|
||||
begin
|
||||
debugConfig:=false;
|
||||
@@ -2064,9 +2132,9 @@ begin
|
||||
closeFile(fichier);
|
||||
// regénérer la config dans le fichier configgenerale.cfg
|
||||
assign(fichier,'client-gl.cfg');
|
||||
reset(fichier); // pour les commentaires
|
||||
reset(fichier); // pour les commentaires
|
||||
genere_config;
|
||||
|
||||
|
||||
s:='------------------------------------------------------------------------------------------------------';
|
||||
Affiche(s,clAqua);
|
||||
Affiche('AVERTISSEMENT: les fichiers de configurations ont été fusionnés dans ConfigGenerale.cfg',clAqua);
|
||||
@@ -2111,6 +2179,9 @@ begin
|
||||
if not(trouve_verif_version) then s:=verif_version_ch;
|
||||
if not(trouve_fonte) then s:=fonte_ch;
|
||||
if s<>'' then affiche('ERREUR: manque variables dans '+NomConfig+' :'+s,clred);
|
||||
if not(trouve_section_aig) then Affiche('Manque section '+section_aig_ch,clred);
|
||||
if not(trouve_section_sig) then Affiche('Manque section '+section_sig_ch,clred);
|
||||
if not(trouve_section_branche) then Affiche('Manque section '+section_branches_ch,clred);
|
||||
verif_coherence;
|
||||
end;
|
||||
|
||||
@@ -2472,7 +2543,7 @@ begin
|
||||
RichAct.Clear;
|
||||
for i:=1 to maxTablo_act do
|
||||
begin
|
||||
s:=encode_act_loc(i);
|
||||
s:=encode_act_loc_son(i);
|
||||
if s<>'' then
|
||||
begin
|
||||
RichAct.Lines.Add(s);
|
||||
@@ -2764,6 +2835,10 @@ begin
|
||||
Visible:=true;
|
||||
RadioButtonLoc.Checked:=false;
|
||||
RadioButtonAccess.Checked:=false;
|
||||
RadioButtonSon.Checked:=false;
|
||||
EditSon.Visible:=false;
|
||||
SpeedButtonJoue.Visible:=false;
|
||||
LabelNomSon.Visible:=false;
|
||||
end;
|
||||
end;
|
||||
|
||||
@@ -2779,11 +2854,17 @@ begin
|
||||
CheckRaz.Visible:=false;
|
||||
GroupBoxAct.Caption:='Actionneur de fonction F de locomotive';
|
||||
LabelTempo.Visible:=true; EditTempo.visible:=true; editEtatFoncSortie.visible:=false;LabelA.Visible:=false;
|
||||
LabelFonction.visible:=true;
|
||||
LabelFonction.caption:='Action : Fonction';
|
||||
RadioButtonLoc.Checked:=true;
|
||||
RadioButtonAccess.Checked:=false;
|
||||
RadioButtonSon.Checked:=false;
|
||||
GroupBoxAct.Visible:=true;
|
||||
GroupBoxPN.Visible:=false;
|
||||
EditSon.Visible:=false;
|
||||
SpeedButtonJoue.Visible:=false;
|
||||
EditFonctionAccess.Visible:=true;
|
||||
LabelNomSon.Visible:=false;
|
||||
end;
|
||||
end;
|
||||
|
||||
@@ -2799,11 +2880,49 @@ begin
|
||||
GroupBoxAct.Caption:='Actionneur d''accessoire';
|
||||
CheckRaz.Visible:=true;
|
||||
LabelTempo.Visible:=false; EditTempo.visible:=false;editEtatFoncSortie.visible:=true;LabelA.Visible:=true;
|
||||
LabelFonction.visible:=true;
|
||||
LabelFonction.caption:='Action : Accessoire';
|
||||
RadioButtonLoc.Checked:=false;
|
||||
RadioButtonSon.checked:=false;
|
||||
RadioButtonAccess.Checked:=true;
|
||||
GroupBoxAct.Visible:=true;
|
||||
GroupBoxPN.Visible:=false;
|
||||
EditSon.Visible:=false;
|
||||
SpeedButtonJoue.Visible:=false;
|
||||
EditFonctionAccess.Visible:=true;
|
||||
LabelNomSon.Visible:=false;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure champs_type_son;
|
||||
begin
|
||||
with formconfig do
|
||||
begin
|
||||
GroupBoxRadio.Visible:=true;
|
||||
GroupBoxRadio.top:=20;
|
||||
GroupBoxRadio.Left:=16;
|
||||
GroupBoxAct.Top:=104;
|
||||
GroupBoxAct.Left:=16;
|
||||
GroupBoxAct.Caption:='Actionneur d''accessoire';
|
||||
CheckRaz.Visible:=true;
|
||||
|
||||
LabelTempo.Visible:=false; EditTempo.visible:=false;
|
||||
|
||||
editEtatFoncSortie.visible:=false;
|
||||
LabelA.Visible:=false;
|
||||
LabelFonction.visible:=false;
|
||||
EditFonctionAccess.Visible:=false;
|
||||
CheckRaz.Visible:=false;
|
||||
EditSon.Visible:=true;
|
||||
SpeedButtonJoue.Visible:=true;
|
||||
LabelNomSon.Visible:=true;
|
||||
|
||||
RadioButtonLoc.Checked:=false;
|
||||
RadioButtonAccess.Checked:=false;
|
||||
RadioButtonSon.checked:=true;
|
||||
|
||||
GroupBoxAct.Visible:=true;
|
||||
GroupBoxPN.Visible:=false;
|
||||
end;
|
||||
end;
|
||||
|
||||
@@ -2964,51 +3083,54 @@ end;
|
||||
// mise à jour des champs graphiques des actionneurs d'après l'index du richAct
|
||||
Procedure aff_champs_act(i : integer);
|
||||
var etatact, adresse,sortie,fonction,tempo,access : integer;
|
||||
s,s2 : string;
|
||||
s,s2,adr : string;
|
||||
det : boolean;
|
||||
begin
|
||||
if affevt then affiche('Aff_champs_act('+intToSTR(i)+')',clyellow);
|
||||
s:=Uppercase(FormConfig.RichAct.Lines[i]);
|
||||
if s='' then exit;
|
||||
if s='' then exit;
|
||||
inc(i); // passer en index tablo
|
||||
|
||||
fonction:=Tablo_actionneur[i].fonction;
|
||||
Access:=Tablo_actionneur[i].accessoire;
|
||||
det:=Tablo_actionneur[i].det;
|
||||
if det then s2:='Détecteur ' else s2:='Actionneur ';
|
||||
s2:=s2+intToSTR(Tablo_actionneur[i].adresse);
|
||||
FormConfig.EditAct.Hint:=s2;
|
||||
|
||||
// Actionneur fonction F loco
|
||||
if Tablo_actionneur[i].loco then
|
||||
if Tablo_actionneur[i].loco then
|
||||
begin
|
||||
Formconfig.radioButtonLoc.Checked:=true;
|
||||
Formconfig.radioButtonAccess.Checked:=false;
|
||||
etatAct:=Tablo_actionneur[i].etat ;
|
||||
//etatFonc:=Tablo_actionneur[i].
|
||||
Adresse:=Tablo_actionneur[i].actionneur;
|
||||
champs_type_loco;
|
||||
etatAct:=Tablo_actionneur[i].etat;
|
||||
Adresse:=Tablo_actionneur[i].adresse;
|
||||
s2:=Tablo_actionneur[i].train;
|
||||
tempo:=tablo_actionneur[i].Tempo;
|
||||
with formconfig do
|
||||
begin
|
||||
champs_type_loco;
|
||||
EditAct.text:=IntToSTR(Adresse);
|
||||
adr:=IntToSTR(Adresse); if det then adr:=adr+'Z';
|
||||
EditAct.text:=adr;
|
||||
editEtatActionneur.Text:=IntToSTR(etatAct);
|
||||
EditTrain.Text:=s2;
|
||||
editFonctionAccess.Text:=intToSTR(fonction);
|
||||
editTempo.Text:=intToSTR(tempo);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
// Actionneur accessoire
|
||||
if Tablo_actionneur[i].act then
|
||||
if Tablo_actionneur[i].act then
|
||||
begin
|
||||
champs_type_act;
|
||||
Formconfig.radioButtonLoc.Checked:=false;
|
||||
Formconfig.radioButtonAccess.Checked:=true;
|
||||
etatAct:=Tablo_actionneur[i].etat ;
|
||||
Adresse:=Tablo_actionneur[i].actionneur;
|
||||
Adresse:=Tablo_actionneur[i].adresse;
|
||||
sortie:=Tablo_actionneur[i].sortie;
|
||||
s2:=Tablo_actionneur[i].train;
|
||||
tempo:=tablo_actionneur[i].Tempo;
|
||||
with formconfig do
|
||||
begin
|
||||
EditAct.text:=IntToSTR(Adresse);
|
||||
adr:=IntToSTR(Adresse); if det then adr:=adr+'Z';
|
||||
EditAct.text:=adr;
|
||||
CheckRaz.Checked:=Tablo_actionneur[i].Raz;
|
||||
EditTrain.Text:=s2;
|
||||
EditEtatActionneur.Text:=IntToSTR(etatAct);
|
||||
@@ -3016,8 +3138,27 @@ begin
|
||||
editEtatFoncSortie.Text:=intToSTR(sortie);
|
||||
editTempo.Text:=intToSTR(tempo);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
// Actionneur son
|
||||
if Tablo_actionneur[i].son then
|
||||
begin
|
||||
champs_type_son;
|
||||
etatAct:=Tablo_actionneur[i].etat ;
|
||||
Adresse:=Tablo_actionneur[i].adresse;
|
||||
s2:=Tablo_actionneur[i].train;
|
||||
s:=Tablo_actionneur[i].FichierSon;
|
||||
with formconfig do
|
||||
begin
|
||||
adr:=IntToSTR(Adresse); if det then adr:=adr+'Z';
|
||||
EditAct.text:=adr;
|
||||
//CheckRaz.Checked:=Tablo_actionneur[i].Raz;
|
||||
EditTrain.Text:=s2;
|
||||
EditSon.Text:=s;
|
||||
EditEtatActionneur.Text:=IntToSTR(etatAct);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
// affiche les champs de l'actionneur PN en fonction du tableau en fonction de l'index du richedit
|
||||
procedure aff_champs_PN(i : integer);
|
||||
@@ -3921,25 +4062,33 @@ end;
|
||||
|
||||
|
||||
procedure TFormConfig.EditActChange(Sender: TObject);
|
||||
var s : string;
|
||||
var s,s2 : string;
|
||||
act,erreur : integer;
|
||||
det : boolean;
|
||||
begin
|
||||
if clicliste then exit;
|
||||
if affevt then affiche('Evt Edit act Change',clyellow);
|
||||
if FormConfig.PageControl.ActivePage=FormConfig.TabSheetAct then
|
||||
with Formconfig do
|
||||
begin
|
||||
begin
|
||||
s:=EditAct.Text;
|
||||
if radioButtonLoc.Checked or RadioButtonAccess.Checked then
|
||||
if radioButtonLoc.Checked or RadioButtonAccess.Checked or RadioButtonSon.Checked then
|
||||
begin
|
||||
Val(s,act,erreur);
|
||||
det:=s[erreur]='Z'; // si détecteur
|
||||
if det then s2:='Détecteur ' else s2:='Actionneur ';
|
||||
s2:=s2+intToSTR(act);
|
||||
EditAct.Hint:=s2;
|
||||
if det then delete(s,erreur,1);
|
||||
Val(s,act,erreur);
|
||||
if erreur<>0 then
|
||||
begin
|
||||
LabelInfo.caption:='Erreur adresse actionneur';exit
|
||||
end else LabelInfo.caption:=' ';
|
||||
|
||||
tablo_actionneur[ligneClicAct+1].actionneur:=act;
|
||||
s:=encode_act_loc(ligneClicAct+1);
|
||||
|
||||
tablo_actionneur[ligneClicAct+1].adresse:=act;
|
||||
tablo_actionneur[ligneClicAct+1].det:=det;
|
||||
s:=encode_act_loc_son(ligneClicAct+1);
|
||||
RichAct.Lines[ligneClicAct]:=s;
|
||||
end;
|
||||
end;
|
||||
@@ -3992,7 +4141,7 @@ begin
|
||||
end else LabelInfo.caption:=' ';
|
||||
|
||||
tablo_actionneur[ligneClicAct+1].etat:=etat;
|
||||
s:=encode_act_loc(ligneClicAct+1);
|
||||
s:=encode_act_loc_son(ligneClicAct+1);
|
||||
RichAct.Lines[ligneClicAct]:=s;
|
||||
end;
|
||||
end;
|
||||
@@ -4015,7 +4164,31 @@ begin
|
||||
end else LabelInfo.caption:=' ';
|
||||
|
||||
tablo_actionneur[ligneClicAct+1].train:=train;
|
||||
s:=encode_act_loc(ligneClicAct+1);
|
||||
s:=encode_act_loc_son(ligneClicAct+1);
|
||||
RichAct.Lines[ligneClicAct]:=s;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
procedure TFormConfig.EditSonChange(Sender: TObject);
|
||||
var s,fichier : string;
|
||||
begin
|
||||
if clicliste then exit;
|
||||
if affevt then affiche('Evt Edit NomFichier Change',clyellow);
|
||||
if FormConfig.PageControl.ActivePage=FormConfig.TabSheetAct then
|
||||
with Formconfig do
|
||||
begin
|
||||
if radioButtonLoc.Checked or RadioButtonAccess.Checked or RadioButtonSon.Checked then
|
||||
begin
|
||||
fichier:=EditSon.Text;
|
||||
if fichier='' then
|
||||
begin
|
||||
LabelInfo.caption:='Nom fichier vide';exit
|
||||
end else LabelInfo.caption:=' ';
|
||||
|
||||
tablo_actionneur[ligneClicAct+1].fichierSon:=fichier;
|
||||
s:=encode_act_loc_son(ligneClicAct+1);
|
||||
RichAct.Lines[ligneClicAct]:=s;
|
||||
end;
|
||||
end;
|
||||
@@ -4042,7 +4215,7 @@ begin
|
||||
if radioButtonLoc.Checked then tablo_actionneur[ligneClicAct+1].fonction:=fonction;
|
||||
if RadioButtonAccess.Checked then Tablo_Actionneur[ligneClicAct+1].accessoire:=fonction;
|
||||
|
||||
s:=encode_act_loc(ligneClicAct+1);
|
||||
s:=encode_act_loc_son(ligneClicAct+1);
|
||||
RichAct.Lines[ligneClicAct]:=s;
|
||||
end;
|
||||
end;
|
||||
@@ -4067,7 +4240,7 @@ begin
|
||||
end else LabelInfo.caption:=' ';
|
||||
|
||||
tablo_actionneur[ligneClicAct+1].sortie:=etat;
|
||||
s:=encode_act_loc(ligneClicAct+1);
|
||||
s:=encode_act_loc_son(ligneClicAct+1);
|
||||
RichAct.Lines[ligneClicAct]:=s;
|
||||
end;
|
||||
end;
|
||||
@@ -4092,7 +4265,7 @@ begin
|
||||
end else LabelInfo.caption:=' ';
|
||||
|
||||
tablo_actionneur[ligneClicAct+1].tempo:=tempo;
|
||||
s:=encode_act_loc(ligneClicAct+1);
|
||||
s:=encode_act_loc_son(ligneClicAct+1);
|
||||
RichAct.Lines[ligneClicAct]:=s;
|
||||
end;
|
||||
end;
|
||||
@@ -4109,7 +4282,7 @@ begin
|
||||
if radioButtonAccess.Checked then
|
||||
begin
|
||||
tablo_actionneur[ligneClicAct+1].raz:=CheckRAZ.checked;
|
||||
s:=encode_act_loc(ligneClicAct+1);
|
||||
s:=encode_act_loc_son(ligneClicAct+1);
|
||||
RichAct.Lines[ligneClicAct]:=s;
|
||||
end;
|
||||
end;
|
||||
@@ -4321,10 +4494,11 @@ begin
|
||||
|
||||
Tablo_Actionneur[i].loco:=true;
|
||||
Tablo_Actionneur[i].Act:=false;
|
||||
Tablo_Actionneur[i].Son:=false;
|
||||
champs_type_loco;
|
||||
|
||||
val(editact.Text,champ,erreur);
|
||||
Tablo_actionneur[i].actionneur:=champ ;
|
||||
Tablo_actionneur[i].adresse:=champ ;
|
||||
val(editEtatActionneur.Text,champ,erreur);
|
||||
Tablo_actionneur[i].etat:=champ;
|
||||
Tablo_actionneur[i].train:=editTrain.Text;
|
||||
@@ -4335,7 +4509,7 @@ begin
|
||||
val(editTempo.Text,champ,erreur);
|
||||
Tablo_actionneur[i].tempo:=champ;
|
||||
tablo_actionneur[i].Raz:=checkRaz.checked;
|
||||
s:=encode_act_loc(i);
|
||||
s:=encode_act_loc_son(i);
|
||||
RichAct.Lines[ligneClicAct]:=s;
|
||||
end;
|
||||
|
||||
@@ -4350,10 +4524,11 @@ begin
|
||||
|
||||
Tablo_Actionneur[i].loco:=false;
|
||||
Tablo_Actionneur[i].Act:=true;
|
||||
Tablo_Actionneur[i].Son:=false;
|
||||
champs_type_act;
|
||||
|
||||
val(editact.Text,champ,erreur);
|
||||
Tablo_actionneur[i].actionneur:=champ ;
|
||||
Tablo_actionneur[i].adresse:=champ ;
|
||||
val(editEtatActionneur.Text,champ,erreur);
|
||||
Tablo_actionneur[i].etat:=champ;
|
||||
Tablo_actionneur[i].train:=editTrain.Text;
|
||||
@@ -4364,7 +4539,39 @@ begin
|
||||
val(editTempo.Text,champ,erreur);
|
||||
Tablo_actionneur[i].tempo:=champ;
|
||||
tablo_actionneur[i].Raz:=checkRaz.checked;
|
||||
s:=encode_act_loc(i);
|
||||
s:=encode_act_loc_son(i);
|
||||
RichAct.Lines[ligneClicAct]:=s;
|
||||
end;
|
||||
|
||||
|
||||
procedure TFormConfig.RadioButtonSonClick(Sender: TObject);
|
||||
var champ,i,erreur : integer;
|
||||
s : string;
|
||||
begin
|
||||
// rendre visible le groupbox Actionneur fonction F loco
|
||||
if clicListe then exit;
|
||||
i:=ligneClicAct+1;
|
||||
if AffEvt then Affiche('RadioSon '+IntToSTR(i),clyellow);
|
||||
|
||||
Tablo_Actionneur[i].loco:=false;
|
||||
Tablo_Actionneur[i].Act:=false;
|
||||
Tablo_Actionneur[i].Son:=true;
|
||||
|
||||
champs_type_son;
|
||||
|
||||
val(editact.Text,champ,erreur);
|
||||
Tablo_actionneur[i].adresse:=champ ;
|
||||
val(editEtatActionneur.Text,champ,erreur);
|
||||
Tablo_actionneur[i].etat:=champ;
|
||||
Tablo_actionneur[i].train:=editTrain.Text;
|
||||
val(editFonctionAccess.Text,champ,erreur);
|
||||
Tablo_actionneur[i].fonction:=champ;
|
||||
val(editEtatFoncSortie.Text,champ,erreur);
|
||||
Tablo_actionneur[i].sortie:=champ;
|
||||
val(editTempo.Text,champ,erreur);
|
||||
Tablo_actionneur[i].tempo:=champ;
|
||||
tablo_actionneur[i].Raz:=checkRaz.checked;
|
||||
s:=encode_act_loc_son(i);
|
||||
RichAct.Lines[ligneClicAct]:=s;
|
||||
end;
|
||||
|
||||
@@ -4654,7 +4861,7 @@ begin
|
||||
Tablo_actionneur[maxtablo_act].act:=false;
|
||||
Tablo_actionneur[maxtablo_act].loco:=true;
|
||||
|
||||
s:=encode_act_loc(i);
|
||||
s:=encode_act_loc_son(i);
|
||||
if ligneClicAct<>-1 then RE_ColorLine(RichAct,ligneClicAct,ClAqua);
|
||||
|
||||
// ajouter et scroller en fin
|
||||
@@ -4718,7 +4925,7 @@ begin
|
||||
if (i=-1) then exit;
|
||||
index:=i+1; // passe en index tableau
|
||||
|
||||
adr:=tablo_actionneur[index].actionneur;
|
||||
adr:=tablo_actionneur[index].adresse;
|
||||
s:='Voulez-vous supprimer l''actionneur '+IntToSTR(adr)+'?';
|
||||
if Application.MessageBox(pchar(s),pchar('confirm'), MB_YESNO or MB_DEFBUTTON2 or MB_ICONQUESTION)=idNo then exit;
|
||||
Affiche('Suppression de l''actionneur index='+IntToSTR(index)+' adresse='+IntToSTR(adr),clOrange);
|
||||
@@ -4738,7 +4945,7 @@ begin
|
||||
RichAct.Clear;
|
||||
for i:=1 to maxTablo_act do
|
||||
begin
|
||||
s:=encode_act_loc(i);
|
||||
s:=encode_act_loc_son(i);
|
||||
if s<>'' then
|
||||
begin
|
||||
RichAct.Lines.Add(s);
|
||||
@@ -5270,6 +5477,7 @@ begin
|
||||
aiguillage[i].modele:=aig;
|
||||
aiguillage[i].AdroitB:='Z'; aiguillage[i].AdevieB:='Z';
|
||||
aiguillage[i].DdroitB:='D'; aiguillage[i].DdevieB:='S'; // préparation pour TJD/S
|
||||
aiguillage[i].EtatTJD:=4;
|
||||
aiguillage[i].ApointeB:='Z';
|
||||
aiguillage[i].Adevie2B:='Z';
|
||||
aiguillage[i].tjsintB:='D';
|
||||
@@ -6235,8 +6443,16 @@ begin
|
||||
Label20.Visible:=false;
|
||||
end;
|
||||
|
||||
begin
|
||||
|
||||
procedure TFormConfig.SpeedButtonJoueClick(Sender: TObject);
|
||||
begin
|
||||
if sndPlaySound(pchar(EditSon.Text),0)=false then
|
||||
labelInfo.Caption:='Erreur';
|
||||
|
||||
end;
|
||||
|
||||
|
||||
begin
|
||||
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
+21
-3
@@ -501,7 +501,7 @@ object FormDebug: TFormDebug
|
||||
object EditSimuDet: TEdit
|
||||
Left = 8
|
||||
Top = 16
|
||||
Width = 73
|
||||
Width = 41
|
||||
Height = 21
|
||||
Hint = 'Adresse d'#39'un d'#233'tecteur'
|
||||
ParentShowHint = False
|
||||
@@ -509,7 +509,7 @@ object FormDebug: TFormDebug
|
||||
TabOrder = 0
|
||||
end
|
||||
object ButtonSimuDet0: TButton
|
||||
Left = 120
|
||||
Left = 48
|
||||
Top = 16
|
||||
Width = 75
|
||||
Height = 25
|
||||
@@ -518,7 +518,7 @@ object FormDebug: TFormDebug
|
||||
OnClick = ButtonSimuDet0Click
|
||||
end
|
||||
object ButtonSimuDet1: TButton
|
||||
Left = 232
|
||||
Left = 120
|
||||
Top = 16
|
||||
Width = 75
|
||||
Height = 25
|
||||
@@ -526,6 +526,24 @@ object FormDebug: TFormDebug
|
||||
TabOrder = 2
|
||||
OnClick = ButtonSimuDet1Click
|
||||
end
|
||||
object ButtonSimuAct0: TButton
|
||||
Left = 192
|
||||
Top = 16
|
||||
Width = 75
|
||||
Height = 25
|
||||
Caption = 'Actionneur '#224' 0'
|
||||
TabOrder = 3
|
||||
OnClick = ButtonSimuAct0Click
|
||||
end
|
||||
object ButtonSimuAct1: TButton
|
||||
Left = 264
|
||||
Top = 16
|
||||
Width = 75
|
||||
Height = 25
|
||||
Caption = 'Actionneur '#224' 1'
|
||||
TabOrder = 4
|
||||
OnClick = ButtonSimuAct1Click
|
||||
end
|
||||
end
|
||||
object ButtonRazTout: TButton
|
||||
Left = 488
|
||||
|
||||
@@ -52,6 +52,8 @@ type
|
||||
ButtonRazTout: TButton;
|
||||
EditDebugSignal: TEdit;
|
||||
CheckBoxTiers: TCheckBox;
|
||||
ButtonSimuAct0: TButton;
|
||||
ButtonSimuAct1: TButton;
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure ButtonEcrLogClick(Sender: TObject);
|
||||
procedure EditNivDebugKeyPress(Sender: TObject; var Key: Char);
|
||||
@@ -82,6 +84,8 @@ type
|
||||
procedure MemoEvtDetChange(Sender: TObject);
|
||||
procedure EditDebugSignalChange(Sender: TObject);
|
||||
procedure CheckBoxTiersClick(Sender: TObject);
|
||||
procedure ButtonSimuAct1Click(Sender: TObject);
|
||||
procedure ButtonSimuAct0Click(Sender: TObject);
|
||||
private
|
||||
{ Déclarations privées }
|
||||
public
|
||||
@@ -441,6 +445,27 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
procedure TFormDebug.ButtonSimuAct1Click(Sender: TObject);
|
||||
var det,erreur : integer;
|
||||
begin
|
||||
val(EditSimuDet.Text,det,erreur);
|
||||
if erreur=0 then
|
||||
begin
|
||||
Event_Act(det,1,'');
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TFormDebug.ButtonSimuAct0Click(Sender: TObject);
|
||||
var det,erreur : integer;
|
||||
begin
|
||||
val(EditSimuDet.Text,det,erreur);
|
||||
if erreur=0 then
|
||||
begin
|
||||
Event_Act(det,0,'');
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TFormDebug.ButtonRazToutClick(Sender: TObject);
|
||||
begin
|
||||
Raz_tout;
|
||||
@@ -467,4 +492,9 @@ begin
|
||||
AffTiers:=checkBoxTiers.checked;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
end.
|
||||
|
||||
Binary file not shown.
+3
-3
@@ -1,6 +1,6 @@
|
||||
object FormPrinc: TFormPrinc
|
||||
Left = 60
|
||||
Top = 181
|
||||
Left = 82
|
||||
Top = 118
|
||||
Width = 1212
|
||||
Height = 664
|
||||
Caption = 'Client TCP-IP CDM Rail ou USB - syst'#232'me LENZ'
|
||||
@@ -1560,7 +1560,7 @@ object FormPrinc: TFormPrinc
|
||||
Caption = 'Interface'
|
||||
object MenuConnecterUSB: TMenuItem
|
||||
Caption = 'Connecter l'#39'interface XpressNet en USB'
|
||||
Hint = 'Connecter l'#39'interface en USB'
|
||||
Hint = 'Connecter l'#39'interface en USB (mode autonome)'
|
||||
OnClick = MenuConnecterUSBClick
|
||||
end
|
||||
object DeconnecterUSB: TMenuItem
|
||||
|
||||
+61
-33
@@ -16,7 +16,7 @@ interface
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, StdCtrls, OleCtrls, ExtCtrls, jpeg, ComCtrls, ShellAPI, TlHelp32,
|
||||
ImgList, ScktComp, StrUtils, Menus, ActnList, MSCommLib_TLB ;
|
||||
ImgList, ScktComp, StrUtils, Menus, ActnList, MSCommLib_TLB, MMSystem ;
|
||||
|
||||
type
|
||||
TFormPrinc = class(TForm)
|
||||
@@ -320,11 +320,12 @@ var
|
||||
MemZone : array[0..1024,0..1024] of boolean ; // mémoires de zones des détecteurs
|
||||
Tablo_actionneur : array[1..100] of
|
||||
record
|
||||
loco,act : boolean; // type loco ou actionneur
|
||||
actionneur,etat,fonction,tempo,
|
||||
loco,act,son : boolean; // type loco actionneur ou son
|
||||
adresse,etat,fonction,tempo,
|
||||
accessoire,sortie : integer;
|
||||
Raz : boolean;
|
||||
train : string;
|
||||
det : boolean; // désigne un détecteur
|
||||
FichierSon,train : string;
|
||||
end;
|
||||
KeyInputs: array of TInput;
|
||||
Tablo_PN : array[1..20] of
|
||||
@@ -395,6 +396,7 @@ function PresTrainPrec(AdrFeu : integer) : boolean;
|
||||
function cond_carre(adresse : integer) : boolean;
|
||||
function carre_signal(adresse : integer) : boolean;
|
||||
procedure Event_Detecteur(Adresse : integer;etat : boolean;train : string);
|
||||
procedure Event_act(adr,etat : integer;train : string);
|
||||
function verif_UniSemaf(adresse,UniSem : integer) : integer;
|
||||
function Select_dessin_feu(TypeFeu : integer) : TBitmap;
|
||||
procedure cree_image(rang : integer);
|
||||
@@ -1251,7 +1253,7 @@ begin
|
||||
P_image_pilote:=Sender as TImage; // récupérer l'objet image de la forme pilote
|
||||
s:=P_Image_pilote.Hint;
|
||||
//Affiche(s,clyellow);
|
||||
i:=pos('@',s); if i<>0 then delete(s,i,1);
|
||||
i:=pos('@',s); if i<>0 then delete(s,1,i);
|
||||
i:=pos('=',s); if i<>0 then delete(s,i,1);
|
||||
i:=pos(' ',s);
|
||||
if i<>0 then s:=copy(s,1,i-1);
|
||||
@@ -4785,40 +4787,51 @@ end;
|
||||
// traitement des évènements actionneurs
|
||||
procedure Event_act(adr,etat : integer;train : string);
|
||||
var i,v,va,etatAct,Af,Ao,Access,sortie : integer;
|
||||
s : string;
|
||||
s,st : 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);
|
||||
|
||||
if AffActionneur then AfficheDebug('Act/Det '+intToSTR(Adr)+'='+intToSTR(etat),clyellow);
|
||||
|
||||
for i:=1 to maxTablo_act do
|
||||
begin
|
||||
s:=Tablo_actionneur[i].train;
|
||||
etatAct:=Tablo_actionneur[i].etat ;
|
||||
if Tablo_actionneur[i].det then st:='Détecteur ' else st:='Actionneur ';
|
||||
|
||||
// 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
|
||||
if (Tablo_actionneur[i].adresse=adr) and (Tablo_actionneur[i].loco) 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
|
||||
Affiche(st+intToSTR(adr)+' Train='+train+' F'+IntToSTR(Tablo_actionneur[i].fonction)+':'+intToSTR(etat),clyellow);
|
||||
// exécution de 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
|
||||
if (Tablo_actionneur[i].adresse=adr) and (Tablo_actionneur[i].act) 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);
|
||||
|
||||
Affiche(st+intToSTR(adr)+' Train='+train+' Accessoire '+IntToSTR(access)+':'+intToSTR(sortie),clyellow);
|
||||
// exécution la fonction accessoire vers CDM
|
||||
if Tablo_actionneur[i].RAZ then Ts:=aigP else Ts:=Feu;
|
||||
pilote_acc(access,sortie,Ts); // sans RAZ
|
||||
RangActCours:=i;
|
||||
RangActCours:=i;
|
||||
end;
|
||||
|
||||
// actionneur pour son
|
||||
if (Tablo_actionneur[i].adresse=adr) and (Tablo_actionneur[i].Son) and ((s=train) or (s='X')) and (etatAct=etat)
|
||||
then
|
||||
begin
|
||||
Affiche(st+intToSTR(adr)+' Train='+train+' son '+Tablo_actionneur[i].FichierSon,clyellow);
|
||||
sndPlaySound(pchar(Tablo_actionneur[i].FichierSon),SND_ASYNC);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
// dans le tableau des PN
|
||||
for i:=1 to NbrePN do
|
||||
begin
|
||||
@@ -4869,7 +4882,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
// traitement sur les évènements détecteurs
|
||||
// traitement sur les évènements détecteurs
|
||||
procedure Event_Detecteur(Adresse : integer;etat : boolean;train : string);
|
||||
var i,AdrSuiv,AdrFeu,AdrDetfeu,index,Etat01,AdrPrec : integer;
|
||||
typeSuiv : tequipement;
|
||||
@@ -4896,8 +4909,8 @@ begin
|
||||
s:='Tick='+IntToSTR(tick)+' Evt Det='+IntToSTR(adresse)+'='+intToSTR(etat01);
|
||||
Affiche(s,clyellow);
|
||||
if not(TraceListe) then AfficheDebug(s,clyellow);
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
ancien_detecteur[Adresse]:=detecteur[Adresse].etat;
|
||||
detecteur[Adresse].etat:=etat;
|
||||
detecteur[Adresse].train:=train;
|
||||
@@ -4921,6 +4934,7 @@ begin
|
||||
begin
|
||||
// explorer les feux pour déverrouiller les feux dont le trajets viennent d'un buttoir pour changer le feu qd un train se présente
|
||||
// sur le détecteur
|
||||
if not(confignulle) then
|
||||
for i:=1 to NbreFeux do
|
||||
begin
|
||||
AdrFeu:=Feux[i].Adresse;
|
||||
@@ -4939,6 +4953,9 @@ begin
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
// gérer l'évènement detecteur pour action
|
||||
if etat then i:=1 else i:=0;
|
||||
event_act(Adresse,i,train);
|
||||
end;
|
||||
|
||||
// détection fronts descendants
|
||||
@@ -4967,7 +4984,10 @@ begin
|
||||
end;
|
||||
end;
|
||||
premierFD:=True;
|
||||
calcul_zones;
|
||||
// gérer l'évènement detecteur pour action
|
||||
if etat then i:=1 else i:=0;
|
||||
event_act(Adresse,i,train);
|
||||
if not(confignulle) then calcul_zones;
|
||||
end;
|
||||
end;
|
||||
|
||||
@@ -5041,7 +5061,7 @@ begin
|
||||
if AvecTCO then formTCO.Maj_TCO(Adresse);
|
||||
|
||||
// l'évaluation des routes est à faire selon conditions
|
||||
if faire_event then evalue;
|
||||
if faire_event and not(confignulle) then evalue;
|
||||
end;
|
||||
|
||||
// pilote une sortie à 0 dont l'adresse est à octet
|
||||
@@ -5662,22 +5682,21 @@ begin
|
||||
exit;
|
||||
end;
|
||||
|
||||
Affiche('Lancement de CDM '+lay,clyellow);
|
||||
|
||||
cdm_lanceLoc:=false;
|
||||
// lancement depuis le répertoire 32 bits d'un OS64
|
||||
if ShellExecute(Formprinc.Handle,'open',PChar('C:\Program Files (x86)\CDM-Rail\cdr.exe'),
|
||||
Pchar('-f '+lay), // paramètre
|
||||
PChar('C:\Program Files (x86)\CDM-Rail\') // répertoire
|
||||
,SW_SHOWNORMAL)>32 then
|
||||
,SW_SHOWNORMAL)>32 then
|
||||
begin
|
||||
cdm_lanceLoc:=true;
|
||||
//Affiche('lancé1',clyellow);
|
||||
end;
|
||||
Affiche('Lancement de CDM 64 '+lay,clyellow);
|
||||
end;
|
||||
|
||||
if not(cdm_lanceLoc) then
|
||||
begin
|
||||
// si çà marche pas essayer depuis le répertoire de base sur un OS32
|
||||
Affiche('2eme lancement',clyellow);
|
||||
if ShellExecute(Formprinc.Handle,
|
||||
'open',PChar('C:\Program Files\CDM-Rail\cdr.exe'),
|
||||
Pchar('-f '+lay), // paramètre
|
||||
@@ -5687,7 +5706,8 @@ begin
|
||||
ShowMessage('répertoire CDM rail introuvable');
|
||||
lance_CDM:=false;exit;
|
||||
end;
|
||||
cdm_lanceLoc:=false;
|
||||
cdm_lanceLoc:=true;
|
||||
Affiche('Lancement de CDM 32 '+lay,clyellow);
|
||||
end;
|
||||
|
||||
if cdm_lanceLoc then
|
||||
@@ -6113,7 +6133,7 @@ begin
|
||||
dec(tempoAct);
|
||||
if tempoAct=0 then
|
||||
begin
|
||||
A:=Tablo_actionneur[RangActCours].actionneur;
|
||||
A:=Tablo_actionneur[RangActCours].adresse;
|
||||
s:=Tablo_actionneur[RangActCours].train;
|
||||
Affiche('Actionneur '+intToSTR(a)+' F'+IntToSTR(Tablo_actionneur[RangActCours].fonction)+':0',clyellow);
|
||||
envoie_fonction_CDM(Tablo_actionneur[RangActCours].fonction,0,s);
|
||||
@@ -7072,6 +7092,7 @@ end;
|
||||
|
||||
procedure TFormPrinc.Codificationdesactionneurs1Click(Sender: TObject);
|
||||
var i,adract,etatAct,fonction,v,acc,sortie : integer;
|
||||
son : boolean;
|
||||
s,s2 : string;
|
||||
begin
|
||||
if (maxTablo_act=0) and (NbrePN=0) then
|
||||
@@ -7085,20 +7106,24 @@ begin
|
||||
begin
|
||||
s:=Tablo_actionneur[i].train;
|
||||
etatAct:=Tablo_actionneur[i].etat ;
|
||||
AdrAct:=Tablo_actionneur[i].actionneur;
|
||||
AdrAct:=Tablo_actionneur[i].adresse;
|
||||
s2:=Tablo_actionneur[i].train;
|
||||
acc:=Tablo_actionneur[i].accessoire;
|
||||
sortie:=Tablo_actionneur[i].sortie;
|
||||
fonction:=Tablo_actionneur[i].fonction;
|
||||
son:=Tablo_actionneur[i].son;
|
||||
if (s2<>'') then
|
||||
begin
|
||||
if fonction<>0 then
|
||||
s:='FonctionF Actionneur='+intToSTR(adrAct)+':'+intToSTR(etatAct)+' Train='+s2+' F'+IntToSTR(fonction)+
|
||||
s:='FonctionF Déclencheur='+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)+
|
||||
if acc<>0 then
|
||||
s:='Accessoire Déclencheur='+intToSTR(adrAct)+':'+intToSTR(etatAct)+' Train='+s2+' A'+IntToSTR(acc)+
|
||||
' sortie='+intToSTR(sortie);
|
||||
Affiche(s,clYellow);
|
||||
if son then
|
||||
s:='Son Déclencheur='+intToSTR(adrAct)+':'+intToSTR(etatAct)+' Train='+s2+' Fichier:'+ Tablo_actionneur[i].FichierSon;
|
||||
|
||||
Affiche(s,clYellow);
|
||||
end;
|
||||
end;
|
||||
|
||||
@@ -7235,5 +7260,8 @@ begin
|
||||
if verif_coherence then affiche('La configuration est cohérente',clLime);
|
||||
end;
|
||||
|
||||
|
||||
|
||||
begin
|
||||
|
||||
end.
|
||||
|
||||
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1
-1
@@ -23,7 +23,7 @@ var
|
||||
Lance_verif : integer;
|
||||
verifVersion,notificationVersion : boolean;
|
||||
|
||||
Const Version='3.4'; // sert à la comparaison de la version publiée
|
||||
Const Version='3.5'; // sert à la comparaison de la version publiée
|
||||
SousVersion=' '; // en cas d'absence de sous version mettre un espace
|
||||
|
||||
implementation
|
||||
|
||||
@@ -69,6 +69,12 @@ version 3.3 : Gestion du d
|
||||
version 3.31 : correction d'un bug sur les suppressions de feux et rajout de feux
|
||||
version 3.4 : fusion des fichiers de configurations en un feul fichier : ConfigGenerale.cfg
|
||||
Intégration des TJD à 2 états.
|
||||
version 3.5 : Les actions "fonctions F, accessoires, sons" sur actionneurs sont possibles depuis les détecteurs.
|
||||
Possibilité de jouer des sons sur un évènement actionneur/détecteur.
|
||||
Correction d'un bug sur le lancement de CDM en 32 bits.
|
||||
Correction des messages d'erreurs et de nombre de trains en mode "config nulle".
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user