This commit is contained in:
f1iwq2
2025-02-17 16:56:38 +01:00
parent 434cf35af1
commit 3d109c0b3c
19 changed files with 2061 additions and 702 deletions
Binary file not shown.
+318 -25
View File
@@ -670,7 +670,7 @@ object FormConfig: TFormConfig
Top = 8
Width = 633
Height = 505
ActivePage = TabSheetPeriph
ActivePage = TabSheetBouton
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack
Font.Height = -11
@@ -684,8 +684,8 @@ object FormConfig: TFormConfig
object Label36: TLabel
Left = 24
Top = 458
Width = 369
Height = 13
Width = 325
Height = 26
Caption =
'Param'#232'tres de connexion et d'#39#233'change avec CDM rail et param'#232'tres' +
' g'#233'n'#233'raux'
@@ -1067,7 +1067,7 @@ object FormConfig: TFormConfig
Hint =
'Utilis'#233' avec la fenetre CDM de signaux complexes pour afficher l' +
'es trains'
Caption = 'Position trains'
Caption = 'Position et vitesses trains'
ParentShowHint = False
ShowHint = True
TabOrder = 3
@@ -1222,8 +1222,8 @@ object FormConfig: TFormConfig
object Label9: TLabel
Left = 16
Top = 456
Width = 294
Height = 13
Width = 249
Height = 26
Caption = 'Ces param'#232'tres sont utilis'#233's en fonctionnement sans CDM Rail'
WordWrap = True
end
@@ -1244,7 +1244,7 @@ object FormConfig: TFormConfig
object Label4: TLabel
Left = 16
Top = 45
Width = 138
Width = 135
Height = 26
Caption = '2. Temporisation d'#39'envoi des octets de la trame (ms)'
WordWrap = True
@@ -1252,7 +1252,7 @@ object FormConfig: TFormConfig
object Label5: TLabel
Left = 16
Top = 75
Width = 151
Width = 148
Height = 26
Caption =
'3. Temporisation d'#39'attente de la r'#233'ponse de l'#39'interface (x 50 ms' +
@@ -1534,7 +1534,7 @@ object FormConfig: TFormConfig
object LabelCrois: TLabel
Left = 96
Top = 312
Width = 187
Width = 178
Height = 26
Caption =
'Les croisements re'#231'oivent une adresse m'#234'me s'#39'ils ne sont pas pil' +
@@ -2077,8 +2077,8 @@ object FormConfig: TFormConfig
object Label34: TLabel
Left = 472
Top = 200
Width = 136
Height = 26
Width = 115
Height = 39
Caption = 'Tapez CTRL-Z pour annuler une modification r'#233'cente'
WordWrap = True
end
@@ -2274,8 +2274,8 @@ object FormConfig: TFormConfig
object Label17: TLabel
Left = 8
Top = 326
Width = 131
Height = 39
Width = 115
Height = 52
Hint =
'Permet d'#39'afficher un carr'#233' si les aiguillages sont dans les posi' +
'tions d'#233'crites ci dessous'
@@ -2369,7 +2369,7 @@ object FormConfig: TFormConfig
object Label69: TLabel
Left = 152
Top = 326
Width = 122
Width = 107
Height = 39
Hint =
'Permet d'#39'afficher un feu blanc si les aiguillages sont dans les ' +
@@ -2800,9 +2800,9 @@ object FormConfig: TFormConfig
ParentFont = False
end
object LabelNa: TLabel
Left = 19
Left = 36
Top = 304
Width = 126
Width = 109
Height = 39
Alignment = taRightJustify
Caption = 'Nombre d'#39'adresses occup'#233'es par le signal sur le d'#233'codeur:'
@@ -3187,7 +3187,7 @@ object FormConfig: TFormConfig
Left = 240
Top = 19
Width = 33
Height = 22
Height = 21
MaxValue = 2
MinValue = 0
TabOrder = 2
@@ -3348,7 +3348,7 @@ object FormConfig: TFormConfig
object Label31: TLabel
Left = 352
Top = 296
Width = 229
Width = 203
Height = 26
Caption = 'Les actionneurs doivent '#234'tre compris entre deux d'#233'tecteurs'
WordWrap = True
@@ -4338,8 +4338,8 @@ object FormConfig: TFormConfig
object Label45: TLabel
Left = 50
Top = 40
Width = 192
Height = 26
Width = 160
Height = 39
Alignment = taCenter
Caption =
'Arr'#234't temporis'#233' du train sur routes sur d'#233'tecteurs : (mode auton' +
@@ -4376,8 +4376,8 @@ object FormConfig: TFormConfig
object LabelEt: TLabel
Left = 16
Top = 24
Width = 213
Height = 26
Width = 201
Height = 39
Caption =
'Les 3 coefficients de vitesse sont issus de la proc'#233'dure d'#39#233'talo' +
'nnage de la mesure du train'
@@ -4641,8 +4641,8 @@ object FormConfig: TFormConfig
end
object Label23: TLabel
Left = 8
Top = 36
Width = 534
Top = 28
Width = 571
Height = 26
Caption =
'Les p'#233'riph'#233'riques sont utilis'#233's pour '#234'tre activ'#233's par une action' +
@@ -4870,9 +4870,302 @@ object FormConfig: TFormConfig
OnClick = BoutonComClick
end
end
object TabSheetBouton: TTabSheet
Caption = 'Boutons USB'
ImageIndex = 10
object GroupBoxB: TGroupBox
Left = 8
Top = 8
Width = 593
Height = 441
Caption = 'Boutons rotatifs / poussoirs USB'
TabOrder = 0
object Shape1: TShape
Left = 72
Top = 80
Width = 193
Height = 201
Brush.Color = clOlive
end
object ShapeBR: TShape
Left = 120
Top = 112
Width = 97
Height = 89
Hint = 'Bouton rotatif et clic'
Brush.Color = clGray
ParentShowHint = False
Shape = stCircle
ShowHint = True
OnMouseDown = ShapeBRMouseDown
end
object ShapeB1: TShape
Left = 80
Top = 224
Width = 33
Height = 33
Hint = 'Clic bouton 1'
Brush.Color = clGray
ParentShowHint = False
Shape = stCircle
ShowHint = True
OnMouseDown = ShapeB1MouseDown
end
object ShapeB2: TShape
Left = 128
Top = 224
Width = 33
Height = 33
Hint = 'Clic bouton 2'
Brush.Color = clGray
ParentShowHint = False
Shape = stCircle
ShowHint = True
OnMouseDown = ShapeB2MouseDown
end
object ShapeB3: TShape
Left = 176
Top = 224
Width = 33
Height = 33
Hint = 'Clic bouton 3'
Brush.Color = clGray
ParentShowHint = False
Shape = stCircle
ShowHint = True
OnMouseDown = ShapeB3MouseDown
end
object ShapeB4: TShape
Left = 224
Top = 224
Width = 33
Height = 33
Hint = 'Clic bouton 4'
Brush.Color = clGray
ParentShowHint = False
Shape = stCircle
ShowHint = True
OnMouseDown = ShapeB4MouseDown
end
object Label66: TLabel
Left = 72
Top = 336
Width = 122
Height = 16
Caption = 'Code de touche : '
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack
Font.Height = -13
Font.Name = 'MS Sans Serif'
Font.Style = [fsBold]
ParentFont = False
end
object LabelCode: TLabel
Left = 200
Top = 336
Width = 5
Height = 16
Caption = '.'
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack
Font.Height = -13
Font.Name = 'MS Sans Serif'
Font.Style = [fsBold]
ParentFont = False
end
object Label70: TLabel
Left = 16
Top = 32
Width = 263
Height = 13
Caption = 'D'#233'finition des boutons des blocs claviers USB'
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = [fsBold]
ParentFont = False
end
object Label72: TLabel
Left = 27
Top = 392
Width = 3
Height = 13
Caption = '-'
end
object Label74: TLabel
Left = 312
Top = 240
Width = 81
Height = 13
Caption = 'Affecter au train :'
end
object LabelId: TLabel
Left = 80
Top = 88
Width = 16
Height = 34
Caption = '1'
Color = clOlive
Font.Charset = ANSI_CHARSET
Font.Color = clBlack
Font.Height = -29
Font.Name = 'Arial'
Font.Style = [fsBold]
ParentColor = False
ParentFont = False
end
object LabeledEditCT: TLabeledEdit
Left = 480
Top = 80
Width = 40
Height = 21
Hint = 'Code ascii envoy'#233' par le bouton'
EditLabel.Width = 76
EditLabel.Height = 13
EditLabel.Caption = 'Code de touche'
EditLabel.Layout = tlBottom
LabelPosition = lpLeft
LabelSpacing = 50
ParentShowHint = False
ShowHint = True
TabOrder = 0
OnChange = LabeledEditCTChange
end
object LabeledEditRm: TLabeledEdit
Left = 480
Top = 128
Width = 40
Height = 21
Hint = 'Code ascii envoy'#233' par la rotation anti horaire (-)'
EditLabel.Width = 99
EditLabel.Height = 13
EditLabel.Caption = 'Code de rotation en -'
EditLabel.Layout = tlBottom
LabelPosition = lpLeft
LabelSpacing = 50
ParentShowHint = False
ShowHint = True
TabOrder = 1
OnChange = LabeledEditRmChange
end
object LabeledEditRp: TLabeledEdit
Left = 480
Top = 152
Width = 40
Height = 21
Hint = 'Code ascii envoy'#233' par la rotation horaire (+)'
EditLabel.Width = 102
EditLabel.Height = 13
EditLabel.Caption = 'Code de rotation en +'
EditLabel.Layout = tlBottom
LabelPosition = lpLeft
LabelSpacing = 50
ParentShowHint = False
ShowHint = True
TabOrder = 2
OnChange = LabeledEditRpChange
end
object LabeledEditClic: TLabeledEdit
Left = 480
Top = 176
Width = 40
Height = 21
Hint = 'Code ascii envoy'#233' par le clic bouton'
EditLabel.Width = 59
EditLabel.Height = 13
EditLabel.Caption = 'Code de clic'
EditLabel.Layout = tlBottom
LabelPosition = lpLeft
LabelSpacing = 50
ParentShowHint = False
ShowHint = True
TabOrder = 3
OnChange = LabeledEditClicChange
end
object LabeledEditNUM: TLabeledEdit
Left = 480
Top = 40
Width = 25
Height = 21
Hint = 'Num'#233'ro de contr'#244'leur clavier USB (1 '#224' 10)'
EditLabel.Width = 134
EditLabel.Height = 13
EditLabel.Caption = 'Num'#233'ro de bloc clavier USB'
EditLabel.Layout = tlBottom
LabelPosition = lpLeft
LabelSpacing = 30
ParentShowHint = False
ShowHint = True
TabOrder = 4
OnChange = LabeledEditNUMChange
end
object LabeledEditF: TLabeledEdit
Left = 480
Top = 104
Width = 40
Height = 21
Hint = 'Fonction F associ'#233'e au bouton'
EditLabel.Width = 100
EditLabel.Height = 13
EditLabel.Caption = 'Fonction F '#224' envoyer'
EditLabel.Layout = tlBottom
LabelPosition = lpLeft
LabelSpacing = 50
ParentShowHint = False
ShowHint = True
TabOrder = 5
OnChange = LabeledEditFChange
end
object LabeledEditIncr: TLabeledEdit
Left = 480
Top = 200
Width = 40
Height = 21
Hint = 'Valeur de l'#39'incr'#233'ment sur une rotation'
EditLabel.Width = 105
EditLabel.Height = 13
EditLabel.Caption = 'Incr'#233'ment '#224' la rotation'
EditLabel.Layout = tlBottom
LabelPosition = lpLeft
LabelSpacing = 50
ParentShowHint = False
ShowHint = True
TabOrder = 6
OnChange = LabeledEditIncrChange
end
object ComboBoxUSBTr: TComboBox
Left = 416
Top = 240
Width = 153
Height = 21
Style = csDropDownList
ItemHeight = 13
TabOrder = 7
OnChange = ComboBoxUSBTrChange
end
object LabeledEditFn: TLabeledEdit
Left = 536
Top = 104
Width = 16
Height = 21
Hint = '0 ou 1'
EditLabel.Width = 6
EditLabel.Height = 13
EditLabel.Caption = #224
EditLabel.Layout = tlBottom
LabelPosition = lpLeft
LabelSpacing = 5
ParentShowHint = False
ShowHint = True
TabOrder = 8
OnChange = LabeledEditFnChange
end
end
end
object TabAvance: TTabSheet
Caption = 'Avanc'#233
ImageIndex = 10
ImageIndex = 11
object Label50: TLabel
Left = 8
Top = 8
+691 -204
View File
File diff suppressed because it is too large Load Diff
+4 -5
View File
@@ -419,7 +419,7 @@ begin
ligne:=1;
for i:=1 to Ntrains do
begin
for j:=1 to 10 do
for j:=1 to NbDetArret do
if (trains[i].DetecteurArret[j].detecteur=adr) and (adr<>0) then
begin
s:='';
@@ -666,7 +666,7 @@ end;
procedure TFormConfCellTCO.EditAdrElementChange(Sender: TObject);
var Adr,erreur,index,Bimage,x,y : integer;
var Adr,erreur,Bimage,x,y : integer;
begin
if clicTCO or not(ConfCellTCO) or actualize then exit;
if affevt then Affiche('TFormConfCellTCO.EditAdrElementChange',clyellow);
@@ -697,11 +697,10 @@ begin
if BImage=Id_signal then
begin
index:=Index_Signal(adr);
{ index:=Index_Signal(adr);
if index=0 then exit
else
else }
begin
//Affiche('Feu '+intToSTR(Adr),clyellow);
affiche_tco(indexTCOcourant);
end;
end;
+2 -2
View File
@@ -54,7 +54,7 @@ uses UnitPrinc,unitTCO;
procedure arret_mesure ;
begin
mesureTrains:=false;
vitesse_loco('',0,trains[indexTrainMes].adresse,0,10);
vitesse_loco('',0,trains[indexTrainMes].adresse,0,10,ActionVitesse); // action vitesse pour ne pas générer d'event vitesse
with formMesure do
begin
ComboBoxTrains.Enabled:=true;
@@ -219,7 +219,7 @@ begin
mesureTrains:=true;
vitesse_loco('',0,trains[indexTrainMes].adresse,v1,10);
vitesse_loco('',0,trains[indexTrainMes].adresse,v1,10,ActionVitesse); // ActionVitesse pour ne pas générer d'event_vitesse
LabelMesC.Visible:=true;
LabelMesC.top:=178;
+5 -1
View File
@@ -60,7 +60,7 @@ object FormModifAction: TFormModifAction
Top = 64
Width = 729
Height = 337
ActivePage = TabSheetOp
ActivePage = TabSheetDecl
MultiLine = True
TabOrder = 1
object TabSheetDecl: TTabSheet
@@ -684,6 +684,8 @@ object FormModifAction: TFormModifAction
EditLabel.Caption = 'Adresse'
LabelPosition = lpLeft
LabelSpacing = 10
ParentShowHint = False
ShowHint = True
TabOrder = 1
OnChange = LabeledEditAdresseChange
end
@@ -734,6 +736,8 @@ object FormModifAction: TFormModifAction
EditLabel.Caption = 'Tempo x100ms'
LabelPosition = lpLeft
LabelSpacing = 10
ParentShowHint = False
ShowHint = True
TabOrder = 5
OnChange = LabeledEditTempoFChange
end
+229 -237
View File
@@ -163,13 +163,11 @@ uses Unitprinc, UnitConfigCellTCO, UnitConfig;
{$R *.dfm}
// rend tous les composants invisibles
procedure efface_tous_parametres;
procedure efface_champs_declencheurs_conditions;
begin
with FormModifAction do
with formModifAction do
begin
//r:=Rect(
// r:=TRect(ListBoxDeclench.handle,0,i*10,ListBoxDeclench.width,16);
// déclencheurs
RadioEtatSignal.Visible:=false;
LabelAdresse.Visible:=false;
SpinEditEtat.Visible:=false;
@@ -178,8 +176,33 @@ begin
EditAdr2.Visible:=false;
LabelTrain.Visible:=false;
EditTrainDecl.Visible:=false;
LabelPeriph.Visible:=false;
LabelEtat.Visible:=false;
LabelInfoFonc.Visible:=false;
ButtonFonction.Visible:=false;
// conditions
Champ1.Visible:=false;
Champ2.Visible:=false;
SpinEditHeure1.visible:=false;
SpinEditMn1.visible:=false;
SpinEditHeure2.visible:=false;
SpinEditMn2.visible:=false;
LabelHeureDebut.Visible:=false;
LabelHeureFin.Visible:=false;
LabelEtat2.Visible:=false;
SpinEditEtat2.Visible:=false;
ChampTrain.Visible:=false;
ButtonVoirFonc.Visible:=false;
Label2InfoFonction.visible:=false;
end;
end;
// rend invisibles les champs opérations
procedure efface_champs_operations;
begin
with FormModifAction do
begin
LabelPeriph.Visible:=false;
LabeledEditTempoF.Visible:=false;
LabeledEditTrain.Visible:=false;
SpeedButtonJoue.visible:=false;
@@ -192,21 +215,6 @@ begin
labelEtatOp.Visible:=false;
RichEditInf.clear;
ComboBoxAccComUSB.visible:=false;
Champ1.Visible:=false;
Champ2.Visible:=false;
LabelHeureDebut.Visible:=false;
LabelHeureFin.Visible:=false;
SpinEditHeure1.visible:=false;
SpinEditMn1.visible:=false;
SpinEditHeure2.visible:=false;
SpinEditMn2.visible:=false;
LabelEtat2.Visible:=false;
SpinEditEtat2.Visible:=false;
ChampTrain.Visible:=false;
ButtonVoirFonc.Visible:=false;
ButtonFonction.Visible:=false;
LabelInfoFonc.Visible:=false;
Label2InfoFonction.visible:=false;
end;
end;
@@ -287,7 +295,8 @@ begin
'Double clic pour valider/dévalider une opération';
LabeledEditFonctionF.Hint:='Fonction F de 0 à 28';
Efface_tous_parametres;
Efface_champs_operations;
Efface_champs_declencheurs_conditions;
PageControlAct.ActivePage:=TabSheetDecl;
end;
@@ -338,7 +347,7 @@ var
i,erreur: Integer;
ItemText: string;
begin
//Affiche('Evt ListBoxOperationsDrawItem',clyellow);
if affevt then Affiche('Evt ListBoxOperationsDrawItem '+intToSTR(index),clyellow);
with ListBoxOperations do
begin
ItemText:=Items[index];
@@ -390,9 +399,9 @@ begin
DeclZoneDet :
s:=s+'Zone détection '+intToSTR(Tablo_Action[i].adresse)+' '+intToSTR(Tablo_Action[i].adresse2);
DeclDemarTrain :
s:=s+'démarrage du train '+Tablo_Action[i].trainDecl+' au seuil de '+intToSTR(Tablo_Action[i].adresse);
s:=s+'démarrage du train '+Tablo_Action[i].trainDecl;
DeclArretTrain :
s:=s+'arrêt du train '+Tablo_Action[i].trainDecl+' au seuil de '+intToSTR(Tablo_Action[i].adresse);
s:=s+'arrêt du train '+Tablo_Action[i].trainDecl;
DeclSignal :
begin
s:=s+'changement du signal '+intToSTR(Tablo_Action[i].adresse);
@@ -481,15 +490,187 @@ begin
result:=s;
end;
procedure affiche_champs_operations(index,indexaction : integer);
var nb,act : integer;
begin
Nb:=Tablo_Action[index].NbOperations;
// si pas d'action sélectionnée et que la liste n'est pas nulle, sélectionner la première
if (Nb>0) and (indexAction=0) then
begin
indexAction:=1;
formModifAction.listBoxOperations.itemIndex:=indexaction;
formModifAction.listBoxOperations.Selected[indexaction-1]:=true;
end;
efface_champs_operations;
if Nb>=indexAction then
begin
Act:=Tablo_Action[index].tabloop[indexAction].numoperation;
with formModifAction do
begin
case Act of
ActionAffTCO :
begin
LabeledEditAdresse.hint:='Numéro du TCO';
LabeledEditAdresse.Visible:=true;
LabeledEditAdresse.EditLabel.Caption:='TCO n°';
LabeledEditAdresse.Text:=intToSTR(Tablo_Action[index].tabloop[indexAction].NumTCO);
end;
ActionAccessoire :
begin
LabeledEditAdresse.hint:='Adresse d''accessoire sur le bus DCC';
LabeledEditAdresse.EditLabel.Caption:='Adresse';
LabeledEditAdresse.visible:=true;
SpinEditEtatop.Visible:=true;
labelEtatOp.Visible:=true;
SpinEditEtatop.MinValue:=0;
SpinEditEtatop.MaxValue:=2;
SpinEditEtatop.hint:='Etat de l''accessoire'+#13+
'0=nul'+#13+
'1=dévié'+#13+
'2=droit';
checkBoxRaz.Visible:=true;
LabeledEditAdresse.Text:=intToSTR(Tablo_Action[index].tabloop[indexAction].adresse);
SpinEditEtatop.Value:=Tablo_Action[index].tabloop[indexAction].etat;
checkBoxRAZ.Checked:=Tablo_Action[index].tabloop[indexAction].zero;
end;
ActionVitesse :
begin
LabeledEditAdresse.EditLabel.Caption:='Vitesse';
LabeledEditAdresse.visible:=true;
LabeledEditAdresse.hint:='Vitesse de pilotage du train en crans';
LabeledEditTrain.Visible:=true;
LabeledEditTrain.EditLabel.Caption:='Train destinataire';
LabeledEditTrain.hint:='Nom unique du train';
LabeledEditAdresse.Text:=intToSTR(Tablo_Action[index].tabloop[indexAction].vitesse);
LabeledEditTrain.Text:=Tablo_Action[index].tabloop[indexAction].train;
end;
ActionCdePeriph :
begin
LabeledEditTrain.Visible:=true;
ComboBoxAccComUSB.Visible:=true;
LabelPeriph.Visible:=true;
LabeledEditTrain.EditLabel.Caption:='Commande';
LabeledEditTrain.Hint:='Commande Ascii';
LabeledEditTrain.Text:=Tablo_Action[index].tabloop[indexAction].chaine;
ComboBoxAccComUSB.itemIndex:=Tablo_Action[index].tabloop[indexAction].periph-1;
end;
ActionFonctionF :
begin
with SpinEditEtatop do
begin
Visible:=true;
MinValue:=0;
MaxValue:=1;
hint:='Etat 0 ou 1 de la fonction F';
end;
labelEtatOp.Visible:=true;
with LabeledEditTempoF do
begin
Visible:=true;
hint:='Valeur de la temporisation en 1/10ème de s'+#13+
'pour désactiver la fonction F'+#13+
'Si 0, la fonction F reste activée';
EditLabel.Caption:='Tempo (x100ms)';
Text:=intToSTR(Tablo_Action[index].tabloop[indexAction].TempoF);
end;
LabeledEditTrain.Visible:=true;
LabeledEditTrain.EditLabel.Caption:='Train destinataire';
LabeledEditTrain.hint:='Nom unique du train';
SpinEditEtatOp.Text:=IntToSTR(Tablo_Action[index].tabloop[indexAction].etat);
LabeledEditFonctionF.Text:=intToSTR(Tablo_Action[index].tabloop[indexAction].fonctionF);
LabeledEditFonctionF.Visible:=true;
LabeledEditTrain.Text:=Tablo_Action[index].tabloop[indexAction].train;
end;
ActionSon :
begin
LabeledEditTrain.Visible:=true;
SpeedButtonJoue.Visible:=true;
SpeedButtonCharger.Visible:=true;
LabeledEditTrain.EditLabel.Caption:='Son';
LabeledEditTrain.Hint:='fichier son';
LabeledEditTrain.Text:=Tablo_Action[index].tabloop[indexAction].train;
end;
ActionTempo :
begin
LabeledEditTempoF.Visible:=true;
LabeledEditTempoF.EditLabel.Caption:='Temporisation (x100 ms)';
LabeledEditTempoF.hint:='Valeur en dixièmes de secondes';
LabeledEditTempoF.Text:=intToSTR(Tablo_Action[index].tabloop[indexAction].TempoF);
end;
ActionBoutonTCO :
begin
with LabeledEditAdresse do
begin
hint:='Numéro de bouton de TCO';
Visible:=true;
EditLabel.Caption:='Bouton';
text:=intToSTR(Tablo_Action[index].tabloop[indexAction].adresse);
end;
With SpinEditEtatOp do
begin
Text:=intToSTR(Tablo_Action[index].tabloop[indexAction].etat);
Visible:=true;
MinValue:=0;
MaxValue:=1;
hint:='Etat 0 ou 1 du bouton';
end;
end;
ActionAffecteMemoire :
begin
with LabeledEditAdresse do
begin
EditLabel.Caption:='Mémoire';
Visible:=true;
hint:='Numéro de mémoire';
text:=intToSTR(Tablo_Action[index].tabloop[indexAction].adresse);
end;
with SpinEditEtatOp do
begin
Text:=intToSTR(Tablo_Action[index].tabloop[indexAction].etat);
Visible:=true;
MinValue:=-999;
MaxValue:=999;
hint:='Valeur d''affectation de -999 à 999';
end;
end;
ActionIncMemoire :
begin
with LabeledEditAdresse do
begin
EditLabel.Caption:='Mémoire';
hint:='Numéro de mémoire';
Visible:=true;
text:=intToSTR(Tablo_Action[index].tabloop[indexAction].adresse);
end;
end;
ActionDecMemoire :
begin
with LabeledEditAdresse do
begin
EditLabel.Caption:='Mémoire';
hint:='Numéro de mémoire';
Visible:=true;
text:=intToSTR(Tablo_Action[index].tabloop[indexAction].adresse);
end;
end;
end;
end;
end;
end;
// affiche les champs en fonction de l'index du tablo actionneur et de l'index de l'action
procedure Aff_champs(index,IndexCond,IndexAction : integer);
var i,decl,act,cond,Nb,icone : integer;
var i,decl,act,cond,icone : integer;
s : string;
begin
if (index<1) then exit;
if clicListe then exit;
clicliste:=true;
// Affiche('Aff_champs('+intToSTR(index)+','+intToSTR(indexAction)+')',clYellow);
if affevt then Affiche('Aff_champs('+intToSTR(index)+', indexOperation='+intToSTR(indexAction)+')',clYellow);
decl:=Tablo_Action[index].declencheur;
formModifAction.ListBoxDeclench.ItemIndex:=decl-1;
// comboboxActions
@@ -515,6 +696,7 @@ begin
FormModifAction.LabeledEditNomAct.Text:=Tablo_Action[index].NomAction;
// ListBox opérations
with FormModifAction.ListBoxOperations do
begin
clear;
@@ -535,7 +717,6 @@ begin
if act=ActionIncMemoire then items.Add(Format('%d%s', [iconeActionIncMemoire, s]));
if act=ActionDecMemoire then items.Add(Format('%d%s', [iconeActionDecMemoire, s]));
// listboxOperations de la formConfig
if act<=ActionTempo then formConfig.ListBoxOperations.Items.add(Format('%d%s', [act-1, s]));
if act=ActionBoutonTCO then formConfig.ListBoxOperations.items.Add(Format('%d%s', [IconeBouton, s]));
@@ -575,6 +756,7 @@ begin
if indexCond<>0 then itemIndex:=indexCond-1;
end;
// listBoxActions de la formConfig
FormConfig.ListBoxActions.Clear;
for i:=1 to maxTablo_act do
@@ -583,7 +765,7 @@ begin
formConfig.ListBoxActions.Items.add(s);
end;
efface_tous_parametres;
efface_champs_declencheurs_conditions;
// déclencheurs
with FormModifAction do
@@ -595,40 +777,24 @@ begin
LabelHeure.visible:=true;
LabelAdresse.visible:=true;
EditAdr.Visible:=true;
ButtonFonction.Visible:=false;
LabelAdresse.Caption:='Heure';
EditAdr.Hint:='Heure du déclencheur';
EditAdr2.Hint:='Minute du déclencheur';
EditAdr2.Visible:=true;
LabelEtat.Visible:=false;
SpinEditEtat.Visible:=false;
LabelTrain.Visible:=false;
EditTrainDecl.Visible:=false;
RichEditInf.Lines.Add('Déclenchement par l''horloge');
ImageIcone.Picture:=nil;
LabelInfoFonc.Visible:=false;
formConfCellTCO.ImageListIcones.GetBitmap(IconeHorloge,ImageIcone.Picture.Bitmap);
ImageIcone.repaint;
end;
DeclPeriph :
begin
EditTrainDecl.Text:=Tablo_Action[index].ordrePeriph;
LabelHeure.visible:=false;
LabelAdresse.visible:=false;
EditAdr.Visible:=false;
EditAdr2.Visible:=false;
LabelEtat.Visible:=false;
SpinEditEtat.Visible:=false;
LabelTrain.Visible:=false;
ButtonFonction.Visible:=false;
EditTrainDecl.Visible:=true;
EditTrainDecl.Hint:='Chaîne ASCII';
LabelTrain.visible:=true;
LabelTrain.Caption:='Commande du périphérique';
RichEditInf.Lines.Add('Déclenchement par chaîne ASCII depuis un périphérique COM/USB - Socket');
LabelInfoFonc.Visible:=false;
ImageIcone.Picture:=nil;
formConfCellTCO.ImageListIcones.GetBitmap(IconePeriph,ImageIcone.Picture.Bitmap);
@@ -651,18 +817,11 @@ begin
visible:=true;
end;
LabelHeure.visible:=false;
LabelAdresse.caption:='Adresse';
LabelAdresse.visible:=true;
EditAdr.Hint:='Adresse de l''accessoire sur le bus';
EditAdr.Visible:=true;
EditAdr2.Visible:=false;
ButtonFonction.Visible:=false;
LabelEtat.Visible:=true;
LabelInfoFonc.Visible:=false;
LabelTrain.Visible:=false;
EditTrainDecl.Visible:=false;
RichEditInf.Lines.Add('Accessoire sur le bus DCC (aiguillage)');
ImageIcone.Picture:=nil;
formConfCellTCO.ImageListIcones.GetBitmap(IconeAccessoire,ImageIcone.Picture.Bitmap);
@@ -674,18 +833,13 @@ begin
EditAdr.text:=intToSTR(Tablo_Action[index].adresse);
EditTrainDecl.Visible:=true;
EditTrainDecl.Text:=Tablo_Action[index].trainDecl;
ButtonFonction.Visible:=false;
EdittrainDecl.Hint:='Train(s) déclencheur(s) séparés par des virgules pour lesquels la condition s''applique.'
+#13+'Mettre X pour tous les trains.'+#13+'Déclenchement par actionneur uniquement';
LabelAdresse.visible:=true;
EditAdr.Visible:=true;
EditAdr.Hint:='Adresse du détecteur sur le bus de rétrosignalisation '+#13+'ou de l''actionneur CDM';
LabelHeure.visible:=false;
EditAdr2.Visible:=false;
LabelAdresse.Caption:='Adresse';
LabelEtat.Visible:=true;
LabelInfoFonc.Visible:=false;
LabelAdresse.Visible:=true;
with SpinEditEtat do
begin
text:=intToSTR(Tablo_Action[index].etat);
@@ -697,7 +851,6 @@ begin
ShowHint:=true;
visible:=true;
end;
ButtonFonction.Visible:=false;
LabelTrain.Visible:=true;
LabelTrain.Caption:='Train déclencheur';
s:='Déclenchement par détecteur/actionneur suivant son état et un train, un groupe de trains ou tous les trains.'+#13;
@@ -719,11 +872,9 @@ begin
EditAdr2.Hint:='Adresse2 de la zone de détection du déclencheur';
LabelAdresse.visible:=true;
EditAdr.Visible:=true;
LabelHeure.visible:=false;
EditAdr2.Visible:=true;
LabelAdresse.Caption:='Adresse';
LabelEtat.Visible:=true;
LabelInfoFonc.Visible:=false;
EditTrainDecl.Visible:=true;
EdittrainDecl.Hint:='Train(s) déclencheur(s) séparés par des virgules pour lesquels la condition s''applique.'
@@ -740,7 +891,6 @@ begin
ShowHint:=true;
visible:=true;
end;
ButtonFonction.Visible:=false;
LabelTrain.Visible:=true;
LabelTrain.Caption:='Train déclencheur';
RichEditInf.Lines.Add('Déclenchement par zones de détections contigües suivant son état et un train, un groupe de trains ou tous les trains.');
@@ -753,16 +903,10 @@ begin
begin
LabelTrain.visible:=true;
EditTrainDecl.Visible:=true;
LabelAdresse.Visible:=true;
LabelAdresse.caption:='Seuil de vitesse';
EditAdr.Visible:=true;
ButtonFonction.Visible:=false;
EdittrainDecl.Hint:='Train déclencheur unique';
LabelInfoFonc.Visible:=false;
EditADR.Hint:='Seuil de vitesse de démarrage du train ';
EditTrainDecl.Text:=Tablo_Action[index].trainDecl;
EditAdr.Text:=IntToSTR(Tablo_Action[index].adresse);
RichEditInf.Lines.Add('Déclenchement par démarrage d''un train à un seuil donné');
RichEditInf.Lines.Add('Déclenchement par démarrage d''un train');
ImageIcone.Picture:=nil;
formConfCellTCO.ImageListIcones.GetBitmap(IconeDemarTrain,ImageIcone.Picture.Bitmap);
ImageIcone.repaint;
@@ -772,17 +916,11 @@ begin
begin
LabelTrain.visible:=true;
EditTrainDecl.Visible:=true;
LabelAdresse.Visible:=true;
LabelAdresse.caption:='Seuil de vitesse';
EdittrainDecl.Hint:='Train déclencheur unique';
ButtonFonction.Visible:=false;
EditAdr.Visible:=true;
EditADR.Hint:='Seuil de vitesse d''arrêt du train';
EditTrainDecl.Text:=Tablo_Action[index].trainDecl;
EditAdr.Text:=IntToSTR(Tablo_Action[index].adresse);
RichEditInf.Lines.Add('Déclenchement par arrêt d''un train à un seuil donné');
RichEditInf.Lines.Add('Déclenchement par arrêt d''un train');
ImageIcone.Picture:=nil;
LabelInfoFonc.Visible:=false;
formConfCellTCO.ImageListIcones.GetBitmap(IconeArretTrain,ImageIcone.Picture.Bitmap);
ImageIcone.repaint;
end;
@@ -794,12 +932,10 @@ begin
RadioEtatSignal.ItemIndex:=Tablo_Action[index].Etat;
LabelAdresse.Caption:='Adresse';
EditAdr.Hint:='Adresse de base du signal';
ButtonFonction.Visible:=false;
EditAdr.Visible:=true;
RadioEtatSignal.Visible:=true;
RadioEtatSignal.Left:=16;
RadioEtatSignal.top:=64;
LabelInfoFonc.Visible:=false;
RichEditInf.Lines.Add('Déclenchement par changement d''état d''un signal');
ImageIcone.Picture:=nil;
formConfCellTCO.ImageListIcones.GetBitmap(IconeSignal,ImageIcone.Picture.Bitmap);
@@ -810,18 +946,16 @@ begin
begin
LabelAdresse.Visible:=true; // numéro de fonction
LabelAdresse.caption:='Numéro de fonction';
EditAdr.Visible:=false;
ButtonFonction.Visible:=true;
RadioEtatSignal.visible:=false;
EditAdr2.Visible:=true; // entrée le la fonction
EditAdr2.Text:=IntToSTR(tablo_action[index].adresse);
RadioEtatSignal.Visible:=false;
ImageIcone.Picture:=nil;
formConfCellTCO.ImageListIcones.GetBitmap(IconeFonction,ImageIcone.Picture.Bitmap);
ImageIcone.repaint;
LabelInfoFonc.Visible:=true;
RichEditInf.Lines.Add('Déclenchement par fonction logique');
LabelInfoFonc.Caption:=NomFonction[index];
if (tablo_action[index].adresse>0) and (tablo_action[index].adresse<NbreFL) then LabelInfoFonc.Caption:=NomFonction[tablo_action[index].adresse]
else LabelInfoFonc.Caption:='';
end;
end;
@@ -845,7 +979,6 @@ begin
ChampTrain.Hint:='Nom du train unique pour la condition';
champ1.Visible:=true;
champ2.Visible:=true;
ButtonVoirFonc.Visible:=false;
ChampTrain.Visible:=true;
end;
CondPosAcc :
@@ -860,7 +993,6 @@ begin
'2=droit';
Champ1.EditLabel.Caption:='Adresse'+#13+'acc';
champ1.Visible:=true;
ButtonVoirFonc.Visible:=false;
labelEtat2.Visible:=true;
SpinEditEtat2.visible:=true;
SpinEditEtat2.MinValue:=0;
@@ -877,7 +1009,6 @@ begin
SpinEditHeure2.visible:=true;
SpinEditMn1.visible:=true;
SpinEditMn2.visible:=true;
ButtonVoirFonc.Visible:=false;
LabelHeureDebut.Visible:=true;
LabelHeureFin.Visible:=true;
end;
@@ -887,7 +1018,6 @@ begin
champ1.editLabel.Caption:='Adresse du signal';
champTrain.Text:=Tablo_Action[index].tabloCond[indexCond].train;
champ1.Visible:=true;
ButtonVoirFonc.Visible:=false;
champTrain.Visible:=true;
end;
condFonction :
@@ -897,7 +1027,6 @@ begin
champTrain.Text:=Tablo_Action[index].tabloCond[indexCond].train;
champ1.Visible:=true;
ButtonVoirFonc.Visible:=true;
champTrain.Visible:=false;
Label2InfoFonction.Visible:=true;
Label2InfoFonction.Caption:=NomFonction[Tablo_Action[index].tabloCond[indexCond].adresse];
end;
@@ -907,9 +1036,6 @@ begin
champ1.editLabel.Caption:='Numéro de bouton TCO';
champTrain.Text:=Tablo_Action[index].tabloCond[indexCond].train;
champ1.Visible:=true;
ButtonVoirFonc.Visible:=false;
champTrain.Visible:=false;
Label2InfoFonction.Visible:=false;
end;
condMemoireEgal,CondMemoireInf,CondMemoireSup :
begin
@@ -925,137 +1051,9 @@ begin
end;
end;
Nb:=Tablo_Action[index].NbOperations;
Efface_champs_operations;
Affiche_champs_operations(index,indexaction);
// si pas d'action sélectionnée et que la liste n'est pas nulle, sélectionner la première
if (Nb>0) and (indexAction=0) then
begin
indexAction:=1;
formModifAction.listBoxOperations.itemIndex:=indexaction;
formModifAction.listBoxOperations.Selected[indexaction-1]:=true;
end;
if Nb>=indexAction then
begin
Act:=Tablo_Action[index].tabloop[indexAction].numoperation;
with formModifAction do
begin
case Act of
ActionAffTCO :
begin
LabeledEditAdresse.Visible:=true;
LabeledEditAdresse.EditLabel.Caption:='TCO n°';
LabeledEditAdresse.Text:=intToSTR(Tablo_Action[index].tabloop[indexAction].NumTCO);
end;
ActionAccessoire :
begin
LabeledEditAdresse.EditLabel.Caption:='Adresse';
LabeledEditAdresse.visible:=true;
SpinEditEtatop.Visible:=true;
labelEtatOp.Visible:=true;
SpinEditEtatop.MinValue:=0;
SpinEditEtatop.MaxValue:=2;
SpinEditEtatop.hint:='Etat de l''accessoire'+#13+
'0=nul'+#13+
'1=dévié'+#13+
'2=droit';
checkBoxRaz.Visible:=true;
LabeledEditAdresse.Text:=intToSTR(Tablo_Action[index].tabloop[indexAction].adresse);
SpinEditEtatop.Value:=Tablo_Action[index].tabloop[indexAction].etat;
checkBoxRAZ.Checked:=Tablo_Action[index].tabloop[indexAction].zero;
end;
ActionVitesse :
begin
LabeledEditAdresse.EditLabel.Caption:='Vitesse';
LabeledEditAdresse.visible:=true;
LabeledEditTrain.Visible:=true;
LabeledEditTrain.EditLabel.Caption:='Train destinataire';
LabeledEditTrain.hint:='Nom unique du train';
LabeledEditAdresse.Text:=intToSTR(Tablo_Action[index].tabloop[indexAction].vitesse);
LabeledEditTrain.Text:=Tablo_Action[index].tabloop[indexAction].train;
end;
ActionCdePeriph :
begin
LabeledEditTrain.Visible:=true;
ComboBoxAccComUSB.Visible:=true;
LabelPeriph.Visible:=true;
LabeledEditTrain.EditLabel.Caption:='Commande';
LabeledEditTrain.Hint:='Commande Ascii';
LabeledEditTrain.Text:=Tablo_Action[index].tabloop[indexAction].chaine;
ComboBoxAccComUSB.itemIndex:=Tablo_Action[index].tabloop[indexAction].periph-1;
end;
ActionFonctionF :
begin
SpinEditEtatop.Visible:=true;
SpinEditEtatop.MinValue:=0;
SpinEditEtatop.MaxValue:=1;
labelEtatOp.Visible:=true;
LabeledEditFonctionF.Visible:=true;
LabeledEditTempoF.Visible:=true;
LabeledEditTrain.EditLabel.Caption:='Train destinataire';
LabeledEditFonctionF.EditLabel.Caption:='Fonction F';
LabeledEditTrain.Visible:=true;
LabeledEditTrain.hint:='Nom unique du train';
SpinEditEtatOp.Text:=IntToSTR(Tablo_Action[index].tabloop[indexAction].etat);
LabeledEditFonctionF.Text:=intToSTR(Tablo_Action[index].tabloop[indexAction].fonctionF);
LabeledEditTempoF.Text:=intToSTR(Tablo_Action[index].tabloop[indexAction].TempoF);
LabeledEditTrain.Text:=Tablo_Action[index].tabloop[indexAction].train;
end;
ActionSon :
begin
LabeledEditTrain.Visible:=true;
SpeedButtonJoue.Visible:=true;
SpeedButtonCharger.Visible:=true;
LabeledEditTrain.EditLabel.Caption:='Son';
LabeledEditTrain.Hint:='fichier son';
LabeledEditTrain.Text:=Tablo_Action[index].tabloop[indexAction].train;
end;
ActionTempo :
begin
LabeledEditTempoF.Visible:=true;
LabeledEditTempoF.EditLabel.Caption:='Temporisation (x100 ms)';
LabeledEditTempoF.Text:=intToSTR(Tablo_Action[index].tabloop[indexAction].TempoF);
end;
ActionBoutonTCO :
begin
LabeledEditAdresse.Visible:=true;
LabeledEditAdresse.EditLabel.Caption:='Bouton';
LabeledEditAdresse.text:=intToSTR(Tablo_Action[index].tabloop[indexAction].adresse);
SpinEditEtatOp.Text:=intToSTR(Tablo_Action[index].tabloop[indexAction].etat);
SpinEditEtatOp.Visible:=true;
SpinEditEtatOp.MinValue:=0;
SpinEditEtatOp.MaxValue:=1;
end;
ActionAffecteMemoire :
begin
LabeledEditAdresse.EditLabel.Caption:='Mémoire';
LabeledEditAdresse.Visible:=true;
LabeledEditAdresse.text:=intToSTR(Tablo_Action[index].tabloop[indexAction].adresse);
SpinEditEtatOp.Text:=intToSTR(Tablo_Action[index].tabloop[indexAction].etat);
SpinEditEtatOp.Visible:=true;
SpinEditEtatOp.MinValue:=-999;
SpinEditEtatOp.MaxValue:=999;
end;
ActionIncMemoire :
begin
LabeledEditAdresse.EditLabel.Caption:='Mémoire';
LabeledEditAdresse.Visible:=true;
LabeledEditAdresse.text:=intToSTR(Tablo_Action[index].tabloop[indexAction].adresse);
end;
ActionDecMemoire :
begin
LabeledEditAdresse.EditLabel.Caption:='Mémoire';
LabeledEditAdresse.Visible:=true;
LabeledEditAdresse.text:=intToSTR(Tablo_Action[index].tabloop[indexAction].adresse);
end;
end;
end;
end;
clicliste:=false;
end;
@@ -1250,6 +1248,7 @@ begin
ItemIndex:=indexSrc+1;
end;
Config_Modifie:=true;
end;
procedure maj_combocactions(i : integer);
@@ -1353,10 +1352,10 @@ end;
procedure TFormModifAction.ListBoxOperationsMouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
//Affiche('Clic ListBoxOperations',clyellow);
if affevt then Affiche('Clic ListBoxOperations',clyellow);
ClicAction:=ListBoxOperations.itemindex;
if ClicAction<0 then exit;
Aff_champs(ligneclicAct+1,1,ClicAction+1);
Affiche_champs_operations(ligneclicAct+1,ClicAction+1);
end;
procedure TFormModifAction.LabeledEditAdresseChange(Sender: TObject);
@@ -1456,6 +1455,7 @@ begin
Tablo_Action[ligneclicAct+1].declencheur:=i+1;
Aff_champs(ligneclicAct+1,0,0);
//aff_champs_declencheur(
ListBoxDeclench.Refresh;
end;
@@ -1739,32 +1739,24 @@ begin
if (nb<1) or clicliste then exit;
if key=VK_delete then supprime_operation;
exit; // interfére,ce avec montée baisse
if ord(Key)=VK_UP then
begin
clicListe:=true;
//with FormModifAction.ListBoxOperations.Items do
begin
if clicAction>0 then
begin
dec(clicaction);
Aff_champs(ligneclicAct+1,ClicCond+1,ClicAction+1);
Formconfig.ListBoxactions.Itemindex:=clicaction;
Affiche_champs_operations(ligneclicAct+1,ClicAction+1);
end;
end;
end;
if ord(Key)=VK_DOWN then
begin
//if clicListe then exit;
clicListe:=true;
//with Formconfig.ListBoxactions.Items do
begin
if clicaction<nb-1 then
begin
inc(clicaction);
Aff_champs(ligneclicAct+1,ClicCond+1,ClicAction+1);
Formconfig.ListBoxactions.Itemindex:=clicaction;
Affiche_champs_operations(ligneclicAct+1,ClicAction+1);
end;
end;
end;
@@ -1785,13 +1777,13 @@ end;
procedure TFormModifAction.ButtonFonctionClick(Sender: TObject);
begin
FoncCourante:=Tablo_Action[ligneClicAct+1].adresse;
if (FoncCourante<=0) or (FoncCourante>NbreFL) then exit;
formModifAction.Close;
formconfig.PageControl.ActivePage:=formconfig.TabSheetFonctions;
FoncCourante:=Tablo_Action[ligneClicAct+1].adresse;
FormConfig.ComboBoxFL.ItemIndex:=FoncCourante-1;
fabrique_treeview(FoncCourante);
formConfig.comboBoxFL.ItemIndex:=FoncCourante-1;
ComboBoxFL_mizajour;
formconfig.show;
end;
+2 -1
View File
@@ -73,6 +73,7 @@ type
// code des aspects des signaux
const
// signaux français
carre =0 ; carre_F=1;
semaphore =1 ; semaphore_F=2;
semaphore_cli =2 ; semaphore_cli_F=4;
@@ -92,7 +93,7 @@ Disque_D =14; // pour d
ral_60_jaune_cli =15;ral_60_jaune_cli_F=32768; // pour décodeur LDT
aspect8 =16 ;
// signal belge
// signaux belges
// base
vert_jaune_H =0 ; vert_jaune_H_F=1; // signal belge
rouge =1 ; rouge_F=2;
+65 -26
View File
@@ -1,6 +1,6 @@
object FormPrinc: TFormPrinc
Left = 103
Top = 192
Left = 80
Top = 204
Width = 1146
Height = 625
Anchors = [akLeft, akTop, akRight]
@@ -11,6 +11,7 @@ object FormPrinc: TFormPrinc
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
KeyPreview = True
Menu = MainMenu1
OldCreateOrder = False
Position = poDefault
@@ -18,10 +19,11 @@ object FormPrinc: TFormPrinc
Visible = True
OnClose = FormClose
OnCreate = FormCreate
OnKeyDown = FormKeyDown
OnResize = FormResize
DesignSize = (
1138
574)
1130
567)
PixelsPerInch = 96
TextHeight = 13
object LabelTitre: TLabel
@@ -1445,8 +1447,8 @@ object FormPrinc: TFormPrinc
end
object StatusBar1: TStatusBar
Left = 0
Top = 552
Width = 1138
Top = 545
Width = 1130
Height = 22
Panels = <
item
@@ -1513,20 +1515,6 @@ object FormPrinc: TFormPrinc
OnChange = FenRichChange
OnMouseDown = FenRichMouseDown
end
object ScrollBoxSig: TScrollBox
Left = 536
Top = 176
Width = 465
Height = 249
HorzScrollBar.Increment = 48
HorzScrollBar.Tracking = True
VertScrollBar.Smooth = True
VertScrollBar.Tracking = True
Anchors = [akTop, akRight]
Color = clSilver
ParentColor = False
TabOrder = 1
end
object GroupBoxAcc: TGroupBox
Left = 497
Top = 5
@@ -1534,7 +1522,7 @@ object FormPrinc: TFormPrinc
Height = 52
Anchors = [akTop, akRight]
Caption = 'Commande d'#39'accessoires'
TabOrder = 2
TabOrder = 1
object Label2: TLabel
Left = 7
Top = 24
@@ -1591,7 +1579,7 @@ object FormPrinc: TFormPrinc
Height = 129
Anchors = [akTop, akRight]
Caption = 'Commande aux trains'
TabOrder = 3
TabOrder = 2
object Label4: TLabel
Left = 8
Top = 22
@@ -1784,6 +1772,7 @@ object FormPrinc: TFormPrinc
Top = 16
Width = 145
Height = 21
Style = csDropDownList
ItemHeight = 13
TabOrder = 3
OnChange = ComboTrainsChange
@@ -1844,7 +1833,7 @@ object FormPrinc: TFormPrinc
Width = 281
Height = 180
Anchors = [akTop, akRight]
TabOrder = 4
TabOrder = 3
DesignSize = (
281
180)
@@ -1986,15 +1975,15 @@ object FormPrinc: TFormPrinc
end
end
object GroupBoxCV: TGroupBox
Left = 561
Top = 40
Left = 753
Top = 32
Width = 265
Height = 129
Anchors = [akTop, akRight]
Caption = 'Variables CV'
Color = clBtnFace
ParentColor = False
TabOrder = 5
TabOrder = 4
object Label3: TLabel
Left = 208
Top = 42
@@ -2049,6 +2038,47 @@ object FormPrinc: TFormPrinc
TabOrder = 3
end
end
object PageControl: TPageControl
Left = 536
Top = 232
Width = 305
Height = 193
ActivePage = TabSheetTrains
TabOrder = 5
object TabSheetSig: TTabSheet
Caption = 'Signaux'
DesignSize = (
297
165)
object ScrollBoxSig: TScrollBox
Left = 0
Top = 4
Width = 137
Height = 161
HorzScrollBar.Increment = 48
HorzScrollBar.Tracking = True
VertScrollBar.Smooth = True
VertScrollBar.Tracking = True
Anchors = [akLeft, akTop, akRight, akBottom]
Color = clSilver
ParentColor = False
TabOrder = 0
end
end
object TabSheetTrains: TTabSheet
Caption = 'Trains'
ImageIndex = 1
object ScrollBoxTrains: TScrollBox
Left = 8
Top = 24
Width = 241
Height = 65
Color = clSilver
ParentColor = False
TabOrder = 0
end
end
end
end
object ButtonEssai: TButton
Left = 504
@@ -2057,6 +2087,7 @@ object FormPrinc: TFormPrinc
Height = 25
Caption = 'Essai'
TabOrder = 2
OnClick = ButtonEssaiClick
end
object Timer1: TTimer
Interval = 100
@@ -2541,4 +2572,12 @@ object FormPrinc: TFormPrinc
OnClientRead = ServerSocketClientRead
Left = 320
end
object PopupMenuTrains: TPopupMenu
OnPopup = PopupMenuTrainsPopup
Left = 1008
object Propritsdutrain1: TMenuItem
Caption = 'Propri'#233't'#233's du train'
OnClick = Propritsdutrain1Click
end
end
end
+636 -122
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -428,7 +428,7 @@ begin
SendMessage(FormRoute.ListBoxRoutes.Handle,LB_SETHORIZONTALEXTENT,PixelLength,0);
// icone train
if idcantonRoute<>0 then Maj_icone_train(FormRoute.ImageTrainR,idTrainCourant);
if idcantonRoute<>0 then Maj_icone_train(FormRoute.ImageTrainR,idTrainCourant,clWhite);
formRoute.ButtonFenPil.enabled:=trains[IdTrainCourant].route[0].adresse<>0;
+2 -2
View File
@@ -4,7 +4,7 @@ object FormRouteTrain: TFormRouteTrain
BorderStyle = bsDialog
Caption = 'Liste des routes affect'#233'es et m'#233'moris'#233'es aux trains'
ClientHeight = 194
ClientWidth = 853
ClientWidth = 850
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
@@ -53,7 +53,7 @@ object FormRouteTrain: TFormRouteTrain
Top = 8
Width = 585
Height = 177
ActivePage = TabSheetRA
ActivePage = TabSheetRM
TabOrder = 1
object TabSheetRA: TTabSheet
Caption = 'Route affect'#233'e'
+7 -6
View File
@@ -197,7 +197,7 @@ begin
vitesse:=GrilleHoraire[i].vitesse;
if trains[indexTrain].route[0].talon then vitesse:=-vitesse;
trains[indexTrain].roulage:=2;
vitesse_loco(train,indextrain,adrTrain,vitesse,10);
vitesse_loco(train,indextrain,adrTrain,vitesse,10,0);
end;
end;
@@ -271,7 +271,7 @@ begin
formRouteTrain.comboBoxTrains.ItemIndex:=indexTrainFR-1;
Maj_icone_train(FormRouteTrain.ImageTrainR,idTrain);
Maj_icone_train(FormRouteTrain.ImageTrainR,idTrain,clWhite);
with formRouteTrain do
begin
TabSheetRM.Enabled:=false;
@@ -329,7 +329,7 @@ procedure TFormRouteTrain.FormActivate(Sender: TObject);
begin
maj_infos(indexTrainFR);
if ntrains>0 then Maj_icone_train(FormRouteTrain.ImageTrainR,indexTrainFR);
if ntrains>0 then Maj_icone_train(FormRouteTrain.ImageTrainR,indexTrainFR,clWhite);
end;
procedure TFormRouteTrain.ButtonQuitteClick(Sender: TObject);
@@ -769,6 +769,7 @@ begin
el2R:=trains[indexTrainFR].routePref[IrPref][2].adresse;
t2R:=trains[indexTrainFR].routePref[IrPref][2].typ;
// canton du départ de la route
IdCanton:=index_canton_det(el1R); // trouve l'index du canton du détecteur el1R (départ de route) = c'est le canton origine de la route
if IdCanton=0 then begin labelRoute.caption:='Le train de départ n''est pas sur un canton';exit;end;
FormRouteTrain.Caption:=trains[indexTrainFR].nom_train+' départ depuis canton '+intToSTR(canton[IdCanton].numero)+' '+canton[idcanton].nom;
@@ -838,7 +839,7 @@ begin
canton[idCantonOrg].Bouton:=0;
dessin_canton(IdCantonOrg,0);
end;
if idcantonOrg<>0 then
if idcantonDest<>0 then
begin
canton[idCantonDest].NumcantonOrg:=0;
canton[idCantonDest].NumcantonDest:=0;
@@ -846,8 +847,8 @@ begin
dessin_canton(IdCantonDest,0);
end;
// affecter le canton origine et destination
canton[IdCanton].bouton:=3;
// affecter le canton origine et destination - IdCanton = canton départ de la route
canton[IdCanton].bouton:=3; // 3 = drapeau vert
n:=trains[indexTrainFR].route[0].adresse ;
detfin:=trains[indexTrainFR].route[n].adresse;
+3 -3
View File
@@ -24,8 +24,8 @@ object FormTCO: TFormTCO
OnKeyPress = FormKeyPress
OnMouseWheel = FormMouseWheel
DesignSize = (
1005
556)
997
548)
PixelsPerInch = 96
TextHeight = 13
object LabelZoom: TLabel
@@ -1299,10 +1299,10 @@ object FormTCO: TFormTCO
Font.Name = 'MS Sans Serif'
Font.Style = []
ParentFont = False
ReadOnly = True
TabOrder = 0
OnChange = EditAdrElementChange
OnClick = EditAdrElementClick
OnExit = EditAdrElementExit
end
object EditTypeImage: TEdit
Left = 184
+32 -16
View File
@@ -405,6 +405,7 @@ type
{ Déclarations privées }
function index_TCOMainMenu : integer;
procedure Mmoiredezone1Click(Sender: TObject);
procedure EditAdrElementExit(Sender: TObject);
public
{ Déclarations publiques }
end;
@@ -1450,7 +1451,6 @@ end;
// remplit les informations du canton avec les éléments adjacents, et des détecteurs adjacents
// et vérifie si le canton ne contient pas de case incorrecte
// Cantons uniquement TCO1
// i : indexCanton
// remplit les champs horizontal, el1,el2,typ1,typ2,sens1,sens2 de canton[]
// et les champs canton1 et canton2 du tableau detecteurs[]
@@ -2446,7 +2446,7 @@ begin
closefile(fichier);
renseigne_tous_cantons;
trier_cantons;
affecte_trains_config;
sauve_styles_tco(indexTCO); // sauver le jeu sombre
if jeucouleurs=2 then jeu_clair(indexTCO);
@@ -14989,6 +14989,7 @@ begin
//Affiche('xClicCell='+intToSTR(XClicCell[indexTCO]),clYellow);
clicTCO:=true;
formTCO[indexTCO].EditAdrElement.Text:=IntToSTR(tco[indextco,XClicCell[indexTCO],YClicCell[indexTCO]].Adresse);
defocusControl(EditAdrElement,true); // pour enlever le curseur
actualise(indexTCO);
clicTCO:=false;
end;
@@ -15290,7 +15291,9 @@ begin
tco[indextco,XClic,YClic].liaisons:=liaisons[icone]; // liaisons des voies
tco[indextco,xClic,YClic].CoulFonte:=clYellow;
tco[indextco,XClicCell[indexTCO],YClicCell[indexTCO]].Repr:=2;
formTCO[indexTCO].EditAdrElement.Text:=IntToSTR(tco[indextco,XClic,YClic].Adresse);
formTCO[indexTCO].EdittypeImage.Text:=IntToSTR(tco[indextco,XClic,YClic].BImage);
end;
@@ -16284,8 +16287,7 @@ begin
else
begin
// detdépart validé : valider le det de destination sauf si route en roulage
if (detatrouve=0) and (bt<=3) and not(ConfCellTCO) and (NbreRoutes=0)
then // bt=3 drapeau vert bt=4 drapeau rouge
if (detatrouve=0) and (bt<=3) and not(ConfCellTCO) and (canton[idCantonClic].NumCantonDest=0) then // bt=3 drapeau vert bt=4 drapeau rouge
begin
if (canton[IdCantonClic].adresseTrain<>0) and (bt<3) then
begin
@@ -16776,6 +16778,7 @@ begin
YclicCellInserer:=YClic;
clicTCO:=true;
EditAdrElement.Text:=IntToSTR(tco[indextco,XClicCellInserer,YClicCellInserer].Adresse);
defocusControl(EditAdrElement,true);
EditTypeImage.Text:=IntToSTR(tco[indextco,XClicCellInserer,YClicCellInserer].Bimage);
CheckPinv.Checked:=tco[indextco,XClicCellInserer,YClicCellInserer].inverse;
clicTCO:=false;
@@ -17081,15 +17084,24 @@ end;
// changement de l'adresse d'un élément
procedure TFormTCO.EditAdrElementChange(Sender: TObject);
var Adr,erreur,index,indexTCO : integer;
var Adr,erreur,indexTCO,Bim : integer;
s: string;
begin
exit;
//Affiche('Chgt adresse',clyellow);
if clicTCO or not(ConfCellTCO) then exit;
clicTCO:=true;
auto_tcurs:=false; // interdit le déplacement du curseur encadré du TCO (pour que les touches curseur s'applique au Tedit)
// exit;
//Affiche('EditAdrElement change',clyellow);
//if clicTCO or not(ConfCellTCO) then exit;
if clicTCO then
begin
HideCaret(EditAdrElement.Handle); // supprime le curseur
exit;
end;
//clicTCO:=true;
indexTCO:=index_TCO(sender);
bim:=tco[indextco,XClicCell[indexTCO],YClicCell[indexTCO]].Bimage;
if bim=0 then exit;
auto_tcurs:=false; // interdit le déplacement du curseur encadré du TCO (pour que les touches curseur s'applique au Tedit)
s:=formTCO[indexTCO].EditAdrElement.Text;
if length(s)>1 then
begin
@@ -17106,17 +17118,16 @@ begin
efface_entoure(indexTCO);
tco[indextco,XClicCell[indexTCO],YClicCell[indexTCO]].Adresse:=Adr;
//formConfCellTCO.editAdrElement.Text:=intToSTR(Adr);
formConfCellTCO.editAdrElement.Text:=intToSTR(Adr);
tco_Modifie:=true;
// si signal
if tco[indextco,XClicCell[indexTCO],YClicCell[indexTCO]].BImage=Id_signal then
begin
index:=Index_Signal(adr);
{index:=Index_Signal(adr);
if index=0 then exit
else
else }
begin
//Affiche('Signal '+intToSTR(Adr),clyellow);
affiche_tco(indexTCO);
end;
end;
@@ -17198,7 +17209,6 @@ begin
end_drag(10,x,y,Sender,Target);
end;
procedure TFormTCO.ImagePalette11EndDrag(Sender, Target: TObject; X,
Y: Integer);
begin
@@ -18739,7 +18749,7 @@ end;
procedure TFormTCO.EditAdrElementClick(Sender: TObject);
begin
auto_tcurs:=false;
// auto_tcurs:=false;
end;
procedure TFormTCO.ImagePalette53DragOver(Sender, Source: TObject; X,
@@ -19224,6 +19234,12 @@ begin
end;
procedure TFormTCO.EditAdrElementExit(Sender: TObject);
begin
auto_tcurs:=true; // réautorise le déplacement du curseur
defocusControl(EditAdrElement,true);
end;
end.
+5 -3
View File
@@ -41,7 +41,7 @@ HauteurLigneSGT=30;
var
FormSelTrain: TFormSelTrain;
x,y,El,largC,hautC,indexTrainClic,LargeurSGT : Integer;
x,y,El,largC,hautC,LargeurSGT,indexTrainClic : Integer;
routeSav : TuneRoute;
procedure actualise_seltrains;
@@ -216,6 +216,7 @@ begin
trains[i].canton:=0;
end;
// Maj_icone_train(Image_Train[i],i,clWhite); // maj arrière plan train page principale
// balayer les détecteurs pour trouver sur quel détecteur est le train pour le razer
// non
@@ -259,7 +260,7 @@ begin
idTrain:=Index_train_adresse(adrTrain);
raz_cantons_train(AdrTrain,false); // efface tous les cantons contenant le train Adrtrain sans raz du détecteur
//Maj_icone_train(Image_Train[idTrain],idTrain,$e0e0e0); // maj arrière plan train page principale
trains[idTrain].canton:=canton[idcanton].numero;
trains[idTrain].sens:=sens;
canton[IdCanton].SensLoco:=sens;
@@ -280,8 +281,10 @@ begin
canton[Idcanton].NomTrain:='';
canton[Idcanton].indexTrain:=0;
canton[IdCanton].adresseTrain:=0;
// a revoir IDTrain=0 !!!! Maj_icone_train(Image_Train[idTrain],idTrain,clWhite);
end;
// affecte le canton avec l'id du train, même si nul
t:=canton[IdCanton].Ntco;
if (t>0) and (t<=nbreTCO) then
begin
@@ -305,7 +308,6 @@ begin
end;
end;
//affiche('Det du canton '+intToSTR(canton[Idcanton].numero)+' det1='+intToSTR(canton[Idcanton].det1)+' det2='+intToSTR(canton[Idcanton].det2),clyellow);
end;
// renvoie x,y El et indexCanton de IdCantonSelect en variable globale
+55 -46
View File
@@ -26,7 +26,7 @@ var
f : text;
Const
VersionSC = '9.77'; // sert à la comparaison de la version publiée
VersionSC = '9.8'; // sert à la comparaison de la version publiée
SousVersion=' '; // A B C ... en cas d'absence de sous version mettre un espace
// pour unzip
SHCONTCH_NOPROGRESSBOX=4;
@@ -39,7 +39,6 @@ SHCONTF_NONFOLDERS=64;
function GetCurrentProcessEnvVar(const VariableName: string): string;
function verifie_version : real;
function DownloadURL_NOCache(aUrl: string;s : string;var taille : longint): Boolean;
function Unzip(zipfile : oleVariant): boolean;
implementation
@@ -173,6 +172,59 @@ begin
log(s+' copié',clLime);
end;
// dézipe un fichier. Si réussi : result=true
function Unzip(zipfile : oleVariant): boolean;
var
shellobj,srcfldr, destfldr, shellfldritems,repertoire: Olevariant;
filtre: string;
i : integer;
erreur : integer;
begin
result:=false;
filtre:='';
zipfile:=lowercase(zipfile);
i:=pos('.zip',zipfile);
if i=0 then
begin
log('Fichier zip : '+zipfile+' incorrect',clred);
exit;
end;
filtre:=zipfile;
delete(filtre,i,4);
// créer le répertoire destination du zip (obligatoire car la commande de dézippe ne le créée pas)
if not(Cree_dir(filtre)) then
begin
log('Création répertoire '+filtre+' impossible',clred);
exit;
end;
repertoire:=filtre; // mettre dans olevariant
filtre:='';
shellobj:=CreateOleObject('Shell.Application');
srcfldr:=ShellObj.NameSpace(Zipfile);
if not((VarType(srcfldr)=varDispatch) and Assigned(TVarData(srcfldr).VDispatch)) then
begin
log('Fichier '+zipfile+ ' invalide ou absent',clred);
exit;
end;
destfldr:=ShellObj.NameSpace(repertoire);
if not ((VarType(destfldr)=varDispatch) and Assigned(TVarData(destfldr).VDispatch)) then
begin
log('Répertoire destination invalide : '+ repertoire,clred);
exit;
end;
shellfldritems:=srcfldr.Items;
if (filtre<>'') then shellfldritems.Filter(SHCONTF_INCLUDEHIDDEN or SHCONTF_NONFOLDERS or SHCONTF_FOLDERS,filtre);
//destfldr.CopyHere(shellfldritems, SHCONTCH_NOPROGRESSBOX or SHCONTCH_RESPONDYESTOALL);
destfldr.CopyHere(shellfldritems, SHCONTCH_RESPONDYESTOALL);
result:=true;
end;
// dézipe copie les fichiers et lance la nouvelle version
// s : chemin et fichier à déziper
@@ -227,6 +279,7 @@ begin
if i>32 then
begin
fermeSC:=true;
Application.Terminate;
end
else
@@ -572,50 +625,6 @@ begin
Result:=(0=ShFileOperation(fos));
end;
function Unzip(zipfile : oleVariant): boolean;
var
shellobj,srcfldr, destfldr, shellfldritems,repertoire: Olevariant;
filtre: string;
i : integer;
erreur : integer;
begin
filtre:='';
zipfile:=lowercase(zipfile);
i:=pos('.zip',zipfile);
if i=0 then exit;
filtre:=zipfile;
delete(filtre,i,4);
// créer le répertoire destination du zip (obligatoire car la commande de dézippe ne le créée pas)
if not(Cree_dir(filtre)) then exit;
repertoire:=filtre; // mettre dans olevariant
filtre:='';
shellobj:=CreateOleObject('Shell.Application');
srcfldr:=ShellObj.NameSpace(Zipfile);
if not((VarType(srcfldr)=varDispatch) and Assigned(TVarData(srcfldr).VDispatch)) then
begin
log('Fichier '+zipfile+ ' invalide ou absent',clred);
result:=false;
exit;
end;
destfldr:=ShellObj.NameSpace(repertoire);
if not ((VarType(destfldr)=varDispatch) and Assigned(TVarData(destfldr).VDispatch)) then
begin
log('Répertoire destination invalide : '+ repertoire,clred);
result:=false;
exit;
end;
shellfldritems:=srcfldr.Items;
if (filtre<>'') then shellfldritems.Filter(SHCONTF_INCLUDEHIDDEN or SHCONTF_NONFOLDERS or SHCONTF_FOLDERS,filtre);
//destfldr.CopyHere(shellfldritems, SHCONTCH_NOPROGRESSBOX or SHCONTCH_RESPONDYESTOALL);
destfldr.CopyHere(shellfldritems, SHCONTCH_RESPONDYESTOALL);
result:=true;
end;
begin
+4 -2
View File
@@ -307,9 +307,11 @@ version 9.75 : Corrections dans le TCO.
version 9.76 : Amélioration de l'importation des réseaux depuis CDM rail.
Correction de l'affichage du réseau CDM en version x64.
Renforcement de la vérification de la configuration.
version 9.77 : Amélioratios diverses.
version 9.77 : Améliorations diverses.
Correction de quelques bugs.
version 9.78 : Correction du déclencheur "démarrage train"
version 9.79 : Corrections et améliorations diverses.
version 9.8 : Intégration des claviers et boutons rotatifs USB