This commit is contained in:
f1iwq2
2024-02-10 10:47:29 +01:00
parent 039f66ed6f
commit b4d968c6ea
15 changed files with 1176 additions and 476 deletions

View File

@@ -123,8 +123,6 @@ type
RadioButtonAccess: TRadioButton;
CheckFenEt: TCheckBox;
GroupBoxDivers: TGroupBox;
EditNbDetDist: TEdit;
Label31: TLabel;
CheckBoxInitAig: TCheckBox;
EditAdrSig: TEdit;
Label32: TLabel;
@@ -213,7 +211,7 @@ type
Label35: TLabel;
Label36: TLabel;
ButtonTestAct: TButton;
RadioGroup1: TRadioGroup;
RadioGroupDecl: TRadioGroup;
RadioButtonActDet: TRadioButton;
RadioButtonZones: TRadioButton;
EditAct2: TEdit;
@@ -224,8 +222,6 @@ type
Label42: TLabel;
Label43: TLabel;
CheckBandeauTCO: TCheckBox;
EditNbCantons: TEdit;
Label44: TLabel;
CheckPosAig: TCheckBox;
ButtonEnregistre: TButton;
CheckBoxDemarUSB: TCheckBox;
@@ -270,9 +266,6 @@ type
EditVitNom: TEdit;
LabelInfVitesse: TLabel;
CheckRoulage: TCheckBox;
GroupBox25: TGroupBox;
Label58: TLabel;
EditFiltrDet: TEdit;
CheckBoxVerifXpressNet: TCheckBox;
ImageTrain: TImage;
PopupMenuRichedit: TPopupMenu;
@@ -353,7 +346,6 @@ type
Label23: TLabel;
Label28: TLabel;
EditPortServeur: TEdit;
ButtonPFCDM: TButton;
CheckBoxZ21: TCheckBox;
RadioButtonDCCpp: TRadioButton;
CheckBoxSombre: TCheckBox;
@@ -361,6 +353,10 @@ type
ColorDialogFond: TColorDialog;
LabelD11: TLabel;
ButtonPropage: TButton;
ButtonPFCDM: TButton;
TabAvance: TTabSheet;
Label31: TLabel;
Label39: TLabel;
procedure ButtonAppliquerEtFermerClick(Sender: TObject);
procedure FormActivate(Sender: TObject);
procedure FormCreate(Sender: TObject);
@@ -574,7 +570,10 @@ PortServeur_ch='Port_Serveur';
procedure EditAdrAigChange(Sender: TObject);
private
{ Déclarations privées }
public
{ Déclarations publiques }
procedure modif_editT(Sender : TObject);
procedure modif_ComboTS(Sender : TObject);
procedure modif_ComboL(Sender : TObject);
@@ -648,7 +647,7 @@ var
nom_dec_pers_ch='Nom_dec_pers';
Nom_fich_TCO_ch='Nom_fichier_TCO';
LargeurF_ch='LargeurF';
HauteurF_ch='HauteurF';
HauteurF_ch='HauteurF';
OffsetXF_ch='OffsetX';
OffsetYF_ch='OffsetY';
PosSplitter_ch='Splitter';
@@ -657,7 +656,7 @@ var
section_aig_ch='[section_aig]';
section_sig_ch='[section_sig]';
section_act_ch='[section_act]';
section_branches_ch='[section_branches]';
section_branches_ch='[section_branches]';
section_dccpp_ch='[section_dcc++]';
section_initpp_ch='[init_dcc++]';
section_trains_ch='[section_trains]';
@@ -668,13 +667,19 @@ var
var
FormConfig: TFormConfig;
AdresseIPCDM,AdresseIP,PortCom,recuCDM,residuCDM : string; //,trainsauve : string;
portCDM,TempoOctet,TimoutMaxInterface,Valeur_entete,PortInterface,prot_serie,NumPort,debug,
LigneCliqueePN,AncLigneCliqueePN,clicMemo,Nb_cantons_Sig,protocole,Port,PortServeur,
ligneclicAig,AncLigneClicAig,ligneClicSig,AncligneClicSig,EnvAigDccpp,AdrBaseDetDccpp,
ligneClicBr,AncligneClicBr,ligneClicAct,AncLigneClicAct,IndexSignalclic,NumTrameCDM,
Algo_localisation,Verif_AdrXpressNet,ligneclicTrain,AncligneclicTrain,AntiTimeoutEthLenz,
ligneDCC,decCourant,AffMemoFenetre,ligneClicAccPeriph,AncligneClicAccPeriph,ligneCherche,
compt_Ligne,Style_aff,Ancien_Style,Ecran_SC,Mode_reserve,Max_Signal_Sens,nCantonsRes : integer;
ligneDCC,decCourant,AffMemoFenetre,ligneClicAccPeriph,AncligneClicAccPeriph,ligneCherche,
ack_cdm,clicliste,config_modifie,clicproprietes,confasauver,trouve_MaxPort,
modif_branches,ConfigPrete,trouve_section_dccpp,trouve_section_trains,trouve_section_acccomusb,
trouveAvecVerifIconesTCO,Affiche_avert,activ,trouve_section_dec_pers : boolean;
fichier : text;
// composants dynamiques
@@ -1037,7 +1042,7 @@ begin
s:=s+')';
end;
if croi then
if croi then
begin
s:=s+'D('+intToSTR(aiguillage[index].Adroit);
c:=aiguillage[index].AdroitB;if (c<>'Z') and (c<>#0) and (c<>' ')then s:=s+c;
@@ -1725,6 +1730,10 @@ begin
end;
function Train_tablo(index : integer) : string;
begin
result:=trains[index].nom_train+','+inttostr(trains[index].adresse)+','+
intToSTR(trains[index].vitmax)+','+intToSTR(trains[index].vitnominale)+','+
intToSTR(trains[index].vitRalenti);
end;
// modifie le fichier de config en fonction du paramétrage
@@ -1734,6 +1743,7 @@ begin
i,j,n,k : integer;
begin
assignFile(fichierN,NomConfig);
rewrite(fichierN);
// entête
// copie_commentaire;
@@ -3171,6 +3181,15 @@ var s,sa,SOrigine: string;
if i=1 then
begin
delete(s,i,length(sa));
val(s,OffsetXF,erreur);
end;
sa:=uppercase(OffsetYF_ch)+'=';
i:=pos(sa,s);
if i=1 then
begin
delete(s,i,length(sa));
val(s,OffsetYF,erreur);
end;
sa:=uppercase(PosSplitter_ch)+'=';
@@ -3188,6 +3207,26 @@ var s,sa,SOrigine: string;
delete(s,i,length(sa));
val(s,filtrageDet0,erreur);
end;
sa:=uppercase(nCantons_Res_ch)+'=';
i:=pos(sa,s);
if i=1 then
begin
delete(s,i,length(sa));
if (i<1) or (i>5) then i:=2;
val(s,nCantonsRes,erreur);
end;
sa:=uppercase(AntiTimeoutEthLenz_ch)+'=';
i:=pos(sa,s);
if i=1 then
begin
delete(s,i,length(sa));
val(s,AntiTimeoutEthLenz,erreur);
end;
sa:=uppercase(Algo_localisation_ch)+'=';
i:=pos(sa,s);
if i=1 then
begin
delete(s,i,length(sa));
@@ -3987,6 +4026,10 @@ begin
if checkRoulage.Checked then
begin
AvecRoulage:=1;
Formprinc.roulage1.visible:=true;
end
else
begin
AvecRoulage:=0;
Formprinc.roulage1.visible:=false;
@@ -4110,6 +4153,14 @@ begin
Srvc_Aig:=CheckBoxServAig.checked;
Srvc_Det:=CheckBoxServDet.checked;
Srvc_Act:=CheckBoxServAct.checked;
Srvc_Pos:=CheckServPosTrains.checked;
Srvc_Sig:=CheckBoxSrvSig.checked;
Raz_Acc_signaux:=CheckBoxRazSignaux.checked;
AvecInitAiguillages:=CheckBoxInitAig.Checked;
AvecDemandeAiguillages:=checkPosAig.checked;
AvecDemandeInterfaceUSB:=CheckBoxDemarUSB.checked;
AvecDemandeInterfaceEth:=CheckBoxDemarEth.checked;
sombre:=CheckBoxSombre.Checked;
protocole:=1;
if RadioButtonXpress.Checked then
@@ -4132,7 +4183,7 @@ procedure clicListeSignal(index : integer);
mode_Reserve:=RadioReserve.ItemIndex; // 0 = par canton - 1=par détecteurs
val(EditAlgo.Text,i,erreur);
Algo_localisation:=i;
val(EditMaxSignalSens.Text,i,erreur);
Max_Signal_Sens:=i;
@@ -4200,6 +4251,7 @@ begin
EditP1.Visible:=false;
EditP2.Visible:=false;
EditP3.Visible:=false;
EditP4.Visible:=false;
LabelTJD1.Visible:=false;
LabelTJD2.Visible:=false;
EditDevieS2.Visible:=false;
@@ -4290,6 +4342,9 @@ begin
RadioButtonXpress.Checked:=protocole=1;
RadioButtonDcc.Checked:=protocole=2;
if NbreDecPers>0 then
ComboBoxNation.Itemindex:=decodeur_pers[1].nation-1;
clicListe:=true; // empeche le traitement de l'evt text
editLAY.Text:=lay;
@@ -4739,6 +4794,13 @@ begin
end;
// onglet cdmrail GB5
for i:=0 to GroupBox5.ComponentCount-1 do
begin
c:=GroupBox5.Components[i];
composant(c,couleurfond,couleurTexte);
end;
// onglet décodeurs
for i:=0 to TabSheetDecodeurs.ComponentCount-1 do
begin
c:=TabSheetDecodeurs.Components[i];
@@ -4759,10 +4821,11 @@ begin
c:=TabSheetPeriph.Components[i];
composant(c,couleurfond,couleurTexte);
end;
// avancé
for i:=0 to TabAvance.ComponentCount-1 do
begin
c:=TabAvance.Components[i];
composant(c,couleurfond,couleurTexte);
end;
end;
@@ -4790,7 +4853,7 @@ begin
begin
if debug=1 then Affiche('Création fenêtre config',clLime);
clicListe:=true;
clicListe:=true;
position:=poMainFormCenter;
cs:='ColorA='+IntToHex(couleurFond,6); // pour rajouter aux couleurs personnalisées de la fenetre couleur
colorDialogFond.CustomColors.Add(cs);
@@ -5487,7 +5550,6 @@ begin
// décodeurs personalisés
for i:=1 to NbreDecPers do
begin
s:=decodeur_pers[i].nom;
s:=decodeur_pers[i].nom;
formconfig.ComboBoxDec.Items.add(s);
end;
@@ -5574,7 +5636,7 @@ begin
RichCdeDccpp.Lines.add(CdeDccpp[i]);
RE_ColorLine(RichCdeDccpp,RichCdeDccpp.lines.count-1,ClAqua);
end;
inc(i);
inc(i);
until (CdeDccpp[i]='') or (i>MaxCdeDccpp);
CheckEnvAigDccpp.Checked:=EnvAigDccpp=1;
@@ -5590,7 +5652,7 @@ begin
with listBoxPeriph do
begin
clear;
formConfig.ComboBoxAccComUSB.Clear;
formConfig.ComboBoxAccComUSB.Clear;
formconfig.ComboBoxPNCom.Clear;
for i:=1 to NbPeriph do
begin
@@ -5601,7 +5663,7 @@ begin
// composants dynamiques car on ne peut plus ajouter de composants en mode conception!
// onglet périphériques COM/USB/Socket
//--------- groupbox
//--------- groupbox
gp1:=TgroupBox.Create(FormConfig.TabSheetPeriph);
with gp1 do
begin
@@ -5613,7 +5675,7 @@ begin
caption:='Services envoyés au périphérique';
Name:='Gp1';
end;
cb2:=TCheckBox.Create(FormConfig.TabSheetPeriph);
with cb2 do
begin
@@ -5700,7 +5762,7 @@ begin
end;
EditPortCde:=TEdit.Create(FormConfig.TabSheetPeriph);
with EditPortCde do
with EditPortCde do
begin
Left:=150;Top:=EditNomPeriph.top+30;Width:=170;Height:=12;
name:='EditPortCde';
@@ -5713,7 +5775,7 @@ begin
OnChange:=formconfig.tb_onChange;
end;
LabelPortCde:=TLabel.Create(FormConfig.TabSheetPeriph);
LabelPortCde:=TLabel.Create(FormConfig.TabSheetPeriph);
with LabelPortCde do
begin
Left:=10;Top:=EditNomPeriph.top+32;Width:=170;Height:=12;
@@ -5728,7 +5790,7 @@ begin
with CheckBoxCR do
begin
Left:=10;Top:=LabelPortCde.Top+30;width:=150;Height:=17;
caption:='Envoyer CR (retour chariot)';
caption:='Envoyer CR (retour chariot)';
name:='CheckBoxCR';
parent:=GroupBoxDesc;
hint:='Envoie un CR après toute chaîne';
@@ -5756,7 +5818,6 @@ begin
with LabelStyle do
begin
Left:=10;Top:=130;Width:=170;Height:=12;
caption:='Styles d''affichage';
caption:='Styles d''affichage';
name:='LabelStyle';
parent:=GroupBoxDivers;
@@ -5765,6 +5826,172 @@ begin
end;
ComboStyle:=TComboBox.create(FormConfig.TabSheetDecodeurs);
with ComboStyle do
begin
Name:='ComboStyle'+intToSTR(i);
left:=130;Top:=LabelStyle.top-2;Width:=150;Height:=13;
text:='';
parent:=GroupBoxDivers;
itemIndex:=-1;
s:='Sélection du style d''affichage - Le style sera changé à la fermeture de la fenêtre';
Hint:=s;
ShowHint:=true;
visible:=true;
Style:=csDropDownList;
onChange:=formConfig.modif_ComboStyle;
end;
// remplir la combobox avec les styles disponibles
for s in TStyleManager.StyleNames do
ComboStyle.Items.Add(s);
ComboStyle.itemIndex:=Style_Aff;
CheckBoxSombre.Visible:=false;
ButtonCouleur.Visible:=false;
{$ELSE} //- Delphi7 -----------------------------------------
labelD11.Visible:=false;
GroupBoxDivers.Height:=180;
{$IFEND}
// onglet avancé
LabelAvance1:=TLabel.Create(FormConfig.TabAvance);
with LabelAvance1 do
begin
Left:=10;Top:=10;Width:=170;Height:=12;
caption:='Paramètres avancés et experts';
name:='LabelAvance1';
Font.Style:=[fsBold];
Font.Size:=10;
parent:=TabAvance;
end;
GroupBoxAvance:=TGroupBox.Create(FormConfig.TabAvance);
with GroupBoxAvance do
begin
Left:=20;Top:=40;Width:=350;Height:=120; // maxi=580
caption:='Jeu de paramètres avancés';
name:='GroupBoxAvance';
parent:=TabAvance;
end;
x:=GroupBoxAvance.width-50;
LabelTD:=TLabel.Create(FormConfig.TabAvance);
with LabelTD do
begin
Left:=10;Top:=30;Width:=170;Height:=12;
caption:='Seuil du nombre de détecteurs trop distants';
name:='LabelTD';
Font.Size:=9;
parent:=GroupBoxAvance;
end;
EditNbDetDist:=TEdit.Create(FormConfig.TabAvance);
with EditNbDetDist do
begin
Left:=x;Top:=28;Width:=30;Height:=15;
name:='EditNbDetDist';
text:='';
parent:=GroupBoxAvance;
hint:='Nombre de détecteurs considérés comme trop distants'+#13+
'Cette valeur dépend de la taille du réseau';
ShowHint:=true;
end;
LabelNC:=TLabel.Create(FormConfig.TabAvance);
with LabelNC do
begin
Left:=10;Top:=50;Width:=170;Height:=12;
caption:='Nombre de cantons présence train avant signal';
name:='LabelNC';
parent:=GroupBoxAvance;
end;
EditNbCantons:=TEdit.Create(TabAvance);
with EditNbCantons do
begin
Left:=x;Top:=48;Width:=30;Height:=15;
name:='EditNbCantons';
text:='';
parent:=GroupBoxAvance;
hint:='Nombre de cantons présence train avant un signal pour le déclarer verrouillé';
ShowHint:=true;
end;
LabelFiltre:=TLabel.Create(FormConfig.TabAvance);
with LabelFiltre do
begin
Left:=10;Top:=70;Width:=170;Height:=12;
caption:='Filtrage des détecteurs (x100 ms)';
name:='LabelFiltre';
parent:=GroupBoxAvance;
end;
EditFiltrDet:=TEdit.Create(TabAvance);
with EditFiltrDet do
begin
Left:=x;Top:=68;Width:=30;Height:=15;
name:='EditFiltrDet';
text:='';
parent:=GroupBoxAvance;
hint:='Temps de filtrage des détecteurs qui passent à 0';
ShowHint:=true;
end;
LabelnCantonsRes:=TLabel.Create(FormConfig.TabAvance);
with LabelnCantonsRes do
begin
Left:=10;Top:=90;Width:=170;Height:=12;
caption:='Nombre de cantons à réserver en avant du train';
name:='LabelnCantonsRes';
parent:=GroupBoxAvance;
end;
EditnCantonsRes:=TEdit.Create(TabAvance);
with EditnCantonsRes do
begin
Left:=x;Top:=88;Width:=30;Height:=15;
name:='EditnCantonsRes';
text:='';
parent:=GroupBoxAvance;
hint:='Nombre de cantons à réserver (1 à 5) en avant du train.'+#13+
'Utilisé en mode roulage ou réservation [sous mode réservation par canton (ci-dessous)].'+#13+
'Cette valeur dépend de la taille du réseau.';
ShowHint:=true;
end;
RadioReserve:=TRadioGroup.Create(TabAvance);
with RadioReserve do
begin
Left:=20;Top:=GroupBoxAvance.top+GroupBoxAvance.Height+20;Width:=GroupBoxAvance.width;Height:=60;
name:='RadioReserve';
Caption:='Réservation des aiguillages';
parent:=TabAvance;
hint:='Choix du mode de réservation des aiguillages par les trains.'+#13+
'La réservation des aiguillages est fonctionelle en mode roulage (mode autonome) ou en mode réservation';
ShowHint:=true;
items.Add('Réservation par canton');
items.Add('Réservation par détecteurs');
end;
GroupBoxExpert:=TGroupBox.Create(FormConfig.TabAvance);
with GroupBoxExpert do
begin
Left:=20;;Width:=350;Height:=100; // maxi=580
Top:=RadioReserve.Top+RadioReserve.Height+20 ;
caption:='Jeu de paramètres experts';
name:='GroupBoxExpert';
parent:=TabAvance;
end;
LabelAlgo:=TLabel.Create(FormConfig.TabAvance);
with LabelAlgo do
begin
Left:=10;Top:=30;Width:=170;Height:=12;
caption:='Algorithme de localisation des trains';
name:='LabelAlgo';
Font.Size:=9;
parent:=GroupBoxExpert;
end;
EditAlgo:=TEdit.Create(FormConfig.TabAvance);
with EditAlgo do
begin
Left:=x;Top:=28;Width:=30;Height:=15;
name:='EditAlgo';
text:='';
parent:=GroupBoxExpert;
hint:='Algorithme de localisation des trains';
ShowHint:=true;
@@ -5826,13 +6053,14 @@ begin
procedure decodeAig(s : string;var adr : integer;var B : char);
var erreur,i : integer;
begin
if s='' then
if s='' then
begin
B:='?';adr:=0;
exit;
end;
if (s[1]='P') or (s[1]='S') or (s[1]='D') then delete(s,1,1);
if s='' then
begin
adr:=0;
B:='Z';
exit;
@@ -5907,7 +6135,7 @@ procedure Aff_champs_aig_tablo(index : integer);
end;
end;
end;
end;
end;
if n=0 then s:=s+'Le périphérique '+intToSTR(ligneClicAccPeriph+1)+' n''est pas utilisé'+#13;
utilisateurs_peripheriques:=s;
@@ -6040,10 +6268,18 @@ begin
EditP4.Text:=intToSTR(aiguillage[index].Ddroit)+aiguillage[index].DdroitB;
if (aiguillage[ind].EtatTJD=4) or tjs then
begin
// droit haut
EditDevie_HD.Text:=intToSTR(aiguillage[id2].Adevie)+aiguillage[id2].AdevieB;
EditDevie_HD.Hint:=TypeElAIg_to_char(aiguillage[id2].Adevie,aiguillage[id2].AdevieB);
begin
// droit haut
EditDevie_HD.Text:=intToSTR(aiguillage[id2].Adevie)+aiguillage[id2].AdevieB;
EditDevie_HD.Hint:=TypeElAIg_to_char(aiguillage[id2].Adevie,aiguillage[id2].AdevieB);
LabelTJD1.Caption:=IntToSTR(adresse);
// droit bas
EditDroit_BD.Text:=intToSTR(aiguillage[id2].Adroit)+aiguillage[Id2].AdroitB;
EditDroit_BD.Hint:=TypeElAIg_to_char(aiguillage[id2].ADroit,aiguillage[Id2].AdroitB);
LabelTJD2.Caption:=IntToSTR(adr2);
end;
if ((aiguillage[ind].EtatTJD=2) and tjd) or croi then
begin
// droit haut
@@ -6090,13 +6326,16 @@ begin
labelcrois.Visible:=true;
end;
// aiguillage normal ou tri
// aiguillage normal ou tri
if (not(tjd) and not(tjs) and not(croi)) or tri then
begin
labelcrois.Visible:=false;
begin
EditL.Visible:=false;
Label20.Visible:=false;
EditL.Visible:=false;
LabelL.Visible:=false;
ComboBoxAig.ItemIndex:=0;
LabelL.Visible:=false;
if not(tri) then
begin
ImageAffiche.Picture.BitMap:=Imageaig.Picture.Bitmap;
EditDevieS2.Visible:=false;
EditAigTriple.Visible:=false;
@@ -6197,8 +6436,12 @@ begin
LabelNomSon.Visible:=false;
end;
end;
procedure positionne;
procedure positionne;
begin
with formconfig do
begin
GroupBoxRadio.Visible:=true;
GroupBoxRadio.top:=16;
GroupBoxRadio.Left:=8;
GroupBoxRadio.Width:=GroupBox13.width-15;
@@ -6575,7 +6818,7 @@ begin
EditSuiv1.Text:=TypeEl_To_char(Signaux[index].Btype_suiv1)+IntToSTR(Signaux[index].Adr_el_suiv1);
EditSuiv1.Hint:=chaine_element(Signaux[index].Btype_suiv1,Signaux[index].Adr_el_suiv1);
j:=Signaux[index].Adr_det2;
j:=Signaux[index].Adr_det2;
if j<>0 then
begin
Editdet2.Text:=IntToSTR(j);EditSuiv2.Text:=TypeEl_To_char(Signaux[index].Btype_suiv2)+IntToSTR(Signaux[index].Adr_el_suiv2);
@@ -6594,7 +6837,7 @@ begin
EditDet4.Text:=IntToSTR(j);EditSuiv4.Text:=TypeEl_To_char(Signaux[index].Btype_suiv4)+IntToSTR(Signaux[index].Adr_el_suiv4);
EditSuiv4.Hint:=chaine_element(Signaux[index].Btype_suiv4,Signaux[index].Adr_el_suiv4);
end
else
else
begin
EditDet4.Text:='';EditSuiv4.Text:='';EditSuiv4.Hint:='';
end;