diff --git a/Notice d'utilisation des signaux_complexes_GL_V8.3.pdf b/Notice d'utilisation des signaux_complexes_GL_V8.32.pdf similarity index 79% rename from Notice d'utilisation des signaux_complexes_GL_V8.3.pdf rename to Notice d'utilisation des signaux_complexes_GL_V8.32.pdf index d7a8199..7e3242b 100644 Binary files a/Notice d'utilisation des signaux_complexes_GL_V8.3.pdf and b/Notice d'utilisation des signaux_complexes_GL_V8.32.pdf differ diff --git a/README.adoc b/README.adoc index 7824f06..2b6f138 100644 --- a/README.adoc +++ b/README.adoc @@ -7,7 +7,7 @@ Fichiers sources. Signaux_complexes_GL est client de CDM rail mais fonctionne aussi de façon autonome si vous disposez d'une centrale compatible Xpressnet. Il pilote les signaux complexes belges et français de façon automatique de votre réseau après modélisation (il existe une importation automatique du réseau CDM rail). Il permet également de piloter des fonctions F de locomotives, jouer des sons et actionner des passages à niveaux à plusieurs voies d'après des actionneurs, piloter des périphériques via port COM/USB (ex=Arduinos) et Socket réseau. -Il gère des TCOs et peut lancer CDM rail automatiquement avec votre LAY et l'interface choisie. :mrgreen: +Il gère des TCOs et peut lancer CDM rail automatiquement avec votre LAY et l'interface choisie. Ce logiciel nécessite une installation : faire clic droit en sélectionnant "exécuter en tant qu'administrateur" sur installeur.exe. Vous pouvez voir les nouveautés de chaque version dans le fichier versions.txt. diff --git a/Signaux_complexes_GL.cfg b/Signaux_complexes_GL.cfg index bcc5ab2..8d97c47 100644 --- a/Signaux_complexes_GL.cfg +++ b/Signaux_complexes_GL.cfg @@ -14,8 +14,8 @@ -$N+ -$O- -$P+ --$Q+ --$R+ +-$Q- +-$R- -$S- -$T- -$U- diff --git a/Signaux_complexes_GL.dof b/Signaux_complexes_GL.dof index 454559d..5ccec48 100644 --- a/Signaux_complexes_GL.dof +++ b/Signaux_complexes_GL.dof @@ -17,8 +17,8 @@ M=0 N=1 O=0 P=1 -Q=1 -R=1 +Q=0 +R=0 S=0 T=0 U=0 diff --git a/Signaux_complexes_GL.map b/Signaux_complexes_GL.map index 0bf5c6f..f0ad32d 100644 --- a/Signaux_complexes_GL.map +++ b/Signaux_complexes_GL.map @@ -1,104 +1,104 @@ Start Length Name Class - 0001:00000000 0019E6D8H .text CODE - 0002:00000000 00002C20H .data DATA - 0002:00002C20 045A150DH .bss BSS + 0001:00000000 0016EC04H .text CODE + 0002:00000000 00002C24H .data DATA + 0002:00002C24 00C39AC5H .bss BSS Detailed map of segments - 0001:00000000 00005EC7 C=CODE S=.text G=(none) M=System ACBP=A9 - 0001:00005EC8 00000140 C=CODE S=.text G=(none) M=SysInit ACBP=A9 - 0001:00006008 00000108 C=CODE S=.text G=(none) M=Types ACBP=A9 - 0001:00006110 00000F08 C=CODE S=.text G=(none) M=Windows ACBP=A9 - 0001:00007018 00000038 C=CODE S=.text G=(none) M=Messages ACBP=A9 - 0001:00007050 00000338 C=CODE S=.text G=(none) M=SysConst ACBP=A9 - 0001:00007388 00006E28 C=CODE S=.text G=(none) M=SysUtils ACBP=A9 - 0001:0000E1B0 0000081B C=CODE S=.text G=(none) M=VarUtils ACBP=A9 - 0001:0000E9CC 0000809A C=CODE S=.text G=(none) M=Variants ACBP=A9 - 0001:00016A68 000001A0 C=CODE S=.text G=(none) M=RTLConsts ACBP=A9 - 0001:00016C08 0000083C C=CODE S=.text G=(none) M=TypInfo ACBP=A9 - 0001:00017444 00000358 C=CODE S=.text G=(none) M=ActiveX ACBP=A9 - 0001:0001779C 0000A7EA C=CODE S=.text G=(none) M=Classes ACBP=A9 - 0001:00021F88 00000370 C=CODE S=.text G=(none) M=Consts ACBP=A9 - 0001:000222F8 00009BFB C=CODE S=.text G=(none) M=Graphics ACBP=A9 - 0001:0002BEF4 00000124 C=CODE S=.text G=(none) M=Math ACBP=A9 - 0001:0002C018 000002B8 C=CODE S=.text G=(none) M=Contnrs ACBP=A9 - 0001:0002C2D0 00000198 C=CODE S=.text G=(none) M=CommCtrl ACBP=A9 - 0001:0002C468 00000787 C=CODE S=.text G=(none) M=MultiMon ACBP=A9 - 0001:0002CBF0 00000038 C=CODE S=.text G=(none) M=Imm ACBP=A9 - 0001:0002CC28 00000FF8 C=CODE S=.text G=(none) M=HelpIntfs ACBP=A9 - 0001:0002DC20 00000058 C=CODE S=.text G=(none) M=WinSpool ACBP=A9 - 0001:0002DC78 000010C8 C=CODE S=.text G=(none) M=Printers ACBP=A9 - 0001:0002ED40 0000031F C=CODE S=.text G=(none) M=FlatSB ACBP=A9 - 0001:0002F060 000003F0 C=CODE S=.text G=(none) M=SyncObjs ACBP=A9 - 0001:0002F450 000009BB C=CODE S=.text G=(none) M=UxTheme ACBP=A9 - 0001:0002FE0C 00000038 C=CODE S=.text G=(none) M=RichEdit ACBP=A9 - 0001:0002FE44 00000038 C=CODE S=.text G=(none) M=ToolWin ACBP=A9 - 0001:0002FE7C 00000040 C=CODE S=.text G=(none) M=ShellAPI ACBP=A9 - 0001:0002FEBC 00000038 C=CODE S=.text G=(none) M=RegStr ACBP=A9 - 0001:0002FEF4 00000058 C=CODE S=.text G=(none) M=WinInet ACBP=A9 - 0001:0002FF4C 00000038 C=CODE S=.text G=(none) M=UrlMon ACBP=A9 - 0001:0002FF84 0000006C C=CODE S=.text G=(none) M=ShlObj ACBP=A9 - 0001:0002FFF0 00000060 C=CODE S=.text G=(none) M=CommDlg ACBP=A9 - 0001:00030050 00000038 C=CODE S=.text G=(none) M=Dlgs ACBP=A9 - 0001:00030088 000036D1 C=CODE S=.text G=(none) M=Dialogs ACBP=A9 - 0001:0003375C 00004ADA C=CODE S=.text G=(none) M=ExtCtrls ACBP=A9 - 0001:00038238 00000090 C=CODE S=.text G=(none) M=ComStrs ACBP=A9 - 0001:000382C8 000007A0 C=CODE S=.text G=(none) M=Clipbrd ACBP=A9 - 0001:00038A68 00000128 C=CODE S=.text G=(none) M=StrUtils ACBP=A9 - 0001:00038B90 00003821 C=CODE S=.text G=(none) M=Buttons ACBP=A9 - 0001:0003C3B4 00000038 C=CODE S=.text G=(none) M=ExtDlgs ACBP=A9 - 0001:0003C3EC 00000068 C=CODE S=.text G=(none) M=IniFiles ACBP=A9 - 0001:0003C454 00000068 C=CODE S=.text G=(none) M=Registry ACBP=A9 - 0001:0003C4BC 0000006C C=CODE S=.text G=(none) M=Mapi ACBP=A9 - 0001:0003C528 00000058 C=CODE S=.text G=(none) M=ExtActns ACBP=A9 - 0001:0003C580 00000038 C=CODE S=.text G=(none) M=ListActns ACBP=A9 - 0001:0003C5B8 00009948 C=CODE S=.text G=(none) M=ComCtrls ACBP=A9 - 0001:00045F00 00000EA0 C=CODE S=.text G=(none) M=Themes ACBP=A9 - 0001:00046DA0 0000C698 C=CODE S=.text G=(none) M=StdCtrls ACBP=A9 - 0001:00053438 00000168 C=CODE S=.text G=(none) M=StdActns ACBP=A9 - 0001:000535A0 00000D1F C=CODE S=.text G=(none) M=WinHelpViewer ACBP=A9 - 0001:000542C0 00011403 C=CODE S=.text G=(none) M=Controls ACBP=A9 - 0001:000656C4 00001292 C=CODE S=.text G=(none) M=ActnList ACBP=A9 - 0001:00066958 00001B9C C=CODE S=.text G=(none) M=ImgList ACBP=A9 - 0001:000684F4 000066E1 C=CODE S=.text G=(none) M=Menus ACBP=A9 - 0001:0006EBD8 0000CEFC C=CODE S=.text G=(none) M=Forms ACBP=A9 - 0001:0007BAD4 00000060 C=CODE S=.text G=(none) M=ComConst ACBP=A9 - 0001:0007BB34 00001259 C=CODE S=.text G=(none) M=ComObj ACBP=A9 - 0001:0007CD90 00000038 C=CODE S=.text G=(none) M=StdVCL ACBP=A9 - 0001:0007CDC8 00001793 C=CODE S=.text G=(none) M=AxCtrls ACBP=A9 - 0001:0007E55C 00000060 C=CODE S=.text G=(none) M=OleConst ACBP=A9 - 0001:0007E5BC 00003519 C=CODE S=.text G=(none) M=OleCtrls ACBP=A9 - 0001:00081AD8 00000050 C=CODE S=.text G=(none) M=JConsts ACBP=A9 - 0001:00081B28 000133EC C=CODE S=.text G=(none) M=jpeg ACBP=A9 - 0001:00094F14 00000314 C=CODE S=.text G=(none) M=TlHelp32 ACBP=A9 - 0001:00095228 00000128 C=CODE S=.text G=(none) M=WinSock ACBP=A9 - 0001:00095350 00003A78 C=CODE S=.text G=(none) M=ScktComp ACBP=A9 - 0001:00098DC8 000008EA C=CODE S=.text G=(none) M=OleServer ACBP=A9 - 0001:000996B4 00000598 C=CODE S=.text G=(none) M=MSCommLib_TLB ACBP=A9 - 0001:00099C4C 00000040 C=CODE S=.text G=(none) M=MMSystem ACBP=A9 - 0001:00099C8C 00000038 C=CODE S=.text G=(none) M=Nb30 ACBP=A9 - 0001:00099CC4 00000A18 C=CODE S=.text G=(none) M=MaskUtils ACBP=A9 - 0001:0009A6DC 00002108 C=CODE S=.text G=(none) M=Mask ACBP=A9 - 0001:0009C7E4 0000924C C=CODE S=.text G=(none) M=Grids ACBP=A9 - 0001:000A5A30 00001900 C=CODE S=.text G=(none) M=UnitPilote ACBP=A9 - 0001:000A7330 000004D0 C=CODE S=.text G=(none) M=Importation ACBP=A9 - 0001:000A7800 00013B20 C=CODE S=.text G=(none) M=UnitAnalyseSegCDM ACBP=A9 - 0001:000BB320 00002C44 C=CODE S=.text G=(none) M=UnitConfigTCO ACBP=A9 - 0001:000BDF64 00000D10 C=CODE S=.text G=(none) M=Unit_Pilote_aig ACBP=A9 - 0001:000BEC74 00004D74 C=CODE S=.text G=(none) M=UnitConfigCellTCO ACBP=A9 - 0001:000C39E8 000452B4 C=CODE S=.text G=(none) M=UnitTCO ACBP=A9 - 0001:00108C9C 000030E4 C=CODE S=.text G=(none) M=UnitSR ACBP=A9 - 0001:0010BD80 000027D4 C=CODE S=.text G=(none) M=UnitCDF ACBP=A9 - 0001:0010E554 00040BD0 C=CODE S=.text G=(none) M=UnitConfig ACBP=A9 - 0001:0014F124 000017E7 C=CODE S=.text G=(none) M=verif_version ACBP=A9 - 0001:0015090C 000011D8 C=CODE S=.text G=(none) M=UnitPareFeu ACBP=A9 - 0001:00151AE4 00002B44 C=CODE S=.text G=(none) M=UnitDebug ACBP=A9 - 0001:00154628 00000D2C C=CODE S=.text G=(none) M=UnitSimule ACBP=A9 - 0001:00155354 00002580 C=CODE S=.text G=(none) M=Unitplace ACBP=A9 - 0001:001578D4 00046974 C=CODE S=.text G=(none) M=UnitPrinc ACBP=A9 - 0001:0019E248 0000048D C=CODE S=.text G=(none) M=Signaux_complexes_GL ACBP=A9 + 0001:00000000 00005E87 C=CODE S=.text G=(none) M=System ACBP=A9 + 0001:00005E88 00000140 C=CODE S=.text G=(none) M=SysInit ACBP=A9 + 0001:00005FC8 00000108 C=CODE S=.text G=(none) M=Types ACBP=A9 + 0001:000060D0 00000F08 C=CODE S=.text G=(none) M=Windows ACBP=A9 + 0001:00006FD8 00000038 C=CODE S=.text G=(none) M=Messages ACBP=A9 + 0001:00007010 00000338 C=CODE S=.text G=(none) M=SysConst ACBP=A9 + 0001:00007348 00006E28 C=CODE S=.text G=(none) M=SysUtils ACBP=A9 + 0001:0000E170 0000081B C=CODE S=.text G=(none) M=VarUtils ACBP=A9 + 0001:0000E98C 0000809A C=CODE S=.text G=(none) M=Variants ACBP=A9 + 0001:00016A28 000001A0 C=CODE S=.text G=(none) M=RTLConsts ACBP=A9 + 0001:00016BC8 0000083C C=CODE S=.text G=(none) M=TypInfo ACBP=A9 + 0001:00017404 00000358 C=CODE S=.text G=(none) M=ActiveX ACBP=A9 + 0001:0001775C 0000A7EA C=CODE S=.text G=(none) M=Classes ACBP=A9 + 0001:00021F48 00000370 C=CODE S=.text G=(none) M=Consts ACBP=A9 + 0001:000222B8 00009BFB C=CODE S=.text G=(none) M=Graphics ACBP=A9 + 0001:0002BEB4 00000124 C=CODE S=.text G=(none) M=Math ACBP=A9 + 0001:0002BFD8 000002B8 C=CODE S=.text G=(none) M=Contnrs ACBP=A9 + 0001:0002C290 00000198 C=CODE S=.text G=(none) M=CommCtrl ACBP=A9 + 0001:0002C428 00000787 C=CODE S=.text G=(none) M=MultiMon ACBP=A9 + 0001:0002CBB0 00000038 C=CODE S=.text G=(none) M=Imm ACBP=A9 + 0001:0002CBE8 00000FF8 C=CODE S=.text G=(none) M=HelpIntfs ACBP=A9 + 0001:0002DBE0 00000058 C=CODE S=.text G=(none) M=WinSpool ACBP=A9 + 0001:0002DC38 000010C8 C=CODE S=.text G=(none) M=Printers ACBP=A9 + 0001:0002ED00 0000031F C=CODE S=.text G=(none) M=FlatSB ACBP=A9 + 0001:0002F020 000003F0 C=CODE S=.text G=(none) M=SyncObjs ACBP=A9 + 0001:0002F410 000009BB C=CODE S=.text G=(none) M=UxTheme ACBP=A9 + 0001:0002FDCC 00000038 C=CODE S=.text G=(none) M=RichEdit ACBP=A9 + 0001:0002FE04 00000038 C=CODE S=.text G=(none) M=ToolWin ACBP=A9 + 0001:0002FE3C 00000040 C=CODE S=.text G=(none) M=ShellAPI ACBP=A9 + 0001:0002FE7C 00000038 C=CODE S=.text G=(none) M=RegStr ACBP=A9 + 0001:0002FEB4 00000058 C=CODE S=.text G=(none) M=WinInet ACBP=A9 + 0001:0002FF0C 00000038 C=CODE S=.text G=(none) M=UrlMon ACBP=A9 + 0001:0002FF44 0000006C C=CODE S=.text G=(none) M=ShlObj ACBP=A9 + 0001:0002FFB0 00000060 C=CODE S=.text G=(none) M=CommDlg ACBP=A9 + 0001:00030010 00000038 C=CODE S=.text G=(none) M=Dlgs ACBP=A9 + 0001:00030048 000036D1 C=CODE S=.text G=(none) M=Dialogs ACBP=A9 + 0001:0003371C 00004ADA C=CODE S=.text G=(none) M=ExtCtrls ACBP=A9 + 0001:000381F8 00000090 C=CODE S=.text G=(none) M=ComStrs ACBP=A9 + 0001:00038288 000007A0 C=CODE S=.text G=(none) M=Clipbrd ACBP=A9 + 0001:00038A28 00000128 C=CODE S=.text G=(none) M=StrUtils ACBP=A9 + 0001:00038B50 00003821 C=CODE S=.text G=(none) M=Buttons ACBP=A9 + 0001:0003C374 00000038 C=CODE S=.text G=(none) M=ExtDlgs ACBP=A9 + 0001:0003C3AC 00000068 C=CODE S=.text G=(none) M=IniFiles ACBP=A9 + 0001:0003C414 00000068 C=CODE S=.text G=(none) M=Registry ACBP=A9 + 0001:0003C47C 0000006C C=CODE S=.text G=(none) M=Mapi ACBP=A9 + 0001:0003C4E8 00000058 C=CODE S=.text G=(none) M=ExtActns ACBP=A9 + 0001:0003C540 00000038 C=CODE S=.text G=(none) M=ListActns ACBP=A9 + 0001:0003C578 00009948 C=CODE S=.text G=(none) M=ComCtrls ACBP=A9 + 0001:00045EC0 00000EA0 C=CODE S=.text G=(none) M=Themes ACBP=A9 + 0001:00046D60 0000C698 C=CODE S=.text G=(none) M=StdCtrls ACBP=A9 + 0001:000533F8 00000168 C=CODE S=.text G=(none) M=StdActns ACBP=A9 + 0001:00053560 00000D1F C=CODE S=.text G=(none) M=WinHelpViewer ACBP=A9 + 0001:00054280 00011403 C=CODE S=.text G=(none) M=Controls ACBP=A9 + 0001:00065684 00001292 C=CODE S=.text G=(none) M=ActnList ACBP=A9 + 0001:00066918 00001B9C C=CODE S=.text G=(none) M=ImgList ACBP=A9 + 0001:000684B4 000066E1 C=CODE S=.text G=(none) M=Menus ACBP=A9 + 0001:0006EB98 0000CEFC C=CODE S=.text G=(none) M=Forms ACBP=A9 + 0001:0007BA94 00000060 C=CODE S=.text G=(none) M=ComConst ACBP=A9 + 0001:0007BAF4 00001259 C=CODE S=.text G=(none) M=ComObj ACBP=A9 + 0001:0007CD50 00000038 C=CODE S=.text G=(none) M=StdVCL ACBP=A9 + 0001:0007CD88 00001793 C=CODE S=.text G=(none) M=AxCtrls ACBP=A9 + 0001:0007E51C 00000060 C=CODE S=.text G=(none) M=OleConst ACBP=A9 + 0001:0007E57C 00003519 C=CODE S=.text G=(none) M=OleCtrls ACBP=A9 + 0001:00081A98 00000050 C=CODE S=.text G=(none) M=JConsts ACBP=A9 + 0001:00081AE8 000133EC C=CODE S=.text G=(none) M=jpeg ACBP=A9 + 0001:00094ED4 00000314 C=CODE S=.text G=(none) M=TlHelp32 ACBP=A9 + 0001:000951E8 00000128 C=CODE S=.text G=(none) M=WinSock ACBP=A9 + 0001:00095310 00003A78 C=CODE S=.text G=(none) M=ScktComp ACBP=A9 + 0001:00098D88 000008EA C=CODE S=.text G=(none) M=OleServer ACBP=A9 + 0001:00099674 00000598 C=CODE S=.text G=(none) M=MSCommLib_TLB ACBP=A9 + 0001:00099C0C 00000040 C=CODE S=.text G=(none) M=MMSystem ACBP=A9 + 0001:00099C4C 00000038 C=CODE S=.text G=(none) M=Nb30 ACBP=A9 + 0001:00099C84 00000A18 C=CODE S=.text G=(none) M=MaskUtils ACBP=A9 + 0001:0009A69C 00002108 C=CODE S=.text G=(none) M=Mask ACBP=A9 + 0001:0009C7A4 0000924C C=CODE S=.text G=(none) M=Grids ACBP=A9 + 0001:000A59F0 00001748 C=CODE S=.text G=(none) M=UnitPilote ACBP=A9 + 0001:000A7138 000004D0 C=CODE S=.text G=(none) M=Importation ACBP=A9 + 0001:000A7608 000102E0 C=CODE S=.text G=(none) M=UnitAnalyseSegCDM ACBP=A9 + 0001:000B78E8 000026F4 C=CODE S=.text G=(none) M=UnitConfigTCO ACBP=A9 + 0001:000B9FDC 00000C40 C=CODE S=.text G=(none) M=Unit_Pilote_aig ACBP=A9 + 0001:000BAC1C 00003A0C C=CODE S=.text G=(none) M=UnitConfigCellTCO ACBP=A9 + 0001:000BE628 00030CB0 C=CODE S=.text G=(none) M=UnitTCO ACBP=A9 + 0001:000EF2D8 00002C18 C=CODE S=.text G=(none) M=UnitSR ACBP=A9 + 0001:000F1EF0 00002404 C=CODE S=.text G=(none) M=UnitCDF ACBP=A9 + 0001:000F42F4 00001613 C=CODE S=.text G=(none) M=verif_version ACBP=A9 + 0001:000F5908 000011D0 C=CODE S=.text G=(none) M=UnitPareFeu ACBP=A9 + 0001:000F6AD8 00038000 C=CODE S=.text G=(none) M=UnitConfig ACBP=A9 + 0001:0012EAD8 000029E0 C=CODE S=.text G=(none) M=UnitDebug ACBP=A9 + 0001:001314B8 00000C00 C=CODE S=.text G=(none) M=UnitSimule ACBP=A9 + 0001:001320B8 000023CC C=CODE S=.text G=(none) M=Unitplace ACBP=A9 + 0001:00134484 0003A2F0 C=CODE S=.text G=(none) M=UnitPrinc ACBP=A9 + 0001:0016E774 0000048D 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 00000254 C=DATA S=.data G=DGROUP M=SysUtils ACBP=A9 @@ -208,20 +208,20 @@ Detailed map of segments 0002:00003E60 00000004 C=BSS S=.bss G=DGROUP M=Grids ACBP=A9 0002:00003E64 00000010 C=BSS S=.bss G=DGROUP M=UnitPilote ACBP=A9 0002:00003E74 00000010 C=BSS S=.bss G=DGROUP M=Importation ACBP=A9 - 0002:00003E84 00003DC0 C=BSS S=.bss G=DGROUP M=UnitAnalyseSegCDM ACBP=A9 - 0002:00007C44 00000014 C=BSS S=.bss G=DGROUP M=UnitConfigTCO ACBP=A9 - 0002:00007C58 00000014 C=BSS S=.bss G=DGROUP M=Unit_Pilote_aig ACBP=A9 - 0002:00007C6C 00000014 C=BSS S=.bss G=DGROUP M=UnitConfigCellTCO ACBP=A9 - 0002:00007C80 004186C8 C=BSS S=.bss G=DGROUP M=UnitTCO ACBP=A9 - 0002:00420348 00000010 C=BSS S=.bss G=DGROUP M=UnitSR ACBP=A9 - 0002:00420358 00000014 C=BSS S=.bss G=DGROUP M=UnitCDF ACBP=A9 - 0002:0042036C 000004FC C=BSS S=.bss G=DGROUP M=UnitConfig ACBP=A9 - 0002:00420868 00000018 C=BSS S=.bss G=DGROUP M=verif_version ACBP=A9 - 0002:00420880 00000004 C=BSS S=.bss G=DGROUP M=UnitPareFeu ACBP=A9 - 0002:00420884 0000002C C=BSS S=.bss G=DGROUP M=UnitDebug ACBP=A9 - 0002:004208B0 0000000C C=BSS S=.bss G=DGROUP M=UnitSimule ACBP=A9 - 0002:004208BC 00000008 C=BSS S=.bss G=DGROUP M=Unitplace ACBP=A9 - 0002:004208C4 04183C48 C=BSS S=.bss G=DGROUP M=UnitPrinc ACBP=A9 + 0002:00003E84 000228A0 C=BSS S=.bss G=DGROUP M=UnitAnalyseSegCDM ACBP=A9 + 0002:00026724 00000014 C=BSS S=.bss G=DGROUP M=UnitConfigTCO ACBP=A9 + 0002:00026738 00000014 C=BSS S=.bss G=DGROUP M=Unit_Pilote_aig ACBP=A9 + 0002:0002674C 00000014 C=BSS S=.bss G=DGROUP M=UnitConfigCellTCO ACBP=A9 + 0002:00026760 004186C8 C=BSS S=.bss G=DGROUP M=UnitTCO ACBP=A9 + 0002:0043EE28 00000010 C=BSS S=.bss G=DGROUP M=UnitSR ACBP=A9 + 0002:0043EE38 00000014 C=BSS S=.bss G=DGROUP M=UnitCDF ACBP=A9 + 0002:0043EE4C 00000018 C=BSS S=.bss G=DGROUP M=verif_version ACBP=A9 + 0002:0043EE64 00000004 C=BSS S=.bss G=DGROUP M=UnitPareFeu ACBP=A9 + 0002:0043EE68 000004FC C=BSS S=.bss G=DGROUP M=UnitConfig ACBP=A9 + 0002:0043F364 0000002C C=BSS S=.bss G=DGROUP M=UnitDebug ACBP=A9 + 0002:0043F390 0000000C C=BSS S=.bss G=DGROUP M=UnitSimule ACBP=A9 + 0002:0043F39C 00000008 C=BSS S=.bss G=DGROUP M=Unitplace ACBP=A9 + 0002:0043F3A4 007FD720 C=BSS S=.bss G=DGROUP M=UnitPrinc ACBP=A9 Bound resource files @@ -237,8 +237,8 @@ UnitConfigCellTCO.dfm UnitTCO.dfm UnitSR.dfm UnitCDF.dfm -UnitConfig.dfm verif_version.dfm +UnitConfig.dfm UnitDebug.dfm UnitSimule.dfm Unitplace.dfm @@ -247,4 +247,4 @@ Signaux_complexes_GL.res Signaux_complexes_GL.drf -Program entry point at 0001:0019E558 +Program entry point at 0001:0016EA84 diff --git a/UnitConfig.dfm b/UnitConfig.dfm index a8b4a60..0072f04 100644 --- a/UnitConfig.dfm +++ b/UnitConfig.dfm @@ -1,6 +1,6 @@ object FormConfig: TFormConfig - Left = 247 - Top = 117 + Left = 117 + Top = 189 Hint = 'Modifie la configuration selon les s'#233'lections choisies' BorderStyle = bsDialog Caption = 'Configuration g'#233'n'#233'rale' @@ -668,7 +668,7 @@ object FormConfig: TFormConfig Top = 8 Width = 633 Height = 497 - ActivePage = TabSheetCDM + ActivePage = TabSheetAct Font.Charset = DEFAULT_CHARSET Font.Color = clBlack Font.Height = -11 @@ -1240,9 +1240,9 @@ object FormConfig: TFormConfig object RadioButton2: TRadioButton Left = 8 Top = 40 - Width = 225 + Width = 241 Height = 17 - Caption = '1 : Ent'#234'te FF FE (interfaces natives USB)' + Caption = '1 : Ent'#234'te FF FE/FD (interfaces natives USB)' TabOrder = 1 end end @@ -2332,7 +2332,7 @@ object FormConfig: TFormConfig end object Label69: TLabel Left = 152 - Top = 328 + Top = 326 Width = 122 Height = 39 Hint = @@ -2766,7 +2766,6 @@ object FormConfig: TFormConfig Top = 56 Width = 193 Height = 21 - AutoComplete = False ItemHeight = 0 TabOrder = 0 OnChange = ComboBoxDecodeurPersoChange @@ -2865,7 +2864,7 @@ object FormConfig: TFormConfig TabOrder = 0 object GroupBoxRadio: TGroupBox Left = 8 - Top = 120 + Top = 24 Width = 249 Height = 89 Caption = 'Type d'#39'action' @@ -2909,14 +2908,14 @@ object FormConfig: TFormConfig end object GroupBoxAct: TGroupBox Left = 8 - Top = 24 + Top = 120 Width = 249 Height = 321 Caption = 'Action fonction de locomotive ' TabOrder = 1 object GroupBox18: TGroupBox Left = 8 - Top = 24 + Top = 16 Width = 233 Height = 161 Caption = 'D'#233'clencheur ' @@ -2970,9 +2969,9 @@ object FormConfig: TFormConfig Width = 129 Height = 21 Hint = - 'Train d'#233'clencheur pour lequel la condition s'#39'applique (mettre X ' + - 'pour tous les trains) #13 d'#233'clenchement par actionneur uniquemen' + - 't' + 'Train(s) d'#233'clencheur(s) s'#233'par'#233's par des virgules pour lequel la ' + + 'condition s'#39'applique (mettre X pour tous les trains) #13 d'#233'clenc' + + 'hement par actionneur uniquement' ParentShowHint = False ShowHint = True TabOrder = 2 @@ -3023,8 +3022,8 @@ object FormConfig: TFormConfig end end object GroupBox19: TGroupBox - Left = 56 - Top = 32 + Left = 8 + Top = 168 Width = 233 Height = 137 Caption = 'Destinataire de l'#39'action ' @@ -3217,7 +3216,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 = 0 + ItemHeight = 13 ParentShowHint = False ShowHint = True TabOrder = 6 @@ -3238,24 +3237,24 @@ object FormConfig: TFormConfig end end object GroupBoxPNA: TGroupBox - Left = 104 - Top = 160 + Left = 168 + Top = 152 Width = 169 Height = 121 Caption = 'Actionneurs PN simples' TabOrder = 2 end object GroupBoxPNZ: TGroupBox - Left = 64 - Top = 48 + Left = 88 + Top = 320 Width = 169 Height = 65 Caption = 'Zones de d'#233'tection' TabOrder = 3 end object GroupBoxPN: TGroupBox - Left = 40 - Top = 48 + Left = 184 + Top = 24 Width = 249 Height = 193 Caption = 'Action gestion passage '#224' niveau' @@ -3378,7 +3377,7 @@ object FormConfig: TFormConfig end object RadioGroupActPN: TRadioGroup Left = 8 - Top = 16 + Top = 24 Width = 217 Height = 57 Hint = 'action par accessoire DCC ou commande COM/USB' @@ -3398,7 +3397,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 = 0 + ItemHeight = 13 ParentShowHint = False ShowHint = True TabOrder = 10 @@ -4087,13 +4086,13 @@ object FormConfig: TFormConfig object Label23: TLabel Left = 8 Top = 28 - Width = 570 + Width = 606 Height = 26 Caption = - 'Ils sont utilis'#233's pour '#234'tre activ'#233's par un actionneur et leur en' + - 'voyer des ordres ASCII. On peut '#233'galement leur envoyer des infor' + - 'mations sur les '#233'v'#232'nements aiguillage, d'#233'tecteurs et actionneurs' + - ' via les services.' + 'Les p'#233'riph'#233'riques sont utilis'#233's pour '#234'tre activ'#233's par un actionn' + + 'eur et pour leur envoyer des ordres ASCII. On peut '#233'galement leu' + + 'r envoyer des informations sur les '#233'v'#232'nements aiguillage, d'#233'tect' + + 'eurs et actionneurs via les services.' WordWrap = True end object ListBoxPeriph: TListBox @@ -4163,7 +4162,7 @@ object FormConfig: TFormConfig end object ButtonOuvreCom: TButton Left = 14 - Top = 365 + Top = 421 Width = 75 Height = 20 Hint = 'R'#233'ouvre les ports COMs et Sockets demand'#233's' diff --git a/UnitConfig.pas b/UnitConfig.pas index 12c1061..540e7f9 100644 --- a/UnitConfig.pas +++ b/UnitConfig.pas @@ -546,6 +546,7 @@ const // constantes du fichier de configuration NomConfig='ConfigGenerale.cfg'; Debug_ch='Debug'; +serveurIPCDM_Touche_ch='serveurIPCDM_Touche'; PortServeur_ch='Port_Serveur'; AntiTimeoutEthLenz_ch='AntiTimeoutEthLenz'; Verif_AdrXpressNet_ch='Verif_AdrXpressNet'; @@ -614,7 +615,7 @@ section_accCOM_ch='[section_accCOMUSB]'; var FormConfig: TFormConfig; - AdresseIPCDM,AdresseIP,PortCom,recuCDM,residuCDM,trainsauve : string; + AdresseIPCDM,AdresseIP,PortCom,recuCDM,residuCDM : string; //,trainsauve : string; portCDM,TempoOctet,TimoutMaxInterface,Valeur_entete,PortInterface,prot_serie,NumPort,debug, LigneCliqueePN,AncLigneCliqueePN,clicMemo,Nb_cantons_Sig,protocole,Port,PortServeur, @@ -626,28 +627,37 @@ var ack_cdm,clicliste,config_modifie,clicproprietes,confasauver,trouve_MaxPort, modif_branches,ConfigPrete,trouve_section_dccpp,trouve_section_trains,trouve_section_acccomusb, trouveAvecVerifIconesTCO,Affiche_avert,activ,trouve_section_dec_pers : boolean; + fichier : text; // composants dynamiques Gp1 : TGroupBox; + CheckBoxCR,Cb1,Cb2,Cb3,CbVis : TCheckBox; + MemoPeriph : Tmemo; + EditPortCde,EditV1F,EditV1O,EditV2F,EditV2O,EditV3F,EditV3O,EditV4F,EditV4O,EditV5F,EditV5O, EditZdet1V1F,EditZdet2V1F,EditZdet1V1O,EditZdet2V1O, EditZdet1V2F,EditZdet2V2F,EditZdet1V2O,EditZdet2V2O, EditZdet1V3F,EditZdet2V3F,EditZdet1V3O,EditZdet2V3O, EditZdet1V4F,EditZdet2V4F,EditZdet1V4O,EditZdet2V4O, EditZdet1V5F,EditZdet2V5F,EditZdet1V5O,EditZdet2V5O : Tedit; - LabelPortCde,LbPnVoie1,LbAPnVoie1,LbAPnVoie2,LbAPnVoie3,LbAPnVoie4,LbAPnVoie5,LbATitre, - LbZTitre,LbZPnVoie1,LbZPnVoie2,LbZPnVoie3,LbZPnVoie4,LbZPnVoie5,LabelMP : Tlabel; - shape1,ShapeZ : Tshape; - BoutonCom : Tbutton; EditT : Array[1..10] of Tedit; - ComboL1,ComboL2,ComboTS1,ComboTS2 : Array[1..10] of TComboBox; - ShapeT : array[1..10] of TShape; - LabelDecCde : array[1..19] of TLabel; TextBoxCde : array[1..19] of Tedit; + LabelPortCde,LbPnVoie1,LbAPnVoie1,LbAPnVoie2,LbAPnVoie3,LbAPnVoie4,LbAPnVoie5,LbATitre, + LbZTitre,LbZPnVoie1,LbZPnVoie2,LbZPnVoie3,LbZPnVoie4,LbZPnVoie5,LabelMP,LabelNumeroP : Tlabel; + LabelDecCde : array[1..19] of TLabel; + + shape1,ShapeZ : Tshape; + ShapeT : array[1..10] of TShape; + + BoutonCom : Tbutton; + + ComboL1,ComboL2,ComboTS1,ComboTS2 : Array[1..10] of TComboBox; + + function config_com(s : string) : boolean; function envoi_CDM(s : string) : boolean; procedure connecte_CDM; @@ -1298,10 +1308,10 @@ begin begin val(s,adr,erreur); // extraire l'adresse Delete(s,1,k); - if Adr>NbMemZone then + if Adr>NbMaxDet then begin Affiche('Erreur 677A : ligne '+chaine_signal+' : adresse détecteur trop grand: '+intToSTR(adr),clred); - Adr:=NbMemZone; + Adr:=NbMaxDet; end; end; inc(j); @@ -1326,10 +1336,10 @@ begin if (j=4) then feux[i].Btype_Suiv4:=det; end; Val(s,adr,erreur); - if Adr>NbMemZone then + if Adr>NbMaxDet then begin Affiche('Erreur 677B : ligne '+chaine_signal+' : adresse élément trop grand: '+intToSTR(adr),clred); - Adr:=NbMemZone; + Adr:=NbMaxDet; end; if (j=1) then feux[i].Adr_el_suiv1:=Adr; if (j=2) then feux[i].Adr_el_suiv2:=Adr; @@ -1674,6 +1684,8 @@ begin writeln(fichierN,Algo_localisation_ch+'=',Algo_localisation); writeln(fichierN,Avec_roulage_ch+'=',avecRoulage); writeln(fichierN,debug_ch+'=',debug); + if serveurIPCDM_Touche then s:='1' else s:='0'; + writeln(fichierN,serveurIPCDM_Touche_ch+'='+s); writeln(fichierN,PortServeur_ch+'=',PortServeur); writeln(fichierN,Filtrage_det_ch+'=',filtrageDet0); writeln(fichierN,AntiTimeoutEthLenz_ch+'=',AntiTimeoutEthLenz); @@ -1826,6 +1838,8 @@ begin writeln(fichierN,section_DecPers_ch); for i:=1 to NbreDecPers do begin + s:=utf8encode('/ décodeur n°'+intToSTR(i)); + Writeln(fichierN,s); writeln(fichierN,nom_dec_pers_ch+'='+decodeur_pers[i].nom); n:=decodeur_pers[i].NbreAdr; s:=Nba_ch+'='+intToSTR(n); @@ -2060,7 +2074,7 @@ var s,sa,SOrigine: string; maxTablo_act:=1; NbrePN:=0;Nligne:=1; - for i:=1 to 10 do tablo_com_cde[i].NumAcc:=0; + for i:=1 to 10 do tablo_com_cde[i].NumPeriph:=0; // définition des actionneurs repeat @@ -2072,6 +2086,8 @@ var s,sa,SOrigine: string; // MEM = zone // Aaiguillage = aiguillage s:=sOrigine; // travailler en min/maj + + // évènement actionneur par aiguillage if (upcase(s[1])='A') then begin Tablo_actionneur[maxtablo_act].typdeclenche:=2; // type aiguillage @@ -2083,7 +2099,7 @@ var s,sa,SOrigine: string; Tablo_actionneur[maxtablo_act].etat:=j; delete(s,1,erreur); i:=pos(',',s); - Tablo_actionneur[maxtablo_act].traindecl:=copy(s,1,i-1); // inutile mais stocké + //Tablo_actionneur[maxtablo_act].traindecl:=copy(s,1,i-1); // inutile mais stocké delete(s,1,i); end else @@ -2102,7 +2118,7 @@ var s,sa,SOrigine: string; Tablo_actionneur[maxtablo_act].etat:=j; delete(s,1,erreur); i:=pos(',',s); - Tablo_actionneur[maxtablo_act].traindecl:=copy(s,1,i-1); // inutile mais stocké + //Tablo_actionneur[maxtablo_act].traindecl:=copy(s,1,i-1); // inutile mais stocké delete(s,1,i); end else @@ -2595,7 +2611,7 @@ var s,sa,SOrigine: string; inc(nv); end; - + // nombre d'adresses k:=pos(uppercase(nba_ch)+'=',s); if (k=1) and (NbreDecPers>0) then @@ -2680,10 +2696,10 @@ var s,sa,SOrigine: string; decodeur_pers[NbreDecPers].desc[adr].Chcommande:=copy(sOrigine,k+1,length(sOrigine)-k+1); s:=''; inc(adr); - end; + end; end; s:=lit_ligne; - + //else Affiche('Section décodeurs - Nombre de descriptions du décodeur "'+decodeur_pers[NbreDecPers].nom+'" différents du nombre des adresses déclarées',clred); until (adr>j) or (s='0'); @@ -2855,7 +2871,7 @@ var s,sa,SOrigine: string; i:=extract_int(sa); if i=0 then Affiche('Erreur COM nul : '+sOrigine,clred); Tablo_periph[NbPeriph].NumCom:=i; - Tablo_com_cde[NbPeriph].NumAcc:=NbPeriph; + Tablo_com_cde[NbPeriph].NumPeriph:=NbPeriph; end; until (sOrigine='0') or (NbPeriph>=NbMaxi_Periph); end; @@ -2864,673 +2880,676 @@ var s,sa,SOrigine: string; // trie les signaux procedure trier_sig; var i,j : integer; - temp : TSignal; + temp : TSignal; begin - for i:=1 to NbreFeux do - begin - for j:=i+1 to NbreFeux do + for i:=1 to NbreFeux do begin - if feux[i].Adresse>feux[j].adresse then + for j:=i+1 to NbreFeux do begin - temp:=feux[i]; - feux[i]:=feux[j]; - feux[j]:=temp; + if feux[i].Adresse>feux[j].adresse then + begin + temp:=feux[i]; + feux[i]:=feux[j]; + feux[j]:=temp; + end; end; end; - end; end; procedure lit_flux; - label ici1,ici2,ici3,ici4 ; - var i : integer; + label ici1,ici2,ici3,ici4 ; + var i : integer; begin - // valeurs par défaut - Nb_cantons_Sig:=3; - nv:=0; it:=0; - // taille de fonte - repeat - s:=lit_ligne; + // valeurs par défaut + Nb_cantons_Sig:=3; + nv:=0; it:=0; + // taille de fonte + repeat + s:=lit_ligne; - sa:=uppercase(debug_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - delete(s,i,length(sa)); - val(s,debug,erreur); - end; - - sa:=uppercase(PortServeur_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - delete(s,i,length(sa)); - val(s,portServeur,erreur); - if (portServeur<1) or (portServeur>65535) then + sa:=uppercase(debug_ch)+'='; + i:=pos(sa,s); + if i=1 then begin - Affiche('Erreur port serveur : '+intToSTR(portServeur),clred); - portServeur:=5000; + delete(s,i,length(sa)); + val(s,debug,erreur); end; - end; - sa:=uppercase(Verif_AdrXpressNet_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - delete(s,i,length(sa)); - val(s,Verif_AdrXpressNet,erreur); - end; - - sa:=uppercase(Nom_fich_TCO_ch); - i:=pos(sa,s); - if i=1 then - begin - delete(s,1,length(sa)); - i:=extract_int(s); - j:=pos('=',s); - delete(s,1,j); - if (i>0) and (i<11) then NomfichierTCO[i]:=s; - end; - - - sa:=uppercase(LargeurF_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - delete(s,i,length(sa)); - val(s,LargeurF,erreur); - end; - - sa:=uppercase(HauteurF_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - delete(s,i,length(sa)); - val(s,HauteurF,erreur); - end; - - sa:=uppercase(OffsetXF_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - delete(s,i,length(sa)); - val(s,OffsetXF,erreur); - end; - - sa:=uppercase(OffsetYF_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - delete(s,i,length(sa)); - val(s,OffsetYF,erreur); - end; - - sa:=uppercase(PosSplitter_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - delete(s,i,length(sa)); - val(s,PosSplitter,erreur); - end; - - sa:=uppercase(Filtrage_det_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - delete(s,i,length(sa)); - val(s,filtrageDet0,erreur); - end; - - sa:=uppercase(AntiTimeoutEthLenz_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - delete(s,i,length(sa)); - val(s,AntiTimeoutEthLenz,erreur); - end; - - sa:=uppercase(Algo_localisation_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - delete(s,i,length(sa)); - val(s,Algo_localisation,erreur); - if Algo_localisation<>1 then Affiche('Avertissement: Algo_localisation='+intToSTR(algo_localisation)+' est expérimental et non garanti',clorange); - end; - - sa:=uppercase(Avec_roulage_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - delete(s,i,length(sa)); - val(s,AvecRoulage,erreur); - if avecRoulage=1 then Formprinc.roulage1.visible:=true; - end; - - sa:=uppercase(Fonte_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - inc(nv); - trouve_fonte:=true; - delete(s,i,length(sa)); - val(s,TailleFonte,erreur); - if (TailleFonte<8) or (tailleFonte>25) then taillefonte:=10; - with FormPrinc.FenRich do + sa:=uppercase(serveurIPCDM_Touche_ch)+'='; + i:=pos(sa,s); + if i=1 then begin - //clear; - Font.Size:=TailleFonte; + delete(s,i,length(sa)); + val(s,i,erreur); + serveurIPCDM_Touche:=i=1; end; - end; - sa:=uppercase(Protocole_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - inc(nv); - trouve_protocole:=true; - delete(s,i,length(sa)); - val(s,Protocole,erreur); - if (Protocole<1) or (Protocole>2) then Protocole:=1; //1=xpressnet 2=DCC+ - end; - - // adresse ip et port de CDM - sa:=uppercase(IpV4_PC_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - inc(nv); - trouve_ipv4_PC:=true; - delete(s,i,length(sa)); - i:=pos(':',s); - if i<>0 then + sa:=uppercase(PortServeur_ch)+'='; + i:=pos(sa,s); + if i=1 then begin - adresseIPCDM:=copy(s,1,i-1);Delete(s,1,i); - val(s,portCDM,erreur); - if (portCDM=0) or (portCDM>65535) or (erreur<>0) then affiche('Erreur port CDM : '+s,clred); - end - else affiche('Erreur adresse ip cdm rail '+s,clred); - end; - - // Services CDM - sa:=uppercase(ServicesCDM_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - inc(nv); - delete(s,i,length(sa)); - val(s,i,erreur); - Srvc_aig:=testbit(i,0); - Srvc_act:=testbit(i,1); - Srvc_det:=testbit(i,2); - Srvc_pos:=testbit(i,3); - Srvc_sig:=testbit(i,4); - Srvc_tdcc:=false; - end; - - // adresse ip et port de la centrale - sa:=uppercase(IPV4_INTERFACE_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - inc(nv); - trouve_IPV4_INTERFACE:=true; - delete(s,i,length(sa)); - i:=pos(':',s); - if i<>0 then - begin - adresseIP:=copy(s,1,i-1);Delete(s,1,i);portInterface:=StrToINT(s); - if (adresseIP<>'0') and (portInterface=0) then affiche('Erreur port nul : '+sOrigine,clRed); - end - else begin adresseIP:='0';parSocketLenz:=false;end; - end; - - // nombre max de port série à explorer - // configuration du port com - sa:=uppercase(MaxCom_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - inc(nv); - delete(s,i,length(sa)); - trouve_MaxPort:=true; - val(s,MaxPortCom,erreur); - if erreur<>0 then Affiche('Erreur MaxCom: '+sOrigine,clred); - if (MaxPortCom<1) or (MaxPortCom>255) then MaxPortCom:=30; - end; - - - // configuration du port com interface - sa:=uppercase(PROTOCOLE_SERIE_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - inc(nv); - trouve_PROTOCOLE_SERIE:=true; - delete(s,i,length(sa)); - if not(config_com(s)) then Affiche('Erreur port com mal déclaré : '+s,clred); - if (NumPort>MaxPortCom) then Affiche('Le port com est supérieur au nombre de COMx à explorer dans le fichier de configuraion',clred); - portcom:=s; - end; - - // temporisation entre 2 caractères - sa:=uppercase(INTER_CAR_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - inc(nv); - delete(s,i,length(sa)); - trouve_INTER_CAR:=true; - val(s,TempoOctet,erreur); - if erreur<>0 then Affiche('Erreur temporisation entre 2 octets',clred); - end; - - // temporisation attente maximale interface - sa:=uppercase(TEMPO_MAXI_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - inc(nv); - delete(s,i,length(sa)); - trouve_Tempo_maxi:=true; - val(s,TimoutMaxInterface,erreur); - if erreur<>0 then Affiche('Erreur temporisation maximale interface',clred); - end; - - // entete - sa:=uppercase(ENTETE_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - inc(nv); - delete(s,i,length(sa)); - trouve_Entete:=true; - val(s,Valeur_entete,erreur); - entete:='';suffixe:=''; - if Valeur_entete=1 then begin entete:=#$FF+#$FE;suffixe:='';end; - if (erreur<>0) or (valeur_entete>1) then Affiche('Erreur déclaration '+entete_ch,clred); - end; - - // avec ou sans initialisation des aiguillages - sa:=uppercase(INIT_AIG_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - trouve_init_aig:=true; - inc(nv); - delete(s,i,length(sa)); - AvecInitAiguillages:=s='1'; - end; - - // avec demande de position des aiguillages en mode autonome au démarrage - sa:=uppercase(Init_dem_aig_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - trouve_dem_aig:=true; - inc(nv); - delete(s,i,length(sa)); - AvecDemandeAiguillages:=s='1'; - end; - - // avec demande de connexion en COM USB au démarrage - sa:=uppercase(Init_dem_interfaceUSBCOM_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - trouve_demcnxCOMUSB:=true; - inc(nv); - delete(s,i,length(sa)); - AvecDemandeInterfaceUSB:=s='1'; - end; - - // avec demande de connexion en ethernet au démarrage - sa:=uppercase(Init_dem_interfaceEth_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - trouve_demcnxEth:=true; - inc(nv); - delete(s,i,length(sa)); - AvecDemandeInterfaceEth:=s='1'; - end; - - // taille de la fenetre - sa:=uppercase(fenetre_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - inc(nv); - trouve_fenetre:=true; - delete(s,i,length(sa)); - val(s,fenetre,erreur); - if fenetre=1 then Formprinc.windowState:=wsMaximized; - end; - - // mémo fenetre - sa:=uppercase(AffMemoFenetre_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - inc(nv); - delete(s,i,length(sa)); - val(s,AffMemoFenetre,erreur); - end; - - // Nombre de cantons avant signal - sa:=uppercase(Nb_cantons_Sig_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - inc(nv); - trouve_Nb_cantons_Sig:=true; - delete(s,i,length(sa)); - val(s,Nb_cantons_Sig,erreur); - if (Nb_cantons_Sig<3) or (Nb_cantons_Sig>5) then Nb_cantons_Sig:=3; - end; - - // temporisation aiguillages - sa:=uppercase(Tempo_Aig_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - inc(nv); - trouve_Tempo_aig:=true; - delete(s,i,length(sa)); - val(s,Tempo_Aig,erreur); - end; - - // temporisation décodeurs de feux - sa:=uppercase(Tempo_Feu_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - inc(nv); - trouve_Tempo_feu:=true; - delete(s,i,length(sa)); - val(s,Tempo_Feu,erreur); - if tempo_Feu=0 then Tempo_feu:=100; - end; - - // algo unisemaf - sa:=uppercase(Algo_unisemaf_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - inc(nv); - trouve_Algo_Uni:=true; - delete(s,i,length(sa)); - val(s,algo_Unisemaf,erreur); - if (algo_Unisemaf<0) or (algo_Unisemaf>2) then algo_Unisemaf:=1; - end; - - sa:=uppercase(verif_version_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - trouve_verif_version:=true; - inc(nv); - delete(s,i,length(sa)); - // vérification de la version au démarrage - verifVersion:=true; - val(s,i,erreur); - if erreur=0 then verifVersion:=i=1; - end; - - sa:=uppercase(NOTIF_VERSION_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - inc(nv); - delete(s,i,length(sa)); - trouve_NOTIF_VERSION:=true; - // vérification de la version au démarrage - val(s,i,erreur); - notificationVersion:=i=1; - end; - - sa:=uppercase(AvecVerifIconesTCO_ch); - i:=pos(sa,s); - if i<>0 then - begin - trouveAvecVerifIconesTCO:=true; - inc(nv); - delete(s,i,length(sa)+1); - val(s,AvecVerifIconesTCO,erreur); - AvecVerifIconesTCO:=0; // forcé à 0 - s:=''; - end; - - sa:=uppercase(TCO_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - inc(nv); - delete(s,i,length(sa)); - trouve_TCO:=true; - val(s,i,erreur); - AvecTCO:=i=1; - end; - - sa:=uppercase(Nb_TCO_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - inc(nv); - delete(s,i,length(sa)); - val(s,i,erreur); - if (i<1) or (i>10) then i:=1; - NbreTCO:=i; - end; - - - sa:=uppercase(MasqueBandeauTCO_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - inc(nv); - delete(s,i,length(sa)); - trouve_MasqueTCO:=true; - val(s,i,erreur); - MasqueBandeauTCO:=i=1; - end; - - sa:=uppercase(CDM_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - inc(nv); - trouve_CDM:=true; - delete(s,i,length(sa)); - val(s,i,erreur); - LanceCDM:=i=1; - end; - - sa:=uppercase(LAY_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - inc(nv); - trouve_lay:=true; - delete(s,i,length(sa)); - lay:=s; - end; - - sa:=uppercase(NomModuleCDM_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - inc(nv); - delete(s,i,length(sa)); - NomModuleCDM:=s; - end; - - sa:=uppercase(ModeResa_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - inc(nv); - delete(s,1,length(sa)); - AvecResa:=s='1' - end; - - sa:=uppercase(SERVEUR_INTERFACE_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - inc(nv); - trouve_serveur_interface:=true; - delete(s,i,length(sa)); - val(s,i,erreur); - ServeurInterfaceCDM:=i; - end; - - sa:=uppercase(RETRO_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - inc(nv); - trouve_retro:=true; - delete(s,i,length(sa)); - val(s,i,erreur); - ServeurRetroCDM:=i; - end; - - sa:=uppercase(nb_det_dist_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - inc(nv); - trouve_NbDetDist:=true; - delete(s,i,length(sa)); - val(s,i,erreur); - if i<2 then begin i:=2;Affiche('Attention '+nb_det_dist_ch+' ramené à '+IntToSTR(i),clOrange); end; - Nb_Det_Dist:=i; - end; - - sa:=uppercase(Raz_signaux_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - inc(nv); - trouve_NbDetDist:=true; - delete(s,i,length(sa)); - val(s,i,erreur); - if i>1 then i:=1; - Raz_Acc_signaux:=i=1; - end; - - // section aiguillages - sa:=uppercase(section_aig_ch); - if pos(sa,s)<>0 then - begin - trouve_section_aig:=true; - compile_aiguillages; - trier_aig; - end; - - // section branche - sa:=uppercase(section_branches_ch); - if pos(sa,s)<>0 then - begin - trouve_section_branche:=true; - compile_branches; - end; - - // section signaux - sa:=uppercase(section_sig_ch); - if pos(sa,s)<>0 then - begin - trouve_section_sig:=true; - compile_signaux; - trier_sig; - end; - - // section actionneurs - sa:=uppercase(section_act_ch); - if pos(sa,s)<>0 then - begin - trouve_section_act:=true; - compile_actionneurs; - end; - - // section dcc++ - sa:=uppercase(section_dccpp_ch); - if pos(sa,s)<>0 then - begin - trouve_section_dccpp:=true; - compile_dccpp; - end; - - // section trains - sa:=uppercase(section_trains_ch); - if pos(sa,s)<>0 then - begin - trouve_section_trains:=true; - compile_trains; - end; - - // section dédodeurs - sa:=uppercase(section_DecPers_ch); - if pos(sa,s)<>0 then - begin - trouve_section_dec_pers:=true; - compile_dec_pers; - end; - - - // section placement - sa:=uppercase(section_placement_ch); - if pos(sa,s)<>0 then - begin - i:=1; - repeat - lit_ligne; - if s<>'0' then + delete(s,i,length(sa)); + val(s,portServeur,erreur); + if (portServeur<1) or (portServeur>65535) then begin - j:=pos(',',s); - if j<>0 then + Affiche('Erreur port serveur : '+intToSTR(portServeur),clred); + portServeur:=5000; + end; + end; + + sa:=uppercase(Verif_AdrXpressNet_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + delete(s,i,length(sa)); + val(s,Verif_AdrXpressNet,erreur); + end; + + sa:=uppercase(Nom_fich_TCO_ch); + i:=pos(sa,s); + if i=1 then + begin + delete(s,1,length(sa)); + i:=extract_int(s); + j:=pos('=',s); + delete(s,1,j); + if (i>0) and (i<11) then NomfichierTCO[i]:=s; + end; + + sa:=uppercase(LargeurF_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + delete(s,i,length(sa)); + val(s,LargeurF,erreur); + end; + + sa:=uppercase(HauteurF_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + delete(s,i,length(sa)); + val(s,HauteurF,erreur); + end; + + sa:=uppercase(OffsetXF_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + delete(s,i,length(sa)); + val(s,OffsetXF,erreur); + end; + + sa:=uppercase(OffsetYF_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + delete(s,i,length(sa)); + val(s,OffsetYF,erreur); + end; + + sa:=uppercase(PosSplitter_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + delete(s,i,length(sa)); + val(s,PosSplitter,erreur); + end; + + sa:=uppercase(Filtrage_det_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + delete(s,i,length(sa)); + val(s,filtrageDet0,erreur); + end; + + sa:=uppercase(AntiTimeoutEthLenz_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + delete(s,i,length(sa)); + val(s,AntiTimeoutEthLenz,erreur); + end; + + sa:=uppercase(Algo_localisation_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + delete(s,i,length(sa)); + val(s,Algo_localisation,erreur); + if Algo_localisation<>1 then Affiche('Avertissement: Algo_localisation='+intToSTR(algo_localisation)+' est expérimental et non garanti',clorange); + end; + + sa:=uppercase(Avec_roulage_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + delete(s,i,length(sa)); + val(s,AvecRoulage,erreur); + if avecRoulage=1 then Formprinc.roulage1.visible:=true; + end; + + sa:=uppercase(Fonte_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + inc(nv); + trouve_fonte:=true; + delete(s,i,length(sa)); + val(s,TailleFonte,erreur); + if (TailleFonte<8) or (tailleFonte>25) then taillefonte:=10; + with FormPrinc.FenRich do + begin + //clear; + Font.Size:=TailleFonte; + end; + end; + + sa:=uppercase(Protocole_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + inc(nv); + trouve_protocole:=true; + delete(s,i,length(sa)); + val(s,Protocole,erreur); + if (Protocole<1) or (Protocole>2) then Protocole:=1; //1=xpressnet 2=DCC+ + end; + + // adresse ip et port de CDM + sa:=uppercase(IpV4_PC_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + inc(nv); + trouve_ipv4_PC:=true; + delete(s,i,length(sa)); + i:=pos(':',s); + if i<>0 then + begin + adresseIPCDM:=copy(s,1,i-1);Delete(s,1,i); + val(s,portCDM,erreur); + if (portCDM=0) or (portCDM>65535) or (erreur<>0) then affiche('Erreur port CDM : '+s,clred); + end + else affiche('Erreur adresse ip cdm rail '+s,clred); + end; + + // Services CDM + sa:=uppercase(ServicesCDM_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + inc(nv); + delete(s,i,length(sa)); + val(s,i,erreur); + Srvc_aig:=testbit(i,0); + Srvc_act:=testbit(i,1); + Srvc_det:=testbit(i,2); + Srvc_pos:=testbit(i,3); + Srvc_sig:=testbit(i,4); + Srvc_tdcc:=false; + end; + + // adresse ip et port de la centrale + sa:=uppercase(IPV4_INTERFACE_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + inc(nv); + trouve_IPV4_INTERFACE:=true; + delete(s,i,length(sa)); + i:=pos(':',s); + if i<>0 then + begin + adresseIP:=copy(s,1,i-1);Delete(s,1,i);portInterface:=StrToINT(s); + if (adresseIP<>'0') and (portInterface=0) then affiche('Erreur port nul : '+sOrigine,clRed); + end + else begin adresseIP:='0';parSocketLenz:=false;end; + end; + + // nombre max de port série à explorer + // configuration du port com + sa:=uppercase(MaxCom_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + inc(nv); + delete(s,i,length(sa)); + trouve_MaxPort:=true; + val(s,MaxPortCom,erreur); + if erreur<>0 then Affiche('Erreur MaxCom: '+sOrigine,clred); + if (MaxPortCom<1) or (MaxPortCom>255) then MaxPortCom:=30; + end; + + // configuration du port com interface + sa:=uppercase(PROTOCOLE_SERIE_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + inc(nv); + trouve_PROTOCOLE_SERIE:=true; + delete(s,i,length(sa)); + if not(config_com(s)) then Affiche('Erreur port com mal déclaré : '+s,clred); + if (NumPort>MaxPortCom) then Affiche('Le port com est supérieur au nombre de COMx à explorer dans le fichier de configuraion',clred); + portcom:=s; + end; + + // temporisation entre 2 caractères + sa:=uppercase(INTER_CAR_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + inc(nv); + delete(s,i,length(sa)); + trouve_INTER_CAR:=true; + val(s,TempoOctet,erreur); + if erreur<>0 then Affiche('Erreur temporisation entre 2 octets',clred); + end; + + // temporisation attente maximale interface + sa:=uppercase(TEMPO_MAXI_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + inc(nv); + delete(s,i,length(sa)); + trouve_Tempo_maxi:=true; + val(s,TimoutMaxInterface,erreur); + if erreur<>0 then Affiche('Erreur temporisation maximale interface',clred); + end; + + // entete + sa:=uppercase(ENTETE_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + inc(nv); + delete(s,i,length(sa)); + trouve_Entete:=true; + val(s,Valeur_entete,erreur); + entete:='';suffixe:=''; + if Valeur_entete=1 then begin entete:=#$FF+#$FE;suffixe:='';end; + if (erreur<>0) or (valeur_entete>1) then Affiche('Erreur déclaration '+entete_ch,clred); + end; + + // avec ou sans initialisation des aiguillages + sa:=uppercase(INIT_AIG_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + trouve_init_aig:=true; + inc(nv); + delete(s,i,length(sa)); + AvecInitAiguillages:=s='1'; + end; + + // avec demande de position des aiguillages en mode autonome au démarrage + sa:=uppercase(Init_dem_aig_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + trouve_dem_aig:=true; + inc(nv); + delete(s,i,length(sa)); + AvecDemandeAiguillages:=s='1'; + end; + + // avec demande de connexion en COM USB au démarrage + sa:=uppercase(Init_dem_interfaceUSBCOM_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + trouve_demcnxCOMUSB:=true; + inc(nv); + delete(s,i,length(sa)); + AvecDemandeInterfaceUSB:=s='1'; + end; + + // avec demande de connexion en ethernet au démarrage + sa:=uppercase(Init_dem_interfaceEth_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + trouve_demcnxEth:=true; + inc(nv); + delete(s,i,length(sa)); + AvecDemandeInterfaceEth:=s='1'; + end; + + // taille de la fenetre + sa:=uppercase(fenetre_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + inc(nv); + trouve_fenetre:=true; + delete(s,i,length(sa)); + val(s,fenetre,erreur); + if fenetre=1 then Formprinc.windowState:=wsMaximized; + end; + + // mémo fenetre + sa:=uppercase(AffMemoFenetre_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + inc(nv); + delete(s,i,length(sa)); + val(s,AffMemoFenetre,erreur); + end; + + // Nombre de cantons avant signal + sa:=uppercase(Nb_cantons_Sig_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + inc(nv); + trouve_Nb_cantons_Sig:=true; + delete(s,i,length(sa)); + val(s,Nb_cantons_Sig,erreur); + if (Nb_cantons_Sig<3) or (Nb_cantons_Sig>5) then Nb_cantons_Sig:=3; + end; + + // temporisation aiguillages + sa:=uppercase(Tempo_Aig_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + inc(nv); + trouve_Tempo_aig:=true; + delete(s,i,length(sa)); + val(s,Tempo_Aig,erreur); + end; + + // temporisation décodeurs de feux + sa:=uppercase(Tempo_Feu_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + inc(nv); + trouve_Tempo_feu:=true; + delete(s,i,length(sa)); + val(s,Tempo_Feu,erreur); + if tempo_Feu=0 then Tempo_feu:=100; + end; + + // algo unisemaf + sa:=uppercase(Algo_unisemaf_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + inc(nv); + trouve_Algo_Uni:=true; + delete(s,i,length(sa)); + val(s,algo_Unisemaf,erreur); + if (algo_Unisemaf<0) or (algo_Unisemaf>2) then algo_Unisemaf:=1; + end; + + sa:=uppercase(verif_version_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + trouve_verif_version:=true; + inc(nv); + delete(s,i,length(sa)); + // vérification de la version au démarrage + verifVersion:=true; + val(s,i,erreur); + if erreur=0 then verifVersion:=i=1; + end; + + sa:=uppercase(NOTIF_VERSION_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + inc(nv); + delete(s,i,length(sa)); + trouve_NOTIF_VERSION:=true; + // vérification de la version au démarrage + val(s,i,erreur); + notificationVersion:=i=1; + end; + + sa:=uppercase(AvecVerifIconesTCO_ch); + i:=pos(sa,s); + if i<>0 then + begin + trouveAvecVerifIconesTCO:=true; + inc(nv); + delete(s,i,length(sa)+1); + val(s,AvecVerifIconesTCO,erreur); + AvecVerifIconesTCO:=0; // forcé à 0 + s:=''; + end; + + sa:=uppercase(TCO_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + inc(nv); + delete(s,i,length(sa)); + trouve_TCO:=true; + val(s,i,erreur); + AvecTCO:=i=1; + end; + + sa:=uppercase(Nb_TCO_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + inc(nv); + delete(s,i,length(sa)); + val(s,i,erreur); + if (i<0) or (i>10) then i:=1; + NbreTCO:=i; + end; + + sa:=uppercase(MasqueBandeauTCO_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + inc(nv); + delete(s,i,length(sa)); + trouve_MasqueTCO:=true; + val(s,i,erreur); + MasqueBandeauTCO:=i=1; + end; + + sa:=uppercase(CDM_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + inc(nv); + trouve_CDM:=true; + delete(s,i,length(sa)); + val(s,i,erreur); + LanceCDM:=i=1; + end; + + sa:=uppercase(LAY_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + inc(nv); + trouve_lay:=true; + delete(s,i,length(sa)); + lay:=s; + end; + + sa:=uppercase(NomModuleCDM_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + inc(nv); + delete(s,i,length(sa)); + NomModuleCDM:=s; + end; + + sa:=uppercase(ModeResa_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + inc(nv); + delete(s,1,length(sa)); + AvecResa:=s='1' + end; + + sa:=uppercase(SERVEUR_INTERFACE_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + inc(nv); + trouve_serveur_interface:=true; + delete(s,i,length(sa)); + val(s,i,erreur); + ServeurInterfaceCDM:=i; + end; + + sa:=uppercase(RETRO_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + inc(nv); + trouve_retro:=true; + delete(s,i,length(sa)); + val(s,i,erreur); + ServeurRetroCDM:=i; + end; + + sa:=uppercase(nb_det_dist_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + inc(nv); + trouve_NbDetDist:=true; + delete(s,i,length(sa)); + val(s,i,erreur); + if i<2 then begin i:=2;Affiche('Attention '+nb_det_dist_ch+' ramené à '+IntToSTR(i),clOrange); end; + Nb_Det_Dist:=i; + end; + + sa:=uppercase(Raz_signaux_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + inc(nv); + trouve_NbDetDist:=true; + delete(s,i,length(sa)); + val(s,i,erreur); + if i>1 then i:=1; + Raz_Acc_signaux:=i=1; + end; + + // section aiguillages + sa:=uppercase(section_aig_ch); + if pos(sa,s)<>0 then + begin + trouve_section_aig:=true; + compile_aiguillages; + trier_aig; + end ; + + // section branche + sa:=uppercase(section_branches_ch); + if pos(sa,s)<>0 then + begin + trouve_section_branche:=true; + compile_branches; + end; + + // section signaux + sa:=uppercase(section_sig_ch); + if pos(sa,s)<>0 then + begin + trouve_section_sig:=true; + compile_signaux; + trier_sig; + end; + + // section actionneurs + sa:=uppercase(section_act_ch); + if pos(sa,s)<>0 then + begin + trouve_section_act:=true; + compile_actionneurs; + end; + + // section dcc++ + sa:=uppercase(section_dccpp_ch); + if pos(sa,s)<>0 then + begin + trouve_section_dccpp:=true; + compile_dccpp; + end; + + // section trains + sa:=uppercase(section_trains_ch); + if pos(sa,s)<>0 then + begin + trouve_section_trains:=true; + compile_trains; + end; + + // section dédodeurs + sa:=uppercase(section_DecPers_ch); + if pos(sa,s)<>0 then + begin + trouve_section_dec_pers:=true; + compile_dec_pers; + end; + + // section placement + sa:=uppercase(section_placement_ch); + if pos(sa,s)<>0 then + begin + i:=1; + repeat + lit_ligne; + if s<>'0' then begin - placement[i].train:=copy(s,1,j-1); - delete(s,1,j); - val(s,j,erreur); - placement[i].detecteur:=j; j:=pos(',',s); if j<>0 then begin + placement[i].train:=copy(s,1,j-1); delete(s,1,j); val(s,j,erreur); - placement[i].detdir:=j; + placement[i].detecteur:=j; j:=pos(',',s); if j<>0 then begin delete(s,1,j); val(s,j,erreur); - placement[i].inverse:=j=1; + placement[i].detdir:=j; + j:=pos(',',s); + if j<>0 then + begin + delete(s,1,j); + val(s,j,erreur); + placement[i].inverse:=j=1; + end; end; end; + inc(i); + s:=''; end; - inc(i); - s:=''; - end; - until (s='0') or eof(fichier); - end; + until (s='0') or eof(fichier); + end; - // section accesoires comusb - sa:=uppercase(section_accCOM_ch); - if pos(sa,s)<>0 then - begin - trouve_section_acccomusb:=true; - compile_periph; - end; + // section accesoires comusb + sa:=uppercase(section_accCOM_ch); + if pos(sa,s)<>0 then + begin + trouve_section_acccomusb:=true; + compile_periph; + end; + inc(it); + until (eof(fichier)); - inc(it); - - until (eof(fichier)); - - end; // fin de lit_flux + end; // fin de lit_flux // début de la procédure lit_config begin @@ -3597,7 +3616,7 @@ begin Aiguillage[i].EtatTJD:=4; Aiguillage[i].vitesse:=0; end; - for i:=1 to 1024 do + for i:=1 to NbMaxDet do begin Detecteur[i].etat:=false; Detecteur[i].train:=''; @@ -4108,7 +4127,7 @@ begin end; end; -procedure Champs_dec_Com; +procedure Champs_dec_Periph; var i,n : integer; begin if decCourant<1 then exit; @@ -4150,7 +4169,6 @@ begin LabelDecCde[i].visible:=false; TextBoxCde[i].Visible:=false; end; - end; if n=1 then @@ -4236,7 +4254,7 @@ begin FormConfig.RadioCdeDec.ItemIndex:=typ; if typ=0 then Champs_Dec_Centrale; - if typ=1 then Champs_dec_Com; + if typ=1 then Champs_dec_Periph; end; procedure TformConfig.Bt_onclick(sender : TObject); @@ -4314,9 +4332,16 @@ begin if nMaxComUSBPeriph then labelInfo.Caption:='Nombre maxi de périphériques COM/USB atteint'; Tablo_periph[i].numComposant:=NbPeriph_COMUSB; - Tablo_com_cde[i].NumAcc:=NbPeriph_COMUSB; + Tablo_com_cde[i].NumPeriph:=NbPeriph_COMUSB; end; if v=2 then begin inc(NbPeriph_Socket); if NbPeriph_Socket>MaxComSocketPeriph then labelInfo.Caption:='Nombre maxi de périphériques socket atteint'; Tablo_periph[NbPeriph].numComposant:=NbPeriph_socket; - Tablo_com_cde[i].NumAcc:=NbPeriph_Socket; + Tablo_com_cde[i].NumPeriph:=NbPeriph_Socket; end; end; end; @@ -5178,7 +5203,7 @@ begin comboBoxNation.Items.add('Française'); comboBoxNation.Items.add('Belge'); - EdittrainDecl.Hint:='Déclencheur pour lequel la condition s''applique (mettre X pour tous les trains)'+#13+'déclenchement par actionneur uniquement'; + EdittrainDecl.Hint:='Train(s) déclencheur(s) séparés par des virgules pour lesquels la condition s''applique'+#13+' (mettre X pour tous les trains)'+#13+'déclenchement par actionneur uniquement'; // actionneurs Train ou accessoire ListBoxAct.Clear; @@ -5321,7 +5346,7 @@ begin left:=gp1.Left-30; top:=LabelMP.Top+15; width:=gp1.Width+30; - height:=100; + height:=110; parent:=TabSheetPeriph; Name:='MemoPeriph'; readOnly:=true; @@ -5344,6 +5369,16 @@ begin onclick:=formconfig.Bt_onclick; end; + LabelNumeroP:=Tlabel.Create(Formconfig.TabSheetPeriph); + with LabelNumeroP do + begin + Left:=12;Top:=ListBoxPeriph.top+ListBoxPeriph.Height+8;Width:=200;Height:=12; + caption:='Périphérique'; + parent:=FormConfig.TabSheetPeriph; + name:='LabelNumeroP'; + + end; + EditPortCde:=TEdit.Create(FormConfig.TabSheetPeriph); with EditPortCde do begin @@ -5829,7 +5864,7 @@ begin ComboBoxAccComUSB.Visible:=false; GroupBoxAct.Caption:='Action pour fonction F de locomotive'; EditFonctionAccess.Hint:='Numéro de fonction du décodeur du train (0 à 12 ou 28)'; - editTrainDest.Hint:='Train destinataire de la fonction F'; + editTrainDest.Hint:='Train(s) destinataire(s) de la fonction F'; LabelTempo.Visible:=true; EditTempo.visible:=true; editEtatFoncSortie.visible:=false;LabelA.Visible:=false; LabelFonction.visible:=true; LabelFonction.caption:='Action : Fonction'; @@ -5855,7 +5890,7 @@ begin end; end; -procedure champs_type_Cde; +procedure champs_type_periph; begin with formconfig do begin @@ -6275,8 +6310,8 @@ end; // mise à jour des champs graphiques des actionneurs d'après l'index du tableau Procedure aff_champs_act(i : integer); -var etatact, adresse,sortie,fonction,tempo,access,typ : integer; - s,s2,adr : string; +var j,etatact, adresse,sortie,fonction,tempo,access,typ : integer; + trainDecl,s,s2,adr : string; begin if affevt then affiche('Aff_champs_act('+intToSTR(i)+')',clyellow); if i<1 then exit; @@ -6287,6 +6322,11 @@ begin Access:=Tablo_actionneur[i].accessoire; typ:=Tablo_actionneur[i].typdeclenche; + trainDecl:=Tablo_actionneur[i].traindecl; + + for j:=1 to length(trainDecl) do + if trainDecl[j]='+' then trainDecl[j]:=','; + // déclencheurs with formconfig do begin @@ -6297,7 +6337,7 @@ begin editAct.Text:=intToSTR(Tablo_actionneur[i].adresse); editEtatActionneur.Text:=intToSTR(Tablo_actionneur[i].etat); editEtatFoncSortie.Text:=intToSTR(Tablo_actionneur[i].sortie); - EditTrainDecl.Text:=Tablo_actionneur[i].trainDecl; + EditTrainDecl.Text:=TrainDecl; end; 3 : begin @@ -6321,8 +6361,8 @@ begin etatAct:=Tablo_actionneur[i].etat; Adresse:=Tablo_actionneur[i].adresse; - s2:=Tablo_actionneur[i].trainDecl; - trainsauve:=s2; + //s2:=Tablo_actionneur[i].trainDecl; + //trainsauve:=s2; tempo:=tablo_actionneur[i].Tempo; with formconfig do @@ -6332,7 +6372,8 @@ begin EditAct.text:=adr; EditAct2.Text:=inttostr(Tablo_actionneur[i].adresse2); editEtatActionneur.Text:=IntToSTR(etatAct); - EditTrainDecl.Text:=s2; + //EditTrainDecl.Text:=s2; + EditTrainDecl.Text:=trainDecl; EditTrainDest.Text:=Tablo_actionneur[i].trainDest; editFonctionAccess.Text:=intToSTR(fonction); editTempo.Text:=intToSTR(tempo); @@ -6346,8 +6387,8 @@ begin etatAct:=Tablo_actionneur[i].etat ; Adresse:=Tablo_actionneur[i].adresse; sortie:=Tablo_actionneur[i].sortie; - s2:=Tablo_actionneur[i].trainDecl; - trainsauve:=s2; + //s2:=Tablo_actionneur[i].trainDecl; + //trainsauve:=s2; tempo:=tablo_actionneur[i].Tempo; with formconfig do begin @@ -6355,7 +6396,8 @@ begin EditAct.text:=adr; EditAct2.Text:=inttostr(Tablo_actionneur[i].adresse2); CheckRaz.Checked:=Tablo_actionneur[i].Raz; - EditTrainDecl.Text:=s2; + //EditTrainDecl.Text:=s2; + EditTrainDecl.Text:=trainDecl; EditEtatActionneur.Text:=IntToSTR(etatAct); editFonctionAccess.Text:=intToSTR(Access); editEtatFoncSortie.Text:=intToSTR(sortie); @@ -6385,7 +6427,7 @@ begin etatAct:=Tablo_actionneur[i].etat ; Adresse:=Tablo_actionneur[i].adresse; s2:=Tablo_actionneur[i].trainDecl; - trainsauve:=s2; + //trainsauve:=s2; s:=Tablo_actionneur[i].FichierSon; with formconfig do begin @@ -6393,7 +6435,8 @@ begin EditAct.text:=adr; EditAct2.Text:=inttostr(Tablo_actionneur[i].adresse2); //CheckRaz.Checked:=Tablo_actionneur[i].Raz; - EditTrainDecl.Text:=s2; + //EditTrainDecl.Text:=s2; + EditTrainDecl.Text:=trainDecl; EditSon.Text:=s; EditEtatActionneur.Text:=IntToSTR(etatAct); end; @@ -6401,12 +6444,13 @@ begin if Tablo_actionneur[i].periph then begin - champs_type_cde; + champs_type_periph; with formConfig do begin ComboBoxAccComUSB.ItemIndex:=Tablo_actionneur[i].fonction-1; EditEtatFoncSortie.Text:=intToSTR(Tablo_actionneur[i].etat); EditTrainDest.text:=Tablo_actionneur[i].TrainDest; + EditTrainDecl.Text:=trainDecl; end; end; @@ -7795,6 +7839,7 @@ end; procedure TFormConfig.EditTrainDeclChange(Sender: TObject); var s,train : string; + i : integer; begin if clicliste or (ligneclicAct<0) then exit; if affevt then affiche('Evt Edit TrainDecl Change',clyellow); @@ -7802,6 +7847,11 @@ begin with Formconfig do begin train:=EditTrainDecl.Text; + // remplacer les , par des + pour le stockage + for i:=1 to length(train) do + begin + if train[i]=',' then train[i]:='+'; + end; if train='' then begin LabelInfo.caption:='Erreur train';exit @@ -8192,8 +8242,8 @@ begin end; procedure TFormConfig.RadioButtonLocClick(Sender: TObject); -var champ,i,erreur : integer; - s : string; +var champ,j,i,erreur : integer; + train,s : string; begin // rendre visible le groupbox Actionneur fonction F loco if clicListe or (ligneclicAct<0) then exit; @@ -8210,7 +8260,9 @@ begin Tablo_actionneur[i].adresse:=champ ; val(editEtatActionneur.Text,champ,erreur); Tablo_actionneur[i].etat:=champ; - Tablo_actionneur[i].trainDecl:=EditTrainDecl.Text; + train:=EditTrainDecl.Text; + for j:=1 to length(train) do if train[j]=',' then train[j]:='+'; + Tablo_actionneur[i].trainDecl:=train; val(editFonctionAccess.Text,champ,erreur); Tablo_actionneur[i].fonction:=champ; val(editEtatFoncSortie.Text,champ,erreur); @@ -8224,8 +8276,8 @@ begin end; procedure TFormConfig.RadioButtonAccessClick(Sender: TObject); -var champ,i,erreur : integer; - s : string; +var champ,i,j,erreur : integer; + train,s : string; begin // rendre visible le groupbox Actionneur fonction F loco if clicListe or (ligneclicAct<0) then exit; @@ -8237,12 +8289,14 @@ begin Tablo_Actionneur[i].Son:=false; Tablo_Actionneur[i].periph:=false; champs_type_act; - + val(editact.Text,champ,erreur); Tablo_actionneur[i].adresse:=champ ; val(editEtatActionneur.Text,champ,erreur); Tablo_actionneur[i].etat:=champ; - Tablo_actionneur[i].trainDecl:=EditTrainDecl.Text; + train:=EditTrainDecl.Text; + for j:=1 to length(train) do if train[j]=',' then train[j]:='+'; + Tablo_actionneur[i].trainDecl:=train; val(editFonctionAccess.Text,champ,erreur); Tablo_actionneur[i].fonction:=champ; val(editEtatFoncSortie.Text,champ,erreur); @@ -8257,8 +8311,8 @@ end; procedure TFormConfig.RadioButtonSonClick(Sender: TObject); -var champ,i,erreur : integer; - s : string; +var j, champ,i,erreur : integer; + s,train : string; begin // rendre visible le groupbox Actionneur fonction F loco if clicListe or (ligneclicAct<0) then exit; @@ -8271,12 +8325,14 @@ begin Tablo_Actionneur[i].periph:=false; champs_type_son; - + val(editact.Text,champ,erreur); Tablo_actionneur[i].adresse:=champ ; val(editEtatActionneur.Text,champ,erreur); Tablo_actionneur[i].etat:=champ; - Tablo_actionneur[i].trainDecl:=EditTrainDecl.Text; + train:=EditTrainDecl.Text; + for j:=1 to length(train) do if train[j]=',' then train[j]:='+'; + Tablo_actionneur[i].trainDecl:=train; val(editFonctionAccess.Text,champ,erreur); Tablo_actionneur[i].fonction:=champ; val(editEtatFoncSortie.Text,champ,erreur); @@ -8290,8 +8346,8 @@ begin end; procedure TFormConfig.RadioButtonCdeClick(Sender: TObject); -var champ,i,erreur : integer; - s : string; +var j,champ,i,erreur : integer; + s,train : string; begin if clicListe or (ligneclicAct<0) then exit; i:=ligneClicAct+1; @@ -8300,13 +8356,16 @@ begin Tablo_Actionneur[i].Act:=false; Tablo_Actionneur[i].Son:=false; Tablo_Actionneur[i].periph:=true; - champs_type_Cde; + champs_type_periph; val(editact.Text,champ,erreur); Tablo_actionneur[i].adresse:=champ ; val(editEtatActionneur.Text,champ,erreur); Tablo_actionneur[i].etat:=champ; - Tablo_actionneur[i].trainDecl:=EditTrainDecl.Text; + train:=EditTrainDecl.Text; + for j:=1 to length(train) do if train[j]=',' then train[j]:='+'; + tablo_actionneur[i].TrainDecl:=train; + val(editFonctionAccess.Text,champ,erreur); Tablo_actionneur[i].fonction:=champ; @@ -8316,6 +8375,7 @@ begin //Tablo_actionneur[i].tempo:=champ; tablo_actionneur[i].TrainDest:=editTrainDest.Text; + s:=encode_act_loc_son(i); ListBoxAct.Items[ligneClicAct]:=s; ListBoxAct.Selected[ligneClicAct]:=true; @@ -9023,7 +9083,7 @@ begin repeat detect:=BrancheN[i][j].Adresse; - if detect>NbMemZone then + if detect>NbMaxDet then begin Affiche('Erreur 1: adresse détecteur trop grand: '+intToSTR(detect),clred); ok:=false; @@ -9408,7 +9468,7 @@ begin adr:=aiguillage[indexaig].Adresse; model:=aiguillage[indexaig].modele; - if adr>NbMemZone then + if adr>NbMaxDet then begin Affiche('Erreur 9.11: adresse aiguillage trop grand: '+intToSTR(adr),clred); ok:=false; @@ -9814,10 +9874,10 @@ begin begin j:=Tablo_actionneur[i].fonction; if j>10 then begin Affiche('Erreur 15.1 pilotage actionneur '+intToSTR(Tablo_actionneur[i].adresse),clred);ok:=false;end; - if j=0 then begin Affiche('Erreur 15.2 L''actionneur '+intToSTR(Tablo_actionneur[i].adresse)+' n''a pas d''accessoire COM/USB d''affecté',clOrange);ok:=false;end; + if j=0 then begin Affiche('Erreur 15.2 L''actionneur '+intToSTR(Tablo_actionneur[i].adresse)+' n''a pas d''accessoire COM/USB d''affecté',clRed);ok:=false;end; if (j>0) and (j<11) and (Tablo_periph[j].NumCom=0) then begin - Affiche('Erreur 15.3 L''actionneur '+intToSTR(Tablo_actionneur[i].adresse)+' n''a pas d''accessoire COM/USB d''affecté',clOrange); + Affiche('Erreur 15.3 L''actionneur '+intToSTR(Tablo_actionneur[i].adresse)+' n''a pas d''accessoire COM/USB d''affecté',clRed); ok:=false; end; end; @@ -9944,6 +10004,7 @@ begin aiguillage[i].position:=const_inconnu; aiguillage[i].InversionCDM:=0; aiguillage[i].vitesse:=0; + aiguillage[i].IndexBranche:=0; s:=encode_Aig(i); // scroller à la fin et sélectionner @@ -9962,6 +10023,9 @@ begin clicliste:=false; config_modifie:=true; Aig_sauve.Adresse:=0; + + // encoder l'index + Index_accessoire[i]:=aiguillage[i].Adresse; end; procedure TFormConfig.ButtonNouvAigClick(Sender: TObject); @@ -10553,10 +10617,10 @@ begin Affiche('Erreur 17 champ '+se+' ligne '+s,clred); code:=false; end; - if adresse>NbMemZone then + if adresse>NbMaxDet then begin Affiche('Erreur 18 ligne '+s+' : adresse aiguillage trop grand: '+intToSTR(adresse),clred); - adresse:=NbMemZone; + adresse:=NbMaxDet; code:=false; end; BrancheN[i,j].adresse:=adresse; @@ -10574,10 +10638,10 @@ begin // détecteur if erreur=0 then begin - if detect>NbMemZone then + if detect>NbMaxDet then begin Affiche('Erreur 20 ligne '+s+' : adresse détecteur trop grand: '+intToSTR(detect),clred); - detect:=NbMemZone; + detect:=NbMaxDet; code:=false; end; BrancheN[i,j].adresse:=detect; // adresse @@ -10987,8 +11051,8 @@ begin end; procedure TFormConfig.RadioButtonActDetClick(Sender: TObject); -var i,champ,erreur : integer; - s : string; +var i,j,champ,erreur : integer; + s,train : string; begin if clicListe or (ligneclicAct<0) then exit; i:=ligneClicAct+1; @@ -10999,8 +11063,13 @@ begin EditTrainDecl.Visible:=true; LabelTrain.Visible:=true; EditEtatActionneur.Hint:='Etat 0 ou 1'; - Tablo_Actionneur[i].trainDecl:=trainSauve; - EditTrainDecl.Text:=trainSauve; + //Tablo_Actionneur[i].trainDecl:=trainSauve; + //EditTrainDecl.Text:=trainSauve; + + train:=Tablo_Actionneur[i].trainDecl; + for j:=1 to length(train) do if train[j]=',' then train[j]:='+'; + EditTrainDecl.text:=train; + val(editact.Text,champ,erreur); Tablo_actionneur[i].adresse:=champ ; @@ -11038,7 +11107,7 @@ begin //editact.Text:=intToSTR(Tablo_actionneur[i].adresse2); EditEtatActionneur.Hint:='Etat 0 ou 1'; - Tablo_actionneur[i].trainDecl:='X'; +// Tablo_actionneur[i].trainDecl:='X'; val(editact.Text,champ,erreur); Tablo_actionneur[i].adresse:=champ ; val(editEtatActionneur.Text,champ,erreur); @@ -11073,7 +11142,7 @@ begin //editact.Text:=intToSTR(Tablo_actionneur[i].adresse2); EditEtatActionneur.Hint:='1 ou S=dévié 2 ou D=droit'; - Tablo_actionneur[i].trainDecl:='X'; + //Tablo_actionneur[i].trainDecl:='X'; val(editact.Text,champ,erreur); Tablo_actionneur[i].adresse:=champ ; val(editEtatActionneur.Text,champ,erreur); @@ -12200,21 +12269,26 @@ end; procedure TFormConfig.ComboBoxDecodeurPersoChange(Sender: TObject); -var i,a : integer; +var it,i : integer; s: string; begin if affevt then Affiche('Evt ComboBoxDecodeurPerso',clyellow); - a:=ComboBoxDecodeurPerso.ItemIndex; - if a>=0 then decCourant:=a+1; + it:=ComboBoxDecodeurPerso.ItemIndex; - //Affiche(intToSTR(a+1)+' courant='+intToSTR(decCourant),clred); - if a=-1 then + if it>=0 then decCourant:=it+1; + //Affiche(intToSTR(decCourant)+' '+intToSTR(it)+' '+ComboBoxDecodeurPerso.Text,clred); + + //if a=-1 then + if decCourant>=0 then begin // changement du nom if decCourant=0 then exit; s:=ComboBoxDecodeurPerso.Text; - ComboBoxDecodeurPerso.items[decCourant-1]:=s; + + ComboBoxDecodeurPerso.items[decCourant-1]:=s; // efface + ComboBoxDecodeurPerso.itemIndex:=it; // remet + decodeur_pers[decCourant].nom:=s; decodeur[NbDecodeurdeBase+DecCourant-1]:=s; ComboBoxDec.Items[NbDecodeurdeBase+DecCourant-1]:=s; @@ -12225,12 +12299,11 @@ begin if feux[i].decodeur=NbDecodeurdeBase+decCourant-1 then Maj_Hint_Signal(i); end; - exit; end; - + EditNbreAdr.Text:=intToSTR(decodeur_pers[decCourant].NbreAdr); //Affiche('Décodeur courant = '+intToSTR(decCourant),clyellow); - maj_decodeurs; + if it=-1 then maj_decodeurs; end; @@ -12270,7 +12343,7 @@ begin //supprimer de la liste des décodeurs si elle est affectée if trouve_entree_combo(ComboBoxDecodeurPerso,s,i) then ComboBoxDecodeurPerso.Items.Delete(i) - else affiche('Anomalie 1',clred); + else affiche('Anomalie ComboBox 1',clred); //if decCourant>0 then dec(decCourant); decCourant:=0; @@ -12445,7 +12518,7 @@ begin aff_champs_sig_feux(ligneClicSig+1); end; end; - end; + end; end; if ord(Key)=VK_DOWN then @@ -12464,7 +12537,7 @@ begin aff_champs_sig_feux(ligneClicSig+1); end; end; - end; + end; end; if (Shift = [ssCtrl]) and (key = ord('A')) then @@ -12582,6 +12655,7 @@ var ss,s : string; clicliste:=true; formConfig.EditNomPeriph.text:=''; + LabelNumeroP.Caption:='Périphérique '; // suppression n:=0; @@ -12617,7 +12691,7 @@ var ss,s : string; s:=encode_Periph(i); if s<>'' then begin - Tablo_com_cde[i].NumAcc:=i; + Tablo_com_cde[i].NumPeriph:=i; FormConfig.ListBoxPeriph.items.Add(s); ajoute_champs_combos(i); end; @@ -12647,6 +12721,7 @@ begin if NbPeriph>10 then formConfig.LabelInfoAcc.caption:='Nombre maxi de périphériques atteint : '+intToStr(NbPeriph); i:=NbPeriph; + LabelNumeroP.Caption:='Périphérique '+intToSTR(NbPeriph); Tablo_periph[i].nom:=''; Tablo_periph[i].NumCom:=0; @@ -12786,6 +12861,8 @@ begin ligneClicAccPeriph:=lc; end; + LabelNumeroP.Caption:='Périphérique '+intToSTR(lc+1); + Aff_champs_accPeriph_tablo(lc+1); s:=utilisateurs_peripheriques; MemoPeriph.Clear; @@ -12838,9 +12915,10 @@ begin if AncligneClicAccPeriph<>ligneClicAccPeriph then begin Aff_champs_accPeriph_tablo(ligneClicAccPeriph+1); + LabelNumeroP.Caption:='Périphérique '+intToSTR(ligneClicAccPeriph+1); end; end; - end; + end; end; if ord(Key)=VK_DOWN then @@ -12857,6 +12935,7 @@ begin if AncligneClicAccPeriph<>ligneClicAccPeriph then begin Aff_champs_accPeriph_tablo(ligneClicAccPeriph+1); + LabelNumeroP.Caption:='Périphérique '+intToSTR(ligneClicAccPeriph+1); end; end; end; @@ -12928,9 +13007,9 @@ end; procedure TFormConfig.RadioCdeDecClick(Sender: TObject); begin if radioCdeDec.ItemIndex=0 then Champs_dec_Centrale; - if radioCdeDec.ItemIndex=1 then Champs_dec_Com; + if radioCdeDec.ItemIndex=1 then Champs_dec_Periph; end; - + procedure TFormConfig.Toutslectionner1Click(Sender: TObject); var tc : Trichedit; begin @@ -13014,6 +13093,7 @@ begin dec(i); if i=0 then exit; + LabelNumeroP.Caption:=''; IndexListe:=i; s:=ListBoxPeriph.Items[i-1]; ListBoxPeriph.Items[i-1]:=ListBoxPeriph.Items[i]; @@ -13062,6 +13142,7 @@ begin dec(i); if i=n-1 then exit; IndexListe:=i; + LabelNumeroP.caption:=''; // inverse les deux entrées de la listebox s:=ListBoxPeriph.Items[i+1]; diff --git a/UnitDebug.pas b/UnitDebug.pas index babc16e..d91b3c5 100644 --- a/UnitDebug.pas +++ b/UnitDebug.pas @@ -607,7 +607,7 @@ begin end; if protocole=2 then AfficheDebug('D11: Commande DCC++ pas encore implantée',clred) end; - + Self.ActiveControl:=nil; end; @@ -633,9 +633,6 @@ begin end; - - - procedure TFormDebug.CheckBoxPrincClick(Sender: TObject); begin ProcPrinc:=checkBoxPrinc.checked; diff --git a/UnitPareFeu.pas b/UnitPareFeu.pas index baa3685..7a8b130 100644 --- a/UnitPareFeu.pas +++ b/UnitPareFeu.pas @@ -25,6 +25,8 @@ Const // Ajoute une règle au pare feu pour un programme en utilisant Microsoft Windows Firewall APIs. +// sp=Nom indicatif du programme (nom de la règle qui sera insérée dans le par-feu +// chemin : chemin partiel et executable function AddApplicationRule(sp,chemin : string) : boolean; var CurrentProfiles,fwPolicy2,RulesObject,NewRule : OleVariant; @@ -42,8 +44,8 @@ begin //Crée l'objet de la règle. NewRule:=CreateOleObject('HNetCfg.FWRule'); - NewRule.Name:=sp; // CDM rail - NewRule.Description:='Autorise le socket de/vers CDM rail'+sp; + NewRule.Name:=sp; + NewRule.Description:='Autorise le socket de/vers '+sp; NewRule.Applicationname:=fichier; NewRule.Protocol:=NET_FW_IP_PROTOCOL_TCP; @@ -60,7 +62,7 @@ begin r:=true; except begin - s:='Erreur: impossible d''accéder au pare feu windows. Le pare feu est géré par un programme tiers.'; + s:='Erreur: impossible d''accéder au pare feu Windows. Le pare feu est géré par un programme tiers.'; Affiche(s,clred); formconfig.Labelinfo.caption:=s; r:=false; diff --git a/UnitPrinc.dfm b/UnitPrinc.dfm index ae7439d..a063cfe 100644 --- a/UnitPrinc.dfm +++ b/UnitPrinc.dfm @@ -1,6 +1,6 @@ object FormPrinc: TFormPrinc - Left = 84 - Top = 223 + Left = 79 + Top = 256 Width = 1133 Height = 653 Anchors = [akLeft, akTop, akRight] @@ -20,7 +20,7 @@ object FormPrinc: TFormPrinc OnResize = FormResize DesignSize = ( 1117 - 595) + 594) PixelsPerInch = 96 TextHeight = 13 object LabelTitre: TLabel @@ -227,7 +227,7 @@ object FormPrinc: TFormPrinc Visible = False end object Image7feux: TImage - Left = 504 + Left = 440 Top = 0 Width = 57 Height = 105 @@ -395,8 +395,8 @@ object FormPrinc: TFormPrinc Visible = False end object Image5feux: TImage - Left = 280 - Top = 0 + Left = 728 + Top = -8 Width = 41 Height = 89 Picture.Data = { @@ -495,8 +495,8 @@ object FormPrinc: TFormPrinc Visible = False end object Image4feux: TImage - Left = 240 - Top = 8 + Left = 704 + Top = 0 Width = 41 Height = 97 Picture.Data = { @@ -1188,23 +1188,9 @@ object FormPrinc: TFormPrinc 0000} Visible = False end - object LabelEtat: TLabel - Left = 360 - Top = 8 - Width = 152 - Height = 18 - Anchors = [akTop, akRight] - Caption = 'Initialisations en cours' - Font.Charset = ANSI_CHARSET - Font.Color = clWindowText - Font.Height = -16 - Font.Name = 'Arial' - Font.Style = [] - ParentFont = False - end object ImageSignal20: TImage - Left = 1072 - Top = 96 + Left = 1048 + Top = 416 Width = 57 Height = 105 Picture.Data = { @@ -1443,7 +1429,7 @@ object FormPrinc: TFormPrinc end object StatusBar1: TStatusBar Left = 0 - Top = 573 + Top = 572 Width = 1117 Height = 22 Panels = < @@ -1481,8 +1467,8 @@ object FormPrinc: TFormPrinc 00020000802500000000080000000000000000003F00000011000000} end object Button1: TButton - Left = 408 - Top = 0 + Left = 728 + Top = 8 Width = 75 Height = 25 Anchors = [akTop, akRight] @@ -1550,7 +1536,7 @@ object FormPrinc: TFormPrinc end object GroupBox1: TGroupBox Left = 505 - Top = 13 + Top = 21 Width = 265 Height = 52 Anchors = [akTop, akRight] @@ -1985,7 +1971,7 @@ object FormPrinc: TFormPrinc end object GroupBox2: TGroupBox Left = 505 - Top = 24 + Top = 16 Width = 265 Height = 105 Anchors = [akTop, akRight] @@ -2089,7 +2075,7 @@ object FormPrinc: TFormPrinc OnDisconnect = ClientSocketInterfaceDisconnect OnRead = ClientSocketInterfaceRead OnError = ClientSocketInterfaceError - Left = 320 + Left = 264 end object MainMenu1: TMainMenu Left = 560 @@ -2432,7 +2418,7 @@ object FormPrinc: TFormPrinc OnDisconnect = ClientSocketCDMDisconnect OnRead = ClientSocketCDMRead OnError = ClientSocketCDMError - Left = 344 + Left = 296 end object OpenDialog: TOpenDialog Left = 944 @@ -2500,6 +2486,6 @@ object FormPrinc: TFormPrinc OnAccept = ServerSocketAccept OnClientDisconnect = ServerSocketClientDisconnect OnClientRead = ServerSocketClientRead - Left = 368 + Left = 320 end end diff --git a/UnitPrinc.pas b/UnitPrinc.pas index cdad9c4..5a12ac4 100644 --- a/UnitPrinc.pas +++ b/UnitPrinc.pas @@ -1,5 +1,5 @@ Unit UnitPrinc; -// 1/12 10h +// 14/12 10h (******************************************** Programme signaux complexes Graphique Lenz Delphi 7 + activeX Tmscomm + clientSocket @@ -102,7 +102,6 @@ type Config: TMenuItem; Codificationdesactionneurs1: TMenuItem; OuvrirunfichiertramesCDM1: TMenuItem; - LabelEtat: TLabel; Affichefentredebug1: TMenuItem; PopupMenuFenRich: TPopupMenu; Copier1: TMenuItem; @@ -378,28 +377,30 @@ type const titre='Signaux complexes GL '; MaxAcc=2048; // adresse maxi d'accessoire XpressNet -NbMaxDet=100; // nombre maximal de détecteurs d'un réseau -NbMemZone=2048; // adresse maximale des détecteurs +NbMaxDet=513+128; // indice maximal de détecteurs d'un réseau (nombre en XpressNet=128) Max_Trains=100; // nombre maximal de train de CDM ou déclarés ou en circulation MaxZones=250; // nombre de zones de détecteurs activés par les trains MaxTrainZone=40; // nombre maximal de trains pour le tableau d'historique des zones +Mtd=128; // nombre maxi de détecteurs précédents stockés Max_event_det=4000; // nombre maximal d'évenements détecteurs -Max_actionneurs=100; -MaxBranches=200; -MaxElBranches=200; -NbreMaxiAiguillages=200; -NbreMaxiSignaux=200; +Max_actionneurs=100; // nombre maximal d'actionneurs +Maxelements=100; // nombre maxi d'éléments 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 NbreMaxiDecPers=10; // nombre maxi de décodeurs personnalisés -NbMaxi_Periph=10; // nombre maxi de périphériques -LargImg=50;HtImg=91; // Dimensions image des feux -MaxComUSBPeriph=2; // Nombre maxi de périphériques USB périphériques -MaxComSocketPeriph=2; +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_inconnu=9; // position inconnue +IdClients=10; // Index maxi de clients NbCouleurTrain=8; MaxCdeDccpp=20; clRose=$AAAAFF; @@ -451,45 +452,38 @@ TBranche = record end; Taiguillage = record - Adresse : integer; // adresse de l'aiguillage - modele : TEquipement; // rien, aig, tjd ... - position, // position actuelle : 1=dévié 2=droit (centrale LENZ) - posInit, // position d'initialisation 1=dévié 2=droit 9=non positionné - Adrtriple, // 2eme adresse pour un aiguillage triple - temps, // temps de pilotage (durée de l'impulsion en x 100 ms - InversionCDM : integer ; // pour les aiguillages déclarés inversés dans CDM, utilisé en mode autonome (paramètre I1) - vitesse : integer; // vitesse de franchissement de l'aiguillage en position déviée (60 ou 90) - AdrTrain : integer; // adresse du train qui a réservé l'aiguillage + Adresse : integer; // adresse de l'aiguillage + modele : TEquipement; // rien, aig, tjd ... + position, // position actuelle : 1=dévié 2=droit (centrale LENZ) + posInit, // position d'initialisation 1=dévié 2=droit 9=non positionné + Adrtriple, // 2eme adresse pour un aiguillage triple + temps, // temps de pilotage (durée de l'impulsion en x 100 ms + InversionCDM : integer ; // pour les aiguillages déclarés inversés dans CDM, utilisé en mode autonome (paramètre I1) + vitesse : integer; // vitesse de franchissement de l'aiguillage en position déviée (60 ou 90) + AdrTrain : integer; // adresse du train qui a réservé l'aiguillage + ADroit : integer ; // adresse (TJD:identifiant extérieur) connecté sur la position droite en talon + ADroitB : char ; // P D S Z + ADevie : integer ; // adresse (TJD:identifiant extérieur) adresse de l'élément connecté en position déviée + ADevieB : char; // caractère (D ou S)si aiguillage de l'élément connecté en position déviée + APointe : integer; // adresse de l'élément connecté en position droite ; + APointeB : char; // P D S Z + DDroit : integer; // destination de la TJD en position droite + DDroitB : char ; + DDevie : integer; // destination de la TJD en position déviée ou 2eme adresse de la TJD + DDevieB : char ; + tjsint : integer; // pour TJS + tjsintb : char ; + // éléments connectés sur la branche déviée 2 (cas d'un aiguillage triple) + Adevie2 : integer; + Adevie2B : char ; + // états d'une TJD (2 ou 4, 4 par défaut) + EtatTJD : integer; - ADroit : integer ; // adresse (TJD:identifiant extérieur) connecté sur la position droite en talon - ADroitB : char ; // P D S Z - - ADevie : integer ; // adresse (TJD:identifiant extérieur) adresse de l'élément connecté en position déviée - ADevieB : char; // caractère (D ou S)si aiguillage de l'élément connecté en position déviée - - APointe : integer; // adresse de l'élément connecté en position droite ; - APointeB : char; // P D S Z - - DDroit : integer; // destination de la TJD en position droite - DDroitB : char ; - - DDevie : integer; // destination de la TJD en position déviée ou 2eme adresse de la TJD - DDevieB : char ; - - tjsint : integer; // pour TJS - tjsintb : char ; - - // éléments connectés sur la branche déviée 2 (cas d'un aiguillage triple) - Adevie2 : integer; - Adevie2B : char ; - // états d'une TJD (2 ou 4, 4 par défaut) - EtatTJD : integer; - - // si modifié en mode config - modifie : boolean ; - NumBranche,IndexBranche : integer; // index dans les branches + // si modifié en mode config + modifie : boolean ; + NumBranche,IndexBranche : integer; // index dans les branches end; -TtabloDet = array[1..10] of integer; +TtabloDet = array[1..Mtd] of integer; TSignal = record adresse, aspect : integer; // adresse du signal, aspect (2 feux..9 feux 12=direction 2 feux .. 16=direction 6 feux) (11=signal belge 1) Img : TImage; // Pointeur sur structure TImage du feu @@ -507,14 +501,14 @@ TSignal = record Adr_det2 : integer; // adresse du détecteur2 sur lequel il est implanté (si un signal est pour plusieurs voies) Adr_det3 : integer; // adresse du détecteur3 sur lequel il est implanté (si un signal est pour plusieurs voies) Adr_det4 : integer; // adresse du détecteur4 sur lequel il est implanté (si un signal est pour plusieurs voies) - Adr_el_suiv1 : integer; // adresse de l'élément1 suivant - Adr_el_suiv2 : integer; // adresse de l'élément2 suivant (si un signal est pour plusieurs voies) - Adr_el_suiv3 : integer; // adresse de l'élément3 suivant (si un signal est pour plusieurs voies) - Adr_el_suiv4 : integer; // adresse de l'élément4 suivant (si un signal est pour plusieurs voies) - Btype_suiv1 : TEquipement ; // type de l'élément suivant ne prend que les valeurs rien, det ou aig - Btype_suiv2 : TEquipement ; // - Btype_suiv3 : TEquipement ; // - Btype_suiv4 : TEquipement ; // + Adr_el_suiv1 : integer; // adresse de l'élément1 suivant voie 1 + Adr_el_suiv2 : integer; // adresse de l'élément2 suivant voie 2 (si un signal est pour plusieurs voies) + Adr_el_suiv3 : integer; // adresse de l'élément3 suivant voie 3 (si un signal est pour plusieurs voies) + Adr_el_suiv4 : integer; // adresse de l'élément4 suivant voie 4 (si un signal est pour plusieurs voies) + Btype_suiv1 : TEquipement ; // type de l'élément suivant voie 1 - Ne prend que les valeurs rien, det ou aig + Btype_suiv2 : TEquipement ; // type de l'élément suivant voie 2 - Ne prend que les valeurs rien, det ou aig + Btype_suiv3 : TEquipement ; // type de l'élément suivant voie 3 - Ne prend que les valeurs rien, det ou aig + Btype_suiv4 : TEquipement ; // type de l'élément suivant voie 4 - Ne prend que les valeurs rien, det ou aig VerrouCarre : boolean ; // si vrai, le feu se verrouille au carré si pas de train avant le signal EtatVerrouCarre : boolean ; // si vrai, le feu est verrouillé au carré modifie : boolean; // feu modifié @@ -535,10 +529,8 @@ TSignal = record Adresse : integer; // aiguillage posAig : char; end; - - - SR : array[1..19] of record // configuration du décodeur Stéphane Ravaut ou digikeijs ou cdf - sortie1,sortie0 : integer; + SR : array[1..19] of record // configuration des sorties du décodeur Stéphane Ravaut ou digikeijs ou cdf pour chacun des 19 états + sortie1,sortie0 : integer; // ex SR[1]=[carre] (voir tableau Etats) end; Na : integer; // nombre d'adresses du feu occupées par le décodeur CDF/digikeijs DetAmont : TtabloDet; // tableau des détecteurs amonts, calculés à la lecture du fichier de config @@ -575,7 +567,7 @@ var TraceListe,clignotant,nack,Maj_feux_cours,configNulle,LanceCDM,AvecInitAiguillages, AvecDemandeInterfaceUSB,AvecDemandeInterfaceEth,aff_acc,affiche_aigdcc,modeStkRetro, retEtatDet,roulage,init_aig_cours,affevt,placeAffiche,clicComboTrain,clicAdrTrain, - avec_splitter,fichier_module_cdm,Diffusion,cdmDevant,avecRESA : boolean; + avec_splitter,fichier_module_cdm,Diffusion,cdmDevant,avecRESA,serveurIPCDM_Touche : boolean; tick,Premier_tick : longint; @@ -586,8 +578,8 @@ var Enregistrement,chaine_Envoi,chaine_recue,Id_CDM,Af,version_Interface,entete,suffixe,Lay, CheminProgrammes : string; - Ancien_detecteur : array[0..NbMemZone] of boolean; // anciens état des détecteurs et adresses des détecteurs et leur état - detecteur : array[0..NbMemZone] of // détecteurs indexés par l'adresse + Ancien_detecteur : array[0..NbMaxDet] of boolean; // anciens état des détecteurs et adresses des détecteurs et leur état + detecteur : array[0..NbMaxDet] of // détecteurs indexés par l'adresse record Etat : boolean; // état 0/1 du détecteur Train : string; // nom du train ayant enclenché le détecteur (CDM - pas fiable) @@ -598,27 +590,25 @@ var end; Adresse_detecteur : array[0..NbMaxDet] of integer; // adresses des détecteurs par index - Ecran : array[1..10] of record - x0,y0,larg,haut : integer; - end; + Ecran : array[1..10] of record // écrans du pc + x0,y0,larg,haut : integer; + end; - Tablo_com_cde : array[1..10] of record - portOuvert: boolean; - NumAcc: integer; // numéro périphérique tableau tablo_acc_comusb - tamponRx : string; - end; - - Liste_clients : array[0..10] of record - adresse : string; - PortDistant,PortLocal : integer; - end; + // tableau des ports COM des périphériqies + Tablo_com_cde : array[1..NbMaxi_Periph] of record + portOuvert: boolean; + NumPeriph: integer; // numéro périphérique USB + tamponRx : string; + end; + Liste_clients : array[0..IdClients] of record + adresse : string; + PortDistant,PortLocal : integer; + end; TypeGen : TEquipement; - // Historique des zones d'occupation par train - TrainZone : array[1..MaxTrainZone] of // train, index record train : string; @@ -643,19 +633,8 @@ var // tableau des périphériques Tablo_periph : array[1..NbMaxi_Periph] of TPeripherique; - // tableau des croisement rencontrés par la fonction suivant_alg3 - croisement : array[1..20] of - record - adresse, // adresse du croisement - entree,sortie, // point d'entrée et de sortie - affect_train : integer; // numéro du train affecté - end; - - // Prévision des zones suivantes (en fonction de la position aiguillages) - TrainPrevZone : array[1..20] of array[1..5] of integer; // non utilisé - // Zones d'occupations actuelles - MemZone : array[0..NbMemZone,0..NbMemZone] of + MemZone : array[0..NbMaxDet,0..NbMaxDet] of record etat : boolean; // mémoires de zones des détecteurs train : string; @@ -674,10 +653,11 @@ var typdeclenche : integer; // déclencheur: 0=actionneur/détecteur 2=evt aig 3=MemZone Raz : boolean; FichierSon,trainDecl, - TrainDest, // train destinataire ou Commande + TrainDest, // train destinataire ou Commande au périphérique TrainCourant : string; end; + // décodeurs personnalisés de signaux decodeur_pers : array[1..NbreMaxiDecPers] of record nom : string; @@ -694,7 +674,7 @@ var end; end; - Ancien_actionneur : array[0..1024] of integer; + Ancien_actionneur : array[0..MaxAcc] of integer; KeyInputs: array of TInput; Tablo_PN : array[0..Max_actionneurs] of @@ -752,7 +732,7 @@ var end; // éléments scannés et/ou verrouillés - elements : array[1..20] of + elements : array[1..Maxelements] of record adresse : integer; typ : Tequipement; @@ -784,7 +764,6 @@ var end; end; - decodeur : array[0..30] of string[20]; Feu_supprime,Feu_sauve : TSignal; @@ -1275,9 +1254,9 @@ var XBlanc,Yblanc,xJaune,yJaune,Xsem,YSem,Xvert,YVert,Xcarre,Ycarre, begin code_to_aspect(Etatsignal,code,combine); // et aspect rayon:=round(6*frX); - XBlanc:=13; YBlanc:=22; + XBlanc:=13; YBlanc:=11; xJaune:=13; yJaune:=55; - Xcarre:=13; Ycarre:=11; + Xcarre:=13; Ycarre:=22; XSem:=13; Ysem:=44; XVert:=13; YVert:=33; @@ -1632,7 +1611,7 @@ begin DeleteObject(NouvBrush); end; -// inverse une image horizontale (miroir) et la met dans dest +// inverse une image (miroir horizontal) et la met dans dest // Utilisé pour les signaux belges procedure inverse_image(imageDest,ImageSrc : Timage); var mrect,nrect : trect; @@ -3429,68 +3408,68 @@ begin if asp=2 then begin case aspect of - violet : begin offset:=0;sortie:=2;end; - blanc : begin offset:=0;sortie:=1;end; - blanc_cli : begin offset:=1;sortie:=1;end; + violet : begin offset:=0;sortie:=2;end; + blanc : begin offset:=0;sortie:=1;end; + blanc_cli : begin offset:=1;sortie:=1;end; end; end; if asp=3 then begin case aspect of - vert : begin offset:=0;sortie:=1;end; - jaune : begin offset:=0;sortie:=2;end; - semaphore : begin offset:=1;sortie:=1;end; - vert_cli : begin offset:=1;sortie:=2;end; - semaphore_cli : begin offset:=2;sortie:=1;end; - jaune_cli : begin offset:=2;sortie:=2;end; + vert : begin offset:=0;sortie:=1;end; + jaune : begin offset:=0;sortie:=2;end; + semaphore : begin offset:=1;sortie:=1;end; + vert_cli : begin offset:=1;sortie:=2;end; + semaphore_cli : begin offset:=2;sortie:=1;end; + jaune_cli : begin offset:=2;sortie:=2;end; end; end; if (asp=4) or (asp=5) then begin case aspect of - vert : begin offset:=0;sortie:=1;end; - jaune : begin offset:=0;sortie:=2;end; - semaphore : begin offset:=1;sortie:=1;end; - carre : begin offset:=1;sortie:=2;end; - vert_cli : begin offset:=2;sortie:=1;end; - jaune_cli : begin offset:=2;sortie:=2;end; - semaphore_cli : begin offset:=3;sortie:=1;end; + vert : begin offset:=0;sortie:=1;end; + jaune : begin offset:=0;sortie:=2;end; + semaphore : begin offset:=1;sortie:=1;end; + carre : begin offset:=1;sortie:=2;end; + vert_cli : begin offset:=2;sortie:=1;end; + jaune_cli : begin offset:=2;sortie:=2;end; + semaphore_cli : begin offset:=3;sortie:=1;end; end; end; if (asp=7) then begin case aspect of - vert : begin offset:=0;sortie:=1;end; - jaune : begin offset:=0;sortie:=2;end; - semaphore : begin offset:=1;sortie:=1;end; - carre : begin offset:=1;sortie:=2;end; - vert_cli : begin offset:=4;sortie:=1;end; - semaphore_cli : begin offset:=4;sortie:=2;end; + vert : begin offset:=0;sortie:=1;end; + jaune : begin offset:=0;sortie:=2;end; + semaphore : begin offset:=1;sortie:=1;end; + carre : begin offset:=1;sortie:=2;end; + vert_cli : begin offset:=4;sortie:=1;end; + semaphore_cli : begin offset:=4;sortie:=2;end; end; case combine of - ral_30 : begin offset:=2;sortie:=1;end; - ral_60 : begin offset:=3;sortie:=1;end; + ral_30 : begin offset:=2;sortie:=1;end; + ral_60 : begin offset:=3;sortie:=1;end; end; end; if (asp=9) then begin case aspect of - vert : begin offset:=0;sortie:=1;end; - jaune : begin offset:=0;sortie:=2;end; - semaphore : begin offset:=1;sortie:=1;end; - carre : begin offset:=1;sortie:=2;end; - vert_cli : begin offset:=4;sortie:=1;end; - semaphore_cli : begin offset:=4;sortie:=2;end; + vert : begin offset:=0;sortie:=1;end; + jaune : begin offset:=0;sortie:=2;end; + semaphore : begin offset:=1;sortie:=1;end; + carre : begin offset:=1;sortie:=2;end; + vert_cli : begin offset:=4;sortie:=1;end; + semaphore_cli : begin offset:=4;sortie:=2;end; end; case combine of - ral_30 : begin offset:=2;sortie:=1;end; - rappel_30 : begin offset:=2;sortie:=2;end; - ral_60 : begin offset:=3;sortie:=1;end; - rappel_60 : begin offset:=3;sortie:=2;end; + ral_30 : begin offset:=2;sortie:=1;end; + rappel_30 : begin offset:=2;sortie:=2;end; + ral_60 : begin offset:=3;sortie:=1;end; + rappel_60 : begin offset:=3;sortie:=2;end; end; end; @@ -3602,28 +3581,26 @@ begin // pilotage qui marche chez JEF if algo_Unisemaf=1 then begin - if modele=2 then // 2 feux - begin - if aspect=blanc then pilote_acc(adresse,1,feu); - if aspect=blanc_cli then pilote_acc(adresse,1,feu); - if aspect=violet then pilote_acc(adresse,2,feu); - end; + if modele=2 then // 2 feux + begin + if aspect=blanc then pilote_acc(adresse,1,feu); + if aspect=blanc_cli then pilote_acc(adresse,1,feu); + if aspect=violet then pilote_acc(adresse,2,feu); + end; - if modele=3 then // 3 feux - begin - if aspect=vert then pilote_acc(adresse,1,feu); - if aspect=vert_cli then pilote_acc(adresse,1,feu); + if modele=3 then // 3 feux + begin + if aspect=vert then pilote_acc(adresse,1,feu); + if aspect=vert_cli then pilote_acc(adresse,1,feu); + if aspect=semaphore then pilote_acc(adresse,2,feu); + if aspect=semaphore_cli then pilote_acc(adresse,2,feu); - if aspect=semaphore then pilote_acc(adresse,2,feu); - if aspect=semaphore_cli then pilote_acc(adresse,2,feu); - - if aspect=jaune then pilote_acc(adresse+1,1,feu); - if aspect=jaune_cli then pilote_acc(adresse+1,1,feu); - end; - - if modele=4 then - begin - case aspect of + if aspect=jaune then pilote_acc(adresse+1,1,feu); + if aspect=jaune_cli then pilote_acc(adresse+1,1,feu); + end; + if modele=4 then + begin + case aspect of vert : pilote_acc(adresse,1,feu); vert_cli : pilote_acc(adresse,1,feu); jaune : pilote_acc(adresse,2,feu); @@ -3633,10 +3610,10 @@ begin carre : pilote_acc(adresse+1,2,feu); end; end; - // 51=carré + blanc - if modele=51 then - begin - case aspect of + // 51=carré + blanc + if modele=51 then + begin + case aspect of vert : pilote_acc(adresse,1,feu); vert_cli : pilote_acc(adresse,1,feu); jaune : pilote_acc(adresse,2,feu); @@ -3646,12 +3623,12 @@ begin carre : pilote_acc(adresse+1,2,feu); blanc : pilote_acc(adresse+2,1,feu); blanc_cli : pilote_acc(adresse+2,1,feu); - end; end; - // 52=VJR + blanc + violet - if modele=52 then - begin - case aspect of + end; + // 52=VJR + blanc + violet + if modele=52 then + begin + case aspect of vert : pilote_acc(adresse,1,feu); vert_cli : pilote_acc(adresse,1,feu); jaune : pilote_acc(adresse,2,feu); @@ -3661,25 +3638,25 @@ begin violet : pilote_acc(adresse+2,1,feu); blanc : pilote_acc(adresse+1,2,feu); blanc_cli : pilote_acc(adresse+1,2,feu); - end; end; - // 71=VJR + ralentissement 30 - if modele=71 then - begin - case aspect of + end; + // 71=VJR + ralentissement 30 + if modele=71 then + begin + case aspect of vert : pilote_acc(adresse,1,feu); vert_cli : pilote_acc(adresse,1,feu); jaune : pilote_acc(adresse,2,feu); jaune_cli : pilote_acc(adresse,2,feu); semaphore : pilote_acc(adresse+1,1,feu); semaphore_cli : pilote_acc(adresse+1,1,feu); - end; - if combine=ral_30 then pilote_acc(adresse+1,2,feu); end; - // 72=VJR + carré + ralentissement 30 - if modele=72 then - begin - case aspect of + if combine=ral_30 then pilote_acc(adresse+1,2,feu); + end; + // 72=VJR + carré + ralentissement 30 + if modele=72 then + begin + case aspect of vert : pilote_acc(adresse,1,feu); vert_cli : pilote_acc(adresse,1,feu); jaune : pilote_acc(adresse,2,feu); @@ -3687,13 +3664,13 @@ begin semaphore : pilote_acc(adresse+1,1,feu); semaphore_cli : pilote_acc(adresse+1,1,feu); carre : pilote_acc(adresse+1,2,feu); - end; - if combine=ral_30 then pilote_acc(adresse+2,1,feu); end; - // 73=VJR + carré + ralentissement 60 - if modele=73 then - begin - case aspect of + if combine=ral_30 then pilote_acc(adresse+2,1,feu); + end; + // 73=VJR + carré + ralentissement 60 + if modele=73 then + begin + case aspect of vert : pilote_acc(adresse,1,feu); vert_cli : pilote_acc(adresse,1,feu); jaune : pilote_acc(adresse,2,feu); @@ -3701,13 +3678,13 @@ begin semaphore : pilote_acc(adresse+1,1,feu); semaphore_cli : pilote_acc(adresse+1,1,feu); carre : pilote_acc(adresse+1,2,feu); - end; - if combine=ral_60 then pilote_acc(adresse+2,1,feu); end; - // 91=VJR + carré + rappel 30 - if modele=91 then - begin - case aspect of + if combine=ral_60 then pilote_acc(adresse+2,1,feu); + end; + // 91=VJR + carré + rappel 30 + if modele=91 then + begin + case aspect of vert : pilote_acc(adresse,1,feu); vert_cli : pilote_acc(adresse,1,feu); jaune : pilote_acc(adresse,2,feu); @@ -3715,14 +3692,14 @@ begin semaphore : pilote_acc(adresse+1,1,feu); semaphore_cli : pilote_acc(adresse+1,1,feu); carre : pilote_acc(adresse+1,2,feu); - end; - if combine=rappel_30 then pilote_acc(adresse+2,1,feu); end; + if combine=rappel_30 then pilote_acc(adresse+2,1,feu); + end; - // 92=VJR + carré + rappel 60 - if modele=92 then - begin - case aspect of + // 92=VJR + carré + rappel 60 + if modele=92 then + begin + case aspect of vert : pilote_acc(adresse,1,feu); vert_cli : pilote_acc(adresse,1,feu); jaune : pilote_acc(adresse,2,feu); @@ -3730,143 +3707,139 @@ begin semaphore : pilote_acc(adresse+1,1,feu); semaphore_cli : pilote_acc(adresse+1,1,feu); carre : pilote_acc(adresse+1,2,feu); - end; - if combine=rappel_60 then pilote_acc(adresse+2,1,feu); end; + if combine=rappel_60 then pilote_acc(adresse+2,1,feu); + end; - // 93=VJR + carré + ral30 + rappel 30 - if modele=93 then + // 93=VJR + carré + ral30 + rappel 30 + if modele=93 then + begin + if combine=-1 then //pas de sig combinée begin - if combine=-1 then //pas de sig combinée - begin - if aspect=vert then pilote_acc(adresse,1,feu); - if aspect=vert_cli then pilote_acc(adresse,1,feu); - if aspect=jaune then pilote_acc(adresse,2,feu); - if aspect=jaune_cli then pilote_acc(adresse,2,feu); - if aspect=semaphore then pilote_acc(adresse+1,1,feu); - if aspect=semaphore_cli then pilote_acc(adresse+1,1,feu); - if aspect=carre then pilote_acc(adresse+1,2,feu); - end; - if combine=ral_30 then pilote_acc(adresse+2,1,feu); - if combine=rappel_30 then pilote_acc(adresse+2,2,feu); - if (aspect=jaune) and (combine=rappel_30) then pilote_acc(adresse+3,1,feu); + if aspect=vert then pilote_acc(adresse,1,feu); + if aspect=vert_cli then pilote_acc(adresse,1,feu); + if aspect=jaune then pilote_acc(adresse,2,feu); + if aspect=jaune_cli then pilote_acc(adresse,2,feu); + if aspect=semaphore then pilote_acc(adresse+1,1,feu); + if aspect=semaphore_cli then pilote_acc(adresse+1,1,feu); + if aspect=carre then pilote_acc(adresse+1,2,feu); end; + if combine=ral_30 then pilote_acc(adresse+2,1,feu); + if combine=rappel_30 then pilote_acc(adresse+2,2,feu); + if (aspect=jaune) and (combine=rappel_30) then pilote_acc(adresse+3,1,feu); + end; - // 94=VJR + carré + ral60 + rappel60 - if modele=94 then + // 94=VJR + carré + ral60 + rappel60 + if modele=94 then + begin + if combine=-1 then begin - if combine=-1 then - begin - if aspect=vert then pilote_acc(adresse,1,feu); - if aspect=vert_cli then pilote_acc(adresse,1,feu); - if aspect=jaune then pilote_acc(adresse,2,feu); - if aspect=jaune_cli then pilote_acc(adresse,2,feu); - if aspect=semaphore then pilote_acc(adresse+1,1,feu); - if aspect=semaphore_cli then pilote_acc(adresse+1,1,feu); - if aspect=carre then pilote_acc(adresse+1,2,feu); - end; - if combine=ral_60 then pilote_acc(adresse+2,1,feu); - if combine=rappel_60 then pilote_acc(adresse+2,2,feu); - if (aspect=jaune) and (combine=rappel_60) then pilote_acc(adresse+3,1,feu); + if aspect=vert then pilote_acc(adresse,1,feu); + if aspect=vert_cli then pilote_acc(adresse,1,feu); + if aspect=jaune then pilote_acc(adresse,2,feu); + if aspect=jaune_cli then pilote_acc(adresse,2,feu); + if aspect=semaphore then pilote_acc(adresse+1,1,feu); + if aspect=semaphore_cli then pilote_acc(adresse+1,1,feu); + if aspect=carre then pilote_acc(adresse+1,2,feu); end; + if combine=ral_60 then pilote_acc(adresse+2,1,feu); + if combine=rappel_60 then pilote_acc(adresse+2,2,feu); + if (aspect=jaune) and (combine=rappel_60) then pilote_acc(adresse+3,1,feu); + end; + // 95=VJR + carré + ral30 + rappel 60 + if modele=95 then + begin + if combine=-1 then + begin + if aspect=vert then pilote_acc(adresse,1,feu); + if aspect=vert_cli then pilote_acc(adresse,1,feu); + if aspect=jaune then pilote_acc(adresse,2,feu); + if aspect=jaune_cli then pilote_acc(adresse,2,feu); + if aspect=semaphore then pilote_acc(adresse+1,1,feu); + if aspect=semaphore_cli then pilote_acc(adresse+1,1,feu); + if aspect=carre then pilote_acc(adresse+1,2,feu); + end; + if combine=ral_30 then pilote_acc(adresse+2,1,feu); + if combine=rappel_60 then pilote_acc(adresse+2,2,feu); + if (aspect=jaune) and (combine=rappel_60) then pilote_acc(adresse+3,1,feu); + end; + // 96=VJR + blanc + carré + ral30 + rappel30 + if modele=96 then + begin + if combine=-1 then + begin + if aspect=vert then pilote_acc(adresse,1,feu); + if aspect=vert_cli then pilote_acc(adresse,1,feu); + if aspect=jaune then pilote_acc(adresse,2,feu); + if aspect=jaune_cli then pilote_acc(adresse,2,feu); + if aspect=semaphore then pilote_acc(adresse+1,1,feu); + if aspect=semaphore_cli then pilote_acc(adresse+1,1,feu); + if aspect=carre then pilote_acc(adresse+1,2,feu); + if aspect=blanc then pilote_acc(adresse+3,2,feu); + if aspect=blanc_cli then pilote_acc(adresse+3,2,feu); + end; + if combine=ral_30 then pilote_acc(adresse+2,1,feu); + if combine=rappel_30 then pilote_acc(adresse+2,2,feu); + if (aspect=jaune) and (combine=rappel_30) then pilote_acc(adresse+3,1,feu); + end; + // 97=VJR + blanc + carré + ral30 + rappel60 + if modele=97 then + begin + if combine=-1 then + begin + if aspect=vert then pilote_acc(adresse,1,feu); + if aspect=vert_cli then pilote_acc(adresse,1,feu); + if aspect=jaune then pilote_acc(adresse,2,feu); + if aspect=jaune_cli then pilote_acc(adresse,2,feu); + if aspect=semaphore then pilote_acc(adresse+1,1,feu); + if aspect=semaphore_cli then pilote_acc(adresse+1,1,feu); + if aspect=carre then pilote_acc(adresse+1,2,feu); + if aspect=blanc then pilote_acc(adresse+3,2,feu); + if aspect=blanc_cli then pilote_acc(adresse+3,2,feu); + end; + if combine=ral_30 then pilote_acc(adresse+2,1,feu); + if combine=rappel_60 then pilote_acc(adresse+2,2,feu); + if (aspect=jaune) and (combine=rappel_60) then pilote_acc(adresse+3,1,feu); + end; - // 95=VJR + carré + ral30 + rappel 60 - if modele=95 then + // 98=VJR + blanc + violet + ral30 + rappel30 + if modele=98 then + begin + if combine=-1 then begin - if combine=-1 then - begin - if aspect=vert then pilote_acc(adresse,1,feu); - if aspect=vert_cli then pilote_acc(adresse,1,feu); - if aspect=jaune then pilote_acc(adresse,2,feu); - if aspect=jaune_cli then pilote_acc(adresse,2,feu); - if aspect=semaphore then pilote_acc(adresse+1,1,feu); - if aspect=semaphore_cli then pilote_acc(adresse+1,1,feu); - if aspect=carre then pilote_acc(adresse+1,2,feu); - end; - if combine=ral_30 then pilote_acc(adresse+2,1,feu); - if combine=rappel_60 then pilote_acc(adresse+2,2,feu); - if (aspect=jaune) and (combine=rappel_60) then pilote_acc(adresse+3,1,feu); + if aspect=vert then pilote_acc(adresse,1,feu); + if aspect=vert_cli then pilote_acc(adresse,1,feu); + if aspect=jaune then pilote_acc(adresse,2,feu); + if aspect=jaune_cli then pilote_acc(adresse,2,feu); + if aspect=semaphore then pilote_acc(adresse+1,1,feu); + if aspect=semaphore_cli then pilote_acc(adresse+1,1,feu); + if aspect=violet then pilote_acc(adresse+1,2,feu); + if aspect=blanc then pilote_acc(adresse+3,2,feu); + if aspect=blanc_cli then pilote_acc(adresse+3,2,feu); end; - - // 96=VJR + blanc + carré + ral30 + rappel30 - if modele=96 then + if (aspect=jaune) and (combine=rappel_30) then pilote_acc(adresse+3,1,feu); + if combine=ral_30 then pilote_acc(adresse+2,1,feu); + if combine=rappel_30 then pilote_acc(adresse+2,2,feu); + end; + // 99=VJR + blanc + violet + ral30 + rappel60 + if modele=99 then + begin + if combine=-1 then begin - if combine=-1 then - begin - if aspect=vert then pilote_acc(adresse,1,feu); - if aspect=vert_cli then pilote_acc(adresse,1,feu); - if aspect=jaune then pilote_acc(adresse,2,feu); - if aspect=jaune_cli then pilote_acc(adresse,2,feu); - if aspect=semaphore then pilote_acc(adresse+1,1,feu); - if aspect=semaphore_cli then pilote_acc(adresse+1,1,feu); - if aspect=carre then pilote_acc(adresse+1,2,feu); - if aspect=blanc then pilote_acc(adresse+3,2,feu); - if aspect=blanc_cli then pilote_acc(adresse+3,2,feu); - end; - if combine=ral_30 then pilote_acc(adresse+2,1,feu); - if combine=rappel_30 then pilote_acc(adresse+2,2,feu); - if (aspect=jaune) and (combine=rappel_30) then pilote_acc(adresse+3,1,feu); - end; - - // 97=VJR + blanc + carré + ral30 + rappel60 - if modele=97 then - begin - if combine=-1 then - begin - if aspect=vert then pilote_acc(adresse,1,feu); - if aspect=vert_cli then pilote_acc(adresse,1,feu); - if aspect=jaune then pilote_acc(adresse,2,feu); - if aspect=jaune_cli then pilote_acc(adresse,2,feu); - if aspect=semaphore then pilote_acc(adresse+1,1,feu); - if aspect=semaphore_cli then pilote_acc(adresse+1,1,feu); - if aspect=carre then pilote_acc(adresse+1,2,feu); - if aspect=blanc then pilote_acc(adresse+3,2,feu); - if aspect=blanc_cli then pilote_acc(adresse+3,2,feu); - end; - if combine=ral_30 then pilote_acc(adresse+2,1,feu); - if combine=rappel_60 then pilote_acc(adresse+2,2,feu); - if (aspect=jaune) and (combine=rappel_60) then pilote_acc(adresse+3,1,feu); - end; - - // 98=VJR + blanc + violet + ral30 + rappel30 - if modele=98 then - begin - if combine=-1 then - begin - if aspect=vert then pilote_acc(adresse,1,feu); - if aspect=vert_cli then pilote_acc(adresse,1,feu); - if aspect=jaune then pilote_acc(adresse,2,feu); - if aspect=jaune_cli then pilote_acc(adresse,2,feu); - if aspect=semaphore then pilote_acc(adresse+1,1,feu); - if aspect=semaphore_cli then pilote_acc(adresse+1,1,feu); - if aspect=violet then pilote_acc(adresse+1,2,feu); - if aspect=blanc then pilote_acc(adresse+3,2,feu); - if aspect=blanc_cli then pilote_acc(adresse+3,2,feu); - end; - if (aspect=jaune) and (combine=rappel_30) then pilote_acc(adresse+3,1,feu); - if combine=ral_30 then pilote_acc(adresse+2,1,feu); - if combine=rappel_30 then pilote_acc(adresse+2,2,feu); - end; - - // 99=VJR + blanc + violet + ral30 + rappel60 - if modele=99 then - begin - if combine=-1 then - begin - if aspect=vert then pilote_acc(adresse,1,feu); - if aspect=vert_cli then pilote_acc(adresse,1,feu); - if aspect=jaune then pilote_acc(adresse,2,feu); - if aspect=jaune_cli then pilote_acc(adresse,2,feu); - if aspect=semaphore then pilote_acc(adresse+1,1,feu); - if aspect=semaphore_cli then pilote_acc(adresse+1,1,feu); - if aspect=violet then pilote_acc(adresse+1,2,feu); - if aspect=blanc then pilote_acc(adresse+3,2,feu); - if aspect=blanc_cli then pilote_acc(adresse+3,2,feu); - end; - if (aspect=jaune) and (combine=rappel_60) then pilote_acc(adresse+3,1,feu); - if combine=ral_30 then pilote_acc(adresse+2,1,feu); - if combine=rappel_60 then pilote_acc(adresse+2,2,feu); + if aspect=vert then pilote_acc(adresse,1,feu); + if aspect=vert_cli then pilote_acc(adresse,1,feu); + if aspect=jaune then pilote_acc(adresse,2,feu); + if aspect=jaune_cli then pilote_acc(adresse,2,feu); + if aspect=semaphore then pilote_acc(adresse+1,1,feu); + if aspect=semaphore_cli then pilote_acc(adresse+1,1,feu); + if aspect=violet then pilote_acc(adresse+1,2,feu); + if aspect=blanc then pilote_acc(adresse+3,2,feu); + if aspect=blanc_cli then pilote_acc(adresse+3,2,feu); end; + if (aspect=jaune) and (combine=rappel_60) then pilote_acc(adresse+3,1,feu); + if combine=ral_30 then pilote_acc(adresse+2,1,feu); + if combine=rappel_60 then pilote_acc(adresse+2,2,feu); + end; end; // algo de la doc qui ne marche pas chez JEF @@ -4064,23 +4037,23 @@ begin if combine=rappel_30 then begin pilote_acc(adresse+2,2,feu);pilote_acc(adresse+3,2,feu);end; if ((aspect=jaune) or (aspect=jaune_cli)) and (combine=rappel_30) then begin pilote_acc(adresse,1,feu);pilote_acc(adresse+2,2,feu);pilote_acc(adresse+3,2,feu);end; - end; + end; - // 99=VJR + blanc + violet + ral30 + rappel60 - if modele=99 then - begin - case aspect of - vert,vert_cli : begin pilote_acc(adresse+1,1,feu);pilote_acc(adresse+3,2,feu);end; - jaune,jaune_cli : begin pilote_acc(adresse,1,feu);pilote_acc(adresse+3,2,feu);end; - semaphore,semaphore_cli: begin pilote_acc(adresse,2,feu);pilote_acc(adresse+3,2,feu);end; - blanc,blanc_cli : pilote_acc(adresse+1,2,feu); - violet : pilote_acc(adresse+3,1,feu); - end; - if combine=ral_30 then begin pilote_acc(adresse+2,1,feu);pilote_acc(adresse+3,2,feu);end; - if combine=rappel_60 then begin pilote_acc(adresse+2,2,feu);pilote_acc(adresse+3,2,feu);end; - if ((aspect=jaune) or (aspect=jaune_cli)) and (combine=rappel_60) - then begin pilote_acc(adresse,1,feu);pilote_acc(adresse+2,2,feu);pilote_acc(adresse+3,2,feu);end; + // 99=VJR + blanc + violet + ral30 + rappel60 + if modele=99 then + begin + case aspect of + vert,vert_cli : begin pilote_acc(adresse+1,1,feu);pilote_acc(adresse+3,2,feu);end; + jaune,jaune_cli : begin pilote_acc(adresse,1,feu);pilote_acc(adresse+3,2,feu);end; + semaphore,semaphore_cli: begin pilote_acc(adresse,2,feu);pilote_acc(adresse+3,2,feu);end; + blanc,blanc_cli : pilote_acc(adresse+1,2,feu); + violet : pilote_acc(adresse+3,1,feu); end; + if combine=ral_30 then begin pilote_acc(adresse+2,1,feu);pilote_acc(adresse+3,2,feu);end; + if combine=rappel_60 then begin pilote_acc(adresse+2,2,feu);pilote_acc(adresse+3,2,feu);end; + if ((aspect=jaune) or (aspect=jaune_cli)) and (combine=rappel_60) + then begin pilote_acc(adresse,1,feu);pilote_acc(adresse+2,2,feu);pilote_acc(adresse+3,2,feu);end; + end; end; end; end; @@ -4202,7 +4175,7 @@ end; {========================================================================== envoie les données au décodeur LDT_nmbs (belge) -seulement 4 aspects !! +ce décodeur ne permet seulement que 4 aspects !! rouge vert 2 jaune (slow approch de la doc ldt) @@ -4354,11 +4327,10 @@ var combine,nombre,aspect,code : integer; i : integer; s : string; -procedure ecrire(v : integer); + + procedure ecrire(v : integer); var j,k : integer; begin - //if InverseMotif then - //v:=inverse(v); // bits 7 6 k:=0; if nombre>=5 then @@ -4368,7 +4340,7 @@ procedure ecrire(v : integer); inc(k); end; - // bit 5 4 + // bits 5 4 if nombre>=3 then begin if (v and $30)=$20 then j:=2 else j:=1; @@ -4376,7 +4348,7 @@ procedure ecrire(v : integer); inc(k); end; - // bit 3 2 // bit 5 4 + // bits 3 2 if nombre>=2 then begin if (v and $c)=$8 then j:=2 else j:=1; @@ -4384,6 +4356,7 @@ procedure ecrire(v : integer); inc(k); end; + // bits 1 0 if nombre>=1 then begin if (v and $3)=$2 then j:=2 else j:=1; @@ -4609,6 +4582,11 @@ begin begin j:=1; numAcc:=decodeur_pers[dp].Peripherique; + if numAcc>NbMaxi_Periph then + begin + Affiche('Erreur 54 : numéro de périphérique hors limite pour décodeur personnalisé '+intToSTR(dp),clred); + exit; + end; code_to_aspect(etat,aspect,combine); if combine=-1 then begin @@ -4700,6 +4678,11 @@ begin if decodeur_pers[dp].commande=1 then begin numAcc:=decodeur_pers[dp].Peripherique; + if numAcc>NbMaxi_Periph then + begin + Affiche('Erreur 55 : numéro de périphérique hors limite pour décodeur personnalisé '+intToSTR(dp),clred); + exit; + end; // trouver l'état dans le décodeur for j:=0 to 8 do begin // balayer les bits de 0 à 8 @@ -4939,13 +4922,13 @@ end; // pilotage des signaux procedure envoi_signauxCplx; -var i,signalCplx : integer; +var i,adr : integer; begin //Affiche('Envoi des signaux (envoi_signauxCplx)',ClGreen); for i:=1 to NbreFeux do begin - signalCplx:=feux[i].adresse; - if not(ferme) and (signalCplx<>0) then envoi_signal(signalCplx); + adr:=feux[i].adresse; + if not(ferme) and (adr<>0) then envoi_signal(adr); end; end; @@ -5088,7 +5071,7 @@ begin end else begin - Affiche('Erreur Signal '+intToSTR(adresse)+' inconnu',clred); + Affiche('Erreur 395 : Signal '+intToSTR(adresse)+' inconnu',clred); Verif_Unisemaf:=3; end; end; @@ -5974,13 +5957,6 @@ begin if (nivdebug>1) then Affichedebug('le port de destination du croisement '+intToSTR(aiguillage[index].adresse)+' est '+IntToSTR(adr)+a,clyellow); // Affiche('croisement '+intToSTR(prec)+' '+intToSTR(actuel),clLime); // mémoriser dans un tableau l'entrée et la sortie du croisement - if ncrois<20 then - begin - inc(ncrois); - croisement[ncrois].adresse:=aiguillage[index].adresse; - croisement[ncrois].entree:=prec; - croisement[ncrois].sortie:=adr; - end; exit; end; @@ -6586,20 +6562,20 @@ begin until dir=3; end; -// renvoie l'adresse des détecteurs précédents un signal après les aiguillages +// renvoie l'adresse des détecteurs convergents précédents un signal après les aiguillages // renvoie dans le tableau TabloDet procedure det_prec_signal(adresse : integer;var tabloDet : TTabloDet); var el1,el2,i,i2,index,it,voie : integer; tq1,tq2 : tEquipement; - // explore un aiguillage + // explore les connexions d'un aiguillage - récursif procedure explore_branche(prec,adrAig : integer); var i,el1,el2 : integer; c: char; typ : tEquipement; begin inc(it); - if it>20 then begin Affiche('Erreur 95',clred);exit;end; + if it>40 then begin Affiche('Erreur récursive 95',clred);exit;end; i:=index_aig(adrAig); typ:=aiguillage[i].modele; @@ -6814,6 +6790,7 @@ var el1,el2,i,i2,index,it,voie : integer; tabloDet[index]:=el2;inc(index); end; end; + if typ=aig then begin // pris en pointe? @@ -6831,7 +6808,8 @@ var el1,el2,i,i2,index,it,voie : integer; else begin //Affiche(IntToSTR(el2),clLime); - tabloDet[index]:=el2;inc(index); + tabloDet[index]:=el2; + inc(index); end; //Affiche('Aig'+inttostr(adraig)+' pointe dévié',clyellow); @@ -6846,7 +6824,8 @@ var el1,el2,i,i2,index,it,voie : integer; else begin //Affiche(IntToSTR(el2),clLime); - tabloDet[index]:=el2;inc(index); + tabloDet[index]:=el2; + inc(index); end; end else @@ -6870,8 +6849,8 @@ var el1,el2,i,i2,index,it,voie : integer; end; begin - // trouver élément avant le signal - for i:=1 to 10 do tabloDet[i]:=0; + // trouver éléments avant le signal + for i:=1 to Mtd do tabloDet[i]:=0; i:=index_signal(adresse); if i=0 then affiche('Erreur 842 : signal '+intToSTR(adresse)+' inconnu',clred); @@ -6909,12 +6888,14 @@ begin if el2<>0 then begin it:=0; + // élément avant le signal suivant:=suivant_alg3(el1,tq1,el2,det,0); //typeGen + // si aiguillage if (typeGen=aig) or (typeGen=tjd) or (typeGen=tjs) or (typeGen=triple) then explore_branche(el2,suivant); if typeGen=det then begin tabloDet[1]:=suivant;index:=2;end; end; end; - tabloDet[index]:=0; + if index<=Mtd then tabloDet[index]:=0 else Affiche('Dépassement TabloDet signal '+intToSTR(Adresse),clred); { for i:=1 to Index do begin @@ -7717,7 +7698,7 @@ begin prec:=actuel;TypePrec:=TypeActuel; actuel:=AdrSuiv;TypeActuel:=typeGen; - if idEl<20 then + if idElNbMemZone) or (prec=0) or (prec>NbMemZone) then + if (actuel=0) or (actuel>NbMaxDet) or (prec=0) or (prec>NbMaxDet) then begin // sortie si aucun détecteur déclaré sur le signal test_memoire_zones:=Pres_train; @@ -8255,7 +8236,7 @@ begin prec:=actuel;TypePrec:=TypeActuel; actuel:=AdrSuiv;TypeActuel:=typeGen; - if idEl<20 then + if idElNbMemZone then + if actuel>NbMaxDet then begin Affiche('Erreur 179 : détecteur '+intToSTR(actuel)+' trop élevé sur signal '+intToSTR(adresse),clred); result:=false; @@ -8421,7 +8402,7 @@ begin if (NivDebug=3) and MemZone[d,actuel].etat then AfficheDebug('Trouvé train '+intToSTR(AdrTr)+' sur mémoire de zone '+intToSTR(d)+','+intToSTR(actuel),clyellow); end; inc(k); - until (d=0) or (k=11); + until (d=0) or (k=Mtd); dernierdet:=actuel; j:=0; @@ -8538,7 +8519,7 @@ begin end; end; inc(k); - until (d=0) or (k=11); + until (d=0) or (k=Mtd); end else begin @@ -8704,7 +8685,6 @@ begin end; end; - if signalDebug=AdrFeu then begin AffSignal:=false;nivDebug:=0;end; if debug=3 then formprinc.Caption:=''; end; @@ -9408,7 +9388,7 @@ begin AdrSuiv:=detecteur_suivant_el(det1,det,det3,det,1); det4:=detecteur_suivant_EL(det3,det,AdrSuiv,det,1); //*** route validée *** - if (det16) or trouve; dec(j); //si début de démarrage train i - if trouve and (TrainZone[i].Nbre=0) and (det1NbMemZone then s:=s+inttostr(det2)+' '; - if det3>NbMemZone then s:=s+inttostr(det2)+' '; - if AdrSuiv>NbMemZone then s:=s+inttostr(det2); + if det2>NbMaxDet then s:=s+inttostr(det2)+' '; + if det3>NbMaxDet then s:=s+inttostr(det2)+' '; + if AdrSuiv>NbMaxDet then s:=s+inttostr(det2); Affiche(s,clred); end; @@ -9779,7 +9756,7 @@ begin begin event_det_tick[N_event_tick].train:=i; if TraceListe then AfficheDebug('La route est valide car les détecteurs '+intToSTR(det2)+' '+intToSTR(det3)+' sont contigus',couleur); - if (det1NbMemZone then s:=s+inttostr(det2)+' '; - if det3>NbMemZone then s:=s+inttostr(det2)+' '; - if AdrSuiv>NbMemZone then s:=s+inttostr(det2); + if det2>NbMaxDet then s:=s+inttostr(det2)+' '; + if det3>NbMaxDet then s:=s+inttostr(det2)+' '; + if AdrSuiv>NbMaxDet then s:=s+inttostr(det2); Affiche(s,clred); end; // stockage dans historique de zones sauf s'il est déja stocké @@ -9830,9 +9807,6 @@ begin TrainZone[i].Zone[n].det1:=det2; TrainZone[i].Zone[n].det2:=det3; TrainZone[i].Nbre:=n; - // zone suivante en prévision - det4:=detecteur_suivant_EL(det2,det,det3,det,1); - TrainPrevZone[i][1]:=det4; end; end; end; @@ -9890,7 +9864,7 @@ begin for i:=1 to N_trains do begin i2:=event_det_train[i].Suivant; - if i2>NbMemZone then begin AfficheDebug('Erreur 715 : détecteur '+intToSTR(i2)+' trop grand',clred);exit;end; + if i2>NbMaxDet then begin AfficheDebug('Erreur 715 : détecteur '+intToSTR(i2)+' trop grand',clred);exit;end; SuivOk:=event_det_train[i].Det[2].etat ; det_adj(det3); if (adj1=i2) or (adj2=i2) then @@ -9956,7 +9930,7 @@ begin if AdrPrec=0 then begin if TraceListe then Affiche('FD - Le signal '+IntToSTR(AdrFeu)+' est précédé d''un buttoir',clyellow); - if AdrDetFeuNbMaxi_Periph) or (numacc=0) then + begin + Affiche('Erreur 56 : numéro de périphérique hors limite pour PN '+intToSTR(i),clred); + exit; + end; v:=Tablo_periph[numacc].NumCom; // numéro de com if v=0 then exit; if Tablo_com_cde[numacc].PortOuvert then @@ -10163,12 +10142,17 @@ begin else Affiche('Envoi commande impossible ; COM'+intToSTR(v)+' non détecté',clred); end; +// ouvre le pn par port com usb procedure ouvre_pn_usb(i : integer); var v,cmd,numacc : integer; s : string; begin numacc:=Tablo_pn[i].AdresseFerme; // numéro d'accessoire - if numacc=0 then exit; + if (numAcc>NbMaxi_Periph) or (numacc=0) then + begin + Affiche('Erreur 57 : numéro de périphérique hors limite pour PN '+intToSTR(i),clred); + exit; + end; v:=Tablo_periph[numacc].NumCom; // numéro de com if v=0 then exit; if Tablo_com_cde[numacc].PortOuvert then @@ -10183,7 +10167,7 @@ begin else Affiche('Envoi commande impossible ; COM'+intToSTR(v)+' non détecté',clred); end; -// i = index tablo_pn +// ouvre le pn par socket i = index tablo_pn procedure ouvre_pn_socket(i : integer); var numacc,cmd : integer; s : string; @@ -10198,7 +10182,7 @@ begin Affiche('Envoie socket'+intToSTR(numacc)+' commande: '+s,clWhite); end; -// i = index tablo_pn +// ferme le pn par socket i = index tablo_pn procedure ferme_pn_socket(i : integer); var numacc,cmd : integer; s : string; @@ -10220,7 +10204,11 @@ var numacc,v,cmd : integer; s : string; begin numacc:=Tablo_actionneur[i].fonction; // numéro de périphérique - if numacc=0 then exit; + if (numAcc>NbMaxi_Periph) or (numacc=0) then + begin + Affiche('Erreur 58 : numéro de périphérique hors limite '+intToSTR(i),clred); + exit; + end; v:=Tablo_periph[numacc].NumCom; // numéro de com if v=0 then exit; if Tablo_com_cde[numacc].PortOuvert then @@ -10242,6 +10230,11 @@ var v,numacc : integer; begin v:=Tablo_actionneur[i].fonction; // numéro de périphérique numacc:=Tablo_periph[v].numComposant; //numéro de composant + if (numAcc>NbMaxi_Periph) or (numacc=0) then + begin + Affiche('Erreur 59 : numéro de périphérique hors limite',clred); + exit; + end; s:=Tablo_actionneur[i].trainDest; if Tablo_periph[numacc].cr then s:=s+#13; if numacc=1 then Formprinc.ClientSocketCde1.socket.SendText(s); @@ -10249,22 +10242,47 @@ begin if Tablo_periph[numacc].ScvVis then Affiche('Envoi socket '+s,clYellow); end; +// envoie un texte vers tous les clients, connectés au serveur signaux_complexes procedure envoi_serveur(s : string); var i : integer; begin - for i:=0 to Formprinc.serverSocket.Socket.ActiveConnections-1 do + with Formprinc.serverSocket.Socket do begin - if i<=10 then - if Liste_Clients[i].adresse<>'' then Formprinc.ServerSocket.Socket.connections[i].SendText(s); + for i:=0 to ActiveConnections-1 do + begin + if i<=IdClients then + if Liste_Clients[i].adresse<>'' then connections[i].SendText(s+#13); + end; end; end; +// test si "train" est dans la liste des trains combinés traincombine +// ex : TrainCombine='BB1542+CC6500' train='CC6500' renvoie vrai +function test_train_decl(TrainCombine,train: string) : boolean; +var i : integer; + trainUnique : string; + trouve : boolean; +begin + trouve:=false; + repeat + i:=pos('+',Traincombine); + if i<>0 then + begin + TrainUnique:=Copy(Traincombine,1,i-1); + delete(traincombine,1,i); + trouve:=trainUnique=train; + end + else trouve:=traincombine=train; + until (i=0) or trouve; + result:=trouve; +end; // traitement des évènements actionneurs (detecteurs aussi) // adr adr2 : pour mémoire de zone +// trainDecl : composé de X, d'un train ou de plusieurs, séparés par + procedure Event_act(adr,adr2,etat : integer;trainDecl : string); var typ,i,v,etatAct,Af,Ao,Access,sortie,dZ1F,dZ2F,dZ1O,dZ2O : integer; - s,st,trainDest : string; + sDecl,st,trainDest : string; fm,fd,adresseOk,etatvalide : boolean; Ts : TAccessoire; begin @@ -10287,8 +10305,8 @@ begin // 1 0 FD // 2 0 FD - fd:=(Ancien_actionneur[adr]>0) and (etat=0); // front descendant - fm:=(Ancien_actionneur[adr]<>etat) and (etat<>0); // front montant + fd:=(Ancien_actionneur[adr]>0) and (etat=0); // front descendant (FD) + fm:=(Ancien_actionneur[adr]<>etat) and (etat<>0); // front montant (FM) ancien_actionneur[adr]:=etat; if not(fd) and not(fm) then exit; @@ -10299,7 +10317,7 @@ begin // dans tableau des actionneurs for i:=1 to maxTablo_act do begin - s:=Tablo_actionneur[i].trainDecl; + sDecl:=Tablo_actionneur[i].trainDecl; etatAct:=Tablo_actionneur[i].etat ; // état à réagir etatValide:=((etatAct=etat) and fm) or ((etatAct=0) and fd); typ:=Tablo_actionneur[i].typdeclenche; // déclencheur: 0=actioneur/détecteur 2=evt aig 3=MemZone @@ -10307,26 +10325,26 @@ begin begin st:='Détecteur/actionneur '+intToSTR(adr); end; + if typ=2 then + begin + st:='Aiguillage '+intToSTR(adr); + end; if typ=3 then begin adresseok:=adresseOk and (Tablo_actionneur[i].adresse2=adr2); st:='Mémoire de zone '+intToSTR(adr)+' '+intToStr(adr2); end; - if typ=2 then - begin - st:='Aiguillage '+intToSTR(adr); - end; adresseok:=( ((Tablo_actionneur[i].adresse=adr) and (adr2=0) ) and ((typ=0) or (typ=2)) ) or ( ((Tablo_actionneur[i].adresse=adr) and (Tablo_actionneur[i].adresse2=adr2) ) and (typ=1) ); // actionneur pour fonction train - if adresseOk and (Tablo_actionneur[i].loco) and ((s=trainDecl) or (s='X') or (trainDecl='X') or (trainDecl='')) and (etatValide) then + if adresseOk and (Tablo_actionneur[i].loco) and ( test_train_decl(sDecl,trainDecl) or (sDecl='X') or (trainDecl='X') or (trainDecl='')) and (etatValide) then begin trainDest:=Tablo_actionneur[i].trainDest; // exécution de la fonction F vers CDM if (trainDest='X') or (trainDest='') then traindest:=traindecl; - if (trainDest='X') then traindest:=s; + //if (trainDest='X') then traindest:=sDecl; Affiche(st+' TrainDecl='+trainDecl+' TrainDest='+trainDest+' F'+IntToSTR(Tablo_actionneur[i].fonction)+':'+intToSTR(etat),clyellow); envoie_fonction_CDM(Tablo_actionneur[i].fonction,etat,trainDest); tablo_actionneur[i].TrainCourant:=trainDest; // pour mémoriser le train pour la retombée de la fonction @@ -10334,7 +10352,7 @@ begin end; // actionneur pour accessoire - if adresseOk and (Tablo_actionneur[i].act) and ((s=trainDecl) or (s='X') or (trainDecl='X') or (trainDecl='')) and (etatValide) then + if adresseOk and (Tablo_actionneur[i].act) and ( test_train_decl(sDecl,trainDecl) or (sDecl='X') or (trainDecl='X') or (trainDecl='')) and (etatValide) then begin access:=Tablo_actionneur[i].accessoire; sortie:=Tablo_actionneur[i].sortie; @@ -10346,7 +10364,7 @@ begin end; // actionneur pour son - if adresseOk and (Tablo_actionneur[i].Son) and ((s=trainDecl) or (s='X') or (trainDecl='X') or (trainDecl='')) and (etatValide) + if adresseOk and (Tablo_actionneur[i].Son) and ( test_train_decl(sDecl,trainDecl) or (sDecl='X') or (trainDecl='X') or (trainDecl='')) and (etatValide) then begin if typ<>2 then st:=st+' Train='+trainDecl; @@ -10355,7 +10373,7 @@ begin end; // commande COM/USB socket - if adresseOK and (Tablo_actionneur[i].periph) and ((s=trainDecl) or (s='X') or (trainDecl='X') or (trainDecl='')) and (etatValide) then + if adresseOK and (Tablo_actionneur[i].periph) and ( test_train_decl(sDecl,trainDecl) or (sDecl='X') or (trainDecl='X') or (trainDecl='')) and (etatValide) then begin trainDest:=Tablo_actionneur[i].trainDest; v:=tablo_actionneur[i].fonction; // numéro d'accessoire @@ -10363,7 +10381,6 @@ begin af:=com_socket(v); if af=1 then envoi_periph_usb(i); // numéro d'actionneur if af=2 then envoi_socket_periph_act(i); // numéro d'actionneur - end; end; @@ -10405,8 +10422,8 @@ begin inc(tablo_pn[i].compteur); if tablo_pn[i].compteur=1 then begin - s:='Fermeture PN'+IntToSTR(i)+' par act '+intToSTr(adr)+' (train voie '+IntToSTR(v)+')'; - Affiche(s,clOrange); + sDecl:='Fermeture PN'+IntToSTR(i)+' par act '+intToSTr(adr)+' (train voie '+IntToSTR(v)+')'; + Affiche(sDecl,clOrange); if tablo_pn[i].TypeCde=0 then begin if Tablo_PN[i].pulse=1 then ts:=aigP else ts:=feu; @@ -10438,8 +10455,8 @@ begin begin if Tablo_PN[i].compteur=1 then begin - s:='Ouverture PN'+intToSTR(i)+' par zone '+intToSTr(adr)+' '+intToSTR(adr2); - Affiche(s,clorange); + sDecl:='Ouverture PN'+intToSTR(i)+' par zone '+intToSTr(adr)+' '+intToSTR(adr2); + Affiche(sDecl,clorange); //if AffAigDet then AfficheDebug(s,clorange); if tablo_pn[i].TypeCde=0 then begin @@ -10462,8 +10479,8 @@ begin inc(Tablo_PN[i].compteur); if tablo_pn[i].compteur=1 then begin - s:='Fermeture PN'+IntToSTR(i)+' par zone '+intToSTr(adr)+' '+intToSTR(adr2)+' (train voie '+IntToSTR(v)+')'; - affiche(s,clorange); + sDecl:='Fermeture PN'+IntToSTR(i)+' par zone '+intToSTr(adr)+' '+intToSTR(adr2)+' (train voie '+IntToSTR(v)+')'; + affiche(sDecl,clorange); if tablo_pn[i].TypeCde=0 then begin if Tablo_PN[i].pulse=1 then ts:=aigP else ts:=feu; @@ -10486,7 +10503,7 @@ begin if (adr>650) then for i:=1 to NbPeriph do begin - s:='A'+intToSTR(adr)+','+intToSTR(etat)+','+trainDecl; + sDecl:='A'+intToSTR(adr)+','+intToSTR(etat)+','+trainDecl; if Tablo_periph[i].ScvAct then begin v:=com_socket(i); @@ -10494,29 +10511,27 @@ begin begin if tablo_com_cde[i].portOuvert then begin - if Tablo_periph[i].ScvVis then Affiche(s,clWhite); - if Tablo_periph[i].cr then s:=s+#13; + if Tablo_periph[i].ScvVis then Affiche(sDecl,clWhite); + if Tablo_periph[i].cr then sDecl:=sDecl+#13; typ:=Tablo_periph[i].numComposant; - if typ=1 then Formprinc.MSCommCde1.Output:=s; - if typ=2 then Formprinc.MSCommCde2.Output:=s; + if typ=1 then Formprinc.MSCommCde1.Output:=sDecl; + if typ=2 then Formprinc.MSCommCde2.Output:=sDecl; end; end; if v=2 then begin - if Tablo_periph[i].ScvVis then Affiche(s,clWhite); - if Tablo_periph[i].cr then s:=s+#13; + if Tablo_periph[i].ScvVis then Affiche(sDecl,clWhite); + if Tablo_periph[i].cr then sDecl:=sDecl+#13; typ:=Tablo_periph[i].numComposant; - if typ=1 then Formprinc.ClientSocketCde1.Socket.SendText(s); - if typ=2 then Formprinc.ClientSocketCde2.Socket.SendText(s); + if typ=1 then Formprinc.ClientSocketCde1.Socket.SendText(sDecl); + if typ=2 then Formprinc.ClientSocketCde2.Socket.SendText(sDecl); end; end; end; // Serveur envoi au clients Envoi_serveur('A'+intToSTR(adr)+','+intToSTR(etat)+','+trainDecl); - - end; Procedure affiche_memoire; @@ -10539,7 +10554,7 @@ var dr,i,AdrSuiv,AdrFeu,AdrDetfeu,index,Etat01,AdrPrec : integer; typeSuiv : tequipement; s : string; begin - if adresse>NbMemZone then + if adresse>NbMaxDet then begin Affiche('Erreur 82 : reçu adresse de détecteur trop grande : '+intToSTR(adresse),clred); exit; @@ -10997,25 +11012,27 @@ end; // le décodage de la rétro est appelé sur une réception d'une trame de la rétrosignalisation de la centrale. // On déclenche ensuite les évènements détecteurs ou aiguillages. -// modeStkRetro=false = stockage sur changement d'état, et génère évènement détecteur -// true = stockage de l'état sans évènement +// valeur = ITTN ZZZZ +// var globale modeStkRetro=false = stockage sur changement d'état, et génère évènement détecteur +// true = stockage de l'état sans évènement procedure decode_retro_XpressNet(adresse,valeur : integer); var s : string; - adraig,bitsITT,i : integer; + adraig,bitsTT,i,n : integer; etat : boolean; begin //afficheDebug(IntToSTR(adresse)+' '+intToSTR(valeur),clorange); - bitsITT:=valeur and $40; + bitsTT:=valeur and $60; // 0110 0000 + n:=valeur and $10; // bit à 010X XXXX = c'est un module de rétrosignalisation (pas un aiguillage) // doc LENZ Xpressnet protocol description page 31 detecteur_chgt:=0; - // ---------- Cas N=1 - if (valeur and $10)=$10 then // si bit N=1, les 4 bits de poids faible sont les 4 bits de poids fort du décodeur + // ---------- Cas N=1, les 4 bits de poids faible sont les 4 bits de poids fort du décodeur + if n=$10 then begin // détermine le détecteur qui a changé d'état // -------état du détecteur - if bitsITT=$40 then // module de rétro = détecteur + if bitsTT and $40=$40 then // TT=10 l'adresse est un module de rétro = détecteur begin // affecter l'état des détecteurs i:=adresse*8+8; @@ -11054,7 +11071,7 @@ begin end; // état de l'aiguillage - if bitsITT=$00 then // module d'aiguillages, N=1 + if (bitsTT=$00) or (bitsTT=$20) then // TT=00 ou TT=01 l'adresse est un décodeur d'accessoires sans(TT=00)/avec(TT=01) rétrosignalisation, avec N=1 begin adraig:=((adresse * 4)+1 ); // *4 car N=1, c'est le "poids fort" if (valeur and $C)=$8 then @@ -11084,10 +11101,10 @@ begin end; // ---------- Cas N=0 - if (valeur and $10)=$00 then // si bit N=0, les 4 bits de poids faible sont les 4 bits de poids faible du décodeur + if n=0 then // si bit N=0, les 4 bits de poids faible sont les 4 bits de poids faible du décodeur begin //Affiche('N=0',clYellow); - if bitsITT=$40 then // module de rétro + if (bitsTT and $40)=$40 then // TT=10 l'adresse est un module de rétro = détecteur avec N=0 begin // affecter l'état des détecteurs i:=adresse*8+4; @@ -11122,9 +11139,9 @@ begin end; if modeStkRetro then detecteur[i].etat:=etat; retEtatDet:=true; // marqueur "reçu état détecteur" - end; - if bitsITT=$00 then // module d'aiguillages + + if (bitsTT=$00) or (bitsTT=$20) then // TT=00 ou TT=01 l'adresse est un décodeur d'accessoires sans(TT=00)/avec(TT=01) rétrosignalisation, avec N=0 begin adraig:=(adresse * 4)+1; if (valeur and $C)=$8 then @@ -11593,7 +11610,7 @@ begin exit; end; - //E3 40 ah al A0 + // E3 40 ah al A0 if chaineInt[1]=#$E3 then begin // la loco ah al est pilotée par le PC @@ -11801,12 +11818,16 @@ begin end; // connecte un port usb pour la comm périphériques. Si le port n'est pas ouvert, renvoie false -// index= index du tableau tablo_com_cde function connecte_port_usb_periph(index : integer) : boolean; var i,j,nc,numport,vitesse,erreur : integer; s,sc,portComCde : string; com : TMSComm; begin + if (index>NbMaxi_Periph) or (index=0) then + begin + Affiche('Erreur 60 : numéro de périphérique hors limite '+intToSTR(index),clred); + exit; + end; numport:=Tablo_periph[index].NumCom; if (numport<1) or (numport>255) then begin @@ -11876,13 +11897,15 @@ begin end; // détermine si le périphérique i est un comusb ou un socket +// =0 erreur // =1 comusb // =2 socket -// i = index de Tablo_acc_ComUSB function com_socket(i : integer) : integer; var s : string; begin result:=0; + if i>NbMaxi_Periph then exit; + s:=Tablo_periph[i].protocole; if length(s)>1 then if upcase(s[1])='C' then result:=1 else result:=2; end; @@ -11921,7 +11944,6 @@ begin val(s,i,erreur); com.port:=i; com.open; -// Affiche('Demande d''ouverture du socket '+tablo_acc_comusb[index].protocole,clYellow); result:=true; end; @@ -12245,7 +12267,7 @@ begin s:=''; if lay<>'' then s:='-f '+lay; // lay - s:=s+' -s COMIPC'; // démarre serveur comipc + if not(serveurIPCDM_Touche) then s:=s+' -COMIPC'; // démarre serveur comipc cdm_lanceLoc:=false; // lancement depuis le répertoire 32 bits d'un OS64 @@ -12275,34 +12297,38 @@ begin // On a lancé CDM, déconnecter l'USB deconnecte_USB; Affiche('Lance les fonctions automatiques de CDM',clyellow); - Sleep(2000); // attend le lancement de CDM + SetForegroundWindow(formprinc.Handle); // met SC devant + Sleep(1500); // attend le lancement de CDM + if serveurIPCDM_touche then sleep(1000); ProcessRunning(s); // récupérer le handle de CDM SetForegroundWindow(CDMhd); // met CDM en premier plan pour le télécommander par le clavier simulé + SetActiveWindow(CdmHd); Application.ProcessMessages; + if serveurIPCDM_Touche then sleep(1000); - { - // démarre le serveur IP : il faut avoir chargé un réseau sinon le permier menu est fermé------------------------------------ - // prépare le tableau pour sendinput - KeybdInput(VK_MENU,0); // enfonce Alt - KeybdInput(Ord('C'),0); // enfonce C - KeybdInput(Ord('C'),KEYEVENTF_KEYUP); // relache C pointe premier menu "Configuration train" + if serveurIPCDM_Touche then + begin + // démarre le serveur IP : il faut avoir chargé un réseau sinon le permier menu est fermé------------------------------------ + // prépare le tableau pour sendinput + KeybdInput(VK_MENU,0); // enfonce Alt + KeybdInput(Ord('C'),0); // enfonce C + KeybdInput(Ord('C'),KEYEVENTF_KEYUP); // relache C pointe premier menu "Configuration train" - KeybdInput(VK_MENU,KEYEVENTF_KEYUP); // relache ALT + KeybdInput(VK_MENU,KEYEVENTF_KEYUP); // relache ALT - KeybdInput(Ord('C'),0); - KeybdInput(Ord('C'),KEYEVENTF_KEYUP); // pointe sur 2eme menu "comm ip" + KeybdInput(Ord('C'),0); + KeybdInput(Ord('C'),KEYEVENTF_KEYUP); // pointe sur 2eme menu "comm ip" - KeybdInput(VK_RETURN,0); // valide démarrer comm ip - KeybdInput(VK_RETURN,KEYEVENTF_KEYUP); - KeybdInput(VK_RETURN,0); - KeybdInput(VK_RETURN,KEYEVENTF_KEYUP); - - // envoie les touches - i:=SendInput(Length(KeyInputs),KeyInputs[0],SizeOf(KeyInputs[0]));SetLength(KeyInputs,0); // la fenetre serveur démarré est affichée - Sleep(300); - Application.ProcessMessages; - } + KeybdInput(VK_RETURN,0); // valide démarrer comm ip + KeybdInput(VK_RETURN,KEYEVENTF_KEYUP); + KeybdInput(VK_RETURN,0); + KeybdInput(VK_RETURN,KEYEVENTF_KEYUP); + // envoie les touches + i:=SendInput(Length(KeyInputs),KeyInputs[0],SizeOf(KeyInputs[0]));SetLength(KeyInputs,0); // la fenetre serveur démarré est affichée + Sleep(400); + Application.ProcessMessages; + end; KeybdInput(VK_RETURN,0); KeybdInput(VK_RETURN,KEYEVENTF_KEYUP); SendInput(Length(KeyInputs),KeyInputs[0],SizeOf(KeyInputs[0]));SetLength(KeyInputs,0); //fermer la fenetre @@ -12328,7 +12354,7 @@ begin KeybdInput(VK_RETURN,0); KeybdInput(VK_RETURN,KEYEVENTF_KEYUP); SendInput(Length(KeyInputs), KeyInputs[0], SizeOf(KeyInputs[0]));SetLength(KeyInputs,0); // affiche la fenetre d'interface - Sleep(300); + Sleep(400); // descendre le curseur n fois pour sélectionner le serveur for i:=1 to ServeurInterfaceCDM-1 do @@ -12341,8 +12367,8 @@ begin KeybdInput(VK_TAB,0);KeybdInput(VK_TAB,KEYEVENTF_KEYUP); KeybdInput(VK_SPACE,0);KeybdInput(VK_SPACE,KEYEVENTF_KEYUP); SendInput(Length(KeyInputs), KeyInputs[0], SizeOf(KeyInputs[0]));SetLength(KeyInputs,0); - Sleep(200); - + Sleep(400); + // Interface if (ServeurInterfaceCDM=1) or (ServeurInterfaceCDM=7) then begin @@ -12357,7 +12383,7 @@ begin KeybdInput(VK_SPACE,0);KeybdInput(VK_SPACE,KEYEVENTF_KEYUP); // valide la fenetre d'interface SendInput(Length(KeyInputs), KeyInputs[0], SizeOf(KeyInputs[0]));SetLength(KeyInputs,0); - Sleep(200); + Sleep(400); KeybdInput(VK_RETURN,0);KeybdInput(VK_RETURN, KEYEVENTF_KEYUP); // valide la fenetre finale SendInput(Length(KeyInputs), KeyInputs[0], SizeOf(KeyInputs[0]));SetLength(KeyInputs,0); end; @@ -12392,7 +12418,7 @@ begin event_det_tick[i].etat:=-1; event_det_tick[i].reaffecte:=0 ; end; - for i:=1 to NbMemZone do + for i:=1 to NbMaxDet do begin detecteur[i].etat:=false; detecteur[i].train:=''; @@ -12400,8 +12426,8 @@ begin detecteur[i].IndexTrain:=0; ancien_detecteur[i]:=false; end; - for i:=1 to NbMemZone do - for j:=1 to NbMemZone do + for i:=1 to NbMaxDet do + for j:=1 to NbMaxDet do begin MemZone[i,j].etat:=false; MemZone[i,j].train:=''; @@ -12656,7 +12682,7 @@ end; // démarrage principal du programme signaux_complexes procedure TFormPrinc.FormCreate(Sender: TObject); -var t,i,index,OrgMilieu : integer; +var n,t,i,index,OrgMilieu : integer; s : string; begin AF:='Client TCP-IP CDM Rail ou USB - système XpressNet DCC++ Version '+Version+sousVersion; @@ -12697,7 +12723,7 @@ begin ScrollBox1.Left:=633; procetape(''); //0 - NbreTCO:=1; + NbreTCO:=0; N_Trains:=0; NivDebug:=0; ncrois:=0; @@ -12722,6 +12748,7 @@ begin avecRoulage:=0; formatY:=-1; avecResa:=false; // réservation des aiguillages en mode normal + serveurIPCDM_Touche:=false; AvecInit:=true; // &&&& avec initialisation des aiguillages ou pas Diffusion:=AvecInit; // mode diffusion publique + debug mise au point etc ButtonIndex.Visible:=not(avecInit); @@ -12751,7 +12778,6 @@ begin if OsBits=64 then s:='OS 64 Bits' else s:='OS 32 Bits'; s:=DateToStr(date)+' '+TimeToStr(Time)+' '+s; Affiche(s,clLime); - LabelEtat.Caption:='Initialisations en cours'; With ScrollBox1 do begin @@ -12772,13 +12798,13 @@ begin NumTrameCDM:=0; protocole:=1; procetape(''); //1 - for i:=1 to NbMemZone do + for i:=1 to NbMaxDet do begin Ancien_detecteur[i]:=false; detecteur[i].etat:=false; detecteur[i].train:=''; end; - for i:=0 to 10 do + for i:=0 to IdClients do begin Liste_clients[i].adresse:=''; Liste_Clients[i].PortLocal:=0; @@ -12838,7 +12864,9 @@ begin if debug=1 then Affiche('Création TCO',clLime); // il faut afficher la fenetre TCO pour l'init aiguillage sinon violation - for i:=0 to Screen.MonitorCount-1 do + n:=Screen.MonitorCount-1; + if n>9 then n:=9; + for i:=0 to n do begin //Affiche('Ecran '+intToSTR(i),clyellow); ecran[i+1].x0:=Screen.Monitors[i].BoundsRect.Left; @@ -12967,7 +12995,6 @@ begin // ouvre périphériques commandes actionneurs, car on a lu les com dans la config for i:=1 to NbPeriph do begin - //index:=tablo_acc_comUSB[i].NumAcc; // numéro d'accessoire index:=com_socket(i); // comusb ou socket ? if index=1 then begin @@ -12990,7 +13017,6 @@ begin NombreImages:=0; //Affiche('Fin des initialisations',clyellow); - LabelEtat.Caption:=' '; Affiche_memoire; modeStkRetro:=false; @@ -13057,7 +13083,6 @@ begin procetape('demande etats accessoires'); demande_etat_acc; // demande l'état des accessoires (position des aiguillages) end; - LabelEtat.Caption:=' '; //Menu_interface(valide); end; @@ -13500,7 +13525,7 @@ begin end; // temporisation détecteur à 0 - for i:=1 to NbMemZone do // i=index détecteur + for i:=1 to NbMaxDet do // i=index détecteur begin a:=detecteur[i].tempo0; if a<>0 then @@ -13742,6 +13767,11 @@ end; procedure deconnecte_usb_periph(index : integer); begin + if (index>NbMaxi_Periph) or (index=0) then + begin + Affiche('Erreur 61 : numéro de périphérique hors limite ',clred); + exit; + end; if tablo_com_cde[index].PortOuvert then begin tablo_com_cde[index].PortOuvert:=false; @@ -13756,6 +13786,11 @@ end; // déconnecte le périphérique socket procedure deconnecte_socket_periph(index : integer); begin + if (index>NbMaxi_Periph) or (index=0) then + begin + Affiche('Erreur 62 : numéro de périphérique hors limite ',clred); + exit; + end; if tablo_com_cde[index].PortOuvert then begin tablo_com_cde[index].PortOuvert:=false; @@ -13967,7 +14002,6 @@ begin procetape('demande etats accessoires'); demande_etat_acc; // demande l'état des accessoires (position des aiguillages) end; - LabelEtat.Caption:=' '; end; end; if not(trouve) then ClientSocketInterface.Close; @@ -14157,7 +14191,7 @@ begin begin ss:=copy(commandeCDM,i+5,l-i-5); val(ss,trains_cdm[ntrains_cdm].vitmax,erreur); - //s:='AD='+IntToSTR(adr); + //s:='AD='+IntToSTR(adr)f; Delete(commandeCDM,i,l-i+1); end; end; @@ -14445,7 +14479,7 @@ begin end; if AffAigDet then - AfficheDebug('Actionneur AD='+intToSTR(adr)+' Nom='+intToSTR(name)+' Train='+train+' Etat='+IntToSTR(etat),clyellow); + AfficheDebug('Actionneur AD='+intToSTR(adr)+' Nom='+nom+' Train='+train+' Etat='+IntToSTR(etat),clyellow); Event_act(adr,0,etat,train); // déclenche évent actionneur end; @@ -14785,7 +14819,7 @@ begin s:=s+IntToSTR(d)+' '; end; inc(k); - until (d=0) or (k=11); + until (d=0) or (k=Mtd); end @@ -15228,7 +15262,6 @@ begin s:=s+' index='+intToSTR(i); s:=s+' '+intToSTR(TrainZone[train].Zone[i].det1); s:=s+' '+intToSTR(TrainZone[train].Zone[i].det2); - if i=n then s:=s+' Prev='+intToSTR(TrainPrevZone[train][1]); couleur:=((train - 1) mod NbCouleurTrain) +1; Affiche(s,CouleurTrain[couleur]); end; @@ -15245,9 +15278,9 @@ begin rien:=false; end; inc(j); - until (j>NbMemZone); + until (j>NbMaxDet); inc(i); - until (i>NbMemZone); + until (i>NbMaxDet); Affiche('Derniers éléments scannés:',clWhite); for i:=1 to idEl do @@ -15332,7 +15365,7 @@ begin Affiche(' ',clyellow); end; -// cliqué droit sur un feu puis sur le menu propriétés +// cliqué droit sur un signal puis sur le menu propriétés procedure TFormPrinc.Proprits1Click(Sender: TObject); var s: string; begin @@ -15787,6 +15820,7 @@ begin // requete 2 pour les com sur usb FWbemObjectSet:=FWMIService.ExecQuery('SELECT * FROM Win32_PnPEntity WHERE ConfigManagerErrorCode = 0','WQL',wbemFlagForwardOnly); // retourne les infos des ports série + oEnum:=IUnknown(FWbemObjectSet._NewEnum) as IEnumVariant; i:=0; while oEnum.Next(1,FWbemObject,iValue)=0 do @@ -15803,11 +15837,11 @@ end; procedure liste_portcom ; begin try - CoInitialize(nil); + CoInitialize(nil); // on va utiliser Ole try - GetWin32_SerialPortInfo; + GetWin32_SerialPortInfo; // chercher les ports com avec Ole finally - CoUninitialize; + CoUninitialize; // on a fini d'utiliser Ole end; except @@ -15815,7 +15849,7 @@ begin Affiche(Format('EOleException %s %x', [E.Message,E.ErrorCode]),clyellow); on E:Exception do Affiche(E.Classname+ ':'+ E.Message,clyellow); - end; + end; end; procedure TFormPrinc.Evenementsdetecteurspartrain1Click(Sender: TObject); @@ -15907,12 +15941,11 @@ begin end; procedure TFormPrinc.PopupMenuFeuPopup(Sender: TObject); -var s : string; - ob : TPopupMenu; +var ob : TPopupMenu; begin // AdrPilote est récupéré de l'event OnMouseDown de l'image du signal qui se produit avant + if Affevt then Affiche('PopupMenuFeu',clYellow); ob:=Sender as Tpopupmenu; - s:=ob.Items[0].Caption; ob.Items[0].Caption:='Propriétés du signal '+intToSTR(AdrPilote); ob.Items[1].Caption:='Informations du signal '+intToSTR(AdrPilote); end; @@ -15931,8 +15964,7 @@ begin if V_utile=V_publie then Affiche('Votre version '+Version+SousVersion+' publiée le '+date_creation+' est à jour',clLime); if V_utile>V_publie then Affiche('Votre version '+version+SousVersion+' est plus récente que la version publiée '+s,clLime); end - else Affiche('Site github.com inatteignable - réessayer plus tard',clred); -end; +end; procedure TFormPrinc.Analyser1Click(Sender: TObject); var s1,s2 : string; @@ -16039,6 +16071,7 @@ begin end; NombreEcrans:=Screen.MonitorCount; + if NombreEcrans>10 then NombreEcrans:=10; if NombreEcrans=1 then NbTCOE[1]:=NbreTCO; for i:=1 to NbreTCO do @@ -16092,14 +16125,13 @@ begin end; NombreEcrans:=Screen.MonitorCount; + if NombreEcrans>10 then NombreEcrans:=10; if NombreEcrans=1 then NbTCOE[1]:=NbreTCO; for i:=1 to NbreTCO do begin - for e:=1 to NombreEcrans do begin - if (ecranTCO[i]=e) or (NombreEcrans=1) then // si l'écran TCO doit aller sur e begin inc(CeTCO[e]); @@ -16316,6 +16348,7 @@ var e : integer; begin if (i<1) or (i>NbreTCO) then exit; e:=ecranTCO[i]; + if e>10 then e:=10; if e>Screen.MonitorCount then e:=1; formTCO[i].show; // on est obligé d'afficher la fenetre TCO pour provoquer OnActivate pour valider les pointeurs @@ -16971,7 +17004,6 @@ var s : string; begin s:=ClientSocketCde1.Socket.ReceiveText; if not(telecommande(s)) then Affiche(s,clWhite); - end; procedure TFormPrinc.ClientSocketCde2Connect(Sender: TObject;Socket: TCustomWinSocket); @@ -17027,7 +17059,7 @@ procedure TFormPrinc.ServerSocketAccept(Sender: TObject; var n : integer; begin n:=serverSocket.Socket.ActiveConnections; - if n<=10 then + if n<=IdClients then begin Liste_clients[n-1].Adresse:=Socket.remoteAddress; Liste_clients[n-1].PortLocal:=Socket.LocalPort; @@ -17049,7 +17081,7 @@ end; procedure TFormPrinc.ServerSocketClientDisconnect(Sender: TObject; Socket: TCustomWinSocket); var n : integer; begin - for n:=0 to 10 do + for n:=0 to IdClients do begin if (Liste_clients[n].adresse=socket.remoteAddress) and (Liste_clients[n].portDistant=socket.remotePort) and (Liste_clients[n].portLocal=socket.LocalPort) then begin @@ -17063,7 +17095,7 @@ procedure TFormPrinc.Listedesclientsconnects1Click(Sender: TObject); var i,n : integer; begin n:=0; - for i:=0 to 10 do + for i:=0 to IdClients do begin if Liste_clients[n].adresse<>'' then begin diff --git a/UnitTCO.pas b/UnitTCO.pas index 8757c47..f4a6c79 100644 --- a/UnitTCO.pas +++ b/UnitTCO.pas @@ -8417,12 +8417,12 @@ begin i:=index_aig(adresse); AdrTr:=aiguillage[i].AdrTrain; typ:=aiguillage[i].modele; - + if AdrTr=0 then begin Brush.Color:=tco[indextco,x,y].CouleurFond; //SetBkMode(PCanvasTCO[indexTCO].Handle,TRANSPARENT); - s:=s+' '; // efface l'adresse de réservation + if avecRESA or roulage then s:=s+' '; // efface l'adresse de réservation end else begin @@ -8573,7 +8573,7 @@ begin else begin xt:=round(2*frxGlob[indexTCO]);yt:=round(1*fryGlob[indexTCO]);end; end; end; - if (aspect=9) and (Oriente=1) then begin xt:=LargeurCell[indexTCO]-round(25*frxGlob[indexTCO]);yt:=2*hauteurCell[indexTCO]-round(25*fryGlob[indexTCO]);end; + if (aspect=9) and (Oriente=1) then begin xt:=LargeurCell[indexTCO]-round(25*frxGlob[indexTCO]);yt:=round(60*fryGlob[indexTCO]);end; if (aspect=9) and (Oriente=2) then begin xt:=round(10*frxGlob[indexTCO]);yt:=hauteurCell[indexTCO]-round(17*fryGlob[indexTCO]);end; // orientation G if (aspect=9) and (Oriente=3) then begin xt:=LargeurCell[indexTCO]+round(25*frxGlob[indexTCO]);yt:=1;end; if (aspect=9) and (Oriente=4) and (pied=1) then begin xt:=round(2*frxGlob[indexTCO]);yt:=round(10*frYGlob[indexTCO]);end; @@ -8627,8 +8627,6 @@ begin TextOut(xOrg+xt,yOrg+yt,s); end; end; - - //if AvecGrille entoure_cell_grille(x,y); // grille devant end; @@ -8684,8 +8682,6 @@ begin end; end; - - // affiche le tco suivant le tableau TCO procedure Affiche_TCO(indexTCO : integer) ; var x,y,x1,y1,DimX,DimY : integer; @@ -8790,7 +8786,6 @@ begin if entoure[indexTCO] then Entoure_cell(indexTCO,Xentoure[indexTCO],Yentoure[indexTCO]); if rect_select.NumTCO<>0 then Affiche_Rectangle(IndexTCO,Rect_select); if selectionaffichee[indexTCO] then Affiche_selection(indexTCO); - end; @@ -8822,7 +8817,7 @@ begin xMiniSel:=99999;yMiniSel:=99999; xMaxiSel:=0;yMaxiSel:=0; SelectionAffichee[indexTCOCreate]:=false; -// ImageTCO.Canvas.font.Name:='Arial'; <--- peut générer exception out of ressource!! + //ImageTCO.Canvas.font.Name:='Arial'; //<--- peut générer exception out of ressource!! clTexte:=ClLime; // évite le clignotement pendant les affichages mais ne marche pas //DoubleBuffered:=true; @@ -10721,7 +10716,6 @@ begin {initalisation des dimensions du tco - à ne faire qu'une fois} if not(Forminit[indexTCO]) then begin - Button1.Visible:=not(Diffusion); Button2.Visible:=not(Diffusion); ButtonCalibrage.Visible:=not(diffusion); @@ -11799,10 +11793,9 @@ begin Annule(indexTCO); end; -// renvoie un élément du TCO par l'icone en fonction des 4 tracés désirés +// renvoie une icone en fonction des 4 tracés désirés // exemple : deux lignes qui se croisent renvoie un croisement // el = élement à remplacer -// Bim = élément d'origine // quadrant des 4 tracés (2=NE 3=Est 4=SE 5=S ) // premier : si c'est le premier élément du tracé // dernier : si c'est le dernier élément du tracé @@ -12769,7 +12762,7 @@ end; // affiche les cellules des tco dont l'adresse d'aiguillage est adresse Procedure Texte_aig_fond(adresse : integer); -var ntco,i,x,y,Bim : integer; +var ntco,x,y,Bim : integer; begin for ntco:=1 to NbreTCO do begin @@ -12789,9 +12782,6 @@ begin end; end; - - - procedure TFormTCO.Button1Click(Sender: TObject); begin Detecteur[569].etat:=true; @@ -12804,7 +12794,6 @@ begin Maj_tco(index_TCO(sender),569); end; - procedure TFormTCO.ImagePalette10EndDrag(Sender, Target: TObject; X, Y: Integer); begin end_drag(10,x,y,Sender,Target); diff --git a/Unitplace.pas b/Unitplace.pas index 01ac41c..13e8f0c 100644 --- a/Unitplace.pas +++ b/Unitplace.pas @@ -142,7 +142,7 @@ begin end; raz_tout; - for detect:=1 to NbMemZone do + for detect:=1 to NbMaxDet do begin detecteur[detect].train:=''; detecteur[detect].AdrTrain:=0; @@ -167,7 +167,7 @@ begin val(s,detect,erreur); val(Ssuiv,Suiv,erreur); NomTrain:=trains[i].nom_train; - if (detect>NbMemZone )then LabelTexte.caption:='Erreur détecteur train '+intToSTR(i); + if (detect>NbMaxDet )then LabelTexte.caption:='Erreur détecteur train '+intToSTR(i); if detect<>0 then begin prec:=det_suiv_cont(Suiv,detect,1); // détecteur précédent (d'ou vient la loco) arret sur suivant diff --git a/verif_version.pas b/verif_version.pas index bdb71bc..433b0cf 100644 --- a/verif_version.pas +++ b/verif_version.pas @@ -25,7 +25,7 @@ var verifVersion,notificationVersion : boolean; date_creation,nombre_tel : string; -Const Version='8.3'; // sert à la comparaison de la version publiée +Const Version='8.32'; // sert à la comparaison de la version publiée SousVersion=' '; // A B C ... en cas d'absence de sous version mettre un espace function GetCurrentProcessEnvVar(const VariableName: string): string; @@ -84,6 +84,7 @@ begin i:=getLastError; if i<>0 then case i of + 12007 : Affiche('Erreur de résolution DNS',clred); 12037 : Affiche('Erreur validité de certificat',clred); 12157 : Affiche('Erreur canal sécurisé SSL 2.0',clred); else affiche('Erreur '+intToSTR(i),clred); @@ -114,6 +115,7 @@ begin end; // renvoie le numéro de version depuis le site github +// si 0 function verifie_version : real; var description,s,s2,s3,Version_p,Url,LocalFile,nomfichier,date_creation_ang : string; @@ -228,7 +230,7 @@ begin //description:=utf8Decode(description); i:=1 ; j:=1; // couper en chaînes - repeat + repeat j:=pos('\r',description); if j<>0 then begin @@ -248,7 +250,7 @@ begin // ncomm:=i; comm[i]:=supprime_anti(description); - + end; end; @@ -322,14 +324,16 @@ begin result:=V_publie; end else - affiche('Le dépôt github ne comprend aucune version diffusée.',clOrange); - + begin + result:=-1; + affiche('Le dépôt github ne comprend aucune version diffusée.',clOrange); + end; end else - begin - result:=0; - if notificationVersion then Affiche('Pas d''accès au site github.com ou échec téléchargement',clorange); - end; + begin + result:=0; + Affiche('Pas d''accès au site github.com ou échec téléchargement',clorange); + end; end; diff --git a/versions.txt b/versions.txt index 371eb62..a324da3 100644 --- a/versions.txt +++ b/versions.txt @@ -210,4 +210,6 @@ version 8.3 : Possibilit Création d'un mode sélectionnable de réservation des aiguillages par les trains. Création d'un serveur de données socket pour la transmission des évènements. Possibilité de télécommander Signaux_Complexes depuis les périphériques ou le serveur socket. - +version 8.31 : Correction d'un bug sur les détecteurs amonts des signaux. +version 8.32 : Un actionneur seul peut être déclenché par plusieurs trains. + Correction du lancement du serveur COM-IP pour CDMRail V20.12