diff --git a/ConfigGenerale.cfg b/ConfigGenerale.cfg index 45275e6..e0477f5 100644 --- a/ConfigGenerale.cfg +++ b/ConfigGenerale.cfg @@ -1,5 +1,5 @@ -/ Fichier de configuration de signaux_complexes_GL version 9.6 -Chemin_progCDM= +/ Fichier de configuration de signaux_complexes_GL version 9.75 +Chemin_progCDM=C:\Program Files (x86) LargeurF=1120 HauteurF=681 OffsetX=128 @@ -15,8 +15,8 @@ Max_Signal_Sens=5 Debug=0 Mode_Sombre=0 debugRoulage=0 -AffLoc=0 -coul_fond=000040 +AffLoc=1 +coul_fond=000080 serveurIPCDM_Touche=0 Port_Serveur=4500 Filtrage_det=3 @@ -24,34 +24,34 @@ nCantonsRes=2 AntiTimeoutEthLenz=0 TempoTC=3 Fonte=10 -Style=1 +Style=Auric Protocole=1 Verif_AdrXpressNet=1 IpV4_PC=127.0.0.1:9999 ServicesCDM=15 Ipv4_interface=192.168.1.23:5550 -Protocole_serie=COM6:57600,N,8,1,0 -Inter_car=50 +Protocole_serie=COM6:57600,N,8,1,2 +Inter_car=30 Tempo_maxi=15 Entete=1 Init_Aig=1 -PilotageTrainsCDMNom=1 +PilotageTrainsCDMNom=0 Init_Dem_Aig=0 Tempo_Aig=30 -MaxParcours=80 -MaxRoutes=5000 +MaxParcours=60 +MaxRoutes=10000 Init_demUSBCOM=0 Init_demETH=1 Fenetre=0 Ecran=1 AffMemoFenetre=1 nb_det_dist=3 -verif_version=1 +verif_version=0 notif_version=0 -TCO=1 +TCO=0 NbreTCO=1 Nom_fichier_TCO1=TCO.CFG -Nom_fichier_TCO2=TCO_ESSAI +Nom_fichier_TCO2=TCO2.CFG Nom_fichier_TCO3=TCO3.CFG Nom_fichier_TCO4=TCO4.CFG Nom_fichier_TCO5=TCO5.CFG @@ -78,7 +78,7 @@ Option_demiTour=0 Alg_Unisemaf=1 /------------ [section_aig] -1,P518,D100D,S3P,V30,I0,INIT(2,1),C0 +1,P518,D100D,S3P,V30,I0,INIT(2,5),C0 2,P12S,D519,S100S,V0,I0,INIT(2,1),C0 3,P1S,D4P,S5D,V0,I0,INIT(2,1),C0 4,P3D,D6S,S514,V0,I0,INIT(2,1),C0 @@ -86,15 +86,15 @@ Alg_Unisemaf=1 6,P516,D0,S4D,V0,I0,INIT(1,1),C0 7,P527,D519,S520,V30,I0,INIT(1,1),C0 8,P527,D521,S103S,V0,I0,INIT(2,2),C0 -9,P526,D103D,S515,V60,I0,INIT(1,2),C0 -10,P101S,D29P,S528,V30,I0,INIT(1,2),C0 -11,P18P,D30D,S101D,V0,I0,INIT(1,2),C0 +9,P526,D103D,S515,V60,I0,INIT(2,2),C0 +10,P101S,D29P,S528,V30,I0,INIT(2,2),C0 +11,P18P,D30D,S101D,V0,I0,INIT(2,2),C0 12,P517,D20S,S2P,V0,I0,INIT(1,2),C0 17,P525,D535,S528,V0,I0,INIT(1,2),C0 18,P11P,D23P,S102S,V0,I0,INIT(1,2),C0 19,P101S,D102D,S531,V0,I0,INIT(1,2),C0 20,P520,D21P,S12D,V0,I0,INIT(2,2),C0 -21,P20D,D28S,S28D,V0,I0,INIT(2,2),C0 +21,P20D,D28S,S28D,V0,I0,INIT(1,2),C0 22,P102D,D537,S105D,V0,I0,INIT(2,2),C0 23,P18D,D105D,S534,V0,I0,INIT(2,2),C0 24,P538,D32S,S533,V0,I0,INIT(1,2),C0 @@ -103,7 +103,7 @@ Alg_Unisemaf=1 27,P25S,D530,S537,V0,I0,INIT(1,2),C0 28TJD,D(21D,26D),S(21S,26S),V0,I0,INIT(1,2),E4,C0 29,P10D,D513,S30S,V60,I0,INIT(2,2),C0 -30,P524,D11D,S29S,V0,I0,INIT(2,2),C0 +30,P524,D11D,S29S,V0,I0,INIT(2,7),C0 31,P534,D34D,S104S,V0,I0,INIT(1,2),C0 32,P105S,D104D,S24D,V0,I0,INIT(1,2),C0 34,P0,D31D,S104D,V0,I0,INIT(2,2),C0 @@ -132,72 +132,18 @@ A31,A34,0 /------------ [section_decodeurs] / décodeur n°1 -Nom_dec_pers=grand -NombreAdresses=8 +Nom_dec_pers=CDF_personnalisé +NombreAdresses=3 Nation=1 Commande=0 -Periph=0 -1,2,0,1,2 -3,4,1,0,0 -5,6,2,0,0 -7,8,3,0,0 -0,0,0,0,0 -0,0,0,0,0 -0,0,0,0,0 -0,0,0,0,0 -/ décodeur n°2 -Nom_dec_pers=decodeur com -NombreAdresses=10 -Nation=1 -Commande=1 Periph=1 -carré,car -sémaphore,sem -rouge cli,semcli -vert, -vert cli, -violet, -blanc, -blanc cli, -avertissement, -jaune cli, -ralen 30, -ralen 60, -rappel 30, -rappel 60, -ralen 60 + jaune cli, -rappel 30 + jaune, -rappel 30 + jaune cli, -rappel 60 + jaune, -rappel 60 + jaune cli, -/ décodeur n°3 -Nom_dec_pers=decodeur USB Belge -NombreAdresses=10 -Nation=2 -Commande=1 -Periph=1 -vert jaune horizontal,vjh -rouge,r -vert,v -vert jaune vertical, -rouge blanc, -deux jaunes, -Chiffre, -Chevron, -Clignote, - , - , - , - , - , - , - , - , - , - , +13,0,0,1,0 +4,9,1,1,2 +2,1,2,1,2 0 /------------ [section_sig] +49,9,0,11,(518,A1),0,FVC0,FRC0,SR(1,2,3,16,17,13,18,19,14,9,10,5,4,0,18,19),NA7 176,7,0,1,(520,A20),1,FVC0,FRC0 190,7,0,1,(523,526),0,FVC0,FRC0 204,9,0,1,(527,A7),1,FVC0,FRC0 @@ -220,16 +166,14 @@ Clignote, 476,9,0,1,(538,A105),1,FVC0,FRC0 497,9,0,4,(531,A19),1,FVC0,FRC0,U14,L1 520,9,1,1,(518,A1),1,FVC0,FRC0,(A1S,A3S,A5S),CFB(A1S,A3D,A4D,A6S) -620,7,0,0,(521,A8),1,FVC0,FRC0 -820,4,0,0,(519,A7),0,FVC0,FRC0 0 /------------ [section_PN] +(523-526,513-531),PN(700,1,700,2),1,0 0 /------------ [section_actions] -Action 3,D4,800,1,traindecl,B1,C5,12,12,13,45,N3,A10,1,30,traindest,A2,1,A8,1 -Action 5,D1,12,30,B1,C3,162,30,TGV,N1,A4,1,15,2,Z +ACTION1,D4,513,1,,B1,C11,1,0,N1,A10,0,0, 0 /------------ [section_dcc++] @@ -241,20 +185,32 @@ AdrBaseDetDccpp=513 0 /------------ [section_trains] -BB25531,1,120,60,50,BB67000.BMP,5,0,0,0,0,0,0.00,0.00,0.00,0,0,0 -TGV,2,120,80,60,TGV.BMP,6,0,0,0,0,0,0.00,0.00,0.00,0,0,0 -BB16024,3,120,100,60,BB16024.BMP,7,0,0,0,0,0,0.00,0.00,0.00,0,0,0 -CC406526,4,120,100,80,CC406526.BMP,10,0,0,0,0,0,0.00,0.00,0.00,0,0,0 -[route_par_pont],0 +BB25531,1,120,60,50,BB67000.BMP,0,0,18,0,0,0,0.00,0.00,0.00,0,0,0 +TGV,2,120,80,60,TGV.BMP,0,0,0,0,0,0,0.00,0.00,0.00,0,0,0 +BB16024,3,120,70,50,BB16024.BMP,0,0,18,40,60,80,4.80,2.50,2.00,6,6,128 +[route directe],0,1 +{523->526->9droit->103crois->513->29droit->10droit->101crois->19dev->531->518->1droit->100crois->523} +[route directe],1,2 +{523->100crois->1droit->518->531->19dev->101crois->10droit->29droit->513->103crois->9droit->526->523} +[],0,3 {519->2droit->12dev->517->102crois->18dev->11dev->101crois->525->17dev->528->10dev->101crois->19dev->531->518->1droit->100crois->523} -CAMERA,6,120,0,0,EAD.BMP,8,0,0,0,0,0,0.00,0.00,0.00,0,0,0 +CC406526,4,120,100,80,CC406526.BMP,0,0,1,50,60,100,6.00,5.50,3.89,4,4,128,P523,D526,T5 +[anneau intérieur],0,1 +{523->526->9droit->103crois->513->29droit->10droit->101crois->19dev->531->518->1droit->100crois->523} +[inversion],0,4 +{523->526->9dev->515->5dev->100crois->2dev->12dev->517->102crois->18dev->11droit->30droit->524->521->8droit->527->7droit->519} +[],0,5 +{515->5dev->100crois->2dev->12dev->517->102crois->18dev->11dev->101crois->525->17dev->528->10dev->101crois->19dev->531->518->1dev->3droit->4droit->6dev->516} +[],0,6 +{523->526->9droit->103crois->513->29droit->10droit->101crois->19dev->531->518->1dev->3droit->4dev->514->522->103crois->8dev->527->7dev->520} +CAMERA,6,120,0,0,EAD.BMP,0,0,0,0,0,0,0.00,0.00,0.00,0,0,0 0 /------------ [section_placement] BB25531,0,0,0 -TGV,0,0,0 +TGV,14,3,0 BB16024,0,0,0 -CC406526,9,1,0 +CC406526,7,2,0 CAMERA,0,0,0 0 /------------ @@ -314,17 +270,17 @@ DureeMinute=1 0 /------------ [section_detecteurs] -513,43,0,0 +513,43,1,10 514,18,0,0 -515,67,0,0 +515,67,1,5 516,150,0,0 517,60,0,0 518,56,0,0 -519,66,0,0 +519,66,1,5 520,73,0,0 521,85,0,0 -522,120,0,0 -523,84,0,0 +522,120,1,10 +523,84,1,10 524,67,0,0 525,153,0,0 526,84,0,0 @@ -332,7 +288,7 @@ DureeMinute=1 528,150,0,0 529,77,0,0 530,90,0,0 -531,28,0,0 +531,29,0,0 533,127,0,0 534,92,0,0 535,134,0,0 @@ -341,4 +297,43 @@ DureeMinute=1 0 /------------ [section_logique] +/--- fonction 1 +"Mafonction1" +0,Fonction logique,N1,T0,A13,E0,V,,O0, +1,Opérateur ET,N2,T1,A0,E0,V,,O0, +2,Etat DCC,N3,T5,A10,E2,V,,O0, +3,Etat DCC,N3,T5,A11,E2,V,,O0, +4,Opérateur OU,N3,T2,A0,E0,V,,O0, +5,Etat DCC,N4,T5,A12,E1,V,,O0, +6,Etat DCC,N4,T5,A17,E1,V,,O0, +7,Opérateur ET,N4,T1,A0,E0,V,,O0, +8,Etat DCC,N5,T5,A25,E1,V,,O0, +9,Etat DCC,N5,T5,A26,E1,V,,O0, +10,Opérateur ET,N3,T1,A0,E0,V,,O0, +11,Etat détect./actionn.,N4,T6,A513,E1,V,,O0, +12,Etat détect./actionn.,N4,T6,A515,E1,V,,O0, +FF +/--- fonction 2 +"kgkhgk" +0,Fonction logique,N2,T0,A3,E0,V,,O0, +1,Opérateur ET,N2,T1,A0,E0,V,,O0, +2,Mémoire,N3,T8,A1,E31,V,CC406526,O2, +FF +/--- fonction 3 +"fonction 3" +0,Fonction logique,N3,T0,A7,E0,V,,O0, +1,Opérateur ET,N2,T1,A0,E0,V,,O0, +2,Etat DCC,N3,T5,A0,E0,V,,O0, +3,Etat DCC,N3,T5,A0,E0,V,,O0, +4,Opérateur ET,N3,T1,A0,E0,V,,O0, +5,Etat DCC,N4,T5,A0,E0,V,,O0, +6,Etat DCC,N4,T5,A0,E0,V,,O0, +FF +/--- fonction 4 +"fonction 4" +0,Fonction logique,N4,T0,A4,E0,V,,O0, +1,Opérateur Non ET,N2,T3,A0,E0,V,,O0, +2,Bouton TCO,N3,T7,A1,E1,V,,O0, +3,Mémoire,N3,T8,A2,E1,V,,O1, +FF 0 diff --git a/Notice d'utilisation des signaux_complexes_GL_V9.74.pdf b/Notice d'utilisation des signaux_complexes_GL_V9.76.pdf similarity index 81% rename from Notice d'utilisation des signaux_complexes_GL_V9.74.pdf rename to Notice d'utilisation des signaux_complexes_GL_V9.76.pdf index c1f9507..ba2cff3 100644 Binary files a/Notice d'utilisation des signaux_complexes_GL_V9.74.pdf and b/Notice d'utilisation des signaux_complexes_GL_V9.76.pdf differ diff --git a/Signaux_complexes_GL.dof b/Signaux_complexes_GL.dof index 73b43da..fa0a9a2 100644 --- a/Signaux_complexes_GL.dof +++ b/Signaux_complexes_GL.dof @@ -130,3 +130,9 @@ OriginalFilename= ProductName= ProductVersion=8.1.0.0 Comments= +[HistoryLists\hlUnitAliases] +Count=1 +Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +[HistoryLists\hlSearchPath] +Count=1 +Item0=$(DELPHI)\Lib\Debug diff --git a/Signaux_complexes_GL.dpr b/Signaux_complexes_GL.dpr index f216031..93aaa04 100644 --- a/Signaux_complexes_GL.dpr +++ b/Signaux_complexes_GL.dpr @@ -17,7 +17,6 @@ uses UnitPareFeu in 'UnitPareFeu.pas', UnitAnalyseSegCDM in 'UnitAnalyseSegCDM.pas' {FormAnalyseCDM}, Importation in 'Importation.pas' {FormImportation}, - MSCommLib_TLB in 'MSCommLib_TLB.pas', UnitHorloge in 'UnitHorloge.pas' {FormHorloge}, UnitFicheHoraire in 'UnitFicheHoraire.pas' {FormFicheHoraire}, UnitClock in 'UnitClock.pas' {FormClock}, diff --git a/Signaux_complexes_GL.exe b/Signaux_complexes_GL.exe new file mode 100644 index 0000000..af4c35c Binary files /dev/null and b/Signaux_complexes_GL.exe differ diff --git a/Signaux_complexes_GL.map b/Signaux_complexes_GL.map index 03df473..2f7ae42 100644 --- a/Signaux_complexes_GL.map +++ b/Signaux_complexes_GL.map @@ -1,8 +1,8 @@ Start Length Name Class - 0001:00000000 001C4204H .text CODE - 0002:00000000 00003018H .data DATA - 0002:00003018 28FB0E09H .bss BSS + 0001:00000000 001D7FBCH .text CODE + 0002:00000000 00003150H .data DATA + 0002:00003150 29020CC1H .bss BSS Detailed map of segments @@ -13,106 +13,105 @@ Detailed map of segments 0001:00006174 00000F38 C=CODE S=.text G=(none) M=Windows ACBP=A9 0001:000070AC 00000038 C=CODE S=.text G=(none) M=Messages ACBP=A9 0001:000070E4 00000340 C=CODE S=.text G=(none) M=SysConst ACBP=A9 - 0001:00007424 000079C0 C=CODE S=.text G=(none) M=SysUtils ACBP=A9 - 0001:0000EDE4 00000823 C=CODE S=.text G=(none) M=VarUtils ACBP=A9 - 0001:0000F608 0000878A C=CODE S=.text G=(none) M=Variants ACBP=A9 - 0001:00017D94 000001A0 C=CODE S=.text G=(none) M=RTLConsts ACBP=A9 - 0001:00017F34 0000083C C=CODE S=.text G=(none) M=TypInfo ACBP=A9 - 0001:00018770 00000368 C=CODE S=.text G=(none) M=ActiveX ACBP=A9 - 0001:00018AD8 0000AAE6 C=CODE S=.text G=(none) M=Classes ACBP=A9 - 0001:000235C0 00000380 C=CODE S=.text G=(none) M=Consts ACBP=A9 - 0001:00023940 00009DC7 C=CODE S=.text G=(none) M=Graphics ACBP=A9 - 0001:0002D708 00000124 C=CODE S=.text G=(none) M=Math ACBP=A9 - 0001:0002D82C 000002B8 C=CODE S=.text G=(none) M=Contnrs ACBP=A9 - 0001:0002DAE4 0000041C C=CODE S=.text G=(none) M=CommCtrl ACBP=A9 - 0001:0002DF00 00000787 C=CODE S=.text G=(none) M=MultiMon ACBP=A9 - 0001:0002E688 00000038 C=CODE S=.text G=(none) M=Imm ACBP=A9 - 0001:0002E6C0 00000FF8 C=CODE S=.text G=(none) M=HelpIntfs ACBP=A9 - 0001:0002F6B8 00000058 C=CODE S=.text G=(none) M=WinSpool ACBP=A9 - 0001:0002F710 000010C8 C=CODE S=.text G=(none) M=Printers ACBP=A9 - 0001:000307D8 0000031F C=CODE S=.text G=(none) M=FlatSB ACBP=A9 - 0001:00030AF8 000003F0 C=CODE S=.text G=(none) M=SyncObjs ACBP=A9 - 0001:00030EE8 000009BB C=CODE S=.text G=(none) M=UxTheme ACBP=A9 - 0001:000318A4 00000038 C=CODE S=.text G=(none) M=RichEdit ACBP=A9 - 0001:000318DC 00000038 C=CODE S=.text G=(none) M=ToolWin ACBP=A9 - 0001:00031914 00000040 C=CODE S=.text G=(none) M=ShellAPI ACBP=A9 - 0001:00031954 00000038 C=CODE S=.text G=(none) M=RegStr ACBP=A9 - 0001:0003198C 00000058 C=CODE S=.text G=(none) M=WinInet ACBP=A9 - 0001:000319E4 00000038 C=CODE S=.text G=(none) M=UrlMon ACBP=A9 - 0001:00031A1C 000000EC C=CODE S=.text G=(none) M=ShlObj ACBP=A9 - 0001:00031B08 00000060 C=CODE S=.text G=(none) M=CommDlg ACBP=A9 - 0001:00031B68 00000038 C=CODE S=.text G=(none) M=Dlgs ACBP=A9 - 0001:00031BA0 000036D1 C=CODE S=.text G=(none) M=Dialogs ACBP=A9 - 0001:00035274 0000602A C=CODE S=.text G=(none) M=ExtCtrls ACBP=A9 - 0001:0003B2A0 000000A0 C=CODE S=.text G=(none) M=ComStrs ACBP=A9 - 0001:0003B340 000007A0 C=CODE S=.text G=(none) M=Clipbrd ACBP=A9 - 0001:0003BAE0 00000128 C=CODE S=.text G=(none) M=StrUtils ACBP=A9 - 0001:0003BC08 00003821 C=CODE S=.text G=(none) M=Buttons ACBP=A9 - 0001:0003F42C 00000038 C=CODE S=.text G=(none) M=ExtDlgs ACBP=A9 - 0001:0003F464 00000068 C=CODE S=.text G=(none) M=IniFiles ACBP=A9 - 0001:0003F4CC 00000068 C=CODE S=.text G=(none) M=Registry ACBP=A9 - 0001:0003F534 0000006C C=CODE S=.text G=(none) M=Mapi ACBP=A9 - 0001:0003F5A0 00000058 C=CODE S=.text G=(none) M=ExtActns ACBP=A9 - 0001:0003F5F8 00000038 C=CODE S=.text G=(none) M=ListActns ACBP=A9 - 0001:0003F630 0000FD90 C=CODE S=.text G=(none) M=ComCtrls ACBP=A9 - 0001:0004F3C0 00000EA0 C=CODE S=.text G=(none) M=Themes ACBP=A9 - 0001:00050260 0000C698 C=CODE S=.text G=(none) M=StdCtrls ACBP=A9 - 0001:0005C8F8 00000168 C=CODE S=.text G=(none) M=StdActns ACBP=A9 - 0001:0005CA60 00000D1F C=CODE S=.text G=(none) M=WinHelpViewer ACBP=A9 - 0001:0005D780 00011403 C=CODE S=.text G=(none) M=Controls ACBP=A9 - 0001:0006EB84 00001292 C=CODE S=.text G=(none) M=ActnList ACBP=A9 - 0001:0006FE18 00001C04 C=CODE S=.text G=(none) M=ImgList ACBP=A9 - 0001:00071A1C 000066E1 C=CODE S=.text G=(none) M=Menus ACBP=A9 - 0001:00078100 0000CFC0 C=CODE S=.text G=(none) M=Forms ACBP=A9 - 0001:000850C0 00000050 C=CODE S=.text G=(none) M=JConsts ACBP=A9 - 0001:00085110 000133EC C=CODE S=.text G=(none) M=jpeg ACBP=A9 - 0001:000984FC 00000060 C=CODE S=.text G=(none) M=ComConst ACBP=A9 - 0001:0009855C 00001259 C=CODE S=.text G=(none) M=ComObj ACBP=A9 - 0001:000997B8 00000038 C=CODE S=.text G=(none) M=StdVCL ACBP=A9 - 0001:000997F0 00001793 C=CODE S=.text G=(none) M=AxCtrls ACBP=A9 - 0001:0009AF84 00000060 C=CODE S=.text G=(none) M=OleConst ACBP=A9 - 0001:0009AFE4 00003519 C=CODE S=.text G=(none) M=OleCtrls ACBP=A9 - 0001:0009E500 00000314 C=CODE S=.text G=(none) M=TlHelp32 ACBP=A9 - 0001:0009E814 00000128 C=CODE S=.text G=(none) M=WinSock ACBP=A9 - 0001:0009E93C 00003A78 C=CODE S=.text G=(none) M=ScktComp ACBP=A9 - 0001:000A23B4 00000040 C=CODE S=.text G=(none) M=MMSystem ACBP=A9 - 0001:000A23F4 00000038 C=CODE S=.text G=(none) M=Nb30 ACBP=A9 - 0001:000A242C 00000038 C=CODE S=.text G=(none) M=DateUtils ACBP=A9 - 0001:000A2464 00000038 C=CODE S=.text G=(none) M=PsAPI ACBP=A9 - 0001:000A249C 000008EA C=CODE S=.text G=(none) M=OleServer ACBP=A9 - 0001:000A2D88 00000598 C=CODE S=.text G=(none) M=MSCommLib_TLB ACBP=A9 - 0001:000A3320 00000A18 C=CODE S=.text G=(none) M=MaskUtils ACBP=A9 - 0001:000A3D38 00002108 C=CODE S=.text G=(none) M=Mask ACBP=A9 - 0001:000A5E40 000092A4 C=CODE S=.text G=(none) M=Grids ACBP=A9 - 0001:000AF0E4 00001BFC C=CODE S=.text G=(none) M=Spin ACBP=A9 - 0001:000B0CE0 00002EE8 C=CODE S=.text G=(none) M=UnitDebug ACBP=A9 - 0001:000B3BC8 000039C2 C=CODE S=.text G=(none) M=UnitPilote ACBP=A9 - 0001:000B758C 0000057C C=CODE S=.text G=(none) M=Importation ACBP=A9 - 0001:000B7B08 000147A0 C=CODE S=.text G=(none) M=UnitAnalyseSegCDM ACBP=A9 - 0001:000CC2A8 00003248 C=CODE S=.text G=(none) M=UnitConfigTCO ACBP=A9 - 0001:000CF4F0 00000D98 C=CODE S=.text G=(none) M=Unit_Pilote_aig ACBP=A9 - 0001:000D0288 000017A8 C=CODE S=.text G=(none) M=UnitFicheHoraire ACBP=A9 - 0001:000D1A30 00000038 C=CODE S=.text G=(none) M=ShellConsts ACBP=A9 - 0001:000D1A68 000004E0 C=CODE S=.text G=(none) M=ShellCtrls ACBP=A9 - 0001:000D1F48 000025E0 C=CODE S=.text G=(none) M=UnitRoute ACBP=A9 - 0001:000D4528 00003BA0 C=CODE S=.text G=(none) M=UnitRouteTrains ACBP=A9 - 0001:000D80C8 0000028C C=CODE S=.text G=(none) M=UnitInfo ACBP=A9 - 0001:000D8354 00002B6C C=CODE S=.text G=(none) M=selection_train ACBP=A9 - 0001:000DAEC0 000052A8 C=CODE S=.text G=(none) M=UnitConfigCellTCO ACBP=A9 - 0001:000E0168 000015F4 C=CODE S=.text G=(none) M=UnitClock ACBP=A9 - 0001:000E175C 00000274 C=CODE S=.text G=(none) M=UnitIntro ACBP=A9 - 0001:000E19D0 0003F3DC C=CODE S=.text G=(none) M=UnitTCO ACBP=A9 - 0001:00120DAC 00003410 C=CODE S=.text G=(none) M=UnitSR ACBP=A9 - 0001:001241BC 00002784 C=CODE S=.text G=(none) M=UnitCDF ACBP=A9 - 0001:00126940 0000872C C=CODE S=.text G=(none) M=UnitModifAction ACBP=A9 - 0001:0012F06C 00043150 C=CODE S=.text G=(none) M=UnitConfig ACBP=A9 - 0001:001721BC 00000F6C C=CODE S=.text G=(none) M=UnitHorloge ACBP=A9 - 0001:00173128 000023D7 C=CODE S=.text G=(none) M=verif_version ACBP=A9 - 0001:00175500 00001190 C=CODE S=.text G=(none) M=UnitPareFeu ACBP=A9 - 0001:00176690 00000D9C C=CODE S=.text G=(none) M=UnitSimule ACBP=A9 - 0001:0017742C 00000BA8 C=CODE S=.text G=(none) M=UnitMesure ACBP=A9 - 0001:00177FD4 0004BC23 C=CODE S=.text G=(none) M=Unitprinc ACBP=A9 - 0001:001C3BF8 0000060C C=CODE S=.text G=(none) M=Signaux_complexes_GL ACBP=A9 + 0001:00007424 00007A7C C=CODE S=.text G=(none) M=SysUtils ACBP=A9 + 0001:0000EEA0 00000823 C=CODE S=.text G=(none) M=VarUtils ACBP=A9 + 0001:0000F6C4 000087F6 C=CODE S=.text G=(none) M=Variants ACBP=A9 + 0001:00017EBC 000001A0 C=CODE S=.text G=(none) M=RTLConsts ACBP=A9 + 0001:0001805C 0000083C C=CODE S=.text G=(none) M=TypInfo ACBP=A9 + 0001:00018898 00000368 C=CODE S=.text G=(none) M=ActiveX ACBP=A9 + 0001:00018C00 0000ABCA C=CODE S=.text G=(none) M=Classes ACBP=A9 + 0001:000237CC 000003B0 C=CODE S=.text G=(none) M=Consts ACBP=A9 + 0001:00023B7C 00009DC7 C=CODE S=.text G=(none) M=Graphics ACBP=A9 + 0001:0002D944 00000318 C=CODE S=.text G=(none) M=Math ACBP=A9 + 0001:0002DC5C 000002B8 C=CODE S=.text G=(none) M=Contnrs ACBP=A9 + 0001:0002DF14 0000041C C=CODE S=.text G=(none) M=CommCtrl ACBP=A9 + 0001:0002E330 00000787 C=CODE S=.text G=(none) M=MultiMon ACBP=A9 + 0001:0002EAB8 00000038 C=CODE S=.text G=(none) M=Imm ACBP=A9 + 0001:0002EAF0 00000FF8 C=CODE S=.text G=(none) M=HelpIntfs ACBP=A9 + 0001:0002FAE8 00000058 C=CODE S=.text G=(none) M=WinSpool ACBP=A9 + 0001:0002FB40 000010C8 C=CODE S=.text G=(none) M=Printers ACBP=A9 + 0001:00030C08 0000031F C=CODE S=.text G=(none) M=FlatSB ACBP=A9 + 0001:00030F28 000003F0 C=CODE S=.text G=(none) M=SyncObjs ACBP=A9 + 0001:00031318 000009BB C=CODE S=.text G=(none) M=UxTheme ACBP=A9 + 0001:00031CD4 00000038 C=CODE S=.text G=(none) M=RichEdit ACBP=A9 + 0001:00031D0C 00000038 C=CODE S=.text G=(none) M=ToolWin ACBP=A9 + 0001:00031D44 00000040 C=CODE S=.text G=(none) M=ShellAPI ACBP=A9 + 0001:00031D84 00000038 C=CODE S=.text G=(none) M=RegStr ACBP=A9 + 0001:00031DBC 00000058 C=CODE S=.text G=(none) M=WinInet ACBP=A9 + 0001:00031E14 00000038 C=CODE S=.text G=(none) M=UrlMon ACBP=A9 + 0001:00031E4C 000000EC C=CODE S=.text G=(none) M=ShlObj ACBP=A9 + 0001:00031F38 00000060 C=CODE S=.text G=(none) M=CommDlg ACBP=A9 + 0001:00031F98 00000038 C=CODE S=.text G=(none) M=Dlgs ACBP=A9 + 0001:00031FD0 00003719 C=CODE S=.text G=(none) M=Dialogs ACBP=A9 + 0001:000356EC 0000602A C=CODE S=.text G=(none) M=ExtCtrls ACBP=A9 + 0001:0003B718 000000A0 C=CODE S=.text G=(none) M=ComStrs ACBP=A9 + 0001:0003B7B8 000007A0 C=CODE S=.text G=(none) M=Clipbrd ACBP=A9 + 0001:0003BF58 00000128 C=CODE S=.text G=(none) M=StrUtils ACBP=A9 + 0001:0003C080 00003821 C=CODE S=.text G=(none) M=Buttons ACBP=A9 + 0001:0003F8A4 00000038 C=CODE S=.text G=(none) M=ExtDlgs ACBP=A9 + 0001:0003F8DC 00000068 C=CODE S=.text G=(none) M=IniFiles ACBP=A9 + 0001:0003F944 00000068 C=CODE S=.text G=(none) M=Registry ACBP=A9 + 0001:0003F9AC 0000006C C=CODE S=.text G=(none) M=Mapi ACBP=A9 + 0001:0003FA18 00000058 C=CODE S=.text G=(none) M=ExtActns ACBP=A9 + 0001:0003FA70 00000038 C=CODE S=.text G=(none) M=ListActns ACBP=A9 + 0001:0003FAA8 0000FDAC C=CODE S=.text G=(none) M=ComCtrls ACBP=A9 + 0001:0004F854 00000ECC C=CODE S=.text G=(none) M=Themes ACBP=A9 + 0001:00050720 0000C698 C=CODE S=.text G=(none) M=StdCtrls ACBP=A9 + 0001:0005CDB8 00000168 C=CODE S=.text G=(none) M=StdActns ACBP=A9 + 0001:0005CF20 00000D1F C=CODE S=.text G=(none) M=WinHelpViewer ACBP=A9 + 0001:0005DC40 000114E3 C=CODE S=.text G=(none) M=Controls ACBP=A9 + 0001:0006F124 00001292 C=CODE S=.text G=(none) M=ActnList ACBP=A9 + 0001:000703B8 00001C04 C=CODE S=.text G=(none) M=ImgList ACBP=A9 + 0001:00071FBC 000066E1 C=CODE S=.text G=(none) M=Menus ACBP=A9 + 0001:000786A0 0000CFC0 C=CODE S=.text G=(none) M=Forms ACBP=A9 + 0001:00085660 00000050 C=CODE S=.text G=(none) M=JConsts ACBP=A9 + 0001:000856B0 000133EC C=CODE S=.text G=(none) M=jpeg ACBP=A9 + 0001:00098A9C 00000060 C=CODE S=.text G=(none) M=ComConst ACBP=A9 + 0001:00098AFC 00001259 C=CODE S=.text G=(none) M=ComObj ACBP=A9 + 0001:00099D58 00000038 C=CODE S=.text G=(none) M=StdVCL ACBP=A9 + 0001:00099D90 00001793 C=CODE S=.text G=(none) M=AxCtrls ACBP=A9 + 0001:0009B524 00000060 C=CODE S=.text G=(none) M=OleConst ACBP=A9 + 0001:0009B584 00003519 C=CODE S=.text G=(none) M=OleCtrls ACBP=A9 + 0001:0009EAA0 00000314 C=CODE S=.text G=(none) M=TlHelp32 ACBP=A9 + 0001:0009EDB4 00000128 C=CODE S=.text G=(none) M=WinSock ACBP=A9 + 0001:0009EEDC 00003A78 C=CODE S=.text G=(none) M=ScktComp ACBP=A9 + 0001:000A2954 00000040 C=CODE S=.text G=(none) M=MMSystem ACBP=A9 + 0001:000A2994 00000040 C=CODE S=.text G=(none) M=Nb30 ACBP=A9 + 0001:000A29D4 000008EA C=CODE S=.text G=(none) M=OleServer ACBP=A9 + 0001:000A32C0 00000598 C=CODE S=.text G=(none) M=MSCommLib_TLB ACBP=A9 + 0001:000A3858 00000A18 C=CODE S=.text G=(none) M=MaskUtils ACBP=A9 + 0001:000A4270 00002108 C=CODE S=.text G=(none) M=Mask ACBP=A9 + 0001:000A6378 0000A8EC C=CODE S=.text G=(none) M=Grids ACBP=A9 + 0001:000B0C64 00001BFC C=CODE S=.text G=(none) M=Spin ACBP=A9 + 0001:000B2860 00003118 C=CODE S=.text G=(none) M=ValEdit ACBP=A9 + 0001:000B5978 000039EA C=CODE S=.text G=(none) M=UnitPilote ACBP=A9 + 0001:000B9364 0000057C C=CODE S=.text G=(none) M=Importation ACBP=A9 + 0001:000B98E0 00015298 C=CODE S=.text G=(none) M=UnitAnalyseSegCDM ACBP=A9 + 0001:000CEB78 00003264 C=CODE S=.text G=(none) M=UnitConfigTCO ACBP=A9 + 0001:000D1DDC 00000D98 C=CODE S=.text G=(none) M=Unit_Pilote_aig ACBP=A9 + 0001:000D2B74 000017CC C=CODE S=.text G=(none) M=UnitFicheHoraire ACBP=A9 + 0001:000D4340 00000038 C=CODE S=.text G=(none) M=ShellConsts ACBP=A9 + 0001:000D4378 000004E0 C=CODE S=.text G=(none) M=ShellCtrls ACBP=A9 + 0001:000D4858 00002638 C=CODE S=.text G=(none) M=UnitRoute ACBP=A9 + 0001:000D6E90 00003E38 C=CODE S=.text G=(none) M=UnitRouteTrains ACBP=A9 + 0001:000DACC8 0000028C C=CODE S=.text G=(none) M=UnitInfo ACBP=A9 + 0001:000DAF54 00002B78 C=CODE S=.text G=(none) M=selection_train ACBP=A9 + 0001:000DDACC 00005630 C=CODE S=.text G=(none) M=UnitConfigCellTCO ACBP=A9 + 0001:000E30FC 00001628 C=CODE S=.text G=(none) M=UnitClock ACBP=A9 + 0001:000E4724 00000320 C=CODE S=.text G=(none) M=UnitIntro ACBP=A9 + 0001:000E4A44 00040FA8 C=CODE S=.text G=(none) M=UnitTCO ACBP=A9 + 0001:001259EC 00003B8C C=CODE S=.text G=(none) M=UnitSR ACBP=A9 + 0001:00129578 0000279C C=CODE S=.text G=(none) M=UnitCDF ACBP=A9 + 0001:0012BD14 00008D6C C=CODE S=.text G=(none) M=UnitModifAction ACBP=A9 + 0001:00134A80 00000F6C C=CODE S=.text G=(none) M=UnitHorloge ACBP=A9 + 0001:001359EC 000025CB C=CODE S=.text G=(none) M=verif_version ACBP=A9 + 0001:00137FB8 00001190 C=CODE S=.text G=(none) M=UnitPareFeu ACBP=A9 + 0001:00139148 00000D9C C=CODE S=.text G=(none) M=UnitSimule ACBP=A9 + 0001:00139EE4 00000BA8 C=CODE S=.text G=(none) M=UnitMesure ACBP=A9 + 0001:0013AA8C 0004F494 C=CODE S=.text G=(none) M=Unitprinc ACBP=A9 + 0001:00189F20 0004ABB0 C=CODE S=.text G=(none) M=UnitConfig ACBP=A9 + 0001:001D4AD0 00002EE8 C=CODE S=.text G=(none) M=UnitDebug ACBP=A9 + 0001:001D79B8 00000604 C=CODE S=.text G=(none) M=Signaux_complexes_GL ACBP=A9 0002:00000000 000000CC C=DATA S=.data G=DGROUP M=System ACBP=A9 0002:000000CC 00000020 C=DATA S=.data G=DGROUP M=SysInit ACBP=A9 0002:000000EC 00000258 C=DATA S=.data G=DGROUP M=SysUtils ACBP=A9 @@ -146,6 +145,7 @@ Detailed map of segments 0002:00001DC0 00000068 C=DATA S=.data G=DGROUP M=ShellCtrls ACBP=A9 0002:00001E28 000000D8 C=DATA S=.data G=DGROUP M=UnitTCO ACBP=A9 0002:00001F00 0000060D C=DATA S=.data G=DGROUP M=Unitprinc ACBP=A9 + 0002:00002510 000000EA C=DATA S=.data G=DGROUP M=UnitConfig ACBP=A9 0002:00004000 00000664 C=BSS S=.bss G=DGROUP M=System ACBP=A9 0002:00004664 00000010 C=BSS S=.bss G=DGROUP M=SysInit ACBP=A9 0002:00004674 00000004 C=BSS S=.bss G=DGROUP M=Types ACBP=A9 @@ -216,41 +216,40 @@ Detailed map of segments 0002:00004CB4 00000194 C=BSS S=.bss G=DGROUP M=ScktComp ACBP=A9 0002:00004E48 00000004 C=BSS S=.bss G=DGROUP M=MMSystem ACBP=A9 0002:00004E4C 00000004 C=BSS S=.bss G=DGROUP M=Nb30 ACBP=A9 - 0002:00004E50 00000004 C=BSS S=.bss G=DGROUP M=DateUtils ACBP=A9 - 0002:00004E54 00000004 C=BSS S=.bss G=DGROUP M=PsAPI ACBP=A9 - 0002:00004E58 00000004 C=BSS S=.bss G=DGROUP M=OleServer ACBP=A9 - 0002:00004E5C 00000004 C=BSS S=.bss G=DGROUP M=MSCommLib_TLB ACBP=A9 - 0002:00004E60 00000004 C=BSS S=.bss G=DGROUP M=MaskUtils ACBP=A9 - 0002:00004E64 00000004 C=BSS S=.bss G=DGROUP M=Mask ACBP=A9 - 0002:00004E68 00000004 C=BSS S=.bss G=DGROUP M=Grids ACBP=A9 - 0002:00004E6C 00000004 C=BSS S=.bss G=DGROUP M=Spin ACBP=A9 - 0002:00004E70 0000002C C=BSS S=.bss G=DGROUP M=UnitDebug ACBP=A9 - 0002:00004E9C 00002494 C=BSS S=.bss G=DGROUP M=UnitPilote ACBP=A9 - 0002:00007330 00000010 C=BSS S=.bss G=DGROUP M=Importation ACBP=A9 - 0002:00007340 000148A4 C=BSS S=.bss G=DGROUP M=UnitAnalyseSegCDM ACBP=A9 - 0002:0001BBE4 00000014 C=BSS S=.bss G=DGROUP M=UnitConfigTCO ACBP=A9 - 0002:0001BBF8 00000014 C=BSS S=.bss G=DGROUP M=Unit_Pilote_aig ACBP=A9 - 0002:0001BC0C 00001C2C C=BSS S=.bss G=DGROUP M=UnitFicheHoraire ACBP=A9 - 0002:0001D838 00000004 C=BSS S=.bss G=DGROUP M=ShellConsts ACBP=A9 - 0002:0001D83C 0000001C C=BSS S=.bss G=DGROUP M=ShellCtrls ACBP=A9 - 0002:0001D858 00000DF4 C=BSS S=.bss G=DGROUP M=UnitRoute ACBP=A9 - 0002:0001E64C 0000000C C=BSS S=.bss G=DGROUP M=UnitRouteTrains ACBP=A9 - 0002:0001E658 0000000C C=BSS S=.bss G=DGROUP M=UnitInfo ACBP=A9 - 0002:0001E664 00000CB4 C=BSS S=.bss G=DGROUP M=selection_train ACBP=A9 - 0002:0001F318 00000020 C=BSS S=.bss G=DGROUP M=UnitConfigCellTCO ACBP=A9 - 0002:0001F338 00000034 C=BSS S=.bss G=DGROUP M=UnitClock ACBP=A9 - 0002:0001F36C 0000000C C=BSS S=.bss G=DGROUP M=UnitIntro ACBP=A9 - 0002:0001F378 00533C6C C=BSS S=.bss G=DGROUP M=UnitTCO ACBP=A9 - 0002:00552FE4 00000010 C=BSS S=.bss G=DGROUP M=UnitSR ACBP=A9 - 0002:00552FF4 00000014 C=BSS S=.bss G=DGROUP M=UnitCDF ACBP=A9 - 0002:00553008 00000018 C=BSS S=.bss G=DGROUP M=UnitModifAction ACBP=A9 - 0002:00553020 000005C0 C=BSS S=.bss G=DGROUP M=UnitConfig ACBP=A9 - 0002:005535E0 00000038 C=BSS S=.bss G=DGROUP M=UnitHorloge ACBP=A9 - 0002:00553618 000001EC C=BSS S=.bss G=DGROUP M=verif_version ACBP=A9 - 0002:00553804 00000004 C=BSS S=.bss G=DGROUP M=UnitPareFeu ACBP=A9 - 0002:00553808 0000000C C=BSS S=.bss G=DGROUP M=UnitSimule ACBP=A9 - 0002:00553814 00000024 C=BSS S=.bss G=DGROUP M=UnitMesure ACBP=A9 - 0002:00553838 28A615D0 C=BSS S=.bss G=DGROUP M=Unitprinc ACBP=A9 + 0002:00004E50 00000004 C=BSS S=.bss G=DGROUP M=OleServer ACBP=A9 + 0002:00004E54 00000004 C=BSS S=.bss G=DGROUP M=MSCommLib_TLB ACBP=A9 + 0002:00004E58 00000004 C=BSS S=.bss G=DGROUP M=MaskUtils ACBP=A9 + 0002:00004E5C 00000004 C=BSS S=.bss G=DGROUP M=Mask ACBP=A9 + 0002:00004E60 00000004 C=BSS S=.bss G=DGROUP M=Grids ACBP=A9 + 0002:00004E64 00000004 C=BSS S=.bss G=DGROUP M=Spin ACBP=A9 + 0002:00004E68 00000004 C=BSS S=.bss G=DGROUP M=ValEdit ACBP=A9 + 0002:00004E6C 00002494 C=BSS S=.bss G=DGROUP M=UnitPilote ACBP=A9 + 0002:00007300 00000010 C=BSS S=.bss G=DGROUP M=Importation ACBP=A9 + 0002:00007310 000148A4 C=BSS S=.bss G=DGROUP M=UnitAnalyseSegCDM ACBP=A9 + 0002:0001BBB4 00000014 C=BSS S=.bss G=DGROUP M=UnitConfigTCO ACBP=A9 + 0002:0001BBC8 00000014 C=BSS S=.bss G=DGROUP M=Unit_Pilote_aig ACBP=A9 + 0002:0001BBDC 00001C2C C=BSS S=.bss G=DGROUP M=UnitFicheHoraire ACBP=A9 + 0002:0001D808 00000004 C=BSS S=.bss G=DGROUP M=ShellConsts ACBP=A9 + 0002:0001D80C 0000001C C=BSS S=.bss G=DGROUP M=ShellCtrls ACBP=A9 + 0002:0001D828 00000DF8 C=BSS S=.bss G=DGROUP M=UnitRoute ACBP=A9 + 0002:0001E620 0000000C C=BSS S=.bss G=DGROUP M=UnitRouteTrains ACBP=A9 + 0002:0001E62C 0000000C C=BSS S=.bss G=DGROUP M=UnitInfo ACBP=A9 + 0002:0001E638 00000CB4 C=BSS S=.bss G=DGROUP M=selection_train ACBP=A9 + 0002:0001F2EC 00000020 C=BSS S=.bss G=DGROUP M=UnitConfigCellTCO ACBP=A9 + 0002:0001F30C 00000034 C=BSS S=.bss G=DGROUP M=UnitClock ACBP=A9 + 0002:0001F340 00000010 C=BSS S=.bss G=DGROUP M=UnitIntro ACBP=A9 + 0002:0001F350 00537330 C=BSS S=.bss G=DGROUP M=UnitTCO ACBP=A9 + 0002:00556680 00000010 C=BSS S=.bss G=DGROUP M=UnitSR ACBP=A9 + 0002:00556690 00000014 C=BSS S=.bss G=DGROUP M=UnitCDF ACBP=A9 + 0002:005566A4 00000018 C=BSS S=.bss G=DGROUP M=UnitModifAction ACBP=A9 + 0002:005566BC 00000038 C=BSS S=.bss G=DGROUP M=UnitHorloge ACBP=A9 + 0002:005566F4 000001E8 C=BSS S=.bss G=DGROUP M=verif_version ACBP=A9 + 0002:005568DC 00000004 C=BSS S=.bss G=DGROUP M=UnitPareFeu ACBP=A9 + 0002:005568E0 0000000C C=BSS S=.bss G=DGROUP M=UnitSimule ACBP=A9 + 0002:005568EC 00000024 C=BSS S=.bss G=DGROUP M=UnitMesure ACBP=A9 + 0002:00556910 28ACDAF4 C=BSS S=.bss G=DGROUP M=Unitprinc ACBP=A9 + 0002:29024404 00000890 C=BSS S=.bss G=DGROUP M=UnitConfig ACBP=A9 + 0002:29024C94 0000002C C=BSS S=.bss G=DGROUP M=UnitDebug ACBP=A9 Bound resource files @@ -258,7 +257,6 @@ c:\program files (x86)\borland\delphi7\Lib\Buttons.res c:\program files (x86)\borland\delphi7\Lib\ExtDlgs.res c:\program files (x86)\borland\delphi7\Lib\Controls.res c:\program files (x86)\borland\delphi7\Lib\SPIN.RES -UnitDebug.dfm UnitPilote.dfm Importation.dfm UnitAnalyseSegCDM.dfm @@ -276,14 +274,15 @@ UnitTCO.dfm UnitSR.dfm UnitCDF.dfm UnitModifAction.dfm -UnitConfig.dfm UnitHorloge.dfm verif_version.dfm UnitSimule.dfm UnitMesure.dfm Unitprinc.dfm +UnitConfig.dfm +UnitDebug.dfm Signaux_complexes_GL.res Signaux_complexes_GL.drf -Program entry point at 0001:001C3F78 +Program entry point at 0001:001D7D30 diff --git a/UnitAnalyseSegCDM.dfm b/UnitAnalyseSegCDM.dfm index 809d616..98790ce 100644 --- a/UnitAnalyseSegCDM.dfm +++ b/UnitAnalyseSegCDM.dfm @@ -113,17 +113,17 @@ object FormAnalyseCDM: TFormAnalyseCDM TabOrder = 0 OnClick = CheckConnexionsClick end - object CheckAdresses: TCheckBox + object CheckDet: TCheckBox Left = 8 Top = 32 Width = 97 Height = 17 - Hint = 'Adresses des d'#233'tecteurs et actionneurs' - Caption = 'Adresses' + Hint = 'Adresses des d'#233'tecteurs' + Caption = 'Adresses det' ParentShowHint = False ShowHint = True TabOrder = 1 - OnClick = CheckAdressesClick + OnClick = CheckDetClick end object CheckSegments: TCheckBox Left = 128 @@ -135,7 +135,7 @@ object FormAnalyseCDM: TFormAnalyseCDM OnClick = CheckSegmentsClick end object CheckPorts: TCheckBox - Left = 128 + Left = 240 Top = 32 Width = 65 Height = 17 @@ -179,7 +179,7 @@ object FormAnalyseCDM: TFormAnalyseCDM OnClick = ButtonAffDetClick end object CheckColorationDiff: TCheckBox - Left = 232 + Left = 240 Top = 16 Width = 137 Height = 17 @@ -205,6 +205,18 @@ object FormAnalyseCDM: TFormAnalyseCDM TabOrder = 10 OnClick = ButtonImprimeClick end + object CheckBoxAutres: TCheckBox + Left = 128 + Top = 32 + Width = 97 + Height = 17 + Hint = 'Adresses des aiguillages, actionneurs et signaux' + Caption = 'Autres adresses' + ParentShowHint = False + ShowHint = True + TabOrder = 11 + OnClick = CheckDetClick + end end object TrackBar1: TTrackBar Left = 1001 @@ -225,7 +237,7 @@ object FormAnalyseCDM: TFormAnalyseCDM object GroupBoxSegment: TGroupBox Left = 400 Top = 484 - Width = 145 + Width = 177 Height = 109 Anchors = [akLeft, akBottom] Caption = 'Segment' @@ -239,14 +251,14 @@ object FormAnalyseCDM: TFormAnalyseCDM end object LabelAdresse: TLabel Left = 11 - Top = 48 + Top = 44 Width = 44 Height = 13 Caption = 'Adresse :' end object LabelPorts: TLabel Left = 11 - Top = 74 + Top = 66 Width = 33 Height = 13 Caption = 'Ports : ' @@ -262,7 +274,7 @@ object FormAnalyseCDM: TFormAnalyseCDM end object EditAdresse: TEdit Left = 64 - Top = 44 + Top = 40 Width = 57 Height = 21 Hint = 'Changement de l'#39'adresse de l'#39'aiguillage' @@ -273,7 +285,7 @@ object FormAnalyseCDM: TFormAnalyseCDM end end object Memo1: TMemo - Left = 552 + Left = 584 Top = 492 Width = 105 Height = 93 @@ -297,7 +309,7 @@ object FormAnalyseCDM: TFormAnalyseCDM OnClick = ButtonAnimeClick end object PrintDialog1: TPrintDialog - Left = 688 + Left = 728 Top = 560 end end diff --git a/UnitAnalyseSegCDM.pas b/UnitAnalyseSegCDM.pas index 317db46..3d8f344 100644 --- a/UnitAnalyseSegCDM.pas +++ b/UnitAnalyseSegCDM.pas @@ -28,7 +28,7 @@ type ImageCDM: TImage; GroupBox1: TGroupBox; CheckConnexions: TCheckBox; - CheckAdresses: TCheckBox; + CheckDet: TCheckBox; CheckSegments: TCheckBox; TrackBar1: TTrackBar; CheckPorts: TCheckBox; @@ -52,10 +52,11 @@ type PrintDialog1: TPrintDialog; ButtonAnime: TButton; ImageLoco: TImage; + CheckBoxAutres: TCheckBox; procedure FormResize(Sender: TObject); procedure CheckSegmentsClick(Sender: TObject); procedure CheckConnexionsClick(Sender: TObject); - procedure CheckAdressesClick(Sender: TObject); + procedure CheckDetClick(Sender: TObject); procedure TrackBar1Change(Sender: TObject); procedure ButtonAffPortClick(Sender: TObject); procedure FormCreate(Sender: TObject); @@ -168,7 +169,7 @@ var Segment : array of Tsegment; reducX,reducY,ArcTanHautLargTrain : single; FormAnalyseCDM: TFormAnalyseCDM; sBranche,NomModuleCDM : string; - clic,premaff : boolean; + clic,premaff,adr_nulle : boolean; Aig_CDM : array[0..NbreMaxiAiguillages] of TAig_CDM; Det_CDM : array[1..500] of integer; FWICImage : tBitmap; @@ -598,6 +599,7 @@ begin begin Affiche('Aiguillage segment '+intToSTR(segment[nSeg-1].numero)+' adresse nulle',clred); AfficheDebug('Aiguillage segment '+intToSTR(segment[nSeg-1].numero)+' adresse nulle',clred); + adr_nulle:=true; end; if i>DernAdrAig then DernAdrAig:=i; @@ -1328,7 +1330,7 @@ begin SinCos(Angle,SinA,CosA); Result.eM11:=CosA; Result.eM12:=SinA; - Result.eM21:=-SinA; + Result.eM21:=-SinA; Result.eM22:=CosA; Result.eDx:=(Centre.X - (CosA*Centre.X)) + (SinA*Centre.Y); Result.eDy:=(Centre.Y - (SinA*Centre.X)) - (CosA*Centre.Y); @@ -1461,7 +1463,6 @@ begin premaff:=false; Acanvas.CopyRect(recta,trains[IndexTrain].SBitmap.canvas,rect(0,0,trains[IndexTrain].x1-trains[IndexTrain].x0,trains[IndexTrain].y1-trains[IndexTrain].y0)); // copie dans Acanvas <-- SbitMap.canvas - // sauvegarder à la nouvelle position avant d'afficher la nouvelle position recta:=rect(x0,y0,x1,y1); trains[IndexTrain].sbitmap.canvas.CopyRect(rect(0,0,larg,haut),Acanvas,recta); // copie dans sbitmap.canvas <-- Acanvas @@ -1503,7 +1504,7 @@ procedure affichage(imprime : boolean); const LargeurMaxi=3000; var r : Trect; i,j,x1,x2,y1,y2,largeur,hauteur,rayon,centreX,centreY,Numsegment,largeurCDM,hauteurCDM, - maxiCDM,offset,ofs,CadreImp : integer; + maxiCDM,offset,ofs,CadreImp,TailleFonte : integer; SegType,s,s2,ctyp : string; Ech,Zoom,startAngle,StopAngle: single; portsSeg : array[0..40] of record x,y : integer; end; @@ -1531,7 +1532,7 @@ begin hauteurCDM:=(YmaxiCDM-YminiCDM); maxiCDM:=max(largeurCDM,hauteurCDM); - + TailleFonte:=8; reducX:=1000*(largeur-(2*cadre))/maxiCDM; reducY:=reducX; largeur:=(round(largeurCDM*reducX/1000))-2*cadre; @@ -1549,14 +1550,15 @@ begin begin largeur:=3000; // la largeur est fixée, la hauteur est calculée - largeurCDM:=(XmaxiCDM-XminiCDM);// div 20; - hauteurCDM:=(YmaxiCDM-YminiCDM);// div 20; + largeurCDM:=(XmaxiCDM-XminiCDM);// div 20; //XmaxiCDM=29610/29610 XminiCDM -24168/280 + hauteurCDM:=(YmaxiCDM-YminiCDM);// div 20; // largeurCDM 53778/29330 maxiCDM:=max(largeurCDM,hauteurCDM); Zoom:=(2*(90-formAnalyseCDM.TrackBar1.Position)/100)+0.4; reducX:=1000*Zoom*(largeur)/maxiCDM; reducY:=reducX; + TailleFonte:=round(zoom*20); largeur_voie:=round(reducX/8); @@ -1568,6 +1570,7 @@ begin ImageCDM.Picture.Bitmap.Width:=largeur; ImageCDM.Picture.Bitmap.height:=hauteur; + with scrollBox1 do begin HorzScrollBar.Range:=largeur; @@ -1580,6 +1583,7 @@ begin end; end; + with Canvas do begin //effacer tout @@ -1675,7 +1679,7 @@ begin with canvas do begin pen.Color:=clOrange; - pen.width:=1; + pen.width:=2; Ellipse(x1-5,y1-5,x1+5,y1+5); canvas.pen.Color:=clWhite; end; @@ -1726,7 +1730,7 @@ begin moveto(portsSeg[1].x,portsSeg[1].y); LineTo(portsSeg[3].x,portsSeg[3].y); end; - if formAnalyseCDM.CheckAdresses.checked then coords_aff_aig(canvas,i); + if formAnalyseCDM.CheckBoxAutres.checked then coords_aff_aig(canvas,i); end else if (segtype='turnout') or (segtype='turnout_sym') then @@ -1739,7 +1743,7 @@ begin LineTo(portsSeg[1].x,portsSeg[1].y); moveTo((portsSeg[0].x+portsSeg[1].x) div 2,(portsSeg[0].y+portsSeg[1].y) div 2); LineTo(portsSeg[2].x,portsSeg[2].y); - if formAnalyseCDM.CheckAdresses.checked then coords_aff_aig(canvas,i); + if formAnalyseCDM.CheckBoxAutres.checked then coords_aff_aig(canvas,i); end else if (segtype='turnout_3way') then @@ -1753,7 +1757,7 @@ begin LineTo(portsSeg[2].x,portsSeg[2].y); moveTo((portsSeg[0].x+portsSeg[1].x) div 2,(portsSeg[0].y+portsSeg[1].y) div 2); LineTo(portsSeg[3].x,portsSeg[3].y); - if formAnalyseCDM.CheckAdresses.checked then coords_aff_aig(canvas,i); + if formAnalyseCDM.CheckBoxAutres.checked then coords_aff_aig(canvas,i); end else if (segtype='turnout_curved') or (segtype='turnout_curved_2r') @@ -1771,7 +1775,7 @@ begin LineTo(portsSeg[2].x,portsSeg[2].y); //dessine_aig_courbe(canvas,i); - if formAnalyseCDM.CheckAdresses.checked then coords_aff_aig(canvas,i); + if formAnalyseCDM.CheckBoxAutres.checked then coords_aff_aig(canvas,i); end else if (segType='arc') or (segType='curve') then @@ -1810,17 +1814,30 @@ begin with Canvas do begin coords(x1,y1); - if formAnalyseCDM.CheckAdresses.checked then + if formAnalyseCDM.CheckBoxAutres.checked and (ctyp<>'detector') then begin ofs:=0; - if ctyp='detector' then begin couleur:=clAqua;ofs:=-15;end; if ctyp='actuator' then begin couleur:=clorange;ofs:=5;end; if ctyp='signal' then begin couleur:=clWhite;ofs:=5;end; font.color:=couleur; + font.Size:=TailleFonte; + //Affiche(intToSTR(round(zoom /10)),clyellow); pen.color:=couleur; textout(x1+4,y1+ofs,s2); - pen.Width:=1; + pen.Width:=2; + Ellipse(x1-5,y1-5,x1+5,y1+5); + end; + if formAnalyseCDM.CheckDet.checked and (ctyp='detector') then + begin + couleur:=clAqua;ofs:=-15; + font.color:=couleur; + font.Size:=TailleFonte; + //Affiche(intToSTR(round(zoom /10)),clyellow); + pen.color:=couleur; + + textout(x1+4,y1+ofs,s2); + pen.Width:=2; Ellipse(x1-5,y1-5,x1+5,y1+5); end; end; @@ -1871,11 +1888,26 @@ begin end; end; -// renvoie si le segment est de type aiguillage et contient une adresse + +// renvoie si le segment est de type aiguillage sans croisement +function segment_aig_strict(s : string) : boolean; +begin + result:=(s='turnout') or (s='dbl_slip_switch') or (s='turnout_sym') or + (s='turnout_curved') or (s='turnout_curved_2r') or (s='turnout_3way') ; +end; + +// renvoie si le segment est de type aiguillage croisement compris function segment_aig(s : string) : boolean; begin - segment_aig:=(s='turnout') or (s='dbl_slip_switch') or (s='turnout_sym') or - (s='turnout_curved') or (s='turnout_curved_2r') or (s='turnout_3way') ; + result:=(s='turnout') or (s='dbl_slip_switch') or (s='turnout_sym') or + (s='turnout_curved') or (s='turnout_curved_2r') or (s='turnout_3way') or + (s='crossing'); +end; + +// renvoie si le segment est de type tjd +function segment_tjd(s : string) : boolean; +begin + result:=(s='dbl_slip_switch') ; end; // trouve l'index du port du segment courant connecté au segment dont l'index est Indexconnecte @@ -1893,7 +1925,6 @@ begin if trouve then IndexPort:=i else indexPort:=-1; end; - // trouve l'index du segment contenant l'aiguillage adresse function trouve_IdSegment_aig(adresse : integer;var Id: integer) : boolean; var i,p,p2 : integer; @@ -1920,7 +1951,6 @@ begin end end; - // trouve les index Segment et port contenant le détecteur est detecteur function trouve_IndexSegPortDetecteur(detecteur : integer;var indexSeg,indexPeriph : integer) : boolean; var i,j,p,np : integer; @@ -2184,7 +2214,7 @@ begin exit; end; - if segment_aig(typeP) then // est-ce un aig + if segment_aig_strict(typeP) then // est-ce un aig hors croisement //------------- aiguillage begin portlocal:=segment[idSeg].port[idport].local; @@ -2289,7 +2319,7 @@ begin end; -// fonction récursive +// fonction récursive jamais exécutée // explore le port,segment jusqu'à trouver une adresse de détecteur // un détecteur peut être sur un port de l'aiguillage // renvoie l'adresse de l'aiguillage ou du détecteur et dans C le port (P D S ou Z pour un détecteur) @@ -2302,7 +2332,7 @@ var i,j,IdSeg,IdPort,NombrePeriph,port1,port2,portSuivant,segSuivant,portLocal, begin if seg=0 then begin - explore_port_det:=0; + result:=0; exit; // laisser sinon mauvais transfert de variable dans la pile dans l'itération suivante!! end; if not(trouve_IndexSegPort(seg,port,idSeg,IdPort)) then @@ -2310,7 +2340,7 @@ begin serr:='Erreur 1 pas trouvé le port '+intToSTR(port)+' dans la liste des segments'; Affiche(serr,clred); AfficheDebug(serr,clred); - explore_port_det:=0; + result:=0; exit; end; @@ -2343,7 +2373,7 @@ begin serr:='Erreur 2 pas trouvé le port '+intToSTR(port)+' dans la liste des segments'; Affiche(serr,clred); AfficheDebug(serr,clred); - explore_port_det:=0; + result:=0; exit; end; @@ -2365,6 +2395,7 @@ begin explore_port_det(SegSuivant,segment[idseg].port[0].numero); explore_port_det(SegSuivant,segment[idseg].port[1].numero); end; + result:=0; exit; end; @@ -2380,6 +2411,7 @@ begin end; 1,2 : explore_port_det(SegSuivant,segment[idseg].port[0].numero); end; + result:=0; exit; end; @@ -2393,6 +2425,7 @@ begin 2 : explore_port_det(SegSuivant,segment[idseg].port[0].numero); 3 : explore_port_det(SegSuivant,segment[idseg].port[1].numero); end; + result:=0; exit; end; @@ -2432,7 +2465,7 @@ begin trier(Sdetect,nb_det); // on prend le premier!! - explore_port_det:=sDetect[1].adresse; + result:=sDetect[1].adresse; exit; end; end; @@ -2442,7 +2475,7 @@ begin NombrePeriph:=segment[idSeg].nport; if NombrePeriph=0 then begin - explore_port_det:=0; + result:=0; exit; end; port1:=segment[idSeg].port[0].numero; @@ -2451,10 +2484,10 @@ begin if (port1<>portSuivant) and (segment[idSeg].port[0].connecte) then i:=explore_port_det(SegSuivant,port1); if (port2<>portSuivant) and (segment[idSeg].port[1].connecte) then i:=explore_port_det(SegSuivant,port2); - explore_port_det:=i; + result:=i; exit; - typeP:=segment[idSeg].typ; + // pas exécuté typeP:=segment[idSeg].typ; // explorer l'autre port if (typeP='straight') or (typeP='arc') or (typeP='curve') or (typeP='pre_curve') then begin @@ -2462,17 +2495,15 @@ begin port2:=segment[idSeg].port[1].numero; if port1<>portSuivant then i:=explore_port_det(SegSuivant,port1); if port2<>portSuivant then i:=explore_port_det(SegSuivant,port2); - explore_port_det:=i; + result:=i; exit; end; Affiche('Segment '+typeP+' non trouvé',clred); - explore_Port_det:=0; + result:=0; end; - - // stocke les aiguillages et les croisement dans le tableau Aig_CDM procedure remplit_Aig_cdm; var i,j,NumSegment,IndexSegment,IndexPort,index,index2,g, @@ -2505,6 +2536,7 @@ begin if formImportation.radioCroisBase.checked then AdrCroisement:=BaseCroisement+SeqAdrCroisement; segment[i].adresse:=AdrCroisement; + inc(nAig_CDM); Aig_CDM[nAig_CDM].adresse:=AdrCroisement; Aig_CDM[nAig_CDM].modele:=crois; @@ -2537,6 +2569,7 @@ begin if debugAnalyse then begin + AfficheDebug(' ',clWhite); AfficheDebug('Liste des aiguillages',clWhite); AfficheDebug('--------------------------------',clWhite); end; @@ -2544,7 +2577,7 @@ begin for i:=0 to nseg-1 do begin segType:=segment[i].typ; - if segment_aig(segtype) then + if segment_aig_strict(segtype) then begin numSegment:=segment[i].numero; adresse:=segment[i].adresse; @@ -2878,6 +2911,29 @@ begin end; end; +function trouve_IdSegment(Seg : integer): integer; +var i,p : integer ; + trouve : boolean; +begin + i:=0; + repeat + p:=segment[i].numero; + trouve:=(p=Seg); + inc(i); + until (i>nSeg-1) or trouve; + dec(i); + if trouve then + begin + trouve_IdSegment:=i; + end + else + begin + trouve_IdSegment:=0; + end +end; + + + // trouve le segment suivant du segment index, opposé au port // 170 seg=169 171 | 173 Seg=172 174 | // exemple trouve_seg_suivant(169,171) => 172 173 dans IndexSegSuiv,IndexportSuiv @@ -2955,7 +3011,7 @@ begin result:=copy(s,i+1,l-i); exit; end; - result:=''; + result:=s; exit; end; @@ -2978,21 +3034,28 @@ end; // créée la branche depuis un aiguillage dont un des ports est un détecteur +// jusqu'au nombre d'aiguillages rencontrés (NbreMaxiAigRencontres) (pas une TJD) // indexSeg,port : index du segment et port de départ (0=pointe,1=droit,2=dévié) // AdrAig : adresse de l'aiguillage qui a servi de départ // et remplit la branche (sBranche) procedure cree_branche_aig(indexSeg,Indexport,adrAig,NbreMaxiAigRencontres : integer); -var i,j,k,l,n,nper,nport,naig,IndexportSuivant,indexSegSuivant,NombrePeriph, +const mit=60; +var Nel,it,i,j,k,l,m,n,o,nper,nport,naig,IndexportSuivant,indexSegSuivant,NombrePeriph, detecteur,indexElBranche,AdrAigRencontre,numSegment, rien,erreur,det2,nb_det,xp,yp,xd,yd,Adr2,AdrDer,idx : integer; trouve,doublon : boolean; s,ss,ctype,derch: string; sdetect : Tdetect_cdm; begin +{ if segment[indexSeg].typ='dbl_slip_switch' then + begin + //AfficheDebug('cree_branche_aig: départ depuis TJD '+intToSTR(adrAig)+' impossible',clred); + //exit; + end; } if debugBranche then AfficheDebug('Création branche depuis aiguillage '+intToSTR(AdrAig),clyellow); raz_detect(sdetect); AdrAigRencontre:=0; - i:=0; Naig:=0; + Nel:=0; it:=0; Naig:=0; repeat // trouver le port du détecteur nper:=Segment[indexSeg].nperiph; // y a t-il des périph (recherche det) @@ -3008,6 +3071,7 @@ begin detecteur:=Segment[indexSeg].periph[nperiph].adresse; if debugBranche then Affiche('Cet aiguillage porte le détecteur '+intToSTR(detecteur),clYellow); sBranche:='A'+intToSTR(segment[indexSeg].adresse)+','+intToSTR(detecteur); + inc(nEl);// nombre éléments dans la branche end; end; inc(n); @@ -3018,9 +3082,11 @@ begin begin numsegment:=segment[indexSeg].numero; NumPort:=segment[indexSeg].port[IndexPort].numero; - AfficheDebug(intToSTR(i)+' Trouve suivant au= '+intToSTR(numSegment)+' '+intToSTR(NumPort),clOrange); + AfficheDebug(intToSTR(Nel)+' Trouve suivant au= '+intToSTR(numSegment)+' '+intToSTR(NumPort),clOrange); end; + trouve:=trouve_Seg_suivant(indexSeg,indexport,IndexSegSuivant,IndexportSuivant); + if not(trouve) then begin s:='Pas de segment suivant à '+intToSTR(numSegment)+' '+intToSTR(NumPort); @@ -3037,45 +3103,69 @@ begin if NivDebug=3 then AfficheDebug(' Suivant= '+intToSTR(numSegment)+' '+intToSTR(NumPort),clOrange); ctype:=segment[indexSegSuivant].typ; - // est-ce un aiguillage + // est-ce un aiguillage ou tjd (croisement compris) if segment_aig(ctype) then begin AdrAigRencontre:=segment[indexSegSuivant].adresse; if debugBranche then Affichedebug('Aiguillage '+intTostr(adrAigRencontre),clyellow); - if (ctype='dbl_slip_switch') and (segment[indexSegSuivant].adresse2<>0) then + // cas d'une tjd double ou simple + if (ctype='dbl_slip_switch') then begin // dernier élément rencontré - adr2:=segment[indexSegSuivant].adresse2; + adr2:=0; + inc(nAig); + if (segment[indexSegSuivant].adresse2<>0) then adr2:=segment[indexSegSuivant].adresse2; derch:=dernier_champ(sBranche); - if derch[1]='A' then begin derch:=copy(derch,2,length(derch)-1);end; + //if derch='' then Affiche('error',clred); + if derch<>'' then if derch[1]='A' then begin derch:=copy(derch,2,length(derch)-1);end; val(derch,AdrDer,erreur); idx:=index_aig(AdrAigRencontre); - // trouver de quel côté on va à la TJD - if (aiguillage[idx].ADroit=AdrDer) or (aiguillage[idx].ADevie=AdrDer) then - sbranche:=sbranche+',A'+intToSTR(AdrAigRencontre)+',A'+intToSTR(adr2) - else + + if adr2<>0 then // est-ce une tjd double (4 états)? begin - idx:=index_aig(Adr2); + // trouver de quel côté on va à la TJD double + inc(nEl,2); if (aiguillage[idx].ADroit=AdrDer) or (aiguillage[idx].ADevie=AdrDer) then - sbranche:=sbranche+',A'+intToSTR(adr2)+',A'+intToSTR(AdrAigRencontre) + begin + // si on est en fin de branche, on ne met qu'une adresse de la tjd double, sinon on met les 2 + // if nAig=NbreMaxiAigRencontres then sbranche:=sbranche+',A'+intToSTR(AdrAigRencontre) else + sbranche:=sbranche+',A'+intToSTR(AdrAigRencontre)+',A'+intToSTR(adr2) + end + else begin - s:='TJD '+intToSTR(Adr2)+'/'+intToSTR(adrAigRencontre)+'non résolue en branche '+intToSTR(nbreBranches)+'. Une vérification manuelle est nécessaire.'; - Affiche(s,clred); - if debugBranche then AfficheDebug(s,clred); - sbranche:=sbranche+',A??,A??'; + idx:=index_aig(Adr2); + if (aiguillage[idx].ADroit=AdrDer) or (aiguillage[idx].ADevie=AdrDer) then + begin + //if nAig=NbreMaxiAigRencontres then sbranche:=sbranche+',A'+intToSTR(adr2) else + sbranche:=sbranche+',A'+intToSTR(adr2)+',A'+intToSTR(AdrAigRencontre) + end + else + begin + s:='TJD '+intToSTR(Adr2)+'/'+intToSTR(adrAigRencontre)+'non résolue en branche '+intToSTR(nbreBranches)+'. Une vérification manuelle est nécessaire.'; + Affiche(s,clred); + if debugBranche then AfficheDebug(s,clred); + sbranche:=sbranche+',A??,A??'; + end; end; + end + else + begin + // TJD 2 états + sbranche:=sbranche+',A'+intToSTR(adrAigrencontre); + inc(nEl); end; - // sbranche:=sbranche+',A'+intToSTR(adrAigRencontre)+',A'+intToSTR(adr2); - inc(nAig); + raz_detect(sdetect); end else begin + // aiguillage non tjd sBranche:=sBranche+',A'+intToSTR(AdrAigRencontre); + inc(nEl); //if debugBranche then AfficheDebug('Aiguillage '+intToSTR(segment[indexSegSuivant].adresse),clorange); inc(nAig); // à la première itération on a un aiguillage raz_detect(sdetect); @@ -3083,17 +3173,19 @@ begin end; // est-ce un croisement - if ctype='crossing' then +{ if ctype='crossing' then begin sBranche:=sBranche+',A'+intToSTR(segment[indexSegSuivant].adresse); + inc(nEl); if debugBranche then Affichedebug('croisement',clyellow); //if debugBranche then AfficheDebug('Croisement '+intToSTR(segment[indexSegSuivant].adresse),clorange); raz_detect(sdetect); end; - + } if ctype='bumper_stop' then begin sBranche:=sBranche+',0'; + inc(nel); if NivDebug=3 then Affichedebug('buttoir',clyellow); //if debugBranche then AfficheDebug('Buttoir',clorange); trouve:=false; @@ -3103,6 +3195,7 @@ begin if ctype='turntable' then begin sBranche:=sBranche+',0'; + inc(nEl); if NivDebug=3 then Affichedebug('table tournante',clyellow); //if debugBranche then AfficheDebug('Buttoir',clorange); trouve:=false; @@ -3142,21 +3235,43 @@ begin inc(j); until (j>NombrePeriph-1) ; + // si il y a des détecteurs dans le périph if nb_det<>0 then begin // trier les détecteurs du segment dans l'ordre de la distance de la plus // courte à la plus grande au port trier(Sdetect,nb_det); + // supprimer les détecteurs redondants (ex: Sdetect=556,536,556,536) supprimer 556 et 536 de fin, reste (556,536) + if nb_det>=3 then + begin + j:=1; + repeat + m:=j+1; + repeat + if Sdetect[j].adresse=Sdetect[m].adresse then + begin + // supprime élément m + if debugBranche then AfficheDebug('Détecteur '+intToSTR(Sdetect[m].adresse)+' supprimé',clOrange); + for o:=m to nb_det do Sdetect[m]:=Sdetect[o]; + Sdetect[nb_det].adresse:=0; + dec(nb_det); + end; + inc(m); + until m>nb_det; + inc(j); + until (j>nb_det); + end; for j:=1 to nb_det do begin - // vérifier si le détecteur est déja en fin de branche - // nouveau détecteur doublon + // vérifier si le détecteur est déja en fin de branche + // détecteur doublon detecteur:=sDetect[j].adresse; doublon:=presence_detecteur_fin(sbranche,detecteur); if not(doublon) then begin sbranche:=sbranche+','+intToSTR(detecteur); + inc(nel); if debugBranche then Affichedebug('Détecteur '+intToSTR(j)+'/'+intToSTR(nb_det)+': pris en compte : '+intToSTR(detecteur),clyellow); end else @@ -3179,16 +3294,20 @@ begin trouve_IndexSegPort(Numsegment,port,rien,indexPort); end; end; - inc(i); - - until not(trouve) or (nAig=NbreMaxiAigRencontres) or (i>50) or (adrAig=AdrAigRencontre); + inc(it); + // si rebouclage + until not(trouve) or (nAig=NbreMaxiAigRencontres) or (it>mit) or (adrAig=AdrAigRencontre); if debugBranche then begin if not(trouve) then AfficheDebug('Arrêt sur non trouvé suivant ou buttoir ou table',clYellow); if (adrAig=AdrAigRencontre) then AfficheDebug('Arret sur bouclage d''aiguillage',clyellow); if nAig=NbreMaxiAigRencontres then AfficheDebug('Arret sur aiguillage '+intToSTR(segment[indexSeg].adresse),clYellow); - if i>50 then AfficheDebug('Arret sur itérations',clyellow); + if it>mit then + begin + AfficheDebug('Arret sur itérations',clred); + exit; // pas de création de branche sur arret sur itération + end; end; // vérifier si la branche créée est valide --------------------------------- @@ -3198,8 +3317,8 @@ begin begin if ss[1]<>'A' then begin - val(ss,i,erreur); - if i<>0 then + val(ss,j,erreur); + if j<>0 then begin if debugBranche then begin @@ -3254,15 +3373,56 @@ begin exit; end; + // vérifier si suite de détecteurs dans la branche + j:=0; + s:=sbranche; + repeat + i:=0; + repeat + j:=posEx(',',s,j+1); + if length(s)>1 then + begin + if s[j+1]<>'A' then + begin + // détecteur à comparer + ss:=s; + delete(ss,1,j); + val(ss,detecteur,erreur); + i:=j; + repeat + i:=posEx(',',s,i+1); + // détecteur suivant + if i<>0 then + begin + if s[i+1]<>'A' then + begin + // détecteur à comparer + ss:=s; + delete(ss,1,i); + val(ss,det2,erreur); + if detecteur=det2 then + begin + l:=posEX(',',s,i+1); + delete(s,i,l-i); + end; + end; + end; + until i=0; + end; + end; + until i=0; + until j=0; + sbranche:=s; + // ok inc(NbreBranches); branche[nbreBranches]:=sBranche; - if debugBranche then AfficheDebug('Création branche '+sBranche,clwhite); + if debugBranche then AfficheDebug('Création branche '+intToSTR(NbreBranches)+' : '+sBranche,clwhite); end; // crée une branche contenant le détecteur detecteur procedure cree_branche_det(detecteur : integer); -var i,NumSegment,rien,indexSeg,IndexPeriph,indexPort,IndexSegSuivant,portSuivant,IndexportSuivant,adresse : integer; +var portLocal,i,NumSegment,rien,indexSeg,IndexPeriph,indexPort,IndexSegSuivant,portSuivant,IndexportSuivant,adresse : integer; ctype,s : string; trouve,fg : boolean; label essai_port; @@ -3316,6 +3476,7 @@ begin end; numSegment:=Segment[indexSegSuivant].numero; portSuivant:=Segment[indexSegSuivant].port[IndexPortSuivant].numero; + portLocal:=Segment[indexSegSuivant].port[indexPortSuivant].local; //0 1 2 ou 3 ctype:=segment[IndexSegSuivant].typ; if DebugBranche then AfficheDebug('Seg suivant='+intToSTR(numSegment)+' port='+intToSTR(portSuivant)+' '+ctype+' @='+intToSTR(segment[indexSegSuivant].adresse),clYellow); @@ -3357,7 +3518,14 @@ begin end; //partir de IndexSegSuivant, IndexPort - adresse:=segment[IndexSegSuivant].adresse; + if ctype='dbl_slip_switch' then + begin + if (portLocal=0) or (portLocal=1) then Adresse:=segment[IndexSegSuivant].adresse; + if (portLocal=2) or (portLocal=3) then Adresse:=segment[IndexSegSuivant].adresse2; + if debugBranche then AfficheDebug('On vient de la TJD par le portlocal '+intToSTR(portLocal)+' son adresse est '+intToSTR(adresse),clyellow); + end + else + adresse:=segment[IndexSegSuivant].adresse; sBranche:='A'+intToSTR(Adresse); end; @@ -3450,8 +3618,7 @@ begin trouve:=false; until trouve or (i>MaxAiguillage); - - if debugBranche then AfficheDebug('Etape 3.3 Liste de détecteurs absents des branches pour constituer les branches manquantes',clwhite); + if debugBranche then AfficheDebug('Etape 4 : Liste de détecteurs absents des branches pour constituer les branches manquantes',clwhite); // regarder la liste des détecteurs de CDM qui sont absents des branches-------------------- for i:=1 to Ndet_cdm do begin @@ -3482,6 +3649,72 @@ begin end; end; + // puis créer les branches depuis les positions droites --------------------- + if debugBranche then AfficheDebug('Etape 5 : Liste des aiguillages absents des branches pour constituer les branches manquantes',clwhite); + i:=1; + repeat + trouve:=false; + adresse:=aiguillage[i].Adresse; + + for j:=1 to NbreBranches do + begin + s:=branche[j]; + repeat + if s[1]='A' then + begin + delete(s,1,1); + val(s,det2,erreur); + trouve:=trouve or (det2=adresse); + end; + k:=pos(',',s); + if k<>0 then delete(s,1,k); + until (k=0) or trouve; + end; + if not(trouve) then + begin + c:=aiguillage[i].APointeB; + //trouve:=(c<>'S') and (c<>'D') and (c<>'P') and (aiguillage[i].modele<>crois) and (aiguillage[i].modele<>tjd); + // si la pointe de l'aiguillage est <> de S D P, c'est qu'il est connecté à un détecteur + //if trouve then + begin + adresse:=aiguillage[i].Adresse; + detecteur:=aiguillage[i].APointe; + if debugBranche then + begin + AfficheDebug('-------------------------',clyellow); + AfficheDebug('Début de branche n°'+intToSTR(NbreBranches+1)+' : aiguillage '+intToSTR(adresse)+' Pointe='+intToSTR(detecteur),clyellow); + end; + + trouve:=trouve_IdSegment_aig(adresse,indexSeg); // trouve l'aiguillage dans les segments + + if trouve then + begin + port:=segment[indexSeg].port[0].numero; // on commence par le port 0 (pointe) de l'aiguillage + sBranche:='A'+intToSTR(adresse); + // créée la branche depuis l'aiguillage + cree_branche_aig(indexSeg,0,adresse,1); // branche dans sBranche, arrêt après trouvé 1 aiguillage + if nivdebug=3 then AfficheDebug(sbranche,clwhite); + end + else + begin + // ne pas afficher de message pour un aiguillage non trouvé en segment s'il s'agit d'un aiguillage créé depuis une bretelle (BDJ) + if (aiguillage[i].AdrCDM=0) then + begin + if (aiguillage[i].modele<>crois) then afficheDebug('Erreur 417 : Aig '+intToSTR(adresse)+' non trouvé dans la base de CDM',clred) + else + begin + AfficheDebug('Croisement absent',clred); + k:=trouve_IdSegment(6254); + end; + end; + end; + end; + end; + inc(i); // aiguillage suivant + + until (i>MaxAiguillage); + + // recopier le tampon des branches dans le richedit de l'onglet branches de la config with formconfig do @@ -3610,8 +3843,13 @@ var if k<>0 then begin delete(s,k,length(ss)); - val(s,k,erreur); - if s[1]='-' then k:=-k; + val(s,k,erreur); // ne fonctionne pas avec les nombres négatifs, sauf en compilateur 64 bits + {$IFDEF WIN32} // si compilé en 32 bits + if s[1]='-' then + begin + k:=-k; + end; + {$ENDIF} delete(s,1,erreur); result:=k; end; @@ -4054,6 +4292,7 @@ var s : string; nombre,position,adresse,i,j,n,ISegA1,ISegA2,ISegA3,ISegA4,ISegCrois,SegBJD, IndexSeg,IndexPort,SegConn,PortConn : integer; begin + Adr_nulle:=false; nombre:=Formprinc.FenRich.Lines.Count; if nombre>0 then begin @@ -4392,6 +4631,12 @@ begin if nAig_CDM=0 then Affiche('Aucun aiguillage avec adresse, les branches ne peuvent pas être créées',clOrange) else Importation; + if adr_nulle then + begin + Affiche(' ',clAqua); + Affiche('Au moins un aiguillage n''a pas d''adresse dans CDM et',clAqua); + Affiche('la modélisation du réseau ne peut pas être complète.',clAqua); + end; end; @@ -4410,7 +4655,7 @@ begin Affichage(false); end; -procedure TFormAnalyseCDM.CheckAdressesClick(Sender: TObject); +procedure TFormAnalyseCDM.CheckDetClick(Sender: TObject); begin Affichage(false); end; @@ -4442,8 +4687,8 @@ begin if debug=1 then Affiche('Création fenêtre réseau CDM',clLime); IndexClic:=0; checkPorts.Checked:=false; - CheckAdresses.checked:=true; - LabelPorts.Width:=120; + CheckDet.checked:=true; + LabelPorts.Width:=160; LabelPorts.Height:=23; ImageCDM.Top:=0; @@ -4552,7 +4797,7 @@ begin if Segment[i].adresse2<>0 then s:=s+'/'+intToSTR(Segment[i].adresse2); formAnalyseCDM.EditAdresse.text:=s; - s:='Ports 0/1/2 = '+IntToSTR(Segment[i].port[0].numero)+'/'+IntToSTR(Segment[i].port[1].numero)+'/'+ + s:='Ports 0/1/2 = (pointe/droit/dévié)'+#13+IntToSTR(Segment[i].port[0].numero)+'/'+IntToSTR(Segment[i].port[1].numero)+'/'+ IntToSTR(Segment[i].port[2].numero); formAnalyseCDM.LabelPorts.Caption:=s; diff --git a/UnitCDF.pas b/UnitCDF.pas index 9057978..5b51030 100644 --- a/UnitCDF.pas +++ b/UnitCDF.pas @@ -202,12 +202,12 @@ begin case Signaux[i].aspect of // feux de signalisation - 2 : dessine_signal2(Vcanvas,0,0,1,1,EtatFeupilote,1); - 3 : dessine_signal3(Vcanvas,0,0,1,1,EtatFeupilote,1); - 4 : dessine_signal4(VCanvas,0,0,1,1,EtatFeupilote,1); - 5 : dessine_signal5(VCanvas,0,0,1,1,EtatFeupilote,1); - 7 : dessine_signal7(VCanvas,0,0,1,1,EtatFeupilote,1); - 9 : dessine_signal9(VCanvas,0,0,1,1,EtatFeupilote,1); + 2 : dessine_signal2(Vcanvas,0,0,1,1,EtatFeupilote,1,i); + 3 : dessine_signal3(Vcanvas,0,0,1,1,EtatFeupilote,1,i); + 4 : dessine_signal4(VCanvas,0,0,1,1,EtatFeupilote,1,i); + 5 : dessine_signal5(VCanvas,0,0,1,1,EtatFeupilote,1,i); + 7 : dessine_signal7(VCanvas,0,0,1,1,EtatFeupilote,1,i); + 9 : dessine_signal9(VCanvas,0,0,1,1,EtatFeupilote,1,i); // 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); diff --git a/UnitClock.dfm b/UnitClock.dfm index d56f5fa..f7904ca 100644 --- a/UnitClock.dfm +++ b/UnitClock.dfm @@ -16,7 +16,7 @@ object FormClock: TFormClock OnResize = FormResize DesignSize = ( 234 - 211) + 212) PixelsPerInch = 96 TextHeight = 13 object BitBtnMarHor: TBitBtn diff --git a/UnitConfig.dfm b/UnitConfig.dfm index 98512a4..752a447 100644 --- a/UnitConfig.dfm +++ b/UnitConfig.dfm @@ -683,7 +683,7 @@ object FormConfig: TFormConfig Top = 8 Width = 633 Height = 505 - ActivePage = TabAvance + ActivePage = TabSheetBranches Font.Charset = DEFAULT_CHARSET Font.Color = clBlack Font.Height = -11 @@ -1208,7 +1208,7 @@ object FormConfig: TFormConfig 'S'#233'lection du style d'#39#39'affichage - Le style sera chang'#233' '#224' la ferm' + 'eture de la fen'#234'tre'#39 Style = csDropDownList - ItemHeight = 13 + ItemHeight = 0 ParentShowHint = False ShowHint = True TabOrder = 0 @@ -2036,9 +2036,9 @@ object FormConfig: TFormConfig OnClick = ButtonAjSupClick end object ListBoxAig: TListBox - Left = 8 - Top = 64 - Width = 305 + Left = 0 + Top = 56 + Width = 321 Height = 377 Color = clBlack Font.Charset = DEFAULT_CHARSET @@ -2180,8 +2180,6 @@ object FormConfig: TFormConfig Font.Name = 'MS Sans Serif' Font.Style = [] HideSelection = False - Lines.Strings = ( - 'RichBranche') ParentFont = False PopupMenu = PopupMenuRichedit ScrollBars = ssBoth @@ -2192,9 +2190,9 @@ object FormConfig: TFormConfig end object Memo5: TMemo Left = 464 - Top = 296 + Top = 248 Width = 153 - Height = 145 + Height = 193 Lines.Strings = ( 'Une ligne doit commencer par ' 'un aiguillage (ou un buttoir) et ' @@ -2205,7 +2203,11 @@ object FormConfig: TFormConfig '' 'Un aiguillage peut se retrouver ' #224' plusieurs endroits de cette ' - 'section, mais pas un d'#233'tecteur. ') + 'section, mais pas un d'#233'tecteur. ' + '' + 'Tous les d'#233'tecteurs et ' + 'aiguillages doivent '#234'tre ' + 'pr'#233'sents.') ReadOnly = True TabOrder = 2 end @@ -2413,7 +2415,7 @@ object FormConfig: TFormConfig Width = 137 Height = 21 Style = csDropDownList - ItemHeight = 13 + ItemHeight = 0 TabOrder = 1 OnChange = ComboBoxDecChange end @@ -2544,7 +2546,7 @@ object FormConfig: TFormConfig Width = 137 Height = 21 Style = csDropDownList - ItemHeight = 13 + ItemHeight = 0 TabOrder = 2 OnChange = ComboBoxAspChange end @@ -2737,8 +2739,8 @@ object FormConfig: TFormConfig Caption = 'D'#233'codeurs' ImageIndex = 8 object Label61: TLabel - Left = 13 - Top = 12 + Left = 0 + Top = 8 Width = 208 Height = 13 Caption = 'D'#233'codeurs personnalis'#233's de signaux' @@ -2852,7 +2854,7 @@ object FormConfig: TFormConfig Top = 56 Width = 193 Height = 21 - ItemHeight = 13 + ItemHeight = 0 TabOrder = 0 OnChange = ComboBoxDecodeurPersoChange end @@ -2871,7 +2873,7 @@ object FormConfig: TFormConfig Width = 145 Height = 21 Style = csDropDownList - ItemHeight = 13 + ItemHeight = 0 TabOrder = 2 OnChange = ComboBoxNationChange end @@ -2917,7 +2919,7 @@ object FormConfig: TFormConfig Width = 193 Height = 21 Style = csDropDownList - ItemHeight = 13 + ItemHeight = 0 TabOrder = 6 OnChange = ComboBoxDecCdeChange end @@ -2928,7 +2930,7 @@ object FormConfig: TFormConfig ImageIndex = 6 object Label44: TLabel Left = 0 - Top = 12 + Top = 8 Width = 537 Height = 13 Caption = @@ -3063,14 +3065,14 @@ object FormConfig: TFormConfig Caption = 'Fonctions' ImageIndex = 14 object Label63: TLabel - Left = 16 - Top = 16 - Width = 136 - Height = 16 + Left = 0 + Top = 8 + Width = 111 + Height = 13 Caption = 'Fonctions logiques ' Font.Charset = DEFAULT_CHARSET Font.Color = clBlack - Font.Height = -13 + Font.Height = -11 Font.Name = 'MS Sans Serif' Font.Style = [fsBold] ParentFont = False @@ -3132,7 +3134,7 @@ object FormConfig: TFormConfig Top = 96 Width = 137 Height = 21 - ItemHeight = 13 + ItemHeight = 0 TabOrder = 2 OnChange = ComboBoxOperateurChange OnDrawItem = ComboBoxOperateurDrawItem @@ -3152,7 +3154,7 @@ object FormConfig: TFormConfig Top = 96 Width = 161 Height = 21 - ItemHeight = 13 + ItemHeight = 0 ParentShowHint = False ShowHint = True TabOrder = 4 @@ -3253,7 +3255,7 @@ object FormConfig: TFormConfig Width = 145 Height = 21 Style = csDropDownList - ItemHeight = 13 + ItemHeight = 0 TabOrder = 7 OnChange = ComboBoxFLChange end @@ -3479,12 +3481,12 @@ object FormConfig: TFormConfig object Label42: TLabel Left = 8 Top = 8 - Width = 76 - Height = 16 + Width = 63 + Height = 13 Caption = 'D'#233'tecteurs' Font.Charset = DEFAULT_CHARSET Font.Color = clBlack - Font.Height = -13 + Font.Height = -11 Font.Name = 'MS Sans Serif' Font.Style = [fsBold] ParentFont = False @@ -3624,17 +3626,30 @@ object FormConfig: TFormConfig object TabSheetPN: TTabSheet Caption = 'PN' ImageIndex = 6 + object Label58: TLabel + Left = 0 + Top = 8 + Width = 114 + Height = 13 + Caption = 'Passages '#224' niveaux' + Font.Charset = ANSI_CHARSET + Font.Color = clBlack + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [fsBold] + ParentFont = False + end object GroupBox13: TGroupBox - Left = 352 + Left = 336 Top = 24 - Width = 265 + Width = 281 Height = 441 - Caption = 'Description de l'#39'action' + Caption = 'Description du PN' TabOrder = 0 object GroupBoxPNA: TGroupBox Left = 8 Top = 240 - Width = 249 + Width = 265 Height = 121 Caption = 'Actionneurs PN simples' TabOrder = 0 @@ -3642,7 +3657,7 @@ object FormConfig: TFormConfig object GroupBoxPNZ: TGroupBox Left = 8 Top = 368 - Width = 249 + Width = 265 Height = 65 Caption = 'Zones de d'#233'tection' TabOrder = 1 @@ -3650,7 +3665,7 @@ object FormConfig: TFormConfig object GroupBoxPN: TGroupBox Left = 8 Top = 16 - Width = 249 + Width = 265 Height = 217 Caption = 'Action gestion passage '#224' niveau' ParentShowHint = False @@ -3689,7 +3704,7 @@ object FormConfig: TFormConfig object EditCdeFerme: TEdit Left = 168 Top = 88 - Width = 25 + Width = 41 Height = 21 Hint = 'Commande de fermeture (0 '#224' 2)' ParentShowHint = False @@ -3700,7 +3715,7 @@ object FormConfig: TFormConfig object EditCdeOuvre: TEdit Left = 168 Top = 112 - Width = 25 + Width = 41 Height = 21 Hint = 'Commande d'#39'ouverture (0 '#224' 2)' ParentShowHint = False @@ -3709,7 +3724,7 @@ object FormConfig: TFormConfig OnChange = EditCdeOuvreChange end object ButtonTestFerme: TButton - Left = 208 + Left = 224 Top = 88 Width = 27 Height = 21 @@ -3721,7 +3736,7 @@ object FormConfig: TFormConfig OnClick = ButtonTestFermeClick end object ButtonTestOuvre: TButton - Left = 208 + Left = 224 Top = 112 Width = 27 Height = 21 @@ -3792,7 +3807,7 @@ object FormConfig: TFormConfig Height = 21 Hint = 'Nom de l'#39'accessoire d'#233'fini dans l'#39'onglet "p'#233'riph'#233'riques COM/USB"' Style = csDropDownList - ItemHeight = 13 + ItemHeight = 0 ParentShowHint = False ShowHint = True TabOrder = 10 @@ -3800,53 +3815,45 @@ object FormConfig: TFormConfig end end end - object GroupBox17: TGroupBox + object ListBoxPN: TListBox Left = 0 - Top = 16 - Width = 345 - Height = 449 - Caption = 'Actionneurs/d'#233'tecteurs passage '#224' niveau' + Top = 56 + Width = 321 + Height = 361 + Color = clBlack + Font.Charset = DEFAULT_CHARSET + Font.Color = clAqua + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ItemHeight = 13 + MultiSelect = True + ParentFont = False + PopupMenu = PopupMenuListes TabOrder = 1 - object ButtonNouvPN: TButton - Left = 8 - Top = 24 - Width = 65 - Height = 17 - Caption = 'Nouveau' - TabOrder = 0 - OnClick = ButtonNouvPNClick - end - object ButtonSupPN: TButton - Left = 80 - Top = 24 - Width = 65 - Height = 17 - Hint = 'Supprime l'#39'actionneur(s) s'#233'lectionn'#233'(s)' - Caption = 'Supprime' - ParentShowHint = False - ShowHint = True - TabOrder = 1 - OnClick = ButtonSupPNClick - end - object ListBoxPN: TListBox - Left = 8 - Top = 48 - Width = 329 - Height = 345 - Color = clBlack - Font.Charset = DEFAULT_CHARSET - Font.Color = clAqua - Font.Height = -11 - Font.Name = 'MS Sans Serif' - Font.Style = [] - ItemHeight = 13 - MultiSelect = True - ParentFont = False - PopupMenu = PopupMenuListes - TabOrder = 2 - OnKeyDown = ListBoxPNKeyDown - OnMouseDown = ListBoxPNMouseDown - end + OnKeyDown = ListBoxPNKeyDown + OnMouseDown = ListBoxPNMouseDown + end + object ButtonNouvPN: TButton + Left = 0 + Top = 32 + Width = 65 + Height = 17 + Caption = 'Nouveau' + TabOrder = 2 + OnClick = ButtonNouvPNClick + end + object ButtonSupPN: TButton + Left = 72 + Top = 32 + Width = 65 + Height = 17 + Hint = 'Supprime l'#39'actionneur(s) s'#233'lectionn'#233'(s)' + Caption = 'Supprime' + ParentShowHint = False + ShowHint = True + TabOrder = 3 + OnClick = ButtonSupPNClick end end object TabSheetDccpp: TTabSheet @@ -4106,28 +4113,28 @@ object FormConfig: TFormConfig Height = 49 end object ButtonNT: TButton - Left = 8 - Top = 48 - Width = 73 + Left = 0 + Top = 32 + Width = 65 Height = 17 Caption = 'Nouveau' TabOrder = 0 OnClick = ButtonNTClick end object ButtonSupprime: TButton - Left = 88 - Top = 48 - Width = 75 + Left = 72 + Top = 32 + Width = 65 Height = 17 Caption = 'Supprime' TabOrder = 1 OnClick = ButtonSupprimeClick end object ListBoxTrains: TListBox - Left = 8 - Top = 72 - Width = 273 - Height = 281 + Left = 0 + Top = 56 + Width = 281 + Height = 313 Color = clBlack Font.Charset = DEFAULT_CHARSET Font.Color = clAqua @@ -4536,6 +4543,30 @@ object FormConfig: TFormConfig ReadOnly = True TabOrder = 7 end + object ButtonlCV3: TButton + Left = 272 + Top = 136 + Width = 27 + Height = 25 + Hint = 'Lire le CV3 de la locomotive plac'#233'e sur la voie de programmation' + Caption = 'CV' + ParentShowHint = False + ShowHint = True + TabOrder = 8 + OnClick = ButtonlCV3Click + end + object ButtonlCV4: TButton + Left = 272 + Top = 160 + Width = 27 + Height = 25 + Hint = 'Lire le CV4 de la locomotive plac'#233'e sur la voie de programmation' + Caption = 'CV' + ParentShowHint = False + ShowHint = True + TabOrder = 9 + OnClick = ButtonlCV4Click + end end end end diff --git a/UnitConfig.pas b/UnitConfig.pas index 64dfe66..554995f 100644 --- a/UnitConfig.pas +++ b/UnitConfig.pas @@ -147,9 +147,6 @@ type EditSpecUni: TEdit; LabelUni: TLabel; Buttonrestaure: TButton; - GroupBox17: TGroupBox; - ButtonNouvPN: TButton; - ButtonSupPN: TButton; ButtonNouvSig: TButton; ButtonSupSig: TButton; ButtonInsSig: TButton; @@ -245,7 +242,6 @@ type Label69: TLabel; LabelCrois: TLabel; ListBoxSig: TListBox; - ListBoxPN: TListBox; PopupMenuListes: TPopupMenu; Slectionnertout1: TMenuItem; Nouveau1: TMenuItem; @@ -442,6 +438,12 @@ type RadioButtonFIS88: TRadioButton; RadioButtonDccPlusPlus: TRadioButton; Memo4: TMemo; + ButtonlCV3: TButton; + ButtonlCV4: TButton; + ListBoxPN: TListBox; + ButtonNouvPN: TButton; + ButtonSupPN: TButton; + Label58: TLabel; procedure ButtonAppliquerEtFermerClick(Sender: TObject); procedure FormCreate(Sender: TObject); procedure ListBoxAigMouseDown(Sender: TObject; Button: TMouseButton; @@ -687,7 +689,7 @@ type Rect: TRect; State: TGridDrawState); procedure ValueListEditorMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); - procedure Button2Click(Sender: TObject); + procedure ButtonlCV4Click(Sender: TObject); procedure RadioGroupOPClick(Sender: TObject); procedure Panel1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); @@ -696,6 +698,7 @@ type procedure Panel1Click(Sender: TObject); procedure ComboStyleChange(Sender: TObject); procedure RadioGroupClClick(Sender: TObject); + procedure ButtonlCV3Click(Sender: TObject); private { Déclarations privées } @@ -7900,7 +7903,7 @@ begin SendMessage(ListBoxTrains.Handle,LB_SETHORIZONTALEXTENT,PixelLength,0); LabeledEditCrans.Hint:='Nombre de crans du décodeur, 128 par défaut.'+#13+ - 'Le nombre de crans est configué dans le CV29 du décodeur'; + 'Le nombre de crans à 128 est validé par la mise à 1 du bit 1 du CV29 du décodeur'; LabeledEditCrans.ShowHint:=true; // actionneurs @@ -10671,11 +10674,11 @@ end; function verif_coherence : boolean; var AncAdr,i,j,k,l,Indexaig,adr,adr2,extr,detect,condcarre,nc,index2,SuivAdr,indexTCO,AdrAig, x,y,extr2,adr3,adr4,index3,det1Br,det2Br,det1index,det2index,adresse,Adresse2,dec,nc2,op, - delta : integer; + delta,broft,adresse3 : integer; modAig,AncModel,model,km,SuivModel,model2,t1,t2: TEquipement; c : char; vitesse : longint; - sort,OkSignal,ok,trouveSuiv,TrouvePrec,AdrOk : boolean; + sort,OkSignal,ok,trouveSuiv,TrouvePrec,AdrOk,ok1,ok2,ok3,ok4 : boolean; s : string; begin // validation des index signaux et détecteurs @@ -10749,7 +10752,6 @@ begin end; // vérifier si l'aiguillage est dans les branches - { non c'est autorisé! if aiguillage[Indexaig].modele<>rien then begin trouve_aiguillage(aiguillage[Indexaig].adresse); // passe l'adresse de l'aiguillage à trouver @@ -10759,7 +10761,7 @@ begin ok:=false; end; end; - } + // exclure les TJD/S if (modAig<>tjd) and (modAig<>tjs) then @@ -11107,16 +11109,36 @@ begin if k=0 then begin ok:=false; - Affiche('Erreur 9.2: aiguillage '+intToSTR(i)+' non existant mais associé au signal '+IntToSTR(Signaux[j].adresse),clred); + Affiche('Erreur 9.20: aiguillage '+intToSTR(i)+' non existant mais associé au signal '+IntToSTR(Signaux[j].adresse),clred); end else begin // vérifier si le détecteur du signal et l'aiguillage sont consécutifs l:=Signaux[j].Adr_det1; - if (aiguillage[k].ADroit<>l) and (aiguillage[k].ADevie<>l) and (aiguillage[k].APointe<>l) then + km:=aiguillage[k].modele; + if km=aig then begin - ok:=false; - Affiche('Erreur 9.21: signal '+intToSTR(Signaux[j].adresse)+' : aiguillage '+intToSTR(i)+' et détecteur '+intToSTR(l)+' non contigüs ',clred); + if (aiguillage[k].ADroit<>l) and (aiguillage[k].ADevie<>l) and (aiguillage[k].APointe<>l) then + begin + ok:=false; + Affiche('Erreur 9.21: signal '+intToSTR(Signaux[j].adresse)+' : aiguillage '+intToSTR(i)+' et détecteur '+intToSTR(l)+' non contigüs ',clred); + end; + end; + if (km=crois) or (km=tjs) or (km=tjd) then + begin + if (aiguillage[k].ADroit<>l) and (aiguillage[k].ADevie<>l) and (aiguillage[k].Ddroit<>l) and (aiguillage[k].Ddevie<>l) then + begin + ok:=false; + Affiche('Erreur 9.22: signal '+intToSTR(Signaux[j].adresse)+' : aiguillage '+intToSTR(i)+' et détecteur '+intToSTR(l)+' non contigüs ',clred); + end; + end; + if km=triple then + begin + if (aiguillage[k].Adevie2<>l) and (aiguillage[k].ADroit<>l) and (aiguillage[k].ADevie<>l) and (aiguillage[k].APointe<>l) then + begin + ok:=false; + Affiche('Erreur 9.23: signal '+intToSTR(Signaux[j].adresse)+' : aiguillage '+intToSTR(i)+' et détecteur '+intToSTR(l)+' non contigüs ',clred); + end; end; end; end; @@ -11625,38 +11647,63 @@ begin adr:=aiguillage[indexaig].Adresse; model:=aiguillage[indexaig].modele; + // TJD 4 états if (model=tjd) or (model=tjs) and (aiguillage[indexAig].EtatTJD=4) then begin + // ne pas tester si la TJD est la dernière exemple : A25,529,A26,A28 : ne pas tester la 28 l:=1; // offset branche commence la recherche en 1 j:=0; // offset dans branche adresse:=aiguillage[indexAig].ADroit; // élements de la tjd adresse2:=aiguillage[indexAig].ADevie; + adresse3:=aiguillage[indexAig].Ddroit; // homologue Adrok:=false; Branche_trouve:=0; repeat j:=1; repeat k:=branche_trouve; // ancien - trouve_element_V1(adr,tjd,l,0,j,false,0); // indexs de la tjd dans les branches + trouve_element_V1(adr,tjd,l,0,j,false,1); // indexs de la tjd dans les branches , it=1 permet de ne pas rechercher la tjs homologue ce qui fausserait le résultat if branche_trouve<>0 then begin - if indexBranche_Trouve>1 then Adrok:=Adrok or (BrancheN[Branche_trouve,indexBranche_Trouve-1].Adresse=adresse); + // il faut trouver adresse et adresse2 à gauche ou à droite le la TJD dans les branches - // pour la rechercher en +, incrémenter l'indexbranche jusqu'à trouve un non actionneur + // trouver si les éléments de connexion de la tjd sont les mêmes dans les branches + + // vérifie si l'élémént Adroit (port0, NO), Adevie (port1, SO) de la TJD est ok dans la branche en décrément + if indexBranche_Trouve>1 then + begin + k:=BrancheN[Branche_trouve,indexBranche_Trouve-1].Adresse; // élément précédent + ok1:=(k=adresse) or (k=adresse2) or (k=adresse3); + Adrok:=Adrok or ok1; + end; + + // pour la recherche en +, incrémenter l'indexbranche jusqu'à trouve un non actionneur + // vérifie si l'élémént Adroit (port0, NO) de la TJD est ok dans la branche en incrément + ok2:=true; repeat sort:=BrancheN[Branche_trouve,indexBranche_Trouve+1].BType<>act; if not(sort) then inc(IndexBranche_trouve); - if sort then Adrok:=Adrok or (BrancheN[Branche_trouve,indexBranche_Trouve+1].Adresse=adresse) ; + if sort then + begin + k:=BrancheN[Branche_trouve,indexBranche_Trouve+1].Adresse; + ok2:=(k=adresse) or (k=adresse2) or (k=adresse3); + Adrok:=Adrok or ok2; + end; until sort; + if not(adrOK) then Affiche('La TJD '+intToSTR(adr)+' décrite n''est pas cohérente test 1 : branche '+intToSTR(Branche_trouve)+' '+ + intToSTR(brancheN[Branche_trouve,indexBranche_Trouve+1].Adresse)+' différent de '+intToSTR(adresse),clred); + if indexBranche_Trouve>1 then Adrok:=Adrok or (BrancheN[Branche_trouve,indexBranche_Trouve-1].Adresse=adresse2); + { repeat sort:=BrancheN[Branche_trouve,indexBranche_Trouve+1].BType<>act; if not(sort) then inc(IndexBranche_trouve); - if sort then Adrok:=Adrok or (BrancheN[Branche_trouve,indexBranche_Trouve+1].Adresse=adresse2) ; + if sort then + Adrok:=Adrok or (BrancheN[Branche_trouve,indexBranche_Trouve+1].Adresse=adresse2) ; until sort; - + } if not(Adrok) then begin Affiche('La TJD '+intToSTR(adr)+' décrite n''est pas cohérente avec les élements contigus dans la branche '+intToSTR(Branche_trouve)+' :',clred); @@ -18094,10 +18141,7 @@ begin ValueListEditor.hint:=Liste[y].aide; end; -procedure TFormConfig.Button2Click(Sender: TObject); -begin - ValueListEditor.Cells[1,7]:='hgjg'; -end; + procedure TFormConfig.RadioGroupOPClick(Sender: TObject); var node : tTreeNode; @@ -18165,6 +18209,52 @@ end; +procedure TFormConfig.ButtonlCV3Click(Sender: TObject); +var valeur : integer; +begin + if (ligneclicTrain<0) or (ligneclicTrain>=ntrains) or (ntrains<1) then exit; + valeur:=lire_cv(3); + if valeur=-1 then + begin + LabelInfo.caption:='Erreur attente trop longue CV'; + exit; + end; + if valeur=-2 then + begin + LabelInfo.caption:='Pas de réponse de l''interface après demande de passage en mode prog'; + exit; + end; + + clicListe:=true; + trains[ligneclicTrain+1].cv3:=valeur; + LabeledEditCV3.Text:=IntToSTR(valeur); + clicListe:=false; +end; + +procedure TFormConfig.ButtonlCV4Click(Sender: TObject); +var valeur : integer; +begin + if (ligneclicTrain<0) or (ligneclicTrain>=ntrains) or (ntrains<1) then exit; + valeur:=lire_cv(4); + if valeur=-1 then + begin + LabelInfo.caption:='Erreur attente trop longue CV'; + exit; + end; + if valeur=-2 then + begin + LabelInfo.caption:='Pas de réponse de l''interface après demande de passage en mode prog'; + exit; + end; + + clicListe:=true; + trains[ligneclicTrain+1].cv4:=valeur; + LabeledEditCV4.Text:=IntToSTR(valeur); + clicListe:=false; + +end; + + end. diff --git a/UnitConfigCellTCO.pas b/UnitConfigCellTCO.pas index 2a145e5..8bc7805 100644 --- a/UnitConfigCellTCO.pas +++ b/UnitConfigCellTCO.pas @@ -1254,6 +1254,7 @@ begin if clicTCO then exit; val(EditParam1.Text,i,erreur); if erreur<>0 then exit; + if (i>100) or (i<1) then begin i:=1; EditParam1.Text:='1';end; tco[IndexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]].adresse:=i; Affiche_cellule(IndexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]); end; @@ -1280,7 +1281,7 @@ begin end; -// dessine les icones et le texte dans la listbox +// dessine les icones et le texte dans la listboxAction procedure TFormConfCellTCO.ListBoxActionDrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState); var @@ -1293,13 +1294,11 @@ begin val(ItemText,i,erreur); Delete(ItemText,1,erreur-1); Canvas.Fillrect(Rect); - ImageListIcones.Draw(Canvas, Rect.Left, Rect.Top, i); - Canvas.Textout(Rect.Left + ImageListIcones.Width + 2, Rect.Top, ItemText); + ImageListIcones.Draw(Canvas,Rect.Left,Rect.Top,i); + Canvas.Textout(Rect.Left+ImageListIcones.Width+2, Rect.Top, ItemText); end; end; - - procedure TFormConfCellTCO.EditCantonExit(Sender: TObject); var NumC,i,erreur :integer; trouve : boolean; diff --git a/UnitConfigTCO.pas b/UnitConfigTCO.pas index d2b7dde..bb102f9 100644 --- a/UnitConfigTCO.pas +++ b/UnitConfigTCO.pas @@ -742,12 +742,12 @@ begin begin clVoies[indexTCO]:=$A00000; ClFond[indexTCO]:=$A00000; - ClGrille[IndexTCO]:=$FFC0C0; - CoulCantonLibre[IndexTco]:=$A0A0A0; - CoulCantonOccupe[IndexTCO]:=$A0A0FF; + ClGrille[IndexTCO]:=$FFC0C0; // bleu + CoulCantonLibre[IndexTco]:=$A0F0A0; // vert + CoulCantonOccupe[IndexTCO]:=$A0A0FF; // rouge for y:=1 to NbreCellY[indexTCO] do for x:=1 to NbreCellX[indexTCO] do - TCO[indexTCO,x,y].CouleurFond:=$FFFFFF; + TCO[indexTCO,x,y].CouleurFond:=$B0B0B0; // blanc doux end; end; diff --git a/UnitDebug.pas b/UnitDebug.pas index 075fff5..a35db30 100644 --- a/UnitDebug.pas +++ b/UnitDebug.pas @@ -223,6 +223,11 @@ begin RichDebug.Height:=scrollBoxdebug.Height-30; RichDebug.Anchors:=[akLeft,akTop,akRight,akBottom]; + {$IF CompilerVersion >= 28.0} + RichDebug.StyleName:='Windows'; + MemoEvtDet.StyleName:='Windows'; + {$IFEND} + with scrollBoxdebug do begin Anchors:=[akLeft,akTop,akRight,akBottom]; @@ -253,7 +258,6 @@ begin formDebug.buttonCP.Caption:='Etat '+intToSTR(Nb_cantons_Sig)+' cantons précédents signal'; end; - procedure TFormDebug.ButtonEcrLogClick(Sender: TObject); var s : string; i : integer; @@ -280,9 +284,9 @@ end; procedure TFormDebug.EditNivDebugKeyPress(Sender: TObject; var Key: Char); var i,e : integer; begin - if ord(Key)=VK_RETURN then + if ord(Key)=VK_RETURN then begin - Key:=#0; // prevent beeping + Key:=#0; // évite bip val(EditNivDebug.text,i,e); if e=0 then begin @@ -290,7 +294,7 @@ begin else EditNivDebug.text:='3'; end else EditNivDebug.text:='0'; - end; + end; RichDebug.Lines.add('Niveau='+intToSTR(NivDebug)); end; diff --git a/UnitPilote.pas b/UnitPilote.pas index 483b361..51ee7b3 100644 --- a/UnitPilote.pas +++ b/UnitPilote.pas @@ -160,12 +160,12 @@ begin case Signaux[i].aspect of // feux de signalisation - 2 : dessine_signal2(Vcanvas,0,0,1,1,EtatFeupilote,1); - 3 : dessine_signal3(Vcanvas,0,0,1,1,EtatFeupilote,1); - 4 : dessine_signal4(VCanvas,0,0,1,1,EtatFeupilote,1); - 5 : dessine_signal5(VCanvas,0,0,1,1,EtatFeupilote,1); - 7 : dessine_signal7(VCanvas,0,0,1,1,EtatFeupilote,1); - 9 : dessine_signal9(VCanvas,0,0,1,1,EtatFeupilote,1); + 2 : dessine_signal2(Vcanvas,0,0,1,1,EtatFeupilote,1,i); + 3 : dessine_signal3(Vcanvas,0,0,1,1,EtatFeupilote,1,i); + 4 : dessine_signal4(VCanvas,0,0,1,1,EtatFeupilote,1,i); + 5 : dessine_signal5(VCanvas,0,0,1,1,EtatFeupilote,1,i); + 7 : dessine_signal7(VCanvas,0,0,1,1,EtatFeupilote,1,i); + 9 : dessine_signal9(VCanvas,0,0,1,1,EtatFeupilote,1,i); 20 : dessine_signal20(VCanvas,0,0,1,1,EtatFeupilote,1,Signaux[i].adresse); // indicateurs de direction 12 : dessine_dirN(VCanvas,0,0,1,1,EtatFeupilote,1,2); diff --git a/UnitPrinc.dfm b/UnitPrinc.dfm index 9c574dc..8890901 100644 --- a/UnitPrinc.dfm +++ b/UnitPrinc.dfm @@ -1986,7 +1986,7 @@ object FormPrinc: TFormPrinc end end object GroupBoxCV: TGroupBox - Left = 681 + Left = 561 Top = 40 Width = 265 Height = 129 diff --git a/UnitPrinc.pas b/UnitPrinc.pas index 5f58bba..0989553 100644 --- a/UnitPrinc.pas +++ b/UnitPrinc.pas @@ -81,16 +81,18 @@ uses Dialogs, StdCtrls, OleCtrls, ExtCtrls, jpeg, ComCtrls, ShellAPI, TlHelp32, ImgList, ScktComp, StrUtils, Menus, ActnList, MMSystem , Buttons, NB30, comObj, activeX //,DateUtils//, PsAPI + {$IFDEF AvecIdTCP} - ,IdTCPClient // client socket indy , ne marche pas bien + ,IdTCPClient // client socket indy , ne marche pas bien {$ENDIF} + {$IF CompilerVersion >= 28.0} // si delphi>=12 - ,Vcl.Themes // pour les thèmes d'affichage (auric etc) - ,Vcl.Styles.Ext // styles étendus - ,AdPort, OoMisc // AsyncPro pour COM/USB - ,idGlobal // pour utiliser tidBytes + ,Vcl.Themes // pour les thèmes d'affichage (auric etc) + ,Vcl.Styles.Ext // styles étendus + ,AdPort, OoMisc // AsyncPro pour COM/USB + ,idGlobal // pour utiliser tidBytes {$ELSE} - ,MSCommLib_TLB // TMSComm pour COM/USB + ,MSCommLib_TLB // TMSComm pour COM/USB {$IFEND} ; @@ -558,28 +560,28 @@ MaxTrainZone=40; // nombre maximal de trains pour le tableau d'historique d Mtd=128; // nombre maxi de détecteurs précédents stockés Max_event_det=4000; // nombre maximal d'évenements détecteurs Max_action=100; // nombre maximal d'actions -MaxCantons=100; -Long_tampon_interface=5000; -Max_actionneurs=2048; -Maxelements=100; // nombre maxi d'éléments scannés/réservés +MaxCantons=100; // nombre maximal de cantons +Long_tampon_interface=5000; // taille tampon interface +Max_actionneurs=2048; // nombre maxi d'actionneurs cdm +Maxelements=100; // nombre maxi d'éléments de voies scannés/réservés MaxBranches=200; // nombre maxi de branches MaxElBranches=200; // nombre maxi d'éléments par branche NbreMaxiAiguillages=MaxAcc; // nombre maxi d'aiguillages -NbreMaxiSignaux=200; // nombre maxi de signaux +NbreMaxiSignaux=250; // nombre maxi de signaux NbreMaxiDecPers=10; // nombre maxi de décodeurs personnalisés NbMaxi_Periph=10; // nombre maxi de périphériques COM/USB/Socket LargImg=50;HtImg=91; // Dimensions image des signaux (le plus grand, le 9 feux) MaxComUSBPeriph=2; // Nombre maxi d'objets périphériques périphériques USB Tmscom MaxComSocketPeriph=2; // Nombre maxi d'objets périphériques périphériques socket TClientsocket -const_droit=2; // positions aiguillages transmises par la centrale LENZ -const_devie=1; // positions aiguillages transmises par la centrale LENZ -const_devieG_CDM=3; // positions aiguillages transmises par cdm -const_devieD_CDM=2; // positions aiguillages transmises par cdm -const_droit_CDM=0; // positions aiguillages transmises par cdm +const_droit=2; // position droite aiguillages transmises par la centrale LENZ +const_devie=1; // position déviée aiguillages transmises par la centrale LENZ +const_devieG_CDM=3; // position déviée gauche aiguillages transmises par cdm +const_devieD_CDM=2; // position déviée droite aiguillages transmises par cdm +const_droit_CDM=0; // position non déviée aiguillages transmises par cdm const_inconnu=9; // position inconnue const_pointe=10; // aiguillage pris en pointe const_talon=11; // aiguillage pris en talon -IdClients=10; // Index maxi de clients +IdClients=10; // Index maxi de clients réseau MaxParcoursTablo=200; // taille maxi du tableau des routes MaxRoutesCte=25000; // Nombre maximal de routes NbCouleurTrain=8; @@ -818,7 +820,7 @@ TSignal = record Adresse : integer; // aiguillage posAig : char; end; - SR : array[1..19] of record // configuration des sorties du décodeur Stéphane Ravaut ou digikeijs ou cdf pour chacun des 19 états + SR : array[1..19] of record // configuration des sorties du décodeur Stéphane Ravaut ou digikeijs ou cdf ou LEA pour chacun des 19 états sortie1,sortie0 : integer; // ex SR[1]=[carre] (voir tableau Etats) end; Na : integer; // nombre d'adresses du signal occupées par le décodeur CDF/SR/digikeijs/Belge @@ -831,10 +833,10 @@ TPeripherique = record portouvert : boolean; // si le port COM est ouvert numComposant : integer ; // numéro de composant MSCOM ou clientSocket ScvAig,ScvDet,ScvAct,ScvVis,cr,dtr,rts : boolean ; // services, visible, avecCR ... - protocole,tamponRX : string; // protocole COM ou socket, tanpon de réception + protocole,tamponRX : string; // protocole COM ou socket, tampon de réception end; -TPn = record +TPn = record // structure passage à niveau AdresseFerme : integer; // adresse de pilotage DCC pour la fermeture ou numéro de périphérique pour pilotage usb commandeFerme : integer; // commande de fermeture (1 ou 2) AdresseOuvre : integer; // adresse de pilotage DCC pour l'ouverture @@ -885,13 +887,13 @@ Taction = record end; TelementRoute=record - // l'index 0 contient dans "adresse" le nombre d'éléments et + // l'index 0 contient dans "adresse" le nombre d'éléments // dans "talon" (si talon=true : consigne vitesse négative) // dans "pos" l'id de route adresse : integer; // adresse de l'élément typ : tequipement; // type de l'élément - pos : integer; // position pour la route si l'élément est un aiguillage - talon : boolean; // vrai si l'élément est un aiguillage pris en talon pour la route + pos : integer; // position pour la route si l'élément est un aiguillage // indice[0] : id de la route + talon : boolean; // vrai si l'élément est un aiguillage pris en talon pour la route // indice[0]: inverse le sens de la loco traite : boolean; // traité ou non par la procédure aig_canton end; @@ -1187,14 +1189,15 @@ var SbitMap : TBitmap ; // pointeur sur tampon sous l'icone de déplacement du train en page CDM ax,ay,x,y : integer; // coordonnées du train (anciennes et nouvelles) en points windows x0,y0,x1,y1 : integer; // ancien contour du tampon, pour l'animation dans la fenêtre cdm - // route ----------------------------------- + // routes ----------------------------------- roulage : integer; // =1 train en roulage mais arrêté pour réservation par tiers =2 en roulage effectif dernierDet : integer; // dernier détecteur traité cantonOrg,CantonDest : integer; // cantons origine et destination si route route : TuneRoute; // tableau de la route en cours du train NomRoute : array[1..30] of string; // nom de la route sauvegardée NomRouteCour : string; // nom de la route courante - routePref : array[0..30] of TUneroute; // tableau de la route sauvegardée du train. routePref[0,0].adresse est le nombre de routes + routePref : array[0..30] of TUneroute; // tableaux dess route sauvegardées du train. routePref[0,0].adresse est le nombre de routes + // routePref[0,0].talon = consigne inverse au train PointRout : integer; // cantons (via leurs déteceteurs) sur lesquels le train doit d'arrêter DetecteurArret : array[1..NbDetArret] of record @@ -1253,12 +1256,12 @@ var // utilisation des procédures et fonctions dans les autres unités function Index_Signal(adresse : integer) : integer; function Index_Aig(adresse : integer) : integer; -procedure dessine_signal2(Acanvas : Tcanvas;x,y : integer;frX,frY : single;EtatSignal : word;orientation : integer); -procedure dessine_signal3(Acanvas : Tcanvas;x,y : integer;frX,frY : single;EtatSignal : word;orientation : integer); -procedure dessine_signal4(Acanvas : Tcanvas;x,y : integer;frX,frY : single;EtatSignal : word;orientation : integer); -procedure dessine_signal5(Acanvas : Tcanvas;x,y : integer;frX,frY : single;EtatSignal : word;orientation : integer); -procedure dessine_signal7(Acanvas : Tcanvas;x,y : integer;frX,frY : single;EtatSignal : word;orientation : integer); -procedure dessine_signal9(Acanvas : Tcanvas;x,y : integer;frX,frY : single;etatsignal : word;orientation : integer); +procedure dessine_signal2(Acanvas : Tcanvas;x,y : integer;frX,frY : single;EtatSignal : word;orientation,index : integer); +procedure dessine_signal3(Acanvas : Tcanvas;x,y : integer;frX,frY : single;EtatSignal : word;orientation,index : integer); +procedure dessine_signal4(Acanvas : Tcanvas;x,y : integer;frX,frY : single;EtatSignal : word;orientation,index : integer); +procedure dessine_signal5(Acanvas : Tcanvas;x,y : integer;frX,frY : single;EtatSignal : word;orientation,index : integer); +procedure dessine_signal7(Acanvas : Tcanvas;x,y : integer;frX,frY : single;EtatSignal : word;orientation,index : integer); +procedure dessine_signal9(Acanvas : Tcanvas;x,y : integer;frX,frY : single;etatsignal : word;orientation,index : integer); procedure dessine_signal20(Acanvas : Tcanvas;x,y : integer;frX,frY : single;EtatSignal : word;orientation,adresse : integer); procedure dessine_dirN(Acanvas : Tcanvas;x,y : integer;frX,frY : single;EtatSignal : word;orientation,N : integer); procedure Maj_Etat_Signal(adresse,aspect : integer); @@ -1369,6 +1372,7 @@ procedure affecte_trains_config; procedure Fonction_Loco_Operation(loco,fonction,etat : integer); procedure calcul_equations_coeff(indexTrain : integer); procedure connecte_interface_ethernet; +function lire_cv(cv : integer) : integer; implementation @@ -1692,7 +1696,7 @@ var i,j,index : integer; si : tStyleInfo; {$IFEND} begin - {$IF CompilerVersion >= 28.0} + {$IF CompilerVersion >= 28.0} if Ancien_Nom_Style<>Nom_style_aff then begin TStyleManager.TrySetStyle(TStyleManager.StyleNames[0]); // repasse en windows (style 0) pour éviter exception après changement du nouveau style @@ -1714,7 +1718,7 @@ begin end; // vérification de la validité du style, et récupération de la structure si qui contient le vrai nom - // du style qu'il faudra utiliser pour son application + // du style qu'il faudra utiliser dans la fonction d'ouverture du style try if tStyleManager.IsValidStyle(s,si)=false then begin @@ -1729,11 +1733,11 @@ begin end; // reprendre le vrai nom du style depuis SI.name car le nom du fichier peur être différent du nom du style - // exemple le style Metropolis UI Dark (avec espaces) a pour nom de fichier MetropolisUIDark.vsf + // exemple le style "Metropolis UI Dark" (avec espaces) a pour nom de fichier "MetropolisUIDark.vsf" Nom_style_aff:=si.Name; try - TStyleManager.ReloadStyle(Nom_Style_aff); // librairie Vcl.Styles.Ext + TStyleManager.ReloadStyle(Nom_Style_aff); // charge le style - librairie Vcl.Styles.Ext except Affiche('Erreur d''application du style '+Nom_style_aff+' version='+si.version,clOrange); exit; @@ -1741,13 +1745,8 @@ begin // repasser certains composants dans le styleName windows permet que le composant affiche en couleurs voulues // car changer de style sur un composant dont le styleName n'est plus windows interdit de changer sa couleur - Formprinc.FenRich.StyleName:='Windows'; - if formDebug<>nil then - begin - FormDebug.RichDebug.StyleName:='Windows'; - formDebug.MemoEvtDet.StyleName:='Windows'; - end; + // et dans formdebug.Create aussi // énumérer tous les composants pour repaint les richedit - ne marche pas { @@ -1767,16 +1766,6 @@ begin end; } - { - if formConfig<>nil then - begin - FormConfig.RichBranche.StyleName:='Windows'; - FormConfig.RichCdeDccpp.StyleName:='Windows'; - end; - for i:=1 to NbreTCO do - begin - if FormTCO[i]<>nil then FormTCO[i].ScrollBox.StyleName:='Windows'; - end; } Ancien_nom_style:=nom_Style_aff; end; {$IFEND} @@ -3026,13 +3015,103 @@ begin end; end; +// Ecrire sur un canvas un texte avec un angle, avec ou sans bordure, monochrome ou à face texturée +// params : C = Canvas-cible +// X,Y = Coordonnées angle supérieur gauche du début du texte. +// Fonte = Police de caractères à utiliser : uniquement des fontes scalables. +// clBord = Couleur de la bordure. +// EpBord = Epaisseur de la bordure. +// PenMode = TPenMode : utiliser en général pmCopy. +// si Clfond=clback, on écrit en transparent +// Texte = Texte à écrire. +// AngleDD = Angle d'inclinaison en Dixièmes de degré. +procedure AffTexteIncliBordeTexture(c : TCanvas; x,y : integer; Fonte : tFont; + clBord : TColor; EpBord : integer; PenMode : TPenMode; + texte : string; AngleDD : longint); +var dc : Hdc; + lgFont : Logfont; // structure d'attributs de police + AncFonte,NouvFonte : Hfont; + AncPen,NouvPen : Hpen; + AncBrush,NouvBrush : Hbrush; + i : integer; +begin + C.Pen.Mode:=PenMode; + dc:=C.Handle; + + c.pen.Mode:=PmCopy; + //c.pen.Color:=clfond; //clfond; + //c.Brush.color:=clfond; + c.pen.width:=1; + i:=round(length(texte)*0.5*abs(fonte.size)); +// c.Rectangle(x+2,y,x+15,y-i); + + // Initialisation de la fonte + zeroMemory(@lgFont,sizeOf(lgFont)); // remplit la structure de 0 + strPCopy(lgFont.lfFaceName,Fonte.Name); // copie la chaîne dans le nom de la fonte depuis le paramètre + lgFont.lfHeight:=Fonte.Height; // la taille + if Fonte.style=[] then lgFont.lfWeight:=FW_REGULAR; // Normal + if Fonte.style=[fsBold] then lgFont.lfWeight:=FW_BOLD; // Gras + + if fsItalic in Fonte.style then lgFont.lfItalic:=1; + if fsUnderline in Fonte.style then lgFont.lfUnderline:=1; + if fsStrikeout in Fonte.style then lgFont.lfStrikeout:=1; + + lgFont.lfEscapement:=AngleDD; // Angle d'inclinaison en dixièmes de degrés + + NouvFonte:=CreateFontInDirect(lgFont); + AncFonte:=SelectObject(dc,NouvFonte); + + // Initialisation du contour : + if EpBord<>0 then NouvPen := CreatePen(PS_SOLID,EpBord,clBord) + else NouvPen := CreatePen(PS_NULL,0,0); + AncPen:= SelectObject(dc,NouvPen); + + // Initialisation de la couleur de la police ou de la Texture : + //if Texture=nil then + NouvBrush := CreateSolidBrush(Fonte.color); + // else NouvBrush := CreatePatternBrush(Texture.Handle); + AncBrush:=SelectObject(dc,NouvBrush); + // Le contexte doit être transparent + SetBkMode(dc,TRANSPARENT); + + + + + // Dessin du texe : + BeginPath(dc); + TextOut(dc,X,Y,PChar(Texte),length(texte)); //<- au lieu de TextOut(dc,X,Y,PansiChar(Texte),length(texte)) pour rendre le code compatible avec toutes les versions de Delphi (de D2 à XE2); + EndPath(dc); + StrokeAndFillPath(dc); + + // Restauration objets et libération mémoire + SelectObject(dc,AncFonte); + DeleteObject(NouvFonte); + SelectObject(dc,AncPen); + DeleteObject(NouvPen); + SelectObject(dc,AncBrush); + DeleteObject(NouvBrush); +end; +// inverse une image (miroir horizontal) et la met dans dest +// Utilisé pour les signaux belges, et les trains +procedure inverse_image(imageDest,ImageSrc : Timage); +var mrect,nrect : trect; + larg,haut : integer; +begin + larg:=ImageSrc.Width; + haut:=ImageSrc.Height; + mRect:=rect(0,0,larg,haut); + nRect:=rect(larg-1,0,-1,haut); + ImageDest.canvas.CopyRect(mRect,ImageSrc.canvas,nRect); +end; + +{ // dessine les 2 feux sur la cible dans le canvas spécifié // x,y : offset en pixels du coin supérieur gauche du feu // Acanvas : canvas de destination // frX, frY : facteurs de réduction (pour agrandissement) // EtatSignal : état du signal // orientation à donner au signal : 1= vertical 2=90° à gauche 3=90° à droite 4=180° -procedure dessine_signal2(Acanvas : Tcanvas;x,y : integer;frX,frY : single;EtatSignal : word;orientation : integer); +procedure dessine_signal2(Acanvas : Tcanvas;x,y : integer;frX,frY : single;EtatSignal : word;orientation,index : integer); var Temp,rayon,xViolet,YViolet,xBlanc,yBlanc, LgImage,HtImage,code,combine : integer; ech : real; @@ -3077,9 +3156,17 @@ begin XBlanc:=round(xBlanc*Frx)+x; YBlanc:=round(Yblanc*Fry)+y; XViolet:=round(XViolet*FrX)+x; YViolet:=round(YViolet*FrY)+y; + if signaux[index].AncienAff<>EtatSignal then + begin + //Affiche('efface tout',clred); + cercle(ACanvas,xBlanc,yBlanc,rayon,GrisF); + cercle(ACanvas,xViolet,yViolet,rayon,GrisF); + signaux[index].AncienAff:=EtatSignal; + end; + + // extinctions - if not((code=blanc_cli) and clignotant) then cercle(ACanvas,xBlanc,yBlanc,rayon,GrisF); - cercle(ACanvas,xViolet,yViolet,rayon,GrisF); + if (code=blanc_cli) and not(clignotant) then cercle(ACanvas,xBlanc,yBlanc,rayon,GrisF); // allumages if ((code=blanc_cli) and (clignotant)) or (code=blanc) then cercle(ACanvas,xBlanc,yBlanc,rayon,clWhite); @@ -3087,7 +3174,7 @@ begin end; // dessine les feux sur une cible à 3 feux -procedure dessine_signal3x(Acanvas : Tcanvas;x,y : integer;frX,frY : real;EtatSignal : word;orientation,index : integer); +procedure dessine_signal3(Acanvas : Tcanvas;x,y : integer;frX,frY : real;EtatSignal : word;orientation,index : integer); var Temp,rayon,xSem,Ysem,xJaune,Yjaune,Xvert,Yvert, LgImage,HtImage,code,combine : integer; ech : real; @@ -3144,22 +3231,724 @@ begin signaux[index].AncienAff:=EtatSignal; end; + // efface if (code=vert_cli) and not(clignotant) then cercle(ACanvas,xVert,yVert,rayon,GrisF); if (code=jaune_cli) and not(clignotant) then cercle(ACanvas,xJaune,yJaune,rayon,GrisF); if (code=semaphore_cli) and not(clignotant) then cercle(ACanvas,xSem,ySem,rayon,GrisF); - if (code=vert_cli) and not(clignotant) then Affiche('efface vert',clred); - if (code=jaune_cli) and not(clignotant) then Affiche('efface jaune',clred); - if (code=semaphore_cli) and not(clignotant) then Affiche('efface rouge',clred); - // allumages if ((code=vert_cli) and (clignotant)) or (code=vert) then cercle(ACanvas,xVert,yVert,rayon,clGreen); if ((code=jaune_cli) and (clignotant)) or (code=jaune) then cercle(Acanvas,xJaune,yJaune,rayon,clOrange); if ((code=semaphore_cli) and (clignotant)) or (code=semaphore) then cercle(ACanvas,xSem,ySem,rayon,clRed); + +end; + +// dessine les feux sur une cible à 4 feux +// orientation=1 vertical +procedure dessine_signal4(Acanvas : Tcanvas;x,y : integer;frX,frY : single;EtatSignal : word;orientation,index : integer); +var Temp,rayon,xSem,Ysem,xJaune,Yjaune,Xcarre,Ycarre,Xvert,Yvert, + LgImage,HtImage,code,combine : integer; + ech : real; +begin + code_to_aspect(Etatsignal,code,combine); // et aspect + rayon:=round(6*frX); + + with Formprinc.Image4feux.Picture.Bitmap do + begin + LgImage:=Width; + HtImage:=Height; + end; + + Xcarre:=13; ycarre:=11; + Xvert:=13; Yvert:=22; + xSem:=13; ySem:=33; + xJaune:=13; yJaune:=44; + + if (orientation=2) then + begin + // rotation 90° vers la gauche des feux + ech:=frY;frY:=frX;FrX:=ech; + Temp:=HtImage-yjaune; YJaune:=XJaune;Xjaune:=Temp; + Temp:=HtImage-ycarre; Ycarre:=Xcarre;Xcarre:=Temp; + Temp:=HtImage-ySem; YSem:=XSem;XSem:=Temp; + Temp:=HtImage-yvert; Yvert:=Xvert;Xvert:=Temp; + end; + + if (orientation=3) then + begin + //rotation 90° vers la droite des feux + // calcul des facteurs de réduction pour la rotation + ech:=frY;frY:=frX;FrX:=ech; + Temp:=LgImage-Xjaune;XJaune:=YJaune;Yjaune:=Temp; + Temp:=LgImage-XSem;XSem:=YSem;YSem:=Temp; + Temp:=LgImage-Xvert;Xvert:=Yvert;Yvert:=Temp; + Temp:=LgImage-Xcarre;Xcarre:=Ycarre;Ycarre:=Temp; + end; + + if (orientation=4) then + begin + // rotation 180° + Xjaune:=LgImage-Xjaune;YJaune:=HtImage-YJaune; + XSem:=LgImage-XSem; YSem:=HtImage-YSem; + XVert:=LgImage-Xvert; Yvert:=HtImage-Yvert; + Xcarre:=LgImage-Xcarre;Ycarre:=HtImage-Ycarre; + end; + + XJaune:=round(Xjaune*Frx)+x; YJaune:=round(Yjaune*Fry)+Y; + 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; + + // nouveau cercle(ACanvas,Xcarre,yCarre,rayon,GrisF); Affiche('Eteint carré',clYellow); + + if signaux[index].AncienAff<>EtatSignal then + begin + //Affiche('efface tout',clred); + cercle(ACanvas,xVert,yVert,rayon,GrisF); + cercle(ACanvas,xSem,ySem,rayon,GrisF); + cercle(ACanvas,xJaune,yJaune,rayon,GrisF); + cercle(ACanvas,xCarre,yCarre,rayon,GrisF); + + signaux[index].AncienAff:=EtatSignal; + end; + + // extinctions + if (code=vert_cli) and not(clignotant) then cercle(ACanvas,Xvert,yvert,rayon,GrisF); + if (code=semaphore_cli) and not(clignotant) then cercle(ACanvas,Xsem,Ysem,rayon,GrisF); + if (code=jaune_cli) and not(clignotant) then cercle(ACanvas,Xjaune,YJaune,rayon,GrisF); + + // allumages + if (code=vert_cli) and clignotant or (code=vert) then cercle(ACanvas,xVert,yVert,rayon,clGreen); + if (code=semaphore_cli) and clignotant or (code=semaphore) then cercle(ACanvas,xSem,ySem,rayon,clRed); + if (code=jaune_cli) and clignotant or (code=jaune) then cercle(Acanvas,Xjaune,yJaune,rayon,clOrange); + if code=carre then begin cercle(ACanvas,xSem,Ysem,rayon,clRed);cercle(ACanvas,xCarre,yCarre,rayon,clRed);end; + +end; + +// dessine les feux sur une cible à 5 feux +procedure dessine_signal5(Acanvas : Tcanvas;x,y : integer;frX,frY : single;EtatSignal : word;orientation,index : integer); +var XBlanc,Yblanc,xJaune,yJaune,Xsem,YSem,Xvert,YVert,Xcarre,Ycarre, + Temp,rayon,LgImage,HtImage,code,combine : integer; + ech : real; + +begin + code_to_aspect(Etatsignal,code,combine); // et aspect + rayon:=round(6*frX); + XBlanc:=13; YBlanc:=11; + xJaune:=13; yJaune:=55; + Xcarre:=13; Ycarre:=22; + XSem:=13; Ysem:=44; + XVert:=13; YVert:=33; + + with Formprinc.Image5feux.Picture.Bitmap do + begin + LgImage:=Width; + HtImage:=Height; + end; + if (orientation=2) then + begin + // rotation 90° vers la gauche des signaux + // calcul des facteurs de réduction pour la rotation + ech:=frY;frY:=frX;FrX:=ech; + Temp:=HtImage-yjaune;YJaune:=XJaune;Xjaune:=Temp; + Temp:=HtImage-yBlanc;YBlanc:=XBlanc;XBlanc:=Temp; + Temp:=HtImage-ycarre;Ycarre:=Xcarre;Xcarre:=Temp; + Temp:=HtImage-ySem;YSem:=XSem;XSem:=Temp; + Temp:=HtImage-yvert;Yvert:=Xvert;Xvert:=Temp; + end; + + if (orientation=3) then + begin + // rotation 90° vers la droite des signaux + // calcul des facteurs de réduction pour la rotation + ech:=frY;frY:=frX;FrX:=ech; + Temp:=LgImage-Xjaune;XJaune:=YJaune;Yjaune:=Temp; + Temp:=LgImage-XSem;XSem:=YSem;YSem:=Temp; + Temp:=LgImage-Xvert;Xvert:=Yvert;Yvert:=Temp; + Temp:=LgImage-Xcarre;Xcarre:=Ycarre;Ycarre:=Temp; + Temp:=LgImage-Xblanc;Xblanc:=Yblanc;Yblanc:=Temp; + end; + + if (orientation=4) then + begin + // rotation 180° + Xjaune:=LgImage-Xjaune;YJaune:=HtImage-YJaune; + XSem:=LgImage-XSem; YSem:=HtImage-YSem; + XVert:=LgImage-Xvert; Yvert:=HtImage-Yvert; + Xcarre:=LgImage-Xcarre;Ycarre:=HtImage-Ycarre; + Xblanc:=LgImage-Xblanc;Yblanc:=HtImage-YBlanc; + end; + + XJaune:=round(Xjaune*Frx)+x; YJaune:=round(Yjaune*Fry)+Y; + Xblanc:=round(XBlanc*FrX)+x; YBlanc:=round(YBlanc*FrY)+Y; + 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; + + if signaux[index].AncienAff<>EtatSignal then + begin + //Affiche('efface tout',clred); + cercle(ACanvas,xVert,yVert,rayon,GrisF); + cercle(ACanvas,xSem,ySem,rayon,GrisF); + cercle(ACanvas,xJaune,yJaune,rayon,GrisF); + cercle(ACanvas,xCarre,yCarre,rayon,GrisF); + cercle(ACanvas,xblanc,yblanc,rayon,GrisF); + signaux[index].AncienAff:=EtatSignal; + end; + + // extinctions + if (code=blanc_cli) and not(clignotant) then cercle(ACanvas,xBlanc,yBlanc,rayon,GrisF); + if (code=vert_cli) and not(clignotant) then cercle(ACanvas,xvert,yvert,rayon,GrisF); + if (code=semaphore_cli) and not(clignotant) then cercle(ACanvas,xSem,ySem,rayon,GrisF); + if (code=jaune_cli) and not(clignotant) then cercle(ACanvas,xjaune,yjaune,rayon,GrisF); + + // allumages + if code=carre then begin cercle(ACanvas,xcarre,ycarre,rayon,clRed);cercle(ACanvas,xsem,ysem,rayon,clRed);end; + + if ((code=semaphore_cli) and (clignotant)) or (code=semaphore) then cercle(ACanvas,xsem,ysem,rayon,clRed); + if ((code=blanc_cli) and (clignotant)) or (code=blanc) then cercle(ACanvas,xblanc,yblanc,rayon,clWhite); + if (code=violet) then cercle(ACanvas,xblanc,yblanc,rayon,clViolet); + if ((code=vert_cli) and (clignotant)) or (code=vert) then cercle(ACanvas,xvert,yVert,rayon,clGreen); + if ((code=jaune_cli) and (clignotant)) or (code=jaune) then cercle(ACanvas,xJaune,yjaune,rayon,clorange); +end; + + +// dessine les feux sur une cible à 7 feux +procedure dessine_signal7(Acanvas : Tcanvas;x,y : integer;frX,frY : single;EtatSignal : word;orientation,index : integer); +var XBlanc,Yblanc,xJaune,yJaune,Xsem,YSem,Xvert,YVert,Xcarre,Ycarre,Xral1,Yral1,Xral2,YRal2, + Temp,rayon,LgImage,HtImage,code,combine : integer; + ech : real; +begin + code_to_aspect(Etatsignal,code,combine); // et combine + rayon:=round(6*frX); + XBlanc:=13; YBlanc:=23; + Xral1:=13; YRal1:=11; + Xral2:=37; YRal2:=11; + xJaune:=13; yJaune:=66; + Xcarre:=13; Ycarre:=35; + XSem:=13; Ysem:=56; + XVert:=13; YVert:=45; + + with Formprinc.Image7feux.Picture.Bitmap do + begin + LgImage:=Width; + HtImage:=Height; + end; + if (orientation=2) then + begin + // rotation 90° vers la gauche des feux + // calcul des facteurs de réduction pour la rotation + ech:=frY;frY:=frX;FrX:=ech; + Temp:=HtImage-yjaune;YJaune:=XJaune;Xjaune:=Temp; + Temp:=HtImage-yBlanc;YBlanc:=XBlanc;XBlanc:=Temp; + Temp:=HtImage-yRal1;YRal1:=XRal1;XRal1:=Temp; + Temp:=HtImage-yRal2;YRal2:=XRal2;XRal2:=Temp; + Temp:=HtImage-ycarre;Ycarre:=Xcarre;Xcarre:=Temp; + Temp:=HtImage-ySem;YSem:=XSem;XSem:=Temp; + Temp:=HtImage-yvert;Yvert:=Xvert;Xvert:=Temp; + end; + + if (orientation=3) then + begin + // rotation 90° vers la droite des feux + // calcul des facteurs de réduction pour la rotation + ech:=frY;frY:=frX;FrX:=ech; + Temp:=LgImage-Xjaune;XJaune:=YJaune;Yjaune:=Temp; + Temp:=LgImage-XSem;XSem:=YSem;YSem:=Temp; + Temp:=LgImage-Xvert;Xvert:=Yvert;Yvert:=Temp; + Temp:=LgImage-Xcarre;Xcarre:=Ycarre;Ycarre:=Temp; + Temp:=LgImage-Xblanc;Xblanc:=Yblanc;Yblanc:=Temp; + Temp:=LgImage-Xral1;Xral1:=Yral1;Yral1:=Temp; + Temp:=LgImage-Xral2;Xral2:=Yral2;Yral2:=Temp; + end; + + if (orientation=4) then + begin + //rotation 180° + Xjaune:=LgImage-Xjaune;YJaune:=HtImage-YJaune; + XSem:=LgImage-XSem; YSem:=HtImage-YSem; + XVert:=LgImage-Xvert; Yvert:=HtImage-Yvert; + Xcarre:=LgImage-Xcarre;Ycarre:=HtImage-Ycarre; + Xblanc:=LgImage-Xblanc;Yblanc:=HtImage-YBlanc; + Xral1:=LgImage-Xral1; Yral1:=HtImage-Yral1; + Xral2:=LgImage-Xral2; Yral2:=HtImage-Yral2; + end; + + XJaune:=round(Xjaune*Frx)+x; YJaune:=round(Yjaune*Fry)+Y; + Xblanc:=round(XBlanc*FrX)+x; YBlanc:=round(YBlanc*FrY)+Y; + XRal1:=round(XRal1*FrX)+x; YRal1:=round(YRal1*FrY)+Y; + XRal2:=round(XRal2*FrX)+x; YRal2:=round(YRal2*FrY)+Y; + 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; + + if signaux[index].AncienAff<>EtatSignal then + begin + //Affiche('efface tout',clred); + cercle(ACanvas,xVert,yVert,rayon,GrisF); + cercle(ACanvas,xSem,ySem,rayon,GrisF); + cercle(ACanvas,xJaune,yJaune,rayon,GrisF); + cercle(ACanvas,xCarre,yCarre,rayon,GrisF); + cercle(ACanvas,xblanc,yblanc,rayon,GrisF); + cercle(ACanvas,xRal1,yRal1,rayon,GrisF); + cercle(ACanvas,xRal2,yRal2,rayon,GrisF); + + signaux[index].AncienAff:=EtatSignal; + end; + + // effacements + if (code=blanc_cli) and not(clignotant) then cercle(ACanvas,xBlanc,yBlanc,rayon,grisF); + if (combine=ral_60) and not(clignotant) then begin cercle(ACanvas,Xral1,Yral1,rayon,grisF);cercle(ACanvas,Xral2,Yral2,rayon,GrisF);end; + if (code=vert_cli) and not(clignotant) then cercle(ACanvas,xVert,yVert,rayon,GrisF); + if (code=jaune_cli) and not(clignotant) then cercle(ACanvas,xJaune,yJaune,rayon,GrisF); + if (code=semaphore_cli) and not(clignotant) then cercle(ACanvas,xSem,ySem,rayon,GrisF); + + // Allumages + if (combine=ral_30) or ((combine=ral_60) and clignotant) then begin cercle(ACanvas,xRal1,yRal1,rayon,clOrange);cercle(ACanvas,xRal2,yRal2,Rayon,clOrange);end; + if ((code=jaune_cli) and clignotant) or (code=jaune) then cercle(Acanvas,xjaune,yjaune,rayon,clOrange); + if ((code=semaphore_cli) and (clignotant)) or (code=semaphore) then cercle(ACanvas,xsem,ysem,rayon,clRed); + if ((code=vert_cli) and (clignotant)) or (code=vert) then cercle(ACanvas,xVert,yVert,rayon,clGreen); + if ((code=blanc_cli) and (clignotant)) or (code=blanc) then cercle(ACanvas,xBlanc,yBlanc,rayon,clWhite); + if (code=violet) then cercle(ACanvas,xblanc,yblanc,rayon,clViolet); + if code=carre then + begin + cercle(ACanvas,xCarre,yCarre,rayon,clRed); + cercle(ACanvas,xSem,ySem,rayon,clRed); + end; +end; + +// dessine les feux sur une cible à 9 feux +procedure dessine_signal9(Acanvas : Tcanvas;x,y : integer;frX,frY : single;etatsignal : word;orientation,index : integer); +var rayon, + XBlanc,Yblanc,xJaune,yJaune,Xsem,YSem,Xvert,YVert,Xcarre,Ycarre,Xral1,Yral1,Xral2,YRal2, + Xrap1,Yrap1,Xrap2,Yrap2,Temp,LgImage,HtImage,xt,yt,code,combine : integer; + ech : real; +begin + rayon:=round(6*frX); + code_to_aspect(Etatsignal,code,combine); // et aspect + // mise à l'échelle des coordonnées des feux en fonction du facteur de réduction frX et frY et x et y (offsets) + + XBlanc:=13; YBlanc:=36; + Xral1:=13; YRal1:=24; + Xral2:=37; YRal2:=24; + xJaune:=13; yJaune:=80; + xRap1:=37; yRap1:=12; + xrap2:=37; yRap2:=37; + Xcarre:=13; Ycarre:=47; + XSem:=13; Ysem:=69; + XVert:=13; YVert:=58; + + with Formprinc.Image9feux.Picture.Bitmap do + begin + LgImage:=Width; + HtImage:=Height; + end; + if (orientation=2) then + begin + //rotation 90° vers la gauche des feux : échange des coordonnées X et Y et translation sur HtImage + ech:=frY;frY:=frX;FrX:=ech; + Temp:=HtImage-yjaune;YJaune:=XJaune;Xjaune:=Temp; + Temp:=HtImage-yBlanc;YBlanc:=XBlanc;XBlanc:=Temp; + Temp:=HtImage-yRal1;YRal1:=XRal1;XRal1:=Temp; + Temp:=HtImage-yRal2;YRal2:=XRal2;XRal2:=Temp; + Temp:=HtImage-ycarre;Ycarre:=Xcarre;Xcarre:=Temp; + Temp:=HtImage-ySem;YSem:=XSem;XSem:=Temp; + Temp:=HtImage-yvert;Yvert:=Xvert;Xvert:=Temp; + Temp:=HtImage-yRap1;YRap1:=XRap1;XRap1:=Temp; + Temp:=HtImage-yRap2;YRap2:=XRap2;XRap2:=Temp; + end; + + if (orientation=3) then + begin + //rotation 90° vers la droite des feux : échange des coordonnées X et Y et translation sur LgImage + ech:=frY;frY:=frX;FrX:=ech; + Temp:=LgImage-Xjaune;XJaune:=YJaune;Yjaune:=Temp; + Temp:=LgImage-XSem;XSem:=YSem;YSem:=Temp; + Temp:=LgImage-Xvert;Xvert:=Yvert;Yvert:=Temp; + Temp:=LgImage-Xcarre;Xcarre:=Ycarre;Ycarre:=Temp; + Temp:=LgImage-Xblanc;Xblanc:=Yblanc;Yblanc:=Temp; + Temp:=LgImage-Xral1;Xral1:=Yral1;Yral1:=Temp; + Temp:=LgImage-Xral2;Xral2:=Yral2;Yral2:=Temp; + Temp:=LgImage-Xrap1;Xrap1:=Yrap1;Yrap1:=Temp; + Temp:=LgImage-Xrap2;Xrap2:=Yrap2;Yrap2:=Temp; + end; + + if (orientation=4) then + begin + //rotation 180° + Xjaune:=LgImage-Xjaune;YJaune:=HtImage-YJaune; + XSem:=LgImage-XSem; YSem:=HtImage-YSem; + XVert:=LgImage-Xvert; Yvert:=HtImage-Yvert; + Xcarre:=LgImage-Xcarre;Ycarre:=HtImage-Ycarre; + Xblanc:=LgImage-Xblanc;Yblanc:=HtImage-YBlanc; + Xral1:=LgImage-Xral1; Yral1:=HtImage-Yral1; + Xral2:=LgImage-Xral2; Yral2:=HtImage-Yral2; + Xrap1:=LgImage-Xrap1; Yrap1:=HtImage-Yrap1; + Xrap2:=LgImage-Xrap2; Yrap2:=HtImage-Yrap2; + end; + + XJaune:=round(Xjaune*Frx)+x; YJaune:=round(Yjaune*Fry)+Y; + Xblanc:=round(XBlanc*FrX)+x; YBlanc:=round(YBlanc*FrY)+Y; + XRal1:=round(XRal1*FrX)+x; YRal1:=round(YRal1*FrY)+Y; + XRal2:=round(XRal2*FrX)+x; YRal2:=round(YRal2*FrY)+Y; + 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; + XRap1:=round(XRap1*FrX)+x; YRap1:=round(YRap1*FrY)+Y; + XRap2:=round(XRap2*FrX)+x; YRap2:=round(YRap2*FrY)+Y; + + if signaux[index].AncienAff<>EtatSignal then + begin + //Affiche('efface tout',clred); + cercle(ACanvas,xVert,yVert,rayon,GrisF); + cercle(ACanvas,xSem,ySem,rayon,GrisF); + cercle(ACanvas,xJaune,yJaune,rayon,GrisF); + cercle(ACanvas,xCarre,yCarre,rayon,GrisF); + cercle(ACanvas,xblanc,yblanc,rayon,GrisF); + cercle(ACanvas,xRal1,yRal1,rayon,GrisF); + cercle(ACanvas,xRal2,yRal2,rayon,GrisF); + cercle(ACanvas,xRap1,yRap1,rayon,GrisF); + cercle(ACanvas,xRap2,yRap2,rayon,GrisF); + + signaux[index].AncienAff:=EtatSignal; + end; + + // extinctions + if (code=blanc_cli) and not(clignotant) then cercle(ACanvas,xBlanc,yBlanc,Rayon,grisF); + if (combine=ral_60) and not(clignotant) then begin cercle(ACanvas,Xral1,Yral1,rayon,grisF);cercle(ACanvas,xRal2,yRal2,rayon,grisF);end; + if (code=jaune_cli) and not(clignotant) then cercle(ACanvas,xJaune,yJaune,rayon,grisF); + if (code=rappel_60) and not(clignotant) then begin cercle(ACanvas,xrap1,yrap1,rayon,grisF);cercle(ACanvas,xrap2,yrap2,rayon,grisF);end; + if (code=semaphore_cli) and not(clignotant) then cercle(ACanvas,xSem,ySem,rayon,grisF); + if (code=vert_cli) and not(clignotant) then cercle(ACanvas,xvert,yvert,rayon,grisF); + + // allumages + if ((code=ral_60) and clignotant) or (code=ral_30) or ((combine=ral_60) and clignotant) or (combine=ral_30) then + begin + cercle(ACanvas,Xral1,yRal1,rayon,clOrange);cercle(ACanvas,xral2,yral2,rayon,clOrange); + end; + + if ((code=rappel_60) and clignotant) or (code=rappel_30) or + ((combine=rappel_60) and clignotant) or (combine=rappel_30) then + begin + cercle(ACanvas,xrap1,yrap1,rayon,clOrange);cercle(ACanvas,xrap2,yrap2,rayon,clOrange); + end; + if ((code=jaune_cli) and clignotant) or (code=jaune) then cercle(Acanvas,xjaune,yjaune,rayon,clOrange); + if ((code=semaphore_cli) and clignotant) or (code=semaphore) then cercle(ACanvas,Xsem,ySem,rayon,clRed); + if ((code=vert_cli) and clignotant) or (code=vert) then cercle(ACanvas,xvert,yvert,rayon,clGreen); + if ((code=blanc_cli) and clignotant) or (code=blanc) then cercle(ACanvas,xBlanc,yBlanc,rayon,clWhite); + if (code=violet) then cercle(ACanvas,xblanc,yblanc,rayon,clViolet); + + if code=carre then + begin + cercle(ACanvas,xcarre,yCarre,rayon,clRed); + cercle(ACanvas,xsem,ysem,rayon,clRed); + end; +end; + + +// dessine les feux sur une cible belge à 5 feux +// cette image peut être inversée (contre voie) + +procedure dessine_signal20(Acanvas : Tcanvas;x,y : integer;frX,frY : single;EtatSignal : word;orientation,adresse : 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,indexTCO,tailleFonte,xTexte,yTexte : integer; + ech : real; + inverse,etatChevron,EtatChiffre,codeClignote : boolean; + r : Trect; +begin + + code:=etatSignal and $3f; + combine:=etatSignal and $1c0; + // LDT-DEC-NMBS ou b-model + etatChiffre:=testBit(combine,chiffre); + etatChevron:=testBit(combine,chevron); + CodeClignote:=testBit(combine,clignote); + largeur:=57; + + rayon:=round(6*frX); + xVert:=15; yvert:=24; + xrouge:=15; yrouge:=37; + xjauneBas:=15;yjauneBas:=50; + xblanc:=15;yblanc:=63; + xJauneHaut:=41;yJauneHaut:=24; + + // chevron + x1:=9;y1:=3; + x2:=16;y2:=10; + x3:=x2+(x2-x1);y3:=y1; + // effacement du chiffre + XChiffre:=11;Ychiffre:=77; + Xfin:=27;yFin:=102; + // texte du chiffre + xTexte:=xChiffre+2; + yTexte:=yChiffre+1; + + index:=index_signal(adresse); + if Signaux[index].contrevoie then + begin + xvert:=largeur-xvert; + xrouge:=largeur-xrouge; + xjaunebas:=largeur-xjaunebas; + xjaunehaut:=largeur-xjaunehaut; + xblanc:=largeur-xblanc; + x1:=largeur-x1; + x2:=largeur-x2; + x3:=largeur-x3; + Xchiffre:=32; + Xfin:=44; + Xtexte:=Xchiffre+1; + codeclignote:=true; + end; + + if XChiffre>Xfin then echange(Xchiffre,Xfin); + + with Formprinc.ImageSignal20.Picture.Bitmap do + begin + LgImage:=Width; + HtImage:=Height; + end; + + if (orientation=2) then + begin + //rotation 90° vers la gauche des signaux + // calcul des facteurs de réduction pour la rotation + ech:=frY;frY:=frX;FrX:=ech; + Temp:=HtImage-yjauneBas;YJauneBas:=XJauneBas;XjauneBas:=Temp; + Temp:=HtImage-yjauneHaut;YJauneHaut:=XJauneHaut;XjauneHaut:=Temp; + Temp:=HtImage-yblanc;YBlanc:=XBlanc;XBlanc:=Temp; + Temp:=HtImage-yRouge;YRouge:=Xrouge;XRouge:=Temp; + Temp:=HtImage-yvert;Yvert:=Xvert;Xvert:=Temp; + Temp:=HtImage-y1;Y1:=X1;X1:=Temp; + Temp:=HtImage-y2;Y2:=X2;X2:=Temp; + Temp:=HtImage-y3;Y3:=X3;X3:=Temp; + Temp:=HtImage-yChiffre;YChiffre:=XChiffre;XChiffre:=Temp; + Temp:=HtImage-yTexte;YTexte:=XTexte;XTexte:=Temp; + Temp:=HtImage-yfin;Yfin:=Xfin;Xfin:=Temp; + end; + + if (orientation=3) then + begin + // rotation 90° vers la droite des signaux + // calcul des facteurs de réduction pour la rotation + ech:=frY;frY:=frX;FrX:=ech; + Temp:=LgImage-XjauneBas;XJauneBas:=YJauneBas;YjauneBas:=Temp; + Temp:=LgImage-XJauneHaut;XJauneHaut:=YJauneHaut;YjauneHaut:=Temp; + Temp:=LgImage-Xvert;Xvert:=Yvert;Yvert:=Temp; + Temp:=LgImage-Xrouge;Xrouge:=Yrouge;Yrouge:=Temp; + Temp:=LgImage-Xblanc;Xblanc:=Yblanc;Yblanc:=Temp; + + Temp:=LgImage-x1;X1:=Y1;Y1:=Temp; + Temp:=LgImage-X2;X2:=Y2;Y2:=Temp; + Temp:=LgImage-X3;X3:=Y3;Y3:=Temp; + Temp:=LgImage-XChiffre;XChiffre:=YChiffre;YChiffre:=Temp; + Temp:=LgImage-Xfin;Xfin:=Yfin;Yfin:=Temp; + Temp:=LgImage-XTexte;XTexte:=YTexte;YTexte:=Temp; + end; + + if orientation=4 then + begin + XjauneBas:=LgImage-XjauneBas;YjauneBas:=HtImage-YjauneBas; + XJauneHaut:=LgImage-XJauneHaut;YjauneHaut:=HtImage-YjauneHaut; + Xvert:=LgImage-Xvert;Yvert:=HtImage-Yvert; + Xrouge:=LgImage-Xrouge;Yrouge:=HtImage-Yrouge; + XBlanc:=LgImage-XBlanc;YBlanc:=HtImage-YBlanc; + + X1:=LgImage-X1;Y1:=HtImage-Y1; + X2:=LgImage-X2;Y2:=HtImage-Y2; + X3:=LgImage-X3;Y3:=HtImage-Y3; + XChiffre:=LgImage-XChiffre;YChiffre:=HtImage-YChiffre; + XFin:=LgImage-Xfin;Yfin:=HtImage-yFin; + xTexte:=LgImage-XTexte;YTexte:=HtImage-YTexte; + end; + + XJauneBas:=round(XjauneBas*Frx)+x; YJauneBas:=round(YjauneBas*Fry)+Y; + XJauneHaut:=round(XjauneHaut*Frx)+x; YJauneHaut:=round(YjauneHaut*Fry)+Y; + Xblanc:=round(XBlanc*FrX)+x; YBlanc:=round(YBlanc*FrY)+Y; + Xvert:=round(Xvert*FrX)+x; Yvert:=round(Yvert*FrY)+Y; + Xrouge:=round(Xrouge*FrX)+x; Yrouge:=round(Yrouge*FrY)+Y; + xchiffre:=round(Xchiffre*frx)+x; ychiffre:=round(ychiffre*fry)+y; + xTexte:=round(XTexte*frx)+x; yTexte:=round(yTexte*fry)+y; + xfin:=round(Xfin*frx)+x; yfin:=round(yfin*fry)+y; + x1:=round(X1*frx)+x; y1:=round(y1*fry)+y; + x2:=round(X2*frx)+x; y2:=round(y2*fry)+y; + x3:=round(X3*frx)+x; y3:=round(y3*fry)+y; + + if signaux[index].AncienAff<>EtatSignal then + begin + //Affiche('efface tout',clred); + cercle(ACanvas,xVert,yVert,rayon,GrisF); + cercle(ACanvas,xRouge,yRouge,rayon,GrisF); + cercle(ACanvas,xblanc,yblanc,rayon,GrisF); + cercle(ACanvas,xJauneBas,yJauneBas,rayon,GrisF); + cercle(ACanvas,xJauneHaut,yJauneHaut,rayon,GrisF); + + signaux[index].AncienAff:=EtatSignal; + end; + + // extinctions + if (code=vertB_F) and codeclignote and not(clignotant) then cercle(ACanvas,xvert,yvert,rayon,GrisF); + if (code=rouge_F) and codeclignote and not(clignotant) then cercle(ACanvas,xrouge,yrouge,rayon,GrisF); + if (code=rouge_blanc_F) and codeclignote and not(clignotant) then + begin + cercle(ACanvas,xBlanc,yBlanc,rayon,GrisF); + cercle(ACanvas,xRouge,yRouge,rayon,GrisF); + end; + if (code=deux_jaunes_F) and codeclignote and not(clignotant) then + begin + cercle(ACanvas,xjaunebas,yjauneBas,rayon,GrisF); + cercle(ACanvas,xjaunehaut,yjauneHaut,rayon,GrisF); + end; + if (code=vert_jaune_H_F) and codeclignote and not(clignotant) then + begin + cercle(ACanvas,xjauneHaut,yjauneHaut,rayon,grisF); + cercle(ACanvas,xvert,yvert,rayon,grisF); + end; + if (code=vert_jaune_V_F) and codeclignote and not(clignotant) then + begin + cercle(ACanvas,xjauneBas,yjauneBas,rayon,grisF); + cercle(ACanvas,xvert,yvert,rayon,grisF); + end; + + //allumages + if ((code=vertB_F) and codeClignote and clignotant) or ((code=vertB_F) and not(codeclignote)) then cercle(ACanvas,xvert,yvert,rayon,clGreen); + if ((code=rouge_F) and codeClignote and clignotant) or ((code=rouge_F) and not(codeclignote)) then cercle(ACanvas,xrouge,yrouge,rayon,clRed); + if ((code=rouge_blanc_F) and codeClignote and clignotant) or ((code=rouge_blanc_F) and not(codeclignote)) then + begin + cercle(ACanvas,xblanc,yblanc,rayon,clWhite); + cercle(ACanvas,xrouge,yrouge,rayon,clred); + end; + if ((code=deux_jaunes_F) and codeClignote and clignotant) or ((code=deux_jaunes_F) and not(codeclignote)) then + begin + cercle(ACanvas,xjauneBas,yjauneBas,rayon,clOrange); + cercle(ACanvas,xjauneHaut,yjauneHaut,rayon,clOrange); + end; + if ((code=vert_jaune_H_F) and codeClignote and clignotant) or ((code=vert_jaune_H_F) and not(codeclignote)) then + begin + cercle(ACanvas,xjauneHaut,yjauneHaut,rayon,clorange); + cercle(ACanvas,xvert,yvert,rayon,clgreen); + end; + if ((code=vert_jaune_V_F) and codeClignote and clignotant) or ((code=vert_jaune_V_F) and not(codeclignote)) then + begin + cercle(ACanvas,xjaunebas,yjaunebas,rayon,clorange); + cercle(ACanvas,xvert,yvert,rayon,clgreen); + end; + + with Acanvas do + begin + if Etatchevron then pen.color:=ClWhite else pen.color:=clblack; + + // dessine le chevron + pen.Width:=2; + Moveto(x1,y1);Lineto(x2,y2);Lineto(x3,y3); + + // écrit le chiffre + if etatChiffre then + begin + taillefonte:=round(frx*ZoomMax); + tailleFonte:=(taillefonte div 4)+2; + //Affiche(inttoSTR(taillefonte),clred); + Brush.Color:=clblack; + with font do + begin + Color:=clWhite; + Size:=taillefonte; + Style:=[fsbold]; + Name:='Arial'; + end; + + if Signaux[index].Btype_suiv1=aig then + begin + adrAig:=Signaux[index].Adr_el_suiv1; + IndexAig:=index_aig(adrAig); + vitesse:=aiguillage[IndexAig].vitesse div 10; + + if orientation=1 then Textout(XTexte,YTexte,intToSTR(vitesse)) + else + begin + case orientation of + 2 : angle:=-900; + 3 : angle:=900; + 4 : angle:=1800; + end; + AffTexteIncliBordeTexture(Acanvas,XTexte,YTexte,Acanvas.Font,clYellow,0,pmcopy,intToSTR(vitesse),angle); + end; + end; + end + else + begin + // éteint le chiffre + Brush.Color:=clblack; + Pen.Color:=clblack; + r.Left:=xchiffre;r.Top:=Ychiffre; + r.Right:=Xfin;r.Bottom:=Yfin; + Fillrect(r); + end; + end; +end; } + +// dessine les 2 feux sur la cible dans le canvas spécifié +// x,y : offset en pixels du coin supérieur gauche du feu +// Acanvas : canvas de destination +// frX, frY : facteurs de réduction (pour agrandissement) +// EtatSignal : état du signal +// orientation à donner au signal : 1= vertical 2=90° à gauche 3=90° à droite 4=180° +procedure dessine_signal2(Acanvas : Tcanvas;x,y : integer;frX,frY : single;EtatSignal : word;orientation,index : integer); +var Temp,rayon,xViolet,YViolet,xBlanc,yBlanc, + LgImage,HtImage,code,combine : integer; + ech : real; +begin + code_to_aspect(Etatsignal,code,combine); + rayon:=round(6*frX); + + // récupérer les dimensions de l'image d'origine du feu + with Formprinc.Image2feux.Picture.Bitmap do + begin + LgImage:=Width; + HtImage:=Height; + end; + + XBlanc:=13; YBlanc:=11; + xViolet:=13; yViolet:=23; + + if (orientation=2) then + begin + //rotation 90° vers la gauche des feux + ech:=frY;frY:=frX;FrX:=ech; + Temp:=HtImage-yViolet;YViolet:=XViolet;XViolet:=Temp; + Temp:=HtImage-yBlanc;YBlanc:=XBlanc;XBlanc:=Temp; + end; + + if (orientation=3) then + begin + // rotation 90° vers la droite des feux + // inversion des facteurs de réduction pour la rotation + ech:=frY;frY:=frX;FrX:=ech; + Temp:=LgImage-XBlanc;Xblanc:=Yblanc;Yblanc:=Temp; + Temp:=LgImage-Xviolet;Xviolet:=Yviolet;Yviolet:=Temp; + end; + + // 180° + if orientation=4 then + begin + Xblanc:=LgIMage-Xblanc;Yblanc:=HtImage-Yblanc; + Xviolet:=LgIMage-Xviolet;Yviolet:=HtImage-Yviolet; + end; + + XBlanc:=round(xBlanc*Frx)+x; YBlanc:=round(Yblanc*Fry)+y; + XViolet:=round(XViolet*FrX)+x; YViolet:=round(YViolet*FrY)+y; + + // extinctions + if not((code=blanc_cli) and clignotant) then cercle(ACanvas,xBlanc,yBlanc,rayon,GrisF); + cercle(ACanvas,xViolet,yViolet,rayon,GrisF); + + // allumages + if ((code=blanc_cli) and (clignotant)) or (code=blanc) then cercle(ACanvas,xBlanc,yBlanc,rayon,clWhite); + if code=violet then cercle(ACanvas,xViolet,yViolet,rayon,clviolet); end; // dessine les feux sur une cible à 3 feux -procedure dessine_signal3(Acanvas : Tcanvas;x,y : integer;frX,frY : single;EtatSignal : word;orientation : integer); +procedure dessine_signal3(Acanvas : Tcanvas;x,y : integer;frX,frY : single;EtatSignal : word;orientation,index : integer); var Temp,rayon,xSem,Ysem,xJaune,Yjaune,Xvert,Yvert, LgImage,HtImage,code,combine : integer; ech : real; @@ -3232,7 +4021,7 @@ end; // dessine les feux sur une cible à 4 feux // orientation=1 vertical -procedure dessine_signal4(Acanvas : Tcanvas;x,y : integer;frX,frY : single;EtatSignal : word;orientation : integer); +procedure dessine_signal4(Acanvas : Tcanvas;x,y : integer;frX,frY : single;EtatSignal : word;orientation,index : integer); var Temp,rayon,xSem,Ysem,xJaune,Yjaune,Xcarre,Ycarre,Xvert,Yvert, LgImage,HtImage,code,combine : integer; ech : real; @@ -3287,7 +4076,7 @@ begin Xcarre:=round(Xcarre*FrX)+x; Ycarre:=round(Ycarre*FrY)+Y; // extinctions - cercle(ACanvas,Xcarre,yCarre,rayon,GrisF); + if not(code=carre) then cercle(ACanvas,Xcarre,yCarre,rayon,GrisF); if not((code=semaphore_cli) and clignotant) then cercle(ACanvas,Xsem,Ysem,rayon,GrisF); if not((code=vert_cli) and clignotant) then cercle(ACanvas,Xvert,yvert,rayon,GrisF); if not((code=jaune_cli) and clignotant) then cercle(ACanvas,Xjaune,YJaune,rayon,GrisF); @@ -3304,11 +4093,10 @@ begin end; // dessine les feux sur une cible à 5 feux -procedure dessine_signal5(Acanvas : Tcanvas;x,y : integer;frX,frY : single;EtatSignal : word;orientation : integer); +procedure dessine_signal5(Acanvas : Tcanvas;x,y : integer;frX,frY : single;EtatSignal : word;orientation,index : integer); var XBlanc,Yblanc,xJaune,yJaune,Xsem,YSem,Xvert,YVert,Xcarre,Ycarre, Temp,rayon,LgImage,HtImage,code,combine : integer; ech : real; - begin code_to_aspect(Etatsignal,code,combine); // et aspect rayon:=round(6*frX); @@ -3365,7 +4153,7 @@ begin // extinctions if not((code=blanc_cli) and clignotant) then cercle(ACanvas,xBlanc,yBlanc,rayon,GrisF); - cercle(ACanvas,xcarre,ycarre,rayon,GrisF); + if not(code=carre) then cercle(ACanvas,xcarre,ycarre,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) then cercle(ACanvas,xjaune,yjaune,rayon,GrisF); @@ -3385,7 +4173,7 @@ end; // dessine les feux sur une cible à 7 feux -procedure dessine_signal7(Acanvas : Tcanvas;x,y : integer;frX,frY : single;EtatSignal : word;orientation : integer); +procedure dessine_signal7(Acanvas : Tcanvas;x,y : integer;frX,frY : single;EtatSignal : word;orientation,index : integer); var XBlanc,Yblanc,xJaune,yJaune,Xsem,YSem,Xvert,YVert,Xcarre,Ycarre,Xral1,Yral1,Xral2,YRal2, Temp,rayon,LgImage,HtImage,code,combine : integer; ech : real; @@ -3460,7 +4248,7 @@ begin cercle(ACanvas,Xral1,Yral1,rayon,grisF);cercle(ACanvas,Xral2,Yral2,rayon,GrisF); end; if not((code=vert_cli) and clignotant) then cercle(ACanvas,xVert,yVert,rayon,GrisF); - cercle(ACanvas,xcarre,yCarre,rayon,GrisF);cercle(ACanvas,xSem,ySem,rayon,GrisF); + if not(code=carre) then cercle(ACanvas,xcarre,yCarre,rayon,GrisF);cercle(ACanvas,xSem,ySem,rayon,GrisF); if not((code=jaune_cli) and clignotant) then cercle(ACanvas,xJaune,yJaune,rayon,GrisF); if not((code=semaphore_cli) and clignotant) then cercle(ACanvas,xSem,ySem,rayon,GrisF); @@ -3482,7 +4270,7 @@ begin end; // dessine les feux sur une cible à 9 feux -procedure dessine_signal9(Acanvas : Tcanvas;x,y : integer;frX,frY : single;etatsignal : word;orientation : integer); +procedure dessine_signal9(Acanvas : Tcanvas;x,y : integer;frX,frY : single;etatsignal : word;orientation,index : integer); var rayon, XBlanc,Yblanc,xJaune,yJaune,Xsem,YSem,Xvert,YVert,Xcarre,Ycarre,Xral1,Yral1,Xral2,YRal2, Xrap1,Yrap1,Xrap2,Yrap2,Temp,LgImage,HtImage,xt,yt,code,combine : integer; @@ -3572,7 +4360,7 @@ begin begin cercle(ACanvas,xrap1,yrap1,rayon,grisF);cercle(ACanvas,xrap2,yrap2,rayon,grisF); end; - cercle(ACanvas,xcarre,Ycarre,rayon,grisF); // carré supérieur + if not(code=carre) then cercle(ACanvas,xcarre,Ycarre,rayon,grisF); // carré supérieur if not((code=semaphore_cli) and clignotant) then cercle(ACanvas,xSem,ySem,rayon,grisF); if not((code=vert_cli) and clignotant) then cercle(ACanvas,xvert,yvert,rayon,grisF); @@ -3601,94 +4389,6 @@ begin end; end; -// Ecrire sur un canvas un texte avec un angle, avec ou sans bordure, monochrome ou à face texturée -// params : C = Canvas-cible -// X,Y = Coordonnées angle supérieur gauche du début du texte. -// Fonte = Police de caractères à utiliser : uniquement des fontes scalables. -// clBord = Couleur de la bordure. -// EpBord = Epaisseur de la bordure. -// PenMode = TPenMode : utiliser en général pmCopy. -// si Clfond=clback, on écrit en transparent -// Texte = Texte à écrire. -// AngleDD = Angle d'inclinaison en Dixièmes de degré. -procedure AffTexteIncliBordeTexture(c : TCanvas; x,y : integer; Fonte : tFont; - clBord : TColor; EpBord : integer; PenMode : TPenMode; - texte : string; AngleDD : longint); -var dc : Hdc; - lgFont : Logfont; // structure d'attributs de police - AncFonte,NouvFonte : Hfont; - AncPen,NouvPen : Hpen; - AncBrush,NouvBrush : Hbrush; - i : integer; -begin - C.Pen.Mode:=PenMode; - dc:=C.Handle; - - c.pen.Mode:=PmCopy; - //c.pen.Color:=clfond; //clfond; - //c.Brush.color:=clfond; - c.pen.width:=1; - i:=round(length(texte)*0.5*abs(fonte.size)); -// c.Rectangle(x+2,y,x+15,y-i); - - // Initialisation de la fonte - zeroMemory(@lgFont,sizeOf(lgFont)); // remplit la structure de 0 - strPCopy(lgFont.lfFaceName,Fonte.Name); // copie la chaîne dans le nom de la fonte depuis le paramètre - lgFont.lfHeight:=Fonte.Height; // la taille - if Fonte.style=[] then lgFont.lfWeight:=FW_REGULAR; // Normal - if Fonte.style=[fsBold] then lgFont.lfWeight:=FW_BOLD; // Gras - - if fsItalic in Fonte.style then lgFont.lfItalic:=1; - if fsUnderline in Fonte.style then lgFont.lfUnderline:=1; - if fsStrikeout in Fonte.style then lgFont.lfStrikeout:=1; - - lgFont.lfEscapement:=AngleDD; // Angle d'inclinaison en dixièmes de degrés - - NouvFonte:=CreateFontInDirect(lgFont); - AncFonte:=SelectObject(dc,NouvFonte); - - // Initialisation du contour : - if EpBord<>0 then NouvPen := CreatePen(PS_SOLID,EpBord,clBord) - else NouvPen := CreatePen(PS_NULL,0,0); - AncPen:= SelectObject(dc,NouvPen); - - // Initialisation de la couleur de la police ou de la Texture : - //if Texture=nil then - NouvBrush := CreateSolidBrush(Fonte.color); - // else NouvBrush := CreatePatternBrush(Texture.Handle); - AncBrush:=SelectObject(dc,NouvBrush); - // Le contexte doit être transparent - SetBkMode(dc,TRANSPARENT); - - - - - // Dessin du texe : - BeginPath(dc); - TextOut(dc,X,Y,PChar(Texte),length(texte)); //<- au lieu de TextOut(dc,X,Y,PansiChar(Texte),length(texte)) pour rendre le code compatible avec toutes les versions de Delphi (de D2 à XE2); - EndPath(dc); - StrokeAndFillPath(dc); - - // Restauration objets et libération mémoire - SelectObject(dc,AncFonte); - DeleteObject(NouvFonte); - SelectObject(dc,AncPen); - DeleteObject(NouvPen); - SelectObject(dc,AncBrush); - DeleteObject(NouvBrush); -end; -// inverse une image (miroir horizontal) et la met dans dest -// Utilisé pour les signaux belges, et les trains -procedure inverse_image(imageDest,ImageSrc : Timage); -var mrect,nrect : trect; - larg,haut : integer; -begin - larg:=ImageSrc.Width; - haut:=ImageSrc.Height; - mRect:=rect(0,0,larg,haut); - nRect:=rect(larg-1,0,-1,haut); - ImageDest.canvas.CopyRect(mRect,ImageSrc.canvas,nRect); -end; // dessine les feux sur une cible belge à 5 feux // cette image peut être inversée (contre voie) @@ -4207,12 +4907,12 @@ begin aspect:=Signaux[i].aspect ; case aspect of // signaux - 2 : dessine_signal2(CanvasDest,x,y,frx,fry,Signaux[i].EtatSignal,orientation); - 3 : dessine_signal3(CanvasDest,x,y,frx,fry,Signaux[i].EtatSignal,orientation); - 4 : dessine_signal4(CanvasDest,x,y,frx,fry,Signaux[i].EtatSignal,orientation); - 5 : dessine_signal5(CanvasDest,x,y,frx,fry,Signaux[i].EtatSignal,orientation); - 7 : dessine_signal7(CanvasDest,x,y,frx,fry,Signaux[i].EtatSignal,orientation); - 9 : dessine_signal9(CanvasDest,x,y,frx,fry,Signaux[i].EtatSignal,orientation); + 2 : dessine_signal2(CanvasDest,x,y,frx,fry,Signaux[i].EtatSignal,orientation,i); + 3 : dessine_signal3(CanvasDest,x,y,frx,fry,Signaux[i].EtatSignal,orientation,i); + 4 : dessine_signal4(CanvasDest,x,y,frx,fry,Signaux[i].EtatSignal,orientation,i); + 5 : dessine_signal5(CanvasDest,x,y,frx,fry,Signaux[i].EtatSignal,orientation,i); + 7 : dessine_signal7(CanvasDest,x,y,frx,fry,Signaux[i].EtatSignal,orientation,i); + 9 : dessine_signal9(CanvasDest,x,y,frx,fry,Signaux[i].EtatSignal,orientation,i); 20 : dessine_signal20(CanvasDest,x,y,frx,fry,Signaux[i].EtatSignal,orientation,Signaux[i].adresse); // signal belge // indicateurs de direction 12..16 : dessine_dirN(CanvasDest,x,y,frx,fry,Signaux[i].EtatSignal,orientation,aspect-10); @@ -4259,11 +4959,7 @@ begin i:=Index_Signal(AdrPilote); if i=0 then exit; - with Formpilote do - begin - // TFormPilote.Create(Self); - show; - end; + Formpilote.show; end; function Select_dessin_Signal(TypeSignal : integer) : TBitmap; @@ -7550,9 +8246,11 @@ end; // trouve un élément en balayant les branches à partir de la branche offset renvoie branche_trouve IndexBranche_trouve // el : adresse de l'élément TypeEL=(1=détécteur 2=aig 3=aig Bis 4=aig triple - Buttoir) +// si l'élément est une TJD et qu'on la trouve pas, on cherche l'homologue // explore les branches // si une branche preférée est choisie, elle est non nulle. // erreur=true affiche le message d'erreur +// it<>0 permet de ne pas chercher une TJD homologue si 2 états // si pas trouvé, Branche_trouve=0 IndexBranche_trouve=0 procedure trouve_element_V1(el: integer; TypeEl : TEquipement; Offset,branche_pref,OffsetDsBranche : integer;erreur : boolean;it : integer); var i,adr,Branche,ia : integer ; @@ -7627,7 +8325,7 @@ begin if el>NbMaxDet then begin - s:='Erreur 80 : trouve_element='+inttoStr(el)+' : '+quelle_procedure(n)+'('; + s:='Erreur 97 : trouve_element='+inttoStr(el)+' : '+quelle_procedure(n)+'('; for i:=1 to n do begin case i of @@ -8107,7 +8805,7 @@ begin suivant_alg3:=9997; // attention code incorrect devrait être 9994 exit; end; - + // aiguillage index (adr) pris en pointe if (aiguillage[index].Apointe=prec) then begin @@ -8820,6 +9518,12 @@ begin if aiguillage[index].Adevie=prec then begin adr:=aiguillage[index].Ddevie;A:=aiguillage[index].DdevieB;end; if aiguillage[index].Ddevie=prec then begin adr:=aiguillage[index].Adevie;A:=aiguillage[index].AdevieB;end; if aiguillage[index].Ddroit=prec then begin adr:=aiguillage[index].Adroit;A:=aiguillage[index].AdroitB;end; + if adr=9999 then + begin + Affiche('Erreur 183 : L''aiguillage '+IntToSTR(aiguillage[index].adresse)+' n''a aucun point de connexion à l''élément '+intToSTR(prec),clred); + result:=adr; + exit; + end; if (A='Z') or (a=#0) then typeGenS:=det else typeGenS:=aig; suivant_alg3:=adr; if a='' then a:=' '; @@ -17587,7 +18291,6 @@ begin end; end; - // connecte la centrale en USB/COM en explorant les ports USB/COM de 1 à MaxComPort // et demande les états des détecteurs procedure connecte_usb; @@ -18824,7 +19527,7 @@ var n,t,i,j,index,OrgMilieu : integer; begin Ancien_Nom_Style:=''; Nom_style_aff:='windows'; - af:='Client TCP-IP ou USB CDM Rail - Système XpressNet DCC++ Version '+VersionSC+sousVersion; + af:='Client TCP-IP ou USB CDM Rail - Système XpressNet DCC++ Version '+VersionSC+sousVersion+' alpha'; vc:=''; {$IF CompilerVersion >= 28.0} vc:=' D12'; @@ -18953,7 +19656,14 @@ begin for i:=1 to 100 do begin memoire[i]:=0; - boutonTCO[i].existe:=false; + with boutonTCO[i] do + begin + existe:=false; + etat:=0; + idTCO:=0; + x:=0; + y:=0; + end; end; // créer icones des trains et raz champs for i:=1 to Max_Trains do @@ -19015,6 +19725,24 @@ begin end; end; + for i:=1 to MaxCantons do + with canton[i] do + begin + numero:=0;SensLoco:=0; + Ntco:=0;nElements:=0; + x:=0;y:=0; + el1:=0;el2:=0; + typ1:=rien;typ2:=rien; + det1:=0;det2:=0; + SensEl1:=0;SensEl2:=0;SensCirc:=0; + Signal:=0;indexTrain:=0;adresseTrain:=0; + Xicone:=0;yIcone:=0;NumcantonOrg:=0;NumCantonDest:=0; + Licone:=0;Hicone:=0;AdrTrainRoute:=0; + bouton:=0; + Select:=false;Horizontal:=false; + Nom:='';NomTrain:=''; + end; + OsBits:=0; if IsWow64Process then begin @@ -21673,13 +22401,61 @@ begin Lire_fichier_CV; end; +function lire_cv(cv : integer) : integer; +var s : string; + i : integer; +begin + result:=-1; + s:=#$22+#$15+Char(cv); //CV de 1 à 256 (V3.0) + //s:=#$22+#$18+Char(cv); //CV de 1 à 255 + 1024 (V3.6) + s:=checksum(s); + // envoi de la trame : fait passer la centrale en mode programmation (service) + envoi_ss_ack(s); + + // attendre la trame 01 04 05 "succès" (env 1s) + succes:=false;i:=0; + repeat + Application.processMessages; + Sleep(100); + inc(i); + until succes or (i>20); + + if succes then + begin + recu_cv:=false; + //Affiche('reçu trame succes',clyellow); + s:=#$21+#$10; // demande d'envoi du résultat du mode service + s:=checksum(s); + //envoi(s); + envoi_ss_ack(s); + Tempo2(1); + // attente de la réponse de la centrale + i:=0; + repeat + Tempo2(2); // attend 200 ms + inc(i); + until recu_cv or (i>4); + if (i>4) then + begin + Affiche('Erreur attente trop longue CV',clred); + result:=-1; + exit; + end; + result:=Tablo_cv[cv]; + end + else + begin + Affiche('Pas de réponse de l''interface après demande de passage en mode prog',clOrange); + result:=-2; + end; +end; + procedure TFormPrinc.ButtonLitCVClick(Sender: TObject); var s,sa: string; - i,cv,erreur : integer; + i,cv,r,erreur : integer; begin s:=GetCurrentDir; N_Cv:=0; // nombre de CV recus à 0 - sa:=''; Affiche('Lecture CV',clyellow); val(EditCV.Text,cv,erreur); @@ -21691,6 +22467,7 @@ begin if protocole=1 then begin + { //trace:=true; s:=#$22+#$15+Char(cv); //CV de 1 à 256 (V3.0) //s:=#$22+#$18+Char(cv); //CV de 1 à 255 + 1024 (V3.6) @@ -21726,11 +22503,18 @@ begin Affiche('Erreur attente trop longue CV',clred); exit; end; - sa:=sa+'Cv'+IntToSTR(cv)+'='+IntToSTR(Tablo_cv[cv])+' '; + sa:='Cv'+IntToSTR(cv)+'='+IntToSTR(Tablo_cv[cv])+' '; Affiche(sa,clyellow);sa:=''; end else Affiche('Pas de réponse de l''interface après demande de passage en mode prog',clOrange); + } + r:=lire_cv(cv); + if r<>-1 then + begin + sa:='Cv'+IntToSTR(cv)+'='+IntToSTR(Tablo_cv[cv])+' '; + Affiche(sa,clyellow);sa:=''; + end; end; if protocole=2 then diff --git a/UnitRoute.pas b/UnitRoute.pas index d48fe41..08fc250 100644 --- a/UnitRoute.pas +++ b/UnitRoute.pas @@ -183,7 +183,7 @@ begin result:=ok; end; -// Efface, fabrique le tableau ParcoursDet[] depuis TabloRoute[id] et affiche la route dans le TCO contenue dans ParcoursDet[] +// Efface route du TCO, fabrique le tableau ParcoursDet[] depuis TabloRoute[id] et affiche la route dans le TCO contenue dans ParcoursDet[] procedure Efface_Affiche_route; var n,id : integer; ok : boolean; @@ -709,12 +709,13 @@ begin IdCantonOrg:=index_canton_numero(cantonOrg); //IdCantonDest:=index_canton_numero(cantonDest); sensCanton:=canton[IdCantonOrg].sensLoco; - case sensCanton of // sens de la loco dans le canton - sensGauche : begin sens:=SensTCO_O;end; - sensDroit : begin sens:=SensTCO_E;end; - SensHaut : begin sens:=SensTCO_N;end; - SensBas : begin sens:=SensTCO_S;end; - end; + // sens de la loco dans le canton + case sensCanton of + sensGauche : sens:=SensTCO_O; + sensDroit : sens:=SensTCO_E; + SensHaut : sens:=SensTCO_N; + SensBas : sens:=SensTCO_S; + end; IndexTCO:=canton[IdcantonOrg].Ntco; r:=prepare_route(IndexTCO,CantonOrg,DetaTrouve,sens); if r<>0 then @@ -743,16 +744,16 @@ begin myColor := clRed else myColor := clBlack; -} - //myBrush.Style := bsSolid; - //myBrush.Color := myColor; - //Windows.FillRect(handle, Rect, myBrush.Handle); - //Pen.color:=clWhite;//CoulText; - //myBrush.color:=clBlue; - //Brush.Style := bsClear; - // TextOut(Rect.Left, Rect.Top, (Control as TListBox).Items[Index]); - //MyBrush.Free; + myBrush.Style := bsSolid; + myBrush.Color := myColor; + + Windows.FillRect(handle, Rect, myBrush.Handle); + Pen.color:=clWhite;//CoulText; + myBrush.color:=clBlue; + Brush.Style := bsClear; + TextOut(Rect.Left, Rect.Top, (Control as TListBox).Items[Index]); + MyBrush.Free; } FillRect(Rect); // on à cause des styles s:=ListBoxRoutes.Items[Index]; fs:=integer(ListBoxRoutes.Items.Objects[Index]); diff --git a/UnitRouteTrains.dfm b/UnitRouteTrains.dfm index b6c4b08..990ce45 100644 --- a/UnitRouteTrains.dfm +++ b/UnitRouteTrains.dfm @@ -2,7 +2,7 @@ object FormRouteTrain: TFormRouteTrain Left = 202 Top = 190 BorderStyle = bsDialog - Caption = 'Liste des routes affect'#233'es aux trains' + Caption = 'Liste des routes affect'#233'es et m'#233'moris'#233'es aux trains' ClientHeight = 194 ClientWidth = 853 Color = clBtnFace @@ -123,7 +123,7 @@ object FormRouteTrain: TFormRouteTrain Height = 33 Hint = 'Sauve la route dans la liste des routes m'#233'moris'#233'es si elle est u' + - 'nique' + 'nique et sauvegarde la configuration' Caption = 'Sauve route' ParentShowHint = False ShowHint = True diff --git a/UnitRouteTrains.pas b/UnitRouteTrains.pas index e947281..c8fa050 100644 --- a/UnitRouteTrains.pas +++ b/UnitRouteTrains.pas @@ -688,7 +688,7 @@ begin until (i>trains[indexTrainFR].routePref[0][0].adresse) or trouve; if trouve then begin - LabelRoute.Caption:='La route existe déja en zone sauvegardée'; + LabelRoute.Caption:='La route existe déja en zone mémorisée'; exit; end; @@ -908,12 +908,12 @@ var i,n : integer; begin if IrPref<1 then exit; - s:='Voulez-vous supprimer la route sauvegardée n°'+intToSTR(IrPref)+' ?'; + s:='Voulez-vous supprimer la route mémorisée n°'+intToSTR(IrPref)+' ?'; if Application.MessageBox(pchar(s),pchar('confirm'), MB_YESNO or MB_DEFBUTTON2 or MB_ICONQUESTION)=idNo then exit; n:=trains[indexTrainFR].routePref[0][0].adresse; // nombre de routes - for i:=IrPref to n do - tabloRoute[i]:=tabloRoute[i+1]; + for i:=IrPref to n-1 do + trains[indexTrainFR].routePref[i]:=trains[indexTrainFR].routePref[i+1]; trains[indexTrainFR].routePref[0][0].adresse:=n-1; dec(irPref); maj_infos(indexTrainFR); diff --git a/UnitTCO.dfm b/UnitTCO.dfm index 2b69089..e853217 100644 --- a/UnitTCO.dfm +++ b/UnitTCO.dfm @@ -24,8 +24,8 @@ object FormTCO: TFormTCO OnKeyPress = FormKeyPress OnMouseWheel = FormMouseWheel DesignSize = ( - 997 - 549) + 1005 + 556) PixelsPerInch = 96 TextHeight = 13 object LabelZoom: TLabel diff --git a/UnitTCO.pas b/UnitTCO.pas index 949973d..92fa1af 100644 --- a/UnitTCO.pas +++ b/UnitTCO.pas @@ -5,8 +5,7 @@ uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Grids , UnitPrinc, StdCtrls, ExtCtrls, Menus, UnitPilote, UnitDebug, ComCtrls ,StrUtils, math, unitconfig, UnitAnalyseSegCDM, Buttons , verif_version, - UnitHorloge, - ImgList ; + UnitHorloge, ImgList ; type TFormTCO = class(TForm) @@ -557,7 +556,7 @@ var couleurAdresse,cltexte,CoulFonte,clCoulGrilleSV,clvoiesSV, clFoncSV,clGrilleSV,clCoulCantonLibreSV,clCoulCantonOccupeSV : Tcolor; - TamponAffecte,TCO_modifie,clicsouris,prise_N,affPosFil, + TamponAffecte,TCO_modifie,prise_N,affPosFil,clicsouris, clicTCO,piloteAig,BandeauMasque,eval_format,sauve_tco,prise_droit,prise_haut,deja_calcule, prise_bas,prise_gauche,prise_NE,prise_NO,prise_SE,prise_SO,ligneAffiche,colonneAffiche, TCOActive,TCOCree,ancienok,dbleClicTCO,auto_tcurs,EvtClicDet,SelecBouge,NB : boolean; @@ -580,8 +579,6 @@ var titre_Fonte,s90,s91,s93,s94,s100,s101 : string; // élements dupliqués dans le TCO : - //TCO[i,x,y].FeuOriente=Nelements - //TCO[i,x,y].PiedFeu=numéro canton : array[1..MaxCantons] of Tcanton; // structure de tous les tco @@ -926,7 +923,7 @@ begin begin screen.cursor:=crSizeNS; //if (not(prise_droit) and not(prise_bas) and not(prise_gauche) and not(prise_NE) and not(prise_NO) and not(prise_SE) and not(prise_SO)) and clicsouris then - if (rien and clicsouris) or prise_haut then + if (rien and (clicsouris)) or prise_haut then begin // efface l'ancien Affiche_Rectangle(IndexTCO,Rect_select); @@ -952,7 +949,7 @@ begin begin screen.cursor:=crSizeWE; //if (not(prise_haut) and not(prise_bas) and not(prise_gauche) and not(prise_NE) and not(prise_NO) and not(prise_SE) and not(prise_SO)) and clicsouris then - if (rien and clicsouris) or prise_droit then + if (rien and (clicsouris)) or prise_droit then begin // efface l'ancien Affiche_Rectangle(IndexTCO,Rect_select); @@ -977,7 +974,7 @@ begin if (((x>=r.left) and (x<=r.Right) and (y>=r.top) and (y<=r.bottom)) or prise_bas) then //and (y=r.left) and (x<=r.Right) and (y>=r.top) and (y<=r.bottom)) or prise_gauche) then //and (x>0) then begin screen.cursor:=crSizeWE; - if (rien and clicsouris) or prise_gauche then + if (rien and (clicsouris)) or prise_gauche then begin // efface l'ancien Affiche_Rectangle(IndexTCO,Rect_select); @@ -1028,7 +1025,7 @@ begin if (((x>=r.left) and (x<=r.Right) and (y>=r.top) and (y<=r.bottom)) or prise_NE) then //and (x0) then begin screen.cursor:=crSizeNESW; - if (rien and clicsouris) or prise_NE then + if (rien and (clicsouris)) or prise_NE then begin // efface l'ancien Affiche_Rectangle(IndexTCO,Rect_select); @@ -1046,7 +1043,7 @@ begin if (((x>=r.left) and (x<=r.Right) and (y>=r.top) and (y<=r.bottom)) or prise_NO) then //and (x>0) and (y>0) then begin screen.cursor:=crSizeNWSE; - if (rien and clicsouris) or prise_NO then + if (rien and (clicsouris)) or prise_NO then begin // efface l'ancien Affiche_Rectangle(IndexTCO,Rect_select); @@ -1064,7 +1061,7 @@ begin if (((x>=r.left) and (x<=r.Right) and (y>=r.top) and (y<=r.bottom)) or prise_SE) then //and (x=r.left) and (x<=r.Right) and (y>=r.top) and (y<=r.bottom)) or prise_SO) then //and (x>0) and (yr.top) and (yr.Left) and (x0) and (x0) and (y10) or (n<4) then begin result:=false;exit;end; // nombre de cellules tirées : maxi 9 screen.cursor:=crSizeWE; - if (rien and clicsouris) or prise_gauche then + if (rien and (clicsouris)) or prise_gauche then begin // efface l'ancien Affiche_Rectangle_canton(IndexTCO,IndexCanton); @@ -1320,7 +1317,7 @@ begin //Affiche(intToSTR(canton[indexCanton].gd.Left)+' '+intToSTR(x)+' n='+intToSTR(n),clYellow); if (n>10) or (n<4) then begin result:=false;exit;end; // nombre de cellules tirées : maxi 9 screen.cursor:=crSizeWE; - if (rien and clicsouris) or prise_droit then + if (rien and (clicsouris)) or prise_droit then begin //Affiche('traite',clOrange); // efface l'ancien @@ -1354,7 +1351,7 @@ begin n:=1+(abs(canton[indexCanton].gd.bottom-y) div larg); // nombre de cellules tirées if (n>10) or (n<4) then begin result:=false;exit;end;; // nombre de cellules tirées : maxi 9 screen.cursor:=crSizeNS; - if (rien and clicsouris) or prise_haut then + if (rien and (clicsouris)) or prise_haut then begin // efface l'ancien Affiche_Rectangle_canton(IndexTCO,IndexCanton); @@ -1387,7 +1384,7 @@ begin n:=1+(abs(canton[indexCanton].gd.top-y) div larg); if (n>10) or (n<4) then begin result:=false;exit;end;; // nombre de cellules tirées : maxi 9 screen.cursor:=crSizeNS; - if (rien and clicsouris) or prise_bas then + if (rien and (clicsouris)) or prise_bas then begin // efface l'ancien Affiche_Rectangle_canton(IndexTCO,IndexCanton); @@ -2321,12 +2318,16 @@ begin begin tco[indexTCO,x,y].PiedFeu:=PiedFeu; // quelle action tco[indexTCO,x,y].FeuOriente:=FeuOriente; // paramètre de l'action - if PiedFeu=AcBouton_bistable then + if (PiedFeu=AcBouton_bistable) then begin - BoutonTCO[adresse].existe:=true; - BoutonTCO[adresse].idtco:=IndexTCO; - BoutonTCO[adresse].x:=x; - BoutonTCO[adresse].y:=y; + if (adresse<=100) and (adresse>0) then + begin + BoutonTCO[adresse].existe:=true; + BoutonTCO[adresse].idtco:=IndexTCO; + BoutonTCO[adresse].x:=x; + BoutonTCO[adresse].y:=y; + end + else Affiche('Erreur N° de bouton TCO incorrect ('+intToSTR(adresse)+')',clred); end; end; @@ -2721,7 +2722,6 @@ begin pen.Color:=Clred; moveto(xc,yc+round(7*fryGlob[indexTCO])); LineTo(xc,yc-round(7*fryGlob[indexTCO])); - exit; end; @@ -2741,6 +2741,7 @@ begin pen.color:=tco[indextco,x,y].CouleurFond; brush.color:=tco[indextco,x,y].CouleurFond; end; + // dessine la bande horizontale jy1:=y0+(HauteurCell[indexTCO] div 2)-round(7*fryGlob[indexTCO]); // pos Y de la bande sup jy2:=y0+(HauteurCell[indexTCO] div 2)+round(7*fryGlob[indexTCO]); // pos Y de la bande inf if avecGrille[indexTCO] then r:=Rect(x0+1,jy1,xf-1,jy2) else @@ -2748,6 +2749,7 @@ begin FillRect(r); end; + // dessine la voie case mode of 0 : couleur:=clVoies[indexTCO]; 1 : couleur:=clAllume[indexTCO]; @@ -2929,7 +2931,6 @@ begin if taillefont=0 then taillefont:=8; tf:=(taillefont*LargeurCell[indexTCO]) div 40; c.font.Size:=tf; - //c.font.Size:=taille_fonte(tco[indextco,x,y].TailleFonte); if b=id_action then c.Brush.Color:=couleurAction; @@ -11280,7 +11281,6 @@ begin 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(indexTCO,x,y : integer); @@ -11436,8 +11436,7 @@ begin begin Brush.style:=bsSolid; Brush.Color:=clBlue; - //s:=s+' '+intToSTR(AdrTr); - s:=s+format('%d',[adrTr]); + s:=s+' '+format('%d',[adrTr]); end else begin @@ -11505,7 +11504,6 @@ begin begin Brush.style:=bsSolid; if not NB then Brush.Color:=clBlue else Brush.color:=clwhite; - //s:=s+' '+intToSTR(AdrTr); s:=s+' '+format('%d',[adrTr]); end else @@ -11737,22 +11735,30 @@ end; procedure _entoure_cell_clic(indexTCO: integer); begin + // si entoure pas affiché if not(entoure[indexTCO]) then begin Entoure_cell(indexTCO,XclicCell[indexTCO],YclicCell[indexTCO]); Xentoure[indexTCO]:=XClicCell[indexTCO]; Yentoure[indexTCO]:=YclicCell[indexTCO]; entoure[indexTCO]:=true; + exit; end else begin + // si entoure affiché Entoure_cell(indexTCO,Xentoure[indexTCO],Yentoure[indexTCO]); // efface l'ancien - // si on clique sur le même on l'efface sans afficher un nouveau + // si on clique sur une cellule différente affiche un nouveau if (Xentoure[indexTCO]<>XclicCell[indexTCO]) or (Yentoure[indexTCO]<>YClicCell[indexTCO]) then begin Entoure_cell(indexTCO,XclicCell[indexTCO],YclicCell[indexTCO]); + Xentoure[indexTCO]:=XClicCell[indexTCO]; + Yentoure[indexTCO]:=YclicCell[indexTCO]; + exit; end - else entoure[indexTCO]:=false; + else + // on a cliqué sur ancien + entoure[indexTCO]:=false; Xentoure[indexTCO]:=XClicCell[indexTCO]; Yentoure[indexTCO]:=YclicCell[indexTCO]; end; @@ -11891,7 +11897,7 @@ var s : string; begin NB:=false; // mode noir et blanc pour l'affichage if jeucouleurs=0 then JeuCouleurs:=1; // style de couleur sombre par défaut - + clicsouris:=false; if affevt or (debug=1) then Affiche('FormTCO'+intToSTR(indexTCOCreate)+' create',clLime); procetape('Création fenêtre TCO'); //Screen.OnActiveControlChange := ActiveControlChanged; @@ -14787,6 +14793,7 @@ begin Rectangle(r); end; SelectionAffichee[indexTCO]:=true; + if affevt then Affiche('Sélection bleue 1',clCyan); end; procedure selec_tout(indexTCO : integer); @@ -14837,7 +14844,7 @@ begin begin if not(ssShift in Shift) then case Key of - VK_right : if x0 then exit; + indexTCO:=index_tco(sender); if indexTCO<1 then exit; GetCursorPos(Position); @@ -16123,7 +16133,7 @@ begin if button=mbLeft then begin //Affiche('TCO'+intToSTR(indexTCO)+' souris clicG enfoncée',clYellow); - if affEvt then Affiche('TCO'+intToSTR(i)+' souris clicG enfoncée',clYellow); + //if affEvt then Affiche('TCO'+intToSTR(i)+' souris clicG enfoncée',clYellow); if dbleClicTCO then begin dbleClicTCO:=false;exit;end; // coordonnées grille @@ -16169,8 +16179,13 @@ begin else begin - IdCantonSelect:=0; // pas cliqué sur un canton - //Affiche('RAZ1 x='+intToSTR(xclic),clred); + //Affiche('RAZ1 x='+intToSTR(xclic)+' Idcanton'+intToSTR(idcantonSelect),clred); + // réaffiche le TCO pour désélectionner le canton qui a été sélectionné, mais ona cliqué ailleurs + if IdCantonSelect<>0 then + begin + IdCantonSelect:=0; // pas cliqué sur un canton + Affiche_TCO(indexTCO); + end; end; @@ -16375,7 +16390,6 @@ begin AncienIdCantonSelect:=IdCantonSelect; IdCantonSelect:=0; //Affiche('RAZ2',clred); - exit; end; end; @@ -16459,8 +16473,6 @@ begin end; end; end; - - end; end; end; @@ -16636,6 +16648,7 @@ begin Init_rectangle(IndexTCO,Rect_Select); Affiche_Rectangle(indexTCO,Rect_select); selectionAffichee[indexTCO]:=true; + if affevt then Affiche('Sélection bleue 2',clCyan); end; end else @@ -16714,7 +16727,7 @@ begin if Xclic>NbreCellX[indexTCO] then exit; if Yclic>NbreCellY[indexTCO] then exit; //if cantonSelect<>0 then exit; - if not(selectionaffichee[indexTCO]) then _entoure_cell_clic(indexTCO); + if not(selectionaffichee[indexTCO]) and (Tdoubleclic=0) then _entoure_cell_clic(indexTCO); actualise(indexTCO); // actualise la fenetre de config cellule end; @@ -16760,7 +16773,11 @@ var r : Trect; ok : boolean; begin // if affevt then Affiche('ImageTCOMouseMove',clLime); - if dbleClicTCO then begin dbleClicTCO:=false;exit;end; + if dbleClicTCO then + begin + dbleClicTCO:=false; + exit; + end; //Affiche(IntToSTR(tempoSouris),clred); indexTCO:=index_tco(sender); @@ -16792,13 +16809,13 @@ begin end; idTrain:=canton[IdCantonSelect].indexTrain; - if clicSouris and (idTrain<>0) then if (trains[IdTrain].icone<>nil) and (trains[IdTrain].icone.width<>0) then + if (clicsouris) and (idTrain<>0) then if (trains[IdTrain].icone<>nil) and (trains[IdTrain].icone.width<>0) then begin debut_drag_train(IndexTCO,canton[IdCantonSelect].x,canton[IdCantonSelect].y); exit; end; exit; - end ; + end; // vérifier si on passe au dessus d'un bouton canton IdCanton:=passe_bouton_canton(indexTCO,x,y); @@ -16875,6 +16892,7 @@ begin TpsBougeSouris:=5; if not(clicsouris) or (temposouris>0) then exit; + //Affiche('sélection cours',clred); Bim:=Tco[IndexTCO,cellx,celly].Bimage; //Affiche('ajuste rect '+intToSTR(Bim)+' '+intToSTR(cellx)+' '+intToSTR(celly),clWhite); @@ -16920,6 +16938,7 @@ begin Affiche_selection(indexTCO); SelectionAffichee[indexTCO]:=true; + if affevt then Affiche('Sélection bleue 3',clCyan); //Affiche('Sélection affichée',clLime); if entoure[indexTCO] then begin Entoure_cell(indexTCO,Xentoure[indexTCO],Yentoure[indexTCO]);entoure[indexTCO]:=false;end; // efface end; @@ -16927,7 +16946,7 @@ end; procedure TFormTCO.ImageTCOMouseUp(Sender: TObject; Button: TMouseButton;Shift: TShiftState; X, Y: Integer); var An,Nouvx,Nouvy,xc,yc,n,indexTCO,lg,ht,xo,yo,larg,haut,i : integer; begin - if affevt then Affiche('Souris clic relachée',clyellow); + if affevt then Affiche('ImageTCO mouseUp',clyellow); clicsouris:=false; SelecBouge:=false; indextco:=index_TCO(sender); @@ -17105,7 +17124,7 @@ begin if tco[indextco,x,y].Adresse=Adresse then begin affiche_cellule(indexTCO,x,y); - entoure_cell_grille(indexTCO,x,y); + entoure_cell_grille(indexTCO,x,y); // si grille end; end; end; @@ -17557,7 +17576,11 @@ var Bimage,Adresse,i,indextco,xt,yt,idcanton : integer; tjdC : boolean; begin if affEvt then Affiche('Double clic',clYellow); - clicsouris:=false; + //clicsouris:=false; + + doubleclic:=true; + Tdoubleclic:=3; + auto_tcurs:=true; // autorise le déplacement du des touches curseur encadré du TCO indexTCO:=index_TCO(sender); @@ -17565,12 +17588,20 @@ begin Adresse:=tco[indextco,xClicCell[indexTCO],yClicCell[indexTCO]].Adresse; // double clic sur détecteur : inversion - //if ((Bimage=1) or (Bimage=20) or (Bimage=10) or (Bimage=11)) and (adresse<>0) then - if not(isAigTCO(Bimage)) and (adresse<>0) then + if ((Bimage=1) or (Bimage=20) or (Bimage=10) or (Bimage=11)) and (adresse<>0) then + //if not(isAigTCO(Bimage)) and (adresse<>0) then begin - if EvtClicDet then event_detecteur(adresse,not(detecteur[adresse].etat),'') - else detecteur[adresse].etat:=not(detecteur[adresse].etat); - Maj_TCO(indexTCO,Adresse) + if EvtClicDet then + begin + //if detecteur[adresse].etat=false then + efface_entoure(indextco); + event_detecteur(adresse,not(detecteur[adresse].etat),''); + end + else detecteur[adresse].etat:=not(detecteur[adresse].etat); + //clicsouris:=false; + //Maj_TCO(indexTCO,Adresse); + doubleclic:=false; + exit; end; tjdC:=false; @@ -17590,6 +17621,7 @@ begin if i=0 then begin Affiche('Aiguillage '+intToSTR(adresse)+' non configuré pour pilotage',clOrange); + doubleclic:=false; exit; end; @@ -17609,6 +17641,7 @@ begin yt:=canton[IdCantonSelect].y; IdCanton:=TCO[IndexTCO,xt,yt].NumCanton; formSelTrain.Show; + doubleclic:=false; exit; end; end; @@ -17618,8 +17651,7 @@ begin begin AdrPilote:=adresse; i:=Index_Signal(adresse); - if i=0 then exit; - TFormPilote.Create(Self); + if i=0 then begin doubleclic:=false;exit;end; with formPilote do begin show; @@ -17656,8 +17688,9 @@ begin end; end; end; - clicsouris:=false; + //clicsouris:=false; dbleClicTCO:=true; + doubleclic:=false; end; procedure TFormTCO.ComboReprChange(Sender: TObject); @@ -19129,11 +19162,6 @@ begin end; end; - - - - - end. diff --git a/verif_version.pas b/verif_version.pas index 3ee9e55..9b0ab32 100644 --- a/verif_version.pas +++ b/verif_version.pas @@ -26,7 +26,7 @@ var f : text; Const -VersionSC ='9.74'; // sert à la comparaison de la version publiée +VersionSC = '9.75'; //'9.76'; // sert à la comparaison de la version publiée SousVersion=' '; // A B C ... en cas d'absence de sous version mettre un espace // pour unzip SHCONTCH_NOPROGRESSBOX=4; @@ -137,6 +137,26 @@ begin writeln(f,s); end; +function Cree_dir(s : string) : boolean; +var erreur : integer; +begin + result:=true; + if not(directoryExists(s)) then + begin + {$I-} + MkDir(s); + erreur:=IoResult; + {$I+} + if erreur<>0 then + begin + log('Impossible de créer répertoire '+s+' erreur '+intToSTR(erreur),clred); + result:=false; + exit; + end; + end; +end; + + procedure copie_fichier(s : string); var fs,fd : string; i : integer; @@ -161,7 +181,7 @@ var i : integer; begin // Vérifier si répertoire dest existe chemin_Dest:=CheminProgrammes+'\Signaux_complexes'; - if not(directoryExists(chemin_Dest)) then mkDir(chemin_dest); + if not(directoryExists(chemin_Dest)) then cree_Dir(chemin_dest); i:=pos('.zip',s); if i=0 then @@ -286,7 +306,7 @@ begin // fabrication du nom de fichier destinataire et son chemin LocalFile:=SysUtils.GetEnvironmentVariable('APPDATA'); if LocalFile<>'' then LocalFile:=IncludeTrailingPathDelimiter(LocalFile)+'Signaux_complexes'; - if not(directoryExists(LocalFile)) then MkDir(LocalFile); + cree_dir(LocalFile); LocalFile:=LocalFile+'\page.txt'; if Debug=1 then Affiche('fichier page: '+LocalFile,clOrange); @@ -567,18 +587,7 @@ begin delete(filtre,i,4); // créer le répertoire destination du zip (obligatoire car la commande de dézippe ne le créée pas) - if not(directoryExists(filtre)) then - begin - {$I-} - MkDir(filtre); - erreur:=IoResult; - {$I+} - if erreur<>0 then - begin - log('Impossible de créer répertoire '+filtre+' erreur '+intToSTR(erreur),clred); - exit; - end; - end; + if not(Cree_dir(filtre)) then exit; repertoire:=filtre; // mettre dans olevariant diff --git a/versions.txt b/versions.txt index 4bfb983..5464e35 100644 --- a/versions.txt +++ b/versions.txt @@ -298,10 +298,16 @@ version 9.7 : Boutons dans le TCO int version 9.71 : Nouveaux styles d'affichages pour les versions D12. Création des opérateurs NonOU et NonET dans les fonctions version 9.72 : Correction de l'affichage de la fiche horaire. - Nouvel installeur + Nouvel installeur. version 9.73 : Changement de l'algorithme du fichier de vérification de versions. - Nouvel installeur -version 9.74 : Correction suppression routes préférentielles des trains + Nouvel installeur. +version 9.74 : Correction suppression routes préférentielles des trains. +version 9.75 : Corrections dans le TCO. + Correction importations TJD 2 et 4 états de CDM rail. +version 9.76 : Amélioration de l'importation des réseaux depuis CDM rail. + Correction de l'affichage du réseau CDM en version x64. + Renforcement de la vérification de la configuration. +