This commit is contained in:
f1iwq2
2022-02-21 18:05:29 +01:00
parent e54910f5c0
commit 3455735956
17 changed files with 1074 additions and 485 deletions
+13 -15
View File
@@ -1,6 +1,6 @@
/******************************************
/ fichier de configuration
/ gily - f1iwq - 2018
/ fichier de configuration de ConfigGenerale.log
/ Gily - 2022
/******************************************
/ ce programme permet de commander les signaux complexes avec ou sans
/ CDM rail. Il a trois modes de fonctionnement:
@@ -18,7 +18,7 @@
/
/
/ Taille de la fonte de la fenêtre
Fonte=10
Fonte=16
/
/ Adresse IP V4 du PC sur lequel s'execute CDM : port
IpV4_PC=127.0.0.1:9999
@@ -39,11 +39,9 @@ IPV4_INTERFACE=192.168.1.23:5550
/ voir notice page 29
/
PROTOCOLE_SERIE=COM3:57600,N,8,1,2
/COM8:9600,N,8,1,0
/
/ Temporisation en ms d'envoi entre deux octets de la trame
INTER_CAR=50
/
/ Temporisation maximale de contrôle après non réponse de l'interface, en tranches de 100ms
/ à adapter en fonction de l'interface. Ex 7=700ms d'attente maxi
Tempo_maxi=7
@@ -55,14 +53,11 @@ Tempo_maxi=7
Entete=1
/ ===============================================================================
/
/ Avec (1) ou sans (0) initialisation des aiguillages au démarrage selon le tableau ci après
/ Avec (1) ou sans (0) initialisation des aiguillages au démarrage
Init_Aig=1
/Temporisation entre aiguillages en ms à l'initialisation en mode autonome
Tempo_Aig=100
/
/ Temporisation entre deux commandes aux décodeurs de feux en ms
Tempo_Feu=100
/
/ Fenêtre d'exécution en plein écran (1) ou réduite (0)
Fenetre=0
/
@@ -78,7 +73,6 @@ TCO=0
/ Lancement de CDM Rail au démarrage
CDM=0
/ Nom du fichier LAY à ouvrir depuis CDM sans caractères spéciaux ( : / )
/reseau_gily_signal_ajoute.lay
Lay=RESEAU_GILY_SIGNAL_AJOUTE.LAY
/
/ Démarrage du serveur d'interface automatique
@@ -101,7 +95,9 @@ Serveur_interface=1
/ 5=LI-100
/ 6=GENLI
retro=1
RazSignaux=0
RazSignaux=1
Tempo_Feu=100
Alg_Unisemaf=1
[section_aig]
1,P518,D523,S3P,V30,I0,INIT(9,5)
2,P12S,D519,S5S,V0,I0,INIT(9,5)
@@ -129,7 +125,7 @@ RazSignaux=0
28TJD,D(21D,26D),S(21S,26S),V0,I0,INIT(9,5),E4
29,P10D,D513,S30S,V60,I0,INIT(9,5)
30,P524,D11D,S29D,V0,I0,INIT(9,5)
31,P534,D0,S25P,V0,I0,INIT(9,5)
31,P534,D0,S25P,V60,I0,INIT(9,5)
32,P22S,D0,S24D,V0,I0,INIT(9,5)
0
[section_branches]
@@ -146,6 +142,7 @@ A22,537,A27
A22,A32,A24
A6,516,0
A31,0
A32,0
0
[section_sig]
176,7,0,1,(520,A20),1
@@ -153,7 +150,7 @@ A31,0
204,9,0,1,(527,A7),1
218,7,0,1,(525,A17),0
232,2,1,1,(516,A6),0
260,9,1,1,(518,A1),1
260,9,1,1,(518,A1),0
274,3,0,1,(524,521),0
288,7,0,1,(522,A8),1
302,9,0,1,(526,A9),1
@@ -170,8 +167,9 @@ A31,0
476,9,0,1,(538,A23),1
497,9,0,4,(531,A19),1
600,7,0,0,(521,A8),1
1000,9,0,0,(530,A26),1
1001,9,0,0,(529,A26),1,(A21S,A6D)
1000,9,0,0,(530,A26),0
1001,9,0,0,(529,A26),0
1002,9,0,0,(534,A31),0
0
[section_act]
815,1,CC406526,F2,400
BIN
View File
Binary file not shown.
+3 -3
View File
@@ -3446,13 +3446,13 @@ object FormConfig: TFormConfig
end
object LabelNomSon: TLabel
Left = 16
Top = 24
Top = 40
Width = 91
Height = 13
Caption = 'Nom du fichier son:'
end
object SpeedButtonJoue: TSpeedButton
Left = 88
Left = 80
Top = 64
Width = 41
Height = 33
@@ -3509,7 +3509,7 @@ object FormConfig: TFormConfig
end
object EditSon: TEdit
Left = 16
Top = 40
Top = 48
Width = 177
Height = 21
TabOrder = 4
+111 -39
View File
@@ -359,6 +359,7 @@ Serveur_interface_ch='Serveur_interface';
fenetre_ch='Fenetre';
Tempo_aig_ch='Tempo_Aig';
Tempo_Feu_ch='Tempo_Feu';
Algo_Unisemaf_ch='Alg_Unisemaf';
NOTIF_VERSION_ch='NOTIF_VERSION';
verif_version_ch='verif_version';
Fonte_ch='Fonte';
@@ -673,7 +674,7 @@ begin
encode_aig:=s;
end;
// renvoie un A si BT est un aiguillage
// renvoie un A si BT est un aiguillage (aig, tjd, tjs tri)
function TypeEl_to_char(BT : TEquipement) : string;
begin
case BT of // 1=détecteur 2=aig ou TJD ou TJS 4=tri
@@ -786,20 +787,25 @@ begin
encode_sig_feux:=s;
end;
// décode la ligne de signal et la stocke dans l'index du tableau feux
// décode la ligne de signal et la stocke dans l'index i du tableau feux
procedure decode_ligne_feux(chaine_signal : string;i : integer);
var s,chaine,sa : string;
j,k,l,t,adresse,adr,erreur ,asp,bd: integer;
c : char;
multiple,fini : boolean;
begin
if i=0 then
begin
AfficheDebug('Erreur 670 : index nul',clred);
exit;
end;
s:=chaine_signal;
j:=pos(',',s);
if j>1 then
begin
// adresse de feu
val(s,adresse,erreur);
if adresse=0 then begin affiche('Erreur ligne '+s,clred);exit;end;
if adresse=0 then begin affiche('Erreur 671 ligne '+s,clred);exit;end;
Delete(s,1,j);
feux[i].adresse:=adresse;
j:=pos(',',s);
@@ -814,14 +820,14 @@ begin
val(sa,l,erreur); // nombre de feux du signal directionnel
if l>6 then
begin
Affiche('Ligne '+chaine_signal+' 6 feux maximum pour un panneau directionnel',clred);
Affiche('Erreur 672 ligne '+chaine_signal+' 6 feux maximum pour un panneau directionnel',clred);
exit;
end;
feux[i].aspect:=l+10;Delete(s,1,j);
// décodeur
val(s,adr,erreur);
Feux[i].decodeur:=adr;
if (adr>NbDecodeur-1) then Affiche('Ligne '+chaine_signal+' : erreur décodeur inconnu',clred);
if (adr>NbDecodeur-1) then Affiche('Erreur 673 ligne '+chaine_signal+' : erreur décodeur inconnu',clred);
j:=pos(',',s);Delete(s,1,j);
// liste des aiguillages
k:=1; // numéro de feu directionnel
@@ -830,7 +836,7 @@ begin
delete(s,1,1); // supprimer ( ou le ,
j:=1; // Nombre de descriptions d'aiguillages dans le feu
repeat
if s[1]<>'A' then begin Affiche('Erreur a la ligne '+chaine_signal,clred);exit;end;
if s[1]<>'A' then begin Affiche('Erreur 674 ligne '+chaine_signal,clred);exit;end;
delete(s,1,1);
val(s,adr,erreur); // adresse
c:=s[erreur]; // type
@@ -849,7 +855,7 @@ begin
dec(k);
if k<>l+1 then
begin
Affiche('Ligne '+chaine_signal,clred);
Affiche('Erreur 675 ligne '+chaine_signal,clred);
Affiche('Nombre incorrect de description des aiguillages: '+intToSTR(k)+' pour '+intToSTR(l)+' feux directionnels',clred);
end;
end
@@ -859,12 +865,12 @@ begin
val(sa,asp,erreur); //aspect
feux[i].aspect:=asp;Delete(s,1,j);
if (asp=0) or (asp=6) or (asp>9) then
Affiche('Fichier '+NomConfig+' configuration aspect ('+intToSTR(asp)+') feu incorrecte à la ligne '+chaine_signal,clRed);
Affiche('Erreur 676 Fichier '+NomConfig+' configuration aspect ('+intToSTR(asp)+') feu incorrecte à la ligne '+chaine_signal,clRed);
j:=pos(',',s);
if j>1 then begin Feux[i].FeuBlanc:=(copy(s,1,j-1))='1';delete(s,1,j);end;
j:=pos(',',s);
val(s,Feux[i].decodeur,erreur);
if (Feux[i].decodeur>NbDecodeur-1) then Affiche('Ligne '+chaine_signal+' : erreur décodeur inconnu',clred);
if (Feux[i].decodeur>NbDecodeur-1) then Affiche('Erreur 677 Ligne '+chaine_signal+' : erreur décodeur inconnu',clred);
if j<>0 then delete(s,1,j);
feux[i].Adr_el_suiv1:=0;feux[i].Adr_el_suiv2:=0;feux[i].Adr_el_suiv3:=0;feux[i].Adr_el_suiv4:=0;
feux[i].Btype_Suiv1:=rien;feux[i].Btype_Suiv2:=rien;feux[i].Btype_Suiv3:=rien;feux[i].Btype_Suiv4:=rien;
@@ -919,7 +925,7 @@ begin
end;
if (j>4) or (not(multiple)) then
begin
Affiche('Erreur: fichier de configuration ligne erronnée : '+chaine_signal,clred);
Affiche('Erreur 678: fichier de configuration ligne erronnée : '+chaine_signal,clred);
closefile(fichier);
exit;
end;
@@ -927,7 +933,7 @@ begin
k:=pos(',',s);
delete(s,1,k);
//Affiche('s='+s,clyellow);
if length(s)=0 then begin Affiche('Erreur: fichier de configuration ligne erronnée : '+chaine_signal,clred); closefile(fichier);exit;end;
if length(s)=0 then begin Affiche('Erreur 679: fichier de configuration ligne erronnée : '+chaine_signal,clred); closefile(fichier);exit;end;
feux[i].VerrouCarre:=s[1]='1';
delete(s,1,1);
@@ -938,16 +944,16 @@ begin
if Feux[i].decodeur=6 then
begin
if k=0 then begin Affiche('Ligne '+chaine_signal,clred);Affiche('Manque définition de la cible pour le décodeur UniSemaf',clred);end
if k=0 then begin Affiche('Erreur 680 Ligne '+chaine_signal,clred);Affiche('Manque définition de la cible pour le décodeur UniSemaf',clred);end
else
begin
Val(s,k,erreur);
Feux[i].UniSemaf:=k;
erreur:=verif_UniSemaf(adresse,k);
if erreur=1 then begin Affiche('Ligne '+chaine_signal,clred);Affiche('Erreur code Unisemaf',clred);end;
if erreur=1 then begin Affiche('Erreur 681 Ligne '+chaine_signal,clred);Affiche('Erreur code Unisemaf',clred);end;
if erreur=2 then
begin
Affiche('Ligne '+chaine_signal,clred);Affiche('Erreur cohérence aspect signal ('+intToSTR(asp)+') et code Unisemaf ('+intToSTR(k)+')',clred);
Affiche('Erreur 682 Ligne '+chaine_signal,clred);Affiche('Erreur cohérence aspect signal ('+intToSTR(asp)+') et code Unisemaf ('+intToSTR(k)+')',clred);
end;
end;
@@ -982,7 +988,7 @@ begin
val(chaine,adresse,erreur);
feux[i].condCarre[l][bd].Adresse:=adresse;
if erreur<>0 then feux[i].condCarre[l][bd].PosAig:=chaine[erreur] else
Affiche('Définition du feu '+IntToSTR(feux[i].adresse)+': Manque D ou S dans les conditions de carré des aiguillages',clred);
Affiche('Erreur 683 Définition du feu '+IntToSTR(feux[i].adresse)+': Manque D ou S dans les conditions de carré des aiguillages',clred);
end;
k:=pos(',',sa);if k<>0 then delete(sa,1,k);
@@ -1180,7 +1186,11 @@ begin
// temporisation entre 2 commandes décodeurs feu
writeln(fichierN,Tempo_feu_ch+'=',IntToSTR(Tempo_feu));
copie_commentaire;
// algorithme Unisemaf
writeln(fichierN,Algo_unisemaf_ch+'=',IntToSTR(algo_Unisemaf));
copie_commentaire;
// aiguillages
writeln(fichierN,section_aig_ch);
for i:=1 to MaxAiguillage do
@@ -1202,7 +1212,7 @@ begin
writeln(fichierN,section_sig_ch);
// feux
for i:=1 to NbreFeux do
for i:=1 to NbreFeux do
begin
s:=encode_sig_feux(i);
// transformer le tableau feux en ligne
@@ -1245,7 +1255,8 @@ var s,sa,chaine,SOrigine: string;
trouve_sec_init,trouve_init_aig,trouve_lay,trouve_IPV4_INTERFACE,trouve_PROTOCOLE_SERIE,trouve_INTER_CAR,
trouve_Tempo_maxi,trouve_Entete,trouve_tco,trouve_cdm,trouve_Serveur_interface,trouve_fenetre,
trouve_NOTIF_VERSION,trouve_verif_version,trouve_fonte,trouve_tempo_aig,trouve_raz,trouve_section_aig,
pds,trouve_section_branche,trouve_section_sig,trouve_section_act,fichier_trouve,trouve_tempo_feu : boolean;
pds,trouve_section_branche,trouve_section_sig,trouve_section_act,fichier_trouve,trouve_tempo_feu,
trouve_algo_uni : boolean;
bd,virgule,i_detect,i,erreur,aig2,detect,offset,index, adresse,j,position,temporisation,invers,indexPointe,indexDevie,indexDroit,
ComptEl,Compt_IT,Num_Element,k,modele,adr,adr2,erreur2,l,t,Nligne,postriple,itl,
postjd,postjs,nv,it,Num_Champ,asp,adraig : integer;
@@ -1932,6 +1943,18 @@ begin
if tempo_Feu=0 then Tempo_feu:=100;
end;
// algo unisemaf
sa:=uppercase(Algo_unisemaf_ch)+'=';
i:=pos(sa,s);
if i<>0 then
begin
inc(nv);
trouve_Algo_Uni:=true;
delete(s,i,length(sa));
val(s,algo_Unisemaf,erreur);
if (algo_Unisemaf<0) or (algo_Unisemaf>2) then algo_Unisemaf:=1;
end;
sa:=uppercase(verif_version_ch)+'=';
i:=pos(sa,s);
if i<>0 then
@@ -2476,6 +2499,9 @@ begin
if Valeur_entete=2 then RadioButton3.checked:=true;
LabelInfo.Width:=253;LabelInfo.Height:=25;
LabelResult.width:=137;LabelResult.Height:=25;
LabelNomSon.top:=16;LabelNomSon.Left:=48;
SpeedButtonJoue.Top:=64; SpeedButtonJoue.Left:=80;
EditSon.Top:=44;EditSon.Left:=16;
CheckVerifVersion.Checked:=verifVersion;
CheckFenEt.Checked:=Fenetre=1;
@@ -3439,6 +3465,8 @@ begin
if index=0 then exit;
aiguillage[index].Adevie:=adr;
aiguillage[index].AdevieB:=B;
RE_ColorLine(Formconfig.RichAig,index-1,ClWhite);
LabelInfo.caption:='Modification de la TJD homologe ('+IntToSTR(adr2)+')';
end;
if aiguillage[index].EtatTJD=2 then
begin
@@ -3448,8 +3476,7 @@ begin
s:=encode_aig(index);
formconfig.RichAig.Lines[index-1]:=s;
RE_ColorLine(Formconfig.RichAig,index-1,ClWhite);
LabelInfo.caption:='Modification de la TJD homologe ('+IntToSTR(adr2)+')';
end;
end;
end;
@@ -3927,7 +3954,7 @@ var s : string;
bt : Tequipement;
begin
if affevt then Affiche('Evt Element suivant2',clOrange);
if FormConfig.PageControl.ActivePage=FormConfig.TabSheetSig then
with Formconfig do
begin
@@ -4047,7 +4074,7 @@ var s : string;
begin
if clicliste then exit;
if affevt then Affiche('Evt detecteur 4',clOrange);
if FormConfig.PageControl.ActivePage=FormConfig.TabSheetSig then
with Formconfig do
begin
@@ -4695,7 +4722,7 @@ begin
if affevt then affiche('Evt EditCmdFerme Change',clyellow);
if FormConfig.PageControl.ActivePage=FormConfig.TabSheetAct then
with Formconfig do
begin
begin
s:=EditCmdFerme.Text;
if (s='+') or (s='-') then
begin
@@ -5079,7 +5106,7 @@ begin
Selstart:=RichSig.GetTextLen-1;
Perform(EM_SCROLLCARET,0,0);
end;
LabelInfo.caption:='';
ligneClicSig:=i-1;
AncligneClicSig:=ligneClicSig;
@@ -5151,7 +5178,7 @@ begin
EditAdrSig.Text:='';
EditDet1.Text:='';EditDet2.Text:='';EditDet3.Text:='';EditDet4.Text:='';
EditSuiv1.Text:='';EditSuiv2.Text:='';EditSuiv3.Text:='';EditSuiv4.Text:='';
config_modifie:=true;
RichSig.Clear;
@@ -5208,8 +5235,9 @@ end;
function verif_coherence : boolean;
var i,j,k,l,Indexaig,adr,adr2,detect,condcarre,nc : integer;
var i,j,k,l,Indexaig,adr,adr2,detect,condcarre,nc,index2 : integer;
modAig,model,km: TEquipement;
c : char;
ok : boolean;
begin
// vérification de la cohérence1
@@ -5247,7 +5275,7 @@ begin
begin
Affiche('Erreur 7: la TJD/S '+IntToStr(Indexaig)+' a des adresses de destination différentes ('+intToSTR(aiguillage[Indexaig].Ddroit)+' et '+intToSTR(aiguillage[Indexaig].Ddevie)+')',clred);
ok:=false;
end;
end;
// vérifier si son homologue est une tjd
adr2:=aiguillage[Indexaig].Ddroit;
if (aiguillage[Index_Aig(adr2)].modele<>tjd) and (aiguillage[Index_Aig(adr2)].modele<>tjs) then
@@ -5315,7 +5343,7 @@ begin
for Indexaig:=1 to maxaiguillage do
begin
adr:=aiguillage[Indexaig].Adresse;
if aiguillage[Indexaig].modele=triple then
if aiguillage[Indexaig].modele=triple then
begin
if aiguillage[Indexaig].AdrTriple=0 then
begin
@@ -5330,7 +5358,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
@@ -5339,7 +5367,7 @@ begin
adr:=feux[j].Adresse;
for i:=j+1 to NbreFeux do
begin
if adr=feux[i].Adresse then
if adr=feux[i].Adresse then
begin
affiche('Erreur 7 : signal '+intToSTR(adr)+' défini deux fois',clred);
ok:=false;
@@ -5385,9 +5413,9 @@ begin
begin
ok:=false;
Affiche('Erreur 8.2: Adresse de détecteur nul sur signal '+IntToSTR(feux[j].adresse),clred);
end;
end;
end;
i:=feux[j].Adr_det2;
if i<>0 then
begin
@@ -5409,7 +5437,7 @@ begin
Affiche('Erreur 8.4: Détecteur '+intToSTR(i)+' non existant mais associé au signal '+IntToSTR(feux[j].adresse),clred);
end;
end;
i:=feux[j].Adr_det4;
if i<>0 then
begin
@@ -5463,7 +5491,7 @@ begin
if ((km=aig) or (km=tjs) or (km=tjd) or (km=triple)) then
begin
// aiguillage
if index_aig(i)=0 then
if index_aig(i)=0 then
begin
ok:=false;
Affiche('Erreur 9.4: aiguillage '+intToSTR(i)+' non existant mais associé au signal '+IntToSTR(feux[j].adresse),clred);
@@ -5495,7 +5523,7 @@ begin
end;
end;
end;
// élement suivant 4
i:=feux[j].Adr_el_suiv4;
km:=feux[j].Btype_suiv4;
@@ -5513,14 +5541,58 @@ begin
if ((km=aig) or (km=tjs) or (km=tjd) or (km=triple)) then
begin
// aiguillage
if index_aig(i)=0 then
if index_aig(i)=0 then
begin
ok:=false;
Affiche('Erreur 9.10: aiguillage '+intToSTR(i)+' non existant mais associé au signal '+IntToSTR(feux[j].adresse),clred);
end;
end;
end;
end;
end;
// cohérence 7
// parcoure les aiguillages pour voir si les aiguillages déclarés aux extrémités sont existants
for Indexaig:=1 to maxaiguillage do
begin
adr:=aiguillage[indexaig].Adresse;
adr2:=aiguillage[indexaig].ADroit;
c:=aiguillage[indexaig].AdroitB;
if (c='D') or (c='S') or (c='P') then
begin
index2:=Index_aig(adr2);
if index2=0 then
begin
ok:=false;
Affiche('Erreur 10.1: aiguillage '+intToSTR(adr)+': déclaration d''un aiguillage '+IntToSTR(adr2)+' inexistant',clred);
end;
end;
adr2:=aiguillage[indexaig].ADevie;
c:=aiguillage[indexaig].AdevieB;
if (c='D') or (c='S') or (c='P') then
begin
index2:=Index_aig(adr2);
if index2=0 then
begin
ok:=false;
Affiche('Erreur 10.2: aiguillage '+intToSTR(adr)+': déclaration d''un aiguillage '+IntToSTR(adr2)+' inexistant',clred);
end;
end;
adr2:=aiguillage[indexaig].Apointe;
c:=aiguillage[indexaig].ApointeB;
if (c='D') or (c='S') or (c='P') then
begin
index2:=Index_aig(adr2);
if index2=0 then
begin
ok:=false;
Affiche('Erreur 10.3: aiguillage '+intToSTR(adr)+': déclaration d''un aiguillage '+IntToSTR(adr2)+' inexistant',clred);
end;
end;
end;
verif_coherence:=ok;
end;
@@ -5538,7 +5610,7 @@ begin
aiguillage[i].EtatTJD:=4;
aiguillage[i].ApointeB:='Z';
aiguillage[i].Adevie2B:='Z';
aiguillage[i].tjsintB:='D';
aiguillage[i].tjsintB:='D';
aiguillage[i].posInit:=const_inconnu;
aiguillage[i].Temps:=5;
@@ -5558,7 +5630,7 @@ begin
ligneClicAig:=i-1;
AncligneClicAig:=ligneClicAig;
Aff_champs_aig_tablo(i);
clicliste:=false;
clicliste:=false;
config_modifie:=true;
Aig_sauve.Adresse:=0;
end;
BIN
View File
Binary file not shown.
+1
View File
@@ -196,6 +196,7 @@ begin
AvecGrille:=checkDessineGrille.Checked;
end;
verif_config_TCO:=not(nokNbX or nokNbY or nokHt or nokLg);
NbCellulesTCO:=NbreCellX*NbreCellY;
end;
procedure TFormConfigTCO.ButtonOKClick(Sender: TObject);
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+810 -341
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+3 -3
View File
@@ -1,6 +1,6 @@
object FormTCO: TFormTCO
Left = 1395
Top = 198
Left = 20
Top = 203
Width = 1139
Height = 694
VertScrollBar.Visible = False
@@ -833,7 +833,7 @@ object FormTCO: TFormTCO
Top = 120
Width = 161
Height = 17
Caption = 'Pilotage aiguillage invers'#233
Caption = 'aiguillage invers'#233
TabOrder = 10
OnClick = CheckPinvClick
end
+128 -82
View File
@@ -303,7 +303,7 @@ var
PImageTCO : Timage;
PImageTemp : TImage;
frXGlob,frYGlob : real;
LargeurCell,HauteurCell,NbreCellX,NbreCellY : integer ;
LargeurCell,HauteurCell,NbreCellX,NbreCellY,NbCellulesTCO : integer ;
procedure calcul_reduction(Var frx,fry : real;DimDestX,DimDestY,DimOrgX,DimOrgY : integer);
procedure sauve_fichier_tco;
@@ -365,6 +365,7 @@ begin
Val(s,NbreCellX,erreur);
delete(s,1,erreur);
Val(s,NbreCellY,erreur);
NbCellulesTCO:=NbreCellX*NbreCellY;
// largeur et hauteur des cellules
s:=lit_ligne;
@@ -583,7 +584,8 @@ begin
pen.color:=clAllume;
jy1:=y0+(HauteurCell div 2)-round(6*frYGlob); // pos Y de la bande sup
jy2:=y0+(HauteurCell div 2)+round(6*frYGlob); // pos Y de la bande inf
r:=Rect(x0+1,jy1,x0+LargeurCell-1,jy2);
if avecGrille then r:=Rect(x0+1,jy1,x0+LargeurCell-1,jy2) else
r:=Rect(x0,jy1,x0+LargeurCell,jy2) ;
FillRect(r);
end;
end;
@@ -599,6 +601,13 @@ begin
end;
end;
{ diagonale
x1:=x0;y1:=y0+hauteurCell-round(3*FryGlob);
x2:=x0+largeurCell-round(3*FrXGlob);y2:=y0;
x3:=x0+largeurCell;y3:=y0+round(4*FrYGlob);
x4:=x0+round(4*FrXGlob); y4:=y0+hauteurCell;
}
// element 2
procedure TformTCO.dessin_AigG_PD(canvas : Tcanvas;x,y : integer; Mode,position : integer);
var x0,y0,x1,y1,x2,y2,x3,y3,x4,y4,jy1,jy2 : integer;
@@ -614,11 +623,13 @@ var x0,y0,x1,y1,x2,y2,x3,y3,x4,y4,jy1,jy2 : integer;
procedure deviation;
begin
//Canvas.Brush.Color:=clRed;
x1:=x0+(largeurCell div 2); y1:=jy1+round(1*frYGlob);
x2:=x0-round(1*FrXGlob);y2:=y0+HauteurCell-round(2*FrYGlob);
x3:=x0+round(2*FrXGlob);y3:=y0+HauteurCell;
x4:=x1+round(1*FrXGlob);y4:=jy2;
x2:=x0-round(1*FrXGlob);y2:=y0+HauteurCell-round(2*FrYGlob); //1
x3:=x0+round(2*FrXGlob);y3:=y0+HauteurCell; //2
x4:=x1+round(1*FrXGlob);y4:=jy2; //1
canvas.Polygon([point(x1,y1),Point(x2,y2),Point(x3,y3),Point(x4,y4)]);
//Canvas.Brush.Color:=clVoies;
end;
begin
@@ -634,12 +645,12 @@ begin
r:=Rect(x0,y0,x0+LargeurCell,y0+HauteurCell);
FillRect(r);
Brush.COlor:=clVoies;
Brush.Color:=clVoies;
Pen.Mode:=pmCopy;
// aiguillage dévié (sans inversion)
if ((inverse=false) and (position=const_Devie)) or
((inverse=true) and (position=const_Droit)) or
(position=9) then
//if ((inverse=false) and (position=const_Devie)) or
// ((inverse=true) and (position=const_Droit)) or (position=9) then
if (position=const_Devie) or (position=9) then
begin
horz;
if (mode=1) and (position=const_devie) then
@@ -655,8 +666,9 @@ begin
canvas.FillRect(r);
// effacement du morceau
if ((inverse=false) and (position=const_Devie)) or
((inverse=true) and (position=const_Droit)) then
//if ((inverse=false) and (position=const_Devie)) or
// ((inverse=true) and (position=const_Droit)) then
if (position=const_Devie) then
begin
x1:=x1;y1:=jy1;
x2:=x1-6;y2:=jy2;
@@ -669,8 +681,9 @@ begin
end;
// aiguillage droit (sans inversion) dévié (avec inversion)
if ((inverse=false) and (position=const_Droit)) or
((inverse=true) and (position=const_Devie)) then
//if ((inverse=false) and (position=const_Droit)) or
// ((inverse=true) and (position=const_Devie)) then
if (position=const_Droit) then
begin
deviation;
if (mode=1) and ( ((inverse=false) and (position=const_droit)) or ((inverse=true) and (position=const_devie)) ) then begin Pen.color:=clAllume;Brush.color:=ClAllume end else begin Pen.color:=clVoies;Brush.Color:=clVoies;end;
@@ -727,9 +740,10 @@ begin
Pen.Mode:=pmCopy;
// aiguillage dévié (sans inversion)
if ((inverse=false) and (position=const_Devie)) or
((inverse=true) and (position=const_Droit)) or
(position=9) then
//if ((inverse=false) and (position=const_Devie)) or
// ((inverse=true) and (position=const_Droit)) or
// (position=9) then
if (position=const_Devie) or (position=9) then
begin
horz;
if (mode=1) and (position=const_Devie) then begin Pen.color:=clAllume;Brush.color:=ClAllume end else begin Pen.color:=clVoies;Brush.Color:=clVoies;end;
@@ -738,8 +752,9 @@ begin
canvas.FillRect(r);
// effacement du morceau
if ((inverse=false) and (position=const_Devie)) or
((inverse=true) and (position=const_Droit)) then
//if ((inverse=false) and (position=const_Devie)) or
// ((inverse=true) and (position=const_Droit)) then
if (position=const_Devie) then
begin
x1:=x4+round(2*frXGlob);y1:=jy2-round(1*frYGlob);
x2:=x1+round(5*frXGlob);y2:=jy1;
@@ -752,8 +767,9 @@ begin
end;
// aiguillage droit (sans inversion) dévié (avec inversion)
if ((inverse=false) and (position=const_Droit)) or
((inverse=true) and (position=const_Devie)) then
//if ((inverse=false) and (position=const_Droit)) or
// ((inverse=true) and (position=const_Devie)) then
if (position=const_Droit) then
begin
devie;
if (mode=1) and ( ((inverse=false) and (position=const_droit)) or ((inverse=true) and (position=const_devie)) )
@@ -813,9 +829,10 @@ begin
Brush.color:=clVoies;
// aiguillage dévié (sans inversion)
if ((inverse=false) and (position=const_Devie)) or
((inverse=true) and (position=const_Droit)) or
(position=9) then
//if ((inverse=false) and (position=const_Devie)) or
// ((inverse=true) and (position=const_Droit)) or
// (position=9) then
if (position=const_Devie) or (position=9) then
begin
bande_horz;
if (mode=1) and ( ((inverse=false) and (position=const_Devie)) or ((inverse=true) and (position=const_Droit)) ) then begin Pen.color:=clAllume;Brush.color:=ClAllume end else begin Pen.color:=clVoies;Brush.Color:=clVoies;end;
@@ -824,8 +841,9 @@ begin
Canvas.FillRect(r);
deviation;
// effacement du morceau
if ((inverse=false) and (position=const_Devie)) or
((inverse=true) and (position=const_Droit)) then
//if ((inverse=false) and (position=const_Devie)) or
// ((inverse=true) and (position=const_Droit)) then
if (position=const_Devie) then
begin
x1:=x1;y1:=jy1;
x2:=x1+5;y2:=jy2-1;
@@ -838,8 +856,9 @@ begin
end;
// aiguillage droit (sans inversion) dévié (avec inversion)
if ((inverse=false) and (position=const_Droit)) or
((inverse=true) and (position=const_Devie)) then
//if ((inverse=false) and (position=const_Droit)) or
// ((inverse=true) and (position=const_Devie)) then
if (position=const_Droit) then
begin
deviation;
if (mode=1) and ( ((inverse=false) and (position=const_droit)) or ((inverse=true) and (position=const_devie)) ) then Brush.color:=clAllume else Brush.Color:=couleur;
@@ -899,9 +918,10 @@ begin
pen.color:=clVoies;
// aiguillage dévié (sans inversion)
if ((inverse=false) and (position=const_Devie)) or
((inverse=true) and (position=const_Droit)) or
(position=9) then
//if ((inverse=false) and (position=const_Devie)) or
// ((inverse=true) and (position=const_Droit)) or
// (position=9) then
if (position=const_Devie) or (position=9) then
begin
horz;
if (mode=1) and ( ((inverse=false) and (position=const_Devie)) or ((inverse=true) and (position=const_Droit)) ) then begin Pen.color:=clAllume;Brush.color:=ClAllume end else begin Pen.color:=clVoies;Brush.Color:=clVoies;end;
@@ -911,8 +931,9 @@ begin
deviation;
// efface le morceau
if ((inverse=false) and (position=const_Devie)) or
((inverse=true) and (position=const_Droit)) then
//if ((inverse=false) and (position=const_Devie)) or
// ((inverse=true) and (position=const_Droit)) then
if (position=const_Devie) then
begin
x1:=x1-12;y1:=jy1;
x2:=x1+5;y2:=jy2-1;
@@ -925,8 +946,9 @@ begin
end;
// aiguillage droit (sans inversion) ou dévie (avec inversion)
if ((inverse=false) and (position=const_Droit)) or
((inverse=true) and (position=const_Devie)) then
//if ((inverse=false) and (position=const_Droit)) or
// ((inverse=true) and (position=const_Devie)) then
if (position=const_Droit) then
begin
deviation;
if (mode=1) and ( ((inverse=false) and (position=const_droit)) or ((inverse=true) and (position=const_devie)) ) then begin Pen.color:=clAllume;Brush.color:=ClAllume end else begin Pen.color:=clVoies;Brush.Color:=clVoies;end;
@@ -1206,9 +1228,10 @@ begin
pen.color:=clVoies;
// aiguillage dévié (sans inversion)
if ((inverse=false) and (position=const_Devie)) or
((inverse=true) and (position=const_Droit)) or
(position=9) then
//if ((inverse=false) and (position=const_Devie)) or
// ((inverse=true) and (position=const_Droit)) or
// (position=9) then
if (position=const_Devie) or (position=9) then
begin
diagonale;
if (mode=1) and ( ((inverse=false) and (position=const_Devie)) or ((inverse=true) and (position=const_Droit)) ) then begin Pen.color:=clAllume;Brush.color:=ClAllume end else begin Pen.color:=clVoies;Brush.Color:=clVoies;end;
@@ -1223,9 +1246,10 @@ begin
canvas.PolyGon([point(x1,y1),point(x2,y2),point(x3,y3),point(x4,y4)]);
end;
// efface le morceau
if ((inverse=false) and (position=const_Devie)) or
((inverse=true) and (position=const_Droit)) then
// efface le morceau
//if ((inverse=false) and (position=const_Devie)) or
// ((inverse=true) and (position=const_Droit)) then
if (position=const_Devie) then
begin
x1:=x0+round(22*frxGlob);y1:=jy2; //+round(FrYGlob*1);
x2:=x1+round(12*frxGlob);y2:=y1;
@@ -1238,8 +1262,9 @@ begin
end;
// aiguillage droit (sans inversion) ou dévie (avec inversion)
if ((inverse=false) and (position=const_Droit)) or
((inverse=true) and (position=const_Devie)) then
//if ((inverse=false) and (position=const_Droit)) or
// ((inverse=true) and (position=const_Devie)) then
if (position=const_Droit) then
begin
horz;
if (mode=1) and ( ((inverse=false) and (position=const_droit)) or ((inverse=true) and (position=const_devie)) ) then begin Pen.color:=clAllume;Brush.color:=ClAllume end else begin Pen.color:=clVoies;Brush.Color:=clVoies;end;
@@ -1296,9 +1321,10 @@ begin
pen.color:=clVoies;
// aiguillage dévié (sans inversion) ou position inconnue (9)
if ((inverse=false) and (position=const_Devie)) or
((inverse=true) and (position=const_Droit)) or
(position=9) then
//if ((inverse=false) and (position=const_Devie)) or
// ((inverse=true) and (position=const_Droit)) or
// (position=9) then
if (position=const_Devie) or (position=9) then
begin
diagonale;
if (mode=1) and ( ((inverse=false) and (position=const_Devie)) or ((inverse=true) and (position=const_Droit)) ) then begin Pen.color:=clAllume;Brush.color:=ClAllume end else begin Pen.color:=clVoies;Brush.Color:=clVoies;end;
@@ -1314,8 +1340,9 @@ begin
end;
// efface le morceau
if ((inverse=false) and (position=const_Devie)) or
((inverse=true) and (position=const_Droit)) then
//if ((inverse=false) and (position=const_Devie)) or
// ((inverse=true) and (position=const_Droit)) then
if (position=const_Devie) then
begin
// efface le morceau
x1:=x0+round(12*frXGlob);y1:=jy2;
@@ -1329,8 +1356,9 @@ begin
end;
// aiguillage droit (sans inversion) ou dévie (avec inversion)
if ((inverse=false) and (position=const_Droit)) or
((inverse=true) and (position=const_Devie)) then
//if ((inverse=false) and (position=const_Droit)) or
// ((inverse=true) and (position=const_Devie)) then
if (position=const_droit) then
begin
horz;
if (mode=1) and ( ((inverse=false) and (position=const_droit)) or ((inverse=true) and (position=const_devie)) ) then begin Pen.color:=clAllume;Brush.color:=ClAllume end else begin Pen.color:=clVoies;Brush.Color:=clVoies;end;
@@ -1385,9 +1413,10 @@ begin
pen.color:=clVoies;
// aiguillage dévié (sans inversion)
if ((inverse=false) and (position=const_Devie)) or
((inverse=true) and (position=const_Droit)) or
(position=9) then
//if ((inverse=false) and (position=const_Devie)) or
// ((inverse=true) and (position=const_Droit)) or
// (position=9) then
if (position=const_Devie) or (position=9) then
begin
diagonale;
if (mode=1) and ( ((inverse=false) and (position=const_Devie)) or ((inverse=true) and (position=const_Droit)) ) then begin Pen.color:=clAllume;Brush.color:=ClAllume end else begin Pen.color:=clVoies;Brush.Color:=clVoies;end;
@@ -1403,8 +1432,9 @@ begin
canvas.PolyGon([point(x1,y1),point(x2,y2),point(x3,y3),point(x4,y4)]);
end;
// efface le morceau
if ((inverse=false) and (position=const_Devie)) or
((inverse=true) and (position=const_Droit)) then
//if ((inverse=false) and (position=const_Devie)) or
// ((inverse=true) and (position=const_Droit)) then
if (position=const_Devie) then
begin
// efface le morceau
x1:=x0+round(2*frXGlob);y1:=jy1-round(1*fryGlob);
@@ -1418,8 +1448,9 @@ begin
end;
// aiguillage droit (sans inversion) ou dévie (avec inversion)
if ((inverse=false) and (position=const_Droit)) or
((inverse=true) and (position=const_Devie)) then
//if ((inverse=false) and (position=const_Droit)) or
// ((inverse=true) and (position=const_Devie)) then
if (position=const_Droit) then
begin
horz;
if (mode=1) and ( ((inverse=false) and (position=const_droit)) or ((inverse=true) and (position=const_devie)) ) then begin Pen.color:=clAllume;Brush.color:=ClAllume end else begin Pen.color:=clVoies;Brush.Color:=clVoies;end;
@@ -1475,9 +1506,10 @@ begin
pen.color:=clVoies;
// aiguillage dévié (sans inversion)
if ((inverse=false) and (position=const_Devie)) or
((inverse=true) and (position=const_Droit)) or
(position=9) then
//if ((inverse=false) and (position=const_Devie)) or
// ((inverse=true) and (position=const_Droit)) or
// (position=9) then
if (position=const_Devie) or (position=9) then
begin
diagonale;
if (mode=1) and ( ((inverse=false) and (position=const_Devie)) or ((inverse=true) and (position=const_Droit)) ) then begin Pen.color:=clAllume;Brush.color:=ClAllume end else begin Pen.color:=clVoies;Brush.Color:=clVoies;end;
@@ -1493,8 +1525,9 @@ begin
end;
// efface le morceau
if ((inverse=false) and (position=const_Devie)) or
((inverse=true) and (position=const_Droit)) then
//if ((inverse=false) and (position=const_Devie)) or
// ((inverse=true) and (position=const_Droit)) then
if (position=const_Devie) then
begin
x1:=x0+round(20*frXGlob);y1:=jy1-round(1*frYGlob);
x2:=x1+round(23*frxGlob);y2:=y1;
@@ -1507,8 +1540,9 @@ begin
end;
// aiguillage droit (sans inversion) ou dévie (avec inversion)
if ((inverse=false) and (position=const_Droit)) or
((inverse=true) and (position=const_Devie)) then
//if ((inverse=false) and (position=const_Droit)) or
// ((inverse=true) and (position=const_Devie)) then
if (position=const_Droit) then
begin
horz;
if (mode=1) and ( ((inverse=false) and (position=const_droit)) or ((inverse=true) and (position=const_devie)) ) then begin Pen.color:=clAllume;Brush.color:=ClAllume end else begin Pen.color:=clVoies;Brush.Color:=clVoies;end;
@@ -2375,7 +2409,7 @@ end;
// affiche la cellule x et y en cases
procedure TformTCO.affiche_cellule(x,y : integer);
var Xorg,Yorg,xt,yt,mode,adresse,Bimage,aspect,oriente,pos : integer;
var p,Xorg,Yorg,xt,yt,mode,adresse,Bimage,aspect,oriente,pos : integer;
Bt : TEquipement;
s : string;
begin
@@ -2389,8 +2423,15 @@ begin
if (bImage>=2) then //????? and (btype<=15)
begin
if Adresse<>0 then pos:=Aiguillage[Index_Aig(adresse)].position
else pos:=9;
else pos:=const_inconnu;
if TCO[x,y].inverse then
begin
p:=const_inconnu;
if pos=const_devie then p:=const_droit;
if pos=const_droit then p:=const_devie;
pos:=p;
end;
end;
Xorg:=(x-1)*LargeurCell;
Yorg:=(y-1)*HauteurCell;
@@ -2423,12 +2464,11 @@ begin
20 : dessin_20(PCanvasTCO,X,Y,mode);
21 : dessin_21(PCanvasTCO,X,Y,mode);
22 : dessin_22(PCanvasTCO,X,Y,mode);
30 : dessin_feu(PCanvasTCO,X,Y);
end;
PCanvasTCO.font.Size:=(LargeurCell div 10)+4 ;
// Affiche(intToSTR( (LargeurCell div 30)+6),clyellow);
//Affiche(intToSTR( (LargeurCell div 30)+6),clyellow);
// affiche le texte des aiguillages
if ((BImage=2) or (BImage=3) or (BImage=4) or (BImage=5) or (BImage=12) or (BImage=13) or (BImage=14) or (BImage=15) or (BImage=21) or (BImage=22)) and (adresse<>0) then
@@ -2439,11 +2479,16 @@ begin
Brush.Color:=fond;
Font.Color:=clYellow;
xt:=0;yt:=0;
if Bimage=4 then begin xt:=1;yt:=1;end;
if Bimage=5 then begin xt:=1;yt:=HauteurCell-round(20*fryGlob);end;
if Bimage=12 then begin xt:=1;yt:=HauteurCell-round(20*frYGlob);end;
if Bimage=21 then begin xt:=2;yt:=1;end;
if Bimage=22 then begin xt:=1;yt:=HauteurCell-round(15*frYGlob);end;
if Bimage=2 then begin xt:=3;yt:=1;end;
if Bimage=3 then begin xt:=3;yt:=HauteurCell-round(20*fryGlob);end;
if Bimage=4 then begin xt:=3;yt:=1;end;
if Bimage=5 then begin xt:=3;yt:=HauteurCell-round(20*fryGlob);end;
if Bimage=12 then begin xt:=3;yt:=HauteurCell-round(20*frYGlob);end;
if Bimage=13 then begin xt:=3;yt:=1;end;
if Bimage=14 then begin xt:=LargeurCell-round(25*frXGlob);yt:=1;end;
if Bimage=15 then begin xt:=3;yt:=1;end;
if Bimage=21 then begin xt:=3;yt:=1;end;
if Bimage=22 then begin xt:=3;yt:=HauteurCell-round(15*frYGlob);end;
TextOut(xOrg+xt,yOrg+yt,s);
//exit;
end;
@@ -2767,19 +2812,19 @@ begin
x:=Xdet2;Xdet2:=Xdet1;Xdet1:=x;
x:=Ydet2;Ydet2:=Ydet1;Ydet1:=x;
x:=det2;det2:=det1;det1:=x;
end;
if yDet2<yDet1 then
begin
y:=Ydet2;Ydet2:=Ydet1;Ydet1:=y;
y:=Xdet2;Xdet2:=Xdet1;Xdet1:=y;
y:=det2;det2:=det1;det1:=y;
//y:=Ydet2;Ydet2:=Ydet1;Ydet1:=y;
//y:=Xdet2;Xdet2:=Xdet1;Xdet1:=y;
//y:=det2;det2:=det1;det1:=y;
end;
//Affiche('trouvé '+intToSTR(det2)+' en '+IntToSTR(xDet2)+'/'+intToSTR(ydet2),clyellow);
// Aller de det1 à det2 vers le sens X croissant du TCO
ancienX:=-1;ancienY:=-1;
ancienX:=Xdet2;ancienY:=yDet2-Ydet1;
if ydet2<ydet1 then ancieny:=ydet1+1 else ancieny:=ydet1-1;
if xdet2<xdet1 then ancienx:=xdet1+1 else ancienx:=xdet1-1;
x:=xDet1;y:=Ydet1;
i:=0; memtrouve:=false;
@@ -2959,8 +3004,8 @@ begin
inc(i);
if adresse=det2 then memTrouve:=true;
until (x=1) or (x=NbreCellX) or (y=NbreCellY) or ((adresse<>det2) and memTrouve) or (i>40);
if i>40 then
//Affiche(intToSTR(x),clLime);
if i>NbCellulesTCO then
begin
s:='Erreur 1000 : dépassement d''itérations TCO: '+IntToSTR(det1)+' - '+IntToSTR(det2);
Affiche(s,clred); AfficheDebug(s,clred); end;
@@ -2983,6 +3028,7 @@ begin
PScrollBoxTCO:=FormTCO.ScrollBox;
lire_fichier_tco;
NbCellulesTCO:=NbreCellX*NbreCellY;
calcul_reduction(frxGlob,fryGlob,LargeurCell,HauteurCell,ZoomMax,ZoomMax);
// dessiner les icônes
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -23,7 +23,7 @@ var
Lance_verif : integer;
verifVersion,notificationVersion : boolean;
Const Version='3.63'; // sert à la comparaison de la version publiée
Const Version='3.7'; // sert à la comparaison de la version publiée
SousVersion=' '; // en cas d'absence de sous version mettre un espace
implementation
+4 -1
View File
@@ -80,7 +80,10 @@ version 3.6 : Am
Changement des vitesses courantes des trains.
version 3.61 : Correction de la non présentation de certains signaux s'ils sont séparés par plus d'un détecteur.
version 3.62 : Correction présence trains 3 cantons avant signaux et 1 canton après signaux.
version 3.63 : Gestion améliorée du décodeur Unisemaf
version 3.7 : Gestion améliorée du décodeur Unisemaf
Présentation du rappel30/60 sur TJD déviées
Correction erreur 1000 au TCO