This commit is contained in:
f1iwq2
2025-11-06 18:07:27 +01:00
parent 2ef4c7b07a
commit f806646a5d
9 changed files with 129 additions and 44 deletions
+1
View File
@@ -66,6 +66,7 @@ var
Scompteur : TTCompteur; // Scompteur : associé à grande fenetre compteur
ParamCompteur : array[1..3] of record
coulAig,coulGrad,CoulNum,CoulFond,CoulArc : tcolor;
increment : integer; // incrément rapide
end;
VerrouilleCompteur,affTrainCompteur,VitCrans : boolean;
+21 -5
View File
@@ -1573,7 +1573,7 @@ object FormConfig: TFormConfig
Top = 8
Width = 633
Height = 505
ActivePage = TabSheetSig
ActivePage = TabSheetCompt
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack
Font.Height = -11
@@ -3332,7 +3332,7 @@ object FormConfig: TFormConfig
Width = 137
Height = 21
Style = csDropDownList
ItemHeight = 13
ItemHeight = 0
TabOrder = 1
OnChange = ComboBoxDecChange
end
@@ -3463,7 +3463,7 @@ object FormConfig: TFormConfig
Width = 137
Height = 21
Style = csDropDownList
ItemHeight = 13
ItemHeight = 0
TabOrder = 2
OnChange = ComboBoxAspChange
end
@@ -5692,7 +5692,7 @@ object FormConfig: TFormConfig
Left = 312
Top = 72
Width = 249
Height = 265
Height = 289
Caption = 'Param'#232'tres de couleur'
TabOrder = 0
object Label76: TLabel
@@ -5806,6 +5806,22 @@ object FormConfig: TFormConfig
Height = 265
end
end
object LabeledEditCr: TLabeledEdit
Left = 152
Top = 424
Width = 33
Height = 21
Hint = 'Valeur de l'#39'incr'#233'ment en crans de vitesse (1-6)'
EditLabel.Width = 98
EditLabel.Height = 13
EditLabel.Caption = 'Incr'#233'ment de vitesse'
LabelPosition = lpLeft
LabelSpacing = 10
ParentShowHint = False
ShowHint = True
TabOrder = 2
OnChange = LabeledEditCrChange
end
end
object TabSheetPeriph: TTabSheet
Caption = 'P'#233'riph'#233'riques'
@@ -6092,7 +6108,7 @@ object FormConfig: TFormConfig
Top = 328
Width = 329
Height = 110
Hint = 'R'#233'f'#233'rences crois'#233'es de l'#39#39'utilisation des p'#233'riph'#233'riques'
Hint = 'R'#233'f'#233'rences crois'#233'es de l'#39'utilisation des p'#233'riph'#233'riques'
ParentShowHint = False
ReadOnly = True
ShowHint = True
+54 -12
View File
@@ -512,6 +512,7 @@ type
LabeledEditZone: TLabeledEdit;
EditTempoSig: TEdit;
Label15: TLabel;
LabeledEditCr: TLabeledEdit;
procedure ButtonAppliquerEtFermerClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure ListBoxAigMouseDown(Sender: TObject; Button: TMouseButton;
@@ -812,6 +813,7 @@ type
procedure LabeledEditVit3Change(Sender: TObject);
procedure LabeledEditZoneChange(Sender: TObject);
procedure EditTempoSigChange(Sender: TObject);
procedure LabeledEditCrChange(Sender: TObject);
private
{ Déclarations privées }
@@ -1247,7 +1249,8 @@ begin
delete(s,1,i);
val(s,vitesse,i);
if (vitesse<>300) and (vitesse<>1200) and (vitesse<>2400) and (vitesse<>4800) and (vitesse<>9600) and
(vitesse<>19200) and (vitesse<>38400) and (vitesse<>57600) and (vitesse<>115200) and (vitesse<>128000) and (vitesse<>256000) then
(vitesse<>19200) and (vitesse<>38400) and (vitesse<>57600) and (vitesse<>115200) and (vitesse<>128000) and
(vitesse<>230400) and (vitesse<>256000) then
begin
Affiche('Vitesse COM ('+intToSTR(vitesse)+') incorrecte',clred);
result:=false;
@@ -1629,6 +1632,8 @@ begin
begin
inc(NbreSignaux);
Signaux[i].adresse:=adresse;
Signaux[i].AncienEtat:=$ffff;
Signaux[i].AncienAff:=$ffff;
Signaux[i].Tempo:=0;
tablo_Index_Signal[adresse]:=i; // stocker l'index provisoire avant tri
j:=pos(',',s);
@@ -2692,7 +2697,7 @@ begin
writeln(fichierN,'Numeros='+intToHex(ParamCompteur[i].coulNum,6));
writeln(fichierN,'Fond='+intToHex(ParamCompteur[i].coulFond,6));
writeln(fichierN,'Arc='+intToHex(ParamCompteur[i].coulArc,6));
writeln(fichierN,'Increment='+intToSTR(ParamCompteur[i].increment));
end;
writeln(fichierN,'0');
@@ -5136,9 +5141,11 @@ const LessThanValue=-1;
lit_ligne;
if s<>'0' then
begin
lit_ligne;
if pos('=',s)=0 then lit_ligne;
i:=pos('=',s);
delete(s,1,i);
val('$'+s,j,erreur);
ParamCompteur[n].coulAig:=j;
@@ -5165,6 +5172,17 @@ const LessThanValue=-1;
delete(s,1,i);
val('$'+s,j,erreur);
ParamCompteur[n].coulArc:=j;
lit_ligne;
i:=pos('=',s);
if i<>0 then
begin
delete(s,1,i);
val('$'+s,j,erreur);
if (j<1) or (j>6) then j:=3;
ParamCompteur[n].increment:=j;
end;
end;
inc(n);
until (sOrigine='0') or (s='') or (n>=10);
@@ -8696,6 +8714,7 @@ begin
// compteurs
ComboBoxCompt.ItemIndex:=0;
LabeledEditCr.Text:=intToSTR(paramCompteur[1].increment);
FbmcompC:=Tbitmap.create;
init_compteur(1,ImageCtC);
@@ -11032,7 +11051,7 @@ begin
end;
if ss='' then exit;
s:='Voulez-vous supprimer ';
s:='Voulez vous supprimer ';
if n=1 then s:=s+' l''action ' else s:=s+' les actions ';
s:=s+ss+' ?';
@@ -11098,7 +11117,7 @@ begin
end;
if ss='' then exit;
s:='Voulez-vous supprimer';
s:='Voulez vous supprimer';
if n=1 then s:=s+' le PN ' else s:=s+' les PNs ';
s:=s+ss+' ?';
@@ -11248,6 +11267,7 @@ begin
Signaux[i].Aspect:=3;
Signaux[i].decodeur:=0;
Signaux[i].verrouCarre:=false;
Signaux[i].EtatSignal:=$ffff;
Signaux[i].SR[1].sortie0:=1;
Signaux[i].SR[1].sortie1:=6;
Signaux[i].SR[2].sortie0:=2;
@@ -11311,7 +11331,7 @@ begin
end;
if ss='' then exit;
s:='Voulez-vous supprimer ';
s:='Voulez vous supprimer';
if n=1 then s:=s+' le signal ' else s:=s+' les signaux ';
s:=s+ss+' ?';
@@ -12863,7 +12883,7 @@ begin
end;
if ss='' then exit;
s:='Voulez-vous supprimer ';
s:='Voulez vous supprimer ';
if n=1 then s:=s+' l''aiguillage ' else s:=s+' les aiguillages ';
s:=s+ss+' ?';
@@ -14539,7 +14559,7 @@ begin
end;
if ss='' then exit;
s:='Voulez-vous supprimer ';
s:='Voulez vous supprimer ';
if n=1 then s:=s+' le train ' else s:=s+' les trains ';
s:=s+ss+' ?';
@@ -15572,7 +15592,7 @@ begin
end;
if ss='' then exit;
s:='Voulez-vous supprimer';
s:='Voulez vous supprimer';
if n=1 then s:=s+' le périphérique ' else s:=s+' les périphériques ';
s:=s+ss+' ?'+#13;
@@ -16881,7 +16901,7 @@ begin
if Nactionneurs<>0 then
begin
j:=MessageDlg('Voulez-vous supprimer les actionneurs existants?'
j:=MessageDlg('Voulez vous supprimer les actionneurs existants?'
,mtConfirmation,[mbNo,mbYes],0) ;
if j=mrNo then exit;
end;
@@ -16937,7 +16957,7 @@ begin
end;
if ss='' then exit;
s:='Voulez-vous supprimer ';
s:='Voulez vous supprimer ';
if n=1 then s:=s+' le détecteur ' else s:=s+' les détecteurs ';
s:=s+ss+' ?';
@@ -16998,7 +17018,7 @@ begin
end;
if ss='' then exit;
s:='Voulez-vous supprimer ';
s:='Voulez vous supprimer ';
if n=1 then s:=s+' l''actionneur ' else s:=s+' les actionneurs ';
s:=s+ss+' ?';
@@ -19789,6 +19809,28 @@ begin
calcul_equations_coeff(ligneclicTrain+1);
end;
procedure TFormConfig.LabeledEditCrChange(Sender: TObject);
var i,erreur : integer;
begin
val(LabeledEditCr.Text,i,erreur);
if erreur=0 then
begin
LabelErreur.caption:='';
if (i>0) and (i<7) then
begin
paramCompteur[1].increment:=i;
paramCompteur[2].increment:=i;
paramCompteur[3].increment:=i;
end
else
begin
LabelErreur.caption:='Hors limites';
exit;
end;
end;
end;
end.
+3 -3
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
@@ -517,7 +517,7 @@ object FormModifAction: TFormModifAction
Top = 32
Width = 217
Height = 21
ItemHeight = 13
ItemHeight = 0
TabOrder = 0
OnChange = ComboBoxFamilleChange
end
@@ -721,7 +721,7 @@ object FormModifAction: TFormModifAction
Height = 21
Hint = 'Nom du p'#233'riph'#233'rique d'#233'fini dans l'#39'onglet "p'#233'riph'#233'riques COM/USB"'
Style = csDropDownList
ItemHeight = 13
ItemHeight = 0
ParentShowHint = False
ShowHint = True
TabOrder = 4
+7 -2
View File
@@ -810,6 +810,7 @@ begin
EditTrainDecl.Hint:='Chaîne ASCII';
LabelTrain.visible:=true;
labelTrain.Width:=105;
LabelTrain.Caption:='Commande du périphérique';
RichEditInf.Lines.Add('Déclenchement par chaîne ASCII depuis un périphérique COM/USB - Socket');
@@ -922,6 +923,8 @@ begin
EditTrainDecl.Visible:=true;
EdittrainDecl.Hint:='Train déclencheur unique';
EditTrainDecl.Text:=Tablo_Action[index].trainDecl;
labelTrain.Width:=105;
labelTrain.caption:='Train déclencheur';
EditAdr.Text:=IntToSTR(Tablo_Action[index].adresse);
RichEditInf.Lines.Add('Déclenchement par démarrage d''un train');
ImageIcone.Picture:=nil;
@@ -933,8 +936,10 @@ begin
begin
LabelTrain.visible:=true;
EditTrainDecl.Visible:=true;
labelTrain.caption:='Train déclencheur';
EdittrainDecl.Hint:='Train déclencheur unique';
EditTrainDecl.Text:=Tablo_Action[index].trainDecl;
labelTrain.Width:=105;
EditAdr.Text:=IntToSTR(Tablo_Action[index].adresse);
RichEditInf.Lines.Add('Déclenchement par arrêt d''un train');
ImageIcone.Picture:=nil;
@@ -978,8 +983,8 @@ begin
DeclClavier :
begin
LabelAdresse.Visible:=true; // numéro de fonction
LabelAdresse.caption:='Code de touche';
EditAdr.Hint:='Code de touche';
LabelAdresse.caption:='Code ASCII de la touche';
EditAdr.Hint:='Code ASCII de la touche';
ButtonFonction.Visible:=false;
EditAdr.Text:=IntToSTR(tablo_action[index].adresse);
EditAdr.Visible:=true;
+3 -3
View File
@@ -1,6 +1,6 @@
object FormPrinc: TFormPrinc
Left = 330
Top = 216
Left = 272
Top = 402
Anchors = [akLeft, akTop, akRight]
BorderStyle = bsNone
Caption = 'Signaux complexes'
@@ -5965,7 +5965,7 @@ object FormPrinc: TFormPrinc
Top = 200
Width = 393
Height = 265
ActivePage = TabSheetSig
ActivePage = TabSheetComp
Anchors = []
TabOrder = 5
OnChange = PageControlChange
+27 -13
View File
@@ -103,17 +103,16 @@ uses
, psAPI // GetModuleFileNameEx
{$IF CompilerVersion >= 28.0} // si delphi>=12
{$IF CompilerVersion >= 28.0} // si Delphi>=13
,Vcl.Themes // pour les thèmes d'affichage (auric etc)
,Vcl.Styles.Ext // styles étendus
,AdPort, OoMisc // AsyncPro pour COM/USB
,idGlobal // pour utiliser tidBytes
{$ELSE}
{$ELSE} // si Delphi 7
,MSCommLib_TLB // TMSComm pour COM/USB
{$IFEND}
;
type
TFormPrinc = class(TForm)
Timer1: TTimer;
@@ -838,7 +837,7 @@ TparamCompt=record
Raig, // rayon aiguille
Rav, // rayon arc vert (consigne vitesse)
ImgL,ImgH : integer; // larg haut image
idTrain : integer;
idTrain : integer; // affectation au train
AngleFin : integer; // angle maxi du compteur
redX,redY,ComptA,ComptB : single;
end;
@@ -997,7 +996,7 @@ var
SensAig,NbreRoutes,nbreIti,DetAtrouve,DetDepart,iteration,IdActTr,Long_recue,
prec1,prec2,Eprec,Esuiv,param1,param2,param3,MaxParcours,MaxRoutes,tempoBlocUSB,
IdTrainClic,TempoCombo,RayonCompteur,XcentreCompteur,YCentreCompteur,AigCX,AigCY,
IncrCompteur,tickt2,pointeurTaches,Nbre_Interfaces_CDM : integer;
tickt2,pointeurTaches,Nbre_Interfaces_CDM : integer;
ack,portCommOuvert,traceTrames,AffMem,CDM_connecte,dupliqueEvt,affiche_retour_dcc,
Raz_Acc_signaux,AvecTCO,terminal,Srvc_Aig,Srvc_Det,Srvc_Act,MasqueBandeauTCO,
@@ -2789,7 +2788,8 @@ begin
val(PortComCde,prot,erreur);
if (_vitesse<>300) and (_vitesse<>1200) and (_vitesse<>2400) and (_vitesse<>4800) and (_vitesse<>9600) and
(_vitesse<>19200) and (_vitesse<>38400) and (_vitesse<>57600) and (_vitesse<>115200) and (_vitesse<>128000) and (_vitesse<>256000) then
(_vitesse<>19200) and (_vitesse<>38400) and (_vitesse<>57600) and (_vitesse<>115200) and (_vitesse<>128000) and
(_vitesse<>230400) and(_vitesse<>256000) then
begin
Affiche('Vitesse périphérique COM'+intToSTR(port)+' ('+intToSTR(_vitesse)+') incorrecte',clred);
tablo_periph[index].PortOuvert:=false;
@@ -2882,9 +2882,12 @@ begin
sc:=copy(portComCde,i+1,j-i+1);
val(sc,vitesse,erreur);
if (vitesse<>300) and (vitesse<>1200) and (vitesse<>2400) and (vitesse<>4800) and (vitesse<>9600) and
(vitesse<>19200) and (vitesse<>38400) and (vitesse<>57600) and (vitesse<>115200) and (vitesse<>128000) and (vitesse<>256000) then
(vitesse<>19200) and (vitesse<>38400) and (vitesse<>57600) and (vitesse<>115200) and (vitesse<>128000) and
(vitesse<>256000) then
// 230400) interdits en MSCOMM
begin
Affiche('Vitesse périphérique COM'+intToSTR(port)+' ('+intToSTR(vitesse)+') incorrecte',clred);
if (vitesse=230400) then Affiche('La vitesse 230400 est interdite sur cette version',clred);
tablo_periph[index].PortOuvert:=false;
result:=false;
exit;
@@ -5254,6 +5257,8 @@ var i : integer;
begin
i:=extract_int((Sender as tbutton).Name);
vitesse_loco(trains[i].nom_train,i,trains[i].adresse,0,10,0);
// mettre la trackbar à 0
compteurT[i].tb.Position:=0;
end;
// changement trackbar compteurs groupBox
@@ -17065,7 +17070,7 @@ begin
if (op=ActionCdePeriph) then
begin
v:=Tablo_Action[i].TabloOp[ida].periph; // numéro d'accessoire
Affiche(st+' Envoi commande',clYellow);
Affiche(st+' Envoi commande '+Tablo_Action[i].TabloOp[ida].chaine,clYellow);
af:=com_socket(v);
if af=1 then envoi_periph_usb(i,ida); // numéro d'actionneur
if af=2 then envoi_socket_periph_act(i,ida); // numéro d'actionneur
@@ -17939,7 +17944,7 @@ begin
else
if AffAigND then affiche('Avertissement 47 : un evt accessoire '+intToSTR(adresse)+' non déclaré a été reçu',clOrange);
// evt actionneur d'aiguillage
// evt actionneur d'aiguillage dans actions
for i:=1 to maxTablo_act do
begin
etatAct:=Tablo_Action[i].etat ;
@@ -18204,7 +18209,7 @@ begin
end;
end;
if index<>0 then event_aig(adresse,octet)
if indexAig<>0 then event_aig(adresse,octet)
else
// Serveur envoi au clients
Envoi_serveur('T'+intToSTR(adresse)+','+intToSTR(octet));
@@ -18228,6 +18233,7 @@ begin
end;
pilotage:=octet;
// test si pilotage aiguillage inversé
indexAig:=0;
if (acc=aigP) then
begin
indexAig:=index_aig(adresse);
@@ -20921,7 +20927,11 @@ begin
NbreBlocsUSB:=10;
tickt2:=0;
NumBlocUSB:=1;
IncrCompteur:=3;
paramCompteur[1].increment:=3;
paramCompteur[2].increment:=3;
paramCompteur[3].increment:=3;
NbreFL:=0;
compteur:=1;
etape:=1;
@@ -21854,11 +21864,13 @@ begin
if typetache=ttacheACC then
begin
traite:=true;
// CDM Rail
if dest=ttDestCDM then
begin
if affe then Affiche(chaine,clyellow);
envoi_cdm(chaine); // cdm taches[].chaine
end;
// xpressNet
if dest=ttDestXpressNet then
begin
envoi_ss_ack(chaine); // xpressnet
@@ -21873,6 +21885,7 @@ begin
Affiche('adr='+intToSTR(adresse)+' Sortie '+intToSTR(sortie)+' état = '+intToSTR(etat),clyellow);
end;
end;
// Dccpp
if dest=ttDestDccpp then envoi_ss_ack(chaine);
// lorsque l'action i est traitée, la supprimer, et décaler la liste des taches d'un cran
@@ -21923,7 +21936,7 @@ end;
// timer à 100 ms
procedure TFormPrinc.Timer1Timer(Sender: TObject);
var n,i,j,a,d,longueur,adresseEl,TailleX,TailleY,orientation,indexTCO,x,y,Bimage,aspect,
IdDet,longDet,LongLoco,distArret,vitcons,vitesseABS,delta : integer;
IdDet,longDet,LongLoco,distArret,vitcons,vitesseABS,delta,IncrCompteur : integer;
imageSignal : Timage;
frx,fry : single;
incrementPas,tempsArret,coeff,vitR : single;
@@ -22206,7 +22219,8 @@ begin
begin
//Affiche('Delta '+intToSTR(Delta),clYellow);
a:=abs(delta);
if a>10 then IncrCompteur:=3 else IncrCompteur:=1;
if a>10 then IncrCompteur:=ParamCompteur[1].increment else IncrCompteur:=1;
if a<IncrCompteur then vitesseCompteur:=vitesseCons;
if a>=IncrCompteur then
if vitesseCompteur<vitesseCons then
+1 -1
View File
@@ -26,7 +26,7 @@ var
f : textFile;
Const
VersionSC = '10.76'; // sert à la comparaison de la version publiée
VersionSC = '10.77'; // 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;
+7
View File
@@ -350,6 +350,13 @@ version 10.74 : Traitement du cas TJD abord
Ajout paramètre de temporisation de commande des signaux.
version 10.75 : Amélioration de l'importation des trains depuis CDM rail.
Correction suppression des signaux.
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.