This commit is contained in:
f1iwq2
2025-11-22 10:54:34 +01:00
parent f806646a5d
commit a70da188fd
8 changed files with 309 additions and 111 deletions
Binary file not shown.
+37 -20
View File
@@ -1573,7 +1573,7 @@ object FormConfig: TFormConfig
Top = 8
Width = 633
Height = 505
ActivePage = TabSheetCompt
ActivePage = TabSheetBouton
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack
Font.Height = -11
@@ -2097,7 +2097,7 @@ object FormConfig: TFormConfig
'S'#233'lection du style d'#39#39'affichage - Le style sera chang'#233' '#224' la ferm' +
'eture de la fen'#234'tre'#39
Style = csDropDownList
ItemHeight = 0
ItemHeight = 13
ParentShowHint = False
ShowHint = True
TabOrder = 0
@@ -3303,11 +3303,11 @@ object FormConfig: TFormConfig
WordWrap = True
end
object Label15: TLabel
Left = 56
Top = 44
Left = 64
Top = 46
Width = 171
Height = 13
Caption = 'Temporisation commandes (x100mx)'
Caption = 'Temporisation commandes (x100ms)'
WordWrap = True
end
object MemoCarre: TMemo
@@ -3332,7 +3332,7 @@ object FormConfig: TFormConfig
Width = 137
Height = 21
Style = csDropDownList
ItemHeight = 0
ItemHeight = 13
TabOrder = 1
OnChange = ComboBoxDecChange
end
@@ -3463,7 +3463,7 @@ object FormConfig: TFormConfig
Width = 137
Height = 21
Style = csDropDownList
ItemHeight = 0
ItemHeight = 13
TabOrder = 2
OnChange = ComboBoxAspChange
end
@@ -3779,7 +3779,7 @@ object FormConfig: TFormConfig
Top = 56
Width = 193
Height = 21
ItemHeight = 0
ItemHeight = 13
TabOrder = 0
OnChange = ComboBoxDecodeurPersoChange
end
@@ -3798,7 +3798,7 @@ object FormConfig: TFormConfig
Width = 145
Height = 21
Style = csDropDownList
ItemHeight = 0
ItemHeight = 13
TabOrder = 2
OnChange = ComboBoxNationChange
end
@@ -3844,7 +3844,7 @@ object FormConfig: TFormConfig
Width = 193
Height = 21
Style = csDropDownList
ItemHeight = 0
ItemHeight = 13
TabOrder = 6
OnChange = ComboBoxDecCdeChange
end
@@ -4057,7 +4057,7 @@ object FormConfig: TFormConfig
Top = 96
Width = 137
Height = 21
ItemHeight = 0
ItemHeight = 13
TabOrder = 2
OnChange = ComboBoxOperateurChange
OnDrawItem = ComboBoxOperateurDrawItem
@@ -4077,7 +4077,7 @@ object FormConfig: TFormConfig
Top = 96
Width = 161
Height = 21
ItemHeight = 0
ItemHeight = 13
ParentShowHint = False
ShowHint = True
TabOrder = 4
@@ -4189,7 +4189,7 @@ object FormConfig: TFormConfig
Width = 145
Height = 21
Style = csDropDownList
ItemHeight = 0
ItemHeight = 13
TabOrder = 7
OnChange = ComboBoxFLChange
end
@@ -4739,7 +4739,7 @@ object FormConfig: TFormConfig
Height = 21
Hint = 'Nom de l'#39'accessoire d'#233'fini dans l'#39'onglet "p'#233'riph'#233'riques COM/USB"'
Style = csDropDownList
ItemHeight = 0
ItemHeight = 13
ParentShowHint = False
ShowHint = True
TabOrder = 10
@@ -6329,7 +6329,7 @@ object FormConfig: TFormConfig
end
object GroupBoxBR: TGroupBox
Left = 312
Top = 120
Top = 128
Width = 260
Height = 121
Caption = 'Bouton rotatif'
@@ -6407,11 +6407,11 @@ object FormConfig: TFormConfig
Left = 312
Top = 224
Width = 260
Height = 121
Height = 145
Caption = 'Bouton'
TabOrder = 2
object LabeledEditF: TLabeledEdit
Left = 185
Left = 193
Top = 52
Width = 40
Height = 21
@@ -6428,7 +6428,7 @@ object FormConfig: TFormConfig
OnChange = LabeledEditFChange
end
object LabeledEditFn: TLabeledEdit
Left = 201
Left = 217
Top = 76
Width = 16
Height = 21
@@ -6445,7 +6445,7 @@ object FormConfig: TFormConfig
OnChange = LabeledEditFnChange
end
object LabeledEditCT: TLabeledEdit
Left = 185
Left = 193
Top = 20
Width = 40
Height = 21
@@ -6461,6 +6461,23 @@ object FormConfig: TFormConfig
TabOrder = 2
OnChange = LabeledEditCTChange
end
object LabeledEditT: TLabeledEdit
Left = 193
Top = 108
Width = 40
Height = 21
Hint = 'Temporisation de retomb'#233'e de la fonction F.'
EditLabel.Width = 173
EditLabel.Height = 13
EditLabel.Caption = 'Temporisation de retomb'#233'e (x100ms)'
EditLabel.Layout = tlBottom
LabelPosition = lpLeft
LabelSpacing = 10
ParentShowHint = False
ShowHint = True
TabOrder = 3
OnChange = LabeledEditTChange
end
end
object GroupBoxBloc: TGroupBox
Left = 312
@@ -6482,7 +6499,7 @@ object FormConfig: TFormConfig
Width = 153
Height = 21
Style = csDropDownList
ItemHeight = 0
ItemHeight = 13
TabOrder = 0
OnChange = ComboBoxUSBTrChange
end
+132 -20
View File
@@ -513,6 +513,7 @@ type
EditTempoSig: TEdit;
Label15: TLabel;
LabeledEditCr: TLabeledEdit;
LabeledEditT: TLabeledEdit;
procedure ButtonAppliquerEtFermerClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure ListBoxAigMouseDown(Sender: TObject; Button: TMouseButton;
@@ -814,6 +815,7 @@ type
procedure LabeledEditZoneChange(Sender: TObject);
procedure EditTempoSigChange(Sender: TObject);
procedure LabeledEditCrChange(Sender: TObject);
procedure LabeledEditTChange(Sender: TObject);
private
{ Déclarations privées }
@@ -972,10 +974,12 @@ EtatBoutonTCO=7;
EtatMemoire=8;
EtatZone=9;
NomVAR='Fonction logique';
// Opérateurs des fonctions
NomOpET='Opérateur ET';
NomOpOU='Opérateur OU';
NomOpNonET='Opérateur Non ET';
NomOpNonOU='Opérateur Non OU';
// Variables des fonctions
NomEtatDCC='Etat DCC';
NomEtatDet='Etat détect./actionn.';
NomEtatBoutonTCO='Bouton TCO';
@@ -2673,16 +2677,16 @@ begin
begin
s:='B'+intToSTR(j)+','+blocUSB[j].afftrain+',BR'+intToSTR(blocUSB[j].rotatifM)+','+intToSTR(blocUSB[j].rotatifP)+','+intToSTR(blocUSB[j].clic)+
','+intToSTR(blocUSB[j].increment)+
',B'+intToSTR(blocUSB[j].Bp1)+','+IntToSTR(blocUSB[j].Fbp1)+','+IntToSTR(blocUSB[j].Fnp1)+
',B'+intToSTR(blocUSB[j].Bp2)+','+IntToSTR(blocUSB[j].Fbp2)+','+IntToSTR(blocUSB[j].Fnp2)+
',B'+intToSTR(blocUSB[j].Bp3)+','+IntToSTR(blocUSB[j].Fbp3)+','+IntToSTR(blocUSB[j].Fnp3)+
',B'+intToSTR(blocUSB[j].Bp4)+','+IntToSTR(blocUSB[j].Fbp4)+','+IntToSTR(blocUSB[j].Fnp4)+
',B'+intToSTR(blocUSB[j].Bp5)+','+IntToSTR(blocUSB[j].Fbp5)+','+IntToSTR(blocUSB[j].Fnp5)+
',B'+intToSTR(blocUSB[j].Bp6)+','+IntToSTR(blocUSB[j].Fbp6)+','+IntToSTR(blocUSB[j].Fnp6)+
',B'+intToSTR(blocUSB[j].Bp7)+','+IntToSTR(blocUSB[j].Fbp7)+','+IntToSTR(blocUSB[j].Fnp7)+
',B'+intToSTR(blocUSB[j].Bp8)+','+IntToSTR(blocUSB[j].Fbp8)+','+IntToSTR(blocUSB[j].Fnp8)+
',B'+intToSTR(blocUSB[j].Bp9)+','+IntToSTR(blocUSB[j].Fbp9)+','+IntToSTR(blocUSB[j].Fnp9)+
',B'+intToSTR(blocUSB[j].Bp10)+','+IntToSTR(blocUSB[j].Fbp10)+','+IntToSTR(blocUSB[j].Fnp10);
',B'+intToSTR(blocUSB[j].Bp1)+','+IntToSTR(blocUSB[j].Fbp1)+','+IntToSTR(blocUSB[j].Fnp1)+','+IntToSTR(blocUSB[j].Tbp1)+
',B'+intToSTR(blocUSB[j].Bp2)+','+IntToSTR(blocUSB[j].Fbp2)+','+IntToSTR(blocUSB[j].Fnp2)+','+IntToSTR(blocUSB[j].Tbp2)+
',B'+intToSTR(blocUSB[j].Bp3)+','+IntToSTR(blocUSB[j].Fbp3)+','+IntToSTR(blocUSB[j].Fnp3)+','+IntToSTR(blocUSB[j].Tbp3)+
',B'+intToSTR(blocUSB[j].Bp4)+','+IntToSTR(blocUSB[j].Fbp4)+','+IntToSTR(blocUSB[j].Fnp4)+','+IntToSTR(blocUSB[j].Tbp4)+
',B'+intToSTR(blocUSB[j].Bp5)+','+IntToSTR(blocUSB[j].Fbp5)+','+IntToSTR(blocUSB[j].Fnp5)+','+IntToSTR(blocUSB[j].Tbp5)+
',B'+intToSTR(blocUSB[j].Bp6)+','+IntToSTR(blocUSB[j].Fbp6)+','+IntToSTR(blocUSB[j].Fnp6)+','+IntToSTR(blocUSB[j].Tbp6)+
',B'+intToSTR(blocUSB[j].Bp7)+','+IntToSTR(blocUSB[j].Fbp7)+','+IntToSTR(blocUSB[j].Fnp7)+','+IntToSTR(blocUSB[j].Tbp7)+
',B'+intToSTR(blocUSB[j].Bp8)+','+IntToSTR(blocUSB[j].Fbp8)+','+IntToSTR(blocUSB[j].Fnp8)+','+IntToSTR(blocUSB[j].Tbp8)+
',B'+intToSTR(blocUSB[j].Bp9)+','+IntToSTR(blocUSB[j].Fbp9)+','+IntToSTR(blocUSB[j].Fnp9)+','+IntToSTR(blocUSB[j].Tbp9)+
',B'+intToSTR(blocUSB[j].Bp10)+','+IntToSTR(blocUSB[j].Fbp10)+','+IntToSTR(blocUSB[j].Fnp10)+','+IntToSTR(blocUSB[j].Tbp10);
Writeln(fichierN,s);
end;
writeln(fichierN,'0');
@@ -3019,7 +3023,7 @@ begin
end;
if typ=EtatDet then
begin
s:=s+fonction[fonc,i].train+' '+intToSTR(fonction[fonc,i].adresse)+' '+intToSTR(fonction[fonc,i].etat);
s:=s+intToSTR(fonction[fonc,i].adresse)+' '+intToSTR(fonction[fonc,i].etat)+' '+fonction[fonc,i].train;
end;
if typ=EtatBoutonTCO then
begin
@@ -3044,7 +3048,7 @@ begin
end;
if typ=EtatZone then
begin
s:=s+fonction[fonc,i].train+' '+intToSTR(fonction[fonc,i].adresse)+' '+intToSTR(fonction[fonc,i].adresse2)+' '+intToSTR(fonction[fonc,i].etat);
s:=s+intToSTR(fonction[fonc,i].adresse)+' '+intToSTR(fonction[fonc,i].adresse2)+' '+intToSTR(fonction[fonc,i].etat)+' '+fonction[fonc,i].train;
end;
end;
result:=s;
@@ -5019,7 +5023,7 @@ const LessThanValue=-1;
end;
procedure compile_blocsUSB;
var n,id,i : integer;
var n,id,i,nv : integer;
ss : string;
begin
n:=0;
@@ -5028,6 +5032,7 @@ const LessThanValue=-1;
if s<>'0' then
begin
s:=sOrigine;
nv:=Nbre_virgules(s);
delete(s,1,1);
val(s,i,erreur); // i=numéro de bloc usb de 1 à 10
if i>10 then i:=10;
@@ -5050,11 +5055,16 @@ const LessThanValue=-1;
delete(s,1,1); // supprime B
val(s,j,erreur);delete(s,1,erreur);
blocUsb[i].Bp1:=j;
blocUsb[i].Bp1:=j; // Bouton1 pour fonction F
val(s,j,erreur);delete(s,1,erreur);
blocUsb[i].Fbp1:=j;
blocUsb[i].Fbp1:=j; // Fonction F
val(s,j,erreur);delete(s,1,erreur);
blocUsb[i].Fnp1:=j;
if nv>35 then
begin
val(s,j,erreur);delete(s,1,erreur);
blocUsb[i].tbp1:=j; // valeur de tempo
end;
delete(s,1,1); // supprime B
val(s,j,erreur);delete(s,1,erreur);
@@ -5063,6 +5073,12 @@ const LessThanValue=-1;
blocUsb[i].Fbp2:=j;
val(s,j,erreur);delete(s,1,erreur);
blocUsb[i].Fnp2:=j;
if nv>35 then
begin
val(s,j,erreur);delete(s,1,erreur);
blocUsb[i].tbp2:=j; // valeur de tempo
end;
delete(s,1,1); // supprime B
val(s,j,erreur);delete(s,1,erreur);
@@ -5071,6 +5087,12 @@ const LessThanValue=-1;
blocUsb[i].Fbp3:=j;
val(s,j,erreur);delete(s,1,erreur);
blocUsb[i].Fnp3:=j;
if nv>35 then
begin
val(s,j,erreur);delete(s,1,erreur);
blocUsb[i].tbp3:=j; // valeur de tempo
end;
delete(s,1,1); // supprime B
val(s,j,erreur);delete(s,1,erreur);
@@ -5079,6 +5101,11 @@ const LessThanValue=-1;
blocUsb[i].Fbp4:=j;
val(s,j,erreur);delete(s,1,erreur);
blocUsb[i].Fnp4:=j;
if nv>35 then
begin
val(s,j,erreur);delete(s,1,erreur);
blocUsb[i].tbp4:=j; // valeur de tempo
end;
delete(s,1,1); // supprime B
val(s,j,erreur);delete(s,1,erreur);
@@ -5087,6 +5114,12 @@ const LessThanValue=-1;
blocUsb[i].Fbp5:=j;
val(s,j,erreur);delete(s,1,erreur);
blocUsb[i].Fnp5:=j;
if nv>35 then
begin
val(s,j,erreur);delete(s,1,erreur);
blocUsb[i].tbp5:=j; // valeur de tempo
end;
delete(s,1,1); // supprime B
val(s,j,erreur);delete(s,1,erreur);
@@ -5095,6 +5128,11 @@ const LessThanValue=-1;
blocUsb[i].Fbp6:=j;
val(s,j,erreur);delete(s,1,erreur);
blocUsb[i].Fnp6:=j;
if nv>35 then
begin
val(s,j,erreur);delete(s,1,erreur);
blocUsb[i].tbp6:=j; // valeur de tempo
end;
delete(s,1,1); // supprime B
val(s,j,erreur);delete(s,1,erreur);
@@ -5103,6 +5141,11 @@ const LessThanValue=-1;
blocUsb[i].Fbp7:=j;
val(s,j,erreur);delete(s,1,erreur);
blocUsb[i].Fnp7:=j;
if nv>35 then
begin
val(s,j,erreur);delete(s,1,erreur);
blocUsb[i].tbp7:=j; // valeur de tempo
end;
delete(s,1,1); // supprime B
val(s,j,erreur);delete(s,1,erreur);
@@ -5111,6 +5154,11 @@ const LessThanValue=-1;
blocUsb[i].Fbp8:=j;
val(s,j,erreur);delete(s,1,erreur);
blocUsb[i].Fnp8:=j;
if nv>35 then
begin
val(s,j,erreur);delete(s,1,erreur);
blocUsb[i].tbp8:=j; // valeur de tempo
end;
delete(s,1,1); // supprime B
val(s,j,erreur);delete(s,1,erreur);
@@ -5119,6 +5167,11 @@ const LessThanValue=-1;
blocUsb[i].Fbp9:=j;
val(s,j,erreur);delete(s,1,erreur);
blocUsb[i].Fnp9:=j;
if nv>35 then
begin
val(s,j,erreur);delete(s,1,erreur);
blocUsb[i].tbp9:=j; // valeur de tempo
end;
delete(s,1,1); // supprime B
val(s,j,erreur);delete(s,1,erreur);
@@ -5127,6 +5180,11 @@ const LessThanValue=-1;
blocUsb[i].Fbp10:=j;
val(s,j,erreur);delete(s,1,erreur);
blocUsb[i].Fnp10:=j;
if nv>35 then
begin
val(s,j,erreur);delete(s,1,erreur);
blocUsb[i].tbp10:=j; // valeur de tempo
end;
inc(n);
end;
@@ -7498,13 +7556,26 @@ begin
editAdrIPCDM.Hint:='Adresse IP du PC sur lequel CDM rail s''exécute'+#13+'ou 127.0.0.1 pour indiquer ce pc';
ValueListEditor.Visible:=true;
ImageAffiche.stretch:=true;
ImageAffiche.Transparent:=true;
ImageAffiche.Picture.Bitmap.TransparentMode:=tmAuto;
ImageAffiche.Picture.Bitmap.TransparentColor:=clblue;
LabeledEditT.Hint:='Temporisation de retomnée de la fonction F'+#13+
'en x100 ms'+#13+
'Si 0 : pas de retombée';
ButtonAjOpEnfant.Hint:='Ajoute un opérateur'+#13+'-> ET'+#13+
'-> OU'+#13+
'-> NON_ET'+#13+
'-> NON_OU';
ButtonAjouteVar.Hint:='Ajoute une variable'+#13+'->'+NomFonc[5]+#13+'->'+NomFonc[6]+#13+'->'+NomFonc[7]+#13+'->'+NomFonc[8]+#13+'->'+NomFonc[9];
ButtonAjouteVar.ShowHint:=true;
// liste des paramètres du mode expert de la ValueListEditor
// syntaxe des masques:
// 0 : chiffre 9 : chiffre ou espace # : chiffre ou signe L : lettre ? : lettre ou espace
// A : lettre ou chiffre a : lettre, chiffre ou espace & : tout caractère
with Liste[1] do
begin
Nom:='1. Seuil du nombre de détecteurs trop distants' ;
@@ -8969,9 +9040,7 @@ begin
croi:=pos('CROI',s)<>0 ;
with formconfig do
begin
ImageAffiche.Picture.Bitmap.TransparentMode:=tmAuto;
ImageAffiche.Picture.Bitmap.TransparentColor:=clblue;
ImageAffiche.Transparent:=true;
GroupBoxEtatTJD.Visible:=false;
GroupBox21.Visible:=true;
GroupBox10.Visible:=true;
@@ -9020,6 +9089,8 @@ begin
end;
ImageAffiche.Picture.BitMap:=Imagetjd.Picture.Bitmap;
ImageAffiche.Picture.BitMap.Canvas.Draw(0,0,ImageTJD.Picture.Bitmap);
labelBG.Caption:='S';
Edit_HG.Visible:=true;
EditAigTriple.Visible:=false;
@@ -9121,7 +9192,8 @@ begin
ComboBoxAig.ItemIndex:=0;
if not(tri) then
begin
ImageAffiche.Picture.BitMap:=Imageaig.Picture.Bitmap;
ImageAffiche.Picture.BitMap:=Imagetjd.Picture.Bitmap;
ImageAffiche.Picture.BitMap.Canvas.Draw(0,0,Imageaig.Picture.Bitmap);
EditDevieS2.Visible:=false;
EditAigTriple.Visible:=false;
end;
@@ -9167,7 +9239,10 @@ begin
LabelTJD2.Visible:=false;
EditPointe_BG.ReadOnly:=false;
labelBG.Caption:='P';
ImageAffiche.Picture.BitMap:=ImageTri.Picture.Bitmap;
ImageAffiche.Picture.BitMap.Canvas.Draw(0,0,ImageTri.Picture.Bitmap);
EditDevieS2.Visible:=true;
Label18.Visible:=true;
adr2:=aiguillage[index].AdrTriple;
@@ -19333,6 +19408,7 @@ begin
LabeledEditCT.Text:=intToSTR(blocUSB[NumBlocUSB].Bp1);
LabeledEditF.Text:=intToSTR(blocUSB[NumBlocUSB].Fbp1);
LabeledEditFn.Text:=intToSTR(blocUSB[NumBlocUSB].Fnp1);
LabeledEditT.Text:=intToSTR(blocUSB[NumBlocUSB].Tbp1);
end;
procedure TFormConfig.ShapeB2MouseDown(Sender: TObject;
@@ -19344,6 +19420,7 @@ begin
LabeledEditCT.Text:=intToSTR(blocUSB[NumBlocUSB].Bp2);
LabeledEditF.Text:=intToSTR(blocUSB[NumBlocUSB].Fbp2);
LabeledEditFn.Text:=intToSTR(blocUSB[NumBlocUSB].Fnp2);
LabeledEditT.Text:=intToSTR(blocUSB[NumBlocUSB].Tbp2);
end;
procedure TFormConfig.ShapeB3MouseDown(Sender: TObject;
@@ -19355,6 +19432,7 @@ begin
LabeledEditCT.Text:=intToSTR(blocUSB[NumBlocUSB].Bp3);
LabeledEditF.Text:=intToSTR(blocUSB[NumBlocUSB].Fbp3);
LabeledEditFn.Text:=intToSTR(blocUSB[NumBlocUSB].Fnp3);
LabeledEditT.Text:=intToSTR(blocUSB[NumBlocUSB].Tbp3);
end;
procedure TFormConfig.ShapeB4MouseDown(Sender: TObject;
@@ -19366,6 +19444,7 @@ begin
LabeledEditCT.Text:=intToSTR(blocUSB[NumBlocUSB].Bp4);
LabeledEditF.Text:=intToSTR(blocUSB[NumBlocUSB].Fbp4);
LabeledEditFn.Text:=intToSTR(blocUSB[NumBlocUSB].Fnp4);
LabeledEditT.Text:=intToSTR(blocUSB[NumBlocUSB].Tbp4);
end;
procedure TFormConfig.ShapeB5MousDown(Sender: TObject;
@@ -19377,6 +19456,7 @@ begin
LabeledEditCT.Text:=intToSTR(blocUSB[NumBlocUSB].Bp5);
LabeledEditF.Text:=intToSTR(blocUSB[NumBlocUSB].Fbp5);
LabeledEditFn.Text:=intToSTR(blocUSB[NumBlocUSB].Fnp5);
LabeledEditT.Text:=intToSTR(blocUSB[NumBlocUSB].Tbp5);
end;
procedure TFormConfig.ShapeB6MouseDown(Sender: TObject;
@@ -19388,6 +19468,7 @@ begin
LabeledEditCT.Text:=intToSTR(blocUSB[NumBlocUSB].Bp6);
LabeledEditF.Text:=intToSTR(blocUSB[NumBlocUSB].Fbp6);
LabeledEditFn.Text:=intToSTR(blocUSB[NumBlocUSB].Fnp6);
LabeledEditT.Text:=intToSTR(blocUSB[NumBlocUSB].Tbp6);
end;
procedure TFormConfig.ShapeB7MouseDown(Sender: TObject;
@@ -19399,6 +19480,7 @@ begin
LabeledEditCT.Text:=intToSTR(blocUSB[NumBlocUSB].Bp7);
LabeledEditF.Text:=intToSTR(blocUSB[NumBlocUSB].Fbp7);
LabeledEditFn.Text:=intToSTR(blocUSB[NumBlocUSB].Fnp7);
LabeledEditT.Text:=intToSTR(blocUSB[NumBlocUSB].Tbp7);
end;
procedure TFormConfig.ShapeB8MouseDown(Sender: TObject;
@@ -19410,6 +19492,7 @@ begin
LabeledEditCT.Text:=intToSTR(blocUSB[NumBlocUSB].Bp8);
LabeledEditF.Text:=intToSTR(blocUSB[NumBlocUSB].Fbp8);
LabeledEditFn.Text:=intToSTR(blocUSB[NumBlocUSB].Fnp8);
LabeledEditT.Text:=intToSTR(blocUSB[NumBlocUSB].Tbp8);
end;
procedure TFormConfig.LabeledEditCTChange(Sender: TObject);
@@ -19493,6 +19576,8 @@ begin
LabeledEditClic.Text:='';
LabeledEditF.Text:='';
LabeledEditFn.Text:='';
LabeledEditT.Text:='';
ShapeBR.Brush.Color:=clGray;
shapeB1.Brush.Color:=clGray;
shapeB2.Brush.Color:=clGray;
@@ -19506,6 +19591,32 @@ begin
clic_BRM;
end;
procedure TFormConfig.LabeledEditTChange(Sender: TObject);
var i,erreur : integer;
begin
val(LabeledEditT.Text,i,erreur);
if (erreur<>0) or (i<0) or (i>30) then
begin
labelInfo.Caption:='Erreur : valeur de 0 à 30';
exit;
end;
labelInfo.Caption:='';
case boutonbloc of
1 : blocUSB[NumBlocUSB].Tbp1:=i;
2 : blocUSB[NumBlocUSB].Tbp2:=i;
3 : blocUSB[NumBlocUSB].Tbp3:=i;
4 : blocUSB[NumBlocUSB].Tbp4:=i;
5 : blocUSB[NumBlocUSB].Tbp5:=i;
6 : blocUSB[NumBlocUSB].Tbp6:=i;
7 : blocUSB[NumBlocUSB].Tbp7:=i;
8 : blocUSB[NumBlocUSB].Tbp8:=i;
9 : blocUSB[NumBlocUSB].Tbp9:=i;
10 : blocUSB[NumBlocUSB].Tbp10:=i;
end;
end;
procedure TFormConfig.LabeledEditFChange(Sender: TObject);
var i,erreur : integer;
begin
@@ -19831,6 +19942,7 @@ begin
end;
end;
end.
-1
View File
@@ -16,7 +16,6 @@ object FormPrinc: TFormPrinc
Menu = MainMenu1
OldCreateOrder = False
Position = poDefault
Scaled = False
Visible = True
OnClose = FormClose
OnCreate = FormCreate
+128 -63
View File
@@ -1,5 +1,5 @@
unit Unitprinc;
// 11/06/2025
// 21/11/2025
(********************************************
Programme signaux complexes Graphique Lenz
Composants ClientSocket et ServeurSocket pour les connexions réseau socket
@@ -1174,6 +1174,8 @@ var
Bp1,bp2,bp3,bp4,bp5,bp6,bp7,bp8,bp9,bp10 : integer;
Fbp1,fbp2,fbp3,Fbp4,fbp5,fbp6,Fbp7,fbp8,fbp9,Fbp10 : integer; // fonctions F des BP
Fnp1,fnp2,fnp3,Fnp4,fnp5,fnp6,Fnp7,fnp8,fnp9,Fnp10 : integer; // état F des BP
Tbp1,Tbp2,Tbp3,Tbp4,Tbp5,Tbp6,Tbp7,Tbp8,Tbp9,Tbp10 : integer; // temps de retombée de la fonction F
Tcp : array[1..10] of integer; // valeur courante de la tempo de retombée
end;
Memoire : array[0..MaxMemoires] of integer;
@@ -4995,6 +4997,21 @@ begin
if Signaux[result].adresse<>adresse then result:=0;
end;
// trouve l'index du signal de l'adresse d'un signal qui n'est pas sa première adresse
function index_signal_quelc(adresse : integer) : integer;
var i,adr : integer;
trouve : boolean;
begin
trouve:=false;
adr:=signaux[NbreSignaux].adresse; // adresse du dernier signal
i:=index_signal(adr);
repeat
trouve:=adresse>=signaux[i].Adresse ;
dec(i);
until trouve or (i>NbreSignaux);
if trouve then result:=i+1 else result:=0;
end;
// renvoie l'index de l'aiguillage dans le tableau aiguillages[] en fonction de son adresse
// si pas trouvé renvoie 0
function Index_Aig_V1(adresse : integer) : integer;
@@ -5203,6 +5220,7 @@ begin
font.Style:=[fsBold];
Parent:=Formprinc.ScrollBoxSig;
font.color:=clBlack;
font.size:=round(RedFonte*10);
width:=100;height:=20;
Top:=HtImg+((HtImg+EspY+20)*((rang-1) div NbreImagePLigne));
Left:=10+ (LargImg+5)*((rang-1) mod (NbreImagePLigne));
@@ -5793,8 +5811,9 @@ begin
chaine_CDM_Acc:=so+s;
end;
// ajoute une tache en tableau taches[] pour le timer
// ttache=1 : pilote accessoire...
// ajoute une tache dans le tableau taches[]
// pour pilotage dans le timer. On pilotera une tache par tick timer (1/10ème de s)
// ttache=ttacheAcc (pilote acc), ttacheVit (vitesse train) , ttacheFF (fonctionF) , ttacheTempo (temporisation)
// temporisation pour le timer avant action
// destinataire (1=CDM 2=XpressNet 3=Dccpp)
// commande : chaine de pilotage pour le destinataire
@@ -5943,7 +5962,7 @@ end;
// appellé par le hooker clavier
function traite_code_blocUSB(code: integer) : integer;
var vitesse,f,n,i : integer;
var vitesse,f,n,i,t : integer;
condValide,EtatValide,BlocSelec : boolean;
s : string;
begin
@@ -6060,8 +6079,9 @@ begin
result:=255;
exit;
end;
f:=blocUSB[1].Fbp1; // numéro de fonction F
n:=blocUSB[1].Fnp1;
f:=blocUSB[i].Fbp1; // numéro de fonction F
n:=blocUSB[i].Fnp1;
blocUSB[i].Tcp[1]:=blocUSB[1].Tbp1; // affecter la tempo de retombée à la valeur courante
s:=trains[IdTrainUSB].nom_train;
Affiche('B1 Fonction F'+intToSTR(f)+' à '+intToSTR(n)+' train '+s,clWhite);
envoie_fonction(f,n,s);
@@ -6076,8 +6096,9 @@ begin
result:=255;
exit;
end;
f:=blocUSB[1].Fbp2; // numéro de fonction F
n:=blocUSB[1].Fnp2;
f:=blocUSB[i].Fbp2; // numéro de fonction F
n:=blocUSB[i].Fnp2;
blocUSB[i].Tcp[i]:=blocUSB[1].Tbp2;
s:=trains[IdTrainUSB].nom_train;
Affiche('B2 Fonction F'+intToSTR(f)+' à '+intToSTR(n)+' train '+s,clWhite);
envoie_fonction(f,n,s);
@@ -6092,8 +6113,9 @@ begin
result:=255;
exit;
end;
f:=blocUSB[1].Fbp3; // numéro de fonction F
n:=blocUSB[1].Fnp3;
f:=blocUSB[i].Fbp3; // numéro de fonction F
n:=blocUSB[i].Fnp3;
blocUSB[i].Tcp[3]:=blocUSB[i].Tbp3;
s:=trains[IdTrainUSB].nom_train;
Affiche('B3 Fonction F'+intToSTR(f)+' à '+intToSTR(n)+' train '+s,clWhite);
envoie_fonction(f,n,s);
@@ -6108,8 +6130,9 @@ begin
result:=255;
exit;
end;
f:=blocUSB[1].Fbp4; // numéro de fonction F
n:=blocUSB[1].Fnp4;
f:=blocUSB[i].Fbp4; // numéro de fonction F
n:=blocUSB[i].Fnp4;
blocUSB[i].Tcp[4]:=blocUSB[4].Tbp4;
s:=trains[IdTrainUSB].nom_train;
Affiche('B4 Fonction F'+intToSTR(f)+' à '+intToSTR(n)+' train '+s,clWhite);
envoie_fonction(f,n,s);
@@ -6124,8 +6147,9 @@ begin
result:=255;
exit;
end;
f:=blocUSB[1].Fbp5; // numéro de fonction F
n:=blocUSB[1].Fnp5;
f:=blocUSB[i].Fbp5; // numéro de fonction F
n:=blocUSB[i].Fnp5;
blocUSB[i].Tcp[5]:=blocUSB[i].Tbp5;
s:=trains[IdTrainUSB].nom_train;
Affiche('B4Fonction F'+intToSTR(f)+' à '+intToSTR(n)+' train '+s,clWhite);
envoie_fonction(f,n,s);
@@ -6140,8 +6164,9 @@ begin
result:=255;
exit;
end;
f:=blocUSB[1].Fbp6; // numéro de fonction F
n:=blocUSB[1].Fnp6;
f:=blocUSB[i].Fbp6; // numéro de fonction F
n:=blocUSB[i].Fnp6;
blocUSB[i].Tcp[6]:=blocUSB[i].Tbp6;
s:=trains[IdTrainUSB].nom_train;
Affiche('B6 Fonction F'+intToSTR(f)+' à '+intToSTR(n)+' train '+s,clWhite);
envoie_fonction(f,n,s);
@@ -6156,8 +6181,9 @@ begin
result:=255;
exit;
end;
f:=blocUSB[1].Fbp7; // numéro de fonction F
n:=blocUSB[1].Fnp7;
f:=blocUSB[i].Fbp7; // numéro de fonction F
n:=blocUSB[i].Fnp7;
blocUSB[i].Tcp[7]:=blocUSB[i].Tbp7;
s:=trains[IdTrainUSB].nom_train;
Affiche('B7 Fonction F'+intToSTR(f)+' à '+intToSTR(n)+' train '+s,clWhite);
envoie_fonction(f,n,s);
@@ -6172,8 +6198,9 @@ begin
result:=255;
exit;
end;
f:=blocUSB[1].Fbp8; // numéro de fonction F
n:=blocUSB[1].Fnp8;
f:=blocUSB[i].Fbp8; // numéro de fonction F
n:=blocUSB[i].Fnp8;
blocUSB[i].Tcp[8]:=blocUSB[1].Tbp8;
s:=trains[IdTrainUSB].nom_train;
Affiche('B8 Fonction F'+intToSTR(f)+' à '+intToSTR(n)+' train '+s,clWhite);
envoie_fonction(f,n,s);
@@ -17076,16 +17103,17 @@ begin
if af=2 then envoi_socket_periph_act(i,ida); // numéro d'actionneur
end;
// 12 actionneur pour fonction train
// 12 action pour fonction train
if (op=ActionFonctionF) then
begin
trainDest:=Tablo_Action[i].tabloOp[ida].train ;
// exécution de la fonction F vers CDM
etat:=Tablo_Action[i].tabloop[ida].etat;
tr:=Tablo_Action[i].tabloop[ida].TempoF/10;
t:=Tablo_Action[i].tabloop[ida].TempoF;
tr:=Tablo_Action[i].tabloop[ida].TempoF; // pour affichage uniquement
Affiche(st+' TrainDest='+trainDest+' F'+IntToSTR(Tablo_Action[i].tabloOp[ida].fonctionF)+':'+intToSTR(etat)+' t='+Format('%.1f', [tr])+'s',clyellow);
envoie_fonction(Tablo_Action[i].TabloOp[ida].fonctionF,etat,trainDest);
// Tempo de retombée de la fonction F
Tablo_Action[i].tabloOp[ida].TrainCourant:=trainDest; // pour mémoriser le train pour la retombée de la fonction
Tablo_Action[i].TabloOp[ida].TempoCourante:=Tablo_Action[i].tabloop[ida].TempoF;
end;
@@ -18018,35 +18046,7 @@ begin
end;
end;
// pilote une sortie à 0 à l'interface dont l'adresse est à 1 ou 2 (octet)
procedure Pilote_acc0_X(adresse : integer;octet : byte);
var groupe : integer ;
fonction : byte;
s : string;
begin
if (portCommOuvert or parSocketLenz) then
begin
if debug_dec_sig then AfficheDebug('Tick='+IntToSTR(Tick)+' signal '+intToSTR(adresse)+' '+intToSTR(octet)+' à 0',clorange);
if protocole=1 then
begin
groupe:=(adresse-1) div 4;
fonction:=((adresse-1) mod 4)*2 + (octet-1);
s:=#$52+Char(groupe)+char(fonction or $80); // désactiver la sortie
s:=checksum(s);
if avecAck then envoi(s) else envoi_ss_ack(s);
end;
if protocole=2 then
begin
//la RAZ d'une sortie n'existe pas en DCC+!
end;
end;
if cdm_connecte then
begin
// remise à 0
s:=chaine_CDM_Acc(adresse,0);
envoi_CDM(s);
end;
end;
// envoi d'une chaîne Com_IPC à CDM par socket, puis attend l'ack ou le nack
function envoi_CDM(s : string) : boolean;
@@ -18122,10 +18122,9 @@ begin
s:=chaine_CDM_Acc(adresse,pilotageCDM);
// pilotage actif de l'accessoire----------------
//if acc<>signal then
tache(ttacheAcc,0,ttDestCDM,s);
// TypeTache,tempo,destinataire,chaine
// else tache(ttacheAcc,signaux[index].Tempo,ttDestCDM,s);
if acc<>signal then tache(ttacheAcc,0,ttDestCDM,s) // TypeTache,tempo,destinataire,chaine
else tache(ttacheAcc,signaux[index_signal_quelc(adresse)].Tempo,ttDestCDM,s);
// si l'accessoire est un signal et sans raz des signaux, sortir
if (acc=signal) and not(Raz_Acc_signaux) then exit;
if Acc=AigP then
@@ -18165,9 +18164,9 @@ begin
if debug_dec_sig and (acc=signal) then AfficheDebug('Tick='+IntToSTR(Tick)+' signal '+intToSTR(adresse)+' '+intToSTR(pilotage),clorange);
//if avecAck then envoi(s) else envoi_ss_ack(s); // envoi de la trame avec/sans attente Ack
//if acc<>signal then tache(ttacheAcc,0,ttDestXpressNet,s) else tache(ttacheAcc,signaux[index].Tempo,ttDestCDM,s);
tache(ttacheAcc,0,ttDestXpressNet,s);
if acc<>signal then tache(ttacheAcc,0,ttDestXpressNet,s)
else tache(ttacheAcc,signaux[index_signal_quelc(adresse)].Tempo,ttDestXpressNet,s);
//tache(ttacheAcc,0,ttDestXpressNet,s);
// si l'accessoire est un signal et sans raz des signaux, sortir
if (acc=signal) and not(Raz_Acc_signaux) then exit;
@@ -18218,6 +18217,43 @@ begin
end;
// pilote une sortie à 0 à l'interface dont l'adresse est à 1 ou 2 (octet)
procedure Pilote_acc0_X(adresse : integer;octet : byte);
var groupe : integer ;
fonction : byte;
s : string;
begin
if (portCommOuvert or parSocketLenz) then
begin
if debug_dec_sig then AfficheDebug('Tick='+IntToSTR(Tick)+' signal '+intToSTR(adresse)+' '+intToSTR(octet)+' à 0',clorange);
if protocole=1 then
begin
groupe:=(adresse-1) div 4;
fonction:=((adresse-1) mod 4)*2 + (octet-1);
s:=#$52+Char(groupe)+char(fonction or $80); // désactiver la sortie
s:=checksum(s);
if ModeTache then tache(ttacheAcc,0,ttDestXpressNet,s)
else
begin
if avecAck then envoi(s) else envoi_ss_ack(s);
end;
end;
if protocole=2 then
begin
//la RAZ d'une sortie n'existe pas en DCC+!
end;
end;
if cdm_connecte then
begin
// remise à 0
s:=chaine_CDM_Acc(adresse,0);
if ModeTache then tache(ttacheAcc,0,ttDestCDM,s)
else envoi_CDM(s);
end;
end;
// pilote aiguillage sous condition (accessoire) avec condition : l'aiguillage doit être réservé par AdrTrain (adrTrain<>0) ou sans condition (adrTrain=0)
// acc : AigP (aiguillage) ou signal
function pilote_acc_sc(adresse : integer;octet : byte;Acc : TAccessoire;adrTrain : integer) : boolean;
@@ -20972,14 +21008,18 @@ begin
{$IF CompilerVersion >= 28.0}
RedFonte:=Screen.DefaultPixelsPerInch/Screen.PixelsPerInch; // pour la réduction des fontes : windows mise à l'échelle du texte
FormatSettings:=tFormatSettings.Create;
{$ELSE}
RedFonte:=100/Screen.PixelsPerInch; // pour la réduction des fontes : windows mise à l'échelle du texte
GetLocaleFormatSettings(0,FormatSettings);
{$IFEND}
ButtonEssai.Visible:=not(diffusion);
GetLocaleFormatSettings(0,FormatSettings);
FormatSettings.DecimalSeparator:='.';
ButtonEssai.Visible:=not(diffusion);
FenRich.MaxLength:=$7FFFFFF0;
NbDecodeur:=12;
NbDecodeurdeBase:=NbDecodeur;
@@ -21539,7 +21579,7 @@ end;
{$IF CompilerVersion >= 28.0}
// évènement réception d'une trame sur le port COM USB centrale Xpressnet
// évènement réception d'une trame sur le port COM USB centrale Xpressnet avec Asyncpro
procedure TFormPrinc.RecuInterface(Sender: TObject;Count : word);
var i,tev,l : integer;
s : string;
@@ -22175,6 +22215,31 @@ begin
end;
end;
// tempo retombée fonction F bloc USB
for i:=1 to 10 do
begin
for j:=1 to 10 do
begin
a:=blocUSB[i].tcp[j]; // tempo courante du bouton j du bloc i
if a<>0 then
begin
dec(a);
blocUSB[i].tcp[j]:=a;
if a=0 then
begin
s:=lowercase(blocUSB[i].AffTrain);
// si bloc usb pas affecté à un train
if (s='') or (pos('pas d',s)<>0) then
begin
s:=trains[idTrainClic].nom_train; // nom du train cliqué
end;
envoie_fonction(blocUSB[i].Fbp1,0,s);
Affiche('B='+intToSTR(i)+' Fonction F'+inttoSTR(blocUSB[i].Fbp1)+' à 0 Train '+s,clyellow);
end;
end;
end;
end;
// tempo retombée actionneur
for i:=1 to maxTablo_act do
begin
+1 -1
View File
@@ -26,7 +26,7 @@ var
f : textFile;
Const
VersionSC = '10.77'; // sert à la comparaison de la version publiée
VersionSC = '10.78'; // 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;
+5
View File
@@ -354,6 +354,11 @@ version 10.76 : Ajout du copier/coller des routes de trains.
Correction du bug de la 10.74 sur le pilotage des signaux.
version 10.77 : Amélioration diverses.
Correction du non affichage de la position des aiguillages dans le TCO.
version 10.78 : Correction affichage aiguillages dans l'écran de config des versions D13.
Correction pilotage des décodeurs LEB en mode binaire.
Ajout temps de retombée fonction F trains dans les blocs claviers USB.