This commit is contained in:
f1iwq2
2023-09-19 17:48:46 +02:00
parent 4d427e81ff
commit 6b945b5dbd
15 changed files with 1337 additions and 963 deletions
+2 -2
View File
@@ -14,8 +14,8 @@
-$N+ -$N+
-$O- -$O-
-$P+ -$P+
-$Q- -$Q+
-$R- -$R+
-$S- -$S-
-$T- -$T-
-$U- -$U-
+2 -2
View File
@@ -17,8 +17,8 @@ M=0
N=1 N=1
O=0 O=0
P=1 P=1
Q=0 Q=1
R=0 R=1
S=0 S=0
T=0 T=0
U=0 U=0
-42
View File
@@ -1,42 +0,0 @@
program Signaux_complexes_GL;
uses
Forms,
UnitPrinc in 'UnitPrinc.pas' {FormPrinc},
UnitDebug in 'UnitDebug.pas' {FormDebug},
verif_version in 'verif_version.pas' {FormVersion},
UnitPilote in 'UnitPilote.pas' {FormPilote},
UnitSimule in 'UnitSimule.pas' {FormSimulation},
UnitTCO in 'UnitTCO.pas' {FormTCO},
UnitConfig in 'UnitConfig.pas' {FormConfig},
UnitConfigTCO in 'UnitConfigTCO.pas' {FormConfigTCO},
UnitSR in 'UnitSR.pas' {FormSR},
Unit_Pilote_aig in 'Unit_Pilote_aig.pas' {FormAig},
UnitConfigCellTCO in 'UnitConfigCellTCO.pas' {FormConfCellTCO},
UnitCDF in 'UnitCDF.pas' {FormCDF},
Unitplace in 'Unitplace.pas' {FormPlace},
UnitPareFeu in 'UnitPareFeu.pas',
UnitAnalyseSegCDM in 'UnitAnalyseSegCDM.pas' {FormAnalyseCDM},
Importation in 'Importation.pas' {FormImportation};
{$R *.res}
begin
// la form TCO ne doit pas etre créée ici!!
Application.Initialize;
Application.CreateForm(TFormPrinc, FormPrinc);
Application.CreateForm(TFormVersion, FormVersion);
Application.CreateForm(TFormPilote, FormPilote);
Application.CreateForm(TFormSimulation, FormSimulation);
Application.CreateForm(TFormConfig, FormConfig);
Application.CreateForm(TFormConfigTCO, FormConfigTCO);
Application.CreateForm(TFormSR, FormSR);
Application.CreateForm(TFormAig, FormAig);
Application.CreateForm(TFormConfCellTCO, FormConfCellTCO);
Application.CreateForm(TFormCDF, FormCDF);
Application.CreateForm(TFormPlace, FormPlace);
Application.CreateForm(TFormDebug, FormDebug);
Application.CreateForm(TFormAnalyseCDM, FormAnalyseCDM);
Application.CreateForm(TFormImportation, FormImportation);
Application.Run;
end.
+19 -6
View File
@@ -1,6 +1,6 @@
object FormConfig: TFormConfig object FormConfig: TFormConfig
Left = 164 Left = 178
Top = 114 Top = 109
Hint = 'Modifie la configuration selon les s'#233'lections choisies' Hint = 'Modifie la configuration selon les s'#233'lections choisies'
BorderStyle = bsDialog BorderStyle = bsDialog
Caption = 'Configuration g'#233'n'#233'rale' Caption = 'Configuration g'#233'n'#233'rale'
@@ -1662,7 +1662,7 @@ object FormConfig: TFormConfig
end end
object CheckVerifVersion: TCheckBox object CheckVerifVersion: TCheckBox
Left = 8 Left = 8
Top = 48 Top = 56
Width = 249 Width = 249
Height = 17 Height = 17
Caption = 'V'#233'rifications de nouvelle version au d'#233'marrage' Caption = 'V'#233'rifications de nouvelle version au d'#233'marrage'
@@ -1670,7 +1670,7 @@ object FormConfig: TFormConfig
end end
object CheckInfoVersion: TCheckBox object CheckInfoVersion: TCheckBox
Left = 8 Left = 8
Top = 64 Top = 72
Width = 241 Width = 241
Height = 17 Height = 17
Caption = 'Information sur la version actuelle' Caption = 'Information sur la version actuelle'
@@ -1687,7 +1687,7 @@ object FormConfig: TFormConfig
end end
object CheckAvecTCO: TCheckBox object CheckAvecTCO: TCheckBox
Left = 8 Left = 8
Top = 88 Top = 96
Width = 73 Width = 73
Height = 17 Height = 17
Hint = 'Affiche le TCO au d'#233'marrage' Hint = 'Affiche le TCO au d'#233'marrage'
@@ -1709,7 +1709,7 @@ object FormConfig: TFormConfig
end end
object CheckBandeauTCO: TCheckBox object CheckBandeauTCO: TCheckBox
Left = 8 Left = 8
Top = 104 Top = 112
Width = 129 Width = 129
Height = 17 Height = 17
Hint = 'Masque le bandeau de param'#233'trage du TCO au d'#233'marrage' Hint = 'Masque le bandeau de param'#233'trage du TCO au d'#233'marrage'
@@ -1731,6 +1731,19 @@ object FormConfig: TFormConfig
OnChange = EditLAYChange OnChange = EditLAYChange
OnExit = EditLAYExit OnExit = EditLAYExit
end end
object CheckBoxAffMemo: TCheckBox
Left = 8
Top = 40
Width = 233
Height = 17
Hint =
'Affiche la fenetre '#224' la position m'#233'moris'#233'e depuis le menu "Sauve' +
'garder la configuration de la fen'#234'tre"'
Caption = 'Afficher la fen'#234'tre sur la position m'#233'moris'#233'e'
ParentShowHint = False
ShowHint = True
TabOrder = 7
end
end end
object GroupBox6: TGroupBox object GroupBox6: TGroupBox
Left = 312 Left = 312
+142 -55
View File
@@ -365,6 +365,7 @@ type
N1: TMenuItem; N1: TMenuItem;
N2: TMenuItem; N2: TMenuItem;
outcopierentatquetexte1: TMenuItem; outcopierentatquetexte1: TMenuItem;
CheckBoxAffMemo: TCheckBox;
procedure ButtonAppliquerEtFermerClick(Sender: TObject); procedure ButtonAppliquerEtFermerClick(Sender: TObject);
procedure FormActivate(Sender: TObject); procedure FormActivate(Sender: TObject);
procedure FormCreate(Sender: TObject); procedure FormCreate(Sender: TObject);
@@ -588,6 +589,7 @@ MasqueBandeauTCO_ch='MasqueBandeauTCO';
CDM_ch='CDM'; CDM_ch='CDM';
Serveur_interface_ch='Serveur_interface'; Serveur_interface_ch='Serveur_interface';
fenetre_ch='Fenetre'; fenetre_ch='Fenetre';
AffMemoFenetre_ch='AffMemoFenetre';
Tempo_aig_ch='Tempo_Aig'; Tempo_aig_ch='Tempo_Aig';
Nb_cantons_Sig_ch='Nb_cantons_Sig'; Nb_cantons_Sig_ch='Nb_cantons_Sig';
Tempo_Feu_ch='Tempo_Feu'; Tempo_Feu_ch='Tempo_Feu';
@@ -605,6 +607,12 @@ Nba_ch='NombreAdresses';
nation_ch='Nation'; nation_ch='Nation';
nom_dec_pers_ch='Nom_dec_pers'; nom_dec_pers_ch='Nom_dec_pers';
Nom_fich_TCO_ch='Nom_fichier_TCO'; Nom_fich_TCO_ch='Nom_fichier_TCO';
LargeurF_ch='LargeurF';
HauteurF_ch='HauteurF';
OffsetXF_ch='OffsetX';
OffsetYF_ch='OffsetY';
etatF_ch='EtatF';
PosSplitter_ch='Splitter';
// sections de config // sections de config
section_aig_ch='[section_aig]'; section_aig_ch='[section_aig]';
@@ -627,7 +635,7 @@ var
ligneclicAig,AncLigneClicAig,ligneClicSig,AncligneClicSig,EnvAigDccpp,AdrBaseDetDccpp, ligneclicAig,AncLigneClicAig,ligneClicSig,AncligneClicSig,EnvAigDccpp,AdrBaseDetDccpp,
ligneClicBr,AncligneClicBr,ligneClicAct,AncLigneClicAct,Adressefeuclic,NumTrameCDM, ligneClicBr,AncligneClicBr,ligneClicAct,AncLigneClicAct,Adressefeuclic,NumTrameCDM,
Algo_localisation,Verif_AdrXpressNet,ligneclicTrain,AncligneclicTrain,AntiTimeoutEthLenz, Algo_localisation,Verif_AdrXpressNet,ligneclicTrain,AncligneclicTrain,AntiTimeoutEthLenz,
ligneDCC,decCourant : integer; ligneDCC,decCourant,AffMemoFenetre : integer;
ack_cdm,clicliste,config_modifie,clicproprietes,confasauver,trouve_MaxPort, ack_cdm,clicliste,config_modifie,clicproprietes,confasauver,trouve_MaxPort,
modif_branches,ConfigPrete,trouve_section_dccpp,trouve_section_trains, modif_branches,ConfigPrete,trouve_section_dccpp,trouve_section_trains,
@@ -1642,6 +1650,13 @@ begin
// copie_commentaire; // copie_commentaire;
s:='/ Fichier de configuration de signaux_complexes_GL version '+version+sousversion; s:='/ Fichier de configuration de signaux_complexes_GL version '+version+sousversion;
writeln(fichierN,s); writeln(fichierN,s);
writeln(fichierN,largeurF_ch+'=',largeurF);
writeln(fichierN,hauteurF_ch+'=',hauteurF);
writeln(fichierN,OffsetXF_ch+'=',OffsetXF);
writeln(fichierN,OffsetYF_ch+'=',OffsetYF);
writeln(fichierN,EtatF_ch+'=',EtatF);
writeln(fichierN,PosSplitter_ch+'=',PosSplitter);
writeln(fichierN,AvecVerifIconesTCO_ch+'=',AvecVerifIconesTCO); writeln(fichierN,AvecVerifIconesTCO_ch+'=',AvecVerifIconesTCO);
writeln(fichierN,Algo_localisation_ch+'=',Algo_localisation); writeln(fichierN,Algo_localisation_ch+'=',Algo_localisation);
writeln(fichierN,Avec_roulage_ch+'=',avecRoulage); writeln(fichierN,Avec_roulage_ch+'=',avecRoulage);
@@ -1708,6 +1723,9 @@ begin
// plein écran // plein écran
writeln(fichierN,Fenetre_ch+'=',fenetre); writeln(fichierN,Fenetre_ch+'=',fenetre);
// mémo
writeln(fichierN,AffMemoFenetre_ch+'=',AffMemoFenetre);
// Nombre maxi de détecteurs considérés distants // Nombre maxi de détecteurs considérés distants
writeln(fichierN,nb_det_dist_ch+'=',Nb_Det_Dist); writeln(fichierN,nb_det_dist_ch+'=',Nb_Det_Dist);
@@ -2759,6 +2777,55 @@ end;
if (i>0) and (i<11) then NomfichierTCO[i]:=s; if (i>0) and (i<11) then NomfichierTCO[i]:=s;
end; end;
sa:=uppercase(LargeurF_ch)+'=';
i:=pos(sa,s);
if i=1 then
begin
delete(s,i,length(sa));
val(s,LargeurF,erreur);
end;
sa:=uppercase(HauteurF_ch)+'=';
i:=pos(sa,s);
if i=1 then
begin
delete(s,i,length(sa));
val(s,HauteurF,erreur);
end;
sa:=uppercase(OffsetXF_ch)+'=';
i:=pos(sa,s);
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(EtatF_ch)+'=';
i:=pos(sa,s);
if i=1 then
begin
delete(s,i,length(sa));
val(s,EtatF,erreur);
end;
sa:=uppercase(PosSplitter_ch)+'=';
i:=pos(sa,s);
if i=1 then
begin
delete(s,i,length(sa));
val(s,PosSplitter,erreur);
end;
sa:=uppercase(Filtrage_det_ch)+'='; sa:=uppercase(Filtrage_det_ch)+'=';
i:=pos(sa,s); i:=pos(sa,s);
if i=1 then if i=1 then
@@ -2804,7 +2871,7 @@ end;
if (TailleFonte<8) or (tailleFonte>25) then taillefonte:=10; if (TailleFonte<8) or (tailleFonte>25) then taillefonte:=10;
with FormPrinc.FenRich do with FormPrinc.FenRich do
begin begin
clear; //clear;
Font.Size:=TailleFonte; Font.Size:=TailleFonte;
end; end;
end; end;
@@ -2994,6 +3061,16 @@ end;
if fenetre=1 then Formprinc.windowState:=wsMaximized; if fenetre=1 then Formprinc.windowState:=wsMaximized;
end; end;
// mémo fenetre
sa:=uppercase(AffMemoFenetre_ch)+'=';
i:=pos(sa,s);
if i=1 then
begin
inc(nv);
delete(s,i,length(sa));
val(s,AffMemoFenetre,erreur);
end;
// Nombre de cantons avant signal // Nombre de cantons avant signal
sa:=uppercase(Nb_cantons_Sig_ch)+'='; sa:=uppercase(Nb_cantons_Sig_ch)+'=';
i:=pos(sa,s); i:=pos(sa,s);
@@ -3339,7 +3416,6 @@ begin
if not(trouve_verif_version) then s:=verif_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; Nb_Det_Dist:=3;
// initialisation des aiguillages avec des valeurs par défaut // initialisation des aiguillages avec des valeurs par défaut
for i:=1 to NbreMaxiAiguillages do for i:=1 to NbreMaxiAiguillages do
@@ -3363,7 +3439,6 @@ begin
Detecteur[i].IndexTrain:=0; Detecteur[i].IndexTrain:=0;
Ancien_detecteur[i]:=false; Ancien_detecteur[i]:=false;
end; end;
//Affiche('Lecture du fichier de configuration '+NomConfig,clyellow); //Affiche('Lecture du fichier de configuration '+NomConfig,clyellow);
try try
assign(fichier,NomConfig); assign(fichier,NomConfig);
@@ -3444,6 +3519,18 @@ begin
if not(trouve_section_aig) then Affiche('Manque section '+section_aig_ch,clred); if not(trouve_section_aig) then Affiche('Manque section '+section_aig_ch,clred);
if not(trouve_section_sig) then Affiche('Manque section '+section_sig_ch,clred); if not(trouve_section_sig) then Affiche('Manque section '+section_sig_ch,clred);
if not(trouve_section_branche) then Affiche('Manque section '+section_branches_ch,clred); if not(trouve_section_branche) then Affiche('Manque section '+section_branches_ch,clred);
// fenetre
{
if largeurF>0 then formPrinc.width:=LargeurF;
if HauteurF>0 then formPrinc.Height:=hauteurF;
formPrinc.left:=offsetXF;
formPrinc.top:=offsetYF;
if (PosSplitter>0) and (PosSPlitter<formPrinc.Width) then
begin
formprinc.fenRich.Width:=PosSplitter;
//positionne_elements(PosSplitter);
end;}
end; end;
@@ -3574,6 +3661,7 @@ begin
LanceCDM:=CheckLanceCDM.Checked; LanceCDM:=CheckLanceCDM.Checked;
if CheckFenEt.checked then fenetre:=1 else fenetre:=0; if CheckFenEt.checked then fenetre:=1 else fenetre:=0;
if CheckBoxAffMemo.checked then AffMemoFenetre:=1 else AffMemoFenetre:=0;
AvecTCO:=CheckAvecTCO.checked; AvecTCO:=CheckAvecTCO.checked;
MasqueBandeauTCO:=CheckBandeauTCO.checked; MasqueBandeauTCO:=CheckBandeauTCO.checked;
@@ -3714,6 +3802,7 @@ begin
EditDroit_BD.ReadOnly:=false; EditDroit_BD.ReadOnly:=false;
Edit_HG.ReadOnly:=false; Edit_HG.ReadOnly:=false;
CheckBoxAffMemo.Checked:=AffMemoFenetre=1;
EditNbCantons.text:=intToSTR(Nb_cantons_Sig); EditNbCantons.text:=intToSTR(Nb_cantons_Sig);
EditTempoFeu.Text:=IntToSTR(Tempo_feu); EditTempoFeu.Text:=IntToSTR(Tempo_feu);
EditNbDetDist.text:=IntToSTR(Nb_Det_dist); EditNbDetDist.text:=IntToSTR(Nb_Det_dist);
@@ -8160,7 +8249,7 @@ begin
Affiche('Erreur 10.41: Discordance de déclaration aiguillage '+intToSTR(adr)+': '+intToSTR(adr2),clred); Affiche('Erreur 10.41: Discordance de déclaration aiguillage '+intToSTR(adr)+': '+intToSTR(adr2),clred);
ok:=false; ok:=false;
end; end;
// tjs ou tjs à 4 états // tjs ou tjs à 4 états
if (((model2=tjs) or (model2=tjd)) and (aiguillage[index2].EtatTJD=4)) then if (((model2=tjs) or (model2=tjd)) and (aiguillage[index2].EtatTJD=4)) then
begin begin
@@ -8316,64 +8405,62 @@ begin
// 9. vérifier la cohérence TCO // 9. vérifier la cohérence TCO
if avecTCO then if avecTCO then
begin begin
indexTCO:=1; for indexTCO:=1 to NbreTCO do
for y:=1 to NbreCellY[indexTCO] do for y:=1 to NbreCellY[indexTCO] do
for x:=1 to NbreCellX[indexTCO] do for x:=1 to NbreCellX[indexTCO] do
begin
i:=TCO[indexTCO,x,y].BImage;
adr:=TCO[indexTCO,x,y].adresse;
if i=Id_signal then
begin
if index_Signal(adr)=0 then
begin
Affiche('Un signal '+IntToSTR(adr)+' est déclaré dans le TCO['+intToSTR(x)+','+intToSTR(y)+'] mais absent de la configuration',clred);
ok:=false;
end;
end;
if (i=21) or (i=22) or (i=23) or (i=25) then
begin
if (adr<>0) and (tco[indexTCO,x,y].pont<>0) then
begin
Affiche('Erreur 48 TCO : la cellule '+intToSTR(x)+'/'+intToSTR(y)+' d''adresse '+intToSTR(Adr)+' est décrite comme un croisement ou TJD/S car elle présente une adresse',clred);
Affiche('mais la cellule représente un pont',clred);
ok:=false;
end;
end;
if isAigTCO(i) then
begin begin
i:=TCO[indexTCO,x,y].BImage;
adr:=TCO[indexTCO,x,y].adresse; adr:=TCO[indexTCO,x,y].adresse;
if (index_aig(adr)=0) and (adr<>0) then if i=Id_signal then
begin begin
Affiche('Un aiguillage '+IntToSTR(adr)+' est déclaré dans le TCO['+intToSTR(x)+','+intToSTR(y)+'] mais absent de la configuration',clred); if index_Signal(adr)=0 then
ok:=false;
end;
end;
if (i=1) or (i=6) or (i=7) or (i=8) or (i=9) or (i=16) or (i=17) or (i=18) or (i=19) or (i=20) or (i=10) or (i=11) then
begin
adr:=TCO[indexTCO,x,y].adresse;
if adr<>0 then
begin
j:=1;
repeat
trouveSuiv:=adr=Adresse_detecteur[j];
inc(j);
until (j>NDetecteurs) or trouveSuiv;
if not(trouveSuiv) then
begin begin
Affiche('Un détecteur '+IntToSTR(adr)+' est déclaré dans le TCO['+intToSTR(x)+','+intToSTR(y)+'] mais absent de la configuration',clred); Affiche('Un signal '+IntToSTR(adr)+' est déclaré dans le TCO'+intToSTR(indexTCO)+' ['+intToSTR(x)+','+intToSTR(y)+'] mais absent de la configuration',clred);
ok:=false; ok:=false;
end; end;
end; end;
end; if (i=21) or (i=22) or (i=23) or (i=25) then
if not(verif_cellule(indexTCO,x,y,i)) then begin
begin if (adr<>0) and (tco[indexTCO,x,y].pont<>0) then
Affiche('TCO: Erreur de proximité composants incompatibles: cellules TCO['+intToSTR(x)+','+intToSTR(y)+'] ',clred); begin
ok:=false; Affiche('Erreur 48 TCO'+intToSTR(indexTCO)+' ['+intToSTR(x)+','+intToSTR(y)+'] d''adresse '+intToSTR(Adr)+' décrite comme un croisement ou TJD/S car elle présente une adresse',clred);
end; Affiche('mais la cellule représente un pont',clred);
ok:=false;
end;
end;
if isAigTCO(i) then
end; begin
adr:=TCO[indexTCO,x,y].adresse;
if (index_aig(adr)=0) and (adr<>0) then
begin
Affiche('Un aiguillage '+IntToSTR(adr)+' est déclaré dans le TCO'+intToSTR(indexTCO)+' ['+intToSTR(x)+','+intToSTR(y)+'] mais absent de la configuration',clred);
ok:=false;
end;
end;
if (i=1) or (i=6) or (i=7) or (i=8) or (i=9) or (i=16) or (i=17) or (i=18) or (i=19) or (i=20) or (i=10) or (i=11) then
begin
adr:=TCO[indexTCO,x,y].adresse;
if adr<>0 then
begin
j:=1;
repeat
trouveSuiv:=adr=Adresse_detecteur[j];
inc(j);
until (j>NDetecteurs) or trouveSuiv;
if not(trouveSuiv) then
begin
Affiche('Un détecteur '+IntToSTR(adr)+' est déclaré dans le TCO '+intToSTR(indexTCO)+' ['+intToSTR(x)+','+intToSTR(y)+'] mais absent de la configuration',clred);
ok:=false;
end;
end;
end;
if not(verif_cellule(indexTCO,x,y,i)) then
begin
Affiche('TCO: Erreur de proximité composants incompatibles: cellules TCO'+intToSTR(indexTCO)+' ['+intToSTR(x)+','+intToSTR(y)+'] ',clred);
ok:=false;
end;
end;
end; end;
// 11 Divers // 11 Divers
+4 -3
View File
@@ -59,7 +59,8 @@ object FormConfCellTCO: TFormConfCellTCO
'Centrale' 'Centrale'
'Haut' 'Haut'
'Bas' 'Bas'
'R'#233'parti') 'R'#233'parti'
'Centr'#233)
end end
object ButtonFonte: TButton object ButtonFonte: TButton
Left = 160 Left = 160
@@ -290,8 +291,8 @@ object FormConfCellTCO: TFormConfCellTCO
TabOrder = 5 TabOrder = 5
end end
object GroupBoxAction: TGroupBox object GroupBoxAction: TGroupBox
Left = 56 Left = 24
Top = 176 Top = 184
Width = 249 Width = 249
Height = 105 Height = 105
Caption = 'Action' Caption = 'Action'
+17 -17
View File
@@ -150,7 +150,7 @@ begin
GroupBoxAction.visible:=false; GroupBoxAction.visible:=false;
end; end;
end; end;
if (Bimage=1) or (Bimage=10) or (Bimage=11) or (Bimage=20) then if (Bimage=1) or (Bimage=10) or (Bimage=11) or (Bimage=20) then
begin begin
@@ -339,9 +339,8 @@ begin
end; end;
end; end;
// aiguillage // aiguillage ou TJD
if ((BImage=2) or (BImage=3) or (BImage=4) or (BImage=5) or (BImage=12) or (BImage=13) or (BImage=14) or if IsAigTCO(Bimage) then
(BImage=15) or (BImage=21) or (BImage=22) or (BImage>=24) ) and (Bimage<50) then
formConfCellTCO.checkPinv.Enabled:=true formConfCellTCO.checkPinv.Enabled:=true
else formConfCellTCO.checkPinv.Enabled:=false; else formConfCellTCO.checkPinv.Enabled:=false;
@@ -600,20 +599,21 @@ begin
end; end;
// copie la cellule cliquée du TCO pour la mettre dans la imagePaletteCC
procedure copie_cellule(index : integer); procedure copie_cellule(index : integer);
begin begin
// affiche l'icone cliquée dans la fenetre ----------------------------------------------- // affiche l'icone cliquée dans la fenetre -----------------------------------------------
// pour que le stretchBlt soit visible, il faut mettre à jour la taille du bitmap // pour que le stretchBlt soit visible, il faut mettre à jour la taille du bitmap
with FormConfCellTCO.ImagePaletteCC.Picture.Bitmap do with FormConfCellTCO.ImagePaletteCC.Picture.Bitmap do
begin begin
width:=iconeX; width:=iconeX;
Height:=iconeY; Height:=iconeY;
end; end;
// destination masque avec mise à l'échelle // destination masque avec mise à l'échelle
StretchBlt(FormConfCellTCO.ImagePaletteCC.canvas.Handle,0,0,iconeX,iconeY, StretchBlt(FormConfCellTCO.ImagePaletteCC.canvas.Handle,0,0,iconeX,iconeY,
PcanvasTCO[index].Handle,(XclicCell[index]-1)*largeurCell[index],(YclicCell[index]-1)*hauteurCell[index],largeurCell[index],hauteurCell[index],srccopy); PcanvasTCO[index].Handle,(XclicCell[index]-1)*largeurCell[index],(YclicCell[index]-1)*hauteurCell[index],largeurCell[index],hauteurCell[index],srccopy);
FormConfCellTCO.ImagePaletteCC.repaint; // obligatoire sinon il ne s'affiche pas FormConfCellTCO.ImagePaletteCC.repaint; // obligatoire sinon il ne s'affiche pas
end; end;
procedure TFormConfCellTCO.ImagePaletteCCMouseDown(Sender: TObject; procedure TFormConfCellTCO.ImagePaletteCCMouseDown(Sender: TObject;
@@ -816,9 +816,9 @@ begin
begin begin
x:=XClicCell[IndexTCOCourant]; x:=XClicCell[IndexTCOCourant];
y:=yClicCell[IndexTCOCourant]; y:=yClicCell[IndexTCOCourant];
tco[IndexTCOCourant,X,Y].PiedFeu:=3; tco[IndexTCOCourant,x,y].PiedFeu:=3;
efface_cellule(indexTCOCourant,PCanvasTCO[indexTCOcourant],x,y,pmcopy); efface_cellule(indexTCOCourant,PCanvasTCO[indexTCOcourant],x,y,pmcopy);
affiche_cellule(IndexTCOCourant,x,Y); affiche_cellule(IndexTCOCourant,x,y);
actualise(indexTCOCourant); actualise(indexTCOCourant);
end; end;
end; end;
+17 -14
View File
@@ -245,13 +245,13 @@ begin
end end
else NbreCellY[indexTCO]:=my; else NbreCellY[indexTCO]:=my;
if LargeurCell[indexTCO]*NbreCellX[indexTCO]>8192 then if ZoomMax*NbreCellX[indexTCO]>8192 then
begin begin
LabelErreur.caption:='Erreur: nombre de cellules X'; LabelErreur.caption:='Erreur: nombre de cellules X';
ok:=false; ok:=false;
end; end;
if HauteurCell[indexTCO]*NbreCellY[indexTCO]>8192 then if ZoomMax*NbreCellY[indexTCO]>8192 then
begin begin
LabelErreur.caption:='Erreur: nombre de cellules Y'; LabelErreur.caption:='Erreur: nombre de cellules Y';
ok:=false; ok:=false;
@@ -434,37 +434,36 @@ end;
procedure TFormConfigTCO.BitBtnOkClick(Sender: TObject); procedure TFormConfigTCO.BitBtnOkClick(Sender: TObject);
var ok : boolean; var ok : boolean;
index,i,x,y,erreur : integer; i,x,y,erreur : integer;
s : string; s : string;
begin begin
ok:=true; ok:=true;
index:=indexTCOCourant;
if verif_config_TCO(indexTCOCourant) then if verif_config_TCO(indexTCOCourant) then
begin begin
with FormTCO[index].ImageTCO do with FormTCO[indexTCOCourant].ImageTCO do
begin begin
Width:=LargeurCell[index]*NbreCellX[index]; Width:=LargeurCell[indexTCOCourant]*NbreCellX[indexTCOCourant];
Height:=HauteurCell[index]*NbreCellY[index]; Height:=HauteurCell[indexTCOCourant]*NbreCellY[indexTCOCourant];
end; end;
try try
begin begin
SetLength(TCO[index],NbreCellX[index]+1,NbreCellY[index]+1); SetLength(TCO[indexTCOCourant],NbreCellX[indexTCOCourant]+1,NbreCellY[indexTCOCourant]+1);
init_tampon_copiercoller; init_tampon_copiercoller;
end; end;
except except
LabelErreur.caption:='TCO Mémoire insuffisante'; LabelErreur.caption:='TCO Mémoire insuffisante';
NbreCellX[index]:=20;NbreCellY[index]:=12; NbreCellX[indexTCOCourant]:=20;NbreCellY[indexTCOCourant]:=12;
SetLength(TCO[index],NbreCellX[index]+1,NbreCellY[index]+1); SetLength(TCO[indexTCOCourant],NbreCellX[indexTCOCourant]+1,NbreCellY[indexTCOCourant]+1);
init_tampon_copiercoller; init_tampon_copiercoller;
ok:=false; ok:=false;
end; end;
for y:=1 to NbreCellY[index] do for y:=1 to NbreCellY[indexTCOCourant] do
for x:=1 to NbreCellX[index] do for x:=1 to NbreCellX[indexTCOCourant] do
begin begin
if tco[index,x,y].CouleurFond=0 then tco[index,x,y].CouleurFond:=clfond; if tco[indexTCOCourant,x,y].CouleurFond=0 then tco[indexTCOCourant,x,y].CouleurFond:=clfond;
end; end;
if RadioButtonLignes.Checked then if RadioButtonLignes.Checked then
@@ -501,7 +500,7 @@ begin
calcul_cellules(IndexTCOcourant); calcul_cellules(IndexTCOcourant);
affiche_TCO(indexTCOcourant); affiche_TCO(indexTCOcourant);
dessine_icones(index); dessine_icones(indexTCOCourant);
LabelErreur.caption:=''; LabelErreur.caption:='';
close; close;
end; end;
@@ -537,11 +536,13 @@ end;
procedure TFormConfigTCO.RadioButtonLignesClick(Sender: TObject); procedure TFormConfigTCO.RadioButtonLignesClick(Sender: TObject);
begin begin
if not(clicConf) then TCO_modifie:=true; if not(clicConf) then TCO_modifie:=true;
graphisme:=1;
end; end;
procedure TFormConfigTCO.RadioButtonCourbesClick(Sender: TObject); procedure TFormConfigTCO.RadioButtonCourbesClick(Sender: TObject);
begin begin
if not(clicConf) then TCO_modifie:=true; if not(clicConf) then TCO_modifie:=true;
graphisme:=2;
end; end;
procedure TFormConfigTCO.FormCreate(Sender: TObject); procedure TFormConfigTCO.FormCreate(Sender: TObject);
@@ -563,6 +564,8 @@ begin
ColWidths[2]:=15; ColWidths[2]:=15;
Cells[0,0]:='Num'; Cells[0,0]:='Num';
Cells[1,0]:='Nom fichier'; Cells[1,0]:='Nom fichier';
Cells[2,0]:='X';
end; end;
end; end;
+517 -499
View File
File diff suppressed because it is too large Load Diff
+283 -172
View File
@@ -1,5 +1,5 @@
Unit UnitPrinc; Unit UnitPrinc;
// 07/09 22h // 13/9 11h
(******************************************** (********************************************
Programme signaux complexes Graphique Lenz Programme signaux complexes Graphique Lenz
Delphi 7 + activeX Tmscomm + clientSocket Delphi 7 + activeX Tmscomm + clientSocket
@@ -58,11 +58,7 @@ type
TFormPrinc = class(TForm) TFormPrinc = class(TForm)
Timer1: TTimer; Timer1: TTimer;
LabelTitre: TLabel; LabelTitre: TLabel;
ScrollBox1: TScrollBox;
ClientSocketInterface: TClientSocket; ClientSocketInterface: TClientSocket;
GroupBox1: TGroupBox;
EditAdresse: TEdit;
Label2: TLabel;
MainMenu1: TMainMenu; MainMenu1: TMainMenu;
Interface1: TMenuItem; Interface1: TMenuItem;
MenuConnecterUSB: TMenuItem; MenuConnecterUSB: TMenuItem;
@@ -104,13 +100,7 @@ type
Config: TMenuItem; Config: TMenuItem;
Codificationdesactionneurs1: TMenuItem; Codificationdesactionneurs1: TMenuItem;
OuvrirunfichiertramesCDM1: TMenuItem; OuvrirunfichiertramesCDM1: TMenuItem;
Panel1: TPanel;
BoutonRaf: TButton;
ButtonArretSimu: TButton;
ButtonDroit: TButton;
LabelEtat: TLabel; LabelEtat: TLabel;
ButtonAffTCO: TButton;
ButtonLanceCDM: TButton;
Affichefentredebug1: TMenuItem; Affichefentredebug1: TMenuItem;
StaticText: TStaticText; StaticText: TStaticText;
PopupMenuFenRich: TPopupMenu; PopupMenuFenRich: TPopupMenu;
@@ -118,40 +108,17 @@ type
Etatdessignaux1: TMenuItem; Etatdessignaux1: TMenuItem;
N6: TMenuItem; N6: TMenuItem;
Apropos1: TMenuItem; Apropos1: TMenuItem;
ButtonDevie: TButton;
GroupBox2: TGroupBox;
ButtonEcrCV: TButton;
ButtonLitCV: TButton;
EditCV: TEdit;
Label3: TLabel;
LabelVCV: TLabel;
EditVal: TEdit;
PopupMenuFeu: TPopupMenu; PopupMenuFeu: TPopupMenu;
Proprits1: TMenuItem; Proprits1: TMenuItem;
N8: TMenuItem; N8: TMenuItem;
Vrifierlacohrence: TMenuItem; Vrifierlacohrence: TMenuItem;
GroupBox3: TGroupBox;
loco: TButton;
ButtonLocCV: TButton;
EditAdrTrain: TEdit;
Label4: TLabel;
Label5: TLabel;
EditVitesse: TEdit;
ComboTrains: TComboBox;
LabelFonction: TLabel;
EditNumFonction: TEdit;
ButtonFonction: TButton;
EditFonc01: TEdit;
Label6: TLabel;
Etatdeszonespartrain1: TMenuItem; Etatdeszonespartrain1: TMenuItem;
N7: TMenuItem; N7: TMenuItem;
Demanderversiondelacentrale1: TMenuItem; Demanderversiondelacentrale1: TMenuItem;
Demanderlaversiondelacentrale1: TMenuItem; Demanderlaversiondelacentrale1: TMenuItem;
RepriseDCC1: TMenuItem; RepriseDCC1: TMenuItem;
BoutonRazTrains: TButton;
Demandetataccessoires1: TMenuItem; Demandetataccessoires1: TMenuItem;
LancerCDMrail1: TMenuItem; LancerCDMrail1: TMenuItem;
TrackBarVit: TTrackBar;
ButtonEnv: TButton; ButtonEnv: TButton;
EditEnvoi: TEdit; EditEnvoi: TEdit;
Roulage1: TMenuItem; Roulage1: TMenuItem;
@@ -161,18 +128,10 @@ type
Button1: TButton; Button1: TButton;
Evenementsdetecteurspartrain1: TMenuItem; Evenementsdetecteurspartrain1: TMenuItem;
RazResa: TMenuItem; RazResa: TMenuItem;
SBMarcheArretLoco: TSpeedButton;
Label1: TLabel;
LabelNbTrains: TLabel;
SplitterH: TSplitter;
Panel2: TPanel;
FenRich: TRichEdit;
SplitterV: TSplitter;
Vrifiernouvelleversion1: TMenuItem; Vrifiernouvelleversion1: TMenuItem;
N9: TMenuItem; N9: TMenuItem;
Analyser1: TMenuItem; Analyser1: TMenuItem;
Coller1: TMenuItem; Coller1: TMenuItem;
ButtonAffAnalyseCDM: TButton;
Affiche_fenetre_CDM: TMenuItem; Affiche_fenetre_CDM: TMenuItem;
ImageSignal20: TImage; ImageSignal20: TImage;
COs1: TMenuItem; COs1: TMenuItem;
@@ -206,7 +165,50 @@ type
CO81: TMenuItem; CO81: TMenuItem;
CO91: TMenuItem; CO91: TMenuItem;
CO101: TMenuItem; CO101: TMenuItem;
Panel2: TPanel;
FenRich: TRichEdit;
SplitterV: TSplitter;
ScrollBox1: TScrollBox;
GroupBox1: TGroupBox;
Label2: TLabel;
EditAdresse: TEdit;
ButtonDroit: TButton;
ButtonDevie: TButton;
GroupBox3: TGroupBox;
Label4: TLabel;
Label5: TLabel;
LabelFonction: TLabel;
Label6: TLabel;
SBMarcheArretLoco: TSpeedButton;
loco: TButton;
EditAdrTrain: TEdit;
EditVitesse: TEdit;
ComboTrains: TComboBox;
EditNumFonction: TEdit;
ButtonFonction: TButton;
EditFonc01: TEdit;
TrackBarVit: TTrackBar;
Panel1: TPanel;
Label1: TLabel;
LabelNbTrains: TLabel;
BoutonRaf: TButton;
ButtonArretSimu: TButton;
ButtonAffTCO: TButton;
ButtonLanceCDM: TButton;
ButtonLocCV: TButton;
BoutonRazTrains: TButton;
ButtonAffAnalyseCDM: TButton;
ButtonCDM: TButton; ButtonCDM: TButton;
GroupBox2: TGroupBox;
Label3: TLabel;
LabelVCV: TLabel;
ButtonEcrCV: TButton;
ButtonLitCV: TButton;
EditCV: TEdit;
EditVal: TEdit;
Affichagenormal1: TMenuItem;
N14: TMenuItem;
Sauvegarderla1: TMenuItem;
procedure FormCreate(Sender: TObject); procedure FormCreate(Sender: TObject);
procedure MSCommUSBLenzComm(Sender: TObject); procedure MSCommUSBLenzComm(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormClose(Sender: TObject; var Action: TCloseAction);
@@ -316,6 +318,9 @@ type
procedure CO91Click(Sender: TObject); procedure CO91Click(Sender: TObject);
procedure CO101Click(Sender: TObject); procedure CO101Click(Sender: TObject);
procedure ButtonCDMClick(Sender: TObject); procedure ButtonCDMClick(Sender: TObject);
procedure FormResize(Sender: TObject);
procedure Affichagenormal1Click(Sender: TObject);
procedure Sauvegarderla1Click(Sender: TObject);
private private
{ Déclarations privées } { Déclarations privées }
procedure DoHint(Sender : Tobject); procedure DoHint(Sender : Tobject);
@@ -505,7 +510,8 @@ var
Nbre_recu_cdm,Tempo_chgt_feux,Adj1,Adj2,NbrePN,ServeurInterfaceCDM,index_couleur, Nbre_recu_cdm,Tempo_chgt_feux,Adj1,Adj2,NbrePN,ServeurInterfaceCDM,index_couleur,
ServeurRetroCDM,TailleFonte,Nb_Det_Dist,Tdoubleclic,algo_Unisemaf,fA,fB, ServeurRetroCDM,TailleFonte,Nb_Det_Dist,Tdoubleclic,algo_Unisemaf,fA,fB,
etape,idEl,avecRoulage,intervalle_courant,filtrageDet0,SauvefiltrageDet0, etape,idEl,avecRoulage,intervalle_courant,filtrageDet0,SauvefiltrageDet0,
TpsTimeoutSL,formatY,OsBits,NbreDecPers,NbDecodeur,NbDecodeurdeBase : integer; TpsTimeoutSL,formatY,OsBits,NbreDecPers,NbDecodeur,NbDecodeurdeBase,
LargeurF,HauteurF,OffsetXF,OffsetYF,etatF,PosSplitter : integer;
ack,portCommOuvert,traceTrames,AffMem,CDM_connecte,dupliqueEvt,affiche_retour_dcc, ack,portCommOuvert,traceTrames,AffMem,CDM_connecte,dupliqueEvt,affiche_retour_dcc,
Raz_Acc_signaux,AvecInit,AvecTCO,terminal,Srvc_Aig,Srvc_Det,Srvc_Act,MasqueBandeauTCO, Raz_Acc_signaux,AvecInit,AvecTCO,terminal,Srvc_Aig,Srvc_Det,Srvc_Act,MasqueBandeauTCO,
@@ -762,6 +768,7 @@ procedure inverse_image(imageDest,ImageSrc : Timage) ;
function extract_int(s : string) : integer; function extract_int(s : string) : integer;
Procedure Menu_tco(i : integer); Procedure Menu_tco(i : integer);
procedure Affiche_fenetre_TCO(i : integer); procedure Affiche_fenetre_TCO(i : integer);
procedure positionne_elements(i : integer);
implementation implementation
@@ -2088,6 +2095,41 @@ begin
else Feux[rang].checkFB:=nil; else Feux[rang].checkFB:=nil;
end; end;
procedure Affiche_signaux;
var i : integer;
begin
i:=(Formprinc.ScrollBox1.Width div (largImg+5)) -1;
if i=NbreImagePLigne then exit;
NbreImagePLigne:=i;
for i:=1 to NbreFeux do
begin
with Feux[i].img do
begin
Top:=(HtImg+espY+20)*((i-1) div NbreImagePLigne); // détermine les points d'origine
Left:=10+ (LargImg+5)*((i-1) mod (NbreImagePLigne));
repaint;
end;
with Feux[i].lbl do
begin
Top:=HtImg+((HtImg+EspY+20)*((i-1) div NbreImagePLigne));
Left:=10+ (LargImg+5)*((i-1) mod (NbreImagePLigne));
repaint;
end;
if feux[i].FeuBlanc then
with Feux[i].checkFB do
begin
Top:=HtImg+15+((HtImg+EspY+20)*((i-1) div NbreImagePLigne));
Left:=10+ (LargImg+5)*((i-1) mod (NbreImagePLigne));
repaint;
end;
end;
end;
// ajoute en bout de chaine le checksum d'une trame (pour XpressNet) // ajoute en bout de chaine le checksum d'une trame (pour XpressNet)
Function Checksum(s : string) : string; Function Checksum(s : string) : string;
var i : integer; var i : integer;
@@ -4494,7 +4536,7 @@ begin
TailleX:=ImageFeu.picture.BitMap.Width; TailleX:=ImageFeu.picture.BitMap.Width;
Orientation:=tco[indextco,x,y].FeuOriente; Orientation:=tco[indextco,x,y].FeuOriente;
// réduction variable en fonction de la taille des cellules // réduction variable en fonction de la taille des cellules
calcul_reduction(frx,fry,round(TailleX*LargeurCell[indexTCO]/ZoomMax),round(tailleY*HauteurCell[indexTCO]/ZoomMax),TailleX,TailleY); calcul_reduction(frx,fry,LargeurCell[indexTCO],HauteurCell[indexTCO]);
// décalage en X pour mettre la tete du feu alignée sur le bord droit de la cellule pour les feux tournés à 90G // décalage en X pour mettre la tete du feu alignée sur le bord droit de la cellule pour les feux tournés à 90G
Dessine_feu_mx(PCanvasTCO[indexTCO],tco[indexTCO,x,y].x,tco[indextco,x,y].y,frx,fry,adresse,orientation); Dessine_feu_mx(PCanvasTCO[indexTCO],tco[indexTCO,x,y].x,tco[indextco,x,y].y,frx,fry,adresse,orientation);
end; end;
@@ -11999,12 +12041,30 @@ begin
Result:='mac non trouvée'; Result:='mac non trouvée';
end; end;
procedure positionne_elements(i : integer);
begin
with formprinc do
begin
GroupBox1.Left:=i+12;
GroupBox2.Left:=i+12;
GroupBox3.Left:=i+12;
ScrollBox1.Left:=i+12;
ScrollBox1.width:=panel2.Width-i-5;
Panel1.Left:=GroupBox1.Left+GroupBox1.Width+5;
Panel1.top:=9;
GroupBox1.Top:=5;
Affiche_signaux;
if not(avec_Splitter) then Panel2.Width:=i;
end;
end;
// démarrage principal du programme signaux_complexes // démarrage principal du programme signaux_complexes
procedure TFormPrinc.FormCreate(Sender: TObject); procedure TFormPrinc.FormCreate(Sender: TObject);
var i,j,index : integer; var i,index,OrgMilieu : integer;
s : string; s : string;
begin begin
AF:='Client TCP-IP CDM Rail ou USB - système XpressNet DCC++ Version '+Version+sousVersion+' beta test'; AF:='Client TCP-IP CDM Rail ou USB - système XpressNet DCC++ Version '+Version+sousVersion;
Caption:=AF; Caption:=AF;
TraceSign:=True; TraceSign:=True;
configPrete:=false; // form config prete configPrete:=false; // form config prete
@@ -12058,7 +12118,7 @@ begin
etape:=1; etape:=1;
affevt:=false; affevt:=false;
EvtClicDet:=false; EvtClicDet:=false;
avec_splitter:=false; avec_splitter:=true;
Algo_localisation:=1; // normal Algo_localisation:=1; // normal
AntiTimeoutEthLenz:=0; AntiTimeoutEthLenz:=0;
Verif_AdrXpressNet:=1; Verif_AdrXpressNet:=1;
@@ -12102,90 +12162,7 @@ begin
VertScrollBar.Smooth:=false; VertScrollBar.Smooth:=false;
end; end;
with panel2 do
begin
Panel2.Top:=32;
Panel2.Left:=8;
Width:=610;
Height:=520;
Anchors:=[akLeft,akTop,akRight,akBottom];
end;
if avec_splitter then
begin
with Fenrich do
begin
parent:=panel2;
Align:=alLeft;
left:=0;
top:=0;
width:=panel2.Width-20;
height:=520;
Anchors:=[akLeft,akTop,akRight,akBottom];
end;
with splitterV do
begin
Parent:=panel2;
Left:=FenRich.left+FenRich.Width+1;
//Align:=Fenrich.Align;
//MinSize:=200;
Visible:=true;
end;
with panel2 do
begin
//align:=alLeft;
//Left:=SplitterV.left+10;
end;
with ScrollBox1 do
begin
//Parent:=formprinc;
//align:=alclient;
Anchors:=[];
top:=200;
end;
splitterH.Visible:=false;
{ with splitterH do
begin
Parent:=formprinc;
//top:=FenRich.top+FenRich.height+1;
Width:=FenRich.width;
Align:=alBottom;
MinSize:=200;
Visible:=true;
end;
}
end
else
begin
splitterV.Visible:=false;
splitterH.Visible:=false;
with panel2 do
begin
Anchors:=[akLeft,akTop,akRight,akBottom];
end;
with Fenrich do
begin
parent:=panel2;
Align:=alLeft;
left:=0;
top:=0;
width:=panel2.Width;
height:=panel2.Height;
Anchors:=[akLeft,akTop,akRight,akBottom];
end;
end;
// pour Rad studio------------------------
FenRich.Height:=Height-150;
ScrollBox1.Height:=Height-280;
StaticText.AutoSize:=true;
StaticText.Top:=panel2.Height+Panel2.Top+6;
//----------------------------------------
ferme:=false; ferme:=false;
CDM_connecte:=false; CDM_connecte:=false;
@@ -12198,7 +12175,6 @@ begin
NumTrameCDM:=0; NumTrameCDM:=0;
protocole:=1; protocole:=1;
procetape(''); //1 procetape(''); //1
for i:=1 to NbMemZone do for i:=1 to NbMemZone do
begin begin
Ancien_detecteur[i]:=false; Ancien_detecteur[i]:=false;
@@ -12211,10 +12187,12 @@ begin
Application.HintPause:=400; Application.HintPause:=400;
//visible:=true; // rend la form visible plus tot //visible:=true; // rend la form visible plus tot
for i:=1 to MaxCdeDccpp do CdeDccpp[i]:=''; for i:=1 to MaxCdeDccpp do CdeDccpp[i]:='';
// lecture fichiers de configuration // lecture fichiers de configuration
procetape('Lecture de la configuration'); procetape('Lecture de la configuration');
lit_config; lit_config;
Menu_tco(NbreTCO); Menu_tco(NbreTCO);
procetape('Lecture du TCO'); procetape('Lecture du TCO');
for i:=1 to NbreTCO do for i:=1 to NbreTCO do
@@ -12269,8 +12247,94 @@ begin
intToSTR(ecran[i+1].larg)+' '+intToSTR(ecran[i+1].haut),clyellow); } intToSTR(ecran[i+1].larg)+' '+intToSTR(ecran[i+1].haut),clyellow); }
end; end;
OrgMilieu:=formprinc.width div 2;
with Panel2 do
begin
left:=5;
//Align:=AlLeft; // si on ne met pas AlignLeft, alors le splitter n'est pas accrochable
top:=formprinc.LabelTitre.Height+20;
width:=formprinc.width-30;
height:=formprinc.Height-StatusBar1.Height-StaticText.Height-LabelTitre.Height-90;
//height:=400;
Anchors:=[akLeft,akTop,akRight,akBottom];
end;
if avec_splitter then
begin
with Fenrich do
begin
left:=5;
Align:=AlLeft; // si on ne met pas AlignLeft, alors le splitter n'est pas accrochable
top:=formprinc.LabelTitre.Height+20;
width:=(OrgMilieu)-left-10;
//height:=formprinc.Height-StatusBar1.Height-StaticText.Height-LabelTitre.Height-90;
Anchors:=[akLeft,akTop,akRight,akBottom];
end;
with splitterV do
begin
Left:=FenRich.left+FenRich.Width-25;
MinSize:=200;
Parent:=Panel2;
align:=fenrich.align; // dessine le splitter à droite de la fenetre Fenrich
Visible:=true;
end;
with ScrollBox1 do
begin
Parent:=Panel2;
Anchors:=[akTop,akRight,akBottom];
width:=panel2.Width-SplitterV.Width-5;
height:=panel2.Height-groupBox3.height-groupBox3.top-25;
top:=GroupBox3.Top+GroupBox3.Height+5;
end;
positionne_elements(splitterV.left);
end
// ---------sans splitter -------------
else
begin
splitterV.Visible:=false;
with Fenrich do
begin
// parent:=paànel2;
Align:=alLeft;
left:=5;
top:=0;
width:=panel2.Width-orgMilieu-10;
height:=panel2.Height;
//Anchors:=[akLeft,akTop,akRight,akBottom];
GroupBox1.Left:=orgMilieu+12;
GroupBox3.Left:=orgMilieu+12;
ScrollBox1.Left:=orgMilieu+12;
ScrollBox1.width:=panel2.Width-orgMilieu-5;
ScrollBox1.top:=GroupBox3.Top+GroupBox3.Height+5;
ScrollBox1.Anchors:=[akTop,akRight,akBottom];
Panel1.Left:=GroupBox1.Left+GroupBox1.Width+5;
end;
end;
// pour Rad studio------------------------
//FenRich.Height:=Height-150;
//ScrollBox1.Height:=Height-280;
StaticText.AutoSize:=true;
StaticText.Top:=panel2.Height+Panel2.Top+4;
//----------------------------------------
if (PosSplitter>0) and (PosSPlitter<formPrinc.Width) and (AffMemoFenetre=1) then
begin
fenRich.Width:=PosSplitter;
positionne_elements(PosSplitter);
end;
for index:=1 to nbreTCO do for index:=1 to nbreTCO do
//for j:=1 to 2 do
begin begin
begin begin
IndexTCOCreate:=index; IndexTCOCreate:=index;
@@ -12279,23 +12343,18 @@ begin
formTCO[index].Caption:='TCO'+intToSTR(index); formTCO[index].Caption:='TCO'+intToSTR(index);
end; end;
{
i:=0; i:=0;
repeat repeat
sleep(100); sleep(100);
application.processmessages; application.processmessages;
inc(i); inc(i);
until (TcoCree) or (i>20); until (TcoCree) or (i>20);
TcoCree:=false; TcoCree:=false;
Application.processmessages; Application.processmessages;
if avecTCO then }
begin if avecTCO then Affiche_Fenetre_TCO(index);
//if NbreTCO=1 then FormTCO.show // créer fiche dynamique (projet/fichier) //tcocree:=true;
//else
begin
Affiche_Fenetre_TCO(index);
end;
end;
//tcocree:=true;
end; end;
if debug=1 then Affiche('Initialisations',clLime); if debug=1 then Affiche('Initialisations',clLime);
@@ -12380,7 +12439,6 @@ begin
end; end;
//DoubleBuffered:=true; //DoubleBuffered:=true;
{ {
aiguillage[index_aig(1)].position:=const_droit; aiguillage[index_aig(1)].position:=const_droit;
@@ -12438,9 +12496,11 @@ begin
ReadOnly:=true; ReadOnly:=true;
end; } end; }
//Affiche(GetMACAddress,clred); //Affiche(GetMACAddress,clred);
formPrinc.left:=-1000;
ConfCellTCO:=false; ConfCellTCO:=false;
if debug=1 then Affiche('Fini',clLime); if debug=1 then Affiche('Fini',clLime);
end; end;
@@ -12521,7 +12581,7 @@ begin
end; end;
if confasauver then sauve_config; if confasauver then sauve_config;
if sauve_tco then sauve_fichiers_tco; if sauve_tco then sauve_fichiers_tco;
Application.ProcessMessages; //Application.ProcessMessages;
end; end;
// timer à 100 ms // timer à 100 ms
@@ -12533,6 +12593,23 @@ var aspect,i,a,x,y,Bimage,combine,adresse,TailleX,TailleY,orientation,indexTCO :
s : string; s : string;
begin begin
inc(tick); inc(tick);
if (tick=10) then
begin
// fenetre
if AffMemoFenetre=1 then
begin
if largeurF>0 then formPrinc.width:=LargeurF;
if HauteurF>0 then formPrinc.Height:=hauteurF;
formPrinc.left:=offsetXF;
formPrinc.top:=offsetYF;
if (PosSplitter>0) and (PosSPlitter<formPrinc.Width) then
begin
fenRich.Width:=PosSplitter;
positionne_elements(PosSplitter);
end;
end;
end;
if (tick=30) or (tick=100) then if (tick=30) or (tick=100) then
begin begin
// raz du flag "fenetre confcellTCO affichée" // raz du flag "fenetre confcellTCO affichée"
@@ -12635,7 +12712,7 @@ begin
TailleX:=ImageFeu.picture.BitMap.Width; TailleX:=ImageFeu.picture.BitMap.Width;
Orientation:=TCO[indexTCO,x,y].FeuOriente; Orientation:=TCO[indexTCO,x,y].FeuOriente;
// réduction variable en fonction de la taille des cellules // réduction variable en fonction de la taille des cellules
calcul_reduction(frx,fry,round(TailleX*LargeurCell[indexTCO]/ZoomMax),round(tailleY*HauteurCell[indexTCO]/ZoomMax),TailleX,TailleY); calcul_reduction(frx,fry,LargeurCell[indexTCO],HauteurCell[indexTCO]);
Dessine_feu_mx(PCanvasTCO[indexTCO],tco[indexTCO,x,y].x,tco[indexTCO,x,y].y,frx,fry,adresse,orientation); Dessine_feu_mx(PCanvasTCO[indexTCO],tco[indexTCO,x,y].x,tco[indexTCO,x,y].y,frx,fry,adresse,orientation);
end; end;
end; end;
@@ -15022,19 +15099,12 @@ end;
procedure TFormPrinc.SplitterVMoved(Sender: TObject); procedure TFormPrinc.SplitterVMoved(Sender: TObject);
var pdroite : integer; var i : integer;
begin begin
Affiche(intToSTR(splitterV.Left),clred); i:=SplitterV.Left;
exit; //Affiche(IntToSTR(i),clred);
//fenrich.width:=splitterV.left; if i<200 then SplitterV.Left:=201;
positionne_elements(SplitterV.Left);
if not(avec_splitter) then exit;
//Affiche('splittermoved',clyellow);
pdroite:=SplitterV.Left+40;
panel2.Width:=pdroite;
end; end;
procedure TFormPrinc.PopupMenuFeuPopup(Sender: TObject); procedure TFormPrinc.PopupMenuFeuPopup(Sender: TObject);
@@ -15171,7 +15241,6 @@ begin
for i:=1 to NbreTCO do for i:=1 to NbreTCO do
begin begin
HautTCO:=HautEcran;
for e:=1 to NombreEcrans do for e:=1 to NombreEcrans do
begin begin
@@ -15179,9 +15248,9 @@ begin
begin begin
with formtco[i] do with formtco[i] do
begin begin
windowState:=wsNormal; windowState:=wsNormal;
show; show;
BringToFront; BringToFront;
end; end;
inc(CeTCO[e]); inc(CeTCO[e]);
@@ -15230,7 +15299,6 @@ begin
for i:=1 to NbreTCO do for i:=1 to NbreTCO do
begin begin
HautTCO:=HautEcran;
for e:=1 to NombreEcrans do for e:=1 to NombreEcrans do
begin begin
@@ -15437,15 +15505,17 @@ end;
procedure Affiche_Fenetre_TCO(i : integer); procedure Affiche_Fenetre_TCO(i : integer);
var e : integer; var e : integer;
begin begin
if i>NbreTCO then exit; if (i<1) or (i>NbreTCO) then exit;
formTCO[i].show;
formTCO[i].BringToFront;
e:=ecranTCO[i]; e:=ecranTCO[i];
if e>Screen.MonitorCount then exit; if e>Screen.MonitorCount then e:=1;
formTCO[i].show;
formTCO[i].BringToFront;
formTCO[i].Left:=Ecran[e].x0; formTCO[i].Left:=Ecran[e].x0;
formTCO[i].Top:=Ecran[e].y0; formTCO[i].Top:=Ecran[e].y0;
formTCO[i].windowState:=wsMaximized; formTCO[i].windowState:=wsMaximized;
end; end;
procedure TFormPrinc.AfficherTCO11Click(Sender: TObject); procedure TFormPrinc.AfficherTCO11Click(Sender: TObject);
@@ -15756,7 +15826,8 @@ end;
procedure TFormPrinc.NouveauTCO1Click(Sender: TObject); procedure TFormPrinc.NouveauTCO1Click(Sender: TObject);
begin var i : integer;
begin
if NbreTCO>=10 then if NbreTCO>=10 then
begin begin
Affiche('Nombre maximum de TCO atteint',clred); Affiche('Nombre maximum de TCO atteint',clred);
@@ -15766,14 +15837,25 @@ begin
TCOActive:=false; TCOActive:=false;
inc(nbreTCO); inc(nbreTCO);
IndexTCOCreate:=nbreTCO; IndexTCOCreate:=nbreTCO;
formTCO[nbreTCO]:=TformTCO.Create(self);
formTCO[NbreTCO]:=nil;
try
formTCO[nbreTCO]:=TformTCO.Create(self);
except
Affiche('Erreur 6800 Impossible de créer la fenêtre du TCO',clred);
exit;
end;
formTCO[nbreTCO].Name:='FormTCO'+intToSTR(nbreTCO); formTCO[nbreTCO].Name:='FormTCO'+intToSTR(nbreTCO);
formTCO[nbreTCO].Caption:='TCO'+intToSTR(nbreTCO); formTCO[nbreTCO].Caption:='TCO'+intToSTR(nbreTCO);
Forminit[nbreTCO]:=false; Forminit[nbreTCO]:=false;
init_TCO(nbreTCO); init_TCO(nbreTCO);
menu_tco(NbreTCO); menu_tco(NbreTCO);
TCO_modifie:=true; TCO_modifie:=true;
config_modifie:=true; config_modifie:=true;
formTCO[nbreTCO].show; // génère formActivate ce qui implique que le nom de la form soit à jour, et que le TCO soit initialisé
end; end;
procedure Supprimer_TCO(TcoS : integer); procedure Supprimer_TCO(TcoS : integer);
@@ -15789,8 +15871,9 @@ begin
TCOActive:=false; TCOActive:=false;
Affiche('Suppression du TCO '+intToSTR(Tcos),clOrange); Affiche('Suppression du TCO '+intToSTR(Tcos),clOrange);
//FormTCO[tcos].close;
FormTCO[tcos].Release; // pas free FreeInstance; // annuler le pointeur et raz les mémoires de la form
FormTCO[tcos].close; FormTCO[tcos].close;
FormTCO[tcos].free; // annuler le pointeur et raz les mémoires de la form
for i:=tCos to SauvNbreTCO-1 do for i:=tCos to SauvNbreTCO-1 do
begin begin
@@ -15818,8 +15901,8 @@ begin
HauteurCell[i]:=HauteurCell[i+1]; HauteurCell[i]:=HauteurCell[i+1];
EcranTCO[i]:=EcranTCO[i+1]; EcranTCO[i]:=EcranTCO[i+1];
Forminit[i]:=false; Forminit[i]:=false;
end; end;
setlength(TCO[SauvNbreTCO],0); setlength(TCO[SauvNbreTCO],0);
dec(SauvNbreTCO); dec(SauvNbreTCO);
Menu_tco(SauvNbreTCO); Menu_tco(SauvNbreTCO);
@@ -15890,5 +15973,33 @@ begin
cdmDevant:=not(cdmDevant); cdmDevant:=not(cdmDevant);
end; end;
procedure TFormPrinc.FormResize(Sender: TObject);
begin
// pour éviter de coincer le splitter à gauche fenetre réduite et on le glisse complètement à gauche
splitterV.Left:=FenRich.left+FenRich.Width-5;
end;
procedure TFormPrinc.Affichagenormal1Click(Sender: TObject);
begin
FenRich.Width:=panel2.Width div 2;
splitterV.Left:=FenRich.left+FenRich.Width-5;
positionne_elements(splitterV.Left);
end;
procedure TFormPrinc.Sauvegarderla1Click(Sender: TObject);
begin
LargeurF:=width;
HauteurF:=Height;
OffsetXF:=left;
OffsetYF:=top;
etatF:=0;
PosSplitter:=splitterV.Left;
AffMemoFenetre:=1;
sauve_config;
end;
end. end.
+55 -42
View File
@@ -1,8 +1,8 @@
object FormTCO: TFormTCO object FormTCO: TFormTCO
Left = 118 Left = 84
Top = 115 Top = 164
Width = 1209 Width = 1209
Height = 580 Height = 575
VertScrollBar.Visible = False VertScrollBar.Visible = False
Caption = 'c' Caption = 'c'
Color = clBtnFace Color = clBtnFace
@@ -23,7 +23,7 @@ object FormTCO: TFormTCO
OnMouseWheel = FormMouseWheel OnMouseWheel = FormMouseWheel
DesignSize = ( DesignSize = (
1193 1193
542) 536)
PixelsPerInch = 96 PixelsPerInch = 96
TextHeight = 13 TextHeight = 13
object LabelZoom: TLabel object LabelZoom: TLabel
@@ -56,7 +56,7 @@ object FormTCO: TFormTCO
Left = 10 Left = 10
Top = 15 Top = 15
Width = 943 Width = 943
Height = 330 Height = 325
HorzScrollBar.Smooth = True HorzScrollBar.Smooth = True
HorzScrollBar.Tracking = True HorzScrollBar.Tracking = True
VertScrollBar.Smooth = True VertScrollBar.Smooth = True
@@ -68,12 +68,12 @@ object FormTCO: TFormTCO
TabOrder = 1 TabOrder = 1
DesignSize = ( DesignSize = (
939 939
326) 321)
object ImageTCO: TImage object ImageTCO: TImage
Left = 48 Left = 48
Top = 25 Top = 25
Width = 642 Width = 642
Height = 143 Height = 138
Anchors = [akLeft, akTop, akRight, akBottom] Anchors = [akLeft, akTop, akRight, akBottom]
AutoSize = True AutoSize = True
ParentShowHint = False ParentShowHint = False
@@ -93,11 +93,11 @@ object FormTCO: TFormTCO
Height = 311 Height = 311
Anchors = [akTop, akRight] Anchors = [akTop, akRight]
Ctl3D = True Ctl3D = True
Max = 50 Max = 100
Min = 20 Min = 15
Orientation = trVertical Orientation = trVertical
ParentCtl3D = False ParentCtl3D = False
Position = 20 Position = 78
TabOrder = 0 TabOrder = 0
TabStop = False TabStop = False
TickMarks = tmTopLeft TickMarks = tmTopLeft
@@ -105,7 +105,7 @@ object FormTCO: TFormTCO
end end
object Panel1: TPanel object Panel1: TPanel
Left = 2 Left = 2
Top = 360 Top = 355
Width = 1085 Width = 1085
Height = 185 Height = 185
Anchors = [akLeft, akRight, akBottom] Anchors = [akLeft, akRight, akBottom]
@@ -979,78 +979,78 @@ object FormTCO: TFormTCO
end end
object GroupBox1: TGroupBox object GroupBox1: TGroupBox
Left = 16 Left = 16
Top = 8 Top = 0
Width = 185 Width = 185
Height = 153 Height = 169
Caption = 'Configuration cellule' Caption = 'Configuration cellule'
Font.Charset = ANSI_CHARSET Font.Charset = ANSI_CHARSET
Font.Color = clBackground Font.Color = clBackground
Font.Height = -12 Font.Height = -15
Font.Name = 'MS Sans Serif' Font.Name = 'Arial Narrow'
Font.Style = [] Font.Style = []
ParentFont = False ParentFont = False
TabOrder = 7 TabOrder = 7
object Label41: TLabel object Label41: TLabel
Left = 8 Left = 8
Top = 16 Top = 24
Width = 120 Width = 103
Height = 20 Height = 16
Caption = 'Adresse de l'#39#233'l'#233'ment: ' Caption = 'Adresse de l'#39#233'l'#233'ment: '
Font.Charset = ANSI_CHARSET Font.Charset = ANSI_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -15 Font.Height = -13
Font.Name = 'Arial Narrow' Font.Name = 'Arial Narrow'
Font.Style = [] Font.Style = []
ParentFont = False ParentFont = False
end end
object Label71: TLabel object Label71: TLabel
Left = 8 Left = 8
Top = 38 Top = 46
Width = 111 Width = 93
Height = 20 Height = 16
Caption = 'Image de l'#39#233'l'#233'ment: ' Caption = 'Image de l'#39#233'l'#233'ment: '
Font.Charset = ANSI_CHARSET Font.Charset = ANSI_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -15 Font.Height = -13
Font.Name = 'Arial Narrow' Font.Name = 'Arial Narrow'
Font.Style = [] Font.Style = []
ParentFont = False ParentFont = False
end end
object Label230: TLabel object Label230: TLabel
Left = 56 Left = 56
Top = 64 Top = 72
Width = 32 Width = 27
Height = 20 Height = 16
Caption = 'Texte' Caption = 'Texte'
Font.Charset = ANSI_CHARSET Font.Charset = ANSI_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -15 Font.Height = -13
Font.Name = 'Arial Narrow' Font.Name = 'Arial Narrow'
Font.Style = [] Font.Style = []
ParentFont = False ParentFont = False
end end
object Label65: TLabel object Label65: TLabel
Left = 8 Left = 8
Top = 88 Top = 96
Width = 89 Width = 75
Height = 20 Height = 16
Caption = 'position du texte' Caption = 'position du texte'
Font.Charset = ANSI_CHARSET Font.Charset = ANSI_CHARSET
Font.Color = clBlack Font.Color = clBlack
Font.Height = -15 Font.Height = -13
Font.Name = 'Arial Narrow' Font.Name = 'Arial Narrow'
Font.Style = [] Font.Style = []
ParentFont = False ParentFont = False
end end
object ShapeCoulFond: TShape object ShapeCoulFond: TShape
Left = 160 Left = 160
Top = 130 Top = 146
Width = 18 Width = 18
Height = 18 Height = 18
end end
object EditAdrElement: TEdit object EditAdrElement: TEdit
Left = 144 Left = 144
Top = 12 Top = 20
Width = 33 Width = 33
Height = 21 Height = 21
Font.Charset = ANSI_CHARSET Font.Charset = ANSI_CHARSET
@@ -1065,7 +1065,7 @@ object FormTCO: TFormTCO
end end
object EditTypeImage: TEdit object EditTypeImage: TEdit
Left = 144 Left = 144
Top = 36 Top = 44
Width = 33 Width = 33
Height = 21 Height = 21
Font.Charset = ANSI_CHARSET Font.Charset = ANSI_CHARSET
@@ -1080,7 +1080,7 @@ object FormTCO: TFormTCO
end end
object ButtonFonte: TButton object ButtonFonte: TButton
Left = 8 Left = 8
Top = 64 Top = 72
Width = 41 Width = 41
Height = 17 Height = 17
Caption = 'Fonte' Caption = 'Fonte'
@@ -1089,19 +1089,31 @@ object FormTCO: TFormTCO
end end
object EditTexte: TEdit object EditTexte: TEdit
Left = 88 Left = 88
Top = 60 Top = 70
Width = 89 Width = 89
Height = 21 Height = 21
Font.Charset = ANSI_CHARSET
Font.Color = clBackground
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
ParentFont = False
TabOrder = 3 TabOrder = 3
OnChange = EditTexteChange OnChange = EditTexteChange
end end
object ComboRepr: TComboBox object ComboRepr: TComboBox
Left = 88 Left = 88
Top = 84 Top = 96
Width = 89 Width = 89
Height = 21 Height = 21
Style = csDropDownList Style = csDropDownList
Font.Charset = ANSI_CHARSET
Font.Color = clBackground
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
ItemHeight = 13 ItemHeight = 13
ParentFont = False
TabOrder = 4 TabOrder = 4
TabStop = False TabStop = False
OnChange = ComboReprChange OnChange = ComboReprChange
@@ -1110,19 +1122,20 @@ object FormTCO: TFormTCO
'Centrale' 'Centrale'
'Haut' 'Haut'
'Bas' 'Bas'
'R'#233'parti') 'R'#233'parti'
'Centr'#233)
end end
object CheckPinv: TCheckBox object CheckPinv: TCheckBox
Left = 8 Left = 8
Top = 110 Top = 126
Width = 113 Width = 113
Height = 17 Height = 17
Hint = 'Cocher si l'#39'aiguillage est repr'#233'sent'#233' invers'#233 Hint = 'Cocher si l'#39'aiguillage est repr'#233'sent'#233' invers'#233
Caption = 'aiguillage invers'#233 Caption = 'aiguillage invers'#233
Font.Charset = ANSI_CHARSET Font.Charset = ANSI_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -9 Font.Height = -13
Font.Name = 'MS Sans Serif' Font.Name = 'Arial Narrow'
Font.Style = [] Font.Style = []
ParentFont = False ParentFont = False
ParentShowHint = False ParentShowHint = False
@@ -1132,7 +1145,7 @@ object FormTCO: TFormTCO
end end
object ButtonCoulFond: TButton object ButtonCoulFond: TButton
Left = 80 Left = 80
Top = 130 Top = 146
Width = 81 Width = 81
Height = 18 Height = 18
Caption = 'Couleur de fond' Caption = 'Couleur de fond'
+250 -103
View File
@@ -407,11 +407,12 @@ type
end; end;
const const
MaxCellX=150;MaxCellY=70;
licone=35; licone=35;
hicone=35; hicone=35;
maxUndo=30; maxUndo=30;
ZoomMax=50;ZoomMin=15; ZoomMax=(8191 div MaxCellX)-1; // pour ne pas dépasser un canvas de 8191 pixel maxi
MaxCellX=150;MaxCellY=70; ZoomMin=15;
ClFond_ch='CoulFond'; ClFond_ch='CoulFond';
clVoies_ch='CoulVoies'; clVoies_ch='CoulVoies';
clAllume_ch='CoulAllume'; clAllume_ch='CoulAllume';
@@ -434,7 +435,7 @@ const
// liaisons des voies pour chaque icone par bit (0=NO 1=Nord 2=NE 3=Est 4=SE 5=S 6=SO 7=Ouest) // liaisons des voies pour chaque icone par bit (0=NO 1=Nord 2=NE 3=Est 4=SE 5=S 6=SO 7=Ouest)
Liaisons : array[0..52] of integer= Liaisons : array[0..52] of integer=
// 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
(0,$88,$c8,$8c,$98,$89,$9,$84,$90,$48,$44,$11,$19,$c4,$91,$4c,$21,$24,$42,$12,$22,$cc,$99,$66,$23,$33,$26,$62,$32,$31,0,0, (0,$88,$c8,$8c,$98,$89,$9,$84,$90,$48,$44,$11,$19,$c4,$91,$4c,$21,$24,$42,$12,$22,$cc,$99,$66,$23,$33,$26,$62,$32,$31,0,0,
// 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 // 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
$64,$13,$46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) ; $64,$13,$46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) ;
@@ -467,7 +468,6 @@ type
var var
clAllume,clVoies,clFond,couleurAdresse,clGrille,cltexte,clQuai,CoulFonte,ClCanton,clPiedSignal : Tcolor; clAllume,clVoies,clFond,couleurAdresse,clGrille,cltexte,clQuai,CoulFonte,ClCanton,clPiedSignal : Tcolor;
//FormTCO: TFormTCO;
formTCO : array[1..10] of TformTCO; formTCO : array[1..10] of TformTCO;
TamponAffecte,TCO_modifie,clicsouris, TamponAffecte,TCO_modifie,clicsouris,
@@ -477,7 +477,7 @@ var
HtImageTCO,LargImageTCO,XminiSel,YminiSel,XCoupe,Ycoupe,Temposouris, HtImageTCO,LargImageTCO,XminiSel,YminiSel,XCoupe,Ycoupe,Temposouris,
XmaxiSel,YmaxiSel,AncienXMiniSel,AncienXMaxiSel,AncienYMiniSel,AncienYMaxiSel, XmaxiSel,YmaxiSel,AncienXMiniSel,AncienXMaxiSel,AncienYMiniSel,AncienYMaxiSel,
Xclic,Yclic,XClicCellInserer,YClicCellInserer,RatioC,ModeCouleurCanton, Xclic,Yclic,XClicCellInserer,YClicCellInserer,RatioC,ModeCouleurCanton,
AncienXClicCell,AncienYClicCell, AncienXClicCell,AncienYClicCell,TCODrag,
Epaisseur,oldX,oldY,offsetSourisY,offsetSourisX,AvecVerifIconesTCO,indexTrace,IndexTCOCourant, Epaisseur,oldX,oldY,offsetSourisY,offsetSourisX,AvecVerifIconesTCO,indexTrace,IndexTCOCourant,
ancienTraceX,ancienTraceY,rangUndo,NbreTCO,IndexTCOCreate: integer; ancienTraceX,ancienTraceY,rangUndo,NbreTCO,IndexTCOCreate: integer;
@@ -524,7 +524,7 @@ var
AvecGrille,SelectionAffichee,forminit,modeTrace,entoure : array[1..10] of boolean; AvecGrille,SelectionAffichee,forminit,modeTrace,entoure : array[1..10] of boolean;
procedure calcul_reduction(Var frx,fry : real;DimDestX,DimDestY,DimOrgX,DimOrgY : integer); procedure calcul_reduction(Var frx,fry : real;DimDestX,DimDestY : integer);
procedure calcul_cellules(indextco : integer); procedure calcul_cellules(indextco : integer);
procedure sauve_fichiers_tco; procedure sauve_fichiers_tco;
procedure zone_TCO(indexTCO,det1,det2,mode: integer); procedure zone_TCO(indexTCO,det1,det2,mode: integer);
@@ -560,6 +560,8 @@ uses UnitConfigTCO, Unit_Pilote_aig, UnitConfigCellTCO ;
{$R *.dfm} {$R *.dfm}
// renvoie l'index du tco d'après le nom de la forme (TCO1 TCO2) // renvoie l'index du tco d'après le nom de la forme (TCO1 TCO2)
// ne fonctionne que si t est un composant dont on peut remonter jusqu'à la form parent
// Exemple : si T est un popup menu, ca ne marche pas!!!
function index_TCO(t : Tobject) : integer; function index_TCO(t : Tobject) : integer;
var s : string; var s : string;
trouve : boolean; trouve : boolean;
@@ -568,7 +570,7 @@ var s : string;
begin begin
s:=(t as Tcomponent).name; s:=(t as Tcomponent).name;
// Affiche(s,clWhite); // Affiche(s,clWhite);
// popup menu ne marche pas!!!
f:=getparentForm(t as Tcontrol); f:=getparentForm(t as Tcontrol);
s:=(f as Tcomponent).Name; s:=(f as Tcomponent).Name;
//Affiche(s,clYellow); //Affiche(s,clYellow);
@@ -603,45 +605,45 @@ end;
procedure Init_TCO(indexTCO : integer); procedure Init_TCO(indexTCO : integer);
var x,y : integer; var x,y : integer;
begin begin
sauve_tco:=true; sauve_tco:=true;
Affiche('Nouveau tco '+intToSTr(indexTCO),clyellow); Affiche('Nouveau tco '+intToSTr(indexTCO),clyellow);
NbreCellX[indexTCO]:=35;NbreCellY[indexTCO]:=20;LargeurCell[indexTCO]:=35;HauteurCell[indexTCO]:=35; NbreCellX[indexTCO]:=35;NbreCellY[indexTCO]:=20;LargeurCell[indexTCO]:=35;HauteurCell[indexTCO]:=35;
largeurCelld2[indexTCO]:=largeurCell[indexTCO] div 2;HauteurCelld2[indexTCO]:=HauteurCell[indexTCO] div 2; largeurCelld2[indexTCO]:=largeurCell[indexTCO] div 2;HauteurCelld2[indexTCO]:=HauteurCell[indexTCO] div 2;
EcranTCO[indexTCO]:=1; EcranTCO[indexTCO]:=1;
RatioC:=10; RatioC:=10;
ClFond:=$000040; ClFond:=$000040;
ClVoies:=$0077FF; ClVoies:=$0077FF;
ClAllume:=$00FFFF; ClAllume:=$00FFFF;
ClGrille:=$404040; ClGrille:=$404040;
ClTexte:=$00FF00; ClTexte:=$00FF00;
ClQuai:=$808080; ClQuai:=$808080;
clPiedSignal:=$4080FF; clPiedSignal:=$4080FF;
ClCanton:=$00FFFF; ClCanton:=$00FFFF;
AvecGrille[indexTCO]:=true; AvecGrille[indexTCO]:=true;
Graphisme:=1; Graphisme:=1;
SetLength(TCO[indexTCO],NbreCellX[indexTCO]+2,NbreCellY[indexTCO]+2); // +2 pour éviter les erreurs d'index sur +1 et -1 SetLength(TCO[indexTCO],NbreCellX[indexTCO]+2,NbreCellY[indexTCO]+2); // +2 pour éviter les erreurs d'index sur +1 et -1
init_tampon_copiercoller; init_tampon_copiercoller;
for x:=1 to NbreCellX[indexTCO] do for x:=1 to NbreCellX[indexTCO] do
for y:=1 to NbreCellY[indexTCO] do for y:=1 to NbreCellY[indexTCO] do
with tco[indextco,x,y] do with tco[indextco,x,y] do
begin begin
CouleurFond:=clfond; CouleurFond:=clfond;
Adresse:=0; Adresse:=0;
Bimage:=0; Bimage:=0;
repr:=0; repr:=0;
Texte:=''; Texte:='';
fonte:='Arial'; fonte:='Arial';
fontSTyle:=''; fontSTyle:='';
piedFeu:=0; piedFeu:=0;
x:=0; x:=0;
y:=0; y:=0;
FeuOriente:=0; FeuOriente:=0;
Liaisons:=0; Liaisons:=0;
Epaisseur:=0; Epaisseur:=0;
Buttoir:=0; Buttoir:=0;
end; end;
end; end;
procedure lire_fichier_tco(indexTCO : integer); procedure lire_fichier_tco(indexTCO : integer);
var fichier : textfile; var fichier : textfile;
@@ -797,7 +799,7 @@ begin
trouve_ModeCanton:=true; trouve_ModeCanton:=true;
delete(s,i,length(sa)); delete(s,i,length(sa));
val(s,i,erreur); val(s,i,erreur);
ModeCouleurCanton:=i; ModeCouleurCanton:=i;
end; end;
sa:=uppercase(Graphisme_ch)+'='; sa:=uppercase(Graphisme_ch)+'=';
@@ -1083,7 +1085,6 @@ begin
inc(y);x:=1; inc(y);x:=1;
end; end;
closefile(fichier); closefile(fichier);
e:=sizeof(Tco) div 1024; e:=sizeof(Tco) div 1024;
//Affiche('Dimensions du tco : '+intToSTR(NbreCellX)+'x'+intToSTR(NbreCellY)+' / '+IntToSTR(e)+'Ko',clyellow); //Affiche('Dimensions du tco : '+intToSTR(NbreCellX)+'x'+intToSTR(NbreCellY)+' / '+IntToSTR(e)+'Ko',clyellow);
if not(trouve_clPiedSignal) then clPiedSignal:=Clvoies; if not(trouve_clPiedSignal) then clPiedSignal:=Clvoies;
@@ -1179,8 +1180,12 @@ begin
end; end;
procedure calcul_cellules(indexTCO : integer); procedure calcul_cellules(indexTCO : integer);
var pos : integer;
begin begin
LargeurCell[indexTCO]:=ZoomMax-FormTCO[indexTCO].TrackBarZoom.Position+ZoomMin; pos:=ZoomMax-FormTCO[indexTCO].TrackBarZoom.Position+ZoomMin;
//Affiche('Position TrackBar°'+intToSTR(indexTCO)+'='+intToSTR(pos),clyellow);
LargeurCell[indexTCO]:=pos;
//Affiche('LargeurCell TCO N°'+intToSTR(indexTCO)+'='+intToSTR(largeurcell[indexTCO]),clyellow); //Affiche('LargeurCell TCO N°'+intToSTR(indexTCO)+'='+intToSTR(largeurcell[indexTCO]),clyellow);
hauteurCell[indexTCO]:=(LargeurCell[indexTCO] * RatioC) div 10; hauteurCell[indexTCO]:=(LargeurCell[indexTCO] * RatioC) div 10;
largeurCelld2[indexTCO]:=largeurCell[indexTCO] div 2; largeurCelld2[indexTCO]:=largeurCell[indexTCO] div 2;
@@ -1436,9 +1441,13 @@ var b,x0,y0,xt,yt,repr,taillefont,tf : integer;
ss,s : string; ss,s : string;
c : Tcanvas; c : Tcanvas;
begin begin
x0:=(x-1)*LargeurCell[indexTCO]; x0:=(x-1)*LargeurCell[indexTCO];
y0:=(y-1)*hauteurCell[indexTCO]; y0:=(y-1)*hauteurCell[indexTCO];
//PCanvasTCO.Brush.Style:=bsSolid; //PCanvasTCO.Brush.Style:=bsSolid;
s:=tco[indextco,x,y].Texte;
// if s='' then exit;
c:=PcanvasTCO[indextco]; c:=PcanvasTCO[indextco];
b:=tco[indextco,x,y].BImage; b:=tco[indextco,x,y].BImage;
@@ -1454,15 +1463,8 @@ begin
repr:=tco[indextco,x,y].repr; repr:=tco[indextco,x,y].repr;
taillefont:=tco[indextco,x,y].TailleFonte; taillefont:=tco[indextco,x,y].TailleFonte;
case repr of
0,1 : yt:=(hauteurCell[indexTCO] div 2)-round(tailleFont*fryGlob[indexTCO]); // milieu
2 : yt:=1; // haut
3 : yt:=hauteurCell[indexTCO]-round(2*TailleFont*fryGlob[indexTCO]); // bas
end;
s:=tco[indextco,x,y].Texte; xt:=0;yt:=0;
xt:=0;
if b=52 then xt:=6 else s:=s+' ';
if taillefont=0 then taillefont:=8; if taillefont=0 then taillefont:=8;
tf:=(taillefont*LargeurCell[indexTCO]) div 40; tf:=(taillefont*LargeurCell[indexTCO]) div 40;
@@ -1471,9 +1473,21 @@ begin
//affiche(intToSTR(taillefont*LargeurCell[indexTCO] div 40),clyellow); //affiche(intToSTR(taillefont*LargeurCell[indexTCO] div 40),clyellow);
// champ texte // champ texte
case repr of
0,1 : yt:=(hauteurCell[indexTCO] div 2)-round(tailleFont*fryGlob[indexTCO]); // milieu
2 : yt:=1; // haut
3 : yt:=hauteurCell[indexTCO]-round(2*TailleFont*fryGlob[indexTCO]); // bas
5 : begin // double centré
xt:=(largeurCell[indexTCO] div 2)-(round(length(s)*(taillefont)*frxGlob[indexTCO]) div 3);
yt:=(hauteurCell[indexTCO] div 2)-round(tailleFont*fryGlob[indexTCO]); // texte centré
end;
end;
if b=Id_Quai then xt:=6;
if (b<>Id_Quai) and (b<>Id_action) then s:=s+' ';
if repr=4 then texte_reparti(s,indextco,x,y,tf) else if repr=4 then texte_reparti(s,indextco,x,y,tf) else
c.Textout(x0+xt,y0+yt,s); c.Textout(x0+xt,y0+yt,s);
//PcanvasTCO[indextco].Textout(x0+xt,y0+yt,s);
end; end;
@@ -1667,8 +1681,6 @@ begin
end; end;
end; end;
// sert de référence11 // sert de référence11
procedure dessin_2L(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); procedure dessin_2L(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer);
var x0,y0,xc,yc,jy2,xf,yf,position,jy1,ep : integer; var x0,y0,xc,yc,jy2,xf,yf,position,jy1,ep : integer;
@@ -4809,20 +4821,20 @@ begin
if TCOActive then if TCOActive then
begin begin
tco[indexTCO,x,y].repr:=5;
act:=tco[indexTCO,x,y].PiedFeu; act:=tco[indexTCO,x,y].PiedFeu;
if act=1 then if act=1 then
begin begin
s:='TCO'+intToSTR(tco[indexTCO,x,y].FeuOriente); s:='TCO'+intToSTR(tco[indexTCO,x,y].FeuOriente);
tco[indexTCO,x,y].texte:=s; tco[indexTCO,x,y].texte:=s;
tco[indexTCO,x,y].repr:=1;
tco[indexTCO,x,y].TailleFonte:=8; tco[indexTCO,x,y].TailleFonte:=8;
tco[indexTCO,x,y].FontStyle:='G'; tco[indexTCO,x,y].FontStyle:='G';
end; end;
if act=2 then if act=2 then
begin begin
s:=' SC'; s:='SC';
tco[indexTCO,x,y].texte:=s; tco[indexTCO,x,y].texte:=s;
tco[indexTCO,x,y].repr:=1;
tco[indexTCO,x,y].TailleFonte:=8; tco[indexTCO,x,y].TailleFonte:=8;
tco[indexTCO,x,y].FontStyle:='G'; tco[indexTCO,x,y].FontStyle:='G';
end; end;
@@ -4830,7 +4842,6 @@ begin
begin begin
s:='CDM'; s:='CDM';
tco[indexTCO,x,y].texte:=s; tco[indexTCO,x,y].texte:=s;
tco[indexTCO,x,y].repr:=1;
tco[indexTCO,x,y].TailleFonte:=8; tco[indexTCO,x,y].TailleFonte:=8;
tco[indexTCO,x,y].FontStyle:='G'; tco[indexTCO,x,y].FontStyle:='G';
end; end;
@@ -7111,10 +7122,12 @@ begin
end; end;
// calcul des facteurs de réductions X et Y pour l'adapter à l'image de destination // calcul des facteurs de réductions X et Y pour l'adapter à l'image de destination
procedure calcul_reduction(Var frx,fry : real;DimDestX,DimDestY,DimOrgX,DimOrgY : integer); procedure calcul_reduction(Var frx,fry : real;DimDestX,DimDestY : integer);
begin begin
frX:=DimDestX/DimOrgX; //frX:=DimDestX/DimOrgX;
frY:=DimDestY/DimOrgY; //frY:=DimDestY/DimOrgY;
frx:=DimDestX/50;
fry:=DimDestY/50;
//Affiche(formatfloat('0.000000',frY),clyellow); //Affiche(formatfloat('0.000000',frY),clyellow);
end; end;
@@ -7529,14 +7542,17 @@ end;
// Dessine un signal dans le canvasDest en x,y , dont l'adresse se trouve à la cellule x,y // Dessine un signal dans le canvasDest en x,y , dont l'adresse se trouve à la cellule x,y
procedure dessin_Signal(indexTCO : integer;CanvasDest : Tcanvas;x,y : integer ); procedure dessin_Signal(indexTCO : integer;CanvasDest : Tcanvas;x,y : integer );
var index,x0,y0,xp,yp,orientation,adresse,aspect,PiedFeu,TailleX,TailleY : integer; var index,x0,y0,xp,yp,orientation,adresse,aspect,PiedFeu,TailleX,TailleY,larg,haut : integer;
ImageFeu : Timage; ImageFeu : Timage;
frX,frY : real; frX,frY : real;
begin begin
if (x>NbreCellX[indexTCO]) or (y>NbreCellY[indexTCO]) or (x<1) or (y<1) then exit; if (x>NbreCellX[indexTCO]) or (y>NbreCellY[indexTCO]) or (x<1) or (y<1) then exit;
xp:=(x-1)*LargeurCell[indexTCO]; larg:=LargeurCell[indexTCO];
yp:=(y-1)*hauteurCell[indexTCO]; haut:=hauteurCell[indexTCO];
xp:=(x-1)*larg;
yp:=(y-1)*haut;
Adresse:=tco[indextco,x,y].Adresse; Adresse:=tco[indextco,x,y].Adresse;
Orientation:=tco[indextco,x,y].FeuOriente; Orientation:=tco[indextco,x,y].FeuOriente;
@@ -7570,7 +7586,7 @@ begin
PiedFeu:=tco[indextco,x,y].PiedFeu; // gauche ou droite de la voie PiedFeu:=tco[indextco,x,y].PiedFeu; // gauche ou droite de la voie
// réduction variable en fonction de la taille des cellules. 50 est le Zoom Maxi // réduction variable en fonction de la taille des cellules. 50 est le Zoom Maxi
calcul_reduction(frx,fry,round(TailleX*LargeurCell[indexTCO]/ZoomMax),round(tailleY*hauteurCell[indexTCO]/ZoomMax),TailleX,TailleY); calcul_reduction(frx,fry,Larg,haut);
x0:=0;y0:=0; // pour les signaux directionnels x0:=0;y0:=0; // pour les signaux directionnels
if orientation=3 then //D if orientation=3 then //D
@@ -8012,7 +8028,7 @@ begin
calcul_reduction(frxGlob[indexTCO],fryGlob[indexTCO],LargeurCell[indexTCO],hauteurCell[indexTCO],ZoomMax,ZoomMax); calcul_reduction(frxGlob[indexTCO],fryGlob[indexTCO],LargeurCell[indexTCO],hauteurCell[indexTCO]);
//Affiche(formatfloat('0.000000',frxGlob[indexTCO]),clyellow); //Affiche(formatfloat('0.000000',frxGlob[indexTCO]),clyellow);
//effacer tout //effacer tout
@@ -8095,6 +8111,7 @@ begin
Buttonmasquer.TabStop:=false; Buttonmasquer.TabStop:=false;
ButtonRaz.TabStop:=false; ButtonRaz.TabStop:=false;
ButtonDessiner.TabStop:=false; ButtonDessiner.TabStop:=false;
TrackBarZoom.position:=78;
Clfond:=$000040; Clfond:=$000040;
couleurAdresse:=Cyan; couleurAdresse:=Cyan;
@@ -9176,17 +9193,14 @@ begin
ImageTemp.Visible:=not(Diffusion); ImageTemp.Visible:=not(Diffusion);
ImageTemp2.Visible:=not(Diffusion); ImageTemp2.Visible:=not(Diffusion);
ButtonAfficheBandeau.visible:=false; ButtonAfficheBandeau.visible:=false;
TrackBarZoom.Max:=ZoomMax;
TrackBarZoom.Min:=ZoomMin;
hauteurCell[indexTCO]:=ImagePalette1.Height; hauteurCell[indexTCO]:=ImagePalette1.Height;
LargeurCell[indexTCO]:=ImagePalette1.Width; LargeurCell[indexTCO]:=ImagePalette1.Width;
LargeurCelld2[indexTCO]:=LargeurCell[indexTCO] div 2;hauteurCelld2[indexTCO]:=hauteurCell[indexTCO] div 2; LargeurCelld2[indexTCO]:=LargeurCell[indexTCO] div 2;hauteurCelld2[indexTCO]:=hauteurCell[indexTCO] div 2;
calcul_reduction(frxGlob[indexTCO],fryGlob[indexTCO],LargeurCell[indexTCO],hauteurCell[indexTCO],ZoomMax,ZoomMax); calcul_reduction(frxGlob[indexTCO],fryGlob[indexTCO],LargeurCell[indexTCO],hauteurCell[indexTCO]);
dessine_icones(indexTCO); dessine_icones(indexTCO);
NbCellulesTCO[indexTCO]:=NbreCellX[indexTCO]*NbreCellY[indexTCO]; NbCellulesTCO[indexTCO]:=NbreCellX[indexTCO]*NbreCellY[indexTCO];
ImageTCO.Width:=LargeurCell[indexTCO]*NbreCellX[indexTCO]; ImageTCO.Width:=LargeurCell[indexTCO]*NbreCellX[indexTCO];
ImageTCO.Height:=hauteurCell[indexTCO]*NbreCellY[indexTCO]; ImageTCO.Height:=hauteurCell[indexTCO]*NbreCellY[indexTCO];
@@ -9202,12 +9216,11 @@ begin
PImageTemp[indextco]:=FormTCO[indextco].ImageTemp; PImageTemp[indextco]:=FormTCO[indextco].ImageTemp;
PImageTemp[indextco].Canvas.Rectangle(0,0,PImageTemp[indextco].Width,PimageTemp[indextco].Height); PImageTemp[indextco].Canvas.Rectangle(0,0,PImageTemp[indextco].Width,PimageTemp[indextco].Height);
//Affiche_tco
with trackBarZoom do //déclenche l'Affiche_tco
begin TrackBarZoom.Max:=ZoomMax;
Position:=(ZoomMax+Zoommin) div 2; TrackBarZoom.Min:=ZoomMin;
//left:=clLarge-50; TrackBarZoom.position:=34;
end;
// height est la taille utile de la fenetre = taille fenetre-32 // height est la taille utile de la fenetre = taille fenetre-32
clLarge:=formTCO[indexTCO].Width; clLarge:=formTCO[indexTCO].Width;
@@ -9562,23 +9575,82 @@ begin
end; end;
end; end;
procedure selection_bleue(indexTCO,cellX,cellY : integer);
var XSel1,YSel1,XSel2,YSel2,xMiniSelP,yminiSelP,xMaxiSelP,ymaxiSelP : integer;
r : Trect;
begin
// zone de sélection bleue en coords pixels
xMiniSel:=(Xentoure[indexTCO]-1)*LargeurCell[indexTCO];;
yMiniSel:=(Yentoure[indexTCO]-1)*HauteurCell[indexTCO];;
xMaxiSel:=(cellX-1)*LargeurCell[indexTCO];
yMaxiSel:=(cellY-1)*hauteurCell[indexTCO];
xminiSelP:=min(xminiSel,xMaxiSel);
yminiSelP:=min(yminiSel,yMaxiSel);
xmaxiSelP:=max(xminiSel,xMaxiSel);
ymaxiSelP:=max(yminiSel,yMaxiSel);
xminiSel:=xMiniSelP;
yminiSel:=yMiniSelP;
xMaxiSel:=xMaxiSelP;
yMaxiSel:=yMaxiSelP;
//Affiche('xMiniSel='+IntToSTR(xMiniSel)+' yMiniSel='+IntToSTR(yMiniSel)+' xMaxiSel='+IntToSTR(xMaxiSel)+' yMaxiSel='+IntToSTR(yMaxiSel),clOrange);
// efface l'ancien rectangle de sélection
if SelectionAffichee[indexTCO] then
with formTCO[indexTCO].ImageTCO.canvas do
begin
Pen.Mode:=PmXor;
Pen.color:=clGrille;
Brush.Color:=clblue;
Rectangle(rAncien);
end;
if piloteAig then begin SelectionAffichee[indexTCO]:=false;piloteAig:=false;exit;end;
r:=Rect(xminiSel+1,YminiSel+1,XmaxiSel+LargeurCell[indexTCO],yMaxiSel+hauteurCell[indexTCO]);
XSel1:=Xminisel div LargeurCell[indexTCO] + 1;
YSel1:=Yminisel div hauteurCell[indexTCO] + 1;
XSel2:=Xmaxisel div LargeurCell[indexTCO] + 1;
YSel2:=Ymaxisel div hauteurCell[indexTCO] + 1;
//Affiche(intToSTR(Xsel1)+' '+intToStr(Ysel1)+' '+intToSTR(Xsel2)+' '+intToStr(Ysel2),clYellow);
// Affiche le nouveau rectangle de sélection
Rancien:=r;
with formTCO[indexTCO].ImageTCO.canvas do
begin
Pen.Mode:=PmXor;
Pen.color:=clGrille;
Brush.Color:=clblue;
//FillRect(r);
Rectangle(r);
end;
SelectionAffichee[indexTCO]:=true;
end;
// pour avoir les evts keydown, il faut dévalider les propriétés tabstop des boutons de la form. // pour avoir les evts keydown, il faut dévalider les propriétés tabstop des boutons de la form.
procedure TFormTCO.FormKeyDown(Sender: TObject; var Key: Word;Shift: TShiftState); procedure TFormTCO.FormKeyDown(Sender: TObject; var Key: Word;Shift: TShiftState);
var s,d,indexTCO : integer; var s,d,indexTCO,x,y : integer;
procede : boolean; procede : boolean;
begin begin
if affevt then Affiche('TCO.FormKeyDown',clOrange); if affevt then Affiche('TCO.FormKeyDown',clOrange);
if not(auto_tcurs) then exit;
indexTCO:=index_TCO(Sender); indexTCO:=index_TCO(Sender);
procede:=false; // indicateur on a tapé une touche de curseur procede:=false; // indicateur on a tapé une touche de curseur
//Affiche(intToSTR(key),clyellow); //Affiche(intToSTR(key),clyellow);
if auto_tcurs then
x:=XClicCell[indexTCO];
y:=YClicCell[indexTCO];
with formTCO[indexTCO] do with formTCO[indexTCO] do
begin begin
if not(ssShift in Shift) then
case Key of case Key of
VK_right : if XClicCell[indexTCO]<NbreCellX[indexTCO] then VK_right : if x<NbreCellX[indexTCO] then
begin begin
Affiche('droit sans shift',clred);
inc(XClicCell[indexTCO]); inc(XClicCell[indexTCO]);
d:=(xClicCell[indexTCO]+1)*LargeurCell[indexTCO]; d:=(xClicCell[indexTCO]+1)*LargeurCell[indexTCO];
s:=scrollBox.HorzScrollBar.Position; s:=scrollBox.HorzScrollBar.Position;
@@ -9627,15 +9699,80 @@ begin
stop_modetrace(indexTCO); stop_modetrace(indexTCO);
end; end;
VK_DELETE : couper(indexTCO); VK_DELETE : couper(indexTCO);
end;
if (ssShift in Shift) then
case key of
VK_right : begin
if XClicCell[indexTCO]<NbreCellX[indexTCO] then
begin
inc(XClicCell[indexTCO]);
d:=(xClicCell[indexTCO]+1)*LargeurCell[indexTCO];
s:=scrollBox.HorzScrollBar.Position;
if d-s>ScrollBox.Width then scrollBox.HorzScrollBar.Position:=s+LargeurCell[indexTCO];
procede:=true;
end
else exit;
selection_bleue(indexTCO,XClicCell[indexTCO],YClicCell[indexTCO]);
exit;
end;
VK_down : begin
if YClicCell[indexTCO]<NbreCellY[indexTCO] then
begin
inc(YClicCell[indexTCO]);
d:=(yClicCell[indexTCO]+1)*hauteurCell[indexTCO];
s:=scrollBox.VertScrollBar.Position;
if d-s>ScrollBox.Height then scrollBox.VertScrollBar.Position:=s+hauteurCell[indexTCO];
procede:=true;
end
else exit;
selection_bleue(indexTCO,XClicCell[indexTCO],YClicCell[indexTCO]);
exit;
end;
VK_up : begin
if YClicCell[indexTCO]>1 then
begin
dec(YClicCell[indexTCO]);
d:=(yClicCell[indexTCO]-1)*hauteurCell[indexTCO];
s:=scrollBox.VertScrollBar.Position;
if d<s then
begin
s:=s-hauteurCell[indexTCO];
if s<hauteurCell[indexTCO] then s:=0;
scrollBox.VertScrollBar.Position:=s;
end;
procede:=true;
end
else exit;
selection_bleue(indexTCO,XClicCell[indexTCO],YClicCell[indexTCO]);
exit;
end;
VK_left : begin
if XClicCell[indexTCO]>1 then
begin
dec(XClicCell[indexTCO]);
d:=(xClicCell[indexTCO]-1)*LargeurCell[indexTCO];
s:=scrollBox.HorzScrollBar.Position;
if d<=s then
begin
s:=s-LargeurCell[indexTCO];
if s<LargeurCell[indexTCO] then s:=0;
scrollBox.HorzScrollBar.Position:=s;
end;
procede:=true;
end
else exit;
selection_bleue(indexTCO,XClicCell[indexTCO],YClicCell[indexTCO]);
exit;
end;
end; end;
end; end;
if (ssCtrl in Shift) and (Key = Ord('Z')) then if (ssCtrl in Shift) and (Key = Ord('Z')) then
begin begin
annule(indexTCO); annule(indexTCO);
exit; exit;
end; end;
//VK_delete : affiche('delete',clorange); //VK_delete : affiche('delete',clorange);
if procede then if procede then
@@ -9711,6 +9848,7 @@ begin
StretchBlt(Vbm.Handle,0,0,LargeurCell[indexTCO],hauteurCell[indexTCO], // destination masque avec mise à l'échelle StretchBlt(Vbm.Handle,0,0,LargeurCell[indexTCO],hauteurCell[indexTCO], // destination masque avec mise à l'échelle
image.Canvas.Handle,0,0,l,h,srccopy); image.Canvas.Handle,0,0,l,h,srccopy);
drag:=true; drag:=true;
TCODrag:=indexTCO;
oldx:=offsetSourisX;oldy:=offsetSourisY; oldx:=offsetSourisX;oldy:=offsetSourisY;
end; end;
@@ -9719,9 +9857,15 @@ procedure TFormTCO.ImageTCODragOver(Sender, Source: TObject; X, Y: Integer;State
var indexTCO,xl,yl : integer; var indexTCO,xl,yl : integer;
begin begin
indexTCO:=Index_tco(sender); indexTCO:=Index_tco(sender);
if affevt then Affiche('TCO'+intToSTR(IndexTCO)+' DragOver',clyellow);
if TCODrag<>indexTCO then
begin
accept:=false;
exit; // le drag source et destination sont diférents
end;
xl:=x+offsetSourisX; xl:=x+offsetSourisX;
yl:=y+offsetSourisY; yl:=y+offsetSourisY;
// Accept:=source is TImage; Accept:=source is TImage;
if drag then if drag then
begin begin
BitBlt(PImageTCO[indexTCO].canvas.handle,oldx,oldy,LargeurCell[indexTCO],hauteurCell[indexTCO],oldbmp.canvas.handle,0,0,SRCCOPY); // remettre la sauvegarde du bitmap à l'ancienne position souris BitBlt(PImageTCO[indexTCO].canvas.handle,oldx,oldy,LargeurCell[indexTCO],hauteurCell[indexTCO],oldbmp.canvas.handle,0,0,SRCCOPY); // remettre la sauvegarde du bitmap à l'ancienne position souris
@@ -10591,7 +10735,7 @@ begin
show; show;
BringToFront; BringToFront;
end; end;
if (i=3) and (CDMhd<>0) then ShowWindow(CDMhd,SW_MAXIMIZE); if (i=3) and (CDMhd<>0) then begin ShowWindow(CDMhd,SW_MAXIMIZE);end;
end; end;
TempoSouris:=2 ; // démarre la tempo souris TempoSouris:=2 ; // démarre la tempo souris
@@ -10738,7 +10882,6 @@ begin
Pen.Mode:=PmXor; Pen.Mode:=PmXor;
Pen.color:=clGrille; Pen.color:=clGrille;
Brush.Color:=clblue; Brush.Color:=clblue;
//FillRect(r);
Rectangle(rAncien); Rectangle(rAncien);
end; end;
SelectionAffichee[n]:=false; SelectionAffichee[n]:=false;
@@ -10848,6 +10991,7 @@ begin
if not(clicsouris) or (temposouris>0) then exit; if not(clicsouris) or (temposouris>0) then exit;
// zone de sélection bleue en coordonnées souris
xMiniSel:=(XclicCell[indexTCO]-1)*LargeurCell[indexTCO]; xMiniSel:=(XclicCell[indexTCO]-1)*LargeurCell[indexTCO];
yMiniSel:=(YclicCell[indexTCO]-1)*hauteurCell[indexTCO]; yMiniSel:=(YclicCell[indexTCO]-1)*hauteurCell[indexTCO];
xMaxiSel:=(cellX-1)*LargeurCell[indexTCO]; xMaxiSel:=(cellX-1)*LargeurCell[indexTCO];
@@ -10864,6 +11008,7 @@ begin
yMaxiSel:=yMaxiSelP; yMaxiSel:=yMaxiSelP;
//Affiche('xMiniSel='+IntToSTR(xMiniSel)+' yMiniSel='+IntToSTR(yMiniSel)+' xMaxiSel='+IntToSTR(xMaxiSel)+' yMaxiSel='+IntToSTR(yMaxiSel),clOrange); //Affiche('xMiniSel='+IntToSTR(xMiniSel)+' yMiniSel='+IntToSTR(yMiniSel)+' xMaxiSel='+IntToSTR(xMaxiSel)+' yMaxiSel='+IntToSTR(yMaxiSel),clOrange);
//Affiche('XclicCell='+intToSTR(XclicCell[indexTCO])+' YclicCell='+intToSTR(XclicCell[indexTCO]),clorange);
// efface l'ancien rectangle de sélection // efface l'ancien rectangle de sélection
if SelectionAffichee[indexTCO] then if SelectionAffichee[indexTCO] then
@@ -11233,8 +11378,9 @@ end;
procedure TFormTCO.TrackBarZoomChange(Sender: TObject); procedure TFormTCO.TrackBarZoomChange(Sender: TObject);
var indextco : integer; var indextco : integer;
begin begin
if affevt then Affiche('TrackVBarZoomChange',clyellow); if affevt then Affiche('TrackBarZoomChange',clyellow);
indexTCO:=index_tco(sender); indexTCO:=index_tco(sender);
// Affiche(intToSTR(TrackBarZoom.position),clred);
calcul_cellules(indexTCO); calcul_cellules(indexTCO);
Affiche_TCO(indexTCO); Affiche_TCO(indexTCO);
SelectionAffichee[indexTCO]:=false; SelectionAffichee[indexTCO]:=false;
@@ -11907,20 +12053,22 @@ begin
if NbreCellY[indexTCO]<=1 then exit; if NbreCellY[indexTCO]<=1 then exit;
TamponAffecte:=false; TamponAffecte:=false;
// tampon de sauvegarde // tampon de sauvegarde
TamponTCO_org.numTCO:=indexTCO;
TamponTCO_Org.NbreCellX:=NbreCellX[indexTCO]; TamponTCO_Org.NbreCellX:=NbreCellX[indexTCO];
TamponTCO_Org.NbreCellY:=NbreCellY[indexTCO]; TamponTCO_Org.NbreCellY:=NbreCellY[indexTCO];
TamponTCO_Org.x1:=1; TamponTCO_Org.x1:=1;
TamponTCO_Org.x2:=NbreCellX[indexTCO]; TamponTCO_Org.x2:=NbreCellX[indexTCO];
TamponTCO_Org.y1:=1; TamponTCO_Org.y1:=YClicCell[indexTCO];
TamponTCO_Org.y2:=NbreCellY[indexTCO]; TamponTCO_Org.y2:=YClicCell[indexTCO];
xcoupe:=1;ycoupe:=1; xcoupe:=1;ycoupe:=1;
for y:=TamponTCO_Org.y1 to TamponTCO_Org.y2 do for y:=TamponTCO_Org.y1 to TamponTCO_Org.y2 do
for x:=TamponTCO_Org.x1 to TamponTCO_Org.x2 do for x:=TamponTCO_Org.x1 to TamponTCO_Org.x2 do
begin begin
//Affiche(intToSTR(x)+' '+intToSTR(y),clyellow); //Affiche(intToSTR(x)+' '+intToSTR(y),clyellow);
tampontco[x,y]:=tco[indextco,x,y]; tampontco[x,y]:=tco[indextco,x,y];
end; end;
//TamponAffecte:=true; TamponAffecte:=true;
// supression ligne // supression ligne
for y:=YClicCell[indexTCO] to NbreCellY[indexTCO]-1 do for y:=YClicCell[indexTCO] to NbreCellY[indexTCO]-1 do
@@ -12029,15 +12177,15 @@ begin
// tampon de sauvegarde // tampon de sauvegarde
TamponTCO_Org.NbreCellX:=NbreCellX[indexTCO]; TamponTCO_Org.NbreCellX:=NbreCellX[indexTCO];
TamponTCO_Org.NbreCellY:=NbreCellY[indexTCO]; TamponTCO_Org.NbreCellY:=NbreCellY[indexTCO];
TamponTCO_Org.x1:=1; TamponTCO_Org.x1:=xClicCell[indexTCO];
TamponTCO_Org.x2:=NbreCellX[indexTCO]; TamponTCO_Org.x2:=xClicCell[indexTCO];
TamponTCO_Org.y1:=1; TamponTCO_Org.y1:=1;
TamponTCO_Org.y2:=NbreCellY[indexTCO]; TamponTCO_Org.y2:=NbreCellY[indexTCO];
xcoupe:=1;ycoupe:=1; xcoupe:=1;ycoupe:=1;
for y:=TamponTCO_Org.y1 to TamponTCO_Org.y2 do for y:=TamponTCO_Org.y1 to TamponTCO_Org.y2 do
for x:=TamponTCO_Org.x1 to TamponTCO_Org.x2 do for x:=TamponTCO_Org.x1 to TamponTCO_Org.x2 do
tampontco[x,y]:=tco[indextco,x,y]; tampontco[x,y]:=tco[indextco,x,y];
// TamponAffecte:=true; TamponAffecte:=true;
// supression colonne // supression colonne
for x:=xClicCell[indexTCO] to NbreCellx[indexTCO]-1 do for x:=xClicCell[indexTCO] to NbreCellx[indexTCO]-1 do
@@ -12128,7 +12276,7 @@ begin
x:=0; x:=0;
y:=0; y:=0;
indexTCO:=index_tco(sender); indexTCO:=index_tco(sender);
calcul_reduction(frxGlob[indexTCO],fryGlob[indexTCO],LargeurCell[indexTCO],hauteurCell[indexTCO],ZoomMax,ZoomMax); calcul_reduction(frxGlob[indexTCO],fryGlob[indexTCO],LargeurCell[indexTCO],hauteurCell[indexTCO]);
with imageTCO.Canvas do with imageTCO.Canvas do
begin begin
pen.color:=clyellow; pen.color:=clyellow;
@@ -12201,7 +12349,6 @@ procedure TFormTCO.ImagePalette1MouseDown(Sender: TObject;Button: TMouseButton;
begin begin
debut_drag(ImagePalette1); debut_drag(ImagePalette1);
end; end;
procedure TFormTCO.FormDragOver(Sender, Source: TObject; X, Y: Integer; procedure TFormTCO.FormDragOver(Sender, Source: TObject; X, Y: Integer;
State: TDragState; var Accept: Boolean); State: TDragState; var Accept: Boolean);
@@ -12267,7 +12414,7 @@ begin
traceXY[1].y:=0; traceXY[1].y:=0;
traceXY[2].x:=0; traceXY[2].x:=0;
traceXY[2].x:=0; traceXY[2].x:=0;
FormTCO[indexTCO].Caption:='** Mode dessin ** Clic droit pour lever le pointeur. Touche Echap pour quitter le mode tracé. CTRL-Z ou annuler pour annuler les derniers tracés.'; FormTCO[indexTCO].Caption:='TCO'+intToSTR(indexTCO)+' ** Mode dessin ** Clic droit pour lever le pointeur. Touche Echap pour quitter le mode tracé. CTRL-Z ou annuler pour annuler les derniers tracés.';
screen.cursor:=crUpArrow; screen.cursor:=crUpArrow;
end end
else stop_modetrace(indexTCO); else stop_modetrace(indexTCO);
+25 -6
View File
@@ -25,7 +25,7 @@ var
verifVersion,notificationVersion : boolean; verifVersion,notificationVersion : boolean;
date_creation : string; date_creation : string;
Const Version='8.0'; // sert à la comparaison de la version publiée Const Version='8.1'; // sert à la comparaison de la version publiée
SousVersion=' '; // A B C ... en cas d'absence de sous version mettre un espace SousVersion=' '; // A B C ... en cas d'absence de sous version mettre un espace
function GetCurrentProcessEnvVar(const VariableName: string): string; function GetCurrentProcessEnvVar(const VariableName: string): string;
@@ -125,6 +125,18 @@ var description,s,s2,s3,Version_p,Url,LocalFile,nomfichier,nombre_tel,date_creat
taille : longint; taille : longint;
comm : array[1..10] of string; comm : array[1..10] of string;
function supprime_anti(s : string) : string;
var i : integer;
begin
// supprimer tous les \ dans la chaine
i:=0;
repeat
i:=posEx('\',s,i+1);
if i<>0 then delete(s,i,1);
until i=0;
result:=s;
end;
function extrait_champ(ss : string) : string; function extrait_champ(ss : string) : string;
var i,j : integer; var i,j : integer;
begin begin
@@ -133,9 +145,16 @@ var description,s,s2,s3,Version_p,Url,LocalFile,nomfichier,nombre_tel,date_creat
i:=pos(ss,s); i:=pos(ss,s);
if i<>0 then if i<>0 then
begin begin
i:=posEx('":',s,i+1);
//delete(s,1,i+1);i:=0;
i:=posEx('"',s,i+1); i:=posEx('"',s,i+1);
i:=posEx('"',s,i+1);
j:=posex('"',s,i+1); j:=i;
// ne pas tenir compte du \" qui correspond à un " effectif dans la chaîne
repeat
j:=posex('"',s,j+1);
until s[j-1]<>'\' ;
result:=copy(s,i+1,j-i-1); result:=copy(s,i+1,j-i-1);
end; end;
end; end;
@@ -150,7 +169,6 @@ var description,s,s2,s3,Version_p,Url,LocalFile,nomfichier,nombre_tel,date_creat
begin begin
i:=posEx(':',s,i+1); i:=posEx(':',s,i+1);
j:=posEx(',',s,i+1); j:=posEx(',',s,i+1);
//j:=posex('"',s,i+1);
result:=copy(s,i+1,j-i-1); result:=copy(s,i+1,j-i-1);
end; end;
end; end;
@@ -171,6 +189,7 @@ begin
while not(eof(fichier)) and (not(trouve_version) or not(trouve_zip)) do while not(eof(fichier)) and (not(trouve_version) or not(trouve_zip)) do
begin begin
readln(fichier,s); readln(fichier,s);
s:=utf8Decode(s);
//Affiche(s,clyellow); //Affiche(s,clyellow);
// adresse de téléchargement // adresse de téléchargement
@@ -206,7 +225,7 @@ begin
description:=extrait_champ('body'); description:=extrait_champ('body');
if description<>'' then if description<>'' then
begin begin
description:=utf8Decode(description); //description:=utf8Decode(description);
i:=1 ; j:=1; i:=1 ; j:=1;
// couper en chaînes // couper en chaînes
while j<>0 do while j<>0 do
@@ -226,7 +245,7 @@ begin
end; end;
end; end;
comm[i]:=description; comm[i]:=supprime_anti(description);
ncomm:=i; ncomm:=i;
end; end;
+4
View File
@@ -183,6 +183,10 @@ version 7.3 : Correction d'un bug sur le pilotage des aiguillages via CDM rail
version 8.0 : Gestion des voies chevauchantes (ponts) et des buttoirs dans le TCO. version 8.0 : Gestion des voies chevauchantes (ponts) et des buttoirs dans le TCO.
Création d'un bouton "action" dans les TCOs. Création d'un bouton "action" dans les TCOs.
Possibilité d'utiliser jusqu'à 10 TCOs. Possibilité d'utiliser jusqu'à 10 TCOs.
version 8.1 : Gestion d'un splitter sur l'affichage principal pour séparer l'écran à la demande.
Possibilité de sauvegarder les paramètres de la fenêtre principale.
Améliorations diverses.