V8.41
This commit is contained in:
251
UnitConfig.pas
251
UnitConfig.pas
@@ -580,6 +580,7 @@ nb_det_dist_ch='nb_det_dist';
|
||||
{ Déclarations publiques }
|
||||
procedure modif_editT(Sender : TObject);
|
||||
procedure modif_ComboTS(Sender : TObject);
|
||||
procedure modif_ComboL(Sender : TObject);
|
||||
procedure cb_onclick(Sender : Tobject);
|
||||
procedure tb_onChange(sender : TObject);
|
||||
procedure Bt_onclick(sender : Tobject);
|
||||
@@ -647,7 +648,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';
|
||||
@@ -667,13 +668,13 @@ 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,
|
||||
ligneDCC,decCourant,AffMemoFenetre,ligneClicAccPeriph,AncligneClicAccPeriph,ligneCherche,
|
||||
compt_Ligne,Style_aff,Ancien_Style,Ecran_SC : integer;
|
||||
|
||||
ack_cdm,clicliste,config_modifie,clicproprietes,confasauver,trouve_MaxPort,
|
||||
@@ -1100,17 +1101,17 @@ begin
|
||||
function TypeElAIg_to_char(adr : integer;c : char) : string;
|
||||
var s: string;
|
||||
begin
|
||||
if (adr=0) and (c<>'D') and (c<>'S') and (c<>'P') then s:='Buttoir';
|
||||
if (adr=0) and (c<>'D') and (c<>'S') and (c<>'P') then s:='Buttoir';
|
||||
|
||||
if adr<>0 then
|
||||
begin
|
||||
begin
|
||||
if c='P' then s:='pointe de l''aiguillage '+IntToSTR(adr) else
|
||||
if c='S' then s:='position déviée de l''aiguillage '+IntToSTR(adr) else
|
||||
if c='D' then s:='position droite de l''aiguillage '+IntToSTR(adr) else
|
||||
if (c<>'D') and (c<>'S') and (c<>'P') then s:='détecteur '+IntToSTR(adr) else
|
||||
s:='erreur';
|
||||
end;
|
||||
TypeElAIg_to_char:=s;
|
||||
TypeElAIg_to_char:=s;
|
||||
end;
|
||||
|
||||
// transforme le signal du tableau Signaux[] en texte
|
||||
@@ -1225,6 +1226,7 @@ var s,chaine,sa : string;
|
||||
if Signaux[i].contrevoie then s:=s+'1' else s:=s+'0';
|
||||
end;
|
||||
end
|
||||
else
|
||||
// signaux directionnels
|
||||
begin
|
||||
NfeuxDir:=aspect-10;
|
||||
@@ -1269,7 +1271,12 @@ begin
|
||||
for id:=1 to NbreSignaux do
|
||||
begin
|
||||
if Signaux[id].adresse=adresse then
|
||||
begin
|
||||
begin
|
||||
decode_ligne_signal:=false;
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
Delete(s,1,j);
|
||||
|
||||
if adresse>MaxAcc then
|
||||
@@ -1390,13 +1397,12 @@ begin
|
||||
if (j=3) then Signaux[i].Btype_Suiv3:=aig;
|
||||
if (j=4) then Signaux[i].Btype_Suiv4:=aig;
|
||||
delete(s,1,1);
|
||||
end
|
||||
end
|
||||
else
|
||||
begin // détecteur
|
||||
if (j=1) then Signaux[i].Btype_Suiv1:=det;
|
||||
if (j=2) then Signaux[i].Btype_Suiv2:=det;
|
||||
if (j=4) then Signaux[i].Btype_Suiv4:=det;
|
||||
if (j=3) then Signaux[i].Btype_Suiv3:=det;
|
||||
if (j=4) then Signaux[i].Btype_Suiv4:=det;
|
||||
end;
|
||||
Val(s,adr,erreur);
|
||||
@@ -1704,7 +1710,7 @@ var s: string;
|
||||
s:=s+IntToSTR(tablo_PN[i].AdresseOuvre)+',';
|
||||
s:=s+intToSTR(tablo_PN[i].commandeOuvre)+'),';
|
||||
end;
|
||||
|
||||
|
||||
// commande par comusb
|
||||
if tablo_PN[i].TypeCde=1 then
|
||||
begin
|
||||
@@ -1786,6 +1792,9 @@ begin
|
||||
writeln(fichierN,Inter_Car_ch+'=',IntToSTR(TempoOctet));
|
||||
|
||||
// temporisation attente maximale interface
|
||||
writeln(fichierN,Tempo_maxi_ch+'=',IntToSTR(TimoutMaxInterface));
|
||||
|
||||
// entete Valeur_entete
|
||||
writeln(fichierN,Entete_ch+'=',intToSTR(Valeur_entete));
|
||||
|
||||
// avec ou sans initialisation des aiguillages
|
||||
@@ -2110,7 +2119,6 @@ begin
|
||||
begin
|
||||
tablo_index_signal[Signaux[i].adresse]:=i;
|
||||
end;
|
||||
|
||||
|
||||
if formconfig<>nil then
|
||||
begin
|
||||
@@ -3383,7 +3391,6 @@ var s,sa,SOrigine: string;
|
||||
sa:=uppercase(Init_dem_interfaceUSBCOM_ch)+'=';
|
||||
i:=pos(sa,s);
|
||||
if i=1 then
|
||||
begin
|
||||
begin
|
||||
trouve_demcnxCOMUSB:=true;
|
||||
inc(nv);
|
||||
@@ -3571,9 +3578,21 @@ var s,sa,SOrigine: string;
|
||||
end;
|
||||
|
||||
sa:=uppercase(ModeResa_ch)+'=';
|
||||
i:=pos(sa,s);
|
||||
i:=pos(sa,s);
|
||||
if i=1 then
|
||||
begin
|
||||
inc(nv);
|
||||
delete(s,1,length(sa));
|
||||
AvecResa:=s='1'
|
||||
end;
|
||||
|
||||
sa:=uppercase(SERVEUR_INTERFACE_ch)+'=';
|
||||
i:=pos(sa,s);
|
||||
if i=1 then
|
||||
begin
|
||||
inc(nv);
|
||||
trouve_serveur_interface:=true;
|
||||
delete(s,i,length(sa));
|
||||
val(s,i,erreur);
|
||||
ServeurInterfaceCDM:=i;
|
||||
end;
|
||||
@@ -3793,7 +3812,7 @@ begin
|
||||
end;
|
||||
if not(trouve_NOTIF_VERSION) then s:=NOTIF_VERSION_ch;
|
||||
if not(trouve_verif_version) then s:=verif_version_ch;
|
||||
if not(trouve_fonte) then s:=fonte_ch;
|
||||
if not(trouve_fonte) then s:=fonte_ch;
|
||||
|
||||
Nb_Det_Dist:=3;
|
||||
// initialisation des aiguillages avec des valeurs par défaut
|
||||
@@ -3803,6 +3822,7 @@ begin
|
||||
Aiguillage[i].adresse:=0;
|
||||
Aiguillage[i].adrTrain:=0;
|
||||
Aiguillage[i].position:=const_inconnu; // position inconnue
|
||||
Aiguillage[i].PosInit:=const_inconnu; // position inconnue
|
||||
Aiguillage[i].temps:=5;
|
||||
Aiguillage[i].inversionCDM:=0;
|
||||
Aiguillage[i].EtatTJD:=4;
|
||||
@@ -3823,7 +3843,7 @@ begin
|
||||
reset(fichier);
|
||||
except
|
||||
Affiche('Fichier '+NomConfig+' non trouvé : création d''un fichier vide par défaut',clred);
|
||||
Affiche('Fichier '+NomConfig+' non trouvé : création d''un fichier vide par défaut',clred);
|
||||
portcom:='COM3:57600,N,8,1,2';
|
||||
adresseIPCDM:='127.0.0.1';portCDM:=9999;
|
||||
adresseIP:='192.168.1.23';portInterface:=5550;
|
||||
verifVersion:=true;
|
||||
@@ -3873,6 +3893,10 @@ begin
|
||||
if not(trouve_Serveur_interface) then s:=Serveur_interface_ch;
|
||||
if not(trouve_fenetre) then s:=fenetre_ch;
|
||||
if not(trouve_tempo_aig) then s:=tempo_aig_ch;
|
||||
if not(trouve_Algo_Uni) then s:=Algo_unisemaf_ch;
|
||||
if not(trouve_Nb_cantons_Sig) then s:=Nb_cantons_Sig_ch;
|
||||
if not(trouve_dem_aig) then s:=Init_dem_aig_ch;
|
||||
if not(trouve_demcnxCOMUSB) then s:=Init_dem_interfaceUSBCOM_ch;
|
||||
if not(trouve_demcnxEth) then s:=Init_dem_interfaceEth_ch;
|
||||
if not(trouveAvecVerifIconesTCO) then confasauver:=true;
|
||||
|
||||
@@ -3978,6 +4002,10 @@ begin
|
||||
if not(IpOk(s)) and (s<>'0') then begin labelInfo.Caption:='Adresse IP interface Xpressnet incorrecte';ok:=false;end;
|
||||
changeInterface:=s<>AdresseIP;
|
||||
AdresseIP:=s;
|
||||
|
||||
// contrôle port interface
|
||||
val(EditPortLenz.Text,i,erreur);
|
||||
if i=0 then i:=5550;
|
||||
if i>65535 then begin labelInfo.Caption:='Port Interface incorrect';ok:=false;end;
|
||||
changeInterface:=changeInterface or (i<>portinterface);
|
||||
portInterface:=i;
|
||||
@@ -4176,6 +4204,7 @@ begin
|
||||
LabelTJD1.Visible:=false;
|
||||
LabelTJD2.Visible:=false;
|
||||
EditDevieS2.Visible:=false;
|
||||
Label18.Visible:=false;
|
||||
Label20.Visible:=false;
|
||||
if AvecRoulage=1 then LabelInfVitesse.Visible:=false else LabelInfVitesse.Visible:=true;
|
||||
|
||||
@@ -4682,11 +4711,10 @@ begin
|
||||
inc(NbPeriph_COMUSB);
|
||||
if NbPeriph_COMUSB>MaxComUSBPeriph then labelInfo.Caption:='Nombre maxi de périphériques COM/USB atteint';
|
||||
Tablo_periph[i].numComposant:=NbPeriph_COMUSB;
|
||||
Tablo_com_cde[i].NumPeriph:=NbPeriph_COMUSB;
|
||||
end;
|
||||
Tablo_com_cde[i].NumPeriph:=NbPeriph_COMUSB;
|
||||
end;
|
||||
if v=2 then
|
||||
begin
|
||||
inc(NbPeriph_Socket);
|
||||
begin
|
||||
inc(NbPeriph_Socket);
|
||||
if NbPeriph_Socket>MaxComSocketPeriph then labelInfo.Caption:='Nombre maxi de périphériques socket atteint';
|
||||
Tablo_periph[NbPeriph].numComposant:=NbPeriph_socket;
|
||||
@@ -4694,6 +4722,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure couleurs_config;
|
||||
var i : integer;
|
||||
c : tcomponent;
|
||||
@@ -4753,7 +4782,7 @@ begin
|
||||
i:=extract_int(s);
|
||||
if (i<1) or (i>19) or (decCourant<1) then exit;
|
||||
decodeur_pers[decCourant].desc[i].Chcommande:=te;
|
||||
|
||||
|
||||
end;
|
||||
|
||||
procedure TFormConfig.FormCreate(Sender: TObject);
|
||||
@@ -4762,7 +4791,31 @@ begin
|
||||
begin
|
||||
if debug=1 then Affiche('Création fenêtre config',clLime);
|
||||
clicListe:=true;
|
||||
position:=poMainFormCenter;
|
||||
position:=poMainFormCenter;
|
||||
cs:='ColorA='+IntToHex(couleurFond,6); // pour rajouter aux couleurs personnalisées de la fenetre couleur
|
||||
colorDialogFond.CustomColors.Add(cs);
|
||||
ButtonCouleur.Hint:='Change la couleur de fond de toutes les fenêtres de Signaux_Complexes.'+#13+
|
||||
'Utilisez la couleur personnalisée n°1 et après modification,'+#13+
|
||||
'cliquer sur "ajouter aux couleurs personnalisées" qui seule sera sauvegardée';
|
||||
|
||||
Affiche_avert:=false;
|
||||
if affevt then affiche('FormConfig create',clLime);
|
||||
PageControl.ActivePage:=Formconfig.TabSheetCDM; // force le premier onglet sur la page
|
||||
Aig_supprime.Adresse:=0;
|
||||
Signal_Supprime.Adresse:=0;
|
||||
Signal_sauve.adresse:=0;
|
||||
clicListe:=false;
|
||||
ligneCherche:=0;
|
||||
Compt_ligne:=0;
|
||||
ConfigPrete:=true;
|
||||
richBranche.HideSelection:=false; // pour pouvoir copier coller la fenetre
|
||||
//groupBox21.Top:=304;
|
||||
GroupBox21.Left:=8;
|
||||
ButtonPropage.Hint:='Change les adresses dans les points de connexions'+#13+
|
||||
'des aiguillages, des branches et des signaux'+#13+
|
||||
'si on a changé l''adresse d''un aiguillage';
|
||||
if debug=1 then Affiche('Fin création fenêtre config',clLime);
|
||||
|
||||
EditNbreAdr.Text:='2';
|
||||
|
||||
// création des champs dynamiques de l'onglet CDM Rail
|
||||
@@ -6354,24 +6407,23 @@ end;
|
||||
radioButtonZones.Checked:=false;
|
||||
radioButtonAig.Checked:=true;
|
||||
EditAct2.Visible:=false;
|
||||
EditTrainDecl.Visible:=false;
|
||||
EditTrainDecl.Visible:=false;
|
||||
LabelTrain.Visible:=false;
|
||||
editact2.Visible:=false;
|
||||
LabelActionneur.Caption:='Aiguillage';
|
||||
EditEtatActionneur.Hint:='1 ou S=dévié 2 ou D=droit';
|
||||
EditAct.Hint:='Aiguillage ';
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
// transforme une chaine "élément" en une chaine affichable pour le hint
|
||||
// ex chaine_element("A32")=aiguillage 32
|
||||
function chaine_element(Equip : Tequipement;adr : integer) : string;
|
||||
var s: string;
|
||||
case Equip of
|
||||
begin
|
||||
case Equip of
|
||||
aig : s:='Aiguillage ';
|
||||
tjs : s:='Tjs ';
|
||||
tjd : s:='Tjd ';
|
||||
tjs : s:='Tjs ';
|
||||
triple : s:='Aiguillage triple ';
|
||||
det : s:='Détecteur ';
|
||||
@@ -6380,9 +6432,9 @@ begin
|
||||
result:=s+intToSTR(adr);
|
||||
end;
|
||||
|
||||
Procedure aff_champs_signaux(index : integer);
|
||||
// mise à jour des champs du signal d'après le tableau feux
|
||||
Procedure aff_champs_signaux(index : integer);
|
||||
s : string;
|
||||
var j,l,d,p,k,nc,decodeur : integer;
|
||||
s : string;
|
||||
begin
|
||||
if Affevt then affiche('Aff_champs_sig_feux('+intToSTR(index)+')',clyellow);
|
||||
@@ -6392,7 +6444,7 @@ begin
|
||||
|
||||
with formconfig.ImageSignal do
|
||||
begin
|
||||
Picture.Bitmap.TransparentMode:=tmAuto;
|
||||
Picture.Bitmap.TransparentMode:=tmAuto;
|
||||
Picture.Bitmap.TransparentColor:=clblue;
|
||||
Transparent:=true;
|
||||
picture.Bitmap:=Select_dessin_Signal(Signaux[index].aspect);
|
||||
@@ -6407,7 +6459,7 @@ begin
|
||||
EditDet2.Text:=''; EditSuiv2.Text:='';
|
||||
EditDet3.Text:=''; EditSuiv3.Text:='';
|
||||
EditDet4.Text:=''; EditSuiv4.Text:='';
|
||||
ComboBoxDec.ItemIndex:=Signaux[i].decodeur;
|
||||
ComboBoxDec.ItemIndex:=Signaux[index].decodeur;
|
||||
|
||||
decodeur:=Signaux[index].decodeur;
|
||||
ButtonConfigSR.Visible:=false;
|
||||
@@ -6417,7 +6469,7 @@ begin
|
||||
5 : ButtonConfigSR.Visible:=true ; // digikeijs
|
||||
6 : begin
|
||||
EditSpecUni.Visible:=true;
|
||||
LabelUni.Caption:='Spec Unisemaf';
|
||||
LabelUni.Caption:='Spec Unisemaf';
|
||||
LabelUni.Visible:=true;
|
||||
EditSpecUni.Text:=IntToSTR(Signaux[index].Unisemaf);
|
||||
editSpecUni.Hint:='Paramètre de description supplémentaire du décodeur Unisemaf';
|
||||
@@ -6448,7 +6500,7 @@ begin
|
||||
case d of
|
||||
2 : ComboBoxAsp.ItemIndex:=0;
|
||||
3 : ComboBoxAsp.ItemIndex:=1;
|
||||
4 : ComboBoxAsp.ItemIndex:=2;
|
||||
4 : ComboBoxAsp.ItemIndex:=2;
|
||||
5 : ComboBoxAsp.ItemIndex:=3;
|
||||
7 : ComboBoxAsp.ItemIndex:=4;
|
||||
9 : ComboBoxAsp.ItemIndex:=5;
|
||||
@@ -6460,9 +6512,9 @@ begin
|
||||
// affiche ou non les checkbox en fonction de l'aspect
|
||||
if (((d=2) or (d>=5)) and (d<10)) or (d=20) then
|
||||
begin
|
||||
checkBoxFB.Visible:=true;
|
||||
Label69.Visible:=true;
|
||||
MemoBlanc.Visible:=true;
|
||||
checkBoxFB.Visible:=true;
|
||||
Label69.Visible:=true;
|
||||
MemoBlanc.Visible:=true;
|
||||
end
|
||||
else
|
||||
begin
|
||||
@@ -6481,7 +6533,7 @@ begin
|
||||
checkFVC.Visible:=false;
|
||||
checkFRC.Visible:=false;
|
||||
end;
|
||||
|
||||
|
||||
if ((d>3) and (d<10)) or (d=20) then CheckVerrouCarre.Visible:=true else CheckVerrouCarre.Visible:=false;
|
||||
if d=20 then
|
||||
begin
|
||||
@@ -6492,44 +6544,47 @@ begin
|
||||
if Signaux[index].Btype_suiv1=Aig then s:='Permet d''afficher le chevron sur le signal si l''aiguillage '+intToSTR(Signaux[index].Adr_el_suiv1)+' est dévié'
|
||||
else s:='Permet d''afficher le chevron sur le signal si son aiguillage est dévié;'+char(13)+'mais ce signal n''est pas suivi d''un aiguillage';
|
||||
CheckBoxversContrevoie.Hint:=s;
|
||||
CheckBoxFB.caption:='Avec demande Blanc rouge';
|
||||
checkVerrouCarre.Caption:='verrouillable au rouge';
|
||||
CheckBoxFB.caption:='Avec demande Blanc rouge';
|
||||
checkVerrouCarre.Caption:='verrouillable au rouge';
|
||||
checkVerrouCarre.Hint:='Positionne le feu au rouge si aucun train n''est présent 3 cantons avant le signal';
|
||||
checkFVC.visible:=false;
|
||||
checkFRC.visible:=false;
|
||||
checkFVC.visible:=false;
|
||||
checkFRC.visible:=false;
|
||||
end
|
||||
else
|
||||
begin
|
||||
CheckBoxVersContrevoie.Visible:=false;
|
||||
begin
|
||||
CheckBoxVersContrevoie.Visible:=false;
|
||||
CheckBoxContrevoie.Visible:=false;
|
||||
CheckBoxFB.caption:='Avec demande feu blanc';
|
||||
CheckBoxFB.caption:='Avec demande feu blanc';
|
||||
checkVerrouCarre.Caption:='verrouillable au carré';
|
||||
checkVerrouCarre.Hint:='Positionne le feu au carré si aucun train n''est présent 3 cantons avant le signal';
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
// signal normal
|
||||
if not(isDirectionnel(index)) then
|
||||
begin
|
||||
begin
|
||||
Label17.Caption:='Conditions supplémentaires d''affichage du carré par les aiguillages :';
|
||||
label17.Width:=131;
|
||||
LabelDetAss.visible:=true;
|
||||
LabelElSuiv.visible:=true;
|
||||
LabelDetAss.visible:=true;
|
||||
LabelElSuiv.visible:=true;
|
||||
label43.Visible:=true;
|
||||
|
||||
EditDet1.Visible:=true;EditDet2.Visible:=true;EditDet3.Visible:=true;EditDet4.Visible:=true;
|
||||
EditSuiv1.Visible:=true;EditSuiv2.Visible:=true;EditSuiv3.Visible:=true;EditSuiv4.Visible:=true;
|
||||
Label24.Visible:=true; Label25.Visible:=true;Label26.Visible:=true;Label27.Visible:=true;
|
||||
EditDet1.Text:=IntToSTR(Signaux[i].Adr_det1);
|
||||
|
||||
EditDet1.Visible:=true;EditDet2.Visible:=true;EditDet3.Visible:=true;EditDet4.Visible:=true;
|
||||
EditSuiv1.Visible:=true;EditSuiv2.Visible:=true;EditSuiv3.Visible:=true;EditSuiv4.Visible:=true;
|
||||
Label24.Visible:=true; Label25.Visible:=true;Label26.Visible:=true;Label27.Visible:=true;
|
||||
EditDet1.Text:=IntToSTR(Signaux[index].Adr_det1);
|
||||
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;
|
||||
if j<>0 then
|
||||
begin
|
||||
j:=Signaux[i].Adr_det2;
|
||||
Editdet2.Text:=IntToSTR(j);EditSuiv2.Text:=TypeEl_To_char(Signaux[index].Btype_suiv2)+IntToSTR(Signaux[index].Adr_el_suiv2);
|
||||
EditSuiv2.Hint:=chaine_element(Signaux[index].Btype_suiv2,Signaux[index].Adr_el_suiv2);
|
||||
end else begin EditDet2.Text:='';EditSuiv2.Text:='';EditSuiv2.Hint:='';end;
|
||||
j:=Signaux[index].Adr_det3;
|
||||
if j<>0 then
|
||||
begin
|
||||
j:=Signaux[i].Adr_det3;
|
||||
EditDet3.Text:=IntToSTR(j);EditSuiv3.Text:=TypeEl_To_char(Signaux[index].Btype_suiv3)+IntToSTR(Signaux[index].Adr_el_suiv3);
|
||||
EditSuiv3.Hint:=chaine_element(Signaux[index].Btype_suiv3,Signaux[index].Adr_el_suiv3);
|
||||
end
|
||||
else begin EditDet3.Text:='';EditSuiv3.Text:='';EditSuiv3.Hint:='';end;
|
||||
@@ -6542,13 +6597,13 @@ begin
|
||||
else
|
||||
begin
|
||||
EditDet4.Text:='';EditSuiv4.Text:='';EditSuiv4.Hint:='';
|
||||
else begin EditDet4.Text:='';EditSuiv4.Text:='';EditSuiv4.Hint:='';end;
|
||||
end;
|
||||
checkVerrouCarre.Checked:=Signaux[index].VerrouCarre;
|
||||
checkBoxFB.Checked:=Signaux[index].FeuBlanc;
|
||||
checkFVC.Checked:=Signaux[index].checkFV;
|
||||
checkFRC.Checked:=Signaux[index].checkFR;
|
||||
// conditions supplémentaires du carré par aiguillages
|
||||
l:=1;
|
||||
l:=1;
|
||||
repeat
|
||||
nc:=Length(Signaux[index].condcarre[l])-1 ;
|
||||
if nc<>-1 then
|
||||
@@ -6573,14 +6628,14 @@ begin
|
||||
if nc<>-1 then
|
||||
begin
|
||||
s:='';
|
||||
for k:=1 to nc do
|
||||
for k:=1 to nc do
|
||||
begin
|
||||
s:=s+'A'+IntToSTR(Signaux[index].condFeuBlanc[l][k].Adresse)+Signaux[index].condFeuBlanc[l][k].PosAig;
|
||||
if k<nc then s:=s+',';
|
||||
end;
|
||||
end;
|
||||
MemoBlanc.Lines.Add(s);
|
||||
end;
|
||||
inc(l);
|
||||
inc(l);
|
||||
until (nc<=0) or (l>6);
|
||||
// scrolle le MemoCarre sur la première ligne
|
||||
MemoBlanc.SelStart:=0;
|
||||
@@ -9201,7 +9256,7 @@ begin
|
||||
repeat
|
||||
detect:=BrancheN[i][j].Adresse;
|
||||
AncModel:=model;
|
||||
model:=BrancheN[i][j].BType;
|
||||
model:=BrancheN[i][j].BType;
|
||||
if (j=1) and (model<>Aig) and (Model<>Buttoir) then
|
||||
begin
|
||||
Affiche('Erreur 3.1 branche '+intToSTR(i)+' : le premier élément d''une branche doit être un buttoir ou un aiguillage',clred);
|
||||
@@ -9489,7 +9544,7 @@ begin
|
||||
adr:=aiguillage[Indexaig].Adresse;
|
||||
if aiguillage[Indexaig].modele=triple then
|
||||
begin
|
||||
if aiguillage[Indexaig].AdrTriple=0 then
|
||||
if aiguillage[Indexaig].AdrTriple=0 then
|
||||
begin
|
||||
Affiche('Erreur 6.1: 2ème adresse de l''aiguillage triple '+intToSTR(adr)+' non définie',clred);
|
||||
ok:=false;
|
||||
@@ -9502,7 +9557,7 @@ begin
|
||||
affiche('Erreur 6.2: aiguillage '+intToSTR(adr)+' défini deux fois',clred);
|
||||
ok:=false;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
// cohérence 4 : vérifie si doublon signal ou si recouvrement avec un autre signal ou un aiguillage
|
||||
@@ -9560,7 +9615,7 @@ begin
|
||||
repeat
|
||||
nc:=Length(Signaux[j].condcarre[l])-1 ;
|
||||
for k:=1 to nc do
|
||||
begin
|
||||
begin
|
||||
adr:=Signaux[j].condcarre[l][k].Adresse; // adresse de l'aiguillage
|
||||
if index_aig(adr)=0 then
|
||||
begin
|
||||
@@ -9603,6 +9658,11 @@ begin
|
||||
ok:=false;
|
||||
Affiche('Erreur 8.3: Détecteur '+intToSTR(i)+' non existant mais associé au signal '+IntToSTR(Signaux[j].adresse),clred);
|
||||
end;
|
||||
end;
|
||||
|
||||
i:=Signaux[j].Adr_det3;
|
||||
if i<>0 then
|
||||
begin
|
||||
trouve_detecteur(i);
|
||||
if IndexBranche_trouve=0 then
|
||||
begin
|
||||
@@ -10268,6 +10328,25 @@ begin
|
||||
if not(verif_dec_sig(true)) then ok:=false;
|
||||
|
||||
// vérifie dans les branches si on a pas de doublon de détecteur
|
||||
for i:=1 to NbreBranches do
|
||||
begin
|
||||
j:=1;
|
||||
repeat
|
||||
detect:=BrancheN[i][j].Adresse;
|
||||
model:=BrancheN[i][j].BType; // 1= détecteur 2= aiguillage 4=Buttoir
|
||||
|
||||
if model=det then
|
||||
begin
|
||||
k:=j+1;
|
||||
repeat
|
||||
if BrancheN[i][k].Btype=det then
|
||||
begin
|
||||
l:=BrancheN[i][k].Adresse;
|
||||
if detect=l then
|
||||
begin
|
||||
Affiche('Erreur 20 : détecteur '+intToSTR(detect)+' défini plusieurs fois en branche '+intToSTR(i),clred);
|
||||
ok:=false;
|
||||
end;
|
||||
end;
|
||||
inc(k);
|
||||
until (BrancheN[i,k].BType=rien) and (BrancheN[i,k].Adresse=0);
|
||||
@@ -11157,7 +11236,7 @@ begin
|
||||
selStart:=curseur; // remettre le curseur en position initiale
|
||||
end;
|
||||
end;
|
||||
clicListe:=false;
|
||||
clicListe:=false;
|
||||
end;
|
||||
|
||||
procedure TFormConfig.ButtonVerifConfigClick(Sender: TObject);
|
||||
@@ -12430,6 +12509,20 @@ begin
|
||||
|
||||
if FormConfig.PageControl.ActivePage=FormConfig.TabSheetSig then
|
||||
begin
|
||||
Signaux[ligneClicSig+1].verscontrevoie:=checkBoxVersContreVoie.Checked;
|
||||
s:=encode_signal(ligneClicSig+1);
|
||||
ListBoxSig.Items[ligneClicSig]:=s;
|
||||
ListBoxSig.selected[ligneClicSig]:=true;
|
||||
Signaux[ligneClicSig+1].modifie:=true;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TFormConfig.CheckBoxContreVoieClick(Sender: TObject);
|
||||
|
||||
var s : string;
|
||||
adr : integer;
|
||||
begin
|
||||
if clicliste or (ligneClicSig<0) then exit;
|
||||
if affevt then Affiche('Evt Contrevoie',clOrange);
|
||||
|
||||
if FormConfig.PageControl.ActivePage=FormConfig.TabSheetSig then
|
||||
@@ -12859,7 +12952,6 @@ begin
|
||||
for i:=1 to NbreSignaux do
|
||||
begin
|
||||
deco:=Signaux[i].decodeur;
|
||||
if deco=supp then
|
||||
if deco=supp then
|
||||
begin
|
||||
Affiche('Le décodeur du signal '+intToSTR(Signaux[i].adresse)+' a été réaffacté à rien',clOrange);
|
||||
@@ -12868,7 +12960,6 @@ begin
|
||||
aff:=true;
|
||||
end;
|
||||
if deco>supp then
|
||||
dec(Signaux[i].decodeur); // et décrémenter les autres décodeurs personnalisés de rang supérieur
|
||||
begin
|
||||
dec(Signaux[i].decodeur); // et décrémenter les autres décodeurs personnalisés de rang supérieur
|
||||
aff:=true;
|
||||
@@ -13699,7 +13790,7 @@ procedure TFormConfig.ColorDialogFondShow(Sender: TObject);
|
||||
begin
|
||||
avecResa:=CheckBoxResa.Checked;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
procedure TFormConfig.EditPortServeurExit(Sender: TObject);
|
||||
|
||||
@@ -13832,12 +13923,12 @@ begin
|
||||
aiguillage[i].AdrTriple:=adresse;
|
||||
Affiche('Réaffectation aiguillage '+intToSTR(aiguillage[i].Adresse)+' triple',clyellow);
|
||||
config_modifie:=true;
|
||||
end;
|
||||
end;
|
||||
if (typ=tjd) or (typ=tjs) or (typ=crois) then
|
||||
begin
|
||||
if aiguillage[i].ADroit=AncienAdresse then
|
||||
begin
|
||||
aiguillage[i].ADroit:=adresse;
|
||||
aiguillage[i].ADroit:=adresse;
|
||||
Affiche('Réaffectation aiguillage '+intToSTR(aiguillage[i].Adresse)+' Adroit',clyellow);
|
||||
config_modifie:=true;
|
||||
end;
|
||||
@@ -13850,14 +13941,28 @@ begin
|
||||
if aiguillage[i].DDroit=AncienAdresse then
|
||||
begin
|
||||
aiguillage[i].DDroit:=adresse;
|
||||
Affiche('Réaffectation aiguillage '+intToSTR(aiguillage[i].Adresse)+' Ddroit',clyellow);
|
||||
Affiche('Réaffectation aiguillage '+intToSTR(aiguillage[i].Adresse)+' Ddroit',clyellow);
|
||||
config_modifie:=true;
|
||||
end;
|
||||
if aiguillage[i].DDevie=AncienAdresse then
|
||||
begin
|
||||
aiguillage[i].DDevie:=adresse;
|
||||
Affiche('Réaffectation aiguillage '+intToSTR(aiguillage[i].Adresse)+' Ddevie',clyellow);
|
||||
config_modifie:=true;
|
||||
config_modifie:=true;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
// réaffecte la listebox aiguillages
|
||||
formconfig.ListBoxAig.Clear;
|
||||
for i:=1 to MaxAiguillage do
|
||||
begin
|
||||
s:=encode_aig(i);
|
||||
formConfig.ListBoxAig.Items.AddObject(s, Pointer(clYellow));
|
||||
Aiguillage[i].modifie:=false;
|
||||
end;
|
||||
formconfig.ListBoxAig.itemindex:=0;
|
||||
|
||||
// branches ----------------------------------
|
||||
for i:=1 to NbreBranches do
|
||||
begin
|
||||
@@ -13963,6 +14068,8 @@ begin
|
||||
if ligneclicAig<0 then exit;
|
||||
if FormConfig.PageControl.ActivePage=FormConfig.TabSheetAig then
|
||||
with Formconfig do
|
||||
begin
|
||||
s:=EditAdrAig.Text;
|
||||
Val(s,i,erreur);
|
||||
if (erreur<>0) or (i<=0) or (i>MaxAcc) then
|
||||
begin
|
||||
|
||||
Reference in New Issue
Block a user