V3.5
This commit is contained in:
1 parent
c85bf9564d
commit
68e87e9ec8
17 files changed
+464
-113
No files matched your search
BIN
Binary file not shown.
@@ -31,5 +31,5 @@
|
|||||||
-M
|
-M
|
||||||
-$M16384,1048576
|
-$M16384,1048576
|
||||||
-K$00400000
|
-K$00400000
|
||||||
-LE"c:\program files (x86)\borland\delphi7\Projects\Bpl"
|
-LE"c:\program files\borland\delphi7\Projects\Bpl"
|
||||||
-LN"c:\program files (x86)\borland\delphi7\Projects\Bpl"
|
-LN"c:\program files\borland\delphi7\Projects\Bpl"
|
||||||
@@ -10,7 +10,7 @@ uses
|
|||||||
UnitTCO in 'UnitTCO.pas' {FormTCO},
|
UnitTCO in 'UnitTCO.pas' {FormTCO},
|
||||||
UnitConfig in 'UnitConfig.pas' {FormConfig},
|
UnitConfig in 'UnitConfig.pas' {FormConfig},
|
||||||
UnitConfigTCO in 'UnitConfigTCO.pas' {FormConfigTCO},
|
UnitConfigTCO in 'UnitConfigTCO.pas' {FormConfigTCO},
|
||||||
UnitSR in '..\macro fichier\UnitSR.pas' {FormSR};
|
UnitSR in 'UnitSR.pas' {FormSR};
|
||||||
|
|
||||||
{$R *.res}
|
{$R *.res}
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
+78
-25
@@ -1,6 +1,6 @@
|
|||||||
object FormConfig: TFormConfig
|
object FormConfig: TFormConfig
|
||||||
Left = 268
|
Left = 281
|
||||||
Top = 207
|
Top = 124
|
||||||
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'
|
||||||
@@ -1578,7 +1578,7 @@ object FormConfig: TFormConfig
|
|||||||
Top = 8
|
Top = 8
|
||||||
Width = 633
|
Width = 633
|
||||||
Height = 457
|
Height = 457
|
||||||
ActivePage = TabSheetAig
|
ActivePage = TabSheetCDM
|
||||||
Font.Charset = DEFAULT_CHARSET
|
Font.Charset = DEFAULT_CHARSET
|
||||||
Font.Color = clBlack
|
Font.Color = clBlack
|
||||||
Font.Height = -11
|
Font.Height = -11
|
||||||
@@ -2581,7 +2581,10 @@ object FormConfig: TFormConfig
|
|||||||
Top = 24
|
Top = 24
|
||||||
Width = 65
|
Width = 65
|
||||||
Height = 17
|
Height = 17
|
||||||
|
Hint = 'TJD '#224' 1 moteur'
|
||||||
Caption = '2 '#233'tats'
|
Caption = '2 '#233'tats'
|
||||||
|
ParentShowHint = False
|
||||||
|
ShowHint = True
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
OnClick = RadioButtonTJD2Click
|
OnClick = RadioButtonTJD2Click
|
||||||
end
|
end
|
||||||
@@ -2590,7 +2593,10 @@ object FormConfig: TFormConfig
|
|||||||
Top = 40
|
Top = 40
|
||||||
Width = 65
|
Width = 65
|
||||||
Height = 17
|
Height = 17
|
||||||
|
Hint = 'TJD '#224' 2 moteurs'
|
||||||
Caption = '4 '#233'tats'
|
Caption = '4 '#233'tats'
|
||||||
|
ParentShowHint = False
|
||||||
|
ShowHint = True
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
OnClick = RadioButtonTJD4Click
|
OnClick = RadioButtonTJD4Click
|
||||||
end
|
end
|
||||||
@@ -2876,7 +2882,7 @@ object FormConfig: TFormConfig
|
|||||||
Top = 48
|
Top = 48
|
||||||
Width = 129
|
Width = 129
|
||||||
Height = 21
|
Height = 21
|
||||||
ItemHeight = 0
|
ItemHeight = 13
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
OnChange = ComboBoxDecChange
|
OnChange = ComboBoxDecChange
|
||||||
end
|
end
|
||||||
@@ -3085,7 +3091,7 @@ object FormConfig: TFormConfig
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
object TabSheetAct: TTabSheet
|
object TabSheetAct: TTabSheet
|
||||||
Caption = 'Actionneurs'
|
Caption = 'Actionneurs/D'#233'tecteurs'
|
||||||
ImageIndex = 5
|
ImageIndex = 5
|
||||||
object Label16: TLabel
|
object Label16: TLabel
|
||||||
Left = 0
|
Left = 0
|
||||||
@@ -3105,12 +3111,12 @@ object FormConfig: TFormConfig
|
|||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
object Label40: TLabel
|
object Label40: TLabel
|
||||||
Left = 16
|
Left = 16
|
||||||
Top = 344
|
Top = 328
|
||||||
Width = 222
|
Width = 222
|
||||||
Height = 26
|
Height = 39
|
||||||
Caption =
|
Caption =
|
||||||
'Les actionneurs ne sont utilisables qu'#39'en mode connect'#233' avec CDM' +
|
'Les actionneurs ne sont utilisables qu'#39'en mode RUN avec CDM Rail' +
|
||||||
' Rail'
|
'. Les d'#233'tecteurs sont utilisables en mode autonome.'
|
||||||
WordWrap = True
|
WordWrap = True
|
||||||
end
|
end
|
||||||
object GroupBoxPN: TGroupBox
|
object GroupBoxPN: TGroupBox
|
||||||
@@ -3283,9 +3289,9 @@ object FormConfig: TFormConfig
|
|||||||
end
|
end
|
||||||
object GroupBoxRadio: TGroupBox
|
object GroupBoxRadio: TGroupBox
|
||||||
Left = 16
|
Left = 16
|
||||||
Top = 40
|
Top = 24
|
||||||
Width = 225
|
Width = 225
|
||||||
Height = 65
|
Height = 81
|
||||||
Caption = 'Type d'#39'actionneur '
|
Caption = 'Type d'#39'actionneur '
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
object RadioButtonLoc: TRadioButton
|
object RadioButtonLoc: TRadioButton
|
||||||
@@ -3306,10 +3312,19 @@ object FormConfig: TFormConfig
|
|||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
OnClick = RadioButtonAccessClick
|
OnClick = RadioButtonAccessClick
|
||||||
end
|
end
|
||||||
|
object RadioButtonSon: TRadioButton
|
||||||
|
Left = 24
|
||||||
|
Top = 56
|
||||||
|
Width = 161
|
||||||
|
Height = 17
|
||||||
|
Caption = 'Son'
|
||||||
|
TabOrder = 2
|
||||||
|
OnClick = RadioButtonSonClick
|
||||||
|
end
|
||||||
end
|
end
|
||||||
object GroupBoxAct: TGroupBox
|
object GroupBoxAct: TGroupBox
|
||||||
Left = 64
|
Left = 16
|
||||||
Top = 112
|
Top = 80
|
||||||
Width = 225
|
Width = 225
|
||||||
Height = 225
|
Height = 225
|
||||||
Caption = 'Actionneur fonction de locomotive '
|
Caption = 'Actionneur fonction de locomotive '
|
||||||
@@ -3322,14 +3337,15 @@ object FormConfig: TFormConfig
|
|||||||
Caption = 'D'#233'clencheur '
|
Caption = 'D'#233'clencheur '
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
object LabelActionneur: TLabel
|
object LabelActionneur: TLabel
|
||||||
Left = 32
|
Left = 16
|
||||||
Top = 24
|
Top = 16
|
||||||
Width = 51
|
Width = 54
|
||||||
Height = 13
|
Height = 26
|
||||||
Caption = 'Actionneur'
|
Caption = 'Actionneur D'#233'tecteurZ'
|
||||||
|
WordWrap = True
|
||||||
end
|
end
|
||||||
object Label30: TLabel
|
object Label30: TLabel
|
||||||
Left = 152
|
Left = 136
|
||||||
Top = 24
|
Top = 24
|
||||||
Width = 6
|
Width = 6
|
||||||
Height = 13
|
Height = 13
|
||||||
@@ -3337,23 +3353,25 @@ object FormConfig: TFormConfig
|
|||||||
end
|
end
|
||||||
object LabelTrain: TLabel
|
object LabelTrain: TLabel
|
||||||
Left = 56
|
Left = 56
|
||||||
Top = 46
|
Top = 54
|
||||||
Width = 24
|
Width = 24
|
||||||
Height = 13
|
Height = 13
|
||||||
Caption = 'Train'
|
Caption = 'Train'
|
||||||
end
|
end
|
||||||
object EditAct: TEdit
|
object EditAct: TEdit
|
||||||
Left = 96
|
Left = 88
|
||||||
Top = 20
|
Top = 20
|
||||||
Width = 49
|
Width = 41
|
||||||
Height = 21
|
Height = 21
|
||||||
|
ParentShowHint = False
|
||||||
|
ShowHint = True
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
OnChange = EditActChange
|
OnChange = EditActChange
|
||||||
end
|
end
|
||||||
object EditEtatActionneur: TEdit
|
object EditEtatActionneur: TEdit
|
||||||
Left = 168
|
Left = 152
|
||||||
Top = 20
|
Top = 20
|
||||||
Width = 25
|
Width = 17
|
||||||
Height = 21
|
Height = 21
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
OnChange = EditEtatActionneurChange
|
OnChange = EditEtatActionneurChange
|
||||||
@@ -3403,6 +3421,33 @@ object FormConfig: TFormConfig
|
|||||||
Height = 13
|
Height = 13
|
||||||
Caption = #224
|
Caption = #224
|
||||||
end
|
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
|
object EditTempo: TEdit
|
||||||
Left = 112
|
Left = 112
|
||||||
Top = 46
|
Top = 46
|
||||||
@@ -3439,6 +3484,14 @@ object FormConfig: TFormConfig
|
|||||||
TabOrder = 3
|
TabOrder = 3
|
||||||
OnChange = EditEtatFoncSortieChange
|
OnChange = EditEtatFoncSortieChange
|
||||||
end
|
end
|
||||||
|
object EditSon: TEdit
|
||||||
|
Left = 16
|
||||||
|
Top = 40
|
||||||
|
Width = 177
|
||||||
|
Height = 21
|
||||||
|
TabOrder = 4
|
||||||
|
OnChange = EditSonChange
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -3447,7 +3500,7 @@ object FormConfig: TFormConfig
|
|||||||
Top = 32
|
Top = 32
|
||||||
Width = 345
|
Width = 345
|
||||||
Height = 185
|
Height = 185
|
||||||
Caption = 'Actionneurs locomotives ou accessoires'
|
Caption = 'Actionneurs/d'#233'tecteurs locomotives ou accessoires'
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
object ButtonNouvAcc: TButton
|
object ButtonNouvAcc: TButton
|
||||||
Left = 8
|
Left = 8
|
||||||
|
|||||||
+272
-56
@@ -4,7 +4,8 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
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
|
type
|
||||||
TFormConfig = class(TForm)
|
TFormConfig = class(TForm)
|
||||||
@@ -233,6 +234,10 @@ type
|
|||||||
GroupBoxEtatTJD: TGroupBox;
|
GroupBoxEtatTJD: TGroupBox;
|
||||||
RadioButtonTJD2: TRadioButton;
|
RadioButtonTJD2: TRadioButton;
|
||||||
RadioButtonTJD4: TRadioButton;
|
RadioButtonTJD4: TRadioButton;
|
||||||
|
RadioButtonSon: TRadioButton;
|
||||||
|
EditSon: TEdit;
|
||||||
|
LabelNomSon: TLabel;
|
||||||
|
SpeedButtonJoue: TSpeedButton;
|
||||||
procedure ButtonAppliquerEtFermerClick(Sender: TObject);
|
procedure ButtonAppliquerEtFermerClick(Sender: TObject);
|
||||||
procedure FormActivate(Sender: TObject);
|
procedure FormActivate(Sender: TObject);
|
||||||
procedure FormCreate(Sender: TObject);
|
procedure FormCreate(Sender: TObject);
|
||||||
@@ -322,6 +327,9 @@ type
|
|||||||
procedure PageControlChange(Sender: TObject);
|
procedure PageControlChange(Sender: TObject);
|
||||||
procedure RadioButtonTJD2Click(Sender: TObject);
|
procedure RadioButtonTJD2Click(Sender: TObject);
|
||||||
procedure RadioButtonTJD4Click(Sender: TObject);
|
procedure RadioButtonTJD4Click(Sender: TObject);
|
||||||
|
procedure RadioButtonSonClick(Sender: TObject);
|
||||||
|
procedure EditSonChange(Sender: TObject);
|
||||||
|
procedure SpeedButtonJoueClick(Sender: TObject);
|
||||||
private
|
private
|
||||||
{ Déclarations privées }
|
{ Déclarations privées }
|
||||||
public
|
public
|
||||||
@@ -992,26 +1000,34 @@ begin
|
|||||||
end;
|
end;
|
||||||
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
|
// paramètre d'entrée : index
|
||||||
function encode_act_loc(i : integer): string;
|
function encode_act_loc_son(i : integer): string;
|
||||||
var s : string;
|
var s : string;
|
||||||
adresse : integer;
|
adresse : integer;
|
||||||
begin
|
begin
|
||||||
// adresse
|
// 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
|
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
|
if Tablo_Actionneur[i].act then
|
||||||
begin
|
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)+',';
|
',A'+IntToSTR(Tablo_Actionneur[i].accessoire)+','+intToSTR(Tablo_Actionneur[i].sortie)+',';
|
||||||
if Tablo_Actionneur[i].Raz then s:=s+'Z' else s:=s+'S';
|
if Tablo_Actionneur[i].Raz then s:=s+'Z' else s:=s+'S';
|
||||||
end;
|
end;
|
||||||
encode_act_loc:=s;
|
|
||||||
|
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;
|
end;
|
||||||
|
|
||||||
// encode l'actioneur PN du tableau en texte
|
// encode l'actionneur PN du tableau en texte
|
||||||
function encode_act_pn(i : integer) : string;
|
function encode_act_pn(i : integer) : string;
|
||||||
var s : string;
|
var s : string;
|
||||||
voie,NbVoies : integer;
|
voie,NbVoies : integer;
|
||||||
@@ -1183,7 +1199,7 @@ begin
|
|||||||
writeln(fichierN,section_act_ch);
|
writeln(fichierN,section_act_ch);
|
||||||
for i:=1 to maxTablo_act do
|
for i:=1 to maxTablo_act do
|
||||||
begin
|
begin
|
||||||
s:=encode_act_loc(i);
|
s:=encode_act_loc_son(i);
|
||||||
if s<>'' then writeln(fichierN,s);
|
if s<>'' then writeln(fichierN,s);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -1280,19 +1296,24 @@ begin
|
|||||||
begin
|
begin
|
||||||
Tablo_actionneur[i].train:='';
|
Tablo_actionneur[i].train:='';
|
||||||
Tablo_actionneur[i].etat:=0;
|
Tablo_actionneur[i].etat:=0;
|
||||||
Tablo_actionneur[i].actionneur:=0;
|
Tablo_actionneur[i].adresse:=0;
|
||||||
Tablo_actionneur[i].accessoire:=0;
|
Tablo_actionneur[i].accessoire:=0;
|
||||||
Tablo_actionneur[i].sortie:=0;
|
Tablo_actionneur[i].sortie:=0;
|
||||||
|
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;
|
end;
|
||||||
|
|
||||||
Affiche('Définition des actionneurs',clyellow);
|
Affiche('Définition des actionneurs/détecteurs',clyellow);
|
||||||
maxTablo_act:=1;
|
maxTablo_act:=1;
|
||||||
NbrePN:=0;Nligne:=1;
|
NbrePN:=0;Nligne:=1;
|
||||||
|
|
||||||
// définition des actionneurs
|
// définition des actionneurs
|
||||||
repeat
|
repeat
|
||||||
s:=lit_ligne;
|
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;
|
sa:=s; sOrigine:=s;
|
||||||
i:=pos(',',sa);
|
i:=pos(',',sa);
|
||||||
if i>0 then delete(sa,1,i) else s:='0';
|
if i>0 then delete(sa,1,i) else s:='0';
|
||||||
@@ -1303,17 +1324,53 @@ begin
|
|||||||
|
|
||||||
inc(Nligne);
|
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
|
if length(sa)>1 then if (sa[1]='A') then
|
||||||
// -----------------accessoire
|
// -----------------accessoire
|
||||||
begin
|
begin
|
||||||
Tablo_actionneur[maxtablo_act].act:=true;
|
Tablo_actionneur[maxtablo_act].act:=true;
|
||||||
|
Tablo_actionneur[maxtablo_act].son:=false;
|
||||||
Tablo_actionneur[maxtablo_act].loco:=false;
|
Tablo_actionneur[maxtablo_act].loco:=false;
|
||||||
|
|
||||||
i:=pos(',',s);
|
i:=pos(',',s);
|
||||||
if i<>0 then
|
if i<>0 then
|
||||||
begin
|
begin
|
||||||
val(copy(s,1,i-1),j,erreur);
|
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);
|
Delete(s,1,i);
|
||||||
i:=pos(',',s);
|
i:=pos(',',s);
|
||||||
if i<>0 then
|
if i<>0 then
|
||||||
@@ -1362,12 +1419,15 @@ begin
|
|||||||
begin
|
begin
|
||||||
Tablo_actionneur[maxtablo_act].act:=false;
|
Tablo_actionneur[maxtablo_act].act:=false;
|
||||||
Tablo_actionneur[maxtablo_act].loco:=true;
|
Tablo_actionneur[maxtablo_act].loco:=true;
|
||||||
|
Tablo_actionneur[maxtablo_act].son:=false;
|
||||||
|
|
||||||
// 815,1,CC406526,F2,450
|
// 815,1,CC406526,F2,450
|
||||||
i:=pos(',',s);
|
i:=pos(',',s);
|
||||||
if i<>0 then
|
if i<>0 then
|
||||||
begin
|
begin
|
||||||
val(copy(s,1,i-1),j,erreur);
|
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);
|
Delete(s,1,i);
|
||||||
i:=pos(',',s);
|
i:=pos(',',s);
|
||||||
if i<>0 then
|
if i<>0 then
|
||||||
@@ -1948,27 +2008,35 @@ begin
|
|||||||
|
|
||||||
// section aiguillages
|
// section aiguillages
|
||||||
sa:=uppercase(section_aig_ch);
|
sa:=uppercase(section_aig_ch);
|
||||||
i:=pos(sa,s);
|
if pos(sa,s)<>0 then
|
||||||
trouve_section_aig:=i<>0;
|
begin
|
||||||
if trouve_section_aig then compile_aiguillages;
|
trouve_section_aig:=true;
|
||||||
|
compile_aiguillages;
|
||||||
|
end;
|
||||||
|
|
||||||
// section branche
|
// section branche
|
||||||
sa:=uppercase(section_branches_ch);
|
sa:=uppercase(section_branches_ch);
|
||||||
i:=pos(sa,s);
|
if pos(sa,s)<>0 then
|
||||||
trouve_section_branche:=i<>0;
|
begin
|
||||||
if trouve_section_branche then compile_branches;
|
trouve_section_branche:=true;
|
||||||
|
compile_branches;
|
||||||
|
end;
|
||||||
|
|
||||||
// section signaux
|
// section signaux
|
||||||
sa:=uppercase(section_sig_ch);
|
sa:=uppercase(section_sig_ch);
|
||||||
i:=pos(sa,s);
|
if pos(sa,s)<>0 then
|
||||||
trouve_section_sig:=i<>0;
|
begin
|
||||||
if trouve_section_sig then compile_signaux;
|
trouve_section_sig:=true;
|
||||||
|
compile_signaux;
|
||||||
|
end;
|
||||||
|
|
||||||
// section actionneurs
|
// section actionneurs
|
||||||
sa:=uppercase(section_act_ch);
|
sa:=uppercase(section_act_ch);
|
||||||
i:=pos(sa,s);
|
if pos(sa,s)<>0 then
|
||||||
trouve_section_act:=i<>0;
|
begin
|
||||||
if trouve_section_act then compile_actionneurs;
|
trouve_section_act:=true;
|
||||||
|
compile_actionneurs;
|
||||||
|
end;
|
||||||
|
|
||||||
inc(it);
|
inc(it);
|
||||||
|
|
||||||
@@ -2111,6 +2179,9 @@ begin
|
|||||||
if not(trouve_verif_version) then s:=verif_version_ch;
|
if not(trouve_verif_version) then s:=verif_version_ch;
|
||||||
if not(trouve_fonte) then s:=fonte_ch;
|
if not(trouve_fonte) then s:=fonte_ch;
|
||||||
if s<>'' then affiche('ERREUR: manque variables dans '+NomConfig+' :'+s,clred);
|
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;
|
verif_coherence;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -2472,7 +2543,7 @@ begin
|
|||||||
RichAct.Clear;
|
RichAct.Clear;
|
||||||
for i:=1 to maxTablo_act do
|
for i:=1 to maxTablo_act do
|
||||||
begin
|
begin
|
||||||
s:=encode_act_loc(i);
|
s:=encode_act_loc_son(i);
|
||||||
if s<>'' then
|
if s<>'' then
|
||||||
begin
|
begin
|
||||||
RichAct.Lines.Add(s);
|
RichAct.Lines.Add(s);
|
||||||
@@ -2764,6 +2835,10 @@ begin
|
|||||||
Visible:=true;
|
Visible:=true;
|
||||||
RadioButtonLoc.Checked:=false;
|
RadioButtonLoc.Checked:=false;
|
||||||
RadioButtonAccess.Checked:=false;
|
RadioButtonAccess.Checked:=false;
|
||||||
|
RadioButtonSon.Checked:=false;
|
||||||
|
EditSon.Visible:=false;
|
||||||
|
SpeedButtonJoue.Visible:=false;
|
||||||
|
LabelNomSon.Visible:=false;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -2779,11 +2854,17 @@ begin
|
|||||||
CheckRaz.Visible:=false;
|
CheckRaz.Visible:=false;
|
||||||
GroupBoxAct.Caption:='Actionneur de fonction F de locomotive';
|
GroupBoxAct.Caption:='Actionneur de fonction F de locomotive';
|
||||||
LabelTempo.Visible:=true; EditTempo.visible:=true; editEtatFoncSortie.visible:=false;LabelA.Visible:=false;
|
LabelTempo.Visible:=true; EditTempo.visible:=true; editEtatFoncSortie.visible:=false;LabelA.Visible:=false;
|
||||||
|
LabelFonction.visible:=true;
|
||||||
LabelFonction.caption:='Action : Fonction';
|
LabelFonction.caption:='Action : Fonction';
|
||||||
RadioButtonLoc.Checked:=true;
|
RadioButtonLoc.Checked:=true;
|
||||||
RadioButtonAccess.Checked:=false;
|
RadioButtonAccess.Checked:=false;
|
||||||
|
RadioButtonSon.Checked:=false;
|
||||||
GroupBoxAct.Visible:=true;
|
GroupBoxAct.Visible:=true;
|
||||||
GroupBoxPN.Visible:=false;
|
GroupBoxPN.Visible:=false;
|
||||||
|
EditSon.Visible:=false;
|
||||||
|
SpeedButtonJoue.Visible:=false;
|
||||||
|
EditFonctionAccess.Visible:=true;
|
||||||
|
LabelNomSon.Visible:=false;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -2799,11 +2880,49 @@ begin
|
|||||||
GroupBoxAct.Caption:='Actionneur d''accessoire';
|
GroupBoxAct.Caption:='Actionneur d''accessoire';
|
||||||
CheckRaz.Visible:=true;
|
CheckRaz.Visible:=true;
|
||||||
LabelTempo.Visible:=false; EditTempo.visible:=false;editEtatFoncSortie.visible:=true;LabelA.Visible:=true;
|
LabelTempo.Visible:=false; EditTempo.visible:=false;editEtatFoncSortie.visible:=true;LabelA.Visible:=true;
|
||||||
|
LabelFonction.visible:=true;
|
||||||
LabelFonction.caption:='Action : Accessoire';
|
LabelFonction.caption:='Action : Accessoire';
|
||||||
RadioButtonLoc.Checked:=false;
|
RadioButtonLoc.Checked:=false;
|
||||||
|
RadioButtonSon.checked:=false;
|
||||||
RadioButtonAccess.Checked:=true;
|
RadioButtonAccess.Checked:=true;
|
||||||
GroupBoxAct.Visible:=true;
|
GroupBoxAct.Visible:=true;
|
||||||
GroupBoxPN.Visible:=false;
|
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;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -2964,7 +3083,8 @@ end;
|
|||||||
// mise à jour des champs graphiques des actionneurs d'après l'index du richAct
|
// mise à jour des champs graphiques des actionneurs d'après l'index du richAct
|
||||||
Procedure aff_champs_act(i : integer);
|
Procedure aff_champs_act(i : integer);
|
||||||
var etatact, adresse,sortie,fonction,tempo,access : integer;
|
var etatact, adresse,sortie,fonction,tempo,access : integer;
|
||||||
s,s2 : string;
|
s,s2,adr : string;
|
||||||
|
det : boolean;
|
||||||
begin
|
begin
|
||||||
if affevt then affiche('Aff_champs_act('+intToSTR(i)+')',clyellow);
|
if affevt then affiche('Aff_champs_act('+intToSTR(i)+')',clyellow);
|
||||||
s:=Uppercase(FormConfig.RichAct.Lines[i]);
|
s:=Uppercase(FormConfig.RichAct.Lines[i]);
|
||||||
@@ -2973,21 +3093,24 @@ begin
|
|||||||
|
|
||||||
fonction:=Tablo_actionneur[i].fonction;
|
fonction:=Tablo_actionneur[i].fonction;
|
||||||
Access:=Tablo_actionneur[i].accessoire;
|
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
|
// Actionneur fonction F loco
|
||||||
if Tablo_actionneur[i].loco then
|
if Tablo_actionneur[i].loco then
|
||||||
begin
|
begin
|
||||||
Formconfig.radioButtonLoc.Checked:=true;
|
champs_type_loco;
|
||||||
Formconfig.radioButtonAccess.Checked:=false;
|
etatAct:=Tablo_actionneur[i].etat;
|
||||||
etatAct:=Tablo_actionneur[i].etat ;
|
Adresse:=Tablo_actionneur[i].adresse;
|
||||||
//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
|
||||||
champs_type_loco;
|
champs_type_loco;
|
||||||
EditAct.text:=IntToSTR(Adresse);
|
adr:=IntToSTR(Adresse); if det then adr:=adr+'Z';
|
||||||
|
EditAct.text:=adr;
|
||||||
editEtatActionneur.Text:=IntToSTR(etatAct);
|
editEtatActionneur.Text:=IntToSTR(etatAct);
|
||||||
EditTrain.Text:=s2;
|
EditTrain.Text:=s2;
|
||||||
editFonctionAccess.Text:=intToSTR(fonction);
|
editFonctionAccess.Text:=intToSTR(fonction);
|
||||||
@@ -2999,16 +3122,15 @@ begin
|
|||||||
if Tablo_actionneur[i].act then
|
if Tablo_actionneur[i].act then
|
||||||
begin
|
begin
|
||||||
champs_type_act;
|
champs_type_act;
|
||||||
Formconfig.radioButtonLoc.Checked:=false;
|
|
||||||
Formconfig.radioButtonAccess.Checked:=true;
|
|
||||||
etatAct:=Tablo_actionneur[i].etat ;
|
etatAct:=Tablo_actionneur[i].etat ;
|
||||||
Adresse:=Tablo_actionneur[i].actionneur;
|
Adresse:=Tablo_actionneur[i].adresse;
|
||||||
sortie:=Tablo_actionneur[i].sortie;
|
sortie:=Tablo_actionneur[i].sortie;
|
||||||
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
|
||||||
EditAct.text:=IntToSTR(Adresse);
|
adr:=IntToSTR(Adresse); if det then adr:=adr+'Z';
|
||||||
|
EditAct.text:=adr;
|
||||||
CheckRaz.Checked:=Tablo_actionneur[i].Raz;
|
CheckRaz.Checked:=Tablo_actionneur[i].Raz;
|
||||||
EditTrain.Text:=s2;
|
EditTrain.Text:=s2;
|
||||||
EditEtatActionneur.Text:=IntToSTR(etatAct);
|
EditEtatActionneur.Text:=IntToSTR(etatAct);
|
||||||
@@ -3017,6 +3139,25 @@ begin
|
|||||||
editTempo.Text:=intToSTR(tempo);
|
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;
|
end;
|
||||||
|
|
||||||
// affiche les champs de l'actionneur PN en fonction du tableau en fonction de l'index du richedit
|
// affiche les champs de l'actionneur PN en fonction du tableau en fonction de l'index du richedit
|
||||||
@@ -3921,8 +4062,9 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
procedure TFormConfig.EditActChange(Sender: TObject);
|
procedure TFormConfig.EditActChange(Sender: TObject);
|
||||||
var s : string;
|
var s,s2 : string;
|
||||||
act,erreur : integer;
|
act,erreur : integer;
|
||||||
|
det : boolean;
|
||||||
begin
|
begin
|
||||||
if clicliste then exit;
|
if clicliste then exit;
|
||||||
if affevt then affiche('Evt Edit act Change',clyellow);
|
if affevt then affiche('Evt Edit act Change',clyellow);
|
||||||
@@ -3930,16 +4072,23 @@ begin
|
|||||||
with Formconfig do
|
with Formconfig do
|
||||||
begin
|
begin
|
||||||
s:=EditAct.Text;
|
s:=EditAct.Text;
|
||||||
if radioButtonLoc.Checked or RadioButtonAccess.Checked then
|
if radioButtonLoc.Checked or RadioButtonAccess.Checked or RadioButtonSon.Checked then
|
||||||
begin
|
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);
|
Val(s,act,erreur);
|
||||||
if erreur<>0 then
|
if erreur<>0 then
|
||||||
begin
|
begin
|
||||||
LabelInfo.caption:='Erreur adresse actionneur';exit
|
LabelInfo.caption:='Erreur adresse actionneur';exit
|
||||||
end else LabelInfo.caption:=' ';
|
end else LabelInfo.caption:=' ';
|
||||||
|
|
||||||
tablo_actionneur[ligneClicAct+1].actionneur:=act;
|
tablo_actionneur[ligneClicAct+1].adresse:=act;
|
||||||
s:=encode_act_loc(ligneClicAct+1);
|
tablo_actionneur[ligneClicAct+1].det:=det;
|
||||||
|
s:=encode_act_loc_son(ligneClicAct+1);
|
||||||
RichAct.Lines[ligneClicAct]:=s;
|
RichAct.Lines[ligneClicAct]:=s;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@@ -3992,7 +4141,7 @@ begin
|
|||||||
end else LabelInfo.caption:=' ';
|
end else LabelInfo.caption:=' ';
|
||||||
|
|
||||||
tablo_actionneur[ligneClicAct+1].etat:=etat;
|
tablo_actionneur[ligneClicAct+1].etat:=etat;
|
||||||
s:=encode_act_loc(ligneClicAct+1);
|
s:=encode_act_loc_son(ligneClicAct+1);
|
||||||
RichAct.Lines[ligneClicAct]:=s;
|
RichAct.Lines[ligneClicAct]:=s;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@@ -4015,7 +4164,31 @@ begin
|
|||||||
end else LabelInfo.caption:=' ';
|
end else LabelInfo.caption:=' ';
|
||||||
|
|
||||||
tablo_actionneur[ligneClicAct+1].train:=train;
|
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;
|
RichAct.Lines[ligneClicAct]:=s;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@@ -4042,7 +4215,7 @@ begin
|
|||||||
if radioButtonLoc.Checked then tablo_actionneur[ligneClicAct+1].fonction:=fonction;
|
if radioButtonLoc.Checked then tablo_actionneur[ligneClicAct+1].fonction:=fonction;
|
||||||
if RadioButtonAccess.Checked then Tablo_Actionneur[ligneClicAct+1].accessoire:=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;
|
RichAct.Lines[ligneClicAct]:=s;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@@ -4067,7 +4240,7 @@ begin
|
|||||||
end else LabelInfo.caption:=' ';
|
end else LabelInfo.caption:=' ';
|
||||||
|
|
||||||
tablo_actionneur[ligneClicAct+1].sortie:=etat;
|
tablo_actionneur[ligneClicAct+1].sortie:=etat;
|
||||||
s:=encode_act_loc(ligneClicAct+1);
|
s:=encode_act_loc_son(ligneClicAct+1);
|
||||||
RichAct.Lines[ligneClicAct]:=s;
|
RichAct.Lines[ligneClicAct]:=s;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@@ -4092,7 +4265,7 @@ begin
|
|||||||
end else LabelInfo.caption:=' ';
|
end else LabelInfo.caption:=' ';
|
||||||
|
|
||||||
tablo_actionneur[ligneClicAct+1].tempo:=tempo;
|
tablo_actionneur[ligneClicAct+1].tempo:=tempo;
|
||||||
s:=encode_act_loc(ligneClicAct+1);
|
s:=encode_act_loc_son(ligneClicAct+1);
|
||||||
RichAct.Lines[ligneClicAct]:=s;
|
RichAct.Lines[ligneClicAct]:=s;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@@ -4109,7 +4282,7 @@ begin
|
|||||||
if radioButtonAccess.Checked then
|
if radioButtonAccess.Checked then
|
||||||
begin
|
begin
|
||||||
tablo_actionneur[ligneClicAct+1].raz:=CheckRAZ.checked;
|
tablo_actionneur[ligneClicAct+1].raz:=CheckRAZ.checked;
|
||||||
s:=encode_act_loc(ligneClicAct+1);
|
s:=encode_act_loc_son(ligneClicAct+1);
|
||||||
RichAct.Lines[ligneClicAct]:=s;
|
RichAct.Lines[ligneClicAct]:=s;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@@ -4321,10 +4494,11 @@ begin
|
|||||||
|
|
||||||
Tablo_Actionneur[i].loco:=true;
|
Tablo_Actionneur[i].loco:=true;
|
||||||
Tablo_Actionneur[i].Act:=false;
|
Tablo_Actionneur[i].Act:=false;
|
||||||
|
Tablo_Actionneur[i].Son:=false;
|
||||||
champs_type_loco;
|
champs_type_loco;
|
||||||
|
|
||||||
val(editact.Text,champ,erreur);
|
val(editact.Text,champ,erreur);
|
||||||
Tablo_actionneur[i].actionneur:=champ ;
|
Tablo_actionneur[i].adresse:=champ ;
|
||||||
val(editEtatActionneur.Text,champ,erreur);
|
val(editEtatActionneur.Text,champ,erreur);
|
||||||
Tablo_actionneur[i].etat:=champ;
|
Tablo_actionneur[i].etat:=champ;
|
||||||
Tablo_actionneur[i].train:=editTrain.Text;
|
Tablo_actionneur[i].train:=editTrain.Text;
|
||||||
@@ -4335,7 +4509,7 @@ begin
|
|||||||
val(editTempo.Text,champ,erreur);
|
val(editTempo.Text,champ,erreur);
|
||||||
Tablo_actionneur[i].tempo:=champ;
|
Tablo_actionneur[i].tempo:=champ;
|
||||||
tablo_actionneur[i].Raz:=checkRaz.checked;
|
tablo_actionneur[i].Raz:=checkRaz.checked;
|
||||||
s:=encode_act_loc(i);
|
s:=encode_act_loc_son(i);
|
||||||
RichAct.Lines[ligneClicAct]:=s;
|
RichAct.Lines[ligneClicAct]:=s;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -4350,10 +4524,11 @@ begin
|
|||||||
|
|
||||||
Tablo_Actionneur[i].loco:=false;
|
Tablo_Actionneur[i].loco:=false;
|
||||||
Tablo_Actionneur[i].Act:=true;
|
Tablo_Actionneur[i].Act:=true;
|
||||||
|
Tablo_Actionneur[i].Son:=false;
|
||||||
champs_type_act;
|
champs_type_act;
|
||||||
|
|
||||||
val(editact.Text,champ,erreur);
|
val(editact.Text,champ,erreur);
|
||||||
Tablo_actionneur[i].actionneur:=champ ;
|
Tablo_actionneur[i].adresse:=champ ;
|
||||||
val(editEtatActionneur.Text,champ,erreur);
|
val(editEtatActionneur.Text,champ,erreur);
|
||||||
Tablo_actionneur[i].etat:=champ;
|
Tablo_actionneur[i].etat:=champ;
|
||||||
Tablo_actionneur[i].train:=editTrain.Text;
|
Tablo_actionneur[i].train:=editTrain.Text;
|
||||||
@@ -4364,7 +4539,39 @@ begin
|
|||||||
val(editTempo.Text,champ,erreur);
|
val(editTempo.Text,champ,erreur);
|
||||||
Tablo_actionneur[i].tempo:=champ;
|
Tablo_actionneur[i].tempo:=champ;
|
||||||
tablo_actionneur[i].Raz:=checkRaz.checked;
|
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;
|
RichAct.Lines[ligneClicAct]:=s;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -4654,7 +4861,7 @@ begin
|
|||||||
Tablo_actionneur[maxtablo_act].act:=false;
|
Tablo_actionneur[maxtablo_act].act:=false;
|
||||||
Tablo_actionneur[maxtablo_act].loco:=true;
|
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);
|
if ligneClicAct<>-1 then RE_ColorLine(RichAct,ligneClicAct,ClAqua);
|
||||||
|
|
||||||
// ajouter et scroller en fin
|
// ajouter et scroller en fin
|
||||||
@@ -4718,7 +4925,7 @@ begin
|
|||||||
if (i=-1) then exit;
|
if (i=-1) then exit;
|
||||||
index:=i+1; // passe en index tableau
|
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)+'?';
|
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;
|
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);
|
Affiche('Suppression de l''actionneur index='+IntToSTR(index)+' adresse='+IntToSTR(adr),clOrange);
|
||||||
@@ -4738,7 +4945,7 @@ begin
|
|||||||
RichAct.Clear;
|
RichAct.Clear;
|
||||||
for i:=1 to maxTablo_act do
|
for i:=1 to maxTablo_act do
|
||||||
begin
|
begin
|
||||||
s:=encode_act_loc(i);
|
s:=encode_act_loc_son(i);
|
||||||
if s<>'' then
|
if s<>'' then
|
||||||
begin
|
begin
|
||||||
RichAct.Lines.Add(s);
|
RichAct.Lines.Add(s);
|
||||||
@@ -5270,6 +5477,7 @@ begin
|
|||||||
aiguillage[i].modele:=aig;
|
aiguillage[i].modele:=aig;
|
||||||
aiguillage[i].AdroitB:='Z'; aiguillage[i].AdevieB:='Z';
|
aiguillage[i].AdroitB:='Z'; aiguillage[i].AdevieB:='Z';
|
||||||
aiguillage[i].DdroitB:='D'; aiguillage[i].DdevieB:='S'; // préparation pour TJD/S
|
aiguillage[i].DdroitB:='D'; aiguillage[i].DdevieB:='S'; // préparation pour TJD/S
|
||||||
|
aiguillage[i].EtatTJD:=4;
|
||||||
aiguillage[i].ApointeB:='Z';
|
aiguillage[i].ApointeB:='Z';
|
||||||
aiguillage[i].Adevie2B:='Z';
|
aiguillage[i].Adevie2B:='Z';
|
||||||
aiguillage[i].tjsintB:='D';
|
aiguillage[i].tjsintB:='D';
|
||||||
@@ -6235,8 +6443,16 @@ begin
|
|||||||
Label20.Visible:=false;
|
Label20.Visible:=false;
|
||||||
end;
|
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
|
object EditSimuDet: TEdit
|
||||||
Left = 8
|
Left = 8
|
||||||
Top = 16
|
Top = 16
|
||||||
Width = 73
|
Width = 41
|
||||||
Height = 21
|
Height = 21
|
||||||
Hint = 'Adresse d'#39'un d'#233'tecteur'
|
Hint = 'Adresse d'#39'un d'#233'tecteur'
|
||||||
ParentShowHint = False
|
ParentShowHint = False
|
||||||
@@ -509,7 +509,7 @@ object FormDebug: TFormDebug
|
|||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
end
|
end
|
||||||
object ButtonSimuDet0: TButton
|
object ButtonSimuDet0: TButton
|
||||||
Left = 120
|
Left = 48
|
||||||
Top = 16
|
Top = 16
|
||||||
Width = 75
|
Width = 75
|
||||||
Height = 25
|
Height = 25
|
||||||
@@ -518,7 +518,7 @@ object FormDebug: TFormDebug
|
|||||||
OnClick = ButtonSimuDet0Click
|
OnClick = ButtonSimuDet0Click
|
||||||
end
|
end
|
||||||
object ButtonSimuDet1: TButton
|
object ButtonSimuDet1: TButton
|
||||||
Left = 232
|
Left = 120
|
||||||
Top = 16
|
Top = 16
|
||||||
Width = 75
|
Width = 75
|
||||||
Height = 25
|
Height = 25
|
||||||
@@ -526,6 +526,24 @@ object FormDebug: TFormDebug
|
|||||||
TabOrder = 2
|
TabOrder = 2
|
||||||
OnClick = ButtonSimuDet1Click
|
OnClick = ButtonSimuDet1Click
|
||||||
end
|
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
|
end
|
||||||
object ButtonRazTout: TButton
|
object ButtonRazTout: TButton
|
||||||
Left = 488
|
Left = 488
|
||||||
|
|||||||
@@ -52,6 +52,8 @@ type
|
|||||||
ButtonRazTout: TButton;
|
ButtonRazTout: TButton;
|
||||||
EditDebugSignal: TEdit;
|
EditDebugSignal: TEdit;
|
||||||
CheckBoxTiers: TCheckBox;
|
CheckBoxTiers: TCheckBox;
|
||||||
|
ButtonSimuAct0: TButton;
|
||||||
|
ButtonSimuAct1: TButton;
|
||||||
procedure FormCreate(Sender: TObject);
|
procedure FormCreate(Sender: TObject);
|
||||||
procedure ButtonEcrLogClick(Sender: TObject);
|
procedure ButtonEcrLogClick(Sender: TObject);
|
||||||
procedure EditNivDebugKeyPress(Sender: TObject; var Key: Char);
|
procedure EditNivDebugKeyPress(Sender: TObject; var Key: Char);
|
||||||
@@ -82,6 +84,8 @@ type
|
|||||||
procedure MemoEvtDetChange(Sender: TObject);
|
procedure MemoEvtDetChange(Sender: TObject);
|
||||||
procedure EditDebugSignalChange(Sender: TObject);
|
procedure EditDebugSignalChange(Sender: TObject);
|
||||||
procedure CheckBoxTiersClick(Sender: TObject);
|
procedure CheckBoxTiersClick(Sender: TObject);
|
||||||
|
procedure ButtonSimuAct1Click(Sender: TObject);
|
||||||
|
procedure ButtonSimuAct0Click(Sender: TObject);
|
||||||
private
|
private
|
||||||
{ Déclarations privées }
|
{ Déclarations privées }
|
||||||
public
|
public
|
||||||
@@ -441,6 +445,27 @@ begin
|
|||||||
end;
|
end;
|
||||||
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);
|
procedure TFormDebug.ButtonRazToutClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
Raz_tout;
|
Raz_tout;
|
||||||
@@ -467,4 +492,9 @@ begin
|
|||||||
AffTiers:=checkBoxTiers.checked;
|
AffTiers:=checkBoxTiers.checked;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
end.
|
end.
|
||||||
Binary file not shown.
+3
-3
@@ -1,6 +1,6 @@
|
|||||||
object FormPrinc: TFormPrinc
|
object FormPrinc: TFormPrinc
|
||||||
Left = 60
|
Left = 82
|
||||||
Top = 181
|
Top = 118
|
||||||
Width = 1212
|
Width = 1212
|
||||||
Height = 664
|
Height = 664
|
||||||
Caption = 'Client TCP-IP CDM Rail ou USB - syst'#232'me LENZ'
|
Caption = 'Client TCP-IP CDM Rail ou USB - syst'#232'me LENZ'
|
||||||
@@ -1560,7 +1560,7 @@ object FormPrinc: TFormPrinc
|
|||||||
Caption = 'Interface'
|
Caption = 'Interface'
|
||||||
object MenuConnecterUSB: TMenuItem
|
object MenuConnecterUSB: TMenuItem
|
||||||
Caption = 'Connecter l'#39'interface XpressNet en USB'
|
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
|
OnClick = MenuConnecterUSBClick
|
||||||
end
|
end
|
||||||
object DeconnecterUSB: TMenuItem
|
object DeconnecterUSB: TMenuItem
|
||||||
|
|||||||
+50
-22
@@ -16,7 +16,7 @@ interface
|
|||||||
uses
|
uses
|
||||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||||
Dialogs, StdCtrls, OleCtrls, ExtCtrls, jpeg, ComCtrls, ShellAPI, TlHelp32,
|
Dialogs, StdCtrls, OleCtrls, ExtCtrls, jpeg, ComCtrls, ShellAPI, TlHelp32,
|
||||||
ImgList, ScktComp, StrUtils, Menus, ActnList, MSCommLib_TLB ;
|
ImgList, ScktComp, StrUtils, Menus, ActnList, MSCommLib_TLB, MMSystem ;
|
||||||
|
|
||||||
type
|
type
|
||||||
TFormPrinc = class(TForm)
|
TFormPrinc = class(TForm)
|
||||||
@@ -320,11 +320,12 @@ var
|
|||||||
MemZone : array[0..1024,0..1024] of boolean ; // mémoires de zones des détecteurs
|
MemZone : array[0..1024,0..1024] of boolean ; // mémoires de zones des détecteurs
|
||||||
Tablo_actionneur : array[1..100] of
|
Tablo_actionneur : array[1..100] of
|
||||||
record
|
record
|
||||||
loco,act : boolean; // type loco ou actionneur
|
loco,act,son : boolean; // type loco actionneur ou son
|
||||||
actionneur,etat,fonction,tempo,
|
adresse,etat,fonction,tempo,
|
||||||
accessoire,sortie : integer;
|
accessoire,sortie : integer;
|
||||||
Raz : boolean;
|
Raz : boolean;
|
||||||
train : string;
|
det : boolean; // désigne un détecteur
|
||||||
|
FichierSon,train : string;
|
||||||
end;
|
end;
|
||||||
KeyInputs: array of TInput;
|
KeyInputs: array of TInput;
|
||||||
Tablo_PN : array[1..20] of
|
Tablo_PN : array[1..20] of
|
||||||
@@ -395,6 +396,7 @@ function PresTrainPrec(AdrFeu : integer) : boolean;
|
|||||||
function cond_carre(adresse : integer) : boolean;
|
function cond_carre(adresse : integer) : boolean;
|
||||||
function carre_signal(adresse : integer) : boolean;
|
function carre_signal(adresse : integer) : boolean;
|
||||||
procedure Event_Detecteur(Adresse : integer;etat : boolean;train : string);
|
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 verif_UniSemaf(adresse,UniSem : integer) : integer;
|
||||||
function Select_dessin_feu(TypeFeu : integer) : TBitmap;
|
function Select_dessin_feu(TypeFeu : integer) : TBitmap;
|
||||||
procedure cree_image(rang : integer);
|
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
|
P_image_pilote:=Sender as TImage; // récupérer l'objet image de la forme pilote
|
||||||
s:=P_Image_pilote.Hint;
|
s:=P_Image_pilote.Hint;
|
||||||
//Affiche(s,clyellow);
|
//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 delete(s,i,1);
|
||||||
i:=pos(' ',s);
|
i:=pos(' ',s);
|
||||||
if i<>0 then s:=copy(s,1,i-1);
|
if i<>0 then s:=copy(s,1,i-1);
|
||||||
@@ -4785,38 +4787,49 @@ 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,etatAct,Af,Ao,Access,sortie : integer;
|
var i,v,va,etatAct,Af,Ao,Access,sortie : integer;
|
||||||
s : string;
|
s,st : string;
|
||||||
presTrain_PN : boolean;
|
presTrain_PN : boolean;
|
||||||
Ts : TAccessoire;
|
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 AfficheDebug('Act/Det '+intToSTR(Adr)+'='+intToSTR(etat),clyellow);
|
||||||
|
|
||||||
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].det then st:='Détecteur ' else st:='Actionneur ';
|
||||||
|
|
||||||
// actionneur pour fonction train
|
// 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
|
begin
|
||||||
Affiche('Actionneur '+intToSTR(adr)+' Train='+train+' F'+IntToSTR(Tablo_actionneur[i].fonction)+':'+intToSTR(etat),clyellow);
|
Affiche(st+intToSTR(adr)+' Train='+train+' F'+IntToSTR(Tablo_actionneur[i].fonction)+':'+intToSTR(etat),clyellow);
|
||||||
// exécutione la fonction F vers CDM
|
// exécution de 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
|
// 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
|
begin
|
||||||
access:=Tablo_actionneur[i].accessoire;
|
access:=Tablo_actionneur[i].accessoire;
|
||||||
sortie:=Tablo_actionneur[i].sortie;
|
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
|
// exécution la fonction accessoire vers CDM
|
||||||
if Tablo_actionneur[i].RAZ then Ts:=aigP else Ts:=Feu;
|
if Tablo_actionneur[i].RAZ then Ts:=aigP else Ts:=Feu;
|
||||||
pilote_acc(access,sortie,Ts); // sans RAZ
|
pilote_acc(access,sortie,Ts); // sans RAZ
|
||||||
RangActCours:=i;
|
RangActCours:=i;
|
||||||
end;
|
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;
|
end;
|
||||||
|
|
||||||
// dans le tableau des PN
|
// dans le tableau des PN
|
||||||
@@ -4921,6 +4934,7 @@ begin
|
|||||||
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
|
// 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
|
// sur le détecteur
|
||||||
|
if not(confignulle) then
|
||||||
for i:=1 to NbreFeux do
|
for i:=1 to NbreFeux do
|
||||||
begin
|
begin
|
||||||
AdrFeu:=Feux[i].Adresse;
|
AdrFeu:=Feux[i].Adresse;
|
||||||
@@ -4939,6 +4953,9 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
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;
|
end;
|
||||||
|
|
||||||
// détection fronts descendants
|
// détection fronts descendants
|
||||||
@@ -4967,7 +4984,10 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
premierFD:=True;
|
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;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -5041,7 +5061,7 @@ begin
|
|||||||
if AvecTCO then formTCO.Maj_TCO(Adresse);
|
if AvecTCO then formTCO.Maj_TCO(Adresse);
|
||||||
|
|
||||||
// l'évaluation des routes est à faire selon conditions
|
// l'évaluation des routes est à faire selon conditions
|
||||||
if faire_event then evalue;
|
if faire_event and not(confignulle) then evalue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// pilote une sortie à 0 dont l'adresse est à octet
|
// pilote une sortie à 0 dont l'adresse est à octet
|
||||||
@@ -5662,7 +5682,7 @@ begin
|
|||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Affiche('Lancement de CDM '+lay,clyellow);
|
|
||||||
cdm_lanceLoc:=false;
|
cdm_lanceLoc:=false;
|
||||||
// lancement depuis le répertoire 32 bits d'un OS64
|
// lancement depuis le répertoire 32 bits d'un OS64
|
||||||
if ShellExecute(Formprinc.Handle,'open',PChar('C:\Program Files (x86)\CDM-Rail\cdr.exe'),
|
if ShellExecute(Formprinc.Handle,'open',PChar('C:\Program Files (x86)\CDM-Rail\cdr.exe'),
|
||||||
@@ -5671,13 +5691,12 @@ begin
|
|||||||
,SW_SHOWNORMAL)>32 then
|
,SW_SHOWNORMAL)>32 then
|
||||||
begin
|
begin
|
||||||
cdm_lanceLoc:=true;
|
cdm_lanceLoc:=true;
|
||||||
//Affiche('lancé1',clyellow);
|
Affiche('Lancement de CDM 64 '+lay,clyellow);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if not(cdm_lanceLoc) then
|
if not(cdm_lanceLoc) then
|
||||||
begin
|
begin
|
||||||
// si çà marche pas essayer depuis le répertoire de base sur un OS32
|
// si çà marche pas essayer depuis le répertoire de base sur un OS32
|
||||||
Affiche('2eme lancement',clyellow);
|
|
||||||
if ShellExecute(Formprinc.Handle,
|
if ShellExecute(Formprinc.Handle,
|
||||||
'open',PChar('C:\Program Files\CDM-Rail\cdr.exe'),
|
'open',PChar('C:\Program Files\CDM-Rail\cdr.exe'),
|
||||||
Pchar('-f '+lay), // paramètre
|
Pchar('-f '+lay), // paramètre
|
||||||
@@ -5687,7 +5706,8 @@ begin
|
|||||||
ShowMessage('répertoire CDM rail introuvable');
|
ShowMessage('répertoire CDM rail introuvable');
|
||||||
lance_CDM:=false;exit;
|
lance_CDM:=false;exit;
|
||||||
end;
|
end;
|
||||||
cdm_lanceLoc:=false;
|
cdm_lanceLoc:=true;
|
||||||
|
Affiche('Lancement de CDM 32 '+lay,clyellow);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if cdm_lanceLoc then
|
if cdm_lanceLoc then
|
||||||
@@ -6113,7 +6133,7 @@ begin
|
|||||||
dec(tempoAct);
|
dec(tempoAct);
|
||||||
if tempoAct=0 then
|
if tempoAct=0 then
|
||||||
begin
|
begin
|
||||||
A:=Tablo_actionneur[RangActCours].actionneur;
|
A:=Tablo_actionneur[RangActCours].adresse;
|
||||||
s:=Tablo_actionneur[RangActCours].train;
|
s:=Tablo_actionneur[RangActCours].train;
|
||||||
Affiche('Actionneur '+intToSTR(a)+' F'+IntToSTR(Tablo_actionneur[RangActCours].fonction)+':0',clyellow);
|
Affiche('Actionneur '+intToSTR(a)+' F'+IntToSTR(Tablo_actionneur[RangActCours].fonction)+':0',clyellow);
|
||||||
envoie_fonction_CDM(Tablo_actionneur[RangActCours].fonction,0,s);
|
envoie_fonction_CDM(Tablo_actionneur[RangActCours].fonction,0,s);
|
||||||
@@ -7072,6 +7092,7 @@ end;
|
|||||||
|
|
||||||
procedure TFormPrinc.Codificationdesactionneurs1Click(Sender: TObject);
|
procedure TFormPrinc.Codificationdesactionneurs1Click(Sender: TObject);
|
||||||
var i,adract,etatAct,fonction,v,acc,sortie : integer;
|
var i,adract,etatAct,fonction,v,acc,sortie : integer;
|
||||||
|
son : boolean;
|
||||||
s,s2 : string;
|
s,s2 : string;
|
||||||
begin
|
begin
|
||||||
if (maxTablo_act=0) and (NbrePN=0) then
|
if (maxTablo_act=0) and (NbrePN=0) then
|
||||||
@@ -7085,19 +7106,23 @@ begin
|
|||||||
begin
|
begin
|
||||||
s:=Tablo_actionneur[i].train;
|
s:=Tablo_actionneur[i].train;
|
||||||
etatAct:=Tablo_actionneur[i].etat ;
|
etatAct:=Tablo_actionneur[i].etat ;
|
||||||
AdrAct:=Tablo_actionneur[i].actionneur;
|
AdrAct:=Tablo_actionneur[i].adresse;
|
||||||
s2:=Tablo_actionneur[i].train;
|
s2:=Tablo_actionneur[i].train;
|
||||||
acc:=Tablo_actionneur[i].accessoire;
|
acc:=Tablo_actionneur[i].accessoire;
|
||||||
sortie:=Tablo_actionneur[i].sortie;
|
sortie:=Tablo_actionneur[i].sortie;
|
||||||
fonction:=Tablo_actionneur[i].fonction;
|
fonction:=Tablo_actionneur[i].fonction;
|
||||||
|
son:=Tablo_actionneur[i].son;
|
||||||
if (s2<>'') then
|
if (s2<>'') then
|
||||||
begin
|
begin
|
||||||
if fonction<>0 then
|
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);
|
' Temporisation='+intToSTR(tablo_actionneur[i].Tempo);
|
||||||
if acc<>0 then
|
if acc<>0 then
|
||||||
s:='Accessoire Actionneur='+intToSTR(adrAct)+':'+intToSTR(etatAct)+' Train='+s2+' A'+IntToSTR(acc)+
|
s:='Accessoire Déclencheur='+intToSTR(adrAct)+':'+intToSTR(etatAct)+' Train='+s2+' A'+IntToSTR(acc)+
|
||||||
' sortie='+intToSTR(sortie);
|
' sortie='+intToSTR(sortie);
|
||||||
|
if son then
|
||||||
|
s:='Son Déclencheur='+intToSTR(adrAct)+':'+intToSTR(etatAct)+' Train='+s2+' Fichier:'+ Tablo_actionneur[i].FichierSon;
|
||||||
|
|
||||||
Affiche(s,clYellow);
|
Affiche(s,clYellow);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@@ -7235,5 +7260,8 @@ begin
|
|||||||
if verif_coherence then affiche('La configuration est cohérente',clLime);
|
if verif_coherence then affiche('La configuration est cohérente',clLime);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
|
||||||
end.
|
end.
|
||||||
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1
-1
@@ -23,7 +23,7 @@ var
|
|||||||
Lance_verif : integer;
|
Lance_verif : integer;
|
||||||
verifVersion,notificationVersion : boolean;
|
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
|
SousVersion=' '; // en cas d'absence de sous version mettre un espace
|
||||||
|
|
||||||
implementation
|
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.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
|
version 3.4 : fusion des fichiers de configurations en un feul fichier : ConfigGenerale.cfg
|
||||||
Intégration des TJD à 2 états.
|
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