diff --git a/ConfigGenerale.cfg b/ConfigGenerale.cfg index c362603..de0e9d4 100644 --- a/ConfigGenerale.cfg +++ b/ConfigGenerale.cfg @@ -1,11 +1,11 @@ -/ Fichier de configuration de signaux_complexes_GL version 7.1 +/ Fichier de configuration de signaux_complexes_GL version 8.0 AvecVerifIconesTCO=1 Algo_localisation=1 -Avec_roulage=1 +Avec_roulage=0 Debug=0 -Filtrage_det=0 +Filtrage_det=3 AntiTimeoutEthLenz=0 -Fonte=12 +Fonte=11 Protocole=1 Verif_AdrXpressNet=1 IpV4_PC=127.0.0.1:9999 @@ -23,13 +23,24 @@ Init_demUSBCOM=0 Init_demETH=0 Fenetre=0 nb_det_dist=3 -verif_version=0 +verif_version=1 notif_version=0 -TCO=0 +TCO=1 +NbreTCO=1 +Nom_fichier_TCO1=tco.cfg +Nom_fichier_TCO2=tco2.cfg +Nom_fichier_TCO3=tco3.cfg +Nom_fichier_TCO4=tco4.cfg +Nom_fichier_TCO5=tco5.cfg +Nom_fichier_TCO6=tco6.cfg +Nom_fichier_TCO7=tco7.cfg +Nom_fichier_TCO8=tco8.cfg +Nom_fichier_TCO9=tco9.cfg +Nom_fichier_TCO10=tco10.cfg MasqueBandeauTCO=0 CDM=0 Lay=RESEAU_GILY_SIGNAL_AJOUTE.LAY -NomModuleCDM=RESEAU_GILY_SIGNAL_AJOUTE.cdm +NomModuleCDM=reseau_gily_signal_ajoute_top.cdm Serveur_interface=1 retro=1 RazSignaux=0 @@ -38,12 +49,12 @@ Nb_cantons_Sig=3 Alg_Unisemaf=1 /------------ [section_aig] -1,P518,D100D,S3P,V30,I0,INIT(1,2) +1,P518,D100D,S3P,V30,I0,INIT(2,2) 2,P12S,D519,S100S,V0,I0,INIT(1,2) 3,P1S,D4P,S5D,V0,I0,INIT(2,2) 4,P3D,D6S,S514,V0,I0,INIT(2,2) 5,P515,D3S,S100S,V0,I0,INIT(1,2) -6,P516,D0,S4D,V0,I0,INIT(1,2) +6,P516,D0,S4D,V0,I0,INIT(2,2) 7,P527,D519,S520,V0,I0,INIT(2,2) 8,P527,D521,S103S,V0,I0,INIT(1,2) 9,P526,D103D,S515,V60,I0,INIT(1,2) @@ -91,23 +102,6 @@ A31,A34,0 0 /------------ [section_decodeurs] -Nom_dec_pers=Personnalisé 1 -NombreAdresses=4 -Nation=1 -1,2,0,1,2 -3,4,1,1,2 -5,9,2,1,2 -10,11,3,1,2 -Nom_dec_pers=grand -NombreAdresses=7 -Nation=1 -1,2,0,1,2 -3,4,1,0,0 -5,6,2,0,0 -7,8,3,0,0 -9,10,4,0,0 -11,12,5,0,0 -13,14,6,0,0 0 /------------ [section_sig] @@ -115,7 +109,7 @@ Nation=1 190,7,0,1,(523,526),0,FVC0,FRC0 204,9,0,1,(527,A7),1,FVC0,FRC0 218,7,0,1,(525,A17),0,FVC0,FRC0 -232,2,1,1,(516,A6),0,FVC0,FRC0,CFB(A6D) +232,2,1,1,(516,A6),0,FVC0,FRC0 274,3,0,1,(524,521),0,FVC0,FRC0 288,7,0,1,(522,A103),1,FVC0,FRC0 302,9,0,1,(526,A9),1,FVC0,FRC0 @@ -132,7 +126,7 @@ Nation=1 462,9,0,1,(513,A29),1,FVC0,FRC0 476,9,0,1,(538,A23),1,FVC0,FRC0 497,9,0,4,(531,A19),1,FVC0,FRC0 -520,9,1,1,(518,A1),0,FVC0,FRC0,(A1S,A3S,A5S),CFB(A1S,A3D,A4D,A6S) +520,9,1,1,(518,A1),1,FVC0,FRC0 600,7,0,0,(521,A8),1,FVC0,FRC0 0 /------------ diff --git a/Notice d'utilisation des signaux_complexes_GL_V7.2.pdf b/Notice d'utilisation des signaux_complexes_GL_V8.pdf similarity index 76% rename from Notice d'utilisation des signaux_complexes_GL_V7.2.pdf rename to Notice d'utilisation des signaux_complexes_GL_V8.pdf index f146099..ee5e59f 100644 Binary files a/Notice d'utilisation des signaux_complexes_GL_V7.2.pdf and b/Notice d'utilisation des signaux_complexes_GL_V8.pdf differ diff --git a/Signaux_complexes_GL.~dpr b/Signaux_complexes_GL.~dpr new file mode 100644 index 0000000..9c93819 --- /dev/null +++ b/Signaux_complexes_GL.~dpr @@ -0,0 +1,42 @@ +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. diff --git a/UnitCDF.pas b/UnitCDF.pas index a23f90c..d58c17e 100644 --- a/UnitCDF.pas +++ b/UnitCDF.pas @@ -169,24 +169,25 @@ begin Edit18.Text:=intToSTR(Feux[index].SR[18].sortie1); Edit19.Text:=intToSTR(Feux[index].SR[19].sortie1); - editNadresses.text:=intToSTR(feux[index].NA); + editNadresses.text:=intToSTR(feux[index].NA); end; procedure dessine_feu_CDF; -var i : integer; +var i,ancienEtat : integer; Vcanvas : Tcanvas; begin i:=0; //ImagePilote.Picture.Bitmap:=FormPilote.ImagePilote.picture.bitmap; EtatFeuPilote:=feux[i].EtatSignal; + AncienEtat:=feux[i].AncienEtat; dessineCDF:=true; // demande dessin CDF pour les clignotements Vcanvas:=FormCDF.ImageDigi.picture.bitmap.Canvas; - + case feux[i].aspect of // feux de signalisation 2 : dessine_feu2(Vcanvas,0,0,1,1,EtatFeupilote,1); - 3 : dessine_feu3(Vcanvas,0,0,1,1,EtatFeupilote,1); + 3 : dessine_feu3(Vcanvas,0,0,1,1,EtatFeupilote,AncienEtat,1); 4 : dessine_feu4(VCanvas,0,0,1,1,EtatFeupilote,1); 5 : dessine_feu5(VCanvas,0,0,1,1,EtatFeupilote,1); 7 : dessine_feu7(VCanvas,0,0,1,1,EtatFeupilote,1); diff --git a/UnitConfig.dfm b/UnitConfig.dfm index c39152b..092017c 100644 --- a/UnitConfig.dfm +++ b/UnitConfig.dfm @@ -1571,7 +1571,7 @@ object FormConfig: TFormConfig Top = 8 Width = 633 Height = 497 - ActivePage = TabSheetAig + ActivePage = TabSheetCDM Font.Charset = DEFAULT_CHARSET Font.Color = clBlack Font.Height = -11 @@ -1650,12 +1650,12 @@ object FormConfig: TFormConfig Left = 16 Top = 128 Width = 273 - Height = 193 + Height = 209 Caption = 'Au d'#233'marrage de Signaux_Complexes ' TabOrder = 1 object Label13: TLabel Left = 8 - Top = 144 + Top = 160 Width = 242 Height = 13 Caption = 'Nom du fichier LAY '#224' utiliser au d'#233'marrage de CDM' @@ -1678,7 +1678,7 @@ object FormConfig: TFormConfig end object CheckLanceCDM: TCheckBox Left = 8 - Top = 120 + Top = 128 Width = 241 Height = 25 Caption = 'Lancer et connecter CDM Rail au d'#233'marrage' @@ -1687,8 +1687,8 @@ object FormConfig: TFormConfig end object CheckAvecTCO: TCheckBox Left = 8 - Top = 80 - Width = 89 + Top = 88 + Width = 73 Height = 17 Hint = 'Affiche le TCO au d'#233'marrage' Caption = 'Avec TCO' @@ -1709,7 +1709,7 @@ object FormConfig: TFormConfig end object CheckBandeauTCO: TCheckBox Left = 8 - Top = 96 + Top = 104 Width = 129 Height = 17 Hint = 'Masque le bandeau de param'#233'trage du TCO au d'#233'marrage' @@ -1720,7 +1720,7 @@ object FormConfig: TFormConfig end object EditLAY: TEdit Left = 8 - Top = 160 + Top = 176 Width = 249 Height = 21 Hint = 'Nom du LAY avec .lay' @@ -1870,21 +1870,21 @@ object FormConfig: TFormConfig end object GroupBox8: TGroupBox Left = 16 - Top = 328 + Top = 344 Width = 273 - Height = 113 + Height = 97 Caption = 'Services CommIP CDM Rail' TabOrder = 4 object Label6: TLabel Left = 8 - Top = 26 + Top = 18 Width = 215 Height = 13 Caption = 'Liste des '#233'v'#232'nements demand'#233's '#224' CDM Rail:' end object CheckBoxServAig: TCheckBox Left = 8 - Top = 48 + Top = 40 Width = 113 Height = 17 Caption = 'Aiguillages' @@ -1892,7 +1892,7 @@ object FormConfig: TFormConfig end object CheckBoxServDet: TCheckBox Left = 8 - Top = 64 + Top = 56 Width = 89 Height = 17 Caption = 'D'#233'tecteurs' @@ -1900,7 +1900,7 @@ object FormConfig: TFormConfig end object CheckBoxServAct: TCheckBox Left = 8 - Top = 80 + Top = 72 Width = 81 Height = 17 Caption = 'Actionneurs' @@ -1908,7 +1908,7 @@ object FormConfig: TFormConfig end object CheckServPosTrains: TCheckBox Left = 120 - Top = 48 + Top = 40 Width = 145 Height = 17 Hint = @@ -1921,7 +1921,7 @@ object FormConfig: TFormConfig end object CheckBoxSrvSig: TCheckBox Left = 120 - Top = 64 + Top = 56 Width = 113 Height = 17 Caption = 'Signaux (non utilis'#233')' @@ -3182,7 +3182,7 @@ object FormConfig: TFormConfig Width = 129 Height = 21 Style = csDropDownList - ItemHeight = 0 + ItemHeight = 13 TabOrder = 1 OnChange = ComboBoxDecChange end @@ -3286,7 +3286,7 @@ object FormConfig: TFormConfig Width = 129 Height = 21 Style = csDropDownList - ItemHeight = 0 + ItemHeight = 13 TabOrder = 2 OnChange = ComboBoxAspChange end @@ -4487,7 +4487,7 @@ object FormConfig: TFormConfig Top = 24 Width = 65 Height = 17 - Hint = 'Supprime l'#39'actionneur cliqu'#233' (en jaune)' + Hint = 'Supprime l'#39'actionneur(s) s'#233'lectionn'#233'(s)' Caption = 'Supprime' ParentShowHint = False ShowHint = True @@ -4535,7 +4535,7 @@ object FormConfig: TFormConfig Top = 24 Width = 65 Height = 17 - Hint = 'Supprime l'#39'actionneur cliqu'#233' (en jaune)' + Hint = 'Supprime l'#39'actionneur(s) s'#233'lectionn'#233'(s)' Caption = 'Supprime' ParentShowHint = False ShowHint = True diff --git a/UnitConfig.pas b/UnitConfig.pas index db85a82..c6ed262 100644 --- a/UnitConfig.pas +++ b/UnitConfig.pas @@ -5,7 +5,8 @@ interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls , jpeg, ComCtrls ,StrUtils, Unitprinc, - MMSystem, Buttons , UnitPareFeu, verif_version, Menus, ClipBrd ; + MMSystem, Buttons , UnitPareFeu, verif_version, Menus, ClipBrd, + Grids ; type TFormConfig = class(TForm) @@ -582,6 +583,7 @@ INTER_CAR_ch='Inter_car'; Tempo_maxi_ch='Tempo_maxi'; Entete_ch='Entete'; TCO_ch='TCO'; +Nb_TCO_ch='NbreTCO'; MasqueBandeauTCO_ch='MasqueBandeauTCO'; CDM_ch='CDM'; Serveur_interface_ch='Serveur_interface'; @@ -602,6 +604,7 @@ NomModuleCDM_ch='NomModuleCDM'; Nba_ch='NombreAdresses'; nation_ch='Nation'; nom_dec_pers_ch='Nom_dec_pers'; +Nom_fich_TCO_ch='Nom_fichier_TCO'; // sections de config section_aig_ch='[section_aig]'; @@ -1720,6 +1723,16 @@ begin if AvecTCO then s:='1' else s:='0'; writeln(fichierN,TCO_ch+'=',s); + // nombre de TCO + writeln(fichierN,Nb_TCO_ch+'=',NbreTCO); + + for i:=1 to 10 do + begin + s:=NomFichierTCO[i]; + if s='' then s:='TCO'+intToSTR(i); + writeln(fichierN,Nom_fich_TCO_ch+intToSTR(i)+'=',s); + end; + if MasqueBandeauTCO then s:='1' else s:='0'; writeln(fichierN,MasqueBandeauTCO_ch+'=',s); @@ -1778,7 +1791,7 @@ begin writeln(fichierN,section_DecPers_ch); for i:=1 to NbreDecPers do begin - writeln(fichierN,nom_dec_pers_ch+'='+decodeur_pers[i].nom); + writeln(fichierN,nom_dec_pers_ch+'='+decodeur_pers[i].nom); n:=decodeur_pers[i].NbreAdr; s:=Nba_ch+'='+intToSTR(n); writeln(fichierN,s); @@ -1905,8 +1918,8 @@ var s,sa,SOrigine: string; if debug=1 then affiche(s,clLime); end; -procedure compile_signaux; -begin + procedure compile_signaux; + begin //Affiche('Définition des signaux',clyellow); i:=1;Nligne:=1; NbreFeux:=0; @@ -1924,16 +1937,16 @@ begin if decode_ligne_feux(s,i) then // décode la chaine et stocke en tableau feux begin inc(i); - end + end else - Affiche('Erreur 9 : signal '+s+' en doublon a été ignoré',clred); + Affiche('Erreur 9 : signal '+s+' en doublon a été ignoré',clred); end; end; - until (s='0') or eof(fichier); -end; + until (s='0') or eof(fichier); + end; -procedure compile_branches; -begin + procedure compile_branches; + begin // branches NDetecteurs:=0; Nligne:=1; @@ -1954,11 +1967,11 @@ begin until (s='0') or eof(fichier) or (i>=MaxBranches); if i>MaxBranches then Affiche('Nombre maximal de branches atteint',clRed); NbreBranches:=i-1; -end; + end; -procedure compile_actionneurs; -var i : integer; -begin + procedure compile_actionneurs; + var i : integer; + begin // raz des actionneurs for i:=1 to Max_actionneurs do begin @@ -2240,10 +2253,10 @@ begin end; until (s='0') or eof(fichier) ; dec(maxTablo_act); -end; + end; -procedure compile_aiguillages; -begin + procedure compile_aiguillages; + begin //Affiche('Définition des aiguillages',clyellow); maxaiguillage:=0; Nligne:=1; @@ -2489,13 +2502,13 @@ begin until (enregistrement='') or (itl>3); if itl>4 then begin Affiche('Erreur 400 ligne '+sOrigine,clred);exit;end; end; - until (sOrigine='0'); -end; + until (sOrigine='0'); + end; -// compile les décodeurs personnalisés -procedure compile_dec_pers; -var nv,j,k,l,adr : integer; -begin + // compile les décodeurs personnalisés + procedure compile_dec_pers; + var nv,j,k,l,adr : integer; + begin Nligne:=1; repeat // boucle de décodeurs nv:=0; // compteur nombre de variables @@ -2573,12 +2586,12 @@ begin end else Affiche('Section décodeurs - Nombre de descriptions du décodeur "'+decodeur_pers[NbreDecPers].nom+'" différents du nombre des adresses déclarées',clred); until (adr>j) or (s='0'); - until eof(fichier) or (s='0'); -end; + until eof(fichier) or (s='0'); + end; -procedure compile_dccpp; -var nv,i : integer; -begin + procedure compile_dccpp; + var nv,i : integer; + begin Nligne:=1; nv:=0; repeat @@ -2619,12 +2632,12 @@ begin until eof(fichier) or (s='') or (s='0') or (nLigne>MaxCdeDccpp); end; - until eof(fichier) or (s='0'); -end; + until eof(fichier) or (s='0'); + end; -procedure compile_trains; -var i,erreur : integer; -begin + procedure compile_trains; + var i,erreur : integer; + begin ntrains:=0; repeat lit_ligne; @@ -2688,11 +2701,11 @@ begin end; -// trie les signaux -procedure trier_sig; -var i,j : integer; + // trie les signaux + procedure trier_sig; + var i,j : integer; temp : TSignal; -begin + begin for i:=1 to NbreFeux do begin for j:=i+1 to NbreFeux do @@ -2705,14 +2718,13 @@ begin end; end; end; -end; + end; -procedure lit_flux; + procedure lit_flux; label ici1,ici2,ici3,ici4 ; var i : integer; -// début de la procédure lit_config -begin + begin // valeurs par défaut Nb_cantons_Sig:=3; nv:=0; it:=0; @@ -2736,6 +2748,17 @@ begin val(s,Verif_AdrXpressNet,erreur); end; + sa:=uppercase(Nom_fich_TCO_ch); + i:=pos(sa,s); + if i=1 then + begin + delete(s,1,length(sa)); + i:=extract_int(s); + j:=pos('=',s); + delete(s,1,j); + if (i>0) and (i<11) then NomfichierTCO[i]:=s; + end; + sa:=uppercase(Filtrage_det_ch)+'='; i:=pos(sa,s); if i=1 then @@ -2937,7 +2960,7 @@ begin AvecDemandeAiguillages:=s='1'; end; - // avec demande de connexion en COM USB au démarrage + // avec demande de connexion en COM USB au démarrage sa:=uppercase(Init_dem_interfaceUSBCOM_ch)+'='; i:=pos(sa,s); if i=1 then @@ -3065,6 +3088,18 @@ begin AvecTCO:=i=1; end; + sa:=uppercase(Nb_TCO_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + inc(nv); + delete(s,i,length(sa)); + val(s,i,erreur); + if (i<1) or (i>10) then i:=1; + NbreTCO:=i; + end; + + sa:=uppercase(MasqueBandeauTCO_ch)+'='; i:=pos(sa,s); if i=1 then @@ -3252,8 +3287,9 @@ begin until (eof(fichier)); -end; -// procédure lit_config + end; // fin de lit_flux + +// début de la procédure lit_config begin debugConfig:=false; trouve_NbDetDist:=false; @@ -3285,6 +3321,11 @@ begin trouve_Algo_Uni:=false; trouve_Nb_cantons_Sig:=false; AvecVerifIconesTCO:=1; + NomfichierTCO[1]:='tco.cfg'; // pour compatibilité anciennes versions + for i:=2 to 10 do + begin + NomfichierTCO[i]:='tco'+intToSTR(i)+'.cfg'; + end; //trouve_FVR:=false; @@ -3605,9 +3646,10 @@ begin end; end; +// affiche les champs du signal lc // LC=Adresse du signal procedure clicListeSignal(lc : integer); -var AncAdresse,index,adresse,erreur : integer; +var i,AncAdresse,index,adresse,erreur : integer; s : string; begin index:=index_Signal(lc)-1; @@ -3618,6 +3660,12 @@ begin exit; end; + with FormConfig.ListBoxSig do + begin + for i:=0 to Count-1 do Selected[i]:=false; + FormConfig.ListBoxSig.Selected[index]:=true; + end; + Feu_Sauve:=feux[index+1]; // sauvegarde AncLigneClicSig:=ligneclicSig; @@ -3640,6 +3688,7 @@ end; procedure TFormConfig.FormActivate(Sender: TObject); +var i : integer; begin if affevt then affiche('FormConfig activate',clLime); activ:=true; @@ -3741,6 +3790,10 @@ begin //l'onglet affiché est sélectionné à l'appel de la fiche dans l'unité UnitPrinc clicListe:=false; activ:=false; + + if clicproprietes then clicListeSignal(Adressefeuclic); + clicproprietes:=false; + end; // met à jour le décodeur courant dans le tableau de config @@ -6520,11 +6573,12 @@ begin end; procedure TFormConfig.ComboBoxAspChange(Sender: TObject); -var x,y,i,index,aspect,adresseFeu : integer; +var indexTCO,x,y,i,index,aspect,adresseFeu : integer; s : string; bm :tbitmap; begin if clicListe then exit; + indexTCO:=index_TCO(sender); if affevt then Affiche('Evt aspect',clOrange); i:=ComboBoxAsp.ItemIndex; //Affiche(IntToSTR(i),clyellow); @@ -6564,15 +6618,15 @@ begin Feux[index].Img.picture.Bitmap:=bm; dessine_feu_mx(Feux[index].Img.Canvas,0,0,1,1,feux[index].adresse,1); // dessine les feux du signal // et dans le TCO - if formTCO.Showing then + if formTCO[indexTCO].Showing then begin - for y:=1 to NbreCellY do - for x:=1 to NbreCellX do + for y:=1 to NbreCellY[indexTCO] do + for x:=1 to NbreCellX[indexTCO] do begin - if TCO[x,y].BImage=50 then + if TCO[1,x,y].BImage=Id_Signal then // &&& balayer tous les tco begin AdresseFeu:=feux[index].adresse; - if tco[x,y].Adresse=AdresseFeu then affiche_tco; + if tco[1,x,y].Adresse=AdresseFeu then affiche_tco(indexTCO); end; end; end; @@ -7565,7 +7619,7 @@ end; function verif_coherence : boolean; -var AncAdr,i,j,k,l,Indexaig,adr,adr2,extr,detect,condcarre,nc,index2,SuivAdr, +var AncAdr,i,j,k,l,Indexaig,adr,adr2,extr,detect,condcarre,nc,index2,SuivAdr,indexTCO, x,y,extr2,adr3,index3,det1Br,det2Br,det1index,det2index,adresse,Adresse2,dec,nc2 : integer; modAig,AncModel,model,km,SuivModel,model2: TEquipement; c : char; @@ -7857,7 +7911,7 @@ begin begin ok:=false; Affiche('Erreur 9.12: signal '+intToSTR(feux[j].adresse)+' : détecteurs '+intToSTR(i)+' et '+intToSTR(l)+' non contigüs ',clred); - end; + end; end; end; if ((km=aig) or (km=tjs) or (km=tjd) or (km=triple)) then @@ -8022,7 +8076,7 @@ begin if adr<>extr then Affiche('Erreur 10.24: Discordance de déclaration aiguillages '+intToSTR(adr)+'S: '+intToSTR(adr2)+'S différent de '+intToSTR(extr),clred); end; if c='P' then - begin + begin extr:=aiguillage[index2].APointe; if adr<>extr then Affiche('Erreur 10.25: Discordance de déclaration aiguillages '+intToSTR(adr)+'S: '+intToSTR(adr2)+'P différent de '+intToSTR(extr),clred); end; @@ -8073,7 +8127,7 @@ begin if c='D' then begin extr:=aiguillage[index2].ADroit; - if adr<>extr then Affiche('Erreur 10.33: Discordance de déclaration aiguillages '+intToSTR(adr)+'S: '+intToSTR(adr2)+'D différent de '+intToSTR(extr),clred); + if adr<>extr then Affiche('Erreur 10.33: Discordance de déclaration aiguillages '+intToSTR(adr)+'S: '+intToSTR(adr2)+'D différent de '+intToSTR(extr),clred); end; if c='S' then begin @@ -8262,23 +8316,34 @@ begin // 9. vérifier la cohérence TCO if avecTCO then begin - for y:=1 to NbreCellY do - for x:=1 to NbreCellX do + indexTCO:=1; + for y:=1 to NbreCellY[indexTCO] do + for x:=1 to NbreCellX[indexTCO] do begin - i:=TCO[x,y].BImage; - if i=50 then + i:=TCO[indexTCO,x,y].BImage; + adr:=TCO[indexTCO,x,y].adresse; + if i=Id_signal then begin - adr:=TCO[x,y].adresse; 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=2) or (i=3) or (i=4) or (i=5) or (i=12) or (i=13) or (i=14) or (i=15) or (i=21) or (i=22) then + if (i=21) or (i=22) or (i=23) or (i=25) then begin - adr:=TCO[x,y].adresse; - if index_aig(adr)=0 then + 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 + 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(x)+','+intToSTR(y)+'] mais absent de la configuration',clred); ok:=false; @@ -8286,7 +8351,7 @@ begin 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[x,y].adresse; + adr:=TCO[indexTCO,x,y].adresse; if adr<>0 then begin j:=1; @@ -8301,11 +8366,13 @@ begin end; end; end; - if not(verif_cellule(x,y,i)) then + if not(verif_cellule(indexTCO,x,y,i)) then begin Affiche('TCO: Erreur de proximité composants incompatibles: cellules TCO['+intToSTR(x)+','+intToSTR(y)+'] ',clred); ok:=false; end; + + end; end; diff --git a/UnitConfigCellTCO.dfm b/UnitConfigCellTCO.dfm index cc59482..4b69052 100644 --- a/UnitConfigCellTCO.dfm +++ b/UnitConfigCellTCO.dfm @@ -1,10 +1,10 @@ object FormConfCellTCO: TFormConfCellTCO - Left = 467 - Top = 112 + Left = 477 + Top = 168 BorderStyle = bsDialog Caption = 'FormConfCellTCO' - ClientHeight = 402 - ClientWidth = 251 + ClientHeight = 430 + ClientWidth = 282 Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText @@ -15,18 +15,19 @@ object FormConfCellTCO: TFormConfCellTCO OldCreateOrder = False OnActivate = FormActivate OnCreate = FormCreate + OnHide = FormHide OnKeyPress = FormKeyPress PixelsPerInch = 96 TextHeight = 13 object GroupBox1: TGroupBox Left = 8 - Top = 264 - Width = 233 + Top = 304 + Width = 265 Height = 97 Caption = 'Texte' Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText - Font.Height = -13 + Font.Height = -15 Font.Name = 'MS Sans Serif' Font.Style = [] ParentFont = False @@ -34,12 +35,12 @@ object FormConfCellTCO: TFormConfCellTCO object Label1: TLabel Left = 8 Top = 41 - Width = 79 - Height = 16 + Width = 93 + Height = 20 Caption = 'Position du texte:' Font.Charset = ANSI_CHARSET Font.Color = clWindowText - Font.Height = -13 + Font.Height = -15 Font.Name = 'Arial Narrow' Font.Style = [] ParentFont = False @@ -57,10 +58,11 @@ object FormConfCellTCO: TFormConfCellTCO 'Sans' 'Centrale' 'Haut' - 'Bas') + 'Bas' + 'R'#233'parti') end object ButtonFonte: TButton - Left = 112 + Left = 160 Top = 56 Width = 81 Height = 25 @@ -71,7 +73,7 @@ object FormConfCellTCO: TFormConfCellTCO object EditTexteCCTCO: TEdit Left = 8 Top = 16 - Width = 209 + Width = 241 Height = 24 TabOrder = 2 OnChange = EditTexteCCTCOChange @@ -80,12 +82,12 @@ object FormConfCellTCO: TFormConfCellTCO object GroupBox2: TGroupBox Left = 8 Top = 8 - Width = 233 - Height = 257 + Width = 265 + Height = 297 Caption = 'El'#233'ment' Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText - Font.Height = -13 + Font.Height = -15 Font.Name = 'MS Sans Serif' Font.Style = [] ParentFont = False @@ -93,39 +95,39 @@ object FormConfCellTCO: TFormConfCellTCO object Label15: TLabel Left = 8 Top = 22 - Width = 93 - Height = 16 + Width = 111 + Height = 20 Caption = 'Image de l'#39#233'l'#233'ment: ' Font.Charset = ANSI_CHARSET Font.Color = clWindowText - Font.Height = -13 + Font.Height = -15 Font.Name = 'Arial Narrow' Font.Style = [] ParentFont = False end object Label2: TLabel - Left = 168 + Left = 192 Top = 14 - Width = 48 - Height = 16 + Width = 53 + Height = 20 Caption = 'Adresse : ' Font.Charset = ANSI_CHARSET Font.Color = clWindowText - Font.Height = -13 + Font.Height = -15 Font.Name = 'Arial Narrow' Font.Style = [] ParentFont = False end object ImagePaletteCC: TImage - Left = 112 + Left = 128 Top = 24 - Width = 49 - Height = 49 + Width = 41 + Height = 41 OnMouseDown = ImagePaletteCCMouseDown end object EditTypeImage: TEdit - Left = 32 - Top = 40 + Left = 40 + Top = 48 Width = 33 Height = 21 Hint = 'Num'#233'ro d'#39'image de l'#39#233'l'#233'ment' @@ -140,15 +142,15 @@ object FormConfCellTCO: TFormConfCellTCO TabOrder = 0 OnChange = EditTypeImageChange end - object GroupBox3: TGroupBox + object GroupBoxOrientation: TGroupBox Left = 8 - Top = 112 - Width = 209 + Top = 152 + Width = 249 Height = 73 Caption = 'Orientation du signal' Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText - Font.Height = -11 + Font.Height = -12 Font.Name = 'MS Sans Serif' Font.Style = [] ParentFont = False @@ -161,7 +163,7 @@ object FormConfCellTCO: TFormConfCellTCO Caption = 'Horizontal gauche' Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText - Font.Height = -11 + Font.Height = -12 Font.Name = 'MS Sans Serif' Font.Style = [] ParentFont = False @@ -176,7 +178,7 @@ object FormConfCellTCO: TFormConfCellTCO Caption = 'Vertical' Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText - Font.Height = -11 + Font.Height = -12 Font.Name = 'MS Sans Serif' Font.Style = [] ParentFont = False @@ -191,7 +193,7 @@ object FormConfCellTCO: TFormConfCellTCO Caption = 'Horizontal droit' Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText - Font.Height = -11 + Font.Height = -12 Font.Name = 'MS Sans Serif' Font.Style = [] ParentFont = False @@ -199,15 +201,15 @@ object FormConfCellTCO: TFormConfCellTCO OnClick = RadioButtonHDClick end end - object GroupBox4: TGroupBox + object GroupBoxImplantation: TGroupBox Left = 8 - Top = 192 - Width = 209 + Top = 232 + Width = 249 Height = 57 Caption = 'Implantation du signal' Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText - Font.Height = -11 + Font.Height = -12 Font.Name = 'MS Sans Serif' Font.Style = [] ParentFont = False @@ -220,7 +222,7 @@ object FormConfCellTCO: TFormConfCellTCO Caption = #224' gauche de la voie' Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText - Font.Height = -11 + Font.Height = -12 Font.Name = 'MS Sans Serif' Font.Style = [] ParentFont = False @@ -235,7 +237,7 @@ object FormConfCellTCO: TFormConfCellTCO Caption = #224' droite de la voie' Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText - Font.Height = -11 + Font.Height = -12 Font.Name = 'MS Sans Serif' Font.Style = [] ParentFont = False @@ -244,7 +246,7 @@ object FormConfCellTCO: TFormConfCellTCO end end object EditAdrElement: TEdit - Left = 176 + Left = 200 Top = 40 Width = 33 Height = 24 @@ -255,9 +257,9 @@ object FormConfCellTCO: TFormConfCellTCO OnChange = EditAdrElementChange end object ButtonFond: TButton - Left = 16 - Top = 72 - Width = 97 + Left = 8 + Top = 104 + Width = 89 Height = 33 Caption = 'Couleur de fond de la cellule' Font.Charset = ANSI_CHARSET @@ -270,10 +272,76 @@ object FormConfCellTCO: TFormConfCellTCO WordWrap = True OnClick = ButtonFondClick end + object RadioGroupSel: TRadioGroup + Left = 104 + Top = 88 + Width = 153 + Height = 57 + Caption = 'S'#233'lection clic ic'#244'ne ci-dessus' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'MS Sans Serif' + Font.Style = [] + Items.Strings = ( + 'Epaisseurs de voie' + 'Pont') + ParentFont = False + TabOrder = 5 + end + object GroupBoxAction: TGroupBox + Left = 56 + Top = 176 + Width = 249 + Height = 105 + Caption = 'Action' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ParentFont = False + TabOrder = 6 + object RadioButtonAffTCO: TRadioButton + Left = 8 + Top = 24 + Width = 97 + Height = 17 + Caption = 'Afficher TCO n'#176 + TabOrder = 0 + OnClick = RadioButtonAffTCOClick + end + object EditNumTCO: TEdit + Left = 104 + Top = 20 + Width = 33 + Height = 21 + TabOrder = 1 + OnChange = EditNumTCOChange + end + object RadioButtonSC: TRadioButton + Left = 8 + Top = 40 + Width = 169 + Height = 17 + Caption = 'Afficher Signaux complexes' + TabOrder = 2 + OnClick = RadioButtonSCClick + end + object RadioButtonCDM: TRadioButton + Left = 8 + Top = 56 + Width = 113 + Height = 17 + Caption = 'Afficher CDM rail' + TabOrder = 3 + OnClick = RadioButtonCDMClick + end + end end object CheckPinv: TCheckBox Left = 8 - Top = 368 + Top = 408 Width = 129 Height = 17 Hint = 'Cocher si l'#39'aiguillage est repr'#233'sent'#233' invers'#233 @@ -290,8 +358,8 @@ object FormConfCellTCO: TFormConfCellTCO OnClick = CheckPinvClick end object BitBtnOk: TBitBtn - Left = 152 - Top = 368 + Left = 168 + Top = 400 Width = 75 Height = 25 TabOrder = 3 diff --git a/UnitConfigCellTCO.pas b/UnitConfigCellTCO.pas index 7e59307..7cfe363 100644 --- a/UnitConfigCellTCO.pas +++ b/UnitConfigCellTCO.pas @@ -4,7 +4,7 @@ interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, - Dialogs, StdCtrls, UnitTCO, ExtCtrls, + Dialogs, StdCtrls, ExtCtrls, Buttons; type @@ -19,17 +19,23 @@ type EditTypeImage: TEdit; CheckPinv: TCheckBox; Label2: TLabel; - GroupBox3: TGroupBox; + GroupBoxOrientation: TGroupBox; RadioButtonHG: TRadioButton; RadioButtonV: TRadioButton; RadioButtonHD: TRadioButton; - GroupBox4: TGroupBox; + GroupBoxImplantation: TGroupBox; RadioButtonG: TRadioButton; RadioButtonD: TRadioButton; EditAdrElement: TEdit; ButtonFond: TButton; BitBtnOk: TBitBtn; ImagePaletteCC: TImage; + RadioGroupSel: TRadioGroup; + GroupBoxAction: TGroupBox; + RadioButtonAffTCO: TRadioButton; + EditNumTCO: TEdit; + RadioButtonSC: TRadioButton; + RadioButtonCDM: TRadioButton; procedure EditAdrElementChange(Sender: TObject); procedure EditTexteCCTCOChange(Sender: TObject); procedure ButtonFonteClick(Sender: TObject); @@ -48,6 +54,11 @@ type procedure EditTypeImageChange(Sender: TObject); procedure ImagePaletteCCMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + procedure RadioButtonAffTCOClick(Sender: TObject); + procedure EditNumTCOChange(Sender: TObject); + procedure FormHide(Sender: TObject); + procedure RadioButtonSCClick(Sender: TObject); + procedure RadioButtonCDMClick(Sender: TObject); private { Déclarations privées } public @@ -56,49 +67,129 @@ type var FormConfCellTCO: TFormConfCellTCO; - actualize : boolean; + actualize,ConfCellTCO : boolean; IconeX,IconeY : integer; -procedure actualise; +procedure actualise(indexTCO : integer); implementation -uses UnitPrinc,UnitAnalyseSegCDM, - UnitConfigTCO; +uses UnitPrinc,UnitAnalyseSegCDM,UnitConfigTCO,UnitTCO; {$R *.dfm} // actualise le contenu de la fenetre et de la zone tco -procedure actualise; -var Bimage,oriente,piedFeu : integer; +procedure actualise(indexTCO : integer); +var Bimage,oriente,piedFeu,xclic,yclic : integer; s : string; ip : Timage; Bm : Tbitmap; r : trect; begin + if (indexTCO=0) or (formConfCellTCO=nil) then exit; + if affevt then affiche('FormConfigCellTCO actualise',clyellow); + + xclic:=XclicCell[indexTCO]; + yclic:=YclicCell[indexTCO]; + Bm:=formConfCellTCO.imagepalettecc.Picture.Bitmap; - Bimage:=tco[XClicCell,YClicCell].Bimage; - - if formConfCellTCOAff then + //with FormConfCellTCO.ImagePaletteCC.Picture.Bitmap do + with FormConfCellTCO.ImagePaletteCC do + begin + // efface l'icone + Picture.Bitmap.width:=iconeX; + Picture.bitmap.height:=iconeY; + // effacer l'icone + r:=Rect(0,0,iconeX,iconeY); + //with FormConfCellTCO.ImagePaletteCC.canvas do + with Picture.Bitmap.Canvas do + // with Picture.Bitmap.Canvas do + begin + Pen.Mode:=pmCopy; + Pen.Width:=1; + Pen.color:=tco[indexTCO,XclicCell[indexTCO],YclicCell[indexTCO]].CouleurFond; + Brush.Color:=tco[indexTCO,XclicCell[indexTCO],YclicCell[indexTCO]].couleurFond; + Brush.style:=bsSolid; + fillRect(r); + end; + end; + FormConfCellTCO.ImagePaletteCC.Repaint; + Bimage:=tco[indexTCO,XClicCell[indexTCO],YClicCell[indexTCO]].Bimage; + + if Bimage=Id_Action then + begin + with formConfCellTCO do + begin + GroupBoxOrientation.visible:=false; + GroupBoxImplantation.visible:=false; + with GroupBoxAction do + begin + visible:=true; + top:=152; + left:=8; + width:=249; + RadioButtonAffTCO.Checked:=tco[indexTCO,Xclic,Yclic].PiedFeu=1; + RadioButtonSC.Checked:=tco[indexTCO,Xclic,Yclic].PiedFeu=2; + RadioButtonCDM.Checked:=tco[indexTCO,Xclic,Yclic].PiedFeu=3; + editNumTCO.Text:=intToSTR(tco[indexTCO,Xclic,Yclic].FeuOriente); + end; + end; + end + else + begin + with formConfCellTCO do + begin + with GroupBoxOrientation do + begin + visible:=true; + left:=8; + top:=152; + end; + GroupBoxImplantation.visible:=true; + GroupBoxAction.visible:=false; + end; + end; + + + if (Bimage=1) or (Bimage=10) or (Bimage=11) or (Bimage=20) then + begin + if tco[indexTCO,XclicCell[indexTCO],YclicCell[indexTCO]].buttoir<>0 then + begin + formConfCellTCO.EditAdrElement.enabled:=false; + formTCO[indexTCO].EditAdrElement.enabled:=false; + tco[indexTCO,XclicCell[indexTCO],YclicCell[indexTCO]].Adresse:=0; + end + else + begin + formConfCellTCO.EditAdrElement.enabled:=true; + formTCO[indexTCO].EditAdrElement.enabled:=true; + end; + end + else + begin + formConfCellTCO.EditAdrElement.enabled:=true; + formTCO[indexTCO].EditAdrElement.enabled:=true; + end; + + if ConfCellTCO then // si la form confcelltco est affichée begin // si aiguillage, mettre à jour l'option de pilotage inverse - 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=24) then + 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=24) then begin - // aiguillage inversé with FormConfCellTCO.CheckPinv do begin enabled:=true; - checked:=TCO[XClicCell,YClicCell].inverse; + checked:=TCO[indexTCO,XclicCell[indexTCO],YclicCell[indexTCO]].inverse; end; - FormTCO.CheckPinv.checked:=TCO[XClicCell,YClicCell].inverse; - FormTCO.CheckPinv.enabled:=true ; + FormTCO[indexTCO].CheckPinv.checked:=TCO[indexTCO,XclicCell[indexTCO],YclicCell[indexTCO]].inverse; + FormTCO[indexTCO].CheckPinv.enabled:=true ; end else begin - FormTCO.CheckPinv.enabled:=false; + FormTCO[indexTCO].CheckPinv.enabled:=false; FormConfCellTCO.checkPinv.enabled:=false; end; end; @@ -106,8 +197,8 @@ begin // si voie ou rien ou signal ou quai if (Bimage=1) or (Bimage=0) or (Bimage=Id_signal) or (Bimage=51) then begin - s:=Tco[XClicCell,YClicCell].Texte; - with formTCO do + s:=Tco[indexTCO,XclicCell[indexTCO],YclicCell[indexTCO]].Texte; + with formTCO[indexTCO] do begin EditTexte.Text:=s; EditTexte.Visible:=true; @@ -116,29 +207,28 @@ begin end else begin - formTCO.EditTexte.Visible:=false; - formTCO.comboRepr.Enabled:=false; + formTCO[indexTCO].EditTexte.Visible:=false; + formTCO[indexTCO].comboRepr.Enabled:=false; end; - s:=IntToSTR(XclicCell)+','+IntToSTR(YclicCell); - FormTCO.LabelCoord.caption:=s; - FormTCO.GroupBox1.Caption:='Configuration cellule '+s; - XclicCellInserer:=XClicCell; - YclicCellInserer:=YClicCell; - FormTCO.EditAdrElement.Text:=IntToSTR(tco[XClicCellInserer,YClicCellInserer].Adresse); - FormTCO.EdittypeImage.Text:=IntToSTR(BImage); - FormTCO.ComboRepr.ItemIndex:=tco[XClicCell,yClicCell].repr; - FormTCO.ShapeCoulFond.Brush.Color:=tco[XClicCell,yClicCell].CouleurFond; + s:=IntToSTR(Xclic)+','+intToSTR(yClic); + FormTCO[indexTCO].GroupBox1.Caption:='Configuration cellule '+s; + XclicCellInserer:=XclicCell[indexTCO]; + YclicCellInserer:=YclicCell[indexTCO]; + FormTCO[indexTCO].EditAdrElement.Text:=IntToSTR(tco[indexTCO,XclicCellInserer,YclicCellInserer].Adresse); + FormTCO[indexTCO].EdittypeImage.Text:=IntToSTR(BImage); + FormTCO[indexTCO].ComboRepr.ItemIndex:=tco[indexTCO,XclicCell[indexTCO],YclicCell[indexTCO]].repr; + FormTCO[indexTCO].ShapeCoulFond.Brush.Color:=tco[indexTCO,XclicCell[indexTCO],YclicCell[indexTCO]].CouleurFond; - s:='El='+intToSTR(tco[XClicCell,YClicCell].BImage); - if tco[XClicCell,YClicCell].adresse<>0 then s:=s+' Adr='+intToSTR(tco[XClicCell,YClicCell].adresse); + s:='El='+intToSTR(tco[indexTCO,XclicCell[indexTCO],YclicCell[indexTCO]].BImage); + if tco[indexTCO,XclicCell[indexTCO],YclicCell[indexTCO]].adresse<>0 then s:=s+' Adr='+intToSTR(tco[indexTCO,XclicCell[indexTCO],YclicCell[indexTCO]].adresse); //hint:=s; - if not(formConfCellTCOAff) then exit; + if not(ConfCellTCO) then exit; actualize:=true; // évite les évènements parasites - FormConfCellTCO.caption:='Propriétés de la cellule '+IntToSTR(XClicCell)+','+intToSTR(YClicCell); - Bimage:=TCO[XClicCell,YClicCell].Bimage; + FormConfCellTCO.caption:='Propriétés de la cellule '+IntToSTR(XclicCell[indexTCO])+','+intToSTR(YclicCell[indexTCO])+' TCO '+intToSTR(IndexTCO); + Bimage:=tco[indexTCO,XclicCell[indexTCO],YclicCell[indexTCO]].Bimage; formConfCellTCO.EditTypeImage.Text:=intToSTR(Bimage); // si signal @@ -146,7 +236,7 @@ begin With formConfCellTCO.ImagePaletteCC do begin //Height:=FormTCO.ImagePalette1.Picture.Height; - //ziziWidth:=FormTCO.ImagePalette1.Picture.Width; + //Width:=FormTCO.ImagePalette1.Picture.Width; Transparent:=false; end; @@ -165,21 +255,6 @@ begin // mettre l'image de la cellule cliquée dans l'icone de la fenetre de config cellule if Bimage=0 then begin - with FormConfCellTCO.ImagePaletteCC do - begin - r:=Rect(0,0,width,height); - with canvas do - begin - // effacer l'icone - Pen.Mode:=pmCopy; - Pen.Width:=1; - Pen.color:=tco[XClicCell,YClicCell].CouleurFond; - Brush.Color:=tco[XClicCell,YClicCell].CouleurFond; - Brush.style:=bsSolid; - fillRect(r); - end; - end; - with formConfCellTCO do begin RadioButtonV.Enabled:=false; @@ -194,7 +269,7 @@ begin // Bimage non nulle begin - ip:=formTCO.findComponent('ImagePalette'+intToSTR(Bimage)) as Timage; + ip:=formTCO[indexTCO].findComponent('ImagePalette'+intToSTR(Bimage)) as Timage; if ip=nil then exit; // affiche l'icone cliquée dans la fenetre ----------------------------------------------- @@ -205,14 +280,12 @@ begin Height:=iconeY; end; - ip:=formTCO.findComponent('ImagePalette'+intToSTR(Bimage)) as Timage; // image source + StretchBlt(FormConfCellTCO.ImagePaletteCC.canvas.Handle,0,0,iconeX,iconeY, // destination + formTCO[indexTCO].ImageTCO.Canvas.Handle,(XclicCell[indexTCO]-1)*largeurCell[indexTCO] ,(YclicCell[indexTCO]-1)*Hauteurcell[indexTCO],largeurCell[indexTCO],Hauteurcell[indexTCO],srccopy); // source } - // destination masque avec mise à l'échelle - StretchBlt(FormConfCellTCO.ImagePaletteCC.canvas.Handle,0,0,iconeX,iconeY, - ip.Canvas.Handle,0,0,ip.Width,ip.Height,srccopy); FormConfCellTCO.ImagePaletteCC.repaint; // obligatoire sinon il ne s'affiche pas //----------------------------------------------------------------------------------------- - + if Bimage=Id_signal then begin // signal With formConfCellTCO.ImagePaletteCC do @@ -231,7 +304,7 @@ begin RadioButtonHD.Enabled:=true; RadioButtonG.Enabled:=true; RadioButtonD.Enabled:=true; - oriente:=tco[XClicCell,YClicCell].Feuoriente; + oriente:=tco[indexTCO,XclicCell[indexTCO],YclicCell[indexTCO]].Feuoriente; if oriente=1 then begin RadioButtonV.checked:=true; @@ -240,9 +313,9 @@ begin end; if oriente=2 then begin - RadioButtonV.checked:=false; - RadioButtonHG.checked:=true; - RadioButtonHD.checked:=false; + RadioButtonV.checked:=false; + RadioButtonHG.checked:=true; + RadioButtonHD.checked:=false; end; if oriente=3 then begin @@ -251,7 +324,7 @@ begin RadioButtonHD.checked:=true; end; - PiedFeu:=tco[XClicCell,YClicCell].PiedFeu; + PiedFeu:=tco[indexTCO,XclicCell[indexTCO],YclicCell[indexTCO]].PiedFeu; if PiedFeu=1 then begin RadioButtonG.checked:=true; @@ -274,66 +347,94 @@ begin with formConfCellTCO do begin - EditTexteCCTCO.Text:=Tco[XClicCell,YClicCell].Texte; - EditAdrElement.Text:=IntToSTR(tco[XClicCellInserer,YClicCellInserer].Adresse); - ComboRepr.ItemIndex:=tco[XClicCell,yClicCell].repr; + EditTexteCCTCO.Text:=tco[indexTCO,XclicCell[indexTCO],YclicCell[indexTCO]].Texte; + EditAdrElement.Text:=IntToSTR(tco[indexTCO,XclicCellInserer,YclicCellInserer].Adresse); + ComboRepr.ItemIndex:=tco[indexTCO,XclicCell[indexTCO],YclicCell[indexTCO]].repr; end; + + // Epaisseur ou pont + FormConfCellTCO.RadioGroupSel.visible:=false; + if (Bimage=21) or (Bimage=22) or (Bimage=23) or (Bimage=25) then + begin + FormConfCellTCO.RadioGroupSel.visible:=true; + FormConfCellTCO.RadioGroupSel.Items[1]:='Pont'; + end ; + + // voie pouvant avoir un buttoir + if (Bimage=1) or (Bimage=10) or (Bimage=11) or (Bimage=20) then + begin + FormConfCellTCO.RadioGroupSel.visible:=true; + FormConfCellTCO.RadioGroupSel.Items[1]:='Buttoir'; + end; + actualize:=false; end; procedure TFormConfCellTCO.EditAdrElementChange(Sender: TObject); -var Adr,erreur,index : integer; +var Adr,erreur,index,Bimage : integer; begin - if clicTCO or not(formConfCellTCOAff) or actualize then exit; + if clicTCO or not(ConfCellTCO) or actualize then exit; if affevt then Affiche('TFormConfCellTCO.EditAdrElementChange',clyellow); + clicTCO:=true; + Bimage:=tco[indexTCOcourant,XclicCell[indexTCOcourant],YclicCell[indexTCOcourant]].BImage; + if (Bimage=1) or (Bimage=10) or (Bimage=11) or (Bimage=20) then + begin + if tco[indexTCOcourant,XclicCell[indexTCOcourant],YclicCell[indexTCOcourant]].buttoir<>0 then + begin + EditAdrElement.Text:=''; + clicTCO:=false; + exit; + end; + end; Val(EditAdrElement.Text,Adr,erreur); if (erreur<>0) or (Adr<0) or (Adr>2048) then Adr:=0; - if Adr=0 then tco[XClicCell,YClicCell].repr:=2; + if Adr=0 then tco[indexTCOcourant,XclicCell[indexTCOcourant],YclicCell[indexTCOcourant]].repr:=2; - tco[XClicCell,YClicCell].Adresse:=Adr; - formTCO.EditAdrElement.Text:=intToSTR(adr); + tco[indexTCOcourant,XclicCell[indexTCOcourant],YclicCell[indexTCOcourant]].Adresse:=Adr; + formTCO[indexTCOcourant].EditAdrElement.Text:=intToSTR(adr); + clicTCO:=false; - if tco[XClicCell,YClicCell].BImage=Id_signal then + if tco[indexTCOcourant,XclicCell[indexTCOcourant],YclicCell[indexTCOcourant]].BImage=Id_signal then begin index:=Index_Signal(adr); if index=0 then exit else begin //Affiche('Feu '+intToSTR(Adr),clyellow); - affiche_tco; + affiche_tco(indexTCOcourant); end; end; - if not(selectionaffichee) then efface_entoure; - Affiche_cellule(XclicCell,YclicCell); - if not(selectionaffichee) then _entoure_cell_clic; + if not(selectionaffichee[indexTCOcourant]) then efface_entoure(indexTCOcourant); + Affiche_cellule(indexTCOcourant,XclicCell[indexTCOcourant],YclicCell[indexTCOcourant]); + if not(selectionaffichee[indexTCOcourant]) then _entoure_cell_clic(indexTCOcourant); end; procedure TFormConfCellTCO.EditTexteCCTCOChange(Sender: TObject); begin - if clicTCO or not(formConfCellTCOAff) or actualize then exit; - PCanvasTCO.Brush.Color:=clfond; + if clicTCO or not(ConfCellTCO) or actualize then exit; + PCanvasTCO[indexTCOCourant].Brush.Color:=clfond; - if Tco[XClicCell,YClicCell].texte='' then + if tco[indexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]].texte='' then begin - Tco[XClicCell,YClicCell].CoulFonte:=clTexte; - Tco[XClicCell,YClicCell].TailleFonte:=8; + tco[indexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]].CoulFonte:=clTexte; + tco[indexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]].TailleFonte:=8; end; - Tco[XClicCell,YClicCell].Texte:=EditTexteCCTCO.Text; + tco[indexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]].Texte:=EditTexteCCTCO.Text; if not(clicTCO) then TCO_modifie:=true; - if not(selectionaffichee) then efface_entoure; - affiche_texte(XClicCell,YClicCell); - formTCO.EditTexte.Text:=EditTexteCCTCO.text; - if not(selectionaffichee) then _entoure_cell_clic; + if not(selectionaffichee[indexTCOcourant]) then efface_entoure(indexTCOCourant); + affiche_texte(indexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]); + formTCO[indexTCOCourant].EditTexte.Text:=EditTexteCCTCO.text; + if not(selectionaffichee[indexTCOcourant]) then _entoure_cell_clic(indexTCOCourant); end; procedure TFormConfCellTCO.ButtonFonteClick(Sender: TObject); begin - change_fonte; + change_fonte(indexTCOcourant); end; procedure TFormConfCellTCO.FormCreate(Sender: TObject); @@ -341,11 +442,12 @@ begin // fenetre toujours dessus if affevt then Affiche('FormConfCellTCO create',clyellow); actualize:=false; - formConfCellTCOAff:=true; SetWindowPos(Handle,HWND_TOPMOST,0,0,0,0,SWP_NoMove or SWP_NoSize); iconeX:=50; // taille de l'icone iconeY:=50; - + ImagePaletteCC.Width:=iconeX; + ImagePaletteCC.Height:=iconeY; + RadioGroupSel.itemIndex:=0; // dessine les composants - non utilisé { i:=1; @@ -382,64 +484,66 @@ end; procedure TFormConfCellTCO.ComboReprChange(Sender: TObject); begin - if clicTCO or not(formConfCellTCOAff) or actualize then exit; - tco[XClicCell,YClicCell].Repr:=comborepr.ItemIndex; - efface_entoure;SelectionAffichee:=false; - FormTCO.ComboRepr.ItemIndex:=ComboRepr.ItemIndex; - //affiche_cellule(XClicCell,yClicCell); - affiche_tco; + if clicTCO or not(ConfCellTCO) or actualize then exit; + tco[indexTCOcourant,XclicCell[indexTCOcourant],YclicCell[indexTCOcourant]].Repr:=comborepr.ItemIndex; + efface_entoure(indexTCOcourant); + SelectionAffichee[indexTCOcourant]:=false; + FormTCO[indexTCOcourant].ComboRepr.ItemIndex:=ComboRepr.ItemIndex; + //affiche_cellule(XclicCell[indexTCO],YclicCell[indexTCO]); + affiche_tco(indexTCOcourant); end; procedure TFormConfCellTCO.CheckPinvClick(Sender: TObject); var Bimage : integer; begin - if (xClicCell=0) or (xClicCell>NbreCellX) or (yClicCell=0) or (yClicCell>NbreCelly) then exit; - Bimage:=Tco[xClicCell,yClicCell].Bimage; + if (XclicCell[indexTCOcourant]=0) or (XclicCell[indexTCOcourant]>NbreCellX[indexTCOcourant]) or (YclicCell[indexTCOcourant]=0) or (YclicCell[indexTCOcourant]>NbreCelly[indexTCOcourant]) then exit; + Bimage:=tco[indexTCOcourant,XclicCell[indexTCOcourant],YclicCell[indexTCOcourant]].Bimage; 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=24) then begin - TCO[xClicCell,yClicCell].inverse:=CheckPinv.checked; - formTCO.CheckPinv.checked:=CheckPinv.checked; - TCO_modifie:=true; + tco[indexTCOcourant,XclicCell[indexTCOcourant],YclicCell[indexTCOcourant]].inverse:=CheckPinv.checked; + formTCO[indexTCOcourant].CheckPinv.checked:=CheckPinv.checked; + TCO_modifie:=true; end; end; procedure TFormConfCellTCO.RadioButtonVClick(Sender: TObject); begin - Vertical; + Vertical(indexTCOcourant); end; procedure TFormConfCellTCO.RadioButtonHGClick(Sender: TObject); begin - tourne90G; + tourne90G(indexTCOcourant); end; procedure TFormConfCellTCO.RadioButtonHDClick(Sender: TObject); begin - tourne90D; + tourne90D(indexTCOcourant); end; procedure TFormConfCellTCO.RadioButtonGClick(Sender: TObject); begin - signalG; + signalG(indexTCOcourant); end; procedure TFormConfCellTCO.RadioButtonDClick(Sender: TObject); begin - signalD; + signalD(indexTCOcourant); end; procedure TFormConfCellTCO.ButtonFondClick(Sender: TObject); begin - change_couleur_fond; + change_couleur_fond(indexTCOcourant); end; procedure TFormConfCellTCO.FormActivate(Sender: TObject); begin if affevt then Affiche('FormConfCellTCO activate',clyellow); - if selectionaffichee then ButtonFond.caption:='Couleur de fond de la sélection' + if selectionaffichee[indexTCOcourant] then ButtonFond.caption:='Couleur de fond de la sélection' else ButtonFond.caption:='Couleur de fond de la cellule'; + ConfCellTCO:=true; end; procedure TFormConfCellTCO.FormKeyPress(Sender: TObject; var Key: Char); @@ -449,10 +553,16 @@ end; procedure TFormConfCellTCO.BitBtnOkClick(Sender: TObject); begin - close + if affevt then Affiche('BitBtnOk',clyellow); + ConfCellTCO:=false; + close; end; -// extraire les points de connexion de l'icone (de 0 à 7) +// extraire les 4 points de connexion de l'icone (de 0 à 7) +// il y a au maximum 4 points de connexion de la voie sur une TJD/S ou un croisement. +// Un aiguillage a 3 points de connexion +// un élément de voie a 2 points de connexion. +// Si un élément de connexion n'existe pas, il a la valeur -1. procedure extrait_connect(numero : integer;var connect1,connect2,connect3,connect4 : integer); var i,j : integer; begin @@ -476,24 +586,21 @@ end; procedure TFormConfCellTCO.EditTypeImageChange(Sender: TObject); var Bimage,erreur : integer; begin - if clicTCO or not(formConfCellTCOAff) or actualize then exit; + if clicTCO or not(ConfCellTCO) or actualize then exit; if affevt then Affiche('TCO evt editTypeImageKeyPress',clorange); Val(EditTypeImage.Text,Bimage,erreur); - if (erreur<>0) or not(Bimage in[0..29,32..34,50,51]) then - begin - exit; - end; + if (erreur<>0) or not(Bimage in[0..29,32..34,50,51]) then exit; TCO_modifie:=true; - tco[XClicCell,YClicCell].Bimage:=Bimage; - FormTCO.EditTypeImage.text:=intToSTR(BImage); - actualise; // pour mise à jour de l'image de la fenetre FormConfCellTCO - efface_entoure; - Efface_Cellule(FormTCO.ImageTCO.Canvas,XClicCell,yClicCell,pmCopy); - affiche_cellule(XClicCell,YClicCell); + tco[IndexTCOCourant,XclicCell[IndexTCOCourant],YclicCell[IndexTCOCourant]].Bimage:=Bimage; + FormTCO[IndexTCOCourant].EditTypeImage.text:=intToSTR(BImage); + actualise(IndexTCOCourant); // pour mise à jour de l'image de la fenetre FormConfCellTCO + efface_entoure(IndexTCOCourant); + Efface_Cellule(IndexTCOCourant,FormTCO[IndexTCOCourant].ImageTCO.Canvas,XclicCell[IndexTCOCourant],YclicCell[IndexTCOCourant],pmCopy); + affiche_cellule(IndexTCOCourant,XclicCell[IndexTCOCourant],YclicCell[IndexTCOCourant]); end; -procedure copie_cellule; +procedure copie_cellule(index : integer); begin // affiche l'icone cliquée dans la fenetre ----------------------------------------------- // pour que le stretchBlt soit visible, il faut mettre à jour la taille du bitmap @@ -504,14 +611,16 @@ begin end; // destination masque avec mise à l'échelle - StretchBlt(FormConfCellTCO.ImagePaletteCC.canvas.Handle,0,0,iconeX,iconeY, - PcanvasTCO.Handle,(xClicCell-1)*largeurCell,(yClicCell-1)*hauteurCell,largeurCell,hauteurCell,srccopy); + 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); FormConfCellTCO.ImagePaletteCC.repaint; // obligatoire sinon il ne s'affiche pas end; procedure TFormConfCellTCO.ImagePaletteCCMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); -var c,x0,y0,xc,yc,xf,yf,element,i,erreur,x1,y1,c1,c2,c3,c4 : integer; +var c,x0,y0,xc,yc,xf,yf,element,i,j,erreur,x1,y1,c1,c2,c3,c4, + Xclic,Yclic : integer; + crois,IconeBut : boolean; begin x0:=0; // x origine y0:=0; // y origine @@ -519,10 +628,14 @@ begin xc:=x0+(iconeX div 2); // x centre xf:=x0+iconeX; // x fin yf:=y0+iconeY; // y fin + Xclic:=XclicCell[indexTCOCourant]; + Yclic:=YclicCell[indexTCOCourant]; + //Affiche(IntToSTR(x)+' '+IntToSTR(y),clyellow); val(editTypeImage.text,element,erreur); - + + if erreur<>0 then exit; extrait_connect(element,c1,c2,c3,c4); @@ -551,35 +664,166 @@ begin // x1,y1 désigne le permier point du segment if point_Sur_Segment(x,y,x1,y1,xc,yc) then begin - if not(testbit(tco[xClicCell,yClicCell].epaisseurs,c)) then - with ImagePaletteCC.Picture.Bitmap.Canvas do - begin - efface_entoure; - tco[xClicCell,yClicCell].epaisseurs:=setbit(tco[xClicCell,yClicCell].epaisseurs,c); - efface_cellule(PCanvasTCO,xClicCell,yClicCell,PmCopy); - dessine_icone(PCanvasTCO,element,xClicCell,yClicCell,0); - copie_cellule; - end - else - with ImagePaletteCC.Picture.Bitmap.Canvas do - begin - efface_entoure; - tco[xClicCell,yClicCell].epaisseurs:=Razbit(tco[xClicCell,yClicCell].epaisseurs,c); - efface_cellule(PCanvasTCO,xClicCell,yClicCell,PmCopy); - dessine_icone(PCanvasTCO,element,xClicCell,yClicCell,0); - copie_cellule; - end - end; + iconeBut:=(Element=1) or (Element=10) or (Element=11) or (Element=20); // icones pouvant afficher un buttoir + crois:=(element=21) or (element=22) or (element=23) or (element=25) ; + // traitement des épaisseurs : mode épaisseur + if (not(iconeBut) and not(crois) or (IconeBut and (FormConfCellTCO.RadioGroupSel.Itemindex=0)) ) or + (crois and (FormConfCellTCO.RadioGroupSel.Itemindex=0)) + then + begin + efface_entoure(IndexTCOCourant); + if not(testbit(tco[IndexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]].epaisseurs,c)) then + // mise à 1 du bit si pas croisement et sélection sur épaisseurs + begin + // si élément à 2 connexions, allumer les deux bits + case Element of + 1 : tco[IndexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]].epaisseurs:=$88; + 6 : tco[IndexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]].epaisseurs:=$09; + 7 : tco[IndexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]].epaisseurs:=$84; + 8 : tco[IndexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]].epaisseurs:=$90; + 9 : tco[IndexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]].epaisseurs:=$48; + 10 : tco[IndexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]].epaisseurs:=$44; + 11 : tco[IndexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]].epaisseurs:=$11; + 16 : tco[IndexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]].epaisseurs:=$21; + 17 : tco[IndexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]].epaisseurs:=$24; + 18 : tco[IndexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]].epaisseurs:=$42; + 19 : tco[IndexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]].epaisseurs:=$14; + 20 : tco[IndexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]].epaisseurs:=$22; + else + tco[IndexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]].epaisseurs:=setbit(tco[IndexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]].epaisseurs,c); + end; + end + else + begin + // si élément à 2 connexions, razer les deux bits + if (Element=1) or (Element=6) or (Element=7) or (Element=8) or (Element=9) or (Element=10) or + (Element=11) or (Element=16) or (Element=17) or (Element=18) or (Element=19) or (Element=20) then + tco[IndexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]].epaisseurs:=0 + else + tco[IndexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]].epaisseurs:=Razbit(tco[IndexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]].epaisseurs,c); + end; + end; + + // traitement des buttoirs : mode buttoir supporté par les éléments 1 10 11 20 + if ((element=1) or (element=10) or (element=11) or (element=20)) and (FormConfCellTCO.RadioGroupSel.Itemindex=1) then + begin + efface_entoure(IndexTCOCourant); + if not(testbit(tco[IndexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]].buttoir,c)) then + begin + // mise à 1 du bit si pas buttoir et sélection sur buttoir + tco[IndexTCOCourant,Xclic,Yclic].buttoir:=0; + tco[IndexTCOCourant,Xclic,Yclic].buttoir:=setbit(tco[IndexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]].buttoir,c) + end + else + begin + tco[IndexTCOCourant,Xclic,Yclic].buttoir:=0; + end; + end; + + // traitement des ponts : croisement et mode croisement + if crois and (FormConfCellTCO.RadioGroupSel.Itemindex=1) then + begin + efface_entoure(IndexTCOCourant); + // si pas croisement et sélection sur épaisseurs + if not(testbit(tco[IndexTCOCourant,Xclic,Yclic].pont,c)) then + begin + tco[IndexTCOCourant,Xclic,Yclic].pont:=0; // raz de tous les autres + tco[IndexTCOCourant,Xclic,Yclic].pont:=setbit(tco[IndexTCOCourant,Xclic,Yclic].pont,c); + end + else + begin + // la raz du bit c doit mettre à 0 le bit opposé aussi + tco[IndexTCOCourant,Xclic,Yclic].pont:=Razbit(tco[IndexTCOCourant,Xclic,Yclic].pont,c); + case c of + 0 : j:=4; + 1 : j:=5; + 2 : j:=6; + 3 : j:=7; + 4 : j:=0; + 5 : j:=1; + 6 : j:=2; + 7 : j:=3; + end; + tco[IndexTCOCourant,Xclic,Yclic].pont:=Razbit(tco[IndexTCOCourant,Xclic,Yclic].pont,j); + end; + end; + efface_cellule(IndexTCOCourant,PCanvasTCO[IndexTCOCourant],Xclic,Yclic,PmCopy); + dessine_icone(IndexTCOCourant,PCanvasTCO[IndexTCOCourant],element,Xclic,Yclic,0); + copie_cellule(IndexTCOCourant); + end; end; end; +end; +procedure TFormConfCellTCO.RadioButtonAffTCOClick(Sender: TObject); +var x,y : integer; +begin + if clicTCO or actualize then exit; + if RadioButtonAffTCO.Checked then + begin + x:=XClicCell[IndexTCOCourant]; + y:=yClicCell[IndexTCOCourant]; + tco[IndexTCOCourant,X,Y].PiedFeu:=1; + efface_cellule(indexTCOCourant,PCanvasTCO[indexTCOcourant],x,y,pmcopy); + affiche_cellule(IndexTCOCourant,x,Y); + actualise(indexTCOCourant); + end; +end; + +procedure TFormConfCellTCO.RadioButtonSCClick(Sender: TObject); +var x,y : integer; +begin + if clicTCO or actualize then exit; + if RadioButtonSC.Checked then + begin + x:=XClicCell[IndexTCOCourant]; + y:=yClicCell[IndexTCOCourant]; + tco[IndexTCOCourant,X,Y].PiedFeu:=2; + efface_cellule(indexTCOCourant,PCanvasTCO[indexTCOcourant],x,y,pmcopy); + affiche_cellule(IndexTCOCourant,x,Y); + actualise(indexTCOCourant); + end; +end; + +procedure TFormConfCellTCO.EditNumTCOChange(Sender: TObject); +var i,erreur : integer; +begin + if clicTCO then exit; + + val(EditNumTCO.Text,i,erreur); + if erreur<>0 then exit; + if i>NbreTCO then + begin + EditNumTCO.Text:=intToSTR(NbreTCO); + i:=NbreTCO; + end; + tco[IndexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]].FeuOriente:=i; end; +procedure TFormConfCellTCO.FormHide(Sender: TObject); +begin + if affevt then Affiche('FormFoncCellTCO hide',clyellow); + ConfCellTCO:=false; +end; - +procedure TFormConfCellTCO.RadioButtonCDMClick(Sender: TObject); +var x,y : integer; +begin + if clicTCO or actualize then exit; + if RadioButtonCDM.Checked then + begin + x:=XClicCell[IndexTCOCourant]; + y:=yClicCell[IndexTCOCourant]; + tco[IndexTCOCourant,X,Y].PiedFeu:=3; + efface_cellule(indexTCOCourant,PCanvasTCO[indexTCOcourant],x,y,pmcopy); + affiche_cellule(IndexTCOCourant,x,Y); + actualise(indexTCOCourant); + end; +end; begin end. + diff --git a/UnitConfigTCO.dfm b/UnitConfigTCO.dfm index 6caa960..a708ac9 100644 --- a/UnitConfigTCO.dfm +++ b/UnitConfigTCO.dfm @@ -1,9 +1,9 @@ object FormConfigTCO: TFormConfigTCO - Left = 311 - Top = 218 + Left = 294 + Top = 201 BorderStyle = bsDialog Caption = 'Configuration du TCO' - ClientHeight = 293 + ClientHeight = 400 ClientWidth = 665 Color = clBtnFace Font.Charset = DEFAULT_CHARSET @@ -13,99 +13,31 @@ object FormConfigTCO: TFormConfigTCO Font.Style = [] OldCreateOrder = False OnActivate = FormActivate + OnCreate = FormCreate PixelsPerInch = 96 TextHeight = 13 - object Label3: TLabel - Left = 16 - Top = 44 - Width = 156 - Height = 13 - Caption = 'Nombre de cellules en horizontal:' - end - object Label4: TLabel - Left = 16 - Top = 68 - Width = 145 - Height = 13 - Caption = 'Nombre de cellules en vertical:' - end object LabelErreur: TLabel Left = 16 Top = 216 Width = 3 Height = 13 end - object LabelMaxX: TLabel - Left = 235 - Top = 44 - Width = 53 - Height = 13 - Caption = 'LabelMaxX' - end - object LabelMaxY: TLabel - Left = 235 - Top = 68 - Width = 53 - Height = 13 - Caption = 'LabelMaxY' - end - object Ratio: TLabel - Left = 16 - Top = 16 - Width = 25 - Height = 13 - Caption = 'Ratio' - end - object Label14: TLabel - Left = 80 - Top = 16 - Width = 17 - Height = 13 - Caption = '/10' - end object ButtonDessine: TButton - Left = 16 - Top = 256 + Left = 8 + Top = 368 Width = 75 Height = 25 Caption = 'Redessine' TabOrder = 0 OnClick = ButtonDessineClick end - object CheckDessineGrille: TCheckBox - Left = 160 - Top = 16 - Width = 97 - Height = 17 - Caption = 'dessine grille' - TabOrder = 1 - OnClick = CheckDessineGrilleClick - end - object EditNbCellX: TEdit - Left = 184 - Top = 40 - Width = 49 - Height = 21 - TabOrder = 2 - Text = 'EditNbCellX' - OnChange = EditNbCellXChange - end - object EditNbCellY: TEdit - Left = 184 - Top = 64 - Width = 49 - Height = 21 - TabOrder = 3 - Text = 'EditNbCellY' - OnChange = EditNbCellYChange - end object GroupBox1: TGroupBox Left = 304 Top = 8 Width = 353 - Height = 273 + Height = 265 Caption = 'Couleurs ' - TabOrder = 4 + TabOrder = 1 object Label5: TLabel Left = 21 Top = 32 @@ -179,8 +111,8 @@ object FormConfigTCO: TFormConfigTCO OnClick = ImagecantonClick end object Label10: TLabel - Left = 48 - Top = 248 + Left = 56 + Top = 240 Width = 258 Height = 13 Caption = 'Cliquez sur l'#39'ic'#244'ne pour changer la couleur de l'#39#233'l'#233'ment' @@ -237,8 +169,8 @@ object FormConfigTCO: TFormConfigTCO OnClick = ImagePiedFeuClick end object CheckCouleur: TCheckBox - Left = 56 - Top = 208 + Left = 64 + Top = 216 Width = 281 Height = 17 Caption = 'Couleur du canton activ'#233' par la couleur du train' @@ -247,82 +179,224 @@ object FormConfigTCO: TFormConfigTCO end end object Memo1: TMemo - Left = 16 - Top = 184 - Width = 273 - Height = 65 + Left = 304 + Top = 344 + Width = 353 + Height = 49 BevelInner = bvLowered BevelKind = bkFlat BorderStyle = bsNone Lines.Strings = ( - 'Si vous d'#233'finissez un nombre de cellules en ' - 'horizontal ou en vertical plus petit(s) que l'#39'actuel(s), ' - 'alors le TCO sera tronqu'#233', et les '#233'l'#233'ments tronqu'#233's ' + + 'Si vous d'#233'finissez un nombre de cellules en horizontal ou en ver' + + 'tical plus ' + + 'petit(s) que l'#39'actuel(s), alors le TCO sera tronqu'#233', et les '#233'l'#233'm' + + 'ents tronqu'#233's ' 'seront perdus '#224' la prochaine sauvegarde.') ReadOnly = True - TabOrder = 5 - end - object EditRatio: TEdit - Left = 48 - Top = 13 - Width = 25 - Height = 21 - Hint = 'Rapport X/Y d'#39'affichage des cellules' - ParentShowHint = False - ShowHint = True - TabOrder = 6 - Text = 'EditRatio' + TabOrder = 2 end object BitBtnOk: TBitBtn - Left = 216 - Top = 256 + Left = 208 + Top = 368 Width = 75 Height = 25 - TabOrder = 7 + TabOrder = 3 OnClick = BitBtnOkClick Kind = bkOK end object RadioGroup1: TRadioGroup - Left = 16 - Top = 120 - Width = 273 + Left = 304 + Top = 280 + Width = 353 Height = 57 Caption = 'Graphisme' - TabOrder = 8 + TabOrder = 4 end object RadioButtonLignes: TRadioButton - Left = 40 - Top = 136 + Left = 352 + Top = 296 Width = 113 Height = 17 Caption = 'Lignes bris'#233'es' - TabOrder = 9 + TabOrder = 5 OnClick = RadioButtonLignesClick end object RadioButtonCourbes: TRadioButton - Left = 40 - Top = 152 + Left = 352 + Top = 312 Width = 113 Height = 17 Caption = 'Lignes courbes' - TabOrder = 10 + TabOrder = 6 OnClick = RadioButtonCourbesClick end - object CheckBoxCreerEvt: TCheckBox - Left = 16 - Top = 96 - Width = 281 - Height = 17 - Hint = 'Pour simuler l'#39'action d'#39'une locomotive sur un d'#233'tecteur' - Caption = 'Cr'#233'er '#233'v'#232'nement d'#233'tecteur sur double clic d'#233'tecteur' - ParentShowHint = False - ShowHint = True - TabOrder = 11 - OnClick = CheckBoxCreerEvtClick + object GroupBox3: TGroupBox + Left = 8 + Top = 8 + Width = 289 + Height = 89 + Caption = 'Configuration du TCO ' + TabOrder = 7 + object Label3: TLabel + Left = 16 + Top = 20 + Width = 156 + Height = 13 + Caption = 'Nombre de cellules en horizontal:' + end + object Label4: TLabel + Left = 16 + Top = 44 + Width = 145 + Height = 13 + Caption = 'Nombre de cellules en vertical:' + end + object labelMaxX: TLabel + Left = 224 + Top = 20 + Width = 49 + Height = 13 + Caption = 'labelMaxX' + end + object labelMaxY: TLabel + Left = 224 + Top = 44 + Width = 49 + Height = 13 + Caption = 'labelMaxY' + end + object Label16: TLabel + Left = 152 + Top = 66 + Width = 75 + Height = 13 + Caption = 'Ouvrir sur '#233'cran' + end + object EditNbCellX: TEdit + Left = 176 + Top = 16 + Width = 41 + Height = 21 + TabOrder = 0 + Text = 'EditNbCellX' + end + object EditNbCellY: TEdit + Left = 176 + Top = 40 + Width = 41 + Height = 21 + TabOrder = 1 + Text = 'EditNbCellY' + end + object CheckDessineGrille: TCheckBox + Left = 16 + Top = 64 + Width = 97 + Height = 17 + Caption = 'dessine grille' + TabOrder = 2 + OnClick = CheckDessineGrilleClick + end + object EditEcran: TEdit + Left = 240 + Top = 64 + Width = 25 + Height = 21 + Hint = 'Num'#233'ro de l'#39#233'cran sur lequel le TCO s'#39'ouvrira' + ParentShowHint = False + ShowHint = True + TabOrder = 3 + Text = 'EditEcran' + end + end + object GroupBox2: TGroupBox + Left = 8 + Top = 104 + Width = 289 + Height = 257 + Caption = 'Configuration de tous les TCO' + TabOrder = 8 + object Ratio: TLabel + Left = 8 + Top = 208 + Width = 25 + Height = 13 + Caption = 'Ratio' + end + object Label14: TLabel + Left = 72 + Top = 208 + Width = 17 + Height = 13 + Caption = '/10' + end + object Label15: TLabel + Left = 8 + Top = 184 + Width = 86 + Height = 13 + Caption = 'Nombre de TCO : ' + end + object Label2: TLabel + Left = 144 + Top = 184 + Width = 64 + Height = 13 + Caption = '(10 maximum)' + end + object StringGridTCO: TStringGrid + Left = 8 + Top = 16 + Width = 273 + Height = 161 + ColCount = 3 + RowCount = 11 + TabOrder = 0 + ColWidths = ( + 64 + 64 + 64) + RowHeights = ( + 24 + 24 + 24 + 24 + 24 + 24 + 24 + 24 + 24 + 24 + 24) + end + object EditRatio: TEdit + Left = 40 + Top = 205 + Width = 25 + Height = 21 + Hint = 'Rapport X/Y d'#39'affichage des cellules' + ParentShowHint = False + ShowHint = True + TabOrder = 1 + Text = 'EditRatio' + end + object CheckBoxCreerEvt: TCheckBox + Left = 8 + Top = 232 + Width = 273 + Height = 17 + Hint = 'Pour simuler l'#39'action d'#39'une locomotive sur un d'#233'tecteur' + Caption = 'Cr'#233'er '#233'v'#232'nement d'#233'tecteur sur double clic d'#233'tecteur' + ParentShowHint = False + ShowHint = True + TabOrder = 2 + OnClick = CheckBoxCreerEvtClick + end end object ColorDialog1: TColorDialog OnShow = ColorDialog1Show Left = 272 - Top = 8 end end diff --git a/UnitConfigTCO.pas b/UnitConfigTCO.pas index 41c98db..3501db9 100644 --- a/UnitConfigTCO.pas +++ b/UnitConfigTCO.pas @@ -5,16 +5,11 @@ interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls , UnitTCO, ExtCtrls, Menus, - Buttons; + Buttons, Grids; type TFormConfigTCO = class(TForm) - Label3: TLabel; - Label4: TLabel; ButtonDessine: TButton; - CheckDessineGrille: TCheckBox; - EditNbCellX: TEdit; - EditNbCellY: TEdit; LabelErreur: TLabel; ColorDialog1: TColorDialog; GroupBox1: TGroupBox; @@ -33,13 +28,8 @@ type ImageTexte: TImage; Label11: TLabel; Label12: TLabel; - LabelMaxX: TLabel; - LabelMaxY: TLabel; ImageQuai: TImage; Label13: TLabel; - EditRatio: TEdit; - Ratio: TLabel; - Label14: TLabel; CheckCouleur: TCheckBox; Label1: TLabel; ImagePiedFeu: TImage; @@ -47,7 +37,24 @@ type RadioGroup1: TRadioGroup; RadioButtonLignes: TRadioButton; RadioButtonCourbes: TRadioButton; + GroupBox3: TGroupBox; + Label3: TLabel; + Label4: TLabel; + GroupBox2: TGroupBox; + StringGridTCO: TStringGrid; + EditNbCellX: TEdit; + EditNbCellY: TEdit; + labelMaxX: TLabel; + labelMaxY: TLabel; + Ratio: TLabel; + EditRatio: TEdit; + Label14: TLabel; CheckBoxCreerEvt: TCheckBox; + Label15: TLabel; + Label2: TLabel; + CheckDessineGrille: TCheckBox; + EditEcran: TEdit; + Label16: TLabel; procedure ButtonDessineClick(Sender: TObject); procedure FormActivate(Sender: TObject); procedure ImageAigClick(Sender: TObject); @@ -67,6 +74,7 @@ type procedure CheckCouleurClick(Sender: TObject); procedure RadioButtonLignesClick(Sender: TObject); procedure RadioButtonCourbesClick(Sender: TObject); + procedure FormCreate(Sender: TObject); private { Déclarations privées } public @@ -74,13 +82,13 @@ type end; var FormConfigTCO: TFormConfigTCO; - AvecGrille : boolean; + clicConf : boolean; titre_couleur : string; graphisme : integer; implementation -uses UnitPrinc ; +uses UnitPrinc,unitconfig ; {$R *.dfm} @@ -109,7 +117,7 @@ begin end; end; -procedure dessine_icones_config; +procedure dessine_icones_config(indexTCO : integer); var r : Trect; x1,y1,x2,y2,jy1,jy2,larg,haut : integer; begin @@ -189,8 +197,8 @@ begin canvas.pen.color:=clQuai; x1:=0; x2:=x1+width; - jy1:=(Haut div 2)-round(12*frYGlob); // pos Y de la bande sup - jy2:=(Haut div 2)+round(12*frYGlob); // pos Y de la bande inf + jy1:=(Haut div 2)-round(12*fryGlob[indexTCO]); // pos Y de la bande sup + jy2:=(Haut div 2)+round(12*fryGlob[indexTCO]); // pos Y de la bande inf canvas.PolyGon([point(x1,jy1),point(x2,jy1),point(x2,jy2),point(x1,jy2)]); end; @@ -207,14 +215,14 @@ begin x1:=Larg div 2; y1:=0; canvas.moveTo(x1,y1); - y2:=HauteurCell div 2; + y2:=HauteurCell[indexTCO] div 2; canvas.LineTo(x1,y2); canvas.LineTo(x1-10,y2); end; end; -function verif_config_TCO : boolean; // renvoie true si ok +function verif_config_TCO(indexTCO : integer) : boolean; // renvoie true si ok var erreur,mx,my : integer; ok : boolean; begin @@ -227,7 +235,7 @@ begin LabelErreur.caption:='Erreur: nombre de cellules X: mini=20 maxi='+IntToSTR(MaxCellX); ok:=false; end - else NbreCellX:=mx; + else NbreCellX[indexTCO]:=mx; Val(EditNbCellY.Text,my,erreur); if (my<10) or (my>MaxCellY) then @@ -235,15 +243,15 @@ begin LabelErreur.caption:='Erreur: nombre de cellules Y: mini=10 maxi='+IntToSTR(MaxCellY); ok:=false; end - else NbreCellY:=my; + else NbreCellY[indexTCO]:=my; - if LargeurCell*NbreCellX>8192 then + if LargeurCell[indexTCO]*NbreCellX[indexTCO]>8192 then begin LabelErreur.caption:='Erreur: nombre de cellules X'; ok:=false; end; - if HauteurCell*NbreCellY>8192 then + if HauteurCell[indexTCO]*NbreCellY[indexTCO]>8192 then begin LabelErreur.caption:='Erreur: nombre de cellules Y'; ok:=false; @@ -251,46 +259,56 @@ begin val(EditRatio.text,RatioC,erreur); - AvecGrille:=checkDessineGrille.Checked; + AvecGrille[IndexTCO]:=checkDessineGrille.Checked; if checkCouleur.checked then ModeCouleurCanton:=1 else ModeCouleurCanton:=0; end; verif_config_TCO:=ok; - NbCellulesTCO:=NbreCellX*NbreCellY; + NbCellulesTCO[indexTCO]:=NbreCellX[indexTCO]*NbreCellY[indexTCO]; end; procedure TFormConfigTCO.ButtonDessineClick(Sender: TObject); begin - if verif_config_TCO then + if verif_config_TCO(indexTCOCourant) then begin - with formTCO do + with formTCO[indexTCOCourant] do begin - ImageTCO.Width:=LargeurCell*NbreCellX; - ImageTCO.Height:=HauteurCell*NbreCellY; + ImageTCO.Width:=LargeurCell[indexTCOCourant]*NbreCellX[indexTCOCourant]; + ImageTCO.Height:=HauteurCell[indexTCOCourant]*NbreCellY[indexTCOCourant]; end; - calcul_cellules; - affiche_TCO; + calcul_cellules(indexTCOCourant); + affiche_TCO(indexTCOCourant); end; end; procedure TFormConfigTCO.FormActivate(Sender: TObject); var s: string; + i : integer; begin - EditNbCellX.Text:=IntToSTR(NbreCellX); - EditNbCellY.Text:=IntToSTR(NbreCellY); + clicConf:=true; + caption:='Configuration du tco '+inttostr(indextcocourant)+' Fichier '+NomFichierTCO[indextcocourant]; + groupBox3.caption:='Configuration du tco '+inttostr(indextcocourant); + EditNbCellX.Text:=IntToSTR(NbreCellX[indexTCOcourant]); + EditNbCellY.Text:=IntToSTR(NbreCellY[indexTCOcourant]); EditRatio.text:=IntToSTR(RatioC); + EditEcran.Text:=intToSTR(EcranTCO[indexTCOcourant]); RadioButtonCourbes.checked:=graphisme=2; RadioButtonLignes.checked:=graphisme=1; - checkDessineGrille.Checked:=AvecGrille; + checkDessineGrille.Checked:=AvecGrille[IndexTCOCourant]; checkCouleur.Checked:=ModeCouleurCanton=1; labelMaxX.caption:='Max='+intToSTR(MaxCellX); labelMaxY.caption:='Max='+intToSTR(MaxCellY); + Label15.caption:='Nbre de TCOs : '+intToSTR(NbreTCO); CheckBoxCreerEvt.checked:=EvtClicDet; - dessine_icones_config; + dessine_icones_config(indexTCOCourant); s:='ColorA='+IntToHex(clfond,6); // ajouter aux couleurs personnalisées colorDialog1.CustomColors.Add(s); + for i:=1 to 10 do + stringGridTCO.Cells[1,i]:=NomFichierTCO[i]; +// stringGridTCO.canvas.Font.Style:=[fsBOld]; + clicConf:=false; end; @@ -306,7 +324,7 @@ begin begin clVoies:=ColorDialog1.Color; TCO_modifie:=true; - dessine_icones_config; + dessine_icones_config(indexTCOCourant); end; end; @@ -322,7 +340,7 @@ begin begin clfond:=ColorDialog1.Color; TCO_modifie:=true; - dessine_icones_config; + dessine_icones_config(indexTCOCourant); end; end; @@ -339,7 +357,7 @@ begin begin ClGrille:=ColorDialog1.Color; TCO_modifie:=true; - dessine_icones_config; + dessine_icones_config(indexTCOCourant); end; end; @@ -356,7 +374,7 @@ begin begin ClAllume:=ColorDialog1.Color; TCO_modifie:=true; - dessine_icones_config; + dessine_icones_config(indexTCOCourant); end; end; @@ -368,7 +386,7 @@ begin if ColorDialog1.execute then begin ClCanton:=ColorDialog1.Color; - dessine_icones_config; + dessine_icones_config(indexTCOCourant); end; end; @@ -380,7 +398,7 @@ begin if ColorDialog1.execute then begin ClTexte:=ColorDialog1.Color; - dessine_icones_config; + dessine_icones_config(indexTCOCourant); end; end; @@ -392,7 +410,7 @@ begin if ColorDialog1.execute then begin ClQuai:=ColorDialog1.Color; - dessine_icones_config; + dessine_icones_config(indexTCOCourant); end; end; @@ -404,7 +422,7 @@ begin if ColorDialog1.execute then begin clPiedSignal:=ColorDialog1.Color; - dessine_icones_config; + dessine_icones_config(indexTCOCourant); end; end; @@ -416,43 +434,39 @@ end; procedure TFormConfigTCO.BitBtnOkClick(Sender: TObject); var ok : boolean; - x,y : integer; + index,i,x,y,erreur : integer; + s : string; begin ok:=true; + index:=indexTCOCourant; - if verif_config_TCO then + if verif_config_TCO(indexTCOCourant) then begin - with FormTCO.ImageTCO do + with FormTCO[index].ImageTCO do begin - Width:=LargeurCell*NbreCellX; - Height:=HauteurCell*NbreCellY; + Width:=LargeurCell[index]*NbreCellX[index]; + Height:=HauteurCell[index]*NbreCellY[index]; end; try - SetLength(TCO,NbreCellX+1,NbreCellY+1); + begin + SetLength(TCO[index],NbreCellX[index]+1,NbreCellY[index]+1); + init_tampon_copiercoller; + end; except LabelErreur.caption:='TCO Mémoire insuffisante'; - NbreCellX:=20;NbreCellY:=12; - SetLength(TCO,NbreCellX+1,NbreCellY+1); + NbreCellX[index]:=20;NbreCellY[index]:=12; + SetLength(TCO[index],NbreCellX[index]+1,NbreCellY[index]+1); + init_tampon_copiercoller; ok:=false; end; - for y:=1 to NbreCellY do - for x:=1 to NbreCellX do + for y:=1 to NbreCellY[index] do + for x:=1 to NbreCellX[index] do begin - if tco[x,y].CouleurFond=0 then tco[x,y].CouleurFond:=clfond; + if tco[index,x,y].CouleurFond=0 then tco[index,x,y].CouleurFond:=clfond; end; - try - SetLength(TamponTCO,NbreCellX+1,NbreCellY+1); - except - LabelErreur.caption:='TamponTCO Mémoire insuffisante'; - NbreCellX:=20;NbreCellY:=12; - SetLength(TamponTCO,NbreCellX+1,NbreCellY+1); - ok:=false; - end; - - if RadioButtonLignes.Checked then begin if graphisme=2 then TCO_modifie:=true; @@ -464,13 +478,30 @@ begin graphisme:=2; end; - AvecGrille:=checkDessineGrille.Checked; + val(editEcran.Text,i,erreur); + if i<1 then i:=1; + if i<>EcranTCO[indexTCOcourant] then tco_modifie:=true; + EcranTCO[indexTCOcourant]:=i; + AvecGrille[IndexTCOCourant]:=checkDessineGrille.Checked; if ok then begin - calcul_cellules; - affiche_TCO; - - dessine_icones; + for i:=1 to 10 do + begin + if NomFichierTCO[i]<>stringGridTCO.Cells[1,i] then + begin + config_modifie:=true; + s:=stringGridTCO.Cells[1,i]; + // on peut vérifier le .cfg mais bon + Affiche('Le nom du fichier '+NomFichierTCO[i]+' sera sauvegardé en '+s,clyellow); + NomFichierTCO[i]:=s; + end + else + NomFichierTCO[i]:=stringGridTCO.Cells[1,i]; + end; + calcul_cellules(IndexTCOcourant); + affiche_TCO(indexTCOcourant); + + dessine_icones(index); LabelErreur.caption:=''; close; end; @@ -480,38 +511,64 @@ end; procedure TFormConfigTCO.CheckBoxCreerEvtClick(Sender: TObject); begin EvtClicDet:=CheckBoxCreerEvt.checked; - TCO_modifie:=true; + if not(clicConf) then TCO_modifie:=true; end; procedure TFormConfigTCO.EditNbCellXChange(Sender: TObject); begin - TCO_modifie:=true; + if not(clicConf) then TCO_modifie:=true; end; procedure TFormConfigTCO.EditNbCellYChange(Sender: TObject); begin - TCO_modifie:=true; + if not(clicConf) then TCO_modifie:=true; end; procedure TFormConfigTCO.CheckDessineGrilleClick(Sender: TObject); begin - TCO_modifie:=true; + if not(clicConf) then TCO_modifie:=true; end; procedure TFormConfigTCO.CheckCouleurClick(Sender: TObject); begin - TCO_modifie:=true; + if not(clicConf) then TCO_modifie:=true; end; procedure TFormConfigTCO.RadioButtonLignesClick(Sender: TObject); begin - TCO_modifie:=true; + if not(clicConf) then TCO_modifie:=true; end; procedure TFormConfigTCO.RadioButtonCourbesClick(Sender: TObject); begin - TCO_modifie:=true; + if not(clicConf) then TCO_modifie:=true; end; +procedure TFormConfigTCO.FormCreate(Sender: TObject); +var i : integer; begin + + for i := 0 to stringGridTCO.RowCount - 1 do + with stringGridTCO do + begin + RowHeights[i]:=15; + Cells[0,i+1]:=intToSTR(i+1); + end; + + with stringGridTCO do + begin + Options := stringGridTCO.Options + [goEditing]; + ColWidths[0]:=30; + ColWidths[1]:=200; + ColWidths[2]:=15; + Cells[0,0]:='Num'; + Cells[1,0]:='Nom fichier'; + end; + +end; + + + + + end. diff --git a/UnitPilote.dfm b/UnitPilote.dfm index 01f64d9..b46d319 100644 --- a/UnitPilote.dfm +++ b/UnitPilote.dfm @@ -4,7 +4,7 @@ object FormPilote: TFormPilote BorderStyle = bsDialog Caption = 'Pilotage' ClientHeight = 350 - ClientWidth = 331 + ClientWidth = 337 Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText @@ -17,30 +17,26 @@ object FormPilote: TFormPilote OnClose = FormClose OnCreate = FormCreate OnKeyPress = FormKeyPress - DesignSize = ( - 331 - 350) PixelsPerInch = 96 TextHeight = 13 object LabelTitrePilote: TLabel Left = 8 Top = 8 - Width = 249 - Height = 34 + Width = 242 + Height = 32 Caption = 'Pilotage du signal' Font.Charset = ANSI_CHARSET Font.Color = clWindowText - Font.Height = -29 + Font.Height = -28 Font.Name = 'Arial' Font.Style = [fsBold, fsItalic] ParentFont = False end object ImagePilote: TImage - Left = 224 + Left = 225 Top = 56 Width = 81 Height = 105 - Anchors = [] end object LabelNbFeux: TLabel Left = 208 @@ -241,9 +237,9 @@ object FormPilote: TFormPilote OnClick = CheckVerrouCarreClick end object GroupBox3: TGroupBox - Left = 120 + Left = 101 Top = 40 - Width = 193 + Width = 192 Height = 73 Caption = 'Signalisation combin'#233'e' TabOrder = 5 diff --git a/UnitPilote.pas b/UnitPilote.pas index 0d010ac..c21504b 100644 --- a/UnitPilote.pas +++ b/UnitPilote.pas @@ -115,25 +115,26 @@ implementation {$R *.dfm} procedure dessine_feu_pilote; -var i : integer; +var i,ancienEtat : integer; Vcanvas : Tcanvas; begin i:=Index_Signal(AdrPilote); // adresse du feu d'origine if i<>0 then - + //ImagePilote.Picture.Bitmap:=FormPilote.ImagePilote.picture.bitmap; EtatFeuPilote:=feux[0].EtatSignal; + AncienEtat:=Feux[0].ancienEtat; Vcanvas:=FormPilote.ImagePilote.picture.bitmap.Canvas; case feux[i].aspect of // feux de signalisation 2 : dessine_feu2(Vcanvas,0,0,1,1,EtatFeupilote,1); - 3 : dessine_feu3(Vcanvas,0,0,1,1,EtatFeupilote,1); + 3 : dessine_feu3(Vcanvas,0,0,1,1,EtatFeupilote,AncienEtat,1); 4 : dessine_feu4(VCanvas,0,0,1,1,EtatFeupilote,1); 5 : dessine_feu5(VCanvas,0,0,1,1,EtatFeupilote,1); 7 : dessine_feu7(VCanvas,0,0,1,1,EtatFeupilote,1); 9 : dessine_feu9(VCanvas,0,0,1,1,EtatFeupilote,1); - 20 : dessine_feu20(VCanvas,0,0,1,1,EtatFeupilote,1,feux[i].adresse); + 20 : dessine_feu20(VCanvas,0,0,1,1,EtatFeupilote,1,feux[i].adresse,12); // indicateurs de direction 12 : dessine_dirN(VCanvas,0,0,1,1,EtatFeupilote,1,2); 13 : dessine_dirN(VCanvas,0,0,1,1,EtatFeupilote,1,3); @@ -162,60 +163,70 @@ end; procedure TFormPilote.RadioVertClick(Sender: TObject); begin + feux[0].AncienEtat:=feux[0].EtatSignal; if nation=1 then Maj_Etat_Signal(0,vert) else Maj_Etat_Signal(0,vertB) ; dessine_feu_pilote; end; procedure TFormPilote.RadioVertCliClick(Sender: TObject); begin + feux[0].AncienEtat:=feux[0].EtatSignal; Maj_Etat_Signal(0,vert_cli); dessine_feu_pilote; end; procedure TFormPilote.RadioJauneClick(Sender: TObject); begin + feux[0].AncienEtat:=feux[0].EtatSignal; if nation=1 then Maj_Etat_Signal(0,jaune) else Maj_Etat_Signal(0,deux_jaunes); dessine_feu_pilote; end; procedure TFormPilote.RadioJaunecliClick(Sender: TObject); begin + feux[0].AncienEtat:=feux[0].EtatSignal; Maj_Etat_Signal(0,jaune_cli); dessine_feu_pilote; end; procedure TFormPilote.RadioRougeClick(Sender: TObject); begin + feux[0].AncienEtat:=feux[0].EtatSignal; Maj_Etat_Signal(0,semaphore); dessine_feu_pilote; end; procedure TFormPilote.RadioRougeCliClick(Sender: TObject); begin + feux[0].AncienEtat:=feux[0].EtatSignal; Maj_Etat_Signal(0,semaphore_cli); dessine_feu_pilote; end; procedure TFormPilote.RadioCarreClick(Sender: TObject); begin + feux[0].AncienEtat:=feux[0].EtatSignal; if nation=1 then Maj_Etat_Signal(0,carre) else Maj_Etat_Signal(0,vert_jaune_H); dessine_feu_pilote; end; procedure TFormPilote.RadioBlancClick(Sender: TObject); begin + feux[0].AncienEtat:=feux[0].EtatSignal; if nation=1 then Maj_Etat_Signal(0,blanc) else Maj_Etat_Signal(0,rouge_blanc); dessine_feu_pilote; end; procedure TFormPilote.RadioVioletClick(Sender: TObject); begin + feux[0].AncienEtat:=feux[0].EtatSignal; if nation=1 then Maj_Etat_Signal(0,violet) else Maj_Etat_Signal(0,vert_jaune_V); dessine_feu_pilote; end; procedure TFormPilote.RadioBlancCliClick(Sender: TObject); begin + feux[0].AncienEtat:=feux[0].EtatSignal; Maj_Etat_Signal(0,blanc_cli); dessine_feu_pilote; end; @@ -228,6 +239,7 @@ end; procedure TFormPilote.RadioRalen30Click(Sender: TObject); begin + feux[0].AncienEtat:=feux[0].EtatSignal; Maj_Etat_Signal(0,ral_30); dessine_feu_pilote; end; @@ -235,6 +247,7 @@ end; procedure TFormPilote.RadioRappel60Click(Sender: TObject); begin + feux[0].AncienEtat:=feux[0].EtatSignal; Maj_Etat_Signal(0,rappel_60); dessine_feu_pilote; end; @@ -242,12 +255,14 @@ end; procedure TFormPilote.RadioRalen60Click(Sender: TObject); begin + feux[0].AncienEtat:=feux[0].EtatSignal; Maj_Etat_Signal(0,ral_60); dessine_feu_pilote; end; procedure TFormPilote.RadioRappel30Click(Sender: TObject); begin + feux[0].AncienEtat:=feux[0].EtatSignal; Maj_Etat_Signal(0,rappel_30); dessine_feu_pilote; end; @@ -348,11 +363,15 @@ begin checkVerrouCarre.Checked:=feux[i].VerrouCarre; end; - ImagePilote.Parent:=FormPilote; - ImagePilote.Picture.Bitmap.TransparentMode:=tmAuto; - ImagePilote.Picture.Bitmap.TransparentColor:=clblue; - ImagePilote.Transparent:=true; - ImagePilote.Picture.BitMap:=Feux[i].Img.Picture.Bitmap; + with imagePIlote do + begin + Parent:=FormPilote; + Picture.Bitmap.TransparentMode:=tmAuto; + Picture.Bitmap.TransparentColor:=clblue; + Transparent:=true; + Picture.BitMap:=Feux[i].Img.Picture.Bitmap; + //left:=groupBox1.width+50; + end; LabelTitrePilote.Caption:='Pilotage du signal '+intToSTR(AdrPilote); feux[0].EtatSignal:=feux[i].EtatSignal; diff --git a/UnitPrinc.dfm b/UnitPrinc.dfm index 2cb35dd..802e3c0 100644 --- a/UnitPrinc.dfm +++ b/UnitPrinc.dfm @@ -1,6 +1,6 @@ object FormPrinc: TFormPrinc - Left = 64 - Top = 216 + Left = 55 + Top = 227 Width = 1222 Height = 652 Caption = 'Signaux complexes' @@ -17,8 +17,8 @@ object FormPrinc: TFormPrinc OnClose = FormClose OnCreate = FormCreate DesignSize = ( - 1206 - 594) + 1214 + 601) PixelsPerInch = 96 TextHeight = 13 object LabelTitre: TLabel @@ -1203,7 +1203,7 @@ object FormPrinc: TFormPrinc object SplitterH: TSplitter Left = 0 Top = 0 - Height = 572 + Height = 579 end object ImageSignal20: TImage Left = 384 @@ -1507,8 +1507,8 @@ object FormPrinc: TFormPrinc end object StatusBar1: TStatusBar Left = 0 - Top = 572 - Width = 1206 + Top = 579 + Width = 1214 Height = 22 Panels = <> SimplePanel = True @@ -1593,9 +1593,9 @@ object FormPrinc: TFormPrinc OnClick = ButtonLanceCDMClick end object ButtonLocCV: TButton - Left = 104 - Top = 8 - Width = 83 + Left = 8 + Top = 88 + Width = 89 Height = 33 Hint = 'Affichage du panneau de contr'#244'le des trains ou des CV' Caption = 'Trains / CVs' @@ -1626,10 +1626,20 @@ object FormPrinc: TFormPrinc WordWrap = True OnClick = ButtonAffAnalyseCDMClick end + object ButtonCDM: TButton + Left = 104 + Top = 8 + Width = 81 + Height = 33 + Caption = 'Affiche/Cache CDM Rail' + TabOrder = 7 + WordWrap = True + OnClick = ButtonCDMClick + end end object StaticText: TStaticText Left = 16 - Top = 549 + Top = 557 Width = 14 Height = 17 Anchors = [akLeft, akBottom] @@ -2197,6 +2207,124 @@ object FormPrinc: TFormPrinc OnClick = Vrifiernouvelleversion1Click end end + object COs1: TMenuItem + Caption = 'TCOs' + object AffichertouslesTCO1: TMenuItem + Caption = 'Afficher tous les TCO' + OnClick = AffichertouslesTCO1Click + end + object N10: TMenuItem + Caption = '-' + end + object Mosaquehorizontale1: TMenuItem + Caption = 'Mosa'#239'que horizontale' + OnClick = Mosaquehorizontale1Click + end + object Mosaqueverticale1: TMenuItem + Caption = 'Mosa'#239'que verticale' + OnClick = Mosaqueverticale1Click + end + object N11: TMenuItem + Caption = '-' + end + object Mosaiquecarre1: TMenuItem + Caption = 'Mosaique carr'#233'e' + OnClick = Mosaiquecarre1Click + end + object N12: TMenuItem + Caption = '-' + end + object AfficherTCO11: TMenuItem + Caption = 'Afficher TCO1' + OnClick = AfficherTCO11Click + end + object AfficherTCO21: TMenuItem + Caption = 'Afficher TCO2' + OnClick = AfficherTCO21Click + end + object AfficherTCO31: TMenuItem + Caption = 'Afficher TCO3' + OnClick = AfficherTCO31Click + end + object AfficherTCO41: TMenuItem + Caption = 'Afficher TCO4' + OnClick = AfficherTCO41Click + end + object AfficherTCO51: TMenuItem + Caption = 'Afficher TCO5' + OnClick = AfficherTCO51Click + end + object AfficherTCO61: TMenuItem + Caption = 'Afficher TCO6' + OnClick = AfficherTCO61Click + end + object AfficherTCO71: TMenuItem + Caption = 'Afficher TCO7' + OnClick = AfficherTCO71Click + end + object AfficherTCO81: TMenuItem + Caption = 'Afficher TCO8' + OnClick = AfficherTCO81Click + end + object AfficherTCO91: TMenuItem + Caption = 'Afficher TCO9' + OnClick = AfficherTCO91Click + end + object AfficherTCO101: TMenuItem + Caption = 'Afficher TCO10' + OnClick = AfficherTCO101Click + end + object N13: TMenuItem + Caption = '-' + end + object NouveauTCO1: TMenuItem + Caption = 'Nouveau TCO' + OnClick = NouveauTCO1Click + end + object SupprimerTCO1: TMenuItem + Caption = 'Supprimer TCO' + object CO11: TMenuItem + Caption = 'TCO1' + OnClick = CO11Click + end + object CO21: TMenuItem + Caption = 'TCO2' + OnClick = CO21Click + end + object CO31: TMenuItem + Caption = 'TCO3' + OnClick = CO31Click + end + object CO41: TMenuItem + Caption = 'TCO4' + OnClick = CO41Click + end + object CO51: TMenuItem + Caption = 'TCO5' + OnClick = CO51Click + end + object CO61: TMenuItem + Caption = 'TCO6' + OnClick = CO61Click + end + object CO71: TMenuItem + Caption = 'TCO7' + OnClick = CO71Click + end + object CO81: TMenuItem + Caption = 'TCO8' + OnClick = CO81Click + end + object CO91: TMenuItem + Caption = 'TCO9' + OnClick = CO91Click + end + object CO101: TMenuItem + Caption = 'TCO10' + OnClick = CO101Click + end + end + end object Roulage1: TMenuItem Caption = 'Roulage' object Placerlestrains1: TMenuItem diff --git a/UnitPrinc.pas b/UnitPrinc.pas index b9bd03b..6476f8a 100644 --- a/UnitPrinc.pas +++ b/UnitPrinc.pas @@ -1,5 +1,5 @@ Unit UnitPrinc; -// 23/8 16h +// 07/09 22h (******************************************** Programme signaux complexes Graphique Lenz Delphi 7 + activeX Tmscomm + clientSocket @@ -175,6 +175,38 @@ type ButtonAffAnalyseCDM: TButton; Affiche_fenetre_CDM: TMenuItem; ImageSignal20: TImage; + COs1: TMenuItem; + AffichertouslesTCO1: TMenuItem; + N10: TMenuItem; + Mosaquehorizontale1: TMenuItem; + Mosaqueverticale1: TMenuItem; + N11: TMenuItem; + Mosaiquecarre1: TMenuItem; + N12: TMenuItem; + AfficherTCO11: TMenuItem; + AfficherTCO21: TMenuItem; + AfficherTCO31: TMenuItem; + AfficherTCO41: TMenuItem; + AfficherTCO51: TMenuItem; + AfficherTCO61: TMenuItem; + AfficherTCO71: TMenuItem; + AfficherTCO81: TMenuItem; + AfficherTCO91: TMenuItem; + AfficherTCO101: TMenuItem; + N13: TMenuItem; + NouveauTCO1: TMenuItem; + SupprimerTCO1: TMenuItem; + CO11: TMenuItem; + CO21: TMenuItem; + CO31: TMenuItem; + CO41: TMenuItem; + CO51: TMenuItem; + CO61: TMenuItem; + CO71: TMenuItem; + CO81: TMenuItem; + CO91: TMenuItem; + CO101: TMenuItem; + ButtonCDM: TButton; procedure FormCreate(Sender: TObject); procedure MSCommUSBLenzComm(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); @@ -258,6 +290,32 @@ type procedure Coller1Click(Sender: TObject); procedure ButtonAffAnalyseCDMClick(Sender: TObject); procedure Affiche_fenetre_CDMClick(Sender: TObject); + procedure AffichertouslesTCO1Click(Sender: TObject); + procedure Mosaquehorizontale1Click(Sender: TObject); + procedure Mosaqueverticale1Click(Sender: TObject); + procedure Mosaiquecarre1Click(Sender: TObject); + procedure AfficherTCO11Click(Sender: TObject); + procedure AfficherTCO21Click(Sender: TObject); + procedure AfficherTCO41Click(Sender: TObject); + procedure AfficherTCO51Click(Sender: TObject); + procedure AfficherTCO61Click(Sender: TObject); + procedure AfficherTCO71Click(Sender: TObject); + procedure AfficherTCO81Click(Sender: TObject); + procedure AfficherTCO91Click(Sender: TObject); + procedure AfficherTCO101Click(Sender: TObject); + procedure AfficherTCO31Click(Sender: TObject); + procedure NouveauTCO1Click(Sender: TObject); + procedure CO11Click(Sender: TObject); + procedure CO21Click(Sender: TObject); + procedure CO31Click(Sender: TObject); + procedure CO41Click(Sender: TObject); + procedure CO51Click(Sender: TObject); + procedure CO61Click(Sender: TObject); + procedure CO71Click(Sender: TObject); + procedure CO81Click(Sender: TObject); + procedure CO91Click(Sender: TObject); + procedure CO101Click(Sender: TObject); + procedure ButtonCDMClick(Sender: TObject); private { Déclarations privées } procedure DoHint(Sender : Tobject); @@ -457,7 +515,7 @@ var TraceListe,clignotant,nack,Maj_feux_cours,configNulle,LanceCDM,AvecInitAiguillages, AvecDemandeInterfaceUSB,AvecDemandeInterfaceEth,aff_acc,affiche_aigdcc,modeStkRetro, retEtatDet,roulage,init_aig_cours,affevt,placeAffiche,clicComboTrain,clicAdrTrain, - avec_splitter,fichier_module_cdm,Diffusion : boolean; + avec_splitter,fichier_module_cdm,Diffusion,cdmDevant : boolean; tick,Premier_tick : longint; @@ -478,6 +536,11 @@ var IndexTrain : integer; // index du train end; + Ecran : array[1..10] of record + x0,y0,larg,haut : integer; + end; + + TypeGen : TEquipement; Adresse_detecteur : array[0..NbMaxDet] of integer; // adresses des détecteurs par index @@ -643,12 +706,12 @@ var function Index_Signal(adresse : integer) : integer; function Index_Aig(adresse : integer) : integer; procedure dessine_feu2(Acanvas : Tcanvas;x,y : integer;frX,frY : real;EtatSignal : word;orientation : integer); -procedure dessine_feu3(Acanvas : Tcanvas;x,y : integer;frX,frY : real;EtatSignal : word;orientation : integer); +procedure dessine_feu3(Acanvas : Tcanvas;x,y : integer;frX,frY : real;EtatSignal,AncienEtat : word;orientation : integer); procedure dessine_feu4(Acanvas : Tcanvas;x,y : integer;frX,frY : real;EtatSignal : word;orientation : integer); procedure dessine_feu5(Acanvas : Tcanvas;x,y : integer;frX,frY : real;EtatSignal : word;orientation : integer); procedure dessine_feu7(Acanvas : Tcanvas;x,y : integer;frX,frY : real;EtatSignal : word;orientation : integer); procedure dessine_feu9(Acanvas : Tcanvas;x,y : integer;frX,frY : real;etatsignal : word;orientation : integer); -procedure dessine_feu20(Acanvas : Tcanvas;x,y : integer;frX,frY : real;etatsignal : word;orientation : integer;adresse : integer); +procedure dessine_feu20(Acanvas : Tcanvas;x,y : integer;frX,frY : real;EtatSignal : word;orientation,adresse,tailleChiffre : integer); procedure dessine_dirN(Acanvas : Tcanvas;x,y : integer;frX,frY : real;EtatSignal : word;orientation,N : integer); procedure Maj_Etat_Signal(adresse,aspect : integer); procedure Maj_Etat_Signal_Belge(adresse,aspect : integer); @@ -697,11 +760,13 @@ Function SetBit(n : word;position : integer) : word; Function RazBit(n : word;position : integer) : word; procedure inverse_image(imageDest,ImageSrc : Timage) ; function extract_int(s : string) : integer; +Procedure Menu_tco(i : integer); +procedure Affiche_fenetre_TCO(i : integer); implementation uses UnitDebug, UnitPilote, UnitSimule, UnitTCO, UnitConfig, - Unitplace, verif_version , UnitCDF, UnitAnalyseSegCDM; + Unitplace, verif_version , UnitCDF, UnitAnalyseSegCDM, UnitConfigCellTCO; { procedure menu_interface(MA : TMA); @@ -819,6 +884,60 @@ begin 16 17 18 19 } end; +// renvoie la chaîne de l'état du signal +function chaine_signal(adresse : word) : string; +var a,i,aspect,etat,combine,nation : integer; + s : string; +begin + i:=Index_Signal(adresse); + etat:=feux[i].EtatSignal ; + nation:=1; + a:=feux[i].aspect; + if a=20 then nation:=2; + + if nation=2 then + begin + // en signalisation belge, on peut avoir plusieurs bits à 1 simultanément en combine + aspect:=etat and $3f; + combine:=etat and $1c0; + aspect:=PremBitNum(aspect) ; + s:=EtatSignBelge[Aspect+1]; + if combine<>0 then + begin + if testBit(combine,chiffre) then s:=s+'+'+EtatSignBelge[chiffre+1]; + if testBit(combine,chevron) then s:=s+'+'+EtatSignBelge[chevron+1]; + end; + result:=s; + exit; + end; + + // signalisation française + if (a>10) and (a<17) then + begin + // directionnel + s:=intToSTR(etat)+' feu'; + if etat>1 then s:=s+'x'; + result:=s; + exit; + end; + + code_to_aspect(etat,aspect,combine); + s:=''; + + if (aspect=16) then s:='' else begin if aspect<>-1 then s:=etatSign[aspect];end; + if combine<>16 then + begin + if (aspect<>16) and (combine<>-1) then + begin + if aspect<>-1 then s:=s+'+'; + s:=s+etatSign[combine]; + end; + end; + chaine_signal:=s; +end; + + + // dessine un cercle plein dans le feu procedure cercle(ACanvas : Tcanvas;x,y,rayon : integer;couleur : Tcolor); begin @@ -886,12 +1005,16 @@ begin end; // dessine les feux sur une cible à 3 feux -procedure dessine_feu3(Acanvas : Tcanvas;x,y : integer;frX,frY : real;EtatSignal : word;orientation : integer); +procedure dessine_feu3(Acanvas : Tcanvas;x,y : integer;frX,frY : real;EtatSignal,AncienEtat : word;orientation : integer); var Temp,rayon,xSem,Ysem,xJaune,Yjaune,Xvert,Yvert, - LgImage,HtImage,code,combine : integer; + LgImage,HtImage,code,combine,AncCode,AncCombine : integer; ech : real; begin +// Affiche('dessine_feu3',clred); code_to_aspect(Etatsignal,code,combine); + code_to_aspect(AncienEtat,Anccode,Anccombine); + //Affiche(intToSTR(ancienEtat),clred); + rayon:=round(6*frX); LgImage:=Formprinc.Image3feux.Picture.Bitmap.Width; @@ -922,10 +1045,21 @@ begin Xvert:=round(Xvert*FrX)+x; Yvert:=round(Yvert*FrY)+Y; XSem:=round(XSem*FrX)+x; YSem:=round(YSem*FrY)+Y; +{ if code=jaune_CLI then Affiche('JC',clyellow); + if code=vert_cli then Affiche('VC',clyellow); + if code=semaphore_CLI then Affiche('SC',clyellow); + + if Anccode=jaune_CLI then Affiche('AJC',clyellow); + if Anccode=vert_cli then Affiche('AVC',clyellow); + if Anccode=semaphore_CLI then Affiche('ASC',clyellow); +} + + // extinctions - if not((code=jaune_cli) and clignotant) then cercle(ACanvas,xJaune,yJaune,rayon,GrisF); - if not((code=vert_cli) and clignotant) then cercle(ACanvas,xVert,yVert,rayon,GrisF); - if not((code=semaphore_cli) and clignotant) then cercle(ACanvas,xSem,ySem,rayon,GrisF); + + if not((code=jaune_cli) and clignotant) and not(ancCode=jaune_cli) then cercle(ACanvas,xJaune,yJaune,rayon,GrisF); + if not((code=vert_cli) and clignotant) and not(ancCode=vert_cli) then cercle(ACanvas,xVert,yVert,rayon,GrisF); + if not((code=semaphore_cli) and clignotant) and not(ancCode=semaphore_cli) then cercle(ACanvas,xSem,ySem,rayon,GrisF); // allumages if ((code=vert_cli) and (clignotant)) or (code=vert) then cercle(ACanvas,xVert,yVert,rayon,clGreen); @@ -976,7 +1110,7 @@ begin Xvert:=round(Xvert*FrX)+x; Yvert:=round(Yvert*FrY)+Y; XSem:=round(XSem*FrX)+x; YSem:=round(YSem*FrY)+Y; Xcarre:=round(Xcarre*FrX)+x; Ycarre:=round(Ycarre*FrY)+Y; - + //extinctions cercle(ACanvas,Xcarre,yCarre,rayon,GrisF); if not((code=semaphore_cli) and clignotant) then cercle(ACanvas,Xsem,Ysem,rayon,GrisF); @@ -1330,14 +1464,18 @@ end; // dessine les feux sur une cible belge à 5 feux // cette image peut être inversée (contre voie) -procedure dessine_feu20(Acanvas : Tcanvas;x,y : integer;frX,frY : real;EtatSignal : word;orientation : integer;adresse : integer); +procedure dessine_feu20(Acanvas : Tcanvas;x,y : integer;frX,frY : real;EtatSignal : word;orientation,adresse,tailleChiffre : integer); var xblanc,xvert,xrouge,Yblanc,xjauneBas,xJauneHaut,yJauneBas,yJauneHaut,YVert,Yrouge,largeur, index,Temp,rayon,LgImage,HtImage,code,combine,x1,y1,x2,y2,x3,y3,xChiffre,yChiffre,xfin,yfin,angle, - AdrAig,IndexAig,vitesse : integer; + AdrAig,IndexAig,vitesse,indexTCO : integer; ech : real; inverse,etatChevron,EtatChiffre,codeClignote : boolean; r : Trect; + c : tcomponent; + t : hwnd; + s : string; begin + code:=etatSignal and $3f; combine:=etatSignal and $1c0; // LDT-DEC-NMBS ou b-model @@ -1492,7 +1630,7 @@ begin with font do begin Font.Color:=clWhite; - font.Size:=(LargeurCell div 5)+4; + font.Size:=taillechiffre; font.Style:=[fsbold]; end; @@ -1765,14 +1903,14 @@ begin begin aspect:=feux[i].aspect ; case aspect of - // feux de signalisation - 2 : dessine_feu2(CanvasDest,x,y,frx,fry,feux[i].EtatSignal,orientation); - 3 : dessine_feu3(CanvasDest,x,y,frx,fry,feux[i].EtatSignal,orientation); - 4 : dessine_feu4(CanvasDest,x,y,frx,fry,feux[i].EtatSignal,orientation); - 5 : dessine_feu5(CanvasDest,x,y,frx,fry,feux[i].EtatSignal,orientation); - 7 : dessine_feu7(CanvasDest,x,y,frx,fry,feux[i].EtatSignal,orientation); - 9 : dessine_feu9(CanvasDest,x,y,frx,fry,feux[i].EtatSignal,orientation); - 20 : dessine_feu20(CanvasDest,x,y,frx,fry,feux[i].EtatSignal,orientation,feux[i].adresse); + // feux de signalisation + 2 : dessine_feu2(CanvasDest,x,y,frx,fry,feux[i].EtatSignal,orientation); + 3 : dessine_feu3(CanvasDest,x,y,frx,fry,feux[i].EtatSignal,feux[i].AncienEtat,orientation); + 4 : dessine_feu4(CanvasDest,x,y,frx,fry,feux[i].EtatSignal,orientation); + 5 : dessine_feu5(CanvasDest,x,y,frx,fry,feux[i].EtatSignal,orientation); + 7 : dessine_feu7(CanvasDest,x,y,frx,fry,feux[i].EtatSignal,orientation); + 9 : dessine_feu9(CanvasDest,x,y,frx,fry,feux[i].EtatSignal,orientation); + 20 : dessine_feu20(CanvasDest,x,y,frx,fry,feux[i].EtatSignal,orientation,feux[i].adresse,10); // indicateurs de direction 12..16 : dessine_dirN(CanvasDest,x,y,frx,fry,feux[i].EtatSignal,orientation,aspect-10); end; @@ -2447,56 +2585,6 @@ begin end; -// renvoie la chaîne de l'état du signal -function chaine_signal(etat,adresse : word) : string; -var a,i,aspect,combine,nation : integer; - s : string; -begin - i:=Index_Signal(adresse); - nation:=1; - a:=feux[i].aspect; - if a=20 then nation:=2; - - if nation=2 then - begin - // en signalisation belge, on peut avoir plusieurs bits à 1 simultanément en combine - aspect:=etat and $3f; - combine:=etat and $1c0; - aspect:=PremBitNum(aspect) ; - s:=EtatSignBelge[Aspect+1]; - if combine<>0 then - begin - if testBit(combine,chiffre) then s:=s+'+'+EtatSignBelge[chiffre+1]; - if testBit(combine,chevron) then s:=s+'+'+EtatSignBelge[chevron+1]; - end; - result:=s; - exit; - end; - - // signalisation française - if (a>10) and (a<17) then - begin - // directionnel - s:=intToSTR(etat)+' feu'; - if etat>1 then s:=s+'x'; - result:=s; - exit; - end; - - code_to_aspect(etat,aspect,combine); - s:=''; - - if (aspect=16) then s:='' else begin if aspect<>-1 then s:=etatSign[aspect];end; - if combine<>16 then - begin - if (aspect<>16) and (combine<>-1) then - begin - if aspect<>-1 then s:=s+'+'; - s:=s+etatSign[combine]; - end; - end; - chaine_signal:=s; -end; procedure Maj_Etat_Signal_Belge(adresse,aspect : integer); var i : integer; @@ -2867,12 +2955,12 @@ begin code:=feux[i].EtatSignal; nombre:=feux[i].Na; // nombre d'adresses occupées par le signal code_to_aspect(code,aspect,combine); - s:='Signal CDF: ad'+IntToSTR(adresse)+'='+chaine_signal(code,adresse); + s:='Signal CDF: ad'+IntToSTR(adresse)+'='+chaine_signal(adresse); if traceSign then affiche(s,clOrange); if Affsignal then afficheDebug(s,clOrange); if AffDetSig then begin - s:='Tick='+IntToSTR(tick)+' Signal '+IntToSTR(adresse)+'='+chaine_signal(feux[i].EtatSignal,adresse); + s:='Tick='+IntToSTR(tick)+' Signal '+IntToSTR(adresse)+'='+chaine_signal(adresse); AfficheDebug(s,clyellow); end; @@ -2922,12 +3010,12 @@ begin begin code:=feux[index].EtatSignal; //code_to_aspect(code,aspect,combine); - s:='Signal SR: ad'+IntToSTR(adresse)+'='+chaine_signal(code,adresse); + s:='Signal SR: ad'+IntToSTR(adresse)+'='+chaine_signal(adresse); if traceSign then affiche(s,clOrange); if Affsignal then afficheDebug(s,clOrange); if AffDetSig then begin - s:='Tick='+IntToSTR(tick)+' Signal '+IntToSTR(adresse)+'='+chaine_signal(feux[index].EtatSignal,adresse); + s:='Tick='+IntToSTR(tick)+' Signal '+IntToSTR(adresse)+'='+chaine_signal(adresse); AfficheDebug(s,clyellow); end; @@ -2988,12 +3076,12 @@ begin begin code:=feux[index].EtatSignal; code_to_aspect(code,aspect,combine); - s:='Signal LEB: ad'+IntToSTR(adresse)+'='+chaine_signal(code,adresse); + s:='Signal LEB: ad'+IntToSTR(adresse)+'='+chaine_signal(adresse); if traceSign then affiche(s,clOrange); if Affsignal then afficheDebug(s,clOrange); if AffDetSig then begin - s:='Tick='+IntToSTR(tick)+' Signal '+IntToSTR(adresse)+'='+chaine_signal(feux[index].EtatSignal,adresse); + s:='Tick='+IntToSTR(tick)+' Signal '+IntToSTR(adresse)+'='+chaine_signal(adresse); AfficheDebug(s,clyellow); end; @@ -3042,12 +3130,12 @@ begin code:=feux[index].EtatSignal; asp:=feux[index].aspect; code_to_aspect(code,aspect,combine); - s:='Signal Arcomora: ad'+IntToSTR(adresse)+'='+chaine_signal(code,adresse); + s:='Signal Arcomora: ad'+IntToSTR(adresse)+'='+chaine_signal(adresse); if traceSign then affiche(s,clOrange); if Affsignal then afficheDebug(s,clOrange); if AffDetSig then begin - s:='Tick='+IntToSTR(tick)+' Signal '+IntToSTR(adresse)+'='+chaine_signal(feux[index].EtatSignal,adresse); + s:='Tick='+IntToSTR(tick)+' Signal '+IntToSTR(adresse)+'='+chaine_signal(adresse); AfficheDebug(s,clyellow); end; @@ -3161,12 +3249,12 @@ begin begin code:=feux[i].EtatSignal; code_to_aspect(code,aspect,combine); - s:='Signal NMRA: ad'+IntToSTR(adresse)+'='+chaine_signal(code,adresse); + s:='Signal NMRA: ad'+IntToSTR(adresse)+'='+chaine_signal(adresse); if traceSign then affiche(s,clOrange); if Affsignal then afficheDebug(s,clOrange); if AffDetSig then begin - s:='Tick='+IntToSTR(tick)+' Signal '+IntToSTR(adresse)+'='+chaine_signal(feux[i].EtatSignal,adresse); + s:='Tick='+IntToSTR(tick)+' Signal '+IntToSTR(adresse)+'='+chaine_signal(adresse); AfficheDebug(s,clyellow); end; @@ -3211,12 +3299,12 @@ begin begin code:=feux[index].EtatSignal; code_to_aspect(code,aspect,combine); - s:='Signal Unisemaf: ad'+IntToSTR(adresse)+'='+chaine_signal(code,adresse); + s:='Signal Unisemaf: ad'+IntToSTR(adresse)+'='+chaine_signal(adresse); if traceSign then affiche(s,clOrange); if Affsignal then afficheDebug(s,clOrange); if AffDetSig then begin - s:='Tick='+IntToSTR(tick)+' Signal '+IntToSTR(adresse)+'='+chaine_signal(feux[index].EtatSignal,adresse); + s:='Tick='+IntToSTR(tick)+' Signal '+IntToSTR(adresse)+'='+chaine_signal(adresse); AfficheDebug(s,clyellow); end; // pour Unisemaf, la cible est définie dans le champ Unisemaf de la structure feux @@ -3725,12 +3813,12 @@ begin code:=feux[i].EtatSignal; code_to_aspect(code,aspect,combine); combine:=code and $fc00; - s:='Signal b_models: ad'+IntToSTR(adresse)+'='+chaine_signal(code,adresse); + s:='Signal b_models: ad'+IntToSTR(adresse)+'='+chaine_signal(adresse); if traceSign then affiche(s,clOrange); if Affsignal then afficheDebug(s,clOrange); if AffDetSig then begin - s:='Tick='+IntToSTR(tick)+' Signal '+IntToSTR(adresse)+'='+chaine_signal(feux[i].EtatSignal,adresse); + s:='Tick='+IntToSTR(tick)+' Signal '+IntToSTR(adresse)+'='+chaine_signal(adresse); AfficheDebug(s,clyellow); end; na:=feux[i].Na; // nombre d'adresses @@ -3844,12 +3932,12 @@ begin begin code:=feux[i].EtatSignal; code_to_aspect(code,aspect,combine); - s:='Signal LDT_NMBS: ad'+IntToSTR(adresse)+'='+chaine_signal(code,adresse); + s:='Signal LDT_NMBS: ad'+IntToSTR(adresse)+'='+chaine_signal(adresse); if traceSign then affiche(s,clOrange); if Affsignal then afficheDebug(s,clOrange); if AffDetSig then begin - s:='Tick='+IntToSTR(tick)+' Signal '+IntToSTR(adresse)+'='+chaine_signal(feux[i].EtatSignal,adresse); + s:='Tick='+IntToSTR(tick)+' Signal '+IntToSTR(adresse)+'='+chaine_signal(adresse); AfficheDebug(s,clyellow); end; if aspect=vert then begin pilote_acc(adresse,2,feu);end; @@ -3879,12 +3967,12 @@ begin begin code:=feux[i].EtatSignal; code_to_aspect(code,aspect,combine); - s:='Signal LDT: ad'+IntToSTR(adresse)+'='+chaine_signal(code,NbDecodeurdeBase+NbreDecPers-1); + s:='Signal LDT: ad'+IntToSTR(adresse)+'='+chaine_signal(NbDecodeurdeBase+NbreDecPers-1); if traceSign then affiche(s,clOrange); if Affsignal then afficheDebug(s,clOrange); if AffDetSig then begin - s:='Tick='+IntToSTR(tick)+' Signal '+IntToSTR(adresse)+'='+chaine_signal(feux[i].EtatSignal,adresse); + s:='Tick='+IntToSTR(tick)+' Signal '+IntToSTR(adresse)+'='+chaine_signal(adresse); AfficheDebug(s,clyellow); end; @@ -3936,7 +4024,7 @@ begin begin code:=feux[i].EtatSignal; code_to_aspect(code,aspect,combine); - s:='Signal virtuel: ad'+IntToSTR(adresse)+'='+chaine_signal(code,adresse); + s:='Signal virtuel: ad'+IntToSTR(adresse)+'='+chaine_signal(adresse); if traceSign then affiche(s,clOrange); if Affsignal then afficheDebug(s,clOrange); end; @@ -4025,12 +4113,12 @@ begin code:=feux[i].EtatSignal; nombre:=feux[i].Na; // nombre d'adresses occupées par le signal code_to_aspect(code,aspect,combine); - s:='Signal digikeijs 4018: ad'+IntToSTR(adresse)+'='+chaine_signal(code,adresse); + s:='Signal digikeijs 4018: ad'+IntToSTR(adresse)+'='+chaine_signal(adresse); if traceSign then affiche(s,clOrange); if Affsignal then afficheDebug(s,clOrange); if AffDetSig then begin - s:='Tick='+IntToSTR(tick)+' Signal '+IntToSTR(adresse)+'='+chaine_signal(feux[i].EtatSignal,adresse); + s:='Tick='+IntToSTR(tick)+' Signal '+IntToSTR(adresse)+'='+chaine_signal(adresse); AfficheDebug(s,clyellow); end; @@ -4083,12 +4171,12 @@ begin begin code:=feux[i].EtatSignal; code_to_aspect(code,aspect,combine); - s:='Signal Bahn: ad'+IntToSTR(adresse)+'='+chaine_signal(code,adresse); + s:='Signal Bahn: ad'+IntToSTR(adresse)+'='+chaine_signal(adresse); if traceSign then affiche(s,clOrange); if Affsignal or traceListe then afficheDebug(s,clOrange); if AffDetSig then begin - s:='Tick='+IntToSTR(tick)+' Signal '+IntToSTR(adresse)+'='+chaine_signal(feux[i].EtatSignal,adresse); + s:='Tick='+IntToSTR(tick)+' Signal '+IntToSTR(adresse)+'='+chaine_signal(adresse); AfficheDebug(s,clyellow); end; //Affiche(IntToSTR(aspect)+' '+inttoSTR(combine),clOrange); @@ -4143,7 +4231,7 @@ begin d:=feux[i].decodeur; dp:=d-NbDecodeurdeBase+NbreDecPers-1; if dp<0 then exit; - s:='Signal '+decodeur_pers[dp].nom+' : ad'+IntToSTR(adresse)+'='+chaine_signal(etat,adresse); + s:='Signal '+decodeur_pers[dp].nom+' : ad'+IntToSTR(adresse)+'='+chaine_signal(adresse); Affiche(s,clOrange); asp:=feux[i].aspect; @@ -4276,7 +4364,8 @@ end; // pilotage d'un signal, et mise à jour du graphisme du feu dans les 3 fenetres procedure envoi_signal(Adr : integer); -var i,it,j,index_train,adresse,detect,detsuiv,a,b,aspect,x,y,TailleX,TailleY,Orientation,AdrTrain,dec : integer; +var i,it,j,index_train,adresse,detect,detsuiv,a,b,aspect,x,y,TailleX,TailleY,Orientation, + indexTCO,AdrTrain,dec : integer; ImageFeu : TImage; frX,frY : real; s : string; @@ -4378,12 +4467,13 @@ begin // allume les signaux du feu dans le TCO if TCOACtive then begin - for y:=1 to NbreCellY do - for x:=1 to NbreCellX do + indexTCO:=1; + for y:=1 to NbreCellY[indexTCO] do + for x:=1 to NbreCellX[indexTCO] do begin - if TCO[x,y].Bimage=50 then + if TCO[indexTCO,x,y].Bimage=Id_signal then begin - adresse:=TCO[x,y].adresse; // vérifie si le feu existe dans le TCO + adresse:=TCO[IndexTCO,x,y].adresse; // vérifie si le feu existe dans le TCO aspect:=feux[Index_Signal(adresse)].Aspect; case aspect of 2 : ImageFeu:=Formprinc.Image2feux; @@ -4402,11 +4492,11 @@ begin end; TailleY:=ImageFeu.picture.BitMap.Height; // taille du feu d'origine (verticale) TailleX:=ImageFeu.picture.BitMap.Width; - Orientation:=TCO[x,y].FeuOriente; + Orientation:=tco[indextco,x,y].FeuOriente; // réduction variable en fonction de la taille des cellules - calcul_reduction(frx,fry,round(TailleX*LargeurCell/ZoomMax),round(tailleY*HauteurCell/ZoomMax),TailleX,TailleY); + calcul_reduction(frx,fry,round(TailleX*LargeurCell[indexTCO]/ZoomMax),round(tailleY*HauteurCell[indexTCO]/ZoomMax),TailleX,TailleY); // 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,tco[x,y].x,tco[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; @@ -8319,10 +8409,10 @@ begin end; if TCOActive then begin - zone_TCO(det2,det3,0); // désactivation + zone_TCO(1,det2,det3,0); // désactivation // activation - if ModeCouleurCanton=0 then zone_TCO(det3,AdrSuiv,1) - else zone_TCO(det3,AdrSuiv,2); // affichage avec la couleur de index_couleur du train + if ModeCouleurCanton=0 then zone_TCO(1,det3,AdrSuiv,1) + else zone_TCO(1,det3,AdrSuiv,2); // affichage avec la couleur de index_couleur du train end; // mettre à jour si présence signal sur det3 pour le passer au rouge de suite @@ -8519,8 +8609,8 @@ begin if TCOActive then begin // activation - if ModeCouleurCanton=0 then zone_TCO(det3,AdrSuiv,1) - else zone_TCO(det3,adrSuiv,2); // affichage avec la couleur de index_couleur du train + if ModeCouleurCanton=0 then zone_TCO(1,det3,AdrSuiv,1) + else zone_TCO(1,det3,adrSuiv,2); // affichage avec la couleur de index_couleur du train end; exit; // sortir absolument end @@ -8581,8 +8671,8 @@ begin if TCOActive then begin // activation - if ModeCouleurCanton=0 then zone_TCO(det1,det3,1) - else zone_TCO(det1,det3,2); // affichage avec la couleur de index_couleur du train + if ModeCouleurCanton=0 then zone_TCO(1,det1,det3,1) + else zone_TCO(1,det1,det3,2); // affichage avec la couleur de index_couleur du train end; end; end; @@ -8765,10 +8855,10 @@ begin end; if TCOActive then begin - zone_TCO(det2,det3,0); // désactivation + zone_TCO(1,det2,det3,0); // désactivation // activation - if ModeCouleurCanton=0 then zone_TCO(det3,AdrSuiv,1) - else zone_TCO(det3,AdrSuiv,2); // affichage avec la couleur de index_couleur du train + if ModeCouleurCanton=0 then zone_TCO(1,det3,AdrSuiv,1) + else zone_TCO(1,det3,AdrSuiv,2); // affichage avec la couleur de index_couleur du train end; // mettre à jour si présence signal sur det3 pour le passer au rouge de suite @@ -8883,10 +8973,10 @@ begin if AffAigDet then AfficheDebug(s,couleur); if TCOActive then begin - zone_TCO(det1,det2,0); // désactivation + zone_TCO(1,det1,det2,0); // désactivation // activation - if ModeCouleurCanton=0 then zone_TCO(det2,det3,1) - else zone_TCO(det2,det3,2); // affichage avec la couleur de index_couleur du train + if ModeCouleurCanton=0 then zone_TCO(1,det2,det3,1) + else zone_TCO(1,det2,det3,2); // affichage avec la couleur de index_couleur du train end; exit; // sortir absolument end @@ -9199,8 +9289,8 @@ begin if TCOActive then begin // activation - if ModeCouleurCanton=0 then zone_TCO(det3,AdrSuiv,1) - else zone_TCO(det3,adrSuiv,2); // affichage avec la couleur de index_couleur du train + if ModeCouleurCanton=0 then zone_TCO(1,det3,AdrSuiv,1) + else zone_TCO(1,det3,adrSuiv,2); // affichage avec la couleur de index_couleur du train end; exit; // sortir absolument end @@ -9261,8 +9351,8 @@ begin if TCOActive then begin // activation - if ModeCouleurCanton=0 then zone_TCO(det1,det3,1) - else zone_TCO(det1,det3,2); // affichage avec la couleur de index_couleur du train + if ModeCouleurCanton=0 then zone_TCO(1,det1,det3,1) + else zone_TCO(1,det1,det3,2); // affichage avec la couleur de index_couleur du train end; end; end; @@ -9430,10 +9520,10 @@ begin end; if TCOActive then begin - zone_TCO(det2,det3,0); // désactivation + zone_TCO(1,det2,det3,0); // désactivation // activation - if ModeCouleurCanton=0 then zone_TCO(det3,AdrSuiv,1) - else zone_TCO(det3,AdrSuiv,2); // affichage avec la couleur de index_couleur du train + if ModeCouleurCanton=0 then zone_TCO(1,det3,AdrSuiv,1) + else zone_TCO(1,det3,AdrSuiv,2); // affichage avec la couleur de index_couleur du train end; // mettre à jour si présence signal sur det3 pour le passer au rouge de suite @@ -9561,10 +9651,10 @@ begin if AffAigDet then AfficheDebug(s,couleur); if TCOActive then begin - zone_TCO(det1,det2,0); // désactivation + zone_TCO(1,det1,det2,0); // désactivation // activation - if ModeCouleurCanton=0 then zone_TCO(det2,det3,1) - else zone_TCO(det2,det3,2); // affichage avec la couleur de index_couleur du train + if ModeCouleurCanton=0 then zone_TCO(1,det2,det3,1) + else zone_TCO(1,det2,det3,2); // affichage avec la couleur de index_couleur du train end; exit; // sortir absolument end @@ -10201,7 +10291,7 @@ begin // Mettre à jour le TCO if TcoActive then begin - formTCO.Maj_TCO(Adresse); + Maj_TCO(1,Adresse); end; end; @@ -10262,7 +10352,8 @@ begin event_det_tick[N_event_tick].etat:=pos; // Mettre à jour le TCO - if TCOActive then formTCO.Maj_TCO(Adresse); + if TCOActive then + for i:=1 to NbreTCO do Maj_TCO(i,Adresse); // l'évaluation des routes est à faire selon conditions if faire_event and not(confignulle) then begin evalue;evalue;end; @@ -11649,7 +11740,7 @@ end; // supprime les events, les trains etc Procedure Raz_tout; -var i,j : integer; +var i,j,index : integer; begin N_Event_tick:=0; N_event_det:=0; @@ -11716,9 +11807,14 @@ begin Tablo_Pn[i].compteur:=0; end; - for i:=1 to NbreCellx do - for j:=1 to NbreCelly do tco[i,j].mode:=0; - if TCOActive then affiche_TCO; + for index:=1 to NbreTCO do + begin + for i:=1 to NbreCellx[index] do + for j:=1 to NbreCelly[index] do + tco[index,i,j].mode:=0; + + if TCOActive then affiche_TCO(index); + end; { ralentit au démarrage for i:=1 to NbreFeux do @@ -11905,10 +12001,10 @@ end; // démarrage principal du programme signaux_complexes procedure TFormPrinc.FormCreate(Sender: TObject); -var i : integer; +var i,j,index : integer; s : string; begin - AF:='Client TCP-IP CDM Rail ou USB - système XpressNet DCC++ Version '+Version+sousVersion; + AF:='Client TCP-IP CDM Rail ou USB - système XpressNet DCC++ Version '+Version+sousVersion+' beta test'; Caption:=AF; TraceSign:=True; configPrete:=false; // form config prete @@ -11918,6 +12014,7 @@ begin ntrains_cdm:=0; protocole:=1; filtrageDet0:=3; + cdmHd:=0; // services commIP CDM par défaut Srvc_Aig:=true; @@ -11927,7 +12024,7 @@ begin Srvc_sig:=false; DebugAffiche:=false; - formConfCellTCOAff:=false; + ConfCellTCO:=false; confasauver:=false; config_modifie:=false; chaine_recue:=''; @@ -11945,8 +12042,8 @@ begin ScrollBox1.Left:=633; procetape(''); //0 - + NbreTCO:=1; N_Trains:=0; NivDebug:=0; ncrois:=0; @@ -11991,12 +12088,12 @@ begin end; // version d'OS pour info application.ProcessMessages; - + if OsBits=64 then s:='OS 64 Bits' else s:='OS 32 Bits'; s:=DateToStr(date)+' '+TimeToStr(Time)+' '+s; Affiche(s,clLime); LabelEtat.Caption:='Initialisations en cours'; - + With ScrollBox1 do begin HorzScrollBar.Tracking:=true; @@ -12087,7 +12184,7 @@ begin FenRich.Height:=Height-150; ScrollBox1.Height:=Height-280; StaticText.AutoSize:=true; - StaticText.Top:=panel2.Height+Panel2.Top+10; + StaticText.Top:=panel2.Height+Panel2.Top+6; //---------------------------------------- ferme:=false; @@ -12118,10 +12215,15 @@ begin procetape('Lecture de la configuration'); lit_config; + Menu_tco(NbreTCO); procetape('Lecture du TCO'); - lire_fichier_tco; - verif_coherence; + for i:=1 to NbreTCO do + begin + EcranTCO[i]:=1; + lire_fichier_tco(i); + end; + verif_coherence; procetape('La configuration a été lue'); if protocole=1 then @@ -12151,16 +12253,49 @@ begin if debug=1 then Affiche('Création TCO',clLime); // il faut afficher la fenetre TCO pour l'init aiguillage sinon violation + + for i:=0 to Screen.MonitorCount-1 do begin - //créée la fenêtre TCO non modale - FormTCO:=TformTCO.Create(nil); + //Affiche('Ecran '+intToSTR(i),clyellow); + ecran[i+1].x0:=Screen.Monitors[i].BoundsRect.Left; + ecran[i+1].y0:=Screen.Monitors[i].BoundsRect.Top; + ecran[i+1].larg:=Screen.Monitors[i].BoundsRect.right-Screen.Monitors[i].BoundsRect.left; + ecran[i+1].Haut:=Screen.Monitors[i].BoundsRect.bottom-Screen.Monitors[i].BoundsRect.top; + + { Affiche('left='+intToSTR(Screen.Monitors[i].BoundsRect.left)+' top='+intToSTR(Screen.Monitors[i].BoundsRect.Top)+' '+ + 'right='+intToSTR(Screen.Monitors[i].BoundsRect.right)+' bottom='+intToSTR(Screen.Monitors[i].BoundsRect.bottom),clLime); + + Affiche(intToSTR(ecran[i+1].x0)+' '+intToSTR(ecran[i+1].y0)+' '+ + intToSTR(ecran[i+1].larg)+' '+intToSTR(ecran[i+1].haut),clyellow); } + end; + + for index:=1 to nbreTCO do + //for j:=1 to 2 do + begin + begin + IndexTCOCreate:=index; + formTCO[index]:=TformTCO.Create(self); + formTCO[index].Name:='FormTCO'+intToSTR(index); + formTCO[index].Caption:='TCO'+intToSTR(index); + end; + i:=0; repeat + sleep(100); application.processmessages; inc(i); until (TcoCree) or (i>20); + TcoCree:=false; Application.processmessages; - if avecTCO then FormTCO.show; // créer fiche dynamique (projet/fichier) + if avecTCO then + begin + //if NbreTCO=1 then FormTCO.show // créer fiche dynamique (projet/fichier) + //else + begin + Affiche_Fenetre_TCO(index); + end; + end; + //tcocree:=true; end; if debug=1 then Affiche('Initialisations',clLime); @@ -12244,6 +12379,8 @@ begin //Menu_interface(valide); end; + + //DoubleBuffered:=true; { aiguillage[index_aig(1)].position:=const_droit; @@ -12301,7 +12438,9 @@ begin ReadOnly:=true; end; } //Affiche(GetMACAddress,clred); + ConfCellTCO:=false; if debug=1 then Affiche('Fini',clLime); + end; @@ -12323,7 +12462,7 @@ begin comEventFrame : Affiche('Erreur trame',clOrange); // Erreur de trame comEventOverrun : Affiche('Données perdues',clOrange); // Des données ont été perdues comEventRxOver : Affiche('Tampon Rx saturé',clOrange); // Tampon de réception saturé - comEventRxParity : Affiche('Erreur parité',clOrange); //Erreur de parité + comEventRxParity : Affiche('111Erreur parité',clOrange); //Erreur de parité comEventTxFull : Affiche('Tampon Tx saturé',clOrange); //Tampon d’envoi saturé comEventDCB : Affiche('Erreur DCB',clOrange); //Erreur de réception DCB (jamais vu) @@ -12370,10 +12509,10 @@ begin timer1.Enabled:=false; if TCO_modifie then begin - res:=MessageDlg('Le TCO a été modifié. Voulez-vous le sauvegarder ?',mtConfirmation,[mbYes,mbNo,mbCancel],0); - if res=mrYes then sauve_fichier_tco; + res:=MessageDlg('Un des TCO a été modifié. Voulez-vous les sauvegarder ?',mtConfirmation,[mbYes,mbNo,mbCancel],0); + if res=mrYes then sauve_fichiers_tco; if res=mrCancel then abort; - end; + end; if config_modifie then begin res:=MessageDlg('La configuration a été modifiée. Voulez-vous la sauvegarder ?',mtConfirmation,[mbYes,mbNo,mbCancel],0); @@ -12381,19 +12520,24 @@ begin if res=mrCancel then abort; end; if confasauver then sauve_config; - if sauve_tco then sauve_fichier_tco; + if sauve_tco then sauve_fichiers_tco; Application.ProcessMessages; end; // timer à 100 ms procedure TFormPrinc.Timer1Timer(Sender: TObject); -var aspect,i,a,x,y,Bimage,combine,adresse,TailleX,TailleY,orientation : integer; +var aspect,i,a,x,y,Bimage,combine,adresse,TailleX,TailleY,orientation,indexTCO : integer; imageFeu : Timage; frx,fry : real; faire : boolean; s : string; begin inc(tick); + if (tick=30) or (tick=100) then + begin + // raz du flag "fenetre confcellTCO affichée" + ConfCellTCO:=false; + end; // envoi timeout if parSocketLenz and (AntiTimeoutEthLenz=1) then begin @@ -12431,9 +12575,9 @@ begin begin // signal belge if TestBit(a,clignote) or feux[i].contrevoie then - begin - Dessine_feu_mx(Feux[i].Img.Canvas,0,0,1,1,adresse,1); - end; + begin + Dessine_feu_mx(Feux[i].Img.Canvas,0,0,1,1,adresse,1); + end; end else begin @@ -12441,54 +12585,59 @@ begin if TestBit(a,jaune_cli) or TestBit(a,ral_60) or TestBit(a,rappel_60) or testBit(a,semaphore_cli) or testBit(a,vert_cli) or testbit(a,blanc_cli) then - Dessine_feu_mx(Feux[i].Img.Canvas,0,0,1,1,adresse,1); - //Affiche('Clignote feu '+IntToSTR(adresse),clyellow); + begin + Dessine_feu_mx(Feux[i].Img.Canvas,0,0,1,1,adresse,1); + //Affiche('Clignote feu '+IntToSTR(adresse),clyellow); + end; end; end; // signaux du TCO----------------------------------------------- if TCOActive then // évite d'accéder à la variable FormTCO si elle est pas encore ouverte begin - // parcourir les feux du TCO - for y:=1 to NbreCellY do - for x:=1 to NbreCellX do + for IndexTCO:=1 to NbreTCO do begin - PcanvasTCO.pen.mode:=pmCOpy; - BImage:=TCO[x,y].bImage; - if Bimage=50 then + // parcourir les feux du TCO + for y:=1 to NbreCellY[indexTCO] do + for x:=1 to NbreCellX[indexTCO] do begin - adresse:=TCO[x,y].adresse; - i:=Index_Signal(adresse); - a:=feux[i].EtatSignal; // a = état binaire du feu - faire:=false; - if feux[i].aspect<>20 then - faire:=TestBit(a,jaune_cli) or TestBit(a,ral_60) or - TestBit(a,rappel_60) or testBit(a,semaphore_cli) or - testBit(a,vert_cli) or testbit(a,blanc_cli) - else + PcanvasTCO[IndexTCO].pen.mode:=pmCOpy; + BImage:=TCO[indexTCO,x,y].bImage; + if Bimage=Id_signal then begin - combine:=a and $fc00; - faire:=testBit(combine,clignote); - end; - if faire then - begin - aspect:=feux[Index_Signal(adresse)].Aspect; - case aspect of - 2 : ImageFeu:=Formprinc.Image2feux; - 3 : ImageFeu:=Formprinc.Image3feux; - 4 : ImageFeu:=Formprinc.Image4feux; - 5 : ImageFeu:=Formprinc.Image5feux; - 7 : ImageFeu:=Formprinc.Image7feux; - 9 : ImageFeu:=Formprinc.Image9feux; - else ImageFeu:=Formprinc.Image3feux; + adresse:=TCO[indexTCO,x,y].adresse; + i:=Index_Signal(adresse); + a:=feux[i].EtatSignal; // a = état binaire du feu + faire:=false; + if feux[i].aspect<>20 then + faire:=TestBit(a,jaune_cli) or TestBit(a,ral_60) or + TestBit(a,rappel_60) or testBit(a,semaphore_cli) or + testBit(a,vert_cli) or testbit(a,blanc_cli) + else + begin + combine:=a and $fc00; + faire:=testBit(combine,clignote); end; + if faire then + begin + aspect:=feux[Index_Signal(adresse)].Aspect; + case aspect of + 2 : ImageFeu:=Formprinc.Image2feux; + 3 : ImageFeu:=Formprinc.Image3feux; + 4 : ImageFeu:=Formprinc.Image4feux; + 5 : ImageFeu:=Formprinc.Image5feux; + 7 : ImageFeu:=Formprinc.Image7feux; + 9 : ImageFeu:=Formprinc.Image9feux; + else ImageFeu:=Formprinc.Image3feux; + end; - TailleY:=ImageFeu.picture.BitMap.Height; // taille du feu d'origine (verticale) - TailleX:=ImageFeu.picture.BitMap.Width; - Orientation:=TCO[x,y].FeuOriente; - // réduction variable en fonction de la taille des cellules - calcul_reduction(frx,fry,round(TailleX*LargeurCell/ZoomMax),round(tailleY*HauteurCell/ZoomMax),TailleX,TailleY); - Dessine_feu_mx(PCanvasTCO,tco[x,y].x,tco[x,y].y,frx,fry,adresse,orientation); + TailleY:=ImageFeu.picture.BitMap.Height; // taille du feu d'origine (verticale) + TailleX:=ImageFeu.picture.BitMap.Width; + Orientation:=TCO[indexTCO,x,y].FeuOriente; + // 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); + Dessine_feu_mx(PCanvasTCO[indexTCO],tco[indexTCO,x,y].x,tco[indexTCO,x,y].y,frx,fry,adresse,orientation); + end; end; end; end; @@ -12503,7 +12652,10 @@ begin if TestBit(a,jaune_cli) or TestBit(a,ral_60) or TestBit(a,rappel_60) or testBit(a,semaphore_cli) or testBit(a,vert_cli) or testbit(a,blanc_cli) then - Dessine_feu_pilote; // dessiner le feu en fonction du bit "clignotant" + begin + //if clignotant then affiche('1',clyellow) else affiche('0',clwhite); + Dessine_feu_pilote; // dessiner le feu en fonction du bit "clignotant" + end; end else begin @@ -14027,7 +14179,7 @@ begin Affiche('Lecture CV',clyellow); val(EditCV.Text,cv,erreur); - if (erreur<>0) or (cv>255) or (cv<0) then + if (erreur<>0) or (cv>255) or (cv<0) then begin EditCV.Text:='1'; exit; @@ -14229,10 +14381,14 @@ begin end; procedure TFormPrinc.ButtonAffTCOClick(Sender: TObject); +var i : integer; begin - formTCO.windowState:=wsNormal; //Maximized; - formTCO.show; - formTCO.BringToFront; + for i:=1 to NbreTCO do + begin + formTCO[i].windowState:=wsNormal; //Maximized; + formTCO[i].show; + formTCO[i].BringToFront; + end; end; procedure TFormPrinc.ButtonLanceCDMClick(Sender: TObject); @@ -14293,7 +14449,7 @@ begin Adr:=Feux[i].Adresse; Etat:=Feux[i].EtatSignal; s:='Signal '+IntToSTR(Adr)+' Etat='; - s:=s+chaine_signal(etat,adr); + s:=s+chaine_signal(adr); Affiche(s,clYellow); end; end; @@ -14444,12 +14600,12 @@ begin if n=20 then nation:=2 else nation:=1; code:=feux[i].EtatSignal; code_to_aspect(code,aspect,combine); - s:='Signal ad'+IntToSTR(adresse)+'='+chaine_signal(code,adresse); + s:='Signal ad'+IntToSTR(adresse)+'='+chaine_signal(adresse); Affiche(s,clYellow); //Affiche(IntToSTR(aspect),clred); //Affiche(IntToSTR(combine),clred); - s:='Le signal '+intToSTR(adresse)+' présente '+chaine_signal(code,adresse)+' car '; + s:='Le signal '+intToSTR(adresse)+' présente '+chaine_signal(adresse)+' car '; // carré if (aspect=carre) and (nation=1) then begin @@ -14491,7 +14647,7 @@ begin if ((aspect=jaune) and (n<>20)) or ((aspect=deux_jaunes) and (n=20)) then begin i:=etat_signal_suivant(Adresse,1,AdrSignalsuivant); - Affiche(s+'son signal suivant '+intToSTR(AdrSignalsuivant)+' est au '+chaine_signal(i,AdrSignalsuivant),clyellow); + Affiche(s+'son signal suivant '+intToSTR(AdrSignalsuivant)+' est au '+chaine_signal(AdrSignalsuivant),clyellow); end; // avertissement cli @@ -14499,20 +14655,20 @@ begin begin i:=etat_signal_suivant(Adresse,1,AdrSignalsuivant); index:=Index_Signal(AdrSignalSuivant); - Affiche(s+'son signal suivant '+intToSTR(AdrSignalsuivant)+' est au '+chaine_signal(i,adresse),clyellow); + Affiche(s+'son signal suivant '+intToSTR(AdrSignalsuivant)+' est au '+chaine_signal(adresse),clyellow); end; // ralen 30 if (combine=10) and (nation=1) then begin i:=etat_signal_suivant(Adresse,1,AdrSignalsuivant); index:=Index_Signal(AdrSignalSuivant); - Affiche(s+'son signal suivant '+intToSTR(AdrSignalsuivant)+' est au '+chaine_signal(i,adresse),clyellow); + Affiche(s+'son signal suivant '+intToSTR(AdrSignalsuivant)+' est au '+chaine_signal(adresse),clyellow); end; if (combine=11) and (nation=1) then begin i:=etat_signal_suivant(Adresse,1,AdrSignalsuivant); index:=Index_Signal(AdrSignalSuivant); - Affiche(s+'son signal suivant '+intToSTR(AdrSignalsuivant)+' est au '+chaine_signal(i,adresse),clyellow); + Affiche(s+'son signal suivant '+intToSTR(AdrSignalsuivant)+' est au '+chaine_signal(adresse),clyellow); end; if ((combine=rappel_30) or (combine=rappel_60)) and (nation=1) then begin @@ -14986,5 +15142,753 @@ begin end; - end. + procedure TFormPrinc.AffichertouslesTCO1Click(Sender: TObject); +var i : integer; +begin + for i:=1 to NbreTCO do + begin + formTCO[i].windowState:=wsNormal; //Maximized; + formTCO[i].show; + formTCO[i].BringToFront; + end; +end; + +procedure mosaiqueH; +var NombreEcrans,e,i,largEcran,hautEcran,topEcran,LeftEcran,LargTCO,HautTCO : integer; + nbTCOE : array[1..10] of integer; // nombre de TCO par écran + CeTCO : array[1..10] of integer; // nombre de TCO en cours d'affchage par écran +begin + for i:=1 to 10 do begin nbTCOE[i]:=0;CeTCO[i]:=0;end; + for i:=1 to NbreTCO do + begin + e:=ECranTCO[i]; // écran du tco i + if (e>=1) and (e<=10) then inc(nbTCOE[e]); //nbTCOE[2]=3 signifie que l'écran 2 contient 3 TCO + end; + + NombreEcrans:=Screen.MonitorCount; + if NombreEcrans=1 then NbTCOE[1]:=NbreTCO; + + for i:=1 to NbreTCO do + begin + + HautTCO:=HautEcran; + for e:=1 to NombreEcrans do + begin + + if (ecranTCO[i]=e) or (NombreEcrans=1) then // si l'écran TCO doit aller sur e + begin + with formtco[i] do + begin + windowState:=wsNormal; + show; + BringToFront; + end; + + inc(CeTCO[e]); + largEcran:=ecran[e].larg; + hautEcran:=ecran[e].haut; + TopEcran:=ecran[e].y0; + LeftEcran:=ecran[e].x0; + largTCO:=largEcran ; + HautTCO:=HautEcran div NbTCOE[e];; + + with formtco[i] do + begin + Top:=((CeTCO[e]-1)*HautTCO)+Topecran; + Left:=leftECran; + width:=largTCO+8; + height:=HautTCO; + windowState:=wsNormal; + show; + BringToFront; + end; + end; + end; + end; +end; + +procedure TFormPrinc.Mosaquehorizontale1Click(Sender: TObject); +begin + mosaiqueH; +end; + +procedure TFormPrinc.Mosaqueverticale1Click(Sender: TObject); +var e,topEcran,LeftEcran,i,largEcran,hautEcran,LargTCO,HautTCO,NombreEcrans : integer; + nbTCOE : array[1..10] of integer; // nombre de TCO par écran + CeTCO : array[1..10] of integer; // nombre de TCO en cours d'affchage par écran +begin + for i:=1 to 10 do begin nbTCOE[i]:=0;CeTCO[i]:=0;end; + for i:=1 to NbreTCO do + begin + e:=ECranTCO[i]; // écran du tco i + if (e>=1) and (e<=10) then inc(nbTCOE[e]); //nbTCOE[2]=3 signifie que l'écran 2 contient 3 TCO + end; + + NombreEcrans:=Screen.MonitorCount; + if NombreEcrans=1 then NbTCOE[1]:=NbreTCO; + + for i:=1 to NbreTCO do + begin + + HautTCO:=HautEcran; + for e:=1 to NombreEcrans do + begin + + if (ecranTCO[i]=e) or (NombreEcrans=1) then // si l'écran TCO doit aller sur e + begin + inc(CeTCO[e]); + largEcran:=ecran[e].larg; + hautEcran:=ecran[e].haut; + TopEcran:=ecran[e].y0; + LeftEcran:=ecran[e].x0; + largTCO:=largEcran div NbTCOE[e]; + HautTCO:=HautEcran; + + with formtco[i] do + begin + windowState:=wsNormal; + Top:=Topecran; + Left:=((CeTCO[e]-1)*largTCO)+leftECran; + width:=largTCO+8; + height:=HautTCO; + show; + BringToFront; + end; + end; + end; + end; +end; + +procedure TFormPrinc.Mosaiquecarre1Click(Sender: TObject); +var topEcran,LeftEcran,i,largEcran,hautEcran,LargTCO,HautTCO : integer; +begin + largEcran:=Screen.WorkAreaWidth; + hautEcran:=Screen.WorkAreaHeight; + TopEcran:=screen.WorkAreaTop; + LeftEcran:=screen.WorkAreaLeft; + + case NbreTCO of + 1 : begin + formTCO[1].windowState:=wsNormal; + formTCO[1].show; + formTCO[1].BringToFront; + end; + 2 : mosaiqueH; + 3 : begin + HautTCO:=HautEcran div 2; + with formtco[1] do + begin + Top:=Topecran; Left:=0; + width:=largEcran+8; height:=HautTCO; + windowState:=wsNormal; + show; + BringToFront; + end; + largTCO:=largEcran div 2; + + with formtco[2] do + begin + Top:=Topecran+HautTCO; Left:=0; + width:=largTCO+8; height:=HautTCO; + windowState:=wsNormal; + show; + BringToFront; + end; + with formtco[3] do + begin + Top:=Topecran+HautTCO; Left:=largTCO; + width:=largTCO+8; height:=HautTCO; + windowState:=wsNormal; + show; + BringToFront; + end; + end; + 4 : begin + HautTCO:=HautEcran div 2; + largTCO:=largEcran div 2; + for i:=1 to 4 do + begin + with formtco[i] do + begin + Top:=Topecran+((i-1) div 2)*HautTCO; Left:=((i-1) mod 2)*LargTCO; + width:=largTCO+8; height:=HautTCO+8; + windowState:=wsNormal; + show; + BringToFront; + end; + end; + end; + + 5 : begin + HautTCO:=HautEcran div 3; + largTCO:=largEcran div 2; + with formtco[1] do + begin + Top:=Topecran; Left:=0; + width:=largEcran+8; height:=HautTCO; + windowState:=wsNormal; + show; + BringToFront; + end; + for i:=2 to 5 do + begin + with formtco[i] do + begin + Top:=Topecran+HautTCO+((i-2) div 2)*HautTCO; Left:=((i-2) mod 2)*LargTCO; + width:=largTCO+8; height:=HautTCO+8; + windowState:=wsNormal; + show; + BringToFront; + end; + end; + end; + + 6 : begin + HautTCO:=HautEcran div 3; + largTCO:=largEcran div 2; + for i:=1 to 6 do + begin + with formtco[i] do + begin + Top:=Topecran+((i-1) div 2)*HautTCO; Left:=((i-1) mod 2)*LargTCO; + width:=largTCO+8; height:=HautTCO+8; + windowState:=wsNormal; + show; + BringToFront; + end; + end; + end; + + 7 : begin + HautTCO:=HautEcran div 4; + largTCO:=largEcran div 2; + with formtco[1] do + begin + Top:=Topecran; Left:=0; + width:=largEcran+8; height:=HautTCO; + windowState:=wsNormal; + show; + BringToFront; + end; + for i:=2 to 7 do + begin + with formtco[i] do + begin + Top:=Topecran+HautTCO+((i-2) div 2)*HautTCO; Left:=((i-2) mod 2)*LargTCO; + width:=largTCO+8; height:=HautTCO+8; + windowState:=wsNormal; + show; + BringToFront; + end; + end; + end; + + 8 : begin + HautTCO:=HautEcran div 3; + largTCO:=largEcran div 2; + with formtco[1] do + begin + Top:=Topecran; Left:=0; + width:=largTCO+8; height:=HautTCO; + windowState:=wsNormal; + show; + BringToFront; + end; + with formtco[2] do + begin + Top:=Topecran; Left:=largTCO; + width:=largTCO+8; height:=HautTCO; + windowState:=wsNormal; + show; + BringToFront; + end; + largTCO:=largEcran div 3; + for i:=3 to 8 do + begin + with formtco[i] do + begin + Top:=Topecran+HautTCO+((i-3) div 3)*HautTCO; Left:=((i-3) mod 3)*LargTCO; + width:=largTCO+8; height:=HautTCO+8; + windowState:=wsNormal; + show; + BringToFront; + end; + end; + end; + + 9 : begin + HautTCO:=HautEcran div 3; + largTCO:=largEcran div 3; + for i:=1 to 9 do + begin + with formtco[i] do + begin + Top:=Topecran+((i-1) div 3)*HautTCO; Left:=((i-1) mod 3)*LargTCO; + width:=largTCO+8; height:=HautTCO+8; + windowState:=wsNormal; + show; + BringToFront; + end; + end; + end; + end; +end; + +procedure Affiche_Fenetre_TCO(i : integer); +var e : integer; +begin + if i>NbreTCO then exit; + + formTCO[i].show; + formTCO[i].BringToFront; + e:=ecranTCO[i]; + if e>Screen.MonitorCount then exit; + formTCO[i].Left:=Ecran[e].x0; + formTCO[i].Top:=Ecran[e].y0; + formTCO[i].windowState:=wsMaximized; +end; + +procedure TFormPrinc.AfficherTCO11Click(Sender: TObject); +begin + Affiche_Fenetre_TCO(1); +end; + +procedure TFormPrinc.AfficherTCO21Click(Sender: TObject); +begin + Affiche_Fenetre_TCO(2); +end; + +procedure TFormPrinc.AfficherTCO31Click(Sender: TObject); +begin + Affiche_Fenetre_TCO(3); +end; + +procedure TFormPrinc.AfficherTCO41Click(Sender: TObject); +begin + Affiche_Fenetre_TCO(4); +end; + +procedure TFormPrinc.AfficherTCO51Click(Sender: TObject); +begin + Affiche_Fenetre_TCO(5); +end; + +procedure TFormPrinc.AfficherTCO61Click(Sender: TObject); +begin + Affiche_Fenetre_TCO(6); +end; + +procedure TFormPrinc.AfficherTCO71Click(Sender: TObject); +begin + Affiche_Fenetre_TCO(7); +end; + +procedure TFormPrinc.AfficherTCO81Click(Sender: TObject); +begin + Affiche_Fenetre_TCO(8); +end; + +procedure TFormPrinc.AfficherTCO91Click(Sender: TObject); +begin + Affiche_Fenetre_TCO(9); +end; + +procedure TFormPrinc.AfficherTCO101Click(Sender: TObject); +begin + Affiche_Fenetre_TCO(10); +end; + +// mise à jour des menus TCO +Procedure Menu_tco(i : integer); +begin + with formprinc do + begin + if i=0 then + begin + AfficherTCO11.Enabled:=false; + AfficherTCO21.Enabled:=false; + AfficherTCO31.Enabled:=false; + AfficherTCO41.Enabled:=false; + AfficherTCO51.Enabled:=false; + AfficherTCO61.Enabled:=false; + AfficherTCO71.Enabled:=false; + AfficherTCO81.Enabled:=false; + AfficherTCO91.Enabled:=false; + AfficherTCO101.Enabled:=false; + CO11.Enabled:=false; + CO21.Enabled:=false; + CO31.Enabled:=false; + CO41.Enabled:=false; + CO51.Enabled:=false; + end; + if i=1 then + begin + AfficherTCO11.Enabled:=true; + AfficherTCO21.Enabled:=false; + AfficherTCO31.Enabled:=false; + AfficherTCO41.Enabled:=false; + AfficherTCO51.Enabled:=false; + AfficherTCO61.Enabled:=false; + AfficherTCO71.Enabled:=false; + AfficherTCO81.Enabled:=false; + AfficherTCO91.Enabled:=false; + AfficherTCO101.Enabled:=false; + CO11.Enabled:=true; + CO21.Enabled:=false; + CO31.Enabled:=false; + CO41.Enabled:=false; + CO51.Enabled:=false; + CO61.Enabled:=false; + CO71.Enabled:=false; + CO81.Enabled:=false; + CO91.Enabled:=false; + CO101.Enabled:=false; + end; + if i=2 then + begin + AfficherTCO11.Enabled:=true; + AfficherTCO21.Enabled:=true; + AfficherTCO31.Enabled:=false; + AfficherTCO41.Enabled:=false; + AfficherTCO51.Enabled:=false; + AfficherTCO61.Enabled:=false; + AfficherTCO71.Enabled:=false; + AfficherTCO81.Enabled:=false; + AfficherTCO91.Enabled:=false; + AfficherTCO101.Enabled:=false; + CO11.Enabled:=true; + CO21.Enabled:=true; + CO31.Enabled:=false; + CO41.Enabled:=false; + CO51.Enabled:=false; + CO61.Enabled:=false; + CO71.Enabled:=false; + CO81.Enabled:=false; + CO91.Enabled:=false; + CO101.Enabled:=false; + end; + if i=3 then + begin + AfficherTCO11.Enabled:=true; + AfficherTCO21.Enabled:=true; + AfficherTCO31.Enabled:=true; + AfficherTCO41.Enabled:=false; + AfficherTCO51.Enabled:=false; + AfficherTCO61.Enabled:=false; + AfficherTCO71.Enabled:=false; + AfficherTCO81.Enabled:=false; + AfficherTCO91.Enabled:=false; + AfficherTCO101.Enabled:=false; + CO11.Enabled:=true; + CO21.Enabled:=true; + CO31.Enabled:=true; + CO41.Enabled:=false; + CO51.Enabled:=false; + CO61.Enabled:=false; + CO71.Enabled:=false; + CO81.Enabled:=false; + CO91.Enabled:=false; + CO101.Enabled:=false; + end; + if i=4 then + begin + AfficherTCO11.Enabled:=true; + AfficherTCO21.Enabled:=true; + AfficherTCO31.Enabled:=true; + AfficherTCO41.Enabled:=true; + AfficherTCO51.Enabled:=false; + AfficherTCO61.Enabled:=false; + AfficherTCO71.Enabled:=false; + AfficherTCO81.Enabled:=false; + AfficherTCO91.Enabled:=false; + AfficherTCO101.Enabled:=false; + CO11.Enabled:=true; + CO21.Enabled:=true; + CO31.Enabled:=true; + CO41.Enabled:=true; + CO51.Enabled:=false; + CO61.Enabled:=false; + CO71.Enabled:=false; + CO81.Enabled:=false; + CO91.Enabled:=false; + CO101.Enabled:=false; + end; + if i=5 then + begin + AfficherTCO11.Enabled:=true; + AfficherTCO21.Enabled:=true; + AfficherTCO31.Enabled:=true; + AfficherTCO41.Enabled:=true; + AfficherTCO51.Enabled:=true; + AfficherTCO61.Enabled:=false; + AfficherTCO71.Enabled:=false; + AfficherTCO81.Enabled:=false; + AfficherTCO91.Enabled:=false; + AfficherTCO101.Enabled:=false; + CO11.Enabled:=true; + CO21.Enabled:=true; + CO31.Enabled:=true; + CO41.Enabled:=true; + CO51.Enabled:=true; + CO61.Enabled:=false; + CO71.Enabled:=false; + CO81.Enabled:=false; + CO91.Enabled:=false; + CO101.Enabled:=false; + end; + if i=6 then + begin + AfficherTCO11.Enabled:=true; + AfficherTCO21.Enabled:=true; + AfficherTCO31.Enabled:=true; + AfficherTCO41.Enabled:=true; + AfficherTCO51.Enabled:=true; + AfficherTCO61.Enabled:=true; + AfficherTCO71.Enabled:=false; + AfficherTCO81.Enabled:=false; + AfficherTCO91.Enabled:=false; + AfficherTCO101.Enabled:=false; + CO11.Enabled:=true; + CO21.Enabled:=true; + CO31.Enabled:=true; + CO41.Enabled:=true; + CO51.Enabled:=true; + CO61.Enabled:=true; + CO71.Enabled:=false; + CO81.Enabled:=false; + CO91.Enabled:=false; + CO101.Enabled:=false; + end; + if i=7 then + begin + AfficherTCO11.Enabled:=true; + AfficherTCO21.Enabled:=true; + AfficherTCO31.Enabled:=true; + AfficherTCO41.Enabled:=true; + AfficherTCO51.Enabled:=true; + AfficherTCO61.Enabled:=true; + AfficherTCO71.Enabled:=true; + AfficherTCO81.Enabled:=false; + AfficherTCO91.Enabled:=false; + AfficherTCO101.Enabled:=false; + CO11.Enabled:=true; + CO21.Enabled:=true; + CO31.Enabled:=true; + CO41.Enabled:=true; + CO51.Enabled:=true; + CO61.Enabled:=true; + CO71.Enabled:=true; + CO81.Enabled:=false; + CO91.Enabled:=false; + CO101.Enabled:=false; + end; + if i=8 then + begin + AfficherTCO11.Enabled:=true; + AfficherTCO21.Enabled:=true; + AfficherTCO31.Enabled:=true; + AfficherTCO41.Enabled:=true; + AfficherTCO51.Enabled:=true; + AfficherTCO61.Enabled:=true; + AfficherTCO71.Enabled:=true; + AfficherTCO81.Enabled:=true; + AfficherTCO91.Enabled:=false; + AfficherTCO101.Enabled:=false; + CO11.Enabled:=true; + CO21.Enabled:=true; + CO31.Enabled:=true; + CO41.Enabled:=true; + CO51.Enabled:=true; + CO61.Enabled:=true; + CO71.Enabled:=true; + CO81.Enabled:=true; + CO91.Enabled:=false; + CO101.Enabled:=false; + end; + if i=9 then + begin + AfficherTCO11.Enabled:=true; + AfficherTCO21.Enabled:=true; + AfficherTCO31.Enabled:=true; + AfficherTCO41.Enabled:=true; + AfficherTCO51.Enabled:=true; + AfficherTCO61.Enabled:=true; + AfficherTCO71.Enabled:=true; + AfficherTCO81.Enabled:=true; + AfficherTCO91.Enabled:=true; + AfficherTCO101.Enabled:=false; + CO11.Enabled:=true; + CO21.Enabled:=true; + CO31.Enabled:=true; + CO41.Enabled:=true; + CO51.Enabled:=true; + CO61.Enabled:=true; + CO71.Enabled:=true; + CO81.Enabled:=true; + CO91.Enabled:=true; + CO101.Enabled:=false; + end; + if i=10 then + begin + AfficherTCO11.Enabled:=true; + AfficherTCO21.Enabled:=true; + AfficherTCO31.Enabled:=true; + AfficherTCO41.Enabled:=true; + AfficherTCO51.Enabled:=true; + AfficherTCO61.Enabled:=true; + AfficherTCO71.Enabled:=true; + AfficherTCO81.Enabled:=true; + AfficherTCO91.Enabled:=true; + AfficherTCO101.Enabled:=true; + CO11.Enabled:=true; + CO21.Enabled:=true; + CO31.Enabled:=true; + CO41.Enabled:=true; + CO51.Enabled:=true; + CO61.Enabled:=true; + CO71.Enabled:=true; + CO81.Enabled:=true; + CO91.Enabled:=true; + CO101.Enabled:=true; + end; + end; +end; + + +procedure TFormPrinc.NouveauTCO1Click(Sender: TObject); +begin + if NbreTCO>=10 then + begin + Affiche('Nombre maximum de TCO atteint',clred); + exit; + end; + + TCOActive:=false; + inc(nbreTCO); + IndexTCOCreate:=nbreTCO; + formTCO[nbreTCO]:=TformTCO.Create(self); + formTCO[nbreTCO].Name:='FormTCO'+intToSTR(nbreTCO); + formTCO[nbreTCO].Caption:='TCO'+intToSTR(nbreTCO); + Forminit[nbreTCO]:=false; + init_TCO(nbreTCO); + menu_tco(NbreTCO); + TCO_modifie:=true; + config_modifie:=true; +end; + +procedure Supprimer_TCO(TcoS : integer); +var i,SauvNbreTCO : integer; + s : string; +begin + if Tcos>NbreTCO then exit; + s:='Voulez-vous supprimer le TCO '+intToSTR(TcoS)+' ('+NomFichierTCO[tcoS]+')'; + if Application.MessageBox(pchar(s),pchar('confirm'), MB_YESNO or MB_DEFBUTTON2 or MB_ICONQUESTION)=idNo then exit; + + SauvNbreTCO:=NbreTCO; // dire au programme Timer qu'il n'y a plus de TCO le temps de supprimer + NbreTCO:=0; + TCOActive:=false; + + Affiche('Suppression du TCO '+intToSTR(Tcos),clOrange); + FormTCO[tcos].close; + FormTCO[tcos].free; // annuler le pointeur et raz les mémoires de la form + + for i:=tCos to SauvNbreTCO-1 do + begin + NomFichierTCO[i]:=NomFichierTCO[i+1]; + + FormTCO[i]:=FormTCO[i+1]; + FormTCO[i].Name:='TCO'+intToSTR(i); // renommer le TCO + TCO[i]:=Tco[i+1]; // déplacer les données + PcanvasTCO[i]:=PcanvasTCO[i+1]; + PBitMapTCO[i]:=PBitMapTCO[i+1]; + PImageTCO[i]:=PImageTCO[i+1]; + PImageTemp[i]:=PImageTemp[i+1]; + frXGlob[i]:=frXGlob[i+1]; + frYGlob[i]:=frYGlob[i+1]; + SelectionAffichee[i]:=SelectionAffichee[i+1]; + forminit[i]:=forminit[i+1]; + modeTrace[i]:=modeTrace[i+1]; + entoure[i]:=entoure[i+1]; + avecGrille[i]:=avecGrille[i+1]; + NbreCellX[i]:=NbreCellX[i+1]; + NbreCellY[i]:=NbreCellY[i+1]; + largeurCelld2[i]:=largeurCelld2[i+1]; + HauteurCelld2[i]:=HauteurCelld2[i+1]; + largeurCell[i]:=largeurCell[i+1]; + HauteurCell[i]:=HauteurCell[i+1]; + EcranTCO[i]:=EcranTCO[i+1]; + Forminit[i]:=false; + + end; + setlength(TCO[SauvNbreTCO],0); + dec(SauvNbreTCO); + Menu_tco(SauvNbreTCO); + config_modifie:=true; + if SauvNbreTCO<>0 then Affiche('La nouvelle liste des noms des fichiers des TCO est la suivante:',ClLime); + + for i:=1 to SauvNbreTCO do + begin + Affiche(IntToSTR(i)+' '+NomFichierTCO[i],clLime); + end; + NbreTCO:=SauvNbreTCO; +end; + +procedure TFormPrinc.CO11Click(Sender: TObject); + begin + Supprimer_TCO(1); +end; + +procedure TFormPrinc.CO21Click(Sender: TObject); +begin + Supprimer_TCO(2); +end; + +procedure TFormPrinc.CO31Click(Sender: TObject); +begin + Supprimer_TCO(3); +end; + +procedure TFormPrinc.CO41Click(Sender: TObject); +begin + Supprimer_TCO(4); +end; + +procedure TFormPrinc.CO51Click(Sender: TObject); +begin + Supprimer_TCO(5); +end; + +procedure TFormPrinc.CO61Click(Sender: TObject); +begin + Supprimer_TCO(6); +end; + +procedure TFormPrinc.CO71Click(Sender: TObject); +begin + Supprimer_TCO(7); +end; + +procedure TFormPrinc.CO81Click(Sender: TObject); +begin + Supprimer_TCO(8); +end; + +procedure TFormPrinc.CO91Click(Sender: TObject); +begin + Supprimer_TCO(9); +end; + +procedure TFormPrinc.CO101Click(Sender: TObject); +begin + Supprimer_TCO(10); +end; + +procedure TFormPrinc.ButtonCDMClick(Sender: TObject); +begin + if cdmHd=0 then exit; + if not(cdmDevant) then ShowWindow(CDMhd,SW_MINIMIZE) else ShowWindow(CDMhd,SW_MAXIMIZE); + cdmDevant:=not(cdmDevant); +end; + +end. diff --git a/UnitTCO.dfm b/UnitTCO.dfm index 3a646f0..d98cf81 100644 --- a/UnitTCO.dfm +++ b/UnitTCO.dfm @@ -1,10 +1,10 @@ object FormTCO: TFormTCO - Left = 82 - Top = 114 - Width = 1142 - Height = 678 + Left = 118 + Top = 115 + Width = 1209 + Height = 580 VertScrollBar.Visible = False - Caption = 'FormTCO' + Caption = 'c' Color = clBtnFace DragMode = dmAutomatic Font.Charset = DEFAULT_CHARSET @@ -22,81 +22,41 @@ object FormTCO: TFormTCO OnKeyPress = FormKeyPress OnMouseWheel = FormMouseWheel DesignSize = ( - 1126 - 640) + 1193 + 542) PixelsPerInch = 96 TextHeight = 13 - object LabelCoord: TLabel - Left = 64 - Top = 0 - Width = 18 - Height = 16 - Caption = '0,0' - Font.Charset = ANSI_CHARSET - Font.Color = clWindowText - Font.Height = -13 - Font.Name = 'Arial' - Font.Style = [fsBold] - ParentFont = False - end - object LabelCellule: TLabel - Left = 8 - Top = 0 - Width = 49 - Height = 16 - Caption = 'Cellule' - Font.Charset = DEFAULT_CHARSET - Font.Color = clWindowText - Font.Height = -13 - Font.Name = 'MS Sans Serif' - Font.Style = [fsBold] - ParentFont = False - end - object SourisX: TLabel - Left = 128 - Top = 2 - Width = 6 - Height = 13 - Caption = '0' - end - object SourisY: TLabel - Left = 168 - Top = 2 - Width = 6 - Height = 13 - Caption = '0' - end object LabelZoom: TLabel - Left = 1078 - Top = 391 + Left = 1164 + Top = 3 Width = 32 Height = 13 - Anchors = [akRight, akBottom] + Anchors = [akTop, akRight] Caption = 'Zoom' Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText - Font.Height = -11 + Font.Height = -12 Font.Name = 'MS Sans Serif' Font.Style = [fsBold] ParentFont = False end object ImageTemp: TImage - Left = 952 - Top = 64 + Left = 731 + Top = 123 Width = 121 Height = 121 end object ImageTemp2: TImage - Left = 952 - Top = 200 + Left = 731 + Top = 252 Width = 121 Height = 121 end object ScrollBox: TScrollBox - Left = 16 - Top = 26 - Width = 828 - Height = 351 + Left = 10 + Top = 15 + Width = 943 + Height = 330 HorzScrollBar.Smooth = True HorzScrollBar.Tracking = True VertScrollBar.Smooth = True @@ -107,13 +67,13 @@ object FormTCO: TFormTCO ParentColor = False TabOrder = 1 DesignSize = ( - 824 - 347) + 939 + 326) object ImageTCO: TImage Left = 48 - Top = 32 - Width = 716 - Height = 305 + Top = 25 + Width = 642 + Height = 143 Anchors = [akLeft, akTop, akRight, akBottom] AutoSize = True ParentShowHint = False @@ -127,11 +87,11 @@ object FormTCO: TFormTCO end end object TrackBarZoom: TTrackBar - Left = 1078 + Left = 1154 Top = 18 Width = 41 - Height = 350 - Anchors = [akTop, akRight, akBottom] + Height = 311 + Anchors = [akTop, akRight] Ctl3D = True Max = 50 Min = 20 @@ -144,10 +104,10 @@ object FormTCO: TFormTCO OnChange = TrackBarZoomChange end object Panel1: TPanel - Left = 8 - Top = 464 - Width = 1124 - Height = 173 + Left = 2 + Top = 360 + Width = 1085 + Height = 185 Anchors = [akLeft, akRight, akBottom] Color = clActiveBorder Font.Charset = ANSI_CHARSET @@ -159,8 +119,8 @@ object FormTCO: TFormTCO TabOrder = 2 OnDragOver = Panel1DragOver DesignSize = ( - 1124 - 173) + 1085 + 185) object Label1: TLabel Left = 216 Top = 22 @@ -909,15 +869,40 @@ object FormTCO: TFormTCO end object ImagePalette34: TImage Left = 232 - Top = 136 + Top = 144 Width = 33 Height = 33 OnDragOver = ImagePalette34DragOver OnEndDrag = ImagePalette34EndDrag OnMouseDown = ImagePalette34MouseDown end + object ImagePalette52: TImage + Left = 808 + Top = 104 + Width = 33 + Height = 33 + Hint = 'Action' + ParentShowHint = False + ShowHint = True + OnDragOver = ImagePalette52DragOver + OnEndDrag = ImagePalette52EndDrag + OnMouseDown = ImagePalette52MouseDown + end + object Label52: TLabel + Left = 776 + Top = 110 + Width = 18 + Height = 19 + Caption = '52' + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Arial' + Font.Style = [fsBold] + ParentFont = False + end object ButtonSauveTCO: TButton - Left = 1017 + Left = 979 Top = 48 Width = 96 Height = 33 @@ -929,7 +914,7 @@ object FormTCO: TFormTCO OnClick = ButtonSauveTCOClick end object ButtonRedessine: TButton - Left = 1017 + Left = 979 Top = 8 Width = 96 Height = 33 @@ -940,25 +925,27 @@ object FormTCO: TFormTCO OnClick = ButtonRedessineClick end object Button1: TButton - Left = 920 - Top = 56 - Width = 89 + Left = 860 + Top = 96 + Width = 57 Height = 25 + Anchors = [akTop, akRight] Caption = 'Simu det 1' TabOrder = 2 OnClick = Button1Click end object Button2: TButton - Left = 912 - Top = 32 - Width = 89 + Left = 860 + Top = 64 + Width = 57 Height = 25 + Anchors = [akTop, akRight] Caption = 'Simu Det 0' TabOrder = 3 OnClick = Button2Click end object ButtonConfigTCO: TButton - Left = 1017 + Left = 979 Top = 88 Width = 96 Height = 33 @@ -969,16 +956,17 @@ object FormTCO: TFormTCO OnClick = ButtonConfigTCOClick end object ButtonSimu: TButton - Left = 728 + Left = 740 Top = 136 Width = 113 Height = 25 + Anchors = [akTop, akRight] Caption = 'Simu canton occup'#233 TabOrder = 5 OnClick = ButtonSimuClick end object ButtonMasquer: TButton - Left = 1017 + Left = 979 Top = 128 Width = 96 Height = 33 @@ -997,7 +985,7 @@ object FormTCO: TFormTCO Caption = 'Configuration cellule' Font.Charset = ANSI_CHARSET Font.Color = clBackground - Font.Height = -9 + Font.Height = -12 Font.Name = 'MS Sans Serif' Font.Style = [] ParentFont = False @@ -1005,12 +993,12 @@ object FormTCO: TFormTCO object Label41: TLabel Left = 8 Top = 16 - Width = 103 - Height = 16 + Width = 120 + Height = 20 Caption = 'Adresse de l'#39#233'l'#233'ment: ' Font.Charset = ANSI_CHARSET Font.Color = clWindowText - Font.Height = -13 + Font.Height = -15 Font.Name = 'Arial Narrow' Font.Style = [] ParentFont = False @@ -1018,12 +1006,12 @@ object FormTCO: TFormTCO object Label71: TLabel Left = 8 Top = 38 - Width = 93 - Height = 16 + Width = 111 + Height = 20 Caption = 'Image de l'#39#233'l'#233'ment: ' Font.Charset = ANSI_CHARSET Font.Color = clWindowText - Font.Height = -13 + Font.Height = -15 Font.Name = 'Arial Narrow' Font.Style = [] ParentFont = False @@ -1031,12 +1019,12 @@ object FormTCO: TFormTCO object Label230: TLabel Left = 56 Top = 64 - Width = 27 - Height = 16 + Width = 32 + Height = 20 Caption = 'Texte' Font.Charset = ANSI_CHARSET Font.Color = clWindowText - Font.Height = -13 + Font.Height = -15 Font.Name = 'Arial Narrow' Font.Style = [] ParentFont = False @@ -1044,12 +1032,12 @@ object FormTCO: TFormTCO object Label65: TLabel Left = 8 Top = 88 - Width = 75 - Height = 16 + Width = 89 + Height = 20 Caption = 'position du texte' Font.Charset = ANSI_CHARSET Font.Color = clBlack - Font.Height = -13 + Font.Height = -15 Font.Name = 'Arial Narrow' Font.Style = [] ParentFont = False @@ -1121,7 +1109,8 @@ object FormTCO: TFormTCO 'Sans' 'Centrale' 'Haut' - 'Bas') + 'Bas' + 'R'#233'parti') end object CheckPinv: TCheckBox Left = 8 @@ -1147,14 +1136,20 @@ object FormTCO: TFormTCO Width = 81 Height = 18 Caption = 'Couleur de fond' + Font.Charset = ANSI_CHARSET + Font.Color = clBackground + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ParentFont = False TabOrder = 6 OnClick = ButtonCoulFondClick end end object buttonRaz: TButton - Left = 912 + Left = 873 Top = 128 - Width = 96 + Width = 97 Height = 33 Anchors = [akTop, akRight] Caption = 'Raz des occupations' @@ -1164,18 +1159,19 @@ object FormTCO: TFormTCO OnClick = buttonRazClick end object ButtonCalibrage: TButton - Left = 840 + Left = 852 Top = 136 Width = 75 Height = 25 + Anchors = [akTop, akRight] Caption = 'Calibrage' TabOrder = 9 OnClick = ButtonCalibrageClick end object ButtonDessiner: TButton - Left = 912 + Left = 873 Top = 88 - Width = 96 + Width = 97 Height = 33 Hint = 'Dessine le TCO '#224' la souris. Clic droit pour lever le pointeur. T' + @@ -1188,13 +1184,24 @@ object FormTCO: TFormTCO TabStop = False OnClick = ButtonDessinerClick end + object ButtonAffSC: TButton + Left = 873 + Top = 48 + Width = 97 + Height = 33 + Anchors = [akTop, akRight] + Caption = 'Afficher Signaux Complexes' + TabOrder = 11 + WordWrap = True + OnClick = ButtonAffSCClick + end end object ButtonAfficheBandeau: TButton - Left = 1070 - Top = 415 - Width = 57 - Height = 33 - Anchors = [akRight, akBottom] + Left = 876 + Top = 408 + Width = 56 + Height = 32 + Anchors = [akTop, akRight] Caption = 'Affiche Bandeau' TabOrder = 3 WordWrap = True diff --git a/UnitTCO.pas b/UnitTCO.pas index e8a0a4c..6c439cd 100644 --- a/UnitTCO.pas +++ b/UnitTCO.pas @@ -9,8 +9,6 @@ uses type TFormTCO = class(TForm) - LabelCoord: TLabel; - LabelCellule: TLabel; PopupMenu1: TPopupMenu; MenuCouper: TMenuItem; N1: TMenuItem; @@ -20,8 +18,6 @@ type ImageTCO: TImage; Tourner90G: TMenuItem; Tourner90D: TMenuItem; - SourisX: TLabel; - SourisY: TLabel; Pos_vert: TMenuItem; TrackBarZoom: TTrackBar; Panel1: TPanel; @@ -141,6 +137,9 @@ type ImagePalette33: TImage; Label34: TLabel; ImagePalette34: TImage; + ImagePalette52: TImage; + Label52: TLabel; + ButtonAffSC: TButton; procedure FormCreate(Sender: TObject); procedure FormActivate(Sender: TObject); procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); @@ -186,7 +185,6 @@ type procedure EditAdrElementChange(Sender: TObject); procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); - procedure Maj_TCO(Adresse : integer); procedure ImagePalette10EndDrag(Sender, Target: TObject; X, Y: Integer); procedure ImagePalette10MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); @@ -394,8 +392,15 @@ type procedure ImagePalette34MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); procedure EditAdrElementClick(Sender: TObject); - - private + procedure ImagePalette52DragOver(Sender, Source: TObject; X, + Y: Integer; State: TDragState; var Accept: Boolean); + procedure ImagePalette52EndDrag(Sender, Target: TObject; X, + Y: Integer); + procedure ImagePalette52MouseDown(Sender: TObject; + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + procedure ButtonAffSCClick(Sender: TObject); + + private { Déclarations privées } public { Déclarations publiques } @@ -422,23 +427,26 @@ const AvecGrille_ch='AvecGrille'; ModeCouleurCanton_ch='ModeCouleurCanton'; Graphisme_ch='Graphisme'; + Ecran_ch='Ecran'; Id_signal=50; - + Id_Quai=51; + Id_action=52; + // 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..51] 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,$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 - $64,$13,$46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) ; + // 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) ; type - // structure du TCO + // structure d'une cellule du TCO TTCO = record Adresse : integer; // adresse du détecteur ou de l'aiguillage ou du feu BImage : integer; // 0=rien 1=voie 2=aiguillage gauche gauche ... 50=feu mode : integer; // couleur de voie 0=éteint 1=ClVoies 2=couleur en fonction du train trajet : integer; // décrit le trajet ouvert sur la voie (cas d'un croisement ou d'une tjd/S) inverse : boolean; // aiguillage piloté inversé - repr : integer; // position de la représentation texte 0 = rien 1=centrale 2=Haut 3=Bas + repr : integer; // position de la représentation texte 0 = rien 1=centrale 2=Haut 3=Bas 4=réparti Texte : string; // texte de la cellule Fonte : string; // fonte du texte FontStyle : string; // GSIB (Gras Souligné Italique Barré) @@ -446,33 +454,40 @@ type TailleFonte : integer; CouleurFond : Tcolor; // couleur de fond // pour les signaux seulement - PiedFeu : integer; // type de pied au signal : signal à gauche=1 ou à droite=2 de la voie + PiedFeu : integer; // type de pied au signal : signal à gauche=1 ou à droite=2 de la voie OU si action: type d'action x,y : integer; // coordonnées pixels relativés du coin sup gauche du signal pour le décalage par rapport au 0,0 cellule Xundo,Yundo : integer; // coordonnées x,y de la cellule pour le undo - FeuOriente : integer; // orientation du signal : 1 vertical en bas / 2 horizontal gauche / 3 horizontal droit + FeuOriente : integer; // orientation du signal : 1 vertical en bas / 2 horizontal gauche / 3 horizontal droit / OU si action : numéro du TCO etc liaisons : integer; // quadrants des liaisons epaisseurs : integer; // épaisseur des liaisons : si le bit n est à 1 : liaison fine + pont : integer; // définition du pont : si le bit n est à 1 : pont (bits symétriques) + buttoir : integer; // définition des buttoirs : si le bit n est à 1 : buttoir end; var clAllume,clVoies,clFond,couleurAdresse,clGrille,cltexte,clQuai,CoulFonte,ClCanton,clPiedSignal : Tcolor; - FormTCO: TFormTCO; + //FormTCO: TFormTCO; + formTCO : array[1..10] of TformTCO; + + TamponAffecte,TCO_modifie,clicsouris, + clicTCO,piloteAig,BandeauMasque,eval_format,sauve_tco, + drag,TCOActive,TCOCree,ancienok,dbleClicTCO,auto_tcurs,EvtClicDet : boolean; + + HtImageTCO,LargImageTCO,XminiSel,YminiSel,XCoupe,Ycoupe,Temposouris, + XmaxiSel,YmaxiSel,AncienXMiniSel,AncienXMaxiSel,AncienYMiniSel,AncienYMaxiSel, + Xclic,Yclic,XClicCellInserer,YClicCellInserer,RatioC,ModeCouleurCanton, + AncienXClicCell,AncienYClicCell, + Epaisseur,oldX,oldY,offsetSourisY,offsetSourisX,AvecVerifIconesTCO,indexTrace,IndexTCOCourant, + ancienTraceX,ancienTraceY,rangUndo,NbreTCO,IndexTCOCreate: integer; - Forminit,SelectionAffichee,TamponAffecte,entoure,TCO_modifie,clicsouris, - clicTCO,piloteAig,BandeauMasque,eval_format,sauve_tco,formConfCellTCOAff, - drag,TCOActive,TCOCree,modeTrace,ancienok,dbleClicTCO,auto_tcurs,EvtClicDet : boolean; - HtImageTCO,LargImageTCO,XclicCell,YclicCell,XminiSel,YminiSel,XCoupe,Ycoupe,Temposouris, - XmaxiSel,YmaxiSel,AncienXMiniSel,AncienXMaxiSel ,AncienYMiniSel,AncienYMaxiSel, - Xclic,Yclic,XClicCellInserer,YClicCellInserer,Xentoure,Yentoure,RatioC,ModeCouleurCanton, - AncienXClicCell,AncienYClicCell,LargeurCell,HauteurCell,NbreCellX,NbreCellY,NbCellulesTCO, - Epaisseur,oldX,oldY,offsetSourisY,offsetSourisX,AvecVerifIconesTCO,indexTrace, - largeurCelld2,HauteurCelld2,ancienTraceX,ancienTraceY,rangUndo : integer; titre_Fonte : string; - TamponTCO,tco : array of array of TTco ; + + TCO : array[1..10] of + array of array of TTco ; // tco[x,y].variable Undo : array[1..MaxUndo] of record nombre : integer; @@ -480,9 +495,11 @@ var end; // pour copier coller + TamponTCO : array of array of TTco ; // tco[x,y].variable TamponTCO_Org : record - x1,y1,x2,y2,NbreCellX,NbreCellY : integer; + numTCO,x1,y1,x2,y2,NbreCellX,NbreCellY : integer; end; + routeTCO : array[1..500] of record x,y : integer; end; @@ -491,36 +508,50 @@ var traceXY : Array[1..50] of record x,y : integer; // en coordonnées grille end; + rAncien : TRect; - PCanvasTCO : Tcanvas; - PBitMapTCO,VBm,OldBmp : TBitMap; + VBm,OldBmp : TBitMap; PScrollBoxTCO : TScrollBox; - PImageTCO,PImageTemp : Timage; - frXGlob,frYGlob : real; + + // liste des variables par tco + largeurCelld2,HauteurCelld2,NbCellulesTCO,NbreCellX,NbreCellY,LargeurCell,HauteurCell, + Xentoure,Yentoure,XclicCell,YclicCell,EcranTCO : array[1..10] of integer; + PcanvasTCO : array[1..10] of Tcanvas; + PBitMapTCO : array[1..10] of TbitMap; + PImageTCO,PImageTemp : array[1..10] of Timage; + frXGlob,frYGlob : array[1..10] of real; + NomFichierTCO : array[1..10] of string; + AvecGrille,SelectionAffichee,forminit,modeTrace,entoure : array[1..10] of boolean; + procedure calcul_reduction(Var frx,fry : real;DimDestX,DimDestY,DimOrgX,DimOrgY : integer); -procedure calcul_cellules; -procedure sauve_fichier_tco; -procedure zone_TCO(det1,det2,mode: integer); -procedure efface_entoure; -procedure affiche_TCO; -procedure affiche_cellule(x,y : integer); -procedure _entoure_cell_clic; -procedure affiche_texte(x,y : integer); -procedure change_fonte; -procedure Tourne90G; -procedure Tourne90D; -procedure Vertical; -procedure signalG; -procedure signalD; -procedure lire_fichier_tco; -procedure grise_ligne_tco; -procedure change_couleur_fond; -function verif_cellule(x,y,Bim : integer) : boolean; -procedure dessine_icones; +procedure calcul_cellules(indextco : integer); +procedure sauve_fichiers_tco; +procedure zone_TCO(indexTCO,det1,det2,mode: integer); +procedure _entoure_cell_clic(indexTCO: integer); +procedure Affiche_TCO(indexTCO : integer) ; +procedure affiche_cellule(indexTCO,x,y : integer); +procedure efface_entoure(indexTCO : integer); +procedure affiche_texte(indextco,x,y : integer); +procedure change_fonte(indexTCO : integer); +procedure Tourne90G(indexTCO : integer); +procedure Tourne90D(indexTCO : integer); +procedure Maj_TCO(indexTCO,Adresse : integer); +procedure Vertical(indexTCO : integer); +procedure signalG(indexTCO : integer); +procedure signalD(indexTCO : integer); +procedure lire_fichier_tco(indexTCO : integer); +procedure grise_ligne_tco(indexTCO : integer); +procedure change_couleur_fond(indexTCO : integer); +function verif_cellule(IndexTCO,x,y,Bim : integer) : boolean; +procedure dessine_icones(indexTCO : integer); procedure echange(var a,b : integer); -procedure Efface_Cellule(Canvas : Tcanvas;x,y : integer;Mode : TPenMode); -procedure dessine_icone(PCanvasTCO : tcanvas;Bimage,X,Y,mode : integer); +procedure Efface_Cellule(indextco : integer;Canvas : Tcanvas;x,y : integer;Mode : TPenMode); +procedure dessine_icone(indexTCO : integer;PCanvasTCO : tcanvas;Bimage,X,Y,mode : integer); +function IsAigTCO(i : integer) : boolean; +function index_TCO(t : Tobject) : integer; +procedure Init_TCO(indexTCO : integer); +procedure init_tampon_copiercoller; implementation @@ -528,9 +559,93 @@ uses UnitConfigTCO, Unit_Pilote_aig, UnitConfigCellTCO ; {$R *.dfm} -procedure lire_fichier_tco; +// renvoie l'index du tco d'après le nom de la forme (TCO1 TCO2) +function index_TCO(t : Tobject) : integer; +var s : string; + trouve : boolean; + f : tcustomform; + i,erreur : integer; +begin + s:=(t as Tcomponent).name; + // Affiche(s,clWhite); + // popup menu ne marche pas!!! + f:=getparentForm(t as Tcontrol); + s:=(f as Tcomponent).Name; + //Affiche(s,clYellow); + + i:=0; + repeat + inc(i); + trouve:=s[i] in ['0'..'9']; + until trouve or (i>length(s)); + if trouve then + begin + delete(s,1,i-1); + val(s,result,erreur); + end + else result:=0; +end; + +// le tampon est aussi grand que le x/y du plus grand TCO +procedure init_tampon_copiercoller; +var i,x,y : integer; +begin + x:=0;y:=0; + // trouver le plus grand X et Y de chaque TCO + for i:=1 to NbreTCO do + begin + if NbreCellX[i]>x then x:=NbreCellX[i]; + if NbreCellY[i]>y then y:=NbreCellY[i]; + end; + SetLength(TamponTCO,x+2,y+2); +end; + +procedure Init_TCO(indexTCO : integer); +var x,y : integer; +begin + sauve_tco:=true; + Affiche('Nouveau tco '+intToSTr(indexTCO),clyellow); + NbreCellX[indexTCO]:=35;NbreCellY[indexTCO]:=20;LargeurCell[indexTCO]:=35;HauteurCell[indexTCO]:=35; + largeurCelld2[indexTCO]:=largeurCell[indexTCO] div 2;HauteurCelld2[indexTCO]:=HauteurCell[indexTCO] div 2; + EcranTCO[indexTCO]:=1; + RatioC:=10; + ClFond:=$000040; + ClVoies:=$0077FF; + ClAllume:=$00FFFF; + ClGrille:=$404040; + ClTexte:=$00FF00; + ClQuai:=$808080; + clPiedSignal:=$4080FF; + ClCanton:=$00FFFF; + AvecGrille[indexTCO]:=true; + Graphisme:=1; + SetLength(TCO[indexTCO],NbreCellX[indexTCO]+2,NbreCellY[indexTCO]+2); // +2 pour éviter les erreurs d'index sur +1 et -1 + init_tampon_copiercoller; + + for x:=1 to NbreCellX[indexTCO] do + for y:=1 to NbreCellY[indexTCO] do + with tco[indextco,x,y] do + begin + CouleurFond:=clfond; + Adresse:=0; + Bimage:=0; + repr:=0; + Texte:=''; + fonte:='Arial'; + fontSTyle:=''; + piedFeu:=0; + x:=0; + y:=0; + FeuOriente:=0; + Liaisons:=0; + Epaisseur:=0; + Buttoir:=0; + end; +end; + +procedure lire_fichier_tco(indexTCO : integer); var fichier : textfile; - s,sa : string; + s,sa,so : string; nv,x,y,i,j,m,adresse,valeur,erreur,FeuOriente,PiedFeu,tailleFont,e,NPar : integer; trouve_CoulFond,trouve_clVoies,trouve_clAllume,trouve_clGrille,trouve_clCanton, trouve_clTexte,trouve_clQuai,trouve_matrice,trouve_ratio,trouve_ModeCanton, @@ -540,6 +655,7 @@ var fichier : textfile; begin repeat readln(fichier,s); + so:=s; s:=Uppercase(s); //Affiche(s,clWhite); c:=#0; @@ -552,46 +668,16 @@ begin //Affiche(GetCurrentDir,clYellow); {$I+} try - assign(fichier,'tco.cfg'); + // assign(fichier,fichierTCO[indexTCO]); + assign(fichier,NomfichierTCO[indexTCO]); reset(fichier); except - Affiche('Nouveau tco',clyellow); - NbreCellX:=35;NbreCellY:=20;LargeurCell:=35;HauteurCell:=35; - largeurCelld2:=largeurCell div 2;HauteurCelld2:=HauteurCell div 2; - RatioC:=10; - ClFond:=$000040; - ClVoies:=$0077FF; - ClAllume:=$00FFFF; - ClGrille:=$404040; - ClTexte:=$00FF00; - ClQuai:=$808080; - clPiedSignal:=$4080FF; - ClCanton:=$00FFFF; - AvecGrille:=true; - Graphisme:=1; - SetLength(TCO,NbreCellX+2,NbreCellY+2); // +2 pour éviter les erreurs d'index sur +1 et -1 - SetLength(TamponTCO,NbreCellX+2,NbreCellY+2); - for x:=1 to NbreCellX do - for y:=1 to NbreCellY do - with tco[x,y] do - begin - CouleurFond:=clfond; - Adresse:=0; - Bimage:=0; - repr:=0; - Texte:=''; - fonte:=''; - fontSTyle:=''; - piedFeu:=0; - x:=0; - y:=0; - FeuOriente:=0; - Liaisons:=0; - end; + init_tco(indexTCO); exit; end; {$I-} - x:=1;y:=1;NbreCellX:=0;NbreCellY:=0; RatioC:=10; + if debug=1 then Affiche('Lecture tco '+intToSTr(indexTCO)+' '+NomfichierTCO[indexTCO],clyellow); + x:=1;y:=1;NbreCellX[indexTCO]:=0;NbreCellY[indexTCO]:=0; RatioC:=10; Graphisme:=1; trouve_clAllume:=false; trouve_CoulFond:=false; @@ -607,7 +693,7 @@ begin trouve_AvecGrille:=false; eval_format:=false; ModeCouleurCanton:=1; - AvecGrille:=true; + AvecGrille[indexTCO]:=true; clCanton:=ClYellow; // couleurs @@ -725,6 +811,18 @@ begin Graphisme:=i; end; + sa:=uppercase(Ecran_ch)+'='; + i:=pos(sa,s); + if i<>0 then + begin + inc(nv); + delete(s,i,length(sa)); + val(s,i,erreur); + if (i<1) or (i>2) then i:=1; + EcranTCO[indexTCO]:=i; + end; + + sa:=uppercase(AvecGrille_ch)+'='; i:=pos(sa,s); if i<>0 then @@ -733,7 +831,7 @@ begin trouve_AvecGrille:=true; delete(s,i,length(sa)); val(s,i,erreur); - AvecGrille:=i=1; + AvecGrille[indexTCO]:=i=1; end; // taille de la matrice @@ -744,9 +842,9 @@ begin inc(nv); trouve_matrice:=true; delete(s,i,length(sa)); - val(s,NbreCellX,erreur); + val(s,NbreCellX[indexTCO],erreur); i:=pos(',',s);delete(s,1,i); - Val(s,NbreCellY,erreur) + Val(s,NbreCellY[indexTCO],erreur) end; // ratio @@ -772,43 +870,44 @@ begin EvtClicDet:=i=1; end; - until (pos('[MATRICE]',uppercase(s))<>0) or (eof(fichier)); - NbCellulesTCO:=NbreCellX*NbreCellY; + NbCellulesTCO[indexTCO]:=NbreCellX[indexTCO]*NbreCellY[indexTCO]; - if (NbreCellX<20) or (NbreCellX>MaxCellX) then + if (NbreCellX[indexTCO]<20) or (NbreCellX[indexTCO]>MaxCellX) then begin - NbreCellX:=MaxCellX; - Affiche('TCO: le nombre de cellules X a été ramené à '+intToSTR(NbreCellX),clred); + NbreCellX[indexTCO]:=MaxCellX; + Affiche('TCO: le nombre de cellules X a été ramené à '+intToSTR(NbreCellX[indexTCO]),clred); end; - if (NbreCellY<5) or (NbreCellY>MaxCellY) then + if (NbreCellY[indexTCO]<5) or (NbreCellY[indexTCO]>MaxCellY) then begin - NbreCellY:=MaxCellY; - Affiche('TCO: le nombre de cellules Y a été ramené à '+intToSTR(NbreCellX),clred); + NbreCellY[indexTCO]:=MaxCellY; + Affiche('TCO: le nombre de cellules Y a été ramené à '+intToSTR(NbreCellX[indexTCO]),clred); end; try - SetLength(TCO,NbreCellX+2,NbreCellY+2); + SetLength(TCO[indexTCO],NbreCellX[indexTCO]+2,NbreCellY[indexTCO]+2); except - Affiche('TCO:Mémoire insuffisante pour'+intToSTR(NbreCellX)+' '+intToSTR(NbreCellY),clred); - NbreCellX:=20;NbreCellY:=12; - SetLength(TCO,NbreCellX+2,NbreCellY+2); + Affiche('TCO:Mémoire insuffisante pour'+intToSTR(NbreCellX[indexTCO])+' '+intToSTR(NbreCellY[indexTCO]),clred); + NbreCellX[indexTCO]:=20;NbreCellY[indexTCO]:=12; + SetLength(TCO[indexTCO],NbreCellX[indexTCO]+2,NbreCellY[indexTCO]+2); end; try - SetLength(TamponTCO,NbreCellX+1,NbreCellY+1); + + init_tampon_copiercoller; except Affiche('TamponTCO:Mémoire insuffisante',clred); - NbreCellX:=20;NbreCellY:=12; - SetLength(TamponTCO,NbreCellX+2,NbreCellY+2); + NbreCellX[indexTCO]:=20;NbreCellY[indexTCO]:=12; + init_tampon_copiercoller; end; // lire la matrice while not eof(fichier) do begin - s:=lit_ligne; + lit_ligne; + s:=so; if s[1]<>'/' then begin repeat @@ -826,7 +925,7 @@ begin inc(npar); until (i>j) or (i=0); - if npar<>13 then sauve_tco:=true; + if npar<15 then sauve_tco:=true; // 1 couleur de fond i:=pos(',',s); @@ -835,7 +934,7 @@ begin if erreur<>0 then begin Affiche('ETCO3',clred);closefile(fichier);exit;end; if coulFonte=0 then begin coulFonte:=clfond;sauve_tco:=true;end; - tco[x,y].CouleurFond:=coulFonte; + tco[indexTCO,x,y].CouleurFond:=coulFonte; delete(s,1,i); // 2 Adresse @@ -843,7 +942,7 @@ begin if i=0 then begin Affiche('ETCO4',clred);closefile(fichier);exit;end; val(copy(s,1,i-1),adresse,erreur); if erreur<>0 then begin Affiche('ETCO5',clred);closefile(fichier);exit;end; - tco[x,y].adresse:=adresse; + tco[indexTCO,x,y].adresse:=adresse; delete(s,1,i); //3 Bimage @@ -852,15 +951,15 @@ begin val(copy(s,1,i-1),valeur,erreur);if erreur<>0 then begin Affiche('ETCO7',clred);closefile(fichier);exit;end; if valeur=30 then begin valeur:=Id_signal;sauve_tco:=true;end; if valeur=31 then begin valeur:=51;sauve_tco:=true;end; - tco[x,y].Bimage:=valeur; - tco[x,y].liaisons:=liaisons[valeur]; + tco[indexTCO,x,y].Bimage:=valeur; + tco[indexTCO,x,y].liaisons:=liaisons[valeur]; delete(s,1,i); //4 Inverse i:=pos(',',s); if i=0 then begin Affiche('ETCO8',clred);closefile(fichier);exit;end; val(copy(s,1,i-1),valeur,erreur);if erreur<>0 then begin Affiche('ETCO9',clred);closefile(fichier);exit;end; - tco[x,y].inverse:=valeur=1; + tco[indexTCO,x,y].inverse:=valeur=1; delete(s,1,i); // 5 FeuOriente @@ -876,7 +975,7 @@ begin delete(s,1,i); // si c'est un signal, remplir les paramètres du signal - if tco[x,y].Bimage=Id_signal then + if tco[indexTCO,x,y].Bimage=Id_signal then begin i:=Index_Signal(adresse); if i<>0 then @@ -884,49 +983,55 @@ begin //Affiche('Feu '+IntToSTR(Adresse)+' aspect='+intToSTR(aspect),clyellow); if FeuOriente<1 then FeuOriente:=1; if FeuOriente>3 then FeuOriente:=3; - tco[x,y].FeuOriente:=FeuOriente; - tco[x,y].x:=0; - tco[x,y].y:=0; + tco[indexTCO,x,y].FeuOriente:=FeuOriente; + tco[indexTCO,x,y].x:=0; + tco[indexTCO,x,y].y:=0; if PiedFeu<1 then PiedFeu:=1; if PiedFeu>2 then PiedFeu:=2; - TCO[x,y].PiedFeu:=PiedFeu; + tco[indexTCO,x,y].PiedFeu:=PiedFeu; end; end; + // si c'est une action, remplir les paramètres de l'action + if tco[indexTCO,x,y].Bimage=Id_action then + begin + tco[indexTCO,x,y].PiedFeu:=PiedFeu; // quelle action + tco[indexTCO,x,y].FeuOriente:=FeuOriente; // paramètre de l'action + end; // 7 texte optionnel j:=pos(')',s); i:=pos(',',s); - tco[x,y].Texte:=''; + tco[indexTCO,x,y].Texte:=''; if j>1 then // le , est avant le ) donc il y a un texte begin if j=13 then begin - delete(s,1,1); // supprimer la virgule du paramètre optionnel + delete(s,1,1); // supprimer la virgule val(s,i,erreur); - tco[x,y].epaisseurs:=i; + tco[indexTCO,x,y].epaisseurs:=i; + i:=pos(')',s); j:=pos(',',s);if j=14 then + begin + delete(s,1,1); // supprimer la virgule + val(s,i,erreur); + tco[indexTCO,x,y].pont:=i; + i:=pos(')',s); j:=pos(',',s);if j=15 then + begin + delete(s,1,1); // supprimer la virgule + val(s,i,erreur); + tco[indexTCO,x,y].buttoir:=i; + if i<>0 then tco[indexTCO,x,y].Adresse:=0; // pas d'adresse dans un buttoir + //delete(s,1,i-1); //ne pas supprimer la virgule + end; + i:=pos(')',s); if i<>0 then delete(s,1,i); @@ -970,111 +1098,124 @@ begin b:=i; end; -procedure sauve_fichier_tco; +// donne l'équation de droite y=ax+b passant par (x1,y1) (x2,y2) +procedure droite(x1,y1,x2,y2: integer;var a,b: double); +begin + if x2<>x1 then a:=(y2-y1)/(x2-x1) else a:=99999; + b:=y1-a*x1; +end; + + +procedure sauve_fichiers_tco; var fichier : textfile; s : string; couleurFonte : Tcolor; - x,y : integer; + x,y,i : integer; begin - AssignFile(fichier,'tco.cfg'); - rewrite(fichier); - Writeln(fichier,'/ Définitions TCO version '+version+sousversion); - Writeln(fichier,clFond_ch+'='+IntToHex(clfond,6)); - Writeln(fichier,clVoies_ch+'='+IntToHex(ClVoies,6)); - Writeln(fichier,clAllume_ch+'='+IntToHex(ClAllume,6)); - Writeln(fichier,clGrille_ch+'='+IntToHex(ClGrille,6)); - Writeln(fichier,clTexte_ch+'='+IntToHex(ClTexte,6)); - Writeln(fichier,clQuai_ch+'='+IntToHex(ClQuai,6)); - Writeln(fichier,clPiedSignal_ch+'='+intToHex(clPiedSignal,6)); - Writeln(fichier,ClCanton_ch+'='+IntToHex(ClCanton,6)); - Writeln(fichier,ModeCouleurCanton_ch+'='+intToSTR(ModeCouleurCanton)); - if avecGrille then s:='1' else s:='0'; - Writeln(fichier,Avecgrille_ch+'='+s); - writeln(fichier,Graphisme_ch+'=',graphisme); - if EvtClicDet then s:='1' else s:='0'; - Writeln(fichier,EvtClicDet_ch+'='+s); - - writeln(fichier,matrice_ch+'='+IntToSTR(NbreCellX)+','+intToSTR(NbreCellY)); - writeln(fichier,Ratio_ch+'='+intToSTR(ratioC)); - writeln(fichier,'/Matrice TCO'); - writeln(fichier,'[Matrice]'); - writeln(fichier,'/ couleur fond,adresse,image,inversion aiguillage,Orientation du signal, pied du signal , [texte], representation, fonte, taille fonte, couleur fonte, style, épaisseurs '); - for y:=1 to NbreCellY do + //x:=formconfig.MemoNomTCO.Lines.Count; + //if x<0 then + for i:=1 to NbreTCO do begin - s:=''; - for x:=1 to NbreCellX do + AssignFile(fichier,nomfichierTCO[i]); + rewrite(fichier); + Writeln(fichier,'/ Définitions TCO version '+version+sousversion); + Writeln(fichier,clFond_ch+'='+IntToHex(clfond,6)); + Writeln(fichier,clVoies_ch+'='+IntToHex(ClVoies,6)); + Writeln(fichier,clAllume_ch+'='+IntToHex(ClAllume,6)); + Writeln(fichier,clGrille_ch+'='+IntToHex(ClGrille,6)); + Writeln(fichier,clTexte_ch+'='+IntToHex(ClTexte,6)); + Writeln(fichier,clQuai_ch+'='+IntToHex(ClQuai,6)); + Writeln(fichier,clPiedSignal_ch+'='+intToHex(clPiedSignal,6)); + Writeln(fichier,ClCanton_ch+'='+IntToHex(ClCanton,6)); + Writeln(fichier,ModeCouleurCanton_ch+'='+intToSTR(ModeCouleurCanton)); + if avecGrille[i] then s:='1' else s:='0'; + Writeln(fichier,Avecgrille_ch+'='+s); + writeln(fichier,Graphisme_ch+'=',graphisme); + writeln(fichier,Ecran_ch+'=',EcranTCO[i]); + if EvtClicDet then s:='1' else s:='0'; + Writeln(fichier,EvtClicDet_ch+'='+s); + + writeln(fichier,matrice_ch+'='+IntToSTR(NbreCellX[i])+','+intToSTR(NbreCellY[i])); + writeln(fichier,Ratio_ch+'='+intToSTR(ratioC)); + writeln(fichier,'/Matrice TCO'); + writeln(fichier,'[Matrice]'); + writeln(fichier, + '/ couleur fond,adresse,image,inversion aiguillage,Orientation du signal, pied du signal , [texte], representation, fonte, taille fonte, couleur fonte, style, épaisseurs, pont, buttoir '); + for y:=1 to NbreCellY[i] do begin - s:=s+'('+intToHex(TCO[x,y].CouleurFond,6)+','+inttostr(TCO[x,y].Adresse)+','+IntToSTR(TCO[x,y].BImage)+','; - - if TCO[x,y].inverse then s:=s+'1,' else s:=s+'0,'; - - if TCO[x,y].BImage=Id_signal then + s:=''; + for x:=1 to NbreCellX[i] do begin - s:=s+IntToSTR(TCO[x,y].FeuOriente)+','+IntToSTR(TCO[x,y].PiedFeu)+','; - end - else s:=s+'0,0,'; + s:=s+'('+intToHex(tco[i,x,y].CouleurFond,6)+','+inttostr(tco[i,x,y].Adresse)+','+IntToSTR(tco[i,x,y].BImage)+','; - // texte - s:=s+TCO[x,y].Texte+','; - // représentation - s:=s+intToSTR(TCO[x,y].repr); - // NomFonte - s:=s+','+TCO[x,y].Fonte; - //taille fonte - s:=s+','+intToSTR(TCO[x,y].tailleFonte); - // couleur fonte - couleurfonte:=TCO[x,y].coulFonte; - s:=s+','+intTohex(couleurFonte,6); - s:=s+','+TCO[x,y].FontStyle; - s:=s+','+intToSTR(TCO[x,y].epaisseurs); - s:=s+')'; + if tco[i,x,y].inverse then s:=s+'1,' else s:=s+'0,'; + + s:=s+IntToSTR(tco[i,x,y].FeuOriente)+','+IntToSTR(tco[i,x,y].PiedFeu)+','; + + // texte + s:=s+tco[i,x,y].Texte+','; + // représentation + s:=s+intToSTR(tco[i,x,y].repr); + // NomFonte + s:=s+','+tco[i,x,y].Fonte; + //taille fonte + s:=s+','+intToSTR(tco[i,x,y].tailleFonte); + // couleur fonte + couleurfonte:=tco[i,x,y].coulFonte; + s:=s+','+intTohex(couleurFonte,6); + s:=s+','+tco[i,x,y].FontStyle; + s:=s+','+intToSTR(tco[i,x,y].epaisseurs); + s:=s+','+intToSTR(tco[i,x,y].pont); + s:=s+','+intToSTR(tco[i,x,y].buttoir); + s:=s+')'; + end; + writeln(fichier,s); end; - writeln(fichier,s); + closefile(fichier); + Affiche('TCO '+nomFichierTCO[i]+' sauvegardé',clyellow); end; - closefile(fichier); TCO_modifie:=false; - Affiche('TCO sauvegardé',clyellow); + end; -procedure calcul_cellules; +procedure calcul_cellules(indexTCO : integer); begin - LargeurCell:=ZoomMax-FormTCO.TrackBarZoom.Position+ZoomMin; - //Affiche(intToSTR(largeurcell),clyellow); - hauteurCell:=(LargeurCell * RatioC) div 10; - largeurCelld2:=largeurCell div 2;HauteurCelld2:=HauteurCell div 2; - Epaisseur:=LargeurCell div 7; // épaisseur du trait pour PEN + LargeurCell[indexTCO]:=ZoomMax-FormTCO[indexTCO].TrackBarZoom.Position+ZoomMin; + //Affiche('LargeurCell TCO N°'+intToSTR(indexTCO)+'='+intToSTR(largeurcell[indexTCO]),clyellow); + hauteurCell[indexTCO]:=(LargeurCell[indexTCO] * RatioC) div 10; + largeurCelld2[indexTCO]:=largeurCell[indexTCO] div 2; + HauteurCelld2[indexTCO]:=HauteurCell[indexTCO] div 2; + Epaisseur:=LargeurCell[indexTCO] div 7; // épaisseur du trait pour PEN end; -procedure entoure_cell_grille(x,y : integer); +procedure entoure_cell_grille(indexTCO,x,y : integer); // redessine le carré de grille de la cellule qui a été altéré par la mise à // jour de la cellule var Xorg,Yorg : integer; begin; - if not(AvecGrille) then exit; - Xorg:=(x-1)*LargeurCell; - Yorg:=(y-1)*HauteurCell; - With PcanvasTCO do + if not(AvecGrille[indexTCO]) then exit; + Xorg:=(x-1)*LargeurCell[indexTCO]; + Yorg:=(y-1)*HauteurCell[indexTCO]; + With PcanvasTCO[indexTCO] do begin Pen.Color:=clGrille; Pen.mode:=PmCopy; Pen.width:=1; MoveTo(Xorg,YOrg); - LineTo(Xorg+LargeurCell,YOrg); - LineTo(Xorg+LargeurCell,YOrg+HauteurCell); - LineTo(Xorg,YOrg+HauteurCell); + LineTo(Xorg+LargeurCell[indexTCO],YOrg); + LineTo(Xorg+LargeurCell[indexTCO],YOrg+HauteurCell[indexTCO]); + LineTo(Xorg,YOrg+HauteurCell[indexTCO]); LineTo(Xorg,YOrg); end; end; - - -function positionTCO(x,y : integer) : integer; +function positionTCO(indexTCO,x,y : integer) : integer; var position,i : integer; begin - i:=index_Aig(TCO[x,y].Adresse); + i:=index_Aig(tco[indextco,x,y].Adresse); position:=aiguillage[i].position ; if (position=0) or (i=0) then begin result:=const_inconnu;exit;end; - if TCO[x,y].inverse then + if tco[indextco,x,y].inverse then begin if position=const_droit then begin result:=const_devie;exit;end; if position=const_devie then begin result:=const_droit;exit;end; @@ -1110,12 +1251,12 @@ begin Canvas.Arc(x1,y1,x2,y2,x3,y3,x4,y4); end; -procedure efface_selection; +procedure efface_selection(indexTCO : integer); begin - if SelectionAffichee then + if SelectionAffichee[indexTCO] then begin //Affiche('efface sélection',clOrange); - with formtco.imageTCO.Canvas do + with formtco[indexTCO].imageTCO.Canvas do begin Pen.Mode:=PmXor; Pen.color:=clGrille; @@ -1123,30 +1264,62 @@ begin //FillRect(r); Rectangle(rAncien); end; - SelectionAffichee:=false; + SelectionAffichee[indexTCO]:=false; end; end; // élément de voie horizontale Element 1 -procedure dessin_1(Canvas : Tcanvas;x,y,mode : integer); -var Adr, x0,y0,jy1,jy2,ep,yc : integer; +procedure dessin_1(indexTCO: integer;Canvas : Tcanvas;x,y,mode : integer); +var Adr,yf,xf,x0,y0,jy1,jy2,ep,xc,yc,but : integer; r : Trect; couleur : Tcolor; begin - x0:=(x-1)*LargeurCell; - y0:=(y-1)*HauteurCell; - yc:=y0+(HauteurCell div 2); - ep:=tco[x,y].epaisseurs; + x0:=(x-1)*LargeurCell[indexTCO]; + y0:=(y-1)*HauteurCell[indexTCO]; + xc:=x0+(LargeurCell[indexTCO] div 2); + yc:=y0+(HauteurCell[indexTCO] div 2); + xf:=x0+LargeurCell[indexTCO]; + yf:=y0+HauteurCell[indexTCO]; + ep:=tco[indextco,x,y].epaisseurs; + but:=tco[indextco,x,y].buttoir; with canvas do begin - //Brush.Color:=TCO[x,y].CouleurFond; + //Brush.Color:=tco[indextco,x,y].CouleurFond; Pen.Mode:=pmCopy; { r:=Rect(x0,y0,x0+LargeurCell,y0+HauteurCell); FillRect(r); } - Adr:=TCO[x,y].adresse; + Adr:=tco[indextco,x,y].adresse; + + if but<>0 then + begin + case mode of + 0 : couleur:=clVoies; + 1 : couleur:=clAllume; + 2 : couleur:=couleurtrain[index_couleur]; + end; + pen.color:=couleur; + if testbit(ep,7) or testbit(ep,3) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; + + if testBit(but,7) then + begin + moveTo(x0,yc);LineTo(xc,yc); + end; + if testBit(but,3) then + begin + moveTo(xc,yc);LineTo(xf,yc); + end; + + Pen.Width:=epaisseur; + pen.Color:=Clred; + moveto(xc,yc+round(7*fryGlob[indexTCO])); + LineTo(xc,yc-round(7*fryGlob[indexTCO])); + + exit; + end; + // détecteur if adr<>0 then @@ -1158,18 +1331,18 @@ begin end else begin - pen.color:=TCO[x,y].CouleurFond; - brush.color:=TCO[x,y].CouleurFond; + pen.color:=tco[indextco,x,y].CouleurFond; + brush.color:=tco[indextco,x,y].CouleurFond; end; - 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 - if avecGrille then r:=Rect(x0+1,jy1,x0+LargeurCell-1,jy2) else - r:=Rect(x0,jy1,x0+LargeurCell,jy2) ; + jy1:=y0+(HauteurCell[indexTCO] div 2)-round(6*fryGlob[indexTCO]); // pos Y de la bande sup + jy2:=y0+(HauteurCell[indexTCO] div 2)+round(6*fryGlob[indexTCO]); // pos Y de la bande inf + if avecGrille[indexTCO] then r:=Rect(x0+1,jy1,xf-1,jy2) else + r:=Rect(x0,jy1,x0+LargeurCell[indexTCO],jy2) ; FillRect(r); end; // voie - jy1:=y0+(HauteurCell div 2); + jy1:=y0+(HauteurCell[indexTCO] div 2); case mode of 0 : couleur:=clVoies; @@ -1177,16 +1350,137 @@ begin 2 : couleur:=couleurtrain[index_couleur]; end; pen.color:=couleur; - if testbit(ep,7) or testbit(ep,3) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; - moveTo(x0,yc);LineTo(x0+LargeurCell,yc); + if testbit(ep,7) or testbit(ep,3) then pen.Width:=epaisseur div 2 else + pen.Width:=epaisseur; + moveTo(x0,yc);LineTo(xf,yc); end; end; +// renvoie vrai si l'élément i est un aiguillage ou une TJD/S +function IsAigTCO(i : integer) : boolean; +begin + result:=((i=2) or (i=3) or (i=4) or (i=5) or (i=12) or (i=13) or (i=14) or + (i=15) or + ((i>=21) and (i<=34) )) ; +end; + +// écrit le texte réparti sur plusieurs lignes. +// ne fonctionne qu'avec certaines fontes +// x,y : en cellules +// tf=taille fonte +Procedure Texte_reparti(s : string;indexTCO,x,y,tf : integer); +var c : Tcanvas; + st : array[1..10] of string; + b,haut,larg,i,l,PixelLength,NombreMots,yl : integer; +begin + if (s='') or (indexTCO=0) then exit; + // supprimer les espaces en fin + i:=Length(s); + if s[i]=' ' then + begin + repeat + dec(i); + until (s[i]<>' ') or (i=1); + delete(s,i+1,length(s)-i); + end; + + // découper la chaine s dans le tableau st + if tf=0 then tf:=8; + c:=PcanvasTCO[indexTCO]; + i:=1;l:=length(s);NombreMots:=1; + repeat + i:=pos(' ',s); + if i=0 then st[NombreMots]:=s else st[NombreMots]:=copy(s,1,i-1); + delete(s,1,i); + inc(NombreMots); + until (i>l) or (i=0); + dec(NombreMots); + + b:=tco[indexTCO,x,y].Bimage; + PixelLength:=tf; + + // x y en cellules + larg:=LargeurCell[indexTCO]; + haut:=HauteurCell[indexTCO]; + l:=0; // compteur de lignes + i:=1; + // faire une ligne + repeat + s:=''; + repeat + s:=s+st[i]+' '; + inc(i); + //Affiche(s+' '+intToSTR(tf*length(s+st[i])),clyellow); + until (round(0.8*tf*length(s+st[i]))>larg) or (i>NombreMots); + //yl:=(y-1)*round((l*tf)); + yl:=round(1.5*l*tf)+((y-1)*haut); + PCanvasTCO[indexTCO].TextOut((x-1)*larg,yl,s+' '); + inc(l); + until (i>NombreMots); +end; + + +function style(s : string) : TfontStyles; +var fs : tFontStyles; +begin + fs:=[]; + if pos('G',s)<>0 then fs:=fs+[fsbold]; + if pos('I',s)<>0 then fs:=fs+[fsItalic]; + if pos('S',s)<>0 then fs:=fs+[fsUnderline]; + if pos('B',s)<>0 then fs:=fs+[fsStrikeout]; + style:=fs; +end; + +procedure affiche_texte(indextco,x,y : integer); +var b,x0,y0,xt,yt,repr,taillefont,tf : integer; + ss,s : string; + c : Tcanvas; +begin + x0:=(x-1)*LargeurCell[indexTCO]; + y0:=(y-1)*hauteurCell[indexTCO]; + //PCanvasTCO.Brush.Style:=bsSolid; + c:=PcanvasTCO[indextco]; + + b:=tco[indextco,x,y].BImage; + if (b=51) then PCanvasTCO[indextco].Brush.Color:=clQuai else PCanvasTCO[indextco].Brush.Color:=tco[indextco,x,y].CouleurFond; + c.Font.Color:=tco[indextco,x,y].CoulFonte; + ss:=tco[indextco,x,y].fonte; + if ss='' then ss:='Arial'; + c.Font.Name:=ss; + + ss:=tco[indextco,x,y].FontStyle; + + c.Font.Style:=style(ss); + + repr:=tco[indextco,x,y].repr; + 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; + if b=52 then xt:=6 else s:=s+' '; + + if taillefont=0 then taillefont:=8; + tf:=(taillefont*LargeurCell[indexTCO]) div 40; + c.font.Size:=tf; + if b=id_action then c.Brush.Color:=ClGray; + //affiche(intToSTR(taillefont*LargeurCell[indexTCO] div 40),clyellow); + // champ texte + + if repr=4 then texte_reparti(s,indextco,x,y,tf) else + c.Textout(x0+xt,y0+yt,s); + //PcanvasTCO[indextco].Textout(x0+xt,y0+yt,s); +end; + // essai pour dessiner les icones de façon paramétrées en fonction du numéro de dessin // et des points de connexion // numéro = numéro d'icone -procedure dessin(Canvas : Tcanvas;x,y,Mode,numero : integer); +procedure dessin(indexTCO : integer;Canvas : Tcanvas;x,y,Mode,numero : integer); var i,j,x0,y0,xc,yc,jy2,xf,yf,position,jy1,connect1,connect2,connect3,connect4 : integer; r : Trect; fond : tcolor; @@ -1282,14 +1576,23 @@ var i,j,x0,y0,xc,yc,jy2,xf,yf,position,jy1,connect1,connect2,connect3,connect4 : end; begin - x0:=(x-1)*LargeurCell; // x origine - y0:=(y-1)*HauteurCell; // y origine - yc:=y0+(HauteurCell div 2); // y centre - xc:=x0+(LargeurCell div 2); // x centre - xf:=x0+largeurCell; // x fin - yf:=y0+HauteurCell; // y fin - fond:=TCO[x,y].CouleurFond; - position:=positionTCO(x,y); + x0:=(x-1)*LargeurCell[indexTCO]; // x origine + y0:=(y-1)*HauteurCell[indexTCO]; // y origine + yc:=y0+(HauteurCell[indexTCO] div 2); // y centre + xc:=x0+(LargeurCell[indexTCO] div 2); // x centre + xf:=x0+largeurCell[indexTCO]; // x fin + yf:=y0+HauteurCell[indexTCO]; // y fin + + //Efface_Cellule(CanvasDest,x,y,pmCopy); + // ((Tpopupmenu(Tmenuitem(sender).GetParentMenu).PopupComponent) as TImage).name; + //f:=getparent(canvasDest.Handle); + //indexTCO:=index_TCO(getParentForm(canvas).name); + //f:=getParentForm(canvas as tcontrol); + + + + fond:=tco[indextco,x,y].CouleurFond; + position:=positionTCO(indexTCO,x,y); // extraire les points de connexion de l'icone (de 0 à 7) connect1:=0;connect2:=0;connect3:=0;connect4:=0; @@ -1348,7 +1651,7 @@ begin pen.width:=1; jy1:=yc-(Epaisseur div 2); // pos Y de la bande sup pen.width:=1; - Polygon([point(x0+1,y0+hauteurCell-epaisseur),Point(xc-(epaisseur div 2),jy1),Point(xc-epaisseur-epaisseur,jy1),Point(x0+1,y0+hauteurcell-epaisseur-epaisseur)]); + Polygon([point(x0+1,y0+hauteurCell[indexTCO]-epaisseur),Point(xc-(epaisseur div 2),jy1),Point(xc-epaisseur-epaisseur,jy1),Point(x0+1,y0+hauteurCell[indexTCO]-epaisseur-epaisseur)]); end; if position=const_droit then @@ -1358,7 +1661,7 @@ begin Brush.Color:=fond; pen.Width:=1; jy2:=yc+(Epaisseur div 2); // pos Y de la bande inf - r:=rect(x0+1,jy2+1,x0+largeurCell-1,jy2+epaisseur); + r:=rect(x0+1,jy2+1,x0+LargeurCell[indexTCO]-1,jy2+epaisseur); FillRect(r); end; end; @@ -1367,7 +1670,7 @@ end; // sert de référence11 -procedure dessin_2L(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; r : Trect; fond : tcolor; @@ -1417,15 +1720,15 @@ var x0,y0,xc,yc,jy2,xf,yf,position,jy1,ep : integer; end; begin - x0:=(x-1)*LargeurCell; // x origine - y0:=(y-1)*HauteurCell; // y origine - yc:=y0+(HauteurCell div 2); // y centre - xc:=x0+(LargeurCell div 2); // x centre - xf:=x0+largeurCell; // x fin - yf:=y0+HauteurCell; // y fin - fond:=TCO[x,y].CouleurFond; - position:=positionTCO(x,y); - ep:=tco[x,y].epaisseurs; + x0:=(x-1)*LargeurCell[indexTCO]; // x origine + y0:=(y-1)*hauteurCell[indexTCO]; // y origine + yc:=y0+(hauteurCell[indexTCO] div 2); // y centre + xc:=x0+(LargeurCell[indexTCO] div 2); // x centre + xf:=x0+LargeurCell[indexTCO]; // x fin + yf:=y0+hauteurCell[indexTCO]; // y fin + fond:=tco[indextco,x,y].CouleurFond; + position:=positionTCO(indexTCO,x,y); + ep:=tco[indextco,x,y].epaisseurs; with canvas do begin @@ -1466,7 +1769,7 @@ begin pen.width:=1; jy1:=yc-(Epaisseur div 2); // pos Y de la bande sup pen.width:=1; - Polygon([point(x0+1,y0+hauteurCell-epaisseur),Point(xc-(epaisseur div 2),jy1),Point(xc-epaisseur-epaisseur,jy1),Point(x0+1,y0+hauteurcell-epaisseur-epaisseur)]); + Polygon([point(x0+1,y0+hauteurCell[indexTCO]-epaisseur),Point(xc-(epaisseur div 2),jy1),Point(xc-epaisseur-epaisseur,jy1),Point(x0+1,y0+hauteurCell[indexTCO]-epaisseur-epaisseur)]); end; if position=const_droit then @@ -1476,7 +1779,7 @@ begin Brush.Color:=fond; pen.Width:=1; jy2:=yc+(Epaisseur div 2); // pos Y de la bande inf - r:=rect(x0+1,jy2+1,x0+largeurCell-1,jy2+epaisseur); + r:=rect(x0+1,jy2+1,x0+LargeurCell[indexTCO]-1,jy2+epaisseur); FillRect(r); end; @@ -1485,7 +1788,7 @@ end; // courbe -procedure dessin_2C(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_2C(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); var x0,y0,xc,yc,jy2,xf,yf,position,x1,y1,x2,y2,x3,y3,x4,y4,ep : integer; r : Trect; fond : tcolor; @@ -1506,7 +1809,7 @@ var x0,y0,xc,yc,jy2,xf,yf,position,x1,y1,x2,y2,x3,y3,x4,y4,ep : integer; begin if testbit(ep,7) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; pen.color:=couleur; - moveto(x0,yc);lineto(xc,yc); + moveto(x0,yc);lineto(xc,yc); if testbit(ep,3) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; lineto(xf,yc); end; @@ -1533,20 +1836,20 @@ var x0,y0,xc,yc,jy2,xf,yf,position,x1,y1,x2,y2,x3,y3,x4,y4,ep : integer; end; begin - x0:=(x-1)*LargeurCell; // x origine - y0:=(y-1)*HauteurCell; // y origine - yc:=y0+(HauteurCell div 2); // y centre - xc:=x0+(LargeurCell div 2); // x centre - xf:=x0+largeurCell; // x fin - yf:=y0+HauteurCell; // y fin - fond:=TCO[x,y].CouleurFond; - position:=positionTCO(x,y); - ep:=tco[x,y].epaisseurs; + x0:=(x-1)*LargeurCell[indexTCO]; // x origine + y0:=(y-1)*hauteurCell[indexTCO]; // y origine + yc:=y0+(hauteurCell[indexTCO] div 2); // y centre + xc:=x0+(LargeurCell[indexTCO] div 2); // x centre + xf:=x0+LargeurCell[indexTCO]; // x fin + yf:=y0+hauteurCell[indexTCO]; // y fin + fond:=tco[indextco,x,y].CouleurFond; + position:=positionTCO(indexTCO,x,y); + ep:=tco[indextco,x,y].epaisseurs; // mode rond x1:=xf-x0; x1:=x0-(x1 div 3);y1:=yc; - x2:=xf+xf-x1;y2:=yf+hauteurCell*2+(hauteurCell div 2); + x2:=xf+xf-x1;y2:=yf+hauteurCell[indexTCO]*2+(hauteurCell[indexTCO] div 2); x3:=xf;y3:=yc; x4:=x0;y4:=yf; @@ -1592,7 +1895,7 @@ begin point(x0+3,yf-epaisseur-5), Point(xc+2*epaisseur,yc-epaisseur), Point(xc-epaisseur,yc-epaisseur)]); - //Point(x0+1,y0+hauteurcell-epaisseur-epaisseur)]); + //Point(x0+1,y0+hauteurCell[indexTCO]-epaisseur-epaisseur)]); end; if position=const_droit then @@ -1602,19 +1905,19 @@ begin Brush.Color:=fond; pen.Width:=1; jy2:=yc+(Epaisseur div 2); // pos Y de la bande inf - r:=rect(x0+1,jy2+1,x0+largeurCell-1,jy2+epaisseur); + r:=rect(x0+1,jy2+1,x0+LargeurCell[indexTCO]-1,jy2+epaisseur); FillRect(r); end; end; end; -procedure dessin_2(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_2(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); begin - if graphisme=1 then dessin_2L(Canvas,x,y,Mode); - if graphisme=2 then dessin_2C(Canvas,x,y,Mode); + if graphisme=1 then dessin_2L(indexTCO,Canvas,x,y,Mode); + if graphisme=2 then dessin_2C(indexTCO,Canvas,x,y,Mode); end; -procedure dessin_3L(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_3L(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); var x0,y0,xc,yc,jy1,xf,yf,position,ep : integer; fond : Tcolor; r : Trect; @@ -1664,15 +1967,15 @@ var x0,y0,xc,yc,jy1,xf,yf,position,ep : integer; end; begin - x0:=(x-1)*LargeurCell; // x origine - y0:=(y-1)*HauteurCell; // y origine - yc:=y0+(HauteurCell div 2); // y centre - xc:=x0+(LargeurCell div 2); // x centre - xf:=x0+largeurCell; // x fin - yf:=y0+HauteurCell; // y fin - fond:=TCO[x,y].CouleurFond; - position:=positionTCO(x,y); - ep:=tco[x,y].epaisseurs; + x0:=(x-1)*LargeurCell[indexTCO]; // x origine + y0:=(y-1)*hauteurCell[indexTCO]; // y origine + yc:=y0+(hauteurCell[indexTCO] div 2); // y centre + xc:=x0+(LargeurCell[indexTCO] div 2); // x centre + xf:=x0+LargeurCell[indexTCO]; // x fin + yf:=y0+hauteurCell[indexTCO]; // y fin + fond:=tco[indextco,x,y].CouleurFond; + position:=positionTCO(indexTCO,x,y); + ep:=tco[indextco,x,y].epaisseurs; with canvas do begin @@ -1721,13 +2024,13 @@ begin Brush.Color:=fond; pen.Width:=1; jy1:=yc-(Epaisseur div 2); // pos Y de la bande sup - r:=rect(x0+1,jy1,x0+largeurCell-1,jy1-epaisseur); + r:=rect(x0+1,jy1,x0+LargeurCell[indexTCO]-1,jy1-epaisseur); FillRect(r); end; end; end; -procedure dessin_3C(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_3C(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); var x0,y0,xc,yc,jy1,xf,yf,position,x1,y1,x2,y2,x3,y3,x4,y4,ep : integer; fond : Tcolor; r : Trect; @@ -1748,7 +2051,7 @@ var x0,y0,xc,yc,jy1,xf,yf,position,x1,y1,x2,y2,x3,y3,x4,y4,ep : integer; begin if testbit(ep,7) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; pen.color:=couleur; - moveto(x0,yc);lineto(xc,yc); + moveto(x0,yc);lineto(xc,yc); if testbit(ep,3) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; lineto(xf,yc); end; @@ -1775,23 +2078,24 @@ var x0,y0,xc,yc,jy1,xf,yf,position,x1,y1,x2,y2,x3,y3,x4,y4,ep : integer; end; begin - x0:=(x-1)*LargeurCell; // x origine - y0:=(y-1)*HauteurCell; // y origine - yc:=y0+(HauteurCell div 2); // y centre - xc:=x0+(LargeurCell div 2); // x centre - xf:=x0+largeurCell; // x fin - yf:=y0+HauteurCell; // y fin - ep:=tco[x,y].epaisseurs; + x0:=(x-1)*LargeurCell[indexTCO]; // x origine + y0:=(y-1)*hauteurCell[indexTCO]; // y origine + yc:=y0+(hauteurCell[indexTCO] div 2); // y centre + xc:=x0+(LargeurCell[indexTCO] div 2); // x centre + xf:=x0+LargeurCell[indexTCO]; // x fin + yf:=y0+hauteurCell[indexTCO]; // y fin + ep:=tco[indextco,x,y].epaisseurs; // mode rond - x1:=x0-largeurCell-(largeurCell div 3);y1:=y0-2*hauteurCell-(hauteurCell div 2); - x2:=xf+(largeurcell div 3)+3;y2:=yc; + x1:=x0-LargeurCell[indexTCO]-(LargeurCell[indexTCO] div 3);y1:=y0-2*hauteurCell[indexTCO]-(hauteurCell[indexTCO] div 2); + x2:=xf+(LargeurCell[indexTCO] div 3)+3;y2:=yc; x3:=x0;y3:=yc; x4:=xf;y4:=y0; - position:=positionTCO(x,y); - fond:=TCO[x,y].CouleurFond; - efface_selection; + position:=positionTCO(indexTCO,x,y); + fond:=tco[indextco,x,y].CouleurFond; + //&&& remonter au parent depuis le canvas.....pour trouver l'index du TCO + efface_selection(1); with canvas do begin @@ -1848,7 +2152,7 @@ begin Brush.Color:=fond; pen.Width:=1; jy1:=yc-(Epaisseur div 2); // pos Y de la bande sup - r:=rect(x0+1,jy1,x0+largeurCell-1,jy1-epaisseur); + r:=rect(x0+1,jy1,x0+LargeurCell[indexTCO]-1,jy1-epaisseur); FillRect(r); end; end; @@ -1862,13 +2166,13 @@ begin end; -procedure dessin_3(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_3(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); begin - if graphisme=1 then dessin_3L(Canvas,x,y,Mode); - if graphisme=2 then dessin_3C(Canvas,x,y,Mode); + if graphisme=1 then dessin_3L(indexTCO,Canvas,x,y,Mode); + if graphisme=2 then dessin_3C(indexTCO,Canvas,x,y,Mode); end; - -procedure dessin_4L(Canvas : Tcanvas;x,y : integer;Mode : integer); + +procedure dessin_4L(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; r : Trect; fond : tcolor; @@ -1888,7 +2192,7 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; begin if testbit(ep,7) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; pen.color:=couleur; - moveto(x0,yc);lineto(xc,yc); + moveto(x0,yc);lineto(xc,yc); if testbit(ep,3) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; lineto(xf,yc); end; @@ -1917,15 +2221,15 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; end; begin - x0:=(x-1)*LargeurCell; // x origine - y0:=(y-1)*HauteurCell; // y origine - yc:=y0+(HauteurCell div 2); // y centre - xc:=x0+(LargeurCell div 2); // x centre - xf:=x0+largeurCell; // x fin - yf:=y0+HauteurCell; // y fin - fond:=TCO[x,y].CouleurFond; - position:=positionTCO(x,y); - ep:=tco[x,y].epaisseurs; + x0:=(x-1)*LargeurCell[indexTCO]; // x origine + y0:=(y-1)*hauteurCell[indexTCO]; // y origine + yc:=y0+(hauteurCell[indexTCO] div 2); // y centre + xc:=x0+(LargeurCell[indexTCO] div 2); // x centre + xf:=x0+LargeurCell[indexTCO]; // x fin + yf:=y0+hauteurCell[indexTCO]; // y fin + fond:=tco[indextco,x,y].CouleurFond; + position:=positionTCO(indexTCO,x,y); + ep:=tco[indextco,x,y].epaisseurs; with canvas do begin @@ -1986,7 +2290,7 @@ begin end; end; -procedure dessin_4C(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_4C(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); var x0,y0,xc,yc,xf,yf,x1,y1,x2,y2,x3,y3,x4,y4,position,ep : integer; r : Trect; fond : tcolor; @@ -2035,22 +2339,22 @@ var x0,y0,xc,yc,xf,yf,x1,y1,x2,y2,x3,y3,x4,y4,position,ep : integer; begin - x0:=(x-1)*LargeurCell; // x origine - y0:=(y-1)*HauteurCell; // y origine - yc:=y0+(HauteurCell div 2); // y centre - xc:=x0+(LargeurCell div 2); // x centre - xf:=x0+largeurCell; // x fin - yf:=y0+HauteurCell; // y fin - ep:=tco[x,y].epaisseurs; + x0:=(x-1)*LargeurCell[indexTCO]; // x origine + y0:=(y-1)*hauteurCell[indexTCO]; // y origine + yc:=y0+(hauteurCell[indexTCO] div 2); // y centre + xc:=x0+(LargeurCell[indexTCO] div 2); // x centre + xf:=x0+LargeurCell[indexTCO]; // x fin + yf:=y0+hauteurCell[indexTCO]; // y fin + ep:=tco[indextco,x,y].epaisseurs; // mode rond - x1:=x0-largeurCell-(largeurCell div 3);y1:=yc; - x2:=xf+(largeurcell div 3);y2:=yf+2*hauteurcell+(hauteurcell div 2); + x1:=x0-LargeurCell[indexTCO]-(LargeurCell[indexTCO] div 3);y1:=yc; + x2:=xf+(LargeurCell[indexTCO] div 3);y2:=yf+2*hauteurCell[indexTCO]+(hauteurCell[indexTCO] div 2); x3:=xf;y3:=yf; x4:=x0;y4:=yc; - position:=positionTCO(x,y); - fond:=TCO[x,y].CouleurFond; + position:=positionTCO(indexTCO,x,y); + fond:=tco[indextco,x,y].CouleurFond; with canvas do begin @@ -2112,13 +2416,13 @@ begin end; -procedure dessin_4(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_4(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); begin - if graphisme=1 then dessin_4L(Canvas,x,y,Mode); - if graphisme=2 then dessin_4C(Canvas,x,y,Mode); + if graphisme=1 then dessin_4L(indexTCO,Canvas,x,y,Mode); + if graphisme=2 then dessin_4C(indexTCO,Canvas,x,y,Mode); end; - -procedure dessin_5L(Canvas : Tcanvas;x,y : integer;Mode : integer); + +procedure dessin_5L(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; r : Trect; fond : tcolor; @@ -2168,15 +2472,15 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; end; begin - x0:=(x-1)*LargeurCell; // x origine - y0:=(y-1)*HauteurCell; // y origine - yc:=y0+(HauteurCell div 2); // y centre - xc:=x0+(LargeurCell div 2); // x centre - xf:=x0+largeurCell; // x fin - yf:=y0+HauteurCell; // y fin - fond:=TCO[x,y].CouleurFond; - position:=positionTCO(x,y); - ep:=tco[x,y].epaisseurs; + x0:=(x-1)*LargeurCell[indexTCO]; // x origine + y0:=(y-1)*hauteurCell[indexTCO]; // y origine + yc:=y0+(hauteurCell[indexTCO] div 2); // y centre + xc:=x0+(LargeurCell[indexTCO] div 2); // x centre + xf:=x0+LargeurCell[indexTCO]; // x fin + yf:=y0+hauteurCell[indexTCO]; // y fin + fond:=tco[indextco,x,y].CouleurFond; + position:=positionTCO(indexTCO,x,y); + ep:=tco[indextco,x,y].epaisseurs; with canvas do begin @@ -2237,7 +2541,7 @@ begin end; end; -procedure dessin_5C(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_5C(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; r : Trect; fond : tcolor; @@ -2285,19 +2589,19 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; end; begin - x0:=(x-1)*LargeurCell; // x origine - y0:=(y-1)*HauteurCell; // y origine - yc:=y0+(HauteurCell div 2); // y centre - xc:=x0+(LargeurCell div 2); // x centre - xf:=x0+largeurCell; // x fin - yf:=y0+HauteurCell; // y fin - position:=positionTCO(x,y); - fond:=TCO[x,y].CouleurFond; - ep:=tco[x,y].epaisseurs; + x0:=(x-1)*LargeurCell[indexTCO]; // x origine + y0:=(y-1)*hauteurCell[indexTCO]; // y origine + yc:=y0+(hauteurCell[indexTCO] div 2); // y centre + xc:=x0+(LargeurCell[indexTCO] div 2); // x centre + xf:=x0+LargeurCell[indexTCO]; // x fin + yf:=y0+hauteurCell[indexTCO]; // y fin + position:=positionTCO(indexTCO,x,y); + fond:=tco[indextco,x,y].CouleurFond; + ep:=tco[indextco,x,y].epaisseurs; // mode rond - x1:=x0-(largeurCell div 3);y1:=y0-2*hauteurCell-(hauteurCell div 2)+4; - x2:=xf+largeurCell+(largeurcell div 3);y2:=yc; + x1:=x0-(LargeurCell[indexTCO] div 3);y1:=y0-2*hauteurCell[indexTCO]-(hauteurCell[indexTCO] div 2)+4; + x2:=xf+LargeurCell[indexTCO]+(LargeurCell[indexTCO] div 3);y2:=yc; x3:=x0;y3:=y0; x4:=xf;y4:=yc; @@ -2361,28 +2665,26 @@ begin end; -procedure dessin_5(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_5(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); begin - if graphisme=1 then dessin_5L(Canvas,x,y,Mode); - if graphisme=2 then dessin_5C(Canvas,x,y,Mode); + if graphisme=1 then dessin_5L(indexTCO,Canvas,x,y,Mode); + if graphisme=2 then dessin_5C(indexTCO,Canvas,x,y,Mode); end; // coin supérieur gauche (Element 6) -procedure dessin_6L(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_6L(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); var x0,y0,xc,yc,ep : integer; begin - x0:=(x-1)*LargeurCell; - y0:=(y-1)*HauteurCell; - xc:=x0+(largeurCell div 2); - yc:=y0+(hauteurCell div 2); - ep:=tco[x,y].epaisseurs; - + x0:=(x-1)*LargeurCell[indexTCO]; + y0:=(y-1)*hauteurCell[indexTCO]; + xc:=x0+(LargeurCell[indexTCO] div 2); + yc:=y0+(hauteurCell[indexTCO] div 2); + ep:=tco[indextco,x,y].epaisseurs; + with canvas do begin - Brush.Color:=TCO[x,y].CouleurFond; + Brush.Color:=tco[indextco,x,y].CouleurFond; Pen.Width:=1; - //r:=Rect(x0,y0,x0+LargeurCell,y0+HauteurCell); - //FillRect(r); case mode of 0: couleur:=clVoies; @@ -2397,30 +2699,30 @@ begin if testbit(ep,0) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; moveto(x0,y0);lineto(xc,yc); if testbit(ep,3) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; - Lineto(x0+largeurCell,yc); + Lineto(x0+LargeurCell[indexTCO],yc); end; end; // coin supérieur gauche (Element 6) -procedure dessin_6C(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_6C(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); var x0,y0,xc,yc,x1,y1,x2,y2,x3,y3,x4,y4,xf,yf,ep : integer; begin - x0:=(x-1)*LargeurCell; - y0:=(y-1)*HauteurCell; - xc:=x0+(largeurCell div 2); - yc:=y0+(hauteurCell div 2); - xf:=x0+largeurCell; // x fin - yf:=y0+HauteurCell; // y fin - ep:=tco[x,y].epaisseurs; - + x0:=(x-1)*LargeurCell[indexTCO]; + y0:=(y-1)*hauteurCell[indexTCO]; + xc:=x0+(LargeurCell[indexTCO] div 2); + yc:=y0+(hauteurCell[indexTCO] div 2); + xf:=x0+LargeurCell[indexTCO]; // x fin + yf:=y0+hauteurCell[indexTCO]; // y fin + ep:=tco[indextco,x,y].epaisseurs; + // mode rond - x1:=x0-(largeurCell div 3);y1:=y0-2*hauteurCell-(hauteurCell div 2); - x2:=xf+largeurCell+(largeurcell div 3);y2:=yc; + x1:=x0-(LargeurCell[indexTCO] div 3);y1:=y0-2*hauteurCell[indexTCO]-(hauteurCell[indexTCO] div 2); + x2:=xf+LargeurCell[indexTCO]+(LargeurCell[indexTCO] div 3);y2:=yc; x3:=x0;y3:=y0; x4:=xf;y4:=yc; with canvas do begin - Brush.Color:=TCO[x,y].CouleurFond; + Brush.Color:=tco[indextco,x,y].CouleurFond; Pen.Width:=1; case mode of @@ -2428,7 +2730,8 @@ begin 1: couleur:=ClCanton; 2: couleur:=couleurtrain[index_couleur]; end; - Pen.Width:=epaisseur; + + if testbit(ep,0) or testbit(ep,3) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; Brush.Color:=Couleur; pen.color:=Couleur; Pen.Mode:=pmCopy; @@ -2436,27 +2739,27 @@ begin end; end; -procedure dessin_6(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_6(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); begin - if graphisme=1 then dessin_6L(Canvas,x,y,Mode); - if graphisme=2 then dessin_6C(Canvas,x,y,Mode); + if graphisme=1 then dessin_6L(indexTCO,Canvas,x,y,Mode); + if graphisme=2 then dessin_6C(indexTCO,Canvas,x,y,Mode); end; // Element 7 -procedure dessin_7L(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_7L(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); var x0,y0,xc,yc,ep : integer; begin - x0:=(x-1)*LargeurCell; - y0:=(y-1)*HauteurCell; - xc:=x0+(largeurCell div 2); - yc:=y0+(hauteurCell div 2); - ep:=tco[x,y].epaisseurs; + x0:=(x-1)*LargeurCell[indexTCO]; + y0:=(y-1)*hauteurCell[indexTCO]; + xc:=x0+(LargeurCell[indexTCO] div 2); + yc:=y0+(hauteurCell[indexTCO] div 2); + ep:=tco[indextco,x,y].epaisseurs; with canvas do begin - Brush.Color:=TCO[x,y].CouleurFond; + Brush.Color:=tco[indextco,x,y].CouleurFond; Pen.Width:=1; - //r:=Rect(x0,y0,x0+LargeurCell,y0+HauteurCell); + //r:=Rect(x0,y0,x0+LargeurCell[indexTCO],y0+hauteurCell[indexTCO]); //FillRect(r); case mode of @@ -2471,32 +2774,32 @@ begin if testbit(ep,7) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; moveto(x0,yc);lineto(xc,yc); if testbit(ep,2) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; - lineto(x0+largeurCell,y0); + lineto(x0+LargeurCell[indexTCO],y0); end; end; -procedure dessin_7C(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_7C(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); var x0,y0,xc,yc,x1,y1,x2,y2,x3,y3,x4,y4,xf,yf,ep : integer; begin - x0:=(x-1)*LargeurCell; - y0:=(y-1)*HauteurCell; - xc:=x0+(largeurCell div 2); - yc:=y0+(hauteurCell div 2); - xf:=x0+largeurCell; // x fin - yf:=y0+HauteurCell; // y fin - ep:=tco[x,y].epaisseurs; + x0:=(x-1)*LargeurCell[indexTCO]; + y0:=(y-1)*hauteurCell[indexTCO]; + xc:=x0+(LargeurCell[indexTCO] div 2); + yc:=y0+(hauteurCell[indexTCO] div 2); + xf:=x0+LargeurCell[indexTCO]; // x fin + yf:=y0+hauteurCell[indexTCO]; // y fin + ep:=tco[indextco,x,y].epaisseurs; // mode rond - x1:=x0-largeurCell-(largeurCell div 3);y1:=y0-2*hauteurCell-(hauteurCell div 2); - x2:=xf+(largeurcell div 3)+3;y2:=yc; + x1:=x0-LargeurCell[indexTCO]-(LargeurCell[indexTCO] div 3);y1:=y0-2*hauteurCell[indexTCO]-(hauteurCell[indexTCO] div 2); + x2:=xf+(LargeurCell[indexTCO] div 3)+3;y2:=yc; x3:=x0;y3:=yc; x4:=xf;y4:=y0; with canvas do begin - Brush.Color:=TCO[x,y].CouleurFond; + Brush.Color:=tco[indextco,x,y].CouleurFond; Pen.Width:=1; - //r:=Rect(x0,y0,x0+LargeurCell,y0+HauteurCell); + //r:=Rect(x0,y0,x0+LargeurCell[indexTCO],y0+hauteurCell[indexTCO]); //FillRect(r); case mode of @@ -2507,32 +2810,32 @@ begin Brush.Color:=Couleur; pen.color:=couleur; Pen.Mode:=pmCopy; - Pen.Width:=epaisseur; + if testbit(ep,2) or testbit(ep,7) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; canvas.Arc(x1,y1,x2,y2,x3,y3,x4,y4); end; end; -procedure dessin_7(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_7(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); begin - if graphisme=1 then dessin_7L(Canvas,x,y,Mode); - if graphisme=2 then dessin_7C(Canvas,x,y,Mode); + if graphisme=1 then dessin_7L(indexTCO,Canvas,x,y,Mode); + if graphisme=2 then dessin_7C(indexTCO,Canvas,x,y,Mode); end; // courbe: droit vers bas -\ Element 8 -procedure dessin_8L(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_8L(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); var x0,y0,xc,yc,ep : integer; begin - x0:=(x-1)*LargeurCell; - y0:=(y-1)*HauteurCell; - xc:=x0+(largeurCell div 2); - yc:=y0+(hauteurCell div 2); - ep:=tco[x,y].epaisseurs; + x0:=(x-1)*LargeurCell[indexTCO]; + y0:=(y-1)*hauteurCell[indexTCO]; + xc:=x0+(LargeurCell[indexTCO] div 2); + yc:=y0+(hauteurCell[indexTCO] div 2); + ep:=tco[indextco,x,y].epaisseurs; with canvas do begin - Brush.Color:=TCO[x,y].CouleurFond; + Brush.Color:=tco[indextco,x,y].CouleurFond; Pen.Width:=1; - //r:=Rect(x0,y0,x0+LargeurCell,y0+HauteurCell); + //r:=Rect(x0,y0,x0+LargeurCell[indexTCO],y0+hauteurCell[indexTCO]); //FillRect(r); case mode of @@ -2543,36 +2846,36 @@ begin Brush.Color:=Couleur; Pen.Mode:=pmCopy; pen.color:=Couleur; - + if testbit(ep,7) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; moveto(x0,yc);lineto(xc,yc); if testbit(ep,4) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; - lineto(x0+largeurCell,y0+hauteurCell); + lineto(x0+LargeurCell[indexTCO],y0+hauteurCell[indexTCO]); end; end; -procedure dessin_8C(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_8C(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); var x0,y0,xc,yc,x1,y1,x2,y2,x3,y3,x4,y4,xf,yf,ep : integer; begin - x0:=(x-1)*LargeurCell; - y0:=(y-1)*HauteurCell; - xc:=x0+(largeurCell div 2); - yc:=y0+(hauteurCell div 2); - xf:=x0+largeurCell; // x fin - yf:=y0+HauteurCell; // y fin + x0:=(x-1)*LargeurCell[indexTCO]; + y0:=(y-1)*hauteurCell[indexTCO]; + xc:=x0+(LargeurCell[indexTCO] div 2); + yc:=y0+(hauteurCell[indexTCO] div 2); + xf:=x0+LargeurCell[indexTCO]; // x fin + yf:=y0+hauteurCell[indexTCO]; // y fin // mode rond - x1:=x0-largeurCell-(largeurCell div 3);y1:=yc; - x2:=xf+(largeurcell div 3);y2:=yf+2*hauteurcell+(hauteurcell div 2); + x1:=x0-LargeurCell[indexTCO]-(LargeurCell[indexTCO] div 3);y1:=yc; + x2:=xf+(LargeurCell[indexTCO] div 3);y2:=yf+2*hauteurCell[indexTCO]+(hauteurCell[indexTCO] div 2); x3:=xf;y3:=yf; x4:=x0;y4:=yc; - ep:=tco[x,y].epaisseurs; + ep:=tco[indextco,x,y].epaisseurs; with canvas do begin - Brush.Color:=TCO[x,y].CouleurFond; + Brush.Color:=tco[indextco,x,y].CouleurFond; Pen.Width:=1; - //r:=Rect(x0,y0,x0+LargeurCell,y0+HauteurCell); + //r:=Rect(x0,y0,x0+LargeurCell[indexTCO],y0+hauteurCell[indexTCO]); //FillRect(r); case mode of @@ -2583,32 +2886,32 @@ begin Brush.Color:=Couleur; Pen.Mode:=pmCopy; pen.color:=Couleur; - pen.Width:=epaisseur; + if testbit(ep,7) or testbit(ep,4) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; canvas.Arc(x1,y1,x2,y2,x3,y3,x4,y4); end; end; -procedure dessin_8(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_8(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); begin - if graphisme=1 then dessin_8L(Canvas,x,y,Mode); - if graphisme=2 then dessin_8C(Canvas,x,y,Mode); + if graphisme=1 then dessin_8L(indexTCO,Canvas,x,y,Mode); + if graphisme=2 then dessin_8C(indexTCO,Canvas,x,y,Mode); end; // courbe bas gauche vers droit Elément 9 -procedure dessin_9l(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_9l(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); var x0,y0,xc,yc,ep : integer; begin - x0:=(x-1)*LargeurCell; - y0:=(y-1)*HauteurCell; - xc:=x0+(largeurCell div 2); - yc:=y0+(hauteurCell div 2); - ep:=tco[x,y].epaisseurs; + x0:=(x-1)*LargeurCell[indexTCO]; + y0:=(y-1)*hauteurCell[indexTCO]; + xc:=x0+(LargeurCell[indexTCO] div 2); + yc:=y0+(hauteurCell[indexTCO] div 2); + ep:=tco[indextco,x,y].epaisseurs; with canvas do begin - Brush.Color:=TCO[x,y].CouleurFond; + Brush.Color:=tco[indextco,x,y].CouleurFond; Pen.Width:=1; - //r:=Rect(x0,y0,x0+LargeurCell,y0+HauteurCell); + //r:=Rect(x0,y0,x0+LargeurCell[indexTCO],y0+hauteurCell[indexTCO]); //FillRect(r); case mode of @@ -2621,37 +2924,37 @@ begin Pen.Mode:=pmCopy; if testbit(ep,6) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; - MoveTo(x0,y0+hauteurCell);lineto(xc,yc); + MoveTo(x0,y0+hauteurCell[indexTCO]);lineto(xc,yc); if testbit(ep,3) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; - LineTo(x0+largeurCell,yc); + LineTo(x0+LargeurCell[indexTCO],yc); end; end; // courbe bas gauche vers droit Elément 9 -procedure dessin_9c(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_9c(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); var x0,y0,xc,yc,x1,y1,x2,y2,x3,y3,x4,y4,xf,yf,ep : integer; begin - x0:=(x-1)*LargeurCell; - y0:=(y-1)*HauteurCell; - xc:=x0+(largeurCell div 2); - yc:=y0+(hauteurCell div 2); - xf:=x0+largeurCell; - yf:=y0+HauteurCell; - ep:=tco[x,y].epaisseurs; + x0:=(x-1)*LargeurCell[indexTCO]; + y0:=(y-1)*hauteurCell[indexTCO]; + xc:=x0+(LargeurCell[indexTCO] div 2); + yc:=y0+(hauteurCell[indexTCO] div 2); + xf:=x0+LargeurCell[indexTCO]; + yf:=y0+hauteurCell[indexTCO]; + ep:=tco[indextco,x,y].epaisseurs; // mode rond x1:=xf-x0; x1:=x0-(x1 div 3);y1:=yc; - x2:=xf+xf-x1;y2:=yf+hauteurCell*2+(hauteurCell div 2); + x2:=xf+xf-x1;y2:=yf+hauteurCell[indexTCO]*2+(hauteurCell[indexTCO] div 2); x3:=xf;y3:=yc; x4:=x0;y4:=yf; with canvas do begin - Brush.Color:=TCO[x,y].CouleurFond; + Brush.Color:=tco[indextco,x,y].CouleurFond; Pen.Width:=1; - //r:=Rect(x0,y0,x0+LargeurCell,y0+HauteurCell); + //r:=Rect(x0,y0,x0+LargeurCell[indexTCO],y0+hauteurCell[indexTCO]); //FillRect(r); case mode of @@ -2668,28 +2971,60 @@ begin end; end; -procedure dessin_9(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_9(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); begin - if graphisme=1 then dessin_9L(Canvas,x,y,Mode); - if graphisme=2 then dessin_9C(Canvas,x,y,Mode); + if graphisme=1 then dessin_9L(indexTCO,Canvas,x,y,Mode); + if graphisme=2 then dessin_9C(indexTCO,Canvas,x,y,Mode); end; // élément 10 -procedure dessin_10(Canvas : Tcanvas;x,y : integer;Mode : integer); -var Adr, x0,y0,ep: integer; +procedure dessin_10(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); +var Adr,but,x0,y0,xc,yc,xf,yf,ep: integer; begin - x0:=(x-1)*LargeurCell; - y0:=(y-1)*HauteurCell; - ep:=tco[x,y].epaisseurs; + x0:=(x-1)*LargeurCell[indexTCO]; + y0:=(y-1)*hauteurCell[indexTCO]; + xc:=x0+(LargeurCell[indexTCO] div 2); + yc:=y0+(hauteurCell[indexTCO] div 2); + xf:=x0+LargeurCell[indexTCO]; + yf:=y0+hauteurCell[indexTCO]; + ep:=tco[indextco,x,y].epaisseurs; + but:=tco[indextco,x,y].buttoir; with canvas do begin - Brush.Color:=TCO[x,y].CouleurFond; + Brush.Color:=tco[indextco,x,y].CouleurFond; Pen.Width:=1; - //r:=Rect(x0,y0,x0+LargeurCell,y0+HauteurCell); + //r:=Rect(x0,y0,x0+LargeurCell[indexTCO],y0+hauteurCell[indexTCO]); //FillRect(r); - Adr:=TCO[x,y].adresse; + + if but<>0 then + begin + case mode of + 0 : couleur:=clVoies; + 1 : couleur:=clAllume; + 2 : couleur:=couleurtrain[index_couleur]; + end; + pen.color:=couleur; + if testbit(ep,2) or testbit(ep,6) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; + + if testBit(but,2) then + begin + moveTo(xf,y0);LineTo(xc,yc); + end; + if testBit(but,6) then + begin + moveTo(x0,yf);LineTo(xc,yc); + end; + + Pen.Width:=epaisseur; + pen.Color:=Clred; + moveto(xc-round(5*frxGlob[indexTCO]),yc-round(5*fryGlob[indexTCO])); + LineTo(xc+round(5*frxGlob[indexTCO]),yc+round(5*fryGlob[indexTCO])); + exit; + end; + + Adr:=tco[indextco,x,y].adresse; // détecteur if adr<>0 then begin @@ -2700,12 +3035,12 @@ begin end else begin - pen.color:=TCO[x,y].CouleurFond; - brush.color:=TCO[x,y].CouleurFond; + pen.color:=tco[indextco,x,y].CouleurFond; + brush.color:=tco[indextco,x,y].CouleurFond; end; - // if avecGrille then r:=Rect(x0+1,jy1,x0+LargeurCell-1,jy2) else + // if avecGrille then r:=Rect(x0+1,jy1,x0+LargeurCell[indexTCO]-1,jy2) else pen.Width:=epaisseur+3; - MoveTo(x0+largeurCell,y0);LineTo(x0,y0+hauteurCell); + MoveTo(x0+LargeurCell[indexTCO],y0);LineTo(x0,y0+hauteurCell[indexTCO]); end; // voie @@ -2717,26 +3052,56 @@ begin pen.color:=couleur; if testbit(ep,6) or testbit(ep,2) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; - MoveTo(x0+largeurCell,y0);LineTo(x0,y0+hauteurCell); + MoveTo(x0+LargeurCell[indexTCO],y0);LineTo(x0,y0+hauteurCell[indexTCO]); end; end; // élément 11 -procedure dessin_11(Canvas : Tcanvas;x,y : integer;Mode : integer); -var Adr, x0,y0,ep : integer; +procedure dessin_11(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); +var Adr, x0,y0,xc,yc,xf,yf,ep,but : integer; begin - x0:=(x-1)*LargeurCell; - y0:=(y-1)*HauteurCell; - ep:=tco[x,y].epaisseurs; - + x0:=(x-1)*LargeurCell[indexTCO]; + y0:=(y-1)*hauteurCell[indexTCO]; + xc:=x0+(LargeurCell[indexTCO] div 2); + yc:=y0+(hauteurCell[indexTCO] div 2); + xf:=x0+LargeurCell[indexTCO]; + yf:=y0+hauteurCell[indexTCO]; + ep:=tco[indextco,x,y].epaisseurs; + but:=tco[indextco,x,y].buttoir; + with canvas do begin - Brush.Color:=TCO[x,y].CouleurFond; + Brush.Color:=tco[indextco,x,y].CouleurFond; Pen.Width:=1; - //r:=Rect(x0,y0,x0+LargeurCell,y0+HauteurCell); - //FillRect(r); - Adr:=TCO[x,y].adresse; + if testbit(but,0) or testbit(but,4) then + begin + case mode of + 0 : couleur:=clVoies; + 1 : couleur:=clAllume; + 2 : couleur:=couleurtrain[index_couleur]; + end; + pen.color:=couleur; + if testbit(ep,0) or testbit(ep,4) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; + + if testBit(but,0) then + begin + moveTo(x0,y0);LineTo(xc,yc); + end; + if testBit(but,4) then + begin + moveTo(xf,yf);LineTo(xc,yc); + end; + + Pen.Width:=epaisseur; + pen.Color:=Clred; + moveto(xc+round(5*frxGlob[indexTCO]),yc-round(5*fryGlob[indexTCO])); + LineTo(xc-round(5*frxGlob[indexTCO]),yc+round(5*fryGlob[indexTCO])); + exit; + end; + + + Adr:=tco[indextco,x,y].adresse; // détecteur if adr<>0 then begin @@ -2747,12 +3112,12 @@ begin end else begin - pen.color:=TCO[x,y].CouleurFond; - brush.color:=TCO[x,y].CouleurFond; + pen.color:=tco[indextco,x,y].CouleurFond; + brush.color:=tco[indextco,x,y].CouleurFond; end; - // if avecGrille then r:=Rect(x0+1,jy1,x0+LargeurCell-1,jy2) else + // if avecGrille then r:=Rect(x0+1,jy1,x0+LargeurCell[indexTCO]-1,jy2) else pen.Width:=epaisseur+3; - MoveTo(x0,y0);LineTo(x0+largeurCell,y0+hauteurCell); + MoveTo(x0,y0);LineTo(x0+LargeurCell[indexTCO],y0+hauteurCell[indexTCO]); end; // voie @@ -2764,13 +3129,13 @@ begin pen.color:=couleur; if testbit(ep,0) or testbit(ep,4) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; - MoveTo(x0,y0);LineTo(x0+largeurCell,y0+hauteurCell); + MoveTo(x0,y0);LineTo(x0+LargeurCell[indexTCO],y0+hauteurCell[indexTCO]); end; end; -// Element 12 -procedure dessin_12L(Canvas : Tcanvas;x,y : integer;Mode : integer); +// Element 12 +procedure dessin_12L(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; fond : tcolor; @@ -2790,9 +3155,9 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; begin if testbit(ep,0) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; pen.color:=couleur; - moveto(x0,y0);lineto(xc,yc); + moveto(x0,y0);lineto(xc,yc); if testbit(ep,4) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; - lineto(xf,yf); + lineto(xf,yf); end; end; @@ -2813,24 +3178,24 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; pen.color:=couleur; if testbit(ep,0) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; pen.color:=couleur; - moveto(x0,y0);lineto(xc,yc); + moveto(x0,y0);lineto(xc,yc); if testbit(ep,3) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; - lineto(xf,yc); - + lineto(xf,yc); + end; end; - + begin - x0:=(x-1)*LargeurCell; // x origine - y0:=(y-1)*HauteurCell; // y origine - yc:=y0+(HauteurCell div 2); // y centre - xc:=x0+(LargeurCell div 2); // x centre - xf:=x0+largeurCell; // x fin - yf:=y0+HauteurCell; // y fin - position:=positionTCO(x,y); - fond:=TCO[x,y].CouleurFond; - ep:=tco[x,y].epaisseurs; + x0:=(x-1)*LargeurCell[indexTCO]; // x origine + y0:=(y-1)*hauteurCell[indexTCO]; // y origine + yc:=y0+(hauteurCell[indexTCO] div 2); // y centre + xc:=x0+(LargeurCell[indexTCO] div 2); // x centre + xf:=x0+LargeurCell[indexTCO]; // x fin + yf:=y0+hauteurCell[indexTCO]; // y fin + position:=positionTCO(indexTCO,x,y); + fond:=tco[indextco,x,y].CouleurFond; + ep:=tco[indextco,x,y].epaisseurs; with canvas do begin @@ -2883,7 +3248,7 @@ begin end; end; -procedure dessin_12C(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_12C(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; fond : tcolor; procedure trajet_droit; @@ -2932,21 +3297,21 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; begin - x0:=(x-1)*LargeurCell; // x origine - y0:=(y-1)*HauteurCell; // y origine - yc:=y0+(HauteurCell div 2); // y centre - xc:=x0+(LargeurCell div 2); // x centre - xf:=x0+largeurCell; // x fin - yf:=y0+HauteurCell; // y fin - ep:=tco[x,y].epaisseurs; + x0:=(x-1)*LargeurCell[indexTCO]; // x origine + y0:=(y-1)*hauteurCell[indexTCO]; // y origine + yc:=y0+(hauteurCell[indexTCO] div 2); // y centre + xc:=x0+(LargeurCell[indexTCO] div 2); // x centre + xf:=x0+LargeurCell[indexTCO]; // x fin + yf:=y0+hauteurCell[indexTCO]; // y fin + ep:=tco[indextco,x,y].epaisseurs; // mode rond - x1:=x0-(largeurCell div 3);y1:=y0-2*hauteurCell-(hauteurCell div 2); - x2:=xf+largeurCell+(largeurcell div 3);y2:=yc; + x1:=x0-(LargeurCell[indexTCO] div 3);y1:=y0-2*hauteurCell[indexTCO]-(hauteurCell[indexTCO] div 2); + x2:=xf+LargeurCell[indexTCO]+(LargeurCell[indexTCO] div 3);y2:=yc; x3:=x0;y3:=y0; x4:=xf;y4:=yc; - position:=positionTCO(x,y); - fond:=TCO[x,y].CouleurFond; + position:=positionTCO(indexTCO,x,y); + fond:=tco[indextco,x,y].CouleurFond; with canvas do begin @@ -3008,15 +3373,15 @@ begin end; -procedure dessin_12(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_12(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); begin - if graphisme=1 then dessin_12L(Canvas,x,y,Mode); - if graphisme=2 then dessin_12C(Canvas,x,y,Mode); + if graphisme=1 then dessin_12L(indexTco,Canvas,x,y,Mode); + if graphisme=2 then dessin_12C(indexTco,Canvas,x,y,Mode); end; // Elément 13 fait -procedure dessin_13L(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_13L(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,position,ep : integer; r : Trect; fond : tcolor; @@ -3066,15 +3431,15 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,position,ep : integer; end; begin - x0:=(x-1)*LargeurCell; // x origine - y0:=(y-1)*HauteurCell; // y origine - yc:=y0+(HauteurCell div 2); // y centre - xc:=x0+(LargeurCell div 2); // x centre - xf:=x0+largeurCell; // x fin - yf:=y0+HauteurCell; // y fin - position:=positionTCO(x,y); - fond:=TCO[x,y].CouleurFond; - ep:=tco[x,y].epaisseurs; + x0:=(x-1)*LargeurCell[indexTCO]; // x origine + y0:=(y-1)*hauteurCell[indexTCO]; // y origine + yc:=y0+(hauteurCell[indexTCO] div 2); // y centre + xc:=x0+(LargeurCell[indexTCO] div 2); // x centre + xf:=x0+LargeurCell[indexTCO]; // x fin + yf:=y0+hauteurCell[indexTCO]; // y fin + position:=positionTCO(indexTco,x,y); + fond:=tco[indextco,x,y].CouleurFond; + ep:=tco[indextco,x,y].epaisseurs; with canvas do begin @@ -3127,7 +3492,7 @@ begin end; // fait -procedure dessin_13C(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_13C(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; fond : tcolor; @@ -3177,21 +3542,21 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; begin - x0:=(x-1)*LargeurCell; // x origine - y0:=(y-1)*HauteurCell; // y origine - yc:=y0+(HauteurCell div 2); // y centre - xc:=x0+(LargeurCell div 2); // x centre - xf:=x0+largeurCell; // x fin - yf:=y0+HauteurCell; // y fin + x0:=(x-1)*LargeurCell[indexTCO]; // x origine + y0:=(y-1)*hauteurCell[indexTCO]; // y origine + yc:=y0+(hauteurCell[indexTCO] div 2); // y centre + xc:=x0+(LargeurCell[indexTCO] div 2); // x centre + xf:=x0+LargeurCell[indexTCO]; // x fin + yf:=y0+hauteurCell[indexTCO]; // y fin // mode rond - x1:=x0-largeurCell-(largeurCell div 3);y1:=y0-2*hauteurCell-(hauteurCell div 2); - x2:=xf+(largeurcell div 3)+3;y2:=yc; + x1:=x0-LargeurCell[indexTCO]-(LargeurCell[indexTCO] div 3);y1:=y0-2*hauteurCell[indexTCO]-(hauteurCell[indexTCO] div 2); + x2:=xf+(LargeurCell[indexTCO] div 3)+3;y2:=yc; x3:=x0;y3:=yc; x4:=xf;y4:=y0; - position:=positionTCO(x,y); - fond:=TCO[x,y].CouleurFond; - ep:=tco[x,y].epaisseurs; + position:=positionTCO(indexTco,x,y); + fond:=tco[indextco,x,y].CouleurFond; + ep:=tco[indextco,x,y].epaisseurs; with canvas do begin @@ -3253,14 +3618,14 @@ begin end; end; -procedure dessin_13(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_13(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); begin - if graphisme=1 then dessin_13L(Canvas,x,y,Mode); - if graphisme=2 then dessin_13C(Canvas,x,y,Mode); + if graphisme=1 then dessin_13L(indexTco,Canvas,x,y,Mode); + if graphisme=2 then dessin_13C(indexTco,Canvas,x,y,Mode); end; // Element 14 -procedure dessin_14l(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_14l(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; r : Trect; fond : tcolor; @@ -3309,15 +3674,15 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; begin - x0:=(x-1)*LargeurCell; // x origine - y0:=(y-1)*HauteurCell; // y origine - yc:=y0+(HauteurCell div 2); // y centre - xc:=x0+(LargeurCell div 2); // x centre - xf:=x0+largeurCell; // x fin - yf:=y0+HauteurCell; // y fin - position:=positionTCO(x,y); - fond:=TCO[x,y].CouleurFond; - ep:=tco[x,y].epaisseurs; + x0:=(x-1)*LargeurCell[indexTCO]; // x origine + y0:=(y-1)*hauteurCell[indexTCO]; // y origine + yc:=y0+(hauteurCell[indexTCO] div 2); // y centre + xc:=x0+(LargeurCell[indexTCO] div 2); // x centre + xf:=x0+LargeurCell[indexTCO]; // x fin + yf:=y0+hauteurCell[indexTCO]; // y fin + position:=positionTCO(indexTco,x,y); + fond:=tco[indextco,x,y].CouleurFond; + ep:=tco[indextco,x,y].epaisseurs; with canvas do begin @@ -3379,7 +3744,7 @@ begin end; end; -procedure dessin_14c(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_14c(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position : integer; r : Trect; fond : tcolor; @@ -3424,20 +3789,20 @@ procedure trajet_droit; begin - x0:=(x-1)*LargeurCell; // x origine - y0:=(y-1)*HauteurCell; // y origine - yc:=y0+(HauteurCell div 2); // y centre - xc:=x0+(LargeurCell div 2); // x centre - xf:=x0+largeurCell; // x fin - yf:=y0+HauteurCell; // y fin + x0:=(x-1)*LargeurCell[indexTCO]; // x origine + y0:=(y-1)*hauteurCell[indexTCO]; // y origine + yc:=y0+(hauteurCell[indexTCO] div 2); // y centre + xc:=x0+(LargeurCell[indexTCO] div 2); // x centre + xf:=x0+LargeurCell[indexTCO]; // x fin + yf:=y0+hauteurCell[indexTCO]; // y fin // mode rond - x1:=x0-largeurCell-(largeurCell div 3);y1:=yc; - x2:=xf+(largeurcell div 3);y2:=yf+2*hauteurcell+(hauteurcell div 2); + x1:=x0-LargeurCell[indexTCO]-(LargeurCell[indexTCO] div 3);y1:=yc; + x2:=xf+(LargeurCell[indexTCO] div 3);y2:=yf+2*hauteurCell[indexTCO]+(hauteurCell[indexTCO] div 2); x3:=xf;y3:=yf; x4:=x0;y4:=yc; - position:=positionTCO(x,y); - fond:=TCO[x,y].CouleurFond; + position:=positionTCO(indexTco,x,y); + fond:=tco[indextco,x,y].CouleurFond; with canvas do begin @@ -3503,15 +3868,15 @@ begin end; -procedure dessin_14(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_14(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); begin - if graphisme=1 then dessin_14L(Canvas,x,y,Mode); - if graphisme=2 then dessin_14C(Canvas,x,y,Mode); + if graphisme=1 then dessin_14L(indexTco,Canvas,x,y,Mode); + if graphisme=2 then dessin_14C(indexTco,Canvas,x,y,Mode); end; // Element 15 fait -procedure dessin_15L(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_15L(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,position,ep : integer; fond : Tcolor; @@ -3560,15 +3925,15 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,position,ep : integer; end; begin - x0:=(x-1)*LargeurCell; // x origine - y0:=(y-1)*HauteurCell; // y origine - yc:=y0+(HauteurCell div 2); // y centre - xc:=x0+(LargeurCell div 2); // x centre - xf:=x0+largeurCell; // x fin - yf:=y0+HauteurCell; // y fin - position:=positionTCO(x,y); - fond:=TCO[x,y].CouleurFond; - ep:=TCO[x,y].epaisseurs; + x0:=(x-1)*LargeurCell[indexTCO]; // x origine + y0:=(y-1)*hauteurCell[indexTCO]; // y origine + yc:=y0+(hauteurCell[indexTCO] div 2); // y centre + xc:=x0+(LargeurCell[indexTCO] div 2); // x centre + xf:=x0+LargeurCell[indexTCO]; // x fin + yf:=y0+hauteurCell[indexTCO]; // y fin + position:=positionTCO(indexTco,x,y); + fond:=tco[indextco,x,y].CouleurFond; + ep:=tco[indextco,x,y].epaisseurs; with canvas do begin @@ -3629,7 +3994,7 @@ begin end; // fait -procedure dessin_15C(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_15C(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; fond : Tcolor; @@ -3678,22 +4043,22 @@ procedure trajet_droit; begin - x0:=(x-1)*LargeurCell; // x origine - y0:=(y-1)*HauteurCell; // y origine - yc:=y0+(HauteurCell div 2); // y centre - xc:=x0+(LargeurCell div 2); // x centre - xf:=x0+largeurCell; // x fin - yf:=y0+HauteurCell; // y fin + x0:=(x-1)*LargeurCell[indexTCO]; // x origine + y0:=(y-1)*hauteurCell[indexTCO]; // y origine + yc:=y0+(hauteurCell[indexTCO] div 2); // y centre + xc:=x0+(LargeurCell[indexTCO] div 2); // x centre + xf:=x0+LargeurCell[indexTCO]; // x fin + yf:=y0+hauteurCell[indexTCO]; // y fin // mode rond x1:=xf-x0; x1:=x0-(x1 div 3);y1:=yc; - x2:=xf+xf-x1;y2:=yf+hauteurCell*2+(hauteurCell div 2); + x2:=xf+xf-x1;y2:=yf+hauteurCell[indexTCO]*2+(hauteurCell[indexTCO] div 2); x3:=xf;y3:=yc; x4:=x0;y4:=yf; - position:=positionTCO(x,y); - fond:=TCO[x,y].CouleurFond; - ep:=TCO[x,y].epaisseurs; + position:=positionTCO(indexTco,x,y); + fond:=tco[indextco,x,y].CouleurFond; + ep:=tco[indextco,x,y].epaisseurs; with canvas do begin Pen.Width:=1; @@ -3751,28 +4116,28 @@ begin end; end; -procedure dessin_15(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_15(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); begin - if graphisme=1 then dessin_15L(Canvas,x,y,Mode); - if graphisme=2 then dessin_15C(Canvas,x,y,Mode); + if graphisme=1 then dessin_15L(indexTco,Canvas,x,y,Mode); + if graphisme=2 then dessin_15C(indexTco,Canvas,x,y,Mode); end; // Element 16 fait -procedure dessin_16L(Canvas : Tcanvas;x,y,mode: integer); +procedure dessin_16L(indexTCO : integer;Canvas : Tcanvas;x,y,mode: integer); var x0,y0,xc,yc,ep : integer; begin - x0:=(x-1)*LargeurCell; - y0:=(y-1)*HauteurCell; - xc:=x0+(largeurCell div 2); - yc:=y0+(hauteurCell div 2); - ep:=TCO[x,y].epaisseurs; + x0:=(x-1)*LargeurCell[indexTCO]; + y0:=(y-1)*hauteurCell[indexTCO]; + xc:=x0+(LargeurCell[indexTCO] div 2); + yc:=y0+(hauteurCell[indexTCO] div 2); + ep:=tco[indextco,x,y].epaisseurs; with canvas do begin - Brush.Color:=TCO[x,y].CouleurFond; + Brush.Color:=tco[indextco,x,y].CouleurFond; Pen.Width:=1; - //r:=Rect(x0,y0,x0+LargeurCell,y0+HauteurCell); + //r:=Rect(x0,y0,x0+LargeurCell[indexTCO],y0+hauteurCell[indexTCO]); //FillRect(r); case mode of @@ -3784,30 +4149,30 @@ begin pen.color:=Couleur; Pen.Mode:=pmCopy; if testbit(ep,0) or testbit(ep,5) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur ; - MoveTo(x0,y0);lineTo(xc,yc);LineTo(xc,y0+hauteurCell); + MoveTo(x0,y0);lineTo(xc,yc);LineTo(xc,y0+hauteurCell[indexTCO]); end; end; // fait -procedure dessin_16C(Canvas : Tcanvas;x,y,mode: integer); +procedure dessin_16C(indexTCO : integer;Canvas : Tcanvas;x,y,mode: integer); var x0,y0,xc,yc,x1,y1,x2,y2,x3,y3,x4,y4,xf,yf,ep : integer; begin - x0:=(x-1)*LargeurCell; - y0:=(y-1)*HauteurCell; - xc:=x0+(largeurCell div 2); - yc:=y0+(hauteurCell div 2); - xf:=x0+largeurCell; // x fin - yf:=y0+HauteurCell; // y fin + x0:=(x-1)*LargeurCell[indexTCO]; + y0:=(y-1)*hauteurCell[indexTCO]; + xc:=x0+(LargeurCell[indexTCO] div 2); + yc:=y0+(hauteurCell[indexTCO] div 2); + xf:=x0+LargeurCell[indexTCO]; // x fin + yf:=y0+hauteurCell[indexTCO]; // y fin // mode rond - x1:=x0-(2*largeurCell)-(largeurcell div 2);y1:=y0-(hauteurCell div 3); - x2:=x0+(largeurcell div 2);y2:=yf+hauteurcell+(hauteurCell div 3); + x1:=x0-(2*LargeurCell[indexTCO])-(LargeurCell[indexTCO] div 2);y1:=y0-(hauteurCell[indexTCO] div 3); + x2:=x0+(LargeurCell[indexTCO] div 2);y2:=yf+hauteurCell[indexTCO]+(hauteurCell[indexTCO] div 3); x3:=xc;y3:=yf; x4:=x0;y4:=y0; - ep:=tco[x,y].epaisseurs; + ep:=tco[indextco,x,y].epaisseurs; with canvas do begin - Brush.Color:=TCO[x,y].CouleurFond; + Brush.Color:=tco[indextco,x,y].CouleurFond; Pen.Width:=1; case mode of 0: couleur:=clVoies; @@ -3823,26 +4188,26 @@ begin end; -procedure dessin_16(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_16(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); begin - if graphisme=1 then dessin_16L(Canvas,x,y,Mode); - if graphisme=2 then dessin_16C(Canvas,x,y,Mode); + if graphisme=1 then dessin_16L(indexTco,Canvas,x,y,Mode); + if graphisme=2 then dessin_16C(indexTco,Canvas,x,y,Mode); end; // Element 17 fait -procedure dessin_17l(Canvas : Tcanvas;x,y,mode: integer); +procedure dessin_17l(indexTCO : integer;Canvas : Tcanvas;x,y,mode: integer); var x0,y0,xc,yc,ep : integer; begin - x0:=(x-1)*LargeurCell; - y0:=(y-1)*HauteurCell; - xc:=x0+(largeurCell div 2); - yc:=y0+(hauteurCell div 2); - ep:=tco[x,y].epaisseurs; + x0:=(x-1)*LargeurCell[indexTCO]; + y0:=(y-1)*hauteurCell[indexTCO]; + xc:=x0+(LargeurCell[indexTCO] div 2); + yc:=y0+(hauteurCell[indexTCO] div 2); + ep:=tco[indextco,x,y].epaisseurs; with canvas do begin - Brush.Color:=TCO[x,y].CouleurFond; + Brush.Color:=tco[indextco,x,y].CouleurFond; Pen.Width:=1; case mode of 0: couleur:=clVoies; @@ -3853,29 +4218,29 @@ begin pen.color:=couleur; Pen.Mode:=pmCopy; if testbit(ep,2) or testbit(ep,5) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; - MoveTo(x0+LargeurCell,y0);LineTo(xc,yc);LineTo(xc,y0+hauteurCell); + MoveTo(x0+LargeurCell[indexTCO],y0);LineTo(xc,yc);LineTo(xc,y0+hauteurCell[indexTCO]); end; end; // Element 17 fait -procedure dessin_17c(Canvas : Tcanvas;x,y,mode: integer); +procedure dessin_17c(indexTCO : integer;Canvas : Tcanvas;x,y,mode: integer); var x0,y0,xc,yc,x1,y1,x2,y2,x3,y3,x4,y4,xf,yf,ep : integer; begin - x0:=(x-1)*LargeurCell; - y0:=(y-1)*HauteurCell; - xc:=x0+(largeurCell div 2); - yc:=y0+(hauteurCell div 2); - xf:=x0+largeurCell; - yf:=y0+HauteurCell; - x1:=x0+(largeurcell div 2);y1:=y0-(hauteurCell div 3); - x2:=xf+(2*largeurCell)+(largeurcell div 2);y2:=yf+hauteurcell+(hauteurCell div 3); + x0:=(x-1)*LargeurCell[indexTCO]; + y0:=(y-1)*hauteurCell[indexTCO]; + xc:=x0+(LargeurCell[indexTCO] div 2); + yc:=y0+(hauteurCell[indexTCO] div 2); + xf:=x0+LargeurCell[indexTCO]; + yf:=y0+hauteurCell[indexTCO]; + x1:=x0+(LargeurCell[indexTCO] div 2);y1:=y0-(hauteurCell[indexTCO] div 3); + x2:=xf+(2*LargeurCell[indexTCO])+(LargeurCell[indexTCO] div 2);y2:=yf+hauteurCell[indexTCO]+(hauteurCell[indexTCO] div 3); x3:=xf;y3:=y0; x4:=xc;y4:=yf; - ep:=tco[x,y].epaisseurs; + ep:=tco[indextco,x,y].epaisseurs; with canvas do begin - Brush.Color:=TCO[x,y].CouleurFond; + Brush.Color:=tco[indextco,x,y].CouleurFond; Pen.Width:=1; case mode of 0: couleur:=clVoies; @@ -3890,25 +4255,25 @@ begin end; end; -procedure dessin_17(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_17(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); begin - if graphisme=1 then dessin_17L(Canvas,x,y,Mode); - if graphisme=2 then dessin_17C(Canvas,x,y,Mode); + if graphisme=1 then dessin_17L(indexTco,Canvas,x,y,Mode); + if graphisme=2 then dessin_17C(indexTco,Canvas,x,y,Mode); end; // Elément 18 fait -procedure dessin_18l(Canvas : Tcanvas;x,y,mode: integer); +procedure dessin_18l(indexTCO : integer;Canvas : Tcanvas;x,y,mode: integer); var x0,y0,xc,yc,ep : integer; begin - x0:=(x-1)*LargeurCell; - y0:=(y-1)*HauteurCell; - xc:=x0+(largeurCell div 2); - yc:=y0+(hauteurCell div 2); - ep:=tco[x,y].epaisseurs; + x0:=(x-1)*LargeurCell[indexTCO]; + y0:=(y-1)*hauteurCell[indexTCO]; + xc:=x0+(LargeurCell[indexTCO] div 2); + yc:=y0+(hauteurCell[indexTCO] div 2); + ep:=tco[indextco,x,y].epaisseurs; with canvas do begin - Brush.Color:=TCO[x,y].CouleurFond; + Brush.Color:=tco[indextco,x,y].CouleurFond; Pen.Width:=1; case mode of 0: couleur:=clVoies; @@ -3919,29 +4284,29 @@ begin pen.color:=Couleur; Pen.Mode:=pmCopy; if testbit(ep,1) or testbit(ep,6) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; - MoveTo(x0,y0+hauteurCell);LineTo(xc,yc);LineTo(xc,y0); + MoveTo(x0,y0+hauteurCell[indexTCO]);LineTo(xc,yc);LineTo(xc,y0); end; end; // fait -procedure dessin_18c(Canvas : Tcanvas;x,y,mode: integer); +procedure dessin_18c(indexTCO : integer;Canvas : Tcanvas;x,y,mode: integer); var x0,y0,xc,yc,x1,y1,x2,y2,x3,y3,x4,y4,xf,yf,ep : integer; begin - x0:=(x-1)*LargeurCell; - y0:=(y-1)*HauteurCell; - xc:=x0+(largeurCell div 2); - yc:=y0+(hauteurCell div 2); - xf:=x0+largeurCell; - yf:=y0+HauteurCell; - x1:=x0-(2*largeurCell)-(largeurcell div 2);y1:=y0-hauteurCell-(hauteurCell div 3); - x2:=x0+(largeurcell div 2);y2:=yf+(hauteurCell div 3); + x0:=(x-1)*LargeurCell[indexTCO]; + y0:=(y-1)*hauteurCell[indexTCO]; + xc:=x0+(LargeurCell[indexTCO] div 2); + yc:=y0+(hauteurCell[indexTCO] div 2); + xf:=x0+LargeurCell[indexTCO]; + yf:=y0+hauteurCell[indexTCO]; + x1:=x0-(2*LargeurCell[indexTCO])-(LargeurCell[indexTCO] div 2);y1:=y0-hauteurCell[indexTCO]-(hauteurCell[indexTCO] div 3); + x2:=x0+(LargeurCell[indexTCO] div 2);y2:=yf+(hauteurCell[indexTCO] div 3); x3:=x0;y3:=yf; x4:=xc;y4:=y0; - ep:=tco[x,y].epaisseurs; + ep:=tco[indextco,x,y].epaisseurs; with canvas do begin - Brush.Color:=TCO[x,y].CouleurFond; + Brush.Color:=tco[indextco,x,y].CouleurFond; Pen.Width:=1; case mode of 0: couleur:=clVoies; @@ -3956,26 +4321,26 @@ begin end; end; -procedure dessin_18(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_18(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); begin - if graphisme=1 then dessin_18L(Canvas,x,y,Mode); - if graphisme=2 then dessin_18C(Canvas,x,y,Mode); + if graphisme=1 then dessin_18L(indexTco,Canvas,x,y,Mode); + if graphisme=2 then dessin_18C(indexTco,Canvas,x,y,Mode); end; // Element 19 // fait -procedure dessin_19l(Canvas : Tcanvas;x,y,mode: integer); +procedure dessin_19l(indexTCO : integer;Canvas : Tcanvas;x,y,mode: integer); var x0,y0,xc,yc,ep : integer; begin - x0:=(x-1)*LargeurCell; - y0:=(y-1)*HauteurCell; - xc:=x0+(largeurcell div 2); - yc:=y0+(Hauteurcell div 2); - ep:=tco[x,y].epaisseurs; + x0:=(x-1)*LargeurCell[indexTCO]; + y0:=(y-1)*hauteurCell[indexTCO]; + xc:=x0+(LargeurCell[indexTCO] div 2); + yc:=y0+(hauteurCell[indexTCO] div 2); + ep:=tco[indextco,x,y].epaisseurs; with canvas do begin - Brush.Color:=TCO[x,y].CouleurFond; + Brush.Color:=tco[indextco,x,y].CouleurFond; Pen.Width:=1; case mode of 0: couleur:=clVoies; @@ -3986,29 +4351,29 @@ begin pen.color:=Couleur; Pen.Mode:=pmCopy; if testbit(ep,1) or testbit(ep,4) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; - moveto(xc,y0);LineTo(xc,yc);LineTo(x0+largeurCell,y0+HauteurCell); + moveto(xc,y0);LineTo(xc,yc);LineTo(x0+LargeurCell[indexTCO],y0+hauteurCell[indexTCO]); end; end; // fait -procedure dessin_19c(Canvas : Tcanvas;x,y,mode: integer); +procedure dessin_19c(indexTCO : integer;Canvas : Tcanvas;x,y,mode: integer); var x0,y0,xc,yc,x1,y1,x2,y2,x3,y3,x4,y4,xf,yf,ep : integer; begin - x0:=(x-1)*LargeurCell; - y0:=(y-1)*HauteurCell; - xc:=x0+(largeurcell div 2); - yc:=y0+(Hauteurcell div 2); - xf:=x0+largeurCell; - yf:=y0+HauteurCell; - x1:=x0+(largeurcell div 2);y1:=y0-hauteurCell-(hauteurCell div 3); - x2:=xf+(2*largeurCell)+(largeurcell div 2);y2:=yf+(hauteurCell div 3); + x0:=(x-1)*LargeurCell[indexTCO]; + y0:=(y-1)*hauteurCell[indexTCO]; + xc:=x0+(LargeurCell[indexTCO] div 2); + yc:=y0+(hauteurCell[indexTCO] div 2); + xf:=x0+LargeurCell[indexTCO]; + yf:=y0+hauteurCell[indexTCO]; + x1:=x0+(LargeurCell[indexTCO] div 2);y1:=y0-hauteurCell[indexTCO]-(hauteurCell[indexTCO] div 3); + x2:=xf+(2*LargeurCell[indexTCO])+(LargeurCell[indexTCO] div 2);y2:=yf+(hauteurCell[indexTCO] div 3); x3:=xc;y3:=y0; x4:=xf;y4:=yf; - ep:=tco[x,y].epaisseurs; + ep:=tco[indextco,x,y].epaisseurs; with canvas do begin - Brush.Color:=TCO[x,y].CouleurFond; + Brush.Color:=tco[indextco,x,y].CouleurFond; Pen.Width:=1; case mode of @@ -4024,33 +4389,64 @@ begin end; end; -procedure dessin_19(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_19(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); begin - if graphisme=1 then dessin_19L(Canvas,x,y,Mode); - if graphisme=2 then dessin_19C(Canvas,x,y,Mode); + if graphisme=1 then dessin_19L(indexTco,Canvas,x,y,Mode); + if graphisme=2 then dessin_19C(indexTco,Canvas,x,y,Mode); end; // Element 20 fait -procedure dessin_20(Canvas : Tcanvas;x,y,mode: integer); -var jx1,jx2,x0,y0,xc,adr,ep : integer; +procedure dessin_20(indexTCO : integer;Canvas : Tcanvas;x,y,mode: integer); +var jx1,jx2,x0,y0,xc,xf,yf,yc,adr,ep,but : integer; r : Trect; couleur : tcolor; begin - x0:=(x-1)*LargeurCell; - y0:=(y-1)*HauteurCell; - xc:=x0+(largeurCell div 2); - ep:=TCO[x,y].epaisseurs; + x0:=(x-1)*LargeurCell[indexTCO]; + y0:=(y-1)*hauteurCell[indexTCO]; + xc:=x0+(LargeurCell[indexTCO] div 2); + yc:=y0+(hauteurCell[indexTCO] div 2); + xf:=x0+LargeurCell[indexTCO]; + yf:=y0+hauteurCell[indexTCO]; + ep:=tco[indextco,x,y].epaisseurs; + but:=tco[indextco,x,y].buttoir; with canvas do begin - Brush.Color:=TCO[x,y].CouleurFond; + Brush.Color:=tco[indextco,x,y].CouleurFond; Pen.Mode:=pmCopy; - //r:=Rect(x0,y0,x0+LargeurCell,y0+HauteurCell); - //FillRect(r); + + if but<>0 then + begin + case mode of + 0 : couleur:=clVoies; + 1 : couleur:=clAllume; + 2 : couleur:=couleurtrain[index_couleur]; + end; + pen.color:=couleur; + if testbit(ep,1) or testbit(ep,5) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; + + if testBit(but,1) then + begin + moveTo(xc,y0);LineTo(xc,yc); + end; + if testBit(but,5) then + begin + moveTo(xc,yc);LineTo(xc,yf); + end; + + Pen.Width:=epaisseur; + pen.Color:=Clred; + moveto(x0+round(20*fryGlob[indexTCO]),yc); + LineTo(xf-round(20*fryGlob[indexTCO]),yc); + + exit; + end; + + // état détecteur - Adr:=TCO[x,y].adresse; + Adr:=tco[indextco,x,y].adresse; if Adr<>0 then begin if detecteur[Adr].etat then @@ -4060,14 +4456,14 @@ begin end else begin - couleur:=TCO[x,y].CouleurFond; + couleur:=tco[indextco,x,y].CouleurFond; Brush.Color:=couleur; pen.color:=couleur; end; - jx1:=x0+(LargeurCell div 2)-round(6*frxGlob); // pos Y de la bande sup - jx2:=x0+(LargeurCell div 2)+round(6*frxGlob); // pos Y de la bande inf - if avecGrille then r:=Rect(jx1,y0+1,jx2,y0+HauteurCell-1) else - r:=Rect(jx1,y0,jx2,y0+HauteurCell) ; + jx1:=x0+(LargeurCell[indexTCO] div 2)-round(6*frxGlob[indexTCO]); // pos Y de la bande sup + jx2:=x0+(LargeurCell[indexTCO] div 2)+round(6*frxGlob[indexTCO]); // pos Y de la bande inf + if avecGrille[indexTCO] then r:=Rect(jx1,y0+1,jx2,y0+hauteurCell[indexTCO]-1) else + r:=Rect(jx1,y0,jx2,y0+hauteurCell[indexTCO]) ; FillRect(r); end; @@ -4081,13 +4477,14 @@ begin pen.color:=couleur; if testbit(ep,1) or testbit(ep,5) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; - MoveTo(xc,y0);LineTo(xc,y0+HauteurCell); + MoveTo(xc,y0);LineTo(xc,y0+hauteurCell[indexTCO]); end; end; // Element 21 - croisement - TJD fait -procedure dessin_21(Canvas : Tcanvas;x,y,mode : integer); -var x0,y0,xc,yc,xf,yf,trajet,ep : integer; +procedure dessin_21(indexTCO : integer;Canvas : Tcanvas;x,y,mode : integer); +var yp,x1,x2,y1,y2,x0,y0,xc,yc,xf,yf,trajet,ep,pont : integer; + a1,b1,a2,b2 : double; procedure horizontale; begin with canvas do @@ -4112,31 +4509,89 @@ var x0,y0,xc,yc,xf,yf,trajet,ep : integer; begin - x0:=(x-1)*LargeurCell; - y0:=(y-1)*HauteurCell; - xc:=x0+(largeurCell div 2); - yc:=y0+(hauteurCell div 2); - xf:=x0+largeurCell; - yf:=y0+HauteurCell; - ep:=TCO[x,y].epaisseurs; + x0:=(x-1)*LargeurCell[indexTCO]; + y0:=(y-1)*hauteurCell[indexTCO]; + xc:=x0+(LargeurCell[indexTCO] div 2); + yc:=y0+(hauteurCell[indexTCO] div 2); + xf:=x0+LargeurCell[indexTCO]; + yf:=y0+hauteurCell[indexTCO]; + ep:=tco[indextco,x,y].epaisseurs; + pont:=tco[indextco,x,y].pont; with canvas do begin Pen.Width:=1; - Brush.Color:=TCO[x,y].CouleurFond; - //r:=Rect(x0,y0,x0+LargeurCell,y0+HauteurCell); - //FillRect(r); - Brush.Color:=clvoies; pen.color:=clvoies; horizontale; diagonale; + // horizontale + if testbit(pont,3) or testbit(pont,7) then + begin + // dessiner le pont + pen.color:=clfond; + yp:=yc-(epaisseur); + moveto(x0+5,yp);lineTo(xf-5,yp); + yp:=yc+(epaisseur); + moveto(x0+5,yp);lineTo(xf-5,yp); + + // barrières du pont + pen.color:=clwhite; + pen.Width:=epaisseur div 2; + moveto(x0+5,yp);lineTo(xf-5,yp); + yp:=yc-(epaisseur); + moveto(x0+5,yp);lineTo(xf-5,yp); + end; + + // diagonale + if testbit(pont,2) or testbit(pont,6) then + begin + pen.color:=clfond; + droite(xf,y0,x0,yf,a1,b1); + // droite a2,b2 // passant par x2,y2 + a2:=a1; + + // masquage G + x2:=xf-round(21*frxGlob[indexTCO]);y2:=y0+round(12*fryGlob[indexTCO]); + b2:=y2-a2*x2; + x1:=x0+round(6*frxGlob[indexTCO]); + y1:=round(a2*x1+b2); + moveto(x1,y1);lineTo(x2,y2); + + // barrière + pen.width:=epaisseur div 2; + pen.color:=clWhite; + x2:=xf-round(21*frxGlob[indexTCO]);y2:=y0+round(12*fryGlob[indexTCO]); + b2:=y2-a2*x2; + x1:=x0+round(6*frxGlob[indexTCO]); + y1:=round(a2*x1+b2); + moveto(x1,y1);lineTo(x2,y2); + + // masquage D + pen.Width:=epaisseur; + pen.color:=clFond; + x2:=xf-round(10*frxGlob[indexTCO]);y2:=y0+round(18*fryGlob[indexTCO]); + b2:=y2-a2*x2; + x1:=x0+round(16*frxGlob[indexTCO]); + y1:=round(a2*x1+b2); + moveto(x1,y1);lineTo(x2,y2); + + // barrière + pen.width:=epaisseur div 2; + pen.color:=clwhite; + x2:=xf-round(10*frxGlob[indexTCO]);y2:=y0+round(18*fryGlob[indexTCO]); + b2:=y2-a2*x2; + x1:=x0+round(16*frxGlob[indexTCO]); + y1:=round(a2*x1+b2); + moveto(x1,y1);lineTo(x2,y2); + end; + // regarder d'ou on vient de la route du tco if mode>0 then begin - trajet:=tco[x,y].trajet; + trajet:=tco[indextco,x,y].trajet; case mode of 0: couleur:=clVoies; 1: couleur:=ClCanton; @@ -4165,9 +4620,9 @@ begin end; // Element 22 fait -procedure dessin_22(Canvas : Tcanvas;x,y,mode : integer); -var x0,y0,xc,yc,xf,yf,trajet,ep : integer; - +procedure dessin_22(indexTCO : integer;Canvas : Tcanvas;x,y,mode : integer); +var pont,yp,x1,y1,x2,y2,x0,y0,xc,yc,xf,yf,trajet,ep : integer; + a1,b1,a2,b2 : double; procedure horizontale; begin with canvas do @@ -4191,19 +4646,20 @@ var x0,y0,xc,yc,xf,yf,trajet,ep : integer; end; begin - x0:=(x-1)*LargeurCell; - y0:=(y-1)*HauteurCell; - xc:=x0+(LargeurCell div 2); - yc:=y0+(hauteurCell div 2); - xf:=x0+largeurCell; - yf:=y0+HauteurCell; - ep:=TCO[x,y].epaisseurs; + x0:=(x-1)*LargeurCell[indexTCO]; + y0:=(y-1)*hauteurCell[indexTCO]; + xc:=x0+(LargeurCell[indexTCO] div 2); + yc:=y0+(hauteurCell[indexTCO] div 2); + xf:=x0+LargeurCell[indexTCO]; + yf:=y0+hauteurCell[indexTCO]; + ep:=tco[indextco,x,y].epaisseurs; + pont:=tco[indextco,x,y].pont; with canvas do begin Pen.Width:=1; - Brush.Color:=TCO[x,y].CouleurFond; - //r:=Rect(x0,y0,x0+LargeurCell,y0+HauteurCell); + Brush.Color:=tco[indextco,x,y].CouleurFond; + //r:=Rect(x0,y0,x0+LargeurCell[indexTCO],y0+hauteurCell[indexTCO]); //FillRect(r); Brush.Color:=clvoies; @@ -4213,10 +4669,70 @@ begin diagonale; horizontale; + // horizontale + if testbit(pont,3) or testbit(pont,7) then + begin + // dessiner le pont + pen.color:=clFond; + yp:=yc-(epaisseur); + moveto(x0+5,yp);lineTo(xf-5,yp); + yp:=yc+(epaisseur); + moveto(x0+5,yp);lineTo(xf-5,yp); + + // barrières du pont + pen.color:=clwhite; + pen.Width:=epaisseur div 2; + moveto(x0+5,yp);lineTo(xf-5,yp); + yp:=yc-(epaisseur); + moveto(x0+5,yp);lineTo(xf-5,yp); + end; + + // diagonale + if testbit(pont,0) or testbit(pont,4) then + begin + pen.color:=clfond; + droite(x0,y0,xf,yf,a1,b1); + // droite a2,b2 // passant par x2,y2 + a2:=a1; + + // masquage G + x2:=x0+round(8*frxGlob[indexTCO]);y2:=y0+round(18*fryGlob[indexTCO]); + b2:=y2-a2*x2; + x1:=xf-round(18*frxGlob[indexTCO]); + y1:=round(a2*x1+b2); + moveto(x1,y1);lineTo(x2,y2); + + // barrière + pen.width:=epaisseur div 2; + pen.color:=clWhite; + x2:=x0+round(8*frxGlob[indexTCO]);y2:=y0+round(18*fryGlob[indexTCO]); + b2:=y2-a2*x2; + x1:=xf-round(18*frxGlob[indexTCO]); + y1:=round(a2*x1+b2); + moveto(x1,y1);lineTo(x2,y2); + + // masquage D + pen.Width:=epaisseur; + pen.color:=clfond; + x2:=x0+round(20*frxGlob[indexTCO]);y2:=y0+round(11*fryGlob[indexTCO]); + b2:=y2-a2*x2; + x1:=xf-round(8*frxGlob[indexTCO]); + y1:=round(a2*x1+b2); + moveto(x1,y1);lineTo(x2,y2); + + pen.width:=epaisseur div 2; + pen.color:=clwhite; + x2:=x0+round(20*frxGlob[indexTCO]);y2:=y0+round(11*fryGlob[indexTCO]); + b2:=y2-a2*x2; + x1:=xf-round(8*frxGlob[indexTCO]); + y1:=round(a2*x1+b2); + moveto(x1,y1);lineTo(x2,y2); + end; + // regarder d'ou on vient de la route du tco if mode>0 then begin - trajet:=tco[x,y].trajet; + trajet:=tco[indextco,x,y].trajet; case mode of 0: couleur:=clVoies; 1: couleur:=ClCanton; @@ -4245,34 +4761,95 @@ begin end; // Element 51 (quai) -procedure dessin_51(Canvas : Tcanvas;x,y,mode: integer); +procedure dessin_51(indexTCO : integer;Canvas : Tcanvas;x,y,mode: integer); var x0,y0,x1,x2,jy1,jy2 : integer; r : Trect; begin - x0:=(x-1)*LargeurCell; - y0:=(y-1)*HauteurCell; + x0:=(x-1)*LargeurCell[indexTCO]; + y0:=(y-1)*hauteurCell[indexTCO]; with canvas do begin Pen.Width:=1; - Brush.Color:=TCO[x,y].CouleurFond; - //r:=Rect(x0,y0,x0+LargeurCell,y0+HauteurCell); + Brush.Color:=tco[indextco,x,y].CouleurFond; + //r:=Rect(x0,y0,x0+LargeurCell[indexTCO],y0+hauteurCell[indexTCO]); //FillRect(r); Brush.Color:=clQuai; pen.color:=clQuai; x1:=x0; - x2:=x0+largeurCell; + x2:=x0+LargeurCell[indexTCO]; - jy1:=y0+(HauteurCell div 2)-round(14*frYGlob); // pos Y de la bande sup - jy2:=y0+(HauteurCell div 2)+round(14*frYGlob); // pos Y de la bande inf + jy1:=y0+(hauteurCell[indexTCO] div 2)-round(14*fryGlob[indexTCO]); // pos Y de la bande sup + jy2:=y0+(hauteurCell[indexTCO] div 2)+round(14*fryGlob[indexTCO]); // pos Y de la bande inf r:=rect(x1,jy1,x2,jy2); rectangle(r); end; end; +procedure dessin_52(indexTCO : integer;Canvas : Tcanvas;x,y,mode: integer); +var x0,y0,xf,yf,act : integer; + r : Trect; + s : string; +begin + x0:=(x-1)*LargeurCell[indexTCO]+2; + y0:=(y-1)*hauteurCell[indexTCO]+2; + xf:=x0+LargeurCell[indexTCO]-4; + yf:=y0+HauteurCell[indexTCO]-4; + + with canvas do + begin + Pen.Width:=1; + + Brush.Color:=clGray; + pen.color:=clwhite; + + r:=rect(x0,y0,xf,yf); + rectangle(r); + + if TCOActive then + begin + act:=tco[indexTCO,x,y].PiedFeu; + if act=1 then + begin + s:='TCO'+intToSTR(tco[indexTCO,x,y].FeuOriente); + tco[indexTCO,x,y].texte:=s; + tco[indexTCO,x,y].repr:=1; + tco[indexTCO,x,y].TailleFonte:=8; + tco[indexTCO,x,y].FontStyle:='G'; + end; + if act=2 then + begin + s:=' SC'; + tco[indexTCO,x,y].texte:=s; + tco[indexTCO,x,y].repr:=1; + tco[indexTCO,x,y].TailleFonte:=8; + tco[indexTCO,x,y].FontStyle:='G'; + end; + if act=3 then + begin + s:='CDM'; + tco[indexTCO,x,y].texte:=s; + tco[indexTCO,x,y].repr:=1; + tco[indexTCO,x,y].TailleFonte:=8; + tco[indexTCO,x,y].FontStyle:='G'; + end; + + + //tf:=(tco[indexTCO,x,y].TailleFonte*LargeurCell[indexTCO]) div 40; + //tf:=(8*LargeurCell[indexTCO]) div 40;; + + //Font.Color:=clwhite; + //font.Name:='Arial'; + //texte_reparti(s,indexTCO,x,y,tf); + affiche_texte(indextco,x,y); + end; + + end; +end; + // Element 24 fait -procedure dessin_24L(Canvas : Tcanvas;x,y,mode: integer); +procedure dessin_24L(indexTCO : integer;Canvas : Tcanvas;x,y,mode: integer); var x0,y0,xc,yc,jx1,jy1,xf,yf,position,ep : integer; r : Trect; fond: tcolor; @@ -4322,15 +4899,15 @@ var x0,y0,xc,yc,jx1,jy1,xf,yf,position,ep : integer; end; begin - x0:=(x-1)*LargeurCell; // x origine - y0:=(y-1)*HauteurCell; // y origine - yc:=y0+(HauteurCell div 2); // y centre - xc:=x0+(LargeurCell div 2); // x centre - xf:=x0+largeurCell; // x fin - yf:=y0+HauteurCell; // y fin - position:=positionTCO(x,y); - ep:=TCO[x,y].epaisseurs; - fond:=TCO[x,y].CouleurFond; + x0:=(x-1)*LargeurCell[indexTCO]; // x origine + y0:=(y-1)*hauteurCell[indexTCO]; // y origine + yc:=y0+(hauteurCell[indexTCO] div 2); // y centre + xc:=x0+(LargeurCell[indexTCO] div 2); // x centre + xf:=x0+LargeurCell[indexTCO]; // x fin + yf:=y0+hauteurCell[indexTCO]; // y fin + position:=positionTCO(indexTco,x,y); + ep:=tco[indextco,x,y].epaisseurs; + fond:=tco[indextco,x,y].CouleurFond; with canvas do begin @@ -4389,7 +4966,7 @@ begin end; // Element 24 -procedure dessin_24C(Canvas : Tcanvas;x,y,mode: integer); +procedure dessin_24C(indexTCO : integer;Canvas : Tcanvas;x,y,mode: integer); var x0,y0,xc,yc,jx1,jy1,xf,yf,x1,y1,x2,y2,x3,y3,x4,y4,position,ep : integer; r : Trect; fond: tcolor; @@ -4437,19 +5014,19 @@ procedure trajet_droit; end; begin - x0:=(x-1)*LargeurCell; // x origine - y0:=(y-1)*HauteurCell; // y origine - yc:=y0+(HauteurCell div 2); // y centre - xc:=x0+(LargeurCell div 2); // x centre - xf:=x0+largeurCell; // x fin - yf:=y0+HauteurCell; // y fin - position:=positionTCO(x,y); - fond:=TCO[x,y].CouleurFond; - ep:=TCO[x,y].epaisseurs; + x0:=(x-1)*LargeurCell[indexTCO]; // x origine + y0:=(y-1)*hauteurCell[indexTCO]; // y origine + yc:=y0+(hauteurCell[indexTCO] div 2); // y centre + xc:=x0+(LargeurCell[indexTCO] div 2); // x centre + xf:=x0+LargeurCell[indexTCO]; // x fin + yf:=y0+hauteurCell[indexTCO]; // y fin + position:=positionTCO(indexTco,x,y); + fond:=tco[indextco,x,y].CouleurFond; + ep:=tco[indextco,x,y].epaisseurs; // mode rond - x1:=x0-(2*largeurCell)-(largeurcell div 2);y1:=y0-(hauteurCell div 3); - x2:=x0+(largeurcell div 2);y2:=yf+hauteurcell+(hauteurCell div 3); + x1:=x0-(2*LargeurCell[indexTCO])-(LargeurCell[indexTCO] div 2);y1:=y0-(hauteurCell[indexTCO] div 3); + x2:=x0+(LargeurCell[indexTCO] div 2);y2:=yf+hauteurCell[indexTCO]+(hauteurCell[indexTCO] div 3); x3:=xc;y3:=yf; x4:=x0;y4:=y0; @@ -4510,8 +5087,9 @@ begin end; // Element 23 croisement -procedure dessin_23(Canvas : Tcanvas;x,y,mode: integer); -var x0,y0,xf,yf,xc,yc,trajet,ep : integer; +procedure dessin_23(indexTCO : integer;Canvas : Tcanvas;x,y,mode: integer); +var x1,x2,y1,y2,xp,x0,y0,xf,yf,xc,yc,trajet,ep,pont : integer; + a1,b1,a2,b2 : double; procedure verticale; begin with canvas do @@ -4535,19 +5113,20 @@ var x0,y0,xf,yf,xc,yc,trajet,ep : integer; end; begin - x0:=(x-1)*LargeurCell; - y0:=(y-1)*HauteurCell; - xc:=x0+(LargeurCell div 2); - yc:=y0+(hauteurCell div 2); - xf:=x0+LargeurCell; - yf:=y0+HauteurCell; - ep:=tco[x,y].epaisseurs; + x0:=(x-1)*LargeurCell[indexTCO]; + y0:=(y-1)*hauteurCell[indexTCO]; + xc:=x0+(LargeurCell[indexTCO] div 2); + yc:=y0+(hauteurCell[indexTCO] div 2); + xf:=x0+LargeurCell[indexTCO]; + yf:=y0+hauteurCell[indexTCO]; + ep:=tco[indextco,x,y].epaisseurs; + pont:=tco[indextco,x,y].pont; with canvas do begin Pen.Width:=1; - Brush.Color:=TCO[x,y].CouleurFond; - //r:=Rect(x0,y0,x0+LargeurCell,y0+HauteurCell); + Brush.Color:=tco[indextco,x,y].CouleurFond; + //r:=Rect(x0,y0,x0+LargeurCell[indexTCO],y0+hauteurCell[indexTCO]); //FillRect(r); Brush.Color:=clvoies; @@ -4557,10 +5136,72 @@ begin diagonale; verticale; + // verticale + if testbit(pont,1) or testbit(pont,5) then + begin + // masquages + pen.color:=clfond; + xp:=xc-(epaisseur); + moveto(xp,y0+epaisseur);lineTo(xp,yf-epaisseur); + xp:=xc+(epaisseur); + moveto(xp,y0+epaisseur);lineTo(xp,yf-epaisseur); + + // barrières du pont + pen.color:=clwhite; + pen.Width:=epaisseur div 2; + xp:=xc-(epaisseur); + moveto(xp,y0+epaisseur);lineTo(xp,yf-epaisseur); + xp:=xc+(epaisseur); + moveto(xp,y0+epaisseur);lineTo(xp,yf-epaisseur); + end; + + // diagonale + if testbit(pont,2) or testbit(pont,6) then + begin + pen.color:=clfond; + droite(xf,y0,x0,yf,a1,b1); + // droite a2,b2 // passant par x2,y2 + a2:=a1; + + // masquage G + x2:=xf-round(21*frxGlob[indexTCO]);y2:=y0+round(12*fryGlob[indexTCO]); + b2:=y2-a2*x2; + x1:=x0+round(6*frxGlob[indexTCO]); + y1:=round(a2*x1+b2); + moveto(x1,y1);lineTo(x2,y2); + + // barrière + pen.width:=epaisseur div 2; + pen.color:=clWhite; + x2:=xf-round(21*frxGlob[indexTCO]);y2:=y0+round(12*fryGlob[indexTCO]); + b2:=y2-a2*x2; + x1:=x0+round(6*frxGlob[indexTCO]); + y1:=round(a2*x1+b2); + moveto(x1,y1);lineTo(x2,y2); + + // masquage D + pen.Width:=epaisseur; + pen.color:=clFond; + x2:=xf-round(10*frxGlob[indexTCO]);y2:=y0+round(18*fryGlob[indexTCO]); + b2:=y2-a2*x2; + x1:=x0+round(16*frxGlob[indexTCO]); + y1:=round(a2*x1+b2); + moveto(x1,y1);lineTo(x2,y2); + + // barrière + pen.width:=epaisseur div 2; + pen.color:=clwhite; + x2:=xf-round(10*frxGlob[indexTCO]);y2:=y0+round(18*fryGlob[indexTCO]); + b2:=y2-a2*x2; + x1:=x0+round(16*frxGlob[indexTCO]); + y1:=round(a2*x1+b2); + moveto(x1,y1);lineTo(x2,y2); + end; + // regarder d'ou on vient de la route du tco if mode>0 then begin - trajet:=tco[x,y].trajet; + trajet:=tco[indextco,x,y].trajet; case mode of 0: couleur:=clVoies; 1: couleur:=ClCanton; @@ -4588,15 +5229,16 @@ begin end; end; -procedure dessin_24(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_24(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); begin - if graphisme=1 then dessin_24L(Canvas,x,y,Mode); - if graphisme=2 then dessin_24C(Canvas,x,y,Mode); + if graphisme=1 then dessin_24L(indexTco,Canvas,x,y,Mode); + if graphisme=2 then dessin_24C(indexTco,Canvas,x,y,Mode); end; // Element 25 croisement -procedure dessin_25(Canvas : Tcanvas;x,y,mode: integer); -var x0,y0,xf,yf,xc,yc,trajet,ep : integer; +procedure dessin_25(indexTCO : integer;Canvas : Tcanvas;x,y,mode: integer); +var xp,x0,y0,xf,yf,xc,yc,trajet,ep,pont,x1,x2,y1,y2 : integer; + a1,b1,a2,b2 : double; procedure verticale; begin with canvas do @@ -4618,21 +5260,22 @@ var x0,y0,xf,yf,xc,yc,trajet,ep : integer; LineTo(xf,yf); end; end; - + begin - x0:=(x-1)*LargeurCell; - y0:=(y-1)*HauteurCell; - xc:=x0+(LargeurCell div 2); - yc:=y0+(hauteurCell div 2); - xf:=x0+LargeurCell; - yf:=y0+HauteurCell; - ep:=tco[x,y].epaisseurs; + x0:=(x-1)*LargeurCell[indexTCO]; + y0:=(y-1)*hauteurCell[indexTCO]; + xc:=x0+(LargeurCell[indexTCO] div 2); + yc:=y0+(hauteurCell[indexTCO] div 2); + xf:=x0+LargeurCell[indexTCO]; + yf:=y0+hauteurCell[indexTCO]; + ep:=tco[indextco,x,y].epaisseurs; + pont:=tco[indextco,x,y].pont; with canvas do begin Pen.Width:=1; - Brush.Color:=TCO[x,y].CouleurFond; - //r:=Rect(x0,y0,x0+LargeurCell,y0+HauteurCell); + Brush.Color:=tco[indextco,x,y].CouleurFond; + //r:=Rect(x0,y0,x0+LargeurCell[indexTCO],y0+hauteurCell[indexTCO]); //FillRect(r); Brush.Color:=clvoies; @@ -4642,16 +5285,78 @@ begin verticale; diagonale; + // verticale + if testbit(pont,1) or testbit(pont,5) then + begin + // masquages + pen.color:=clfond; + xp:=xc-(epaisseur); + moveto(xp,y0+epaisseur);lineTo(xp,yf-epaisseur); + xp:=xc+(epaisseur); + moveto(xp,y0+epaisseur);lineTo(xp,yf-epaisseur); + + // barrières du pont + pen.color:=clwhite; + pen.Width:=epaisseur div 2; + xp:=xc-(epaisseur); + moveto(xp,y0+epaisseur);lineTo(xp,yf-epaisseur); + xp:=xc+(epaisseur); + moveto(xp,y0+epaisseur);lineTo(xp,yf-epaisseur); + end; + + // diagonale + if testbit(pont,0) or testbit(pont,4) then + begin + pen.color:=clfond; + droite(x0,y0,xf,yf,a1,b1); + // droite a2,b2 // passant par x2,y2 + a2:=a1; + + // masquage G + x2:=x0+round(8*frxGlob[indexTCO]);y2:=y0+round(18*fryGlob[indexTCO]); + b2:=y2-a2*x2; + x1:=xf-round(18*frxGlob[indexTCO]); + y1:=round(a2*x1+b2); + moveto(x1,y1);lineTo(x2,y2); + + // barrière + pen.width:=epaisseur div 2; + pen.color:=clWhite; + x2:=x0+round(8*frxGlob[indexTCO]);y2:=y0+round(18*fryGlob[indexTCO]); + b2:=y2-a2*x2; + x1:=xf-round(18*frxGlob[indexTCO]); + y1:=round(a2*x1+b2); + moveto(x1,y1);lineTo(x2,y2); + + // masquage D + pen.Width:=epaisseur; + pen.color:=clfond; + x2:=x0+round(20*frxGlob[indexTCO]);y2:=y0+round(11*fryGlob[indexTCO]); + b2:=y2-a2*x2; + x1:=xf-round(8*frxGlob[indexTCO]); + y1:=round(a2*x1+b2); + moveto(x1,y1);lineTo(x2,y2); + + pen.width:=epaisseur div 2; + pen.color:=clwhite; + x2:=x0+round(20*frxGlob[indexTCO]);y2:=y0+round(11*fryGlob[indexTCO]); + b2:=y2-a2*x2; + x1:=xf-round(8*frxGlob[indexTCO]); + y1:=round(a2*x1+b2); + moveto(x1,y1);lineTo(x2,y2); + end; + + // regarder d'ou on vient de la route du tco if mode>0 then begin - trajet:=tco[x,y].trajet; + trajet:=tco[indextco,x,y].trajet; case mode of 0: couleur:=clVoies; 1: couleur:=ClCanton; 2: couleur:=couleurtrain[index_couleur]; - end; - + end; + Brush.Color:=couleur; pen.color:=couleur; if trajet=1 then verticale; @@ -4675,7 +5380,7 @@ begin end; // Element 26 fait -procedure dessin_26L(Canvas : Tcanvas;x,y,mode: integer); +procedure dessin_26L(indexTCO : integer;Canvas : Tcanvas;x,y,mode: integer); var x0,y0,xc,yc,jx1,jy1,xf,yf,position,ep : integer; r : Trect; fond: tcolor; @@ -4726,15 +5431,15 @@ var x0,y0,xc,yc,jx1,jy1,xf,yf,position,ep : integer; begin - x0:=(x-1)*LargeurCell; // x origine - y0:=(y-1)*HauteurCell; // y origine - yc:=y0+(HauteurCell div 2); // y centre - xc:=x0+(LargeurCell div 2); // x centre - xf:=x0+largeurCell; // x fin - yf:=y0+HauteurCell; // y fin - position:=positionTCO(x,y); - fond:=TCO[x,y].CouleurFond; - ep:=tco[x,y].epaisseurs; + x0:=(x-1)*LargeurCell[indexTCO]; // x origine + y0:=(y-1)*hauteurCell[indexTCO]; // y origine + yc:=y0+(hauteurCell[indexTCO] div 2); // y centre + xc:=x0+(LargeurCell[indexTCO] div 2); // x centre + xf:=x0+LargeurCell[indexTCO]; // x fin + yf:=y0+hauteurCell[indexTCO]; // y fin + position:=positionTCO(indexTco,x,y); + fond:=tco[indextco,x,y].CouleurFond; + ep:=tco[indextco,x,y].epaisseurs; with canvas do begin @@ -4796,7 +5501,7 @@ begin end; // Element 26 -procedure dessin_26C(Canvas : Tcanvas;x,y,mode: integer); +procedure dessin_26C(indexTCO : integer;Canvas : Tcanvas;x,y,mode: integer); var x0,y0,xc,yc,jx1,jy1,xf,yf,x1,y1,x2,y2,x3,y3,x4,y4,position,ep : integer; r : Trect; fond: tcolor; @@ -4846,19 +5551,19 @@ procedure trajet_droit; begin - x0:=(x-1)*LargeurCell; // x origine - y0:=(y-1)*HauteurCell; // y origine - yc:=y0+(HauteurCell div 2); // y centre - xc:=x0+(LargeurCell div 2); // x centre - xf:=x0+largeurCell; // x fin - yf:=y0+HauteurCell; // y fin - position:=positionTCO(x,y); - fond:=TCO[x,y].CouleurFond; - ep:=tco[x,y].epaisseurs; + x0:=(x-1)*LargeurCell[indexTCO]; // x origine + y0:=(y-1)*hauteurCell[indexTCO]; // y origine + yc:=y0+(hauteurCell[indexTCO] div 2); // y centre + xc:=x0+(LargeurCell[indexTCO] div 2); // x centre + xf:=x0+LargeurCell[indexTCO]; // x fin + yf:=y0+hauteurCell[indexTCO]; // y fin + position:=positionTCO(indexTco,x,y); + fond:=tco[indextco,x,y].CouleurFond; + ep:=tco[indextco,x,y].epaisseurs; // mode rond - x1:=x0+(largeurcell div 2);y1:=y0-(hauteurCell div 3); - x2:=xf+(2*largeurCell)+(largeurcell div 2);y2:=yf+hauteurcell+(hauteurCell div 3); + x1:=x0+(LargeurCell[indexTCO] div 2);y1:=y0-(hauteurCell[indexTCO] div 3); + x2:=xf+(2*LargeurCell[indexTCO])+(LargeurCell[indexTCO] div 2);y2:=yf+hauteurCell[indexTCO]+(hauteurCell[indexTCO] div 3); x3:=xf;y3:=y0; x4:=xc;y4:=yf; @@ -4917,14 +5622,14 @@ begin end; end; -procedure dessin_26(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_26(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); begin - if graphisme=1 then dessin_26L(Canvas,x,y,Mode); - if graphisme=2 then dessin_26C(Canvas,x,y,Mode); + if graphisme=1 then dessin_26L(indexTco,Canvas,x,y,Mode); + if graphisme=2 then dessin_26C(indexTco,Canvas,x,y,Mode); end; // Element 27 fait -procedure dessin_27L(Canvas : Tcanvas;x,y,mode: integer); +procedure dessin_27L(indexTCO : integer;Canvas : Tcanvas;x,y,mode: integer); var x0,y0,jx2,jy2,jx3,jy3,xc,yc,jx1,jy1,xf,yf,position,ep : integer; r : Trect; fond: tcolor; @@ -4975,15 +5680,15 @@ var x0,y0,jx2,jy2,jx3,jy3,xc,yc,jx1,jy1,xf,yf,position,ep : integer; begin - x0:=(x-1)*LargeurCell; // x origine - y0:=(y-1)*HauteurCell; // y origine - yc:=y0+(HauteurCell div 2); // y centre - xc:=x0+(LargeurCell div 2); // x centre - xf:=x0+largeurCell; // x fin - yf:=y0+HauteurCell; // y fin - position:=positionTCO(x,y); - fond:=TCO[x,y].CouleurFond; - ep:=tco[x,y].epaisseurs; + x0:=(x-1)*LargeurCell[indexTCO]; // x origine + y0:=(y-1)*hauteurCell[indexTCO]; // y origine + yc:=y0+(hauteurCell[indexTCO] div 2); // y centre + xc:=x0+(LargeurCell[indexTCO] div 2); // x centre + xf:=x0+LargeurCell[indexTCO]; // x fin + yf:=y0+hauteurCell[indexTCO]; // y fin + position:=positionTCO(indexTco,x,y); + fond:=tco[indextco,x,y].CouleurFond; + ep:=tco[indextco,x,y].epaisseurs; with canvas do begin @@ -5045,7 +5750,7 @@ begin end; // Element 27c fait -procedure dessin_27C(Canvas : Tcanvas;x,y,mode: integer); +procedure dessin_27C(indexTCO : integer;Canvas : Tcanvas;x,y,mode: integer); var x0,y0,xc,yc,jx1,jy1,jx2,jy2,xf,yf,x1,y1,x2,y2,x3,y3,x4,y4,position,ep, jx3,jy3 : integer; r : Trect; @@ -5094,19 +5799,19 @@ procedure trajet_droit; end; begin - x0:=(x-1)*LargeurCell; // x origine - y0:=(y-1)*HauteurCell; // y origine - yc:=y0+(HauteurCell div 2); // y centre - xc:=x0+(LargeurCell div 2); // x centre - xf:=x0+largeurCell; // x fin - yf:=y0+HauteurCell; // y fin - position:=positionTCO(x,y); - fond:=TCO[x,y].CouleurFond; - ep:=tco[x,y].epaisseurs; + x0:=(x-1)*LargeurCell[indexTCO]; // x origine + y0:=(y-1)*hauteurCell[indexTCO]; // y origine + yc:=y0+(hauteurCell[indexTCO] div 2); // y centre + xc:=x0+(LargeurCell[indexTCO] div 2); // x centre + xf:=x0+LargeurCell[indexTCO]; // x fin + yf:=y0+hauteurCell[indexTCO]; // y fin + position:=positionTCO(indexTco,x,y); + fond:=tco[indextco,x,y].CouleurFond; + ep:=tco[indextco,x,y].epaisseurs; // mode rond - x1:=x0-(2*largeurCell)-(largeurcell div 3);y1:=y0-hauteurcell-(hauteurCell div 3); - x2:=xc;y2:=yf+(hauteurCell div 3); // div 3 permet d'avoir un angle a 45° plutot que div 2 + x1:=x0-(2*LargeurCell[indexTCO])-(LargeurCell[indexTCO] div 3);y1:=y0-hauteurCell[indexTCO]-(hauteurCell[indexTCO] div 3); + x2:=xc;y2:=yf+(hauteurCell[indexTCO] div 3); // div 3 permet d'avoir un angle a 45° plutot que div 2 x3:=x0;y3:=yf; x4:=xc;y4:=y0; @@ -5168,14 +5873,14 @@ begin end; end; -procedure dessin_27(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_27(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); begin - if graphisme=1 then dessin_27L(Canvas,x,y,Mode); - if graphisme=2 then dessin_27C(Canvas,x,y,Mode); + if graphisme=1 then dessin_27L(indexTco,Canvas,x,y,Mode); + if graphisme=2 then dessin_27C(indexTco,Canvas,x,y,Mode); end; // Element 28 fait -procedure dessin_28L(Canvas : Tcanvas;x,y,mode: integer); +procedure dessin_28L(indexTCO : integer;Canvas : Tcanvas;x,y,mode: integer); var x0,y0,jx2,jy2,jx3,jy3,xc,yc,jx1,jy1,xf,yf,position,ep : integer; r : Trect; fond: tcolor; @@ -5226,15 +5931,15 @@ var x0,y0,jx2,jy2,jx3,jy3,xc,yc,jx1,jy1,xf,yf,position,ep : integer; begin - x0:=(x-1)*LargeurCell; // x origine - y0:=(y-1)*HauteurCell; // y origine - yc:=y0+(HauteurCell div 2); // y centre - xc:=x0+(LargeurCell div 2); // x centre - xf:=x0+largeurCell; // x fin - yf:=y0+HauteurCell; // y fin - position:=positionTCO(x,y); - fond:=TCO[x,y].CouleurFond; - ep:=tco[x,y].epaisseurs; + x0:=(x-1)*LargeurCell[indexTCO]; // x origine + y0:=(y-1)*hauteurCell[indexTCO]; // y origine + yc:=y0+(hauteurCell[indexTCO] div 2); // y centre + xc:=x0+(LargeurCell[indexTCO] div 2); // x centre + xf:=x0+LargeurCell[indexTCO]; // x fin + yf:=y0+hauteurCell[indexTCO]; // y fin + position:=positionTCO(indexTco,x,y); + fond:=tco[indextco,x,y].CouleurFond; + ep:=tco[indextco,x,y].epaisseurs; with canvas do begin @@ -5286,7 +5991,7 @@ begin end; // Element 28 fait -procedure dessin_28C(Canvas : Tcanvas;x,y,mode: integer); +procedure dessin_28C(indexTCO : integer;Canvas : Tcanvas;x,y,mode: integer); var x0,y0,xc,yc,jx1,jy1,jx2,jy2,xf,yf,x1,y1,x2,y2,x3,y3,x4,y4,position,ep, jx3,jy3 : integer; r : Trect; @@ -5335,19 +6040,19 @@ procedure trajet_droit; end; begin - x0:=(x-1)*LargeurCell; // x origine - y0:=(y-1)*HauteurCell; // y origine - yc:=y0+(HauteurCell div 2); // y centre - xc:=x0+(LargeurCell div 2); // x centre - xf:=x0+largeurCell; // x fin - yf:=y0+HauteurCell; // y fin - position:=positionTCO(x,y); - fond:=TCO[x,y].CouleurFond; - ep:=tco[x,y].epaisseurs; + x0:=(x-1)*LargeurCell[indexTCO]; // x origine + y0:=(y-1)*hauteurCell[indexTCO]; // y origine + yc:=y0+(hauteurCell[indexTCO] div 2); // y centre + xc:=x0+(LargeurCell[indexTCO] div 2); // x centre + xf:=x0+LargeurCell[indexTCO]; // x fin + yf:=y0+hauteurCell[indexTCO]; // y fin + position:=positionTCO(indexTco,x,y); + fond:=tco[indextco,x,y].CouleurFond; + ep:=tco[indextco,x,y].epaisseurs; // mode rond - x1:=x0+(largeurcell div 2);y1:=y0-hauteurCell-(hauteurCell div 3); - x2:=xf+(2*largeurCell)+(largeurcell div 2);y2:=yf+(hauteurCell div 3); + x1:=x0+(LargeurCell[indexTCO] div 2);y1:=y0-hauteurCell[indexTCO]-(hauteurCell[indexTCO] div 3); + x2:=xf+(2*LargeurCell[indexTCO])+(LargeurCell[indexTCO] div 2);y2:=yf+(hauteurCell[indexTCO] div 3); x3:=xc;y3:=y0; x4:=xf;y4:=yf; @@ -5408,14 +6113,14 @@ begin end; end; -procedure dessin_28(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_28(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); begin - if graphisme=1 then dessin_28L(Canvas,x,y,Mode); - if graphisme=2 then dessin_28C(Canvas,x,y,Mode); + if graphisme=1 then dessin_28L(indexTco,Canvas,x,y,Mode); + if graphisme=2 then dessin_28C(indexTco,Canvas,x,y,Mode); end; // Element 29 fait -procedure dessin_29L(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_29L(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; fond : tcolor; @@ -5465,15 +6170,15 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; begin - x0:=(x-1)*LargeurCell; // x origine - y0:=(y-1)*HauteurCell; // y origine - yc:=y0+(HauteurCell div 2); // y centre - xc:=x0+(LargeurCell div 2); // x centre - xf:=x0+largeurCell; // x fin - yf:=y0+HauteurCell; // y fin - position:=positionTCO(x,y); - fond:=TCO[x,y].CouleurFond; - ep:=tco[x,y].epaisseurs; + x0:=(x-1)*LargeurCell[indexTCO]; // x origine + y0:=(y-1)*hauteurCell[indexTCO]; // y origine + yc:=y0+(hauteurCell[indexTCO] div 2); // y centre + xc:=x0+(LargeurCell[indexTCO] div 2); // x centre + xf:=x0+LargeurCell[indexTCO]; // x fin + yf:=y0+hauteurCell[indexTCO]; // y fin + position:=positionTCO(indexTco,x,y); + fond:=tco[indextco,x,y].CouleurFond; + ep:=tco[indextco,x,y].epaisseurs; with canvas do begin @@ -5527,7 +6232,7 @@ begin end; // fait -procedure dessin_29C(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_29C(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; fond : tcolor; procedure trajet_droit; @@ -5573,21 +6278,21 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; end; begin - x0:=(x-1)*LargeurCell; // x origine - y0:=(y-1)*HauteurCell; // y origine - yc:=y0+(HauteurCell div 2); // y centre - xc:=x0+(LargeurCell div 2); // x centre - xf:=x0+largeurCell; // x fin - yf:=y0+HauteurCell; // y fin + x0:=(x-1)*LargeurCell[indexTCO]; // x origine + y0:=(y-1)*hauteurCell[indexTCO]; // y origine + yc:=y0+(hauteurCell[indexTCO] div 2); // y centre + xc:=x0+(LargeurCell[indexTCO] div 2); // x centre + xf:=x0+LargeurCell[indexTCO]; // x fin + yf:=y0+hauteurCell[indexTCO]; // y fin // mode rond - x1:=x0-(2*largeurCell)-(largeurcell div 2);y1:=y0-(hauteurCell div 3); - x2:=x0+(largeurcell div 2);y2:=yf+hauteurcell+(hauteurCell div 3); + x1:=x0-(2*LargeurCell[indexTCO])-(LargeurCell[indexTCO] div 2);y1:=y0-(hauteurCell[indexTCO] div 3); + x2:=x0+(LargeurCell[indexTCO] div 2);y2:=yf+hauteurCell[indexTCO]+(hauteurCell[indexTCO] div 3); x3:=xc;y3:=yf; x4:=x0;y4:=y0; - ep:=tco[x,y].epaisseurs; + ep:=tco[indextco,x,y].epaisseurs; - position:=positionTCO(x,y); - fond:=TCO[x,y].CouleurFond; + position:=positionTCO(indexTco,x,y); + fond:=tco[indextco,x,y].CouleurFond; with canvas do begin @@ -5647,14 +6352,14 @@ begin end; end; -procedure dessin_29(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_29(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); begin - if graphisme=1 then dessin_29L(Canvas,x,y,Mode); - if graphisme=2 then dessin_29C(Canvas,x,y,Mode); + if graphisme=1 then dessin_29L(indexTco,Canvas,x,y,Mode); + if graphisme=2 then dessin_29C(indexTco,Canvas,x,y,Mode); end; // Elément 32 fait -procedure dessin_32L(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_32L(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,position,ep : integer; r : Trect; fond : tcolor; @@ -5705,15 +6410,15 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,position,ep : integer; begin - x0:=(x-1)*LargeurCell; // x origine - y0:=(y-1)*HauteurCell; // y origine - yc:=y0+(HauteurCell div 2); // y centre - xc:=x0+(LargeurCell div 2); // x centre - xf:=x0+largeurCell; // x fin - yf:=y0+HauteurCell; // y fin - position:=positionTCO(x,y); - fond:=TCO[x,y].CouleurFond; - ep:=tco[x,y].epaisseurs; + x0:=(x-1)*LargeurCell[indexTCO]; // x origine + y0:=(y-1)*hauteurCell[indexTCO]; // y origine + yc:=y0+(hauteurCell[indexTCO] div 2); // y centre + xc:=x0+(LargeurCell[indexTCO] div 2); // x centre + xf:=x0+LargeurCell[indexTCO]; // x fin + yf:=y0+hauteurCell[indexTCO]; // y fin + position:=positionTCO(indexTco,x,y); + fond:=tco[indextco,x,y].CouleurFond; + ep:=tco[indextco,x,y].epaisseurs; with canvas do begin @@ -5775,7 +6480,7 @@ begin end; end; -procedure dessin_32C(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_32C(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; fond : tcolor; @@ -5824,21 +6529,21 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; begin - x0:=(x-1)*LargeurCell; // x origine - y0:=(y-1)*HauteurCell; // y origine - yc:=y0+(HauteurCell div 2); // y centre - xc:=x0+(LargeurCell div 2); // x centre - xf:=x0+largeurCell; // x fin - yf:=y0+HauteurCell; // y fin + x0:=(x-1)*LargeurCell[indexTCO]; // x origine + y0:=(y-1)*hauteurCell[indexTCO]; // y origine + yc:=y0+(hauteurCell[indexTCO] div 2); // y centre + xc:=x0+(LargeurCell[indexTCO] div 2); // x centre + xf:=x0+LargeurCell[indexTCO]; // x fin + yf:=y0+hauteurCell[indexTCO]; // y fin // mode rond - x1:=x0+(largeurcell div 2);y1:=y0-(hauteurCell div 3); - x2:=xf+(2*largeurCell)+(largeurcell div 2);y2:=yf+hauteurcell+(hauteurCell div 3); + x1:=x0+(LargeurCell[indexTCO] div 2);y1:=y0-(hauteurCell[indexTCO] div 3); + x2:=xf+(2*LargeurCell[indexTCO])+(LargeurCell[indexTCO] div 2);y2:=yf+hauteurCell[indexTCO]+(hauteurCell[indexTCO] div 3); x3:=xf;y3:=y0; x4:=xc;y4:=yf; - position:=positionTCO(x,y); - fond:=TCO[x,y].CouleurFond; - ep:=tco[x,y].epaisseurs; + position:=positionTCO(indexTco,x,y); + fond:=tco[indextco,x,y].CouleurFond; + ep:=tco[indextco,x,y].epaisseurs; with canvas do begin @@ -5900,14 +6605,14 @@ begin end; end; -procedure dessin_32(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_32(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); begin - if graphisme=1 then dessin_32L(Canvas,x,y,Mode); - if graphisme=2 then dessin_32C(Canvas,x,y,Mode); + if graphisme=1 then dessin_32L(indexTco,Canvas,x,y,Mode); + if graphisme=2 then dessin_32C(indexTco,Canvas,x,y,Mode); end; // Element 33 fait -procedure dessin_33L(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_33L(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; r : Trect; fond : tcolor; @@ -5959,15 +6664,15 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; begin - x0:=(x-1)*LargeurCell; // x origine - y0:=(y-1)*HauteurCell; // y origine - yc:=y0+(HauteurCell div 2); // y centre - xc:=x0+(LargeurCell div 2); // x centre - xf:=x0+largeurCell; // x fin - yf:=y0+HauteurCell; // y fin - position:=positionTCO(x,y); - fond:=TCO[x,y].CouleurFond; - ep:=TCO[x,y].epaisseurs; + x0:=(x-1)*LargeurCell[indexTCO]; // x origine + y0:=(y-1)*hauteurCell[indexTCO]; // y origine + yc:=y0+(hauteurCell[indexTCO] div 2); // y centre + xc:=x0+(LargeurCell[indexTCO] div 2); // x centre + xf:=x0+LargeurCell[indexTCO]; // x fin + yf:=y0+hauteurCell[indexTCO]; // y fin + position:=positionTCO(indexTco,x,y); + fond:=tco[indextco,x,y].CouleurFond; + ep:=tco[indextco,x,y].epaisseurs; with canvas do begin @@ -6030,7 +6735,7 @@ begin end; // fait -procedure dessin_33c(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_33c(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; r : Trect; fond : tcolor; @@ -6079,21 +6784,21 @@ procedure trajet_droit; begin - x0:=(x-1)*LargeurCell; // x origine - y0:=(y-1)*HauteurCell; // y origine - yc:=y0+(HauteurCell div 2); // y centre - xc:=x0+(LargeurCell div 2); // x centre - xf:=x0+largeurCell; // x fin - yf:=y0+HauteurCell; // y fin + x0:=(x-1)*LargeurCell[indexTCO]; // x origine + y0:=(y-1)*hauteurCell[indexTCO]; // y origine + yc:=y0+(hauteurCell[indexTCO] div 2); // y centre + xc:=x0+(LargeurCell[indexTCO] div 2); // x centre + xf:=x0+LargeurCell[indexTCO]; // x fin + yf:=y0+hauteurCell[indexTCO]; // y fin // mode rond - x1:=x0+(largeurcell div 2);y1:=y0-hauteurCell-(hauteurCell div 3); - x2:=xf+(2*largeurCell)+(largeurcell div 2);y2:=yf+(hauteurCell div 3); + x1:=x0+(LargeurCell[indexTCO] div 2);y1:=y0-hauteurCell[indexTCO]-(hauteurCell[indexTCO] div 3); + x2:=xf+(2*LargeurCell[indexTCO])+(LargeurCell[indexTCO] div 2);y2:=yf+(hauteurCell[indexTCO] div 3); x3:=xc;y3:=y0; x4:=xf;y4:=yf; - ep:=TCO[x,y].epaisseurs; + ep:=tco[indextco,x,y].epaisseurs; - position:=positionTCO(x,y); - fond:=TCO[x,y].CouleurFond; + position:=positionTCO(indexTco,x,y); + fond:=tco[indextco,x,y].CouleurFond; with canvas do begin @@ -6158,14 +6863,14 @@ begin end; end; -procedure dessin_33(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_33(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); begin - if graphisme=1 then dessin_33L(Canvas,x,y,Mode); - if graphisme=2 then dessin_33C(Canvas,x,y,Mode); + if graphisme=1 then dessin_33L(indexTco,Canvas,x,y,Mode); + if graphisme=2 then dessin_33C(indexTco,Canvas,x,y,Mode); end; // Element 34 fait -procedure dessin_34L(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_34L(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; fond : Tcolor; @@ -6214,15 +6919,15 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; end; begin - x0:=(x-1)*LargeurCell; // x origine - y0:=(y-1)*HauteurCell; // y origine - yc:=y0+(HauteurCell div 2); // y centre - xc:=x0+(LargeurCell div 2); // x centre - xf:=x0+largeurCell; // x fin - yf:=y0+HauteurCell; // y fin - position:=positionTCO(x,y); - fond:=TCO[x,y].CouleurFond; - ep:=TCO[x,y].epaisseurs; + x0:=(x-1)*LargeurCell[indexTCO]; // x origine + y0:=(y-1)*hauteurCell[indexTCO]; // y origine + yc:=y0+(hauteurCell[indexTCO] div 2); // y centre + xc:=x0+(LargeurCell[indexTCO] div 2); // x centre + xf:=x0+LargeurCell[indexTCO]; // x fin + yf:=y0+hauteurCell[indexTCO]; // y fin + position:=positionTCO(indexTco,x,y); + fond:=tco[indextco,x,y].CouleurFond; + ep:=tco[indextco,x,y].epaisseurs; with canvas do begin @@ -6274,7 +6979,7 @@ begin end; //fait -procedure dessin_34C(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_34C(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; fond : Tcolor; @@ -6322,21 +7027,21 @@ procedure trajet_droit; begin - x0:=(x-1)*LargeurCell; // x origine - y0:=(y-1)*HauteurCell; // y origine - yc:=y0+(HauteurCell div 2); // y centre - xc:=x0+(LargeurCell div 2); // x centre - xf:=x0+largeurCell; // x fin - yf:=y0+HauteurCell; // y fin + x0:=(x-1)*LargeurCell[indexTCO]; // x origine + y0:=(y-1)*hauteurCell[indexTCO]; // y origine + yc:=y0+(hauteurCell[indexTCO] div 2); // y centre + xc:=x0+(LargeurCell[indexTCO] div 2); // x centre + xf:=x0+LargeurCell[indexTCO]; // x fin + yf:=y0+hauteurCell[indexTCO]; // y fin // mode rond - x1:=x0-(2*largeurCell)-(largeurcell div 2);y1:=y0-hauteurCell-(hauteurCell div 3); - x2:=x0+(largeurcell div 2);y2:=yf+(hauteurCell div 3); + x1:=x0-(2*LargeurCell[indexTCO])-(LargeurCell[indexTCO] div 2);y1:=y0-hauteurCell[indexTCO]-(hauteurCell[indexTCO] div 3); + x2:=x0+(LargeurCell[indexTCO] div 2);y2:=yf+(hauteurCell[indexTCO] div 3); x3:=x0;y3:=yf; x4:=xc;y4:=y0; - position:=positionTCO(x,y); - fond:=TCO[x,y].CouleurFond; - ep:=TCO[x,y].epaisseurs; + position:=positionTCO(indexTco,x,y); + fond:=tco[indextco,x,y].CouleurFond; + ep:=tco[indextco,x,y].epaisseurs; with canvas do begin @@ -6399,10 +7104,10 @@ begin end; end; -procedure dessin_34(Canvas : Tcanvas;x,y : integer;Mode : integer); +procedure dessin_34(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); begin - if graphisme=1 then dessin_34L(Canvas,x,y,Mode); - if graphisme=2 then dessin_34C(Canvas,x,y,Mode); + if graphisme=1 then dessin_34L(indexTco,Canvas,x,y,Mode); + if graphisme=2 then dessin_34C(indexTco,Canvas,x,y,Mode); end; // calcul des facteurs de réductions X et Y pour l'adapter à l'image de destination @@ -6415,7 +7120,7 @@ end; // Affiche dans le TCO en x,y un signal à 90° d'après l'image transmise // x y en coordonnées pixels -procedure Feu_90G(ImageSource : TImage;x,y : integer;FrX,FrY : real;inverse : boolean); +procedure Feu_90G(index : integer;ImageSource : TImage;x,y : integer;FrX,FrY : real;inverse : boolean); var p : array[0..2] of TPoint; TailleY,TailleX : integer; begin @@ -6430,24 +7135,25 @@ begin p[2].X:=0; //0; p[2].Y:=0; //0; + //&& parent pour l'index + if inverse then begin - inverse_image(FormTCO.ImageTemp2,ImageSource); + inverse_image(FormTCO[index].ImageTemp2,ImageSource); // copie l'image du signal depuis imagesource vers image temporaire à la même échelle mais retournée à 90° - PlgBlt(PImageTemp.Canvas.Handle,p,FormTCO.ImageTemp2.Canvas.Handle,0,0,TailleX,TailleY,0,0,0); + PlgBlt(PImageTemp[Index].Canvas.Handle,p,FormTCO[index].ImageTemp2.Canvas.Handle,0,0,TailleX,TailleY,0,0,0); end else - PlgBlt(PImageTemp.Canvas.Handle,p,ImageSource.Canvas.Handle,0,0,TailleX,TailleY,0,0,0); - + PlgBlt(PImageTemp[index].Canvas.Handle,p,ImageSource.Canvas.Handle,0,0,TailleX,TailleY,0,0,0); //PimageTemp.Visible:=true; // copie l'image du signal retournée depuis image temporaire vers tco avec une réduction en mode transparennt - TransparentBlt(PcanvasTCO.Handle,x,y,round(TailleY*FrY),round(TailleX*FrX), // destination - PImageTemp.Canvas.Handle,0,0,TailleY,TailleX,clBlue); // source - clblue est la couleur de transparence - PImageTCO.Picture.Bitmap.Modified:=True; // rafraichit l'affichage sinon le stretchblt n'apparaît pas. + TransparentBlt(PcanvasTCO[index].Handle,x,y,round(TailleY*FrY),round(TailleX*FrX), // destination + PImageTemp[index].Canvas.Handle,0,0,TailleY,TailleX,clBlue); // source - clblue est la couleur de transparence + PImageTCO[index].Picture.Bitmap.Modified:=True; // rafraichit l'affichage sinon le stretchblt n'apparaît pas. end; // copie de l'image du signal à 90° dans le canvas source et le tourne de 90° et le met dans l'image temporaire -procedure Feu_90D(ImageSource : TImage;x,y : integer ; FrX,FrY : real;inverse : boolean); +procedure Feu_90D(index : integer;ImageSource : TImage;x,y : integer ; FrX,FrY : real;inverse : boolean); var p : array[0..2] of TPoint; TailleY,TailleX : integer; begin @@ -6464,26 +7170,26 @@ begin if inverse then begin - inverse_image(FormTCO.ImageTemp2,ImageSource); + inverse_image(FormTCO[index].ImageTemp2,ImageSource); // copie l'image du signal depuis imagesource vers image temporaire à la même échelle mais retournée à 90° - PlgBlt(PImageTemp.Canvas.Handle,p,FormTCO.ImageTemp2.Canvas.Handle,0,0,TailleX,TailleY,0,0,0); + PlgBlt(PImageTemp[index].Canvas.Handle,p,FormTCO[index].ImageTemp2.Canvas.Handle,0,0,TailleX,TailleY,0,0,0); end else - PlgBlt(PImageTemp.Canvas.Handle,p,ImageSource.Canvas.Handle,0,0,TailleX,TailleY,0,0,0); + PlgBlt(PImageTemp[index].Canvas.Handle,p,ImageSource.Canvas.Handle,0,0,TailleX,TailleY,0,0,0); // et copier l'image avec mise à l'échelle tournée sur le TCO - TransparentBlt(PcanvasTCO.Handle,x,y,round(tailleY*FrY),round(tailleX*FrX), - PImageTemp.Canvas.Handle,0,0,TailleY,TailleX,clBlue); - PImageTCO.Picture.Bitmap.Modified:=True; // rafraichit l'affichage sinon le stretchblt n'apparaît pas. + TransparentBlt(PcanvasTCO[index].Handle,x,y,round(tailleY*FrY),round(tailleX*FrX), + PImageTemp[index].Canvas.Handle,0,0,TailleY,TailleX,clBlue); + PImageTCO[index].Picture.Bitmap.Modified:=True; // rafraichit l'affichage sinon le stretchblt n'apparaît pas. end; -procedure affiche_pied2G_90G(x,y : integer;FrX,frY : real;pied : integer); +procedure affiche_pied2G_90G(index,x,y : integer;FrX,frY : real;pied : integer); var x1,y1 : integer; ech,frYR : real; begin ech:=frY;frY:=frX;FrX:=ech; frYR:=frY*ratioC/10; - with PcanvasTCO do + with PcanvasTCO[index] do begin Pen.Width:=2; Pen.Color:=clPiedSignal; @@ -6495,13 +7201,13 @@ begin end; end; -procedure affiche_pied2G_90D(x,y : integer;FrX,frY : real;pied : integer); +procedure affiche_pied2G_90D(index,x,y : integer;FrX,frY : real;pied : integer); var x1,y1 : integer; ech,frYR: real; begin ech:=frY;frY:=frX;FrX:=ech; frYR:=frY*ratioC/10; - with PcanvasTCO do + with PcanvasTCO[index] do begin Pen.Width:=2; Pen.Color:=clPiedSignal; @@ -6513,10 +7219,10 @@ begin end; end; -procedure affiche_pied_Vertical2G(x,y : integer;FrX,frY : real;pied : integer); +procedure affiche_pied_Vertical2G(index,x,y : integer;FrX,frY : real;pied : integer); var x1,y1 : integer; begin - with PcanvasTCO do + with PcanvasTCO[index] do begin Pen.Width:=2; Pen.Color:=clPiedSignal; @@ -6528,13 +7234,13 @@ begin end; end; -procedure affiche_pied3G_90D(x,y : integer;FrX,frY : real;pied : integer); +procedure affiche_pied3G_90D(index,x,y : integer;FrX,frY : real;pied : integer); var x1,y1 : integer; ech,fryR : real; begin ech:=frY;frY:=frX;FrX:=ech; frYR:=frY*ratioC/10; - with PcanvasTCO do + with PcanvasTCO[index] do begin Pen.Width:=2; Pen.Color:=clPiedSignal; @@ -6546,13 +7252,13 @@ begin end; end; -procedure affiche_pied3G_90G(x,y : integer;FrX,frY : real;pied : integer); +procedure affiche_pied3G_90G(index,x,y : integer;FrX,frY : real;pied : integer); var x1,y1 : integer; ech,frYR : real; begin ech:=frY;frY:=frX;FrX:=ech; frYR:=frY*ratioC/10; - with PcanvasTCO do + with PcanvasTCO[index] do begin Pen.Width:=2; Pen.Color:=clPiedSignal; @@ -6564,10 +7270,10 @@ begin end; end; -procedure affiche_pied_Vertical3G(x,y : integer;FrX,frY : real;pied : integer); +procedure affiche_pied_Vertical3G(index,x,y : integer;FrX,frY : real;pied : integer); var x1,y1 : integer; begin - with PcanvasTCO do + with PcanvasTCO[index] do begin Pen.Width:=2; Pen.Color:=clPiedSignal; @@ -6579,13 +7285,13 @@ begin end; end; -procedure affiche_pied4G_90G(x,y : integer;FrX,frY : real;piedFeu : integer); +procedure affiche_pied4G_90G(index,x,y : integer;FrX,frY : real;piedFeu : integer); var x1,y1 : integer; fryR,ech : real; begin ech:=frY;frY:=frX;FrX:=ech; frYR:=frY*ratioC/10; - with PcanvasTCO do + with PcanvasTCO[index] do begin Pen.Width:=2; Pen.Color:=clPiedSignal; @@ -6597,13 +7303,13 @@ begin end; end; -procedure affiche_pied4G_90D(x,y : integer;FrX,frY : real;piedfeu: integer); +procedure affiche_pied4G_90D(index,x,y : integer;FrX,frY : real;piedfeu: integer); var x1,y1 : integer; ech,frYR : real; begin ech:=frY;frY:=frX;FrX:=ech; frYR:=frY*ratioC/10; - with PcanvasTCO do + with PcanvasTCO[index] do begin Pen.Width:=2; Pen.Color:=clPiedSignal; @@ -6615,10 +7321,10 @@ begin end; end; -procedure affiche_pied_Vertical4G(x,y : integer;FrX,frY : real;pied : integer); +procedure affiche_pied_Vertical4G(index,x,y : integer;FrX,frY : real;pied : integer); var x1,y1 : integer; begin - with PcanvasTCO do + with PcanvasTCO[index] do begin Pen.Width:=2; Pen.Color:=clPiedSignal; @@ -6630,13 +7336,13 @@ begin end; end; -procedure affiche_pied9G_90D(x,y : integer;FrX,frY : real;pied : integer); +procedure affiche_pied9G_90D(index,x,y : integer;FrX,frY : real;pied : integer); var x1,y1 : integer; var ech,frYR : real; begin ech:=frY;frY:=frX;FrX:=ech; frYR:=frY*ratioC/10; - with PcanvasTCO do + with PcanvasTCO[index] do begin Pen.Width:=2; Pen.Color:=clPiedSignal; @@ -6648,13 +7354,13 @@ begin end; end; -procedure affiche_pied5G_90D(x,y : integer;FrX,frY : real;piedFeu : integer); +procedure affiche_pied5G_90D(index,x,y : integer;FrX,frY : real;piedFeu : integer); var x1,y1 : integer; ech,frYR : real; begin ech:=frY;frY:=frX;FrX:=ech; frYR:=frY*ratioC/10; - with PcanvasTCO do + with PcanvasTCO[index] do begin Pen.Width:=2; Pen.Color:=clPiedSignal; @@ -6666,13 +7372,13 @@ begin end; end; -procedure affiche_pied5G_90G(x,y : integer;FrX,frY : real;piedFeu : integer); +procedure affiche_pied5G_90G(index,x,y : integer;FrX,frY : real;piedFeu : integer); var x1,y1 : integer; ech,fryR : real; begin ech:=frY;frY:=frX;FrX:=ech; frYR:=frY*ratioC/10; - with PcanvasTCO do + with PcanvasTCO[index] do begin Pen.Width:=2; Pen.Color:=clPiedSignal; @@ -6684,10 +7390,10 @@ begin end; end; -procedure affiche_pied_Vertical5G(x,y : integer;FrX,frY : real;pied : integer); +procedure affiche_pied_Vertical5G(index,x,y : integer;FrX,frY : real;pied : integer); var x1,y1 : integer; begin - with PcanvasTCO do + with PcanvasTCO[index] do begin Pen.Width:=2; Pen.Color:=clPiedSignal; @@ -6700,13 +7406,13 @@ begin end; end; -procedure affiche_pied7G_90D(x,y : integer;FrX,frY : real;pied : integer); +procedure affiche_pied7G_90D(index,x,y : integer;FrX,frY : real;pied : integer); var x1,y1 : integer; ech,frYR : real; begin ech:=frY;frY:=frX;FrX:=ech; frYR:=frY*ratioC/10; - with PcanvasTCO do + with PcanvasTCO[index] do begin Pen.Width:=2; Pen.Color:=clPiedSignal; @@ -6718,13 +7424,13 @@ begin end; end; -procedure affiche_pied7G_90G(x,y : integer;FrX,frY : real;pied : integer); +procedure affiche_pied7G_90G(index,x,y : integer;FrX,frY : real;pied : integer); var x1,y1 : integer; ech,frYR : real; begin ech:=frY;frY:=frX;FrX:=ech; frYR:=frY*ratioC/10; - with PcanvasTCO do + with PcanvasTCO[index] do begin Pen.Color:=clPiedSignal; Pen.Width:=2; @@ -6736,10 +7442,10 @@ begin end; end; -procedure affiche_pied_Vertical7G(x,y : integer;FrX,frY : real;pied : integer); +procedure affiche_pied_Vertical7G(index,x,y : integer;FrX,frY : real;pied : integer); var x1,y1 : integer; begin - with PcanvasTCO do + with PcanvasTCO[index] do begin Pen.Width:=2; Pen.Color:=clPiedSignal; @@ -6751,13 +7457,13 @@ begin end; end; -procedure affiche_pied9G_90G(x,y : integer;FrX,frY : real;pied : integer); +procedure affiche_pied9G_90G(index,x,y : integer;FrX,frY : real;pied : integer); var x1,y1 : integer; frYR,ech : real; begin ech:=frY;frY:=frX;FrX:=ech; frYR:=frY*ratioC/10; - with PcanvasTCO do + with PcanvasTCO[index] do begin Pen.Color:=clPiedSignal; pen.Width:=2; @@ -6771,10 +7477,10 @@ begin end; end; -procedure affiche_pied_Vertical9G(x,y : integer;FrX,frY : real;pied : integer); +procedure affiche_pied_Vertical9G(index,x,y : integer;FrX,frY : real;pied : integer); var x1,y1 : integer; begin - with PcanvasTCO do + with PcanvasTCO[index] do begin Pen.Width:=2; Pen.Color:=clPiedSignal; @@ -6786,7 +7492,7 @@ begin end; end; -procedure Efface_Cellule(Canvas : Tcanvas;x,y : integer;Mode : TPenMode); +procedure Efface_Cellule(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : TPenMode); var x0,y0 : integer; r : TRect; c : tcolor; @@ -6795,20 +7501,20 @@ begin if y>1 then begin // si la cellule au dessus contient un feu vertical, ne pas effacer la cellule - // if (tco[x,y-1].BImage=12) and (tco[x,y-1].FeuOriente=1) then exit; + // if (tco[indextco,x,y-1].BImage=12) and (tco[indextco,x,y-1].FeuOriente=1) then exit; end; if xNbreCellX) or (y>NbreCellY) or (x<1) or (y<1) then exit; + if (x>NbreCellX[indexTCO]) or (y>NbreCellY[indexTCO]) or (x<1) or (y<1) then exit; - x0:=(x-1)*LargeurCell; - y0:=(y-1)*HauteurCell; - r:=Rect(x0,y0,x0+LargeurCell,y0+HauteurCell); - c:=TCO[x,y].CouleurFond; + x0:=(x-1)*LargeurCell[indexTCO]; + y0:=(y-1)*hauteurCell[indexTCO]; + r:=Rect(x0,y0,x0+LargeurCell[indexTCO],y0+hauteurCell[indexTCO]); + c:=tco[indextco,x,y].CouleurFond; with canvas do begin @@ -6822,19 +7528,18 @@ begin end; // Dessine un signal dans le canvasDest en x,y , dont l'adresse se trouve à la cellule x,y -procedure dessin_Signal(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; ImageFeu : Timage; frX,frY : real; begin - //Efface_Cellule(CanvasDest,x,y,pmCopy); - if (x>NbreCellX) or (y>NbreCellY) 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; - yp:=(y-1)*HauteurCell; - Adresse:=TCO[x,y].Adresse; + xp:=(x-1)*LargeurCell[indexTCO]; + yp:=(y-1)*hauteurCell[indexTCO]; + Adresse:=tco[indextco,x,y].Adresse; - Orientation:=TCO[x,y].FeuOriente; + Orientation:=tco[indextco,x,y].FeuOriente; if Orientation=0 then Orientation:=1; // cas d'un signal non encore renseigné index:=Index_Signal(adresse); @@ -6862,17 +7567,17 @@ begin TailleX:=ImageFeu.picture.BitMap.Width; TailleY:=ImageFeu.picture.BitMap.Height; // taille du feu d'origine (verticale) - PiedFeu:=TCO[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 - calcul_reduction(frx,fry,round(TailleX*LargeurCell/ZoomMax),round(tailleY*HauteurCell/ZoomMax),TailleX,TailleY); + calcul_reduction(frx,fry,round(TailleX*LargeurCell[indexTCO]/ZoomMax),round(tailleY*hauteurCell[indexTCO]/ZoomMax),TailleX,TailleY); x0:=0;y0:=0; // pour les signaux directionnels if orientation=3 then //D begin - if aspect=20 then begin x0:=round(10*frX); y0:=HauteurCell-round(tailleX*frY);end; - if aspect=9 then begin x0:=round(10*frX); y0:=HauteurCell-round(tailleX*frY);end; - if aspect=7 then begin x0:=round(10*frX); y0:=HauteurCell-round(tailleX*frY);end; + if aspect=20 then begin x0:=round(10*frX); y0:=hauteurCell[indexTCO]-round(tailleX*frY);end; + if aspect=9 then begin x0:=round(10*frX); y0:=hauteurCell[indexTCO]-round(tailleX*frY);end; + if aspect=7 then begin x0:=round(10*frX); y0:=hauteurCell[indexTCO]-round(tailleX*frY);end; if aspect=5 then begin x0:=0; y0:=round((tailleX/2)*frY);end; if aspect=4 then begin x0:=0; y0:=round((tailleX/2)*frY);end; if aspect=3 then begin x0:=0; y0:=round((tailleX/2)*frY);end; @@ -6883,8 +7588,8 @@ begin if orientation=2 then begin if aspect=20 then begin x0:=0; y0:=0;end; - if aspect=9 then begin x0:=round(10*frX); y0:=HauteurCell-round(tailleX*frY);end; - if aspect=7 then begin x0:=round(10*frX); y0:=HauteurCell-round(tailleX*frY);end; + if aspect=9 then begin x0:=round(10*frX); y0:=hauteurCell[indexTCO]-round(tailleX*frY);end; + if aspect=7 then begin x0:=round(10*frX); y0:=hauteurCell[indexTCO]-round(tailleX*frY);end; if aspect=5 then begin x0:=round(10*frX); y0:=round((tailleX/2)*frY);end; if aspect=4 then begin x0:=round(10*frX); y0:=round((tailleX/2)*frY);end; if aspect=3 then begin x0:=round(8*frX); y0:=round((tailleX/2)*frY);end; @@ -6904,8 +7609,8 @@ begin end; x0:=x0+xp;y0:=y0+yp; - tco[x,y].x:=x0; - tco[x,y].y:=y0; + tco[indextco,x,y].x:=x0; + tco[indextco,x,y].y:=y0; // affichage du signal et du pied - orientation verticale if (Orientation=1) then @@ -6913,57 +7618,57 @@ begin // si inversion if feux[index].contrevoie then begin - inverse_image(FormTCO.ImageTemp,ImageFeu); + inverse_image(FormTCO[index].ImageTemp,ImageFeu); // copie avec mise à l'échelle de l'image du signal TransparentBlt(canvasDest.Handle,x0,y0,round(TailleX*frX),round(TailleY*frY), - FormTCO.ImageTemp.Canvas.Handle,0,0,TailleX,TailleY,clBlue); + FormTCO[indexTCO].ImageTemp.Canvas.Handle,0,0,TailleX,TailleY,clBlue); end else // copie avec mise à l'échelle de l'image du signal TransparentBlt(canvasDest.Handle,x0,y0,round(TailleX*frX),round(TailleY*frY), ImageFeu.Canvas.Handle,0,0,TailleX,TailleY,clBlue); - PImageTCO.Picture.Bitmap.Modified:=True; // rafraichit l'affichage sinon le stretchblt n'apparaît pas. + PImageTCO[indexTCO].Picture.Bitmap.Modified:=True; // rafraichit l'affichage sinon le stretchblt n'apparaît pas. case aspect of - 20 : affiche_pied_Vertical5G(x0+round(10*frx),y0+hauteurCell-round(10*fry),frX,frY,piedFeu); - 9 : affiche_pied_Vertical9G(x0,y0,frX,frY,piedFeu); - 7 : affiche_pied_Vertical7G(x0,y0,frX,frY,piedFeu); - 5 : affiche_pied_Vertical5G(x0,y0,frX,frY,piedFeu); - 4 : affiche_pied_Vertical4G(x0,y0,frX,frY,piedFeu); - 3 : affiche_pied_Vertical3G(x0,y0,frX,frY,PiedFeu); - 2 : affiche_pied_Vertical2G(x0,y0,frX,frY,PiedFeu); + 20 : affiche_pied_Vertical5G(indexTCO,x0+round(10*frx),y0+hauteurCell[indexTCO]-round(10*fry),frX,frY,piedFeu); + 9 : affiche_pied_Vertical9G(indexTCO,x0,y0,frX,frY,piedFeu); + 7 : affiche_pied_Vertical7G(indexTCO,x0,y0,frX,frY,piedFeu); + 5 : affiche_pied_Vertical5G(indexTCO,x0,y0,frX,frY,piedFeu); + 4 : affiche_pied_Vertical4G(indexTCO,x0,y0,frX,frY,piedFeu); + 3 : affiche_pied_Vertical3G(indexTCO,x0,y0,frX,frY,PiedFeu); + 2 : affiche_pied_Vertical2G(indexTCO,x0,y0,frX,frY,PiedFeu); end; end; // affichage du feu et du pieds - orientation 90°G if Orientation=2 then begin - Feu_90G(ImageFeu,x0,y0,frX,frY,feux[index].contrevoie); // ici on passe l'origine du signal + Feu_90G(indexTCO,ImageFeu,x0,y0,frX,frY,feux[index].contrevoie); // ici on passe l'origine du signal // dessiner le pied case aspect of - 20 : affiche_pied5G_90G(x0+2,y0+round(fry*5),frX,frY,piedFeu); - 9 : affiche_pied9G_90G(x0,y0,frX,frY,piedFeu); - 7 : affiche_pied7G_90G(x0,y0,frX,frY,piedFeu); - 5 : affiche_pied5G_90G(x0,y0,frX,frY,piedFeu); - 4 : affiche_pied4G_90G(x0,y0,frX,frY,piedFeu); - 3 : affiche_pied3G_90G(x0,y0,frX,frY,piedFeu); - 2 : affiche_pied2G_90G(x0,y0,frX,frY,piedFeu); + 20 : affiche_pied5G_90G(indexTCO,x0+2,y0+round(fry*5),frX,frY,piedFeu); + 9 : affiche_pied9G_90G(indexTCO,x0,y0,frX,frY,piedFeu); + 7 : affiche_pied7G_90G(indexTCO,x0,y0,frX,frY,piedFeu); + 5 : affiche_pied5G_90G(indexTCO,x0,y0,frX,frY,piedFeu); + 4 : affiche_pied4G_90G(indexTCO,x0,y0,frX,frY,piedFeu); + 3 : affiche_pied3G_90G(indexTCO,x0,y0,frX,frY,piedFeu); + 2 : affiche_pied2G_90G(indexTCO,x0,y0,frX,frY,piedFeu); end; end; // affichage du signal et du pied - orientation 90°D if Orientation=3 then begin - Feu_90D(ImageFeu,x0,y0,frX,frY,feux[index].contrevoie); + Feu_90D(indexTCO,ImageFeu,x0,y0,frX,frY,feux[index].contrevoie); // dessiner le pied case aspect of - 20 : affiche_pied5G_90D(x0+(largeurCell div 2)+round(frx*12),y0+(hauteurCell div 2),frX,frY,piedFeu); - 9 : affiche_pied9G_90D(x0,y0,frX,frY,piedFeu); - 7 : affiche_pied7G_90D(x0,y0,frX,frY,piedFeu); - 5 : affiche_pied5G_90D(x0,y0,frX,frY,piedFeu); - 4 : affiche_pied4G_90D(x0,y0,frX,frY,piedFeu); - 3 : affiche_pied3G_90D(x0,y0,frX,frY,PiedFeu); - 2 : affiche_pied2G_90D(x0,y0,frX,frY,PiedFeu); + 20 : affiche_pied5G_90D(indexTCO,x0+(LargeurCell[indexTCO] div 2)+round(frx*12),y0+(hauteurCell[indexTCO] div 2),frX,frY,piedFeu); + 9 : affiche_pied9G_90D(indexTCO,x0,y0,frX,frY,piedFeu); + 7 : affiche_pied7G_90D(indexTCO,x0,y0,frX,frY,piedFeu); + 5 : affiche_pied5G_90D(indexTCO,x0,y0,frX,frY,piedFeu); + 4 : affiche_pied4G_90D(indexTCO,x0,y0,frX,frY,piedFeu); + 3 : affiche_pied3G_90D(indexTCO,x0,y0,frX,frY,PiedFeu); + 2 : affiche_pied2G_90D(indexTCO,x0,y0,frX,frY,PiedFeu); end; end; @@ -6972,121 +7677,111 @@ begin end; -function style(s : string) : TfontStyles; -var fs : tFontStyles; -begin - fs:=[]; - if pos('G',s)<>0 then fs:=fs+[fsbold]; - if pos('I',s)<>0 then fs:=fs+[fsItalic]; - if pos('S',s)<>0 then fs:=fs+[fsUnderline]; - if pos('B',s)<>0 then fs:=fs+[fsStrikeout]; - style:=fs; -end; - // dessine l'icone n° Bimage dans le canvas PcanvasTCO, aux coordonnées cellules x,y en mode -procedure dessine_icone(PCanvasTCO : tcanvas;Bimage,X,Y,mode : integer); +procedure dessine_icone(indexTCO : integer;PCanvasTCO : tcanvas;Bimage,X,Y,mode : integer); begin case Bimage of // 0 : efface_cellule(PCanvasTCO,x,y,pmcopy); - 1 : dessin_1(PCanvasTCO,X,Y,mode); - 2 : dessin_2(PCanvasTCO,X,Y,mode); - 3 : dessin_3(PCanvasTCO,X,Y,mode); - 4 : dessin_4(PCanvasTCO,X,Y,Mode); - 5 : dessin_5(PCanvasTCO,X,Y,Mode); - 6 : dessin_6(PCanvasTCO,X,Y,Mode); - 7 : dessin_7(PCanvasTCO,X,Y,Mode); - 8 : dessin_8(PCanvasTCO,X,Y,Mode); - 9 : dessin_9(PCanvasTCO,X,Y,mode); - 10 : dessin_10(PCanvasTCO,X,Y,mode); - 11 : dessin_11(PCanvasTCO,X,Y,mode); - 12 : dessin_12(PCanvasTCO,X,Y,mode); - 13 : dessin_13(PCanvasTCO,X,Y,mode); - 14 : dessin_14(PCanvasTCO,X,Y,mode); - 15 : dessin_15(PCanvasTCO,X,Y,mode); - 16 : dessin_16(PCanvasTCO,X,Y,mode); - 17 : dessin_17(PCanvasTCO,X,Y,mode); - 18 : dessin_18(PCanvasTCO,X,Y,mode); - 19 : dessin_19(PCanvasTCO,X,Y,mode); - 20 : dessin_20(PCanvasTCO,X,Y,mode); - 21 : dessin_21(PCanvasTCO,X,Y,mode); - 22 : dessin_22(PCanvasTCO,X,Y,mode); - 23 : dessin_23(PCanvasTCO,X,Y,mode); - 24 : dessin_24(PCanvasTCO,X,Y,mode); - 25 : dessin_25(PCanvasTCO,X,Y,mode); - 26 : dessin_26(PCanvasTCO,X,Y,mode); - 27 : dessin_27(PCanvasTCO,X,Y,mode); - 28 : dessin_28(PCanvasTCO,X,Y,mode); - 29 : dessin_29(PCanvasTCO,X,Y,mode); - 32 : dessin_32(PCanvasTCO,X,Y,mode); - 33 : dessin_33(PCanvasTCO,X,Y,mode); - 34 : dessin_34(PCanvasTCO,X,Y,mode); + 1 : dessin_1(indexTCO,PCanvasTCO,X,Y,mode); + 2 : dessin_2(indexTCO,PCanvasTCO,X,Y,mode); + 3 : dessin_3(indexTCO,PCanvasTCO,X,Y,mode); + 4 : dessin_4(indexTCO,PCanvasTCO,X,Y,Mode); + 5 : dessin_5(indexTCO,PCanvasTCO,X,Y,Mode); + 6 : dessin_6(indexTCO,PCanvasTCO,X,Y,Mode); + 7 : dessin_7(indexTCO,PCanvasTCO,X,Y,Mode); + 8 : dessin_8(indexTCO,PCanvasTCO,X,Y,Mode); + 9 : dessin_9(indexTCO,PCanvasTCO,X,Y,mode); + 10 : dessin_10(indexTCO,PCanvasTCO,X,Y,mode); + 11 : dessin_11(indexTCO,PCanvasTCO,X,Y,mode); + 12 : dessin_12(indexTCO,PCanvasTCO,X,Y,mode); + 13 : dessin_13(indexTCO,PCanvasTCO,X,Y,mode); + 14 : dessin_14(indexTCO,PCanvasTCO,X,Y,mode); + 15 : dessin_15(indexTCO,PCanvasTCO,X,Y,mode); + 16 : dessin_16(indexTCO,PCanvasTCO,X,Y,mode); + 17 : dessin_17(indexTCO,PCanvasTCO,X,Y,mode); + 18 : dessin_18(indexTCO,PCanvasTCO,X,Y,mode); + 19 : dessin_19(indexTCO,PCanvasTCO,X,Y,mode); + 20 : dessin_20(indexTCO,PCanvasTCO,X,Y,mode); + 21 : dessin_21(indexTCO,PCanvasTCO,X,Y,mode); + 22 : dessin_22(indexTCO,PCanvasTCO,X,Y,mode); + 23 : dessin_23(indexTCO,PCanvasTCO,X,Y,mode); + 24 : dessin_24(indexTCO,PCanvasTCO,X,Y,mode); + 25 : dessin_25(indexTCO,PCanvasTCO,X,Y,mode); + 26 : dessin_26(indexTCO,PCanvasTCO,X,Y,mode); + 27 : dessin_27(indexTCO,PCanvasTCO,X,Y,mode); + 28 : dessin_28(indexTCO,PCanvasTCO,X,Y,mode); + 29 : dessin_29(indexTCO,PCanvasTCO,X,Y,mode); + 32 : dessin_32(indexTCO,PCanvasTCO,X,Y,mode); + 33 : dessin_33(indexTCO,PCanvasTCO,X,Y,mode); + 34 : dessin_34(indexTCO,PCanvasTCO,X,Y,mode); + + Id_signal : dessin_Signal(indexTCO,PCanvasTCO,X,Y); + Id_Quai : dessin_51(indexTCO,PCanvasTCO,X,Y,mode); + Id_action : dessin_52(indexTCO,PCanvasTCO,X,Y,mode); + + end; +end; - 50 : dessin_Signal(PCanvasTCO,X,Y); - 51 : dessin_51(PCanvasTCO,X,Y,mode); - end; -end; // affiche la cellule x et y en cases // index est utilisé pour accéder au tableau du tracé de la fonction zone_tco -procedure affiche_cellule(x,y : integer); +procedure affiche_cellule(indexTCO,x,y : integer); var i,index,repr,Xorg,Yorg,xt,yt,mode,adresse,Bimage,aspect,oriente,pied : integer; inverse : boolean; s : string; begin - //if tco[x,y].BImage=0 then exit; + if AvecGrille[indexTCO] then entoure_cell_grille(indexTCO,x,y); // grille derrière + //if tco[indextco,x,y].BImage=0 then exit; //Affiche('Affiche_cellule',clLime); - PcanvasTCO.pen.Mode:=PmCopy; + PcanvasTCO[indexTCO].pen.Mode:=PmCopy; //pcanvasTCO.Brush.Style:=BsClear; - adresse:=tco[x,y].Adresse; - BImage:=tco[x,y].BImage; - mode:=tco[x,y].mode; - repr:=tco[x,y].repr; + adresse:=tco[indextco,x,y].Adresse; + BImage:=tco[indextco,x,y].BImage; + mode:=tco[indextco,x,y].mode; + repr:=tco[indextco,x,y].repr; - Xorg:=(x-1)*LargeurCell; - Yorg:=(y-1)*HauteurCell; + Xorg:=(x-1)*LargeurCell[indexTCO]; + Yorg:=(y-1)*hauteurCell[indexTCO]; // ------------- affichage de l'adresse ------------------ s:=IntToSTR(adresse); - // affiche d'abord l'icone de la cellule et colore la voie si zone ou détecteur actionnée selon valeur mode - dessine_icone(PCanvasTCO,Bimage,X,Y,mode); + dessine_icone(indexTCO,PCanvasTCO[indexTCO],Bimage,X,Y,mode); - PCanvasTCO.font.Size:=(LargeurCell div 10)+4 ; - //Affiche(intToSTR( (LargeurCell div 30)+6),clyellow); + PCanvasTCO[indexTCO].font.Size:=(LargeurCell[indexTCO] div 10)+4 ; + //Affiche(intToSTR( (LargeurCell[indexTCO] 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) and (BImage<=34) )) and (adresse<>0) then + if IsAigTCO(Bimage) and (adresse<>0) then begin if adresse<>0 then s:='A'+s+' ' else s:=' '; - with PCanvasTCO do + with PCanvasTCO[indexTCO] do begin - Brush.Color:=tco[x,y].CouleurFond; + Brush.Color:=tco[indextco,x,y].CouleurFond; //Brush.Style:=Bsclear; - Font.Color:=tco[x,y].coulFonte; + Font.Color:=tco[indextco,x,y].coulFonte; Font.Name:='Arial'; - Font.Style:=style(tco[x,y].FontStyle); + Font.Style:=style(tco[indextco,x,y].FontStyle); xt:=0;yt:=0; 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=3 then begin xt:=3;yt:=hauteurCell[indexTCO]-round(20*fryGlob[indexTCO]);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:=1;yt:=HauteurCell-round(15*frYGlob);end; - if Bimage=13 then begin xt:=LargeurCell-round(30*frXGlob);yt:=HauteurCell-round(15*frYGlob);end; - if Bimage=14 then begin xt:=LargeurCell-round(30*frXGlob);yt:=1;end; + if Bimage=5 then begin xt:=3;yt:=hauteurCell[indexTCO]-round(20*fryGlob[indexTCO]);end; + if Bimage=12 then begin xt:=1;yt:=hauteurCell[indexTCO]-round(15*fryGlob[indexTCO]);end; + if Bimage=13 then begin xt:=LargeurCell[indexTCO]-round(30*frxGlob[indexTCO]);yt:=hauteurCell[indexTCO]-round(15*fryGlob[indexTCO]);end; + if Bimage=14 then begin xt:=LargeurCell[indexTCO]-round(30*frxGlob[indexTCO]);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; - if Bimage=24 then begin xt:=LargeurCell-round(20*frXGlob);yt:=HauteurCell-round(15*frYGlob);end; - if Bimage=25 then begin xt:=1;yt:=HauteurCell-round(15*frYGlob);end; - if Bimage=26 then begin xt:=1;yt:=HauteurCell-round(15*frYGlob);end; + if Bimage=22 then begin xt:=3;yt:=hauteurCell[indexTCO]-round(15*fryGlob[indexTCO]);end; + if Bimage=24 then begin xt:=LargeurCell[indexTCO]-round(20*frxGlob[indexTCO]);yt:=hauteurCell[indexTCO]-round(15*fryGlob[indexTCO]);end; + if Bimage=25 then begin xt:=1;yt:=hauteurCell[indexTCO]-round(15*fryGlob[indexTCO]);end; + if Bimage=26 then begin xt:=1;yt:=hauteurCell[indexTCO]-round(15*fryGlob[indexTCO]);end; if Bimage=27 then begin xt:=1;yt:=1;end; if Bimage=28 then begin xt:=1;yt:=1;end; - if Bimage=29 then begin xt:=LargeurCell div 2;yt:=1;end; + if Bimage=29 then begin xt:=LargeurCell[indexTCO] div 2;yt:=1;end; if Bimage=32 then begin xt:=1;yt:=1;end; - if Bimage=33 then begin xt:=1;yt:=HauteurCell-round(15*frYGlob);end; - if Bimage=34 then begin xt:=LargeurCell-round(30*frXGlob);yt:=HauteurCell-round(15*frYGlob);end; + if Bimage=33 then begin xt:=1;yt:=hauteurCell[indexTCO]-round(15*fryGlob[indexTCO]);end; + if Bimage=34 then begin xt:=LargeurCell[indexTCO]-round(30*frxGlob[indexTCO]);yt:=hauteurCell[indexTCO]-round(15*fryGlob[indexTCO]);end; TextOut(xOrg+xt,yOrg+yt,s); @@ -7096,74 +7791,75 @@ begin // détecteurs voie horizontale if ((BImage=1) ) and (adresse<>0) then begin // Adresse de l'élément + xt:=3; if repr<>0 then - with PCanvasTCO do + with PCanvasTCO[indexTCO] do begin - Brush.Color:=tco[x,y].CouleurFond; - Font.Color:=tco[x,y].coulFonte; + Brush.Color:=tco[indextco,x,y].CouleurFond; + Font.Color:=tco[indextco,x,y].coulFonte; Font.Name:='Arial'; - Font.Style:=style(tco[x,y].FontStyle); - xt:=round(15*frXGlob); + Font.Style:=style(tco[indextco,x,y].FontStyle); + xt:=round(15*frxGlob[indexTCO]); case repr of - 1 : yt:=(HauteurCell div 2)-round(7*fryGlob); // milieu + 1 : yt:=(hauteurCell[indexTCO] div 2)-round(7*fryGlob[indexTCO]); // milieu 2 : yt:=1; // haut - 3 : yt:=HauteurCell-round(17*frYGlob); // bas + 3 : yt:=hauteurCell[indexTCO]-round(17*fryGlob[indexTCO]); // bas end; - TextOut(xOrg+xt,Yorg+yt,s); - // affiche/efface le nom du train du détecteur - s:=' '; + +{ // affiche/efface le nom du train du détecteur + s:=s+' '; case repr of 1,3 : yt:=1; // haut - 2 : yt:=HauteurCell-round(17*frYGlob); // bas - end; + 2 : yt:=hauteurCell[indexTCO]-round(17*fryGlob[indexTCO]); // bas + end; } i:=detecteur[adresse].AdrTrain; if i<>0 then begin i:=index_train_adresse(i); - if i<>0 then s:=trains[i].nom_train; + if i<>0 then s:=s+' '+trains[i].nom_train; end; - PCanvasTCO.font.Size:=(LargeurCell div 13)+4 ; - TextOut(xOrg,Yorg+yt,s+' '); + //PCanvasTCO[indexTCO].font.Size:=(LargeurCell[indexTCO] div 13)+4 ; + TextOut(xOrg+xt,Yorg+yt,s+' '); end; end; // autres détecteurs if ((Bimage=7) or (Bimage=8) or (Bimage=9) or (Bimage=10) or (Bimage=17) or (Bimage=20)) and (adresse<>0) then begin // Adresse de l'élément - with PCanvasTCO do + with PCanvasTCO[indexTCO] do begin - Brush.Color:=tco[x,y].CouleurFond; + Brush.Color:=tco[indextco,x,y].CouleurFond; Font.Name:='Arial'; - Font.Style:=style(tco[x,y].FontStyle); - Font.Color:=tco[x,y].coulFonte; - TextOut(xOrg+round(2*frXGlob),yOrg+round(2*fryGlob),s); + Font.Style:=style(tco[indextco,x,y].FontStyle); + Font.Color:=tco[indextco,x,y].coulFonte; + TextOut(xOrg+round(2*frxGlob[indexTCO]),yOrg+round(2*fryGlob[indexTCO]),s); end; end; // autres détecteurs if (Bimage=18) and (adresse<>0) then begin // Adresse de l'élément - with PCanvasTCO do + with PCanvasTCO[indexTCO] do begin - Brush.Color:=tco[x,y].CouleurFond; + Brush.Color:=tco[indextco,x,y].CouleurFond; Font.Name:='Arial'; - Font.Style:=style(tco[x,y].FontStyle); - Font.Color:=tco[x,y].coulFonte; - TextOut(xOrg+round(20*frXGlob),yOrg+HauteurCell-round(14*frYGlob),s); + Font.Style:=style(tco[indextco,x,y].FontStyle); + Font.Color:=tco[indextco,x,y].coulFonte; + TextOut(xOrg+round(20*frxGlob[indexTCO]),yOrg+hauteurCell[indexTCO]-round(14*fryGlob[indexTCO]),s); end; end; // autres détecteurs if ((Bimage=6) or (Bimage=11) or (Bimage=16)) and (adresse<>0) then begin // Adresse de l'élément - with PCanvasTCO do + with PCanvasTCO[indexTCO] do begin - Brush.Color:=tco[x,y].CouleurFond; - Font.Color:=tco[x,y].coulFonte;; - Font.Style:=style(tco[x,y].FontStyle); + Brush.Color:=tco[indextco,x,y].CouleurFond; + Font.Color:=tco[indextco,x,y].coulFonte;; + Font.Style:=style(tco[indextco,x,y].FontStyle); Font.Name:='Arial'; - TextOut(xOrg+round(28*frXGlob),yOrg+round(2*fryGlob),s); + TextOut(xOrg+round(28*frxGlob[indexTCO]),yOrg+round(2*fryGlob[indexTCO]),s); //exit; end; end; @@ -7173,170 +7869,138 @@ begin begin index:=Index_Signal(adresse); aspect:=feux[index].Aspect; - oriente:=TCO[x,y].FeuOriente; - pied:=TCO[x,y].PiedFeu; + oriente:=tco[indextco,x,y].FeuOriente; + pied:=tco[indextco,x,y].PiedFeu; inverse:=feux[index].contrevoie; xt:=0;yt:=0; if (aspect=20) and (Oriente=1) then begin - if inverse then begin xt:=2;yt:=2*HauteurCell-round(16*fryGlob);end + if inverse then begin xt:=2;yt:=2*hauteurCell[indexTCO]-round(16*fryGlob[indexTCO]);end else - begin xt:=(largeurCell div 2)+round(5*frXglob);yt:=2*HauteurCell-round(20*fryGlob); end; + begin xt:=(LargeurCell[indexTCO] div 2)+round(5*frxGlob[indexTCO]);yt:=2*hauteurCell[indexTCO]-round(20*fryGlob[indexTCO]); end; end; if (aspect=20) and (Oriente=2) then begin - if inverse then begin xt:=round(20*frxGlob);yt:=round(3*fryGlob);end + if inverse then begin xt:=round(20*frxGlob[indexTCO]);yt:=round(3*fryGlob[indexTCO]);end else - begin xt:=round(10*frxGlob);yt:=HauteurCell-round(16*fryGlob);end; + begin xt:=round(10*frxGlob[indexTCO]);yt:=hauteurCell[indexTCO]-round(16*fryGlob[indexTCO]);end; end; if (aspect=20) and (Oriente=3) then begin - if inverse then begin xt:=largeurCell+round(10*frxGlob);yt:=HauteurCell-round(16*fryGlob);end - else begin xt:=largeurCell+round(10*frxGlob);yt:=round(1*fryGlob);end; + if inverse then begin xt:=LargeurCell[indexTCO]+round(10*frxGlob[indexTCO]);yt:=hauteurCell[indexTCO]-round(16*fryGlob[indexTCO]);end + else begin xt:=LargeurCell[indexTCO]+round(10*frxGlob[indexTCO]);yt:=round(1*fryGlob[indexTCO]);end; end; - if (aspect=9) and (Oriente=1) then begin xt:=LargeurCell-round(25*frXGlob);yt:=2*HauteurCell-round(25*fryGlob);end; - if (aspect=9) and (Oriente=2) then begin xt:=round(10*frXGlob);yt:=HauteurCell-round(17*frYGlob);end; // orientation G - if (aspect=9) and (Oriente=3) then begin xt:=LargeurCell+round(25*frXglob);yt:=1;end; - if (aspect=7) and (Oriente=1) then begin xt:=LargeurCell-round(25*frXGlob);yt:=HauteurCell;end; - if (aspect=7) and (Oriente=2) then begin xt:=round(10*frXGlob);yt:=HauteurCell-round(15*frYGlob);end; - if (aspect=7) and (Oriente=3) then begin xt:=LargeurCell+2;yt:=1;end; - if (aspect=5) and (Oriente=1) then begin xt:=round(10*frXGlob);yt:=HauteurCell+round(25*fryGlob);end; - if (aspect=5) and (Oriente=2) then begin xt:=round(10*frXGlob);yt:=HauteurCell ;end; - if (aspect=5) and (Oriente=3) then begin xt:=round(10*frXGlob);yt:=-round(14*frYGlob);end; - if (aspect=4) and (Oriente=1) then begin xt:=1;yt:=HauteurCell+round(20*fryGlob);end; - if (aspect=4) and (Oriente=2) then begin xt:=round(10*frXGlob);yt:=HauteurCell;end; - if (aspect=4) and (Oriente=3) then begin xt:=round(10*frXGlob);yt:=-round(14*frYGlob);end; - if (aspect=3) and (Oriente=1) and (pied=2) then begin xt:=round(-15*frXglob);yt:=1;end; // signal à droite - if (aspect=3) and (Oriente=1) and (pied=1) then begin xt:=round(45*frXglob);yt:=1;end; // signal à gauche - if (aspect=3) and (Oriente=2) then begin xt:=round(10*frXGlob);yt:=-round(14*frYGlob);end; - if (aspect=3) and (Oriente=3) then begin xt:=round(10*frXGlob);yt:=HauteurCell;end; - if (aspect=2) and (Oriente=1) and (pied=2) then begin xt:=round(-15*frXglob);yt:=1;end; // signal à droite - if (aspect=2) and (Oriente=1) and (pied=1) then begin xt:=round(45*frXglob);yt:=1;end; // signal à gauche - if (aspect=2) and (Oriente=2) then begin xt:=round(10*frXGlob);yt:=HauteurCell;end; // orientation G - if (aspect=2) and (Oriente=3) then begin xt:=round(10*frXGlob);yt:=HauteurCell;end; // orientation D - if (aspect>10) and (aspect<20) and(oriente=1) then begin xt:=1;yt:=HauteurCell-round(14*frYGlob);end; - if (aspect>10) and (aspect<20) and (oriente=2) then begin xt:=LargeurCell-round(15*frXGlob);yt:=0;end; - if (aspect>10) and (aspect<20) and (oriente=3) then begin xt:=LargeurCell-round(15*frXGlob);yt:=0;end; + if (aspect=9) and (Oriente=1) then begin xt:=LargeurCell[indexTCO]-round(25*frxGlob[indexTCO]);yt:=2*hauteurCell[indexTCO]-round(25*fryGlob[indexTCO]);end; + if (aspect=9) and (Oriente=2) then begin xt:=round(10*frxGlob[indexTCO]);yt:=hauteurCell[indexTCO]-round(17*fryGlob[indexTCO]);end; // orientation G + if (aspect=9) and (Oriente=3) then begin xt:=LargeurCell[indexTCO]+round(25*frxGlob[indexTCO]);yt:=1;end; + if (aspect=7) and (Oriente=1) then begin xt:=LargeurCell[indexTCO]-round(25*frxGlob[indexTCO]);yt:=hauteurCell[indexTCO];end; + if (aspect=7) and (Oriente=2) then begin xt:=round(10*frxGlob[indexTCO]);yt:=hauteurCell[indexTCO]-round(15*fryGlob[indexTCO]);end; + if (aspect=7) and (Oriente=3) then begin xt:=LargeurCell[indexTCO]+2;yt:=1;end; + if (aspect=5) and (Oriente=1) then begin xt:=round(10*frxGlob[indexTCO]);yt:=hauteurCell[indexTCO]+round(25*fryGlob[indexTCO]);end; + if (aspect=5) and (Oriente=2) then begin xt:=round(10*frxGlob[indexTCO]);yt:=hauteurCell[indexTCO] ;end; + if (aspect=5) and (Oriente=3) then begin xt:=round(10*frxGlob[indexTCO]);yt:=-round(14*fryGlob[indexTCO]);end; + if (aspect=4) and (Oriente=1) then begin xt:=1;yt:=hauteurCell[indexTCO]+round(20*fryGlob[indexTCO]);end; + if (aspect=4) and (Oriente=2) then begin xt:=round(10*frxGlob[indexTCO]);yt:=hauteurCell[indexTCO];end; + if (aspect=4) and (Oriente=3) then begin xt:=round(10*frxGlob[indexTCO]);yt:=-round(14*fryGlob[indexTCO]);end; + if (aspect=3) and (Oriente=1) and (pied=2) then begin xt:=round(-15*frxGlob[indexTCO]);yt:=1;end; // signal à droite + if (aspect=3) and (Oriente=1) and (pied=1) then begin xt:=round(45*frxGlob[indexTCO]);yt:=1;end; // signal à gauche + if (aspect=3) and (Oriente=2) then begin xt:=round(10*frxGlob[indexTCO]);yt:=-round(14*fryGlob[indexTCO]);end; + if (aspect=3) and (Oriente=3) then begin xt:=round(10*frxGlob[indexTCO]);yt:=hauteurCell[indexTCO];end; + if (aspect=2) and (Oriente=1) and (pied=2) then begin xt:=round(-15*frxGlob[indexTCO]);yt:=1;end; // signal à droite + if (aspect=2) and (Oriente=1) and (pied=1) then begin xt:=round(45*frxGlob[indexTCO]);yt:=1;end; // signal à gauche + if (aspect=2) and (Oriente=2) then begin xt:=round(10*frxGlob[indexTCO]);yt:=hauteurCell[indexTCO];end; // orientation G + if (aspect=2) and (Oriente=3) then begin xt:=round(10*frxGlob[indexTCO]);yt:=hauteurCell[indexTCO];end; // orientation D + if (aspect>10) and (aspect<20) and(oriente=1) then begin xt:=1;yt:=hauteurCell[indexTCO]-round(14*fryGlob[indexTCO]);end; + if (aspect>10) and (aspect<20) and (oriente=2) then begin xt:=LargeurCell[indexTCO]-round(15*frxGlob[indexTCO]);yt:=0;end; + if (aspect>10) and (aspect<20) and (oriente=3) then begin xt:=LargeurCell[indexTCO]-round(15*frxGlob[indexTCO]);yt:=0;end; - with PCanvasTCO do + with PCanvasTCO[indexTCO] do begin - Brush.Color:=tco[x,y].CouleurFond; - Font.Color:=tco[x,y].coulFonte; - Font.Style:=style(tco[x,y].FontStyle); + Brush.Color:=tco[indextco,x,y].CouleurFond; + Font.Color:=tco[indextco,x,y].coulFonte; + Font.Style:=style(tco[indextco,x,y].FontStyle); Font.Name:='Arial'; TextOut(xOrg+xt,yOrg+yt,s); end; end; - entoure_cell_grille(x,y); - //canvasTCO.TextOut(xOrg+1,yOrg+1,IntToSTR(x)); + //if AvecGrille entoure_cell_grille(x,y); // grille devant end; -procedure Entoure_cell(x,y : integer); +procedure Entoure_cell(indexTCO,x,y : integer); var r : Trect; x0,y0 : integer; begin - x0:=(x-1)*LargeurCell+1; - y0:=(y-1)*HauteurCell+1; - with PcanvasTCO do + x0:=(x-1)*LargeurCell[indexTCO]+1; + y0:=(y-1)*hauteurCell[indexTCO]+1; + with PcanvasTCO[indexTCO] do begin Pen.width:=3; Pen.Color:=clyellow; Brush.Color:=clBlack; Brush.Style:=bsSolid; Pen.Mode:=PmXor; - r:=Rect(x0,y0,x0+largeurCell,y0+HauteurCell); + r:=Rect(x0,y0,x0+LargeurCell[indexTCO],y0+hauteurCell[indexTCO]); Rectangle(r); Pen.width:=1; Pen.Mode:=PmCopy; end; end; -procedure efface_entoure; +procedure efface_entoure(indexTCO : integer); begin - if (entoure) then + if (entoure[indexTCO]) then begin - Entoure_cell(Xentoure,Yentoure); - entoure:=false; + Entoure_cell(indexTCO,Xentoure[indexTCO],Yentoure[indexTCO]); + entoure[indexTCO]:=false; end end; -procedure _entoure_cell_clic; +procedure _entoure_cell_clic(indexTCO: integer); begin - if not(entoure) then + if not(entoure[indexTCO]) then begin - Entoure_cell(XclicCell,YclicCell); - Xentoure:=XClicCell;Yentoure:=YclicCell; - entoure:=true; + Entoure_cell(indexTCO,XclicCell[indexTCO],YclicCell[indexTCO]); + Xentoure[indexTCO]:=XClicCell[indexTCO]; + Yentoure[indexTCO]:=YclicCell[indexTCO]; + entoure[indexTCO]:=true; end else begin - Entoure_cell(Xentoure,Yentoure); // efface l'ancien + Entoure_cell(indexTCO,Xentoure[indexTCO],Yentoure[indexTCO]); // efface l'ancien // si on clique sur le même on l'efface sans afficher un nouveau - if (Xentoure<>XclicCell) or (Yentoure<>YClicCell) then + if (Xentoure[indexTCO]<>XclicCell[indexTCO]) or (Yentoure[indexTCO]<>YClicCell[indexTCO]) then begin - Entoure_cell(XclicCell,YclicCell); + Entoure_cell(indexTCO,XclicCell[indexTCO],YclicCell[indexTCO]); end - else entoure:=false; + else entoure[indexTCO]:=false; - Xentoure:=XClicCell;Yentoure:=YclicCell; + Xentoure[indexTCO]:=XClicCell[indexTCO]; + Yentoure[indexTCO]:=YclicCell[indexTCO]; end; end; -procedure affiche_texte(x,y : integer); -var x0,y0,yt,repr,taillefont : integer; - ss,s : string; -begin - x0:=(x-1)*Largeurcell; - y0:=(y-1)*hauteurcell; - //PCanvasTCO.Brush.Style:=bsSolid; - - if (TCO[x,y].BImage=51) then PCanvasTCO.Brush.Color:=clQuai else PCanvasTCO.Brush.Color:=tco[x,y].CouleurFond; - //PCanvasTCO.pen.color:=clyellow; - PcanvasTCO.Font.Color:=tco[x,y].CoulFonte; - ss:=tco[x,y].fonte; - if ss='' then ss:='Arial'; - PcanvasTCO.Font.Name:=ss; - ss:=tco[x,y].FontStyle; - - PcanvasTCO.Font.Style:=style(ss); - - repr:=tco[x,y].repr; - taillefont:=tco[x,y].TailleFonte; - case repr of - 0,1 : yt:=(HauteurCell div 2)-round(tailleFont*fryGlob); // milieu - 2 : yt:=1; // haut - 3 : yt:=HauteurCell-round(2*TailleFont*frYGlob); // bas - end; - - if taillefont=0 then taillefont:=8; - PCanvasTCO.font.Size:=(taillefont*LargeurCell) div 40; - - s:=tco[x,y].Texte+' '; - PcanvasTCO.Textout(x0+2,y0+yt,s); -end; // affiche le tco suivant le tableau TCO -procedure Affiche_TCO ; +procedure Affiche_TCO(indexTCO : integer) ; var x,y,x1,y1,DimX,DimY : integer; s : string; r : Trect; begin if affevt then affiche('Affiche_tco',clLime); - if pImageTCO=nil then exit; - DimX:=LargeurCell*NbreCellX; - DimY:=HauteurCell*NbreCellY; + if pImageTCO[indexTCO]=nil then exit; + DimX:=LargeurCell[indexTCO]*NbreCellX[indexTCO]; + DimY:=hauteurCell[indexTCO]*NbreCellY[indexTCO]; // DimX DimY maxi 8191 pixels pour les bitmap if (dimX>8192) then begin Affiche('Espace TCO X trop grand',clred); exit; end; if (dimY>8192) then begin Affiche('Espace TCO Y trop grand',clred); exit; end; - PImageTCO.Height:=DimY; - PImageTCO.Width:=DimX; + PImageTCO[indexTCO].Height:=DimY; + PImageTCO[indexTCO].Width:=DimX; - PBitMapTCO.Height:=DimY; - PBitMapTCO.Width:=DimX; - - with formTCO.ScrollBox do + PBitMapTCO[indexTCO].Height:=DimY; + PBitMapTCO[indexTCO].Width:=DimX; + with formTCO[indexTCO].ScrollBox do begin HorzScrollBar.Range:=DimX; HorzScrollBar.Tracking:=true; @@ -7347,81 +8011,80 @@ begin end; - //formTCO.ScrollBox.Width:=DimX; - calcul_reduction(frxGlob,fryGlob,LargeurCell,HauteurCell,ZoomMax,ZoomMax); - //Affiche(formatfloat('0.000000',frxGlob),clyellow); + calcul_reduction(frxGlob[indexTCO],fryGlob[indexTCO],LargeurCell[indexTCO],hauteurCell[indexTCO],ZoomMax,ZoomMax); + //Affiche(formatfloat('0.000000',frxGlob[indexTCO]),clyellow); //effacer tout - with PcanvasTCO do + with PcanvasTCO[indexTCO] do begin Pen.width:=1; Brush.Style:=bsSolid; pen.color:=clyellow; - for y:=1 to NbreCellY do - for x:=1 to NbreCellX do + for y:=1 to NbreCellY[indexTCO] do + for x:=1 to NbreCellX[indexTCO] do begin - x1:=(x-1)*largeurCell; - y1:=(y-1)*hauteurCell; - brush.Color:=TCO[x,y].CouleurFond; + x1:=(x-1)*LargeurCell[indexTCO]; + y1:=(y-1)*hauteurCell[indexTCO]; + brush.Color:=tco[indextco,x,y].CouleurFond; - r:=rect(x1,y1,x1+LargeurCell,y1+HauteurCell); + r:=rect(x1,y1,x1+LargeurCell[indexTCO],y1+hauteurCell[indexTCO]); FillRect(r); end; end; //afficher les cellules sauf les signaux - for y:=1 to NbreCellY do - for x:=1 to NbreCellX do + for y:=1 to NbreCellY[indexTCO] do + for x:=1 to NbreCellX[indexTCO] do begin - if TCO[x,y].BImage<>50 then + if tco[indextco,x,y].BImage<>Id_signal then begin - affiche_cellule(x,y); + affiche_cellule(indexTCO,x,y); end; end; //afficher les cellules des signaux et les textes pour que les pieds recouvrent le reste et afficher les textes - for y:=1 to NbreCellY do - for x:=1 to NbreCellX do + for y:=1 to NbreCellY[indexTCO] do + for x:=1 to NbreCellX[indexTCO] do begin - if TCO[x,y].BImage=Id_signal then + if tco[indextco,x,y].BImage=Id_signal then begin - affiche_cellule(x,y); + affiche_cellule(indexTCO,x,y); end; - - s:=Tco[x,y].Texte; - if s<>'' then Affiche_texte(x,y); + //Affiche(intToSTR(indexTCO)+' '+intToSTR(x)+' '+intToSTR(y),clred); + s:=tco[indextco,x,y].Texte; + if s<>'' then Affiche_texte(indexTCO,x,y); end; - if entoure then + if entoure[indexTCO] then begin - Entoure_cell(Xentoure,Yentoure); + Entoure_cell(indexTCO,Xentoure[indexTCO],Yentoure[indexTCO]); end; end; -procedure grise_ligne_tco; +procedure grise_ligne_tco(indexTCO : integer); var x : integer; begin - for x:=1 to NbreCellX do + for x:=1 to NbreCellX[indexTCO] do begin - Affiche_Cellule(x,YClicCell); + Affiche_Cellule(indexTCO,x,YClicCell[indexTCO]); end; end; procedure TFormTCO.FormCreate(Sender: TObject); +var s : string; begin - if affevt or (debug=1) then Affiche('FormTCO create',clyellow); + if affevt or (debug=1) then Affiche('FormTCO'+intToSTR(indexTCOCreate)+' create',clyellow); offsetSourisY:=-10; offsetSourisX:=-10; auto_tcurs:=true; - caption:='TCO'; TCO_modifie:=false; rangUndo:=1; - XclicCell:=1; - YclicCell:=1; + XclicCell[indexTCOCreate]:=1; + YclicCell[indexTCOCreate]:=1; xCoupe:=0;yCoupe:=0; indexTrace:=0; KeyPreview:=true; // valide les évènements clavier @@ -7433,12 +8096,12 @@ begin ButtonRaz.TabStop:=false; ButtonDessiner.TabStop:=false; - Clfond:=$202050; + Clfond:=$000040; couleurAdresse:=Cyan; xMiniSel:=99999;yMiniSel:=99999; xMaxiSel:=0;yMaxiSel:=0; - SelectionAffichee:=false; - ImageTCO.Canvas.font.Name:='Arial'; + SelectionAffichee[indexTCOCreate]:=false; +// ImageTCO.Canvas.font.Name:='Arial'; <--- peut générer exception out of ressource!! clAllume:=clYellow; clVoies:=clOrange; clTexte:=ClLime; @@ -7462,17 +8125,64 @@ begin oldbmp.width:=100; oldbmp.Height:=100; - modeTrace:=false; // pour tracer les voies à la souris + modeTrace[indexTCOCreate]:=false; // pour tracer les voies à la souris //controlStyle:=controlStyle+[csOpaque]; TCOCree:=true; + + s:='Voie'; + ImagePalette6.Hint:=s;ImagePalette6.ShowHint:=true; + ImagePalette7.Hint:=s;ImagePalette7.ShowHint:=true; + ImagePalette8.Hint:=s;ImagePalette8.ShowHint:=true; + ImagePalette9.Hint:=s;ImagePalette9.ShowHint:=true; + ImagePalette10.Hint:=s;ImagePalette10.ShowHint:=true; + ImagePalette11.Hint:=s;ImagePalette11.ShowHint:=true; + ImagePalette16.Hint:=s;ImagePalette16.ShowHint:=true; + ImagePalette17.Hint:=s;ImagePalette17.ShowHint:=true; + ImagePalette18.Hint:=s;ImagePalette18.ShowHint:=true; + ImagePalette19.Hint:=s;ImagePalette19.ShowHint:=true; + + s:='Voie pouvant porter un détecteur ou buttoir'; + ImagePalette1.Hint:=s;ImagePalette1.ShowHint:=true; + ImagePalette20.Hint:=s;ImagePalette20.ShowHint:=true; + + s:='Voie ou buttoir'; + ImagePalette10.Hint:=s;ImagePalette1.ShowHint:=true; + ImagePalette11.Hint:=s;ImagePalette20.ShowHint:=true; + + s:='Aiguillage'; + ImagePalette2.Hint:=s;ImagePalette2.ShowHint:=true; + ImagePalette3.Hint:=s;ImagePalette3.ShowHint:=true; + ImagePalette4.Hint:=s;ImagePalette4.ShowHint:=true; + ImagePalette5.Hint:=s;ImagePalette5.ShowHint:=true; + ImagePalette12.Hint:=s;ImagePalette12.ShowHint:=true; + ImagePalette13.Hint:=s;ImagePalette13.ShowHint:=true; + ImagePalette14.Hint:=s;ImagePalette14.ShowHint:=true; + ImagePalette15.Hint:=s;ImagePalette15.ShowHint:=true; + ImagePalette24.Hint:=s;ImagePalette24.ShowHint:=true; + ImagePalette26.Hint:=s;ImagePalette26.ShowHint:=true; + ImagePalette27.Hint:=s;ImagePalette27.ShowHint:=true; + ImagePalette28.Hint:=s;ImagePalette28.ShowHint:=true; + ImagePalette29.Hint:=s;ImagePalette29.ShowHint:=true; + ImagePalette32.Hint:=s;ImagePalette32.ShowHint:=true; + ImagePalette33.Hint:=s;ImagePalette33.ShowHint:=true; + ImagePalette34.Hint:=s;ImagePalette34.ShowHint:=true; + + + s:='Croisement ou TJD ou TJS ou pont'; + ImagePalette21.Hint:=s;ImagePalette21.ShowHint:=true; + ImagePalette22.Hint:=s;ImagePalette22.ShowHint:=true; + ImagePalette23.Hint:=s;ImagePalette22.ShowHint:=true; + ImagePalette25.Hint:=s;ImagePalette25.ShowHint:=true; + + if debug=1 then Affiche('Fin création fenêtre TCO',clLime); end; // trouve le détecteur det dans le TCO et renvoie x et y // si on le trouve pas, renvoie x=0,y=0 -procedure trouve_det(det : integer;var x,y : integer); +procedure trouve_det(indexTCO,det : integer;var x,y : integer); var xc,yc : integer; trouve : boolean; begin @@ -7481,10 +8191,10 @@ begin xc:=0; repeat inc(xc); - trouve:=tco[xc,yc].Adresse=det; - until (xc=NbreCellX) or trouve; + trouve:=tco[indextco,xc,yc].Adresse=det; + until (xc=NbreCellX[indexTCO]) or trouve; inc(yc); - until (yc=NbreCellY) or trouve; + until (yc=NbreCellY[indexTCO]) or trouve; dec(yc); if trouve then begin @@ -7498,12 +8208,12 @@ begin end; end; -procedure Erreur_TCO(x,y : integer); +procedure Erreur_TCO(indexTCO,x,y : integer); var s : string; i,adresse : integer; begin s:='Erreur 92 TCO : cellule '+intToSTR(x)+','+intToSTR(y)+' '; - adresse:=tco[x,y].Adresse; + adresse:=tco[indextco,x,y].Adresse; i:=index_aig(adresse); if i=0 then s:=s+'aiguillage '+intToSTR(adresse)+' inconnu'; if i<>0 then s:=s+'position aiguillage '+intToSTR(adresse)+' inconnue'; @@ -7516,7 +8226,7 @@ end; // =1 : couleur détecteur allumé // =2 : couleur de l'index train -procedure zone_TCO(det1,det2,mode: integer); +procedure zone_TCO(indexTCO,det1,det2,mode: integer); var direction,i,j,x,y,xn,yn,ancienY,ancienX,Xdet1,Ydet1,Xdet2,Ydet2,Bimage,adresse, pos,pos2,ir,ax,ay,sx,sy: integer; memtrouve,sortir,horz,diag,casok : boolean; @@ -7525,10 +8235,10 @@ var direction,i,j,x,y,xn,yn,ancienY,ancienX,Xdet1,Ydet1,Xdet2,Ydet2,Bimage,adres begin // trouver le détecteur det1 if debugTCO then AfficheDebug('Zone_TCO det1='+intToSTR(det1)+' det2='+intToSTR(det2)+' mode='+intToSTR(mode)+' couleur='+intToSTR(index_couleur),clyellow); - trouve_det(det1,Xdet1,Ydet1); + trouve_det(indexTCO,det1,Xdet1,Ydet1); if (Xdet1=0) or (Ydet1=0) then exit; - trouve_det(det2,Xdet2,Ydet2); + trouve_det(indexTCO,det2,Xdet2,Ydet2); if (Xdet2=0) or (Ydet2=0) then exit; if debugTCO then @@ -7581,8 +8291,8 @@ begin // boucle de remplissage du tableau routeTCO de det1 à det2 repeat - routeTCO[ir].x:=x; - routeTCO[ir].y:=y; + routetco[ir].x:=x; + routetco[ir].y:=y; if ir<500 then inc(ir); if debugTCO then AfficheDebug('X='+intToSTR(x)+' Y='+IntToSTR(Y)+' AncienX='+intToSTR(ancienX)+' AncienY='+IntToSTR(ancienY),clyellow); @@ -7590,8 +8300,8 @@ begin // Affiche la cellule en fonction du mode - adresse:=TCO[x,y].Adresse ; - Bimage:=TCO[x,y].Bimage; + adresse:=tco[indextco,x,y].Adresse ; + Bimage:=tco[indextco,x,y].Bimage; casok:=false; // vers case suivante: trouver le trajet pour rejoindre det1 à det2 case Bimage of @@ -7607,35 +8317,35 @@ begin // aiguillage 2 : begin //if debugTCO then AfficheDebug('El 2',clyellow); - pos:=positionTCO(x,y); + pos:=positionTCO(indexTCO,x,y); if (ancienXx) and (ancienY=Y) then begin xn:=x-1;if pos=const_devie then yn:=y+1;end; if (ancienXy) then begin xn:=x+1; end; - if (pos=const_inconnu) then begin Erreur_TCO(x,y);exit;end; + if (pos=const_inconnu) then begin Erreur_TCO(indexTCO,x,y);exit;end; end; 3 : begin //if debugTCO then AfficheDebug('El 3',clyellow); - pos:=positionTCO(x,y); + pos:=positionTCO(indexTCO,x,y); if (ancienXx) and (ancienY=Y) then begin xn:=x-1;end; if (ancienX>x) and (ancienYx) and (ancienY=Y) then begin xn:=x-1;end; if (ancienX>x) and (ancienY>y) then begin xn:=x-1;end; - if (pos=const_inconnu) then begin Erreur_TCO(x,y);exit;end; + if (pos=const_inconnu) then begin Erreur_TCO(indexTCO,x,y);exit;end; end; 5 : begin //if debugTCO then AfficheDebug('El 5',clyellow); - pos:=positionTCO(x,y); + pos:=positionTCO(indexTCO,x,y); if (ancienXx) and (ancienY=Y) then begin xn:=x-1;if pos=const_devie then yn:=y-1;end; if (ancienXx) and (ancienY=Y) then begin xn:=x-1;yn:=y-1;end; if (ancienX>x) and (ancienY>y) then begin xn:=x-1;yn:=y-1;end; - if (pos=const_inconnu) then begin Erreur_TCO(x,y);exit;end; + if (pos=const_inconnu) then begin Erreur_TCO(indexTCO,x,y);exit;end; end; 13 : begin //if debugTCO then AfficheDebug('El 13',clyellow); - pos:=positionTCO(x,y); + pos:=positionTCO(indexTCO,x,y); if (ancienXx) and (ancienYy) then begin xn:=x+1;yn:=y-1;end; - if (pos=const_inconnu) then begin Erreur_TCO(x,y);exit;end; + if (pos=const_inconnu) then begin Erreur_TCO(indexTCO,x,y);exit;end; end; 14 : begin //if debugTCO then AfficheDebug('El 14',clyellow); - pos:=positionTCO(x,y); + pos:=positionTCO(indexTCO,x,y); if (ancienXx) and (ancienY>y) then begin xn:=x-1;if pos=const_droit then yn:=y-1;end; - if (pos=const_inconnu) then begin Erreur_TCO(x,y);exit;end; + if (pos=const_inconnu) then begin Erreur_TCO(indexTCO,x,y);exit;end; end; 15 : begin //if debugTCO then AfficheDebug('El 15',clyellow); - pos:=positionTCO(x,y); + pos:=positionTCO(indexTCO,x,y); if (ancienXY) then begin xn:=x+1;if pos=const_droit then yn:=y-1;end; if (ancienX>x) and (ancienYx) and (ancienY=y) then begin xn:=x-1;yn:=y+1;end; - if (pos=const_inconnu) then begin Erreur_TCO(x,y);exit;end; + if (pos=const_inconnu) then begin Erreur_TCO(indexTCO,x,y);exit;end; end; 16 : if ancienXy) and (ancienX=x) then begin @@ -7932,7 +8642,7 @@ begin begin yn:=y+1;xn:=x; end; - if (pos=const_inconnu) then begin Erreur_TCO(x,y);exit;end; + if (pos=const_inconnu) then begin Erreur_TCO(indexTCO,x,y);exit;end; end; // tjd ou croisement @@ -7946,13 +8656,13 @@ begin if (mdl=tjd) or (mdl=tjs) then begin pos:=aiguillage[j].position; - if (pos=const_inconnu) then begin Erreur_TCO(x,y);exit;end; + if (pos=const_inconnu) then begin Erreur_TCO(indexTCO,x,y);exit;end; if ((mdl=tjd) or (mdl=tjs)) and (aiguillage[j].EtatTJD=4) then begin j:=Index_Aig(aiguillage[j].Ddroit); pos2:=aiguillage[j].position; // 2eme adresse de la TJD - if (pos2=const_inconnu) then begin Erreur_TCO(x,y);exit;end; + if (pos2=const_inconnu) then begin Erreur_TCO(indexTCO,x,y);exit;end; if (pos=const_droit) and (pos2=const_droit) then begin if ancienXy) and (ancienX=x) then begin @@ -8018,11 +8728,11 @@ begin begin yn:=y+1;xn:=x; end; - if (pos=const_inconnu) then begin Erreur_TCO(x,y);exit;end; + if (pos=const_inconnu) then begin Erreur_TCO(indexTCO,x,y);exit;end; end; 27 : begin if debugTCO then AfficheDebug('El 27',clyellow); - pos:=positionTCO(x,y); + pos:=positionTCO(indexTCO,x,y); // on vient d'en bas if (ancienY>y) and (ancienX=x) then begin @@ -8038,11 +8748,11 @@ begin begin yn:=y-1;xn:=x; end; - if (pos=const_inconnu) then begin Erreur_TCO(x,y);exit;end; + if (pos=const_inconnu) then begin Erreur_TCO(indexTCO,x,y);exit;end; end; 28 : begin if debugTCO then AfficheDebug('El 28',clyellow); - pos:=positionTCO(x,y); + pos:=positionTCO(indexTCO,x,y); // on vient d'en bas if (ancienY>y) and (ancienX=x) then begin @@ -8058,11 +8768,11 @@ begin begin yn:=y-1;xn:=x; end; - if (pos=const_inconnu) then begin Erreur_TCO(x,y);exit;end; + if (pos=const_inconnu) then begin Erreur_TCO(indexTCO,x,y);exit;end; end; 29 : begin //if debugTCO then AfficheDebug('El 12',clyellow); - pos:=positionTCO(x,y); + pos:=positionTCO(indexTCO,x,y); // on vient à de haut à gauche if (ancienXx) and (ancienY>Y) then begin xn:=x-1;yn:=y-1;end; // on vient de bas if (ancienX=x) and (ancienY>y) then begin xn:=x-1;yn:=y-1;end; - if (pos=const_inconnu) then begin Erreur_TCO(x,y);exit;end; + if (pos=const_inconnu) then begin Erreur_TCO(indexTCO,x,y);exit;end; end; 32 : begin if debugTCO then AfficheDebug('El 32',clyellow); - pos:=positionTCO(x,y); + pos:=positionTCO(indexTCO,x,y); // on vient d'en bas à gauche if (ancienXY) then begin xn:=x+1;yn:=y-1;end; // on vient d'en bas if (ancienX=x) and (ancienY>Y) then begin xn:=x+1;yn:=y-1;end; // on vient d'en haut à droite if (ancienX>x) and (ancienYx) and (ancienY>y) then begin yn:=y-1;if pos=const_droit then xn:=x-1 else xn:=x;end; - if (pos=const_inconnu) then begin Erreur_TCO(x,y);exit;end; + if (pos=const_inconnu) then begin Erreur_TCO(indexTCO,x,y);exit;end; end; 34 : begin - pos:=positionTCO(x,y); + pos:=positionTCO(indexTCO,x,y); // on vient du SE if (ancienXy) then begin yn:=y-1;if pos=const_droit then xn:=x+1 else xn:=x;end; // on vient du N if (ancienX=x) and (ancienYx) and (ancienYNbCellulesTCO) or (x>NbreCellX) or (y>NbreCellY) or (x=0) or (y=0) or sortir; // or not(casok) ; + until (memTrouve) or (i>NbCellulesTCO[indexTCO]) or (x>NbreCellX[indexTCO]) or (y>NbreCellY[indexTCO]) or (x=0) or (y=0) or sortir; // or not(casok) ; { if not(casok) then begin Affiche('Erreur TCO incohérence tracé cellule '+intToSTR(x)+','+intToSTR(y),clred); exit; end; } - if (i>NbCellulesTCO) then AfficheDebug('Erreur 1000 TCO : dépassement d''itérations - Route de '+IntToSTR(det1)+' à '+IntToSTR(det2),clred); + if (i>NbCellulesTCO[indexTCO]) then AfficheDebug('Erreur 1000 TCO : dépassement d''itérations - Route de '+IntToSTR(det1)+' à '+IntToSTR(det2),clred); inc(direction) until (direction=5) or memtrouve ; //Affiche(intToSTR(x),clLime); - if i>NbCellulesTCO then + if i>NbCellulesTCO[indexTCO] then begin // fausse route, sortir if DebugTCO then AfficheDebug('Erreur 1000 TCO : dépassement d''itérations - Route de '+IntToSTR(det1)+' à '+IntToSTR(det2),clred); @@ -8153,33 +8863,33 @@ begin // et affichage de la route for i:=1 to ir do begin - x:=routeTCO[i].x; - y:=routeTCO[i].y; - Tco[x,y].mode:=mode; + x:=routetco[i].x; + y:=routetco[i].y; + tco[indextco,x,y].mode:=mode; //Affiche(intToSTR(x)+' '+intToSTR(y),clorange); - bimage:=TCO[x,y].BImage; - adresse:=TCO[x,y].Adresse; - tco[x,y].trajet:=0; + bimage:=tco[indextco,x,y].BImage; + adresse:=tco[indextco,x,y].Adresse; + tco[indextco,x,y].trajet:=0; // croisement if (bimage=21) and (i>1) then begin j:=index_aig(adresse); mdl:=aiguillage[j].modele; - ax:=routeTCO[i-1].x; - ay:=routeTCO[i-1].y; - sx:=routeTCO[i+1].x; // suivant - sy:=routeTCO[i+1].y; - if (ax-x=-1) and (ay-y=0) and (sx-x=1) and (sy-y=0) then tco[x,y].trajet:=1; // de gauche à droite - if (ax-x=1) and (ay-y=0) and (sx-x=-1) and (sy-y=0) then tco[x,y].trajet:=1; // de droite à gauche - if (ax-x=-1) and (ay-y=1) and (sx-x=1) and (sy-y=-1) then tco[x,y].trajet:=2; // de bas gauche vers haut droit - if (ax-x=1) and (ay-y=-1) and (sx-x=-1) and (sy-y=1) then tco[x,y].trajet:=2; // de haut droit vers bas gauche - if (ax-x=-1) and (ay-y=0) and (sx-x=1) and (sy-y=-1) then tco[x,y].trajet:=4; // de gauche vers haut droite - if (ax-x=1) and (ay-y=-1) and (sx-x=-1) and (sy-y=0) then tco[x,y].trajet:=4; // de haut droite vers gauche - if (ax-x=-1) and (ay-y=1) and (sx-x=1) and (sy-y=0) then tco[x,y].trajet:=3; // de bas gauche vers droite - if (ax-x=1) and (ay-y=0) and (sx-x=-1) and (sy-y=1) then tco[x,y].trajet:=3; // de gauche vers haut droite - if tco[x,y].trajet=0 then affiche('Erreur 50 TCO',clred); + ax:=routetco[i-1].x; + ay:=routetco[i-1].y; + sx:=routetco[i+1].x; // suivant + sy:=routetco[i+1].y; + if (ax-x=-1) and (ay-y=0) and (sx-x=1) and (sy-y=0) then tco[indextco,x,y].trajet:=1; // de gauche à droite + if (ax-x=1) and (ay-y=0) and (sx-x=-1) and (sy-y=0) then tco[indextco,x,y].trajet:=1; // de droite à gauche + if (ax-x=-1) and (ay-y=1) and (sx-x=1) and (sy-y=-1) then tco[indextco,x,y].trajet:=2; // de bas gauche vers haut droit + if (ax-x=1) and (ay-y=-1) and (sx-x=-1) and (sy-y=1) then tco[indextco,x,y].trajet:=2; // de haut droit vers bas gauche + if (ax-x=-1) and (ay-y=0) and (sx-x=1) and (sy-y=-1) then tco[indextco,x,y].trajet:=4; // de gauche vers haut droite + if (ax-x=1) and (ay-y=-1) and (sx-x=-1) and (sy-y=0) then tco[indextco,x,y].trajet:=4; // de haut droite vers gauche + if (ax-x=-1) and (ay-y=1) and (sx-x=1) and (sy-y=0) then tco[indextco,x,y].trajet:=3; // de bas gauche vers droite + if (ax-x=1) and (ay-y=0) and (sx-x=-1) and (sy-y=1) then tco[indextco,x,y].trajet:=3; // de gauche vers haut droite + if tco[indextco,x,y].trajet=0 then affiche('Erreur 50 TCO',clred); end; // croisement @@ -8187,19 +8897,19 @@ begin begin j:=index_aig(adresse); mdl:=aiguillage[j].modele; - ax:=routeTCO[i-1].x; // précédent - ay:=routeTCO[i-1].y; - sx:=routeTCO[i+1].x; // suivant - sy:=routeTCO[i+1].y; - if (ax-x=-1) and (ay-y=0) and (sx-x=1) and (sy-y=0) then tco[x,y].trajet:=1; // de gauche à droite - if (ax-x=1) and (ay-y=0) and (sx-x=-1) and (sy-y=0) then tco[x,y].trajet:=1; // de droite à gauche - if (ax-x=-1) and (ay-y=-1) and (sx-x=1) and (sy-y=1) then tco[x,y].trajet:=2; // de haut gauche vers bas droit - if (ax-x=1) and (ay-y=1) and (sx-x=-1) and (sy-y=-1) then tco[x,y].trajet:=2; // de bas droit vers haut gauche - if (ax-x=1) and (ay-y=0) and (sx-x=-1) and (sy-y=-1) then tco[x,y].trajet:=3; // de droit vers en haut à gauche - if (ax-x=-1) and (ay-y=-1) and (sx-x=1) and (sy-y=0) then tco[x,y].trajet:=3; // de haut à gauche vers droit - if (ax-x=1) and (ay-y=1) and (sx-x=-1) and (sy-y=0) then tco[x,y].trajet:=4; // de bas à droite vers gauche - if (ax-x=-1) and (ay-y=0) and (sx-x=1) and (sy-y=1) then tco[x,y].trajet:=4; // de gauche vers en bas a droite - if tco[x,y].trajet=0 then affiche('Erreur 51 TCO',clred); + ax:=routetco[i-1].x; // précédent + ay:=routetco[i-1].y; + sx:=routetco[i+1].x; // suivant + sy:=routetco[i+1].y; + if (ax-x=-1) and (ay-y=0) and (sx-x=1) and (sy-y=0) then tco[indextco,x,y].trajet:=1; // de gauche à droite + if (ax-x=1) and (ay-y=0) and (sx-x=-1) and (sy-y=0) then tco[indextco,x,y].trajet:=1; // de droite à gauche + if (ax-x=-1) and (ay-y=-1) and (sx-x=1) and (sy-y=1) then tco[indextco,x,y].trajet:=2; // de haut gauche vers bas droit + if (ax-x=1) and (ay-y=1) and (sx-x=-1) and (sy-y=-1) then tco[indextco,x,y].trajet:=2; // de bas droit vers haut gauche + if (ax-x=1) and (ay-y=0) and (sx-x=-1) and (sy-y=-1) then tco[indextco,x,y].trajet:=3; // de droit vers en haut à gauche + if (ax-x=-1) and (ay-y=-1) and (sx-x=1) and (sy-y=0) then tco[indextco,x,y].trajet:=3; // de haut à gauche vers droit + if (ax-x=1) and (ay-y=1) and (sx-x=-1) and (sy-y=0) then tco[indextco,x,y].trajet:=4; // de bas à droite vers gauche + if (ax-x=-1) and (ay-y=0) and (sx-x=1) and (sy-y=1) then tco[indextco,x,y].trajet:=4; // de gauche vers en bas a droite + if tco[indextco,x,y].trajet=0 then affiche('Erreur 51 TCO',clred); end; // croisement @@ -8207,19 +8917,19 @@ begin begin j:=index_aig(adresse); mdl:=aiguillage[j].modele; - ax:=routeTCO[i-1].x; // précédent - ay:=routeTCO[i-1].y; - sx:=routeTCO[i+1].x; // suivant - sy:=routeTCO[i+1].y; - if (ax-x=0) and (ay-y=-1) and (sx-x=0) and (sy-y=1) then tco[x,y].trajet:=1; // de haut à bas - if (ax-x=0) and (ay-y=1) and (sx-x=0) and (sy-y=-1) then tco[x,y].trajet:=1; // de bas à haut - if (ax-x=1) and (ay-y=-1) and (sx-x=-1) and (sy-y=1) then tco[x,y].trajet:=2; // de haut droit vers bas gauche - if (ax-x=-1) and (ay-y=1) and (sx-x=1) and (sy-y=-1) then tco[x,y].trajet:=2; // de bas gauche vers haut droit - if (ax-x=1) and (ay-y=-1) and (sx-x=0) and (sy-y=1) then tco[x,y].trajet:=3; // de haut droit vers bas - if (ax-x=0) and (ay-y=1) and (sx-x=1) and (sy-y=-1) then tco[x,y].trajet:=3; // de bas vers haut droit - if (ax-x=0) and (ay-y=-1) and (sx-x=-1) and (sy-y=1) then tco[x,y].trajet:=4; // de haut vers bas gauche - if (ax-x=-1) and (ay-y=1) and (sx-x=0) and (sy-y=-1) then tco[x,y].trajet:=4; // de bas gauche vers haut - if tco[x,y].trajet=0 then affiche('Erreur 52 TCO',clred); + ax:=routetco[i-1].x; // précédent + ay:=routetco[i-1].y; + sx:=routetco[i+1].x; // suivant + sy:=routetco[i+1].y; + if (ax-x=0) and (ay-y=-1) and (sx-x=0) and (sy-y=1) then tco[indextco,x,y].trajet:=1; // de haut à bas + if (ax-x=0) and (ay-y=1) and (sx-x=0) and (sy-y=-1) then tco[indextco,x,y].trajet:=1; // de bas à haut + if (ax-x=1) and (ay-y=-1) and (sx-x=-1) and (sy-y=1) then tco[indextco,x,y].trajet:=2; // de haut droit vers bas gauche + if (ax-x=-1) and (ay-y=1) and (sx-x=1) and (sy-y=-1) then tco[indextco,x,y].trajet:=2; // de bas gauche vers haut droit + if (ax-x=1) and (ay-y=-1) and (sx-x=0) and (sy-y=1) then tco[indextco,x,y].trajet:=3; // de haut droit vers bas + if (ax-x=0) and (ay-y=1) and (sx-x=1) and (sy-y=-1) then tco[indextco,x,y].trajet:=3; // de bas vers haut droit + if (ax-x=0) and (ay-y=-1) and (sx-x=-1) and (sy-y=1) then tco[indextco,x,y].trajet:=4; // de haut vers bas gauche + if (ax-x=-1) and (ay-y=1) and (sx-x=0) and (sy-y=-1) then tco[indextco,x,y].trajet:=4; // de bas gauche vers haut + if tco[indextco,x,y].trajet=0 then affiche('Erreur 52 TCO',clred); end; // croisement @@ -8227,38 +8937,40 @@ begin begin j:=index_aig(adresse); mdl:=aiguillage[j].modele; - ax:=routeTCO[i-1].x; // précédent - ay:=routeTCO[i-1].y; - sx:=routeTCO[i+1].x; // suivant - sy:=routeTCO[i+1].y; - if (ax-x=0) and (ay-y=-1) and (sx-x=0) and (sy-y=1) then tco[x,y].trajet:=1; // de haut à bas - if (ax-x=0) and (ay-y=1) and (sx-x=0) and (sy-y=-1) then tco[x,y].trajet:=1; // de bas à haut - if (ax-x=-1) and (ay-y=-1) and (sx-x=1) and (sy-y=1) then tco[x,y].trajet:=2; // de haut gauche vers bas droit - if (ax-x=1) and (ay-y=1) and (sx-x=-1) and (sy-y=-1) then tco[x,y].trajet:=2; // de bas droit vers haut gauche - if (ax-x=-1) and (ay-y=1) and (sx-x=0) and (sy-y=1) then tco[x,y].trajet:=3; // de haut gauche vers bas - if (ax-x=0) and (ay-y=1) and (sx-x=-1) and (sy-y=-1) then tco[x,y].trajet:=3; // de bas vers haut gauche - if (ax-x=0) and (ay-y=-1) and (sx-x=1) and (sy-y=1) then tco[x,y].trajet:=4; // de haut vers bas droite - if (ax-x=-1) and (ay-y=1) and (sx-x=0) and (sy-y=-1) then tco[x,y].trajet:=4; // de bas droit vers haut - if tco[x,y].trajet=0 then affiche('Erreur 53 TCO',clred); + ax:=routetco[i-1].x; // précédent + ay:=routetco[i-1].y; + sx:=routetco[i+1].x; // suivant + sy:=routetco[i+1].y; + if (ax-x=0) and (ay-y=-1) and (sx-x=0) and (sy-y=1) then tco[indextco,x,y].trajet:=1; // de haut à bas + if (ax-x=0) and (ay-y=1) and (sx-x=0) and (sy-y=-1) then tco[indextco,x,y].trajet:=1; // de bas à haut + if (ax-x=-1) and (ay-y=-1) and (sx-x=1) and (sy-y=1) then tco[indextco,x,y].trajet:=2; // de haut gauche vers bas droit + if (ax-x=1) and (ay-y=1) and (sx-x=-1) and (sy-y=-1) then tco[indextco,x,y].trajet:=2; // de bas droit vers haut gauche + if (ax-x=-1) and (ay-y=1) and (sx-x=0) and (sy-y=1) then tco[indextco,x,y].trajet:=3; // de haut gauche vers bas + if (ax-x=0) and (ay-y=1) and (sx-x=-1) and (sy-y=-1) then tco[indextco,x,y].trajet:=3; // de bas vers haut gauche + if (ax-x=0) and (ay-y=-1) and (sx-x=1) and (sy-y=1) then tco[indextco,x,y].trajet:=4; // de haut vers bas droite + if (ax-x=-1) and (ay-y=1) and (sx-x=0) and (sy-y=-1) then tco[indextco,x,y].trajet:=4; // de bas droit vers haut + if tco[indextco,x,y].trajet=0 then affiche('Erreur 53 TCO',clred); end; - Affiche_cellule(x,y); + Affiche_cellule(indexTCO,x,y); end; end; -// dessine l'icone d'image ip et la place en x y d'après son index -procedure positionne_icone(ip : timage;lbl : tlabel;i : integer); + +procedure positionne_icone_G2(ip : timage;lbl : tlabel;i : integer); const NbElLi=12; var s : string; + l : integer; begin - if i=Id_signal then i:=35; // pour affichage en XY - if i=51 then i:=36; - if ip<>nil then + l:=formTCO[1].groupBox1.Width; + dec(i,17); + + if ip<>nil then begin with ip do begin width:=licone; height:=hicone; - left:=((i-1) mod NbElLi)*(licone+20)+230; + left:=((i-1) mod NbElLi)*(licone+20)+l+50; top:= ((i-1) div NbElLi)*(hicone+10)+8; with canvas do begin @@ -8272,11 +8984,53 @@ begin begin with lbl do begin - if (i=35) or (i=36) then s:=intToSTR(i+15) else + s:=intToSTR(i+17); + if i<10 then s:=' '+s; + caption:=s; + left:=((i-1) mod NbElLi)*(licone+20)+l+32; + top:= ((i-1) div NbElLi)*(hicone+10)+16; + end; + end; +end; + +// dessine l'icone d'image ip et la place en x y d'après son index +procedure positionne_iconeLbIm(ip : timage;lbl : tlabel;i : integer); +const NbElLi=12; +var s : string; + l : integer; +begin + l:=formTCO[1].groupBox1.Width; + + if (i>=32) and (i<=34) then dec(i,2); + + if ip<>nil then + begin + with ip do + begin + width:=licone; + height:=hicone; + left:=((i-1) mod NbElLi)*(licone+20)+l+50; + top:= ((i-1) div NbElLi)*(hicone+10)+8; + with canvas do + begin + Pen.Color:=clFond; + Brush.color:=clFond; + Rectangle(0,0,licone,hicone); + end; + end; + end; + if lbl<>nil then + begin + with lbl do + begin + if (i=35) or (i=36) or (i=37) then s:=intToSTR(i+15) else + if (i>=30) and (i<=32) then + s:=intToSTR(i+2) + else s:=intToSTR(i); if i<10 then s:=' '+s; caption:=s; - left:=((i-1) mod NbElLi)*(licone+20)+212; + left:=((i-1) mod NbElLi)*(licone+20)+l+32; top:= ((i-1) div NbElLi)*(hicone+10)+16; end; end; @@ -8285,36 +9039,44 @@ end; // dessine les icones du tco et les aligne -procedure dessine_icones; +procedure dessine_icones(indexTCO : integer); var ancH,ancW,i,lf,hf: integer; ip : TImage; lbl : Tlabel; begin - with formTCO do + // d'abord on positionne les icones + with formTCO[indexTCO] do begin for i:=1 to 29 do begin ip:=findComponent('ImagePalette'+intToSTR(i)) as Timage; lbl:=findComponent('Label'+intToSTR(i)) as Tlabel; - positionne_icone(ip,lbl,i); + positionne_iconeLbIm(ip,lbl,i); end; for i:=32 to 34 do begin ip:=findComponent('ImagePalette'+intToSTR(i)) as Timage; lbl:=findComponent('Label'+intToSTR(i)) as Tlabel; - positionne_icone(ip,lbl,i); + positionne_iconeLbIm(ip,lbl,i); end; + // groupe 2 i:=Id_signal; ip:=findComponent('ImagePalette'+intToSTR(i)) as Timage; lbl:=findComponent('Label'+intToSTR(i)) as Tlabel; - positionne_icone(ip,lbl,i); - i:=51; + positionne_icone_G2(ip,lbl,i); + i:=Id_Quai; ip:=findComponent('ImagePalette'+intToSTR(i)) as Timage; lbl:=findComponent('Label'+intToSTR(i)) as Tlabel; - positionne_icone(ip,lbl,i); + positionne_icone_G2(ip,lbl,i); + i:=Id_action; + ip:=findComponent('ImagePalette'+intToSTR(i)) as Timage; + lbl:=findComponent('Label'+intToSTR(i)) as Tlabel; + positionne_icone_G2(ip,lbl,i); + + // signal ip:=findComponent('ImagePalette51') as Timage; @@ -8331,47 +9093,49 @@ begin end; end; + // et puis on les dessine epaisseur:=4; - ancw:=LargeurCell; - AncH:=hauteurCell; - HauteurCell:=ImagePalette1.Height; - LargeurCell:=ImagePalette1.Width; - dessin_5(ImagePalette5.Canvas,1,1,0); //posX,posY,état,position - dessin_2(ImagePalette2.Canvas,1,1,0); - dessin_3(ImagePalette3.Canvas,1,1,0); - dessin_4(ImagePalette4.Canvas,1,1,0); - dessin_1(ImagePalette1.canvas,1,1,0); - dessin_6(ImagePalette6.canvas,1,1,0); - dessin_7(ImagePalette7.canvas,1,1,0); - dessin_8(ImagePalette8.canvas,1,1,0); - dessin_9(ImagePalette9.canvas,1,1,0); - dessin_10(ImagePalette10.Canvas,1,1,0); - dessin_11(ImagePalette11.Canvas,1,1,0); - dessin_12(ImagePalette12.Canvas,1,1,0); - dessin_13(ImagePalette13.Canvas,1,1,0); - dessin_14(ImagePalette14.Canvas,1,1,0); - dessin_15(ImagePalette15.Canvas,1,1,0); - dessin_16(ImagePalette16.canvas,1,1,0); - dessin_17(ImagePalette17.canvas,1,1,0); - dessin_18(ImagePalette18.canvas,1,1,0); - dessin_19(ImagePalette19.canvas,1,1,0); - dessin_20(ImagePalette20.canvas,1,1,0); - dessin_21(ImagePalette21.canvas,1,1,0); - dessin_22(ImagePalette22.canvas,1,1,0); - dessin_23(ImagePalette23.canvas,1,1,0); - dessin_24(ImagePalette24.canvas,1,1,0); - dessin_25(ImagePalette25.canvas,1,1,0); - dessin_26(ImagePalette26.canvas,1,1,0); - dessin_27(ImagePalette27.canvas,1,1,0); - dessin_28(ImagePalette28.canvas,1,1,0); - dessin_29(ImagePalette29.canvas,1,1,0); - dessin_32(ImagePalette32.canvas,1,1,0); - dessin_33(ImagePalette33.canvas,1,1,0); - dessin_34(ImagePalette34.canvas,1,1,0); + ancw:=LargeurCell[indexTCO]; + AncH:=hauteurCell[indexTCO]; + hauteurCell[indexTCO]:=ImagePalette1.Height; + LargeurCell[indexTCO]:=ImagePalette1.Width; + dessin_5(indexTCO,ImagePalette5.Canvas,1,1,0); //posX,posY,état,position + dessin_2(indexTCO,ImagePalette2.Canvas,1,1,0); + dessin_3(indexTCO,ImagePalette3.Canvas,1,1,0); + dessin_4(indexTCO,ImagePalette4.Canvas,1,1,0); + dessin_1(indexTCO,ImagePalette1.canvas,1,1,0); + dessin_6(indexTCO,ImagePalette6.canvas,1,1,0); + dessin_7(indexTCO,ImagePalette7.canvas,1,1,0); + dessin_8(indexTCO,ImagePalette8.canvas,1,1,0); + dessin_9(indexTCO,ImagePalette9.canvas,1,1,0); + dessin_10(indexTCO,ImagePalette10.Canvas,1,1,0); + dessin_11(indexTCO,ImagePalette11.Canvas,1,1,0); + dessin_12(indexTCO,ImagePalette12.Canvas,1,1,0); + dessin_13(indexTCO,ImagePalette13.Canvas,1,1,0); + dessin_14(indexTCO,ImagePalette14.Canvas,1,1,0); + dessin_15(indexTCO,ImagePalette15.Canvas,1,1,0); + dessin_16(indexTCO,ImagePalette16.canvas,1,1,0); + dessin_17(indexTCO,ImagePalette17.canvas,1,1,0); + dessin_18(indexTCO,ImagePalette18.canvas,1,1,0); + dessin_19(indexTCO,ImagePalette19.canvas,1,1,0); + dessin_20(indexTCO,ImagePalette20.canvas,1,1,0); + dessin_21(indexTCO,ImagePalette21.canvas,1,1,0); + dessin_22(indexTCO,ImagePalette22.canvas,1,1,0); + dessin_23(indexTCO,ImagePalette23.canvas,1,1,0); + dessin_24(indexTCO,ImagePalette24.canvas,1,1,0); + dessin_25(indexTCO,ImagePalette25.canvas,1,1,0); + dessin_26(indexTCO,ImagePalette26.canvas,1,1,0); + dessin_27(indexTCO,ImagePalette27.canvas,1,1,0); + dessin_28(indexTCO,ImagePalette28.canvas,1,1,0); + dessin_29(indexTCO,ImagePalette29.canvas,1,1,0); + dessin_32(indexTCO,ImagePalette32.canvas,1,1,0); + dessin_33(indexTCO,ImagePalette33.canvas,1,1,0); + dessin_34(indexTCO,ImagePalette34.canvas,1,1,0); - dessin_51(ImagePalette51.canvas,1,1,0); //quai + dessin_51(indexTCO,ImagePalette51.canvas,1,1,0); //quai + dessin_52(indexTCO,ImagePalette52.canvas,1,1,0); //action - LargeurCell:=20; + LargeurCell[indexTCO]:=20; with formprinc.Image9Feux do begin @@ -8385,124 +9149,107 @@ begin Transparent:=true; end; //Picture.Bitmap:=Formprinc.Image9feux.Picture.Bitmap; - TransparentBlt(ImagePalette50.canvas.Handle,8,0,largeurCell,Hauteurcell, + TransparentBlt(ImagePalette50.canvas.Handle,8,0,LargeurCell[indexTCO],hauteurCell[indexTCO], formprinc.Image9Feux.Canvas.Handle,0,0,50,90,clBlue); // end; end; - LargeurCell:=ancW; - HauteurCell:=ancH; + LargeurCell[indexTCO]:=ancW; + hauteurCell[indexTCO]:=ancH; end; + procedure TFormTCO.FormActivate(Sender: TObject); -var s : string; +//procedure PFormTCO[indexTCO].FormActivate(Sender: TObject); +var clLarge,ClHaut,indextco : integer; begin - if affevt then Affiche('Form TCO activate',clyellow); - if not(Forminit) then + indextco:=index_TCO(sender); + IndexTCOCourant:=indexTCO; + if affevt then Affiche('Form TCO'+intToSTR(indexTCO)+' activate',clyellow); + Caption:='TCO'+intToSTR(indexTCO)+' : '+NomFichierTCO[indexTCO]; + if not(Forminit[indexTCO]) then begin - FormInit:=true; + Button1.Visible:=not(Diffusion); Button2.Visible:=not(Diffusion); ButtonCalibrage.Visible:=not(diffusion); ButtonSimu.Visible:=not(Diffusion); ImageTemp.Visible:=not(Diffusion); ImageTemp2.Visible:=not(Diffusion); - SourisX.Visible:=not(Diffusion); - SourisY.Visible:=not(Diffusion); ButtonAfficheBandeau.visible:=false; TrackBarZoom.Max:=ZoomMax; TrackBarZoom.Min:=ZoomMin; - HauteurCell:=ImagePalette1.Height; - LargeurCell:=ImagePalette1.Width; - largeurCelld2:=largeurCell div 2;HauteurCelld2:=HauteurCell div 2; - calcul_reduction(frxGlob,fryGlob,LargeurCell,HauteurCell,ZoomMax,ZoomMax); + hauteurCell[indexTCO]:=ImagePalette1.Height; + LargeurCell[indexTCO]:=ImagePalette1.Width; + LargeurCelld2[indexTCO]:=LargeurCell[indexTCO] div 2;hauteurCelld2[indexTCO]:=hauteurCell[indexTCO] div 2; + calcul_reduction(frxGlob[indexTCO],fryGlob[indexTCO],LargeurCell[indexTCO],hauteurCell[indexTCO],ZoomMax,ZoomMax); - dessine_icones; - - s:='Voie'; - ImagePalette6.Hint:=s;ImagePalette6.ShowHint:=true; - ImagePalette7.Hint:=s;ImagePalette7.ShowHint:=true; - ImagePalette8.Hint:=s;ImagePalette8.ShowHint:=true; - ImagePalette9.Hint:=s;ImagePalette9.ShowHint:=true; - ImagePalette10.Hint:=s;ImagePalette10.ShowHint:=true; - ImagePalette11.Hint:=s;ImagePalette11.ShowHint:=true; - ImagePalette16.Hint:=s;ImagePalette16.ShowHint:=true; - ImagePalette17.Hint:=s;ImagePalette17.ShowHint:=true; - ImagePalette18.Hint:=s;ImagePalette18.ShowHint:=true; - ImagePalette19.Hint:=s;ImagePalette19.ShowHint:=true; - - s:='Voie pouvant porter un détecteur'; - ImagePalette1.Hint:=s;ImagePalette1.ShowHint:=true; - ImagePalette20.Hint:=s;ImagePalette20.ShowHint:=true; - - s:='Aiguillage'; - ImagePalette2.Hint:=s;ImagePalette2.ShowHint:=true; - ImagePalette3.Hint:=s;ImagePalette3.ShowHint:=true; - ImagePalette4.Hint:=s;ImagePalette4.ShowHint:=true; - ImagePalette5.Hint:=s;ImagePalette5.ShowHint:=true; - ImagePalette12.Hint:=s;ImagePalette12.ShowHint:=true; - ImagePalette13.Hint:=s;ImagePalette13.ShowHint:=true; - ImagePalette14.Hint:=s;ImagePalette14.ShowHint:=true; - ImagePalette15.Hint:=s;ImagePalette15.ShowHint:=true; - ImagePalette24.Hint:=s;ImagePalette24.ShowHint:=true; - ImagePalette26.Hint:=s;ImagePalette26.ShowHint:=true; - ImagePalette27.Hint:=s;ImagePalette27.ShowHint:=true; - ImagePalette28.Hint:=s;ImagePalette28.ShowHint:=true; - ImagePalette29.Hint:=s;ImagePalette29.ShowHint:=true; - ImagePalette32.Hint:=s;ImagePalette32.ShowHint:=true; - ImagePalette33.Hint:=s;ImagePalette33.ShowHint:=true; - ImagePalette34.Hint:=s;ImagePalette34.ShowHint:=true; + dessine_icones(indexTCO); - s:='Croisement ou TJD ou TJS'; - ImagePalette21.Hint:=s;ImagePalette21.ShowHint:=true; - ImagePalette22.Hint:=s;ImagePalette22.ShowHint:=true; - ImagePalette25.Hint:=s;ImagePalette25.ShowHint:=true; - - NbCellulesTCO:=NbreCellX*NbreCellY; - ImageTCO.Width:=LargeurCell*NbreCellX; - ImageTCO.Height:=HauteurCell*NbreCellY; + NbCellulesTCO[indexTCO]:=NbreCellX[indexTCO]*NbreCellY[indexTCO]; + ImageTCO.Width:=LargeurCell[indexTCO]*NbreCellX[indexTCO]; + ImageTCO.Height:=hauteurCell[indexTCO]*NbreCellY[indexTCO]; ImageTCO.Picture.Create; - ImageTCO.Picture.Bitmap.Height:=HauteurCell*NbreCellY; - ImageTCO.Picture.BitMap.Width:=LargeurCell*NbreCellX; + ImageTCO.Picture.Bitmap.Height:=hauteurCell[indexTCO]*NbreCellY[indexTCO]; + ImageTCO.Picture.BitMap.Width:=LargeurCell[indexTCO]*NbreCellX[indexTCO]; - PCanvasTCO:=FormTCO.ImageTCO.Picture.Bitmap.Canvas; - PBitMapTCO:=FormTCO.ImageTCO.Picture.Bitmap; + PCanvasTCO[indextco]:=FormTCO[indextco].ImageTCO.Picture.Bitmap.Canvas; + PBitMapTCO[indextco]:=FormTCO[indextco].ImageTCO.Picture.Bitmap; - PImageTCO:=FormTCO.ImageTCO; - PImageTemp:=FormTCO.ImageTemp; - PImageTemp.Canvas.Rectangle(0,0,PImageTemp.Width,PimageTemp.Height); + PImageTCO[indextco]:=FormTCO[indextco].ImageTCO; + PImageTemp[indextco]:=FormTCO[indextco].ImageTemp; + PImageTemp[indextco].Canvas.Rectangle(0,0,PImageTemp[indextco].Width,PimageTemp[indextco].Height); + //Affiche_tco + with trackBarZoom do + begin + Position:=(ZoomMax+Zoommin) div 2; + //left:=clLarge-50; + end; + // height est la taille utile de la fenetre = taille fenetre-32 + clLarge:=formTCO[indexTCO].Width; + clHaut:=formTCO[indexTCO].Height; + //Affiche('large='+intToSTR(clLarge)+' Haut='+intToSTR(clHaut),clyellow); + ButtonAfficheBandeau.Left:=clLarge-70; - //Affiche_tco par r - trackBarZoom.Position:=(ZoomMax+Zoommin) div 2; + panel1.width:=clLarge-12; + Panel1.Top:=clHaut-Panel1.Height-32; // 32=entete de la fenetre + + with ScrollBox do + begin + Width:=clLarge-55; // laisser 50 pixels pour la trackbarzoom + scrollBar + top:=1; + left:=1; + end; - ScrollBox.Width:=clientWidth-80; if MasqueBandeauTCO then begin ButtonAfficheBandeau.visible:=true; BandeauMasque:=true; Panel1.Hide; - ScrollBox.Height:=ClientHeight-30; + ScrollBox.Height:=clHaut-32; end else begin BandeauMasque:=false; Panel1.show; - ScrollBox.Height:=ClientHeight-Panel1.Height-30; + ScrollBox.Height:=ClHaut-Panel1.Height-ScrollBox.Top-32; end; - end; - //scrollBox.Width:=800; - - TCOActive:=true; + //Panel1.top:=scrollBox.top+ScrollBox.height; + + + FormInit[indexTCO]:=true; + end; + if indexTCO=NbreTCO then TCOActive:=true; end; // vérifie que les icones adjacentes sont cohérentes -function verif_cellule(x,y,Bim : integer) : boolean; +function verif_cellule(IndexTCO,x,y,Bim : integer) : boolean; var res,verif : boolean; Bimz,i,bl : integer; begin @@ -8522,17 +9269,17 @@ begin begin if (x>1) and (y>1) then begin - Bimz:=tco[x-1,y-1].BImage; + Bimz:=tco[indexTCO,x-1,y-1].BImage; if (bimz>=1) and (bimz<=25) and (bimz<>23) and not( testbit(liaisons[bimZ],4) ) then res:=false; end; if x>1 then begin - Bimz:=tco[x-1,y].BImage; + Bimz:=tco[indexTCO,x-1,y].BImage; if (bimz>=1) and (bimz<=25) and (bimz<>23) and testbit(liaisons[bimZ],2) then res:=false; end; if y>1 then begin - Bimz:=tco[x,y-1].BImage; + Bimz:=tco[indexTCO,x,y-1].BImage; if (bimz>=1) and (bimz<=25) and (bimz<>23) and testbit(liaisons[bimZ],6) then res:=false; end; if verif and not(res) then affiche('NO 0',clred); @@ -8543,7 +9290,7 @@ begin begin if (y>1) then begin - Bimz:=tco[x,y-1].BImage; + Bimz:=tco[indexTCO,x,y-1].BImage; if (bimz>=1) and (bimz<=25) and (bimz<>23) and not( testbit(liaisons[bimZ],5) ) then res:=false; end; if verif and not(res) then affiche('N 1',clred); @@ -8552,19 +9299,19 @@ begin // NE if (i=2) then begin - if (x1) then + if (x1) then begin - Bimz:=tco[x+1,y-1].BImage; + Bimz:=tco[indexTCO,x+1,y-1].BImage; if (bimz>=1) and (bimz<=25) and (bimz<>23) and not( testbit(liaisons[bimZ],6) ) then res:=false; end; - if (x=1) and (bimz<=25) and (bimz<>23) and testbit(liaisons[bimZ],0) then res:=false; end; if (y>1) then begin - Bimz:=tco[x,y-1].BImage; + Bimz:=tco[indexTCO,x,y-1].BImage; if (bimz>=1) and (bimz<=25) and (bimz<>23) and testbit(liaisons[bimZ],4) then res:=false; end; if verif and not(res) then affiche('NE 2',clred); @@ -8573,9 +9320,9 @@ begin // E if (i=3) then begin - if (x=1) and (bimz<=25) and (bimz<>23) and not( testbit(liaisons[bimZ],7) ) then res:=false; end; if verif and not(res) then affiche('E 3',clred); @@ -8584,19 +9331,19 @@ begin // SE if (i=4) then begin - if (x=1) and (bimz<=25) and (bimz<>23) and not( testbit(liaisons[bimZ],0) ) then res:=false; end; - if (x=1) and (bimz<=25) and (bimz<>23) and testbit(liaisons[bimZ],6) then res:=false; end; - if (y=1) and (bimz<=25) and (bimz<>23) and testbit(liaisons[bimZ],2) then res:=false; end; if verif and not(res) then affiche('SE 4',clred); @@ -8605,9 +9352,9 @@ begin // S if (i=5) then begin - if (y=1) and (bimz<=25) and (bimz<>23) and not( testbit(liaisons[bimZ],1) ) then res:=false; end; if verif and not(res) then affiche('S 5',clred); @@ -8616,19 +9363,19 @@ begin // SO if (i=6) then begin - if (x>1) and (y1) and (y=1) and (bimz<=25) and (bimz<>23) and not( testbit(liaisons[bimZ],2) ) then res:=false; end; if x>1 then begin - Bimz:=tco[x-1,y].BImage; + Bimz:=tco[indextco,x-1,y].BImage; if (bimz>=1) and (bimz<=25) and (bimz<>23) and testbit(liaisons[bimZ],4) then res:=false; end; - if (y=1) and (bimz<=25) and (bimz<>23) and testbit(liaisons[bimZ],0) then res:=false; end; if verif and not(res) then affiche('SO 6',clred); @@ -8639,7 +9386,7 @@ begin begin if (x>1) then begin - Bimz:=tco[x-1,y].BImage; + Bimz:=tco[indextco,x-1,y].BImage; if (bimz>=1) and (bimz<=25) and (bimz<>23) and not( testbit(liaisons[bimZ],3) ) then res:=false; end; if verif and not(res) then affiche('O 7',clred); @@ -8651,31 +9398,29 @@ begin result:=res; end; -procedure Annule; +procedure Annule(indextco : integer); var x,y,xu,yu,Xplace,yplace,adresse,i : integer; begin if TamponAffecte then begin - NbreCellX:=TamponTCO_org.NbreCellX; - NbreCellY:=TamponTCO_org.NbreCellY; - if (xCoupe<>0) and (ycoupe<>0) then + if (xCoupe<>0) and (ycoupe<>0) and (TamponTCO_org.numTCO=indexTCO) then begin for y:=TamponTCO_Org.y1 to TamponTCO_Org.y2 do // rectangle de la sélection for x:=TamponTCO_Org.x1 to TamponTCO_Org.x2 do begin xPlace:=xCoupe+x-TamponTCO_Org.x1; // destination yPlace:=yCoupe+y-TamponTCO_Org.y1; - if (xPlace<=NbreCellX) and (yPlace<=NbreCellY) then + if (xPlace<=NbreCellX[indexTCO]) and (yPlace<=NbreCellY[indexTCO]) then begin - tco[xPlace,yPlace]:=tamponTCO[x,y]; - if tco[xPlace,yPlace].Bimage=Id_signal then + tco[indextco,xPlace,yPlace]:=tampontco[x,y]; + if tco[indextco,xPlace,yPlace].Bimage=Id_signal then begin - adresse:=tco[xPlace,yPlace].Adresse; + adresse:=tco[indextco,xPlace,yPlace].Adresse; end; end; end; end; - Affiche_TCO; + Affiche_TCO(indextco); tamponaffecte:=false; exit; end; @@ -8688,260 +9433,282 @@ begin begin xu:=undo[rangUndo].element[i].Xundo; yu:=undo[rangUndo].element[i].Yundo; - if (xu<=NbreCellX) and (yu<=NbreCellY) then tco[xu,yu]:=undo[rangUndo].element[i]; + if (xu<=NbreCellX[indexTCO]) and (yu<=NbreCellY[indexTCO]) then tco[indextco,xu,yu]:=undo[rangUndo].element[i]; end; - Affiche_tco; + Affiche_tco(indexTCO); exit; end; end; -procedure stop_modetrace; +procedure stop_modetrace(indexTCO : integer); begin - modetrace:=false; - FormTCO.Caption:='TCO'; + modetrace[indexTCO]:=false; screen.cursor:=crDefault; - modeTrace:=false; - IndexTrace:=0; + IndexTrace:=0; traceXY[1].x:=0;traceXY[1].y:=0; traceXY[2].x:=0;traceXY[2].y:=0; - affiche_tco; + affiche_tco(indexTCO); if debugTCO then Affiche('------------',clYellow); - FormTCO.Caption:='TCO'; + FormTCO[indexTCO].Caption:='TCO'+intToSTR(indexTCO)+' : '+NomFichierTCO[indexTCO]; screen.cursor:=crDefault; end; -procedure grille; +procedure grille(indexTCO : integer); var x,y : integer; begin - if not(AvecGrille) then exit; - With PCanvasTCO do + if not(AvecGrille[indexTCO]) then exit; + With PCanvasTCO[indexTCO] do begin pen.color:=ClGrille; pen.Width:=1; Brush.Color:=ClFond; pen.mode:=PmCopy; // lignes verticales - for x:=1 to NbreCellX do + for x:=1 to NbreCellX[indexTCO] do begin - moveto(x*LargeurCell,1); - LineTo(x*LargeurCell,HauteurCell*NbreCelly); + moveto(x*LargeurCell[indexTCO],1); + LineTo(x*LargeurCell[indexTCO],hauteurCell[indexTCO]*NbreCelly[indexTCO]); end; - for y:=1 to NbreCelly do + for y:=1 to NbreCelly[indexTCO] do begin - moveto(1,y*HauteurCell); - LineTo(LargeurCell*NbreCellX,y*HauteurCell); + moveto(1,y*hauteurCell[indexTCO]); + LineTo(LargeurCell[indexTCO]*NbreCellX[indexTCO],y*hauteurCell[indexTCO]); end; end; end; -procedure copier; +procedure copier(indexTCO : integer); var x,y : integer; begin - if SelectionAffichee then + if SelectionAffichee[indexTCO] then begin - TamponTCO_org.NbreCellX:=NbreCellX; - TamponTCO_org.NbreCellY:=NbreCellY; - - TamponTCO_Org.x1:=XminiSel div LargeurCell +1; - TamponTCO_Org.x2:=XmaxiSel div LargeurCell +1; - TamponTCO_Org.y1:=yminiSel div HauteurCell +1; - TamponTCO_Org.y2:=ymaxiSel div HauteurCell +1; + TamponTCO_org.numTCO:=indexTCO; + TamponTCO_Org.x1:=XminiSel div LargeurCell[indexTCO] +1; + TamponTCO_Org.x2:=XmaxiSel div LargeurCell[indexTCO] +1; + TamponTCO_Org.y1:=yminiSel div hauteurCell[indexTCO] +1; + TamponTCO_Org.y2:=ymaxiSel div hauteurCell[indexTCO] +1; for y:=TamponTCO_Org.y1 to TamponTCO_Org.y2 do for x:=TamponTCO_Org.x1 to TamponTCO_Org.x2 do - tamponTCO[x,y]:=tco[x,y]; + begin + //Affiche(intToSTR(x)+' '+intToSTR(y),clred); + tampontco[x,y]:=tco[indextco,x,y]; + end; TamponAffecte:=true; end; end; -procedure couper; +procedure couper(indexTCO: integer); var x,y,XCell1,YCell1,xCell2,yCell2 : integer; begin - with formTCO do + with formTCO[indexTCO] do begin - TamponTCO_org.NbreCellX:=NbreCellX; - TamponTCO_org.NbreCellY:=NbreCellY; EditAdrElement.Text:=''; EditTypeImage.Text:=''; EditTexte.Text:=''; end; // couper sans sélection : on coupe une seule cellule - if not(SelectionAffichee) then + if not(SelectionAffichee[indexTCO]) then begin - tamponTCO[XclicCell,YclicCell]:=tco[XclicCell,YclicCell]; // pour pouvoir faire annuler couper - TamponTCO_org.x1:=XclicCell;TamponTCO_org.y1:=YclicCell; - TamponTCO_org.x2:=XclicCell;TamponTCO_org.y2:=YclicCell; + tampontco[XclicCell[indexTCO],YclicCell[indexTCO]]:=tco[indextco,XclicCell[indexTCO],YclicCell[indexTCO]]; // pour pouvoir faire annuler couper + TamponTCO_org.x1:=XclicCell[indexTCO];TamponTCO_org.y1:=YclicCell[indexTCO]; + TamponTCO_org.x2:=XclicCell[indexTCO];TamponTCO_org.y2:=YclicCell[indexTCO]; - tco[XclicCell,YClicCell].Adresse:=0; - tco[XclicCell,YClicCell].Bimage:=0; - tco[XclicCell,YClicCell].liaisons:=0; - tco[XclicCell,YClicCell].epaisseurs:=0; - tco[XclicCell,YClicCell].Texte:=''; + tco[indextco,XclicCell[indexTCO],YClicCell[indexTCO]].Adresse:=0; + tco[indextco,XclicCell[indexTCO],YClicCell[indexTCO]].Bimage:=0; + tco[indextco,XclicCell[indexTCO],YClicCell[indexTCO]].liaisons:=0; + tco[indextco,XclicCell[indexTCO],YClicCell[indexTCO]].epaisseurs:=0; + tco[indextco,XclicCell[indexTCO],YClicCell[indexTCO]].buttoir:=0; + tco[indextco,XclicCell[indexTCO],YClicCell[indexTCO]].pont:=0; + tco[indextco,XclicCell[indexTCO],YClicCell[indexTCO]].Texte:=''; - efface_entoure; - efface_cellule(formTCO.ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); + efface_entoure(indexTCO); + efface_cellule(indexTCO,formTCO[indexTCO].ImageTCO.Canvas,XclicCell[indexTCO],YClicCell[indexTCO],PmCopy); TamponAffecte:=true; - xCoupe:=XclicCell;yCoupe:=YclicCell; - Affiche_tco; + xCoupe:=XclicCell[indexTCO];yCoupe:=YclicCell[indexTCO]; + Affiche_tco(indexTCO); exit; end; TCO_modifie:=true; - copier; - SelectionAffichee:=false; + copier(indexTCO); + SelectionAffichee[indexTCO]:=false; - xCell1:=XminiSel div LargeurCell +1; - xCell2:=XmaxiSel div LargeurCell +1; - yCell1:=yminiSel div HauteurCell +1; - yCell2:=ymaxiSel div HauteurCell +1; + xCell1:=XminiSel div LargeurCell[indexTCO] +1; + xCell2:=XmaxiSel div LargeurCell[indexTCO] +1; + yCell1:=yminiSel div hauteurCell[indexTCO] +1; + yCell2:=ymaxiSel div hauteurCell[indexTCO] +1; xCoupe:=XCell1;yCoupe:=yCell1; for y:=yCell1 to yCell2 do for x:=xCell1 to xCell2 do begin - tco[x,y].Adresse:=0; - tco[x,y].BImage:=0; - tco[x,y].liaisons:=0; - tco[x,y].Texte:=''; + tco[indextco,x,y].Adresse:=0; + tco[indextco,x,y].BImage:=0; + tco[indextco,x,y].epaisseurs:=0; + tco[indextco,x,y].pont:=0; + tco[indextco,x,y].buttoir:=0; + tco[indextco,x,y].liaisons:=0; + tco[indextco,x,y].epaisseurs:=0; + tco[indextco,x,y].pont:=0; + tco[indextco,x,y].Texte:=''; //Affiche('Efface cellules '+IntToSTR(X)+' '+intToSTR(y),clyellow); - efface_entoure; - efface_cellule(formTCO.ImageTCO.Canvas,X,Y,PmCopy); - if avecGrille then grille; + efface_entoure(indexTCO); + efface_cellule(indexTCO,formTCO[indexTCO].ImageTCO.Canvas,X,Y,PmCopy); + if avecGrille[indexTCO] then grille(indexTCO); end; end; // 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); -var s,d : integer; +var s,d,indexTCO : integer; procede : boolean; begin if affevt then Affiche('TCO.FormKeyDown',clOrange); - + indexTCO:=index_TCO(Sender); procede:=false; // indicateur on a tapé une touche de curseur //Affiche(intToSTR(key),clyellow); if auto_tcurs then - case Key of - VK_right : if XClicCellFormTCO.ScrollBox.Width then scrollBox.HorzScrollBar.Position:=s+largeurCell; + if d-s>ScrollBox.Width then scrollBox.HorzScrollBar.Position:=s+LargeurCell[indexTCO]; procede:=true; end else exit; - VK_left : if XClicCell>1 then + VK_left : if XClicCell[indexTCO]>1 then begin - dec(XClicCell); - d:=(xClicCell-1)*largeurCell; + dec(XClicCell[indexTCO]); + d:=(xClicCell[indexTCO]-1)*LargeurCell[indexTCO]; s:=scrollBox.HorzScrollBar.Position; if d<=s then begin - s:=s-largeurCell; - if sFormTCO.ScrollBox.Height then scrollBox.VertScrollBar.Position:=s+HauteurCell; + if d-s>ScrollBox.Height then scrollBox.VertScrollBar.Position:=s+hauteurCell[indexTCO]; procede:=true; end else exit; - VK_up : if YClicCell>1 then + VK_up : if YClicCell[indexTCO]>1 then begin - dec(YClicCell); - d:=(yClicCell-1)*HauteurCell; + dec(YClicCell[indexTCO]); + d:=(yClicCell[indexTCO]-1)*hauteurCell[indexTCO]; s:=scrollBox.VertScrollBar.Position; if d=100 then exit; - tco[xu,yu].Xundo:=xu; // stocke les coordonnées de la cellule concernée - tco[xu,yu].Yundo:=yu; + tco[indextco,xu,yu].Xundo:=xu; // stocke les coordonnées de la cellule concernée + tco[indextco,xu,yu].Yundo:=yu; - undo[rangUndo].element[i]:=tco[xu,yu]; + undo[rangUndo].element[i]:=tco[indextco,xu,yu]; //affiche('Rang undo='+intToSTR(rangundo),clYellow); end; +procedure end_Drag(icone,x,y : integer;Sender, Target: TObject); +var s : string; + indexTCO,xclic,Yclic : integer; +begin + if not(Target is TImage) then exit; + s:=(Target as TImage).Name; + if copy(s,1,8)<>'ImageTCO' then exit; + if (x=0) and (y=0) then exit; + + indexTCO:=Index_tco(sender); + //Xclic:=XclicCell[indexTCO]; + //Yclic:=YClicCell[indexTCO]; + + BitBlt(formTCO[indexTCO].imageTCO.canvas.handle,oldx,oldy,LargeurCell[indexTCO],hauteurCell[indexTCO],oldbmp.canvas.handle,0,0,SRCCOPY); + efface_entoure(indexTCO); + FormTCO[indexTCO].imageTCO.repaint; + + Xclic:=X div LargeurCell[indexTCO] +1; + Yclic:=Y div hauteurCell[indexTCO] +1; + XclicCell[indexTCO]:=Xclic; + YClicCell[indexTCO]:=Yclic; + + if not(verif_cellule(indexTCO,Xclic,Yclic,icone)) then exit; + efface_cellule(IndexTCO,formTCO[indexTCO].ImageTCO.Canvas,Xclic,YClic,PmCopy); + TCO_modifie:=true; + + case icone of + 1 : dessin_1(indexTCO,FormTCO[indexTCO].ImageTCO.Canvas,XClic,YClic,0); + 2 : dessin_2(indexTCO,FormTCO[indexTCO].ImageTCO.Canvas,XClic,YClic,0); + 3 : dessin_3(indexTCO,FormTCO[indexTCO].ImageTCO.Canvas,XClic,YClic,0); + 4 : dessin_4(indexTCO,FormTCO[indexTCO].ImageTCO.Canvas,XClic,YClic,0); + 5 : dessin_5(indexTCO,FormTCO[indexTCO].ImageTCO.Canvas,XClic,YClic,0); + 6 : dessin_6(indexTCO,FormTCO[indexTCO].ImageTCO.Canvas,XClic,YClic,0); + 7 : dessin_7(indexTCO,FormTCO[indexTCO].ImageTCO.Canvas,XClic,YClic,0); + 8 : dessin_8(indexTCO,FormTCO[indexTCO].ImageTCO.Canvas,XClic,YClic,0); + 9 : dessin_9(indexTCO,FormTCO[indexTCO].ImageTCO.Canvas,XClic,YClic,0); + 10 : dessin_10(indexTCO,FormTCO[indexTCO].ImageTCO.Canvas,XClic,YClic,0); + 11 : dessin_11(indexTCO,FormTCO[indexTCO].ImageTCO.Canvas,XClic,YClic,0); + 12 : dessin_12(indexTCO,FormTCO[indexTCO].ImageTCO.Canvas,XClic,YClic,0); + 13 : dessin_13(indexTCO,FormTCO[indexTCO].ImageTCO.Canvas,XClic,YClic,0); + 14 : dessin_14(indexTCO,FormTCO[indexTCO].ImageTCO.Canvas,XClic,YClic,0); + 15 : dessin_15(indexTCO,FormTCO[indexTCO].ImageTCO.Canvas,XClic,YClic,0); + 16 : dessin_16(indexTCO,FormTCO[indexTCO].ImageTCO.Canvas,XClic,YClic,0); + 17 : dessin_17(indexTCO,FormTCO[indexTCO].ImageTCO.Canvas,XClic,YClic,0); + 18 : dessin_18(indexTCO,FormTCO[indexTCO].ImageTCO.Canvas,XClic,YClic,0); + 19 : dessin_19(indexTCO,FormTCO[indexTCO].ImageTCO.Canvas,XClic,YClic,0); + 20 : dessin_20(indexTCO,FormTCO[indexTCO].ImageTCO.Canvas,XClic,YClic,0); + 21 : dessin_21(indexTCO,FormTCO[indexTCO].ImageTCO.Canvas,XClic,YClic,0); + 22 : dessin_22(indexTCO,FormTCO[indexTCO].ImageTCO.Canvas,XClic,YClic,0); + 23 : dessin_23(indexTCO,FormTCO[indexTCO].ImageTCO.Canvas,XClic,YClic,0); + 24 : dessin_24(indexTCO,FormTCO[indexTCO].ImageTCO.Canvas,XClic,YClic,0); + 25 : dessin_25(indexTCO,FormTCO[indexTCO].ImageTCO.Canvas,XClic,YClic,0); + 26 : dessin_26(indexTCO,FormTCO[indexTCO].ImageTCO.Canvas,XClic,YClic,0); + 27 : dessin_27(indexTCO,FormTCO[indexTCO].ImageTCO.Canvas,XClic,YClic,0); + 28 : dessin_28(indexTCO,FormTCO[indexTCO].ImageTCO.Canvas,XClic,YClic,0); + 29 : dessin_29(indexTCO,FormTCO[indexTCO].ImageTCO.Canvas,XClic,YClic,0); + 32 : dessin_32(indexTCO,FormTCO[indexTCO].ImageTCO.Canvas,XClic,YClic,0); + 33 : dessin_33(indexTCO,FormTCO[indexTCO].ImageTCO.Canvas,XClic,YClic,0); + 34 : dessin_34(indexTCO,FormTCO[indexTCO].ImageTCO.Canvas,XClic,YClic,0); + id_Quai : dessin_51(indexTCO,FormTCO[indexTCO].ImageTCO.Canvas,XClic,YClic,0); + id_action : dessin_52(indexTCO,FormTCO[indexTCO].ImageTCO.Canvas,XClic,YClic,0); + end; + + stocke_undo(indexTCO,1,XClic,YClic); + maj_undo(1); + tco[indextco,XClic,YClic].BImage:=icone; + tco[indextco,XClic,YClic].liaisons:=liaisons[icone]; + tco[indextco,xClic,YClic].CoulFonte:=clYellow; + formTCO[indexTCO].EditAdrElement.Text:=IntToSTR( tco[indextco,XClic,YClic].Adresse); + formTCO[indexTCO].EdittypeImage.Text:=IntToSTR(tco[indextco,XClic,YClic].BImage); +end; + procedure TFormTCO.ImagePalette5EndDrag(Sender, Target: TObject; X,Y: Integer); begin - if not(Target is TImage) then exit; - if (Target as TImage).Name<>'ImageTCO' then exit; - if (x=0) and (y=0) then exit; - BitBlt(imageTCO.canvas.handle,oldx,oldy,LargeurCell,HauteurCell,oldbmp.canvas.handle,0,0,SRCCOPY); - efface_entoure; - imageTCO.repaint; - Xclic:=X;YClic:=Y; - XclicCell:=Xclic div largeurCell +1; - YclicCell:=Yclic div hauteurCell +1; - if not(verif_cellule(XclicCell,YclicCell,5)) then exit; - efface_cellule(ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); - TCO_modifie:=true; - - dessin_5(ImageTCO.Canvas,XClicCell,YClicCell,0); - stocke_undo(1,XClicCell,YClicCell); - maj_undo(1); - tco[XClicCell,YClicCell].BImage:=5; // image 5 - tco[XClicCell,YClicCell].liaisons:=liaisons[5]; - tco[xClicCell,YClicCell].CoulFonte:=clYellow; - EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); - EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); + end_drag(5,x,y,Sender,Target); end; procedure TFormTCO.ImagePalette2EndDrag(Sender,Target: TObject; X,Y: Integer); begin - if not(Target is TImage) then exit; - if (Target as TImage).Name<>'ImageTCO' then exit; - if (x=0) and (y=0) then exit; - BitBlt(imageTCO.canvas.handle,oldx,oldy,LargeurCell,HauteurCell,oldbmp.canvas.handle,0,0,SRCCOPY); - efface_entoure; - imageTCO.repaint; - Xclic:=X;YClic:=Y; - XclicCell:=Xclic div largeurCell +1; - YclicCell:=Yclic div hauteurCell +1; - if not(verif_cellule(XclicCell,YclicCell,2)) then exit; - efface_cellule(ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); - TCO_modifie:=true; - stocke_undo(1,XClicCell,YClicCell); - maj_undo(1); - tco[XClicCell,YClicCell].BImage:=2; // image 2 - tco[xClicCell,YClicCell].CoulFonte:=clYellow; - dessin_2(ImageTCO.Canvas,XClicCell,YClicCell,0); - tco[XClicCell,YClicCell].liaisons:=liaisons[2]; - EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); - EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); + end_drag(2,x,y,Sender,Target); end; procedure TFormTCO.ImagePalette2MouseDown(Sender: TObject; @@ -9051,26 +9852,7 @@ end; procedure TFormTCO.ImagePalette3EndDrag(Sender, Target: TObject; X,Y: Integer); begin - if not(Target is TImage) then exit; - if (Target as TImage).Name<>'ImageTCO' then exit; - if (x=0) and (y=0) then exit; - BitBlt(imageTCO.canvas.handle,oldx,oldy,LargeurCell,HauteurCell,oldbmp.canvas.handle,0,0,SRCCOPY); - efface_entoure; - imageTCO.repaint; - Xclic:=X;YClic:=Y; - XclicCell:=Xclic div largeurCell +1; - YclicCell:=Yclic div hauteurCell +1; - if not(verif_cellule(XclicCell,YclicCell,3)) then exit; - efface_cellule(ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); - TCO_modifie:=true; - tco[xClicCell,YClicCell].CoulFonte:=clYellow; - dessin_3(ImageTCO.Canvas,XClicCell,YClicCell,0); - stocke_undo(1,XClicCell,YClicCell); - maj_undo(1); - tco[XClicCell,YClicCell].BImage:=3; // image 3 - tco[XClicCell,YClicCell].liaisons:=liaisons[3]; - EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); - EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); + end_drag(3,x,y,Sender,Target); end; procedure TFormTCO.ImagePalette3MouseDown(Sender: TObject; @@ -9081,26 +9863,7 @@ end; procedure TFormTCO.ImagePalette4EndDrag(Sender, Target: TObject; X,Y: Integer); begin - if not(Target is TImage) then exit; - if (Target as TImage).Name<>'ImageTCO' then exit; - if (x=0) and (y=0) then exit; - BitBlt(imageTCO.canvas.handle,oldx,oldy,LargeurCell,HauteurCell,oldbmp.canvas.handle,0,0,SRCCOPY); - efface_entoure; - imageTCO.repaint; - Xclic:=X;YClic:=Y; - XclicCell:=Xclic div largeurCell +1; - YclicCell:=Yclic div hauteurCell +1; - if not(verif_cellule(XclicCell,YclicCell,4)) then exit; - efface_cellule(ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); - TCO_modifie:=true; - dessin_4(ImageTCO.Canvas,XClicCell,YClicCell,0); - stocke_undo(1,XClicCell,YClicCell); - maj_undo(1); - tco[XClicCell,YClicCell].BImage:=4; // image 4 - tco[XClicCell,YClicCell].liaisons:=liaisons[4]; - tco[xClicCell,YClicCell].CoulFonte:=clYellow; - EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); - EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); + end_drag(4,x,y,Sender,Target); end; procedure TFormTCO.ImagePalette4MouseDown(Sender: TObject; @@ -9115,59 +9878,15 @@ begin debut_drag(ImagePalette5); end; - procedure TFormTCO.ImagePalette1EndDrag(Sender, Target: TObject; X,Y: Integer); begin - if not(target=ImageTCO) then exit; - if (x=0) and (y=0) then exit; - drag:=false; - BitBlt(imageTCO.canvas.handle,oldx,oldy,LargeurCell,HauteurCell,oldbmp.canvas.handle,0,0,SRCCOPY); - efface_entoure; - imageTCO.repaint; - Xclic:=X;YClic:=Y; - XclicCell:=Xclic div largeurCell +1; - YclicCell:=Yclic div hauteurCell +1; - if not(verif_cellule(XclicCell,YclicCell,1)) then exit; - - efface_cellule(ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); - TCO_modifie:=true; - dessin_1(ImageTCO.Canvas,XClicCell,YClicCell,0); - - stocke_undo(1,XClicCell,YClicCell); - maj_undo(1); - tco[XClicCell,YClicCell].BImage:=1; // image 1 - tco[xClicCell,YClicCell].CoulFonte:=clYellow; - tco[XClicCell,YClicCell].Adresse:=0; - tco[XClicCell,YClicCell].liaisons:=liaisons[1]; - - EditAdrElement.Text:=IntToSTR(tco[XClicCell,YClicCell].Adresse); - EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); + end_drag(1,x,y,Sender,Target); end; procedure TFormTCO.ImagePalette6EndDrag(Sender, Target: TObject; X,Y: Integer); begin - if not(Target is TImage) then exit; - if (Target as TImage).Name<>'ImageTCO' then exit; - if (x=0) and (y=0) then exit; - BitBlt(imageTCO.canvas.handle,oldx,oldy,LargeurCell,HauteurCell,oldbmp.canvas.handle,0,0,SRCCOPY); - efface_entoure; - imageTCO.repaint; - Xclic:=X;YClic:=Y; - XclicCell:=Xclic div largeurCell +1; - YclicCell:=Yclic div hauteurCell +1; - if not(verif_cellule(XclicCell,YclicCell,6)) then exit; - efface_cellule(ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); - TCO_modifie:=true; - dessin_6(ImageTCO.Canvas,XClicCell,YClicCell,0); - stocke_undo(1,XClicCell,YClicCell); - maj_undo(1); - tco[XClicCell,YClicCell].BImage:=6; // image 6 - tco[XClicCell,YClicCell].liaisons:=liaisons[6]; - tco[XClicCell,YClicCell].Adresse:=0; - tco[xClicCell,YClicCell].CoulFonte:=clYellow; - EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); - EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); + end_drag(6,x,y,Sender,Target); end; procedure TFormTCO.ImagePalette6MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); @@ -9178,27 +9897,7 @@ end; procedure TFormTCO.ImagePalette7EndDrag(Sender, Target: TObject; X, Y: Integer); begin - if not(Target is TImage) then exit; - if (Target as TImage).Name<>'ImageTCO' then exit; - if (x=0) and (y=0) then exit; - BitBlt(imageTCO.canvas.handle,oldx,oldy,LargeurCell,HauteurCell,oldbmp.canvas.handle,0,0,SRCCOPY); - efface_entoure; - imageTCO.repaint; - Xclic:=X;YClic:=Y; - XclicCell:=Xclic div largeurCell +1; - YclicCell:=Yclic div hauteurCell +1; - if not(verif_cellule(XclicCell,YclicCell,7)) then exit; - efface_cellule(ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); - TCO_modifie:=true; - dessin_7(ImageTCO.Canvas,XClicCell,YClicCell,0); - stocke_undo(1,XClicCell,YClicCell); - maj_undo(1); - tco[XClicCell,YClicCell].BImage:=7; // image 7 - tco[XClicCell,YClicCell].liaisons:=liaisons[7]; - tco[XClicCell,YClicCell].Adresse:=0; - tco[xClicCell,YClicCell].CoulFonte:=clYellow; - EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); - EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); + end_drag(7,x,y,Sender,Target); end; procedure TFormTCO.ImagePalette7MouseDown(Sender: TObject; @@ -9209,27 +9908,7 @@ end; procedure TFormTCO.ImagePalette8EndDrag(Sender, Target: TObject; X,Y: Integer); begin - if not(Target is TImage) then exit; - if (Target as TImage).Name<>'ImageTCO' then exit; - if (x=0) and (y=0) then exit; - BitBlt(imageTCO.canvas.handle,oldx,oldy,LargeurCell,HauteurCell,oldbmp.canvas.handle,0,0,SRCCOPY); - efface_entoure; - imageTCO.repaint; - Xclic:=X;YClic:=Y; - XclicCell:=Xclic div largeurCell +1; - YclicCell:=Yclic div hauteurCell +1; - if not(verif_cellule(XclicCell,YclicCell,8)) then exit; - efface_cellule(ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); - TCO_modifie:=true;; - dessin_8(ImageTCO.Canvas,XClicCell,YClicCell,0); - stocke_undo(1,XClicCell,YClicCell); - maj_undo(1); - tco[XClicCell,YClicCell].BImage:=8; // image 8 - tco[XClicCell,YClicCell].liaisons:=liaisons[8]; - tco[XClicCell,YClicCell].Adresse:=0; - tco[xClicCell,YClicCell].CoulFonte:=clYellow; - EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); - EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); + end_drag(8,x,y,Sender,Target); end; procedure TFormTCO.ImagePalette8MouseDown(Sender: TObject; @@ -9309,333 +9988,130 @@ end; procedure TFormTCO.ImagePalette9EndDrag(Sender, Target: TObject; X,Y: Integer); begin - if not(Target is TImage) then exit; - if (Target as TImage).Name<>'ImageTCO' then exit; - if (x=0) and (y=0) then exit; - BitBlt(imageTCO.canvas.handle,oldx,oldy,LargeurCell,HauteurCell,oldbmp.canvas.handle,0,0,SRCCOPY); - efface_entoure; - imageTCO.repaint; - Xclic:=X;YClic:=Y; - XclicCell:=Xclic div largeurCell +1; - YclicCell:=Yclic div hauteurCell +1; - if not(verif_cellule(XclicCell,YclicCell,9)) then exit; - efface_cellule(ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); - TCO_modifie:=true; - dessin_9(ImageTCO.Canvas,XClicCell,YClicCell,0); - stocke_undo(1,XClicCell,YClicCell); - maj_undo(1); - tco[XClicCell,YClicCell].BImage:=9; // image 9 - tco[XClicCell,YClicCell].liaisons:=liaisons[9]; - tco[XClicCell,YClicCell].Adresse:=0; // rien - tco[xClicCell,YClicCell].CoulFonte:=clYellow; - entoure_cell_grille(XClicCell,YClicCell); - _entoure_cell_clic; - EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); - EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); + end_drag(9,x,y,Sender,Target); end; procedure TFormTCO.ImagePalette12EndDrag(Sender, Target: TObject; X, Y: Integer); begin - if not(Target is TImage) then exit; - if (Target as TImage).Name<>'ImageTCO' then exit; - if (x=0) and (y=0) then exit; - BitBlt(imageTCO.canvas.handle,oldx,oldy,LargeurCell,HauteurCell,oldbmp.canvas.handle,0,0,SRCCOPY); - efface_entoure; - imageTCO.repaint; - Xclic:=X;YClic:=Y; - XclicCell:=Xclic div largeurCell +1; - YclicCell:=Yclic div hauteurCell +1; - if not(verif_cellule(XclicCell,YclicCell,12)) then exit; - efface_cellule(ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); - TCO_modifie:=true; - dessin_12(ImageTCO.Canvas,XClicCell,YClicCell,0); - stocke_undo(1,XClicCell,YClicCell); - maj_undo(1); - tco[XClicCell,YClicCell].BImage:=12; // image 12 - tco[XClicCell,YClicCell].liaisons:=liaisons[12]; - tco[XClicCell,YClicCell].Adresse:=0; // rien - tco[xClicCell,YClicCell].CoulFonte:=clYellow; - EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); - EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); + end_drag(12,x,y,Sender,Target); end; procedure TFormTCO.ImagePalette13EndDrag(Sender, Target: TObject; X,Y: Integer); begin - if not(Target is TImage) then exit; - if (Target as TImage).Name<>'ImageTCO' then exit; - if (x=0) and (y=0) then exit; - BitBlt(imageTCO.canvas.handle,oldx,oldy,LargeurCell,HauteurCell,oldbmp.canvas.handle,0,0,SRCCOPY); - imageTCO.repaint; - efface_entoure; - imageTCO.repaint; - Xclic:=X;YClic:=Y; - XclicCell:=Xclic div largeurCell +1; - YclicCell:=Yclic div hauteurCell +1; - if not(verif_cellule(XclicCell,YclicCell,13)) then exit; - efface_cellule(ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); - TCO_modifie:=true; - dessin_13(ImageTCO.Canvas,XClicCell,YClicCell,0); - stocke_undo(1,XClicCell,YClicCell); - maj_undo(1); - tco[XClicCell,YClicCell].BImage:=13; // image 13 - tco[XClicCell,YClicCell].liaisons:=liaisons[13]; - tco[XClicCell,YClicCell].Adresse:=0; // rien - tco[xClicCell,YClicCell].CoulFonte:=clYellow; - EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); - EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); + end_drag(13,x,y,Sender,Target); end; procedure TFormTCO.ImagePalette14EndDrag(Sender, Target: TObject; X, Y: Integer); begin - if not(Target is TImage) then exit; - if (Target as TImage).Name<>'ImageTCO' then exit; - if (x=0) and (y=0) then exit; - BitBlt(imageTCO.canvas.handle,oldx,oldy,LargeurCell,HauteurCell,oldbmp.canvas.handle,0,0,SRCCOPY); - efface_entoure; - imageTCO.repaint; - Xclic:=X;YClic:=Y; - XclicCell:=Xclic div largeurCell +1; - YclicCell:=Yclic div hauteurCell +1; - if not(verif_cellule(XclicCell,YclicCell,14)) then exit; - efface_cellule(ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); - TCO_modifie:=true; - dessin_14(ImageTCO.Canvas,XClicCell,YClicCell,0); - stocke_undo(1,XClicCell,YClicCell); - maj_undo(1); - tco[XClicCell,YClicCell].BImage:=14; // image 14 - tco[XClicCell,YClicCell].liaisons:=liaisons[14]; - tco[XClicCell,YClicCell].Adresse:=0; // rien - tco[xClicCell,YClicCell].CoulFonte:=clYellow; - EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); - EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); + end_drag(14,x,y,Sender,Target); end; procedure TFormTCO.ImagePalette15EndDrag(Sender, Target: TObject; X, Y: Integer); begin - if not(Target is TImage) then exit; - if (Target as TImage).Name<>'ImageTCO' then exit; - if (x=0) and (y=0) then exit; - BitBlt(imageTCO.canvas.handle,oldx,oldy,LargeurCell,HauteurCell,oldbmp.canvas.handle,0,0,SRCCOPY); - efface_entoure; - imageTCO.repaint; - Xclic:=X;YClic:=Y; - XclicCell:=Xclic div largeurCell +1; - YclicCell:=Yclic div hauteurCell +1; - if not(verif_cellule(XclicCell,YclicCell,15)) then exit; - efface_cellule(ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); - TCO_modifie:=true; - - Dessin_15(ImageTCO.Canvas,XClicCell,YClicCell,0); - stocke_undo(1,XClicCell,YClicCell); - maj_undo(1); - tco[XClicCell,YClicCell].BImage:=15; // image 15 - tco[XClicCell,YClicCell].liaisons:=liaisons[15]; - tco[XClicCell,YClicCell].Adresse:=0; // rien - tco[xClicCell,YClicCell].CoulFonte:=clYellow; - EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); - EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); + end_drag(15,x,y,Sender,Target); end; procedure TFormTCO.ImagePalette16EndDrag(Sender, Target: TObject; X, Y: Integer); begin - if not(Target is TImage) then exit; - if (Target as TImage).Name<>'ImageTCO' then exit; - if (x=0) and (y=0) then exit; - BitBlt(imageTCO.canvas.handle,oldx,oldy,LargeurCell,HauteurCell,oldbmp.canvas.handle,0,0,SRCCOPY); - efface_entoure; - imageTCO.repaint; - Xclic:=X;YClic:=Y; - XclicCell:=Xclic div largeurCell +1; - YclicCell:=Yclic div hauteurCell +1; - if not(verif_cellule(XclicCell,YclicCell,16)) then exit; - efface_cellule(ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); - TCO_modifie:=true; - - Dessin_16(ImageTCO.Canvas,XClicCell,YClicCell,0); - stocke_undo(1,XClicCell,YClicCell); - maj_undo(1); - tco[XClicCell,YClicCell].BImage:=16; // image 16 - tco[XClicCell,YClicCell].liaisons:=liaisons[16]; - tco[XClicCell,YClicCell].Adresse:=0; // rien - tco[xClicCell,YClicCell].CoulFonte:=clYellow; - EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); - EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); + end_drag(16,x,y,Sender,Target); end; procedure TFormTCO.ImagePalette17EndDrag(Sender, Target: TObject; X, Y: Integer); begin - if not(Target is TImage) then exit; - if (Target as TImage).Name<>'ImageTCO' then exit; - if (x=0) and (y=0) then exit; - BitBlt(imageTCO.canvas.handle,oldx,oldy,LargeurCell,HauteurCell,oldbmp.canvas.handle,0,0,SRCCOPY); - efface_entoure; - imageTCO.repaint; - Xclic:=X;YClic:=Y; - XclicCell:=Xclic div largeurCell +1; - YclicCell:=Yclic div hauteurCell +1; - if not(verif_cellule(XclicCell,YclicCell,17)) then exit; - efface_cellule(ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); - TCO_modifie:=true; - Dessin_17(ImageTCO.Canvas,XClicCell,YClicCell,0); - stocke_undo(1,XClicCell,YClicCell); - maj_undo(1); - tco[XClicCell,YClicCell].BImage:=17; // image 17 - tco[XClicCell,YClicCell].liaisons:=liaisons[17]; - tco[XClicCell,YClicCell].Adresse:=0; // rien - tco[xClicCell,YClicCell].CoulFonte:=clYellow; - EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); - EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); + end_drag(17,x,y,Sender,Target); end; - + procedure TFormTCO.ImagePalette18EndDrag(Sender, Target: TObject; X, Y: Integer); begin - if not(Target is TImage) then exit; - if (Target as TImage).Name<>'ImageTCO' then exit; - if (x=0) and (y=0) then exit; - BitBlt(imageTCO.canvas.handle,oldx,oldy,LargeurCell,HauteurCell,oldbmp.canvas.handle,0,0,SRCCOPY); - efface_entoure; - imageTCO.repaint; - Xclic:=X;YClic:=Y; - XclicCell:=Xclic div largeurCell +1; - YclicCell:=Yclic div hauteurCell +1; - if not(verif_cellule(XclicCell,YclicCell,18)) then exit; - efface_cellule(ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); - TCO_modifie:=true; - - Dessin_18(ImageTCO.Canvas,XClicCell,YClicCell,0); - stocke_undo(1,XClicCell,YClicCell); - maj_undo(1); - tco[XClicCell,YClicCell].BImage:=18; // image 18 - tco[XClicCell,YClicCell].liaisons:=liaisons[18]; - tco[XClicCell,YClicCell].Adresse:=0; // rien - tco[xClicCell,YClicCell].CoulFonte:=clYellow; - EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); - EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); + end_drag(18,x,y,Sender,Target); end; procedure TFormTCO.ImagePalette19EndDrag(Sender, Target: TObject; X, Y: Integer); begin - if not(Target is TImage) then exit; - if (Target as TImage).Name<>'ImageTCO' then exit; - if (x=0) and (y=0) then exit; - BitBlt(imageTCO.canvas.handle,oldx,oldy,LargeurCell,HauteurCell,oldbmp.canvas.handle,0,0,SRCCOPY); - efface_entoure; - imageTCO.repaint; - Xclic:=X;YClic:=Y; - XclicCell:=Xclic div largeurCell +1; - YclicCell:=Yclic div hauteurCell +1; - if not(verif_cellule(XclicCell,YclicCell,19)) then exit; - efface_cellule(ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); - TCO_modifie:=true; - Dessin_19(ImageTCO.Canvas,XClicCell,YClicCell,0); - stocke_undo(1,XClicCell,YClicCell); - maj_undo(1); - tco[XClicCell,YClicCell].BImage:=19; // image 19 - tco[XClicCell,YClicCell].liaisons:=liaisons[19]; - tco[XClicCell,YClicCell].Adresse:=0; // rien - tco[xClicCell,YClicCell].CoulFonte:=clYellow; - EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); - EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); + end_drag(19,x,y,Sender,Target); end; procedure TFormTCO.ImagePalette21EndDrag(Sender, Target: TObject; X, Y: Integer); begin - if not(Target is TImage) then exit; - if (Target as TImage).Name<>'ImageTCO' then exit; - if (x=0) and (y=0) then exit; - BitBlt(imageTCO.canvas.handle,oldx,oldy,LargeurCell,HauteurCell,oldbmp.canvas.handle,0,0,SRCCOPY); - efface_entoure; - imageTCO.repaint; - Xclic:=X;YClic:=Y; - XclicCell:=Xclic div largeurCell +1; - YclicCell:=Yclic div hauteurCell +1; - if not(verif_cellule(XclicCell,YclicCell,21)) then exit; - efface_cellule(ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); - TCO_modifie:=true; - Dessin_21(ImageTCO.Canvas,XClicCell,YClicCell,0); - stocke_undo(1,XClicCell,YClicCell); - maj_undo(1); - tco[XClicCell,YClicCell].BImage:=21; - tco[XClicCell,YClicCell].liaisons:=liaisons[21]; - tco[XClicCell,YClicCell].Adresse:=0; // rien - tco[xClicCell,YClicCell].CoulFonte:=clYellow; - EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); - EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); + end_drag(21,x,y,Sender,Target); end; procedure TFormTCO.ImagePalette22EndDrag(Sender, Target: TObject; X,Y: Integer); begin - if not(Target is TImage) then exit; - if (Target as TImage).Name<>'ImageTCO' then exit; - if (x=0) and (y=0) then exit; - BitBlt(imageTCO.canvas.handle,oldx,oldy,LargeurCell,HauteurCell,oldbmp.canvas.handle,0,0,SRCCOPY); - efface_entoure; - imageTCO.repaint; - Xclic:=X;YClic:=Y; - XclicCell:=Xclic div largeurCell +1; - YclicCell:=Yclic div hauteurCell +1; - if not(verif_cellule(XclicCell,YclicCell,22)) then exit; - efface_cellule(ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); - TCO_modifie:=true; - - Dessin_22(ImageTCO.Canvas,XClicCell,YClicCell,0); - stocke_undo(1,XClicCell,YClicCell); - maj_undo(1); - tco[XClicCell,YClicCell].BImage:=22; - tco[XClicCell,YClicCell].liaisons:=liaisons[22]; - tco[XClicCell,YClicCell].Adresse:=0; // rien - tco[xClicCell,YClicCell].CoulFonte:=clYellow; - EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); - EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); + end_drag(22,x,y,Sender,Target); end; procedure TFormTCO.ButtonSauveTCOClick(Sender: TObject); +var indexTCO : integer; begin - sauve_fichier_tco; + indexTCO:=Index_TCO(sender); + sauve_fichiers_tco; defocusControl(ButtonSauveTCO,true); end; procedure TFormTCO.MenuCollerClick(Sender: TObject); -var x,y,xPlace,yPlace : integer; +var x,y,xPlace,yPlace,indexTCO: integer; + c : tComponent; begin if TamponAffecte then begin + c:=popupmenu1.PopupComponent ; // imageTCO + c:=c.GetParentComponent; // scrollBox + c:=c.GetParentComponent; // formTCO + indexTCO:=index_tco(c); for y:=TamponTCO_Org.y1 to TamponTCO_Org.y2 do // rectangle de la sélection for x:=TamponTCO_Org.x1 to TamponTCO_Org.x2 do begin - xPlace:=XclicCell+x-TamponTCO_Org.x1; // destination - yPlace:=YclicCell+y-TamponTCO_Org.y1; - if (xPlace<=NbreCellX) and (yPlace<=NbreCellY) then tco[xPlace,yPlace]:=tamponTCO[x,y]; + xPlace:=XclicCell[indexTCO]+x-TamponTCO_Org.x1; // destination + yPlace:=YclicCell[indexTCO]+y-TamponTCO_Org.y1; + if (xPlace<=NbreCellX[indexTCO]) and (yPlace<=NbreCellY[indexTCO]) then tco[indextco,xPlace,yPlace]:=tampontco[x,y]; end; + Affiche_TCO(indexTCO); + TCO_modifie:=true; end; - Affiche_TCO; - TCO_modifie:=true; end; - procedure TFormTCO.MenuCopierClick(Sender: TObject); +var indexTCO : integer; + c : tcomponent; begin - copier; + c:=popupmenu1.PopupComponent ; // imageTCO + c:=c.GetParentComponent; // scrollBox + c:=c.GetParentComponent; // formTCO + indexTCO:=index_tco(c); + copier(indexTCO); end; // supprimer la sélection procedure TFormTCO.MenuCouperClick(Sender: TObject); +var indexTCO : integer; + c : Tcomponent; begin - couper; + c:=popupmenu1.PopupComponent ; // imageTCO + c:=c.GetParentComponent; // scrollBox + c:=c.GetParentComponent; // formTCO + indexTCO:=index_tco(c); + couper(indexTCO); end; procedure TFormTCO.AnnulercouperClick(Sender: TObject); +var indexTCO : integer; + c : tComponent; begin - Annule; + c:=popupmenu1.PopupComponent ; // imageTCO + c:=c.GetParentComponent; // scrollBox + c:=c.GetParentComponent; // formTCO + indexTCO:=index_tco(c); + Annule(indexTCO); end; // renvoie un élément du TCO par l'icone en fonction du tracé désiré 4 @@ -9645,13 +10121,13 @@ end; // quadrant du tracé (2=NE 3=Est 4=SE 5=S ) // premier : si c'est le premier élément du tracé // dernier : si c'est le dernier élément du tracé -// on regarde si l'élément est connecté par testbit(tco[x,y].liaisons,numbit) numbit=0=NO 1=N 2=NE 3=E 4=SE 5=S 6=SO 7=O -function replace(x,y,el,quadrant : integer;premier,dernier : boolean) : integer; +// on regarde si l'élément est connecté par testbit(tco[indextco,x,y].liaisons,numbit) numbit=0=NO 1=N 2=NE 3=E 4=SE 5=S 6=SO 7=O +function replace(indexTCO,x,y,el,quadrant : integer;premier,dernier : boolean) : integer; var bim : integer; begin //if debugTCO then Affiche('Quadrant '+intToSTR(quadrant),clred); result:=0; - bim:=tco[x,y].BImage; + bim:=tco[indextco,x,y].BImage; // élément d'origine case bim of 0 : result:=el; @@ -9660,11 +10136,11 @@ begin begin if premier then begin - if testbit(tco[x+1,y].liaisons,3) then result:=3 else result:=7; + if testbit(tco[indextco,x+1,y].liaisons,3) then result:=3 else result:=7; end; if dernier then begin - if testbit(tco[x-1,y].liaisons,3) then result:=2 else result:=9; + if testbit(tco[indextco,x-1,y].liaisons,3) then result:=2 else result:=9; end; if not(premier) and not(dernier) then result:=21; end; @@ -9672,19 +10148,19 @@ begin begin if dernier then begin - if not(testbit(tco[x-1,y].liaisons,3)) then result:=6; - if testbit(tco[x-1,y].liaisons,3) then result:=5; + if not(testbit(tco[indextco,x-1,y].liaisons,3)) then result:=6; + if testbit(tco[indextco,x-1,y].liaisons,3) then result:=5; end; if premier then begin - if testbit(tco[x+1,y].liaisons,7) then result:=4 ; - if not(testbit(tco[x+1,y].liaisons,7)) then result:=8; + if testbit(tco[indextco,x+1,y].liaisons,7) then result:=4 ; + if not(testbit(tco[indextco,x+1,y].liaisons,7)) then result:=8; end; if not(premier) and not(dernier) then begin - if testbit(tco[x-1,y].liaisons,3) and testbit(tco[x+1,y].liaisons,7) then result:=22; - if not(testbit(tco[x-1,y].liaisons,3)) and testbit(tco[x+1,y].liaisons,7) then result:=12; - if not(testbit(tco[x+1,y].liaisons,7)) and testbit(tco[x-1,y].liaisons,3) then result:=14; + if testbit(tco[indextco,x-1,y].liaisons,3) and testbit(tco[indextco,x+1,y].liaisons,7) then result:=22; + if not(testbit(tco[indextco,x-1,y].liaisons,3)) and testbit(tco[indextco,x+1,y].liaisons,7) then result:=12; + if not(testbit(tco[indextco,x+1,y].liaisons,7)) and testbit(tco[indextco,x-1,y].liaisons,3) then result:=14; end; end; if quadrant=3 then result:=1; @@ -9786,15 +10262,15 @@ begin if quadrant=2 then result:=10; if quadrant=3 then begin - if premier then begin if testbit(tco[x+1,y-1].liaisons,6) then result:=15 else result:=9;end + if premier then begin if testbit(tco[indextco,x+1,y-1].liaisons,6) then result:=15 else result:=9;end else - if dernier then begin if testbit(tco[x-1,y+1].liaisons,2) then result:=13 else result:=7;end + if dernier then begin if testbit(tco[indextco,x-1,y+1].liaisons,2) then result:=13 else result:=7;end else if not(premier) and not(dernier) then begin - if (testbit(tco[x-1,y+1].liaisons,2)) and (testbit(tco[x+1,y-1].liaisons,6)) then result:=21; - if not(testbit(tco[x-1,y+1].liaisons,2)) and (testbit(tco[x+1,y-1].liaisons,6)) then result:=3; - if testbit(tco[x-1,y+1].liaisons,2) and not(testbit(tco[x+1,y-1].liaisons,6)) then result:=2; + if (testbit(tco[indextco,x-1,y+1].liaisons,2)) and (testbit(tco[indextco,x+1,y-1].liaisons,6)) then result:=21; + if not(testbit(tco[indextco,x-1,y+1].liaisons,2)) and (testbit(tco[indextco,x+1,y-1].liaisons,6)) then result:=3; + if testbit(tco[indextco,x-1,y+1].liaisons,2) and not(testbit(tco[indextco,x+1,y-1].liaisons,6)) then result:=2; end; end; if quadrant=5 then @@ -9802,12 +10278,12 @@ begin if premier then begin // SO - if testbit(tco[x-1,y+1].liaisons,2) then result:=32 else result:=17; + if testbit(tco[indextco,x-1,y+1].liaisons,2) then result:=32 else result:=17; end; if dernier then begin // NE - if testbit(tco[x+1,y-1].liaisons,6) then result:=34 else result:=18; + if testbit(tco[indextco,x+1,y-1].liaisons,6) then result:=34 else result:=18; end; if not(premier) and not(dernier) then result:=23; end; @@ -9816,15 +10292,15 @@ begin if quadrant=1 then result:=19; if quadrant=3 then begin - if dernier then begin if testbit(tco[x-1,y-1].liaisons,4) then result:=14 else result:=8;end + if dernier then begin if testbit(tco[indextco,x-1,y-1].liaisons,4) then result:=14 else result:=8;end else - if premier then begin if testbit(tco[x+1,y+1].liaisons,0) then result:=12 else result:=6;end + if premier then begin if testbit(tco[indextco,x+1,y+1].liaisons,0) then result:=12 else result:=6;end else if not(premier) and not(dernier) then begin - if (testbit(tco[x-1,y-1].liaisons,4)) and (testbit(tco[x+1,y+1].liaisons,0)) then result:=22; - if not(testbit(tco[x-1,y-1].liaisons,4)) and (testbit(tco[x+1,y+1].liaisons,0)) then result:=4; - if testbit(tco[x-1,y-1].liaisons,4) and not(testbit(tco[x+1,y+1].liaisons,0)) then result:=5; + if (testbit(tco[indextco,x-1,y-1].liaisons,4)) and (testbit(tco[indextco,x+1,y+1].liaisons,0)) then result:=22; + if not(testbit(tco[indextco,x-1,y-1].liaisons,4)) and (testbit(tco[indextco,x+1,y+1].liaisons,0)) then result:=4; + if testbit(tco[indextco,x-1,y-1].liaisons,4) and not(testbit(tco[indextco,x+1,y+1].liaisons,0)) then result:=5; end; end; if quadrant=4 then result:=11; @@ -9833,12 +10309,12 @@ begin if dernier then begin // NO - if testbit(tco[x-1,y-1].liaisons,4) then result:=33 else result:=19; + if testbit(tco[indextco,x-1,y-1].liaisons,4) then result:=33 else result:=19; end; if premier then begin // SE - if testbit(tco[x+1,y+1].liaisons,0) then result:=29 else result:=16; + if testbit(tco[indextco,x+1,y+1].liaisons,0) then result:=29 else result:=16; end; if not(premier) and not(dernier) then result:=25; end; @@ -9891,7 +10367,7 @@ begin end; if quadrant=5 then begin - if testbit(tco[x,y-1].liaisons,5) then result:=24 else result:=16; + if testbit(tco[indextco,x,y-1].liaisons,5) then result:=24 else result:=16; end; end; @@ -9917,7 +10393,7 @@ begin if premier then result:=27; if dernier then begin - if testbit(tco[x,y+1].liaisons,1) then result:=21;result:=18; + if testbit(tco[indextco,x,y+1].liaisons,1) then result:=21;result:=18; end; if not(premier) and not(dernier) then result:=27; end; @@ -9937,16 +10413,16 @@ begin if premier then begin // /N - if not(testbit(tco[x,y-1].liaisons,5)) then result:=17 else result:=26; + if not(testbit(tco[indextco,x,y-1].liaisons,5)) then result:=17 else result:=26; // SO - if (testbit(tco[x-1,y+1].liaisons,2)) then result:=23; + if (testbit(tco[indextco,x-1,y+1].liaisons,2)) then result:=23; // /SO N - if not(testbit(tco[x-1,y+1].liaisons,2)) and testbit(tco[x-1,y].liaisons,5) then result:=26; + if not(testbit(tco[indextco,x-1,y+1].liaisons,2)) and testbit(tco[indextco,x-1,y].liaisons,5) then result:=26; end; if dernier then begin // /S - if not(testbit(tco[x,y+1].liaisons,1)) then result:=18 else result:=27; + if not(testbit(tco[indextco,x,y+1].liaisons,1)) then result:=18 else result:=27; end; if not(premier) and not(dernier) then result:=23; end; @@ -9954,17 +10430,17 @@ begin begin if dernier then begin - if (testbit(tco[x,y-1].liaisons,5)) and not(testbit(tco[x+1,y+1].liaisons,0)) then result:=24; - if (testbit(tco[x,y-1].liaisons,5)) and (testbit(tco[x+1,y+1].liaisons,0)) then result:=25; - if not(testbit(tco[x,y-1].liaisons,5)) and not(testbit(tco[x+1,y+1].liaisons,0)) then result:=16; + if (testbit(tco[indextco,x,y-1].liaisons,5)) and not(testbit(tco[indextco,x+1,y+1].liaisons,0)) then result:=24; + if (testbit(tco[indextco,x,y-1].liaisons,5)) and (testbit(tco[indextco,x+1,y+1].liaisons,0)) then result:=25; + if not(testbit(tco[indextco,x,y-1].liaisons,5)) and not(testbit(tco[indextco,x+1,y+1].liaisons,0)) then result:=16; end; if premier then begin - if (testbit(tco[x-1,y-1].liaisons,4)) then result:=25; + if (testbit(tco[indextco,x-1,y-1].liaisons,4)) then result:=25; // /NO /S - if not(testbit(tco[x-1,y-1].liaisons,4)) and not(testbit(tco[x,y+1].liaisons,1)) then result:=19; + if not(testbit(tco[indextco,x-1,y-1].liaisons,4)) and not(testbit(tco[indextco,x,y+1].liaisons,1)) then result:=19; // /NO S - if not(testbit(tco[x-1,y-1].liaisons,4)) and (testbit(tco[x,y+1].liaisons,1)) then result:=28; + if not(testbit(tco[indextco,x-1,y-1].liaisons,4)) and (testbit(tco[indextco,x,y+1].liaisons,1)) then result:=28; end; if not(premier) and not(dernier) then result:=25; @@ -9979,8 +10455,8 @@ begin begin if dernier then begin - if testbit(tco[x+1,y+1].liaisons,0) then result:=25 ; - if not(testbit(tco[x+1,y+1].liaisons,0)) then result:=24 ; + if testbit(tco[indextco,x+1,y+1].liaisons,0) then result:=25 ; + if not(testbit(tco[indextco,x+1,y+1].liaisons,0)) then result:=24 ; end; if premier then result:=25; if not(premier) and not(dernier) then result:=25; @@ -10013,7 +10489,7 @@ begin if premier then result:=28; if dernier then begin - if (testbit(tco[x,y-1].liaisons,5)) and (testbit(tco[x+1,y+1].liaisons,0)) and (testbit(tco[x,y+1].liaisons,1)) then result:=25 else result:=28; + if (testbit(tco[indextco,x,y-1].liaisons,5)) and (testbit(tco[indextco,x+1,y+1].liaisons,0)) and (testbit(tco[indextco,x,y+1].liaisons,1)) then result:=25 else result:=28; end; if not(premier) and not(dernier) then result:=25; end; @@ -10036,12 +10512,12 @@ begin if premier then begin // N - if (testbit(tco[x,y-1].liaisons,5)) then result:=23 else result:=32; + if (testbit(tco[indextco,x,y-1].liaisons,5)) then result:=23 else result:=32; end; if not(premier) and not(dernier) then begin // N - if (testbit(tco[x,y-1].liaisons,5)) then result:=23 else result:=32; + if (testbit(tco[indextco,x,y-1].liaisons,5)) then result:=23 else result:=32; end; end; end; @@ -10070,10 +10546,10 @@ begin end; end; end; - tco[x,y].coulFonte:=clyellow; + tco[indextco,x,y].coulFonte:=clyellow; if result=1 then begin - tco[x,y].repr:=2; + tco[indextco,x,y].repr:=2; end; end; @@ -10082,43 +10558,65 @@ end; // évènement qui se produit quand on clique gauche ou droit procedure TFormTCO.ImageTCOMouseDown(Sender: TObject; Button: TMouseButton;Shift: TShiftState; X, Y: Integer); var position : Tpoint; - i,Bimage,xt,yt,xf,yf : integer; + indexTCO,i,n,Bimage,xt,yt,xf,yf,xclic,yclic : integer; begin + indexTCO:=index_tco(sender); + GetCursorPos(Position); + Position:=ImageTCO.screenToCLient(Position); + Xclic:=position.X; + YClic:=position.Y; + // coordonnées grille + Xclic:=Xclic div LargeurCell[indexTCO] + 1; + Yclic:=Yclic div hauteurCell[indexTCO] + 1; + XclicCell[indexTCO]:=Xclic; + YclicCell[indexTCO]:=Yclic; + if button=mbLeft then begin if affEvt then Affiche('TCO Souris clicG enfoncée',clYellow); if dbleClicTCO then begin dbleClicTCO:=false;exit;end; auto_tcurs:=true; clicsouris:=true; - GetCursorPos(Position); - Position:=formTCO.ImageTCO.screenToCLient(Position); - //Affiche(IntToSTR(position.x),clyellow); - Xclic:=position.X;YClic:=position.Y; - XclicCell:=Xclic div largeurCell +1; - YclicCell:=Yclic div hauteurCell +1; + + Bimage:=tco[indextco,xclic,yclic].BImage; + // action + if (Bimage=id_action) and not(ConfCellTCO) then + begin + i:=tco[indextco,xclic,yclic].piedfeu; + n:=tco[indextco,xclic,yclic].feuoriente; + if i=1 then Affiche_fenetre_TCO(n); + if i=2 then with formprinc do + begin + windowState:=wsNormal; //Maximized; + show; + BringToFront; + end; + if (i=3) and (CDMhd<>0) then ShowWindow(CDMhd,SW_MAXIMIZE); + end; + TempoSouris:=2 ; // démarre la tempo souris // clic en mode dessin - if modeTrace then + if modeTrace[indexTCO] then begin if indextrace=0 then begin inc(indexTrace); - traceXY[indexTrace].x:=XClicCell; - traceXY[indexTrace].y:=YclicCell; + traceXY[indexTrace].x:=XClic; + traceXY[indexTrace].y:=Yclic; exit; end; if indextrace=1 then begin // vérifier coordonnées valides - if ( abs(XClicCell-traceXY[1].x)=abs(YClicCell-traceXY[1].y) ) or - ( XClicCell-traceXY[1].x=0 ) or ( YClicCell-traceXY[1].y=0 ) then + if ( abs(XClic-traceXY[1].x)=abs(YClic-traceXY[1].y) ) or + ( XClic-traceXY[1].x=0 ) or ( YClic-traceXY[1].y=0 ) then begin - traceXY[2].x:=XClicCell; - traceXY[2].y:=YclicCell; - xf:=XClicCell; - yf:=YclicCell; + traceXY[2].x:=XClic; + traceXY[2].y:=Yclic; + xf:=XClic; + yf:=Yclic; // si origine=destination, annuler if (traceXY[1].x=traceXY[2].x) and (traceXY[1].y=traceXY[2].y) then @@ -10139,15 +10637,15 @@ begin i:=1; for xt:=traceXY[1].x to traceXY[2].x do begin - stocke_undo(i,xt,yt); // stocke les points de la ligne entière dessinée + stocke_undo(indextco,i,xt,yt); // stocke les points de la ligne entière dessinée inc(i); - Bimage:=replace(xt,yt,1,3,xt=traceXY[1].x,xt=traceXY[2].x); - tco[xt,yt].BImage:=Bimage; - tco[xt,yt].liaisons:=liaisons[Bimage]; + Bimage:=replace(indexTCO,xt,yt,1,3,xt=traceXY[1].x,xt=traceXY[2].x); + tco[indextco,xt,yt].BImage:=Bimage; + tco[indextco,xt,yt].liaisons:=liaisons[Bimage]; end; maj_undo(i-1); // stocke le nombre de points de la ligne - affiche_tco; + affiche_tco(indextco); end else @@ -10160,14 +10658,14 @@ begin i:=1; for yt:=traceXY[1].y to traceXY[2].y do begin - stocke_undo(i,xt,yt); + stocke_undo(indexTCO,i,xt,yt); inc(i); - Bimage:=replace(xt,yt,20,5,yt=traceXY[1].y,yt=traceXY[2].y); - tco[xt,yt].BImage:=Bimage; - tco[xt,yt].liaisons:=liaisons[Bimage]; + Bimage:=replace(indexTCO,xt,yt,20,5,yt=traceXY[1].y,yt=traceXY[2].y); + tco[indextco,xt,yt].BImage:=Bimage; + tco[indextco,xt,yt].liaisons:=liaisons[Bimage]; end; maj_undo(i-1); - affiche_tco; + affiche_tco(indexTCO); end // indice 1 doit toujours < que indice 2 @@ -10187,15 +10685,15 @@ begin i:=1; for xt:=traceXY[1].x to traceXY[2].x do begin - stocke_undo(i,xt,yt); + stocke_undo(indexTCO,i,xt,yt); inc(i); - Bimage:=replace(xt,yt,11,4,xt=traceXY[1].x,xt=traceXY[2].x); - tco[xt,yt].BImage:=Bimage; - tco[xt,yt].liaisons:=liaisons[Bimage]; + Bimage:=replace(indexTCO,xt,yt,11,4,xt=traceXY[1].x,xt=traceXY[2].x); + tco[indextco,xt,yt].BImage:=Bimage; + tco[indextco,xt,yt].liaisons:=liaisons[Bimage]; inc(yt); end; maj_undo(i-1); - affiche_tco; + affiche_tco(indexTCO); end else begin @@ -10204,15 +10702,15 @@ begin i:=1; for xt:=traceXY[1].x to traceXY[2].x do begin - stocke_undo(i,xt,yt); + stocke_undo(indexTCO,i,xt,yt); inc(i); - Bimage:=replace(xt,yt,10,2,xt=traceXY[1].x,xt=traceXY[2].x); - tco[xt,yt].BImage:=Bimage; - tco[xt,yt].liaisons:=liaisons[Bimage]; + Bimage:=replace(indexTCO,xt,yt,10,2,xt=traceXY[1].x,xt=traceXY[2].x); + tco[indextco,xt,yt].BImage:=Bimage; + tco[indextco,xt,yt].liaisons:=liaisons[Bimage]; dec(yt); end; maj_undo(i-1); - affiche_tco; + affiche_tco(indexTCO); end; end; end; @@ -10229,77 +10727,69 @@ begin //Temposouris:=0; xMiniSel:=99999;yMiniSel:=99999; xMaxiSel:=0;yMaxiSel:=0; - if SelectionAffichee then - begin - //Affiche('efface sélection',clOrange); - with imageTCO.Canvas do + + // si une zone de sélection est affichée sur un des TCO, annuler toutes + for n:=1 to NbreTCO do + if SelectionAffichee[n] then begin - Pen.Mode:=PmXor; - Pen.color:=clGrille; - Brush.Color:=clblue; - //FillRect(r); - Rectangle(rAncien); + //Affiche('efface sélection',clOrange); + with formTCO[n].imageTCO.Canvas do + begin + Pen.Mode:=PmXor; + Pen.color:=clGrille; + Brush.Color:=clblue; + //FillRect(r); + Rectangle(rAncien); + end; + SelectionAffichee[n]:=false; end; - SelectionAffichee:=false; - end; // clic gauche clicTCO:=true; //Affiche('xcliccell='+IntToSTR(XclicCell)+' ycliccell='+IntToSTR(YclicCell),clyellow); - if XclicCell>NbreCellX then exit; - if YclicCell>NbreCellY then exit; + if Xclic>NbreCellX[indexTCO] then exit; + if Yclic>NbreCellY[indexTCO] then exit; - if not(selectionaffichee) then _entoure_cell_clic; - actualise; // actualise la fenetre de config cellule + if not(selectionaffichee[indexTCO]) then _entoure_cell_clic(indexTCO); + actualise(indexTCO); // actualise la fenetre de config cellule clicTCO:=false; end; - if button=mbRight then begin if affEvt then Affiche('TCO Souris clicD enfoncée',clLime); auto_tcurs:=true; - - if modetrace then + if modetrace[indexTCO] then begin traceXY[1].x:=0;traceXY[1].y:=0; traceXY[2].x:=0;traceXY[2].y:=0; indextrace:=0; - affiche_tco; + affiche_tco(indexTCO); screen.cursor:=crUpArrow; exit; end; - GetCursorPos(Position); - Position:=ImageTCO.screenToCLient(Position); - Xclic:=position.X; - YClic:=position.Y; - // coordonnées grille - XclicCell:=Xclic div largeurCell + 1; - YclicCell:=Yclic div hauteurCell + 1; - LabelCoord.caption:=IntToSTR(XClicCell)+','+IntToSTR(YClicCell); - XclicCellInserer:=XClicCell; - YclicCellInserer:=YClicCell; + XclicCellInserer:=XClic; + YclicCellInserer:=YClic; //Entoure_cell(XclicCellInserer,YclicCellInserer); - EditAdrElement.Text:=IntToSTR(tco[XClicCellInserer,YClicCellInserer].Adresse); - EditTypeImage.Text:=IntToSTR(tco[XClicCellInserer,YClicCellInserer].Bimage); + EditAdrElement.Text:=IntToSTR(tco[indextco,XClicCellInserer,YClicCellInserer].Adresse); + EditTypeImage.Text:=IntToSTR(tco[indextco,XClicCellInserer,YClicCellInserer].Bimage); end; end; procedure TFormTCO.ImageTCOMouseMove(Sender: TObject; Shift: TShiftState;X, Y: Integer); var r : Trect; - cellX,cellY,XSel1,YSel1,XSel2,YSel2,Bimage,xMiniSelP,yMiniSelP,xMaxiSelP,yMaxiSelP : integer; + indexTCO,cellX,cellY,XSel1,YSel1,XSel2,YSel2,Bimage,xMiniSelP,yMiniSelP,xMaxiSelP,yMaxiSelP : integer; ok : boolean; begin if affevt then Affiche('ImageTCOMouseMove',clLime); if dbleClicTCO then begin dbleClicTCO:=false;exit;end; if Temposouris>0 then exit; // Affiche('*',cllime); - SourisX.Caption:=IntToSTR(x); - SourisY.Caption:=IntToSTR(y); - //affiche(intToSTR(x),clorange); - cellX:=x div largeurCell+1; - cellY:=y div hauteurCell+1; + indexTCO:=index_tco(sender); + //affiche(intToSTR(y),clorange); + cellX:=x div LargeurCell[indexTCO]+1; + cellY:=y div hauteurCell[indexTCO]+1; //Affiche('Cellx='+IntToSTR(Cellx)+' Celly='+intToSTR(Celly)+' AncienCellx='+IntToSTR(AncienXClicCell)+' AncienCelly='+intToSTR(AncienYClicCell),clorange); @@ -10310,16 +10800,16 @@ begin //Affiche('cellX='+IntToSTR(Cellx)+' cellY='+intToSTR(cellY),clyellow); - if CellX>NbreCellX then exit; - if CellY>NbreCellY then exit; + if CellX>NbreCellX[indexTCO] then exit; + if CellY>NbreCellY[indexTCO] then exit; - Bimage:=tco[cellX,cellY].BImage; + Bimage:=tco[indextco,cellX,cellY].BImage; - if modeTrace then + if modeTrace[indexTCO] then begin if indexTrace>0 then begin - with ImageTCO.canvas do + with formTCO[indexTCO].ImageTCO.canvas do begin Pen.Mode:=pmXor; Pen.Color:=clwhite; @@ -10329,8 +10819,8 @@ begin begin if debugTCO then Affiche('Efface précédent',clyellow); if ancienok then Pen.color:=clyellow else pen.color:=clGray; - MoveTo(traceXY[indexTrace].x*largeurCell-LargeurCelld2,traceXY[indexTrace].y*hauteurCell-HauteurCelld2); - LineTo(ancienTraceX*largeurcell-largeurCelld2,ancienTraceY*HauteurCell-HauteurCelld2); + MoveTo(traceXY[indexTrace].x*LargeurCell[indexTCO]-LargeurCelld2[indexTCO],traceXY[indexTrace].y*hauteurCell[indexTCO]-hauteurCelld2[indexTCO]); + LineTo(ancienTraceX*LargeurCell[indexTCO]-LargeurCelld2[indexTCO],ancienTraceY*hauteurCell[indexTCO]-hauteurCelld2[indexTCO]); end; if debugTCO then Affiche('Trace',clyellow); ancienTraceX:=cellx; @@ -10343,8 +10833,8 @@ begin Ancienok:=ok; if ok then Pen.color:=clyellow else pen.color:=clGray; - MoveTo(traceXY[indexTrace].x*largeurCell-LargeurCelld2,traceXY[indexTrace].y*hauteurCell-HauteurCelld2); - LineTo(cellX*largeurCell-largeurCelld2,CellY*hauteurCell-HauteurCelld2); + MoveTo(traceXY[indexTrace].x*LargeurCell[indexTCO]-LargeurCelld2[indexTCO],traceXY[indexTrace].y*hauteurCell[indexTCO]-hauteurCelld2[indexTCO]); + LineTo(cellX*LargeurCell[indexTCO]-LargeurCelld2[indexTCO],CellY*hauteurCell[indexTCO]-hauteurCelld2[indexTCO]); if ok then begin @@ -10358,10 +10848,10 @@ begin if not(clicsouris) or (temposouris>0) then exit; - xMiniSel:=(XclicCell-1)*LargeurCell; - yMiniSel:=(YclicCell-1)*HauteurCell; - xMaxiSel:=(cellX-1)*LargeurCell; - yMaxiSel:=(cellY-1)*HauteurCell; + xMiniSel:=(XclicCell[indexTCO]-1)*LargeurCell[indexTCO]; + yMiniSel:=(YclicCell[indexTCO]-1)*hauteurCell[indexTCO]; + xMaxiSel:=(cellX-1)*LargeurCell[indexTCO]; + yMaxiSel:=(cellY-1)*hauteurCell[indexTCO]; xminiSelP:=min(xminiSel,xMaxiSel); yminiSelP:=min(yminiSel,yMaxiSel); @@ -10376,7 +10866,7 @@ begin //Affiche('xMiniSel='+IntToSTR(xMiniSel)+' yMiniSel='+IntToSTR(yMiniSel)+' xMaxiSel='+IntToSTR(xMaxiSel)+' yMaxiSel='+IntToSTR(yMaxiSel),clOrange); // efface l'ancien rectangle de sélection - if SelectionAffichee then + if SelectionAffichee[indexTCO] then with imageTCO.Canvas do begin Pen.Mode:=PmXor; @@ -10385,14 +10875,14 @@ begin Rectangle(rAncien); end; - if piloteAig then begin SelectionAffichee:=false;piloteAig:=false;exit;end; + if piloteAig then begin SelectionAffichee[indexTCO]:=false;piloteAig:=false;exit;end; - r:=Rect(xminiSel+1,YminiSel+1,XmaxiSel+largeurCell,yMaxiSel+hauteurCell); + r:=Rect(xminiSel+1,YminiSel+1,XmaxiSel+LargeurCell[indexTCO],yMaxiSel+hauteurCell[indexTCO]); - XSel1:=Xminisel div largeurCell + 1; - YSel1:=Yminisel div hauteurCell + 1; - XSel2:=Xmaxisel div largeurCell + 1; - YSel2:=Ymaxisel div hauteurCell + 1; + 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 @@ -10405,9 +10895,9 @@ begin //FillRect(r); Rectangle(r); end; - SelectionAffichee:=true; + SelectionAffichee[indexTCO]:=true; //Affiche('Sélection affichée',clLime); - if entoure then begin Entoure_cell(Xentoure,Yentoure);entoure:=false;end; // efface + if entoure[indexTCO] then begin Entoure_cell(indexTCO,Xentoure[indexTCO],Yentoure[indexTCO]);entoure[indexTCO]:=false;end; // efface end; procedure TFormTCO.ImageTCOMouseUp(Sender: TObject; Button: TMouseButton; @@ -10418,22 +10908,25 @@ begin end; procedure TFormTCO.ButtonRedessineClick(Sender: TObject); +var indexTCO : integer; begin - Affiche_TCO; + indexTCO:=index_TCO(sender); + Affiche_TCO(indexTCO); defocusControl(ButtonRedessine,true); end; // changement de l'adresse d'un élément procedure TFormTCO.EditAdrElementChange(Sender: TObject); -var Adr,erreur,index : integer; +var Adr,erreur,index,indexTCO : integer; s: string; begin //Affiche('Chgt adresse',clyellow); - if clicTCO or not(formConfCellTCOAff) then exit; + if clicTCO then exit; + if (ConfCellTCO) then exit; clicTCO:=true; auto_tcurs:=false; // interdit le déplacement du curseur encadré du TCO (pour que les tuouches curseur s'applique au Tedit) - - s:=EditAdrElement.Text; + indexTCO:=index_TCO(sender); + s:=formTCO[indexTCO].EditAdrElement.Text; if length(s)>1 then begin if (s[1]='A') or (s[1]='a') then delete(s,1,1); @@ -10441,43 +10934,44 @@ begin end; Val(s,Adr,erreur); - if (erreur<>0) or (Adr<0) or (Adr>2048) then Adr:=0; + if erreur<>0 then exit; + if (Adr<0) or (Adr>2048) then Adr:=0; clicTCO:=false; - if Adr=0 then tco[XClicCell,YClicCell].repr:=2; + if Adr=0 then tco[indextco,XClicCell[indexTCO],YClicCell[indexTCO]].repr:=2; - efface_entoure; - tco[XClicCell,YClicCell].Adresse:=Adr; + efface_entoure(indexTCO); + tco[indextco,XClicCell[indexTCO],YClicCell[indexTCO]].Adresse:=Adr; //formConfCellTCO.editAdrElement.Text:=intToSTR(Adr); tco_Modifie:=true; // si signal - if tco[XClicCell,YClicCell].BImage=Id_signal then + if tco[indextco,XClicCell[indexTCO],YClicCell[indexTCO]].BImage=Id_signal then begin index:=Index_Signal(adr); if index=0 then exit else begin //Affiche('Signal '+intToSTR(Adr),clyellow); - affiche_tco; + affiche_tco(indexTCO); end; end; - Affiche_cellule(XclicCell,YclicCell); + Affiche_cellule(indexTCO,XclicCell[indexTCO],YclicCell[indexTCO]); end; // mise à jour des cellules de l'adresse "adresse" -procedure TFormTCO.Maj_TCO(Adresse : integer); +procedure Maj_TCO(indexTCO,Adresse : integer); var x,y: integer; begin - for y:=1 to NbreCellY do - for x:=1 to NbreCellX do + for y:=1 to NbreCellY[indexTCO] do + for x:=1 to NbreCellX[indexTCO] do begin - if tco[x,y].Adresse=Adresse then + if tco[indextco,x,y].Adresse=Adresse then begin - affiche_cellule(x,y); - entoure_cell_grille(x,y); + affiche_cellule(indexTCO,x,y); + entoure_cell_grille(indexTCO,x,y); end; end; end; @@ -10485,66 +10979,26 @@ end; procedure TFormTCO.Button1Click(Sender: TObject); begin Detecteur[569].etat:=true; - Maj_tco(569); + Maj_tco(index_TCO(sender),569); end; procedure TFormTCO.Button2Click(Sender: TObject); begin Detecteur[569].etat:=false; - Maj_tco(569); + Maj_tco(index_TCO(sender),569); end; procedure TFormTCO.ImagePalette10EndDrag(Sender, Target: TObject; X, Y: Integer); begin - if not(target=ImageTCO) then exit; - if (x=0) and (y=0) then exit; - drag:=false; - BitBlt(imageTCO.canvas.handle,oldx,oldy,LargeurCell,HauteurCell,oldbmp.canvas.handle,0,0,SRCCOPY); - efface_entoure; - imageTCO.repaint; - Xclic:=X;YClic:=Y; - XclicCell:=Xclic div largeurCell +1; - YclicCell:=Yclic div hauteurCell +1; - if not(verif_cellule(XclicCell,YclicCell,10)) then exit; - efface_cellule(ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); - TCO_modifie:=true; - dessin_10(ImageTCO.Canvas,XClicCell,YClicCell,0); - stocke_undo(1,XClicCell,YClicCell); - maj_undo(1); - tco[XClicCell,YClicCell].BImage:=10; - tco[XClicCell,YClicCell].liaisons:=liaisons[10]; - tco[xClicCell,YClicCell].CoulFonte:=clYellow; - tco[XClicCell,YClicCell].Adresse:=0; - EditAdrElement.Text:=IntToSTR(tco[XClicCell,YClicCell].Adresse); - EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); + end_drag(10,x,y,Sender,Target); end; procedure TFormTCO.ImagePalette11EndDrag(Sender, Target: TObject; X, Y: Integer); begin - if not(target=ImageTCO) then exit; - if (x=0) and (y=0) then exit; - drag:=false; - BitBlt(imageTCO.canvas.handle,oldx,oldy,LargeurCell,HauteurCell,oldbmp.canvas.handle,0,0,SRCCOPY); - efface_entoure; - imageTCO.repaint; - Xclic:=X;YClic:=Y; - XclicCell:=Xclic div largeurCell +1; - YclicCell:=Yclic div hauteurCell +1; - if not(verif_cellule(XclicCell,YclicCell,11)) then exit; - efface_cellule(ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); - TCO_modifie:=true; - dessin_11(ImageTCO.Canvas,XClicCell,YClicCell,0); - stocke_undo(1,XClicCell,YClicCell); - maj_undo(1); - tco[XClicCell,YClicCell].BImage:=11; - tco[XClicCell,YClicCell].liaisons:=liaisons[11]; - tco[xClicCell,YClicCell].CoulFonte:=clYellow; - tco[XClicCell,YClicCell].Adresse:=0; - EditAdrElement.Text:=IntToSTR(tco[XClicCell,YClicCell].Adresse); - EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); + end_drag(11,x,y,Sender,Target); end; procedure TFormTCO.ImagePalette10MouseDown(Sender: TObject; @@ -10568,197 +11022,222 @@ begin end; procedure TFormTCO.ImagePalette50EndDrag(Sender, Target: TObject; X, Y: Integer); +var indexTCO,Xclic,Yclic : integer; begin if not(Target is TImage) then exit; - if (Target as TImage).Name<>'ImageTCO' then exit; if (x=0) and (y=0) then exit; - BitBlt(imageTCO.canvas.handle,oldx,oldy,LargeurCell,HauteurCell,oldbmp.canvas.handle,0,0,SRCCOPY); - efface_entoure; + indexTCO:=index_TCO(sender); + xclic:=xclicCell[indexTCO]; + yclic:=yclicCell[indexTCO]; + + BitBlt(formTCO[indexTCO].imageTCO.canvas.handle,oldx,oldy,LargeurCell[indexTCO],hauteurCell[indexTCO],oldbmp.canvas.handle,0,0,SRCCOPY); + efface_entoure(indexTCO); TCO_modifie:=true; Xclic:=X;YClic:=Y; - XclicCell:=Xclic div largeurCell +1; - YclicCell:=Yclic div hauteurCell +1; - stocke_undo(1,XClicCell,YClicCell); + Xclic:=Xclic div LargeurCell[indexTCO] +1; + Yclic:=Yclic div hauteurCell[indexTCO] +1; + stocke_undo(indexTCO,1,XClic,YClic); maj_undo(1); - efface_cellule(ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); - tco[XClicCell,YClicCell].BImage:=Id_signal; - tco[XClicCell,YClicCell].liaisons:=0; - tco[XClicCell,YClicCell].Adresse:=0; - tco[XClicCell,YClicCell].FeuOriente:=1; - tco[XClicCell,YClicCell].PiedFeu:=1; - tco[XClicCell,YClicCell].coulFonte:=clWhite; + efface_cellule(indexTCO,formTCO[indexTCO].ImageTCO.Canvas,XClic,YClic,PmCopy); + tco[indextco,XClic,YClic].BImage:=Id_signal; + tco[indextco,XClic,YClic].liaisons:=0; + tco[indextco,XClic,YClic].Adresse:=0; + tco[indextco,XClic,YClic].epaisseurs:=0; + tco[indextco,XClic,YClic].pont:=0; + tco[indextco,XClic,YClic].buttoir:=0; + tco[indextco,XClic,YClic].FeuOriente:=1; + tco[indextco,XClic,YClic].PiedFeu:=1; + tco[indextco,XClic,YClic].coulFonte:=clWhite; - tco[XClicCell,YClicCell].x:=0; - tco[XClicCell,YClicCell].y:=0; - // ne pas convertir l'adresse sinon evt changement du composant et on écrase l'aspect EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); - EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); - Dessin_Signal(ImageTCO.Canvas,XClicCell,YClicCell); + tco[indextco,XClic,YClic].x:=0; + tco[indextco,XClic,YClic].y:=0; + // ne pas convertir l'adresse sinon evt changement du composant et on écrase l'aspect EditAdrElement.Text:=IntToSTR( tco[indextco,XClicCell,YClicCell].Adresse); + EdittypeImage.Text:=IntToSTR(tco[indextco,XClic,YClic].BImage); + Dessin_Signal(indexTCO,formTCO[indexTCO].ImageTCO.Canvas,XClic,YClic); end; procedure TFormTCO.ImagePalette50MouseDown(Sender: TObject; Button: TMouseButton;Shift: TShiftState; X, Y: Integer); -var l,h : integer; +var l,h,indexTCO : integer; begin l:=Formprinc.Image9feux.width; //57 h:=Formprinc.Image9feux.height; //105 + indexTCO:=Index_tco(sender); ImagePalette50.BeginDrag(true); - BitBlt(OldBmp.Canvas.Handle,0,0,LargeurCell,HauteurCell,ImageTCO.Canvas.Handle,offsetSourisX,offsetSourisY,SRCCOPY); + BitBlt(OldBmp.Canvas.Handle,0,0,LargeurCell[indexTCO],hauteurCell[indexTCO],ImageTCO.Canvas.Handle,offsetSourisX,offsetSourisY,SRCCOPY); drag:=true; oldx:=offsetSourisX;oldy:=offsetSourisY; - with formTCO.ImageTemp2.Canvas do + with formTCO[indexTCO].ImageTemp2.Canvas do begin pen.Color:=clfond; brush.Color:=clblack; Rectangle(0,0,91,91); end; - TransparentBlt(formTCO.ImageTemp2.canvas.Handle,0,0,largeurCell,HauteurCell, // destination avec mise à l'échelle //50,50 ok 51,51 nok + TransparentBlt(formTCO[indexTCO].ImageTemp2.canvas.Handle,0,0,LargeurCell[indexTCO],hauteurCell[indexTCO], // destination avec mise à l'échelle //50,50 ok 51,51 nok formprinc.Image9feux.Canvas.Handle,0,0,50,90,clblue); - formtco.ImageTCO.repaint; - formTCO.ImageTemp:=formTCO.ImageTemp2; - BitBlt(formTCO.ImageTemp.canvas.Handle,0,0,20,20,formTCO.ImageTemp2.canvas.Handle,0,0,SRCCOPY); - - formtco.ImageTCO.repaint; + formtco[indexTCO].ImageTCO.repaint; + formTCO[indexTCO].ImageTemp:=formTCO[indexTCO].ImageTemp2; + BitBlt(formTCO[indexTCO].ImageTemp.canvas.Handle,0,0,20,20,formTCO[indexTCO].ImageTemp2.canvas.Handle,0,0,SRCCOPY); + formtco[indexTCO].ImageTCO.repaint; end; -procedure Tourne90G; +procedure Tourne90G(indexTCO : integer); var BImage : integer; begin if actualize then exit; - BImage:=TCO[XClicCell,YClicCell].Bimage; + BImage:=tco[indextco,XClicCell[indexTCO],YClicCell[indexTCO]].Bimage; if Bimage<>50 then exit; TCO_modifie:=true; // effacement de l'ancien signal - if tco[XClicCell,YClicCell].FeuOriente=3 then + if tco[indextco,XClicCell[indexTCO],YClicCell[indexTCO]].FeuOriente=3 then begin - Efface_Cellule(PCanvasTCO,xClicCell,yClicCell,PmCopy); - Efface_Cellule(PCanvasTCO,xClicCell+1,yClicCell,PmCopy); + Efface_Cellule(indexTCO,PCanvasTCO[indexTCO],xClicCell[indexTCO],yClicCell[indexTCO],PmCopy); + Efface_Cellule(indexTCO,PCanvasTCO[indexTCO],xClicCell[indexTCO]+1,yClicCell[indexTCO],PmCopy); end; - if tco[XClicCell,YClicCell].FeuOriente=2 then + if tco[indextco,XClicCell[indexTCO],YClicCell[indexTCO]].FeuOriente=2 then begin - Efface_Cellule(PCanvasTCO,xClicCell,yClicCell,PmCopy); - Efface_Cellule(PCanvasTCO,xClicCell-1,yClicCell,PmCopy); + Efface_Cellule(indexTCO,PCanvasTCO[indexTCO],xClicCell[indexTCO],yClicCell[indexTCO],PmCopy); + Efface_Cellule(indexTCO,PCanvasTCO[indexTCO],xClicCell[indexTCO]-1,yClicCell[indexTCO],PmCopy); end; // si l'image était verticale, il faut effacer la cellule en bas - if tco[XClicCell,YClicCell].FeuOriente=1 then + if tco[indextco,XClicCell[indexTCO],YClicCell[indexTCO]].FeuOriente=1 then begin - Efface_Cellule(PCanvasTCO,xClicCell,yClicCell,PmCopy); - Efface_Cellule(PCanvasTCO,xClicCell,yClicCell+1,PmCopy); + Efface_Cellule(indexTCO,PCanvasTCO[indexTCO],xClicCell[indexTCO],yClicCell[indexTCO],PmCopy); + Efface_Cellule(indexTCO,PCanvasTCO[indexTCO],xClicCell[indexTCO],yClicCell[indexTCO]+1,PmCopy); end; - tco[XClicCell,YClicCell].FeuOriente:=2; // signal orienté à 90° gauche - Affiche_TCO; - actualise; // met à jour la fenetre de config de la cellule + tco[indextco,XClicCell[indexTCO],YClicCell[indexTCO]].FeuOriente:=2; // signal orienté à 90° gauche + Affiche_TCO(indexTCO); + actualise(indexTCO); // met à jour la fenetre de config de la cellule end; procedure TFormTCO.Tourner90GClick(Sender: TObject); +var indexTCO : integer; + c : tcomponent; begin - tourne90G; + c:=popupmenu1.PopupComponent ; // imageTCO + c:=c.GetParentComponent; // scrollBox + c:=c.GetParentComponent; // formTCO + indexTCO:=index_tco(c); + tourne90G(indextco); end; -procedure tourne90D; +procedure tourne90D(indexTCO : integer); var BImage,aspect,adresse : integer; begin if actualize then exit; - BImage:=TCO[XClicCell,YClicCell].Bimage; + BImage:=tco[indextco,XClicCell[indexTCO],YClicCell[indexTCO]].Bimage; if Bimage<>50 then exit; TCO_modifie:=true; - adresse:=TCO[XClicCell,YClicCell].Adresse; + adresse:=tco[indextco,XClicCell[indexTCO],YClicCell[indexTCO]].Adresse; aspect:=feux[Index_Signal(adresse)].Aspect; if aspect=0 then aspect:=9; // ancien signal orienté orienté 90D - if tco[XClicCell,YClicCell].FeuOriente=3 then + if tco[indextco,XClicCell[indexTCO],YClicCell[indexTCO]].FeuOriente=3 then begin - Efface_Cellule(PCanvasTCO,xClicCell,yClicCell,PmCopy); - if aspect>=4 then Efface_Cellule(PCanvasTCO,xClicCell+1,yClicCell,PmCopy); + Efface_Cellule(indexTCO,PCanvasTCO[indexTCO],xClicCell[indexTCO],yClicCell[indexTCO],PmCopy); + if aspect>=4 then Efface_Cellule(indexTCO,PCanvasTCO[indexTCO],xClicCell[indexTCO]+1,yClicCell[indexTCO],PmCopy); end; // ancien signal orienté orienté 90G - if tco[XClicCell,YClicCell].FeuOriente=2 then + if tco[indextco,XClicCell[indexTCO],YClicCell[indexTCO]].FeuOriente=2 then begin - Efface_Cellule(PCanvasTCO,xClicCell,yClicCell,PmCopy); - if aspect>=4 then Efface_Cellule(PCanvasTCO,xClicCell+1,yClicCell,PmCopy); + Efface_Cellule(indexTCO,PCanvasTCO[indexTCO],xClicCell[indexTCO],yClicCell[indexTCO],PmCopy); + if aspect>=4 then Efface_Cellule(indexTCO,PCanvasTCO[indexTCO],xClicCell[indexTCO]+1,yClicCell[indexTCO],PmCopy); end; // si l'image était verticale, il faut effacer la cellule en bas - if tco[XClicCell,YClicCell].FeuOriente=1 then + if tco[indextco,XClicCell[indexTCO],YClicCell[indexTCO]].FeuOriente=1 then begin - Efface_Cellule(PCanvasTCO,xClicCell,yClicCell,PmCopy); - Efface_Cellule(PCanvasTCO,xClicCell,yClicCell+1,PmCopy); + Efface_Cellule(indexTCO,PCanvasTCO[indexTCO],xClicCell[indexTCO],yClicCell[indexTCO],PmCopy); + Efface_Cellule(indexTCO,PCanvasTCO[indexTCO],xClicCell[indexTCO],yClicCell[indexTCO]+1,PmCopy); end; - tco[XClicCell,YClicCell].FeuOriente:=3; // feu orienté à 90° droit - Affiche_TCO; - actualise; // met à jour la fenetre de config de la cellule + tco[indextco,XClicCell[indexTCO],YClicCell[indexTCO]].FeuOriente:=3; // feu orienté à 90° droit + Affiche_TCO(indexTCO); + actualise(indexTCO); // met à jour la fenetre de config de la cellule end; procedure TFormTCO.Tourner90DClick(Sender: TObject); +var c : tcomponent; + indexTCO : integer; begin - tourne90D; + c:=popupmenu1.PopupComponent ; // imageTCO + c:=c.GetParentComponent; // scrollBox + c:=c.GetParentComponent; // formTCO + indexTCO:=index_tco(c); + tourne90D(indextco); end; -procedure vertical; +procedure vertical(indexTCO : integer); var BImage ,aspect,Adresse : integer; begin if actualize then exit; - BImage:=TCO[XClicCell,YClicCell].Bimage; + BImage:=tco[indextco,XClicCell[indexTCO],YClicCell[indexTCO]].Bimage; // si c'est autre chose qu'un signal, sortir if Bimage<>50 then exit; TCO_modifie:=true; - adresse:=TCO[XClicCell,YClicCell].Adresse; + adresse:=tco[indextco,XClicCell[indexTCO],YClicCell[indexTCO]].Adresse; aspect:=feux[Index_Signal(adresse)].Aspect; if aspect=0 then aspect:=9; // effacement de l'ancien signal // ancien signal orienté orienté 90D - if tco[XClicCell,YClicCell].FeuOriente=3 then + if tco[indextco,XClicCell[indexTCO],YClicCell[indexTCO]].FeuOriente=3 then begin - Efface_Cellule(PCanvasTCO,xClicCell,yClicCell,PmCopy); + Efface_Cellule(indexTCO,PCanvasTCO[indexTCO],xClicCell[indexTCO],yClicCell[indexTCO],PmCopy); // si le signal occupe 2 cellules - if aspect>=4 then Efface_Cellule(PCanvasTCO,xClicCell+1,yClicCell,PmCopy); + if aspect>=4 then Efface_Cellule(indexTCO,PCanvasTCO[indexTCO],xClicCell[indexTCO]+1,yClicCell[indexTCO],PmCopy); end; // ancien signal orienté orienté 90G - if tco[XClicCell,YClicCell].FeuOriente=2 then + if tco[indextco,XClicCell[indexTCO],YClicCell[indexTCO]].FeuOriente=2 then begin - Efface_Cellule(PCanvasTCO,xClicCell,yClicCell,PmCopy); + Efface_Cellule(indexTCO,PCanvasTCO[indexTCO],xClicCell[indexTCO],yClicCell[indexTCO],PmCopy); // si le signal occupe 2 cellules - if aspect>=4 then Efface_Cellule(PCanvasTCO,xClicCell+1,yClicCell,PmCopy); + if aspect>=4 then Efface_Cellule(indexTCO,PCanvasTCO[indexTCO],xClicCell[indexTCO]+1,yClicCell[indexTCO],PmCopy); end; // si l'image était verticale, il faut effacer la cellule en bas - if tco[XClicCell,YClicCell].FeuOriente=1 then + if tco[indextco,XClicCell[indexTCO],YClicCell[indexTCO]].FeuOriente=1 then begin - Efface_Cellule(PCanvasTCO,xClicCell,yClicCell,PmCopy); - Efface_Cellule(PCanvasTCO,xClicCell,yClicCell+1,PmCopy); + Efface_Cellule(indexTCO,PCanvasTCO[indexTCO],xClicCell[indexTCO],yClicCell[indexTCO],PmCopy); + Efface_Cellule(indexTCO,PCanvasTCO[indexTCO],xClicCell[indexTCO],yClicCell[indexTCO]+1,PmCopy); end; - tco[XClicCell,YClicCell].FeuOriente:=1; // signal orienté à 180° - affiche_tco; - actualise; // met à jour la fenetre de config de la cellule + tco[indextco,XClicCell[indexTCO],YClicCell[indexTCO]].FeuOriente:=1; // signal orienté à 180° + affiche_tco(indexTCO); + actualise(indexTCO); // met à jour la fenetre de config de la cellule end; procedure TFormTCO.Pos_vertClick(Sender: TObject); +var c : tcomponent; begin - vertical; + c:=popupmenu1.PopupComponent ; // imageTCO + c:=c.GetParentComponent; // scrollBox + c:=c.GetParentComponent; // formTCO + vertical(index_tco(c)); end; procedure TFormTCO.TrackBarZoomChange(Sender: TObject); +var indextco : integer; begin if affevt then Affiche('TrackVBarZoomChange',clyellow); - calcul_cellules; - Affiche_TCO; - SelectionAffichee:=false; + indexTCO:=index_tco(sender); + calcul_cellules(indexTCO); + Affiche_TCO(indexTCO); + SelectionAffichee[indexTCO]:=false; tabstop:=false; defocusControl(trackbarZoom,true); { Affiche(intToSTR(FormTCO.ScrollBox.HorzScrollBar.Range),clyellow); @@ -10773,24 +11252,25 @@ end; procedure TFormTCO.EditTexteChange(Sender: TObject); +var indexTCO : integer; begin if clicTCO then exit; if affevt then Affiche('TCO.EditTextChange',clOrange); auto_tcurs:=false; // interdit le déplacement du curseur encadré du TCO (pour que les tuouches curseur s'applique au Tedit) + indexTCO:=index_TCO(sender); + PCanvasTCO[indexTCO].Brush.Color:=Clfond; + efface_entoure(indexTCO); - PCanvasTCO.Brush.Color:=Clfond; - efface_entoure; - - if Tco[XClicCell,YClicCell].texte='' then + if tco[indextco,XClicCell[indexTCO],YClicCell[indexTCO]].texte='' then begin - Tco[XClicCell,YClicCell].CoulFonte:=clTexte; - Tco[XClicCell,YClicCell].TailleFonte:=8; + tco[indextco,XClicCell[indexTCO],YClicCell[indexTCO]].CoulFonte:=clTexte; + tco[indextco,XClicCell[indexTCO],YClicCell[indexTCO]].TailleFonte:=8; end; - Tco[XClicCell,YClicCell].Texte:=EditTexte.Text; + tco[indextco,XClicCell[indexTCO],YClicCell[indexTCO]].Texte:=EditTexte.Text; formConfCellTCO.EditTexteCCTCO.Text:=EditTexte.Text; TCO_modifie:=true; -// affiche_texte(XClicCell,YClicCell); + affiche_texte(indexTCO,XClicCell[indexTCO],YClicCell[indexTCO]); end; procedure TFormTCO.ButtonSimuClick(Sender: TObject); @@ -10817,7 +11297,7 @@ begin aiguillage[Index_Aig(117)].position:=const_devie; //debugTco:=true; - zone_tco(518,514,1); + zone_tco(1,550,551,1); // zone_tco(518,515,1); //zone_tco(522,514,1); @@ -10826,16 +11306,16 @@ begin end; procedure TFormTCO.CheckPinvClick(Sender: TObject); -var Bimage : integer; +var Bimage,indexTCO : integer; begin if clicTCO then exit; if actualize then exit; - if (xClicCell=0) or (xClicCell>NbreCellX) or (yClicCell=0) or (yClicCell>NbreCelly) then exit; - Bimage:=Tco[xClicCell,yClicCell].Bimage; - if (bimage=2) or (bimage=3) or (bimage=4) or (bimage=5) or (bimage=12) or (bimage=13) - or (bimage=14) or (bimage=15) then + indexTCO:=index_TCO(sender); + if (xClicCell[indexTCO]=0) or (xClicCell[indexTCO]>NbreCellX[indexTCO]) or (yClicCell[indexTCO]=0) or (yClicCell[indexTCO]>NbreCelly[indexTCO]) then exit; + Bimage:=tco[indextco,xClicCell[indexTCO],yClicCell[indexTCO]].Bimage; + if IsAIgTCO(Bimage) then begin - TCO[xClicCell,yClicCell].inverse:=CheckPinv.checked; + tco[indextco,xClicCell[indexTCO],yClicCell[indexTCO]].inverse:=CheckPinv.checked; TCO_modifie:=true; end; end; @@ -10844,8 +11324,7 @@ procedure TFormTCO.ButtonMasquerClick(Sender: TObject); begin Panel1.Hide; ButtonAfficheBandeau.visible:=true; - ScrollBox.Height:=ClientHeight-40; - //ScrollBox.Anchors:=[akLeft,AkTop,AkRight,akBottom]; + ScrollBox.Height:=ClientHeight-32; BandeauMasque:=true; defocusControl(ButtonMasquer,true); end; @@ -10854,20 +11333,20 @@ procedure TFormTCO.ButtonAfficheBandeauClick(Sender: TObject); begin Panel1.Show; ButtonAfficheBandeau.visible:=false; - ScrollBox.Height:=ClientHeight-Panel1.Height-40; + ScrollBox.Height:=ClientHeight-Panel1.Height-ScrollBox.Top-32; BandeauMasque:=false; end; procedure TFormTCO.ImageTCODblClick(Sender: TObject); -var Bimage,Adresse,i : integer; +var Bimage,Adresse,i,indextco : integer; tjdC : boolean; begin if affEvt then Affiche('Double clic',clYellow); clicsouris:=false; - auto_tcurs:=true; // autorise le déplacement du des touches curseur encadré du TCO - - Bimage:=Tco[xClicCell,yClicCell].BImage; - Adresse:=Tco[xClicCell,yClicCell].Adresse; + auto_tcurs:=true; // autorise le déplacement du des touches curseur encadré du TCO + indexTCO:=index_TCO(sender); + Bimage:=tco[indextco,xClicCell[indexTCO],yClicCell[indexTCO]].BImage; + Adresse:=tco[indextco,xClicCell[indexTCO],yClicCell[indexTCO]].Adresse; if adresse=0 then exit; // double clic sur détecteur : inversion @@ -10875,7 +11354,7 @@ begin begin if EvtClicDet then event_detecteur(adresse,not(detecteur[adresse].etat),'') else detecteur[adresse].etat:=not(detecteur[adresse].etat); - Affiche_tco; + Affiche_tco(indexTCO); end; tjdC:=false; @@ -10883,13 +11362,12 @@ begin if (Bimage=21) or (Bimage=22) or (Bimage=23) or (Bimage=25) then begin i:=Index_aig(Adresse); + if aiguillage[i].modele=crois then exit; tjdC:=(aiguillage[i].modele=tjd) or (aiguillage[i].modele=tjs); end; // commande aiguillage - 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=24) or ((Bimage>=26) and (Bimage<=34)) or - TJDc then + if isAigTCO(Bimage) or TJDc then begin aiguille:=Adresse; i:=Index_aig(Adresse); @@ -10916,7 +11394,6 @@ begin with formPilote do begin show; - ImagePilote.top:=40;ImagePilote.left:=220; ImagePilote.Parent:=FormPilote; ImagePilote.Picture.Bitmap.TransparentMode:=tmAuto; ImagePilote.Picture.Bitmap.TransparentColor:=clblue; @@ -10930,8 +11407,8 @@ begin EditNbreFeux.Visible:=false; GroupBox1.Visible:=true; GroupBox2.Visible:=true; - efface_entoure; - SelectionAffichee:=false; + efface_entoure(indexTCO); + SelectionAffichee[indexTCO]:=false; if (feux[i].aspect>10) and (feux[i].aspect<20) then begin @@ -10955,14 +11432,16 @@ begin end; procedure TFormTCO.ComboReprChange(Sender: TObject); +var indexTCO : integer; begin if clicTCO then exit; - tco[XClicCell,YClicCell].Repr:=comborepr.ItemIndex; - efface_entoure; - SelectionAffichee:=false; + indexTCO:=index_TCO(sender); + tco[indextco,XClicCell[indexTCO],YClicCell[indexTCO]].Repr:=comborepr.ItemIndex; + efface_entoure(indexTCO); + SelectionAffichee[indexTCO]:=false; formConfCellTCO.ComboRepr.ItemIndex:=ComboRepr.ItemIndex; defocusControl(ComboRepr,true); - affiche_tco; + affiche_tco(indexTCO); end; procedure TFormTCO.ImagePalette1DragOver(Sender, Source: TObject; X, @@ -11058,103 +11537,26 @@ end; procedure TFormTCO.ImagePalette51EndDrag(Sender, Target: TObject; X, Y: Integer); begin - if not(Target is TImage) then exit; - if (Target as TImage).Name<>'ImageTCO' then exit; - if (x=0) and (y=0) then exit; - BitBlt(imageTCO.canvas.handle,oldx,oldy,LargeurCell,HauteurCell,oldbmp.canvas.handle,0,0,SRCCOPY); - efface_entoure; - TCO_modifie:=true; - Xclic:=X;YClic:=Y; - XclicCell:=Xclic div largeurCell +1; - YclicCell:=Yclic div hauteurCell +1; - efface_cellule(ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); - Dessin_51(ImageTCO.Canvas,XClicCell,YClicCell,0); - stocke_undo(1,XClicCell,YClicCell); - maj_undo(1); - tco[XClicCell,YClicCell].BImage:=51; - tco[XClicCell,YClicCell].liaisons:=0; - tco[XClicCell,YClicCell].Adresse:=0; - EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); - EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); + end_drag(51,x,y,sender,target); end; procedure TFormTCO.ImagePalette24EndDrag(Sender, Target: TObject; X, Y: Integer); begin - if not(Target is TImage) then exit; - if (Target as TImage).Name<>'ImageTCO' then exit; - if (x=0) and (y=0) then exit; - BitBlt(imageTCO.canvas.handle,oldx,oldy,LargeurCell,HauteurCell,oldbmp.canvas.handle,0,0,SRCCOPY); - efface_entoure; - imageTCO.repaint; - Xclic:=X;YClic:=Y; - XclicCell:=Xclic div largeurCell +1; - YclicCell:=Yclic div hauteurCell +1; - if not(verif_cellule(XclicCell,YclicCell,24)) then exit; - efface_cellule(ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); - TCO_modifie:=true; - - Dessin_24(ImageTCO.Canvas,XClicCell,YClicCell,0); - stocke_undo(1,XClicCell,YClicCell); - maj_undo(1); - tco[XClicCell,YClicCell].BImage:=24; - tco[XClicCell,YClicCell].liaisons:=liaisons[24]; - tco[XClicCell,YClicCell].Adresse:=0; - tco[xClicCell,YClicCell].CoulFonte:=clYellow; - EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); - EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); -end; + end_drag(24,x,y,sender,target); +end; procedure TFormTCO.ImagePalette25EndDrag(Sender, Target: TObject; X, Y: Integer); begin - if not(Target is TImage) then exit; - if (Target as TImage).Name<>'ImageTCO' then exit; - if (x=0) and (y=0) then exit; - BitBlt(imageTCO.canvas.handle,oldx,oldy,LargeurCell,HauteurCell,oldbmp.canvas.handle,0,0,SRCCOPY); - efface_entoure; - imageTCO.repaint; - Xclic:=X;YClic:=Y; - XclicCell:=Xclic div largeurCell +1; - YclicCell:=Yclic div hauteurCell +1; - if not(verif_cellule(XclicCell,YclicCell,25)) then exit; - efface_cellule(ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); - TCO_modifie:=true; - Dessin_25(ImageTCO.Canvas,XClicCell,YClicCell,0); - stocke_undo(1,XClicCell,YClicCell); - maj_undo(1); - tco[XClicCell,YClicCell].BImage:=25; - tco[XClicCell,YClicCell].liaisons:=liaisons[25]; - tco[XClicCell,YClicCell].Adresse:=0; - tco[xClicCell,YClicCell].CoulFonte:=clYellow; - EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); - EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); -end; + end_drag(25,x,y,sender,target); +end; procedure TFormTCO.ImagePalette20EndDrag(Sender, Target: TObject; X, Y: Integer); begin - if not(Target is TImage) then exit; - if (Target as TImage).Name<>'ImageTCO' then exit; - if (x=0) and (y=0) then exit; - BitBlt(imageTCO.canvas.handle,oldx,oldy,LargeurCell,HauteurCell,oldbmp.canvas.handle,0,0,SRCCOPY); - efface_entoure; - imageTCO.repaint; - Xclic:=X;YClic:=Y; - XclicCell:=Xclic div largeurCell +1; - YclicCell:=Yclic div hauteurCell +1; - if not(verif_cellule(XclicCell,YclicCell,20)) then exit; - TCO_modifie:=true; - efface_cellule(ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); - Dessin_20(ImageTCO.Canvas,XClicCell,YClicCell,0); - stocke_undo(1,XClicCell,YClicCell); - maj_undo(1); - tco[XClicCell,YClicCell].BImage:=20; - tco[XClicCell,YClicCell].liaisons:=liaisons[20]; - tco[XClicCell,YClicCell].Adresse:=0; - EditAdrElement.Text:=IntToSTR(tco[XClicCell,YClicCell].Adresse); - EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); + end_drag(20,x,y,sender,target); end; procedure TFormTCO.ImagePalette51MouseDown(Sender: TObject; @@ -11253,23 +11655,23 @@ begin accept:=true; end; -procedure change_fonte; +procedure change_fonte(indexTCO : integer); var s,ss : string; fs : TFontStyles; begin - s:='Fonte et couleur pour la cellule ('+intToSTR(xClicCell)+','+intToSTR(YClicCell)+') Texte: '; - ss:=tco[xClicCell,YClicCell].Texte; - if ss='' then s:=s+inttoSTR(tco[xClicCell,YClicCell].Adresse) else s:=s+ss; + s:='Fonte et couleur pour la cellule ('+intToSTR(xClicCell[indexTCO])+','+intToSTR(YClicCell[indexTCO])+') Texte: '; + ss:=tco[indextco,xClicCell[indexTCO],YClicCell[indexTCO]].Texte; + if ss='' then s:=s+inttoSTR(tco[indextco,xClicCell[indexTCO],YClicCell[indexTCO]].Adresse) else s:=s+ss; titre_fonte:=s; - With FormTCO do + With FormTCO[indexTCO] do begin - FontDialog1.Font.Name:=tco[XclicCell,YclicCell].Fonte; - FontDialog1.Font.Color:=tco[XclicCell,YclicCell].CoulFonte; - FontDialog1.Font.Size:=tco[XclicCell,YclicCell].taillefonte; + FontDialog1.Font.Name:=tco[indextco,XclicCell[indexTCO],YclicCell[indexTCO]].Fonte; + FontDialog1.Font.Color:=tco[indextco,XclicCell[indexTCO],YclicCell[indexTCO]].CoulFonte; + FontDialog1.Font.Size:=tco[indextco,XclicCell[indexTCO],YclicCell[indexTCO]].taillefonte; fs:=[]; - s:=tco[XclicCell,YclicCell].FontStyle; + s:=tco[indextco,XclicCell[indexTCO],YclicCell[indexTCO]].FontStyle; if pos('G',s)<>0 then fs:=fs+[fsbold]; if pos('I',s)<>0 then fs:=fs+[fsItalic]; if pos('S',s)<>0 then fs:=fs+[fsUnderline]; @@ -11278,24 +11680,24 @@ begin if FontDialog1.execute then begin - tco[XclicCell,YclicCell].Fonte:=FontDialog1.Font.Name; - tco[XclicCell,YclicCell].CoulFonte:=FontDialog1.Font.Color; - tco[XclicCell,YclicCell].taillefonte:=FontDialog1.Font.Size; + tco[indextco,XclicCell[indexTCO],YclicCell[indexTCO]].Fonte:=FontDialog1.Font.Name; + tco[indextco,XclicCell[indexTCO],YclicCell[indexTCO]].CoulFonte:=FontDialog1.Font.Color; + tco[indextco,XclicCell[indexTCO],YclicCell[indexTCO]].taillefonte:=FontDialog1.Font.Size; fs:=FontDialog1.Font.Style; s:=''; if fsBold in fs then s:=s+'G'; if fsItalic in fs then s:=s+'I'; if fsUnderline in fs then s:=s+'S'; if fsStrikeout in fs then s:=s+'B'; - tco[XclicCell,YclicCell].FontStyle:=s; - affiche_tco; + tco[indextco,XclicCell[indexTCO],YclicCell[indexTCO]].FontStyle:=s; + affiche_tco(indexTCO); end; end; end; procedure TFormTCO.ButtonFonteClick(Sender: TObject); begin - change_fonte; + change_fonte(index_tco(sender)); end; procedure TFormTCO.FontDialog1Show(Sender: TObject); @@ -11308,57 +11710,73 @@ begin SetWindowText(ColorDialog1.Handle,pchar(titre_couleur)); end; -procedure signalD; +procedure signalD(indexTCO : integer); begin if actualize then exit; - if TCO[XClicCell,YClicCell].Bimage=Id_signal then + if tco[indextco,XClicCell[indexTCO],YClicCell[indexTCO]].Bimage=Id_signal then begin - TCO[XClicCell,YClicCell].PiedFeu:=2; - Affiche_TCO; + tco[indextco,XClicCell[indexTCO],YClicCell[indexTCO]].PiedFeu:=2; + Affiche_TCO(indexTCO); TCO_modifie:=true; - actualise; // met à jour la fenetre de config de la cellule + actualise(indexTCO); // met à jour la fenetre de config de la cellule end; end; procedure TFormTCO.Signaldroitedelavoie1Click(Sender: TObject); +var c : tcomponent; begin - signalD; + c:=popupmenu1.PopupComponent ; // imageTCO + c:=c.GetParentComponent; // scrollBox + c:=c.GetParentComponent; // formTCO + signalD(index_TCO(c)); end; -procedure signalG; +procedure signalG(indexTCO : integer); begin if actualize then exit; - if TCO[XClicCell,YClicCell].Bimage=Id_signal then + if tco[indextco,XClicCell[indexTCO],YClicCell[indexTCO]].Bimage=Id_signal then begin - TCO[XClicCell,YClicCell].PiedFeu:=1; - Affiche_TCO; + tco[indextco,XClicCell[indexTCO],YClicCell[indexTCO]].PiedFeu:=1; + Affiche_TCO(indexTCO); TCO_modifie:=true; - actualise; // met à jour la fenetre de config de la cellule + actualise(indexTCO); // met à jour la fenetre de config de la cellule end; end; procedure TFormTCO.Signalgauchedelavoie1Click(Sender: TObject); +var c : tcomponent; begin - signalG; + c:=popupmenu1.PopupComponent ; // imageTCO + c:=c.GetParentComponent; // scrollBox + c:=c.GetParentComponent; // formTCO + signalG(index_tco(c)); end; procedure TFormTCO.PopupMenu1Popup(Sender: TObject); -var oriente,piedFeu : integer; +var oriente,piedFeu,indexTCO : integer; + c : Tcomponent; begin if affevt then Affiche('on popup',clyellow); - PopUpMenu1.Items[9][0].Caption:='Ligne au dessus de la '+intToSTR(YclicCell); - PopUpMenu1.Items[9][1].Caption:='Ligne en dessous de la '+intToSTR(YclicCell); - PopUpMenu1.Items[9][3].Caption:='Colonne à gauche de la '+intToSTR(XclicCell); - PopUpMenu1.Items[9][4].Caption:='Colonne à droite de la '+intToSTR(XclicCell); + indexTCO:=1; - PopUpMenu1.Items[10][0].Caption:='Ligne '+intToSTR(YclicCell); - PopUpMenu1.Items[10][1].Caption:='Colonne '+intToSTR(XclicCell); + c:=popupmenu1.PopupComponent ; // imageTCO + c:=c.GetParentComponent; // scrollBox + c:=c.GetParentComponent; // formTCO + indexTCO:=index_tco(c); + + PopUpMenu1.Items[9][0].Caption:='Ligne au dessus de la '+intToSTR(YclicCell[indexTCO]); + PopUpMenu1.Items[9][1].Caption:='Ligne en dessous de la '+intToSTR(YclicCell[indexTCO]); + PopUpMenu1.Items[9][3].Caption:='Colonne à gauche de la '+intToSTR(XclicCell[indexTCO]); + PopUpMenu1.Items[9][4].Caption:='Colonne à droite de la '+intToSTR(XclicCell[indexTCO]); + + PopUpMenu1.Items[10][0].Caption:='Ligne '+intToSTR(YclicCell[indexTCO]); + PopUpMenu1.Items[10][1].Caption:='Colonne '+intToSTR(XclicCell[indexTCO]); // grise ou non l'entrée signal du menu - if tco[XClicCell,YClicCell].Bimage=Id_signal then + if tco[indextco,XClicCell[indexTCO],YClicCell[indexTCO]].Bimage=Id_signal then begin PopUpMenu1.Items[6].Enabled:=true; - oriente:=tco[XClicCell,YClicCell].Feuoriente; + oriente:=tco[indextco,XClicCell[indexTCO],YClicCell[indexTCO]].Feuoriente; if oriente=1 then begin PopUpMenu1.Items[6][0].checked:=false; @@ -11377,7 +11795,7 @@ begin PopUpMenu1.Items[6][1].checked:=true; PopUpMenu1.Items[6][2].checked:=false; end; - PiedFeu:=tco[XClicCell,YClicCell].PiedFeu; + PiedFeu:=tco[indextco,XClicCell[indexTCO],YClicCell[indexTCO]].PiedFeu; if PiedFeu=1 then begin PopUpMenu1.Items[6][4].checked:=true; @@ -11395,240 +11813,281 @@ end; procedure TFormTCO.N3Click(Sender: TObject); +var c : Tcomponent; + indexTCO : integer; begin - actualise; + c:=popupmenu1.PopupComponent ; // imageTCO + c:=c.GetParentComponent; // scrollBox + c:=c.GetParentComponent; // formTCO + indexTCO:=index_tco(c); + FormConfCellTCO.show; FormConfCellTCO.BringToFront; + actualise(IndexTCOCourant); // actualiser après avoir affiché formConfCellTCO end; procedure TFormTCO.LigneDessusClick(Sender: TObject); - var x,y : integer; + var x,y,indexTCO : integer; + c : tcomponent; begin - if NbreCellY>=MaxCellY then exit; + c:=popupmenu1.PopupComponent ; // imageTCO + c:=c.GetParentComponent; // scrollBox + c:=c.GetParentComponent; // formTCO + indexTCO:=index_tco(c); + if NbreCellY[indexTCO]>=MaxCellY then exit; TamponAffecte:=false; - SetLength(TCO,NbreCellX+2,NbreCellY+3); // ajoute une ligne en Y - SetLength(TamponTCO,NbreCellX+2,NbreCellY+3); + SetLength(TCO[indexTCO],NbreCellX[indexTCO]+2,NbreCellY[indexTCO]+3); // ajoute une ligne en Y + init_tampon_copiercoller; - for y:=NbreCellY-1 downto YClicCell do + for y:=NbreCellY[indexTCO]-1 downto YClicCell[indexTCO] do begin - for x:=1 to NbreCellX do + for x:=1 to NbreCellX[indexTCO] do begin - tco[x,y+1]:=tco[x,y]; + tco[indextco,x,y+1]:=tco[indextco,x,y]; end; end; - for x:=1 to NbreCellX do + for x:=1 to NbreCellX[indexTCO] do begin - tco[x,YClicCell].Adresse:=0; - tco[x,YClicCell].BImage:=0; - tco[x,YClicCell].inverse:=false; - tco[x,YClicCell].repr:=0; - tco[x,YClicCell].texte:=''; - tco[x,YClicCell].fonte:=''; - tco[x,YClicCell].CouleurFond:=Clfond; - tco[x,YClicCell].PiedFeu:=0; - tco[x,YClicCell].FeuOriente:=0; + tco[indextco,x,YClicCell[indexTCO]].Adresse:=0; + tco[indextco,x,YClicCell[indexTCO]].BImage:=0; + tco[indextco,x,YClicCell[indexTCO]].inverse:=false; + tco[indextco,x,YClicCell[indexTCO]].repr:=0; + tco[indextco,x,YClicCell[indexTCO]].texte:=''; + tco[indextco,x,YClicCell[indexTCO]].fonte:=''; + tco[indextco,x,YClicCell[indexTCO]].CouleurFond:=Clfond; + tco[indextco,x,YClicCell[indexTCO]].PiedFeu:=0; + tco[indextco,x,YClicCell[indexTCO]].FeuOriente:=0; end; - inc(NbreCellY); - affiche_TCO; + inc(NbreCellY[indexTCO]); + affiche_TCO(indexTCO); end; procedure TFormTCO.LigneDessousClick(Sender: TObject); -var x,y : integer; +var x,y,indexTCO : integer; + c : tcomponent; begin - if NbreCellY>=MaxCellY then exit; + c:=popupmenu1.PopupComponent ; // imageTCO + c:=c.GetParentComponent; // scrollBox + c:=c.GetParentComponent; // formTCO + indexTCO:=index_tco(c); + if NbreCellY[indexTCO]>=MaxCellY then exit; TamponAffecte:=false; - SetLength(TCO,NbreCellX+2,NbreCellY+3); // ajoute une ligne en Y - SetLength(TamponTCO,NbreCellX+2,NbreCellY+3); // ajoute une ligne en Y + SetLength(TCO[indexTCO],NbreCellX[indexTCO]+2,NbreCellY[indexTCO]+3); // ajoute une ligne en Y + init_tampon_copiercoller; - for y:=NbreCellY downto YClicCell+1 do + for y:=NbreCellY[indexTCO] downto YClicCell[indexTCO]+1 do begin - for x:=1 to NbreCellX do tco[x,y+1]:=tco[x,y]; + for x:=1 to NbreCellX[indexTCO] do tco[indextco,x,y+1]:=tco[indextco,x,y]; end; - for x:=1 to NbreCellX do + for x:=1 to NbreCellX[indexTCO] do begin - tco[x,YClicCell+1].Adresse:=0; - tco[x,YClicCell+1].BImage:=0; - tco[x,YClicCell+1].inverse:=false; - tco[x,YClicCell+1].repr:=0; - tco[x,YClicCell+1].texte:=''; - tco[x,YClicCell+1].fonte:=''; - tco[x,YClicCell+1].Couleurfond:=Clfond; - tco[x,YClicCell+1].PiedFeu:=0; - tco[x,YClicCell+1].FeuOriente:=0; + tco[indextco,x,YClicCell[indexTCO]+1].Adresse:=0; + tco[indextco,x,YClicCell[indexTCO]+1].BImage:=0; + tco[indextco,x,YClicCell[indexTCO]+1].inverse:=false; + tco[indextco,x,YClicCell[indexTCO]+1].repr:=0; + tco[indextco,x,YClicCell[indexTCO]+1].texte:=''; + tco[indextco,x,YClicCell[indexTCO]+1].fonte:=''; + tco[indextco,x,YClicCell[indexTCO]+1].Couleurfond:=Clfond; + tco[indextco,x,YClicCell[indexTCO]+1].PiedFeu:=0; + tco[indextco,x,YClicCell[indexTCO]+1].FeuOriente:=0; end; - inc(NbreCellY); - affiche_TCO; + inc(NbreCellY[indexTCO]); + affiche_TCO(indexTCO); end; procedure TFormTCO.SupprimeLigneClick(Sender: TObject); -var x,y : integer; +var x,y,indexTCO : integer; + c : tcomponent; begin - if NbreCellY<=1 then exit; + c:=popupmenu1.PopupComponent ; // imageTCO + c:=c.GetParentComponent; // scrollBox + c:=c.GetParentComponent; // formTCO + indexTCO:=index_tco(c); + if NbreCellY[indexTCO]<=1 then exit; TamponAffecte:=false; // tampon de sauvegarde - TamponTCO_Org.NbreCellX:=NbreCellX; - TamponTCO_Org.NbreCellY:=NbreCellY; + TamponTCO_Org.NbreCellX:=NbreCellX[indexTCO]; + TamponTCO_Org.NbreCellY:=NbreCellY[indexTCO]; TamponTCO_Org.x1:=1; - TamponTCO_Org.x2:=NbreCellX; + TamponTCO_Org.x2:=NbreCellX[indexTCO]; TamponTCO_Org.y1:=1; - TamponTCO_Org.y2:=NbreCellY; + TamponTCO_Org.y2:=NbreCellY[indexTCO]; xcoupe:=1;ycoupe:=1; for y:=TamponTCO_Org.y1 to TamponTCO_Org.y2 do for x:=TamponTCO_Org.x1 to TamponTCO_Org.x2 do begin //Affiche(intToSTR(x)+' '+intToSTR(y),clyellow); - tamponTCO[x,y]:=tco[x,y]; + tampontco[x,y]:=tco[indextco,x,y]; end; //TamponAffecte:=true; // supression ligne - for y:=YClicCell to NbreCellY-1 do + for y:=YClicCell[indexTCO] to NbreCellY[indexTCO]-1 do begin - for x:=1 to NbreCellX do tco[x,y]:=tco[x,y+1]; + for x:=1 to NbreCellX[indexTCO] do tco[indextco,x,y]:=tco[indextco,x,y+1]; end; - for x:=1 to NbreCellX do + for x:=1 to NbreCellX[indexTCO] do begin - tco[x,NbreCellY].Adresse:=0; - tco[x,NbreCellY].BImage:=0; - tco[x,NbreCellY].inverse:=false; - tco[x,NbreCellY].repr:=0; - tco[x,NbreCellY].texte:=''; - tco[x,NbreCellY].fonte:=''; - tco[x,NbreCellY].Couleurfond:=Clfond; - tco[x,NbreCellY].PiedFeu:=0; - tco[x,NbreCellY].FeuOriente:=0; + tco[indextco,x,NbreCellY[indexTCO]].Adresse:=0; + tco[indextco,x,NbreCellY[indexTCO]].BImage:=0; + tco[indextco,x,NbreCellY[indexTCO]].inverse:=false; + tco[indextco,x,NbreCellY[indexTCO]].repr:=0; + tco[indextco,x,NbreCellY[indexTCO]].texte:=''; + tco[indextco,x,NbreCellY[indexTCO]].fonte:=''; + tco[indextco,x,NbreCellY[indexTCO]].Couleurfond:=Clfond; + tco[indextco,x,NbreCellY[indexTCO]].PiedFeu:=0; + tco[indextco,x,NbreCellY[indexTCO]].FeuOriente:=0; + tco[indextco,x,NbreCellY[indexTCO]].Buttoir:=0; + tco[indextco,x,NbreCellY[indexTCO]].epaisseurs:=0; + tco[indextco,x,NbreCellY[indexTCO]].Pont:=0; end; - dec(NbreCellY); - SetLength(TCO,NbreCellX+2,NbreCellY+2); // ajuste la taille du tableau - SetLength(TamponTCO,NbreCellX+2,NbreCellY+2); // ajoute une ligne en Y + dec(NbreCellY[indexTCO]); + SetLength(TCO[indexTCO],NbreCellX[indexTCO]+2,NbreCellY[indexTCO]+2); // ajuste la taille du tableau - affiche_TCO; + affiche_TCO(indexTCO); end; procedure TFormTCO.Colonnegauche1Click(Sender: TObject); - var x,y : integer; + var x,y,indexTCO : integer; + c : tcomponent; begin - if NbreCellX>=MaxCellX then exit; + c:=popupmenu1.PopupComponent ; // imageTCO + c:=c.GetParentComponent; // scrollBox + c:=c.GetParentComponent; // formTCO + indexTCO:=index_tco(c); + if NbreCellX[indexTCO]>=MaxCellX then exit; TamponAffecte:=false; - SetLength(TCO,NbreCellX+3,NbreCellY+2); // ajoute taille X - SetLength(TamponTCO,NbreCellX+3,NbreCellY+2); + SetLength(TCO[indexTCO],NbreCellX[indexTCO]+3,NbreCellY[indexTCO]+2); // ajoute taille X + init_tampon_copiercoller; - for x:=NbreCellX downto XClicCell do + for x:=NbreCellX[indexTCO] downto XClicCell[indexTCO] do begin - for y:=1 to NbreCellY do tco[x+1,y]:=tco[x,y]; + for y:=1 to NbreCellY[indexTCO] do tco[indextco,x+1,y]:=tco[indextco,x,y]; end; - for y:=1 to NbreCellY do + for y:=1 to NbreCellY[indexTCO] do begin - tco[XClicCell,y].Adresse:=0; - tco[XClicCell,y].BImage:=0; - tco[XClicCell,y].inverse:=false; - tco[XClicCell,y].repr:=0; - tco[XClicCell,y].texte:=''; - tco[XClicCell,y].fonte:=''; - tco[XClicCell,y].Couleurfond:=Clfond; - tco[XClicCell,y].PiedFeu:=0; - tco[XClicCell,y].FeuOriente:=0; + tco[indextco,XClicCell[indexTCO],y].Adresse:=0; + tco[indextco,XClicCell[indexTCO],y].BImage:=0; + tco[indextco,XClicCell[indexTCO],y].inverse:=false; + tco[indextco,XClicCell[indexTCO],y].repr:=0; + tco[indextco,XClicCell[indexTCO],y].texte:=''; + tco[indextco,XClicCell[indexTCO],y].fonte:=''; + tco[indextco,XClicCell[indexTCO],y].Couleurfond:=Clfond; + tco[indextco,XClicCell[indexTCO],y].PiedFeu:=0; + tco[indextco,XClicCell[indexTCO],y].FeuOriente:=0; end; - inc(NbreCellX); - affiche_TCO; + inc(NbreCellX[indexTCO]); + affiche_TCO(indexTCO); end; procedure TFormTCO.Colonnedroite1Click(Sender: TObject); - var x,y : integer; + var x,y,indexTCO : integer; + c : tcomponent; begin - if NbreCellX>=MaxCellX then exit; + c:=popupmenu1.PopupComponent ; // imageTCO + c:=c.GetParentComponent; // scrollBox + c:=c.GetParentComponent; // formTCO + indexTCO:=index_tco(c); + if NbreCellX[indexTCO]>=MaxCellX then exit; TamponAffecte:=false; - SetLength(TCO,NbreCellX+3,NbreCellY+2); // ajoute taille X - SetLength(TamponTCO,NbreCellX+3,NbreCellY+2); // ajoute taille X - for x:=NbreCellX downto XClicCell+1 do + SetLength(TCO[indextco],NbreCellX[indexTCO]+3,NbreCellY[indexTCO]+2); // ajoute taille X + init_tampon_copiercoller; + + for x:=NbreCellX[indexTCO] downto XClicCell[indexTCO]+1 do begin - for y:=1 to NbreCellY do tco[x+1,y]:=tco[x,y]; + for y:=1 to NbreCellY[indexTCO] do tco[indextco,x+1,y]:=tco[indextco,x,y]; end; - for y:=1 to NbreCellY do + for y:=1 to NbreCellY[indexTCO] do begin - tco[XClicCell+1,y].Adresse:=0; - tco[XClicCell+1,y].BImage:=0; - tco[XClicCell+1,y].inverse:=false; - tco[XClicCell+1,y].repr:=0; - tco[XClicCell+1,y].texte:=''; - tco[XClicCell+1,y].fonte:=''; - tco[XClicCell+1,y].Couleurfond:=Clfond; - tco[XClicCell+1,y].PiedFeu:=0; - tco[XClicCell+1,y].FeuOriente:=0; + tco[indextco,XClicCell[indexTCO]+1,y].Adresse:=0; + tco[indextco,XClicCell[indexTCO]+1,y].BImage:=0; + tco[indextco,XClicCell[indexTCO]+1,y].inverse:=false; + tco[indextco,XClicCell[indexTCO]+1,y].repr:=0; + tco[indextco,XClicCell[indexTCO]+1,y].texte:=''; + tco[indextco,XClicCell[indexTCO]+1,y].fonte:=''; + tco[indextco,XClicCell[indexTCO]+1,y].Couleurfond:=Clfond; + tco[indextco,XClicCell[indexTCO]+1,y].PiedFeu:=0; + tco[indextco,XClicCell[indexTCO]+1,y].FeuOriente:=0; end; - inc(NbreCellX); - affiche_TCO; + inc(NbreCellX[indexTCO]); + affiche_TCO(indexTCO); end; // suppression colonne procedure TFormTCO.ColonneClick(Sender: TObject); -var x,y : integer; +var x,y,indexTCO : integer; + c : tcomponent; begin - if NbreCellX<=1 then exit; + c:=popupmenu1.PopupComponent ; // imageTCO + c:=c.GetParentComponent; // scrollBox + c:=c.GetParentComponent; // formTCO + indexTCO:=index_tco(c); + if NbreCellX[indexTCO]<=1 then exit; TamponAffecte:=false; // tampon de sauvegarde - TamponTCO_Org.NbreCellX:=NbreCellX; - TamponTCO_Org.NbreCellY:=NbreCellY; + TamponTCO_Org.NbreCellX:=NbreCellX[indexTCO]; + TamponTCO_Org.NbreCellY:=NbreCellY[indexTCO]; TamponTCO_Org.x1:=1; - TamponTCO_Org.x2:=NbreCellX; + TamponTCO_Org.x2:=NbreCellX[indexTCO]; TamponTCO_Org.y1:=1; - TamponTCO_Org.y2:=NbreCellY; + TamponTCO_Org.y2:=NbreCellY[indexTCO]; xcoupe:=1;ycoupe:=1; for y:=TamponTCO_Org.y1 to TamponTCO_Org.y2 do for x:=TamponTCO_Org.x1 to TamponTCO_Org.x2 do - tamponTCO[x,y]:=tco[x,y]; + tampontco[x,y]:=tco[indextco,x,y]; // TamponAffecte:=true; // supression colonne - for x:=xClicCell to NbreCellx-1 do + for x:=xClicCell[indexTCO] to NbreCellx[indexTCO]-1 do begin - for y:=1 to NbreCelly do + for y:=1 to NbreCelly[indexTCO] do begin - tco[x,y]:=tco[x+1,y]; + tco[indextco,x,y]:=tco[indextco,x+1,y]; end; end; - for y:=1 to NbreCellY do + for y:=1 to NbreCellY[indexTCO] do begin - tco[NbreCellx,y].Adresse:=0; - tco[NbreCellx,y].BImage:=0; - tco[NbreCellx,y].inverse:=false; - tco[NbreCellx,y].repr:=0; - tco[NbreCellx,y].texte:=''; - tco[NbreCellx,y].fonte:=''; - tco[NbreCellx,y].CouleurFond:=Clfond; - tco[NbreCellx,y].PiedFeu:=0; - tco[NbreCellx,y].FeuOriente:=0; + tco[indextco,NbreCellx[indexTCO],y].Adresse:=0; + tco[indextco,NbreCellx[indexTCO],y].BImage:=0; + tco[indextco,NbreCellx[indexTCO],y].inverse:=false; + tco[indextco,NbreCellx[indexTCO],y].repr:=0; + tco[indextco,NbreCellx[indexTCO],y].texte:=''; + tco[indextco,NbreCellx[indexTCO],y].fonte:=''; + tco[indextco,NbreCellx[indexTCO],y].CouleurFond:=Clfond; + tco[indextco,NbreCellx[indexTCO],y].PiedFeu:=0; + tco[indextco,NbreCellx[indexTCO],y].FeuOriente:=0; end; - dec(NbreCellX); - SetLength(TCO,NbreCellX+2,NbreCellY+2); // ajuste taille - SetLength(TamponTCO,NbreCellX+2,NbreCellY+2); // ajuste taille + dec(NbreCellX[indexTCO]); + SetLength(TCO[indexTCO],NbreCellX[indexTCO]+2,NbreCellY[indexTCO]+2); // ajuste taille - affiche_TCO; + affiche_TCO(indexTCO); end; procedure TFormTCO.buttonRazClick(Sender: TObject); -var x,y : integer; +var x,y,indexTCO : integer; begin - for x:=1 to NbreCellx do - for y:=1 to NbreCelly do tco[x,y].mode:=0; - Affiche_TCO; + indexTCO:=index_tco(sender); + for x:=1 to NbreCellx[indexTCO] do + for y:=1 to NbreCelly[indexTCO] do tco[indextco,x,y].mode:=0; + Affiche_TCO(indexTCO); defocusControl(buttonRaz,true); end; procedure TFormTCO.FormMouseWheel(Sender: TObject; Shift: TShiftState; WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean); -var i,maxi : integer; +var i,maxi,indexTCO : integer; begin if affevt then Affiche('FormMouseWheel',clOrange); - i:=FormTCO.TrackBarZoom.Position; + indexTCO:=index_tco(sender); + i:=FormTCO[indexTCO].TrackBarZoom.Position; if WheelDelta>0 then begin if (i<=ZoomMin) then begin - FormTCO.TrackBarZoom.Position:=ZoomMin; + FormTCO[indexTCO].TrackBarZoom.Position:=ZoomMin; exit; end; dec(i); @@ -11637,56 +12096,57 @@ begin begin if (i>=ZoomMax) then begin - FormTCO.TrackBarZoom.Position:=ZoomMax; + FormTCO[indexTCO].TrackBarZoom.Position:=ZoomMax; exit; end; inc(i); end; // positionner la trackbar zoom - FormTCO.TrackBarZoom.Position:=i; - calcul_cellules; - Affiche_TCO; - SelectionAffichee:=false; + FormTCO[indexTCO].TrackBarZoom.Position:=i; + calcul_cellules(indexTCO); + Affiche_TCO(indexTCO); + SelectionAffichee[indexTCO]:=false; //positionner les trackbar du scrollbox sur la position cliquée de la souris {GetCursorPos(Position); - x:=position.x div largeurCell +1 ; - y:=position.Y div HauteurCell +1 ; + x:=position.x div LargeurCell[indexTCO] +1 ; + y:=position.Y div hauteurCell[indexTCO] +1 ; } maxi:=ScrollBox.HorzScrollBar.Range-ScrollBox.ClientWidth; - i:=round(xClicCell*maxi/NbreCellx); + i:=round(xClicCell[indexTCO]*maxi/NbreCellx[indexTCO]); ScrollBox.HorzScrollBar.position:=i; maxi:=ScrollBox.VertScrollBar.Range-ScrollBox.ClientHeight; - i:=round(yClicCell*maxi/NbreCelly); + i:=round(yClicCell[indexTCO]*maxi/NbreCelly[indexTCO]); ScrollBox.VertScrollBar.position:=i; end; procedure TFormTCO.ButtonCalibrageClick(Sender: TObject); -var x,y : integer; +var indexTCO,x,y : integer; begin x:=0; y:=0; - calcul_reduction(frxGlob,fryGlob,LargeurCell,HauteurCell,ZoomMax,ZoomMax); + indexTCO:=index_tco(sender); + calcul_reduction(frxGlob[indexTCO],fryGlob[indexTCO],LargeurCell[indexTCO],hauteurCell[indexTCO],ZoomMax,ZoomMax); with imageTCO.Canvas do begin pen.color:=clyellow; - moveTo( round(x),round(y*frYGlob) ); - LineTo( round((x+LargeurCell)),round(y+HauteurCell*ratioC/10) ); + moveTo( round(x),round(y*fryGlob[indexTCO]) ); + LineTo( round((x+LargeurCell[indexTCO])),round(y+hauteurCell[indexTCO]*ratioC/10) ); end; - Affiche(formatfloat('0.000000',fryglob),clyellow); + Affiche(formatfloat('0.000000',fryGlob[indexTCO]),clyellow); end; -procedure change_couleur_fond; +procedure change_couleur_fond(indexTCO : integer); var cs : string; x,y,xmini,ymini,xmaxi,ymaxi : integer; modeselection : boolean; begin - xmini:=(XminiSel div LargeurCell) +1; - ymini:=(YminiSel div HauteurCell) +1; - xmaxi:=(XmaxiSel div LargeurCell) +1; - ymaxi:=(YmaxiSel div HauteurCell) +1; + xmini:=(XminiSel div LargeurCell[indexTCO]) +1; + ymini:=(YminiSel div hauteurCell[indexTCO]) +1; + xmaxi:=(XmaxiSel div LargeurCell[indexTCO]) +1; + ymaxi:=(YmaxiSel div hauteurCell[indexTCO]) +1; modeSelection:=xmini0) or not(Bimage in[0..22,24..25,50,51]) then + if (erreur<>0) or not(Bimage in[0..22,24..25,id_signal,id_quai,id_action]) then begin exit; end; TCO_modifie:=true; - tco[XClicCell,YClicCell].Bimage:=Bimage; - formConfCellTCO.EditTypeImage.Text:=intToSTR(Bimage); - actualise; // pour mise à jour de l'image de la fenetre FormConfCellTCO - efface_entoure; - affiche_cellule(XClicCell,YClicCell); + + tco[indextco,XClicCell[indexTCO],YClicCell[indexTCO]].Bimage:=Bimage; + //formConfCellTCO.EditTypeImage.Text:=intToSTR(Bimage); + //actualise(indexTCO); // pour mise à jour de l'image de la fenetre FormConfCellTCO + efface_entoure(indexTCO); + affiche_cellule(indexTCO,XClicCell[indexTCO],YClicCell[indexTCO]); end; procedure TFormTCO.outslectionner1Click(Sender: TObject); +var c: tcomponent; + indextco : integer; begin + c:=popupmenu1.PopupComponent ; // imageTCO + c:=c.GetParentComponent; // scrollBox + c:=c.GetParentComponent; // formTCO + indexTCO:=index_tco(c); xminiSel:=0; yminiSel:=0; - xMaxiSel:=(NbreCellX-1)*LargeurCell; - yMaxiSel:=(NbreCellY-1)*HauteurCell; - rAncien:=rect(xminiSel,YminiSel,xmaxiSel+LargeurCell,YMaxiSel+HauteurCell); + xMaxiSel:=(NbreCellX[indexTCO]-1)*LargeurCell[indexTCO]; + yMaxiSel:=(NbreCellY[indexTCO]-1)*hauteurCell[indexTCO]; + rAncien:=rect(xminiSel,YminiSel,xmaxiSel+LargeurCell[indexTCO],YMaxiSel+hauteurCell[indexTCO]); - SelectionAffichee:=true; - with imageTCO.Canvas do + SelectionAffichee[indexTCO]:=true; + with formTCO[indexTCO].imageTCO.Canvas do begin Pen.Mode:=PmXor; Pen.color:=clGrille; @@ -11787,19 +12256,21 @@ begin end; procedure TFormTCO.ButtonDessinerClick(Sender: TObject); +var indexTCO : integer; begin - if not(modetrace) then + indexTCO:=index_tco(sender); + if not(modetrace[indexTCO]) then begin - modetrace:=true; + modetrace[indexTCO]:=true; indexTrace:=0; traceXY[1].x:=0; traceXY[1].y:=0; traceXY[2].x:=0; traceXY[2].x:=0; - FormTCO.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:='** 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; end - else stop_modetrace; + else stop_modetrace(indexTCO); defocusControl(buttonDessiner,true); end; @@ -11813,28 +12284,7 @@ end; procedure TFormTCO.ImagePalette26EndDrag(Sender, Target: TObject; X, Y: Integer); begin - if not(Target is TImage) then exit; - if (Target as TImage).Name<>'ImageTCO' then exit; - if (x=0) and (y=0) then exit; - BitBlt(imageTCO.canvas.handle,oldx,oldy,LargeurCell,HauteurCell,oldbmp.canvas.handle,0,0,SRCCOPY); - efface_entoure; - imageTCO.repaint; - Xclic:=X;YClic:=Y; - XclicCell:=Xclic div largeurCell +1; - YclicCell:=Yclic div hauteurCell +1; - if not(verif_cellule(XclicCell,YclicCell,26)) then exit; - efface_cellule(ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); - TCO_modifie:=true; - - Dessin_26(ImageTCO.Canvas,XClicCell,YClicCell,0); - stocke_undo(1,XClicCell,YClicCell); - maj_undo(1); - tco[XClicCell,YClicCell].BImage:=26; - tco[XClicCell,YClicCell].liaisons:=liaisons[26]; - tco[XClicCell,YClicCell].Adresse:=0; - tco[xClicCell,YClicCell].CoulFonte:=clYellow; - EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); - EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); + end_drag(26,x,y,Sender,Target); end; procedure TFormTCO.ImagePalette26MouseDown(Sender: TObject; @@ -11846,27 +12296,7 @@ end; procedure TFormTCO.ImagePalette23EndDrag(Sender, Target: TObject; X, Y: Integer); begin - if not(Target is TImage) then exit; - if (Target as TImage).Name<>'ImageTCO' then exit; - if (x=0) and (y=0) then exit; - BitBlt(imageTCO.canvas.handle,oldx,oldy,LargeurCell,HauteurCell,oldbmp.canvas.handle,0,0,SRCCOPY); - efface_entoure; - imageTCO.repaint; - Xclic:=X;YClic:=Y; - XclicCell:=Xclic div largeurCell +1; - YclicCell:=Yclic div hauteurCell +1; - if not(verif_cellule(XclicCell,YclicCell,23)) then exit; - efface_cellule(ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); - TCO_modifie:=true; - Dessin_23(ImageTCO.Canvas,XClicCell,YClicCell,0); - stocke_undo(1,XClicCell,YClicCell); - maj_undo(1); - tco[XClicCell,YClicCell].BImage:=23; - tco[XClicCell,YClicCell].liaisons:=liaisons[23]; - tco[XClicCell,YClicCell].Adresse:=0; - tco[xClicCell,YClicCell].CoulFonte:=clYellow; - EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); - EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); + end_drag(23,x,y,Sender,Target); end; procedure TFormTCO.ImagePalette23DragOver(Sender, Source: TObject; X, @@ -11896,28 +12326,7 @@ end; procedure TFormTCO.ImagePalette27EndDrag(Sender, Target: TObject; X, Y: Integer); begin - if not(Target is TImage) then exit; - if (Target as TImage).Name<>'ImageTCO' then exit; - if (x=0) and (y=0) then exit; - BitBlt(imageTCO.canvas.handle,oldx,oldy,LargeurCell,HauteurCell,oldbmp.canvas.handle,0,0,SRCCOPY); - efface_entoure; - imageTCO.repaint; - Xclic:=X;YClic:=Y; - XclicCell:=Xclic div largeurCell +1; - YclicCell:=Yclic div hauteurCell +1; - if not(verif_cellule(XclicCell,YclicCell,27)) then exit; - efface_cellule(ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); - TCO_modifie:=true; - - Dessin_27(ImageTCO.Canvas,XClicCell,YClicCell,0); - stocke_undo(1,XClicCell,YClicCell); - maj_undo(1); - tco[XClicCell,YClicCell].BImage:=27; - tco[XClicCell,YClicCell].liaisons:=liaisons[27]; - tco[XClicCell,YClicCell].Adresse:=0; - tco[xClicCell,YClicCell].CoulFonte:=clYellow; - EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); - EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); + end_drag(27,x,y,Sender,Target); end; procedure TFormTCO.ImagePalette28DragOver(Sender, Source: TObject; X, @@ -11929,29 +12338,7 @@ end; procedure TFormTCO.ImagePalette28EndDrag(Sender, Target: TObject; X, Y: Integer); begin - if not(Target is TImage) then exit; - if (Target as TImage).Name<>'ImageTCO' then exit; - if (x=0) and (y=0) then exit; - BitBlt(imageTCO.canvas.handle,oldx,oldy,LargeurCell,HauteurCell,oldbmp.canvas.handle,0,0,SRCCOPY); - efface_entoure; - imageTCO.repaint; - Xclic:=X;YClic:=Y; - XclicCell:=Xclic div largeurCell +1; - YclicCell:=Yclic div hauteurCell +1; - if not(verif_cellule(XclicCell,YclicCell,28)) then exit; - efface_cellule(ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); - TCO_modifie:=true; - - Dessin_28(ImageTCO.Canvas,XClicCell,YClicCell,0); - stocke_undo(1,XClicCell,YClicCell); - maj_undo(1); - tco[XClicCell,YClicCell].BImage:=28; - tco[XClicCell,YClicCell].liaisons:=liaisons[28]; - tco[XClicCell,YClicCell].Adresse:=0; - tco[xClicCell,YClicCell].CoulFonte:=clYellow; - EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); - EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); - + end_drag(28,x,y,Sender,Target); end; procedure TFormTCO.ImagePalette28MouseDown(Sender: TObject; @@ -11969,27 +12356,7 @@ end; procedure TFormTCO.ImagePalette29EndDrag(Sender, Target: TObject; X, Y: Integer); begin - if not(Target is TImage) then exit; - if (Target as TImage).Name<>'ImageTCO' then exit; - if (x=0) and (y=0) then exit; - BitBlt(imageTCO.canvas.handle,oldx,oldy,LargeurCell,HauteurCell,oldbmp.canvas.handle,0,0,SRCCOPY); - efface_entoure; - imageTCO.repaint; - Xclic:=X;YClic:=Y; - XclicCell:=Xclic div largeurCell +1; - YclicCell:=Yclic div hauteurCell +1; - if not(verif_cellule(XclicCell,YclicCell,29)) then exit; - efface_cellule(ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); - TCO_modifie:=true; - Dessin_29(ImageTCO.Canvas,XClicCell,YClicCell,0); - stocke_undo(1,XClicCell,YClicCell); - maj_undo(1); - tco[XClicCell,YClicCell].BImage:=29; - tco[XClicCell,YClicCell].liaisons:=liaisons[29]; - tco[XClicCell,YClicCell].Adresse:=0; - tco[xClicCell,YClicCell].CoulFonte:=clYellow; - EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); - EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); + end_drag(29,x,y,Sender,Target); end; procedure TFormTCO.ImagePalette29MouseDown(Sender: TObject; @@ -12007,27 +12374,7 @@ end; procedure TFormTCO.ImagePalette32EndDrag(Sender, Target: TObject; X, Y: Integer); begin - if not(Target is TImage) then exit; - if (Target as TImage).Name<>'ImageTCO' then exit; - if (x=0) and (y=0) then exit; - BitBlt(imageTCO.canvas.handle,oldx,oldy,LargeurCell,HauteurCell,oldbmp.canvas.handle,0,0,SRCCOPY); - efface_entoure; - imageTCO.repaint; - Xclic:=X;YClic:=Y; - XclicCell:=Xclic div largeurCell +1; - YclicCell:=Yclic div hauteurCell +1; - if not(verif_cellule(XclicCell,YclicCell,32)) then exit; - efface_cellule(ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); - TCO_modifie:=true; - Dessin_32(ImageTCO.Canvas,XClicCell,YClicCell,0); - stocke_undo(1,XClicCell,YClicCell); - maj_undo(1); - tco[XClicCell,YClicCell].BImage:=32; - tco[XClicCell,YClicCell].liaisons:=liaisons[32]; - tco[XClicCell,YClicCell].Adresse:=0; - tco[xClicCell,YClicCell].CoulFonte:=clYellow; - EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); - EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); + end_drag(32,x,y,Sender,Target); end; procedure TFormTCO.ImagePalette32MouseDown(Sender: TObject; @@ -12045,27 +12392,7 @@ end; procedure TFormTCO.ImagePalette33EndDrag(Sender, Target: TObject; X, Y: Integer); begin - if not(Target is TImage) then exit; - if (Target as TImage).Name<>'ImageTCO' then exit; - if (x=0) and (y=0) then exit; - BitBlt(imageTCO.canvas.handle,oldx,oldy,LargeurCell,HauteurCell,oldbmp.canvas.handle,0,0,SRCCOPY); - efface_entoure; - imageTCO.repaint; - Xclic:=X;YClic:=Y; - XclicCell:=Xclic div largeurCell +1; - YclicCell:=Yclic div hauteurCell +1; - if not(verif_cellule(XclicCell,YclicCell,33)) then exit; - efface_cellule(ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); - TCO_modifie:=true; - Dessin_33(ImageTCO.Canvas,XClicCell,YClicCell,0); - stocke_undo(1,XClicCell,YClicCell); - maj_undo(1); - tco[XClicCell,YClicCell].BImage:=33; - tco[XClicCell,YClicCell].liaisons:=liaisons[33]; - tco[XClicCell,YClicCell].Adresse:=0; - tco[xClicCell,YClicCell].CoulFonte:=clYellow; - EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); - EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); + end_drag(33,x,y,Sender,Target); end; procedure TFormTCO.ImagePalette33MouseDown(Sender: TObject; @@ -12083,27 +12410,7 @@ end; procedure TFormTCO.ImagePalette34EndDrag(Sender, Target: TObject; X, Y: Integer); begin - if not(Target is TImage) then exit; - if (Target as TImage).Name<>'ImageTCO' then exit; - if (x=0) and (y=0) then exit; - BitBlt(imageTCO.canvas.handle,oldx,oldy,LargeurCell,HauteurCell,oldbmp.canvas.handle,0,0,SRCCOPY); - efface_entoure; - imageTCO.repaint; - Xclic:=X;YClic:=Y; - XclicCell:=Xclic div largeurCell +1; - YclicCell:=Yclic div hauteurCell +1; - if not(verif_cellule(XclicCell,YclicCell,34)) then exit; - efface_cellule(ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); - TCO_modifie:=true; - Dessin_34(ImageTCO.Canvas,XClicCell,YClicCell,0); - stocke_undo(1,XClicCell,YClicCell); - maj_undo(1); - tco[XClicCell,YClicCell].BImage:=34; - tco[XClicCell,YClicCell].liaisons:=liaisons[34]; - tco[XClicCell,YClicCell].Adresse:=0; - tco[xClicCell,YClicCell].CoulFonte:=clYellow; - EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); - EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); + end_drag(34,x,y,Sender,Target); end; procedure TFormTCO.ImagePalette34MouseDown(Sender: TObject; @@ -12118,5 +12425,34 @@ begin end; +procedure TFormTCO.ImagePalette52DragOver(Sender, Source: TObject; X, + Y: Integer; State: TDragState; var Accept: Boolean); +begin + accept:=true; +end; + +procedure TFormTCO.ImagePalette52EndDrag(Sender, Target: TObject; X, + Y: Integer); +begin + end_drag(id_action,x,y,sender,target); +end; + +procedure TFormTCO.ImagePalette52MouseDown(Sender: TObject; + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + debut_drag(ImagePalette52); +end; + +procedure TFormTCO.ButtonAffSCClick(Sender: TObject); +begin + with formprinc do + begin + windowState:=wsNormal; //Maximized; + show; + BringToFront; + end; +end; + end. + diff --git a/Unit_Pilote_aig.pas b/Unit_Pilote_aig.pas index 3fa1357..19e7392 100644 --- a/Unit_Pilote_aig.pas +++ b/Unit_Pilote_aig.pas @@ -92,7 +92,8 @@ end; procedure TFormAig.ButtonDevClick(Sender: TObject); var s : string; begin - efface_entoure;SelectionAffichee:=false; + efface_entoure(indexTCOCourant); + SelectionAffichee[indexTCOCourant]:=false; pilote_acc(aiguille,const_devie,aigP); s:='accessoire '+IntToSTR(aiguille)+' dévié'; Affiche(s,clyellow); @@ -102,7 +103,8 @@ end; procedure TFormAig.ButtonDroitClick(Sender: TObject); var s : string; begin - efface_entoure;SelectionAffichee:=false; + efface_entoure(indexTCOcourant); + SelectionAffichee[indexTCOcourant]:=false; pilote_acc(aiguille,const_droit,aigP); s:='accessoire '+IntToSTR(aiguille)+' droit'; Affiche(s,clyellow); @@ -112,7 +114,8 @@ end; procedure TFormAig.ButtonDev2Click(Sender: TObject); var s : string; begin - efface_entoure;SelectionAffichee:=false; + efface_entoure(indexTCOcourant); + SelectionAffichee[indexTCOcourant]:=false; pilote_acc(aiguille2,const_devie,aigP); s:='accessoire '+IntToSTR(aiguille2)+' dévié'; Affiche(s,clyellow); @@ -121,8 +124,10 @@ end; procedure TFormAig.ButtonDroit2Click(Sender: TObject); var s : string; + index : integer; begin - efface_entoure;SelectionAffichee:=false; + efface_entoure(indexTCOCOurant); + SelectionAffichee[indexTCOcourant]:=false; pilote_acc(aiguille2,const_droit,aigP); s:='accessoire '+IntToSTR(aiguille2)+' droit'; Affiche(s,clyellow); diff --git a/Unitplace.pas b/Unitplace.pas index bfb707c..1b0b9db 100644 --- a/Unitplace.pas +++ b/Unitplace.pas @@ -132,7 +132,7 @@ begin end; procedure TFormPlace.ButtonPlaceClick(Sender: TObject); -var Suiv,prec,detect,erreur,i,it : integer; +var Suiv,prec,detect,erreur,i,it,indexTCO : integer; s,Ssuiv,NomTrain : string; begin if cdm_connecte then @@ -223,9 +223,10 @@ begin end; end; - if formTCO.Showing then + indexTCO:=1; + if formTCO[indexTCO].Showing then begin - affiche_tco; + affiche_tco(1); end; maj_feux(true); maj_feux(true); diff --git a/tco.cfg b/tco.cfg index bacbfd8..e5c7575 100644 --- a/tco.cfg +++ b/tco.cfg @@ -1,5 +1,5 @@ -/ Définitions TCO version 7.2 -CoulFond=202050 +/ Définitions TCO version 8.0 +CoulFond=000040 CoulVoies=0077FF CoulAllume=00FFFF CoulGrille=404040 @@ -10,22 +10,23 @@ CoulCanton=00FFFF ModeCouleurCanton=1 AvecGrille=0 Graphisme=2 +Ecran=1 EvtClicDet=1 Matrice=39,13 Ratio=10 /Matrice TCO [Matrice] -/ couleur fond,adresse,image,inversion aiguillage,Orientation du signal, pied du signal , [texte], representation, fonte, taille fonte, couleur fonte, style, épaisseurs -(000040,358,50,0,1,1,,2,,0,FFFFFF,,0)(000040,0,20,0,0,0,,2,,0,00FFFF,G,0)(000040,0,20,0,0,0,,2,,0,00FFFF,,0)(000040,497,50,0,1,2,,2,,0,FFFFFF,G,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,TCO GARE PRINCIPALE,1,ARIAL,20,00FFFF,GI,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,FFFFFF,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0) -(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,20,0,0,0,,2,,0,00FFFF,,0)(000040,0,20,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,8,00FF00,,0)(000040,0,0,0,0,0,,2,,8,00FF00,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,9,0,0,0,,2,,0,000000,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,0,,0,00FFFF,,0)(000040,0,8,0,0,0,,0,,0,00FFFF,,0)(000040,0,20,0,0,0,,2,,0,000000,,0)(000040,0,20,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0) -(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,517,20,0,0,0,,2,,0,00FFFF,,0)(000040,531,20,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,6,2,0,0,0,,2,,0,00FF00,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,516,1,0,0,0,,2,,0,00FFFF,,0)(000040,516,1,0,0,0,,0,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,72)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,10,0,0,0,,2,,0,000000,,0)(000040,0,9,0,0,0,,2,,0,000000,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,0,,0,00FFFF,,0)(000040,0,8,0,0,0,,2,,0,00FFFF,,0)(000040,103,25,0,0,0,,2,MS SANS SERIF,10,00FF00,,0)(000040,0,20,0,0,0,,0,,0,000000,,0)(000040,600,50,0,1,1,,2,,0,FFFFFF,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0) -(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,20,0,0,0,,2,,0,00FFFF,,0)(000040,0,20,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,16)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,10,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,232,50,0,3,1,,2,,0,00FF00,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,FFFFFF,,0)(000040,288,50,0,2,1,,2,,0,FFFFFF,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,10,0,0,0,,2,MS SANS SERIF,10,00FFFF,,0)(000040,0,10,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,302,50,0,1,1,,0,,0,FFFFFF,,0)(000040,9,24,0,0,0,,2,MS SANS SERIF,10,00FF00,,0)(000040,8,24,0,0,0,,0,MS SANS SERIF,10,00FF00,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0) -(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,20,0,0,0,,2,,0,00FFFF,,0)(000040,0,20,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,70)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,372,50,0,1,1,,2,,0,FFFFFF,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,4,15,0,0,0,,2,,0,00FF00,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,514,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,522,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,7,0,0,0,,2,,0,000000,,0)(000040,0,10,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,FFFFFF,,0)(000040,0,20,0,0,0,,0,,0,00FFFF,,0)(000040,0,20,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0) -(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,20,0,0,0,,2,,0,00FFFF,,0)(000040,0,20,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,3,15,0,0,0,,2,,0,00FF00,,0)(000040,5,2,0,0,0,,2,,0,00FF00,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,515,1,0,0,0,,2,,0,00FFFF,,0)(000040,515,1,0,0,0,,0,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,7,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,00FFFF,,0)(000040,0,0,0,0,0,,0,,0,FFFFFF,,0)(000040,526,20,0,0,0,,2,,0,00FFFF,,0)(000040,0,20,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,00FFFF,,0)(000040,0,0,0,0,0,,0,,0,000000,,0) -(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,19,0,0,0,,2,,0,00FFFF,,0)(000040,0,19,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,520,50,0,2,1,,2,,0,00FF00,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,10,0,0,0,,2,,0,000000,,0)(000040,0,10,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,316,50,0,3,1,,2,,0,00FF00,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,51,0,0,0,,2,,0,000000,,0)(000040,0,51,0,0,0,,2,,0,000000,,0)(000040,0,51,0,0,0,QUAI 1,1,ARIAL,12,FFFFFF,G,0)(000040,0,51,0,0,0,,2,,8,00FF00,,0)(000040,0,51,0,0,0,,2,,8,00FF00,,0)(000040,0,51,0,0,0,,2,,0,000000,,0)(000040,0,51,0,0,0,,2,,0,000000,,0)(000040,0,51,0,0,0,,2,,0,000000,,0)(000040,0,51,0,0,0,,2,,0,000000,,0)(000040,0,51,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,190,50,0,2,1,,2,,0,00FF00,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,00FFFF,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,18,0,0,0,,0,,0,00FFFF,,0)(000040,0,18,0,0,0,,0,,0,00FFFF,,0)(000040,0,0,0,0,0,,0,,0,00FFFF,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0) -(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,11,0,0,0,,2,,0,00FFFF,,0)(000040,0,6,0,0,0,,2,,0,000000,,0)(000040,518,1,0,0,0,,0,,0,00FFFF,,0)(000040,518,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,1,3,0,0,0,,2,,8,00FF00,,0)(000040,100,21,0,0,0,,2,,0,00FF00,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,VOIE 2,2,ARIAL,10,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,523,1,0,0,0,,0,,0,00FFFF,,0)(000040,523,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,7,0,0,0,,2,,0,00FFFF,,0)(000040,0,10,0,0,0,,0,,0,00FFFF,,0)(000040,0,0,0,0,0,,0,,0,00FFFF,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0) -(000040,530,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,8,0,0,0,,2,,0,00FFFF,,0)(000040,0,6,0,0,0,,2,,0,000000,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,12,4,1,0,0,,2,,0,00FF00,,16)(000040,2,3,0,0,0,,2,,0,00FF00,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,519,1,0,0,0,,2,,0,00FFFF,,0)(000040,519,1,0,0,0,,0,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,VOIE 1,2,ARIAL,10,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,8,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,7,2,0,0,0,,2,,0,00FF00,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,527,1,0,0,0,,2,,8,00FFFF,,0)(000040,0,1,0,0,0,,3,,8,00FFFF,,0)(000040,0,1,0,0,0,,0,,0,00FFFF,,0)(000040,0,7,0,0,0,,0,,0,00FFFF,,0)(000040,0,0,0,0,0,,0,,0,00FFFF,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0) -(000040,529,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,0,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,26,22,0,0,0,,0,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,0,,0,00FFFF,,0)(000040,0,1,0,0,0,,0,,0,00FFFF,,0)(000040,0,8,0,0,0,,0,,0,000000,,0)(000040,0,11,0,0,0,,0,,0,000000,,16)(000040,330,50,0,3,1,,0,,0,00FF00,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,51,0,0,0,,0,,0,000000,,0)(000040,0,51,0,0,0,,0,,0,000000,,0)(000040,0,51,0,0,0,QUAI 2,1,ARIAL,12,FFFFFF,G,0)(000040,0,51,0,0,0,,0,,0,000000,,0)(000040,0,51,0,0,0,,0,,0,000000,,0)(000040,0,51,0,0,0,,0,,0,000000,,0)(000040,0,51,0,0,0,,0,,0,000000,,0)(000040,0,51,0,0,0,,0,,0,000000,,0)(000040,0,51,0,0,0,,0,,0,000000,,0)(000040,0,51,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,10,0,0,0,,0,,0,000000,,0)(000040,204,50,0,3,1,,0,,0,00FF00,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,8,00FF00,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0) -(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,6,0,0,0,,0,,0,00FFFF,,0)(000040,0,1,0,0,0,,0,,0,00FFFF,,0)(000040,0,1,0,0,0,,0,,0,00FFFF,,0)(000040,0,1,0,0,0,,0,,0,00FFFF,,0)(000040,21,5,0,0,0,,0,,0,00FF00,,0)(000040,20,5,0,0,0,,0,,0,00FF00,,1)(000040,520,1,0,0,0,,2,,8,00FFFF,,0)(000040,520,1,0,0,0,,0,,0,00FFFF,,0)(000040,520,1,0,0,0,,0,,0,00FFFF,,0)(000040,0,1,0,0,0,,0,,8,00FFFF,,0)(000040,0,1,0,0,0,,0,,0,00FFFF,,0)(000040,0,1,0,0,0,,0,,0,00FFFF,,0)(000040,0,1,0,0,0,,0,,8,00FFFF,,0)(000040,0,1,0,0,0,,0,,0,00FFFF,,0)(000040,0,1,0,0,0,,0,,0,00FFFF,,0)(000040,0,1,0,0,0,,0,,8,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,0,,0,00FFFF,,0)(000040,0,1,0,0,0,,0,,8,00FFFF,,0)(000040,0,1,0,0,0,,0,,0,00FFFF,,0)(000040,0,1,0,0,0,,0,,8,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,7,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,8,00FF00,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0) -(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,176,50,0,3,1,,0,,0,00FF00,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,3,,8,00FF00,,0)(000040,0,0,0,0,0,,0,,8,00FF00,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,8,00FF00,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,8,00FF00,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,8,00FF00,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,00FFFF,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,FFFFFF,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0) -(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,00FFFF,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,FFFFFF,,0) +/ couleur fond,adresse,image,inversion aiguillage,Orientation du signal, pied du signal , [texte], representation, fonte, taille fonte, couleur fonte, style, épaisseurs, pont, buttoir +(000040,358,50,0,1,1,,2,,0,FFFFFF,,0,0,0)(000040,0,20,0,0,0,,2,,0,00FFFF,G,0,0,0)(000040,0,20,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,497,50,0,1,2,,2,,0,FFFFFF,G,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,TCO GARE PRINCIPALE,1,ARIAL,20,00FFFF,GI,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,10,0,0,0,,2,,0,00FFFF,,0,0,64)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,FFFFFF,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0) +(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,20,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,20,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,11,0,0,0,,2,,0,00FFFF,,0,0,16)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,8,00FF00,,0,0,0)(000040,0,0,0,0,0,,2,,8,00FF00,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,10,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,9,0,0,0,,2,,0,000000,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,0,,0,00FFFF,,0,0,0)(000040,0,8,0,0,0,,0,,0,00FFFF,,0,0,0)(000040,0,20,0,0,0,,2,,0,000000,,0,0,0)(000040,0,20,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0) +(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,517,20,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,531,20,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,52,0,0,2, SC,1,,8,00FFFF,G,0,0,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,6,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,6,2,0,0,0,,2,,0,00FF00,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,516,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,516,1,0,0,0,,0,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,64,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,7,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,10,0,0,0,,2,,0,000000,,0,0,0)(000040,0,9,0,0,0,,2,,0,000000,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,0,,0,00FFFF,,0,0,0)(000040,0,8,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,103,25,0,0,0,,2,MS SANS SERIF,10,00FF00,,0,0,0)(000040,0,20,0,0,0,,0,,0,000000,,0,0,0)(000040,600,50,0,1,1,,2,,0,FFFFFF,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0) +(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,20,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,20,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,10,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,232,50,0,3,1,,2,,0,00FF00,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,0,0,0,0,,2,,0,FFFFFF,,0,0,0)(000040,288,50,0,2,1,,2,,0,FFFFFF,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,10,0,0,0,,2,MS SANS SERIF,10,00FFFF,,0,0,0)(000040,0,10,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,302,50,0,1,1,,0,,0,FFFFFF,,0,0,0)(000040,9,24,0,0,0,,2,MS SANS SERIF,10,00FF00,,0,0,0)(000040,8,24,0,0,0,,0,MS SANS SERIF,10,00FF00,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0) +(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,20,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,20,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,372,50,0,1,1,,2,,0,FFFFFF,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,4,15,0,0,0,,2,,0,00FF00,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,514,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,522,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,7,0,0,0,,2,,0,000000,,0,0,0)(000040,0,10,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,FFFFFF,,0,0,0)(000040,0,20,0,0,0,,0,,0,00FFFF,,0,0,0)(000040,0,20,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0) +(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,20,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,20,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0,128,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,3,15,0,0,0,,2,,0,00FF00,,0,0,0)(000040,5,2,0,0,0,,2,,0,00FF00,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,515,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,515,1,0,0,0,,0,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,7,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,00FFFF,,0,0,0)(000040,0,0,0,0,0,,0,,0,FFFFFF,,0,0,0)(000040,526,20,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,20,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,00FFFF,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0) +(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,19,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,19,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,520,50,0,2,1,,2,,0,00FF00,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,10,0,0,0,,2,,0,000000,,0,0,0)(000040,0,10,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,316,50,0,3,1,,2,,0,00FF00,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,51,0,0,0,,2,,0,000000,,0,0,0)(000040,0,51,0,0,0,,2,,0,000000,,0,0,0)(000040,0,51,0,0,0,QUAI 1,1,ARIAL,12,FFFFFF,G,0,0,0)(000040,0,51,0,0,0,,2,,8,00FF00,,0,0,0)(000040,0,51,0,0,0,,2,,8,00FF00,,0,0,0)(000040,0,51,0,0,0,,2,,0,000000,,0,0,0)(000040,0,51,0,0,0,,2,,0,000000,,0,0,0)(000040,0,51,0,0,0,,2,,0,000000,,0,0,0)(000040,0,51,0,0,0,,2,,0,000000,,0,0,0)(000040,0,51,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,190,50,0,2,1,,2,,0,00FF00,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,00FFFF,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,18,0,0,0,,0,,0,00FFFF,,0,0,0)(000040,0,18,0,0,0,,0,,0,00FFFF,,0,0,0)(000040,0,0,0,0,0,,0,,0,00FFFF,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0) +(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,11,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,6,0,0,0,,2,,0,000000,,0,0,0)(000040,518,1,0,0,0,,0,,0,00FFFF,,0,0,0)(000040,518,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,1,3,0,0,0,,2,,8,00FF00,,0,0,0)(000040,100,21,0,0,0,,3,,0,00FF00,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,VOIE 2,2,ARIAL,10,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,523,1,0,0,0,,0,,0,00FFFF,,0,0,0)(000040,523,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,7,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,10,0,0,0,,0,,0,00FFFF,,0,0,0)(000040,0,0,0,0,0,,0,,0,00FFFF,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0) +(000040,530,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,8,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,6,0,0,0,,2,,0,000000,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,12,4,1,0,0,,2,,0,00FF00,,16,0,0)(000040,2,3,0,0,0,,2,,0,00FF00,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,519,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,519,1,0,0,0,,0,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,VOIE 1,2,ARIAL,10,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,8,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,7,2,0,0,0,,2,,0,00FF00,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,527,1,0,0,0,,2,,8,00FFFF,,0,0,0)(000040,0,1,0,0,0,,3,,8,00FFFF,,0,0,0)(000040,0,1,0,0,0,,0,,0,00FFFF,,0,0,0)(000040,0,7,0,0,0,,0,,0,00FFFF,,0,0,0)(000040,0,0,0,0,0,,0,,0,00FFFF,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0) +(000040,529,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,0,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,26,22,0,0,0,,0,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,0,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,0,,0,00FFFF,,0,0,0)(000040,0,8,0,0,0,,0,,0,000000,,0,0,0)(000040,0,11,0,0,0,,0,,0,000000,,16,0,0)(000040,330,50,0,3,1,,0,,0,00FF00,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,51,0,0,0,,0,,0,000000,,0,0,0)(000040,0,51,0,0,0,,0,,0,000000,,0,0,0)(000040,0,51,0,0,0,QUAI 2,1,ARIAL,12,FFFFFF,G,0,0,0)(000040,0,51,0,0,0,,0,,0,000000,,0,0,0)(000040,0,51,0,0,0,,0,,0,000000,,0,0,0)(000040,0,51,0,0,0,,0,,0,000000,,0,0,0)(000040,0,51,0,0,0,,0,,0,000000,,0,0,0)(000040,0,51,0,0,0,,0,,0,000000,,0,0,0)(000040,0,51,0,0,0,,0,,0,000000,,0,0,0)(000040,0,51,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,10,0,0,0,,0,,0,000000,,0,0,0)(000040,204,50,0,3,1,,0,,0,00FF00,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,8,00FF00,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0) +(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,6,0,0,0,,0,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,0,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,0,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,0,,0,00FFFF,,0,0,0)(000040,21,5,0,0,0,,0,,0,00FF00,,0,0,0)(000040,20,5,0,0,0,,0,,0,00FF00,,1,0,0)(000040,520,1,0,0,0,,2,,8,00FFFF,,0,0,0)(000040,520,1,0,0,0,,0,,0,00FFFF,,0,0,0)(000040,520,1,0,0,0,,0,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,0,,8,00FFFF,,0,0,0)(000040,0,1,0,0,0,,0,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,0,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,0,,8,00FFFF,,0,0,0)(000040,0,1,0,0,0,,0,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,0,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,0,,8,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,0,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,0,,8,00FFFF,,0,0,0)(000040,0,1,0,0,0,,0,,0,00FFFF,,0,0,0)(000040,0,1,0,0,0,,0,,8,00FFFF,,0,0,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,7,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,8,00FF00,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0) +(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,176,50,0,3,1,,0,,0,00FF00,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,3,,8,00FF00,,0,0,0)(000040,0,0,0,0,0,,0,,8,00FF00,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,8,00FF00,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,8,00FF00,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,8,00FF00,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,00FFFF,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,FFFFFF,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0) +(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,2,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,00FFFF,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,000000,,0,0,0)(000040,0,0,0,0,0,,0,,0,FFFFFF,,0,0,0) diff --git a/verif_version.pas b/verif_version.pas index 1c34c21..3949080 100644 --- a/verif_version.pas +++ b/verif_version.pas @@ -25,7 +25,7 @@ var verifVersion,notificationVersion : boolean; date_creation : string; -Const Version='7.3'; // sert à la comparaison de la version publiée +Const Version='8.0'; // sert à la comparaison de la version publiée SousVersion=' '; // A B C ... en cas d'absence de sous version mettre un espace function GetCurrentProcessEnvVar(const VariableName: string): string; diff --git a/versions.txt b/versions.txt index 2c31e7e..8eb0d7d 100644 --- a/versions.txt +++ b/versions.txt @@ -180,7 +180,10 @@ version 7.11 : Renvoi de la consigne de vitesse au trains apr version 7.2 : Possibilité de dessiner des voies fines et épaisses dans le TCO par exemple pour distinguer les voies principales et les bretelles. 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. + Création d'un bouton "action" dans les TCOs. + Possibilité d'utiliser jusqu'à 10 TCOs. +