diff --git a/Notice d'utilisation des signaux_complexes_GL_V8.24.pdf b/Notice d'utilisation des signaux_complexes_GL_V8.25.pdf similarity index 74% rename from Notice d'utilisation des signaux_complexes_GL_V8.24.pdf rename to Notice d'utilisation des signaux_complexes_GL_V8.25.pdf index ffafd27..dea2bfb 100644 Binary files a/Notice d'utilisation des signaux_complexes_GL_V8.24.pdf and b/Notice d'utilisation des signaux_complexes_GL_V8.25.pdf differ 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 c53d8d5..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 @@ -109,7 +109,7 @@ DebugCWD= IncludeVerInfo=1 AutoIncBuild=0 MajorVer=8 -MinorVer=1 +MinorVer=24 Release=0 Build=5 Debug=0 @@ -122,7 +122,7 @@ CodePage=1252 [Version Info Keys] CompanyName=F1IWQ FileDescription=Signaux complexes -FileVersion=8.1.0.5 +FileVersion=8.24.0.5 InternalName= LegalCopyright=2023 F1IWQ LegalTrademarks= diff --git a/Signaux_complexes_GL.map b/Signaux_complexes_GL.map index da5ce6a..603b65e 100644 --- a/Signaux_complexes_GL.map +++ b/Signaux_complexes_GL.map @@ -1,104 +1,104 @@ Start Length Name Class - 0001:00000000 0018EDC8H .text CODE + 0001:00000000 00166354H .text CODE 0002:00000000 00002C10H .data DATA - 0002:00002C10 041C8A05H .bss BSS + 0002:00002C10 041C8BF9H .bss BSS Detailed map of segments - 0001:00000000 00005E33 C=CODE S=.text G=(none) M=System ACBP=A9 - 0001:00005E34 00000140 C=CODE S=.text G=(none) M=SysInit ACBP=A9 - 0001:00005F74 00000108 C=CODE S=.text G=(none) M=Types ACBP=A9 - 0001:0000607C 00000ED8 C=CODE S=.text G=(none) M=Windows ACBP=A9 - 0001:00006F54 00000038 C=CODE S=.text G=(none) M=Messages ACBP=A9 - 0001:00006F8C 00000338 C=CODE S=.text G=(none) M=SysConst ACBP=A9 - 0001:000072C4 00006E28 C=CODE S=.text G=(none) M=SysUtils ACBP=A9 - 0001:0000E0EC 0000081B C=CODE S=.text G=(none) M=VarUtils ACBP=A9 - 0001:0000E908 0000809A C=CODE S=.text G=(none) M=Variants ACBP=A9 - 0001:000169A4 00000188 C=CODE S=.text G=(none) M=RTLConsts ACBP=A9 - 0001:00016B2C 0000083C C=CODE S=.text G=(none) M=TypInfo ACBP=A9 - 0001:00017368 00000358 C=CODE S=.text G=(none) M=ActiveX ACBP=A9 - 0001:000176C0 0000A236 C=CODE S=.text G=(none) M=Classes ACBP=A9 - 0001:000218F8 00000370 C=CODE S=.text G=(none) M=Consts ACBP=A9 - 0001:00021C68 00009BFB C=CODE S=.text G=(none) M=Graphics ACBP=A9 - 0001:0002B864 00000124 C=CODE S=.text G=(none) M=Math ACBP=A9 - 0001:0002B988 000002B8 C=CODE S=.text G=(none) M=Contnrs ACBP=A9 - 0001:0002BC40 00000198 C=CODE S=.text G=(none) M=CommCtrl ACBP=A9 - 0001:0002BDD8 00000787 C=CODE S=.text G=(none) M=MultiMon ACBP=A9 - 0001:0002C560 00000038 C=CODE S=.text G=(none) M=Imm ACBP=A9 - 0001:0002C598 00000FF8 C=CODE S=.text G=(none) M=HelpIntfs ACBP=A9 - 0001:0002D590 00000058 C=CODE S=.text G=(none) M=WinSpool ACBP=A9 - 0001:0002D5E8 000010C8 C=CODE S=.text G=(none) M=Printers ACBP=A9 - 0001:0002E6B0 0000031F C=CODE S=.text G=(none) M=FlatSB ACBP=A9 - 0001:0002E9D0 000001A4 C=CODE S=.text G=(none) M=SyncObjs ACBP=A9 - 0001:0002EB74 000009BB C=CODE S=.text G=(none) M=UxTheme ACBP=A9 - 0001:0002F530 00000038 C=CODE S=.text G=(none) M=RichEdit ACBP=A9 - 0001:0002F568 00000038 C=CODE S=.text G=(none) M=ToolWin ACBP=A9 - 0001:0002F5A0 00000040 C=CODE S=.text G=(none) M=ShellAPI ACBP=A9 - 0001:0002F5E0 00000038 C=CODE S=.text G=(none) M=RegStr ACBP=A9 - 0001:0002F618 00000058 C=CODE S=.text G=(none) M=WinInet ACBP=A9 - 0001:0002F670 00000038 C=CODE S=.text G=(none) M=UrlMon ACBP=A9 - 0001:0002F6A8 0000006C C=CODE S=.text G=(none) M=ShlObj ACBP=A9 - 0001:0002F714 00000060 C=CODE S=.text G=(none) M=CommDlg ACBP=A9 - 0001:0002F774 00000038 C=CODE S=.text G=(none) M=Dlgs ACBP=A9 - 0001:0002F7AC 000036D1 C=CODE S=.text G=(none) M=Dialogs ACBP=A9 - 0001:00032E80 00004ADA C=CODE S=.text G=(none) M=ExtCtrls ACBP=A9 - 0001:0003795C 00000090 C=CODE S=.text G=(none) M=ComStrs ACBP=A9 - 0001:000379EC 000007A0 C=CODE S=.text G=(none) M=Clipbrd ACBP=A9 - 0001:0003818C 00000128 C=CODE S=.text G=(none) M=StrUtils ACBP=A9 - 0001:000382B4 00003821 C=CODE S=.text G=(none) M=Buttons ACBP=A9 - 0001:0003BAD8 00000038 C=CODE S=.text G=(none) M=ExtDlgs ACBP=A9 - 0001:0003BB10 00000068 C=CODE S=.text G=(none) M=IniFiles ACBP=A9 - 0001:0003BB78 00000068 C=CODE S=.text G=(none) M=Registry ACBP=A9 - 0001:0003BBE0 0000006C C=CODE S=.text G=(none) M=Mapi ACBP=A9 - 0001:0003BC4C 00000058 C=CODE S=.text G=(none) M=ExtActns ACBP=A9 - 0001:0003BCA4 00000038 C=CODE S=.text G=(none) M=ListActns ACBP=A9 - 0001:0003BCDC 00009948 C=CODE S=.text G=(none) M=ComCtrls ACBP=A9 - 0001:00045624 00000EA0 C=CODE S=.text G=(none) M=Themes ACBP=A9 - 0001:000464C4 0000C698 C=CODE S=.text G=(none) M=StdCtrls ACBP=A9 - 0001:00052B5C 00000168 C=CODE S=.text G=(none) M=StdActns ACBP=A9 - 0001:00052CC4 00000D1F C=CODE S=.text G=(none) M=WinHelpViewer ACBP=A9 - 0001:000539E4 00011403 C=CODE S=.text G=(none) M=Controls ACBP=A9 - 0001:00064DE8 00001292 C=CODE S=.text G=(none) M=ActnList ACBP=A9 - 0001:0006607C 00001B9C C=CODE S=.text G=(none) M=ImgList ACBP=A9 - 0001:00067C18 000066E1 C=CODE S=.text G=(none) M=Menus ACBP=A9 - 0001:0006E2FC 0000CEFC C=CODE S=.text G=(none) M=Forms ACBP=A9 - 0001:0007B1F8 00000060 C=CODE S=.text G=(none) M=ComConst ACBP=A9 - 0001:0007B258 00001259 C=CODE S=.text G=(none) M=ComObj ACBP=A9 - 0001:0007C4B4 00000038 C=CODE S=.text G=(none) M=StdVCL ACBP=A9 - 0001:0007C4EC 00001793 C=CODE S=.text G=(none) M=AxCtrls ACBP=A9 - 0001:0007DC80 00000060 C=CODE S=.text G=(none) M=OleConst ACBP=A9 - 0001:0007DCE0 00003519 C=CODE S=.text G=(none) M=OleCtrls ACBP=A9 - 0001:000811FC 00000050 C=CODE S=.text G=(none) M=JConsts ACBP=A9 - 0001:0008124C 000133EC C=CODE S=.text G=(none) M=jpeg ACBP=A9 - 0001:00094638 00000314 C=CODE S=.text G=(none) M=TlHelp32 ACBP=A9 - 0001:0009494C 000000D8 C=CODE S=.text G=(none) M=WinSock ACBP=A9 - 0001:00094A24 00001F40 C=CODE S=.text G=(none) M=ScktComp ACBP=A9 - 0001:00096964 000008EA C=CODE S=.text G=(none) M=OleServer ACBP=A9 - 0001:00097250 000005A0 C=CODE S=.text G=(none) M=MSCommLib_TLB ACBP=A9 - 0001:000977F0 00000040 C=CODE S=.text G=(none) M=MMSystem ACBP=A9 - 0001:00097830 00000038 C=CODE S=.text G=(none) M=Nb30 ACBP=A9 - 0001:00097868 00000A18 C=CODE S=.text G=(none) M=MaskUtils ACBP=A9 - 0001:00098280 00002108 C=CODE S=.text G=(none) M=Mask ACBP=A9 - 0001:0009A388 0000924C C=CODE S=.text G=(none) M=Grids ACBP=A9 - 0001:000A35D4 000015B4 C=CODE S=.text G=(none) M=UnitPilote ACBP=A9 - 0001:000A4B88 000004D0 C=CODE S=.text G=(none) M=Importation ACBP=A9 - 0001:000A5058 00013AFC C=CODE S=.text G=(none) M=UnitAnalyseSegCDM ACBP=A9 - 0001:000B8B54 000025F4 C=CODE S=.text G=(none) M=UnitConfigTCO ACBP=A9 - 0001:000BB148 000009C0 C=CODE S=.text G=(none) M=Unit_Pilote_aig ACBP=A9 - 0001:000BBB08 00003450 C=CODE S=.text G=(none) M=UnitConfigCellTCO ACBP=A9 - 0001:000BEF58 0003CD0C C=CODE S=.text G=(none) M=UnitTCO ACBP=A9 - 0001:000FBC64 000030E4 C=CODE S=.text G=(none) M=UnitSR ACBP=A9 - 0001:000FED48 000027D4 C=CODE S=.text G=(none) M=UnitCDF ACBP=A9 - 0001:0010151C 0003F1C8 C=CODE S=.text G=(none) M=UnitConfig ACBP=A9 - 0001:001406E4 00001803 C=CODE S=.text G=(none) M=verif_version ACBP=A9 - 0001:00141EE8 0000114C C=CODE S=.text G=(none) M=UnitPareFeu ACBP=A9 - 0001:00143034 00002A70 C=CODE S=.text G=(none) M=UnitDebug ACBP=A9 - 0001:00145AA4 00000D2C C=CODE S=.text G=(none) M=UnitSimule ACBP=A9 - 0001:001467D0 00002558 C=CODE S=.text G=(none) M=Unitplace ACBP=A9 - 0001:00148D28 00045C10 C=CODE S=.text G=(none) M=UnitPrinc ACBP=A9 - 0001:0018E938 0000048D C=CODE S=.text G=(none) M=Signaux_complexes_GL ACBP=A9 + 0001:00000000 00005DF3 C=CODE S=.text G=(none) M=System ACBP=A9 + 0001:00005DF4 00000140 C=CODE S=.text G=(none) M=SysInit ACBP=A9 + 0001:00005F34 00000108 C=CODE S=.text G=(none) M=Types ACBP=A9 + 0001:0000603C 00000ED8 C=CODE S=.text G=(none) M=Windows ACBP=A9 + 0001:00006F14 00000038 C=CODE S=.text G=(none) M=Messages ACBP=A9 + 0001:00006F4C 00000338 C=CODE S=.text G=(none) M=SysConst ACBP=A9 + 0001:00007284 00006E28 C=CODE S=.text G=(none) M=SysUtils ACBP=A9 + 0001:0000E0AC 0000081B C=CODE S=.text G=(none) M=VarUtils ACBP=A9 + 0001:0000E8C8 0000809A C=CODE S=.text G=(none) M=Variants ACBP=A9 + 0001:00016964 00000188 C=CODE S=.text G=(none) M=RTLConsts ACBP=A9 + 0001:00016AEC 0000083C C=CODE S=.text G=(none) M=TypInfo ACBP=A9 + 0001:00017328 00000358 C=CODE S=.text G=(none) M=ActiveX ACBP=A9 + 0001:00017680 0000A236 C=CODE S=.text G=(none) M=Classes ACBP=A9 + 0001:000218B8 00000370 C=CODE S=.text G=(none) M=Consts ACBP=A9 + 0001:00021C28 00009BFB C=CODE S=.text G=(none) M=Graphics ACBP=A9 + 0001:0002B824 00000124 C=CODE S=.text G=(none) M=Math ACBP=A9 + 0001:0002B948 000002B8 C=CODE S=.text G=(none) M=Contnrs ACBP=A9 + 0001:0002BC00 00000198 C=CODE S=.text G=(none) M=CommCtrl ACBP=A9 + 0001:0002BD98 00000787 C=CODE S=.text G=(none) M=MultiMon ACBP=A9 + 0001:0002C520 00000038 C=CODE S=.text G=(none) M=Imm ACBP=A9 + 0001:0002C558 00000FF8 C=CODE S=.text G=(none) M=HelpIntfs ACBP=A9 + 0001:0002D550 00000058 C=CODE S=.text G=(none) M=WinSpool ACBP=A9 + 0001:0002D5A8 000010C8 C=CODE S=.text G=(none) M=Printers ACBP=A9 + 0001:0002E670 0000031F C=CODE S=.text G=(none) M=FlatSB ACBP=A9 + 0001:0002E990 000001A4 C=CODE S=.text G=(none) M=SyncObjs ACBP=A9 + 0001:0002EB34 000009BB C=CODE S=.text G=(none) M=UxTheme ACBP=A9 + 0001:0002F4F0 00000038 C=CODE S=.text G=(none) M=RichEdit ACBP=A9 + 0001:0002F528 00000038 C=CODE S=.text G=(none) M=ToolWin ACBP=A9 + 0001:0002F560 00000040 C=CODE S=.text G=(none) M=ShellAPI ACBP=A9 + 0001:0002F5A0 00000038 C=CODE S=.text G=(none) M=RegStr ACBP=A9 + 0001:0002F5D8 00000058 C=CODE S=.text G=(none) M=WinInet ACBP=A9 + 0001:0002F630 00000038 C=CODE S=.text G=(none) M=UrlMon ACBP=A9 + 0001:0002F668 0000006C C=CODE S=.text G=(none) M=ShlObj ACBP=A9 + 0001:0002F6D4 00000060 C=CODE S=.text G=(none) M=CommDlg ACBP=A9 + 0001:0002F734 00000038 C=CODE S=.text G=(none) M=Dlgs ACBP=A9 + 0001:0002F76C 000036D1 C=CODE S=.text G=(none) M=Dialogs ACBP=A9 + 0001:00032E40 00004ADA C=CODE S=.text G=(none) M=ExtCtrls ACBP=A9 + 0001:0003791C 00000090 C=CODE S=.text G=(none) M=ComStrs ACBP=A9 + 0001:000379AC 000007A0 C=CODE S=.text G=(none) M=Clipbrd ACBP=A9 + 0001:0003814C 00000128 C=CODE S=.text G=(none) M=StrUtils ACBP=A9 + 0001:00038274 00003821 C=CODE S=.text G=(none) M=Buttons ACBP=A9 + 0001:0003BA98 00000038 C=CODE S=.text G=(none) M=ExtDlgs ACBP=A9 + 0001:0003BAD0 00000068 C=CODE S=.text G=(none) M=IniFiles ACBP=A9 + 0001:0003BB38 00000068 C=CODE S=.text G=(none) M=Registry ACBP=A9 + 0001:0003BBA0 0000006C C=CODE S=.text G=(none) M=Mapi ACBP=A9 + 0001:0003BC0C 00000058 C=CODE S=.text G=(none) M=ExtActns ACBP=A9 + 0001:0003BC64 00000038 C=CODE S=.text G=(none) M=ListActns ACBP=A9 + 0001:0003BC9C 00009948 C=CODE S=.text G=(none) M=ComCtrls ACBP=A9 + 0001:000455E4 00000EA0 C=CODE S=.text G=(none) M=Themes ACBP=A9 + 0001:00046484 0000C698 C=CODE S=.text G=(none) M=StdCtrls ACBP=A9 + 0001:00052B1C 00000168 C=CODE S=.text G=(none) M=StdActns ACBP=A9 + 0001:00052C84 00000D1F C=CODE S=.text G=(none) M=WinHelpViewer ACBP=A9 + 0001:000539A4 00011403 C=CODE S=.text G=(none) M=Controls ACBP=A9 + 0001:00064DA8 00001292 C=CODE S=.text G=(none) M=ActnList ACBP=A9 + 0001:0006603C 00001B9C C=CODE S=.text G=(none) M=ImgList ACBP=A9 + 0001:00067BD8 000066E1 C=CODE S=.text G=(none) M=Menus ACBP=A9 + 0001:0006E2BC 0000CEFC C=CODE S=.text G=(none) M=Forms ACBP=A9 + 0001:0007B1B8 00000060 C=CODE S=.text G=(none) M=ComConst ACBP=A9 + 0001:0007B218 00001259 C=CODE S=.text G=(none) M=ComObj ACBP=A9 + 0001:0007C474 00000038 C=CODE S=.text G=(none) M=StdVCL ACBP=A9 + 0001:0007C4AC 00001793 C=CODE S=.text G=(none) M=AxCtrls ACBP=A9 + 0001:0007DC40 00000060 C=CODE S=.text G=(none) M=OleConst ACBP=A9 + 0001:0007DCA0 00003519 C=CODE S=.text G=(none) M=OleCtrls ACBP=A9 + 0001:000811BC 00000050 C=CODE S=.text G=(none) M=JConsts ACBP=A9 + 0001:0008120C 000133EC C=CODE S=.text G=(none) M=jpeg ACBP=A9 + 0001:000945F8 00000314 C=CODE S=.text G=(none) M=TlHelp32 ACBP=A9 + 0001:0009490C 000000D8 C=CODE S=.text G=(none) M=WinSock ACBP=A9 + 0001:000949E4 00001F40 C=CODE S=.text G=(none) M=ScktComp ACBP=A9 + 0001:00096924 000008EA C=CODE S=.text G=(none) M=OleServer ACBP=A9 + 0001:00097210 00000598 C=CODE S=.text G=(none) M=MSCommLib_TLB ACBP=A9 + 0001:000977A8 00000040 C=CODE S=.text G=(none) M=MMSystem ACBP=A9 + 0001:000977E8 00000038 C=CODE S=.text G=(none) M=Nb30 ACBP=A9 + 0001:00097820 00000A18 C=CODE S=.text G=(none) M=MaskUtils ACBP=A9 + 0001:00098238 00002108 C=CODE S=.text G=(none) M=Mask ACBP=A9 + 0001:0009A340 0000924C C=CODE S=.text G=(none) M=Grids ACBP=A9 + 0001:000A358C 000015B4 C=CODE S=.text G=(none) M=UnitPilote ACBP=A9 + 0001:000A4B40 000004D0 C=CODE S=.text G=(none) M=Importation ACBP=A9 + 0001:000A5010 00010280 C=CODE S=.text G=(none) M=UnitAnalyseSegCDM ACBP=A9 + 0001:000B5290 00002690 C=CODE S=.text G=(none) M=UnitConfigTCO ACBP=A9 + 0001:000B7920 000009C0 C=CODE S=.text G=(none) M=Unit_Pilote_aig ACBP=A9 + 0001:000B82E0 00003458 C=CODE S=.text G=(none) M=UnitConfigCellTCO ACBP=A9 + 0001:000BB738 0002CEBC C=CODE S=.text G=(none) M=UnitTCO ACBP=A9 + 0001:000E85F4 00002C18 C=CODE S=.text G=(none) M=UnitSR ACBP=A9 + 0001:000EB20C 00002404 C=CODE S=.text G=(none) M=UnitCDF ACBP=A9 + 0001:000ED610 000015DB C=CODE S=.text G=(none) M=verif_version ACBP=A9 + 0001:000EEBEC 0000114C C=CODE S=.text G=(none) M=UnitPareFeu ACBP=A9 + 0001:000EFD38 00037300 C=CODE S=.text G=(none) M=UnitConfig ACBP=A9 + 0001:00127038 0000290C C=CODE S=.text G=(none) M=UnitDebug ACBP=A9 + 0001:00129944 00000C00 C=CODE S=.text G=(none) M=UnitSimule ACBP=A9 + 0001:0012A544 00002390 C=CODE S=.text G=(none) M=Unitplace ACBP=A9 + 0001:0012C8D4 000395F0 C=CODE S=.text G=(none) M=UnitPrinc ACBP=A9 + 0001:00165EC4 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 @@ -212,16 +212,16 @@ Detailed map of segments 0002:00007C40 00000014 C=BSS S=.bss G=DGROUP M=UnitConfigTCO ACBP=A9 0002:00007C54 00000014 C=BSS S=.bss G=DGROUP M=Unit_Pilote_aig ACBP=A9 0002:00007C68 00000014 C=BSS S=.bss G=DGROUP M=UnitConfigCellTCO ACBP=A9 - 0002:00007C7C 00041DA4 C=BSS S=.bss G=DGROUP M=UnitTCO ACBP=A9 - 0002:00049A20 00000010 C=BSS S=.bss G=DGROUP M=UnitSR ACBP=A9 - 0002:00049A30 00000014 C=BSS S=.bss G=DGROUP M=UnitCDF ACBP=A9 - 0002:00049A44 000004F0 C=BSS S=.bss G=DGROUP M=UnitConfig ACBP=A9 - 0002:00049F34 00000018 C=BSS S=.bss G=DGROUP M=verif_version ACBP=A9 - 0002:00049F4C 00000004 C=BSS S=.bss G=DGROUP M=UnitPareFeu ACBP=A9 - 0002:00049F50 0000002C C=BSS S=.bss G=DGROUP M=UnitDebug ACBP=A9 - 0002:00049F7C 0000000C C=BSS S=.bss G=DGROUP M=UnitSimule ACBP=A9 - 0002:00049F88 00000008 C=BSS S=.bss G=DGROUP M=Unitplace ACBP=A9 - 0002:00049F90 04181A74 C=BSS S=.bss G=DGROUP M=UnitPrinc ACBP=A9 + 0002:00007C7C 00041F90 C=BSS S=.bss G=DGROUP M=UnitTCO ACBP=A9 + 0002:00049C0C 00000010 C=BSS S=.bss G=DGROUP M=UnitSR ACBP=A9 + 0002:00049C1C 00000014 C=BSS S=.bss G=DGROUP M=UnitCDF ACBP=A9 + 0002:00049C30 00000018 C=BSS S=.bss G=DGROUP M=verif_version ACBP=A9 + 0002:00049C48 00000004 C=BSS S=.bss G=DGROUP M=UnitPareFeu ACBP=A9 + 0002:00049C4C 000004F8 C=BSS S=.bss G=DGROUP M=UnitConfig ACBP=A9 + 0002:0004A144 0000002C C=BSS S=.bss G=DGROUP M=UnitDebug ACBP=A9 + 0002:0004A170 0000000C C=BSS S=.bss G=DGROUP M=UnitSimule ACBP=A9 + 0002:0004A17C 00000008 C=BSS S=.bss G=DGROUP M=Unitplace ACBP=A9 + 0002:0004A184 04181A74 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:0018EC48 +Program entry point at 0001:001661D4 diff --git a/Signaux_complexes_GL.res b/Signaux_complexes_GL.res index ff026ad..aad2303 100644 Binary files a/Signaux_complexes_GL.res and b/Signaux_complexes_GL.res differ diff --git a/UnitAnalyseSegCDM.pas b/UnitAnalyseSegCDM.pas index 47bd81c..2af91ee 100644 --- a/UnitAnalyseSegCDM.pas +++ b/UnitAnalyseSegCDM.pas @@ -1306,13 +1306,12 @@ begin // angle:=angleX; GMode:=SetGraphicsMode(ACanvas.Handle, GM_ADVANCED); - if GetWorldTransform(ACanvas.Handle, XFormOld) then // renvoie la matrice courante dans XformOld + if GetWorldTransform(ACanvas.Handle, XFormOld) then // renvoie la matrice courante dans XformOld begin // faire les transformations - XFormRot:=XForm_Rotation(Angle,Point(l2,h2)); // rotation autour du centre - //XFormScale:=XForm_Echelle(Zoom,Zoom,Point(0,0)); // Zoom + XFormRot:=XForm_Rotation(Angle,Point(l2,h2)); // rotation autour du centre XFormScale:=XForm_Echelle(Zoom,Zoom,point(l2,h2)); // Zoom au point central - XFormXLat:=XForm_Translation(x-l2,y-h2); // décalage + XFormXLat:=XForm_Translation(x-l2,y-h2); // décalage // Combiner les 3 transformations CombineTransform(XForm,XFormRot,XFormScale); // Xform<-- f(XformRot,XformScale) @@ -1346,7 +1345,7 @@ begin inc(x2);inc(y2); inc(x3);dec(y3); - // rectangle contenant l'icone + // rectangle droit contenant l'icone tv[0]:=x0; tv[1]:=x1; tv[2]:=x2; tv[3]:=x3; x0:=minIntValue(tv); x1:=maxIntValue(tv); @@ -4247,7 +4246,7 @@ procedure TFormAnalyseCDM.ButtonAnimeClick(Sender: TObject); var zom,ang : single; x,y : integer; begin - x:=100;y:=200; + x:=50;y:=50; zom:=1.2; ang:=0; @@ -4257,7 +4256,9 @@ begin //peindre(2,500-x,y,0,zom); //zom:=zom+0.005; x:=x+10; - ang:=ang+0.04; + y:=y+3; + ang:=ang+0.02; + zom:=zom+0.01; sleep(40); Application.processMessages; until x>800; diff --git a/UnitConfig.dfm b/UnitConfig.dfm index 3c8e1b3..65fd89e 100644 --- a/UnitConfig.dfm +++ b/UnitConfig.dfm @@ -668,7 +668,7 @@ object FormConfig: TFormConfig Top = 8 Width = 633 Height = 497 - ActivePage = TabSheetAig + ActivePage = TabSheetPeriph Font.Charset = DEFAULT_CHARSET Font.Color = clBlack Font.Height = -11 @@ -1542,8 +1542,8 @@ object FormConfig: TFormConfig Width = 73 Height = 17 Hint = - 'Affiche un ralen30/rappel30 sur le signal implant'#233' avant cet aig' + - 'uillage' + 'Affiche un ralen30/rappel30 sur les signaux implant'#233's avant cet ' + + 'aiguillage' Caption = '30 km/h' ParentShowHint = False ShowHint = True @@ -1556,8 +1556,8 @@ object FormConfig: TFormConfig Width = 73 Height = 17 Hint = - 'Affiche un ralen60/rappel60 sur le signal implant'#233' avant cet aig' + - 'uillage' + 'Affiche un ralen60/rappel60 sur les signaux implant'#233's avant cet ' + + 'aiguillage' Caption = '60 km/h' ParentShowHint = False ShowHint = True @@ -2318,7 +2318,7 @@ object FormConfig: TFormConfig Width = 137 Height = 21 Style = csDropDownList - ItemHeight = 13 + ItemHeight = 0 TabOrder = 1 OnChange = ComboBoxDecChange end @@ -2425,7 +2425,7 @@ object FormConfig: TFormConfig Width = 137 Height = 21 Style = csDropDownList - ItemHeight = 13 + ItemHeight = 0 TabOrder = 2 OnChange = ComboBoxAspChange end @@ -2719,7 +2719,7 @@ object FormConfig: TFormConfig Width = 193 Height = 21 AutoComplete = False - ItemHeight = 13 + ItemHeight = 0 TabOrder = 0 OnChange = ComboBoxDecodeurPersoChange end @@ -2738,7 +2738,7 @@ object FormConfig: TFormConfig Width = 145 Height = 21 Style = csDropDownList - ItemHeight = 13 + ItemHeight = 0 TabOrder = 2 OnChange = ComboBoxNationChange end @@ -2784,7 +2784,7 @@ object FormConfig: TFormConfig Width = 193 Height = 21 Style = csDropDownList - ItemHeight = 13 + ItemHeight = 0 TabOrder = 6 OnChange = ComboBoxDecCdeChange end @@ -3163,7 +3163,7 @@ object FormConfig: TFormConfig Height = 21 Hint = 'Nom de l'#39'accessoire d'#233'fini dans l'#39'onglet "p'#233'riph'#233'riques COM/USB"' Style = csDropDownList - ItemHeight = 13 + ItemHeight = 0 ParentShowHint = False ShowHint = True TabOrder = 6 @@ -3184,8 +3184,8 @@ object FormConfig: TFormConfig end end object GroupBoxPNA: TGroupBox - Left = 88 - Top = 72 + Left = 56 + Top = 64 Width = 169 Height = 121 Caption = 'Actionneurs PN simples' @@ -3344,7 +3344,7 @@ object FormConfig: TFormConfig Height = 21 Hint = 'Nom de l'#39'accessoire d'#233'fini dans l'#39'onglet "p'#233'riph'#233'riques COM/USB"' Style = csDropDownList - ItemHeight = 13 + ItemHeight = 0 ParentShowHint = False ShowHint = True TabOrder = 10 @@ -3968,6 +3968,54 @@ object FormConfig: TFormConfig Width = 3 Height = 13 end + object SBMonte: TSpeedButton + Left = 240 + Top = 160 + Width = 25 + Height = 33 + Hint = + 'Monte d'#39'un cran le p'#233'riph'#233'rique et r'#233'affecte les index des utili' + + 'sateurs' + Glyph.Data = { + 42010000424D4201000000000000760000002800000011000000110000000100 + 040000000000CC00000000000000000000001000000000000000000000000000 + 8000008000000080800080000000800080008080000080808000C0C0C0000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00FFFFFFFFFFFF + FFFFF0000000F000000000000000F0000000FF0000000000000FF0000000FF00 + 00000000000FF0000000FFF00000000000FFF0000000FFF00000000000FFF000 + 0000FFFF000000000FFFF0000000FFFF000000000FFFF0000000FFFFF0000000 + FFFFF0000000FFFFF0000000FFFFF0000000FFFFFF00000FFFFFF0000000FFFF + FF00000FFFFFF0000000FFFFFFF000FFFFFFF0000000FFFFFFF000FFFFFFF000 + 0000FFFFFFFF0FFFFFFFF0000000FFFFFFFF0FFFFFFFF0000000FFFFFFFFFFFF + FFFFF0000000} + ParentShowHint = False + ShowHint = True + OnClick = SBMonteClick + end + object SBDesc: TSpeedButton + Left = 240 + Top = 200 + Width = 25 + Height = 33 + Hint = + 'Descend d'#39'un cran le p'#233'riph'#233'rique et r'#233'affecte les index des uti' + + 'lisateurs' + Glyph.Data = { + 42010000424D4201000000000000760000002800000011000000110000000100 + 040000000000CC00000000000000000000001000000000000000000000000000 + 8000008000000080800080000000800080008080000080808000C0C0C0000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00FFFFFFFFFFFF + FFFFF0000000FFFFFFFF0FFFFFFFF0000000FFFFFFFF0FFFFFFFF0000000FFFF + FFF000FFFFFFF0000000FFFFFFF000FFFFFFF0000000FFFFFF00000FFFFFF000 + 0000FFFFFF00000FFFFFF0000000FFFFF0000000FFFFF0000000FFFFF0000000 + FFFFF0000000FFFF000000000FFFF0000000FFFF000000000FFFF0000000FFF0 + 0000000000FFF0000000FFF00000000000FFF0000000FF0000000000000FF000 + 0000FF0000000000000FF0000000F000000000000000F0000000FFFFFFFFFFFF + FFFFF0000000} + ParentShowHint = False + ShowHint = True + OnClick = SBDescClick + end object ListBoxPeriph: TListBox Left = 8 Top = 72 @@ -3982,7 +4030,9 @@ object FormConfig: TFormConfig ItemHeight = 13 MultiSelect = True ParentFont = False + ParentShowHint = False PopupMenu = PopupMenuListes + ShowHint = False TabOrder = 0 OnKeyDown = ListBoxPeriphKeyDown OnMouseDown = ListBoxPeriphMouseDown @@ -4006,7 +4056,7 @@ object FormConfig: TFormConfig OnClick = ButtonSupAccComClick end object GroupBoxDesc: TGroupBox - Left = 264 + Left = 280 Top = 72 Width = 329 Height = 129 @@ -4019,7 +4069,7 @@ object FormConfig: TFormConfig Height = 13 Caption = 'Nom du p'#233'riph'#233'rique' end - object EditNomAcc: TEdit + object EditNomPeriph: TEdit Left = 150 Top = 24 Width = 170 @@ -4028,7 +4078,7 @@ object FormConfig: TFormConfig ParentShowHint = False ShowHint = True TabOrder = 0 - OnChange = EditNomAccChange + OnChange = EditNomPeriphChange end end object ButtonOuvreCom: TButton diff --git a/UnitConfig.pas b/UnitConfig.pas index a78de27..7020bc0 100644 --- a/UnitConfig.pas +++ b/UnitConfig.pas @@ -317,7 +317,7 @@ type ButtonSupAccCom: TButton; GroupBoxDesc: TGroupBox; Label71: TLabel; - EditNomAcc: TEdit; + EditNomPeriph: TEdit; ComboBoxAccComUSB: TComboBox; Label73: TLabel; LabelInfoAcc: TLabel; @@ -345,6 +345,8 @@ type outslectionner1: TMenuItem; EditChercher: TEdit; ButtonCherche: TButton; + SBMonte: TSpeedButton; + SBDesc: TSpeedButton; procedure ButtonAppliquerEtFermerClick(Sender: TObject); procedure FormActivate(Sender: TObject); procedure FormCreate(Sender: TObject); @@ -501,7 +503,7 @@ type procedure RadioButtonCdeClick(Sender: TObject); procedure ButtonOuvreComClick(Sender: TObject); procedure ButtonAjAccComClick(Sender: TObject); - procedure EditNomAccChange(Sender: TObject); + procedure EditNomPeriphChange(Sender: TObject); procedure ListBoxPeriphMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); procedure ComboBoxAccComUSBChange(Sender: TObject); @@ -517,6 +519,8 @@ type procedure Toutslectionner1Click(Sender: TObject); procedure ButtonChercheClick(Sender: TObject); procedure EditChercherChange(Sender: TObject); + procedure SBMonteClick(Sender: TObject); + procedure SBDescClick(Sender: TObject); private { Déclarations privées } @@ -618,6 +622,7 @@ var // 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, @@ -625,7 +630,7 @@ var EditZdet1V4F,EditZdet2V4F,EditZdet1V4O,EditZdet2V4O, EditZdet1V5F,EditZdet2V5F,EditZdet1V5O,EditZdet2V5O : Tedit; LabelPortCde,LbPnVoie1,LbAPnVoie1,LbAPnVoie2,LbAPnVoie3,LbAPnVoie4,LbAPnVoie5,LbATitre, - LbZTitre,LbZPnVoie1,LbZPnVoie2,LbZPnVoie3,LbZPnVoie4,LbZPnVoie5 : Tlabel; + LbZTitre,LbZPnVoie1,LbZPnVoie2,LbZPnVoie3,LbZPnVoie4,LbZPnVoie5,LabelMP : Tlabel; shape1,ShapeZ : Tshape; BoutonCom : Tbutton; EditT : Array[1..10] of Tedit; @@ -1108,8 +1113,6 @@ begin end; end; - - // décodeur SR if feux[i].decodeur=7 then begin @@ -1970,7 +1973,7 @@ var s,sa,SOrigine: string; trouve_Tempo_maxi,trouve_Entete,trouve_tco,trouve_cdm,trouve_Serveur_interface,trouve_fenetre,trouve_MasqueTCO, trouve_NOTIF_VERSION,trouve_verif_version,trouve_fonte,trouve_tempo_aig,trouve_raz,trouve_section_aig, trouve_section_branche,trouve_section_sig,trouve_section_act,trouve_tempo_feu, - trouve_algo_uni,croi,trouve_Nb_cantons_Sig,trouve_dem_aig,trouve_demcnxCOMUSB,trouve_demcnxEth,trouve : boolean; + trouve_algo_uni,croi,trouve_Nb_cantons_Sig,trouve_dem_aig,trouve_demcnxCOMUSB,trouve_demcnxEth : boolean; virgule,i_detect,i,erreur,aig2,detect,offset,j,position, ComptEl,Compt_IT,Num_Element,adr,Nligne,postriple,itl, postjd,postjs,nv,it,Num_Champ,asp,adraig,poscroi : integer; @@ -3702,7 +3705,7 @@ begin end; function verifie_panneau_config : boolean; -var ChangeCDM,changeInterface,changeUSB,changeUSBcde,change_srv,ok : boolean; +var ChangeCDM,changeInterface,changeUSB,change_srv,ok : boolean; i,erreur : integer; s : string; begin @@ -3909,7 +3912,7 @@ end; // affiche les champs du signal index // LC=index du signal procedure clicListeSignal(index : integer); -var AncAdresse,adresse,erreur,i : integer; +var AncAdresse,adresse,erreur : integer; s : string; begin if index<1 then exit; @@ -3920,14 +3923,6 @@ begin exit; end; - // ne pas déselectionner tout!! - with FormConfig.ListBoxSig do - begin - for i:=0 to Count-1 do Selected[i]:=false; - FormConfig.ListBoxSig.Selected[index-1]:=true; - end; - - Feu_Sauve:=feux[index]; // sauvegarde AncLigneClicSig:=ligneclicSig; @@ -4253,7 +4248,6 @@ end; procedure TformConfig.cb_onclick(sender : TObject); var s : string; cb : TCheckBox; - etat : string; begin if clicliste or (ligneClicAccCOM<0) then exit; cb:=(sender as Tcheckbox); @@ -4282,7 +4276,29 @@ begin ComboBoxPNCom.Items.Add(s); ComboBoxDecCde.Items.Add(s); end; -end; +end; + + +// fabrique les combos des périphériques +procedure fabrique_combos_periph; +var i : integer; + s : string; +begin + + with FormConfig.ListBoxPeriph,FormConfig do + begin + ComboBoxAccComUSB.Clear; + ComboBoxPNCom.clear; + ComboBoxDecCde.clear; + for i:=0 to Count-1 do + begin + s:=items[i]; + ajoute_champs_combos(i+1); + end; + end; +end; + + // met à jour le nom d'un champ d'index i dans les combos @@ -4305,14 +4321,92 @@ begin end; end; +// réaffecte mes index des combos dans la base de donnée +procedure reaffecte_index_combos(ancien1,ancien2,nouveau1,nouveau2 : integer); +var i : integer; + s : string; +begin + i:=1; + repeat + if tablo_actionneur[i].periph then + begin + if tablo_actionneur[i].fonction=ancien1 then //numéro périph + begin + tablo_actionneur[i].fonction:=nouveau1; + s:=encode_act_loc_son(i); + FormConfig.ListBoxAct.Items[i-1]:=s; + inc(i); + end + else + if tablo_actionneur[i].fonction=ancien2 then + begin + tablo_actionneur[i].fonction:=nouveau2; + s:=encode_act_loc_son(i); + FormConfig.ListBoxAct.Items[i-1]:=s; + inc(i); + end + else + inc(i); + end + else inc(i); + until i>maxTablo_act ; + + i:=1; + repeat + // commande par périphérique + if Tablo_PN[i].typeCde=1 then + begin + if tablo_pn[i].AdresseFerme=ancien1 then // numéro périph + begin + tablo_pn[i].AdresseFerme:=nouveau1; + s:=encode_act_PN(i); + FormConfig.ListBoxPN.Items[i-1]:=s; + inc(i); + end + else + if tablo_pn[i].AdresseFerme=ancien2 then // numéro périph + begin + tablo_pn[i].AdresseFerme:=nouveau2; + s:=encode_act_PN(i); + FormConfig.ListBoxPN.Items[i-1]:=s; + inc(i); + end + else + inc(i); + end + else inc(i); + until i>nbrePN ; + + i:=1; + repeat + if decodeur_pers[i].commande=1 then + begin + if decodeur_pers[i].peripherique=ancien1 then // numéro périph + begin + decodeur_pers[i].peripherique:=nouveau1; + inc(i); + end + else + if decodeur_pers[i].peripherique=ancien2 then // numéro périph + begin + decodeur_pers[i].peripherique:=nouveau2; + inc(i); + end + else + inc(i); + end + else inc(i); + until i>NbreDecPers; +end; + // textbox du protocole procedure TformConfig.tb_onChange(sender : TObject); var s,te : string; tb : Tedit; - p,i,v : integer; + i,v : integer; begin if clicliste or (ligneClicAccCOM<0) then exit; - tb:=(sender as Tedit); + tb:=sender as Tedit; s:=tb.Name; te:=tb.text; if s='EditPortCde' then Tablo_periph[ligneClicAccCOM+1].Protocole:=te; @@ -4361,13 +4455,13 @@ var tb : tEdit; i : integer; begin if affevt then affiche('tbCde_onchange',clyellow); - tb:=(sender as Tedit); + tb:=sender as Tedit; s:=tb.Name; te:=tb.text; i:=extract_int(s); if (i<1) or (i>19) or (decCourant<1) then exit; decodeur_pers[decCourant].desc[i].Chcommande:=te; - + end; procedure TFormConfig.FormCreate(Sender: TObject); @@ -4489,9 +4583,8 @@ begin end; end; - // composants dynamiques des décodeurs pilotés par périph - - for i:=1 to 19 do + // composants dynamiques des décodeurs personnalisés pilotés par périphériques + for i:=1 to 19 do begin y:=i*21+20; LabelDecCde[i]:=Tlabel.Create(FormConfig.TabSheetDecodeurs); @@ -4503,7 +4596,7 @@ begin parent:=TabSheetDecodeurs; ShowHint:=false; visible:=false; - end; + end; TextBoxCde[i]:=Tedit.Create(FormConfig.TabSheetDecodeurs); with TextBoxCde[i] do begin @@ -4515,9 +4608,9 @@ begin visible:=false; onChange:=formconfig.tbCde_onchange; end; - end; + end; + - GroupBoxPN.Top:=16; // composants onglet passage à niveau with GroupBoxPNA do @@ -5087,7 +5180,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:='Déclencheur pour lequel la condition s''applique (mettre X pour tous les trains)'+#13+'déclenchement par actionneur uniquement'; // actionneurs Train ou accessoire ListBoxAct.Clear; @@ -5163,11 +5256,17 @@ begin end; // composants dynamiques car on ne peut plus ajouter de composants en mode conception! + // Bouton monte le périphérique + + //--------- groupbox gp1:=TgroupBox.Create(FormConfig.TabSheetPeriph); with gp1 do begin - Left:=264;Top:=groupBoxDesc.top+groupBoxDesc.Height+10;Width:=groupBoxDesc.Width;Height:=90; + Left:=GroupBoxDesc.Left; + Top:=groupBoxDesc.top+groupBoxDesc.Height+10; + Width:=groupBoxDesc.Width; + Height:=90; parent:=TabSheetPeriph; caption:='Services envoyés au périphérique'; Name:='Gp1'; @@ -5195,6 +5294,7 @@ begin ShowHint:=true; onclick:=formconfig.cb_onclick; end; + cb1:=TCheckBox.Create(FormConfig.TabSheetPeriph); with cb1 do begin @@ -5207,6 +5307,35 @@ begin onclick:=formconfig.cb_onclick; end; + LabelMP:=Tlabel.Create(Formconfig.TabSheetPeriph); + with LabelMP do + begin + left:=gp1.Left-20; + top:=gp1.Top+gp1.Height+10; + height:=10; + width:=40; + caption:='Références croisées de l''utilisation des périphériques'; + Name:='LabelMP'; + parent:=TabSheetPeriph; + end; + + MemoPeriph:=Tmemo.Create(Formconfig.TabSheetPeriph); + with MemoPeriph do + begin + left:=gp1.Left-30; + top:=LabelMP.Top+15; + width:=gp1.Width+30; + height:=100; + parent:=TabSheetPeriph; + Name:='MemoPeriph'; + readOnly:=true; + color:=clBtnFace; + //Font.Color:=clAqua; + clear; + Hint:='Références croisées de l''utilisation des périphériques'; + ShowHint:=true; + end; + BoutonCom:=Tbutton.Create(FormConfig.TabSheetPeriph); with BoutonCom do begin @@ -5222,12 +5351,12 @@ begin EditPortCde:=TEdit.Create(FormConfig.TabSheetPeriph); with EditPortCde do begin - Left:=150;Top:=EditNomAcc.top+30;Width:=170;Height:=12; + Left:=150;Top:=EditNomPeriph.top+30;Width:=170;Height:=12; name:='EditPortCde'; text:=''; parent:=GroupBoxDesc; hint:='Port COM/USB : COMX:vitesse,parité,nombre de bits de données, nombre de bits de stop ou'+#13+ - '________________________________'+#13+#13+ + '________________________________'+#13+#13+ 'Socket : AdresseIPV4:port'; ShowHint:=true; OnChange:=formconfig.tb_onChange; @@ -5236,7 +5365,7 @@ begin LabelPortCde:=TLabel.Create(FormConfig.TabSheetPeriph); with LabelPortCde do begin - Left:=10;Top:=EditNomAcc.top+32;Width:=170;Height:=12; + Left:=10;Top:=EditNomPeriph.top+32;Width:=170;Height:=12; caption:='Protocole de communication'; name:='LabelPortCde'; parent:=GroupBoxDesc; @@ -5263,7 +5392,7 @@ begin Left:=10;Top:=CheckBoxCR.top+20;Width:=100;Height:=12; caption:='Mode visible'; name:='cbVis'; - hint:='Affiche le texte à l''écran lors des envoi'; + hint:='Affiche le texte à l''écran lors des envois'; ShowHint:=true; onclick:=formconfig.cb_onclick; end; @@ -5322,17 +5451,72 @@ begin B:='Z'; end; +// Affiche les utilisateurs des périphériques en fonction de la sélection du périphériques +function utilisateurs_peripheriques : string; +var i,j : integer; + s : string; +begin + s:=''; + for i:=1 to maxTablo_act do + begin + if tablo_actionneur[i].periph then + begin + for j:=0 to NbPeriph-1 do + begin + if formconfig.ListBoxPeriph.selected[j] then + begin + if tablo_actionneur[i].fonction=j+1 then s:=s+'Le périphérique '+intToSTR(j+1)+' est utilisé par l''actionneur '+intToSTR(tablo_actionneur[i].adresse)+#13; + end; + end; + end; + end; + + for i:=1 to nbrePN do + begin + // commande par périphérique + if Tablo_PN[i].typeCde=1 then + begin + for j:=0 to NbPeriph-1 do + begin + if formconfig.ListBoxPeriph.selected[j] then + begin + if Tablo_PN[i].AdresseFerme=j+1 then s:=s+'Le périphérique '+intToSTR(j+1)+' est utilisé par le PN '+intToSTR(Tablo_PN[i].voie[1].ActFerme)+#13; + end; + end; + end; + end; + + for i:=1 to NbreDecPers do + begin + if decodeur_pers[i].commande=1 then + begin + for j:=0 to NbPeriph-1 do + begin + if formconfig.ListBoxPeriph.selected[j] then + begin + if decodeur_pers[i].Peripherique=j+1 then s:=s+'Le périphérique '+intToSTR(j+1)+' est utilisé par le décodeur personnalisé '+decodeur_pers[i].Nom+#13; + end; + end; + end; + end; + + if s='' then s:='Pas d''utilisation'+#13; + utilisateurs_peripheriques:=s; +end; + + procedure Aff_champs_accCOMUSB_tablo(index : integer); begin if (index<1) or (index>NbPeriph) then exit; clicliste:=true; - formConfig.editNomAcc.Text:=Tablo_periph[index].nom; + formConfig.EditNomPeriph.Text:=Tablo_periph[index].nom; cb1.Checked:=Tablo_periph[index].ScvAig; cb2.Checked:=Tablo_periph[index].ScvDet; cb3.Checked:=Tablo_periph[index].ScvAct; cbVis.Checked:=Tablo_periph[index].ScvVis; CheckBoxCR.Checked:=Tablo_periph[index].cr; EditPortCde.text:=Tablo_periph[index].protocole; + MemoPeriph.Clear; clicliste:=false; end; @@ -6245,7 +6429,6 @@ begin end; procedure champs_pn_act; -var s : string; begin with formConfig do begin @@ -6278,7 +6461,6 @@ begin end; procedure champs_pn_COMUSBSockets; -var s : string; begin with formConfig do begin @@ -6308,7 +6490,7 @@ end; // affiche les champs de l'actionneur PN en fonction de l'index du tableau procedure aff_champs_PN(i : integer); -var adresse,erreur,j,v,periph : integer; +var erreur,j,v,periph : integer; trouve : boolean; s : string; begin @@ -8468,8 +8650,7 @@ begin end; procedure supprime_pn; -var n,i,j,index,adr : integer; - ac,pn : boolean; +var n,i,j : integer; ss,s: string; begin if affevt then affiche('Evt bouton Sup PN',clyellow); @@ -8593,7 +8774,7 @@ begin end; procedure supprime_sig; -var n,adresse,i,j,indexFeu,l : integer; +var n,i,j : integer; s,ss : string; begin ss:=''; @@ -9684,6 +9865,20 @@ begin end; end; + // PN + for i:=1 to NbrePN do + begin + if tablo_pn[i].TypeCde=1 then + begin + adresse:=tablo_pn[i].AdresseFerme; + if adresse>NbPeriph then + begin + Affiche('Erreur 20 : le PN '+intToSTR(tablo_pn[i].voie[1].ActFerme)+' est lié à un périphérique n°'+intToSTR(adresse)+' COM/USB/Socket inexistant',clred); + ok:=false; + end; + end; + end; + // vérification des compatibilités des décodeurs de signaux et des aspects if not(verif_dec_sig(true)) then ok:=false; @@ -10764,7 +10959,6 @@ begin end; procedure TFormConfig.PageControlChange(Sender: TObject); -var i : integer; begin Label20.Visible:=false; LabelInfo.caption:=''; @@ -12353,6 +12547,7 @@ begin tl.SelectAll; end; + // supprimer un périphérique procedure supprime_periph; var ss,s : string; @@ -12364,20 +12559,24 @@ var ss,s : string; begin if formconfig.ListBoxPeriph.selected[i] then begin - ss:=ss+ Tablo_periph[i+1].nom+' '; + ss:=ss+ intToSTr(i+1)+' '+Tablo_periph[i+1].nom+' '; inc(n); end; end; if ss='' then exit; - s:='Voulez-vous supprimer '; + s:='Voulez-vous supprimer'; if n=1 then s:=s+' le périphérique ' else s:=s+' les périphériques '; - s:=s+ss+' ?'; + s:=s+ss+' ?'+#13; + + // vérifier si le périphérique est utilisé + + s:=s+utilisateurs_peripheriques; if Application.MessageBox(pchar(s),pchar('confirm'), MB_YESNO or MB_DEFBUTTON2 or MB_ICONQUESTION)=idNo then exit; clicliste:=true; - formConfig.editNomAcc.text:=''; + formConfig.EditNomPeriph.text:=''; // suppression n:=0; @@ -12418,6 +12617,7 @@ var ss,s : string; ajoute_champs_combos(i); end; end; + MemoPeriph.Clear; ligneclicAccCom:=-1; AncligneclicAccCom:=-1; clicliste:=false; @@ -12462,7 +12662,7 @@ begin s:='Nouveau périphérique'; formConfig.ComboBoxAccComUSB.Items.Add(s); formconfig.ComboBoxPNCom.Items.Add(s); - formconfig.EditNomAcc.text:=s; // ??? + formconfig.EditNomPeriph.text:=s; clicliste:=false; config_modifie:=true; end; @@ -12480,7 +12680,6 @@ begin if s='ListBoxAig' then supprime_aig; if s='ListBoxTrains' then supprime_Train; if s='ListBoxPeriph' then supprime_periph; - end; procedure TFormConfig.Nouveau1Click(Sender: TObject); @@ -12506,7 +12705,6 @@ end; procedure TFormConfig.ButtonOuvreComClick(Sender: TObject); var i,index : integer; - s : string; begin // Affiche(intToSTr(componentcount),clyellow); @@ -12540,14 +12738,14 @@ begin ajoute_Periph; end; -procedure TFormConfig.EditNomAccChange(Sender: TObject); +procedure TFormConfig.EditNomPeriphChange(Sender: TObject); var s : string; begin if clicliste or (ligneClicAccCOM<0) then exit; if affevt then affiche('Evt Edit act Change',clyellow); with Formconfig do begin - s:=EditNomAcc.Text; + s:=EditNomPeriph.Text; Tablo_periph[ligneClicAccCOM+1].nom:=s; maj_champs_combos(ligneClicAccCOM+1); s:=encode_Periph(ligneClicAccCOM+1); @@ -12559,7 +12757,7 @@ end; procedure TFormConfig.ListBoxPeriphMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); var i,lc : integer; - s : string; + s,sc : string; begin clicliste:=true; if NbPeriph<1 then exit; @@ -12580,6 +12778,18 @@ begin end; Aff_champs_accCOMUSB_tablo(lc+1); + s:=utilisateurs_peripheriques; + MemoPeriph.Clear; + repeat + i:=pos(#13,s); + if i<>0 then + begin + sc:=copy(s,1,i-1); + MemoPeriph.Lines.add(sc); + delete(s,1,i); + end; + until i=0; + clicliste:=false; end; @@ -12762,6 +12972,111 @@ procedure TFormConfig.EditChercherChange(Sender: TObject); ligneCherche:=0; end; +procedure raz_selection_periph; +begin + ligneClicAccCOM:=-1; + AncligneClicAccCOM:=-1; + with formConfig do + begin + EditNomPeriph.text:=''; + EditPortCde.text:=''; + CheckBoxCR.checked:=false; + CbVis.checked:=false; + cb1.checked:=false; + cb2.checked:=false; + cb3.checked:=false; + end; +end; + +procedure TFormConfig.SBMonteClick(Sender: TObject); + var i,n,IndexListe : integer; + Periph : TPeripherique; + trouve : boolean; + s : string; +begin + n:=ListBoxPeriph.Count; + if n<=1 then exit; + i:=0; + repeat + trouve:=ListBoxPeriph.Selected[i]; + inc(i); + until (i=n) or trouve; + if not(trouve) then exit; + dec(i); + if i=0 then exit; + + IndexListe:=i; + s:=ListBoxPeriph.Items[i-1]; + ListBoxPeriph.Items[i-1]:=ListBoxPeriph.Items[i]; + ListBoxPeriph.Items[i]:=s; + + inc(i); + + Periph:=Tablo_periph[i-1]; + Tablo_periph[i-1]:=Tablo_periph[i]; + Tablo_periph[i]:=Periph; + + for i:=0 to n-1 do + begin + ListBoxPeriph.Selected[i]:=false; + end; + ListBoxPeriph.Selected[IndexListe-1]:=true; + + ligneClicAccCOM:=IndexListe-1; + Aff_champs_accCOMUSB_tablo(indexListe); + + fabrique_combos_periph; + reaffecte_index_combos(indexListe+1,IndexListe,IndexListe,IndexListe+1); + + config_modifie:=true; +end; + +procedure TFormConfig.SBDescClick(Sender: TObject); + var i,n,IndexListe : integer; + trouve : boolean; + Periph : Tperipherique; + s : string; +begin + n:=ListBoxPeriph.Count; + if n<=1 then exit; + i:=0; + repeat + trouve:=ListBoxPeriph.Selected[i]; + inc(i); + until (i=n) or trouve; + if not(trouve) then exit; + dec(i); + if i=n-1 then exit; + IndexListe:=i; + + // inverse les deux entrées de la listebox + s:=ListBoxPeriph.Items[i+1]; + ListBoxPeriph.Items[i+1]:=ListBoxPeriph.Items[i]; + ListBoxPeriph.Items[i]:=s; + + inc(i); + + // inverse les deux entrées des périphériques + Periph:=Tablo_periph[i+1]; + Tablo_periph[i+1]:=Tablo_periph[i]; + Tablo_periph[i]:=Periph; + + for i:=0 to n-1 do + begin + ListBoxPeriph.Selected[i]:=false; + end; + ListBoxPeriph.Selected[IndexListe+1]:=true; + + ligneClicAccCOM:=IndexListe+1; + Aff_champs_accCOMUSB_tablo(indexListe+2); + + fabrique_combos_periph; + reaffecte_index_combos(indexListe+1,IndexListe+2,IndexListe+2,IndexListe+1); + + config_modifie:=true; + +end; + end. diff --git a/UnitConfigCellTCO.pas b/UnitConfigCellTCO.pas index d2dee4d..311ccf6 100644 --- a/UnitConfigCellTCO.pas +++ b/UnitConfigCellTCO.pas @@ -74,7 +74,6 @@ procedure actualise(indexTCO : integer); implementation - uses UnitPrinc,UnitAnalyseSegCDM,UnitConfigTCO,UnitTCO; {$R *.dfm} @@ -416,7 +415,7 @@ end; procedure TFormConfCellTCO.EditTexteCCTCOChange(Sender: TObject); begin if clicTCO or not(ConfCellTCO) or actualize then exit; - PCanvasTCO[indexTCOCourant].Brush.Color:=clfond; + PCanvasTCO[indexTCOCourant].Brush.Color:=clfond[indexTCOCourant]; if tco[indexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]].texte='' then begin diff --git a/UnitConfigTCO.dfm b/UnitConfigTCO.dfm index ed6ef17..ae917ff 100644 --- a/UnitConfigTCO.dfm +++ b/UnitConfigTCO.dfm @@ -36,7 +36,7 @@ object FormConfigTCO: TFormConfigTCO Top = 8 Width = 353 Height = 281 - Caption = 'Couleurs ' + Caption = 'Couleurs du TCO' TabOrder = 1 object Label5: TLabel Left = 21 @@ -211,7 +211,7 @@ object FormConfigTCO: TFormConfigTCO Top = 296 Width = 353 Height = 57 - Caption = 'Graphisme' + Caption = 'Graphisme de tous les TCOs' TabOrder = 4 end object RadioButtonLignes: TRadioButton @@ -281,6 +281,7 @@ object FormConfigTCO: TFormConfigTCO Height = 21 TabOrder = 0 Text = 'EditNbCellX' + OnChange = EditNbCellXChange end object EditNbCellY: TEdit Left = 176 @@ -316,7 +317,7 @@ object FormConfigTCO: TFormConfigTCO Top = 104 Width = 289 Height = 273 - Caption = 'Configuration de tous les TCO' + Caption = 'Configuration de tous les TCOs' TabOrder = 8 object Ratio: TLabel Left = 8 diff --git a/UnitConfigTCO.pas b/UnitConfigTCO.pas index e2c8abb..5380630 100644 --- a/UnitConfigTCO.pas +++ b/UnitConfigTCO.pas @@ -104,12 +104,12 @@ var r : Trect; begin with FormConfigTCO.ImageAig do begin - canvas.Pen.color:=clfond; - canvas.Brush.Color:=clfond; + canvas.Pen.color:=clfond[indexTCOCourant]; + canvas.Brush.Color:=clfond[indexTCOCourant]; canvas.Rectangle(0,0,Width,Height); - canvas.pen.color:=clVoies; - canvas.brush.color:=clvoies; + canvas.pen.color:=clVoies[indexTCOCourant]; + canvas.brush.color:=clvoies[indexTCOCourant]; // bande horizontale r:=Rect(0,(height div 2)-3,width,(height div 2)+3); canvas.FillRect(r); @@ -133,35 +133,35 @@ begin begin larg:=width ; haut:=height; - canvas.Pen.color:=clfond; - canvas.Brush.Color:=clfond; + canvas.Pen.color:=clfond[indexTCO]; + canvas.Brush.Color:=clfond[indexTCO]; canvas.Rectangle(0,0,Width,Height); end; // 3 with formConfigTCO.ImageGrille do begin - canvas.Pen.color:=clfond; - canvas.Brush.Color:=clfond; + canvas.Pen.color:=clfond[indexTCO]; + canvas.Brush.Color:=clfond[indexTCO]; canvas.Rectangle(0,0,Width,Height); - canvas.Pen.color:=ClGrille; + canvas.Pen.color:=ClGrille[IndexTCO]; canvas.moveto(0,5); canvas.LineTo(width,5); canvas.moveto(27,0); canvas.LineTo(27,Height); end; // 4 détecteur with formConfigTCO.ImageDetAct do begin - canvas.Pen.color:=clfond; - canvas.Brush.Color:=clfond; + canvas.Pen.color:=clfond[indexTCO]; + canvas.Brush.Color:=clfond[indexTCO]; canvas.Rectangle(0,0,Width,Height); - canvas.Brush.Color:=clAllume; - canvas.pen.color:=clAllume; + canvas.Brush.Color:=clAllume[indexTCO]; + canvas.pen.color:=clAllume[indexTCO]; canvas.Pen.Mode:=pmCopy; r:=Rect(1,(height div 2)-6,width-1,(height div 2)+6); canvas.FillRect(r); - canvas.pen.color:=clVoies; - canvas.brush.color:=clVoies; + canvas.pen.color:=clVoies[indexTCO]; + canvas.brush.color:=clVoies[indexTCO]; // bande horizontale r:=Rect(0,(height div 2)-3,width,(height div 2)+3); canvas.FillRect(r); @@ -170,12 +170,12 @@ begin // 5 canton with formCOnfigTCO.Imagecanton do begin - canvas.Pen.color:=clfond; - canvas.Brush.Color:=clfond; + canvas.Pen.color:=clfond[indexTCO]; + canvas.Brush.Color:=clfond[indexTCO]; canvas.Rectangle(0,0,Width,Height); - canvas.pen.color:=clCanton; - canvas.brush.color:=clCanton; + canvas.pen.color:=clCanton[indexTCO]; + canvas.brush.color:=clCanton[indexTCO]; // bande horizontale r:=Rect(0,(height div 2)-3,width,(height div 2)+3); canvas.FillRect(r); @@ -184,8 +184,8 @@ begin // 6 texte with formCOnfigTCO.ImageTexte do begin - canvas.Pen.color:=clfond; - canvas.Brush.Color:=clfond; + canvas.Pen.color:=clfond[indexTCO]; + canvas.Brush.Color:=clfond[indexTCO]; canvas.Rectangle(0,0,Width,Height); canvas.Font.color:=clTexte; canvas.Pen.mode:=pmCopy; @@ -195,11 +195,11 @@ begin // Quai with formconfigTCO.ImageQuai do begin - canvas.Pen.color:=clfond; - canvas.Brush.Color:=clfond; + canvas.Pen.color:=clfond[indexTCO]; + canvas.Brush.Color:=clfond[indexTCO]; canvas.Rectangle(0,0,Width,Height); - canvas.Brush.Color:=clQuai; - canvas.pen.color:=clQuai; + canvas.Brush.Color:=clQuai[indexTCO]; + canvas.pen.color:=clQuai[indexTCO]; x1:=0; x2:=x1+width; jy1:=(Haut div 2)-round(12*fryGlob[indexTCO]); // pos Y de la bande sup @@ -211,11 +211,11 @@ begin // pied signal with formconfigTCO.ImagePiedFeu do begin - canvas.Pen.color:=clfond; - canvas.Brush.Color:=clfond; + canvas.Pen.color:=clfond[indexTCO]; + canvas.Brush.Color:=clfond[indexTCO]; canvas.Rectangle(0,0,Width,Height); - canvas.Brush.Color:=clPiedSignal; - canvas.pen.color:=clPiedSignal; + canvas.Brush.Color:=clPiedSignal[indexTCO]; + canvas.pen.color:=clPiedSignal[indexTCO]; canvas.Pen.Width:=2; x1:=Larg div 2; y1:=0; @@ -293,8 +293,11 @@ var s: string; i : integer; begin clicConf:=true; - caption:='Configuration du tco '+inttostr(indextcocourant)+' Fichier '+NomFichierTCO[indextcocourant]; - groupBox3.caption:='Configuration du tco '+inttostr(indextcocourant); + s:='Configuration du tco '+inttostr(indextcocourant)+' Fichier '+NomFichierTCO[indextcocourant]; + caption:=s; + + groupBox3.caption:='Configuration du TCO '+inttostr(indextcocourant); + GroupBox1.Caption:='Couleurs du TCO '+inttostr(indextcocourant); EditNbCellX.Text:=IntToSTR(NbreCellX[indexTCOcourant]); EditNbCellY.Text:=IntToSTR(NbreCellY[indexTCOcourant]); EditRatio.text:=IntToSTR(RatioC); @@ -309,7 +312,7 @@ begin Label15.caption:='Nbre de TCOs : '+intToSTR(NbreTCO); CheckBoxCreerEvt.checked:=EvtClicDet; dessine_icones_config(indexTCOCourant); - s:='ColorA='+IntToHex(clfond,6); // ajouter aux couleurs personnalisées + s:='ColorA='+IntToHex(clfond[indexTCOcourant],6); // ajouter aux couleurs personnalisées colorDialog1.CustomColors.Add(s); for i:=1 to 10 do stringGridTCO.Cells[1,i]:=NomFichierTCO[i]; @@ -322,13 +325,13 @@ procedure TFormConfigTCO.ImageAigClick(Sender: TObject); var s : string; begin titre_couleur:='Changer la couleur des voies'; - ColorDialog1.Color:=clVoies; + ColorDialog1.Color:=clVoies[indexTCOcourant]; - s:='ColorA='+IntToHex(clfond,6); // ajouter aux couleurs personnalisées + s:='ColorA='+IntToHex(clfond[indexTCOCourant],6); // ajouter aux couleurs personnalisées colorDialog1.CustomColors.Add(s); if ColorDialog1.execute then begin - clVoies:=ColorDialog1.Color; + clVoies[indexTCOCourant]:=ColorDialog1.Color; TCO_modifie:=true; dessine_icones_config(indexTCOCourant); end; @@ -339,12 +342,12 @@ var s : string; begin titre_couleur:='Changer la couleur de fond'; - s:='ColorA='+IntToHex(clfond,6); // pour rajouter aux couleurs personnalisées + s:='ColorA='+IntToHex(clfond[indexTCOCourant],6); // pour rajouter aux couleurs personnalisées colorDialog1.CustomColors.Add(s); if ColorDialog1.execute then begin - clfond:=ColorDialog1.Color; + clfond[indexTCOCourant]:=ColorDialog1.Color; TCO_modifie:=true; dessine_icones_config(indexTCOCourant); end; @@ -354,14 +357,14 @@ procedure TFormConfigTCO.ImageGrilleClick(Sender: TObject); var s: string; begin titre_couleur:='Changer la couleur de la grille'; - ColorDialog1.Color:=clGrille; + ColorDialog1.Color:=clGrille[IndexTCOCourant]; - s:='ColorA='+IntToHex(clfond,6); // ajouter aux couleurs personnalisées + s:='ColorA='+IntToHex(clfond[indexTCOCourant],6); // ajouter aux couleurs personnalisées colorDialog1.CustomColors.Add(s); if ColorDialog1.execute then begin - ClGrille:=ColorDialog1.Color; + ClGrille[IndexTCOCourant]:=ColorDialog1.Color; TCO_modifie:=true; dessine_icones_config(indexTCOCourant); end; @@ -371,14 +374,13 @@ procedure TFormConfigTCO.ImageDetActClick(Sender: TObject); var s: string; begin titre_couleur:='Changer la couleur de détecteur activé'; - ColorDialog1.Color:=clAllume; + ColorDialog1.Color:=clAllume[indexTCOCourant]; - s:='ColorA='+IntToHex(clfond,6); // ajouter aux couleurs personnalisées + s:='ColorA='+IntToHex(clfond[indexTCOCourant],6); // ajouter aux couleurs personnalisées colorDialog1.CustomColors.Add(s); - if ColorDialog1.execute then begin - ClAllume:=ColorDialog1.Color; + ClAllume[indexTCOCourant]:=ColorDialog1.Color; TCO_modifie:=true; dessine_icones_config(indexTCOCourant); end; @@ -387,11 +389,11 @@ end; procedure TFormConfigTCO.ImagecantonClick(Sender: TObject); begin titre_couleur:='Changer la couleur de canton activé'; - ColorDialog1.Color:=clAllume; + ColorDialog1.Color:=clCanton[indexTCOCourant]; if ColorDialog1.execute then begin - ClCanton:=ColorDialog1.Color; + ClCanton[indexTCOCourant]:=ColorDialog1.Color; dessine_icones_config(indexTCOCourant); end; end; @@ -411,11 +413,11 @@ end; procedure TFormConfigTCO.ImageQuaiClick(Sender: TObject); begin titre_couleur:='Changer la couleur du quai'; - ColorDialog1.Color:=clQuai; + ColorDialog1.Color:=clQuai[indexTCOCourant]; if ColorDialog1.execute then begin - ClQuai:=ColorDialog1.Color; + ClQuai[indexTCOCourant]:=ColorDialog1.Color; dessine_icones_config(indexTCOCourant); end; end; @@ -423,11 +425,11 @@ end; procedure TFormConfigTCO.ImagePiedFeuClick(Sender: TObject); begin titre_couleur:='Changer la couleur du pied du signal'; - ColorDialog1.Color:=clPiedSignal; + ColorDialog1.Color:=clPiedSignal[indexTCOCourant]; if ColorDialog1.execute then begin - clPiedSignal:=ColorDialog1.Color; + clPiedSignal[indexTCOCourant]:=ColorDialog1.Color; dessine_icones_config(indexTCOCourant); end; end; @@ -453,23 +455,10 @@ begin Height:=HauteurCell[indexTCOCourant]*NbreCellY[indexTCOCourant]; end; - try - begin - SetLength(TCO[indexTCOCourant],NbreCellX[indexTCOCourant]+1,NbreCellY[indexTCOCourant]+1); - init_tampon_copiercoller; - end; - except - LabelErreur.caption:='TCO Mémoire insuffisante'; - NbreCellX[indexTCOCourant]:=20;NbreCellY[indexTCOCourant]:=12; - SetLength(TCO[indexTCOCourant],NbreCellX[indexTCOCourant]+1,NbreCellY[indexTCOCourant]+1); - init_tampon_copiercoller; - ok:=false; - end; - for y:=1 to NbreCellY[indexTCOCourant] do for x:=1 to NbreCellX[indexTCOCourant] do begin - if tco[indexTCOCourant,x,y].CouleurFond=0 then tco[indexTCOCourant,x,y].CouleurFond:=clfond; + if tco[indexTCOCourant,x,y].CouleurFond=0 then tco[indexTCOCourant,x,y].CouleurFond:=clfond[indexTCOCourant]; end; if RadioButtonLignes.Checked then diff --git a/UnitPrinc.dfm b/UnitPrinc.dfm index 00cfe3d..3f952a0 100644 --- a/UnitPrinc.dfm +++ b/UnitPrinc.dfm @@ -1,7 +1,7 @@ object FormPrinc: TFormPrinc - Left = 178 - Top = 243 - Width = 1222 + Left = 47 + Top = 346 + Width = 1133 Height = 653 Caption = 'Signaux complexes' Color = clBtnFace @@ -18,8 +18,8 @@ object FormPrinc: TFormPrinc OnCreate = FormCreate OnResize = FormResize DesignSize = ( - 1206 - 594) + 1125 + 602) PixelsPerInch = 96 TextHeight = 13 object LabelTitre: TLabel @@ -667,8 +667,8 @@ object FormPrinc: TFormPrinc Visible = False end object Image2feux: TImage - Left = 1104 - Top = 8 + Left = 1064 + Top = 104 Width = 33 Height = 57 Picture.Data = { @@ -1188,7 +1188,7 @@ object FormPrinc: TFormPrinc Visible = False end object LabelEtat: TLabel - Left = 449 + Left = 360 Top = 8 Width = 152 Height = 18 @@ -1442,8 +1442,8 @@ object FormPrinc: TFormPrinc end object StatusBar1: TStatusBar Left = 0 - Top = 572 - Width = 1206 + Top = 580 + Width = 1125 Height = 22 Panels = < item @@ -1459,6 +1459,7 @@ object FormPrinc: TFormPrinc Width = 100 end item + Style = psOwnerDraw Text = 'USB' Width = 120 end @@ -1469,7 +1470,7 @@ object FormPrinc: TFormPrinc OnDrawPanel = StatusBar1DrawPanel end object MSCommUSBLenz: TMSComm - Left = 1144 + Left = 1064 Top = 192 Width = 32 Height = 32 @@ -1479,7 +1480,7 @@ object FormPrinc: TFormPrinc 00020000802500000000080000000000000000003F00000011000000} end object Button1: TButton - Left = 489 + Left = 400 Top = 0 Width = 75 Height = 25 @@ -1492,12 +1493,12 @@ object FormPrinc: TFormPrinc object Panel2: TPanel Left = 0 Top = 32 - Width = 1129 + Width = 1065 Height = 473 Anchors = [akLeft, akTop, akRight] TabOrder = 3 DesignSize = ( - 1129 + 1065 473) object SplitterV: TSplitter Left = 1 @@ -1515,7 +1516,7 @@ object FormPrinc: TFormPrinc object FenRich: TRichEdit Left = 16 Top = 16 - Width = 425 + Width = 473 Height = 409 Color = clBlack Font.Charset = DEFAULT_CHARSET @@ -1533,9 +1534,9 @@ object FormPrinc: TFormPrinc OnMouseDown = FenRichMouseDown end object ScrollBox1: TScrollBox - Left = 488 + Left = 424 Top = 192 - Width = 497 + Width = 465 Height = 249 HorzScrollBar.Increment = 48 HorzScrollBar.Tracking = True @@ -1547,7 +1548,7 @@ object FormPrinc: TFormPrinc TabOrder = 1 end object GroupBox1: TGroupBox - Left = 489 + Left = 505 Top = 13 Width = 265 Height = 52 @@ -1598,8 +1599,8 @@ object FormPrinc: TFormPrinc end end object GroupBox3: TGroupBox - Left = 489 - Top = 56 + Left = 433 + Top = 32 Width = 265 Height = 129 Anchors = [akTop, akRight] @@ -1834,14 +1835,14 @@ object FormPrinc: TFormPrinc end end object Panel1: TPanel - Left = 761 - Top = 5 - Width = 296 + Left = 729 + Top = -3 + Width = 288 Height = 180 Anchors = [akTop, akRight] TabOrder = 4 DesignSize = ( - 296 + 288 180) object Label1: TLabel Left = 152 @@ -1960,7 +1961,7 @@ object FormPrinc: TFormPrinc OnClick = ButtonCDMClick end object EditEnvoi: TEdit - Left = 7 + Left = -1 Top = 127 Width = 121 Height = 21 @@ -1969,7 +1970,7 @@ object FormPrinc: TFormPrinc Text = '<1>' end object ButtonEnv: TButton - Left = 8 + Left = 0 Top = 88 Width = 88 Height = 33 @@ -1981,8 +1982,8 @@ object FormPrinc: TFormPrinc end end object GroupBox2: TGroupBox - Left = 521 - Top = 40 + Left = 449 + Top = 72 Width = 265 Height = 105 Anchors = [akTop, akRight] @@ -2053,7 +2054,7 @@ object FormPrinc: TFormPrinc OnClick = ButtonIndexClick end object MSCommCde1: TMSComm - Left = 1144 + Left = 1064 Top = 272 Width = 32 Height = 32 @@ -2063,7 +2064,7 @@ object FormPrinc: TFormPrinc 00020000802500000000080000000000000000003F00000001000000} end object MSCommCde2: TMSComm - Left = 1144 + Left = 1064 Top = 304 Width = 32 Height = 32 @@ -2075,8 +2076,8 @@ object FormPrinc: TFormPrinc object Timer1: TTimer Interval = 100 OnTimer = Timer1Timer - Left = 1168 - Top = 224 + Left = 1064 + Top = 232 end object ClientSocketInterface: TClientSocket Active = False @@ -2468,7 +2469,7 @@ object FormPrinc: TFormPrinc OnConnect = ClientSocketCde1Connect OnRead = ClientSocketCde1Read OnError = ClientSocketCde1Error - Left = 1152 + Left = 1072 Top = 344 end object ClientSocketCde2: TClientSocket @@ -2478,7 +2479,7 @@ object FormPrinc: TFormPrinc OnConnect = ClientSocketCde2Connect OnRead = ClientSocketCde2Read OnError = ClientSocketCde2Error - Left = 1152 - Top = 384 + Left = 1072 + Top = 376 end end diff --git a/UnitPrinc.pas b/UnitPrinc.pas index e0022ae..ded6493 100644 --- a/UnitPrinc.pas +++ b/UnitPrinc.pas @@ -462,7 +462,7 @@ Taiguillage = record DDroit : integer; // destination de la TJD en position droite DDroitB : char ; - DDevie : integer; // destination de la TJD en position déviée + DDevie : integer; // destination de la TJD en position déviée ou 2eme adresse de la TJD DDevieB : char ; tjsint : integer; // pour TJS @@ -532,6 +532,14 @@ TSignal = record Na : integer; // nombre d'adresses du feu occupées par le décodeur CDF/digikeijs end; + TPeripherique = record + nom : string; + NumCom : integer; // numéro de port COM si c'est une liaison com usb + numComposant : integer ; // numéro de composant MSCOM ou clientSocket + ScvAig,ScvDet,ScvAct,ScvVis,cr : boolean ; // services, visible, avecCR + protocole: string; + end; + var maxaiguillage,detecteur_chgt,Temps,Tempo_init,Suivant,ntrains,MaxPortCom, @@ -614,13 +622,7 @@ var Index_Accessoire : array[0..MaxAcc] of integer; // tableau d'index des accessoires aiguillages et signaux sur le bus DCC // tableau des périphériques - Tablo_periph : array[1..NbMaxi_Periph] of record - nom : string; - NumCom : integer; // numéro de port COM si c'est une liaison com usb - numComposant : integer ; // numéro de composant MSCOM ou clientSocket - ScvAig,ScvDet,ScvAct,ScvVis,cr : boolean ; // services, visible, avecCR - protocole: string; - end; + Tablo_periph : array[1..NbMaxi_Periph] of TPeripherique; // tableau des croisement rencontrés par la fonction suivant_alg3 croisement : array[1..20] of @@ -840,6 +842,9 @@ procedure ouvre_pn_socket(i : integer); procedure ferme_pn_socket(i : integer); function com_socket(i : integer) : integer; function liste_portcom : tStrings; +procedure mosaiqueH; +procedure mosaiqueV; +function InfoSignal(adresse : integer) : string; implementation @@ -1920,6 +1925,17 @@ begin end; end; +procedure Affiche_CR(s: string;lacouleur : Tcolor); +var i : integer; +begin + + repeat + i:=pos(#13,s); + Affiche(copy(s,1,i-1),lacouleur); + delete(s,1,i); + until (i=0); +end; + // trouve l'index d'un train par son nom function index_train_nom(nom : string) : integer; var i : integer; @@ -1963,7 +1979,9 @@ end; function index_signal(adresse : integer) : integer; begin if adresse>MaxAcc then result:=0 else - result:=Index_Accessoire[adresse]; + result:=Index_Accessoire[adresse]; + // vérifier si l'index correspond à un signal + if feux[result].adresse<>adresse then result:=0; end; // renvoie l'index de l'aiguillage dans le tableau aiguillages[] en fonction de son adresse @@ -1984,6 +2002,8 @@ function Index_Aig(adresse : integer) : integer; begin if adresse>MaxAcc then result:=0 else result:=Index_Accessoire[adresse]; + // vérifier si l'index correspond à un aiguillage + if Aiguillage[result].adresse<>adresse then result:=0; end; { @@ -5271,8 +5291,11 @@ begin else begin // si TJD (modele=2) sur le précédent, alors substituer avec la 2eme adresse de la TJD - md:=aiguillage[index_aig(prec)].modele; - if (md=tjd) or (md=tjs) then prec:=aiguillage[index_aig(prec)].Ddevie; + if TypeElPrec<>det then + begin + md:=aiguillage[index_aig(prec)].modele; + if (md=tjd) or (md=tjs) then prec:=aiguillage[index_aig(prec)].Ddevie; + end; if prec<>aiguillage[index].Adevie then begin if NivDebug=3 then AfficheDebug('135.3 Aiguillage '+intToSTR(adr)+' mal positionné',clyellow); @@ -7122,7 +7145,7 @@ var num_feu,etat,AdrFeu,i,j,prec,AdrSuiv,index2,voie : integer; begin if NivDebug>=2 then AfficheDebug('Cherche état du signal suivant au '+IntToSTR(adresse),clyellow); i:=Index_Signal(adresse); - if i=0 then + if (i=0) then begin if NivDebug>=2 then AfficheDebug('Signal '+IntToSTR(adresse)+' non trouvé',clyellow); etat_signal_suivant:=0; @@ -11904,21 +11927,14 @@ begin end; -// connecte un port usb pour la comm actionneurs. Si le port n'est pas ouvert, renvoie false +// 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,numport,vitesse,erreur : integer; +var i,j,nc,numport,vitesse,erreur : integer; trouve : boolean; s,sc,portComCde : string; com : TMSComm; begin - if (index<0) or (index>MaxComUSBPeriph) then - begin - affiche('Le nombre maxi de portCom périphériques est atteint - Le port COM'+inttostr(Tablo_periph[index].NumCom)+' ne sera pas ouvert',clred); - result:=false; - exit; - end; - numport:=Tablo_periph[index].NumCom; if (numport<1) or (numport>255) then begin @@ -11928,14 +11944,15 @@ begin trouve:=false; portComCde:=Tablo_periph[index].protocole; - case index of + nc:=Tablo_periph[index].NumComposant; + case nc of 1 : com:=formprinc.MSCommCde1; 2 : com:=formprinc.MSCommCde2; end; - if index>MaxComUSBPeriph then + if nc>MaxComUSBPeriph then begin - affiche('Le nombre maxi de portCom périphériques est atteint - Le port COM'+inttostr(Tablo_periph[index].NumCom)+' ne sera pas ouvert',clred); + affiche('Le nombre maxi de portCom périphériques est atteint. Le port COM'+inttostr(Tablo_periph[index].NumCom)+' ne sera pas ouvert',clred); result:=false; exit; end; @@ -11966,21 +11983,20 @@ begin InputLen:=0; CommPort:=numport; DTREnable:=false; // évite de reset de l'arduino à la connexion - RTSEnable:=false; //pour la genli + RTSEnable:=false; // pour la genli InputMode:=comInputModeBinary; end; + FormPrinc.StatusBar1.Panels[3].Style:=psOwnerDraw; // permet de déclencher l'event onDrawPanel tablo_com_cde[index].PortOuvert:=true; try - com.portopen:=true; + com.portopen:=true; except tablo_com_cde[index].PortOuvert:=false; end; if tablo_com_cde[index].PortOuvert then begin - // portComCmd[index].MsComm.OnComm:=formprinc.Event_MsComm; - s:='COM'+intToSTR(numport)+':'+sc; Formprinc.StatusBar1.Panels[3].Text:=s; end; @@ -12080,9 +12096,11 @@ begin if portCommOuvert then begin + FormPrinc.StatusBar1.Panels[3].Style:=psOwnerDraw; // permet de déclencher l'event onDrawPanel s:='COM'+intToSTR(port)+' ouvert'; Affiche(s,clLime); s:='COM'+intToSTR(port)+':'+sc; + Formprinc.StatusBar1.Panels[3].Text:=s; sleep(1000); trouve:=test_protocole; @@ -12891,26 +12909,6 @@ begin procetape('Lecture de la configuration'); lit_config; - // ouvre com 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 - if connecte_port_usb_periph(i) then - Affiche('COM'+intToSTR(Tablo_periph[i].numcom)+' commande périphérique ouvert',clLime) - else Affiche('COM'+intToSTR(Tablo_periph[i].numcom)+' commande périphérique non ouvert',clOrange); - end; - if index=2 then - begin - if connecte_socket_periph(i) then - Affiche('Socket '+Tablo_periph[i].protocole+' demande ouverture ',clLime) - else - Affiche('Socket '+Tablo_periph[i].protocole+' commande périphérique non ouvert',clOrange) - end; - end; - Menu_tco(NbreTCO); procetape('Lecture du TCO'); for i:=1 to NbreTCO do @@ -12998,7 +12996,7 @@ begin left:=5; Align:=AlLeft; // si on ne met pas AlignLeft, alors le splitter n'est pas accrochable top:=5; // par rapport au panel - width:=(OrgMilieu)-left-10; + Width:=panel2.Width-Panel1.Width-GroupBox1.Width-25; //height:=formprinc.Height-StatusBar1.Height-StaticText.Height-LabelTitre.Height-90; Anchors:=[akLeft,akTop,akRight,akBottom]; end; @@ -13031,7 +13029,6 @@ begin splitterV.Visible:=false; with Fenrich do begin - // parent:=paànel2; Align:=alLeft; left:=5; top:=0; @@ -13071,6 +13068,26 @@ begin Affiche_Fenetre_TCO(index,avecTCO); end; + // ouvre com 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 + if connecte_port_usb_periph(i) then + Affiche('COM'+intToSTR(Tablo_periph[i].numcom)+' commande périphérique ouvert',clLime) + else Affiche('COM'+intToSTR(Tablo_periph[i].numcom)+' commande périphérique non ouvert',clOrange); + end; + if index=2 then + begin + if connecte_socket_periph(i) then + Affiche('Socket '+Tablo_periph[i].protocole+' demande ouverture ',clLime) + else + Affiche('Socket '+Tablo_periph[i].protocole+' commande périphérique non ouvert',clOrange) + end; + end; + if debug=1 then Affiche('Initialisations',clLime); raz_tout; procetape('Début des init'); @@ -13390,7 +13407,7 @@ begin end; // signaux du TCO----------------------------------------------- - if false and TCOActive then // évite d'accéder à la variable FormTCO si elle est pas encore ouverte + if TCOActive then // évite d'accéder à la variable FormTCO si elle est pas encore ouverte begin for IndexTCO:=1 to NbreTCO do begin @@ -15397,7 +15414,7 @@ begin Affiche('En orange : pilotage des signaux / erreurs mineures',ClWhite); Affiche('En bleu : pilotage des aiguillages',ClWhite); Affiche('En jaune : rétrosignalisation reçue depuis l''interface',ClWhite); - Affiche('Taille du TCO : '+intToSTR(length(tco))+'x'+intToSTR(length(tco[1])),clorange); + //Affiche('Taille du TCO : '+intToSTR(length(tco))+'x'+intToSTR(length(tco[1])),clorange); Affiche('Taille des aiguillages : '+intToSTR(SizeOf(aiguillage) div 1024)+' ko',clorange); Affiche('Taille des signaux : '+intToSTR(SizeOf(feux) div 1024)+' ko',clorange); Affiche('Taille des branches : '+intToSTR(SizeOf(brancheN) div 1024)+' ko',clorange); @@ -15421,38 +15438,34 @@ begin formconfig.close; end; -procedure TFormPrinc.Informationsdusignal1Click(Sender: TObject); -var s: string; - nation,etat,i,aspect,n,combine,adresse,aig,trainReserve,AdrSignalsuivant,voie,AdrTrainRes : integer; +function InfoSignal(adresse : integer) : string; +var s : string; + nation,etat,i,aspect,n,combine,aig,trainReserve,AdrSignalsuivant,voie,AdrTrainRes : integer; reserveTrainTiers : boolean; code : word; -begin - clicliste:=false; - s:=((Tpopupmenu(Tmenuitem(sender).GetParentMenu).PopupComponent) as TImage).name; // nom du composant, pout récupérer l'adresse du feu (ex: ImageFeu260) - //Affiche(s,clOrange); // nom de l'image du signal (ex: ImageFeu2) - i:=extract_int(s); // extraire l'index (ex 2) - adresse:=feux[i].adresse; +begin + i:=index_signal(adresse); n:=feux[i].aspect; if (n>10) and (n<20) then exit; if n=20 then nation:=2 else nation:=1; code:=feux[i].EtatSignal; code_to_aspect(code,aspect,combine); - s:='Signal ad'+IntToSTR(adresse)+'='+chaine_signal(adresse); - Affiche(s,clYellow); + //s:='Signal ad'+IntToSTR(adresse)+'='+chaine_signal(adresse); + //Affiche(s,clYellow); //Affiche(IntToSTR(aspect),clred); //Affiche(IntToSTR(combine),clred); - s:='Le signal '+intToSTR(adresse)+' présente '+chaine_signal(adresse)+' car '; + s:='Le signal '+intToSTR(adresse)+' présente '+chaine_signal(adresse)+#13; // carré if (aspect=carre) and (nation=1) then begin - Affiche(s,clyellow); - if carre_signal(Adresse,trainreserve,reserveTrainTiers,AdrTrainRes) then affiche('les aiguillages en aval du signal sont mal positionnés ou leur positions inconnues',clyellow) ; - if reserveTrainTiers then affiche('un aiguillage ou un croisement en aval du signal sont réservés par un autre train (@'+intToSTR(AdrTrainRes)+')',clyellow); - if Cond_Carre(Adresse) then affiche_suivi('les aiguillages déclarés dans la définition du signal sont mal positionnés',clyellow); - if feux[i].VerrouCarre and not(PresTrainPrec(Adresse,Nb_cantons_Sig,false,TrainReserve,voie)) then affiche('le signal est verrouillable au carré et aucun train n''est présent avant le signal',clyellow); - if test_memoire_zones(Adresse) then affiche('présence train dans canton suivant le signal',clyellow); - if feux[i].EtatVerrouCarre then affiche('le signal est verrouillé au carré dans la fenêtre de pilotage',clYellow); + //Affiche(s,clyellow); + if carre_signal(Adresse,trainreserve,reserveTrainTiers,AdrTrainRes) then s:=s+'les aiguillages en aval du signal sont mal positionnés ou leur positions inconnues'+#13; + if reserveTrainTiers then s:=s+'un aiguillage ou un croisement en aval du signal sont réservés par un autre train (@'+intToSTR(AdrTrainRes)+')'+#13; + if Cond_Carre(Adresse) then s:=s+'les aiguillages déclarés dans la définition du signal sont mal positionnés'+#13; + if feux[i].VerrouCarre and not(PresTrainPrec(Adresse,Nb_cantons_Sig,false,TrainReserve,voie)) then s:=s+'le signal est verrouillable au carré et aucun train n''est présent avant le signal'+#13; + if test_memoire_zones(Adresse) then s:=s+'présence train dans canton suivant le signal'+#13; + if feux[i].EtatVerrouCarre then s:=s+'le signal est verrouillé au carré dans la fenêtre de pilotage'+#13; end; if (aspect=vert_jaune_H) and (nation=2) then @@ -15460,31 +15473,29 @@ begin etat:=etat_signal_suivant(Adresse,1,AdrSignalsuivant) ; // état du signal suivant + adresse du signal suivant dans Signal_Suivant if testbit(etat,chiffre) then begin - s:=s+'le signal suivant '+intToSTR(adrSignalSuivant)+' affiche une réduction de vitesse '; - Affiche(s,clyellow); + s:=s+'le signal suivant '+intToSTR(adrSignalSuivant)+' affiche une réduction de vitesse '+#13; end; end; if ((aspect=semaphore) and (nation=1)) or ((aspect=rouge) and (nation=2)) then begin - Affiche(s,clyellow); - if test_memoire_zones(Adresse) then affiche_suivi('présence train dans canton après le signal',clyellow); + if test_memoire_zones(Adresse) then s:=s+'présence train dans canton après le signal'+#13; if n=20 then begin // signal belge - if carre_signal(Adresse,trainreserve,reserveTrainTiers,AdrTrainRes) then affiche('les aiguillages en aval du signal sont mal positionnés ou leur positions inconnues',clyellow) ; - if reserveTrainTiers then affiche('un aiguillage ou un croisement en aval du signal sont réservés par un autre train (@'+intToSTR(AdrTrainRes)+')',clyellow); - if Cond_Carre(Adresse) then affiche_suivi('les aiguillages déclarés dans la définition du signal sont mal positionnés',clyellow); - if feux[i].VerrouCarre and not(PresTrainPrec(Adresse,Nb_cantons_Sig,false,TrainReserve,voie)) then affiche('le signal est verrouillable au carré et aucun train n''est présent avant le signal',clyellow); - if test_memoire_zones(Adresse) then affiche('présence train dans canton suivant le signal',clyellow); - if feux[i].EtatVerrouCarre then affiche('le signal est verrouillé au rouge dans la fenêtre de pilotage',clYellow); + if carre_signal(Adresse,trainreserve,reserveTrainTiers,AdrTrainRes) then s:=s+'les aiguillages en aval du signal sont mal positionnés ou leur positions inconnues'+#13; + if reserveTrainTiers then s:=s+'un aiguillage ou un croisement en aval du signal sont réservés par un autre train (@'+intToSTR(AdrTrainRes)+')'+#13; + if Cond_Carre(Adresse) then s:=s+'les aiguillages déclarés dans la définition du signal sont mal positionnés'+#13; + if feux[i].VerrouCarre and not(PresTrainPrec(Adresse,Nb_cantons_Sig,false,TrainReserve,voie)) then s:=s+'le signal est verrouillable au carré et aucun train n''est présent avant le signal'+#13; + if test_memoire_zones(Adresse) then s:=s+'présence train dans canton suivant le signal'+#13; + if feux[i].EtatVerrouCarre then s:=s+'le signal est verrouillé au rouge dans la fenêtre de pilotage'+#13; end; end; // avertissement ou deux-jaunes (belge) if ((aspect=jaune) and (n<>20)) or ((aspect=deux_jaunes) and (n=20)) then begin i:=etat_signal_suivant(Adresse,1,AdrSignalsuivant); - Affiche(s+'son signal suivant '+intToSTR(AdrSignalsuivant)+' est au '+chaine_signal(AdrSignalsuivant),clyellow); + s:=s+'son signal suivant '+intToSTR(AdrSignalsuivant)+' est au '+chaine_signal(AdrSignalsuivant)+#13; end; // avertissement cli @@ -15492,28 +15503,30 @@ begin begin i:=etat_signal_suivant(Adresse,1,AdrSignalsuivant); index:=Index_Signal(AdrSignalSuivant); - Affiche(s+'son signal suivant '+intToSTR(AdrSignalsuivant)+' est au '+chaine_signal(adresse),clyellow); + s:=s+'son signal suivant '+intToSTR(AdrSignalsuivant)+' est au '+chaine_signal(AdrSignalSuivant)+#13; end; // ralen 30 if (combine=10) and (nation=1) then begin i:=etat_signal_suivant(Adresse,1,AdrSignalsuivant); index:=Index_Signal(AdrSignalSuivant); - Affiche(s+'son signal suivant '+intToSTR(AdrSignalsuivant)+' est au '+chaine_signal(adresse),clyellow); + s:=s+'son signal suivant '+intToSTR(AdrSignalsuivant)+' est au '+chaine_signal(AdrSignalSuivant)+#13; end; if (combine=11) and (nation=1) then begin i:=etat_signal_suivant(Adresse,1,AdrSignalsuivant); index:=Index_Signal(AdrSignalSuivant); - Affiche(s+'son signal suivant '+intToSTR(AdrSignalsuivant)+' est au '+chaine_signal(adresse),clyellow); + s:=s+'son signal suivant '+intToSTR(AdrSignalsuivant)+' est au '+chaine_signal(AdrSignalSuivant)+#13; end; if ((combine=rappel_30) or (combine=rappel_60)) and (nation=1) then begin Aig:=Aiguille_deviee(Adresse); // si aiguille locale déviée - if (aig<>0) then Affiche(s+'l''aiguillage suivant '+intToSTR(Aig)+' est dévié',clyellow); + if (aig<>0) then s:=s+'l''aiguillage suivant '+intToSTR(Aig)+' est dévié'+#13; end; + if aspect=vert then s:=s+'la voie en aval est libre'+#13; + // chiffre et signal belge if nation=2 then begin @@ -15522,15 +15535,31 @@ begin begin aig:=feux[i].Adr_el_suiv1; aig:=index_aig(aig); - Affiche(s+'le signal doit être franchi à <'+intToSTR(aiguillage[aig].vitesse)+'km/h',clyellow); + s:=s+'le signal doit être franchi à <'+intToSTR(aiguillage[aig].vitesse)+'km/h'+#13; end; if testbit(combine,chevron) then begin aig:=feux[i].Adr_el_suiv1; aig:=index_aig(aig); - Affiche(s+'l''aiguillage mène à une voie en contresens',clyellow); + s:=s+'l''aiguillage mène à une voie en contresens'+#13; end; end; + infoSignal:=s; +end; + +procedure TFormPrinc.Informationsdusignal1Click(Sender: TObject); +var s: string; + i,adresse : integer; +begin + clicliste:=false; + s:=((Tpopupmenu(Tmenuitem(sender).GetParentMenu).PopupComponent) as TImage).name; // nom du composant, pout récupérer l'adresse du feu (ex: ImageFeu260) + //Affiche(s,clOrange); // nom de l'image du signal (ex: ImageFeu2) + i:=extract_int(s); // extraire l'index (ex 2) + adresse:=feux[i].adresse; + + s:=InfoSignal(adresse); + Affiche_CR(s,clyellow); + end; procedure TFormPrinc.VrifierlacohrenceClick(Sender: TObject); @@ -16082,12 +16111,7 @@ begin end; end; -procedure TFormPrinc.Mosaquehorizontale1Click(Sender: TObject); -begin - mosaiqueH; -end; - -procedure TFormPrinc.Mosaqueverticale1Click(Sender: TObject); +procedure MosaiqueV; var e,topEcran,LeftEcran,i,largEcran,hautEcran,LargTCO,HautTCO,NombreEcrans : integer; nbTCOE : array[1..10] of integer; // nombre de TCO par écran CeTCO : array[1..10] of integer; // nombre de TCO en cours d'affchage par écran @@ -16133,6 +16157,16 @@ begin end; end; +procedure TFormPrinc.Mosaquehorizontale1Click(Sender: TObject); +begin + mosaiqueH; +end; + +procedure TFormPrinc.Mosaqueverticale1Click(Sender: TObject); +begin + mosaiqueV; +end; + procedure TFormPrinc.Mosaiquecarre1Click(Sender: TObject); var topEcran,LeftEcran,i,largEcran,hautEcran,LargTCO,HautTCO : integer; begin @@ -16789,7 +16823,8 @@ end; procedure TFormPrinc.Affichagenormal1Click(Sender: TObject); begin - FenRich.Width:=panel2.Width div 2; + //FenRich.Width:=panel2.Width div 2; + FenRich.Width:=panel2.Width-Panel1.Width-GroupBox1.Width-25; splitterV.Left:=FenRich.left+FenRich.Width-5; positionne_elements(splitterV.Left); end; @@ -16818,16 +16853,19 @@ end; procedure TFormPrinc.StatusBar1DrawPanel(StatusBar: TStatusBar; Panel: TStatusPanel; const Rect: TRect); var - RectForText: TRect; + RectForText: TRect; + i : integer; begin if (Panel = StatusBar.Panels[3]) then begin - StatusBar1.Canvas.Font.Color := clwhite; - StatusBar1.Canvas.Brush.color:=clGreen; - RectForText:=Rect; - StatusBar1.Canvas.FillRect(RectForText); - DrawText(StatusBar1.Canvas.Handle, PChar(Panel.Text), -1, RectForText, - DT_SINGLELINE or DT_VCENTER or DT_LEFT); + if Panel.Text<>'' then + begin + StatusBar1.Canvas.Font.Color := clwhite; + StatusBar1.Canvas.Brush.color:=clGreen; + RectForText:=Rect; + StatusBar1.Canvas.FillRect(RectForText); + DrawText(StatusBar1.Canvas.Handle, PChar(Panel.Text), -1, RectForText,DT_SINGLELINE or DT_VCENTER or DT_LEFT); + end; end; end; diff --git a/UnitTCO.dfm b/UnitTCO.dfm index dd30b19..69b91e4 100644 --- a/UnitTCO.dfm +++ b/UnitTCO.dfm @@ -1,8 +1,8 @@ object FormTCO: TFormTCO - Left = 84 - Top = 164 - Width = 1209 - Height = 575 + Left = 108 + Top = 119 + Width = 1212 + Height = 580 VertScrollBar.Visible = False Caption = 'c' Color = clBtnFace @@ -13,6 +13,7 @@ object FormTCO: TFormTCO Font.Name = 'MS Sans Serif' Font.Style = [] KeyPreview = True + Menu = MainMenuTCO OldCreateOrder = False Position = poScreenCenter OnActivate = FormActivate @@ -22,12 +23,12 @@ object FormTCO: TFormTCO OnKeyPress = FormKeyPress OnMouseWheel = FormMouseWheel DesignSize = ( - 1193 - 536) + 1204 + 529) PixelsPerInch = 96 TextHeight = 13 object LabelZoom: TLabel - Left = 1164 + Left = 1167 Top = 3 Width = 32 Height = 13 @@ -47,16 +48,16 @@ object FormTCO: TFormTCO Height = 121 end object ImageTemp2: TImage - Left = 731 - Top = 252 + Left = 995 + Top = 76 Width = 121 Height = 121 end object ScrollBox: TScrollBox Left = 10 - Top = 15 - Width = 943 - Height = 325 + Top = 7 + Width = 946 + Height = 258 HorzScrollBar.Smooth = True HorzScrollBar.Tracking = True VertScrollBar.Smooth = True @@ -67,13 +68,13 @@ object FormTCO: TFormTCO ParentColor = False TabOrder = 1 DesignSize = ( - 939 - 321) + 942 + 254) object ImageTCO: TImage - Left = 48 - Top = 25 - Width = 642 - Height = 138 + Left = 56 + Top = 33 + Width = 745 + Height = 168 Anchors = [akLeft, akTop, akRight, akBottom] AutoSize = True ParentShowHint = False @@ -87,7 +88,7 @@ object FormTCO: TFormTCO end end object TrackBarZoom: TTrackBar - Left = 1154 + Left = 1157 Top = 18 Width = 41 Height = 311 @@ -105,8 +106,8 @@ object FormTCO: TFormTCO end object Panel1: TPanel Left = 2 - Top = 355 - Width = 1085 + Top = 332 + Width = 1143 Height = 185 Anchors = [akLeft, akRight, akBottom] Color = clActiveBorder @@ -119,7 +120,7 @@ object FormTCO: TFormTCO TabOrder = 2 OnDragOver = Panel1DragOver DesignSize = ( - 1085 + 1143 185) object Label1: TLabel Left = 216 @@ -902,8 +903,8 @@ object FormTCO: TFormTCO ParentFont = False end object ButtonSauveTCO: TButton - Left = 979 - Top = 48 + Left = 1037 + Top = 64 Width = 96 Height = 33 Anchors = [akTop, akRight] @@ -913,73 +914,65 @@ object FormTCO: TFormTCO WordWrap = True OnClick = ButtonSauveTCOClick end - object ButtonRedessine: TButton - Left = 979 - Top = 8 - Width = 96 - Height = 33 - Anchors = [akTop, akRight] - Caption = 'Redessine' - TabOrder = 1 - TabStop = False - OnClick = ButtonRedessineClick - end object Button1: TButton - Left = 900 - Top = 8 + Left = 478 + Top = 152 Width = 57 Height = 25 Anchors = [akTop, akRight] Caption = 'Simu det 1' - TabOrder = 2 + TabOrder = 1 + TabStop = False OnClick = Button1Click end object Button2: TButton - Left = 844 - Top = 8 + Left = 414 + Top = 152 Width = 57 Height = 25 Anchors = [akTop, akRight] Caption = 'Simu Det 0' - TabOrder = 3 + TabOrder = 2 + TabStop = False OnClick = Button2Click end object ButtonConfigTCO: TButton - Left = 979 - Top = 88 + Left = 1037 + Top = 104 Width = 96 Height = 33 Anchors = [akTop, akRight] Caption = 'Configuration TCO' - TabOrder = 4 + TabOrder = 3 TabStop = False OnClick = ButtonConfigTCOClick end object ButtonSimu: TButton - Left = 644 + Left = 566 Top = 152 Width = 113 Height = 25 Anchors = [akTop, akRight] Caption = 'Simu canton occup'#233 - TabOrder = 5 + TabOrder = 4 + TabStop = False OnClick = ButtonSimuClick end object ButtonMasquer: TButton - Left = 979 - Top = 128 + Left = 1037 + Top = 144 Width = 96 Height = 33 Anchors = [akTop, akRight] Caption = 'Masquer bandeau' - TabOrder = 6 + TabOrder = 5 TabStop = False WordWrap = True OnClick = ButtonMasquerClick end object GroupBox1: TGroupBox Left = 16 - Top = 0 + Top = 8 Width = 185 Height = 169 Caption = 'Configuration cellule' @@ -989,7 +982,7 @@ object FormTCO: TFormTCO Font.Name = 'Arial Narrow' Font.Style = [] ParentFont = False - TabOrder = 7 + TabOrder = 6 object Label41: TLabel Left = 8 Top = 24 @@ -1160,30 +1153,31 @@ object FormTCO: TFormTCO end end object buttonRaz: TButton - Left = 873 - Top = 128 + Left = 931 + Top = 144 Width = 97 Height = 33 Anchors = [akTop, akRight] Caption = 'Raz des occupations' - TabOrder = 8 + TabOrder = 7 TabStop = False WordWrap = True OnClick = buttonRazClick end object ButtonCalibrage: TButton - Left = 764 + Left = 686 Top = 152 Width = 75 Height = 25 Anchors = [akTop, akRight] Caption = 'Calibrage' - TabOrder = 9 + TabOrder = 8 + TabStop = False OnClick = ButtonCalibrageClick end object ButtonDessiner: TButton - Left = 873 - Top = 88 + Left = 931 + Top = 104 Width = 97 Height = 33 Hint = @@ -1193,32 +1187,41 @@ object FormTCO: TFormTCO Caption = 'Dessiner le TCO' ParentShowHint = False ShowHint = True - TabOrder = 10 + TabOrder = 9 TabStop = False OnClick = ButtonDessinerClick end object ButtonAffSC: TButton - Left = 873 - Top = 48 + Left = 931 + Top = 64 Width = 97 Height = 33 Anchors = [akTop, akRight] Caption = 'Afficher Signaux Complexes' - TabOrder = 11 + TabOrder = 10 + TabStop = False WordWrap = True OnClick = ButtonAffSCClick end - end - object ButtonAfficheBandeau: TButton - Left = 1132 - Top = 328 - Width = 56 - Height = 32 - Anchors = [akTop, akRight] - Caption = 'Affiche Bandeau' - TabOrder = 3 - WordWrap = True - OnClick = ButtonAfficheBandeauClick + object RadioGroupSel: TRadioGroup + Left = 959 + Top = 8 + Width = 169 + Height = 49 + Anchors = [akTop, akRight] + Caption = 'Outil de s'#233'lection' + Font.Charset = ANSI_CHARSET + Font.Color = clBlack + Font.Height = -9 + Font.Name = 'MS Sans Serif' + Font.Style = [] + Items.Strings = ( + 'Cellules s'#233'lectionn'#233'es' + 'fen'#234'tre d'#233'pla'#231'able') + ParentFont = False + TabOrder = 11 + OnClick = RadioGroupSelClick + end end object PopupMenu1: TPopupMenu OnPopup = PopupMenu1Popup @@ -1336,4 +1339,55 @@ object FormTCO: TFormTCO Left = 448 Top = 432 end + object MainMenuTCO: TMainMenu + Left = 1000 + Top = 48 + object MenuTCO: TMenuItem + Caption = 'TCO' + object SauvegarderleTCO1: TMenuItem + Caption = 'Sauvegarder le TCO' + OnClick = SauvegarderleTCO1Click + end + object N8: TMenuItem + Caption = '-' + end + object DessinerleTCO1: TMenuItem + Caption = 'Dessiner le TCO' + OnClick = DessinerleTCO1Click + end + object ConfigurationduTCO1: TMenuItem + Caption = 'Configuration du TCO' + OnClick = ConfigurationduTCO1Click + end + object N9: TMenuItem + Caption = '-' + end + object Redessine1: TMenuItem + Caption = 'Redessine' + OnClick = Redessine1Click + end + end + object Affichebandeau1: TMenuItem + Caption = 'Affiche bandeau' + OnClick = Affichebandeau1Click + end + object Affichage1: TMenuItem + Caption = 'Affichage' + object Mosaquehorizontale1: TMenuItem + Caption = 'Mosa'#239'que horizontale' + OnClick = Mosaquehorizontale1Click + end + object Mosaqueverticale1: TMenuItem + Caption = 'Mosa'#239'que verticale' + OnClick = Mosaqueverticale1Click + end + object N10: TMenuItem + Caption = '-' + end + object AfficherSignauxComplexes1: TMenuItem + Caption = 'Afficher Signaux Complexes' + OnClick = AfficherSignauxComplexes1Click + end + end + end end diff --git a/UnitTCO.pas b/UnitTCO.pas index 1f7f230..affd358 100644 --- a/UnitTCO.pas +++ b/UnitTCO.pas @@ -34,7 +34,6 @@ type Label11: TLabel; Label50: TLabel; ButtonSauveTCO: TButton; - ButtonRedessine: TButton; Button1: TButton; Button2: TButton; LabelZoom: TLabel; @@ -52,7 +51,6 @@ type Label19: TLabel; Label20: TLabel; ButtonMasquer: TButton; - ButtonAfficheBandeau: TButton; Label21: TLabel; Label22: TLabel; Label51: TLabel; @@ -140,6 +138,22 @@ type ImagePalette52: TImage; Label52: TLabel; ButtonAffSC: TButton; + RadioGroupSel: TRadioGroup; + MainMenuTCO: TMainMenu; + MenuTCO: TMenuItem; + SauvegarderleTCO1: TMenuItem; + N8: TMenuItem; + DessinerleTCO1: TMenuItem; + ConfigurationduTCO1: TMenuItem; + N9: TMenuItem; + Redessine1: TMenuItem; + Affichebandeau1: TMenuItem; + Affichage1: TMenuItem; + Mosaquehorizontale1: TMenuItem; + Mosaqueverticale1: TMenuItem; + N10: TMenuItem; + AfficherSignauxComplexes1: TMenuItem; + //TimerTCO: TTimer; procedure FormCreate(Sender: TObject); procedure FormActivate(Sender: TObject); procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); @@ -240,7 +254,6 @@ type procedure ImagePalette20EndDrag(Sender, Target: TObject; X, Y: Integer); procedure ButtonMasquerClick(Sender: TObject); - procedure ButtonAfficheBandeauClick(Sender: TObject); procedure ImagePalette21EndDrag(Sender, Target: TObject; X, Y: Integer); procedure ImagePalette22EndDrag(Sender, Target: TObject; X, @@ -399,9 +412,20 @@ type procedure ImagePalette52MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); procedure ButtonAffSCClick(Sender: TObject); - - private + procedure RadioGroupSelClick(Sender: TObject); + procedure SauvegarderleTCO1Click(Sender: TObject); + procedure DessinerleTCO1Click(Sender: TObject); + procedure ConfigurationduTCO1Click(Sender: TObject); + procedure Redessine1Click(Sender: TObject); + procedure Affichebandeau1Click(Sender: TObject); + procedure Mosaquehorizontale1Click(Sender: TObject); + procedure Mosaqueverticale1Click(Sender: TObject); + procedure AfficherSignauxComplexes1Click(Sender: TObject); + // procedure TimerTCOTimer(Sender: TObject); + + private { Déclarations privées } + function index_TCOMainMenu : integer; public { Déclarations publiques } end; @@ -444,7 +468,7 @@ type // structure d'une cellule du TCO TTCO = record Adresse : integer; // adresse du détecteur ou de l'aiguillage ou du feu - BImage : integer; // 0=rien 1=voie 2=aiguillage gauche gauche ... 50=feu + BImage : integer; // icone: 0=rien 1=voie 2=aiguillage gauche ... 50=feu mode : integer; // couleur de voie 0=éteint 1=ClVoies 2=couleur en fonction du train trajet : integer; // décrit le trajet ouvert sur la voie (cas d'un croisement ou d'une tjd/S) inverse : boolean; // aiguillage piloté inversé @@ -466,21 +490,30 @@ type buttoir : integer; // définition des buttoirs : si le bit n est à 1 : buttoir end; + Trect_Select= record + NumTCO : integer; // affection du rectangle à ce tco + Gd, // grand rectangle + rN,rE,rS,rO,rNE,rNO,rSE,rSO : Trect; // poignées + end; + var - clAllume,clVoies,clFond,couleurAdresse,clGrille,cltexte,clQuai,CoulFonte,ClCanton,clPiedSignal : Tcolor; + couleurAdresse,cltexte,CoulFonte : Tcolor; formTCO : array[1..10] of TformTCO; + //TCO_Timer : array[1..10] of Ttimer; - TamponAffecte,TCO_modifie,clicsouris, - clicTCO,piloteAig,BandeauMasque,eval_format,sauve_tco, + TamponAffecte,TCO_modifie,clicsouris,prise_N, + clicTCO,piloteAig,BandeauMasque,eval_format,sauve_tco,prise_droit,prise_haut, + prise_bas,prise_gauche,prise_NE,prise_NO,prise_SE,prise_SO, drag,TCOActive,TCOCree,ancienok,dbleClicTCO,auto_tcurs,EvtClicDet : boolean; HtImageTCO,LargImageTCO,XminiSel,YminiSel,XCoupe,Ycoupe,Temposouris, XmaxiSel,YmaxiSel,AncienXMiniSel,AncienXMaxiSel,AncienYMiniSel,AncienYMaxiSel, Xclic,Yclic,XClicCellInserer,YClicCellInserer,RatioC,ModeCouleurCanton, - AncienXClicCell,AncienYClicCell,TCODrag,epaisseur_voies, + AncienXClicCell,AncienYClicCell,TCODrag,epaisseur_voies,Ax,Ay,TpsBougeSouris, Epaisseur,oldX,oldY,offsetSourisY,offsetSourisX,AvecVerifIconesTCO,indexTrace,IndexTCOCourant, - ancienTraceX,ancienTraceY,rangUndo,NbreTCO,IndexTCOCreate: integer; + ancienTraceX,ancienTraceY,rangUndo,NbreTCO,IndexTCOCreate,deltaXrect,deltaYrect, + CellX,CellY : integer; titre_Fonte : string; @@ -498,6 +531,9 @@ var numTCO,x1,y1,x2,y2,NbreCellX,NbreCellY : integer; end; + Rect_select : Trect_Select; + Sauv_rect_select : Trect; + routeTCO : array[1..500] of record x,y : integer; end; @@ -513,7 +549,8 @@ var // liste des variables par tco largeurCelld2,HauteurCelld2,NbCellulesTCO,NbreCellX,NbreCellY,LargeurCell,HauteurCell, - Xentoure,Yentoure,XclicCell,YclicCell,EcranTCO : array[1..10] of integer; + Xentoure,Yentoure,XclicCell,YclicCell,EcranTCO,clGrille,clFond,ClAllume,ClVoies, + ClCanton,clPiedSignal,ClQuai,ClBarriere : array[1..10] of integer; PcanvasTCO : array[1..10] of Tcanvas; PBitMapTCO : array[1..10] of TbitMap; PImageTCO,PImageTemp : array[1..10] of Timage; @@ -539,7 +576,6 @@ procedure Vertical(indexTCO : integer); procedure signalG(indexTCO : integer); procedure signalD(indexTCO : integer); procedure lire_fichier_tco(indexTCO : integer); -procedure grise_ligne_tco(indexTCO : integer); procedure change_couleur_fond(indexTCO : integer); function verif_cellule(IndexTCO,x,y,Bim : integer) : boolean; procedure dessine_icones(indexTCO : integer); @@ -588,45 +624,355 @@ end; // le tampon est aussi grand que le x/y du plus grand TCO procedure init_tampon_copiercoller; -var i,x,y : integer; begin - x:=0;y:=0; - // trouver le plus grand X et Y de chaque TCO - for i:=1 to NbreTCO do + SetLength(TamponTCO,MaxCellX+2,MaxCellY+2); +end; + +// affiche le rectangle de sélection graphique +Procedure Affiche_Rectangle(IndexTCO : integer;r : Trect_Select); +begin + if indexTCO<1 then exit; + with PCanvasTCO[IndexTCO] do begin - if NbreCellX[i]>x then x:=NbreCellX[i]; - if NbreCellY[i]>y then y:=NbreCellY[i]; + with pen do + begin + Mode:=PmXor; + color:=clWhite; + width:=1; + end; + Brush.Color:=clblue; + + Rectangle(r.Gd); // Grand rectangle + Rectangle(r.rN); // rectangle poignée haut + Rectangle(r.rE); + Rectangle(r.rO); + Rectangle(r.rS); + Rectangle(r.rNE); + Rectangle(r.rNO); + Rectangle(r.rSO); + Rectangle(r.rSE); end; - SetLength(TamponTCO,x+2,y+2); +end; + +// calcule les poignées du rectangle de sélection graphique +procedure Init_rectangle(IndexTCO : integer;var r : Trect_Select); +var xp,yp : integer; +begin + with r do + begin + // poignée nord (haut) + xp:=(r.Gd.right+r.Gd.Left) div 2; + yp:=r.Gd.Top; + rn.Left:=xp-5; + rn.top:=yp-5; + rn.Right:=xp+5; + rn.Bottom:=yp+5; + + // poignée droite + xp:=r.Gd.Right; + yp:=(r.Gd.Bottom+r.Gd.top) div 2; + rE.Left:=xp-5; + re.top:=yp-5; + re.Right:=xp+5; + re.Bottom:=yp+5; + + // poignée bas + xp:=(r.gd.right+r.gd.Left) div 2; + yp:=r.gd.Bottom; + rS.Left:=xp-5; + rs.top:=yp-5; + rs.Right:=xp+5; + rs.Bottom:=yp+5; + + // poignée gauche + xp:=r.gd.Left; + yp:=(r.gd.Bottom+r.gd.top) div 2; + rO.Left:=xp-5; + rO.top:=yp-5; + ro.Right:=xp+5; + ro.Bottom:=yp+5; + + // nord est + xp:=r.gd.right; + yp:=r.gd.top; + rNE.Left:=xp-5; + rNE.top:=yp-5; + rNE.Right:=xp+5; + rNE.Bottom:=yp+5; + + // sud est + xp:=r.gd.right; + yp:=r.gd.bottom; + rSE.Left:=xp-5; + rSE.top:=yp-5; + rSE.Right:=xp+5; + rSE.Bottom:=yp+5; + + // sud ouest + xp:=r.gd.left; + yp:=r.gd.bottom; + rSO.Left:=xp-5; + rSO.top:=yp-5; + rSO.Right:=xp+5; + rSO.Bottom:=yp+5; + + // nord ouest + xp:=r.gd.left; + yp:=r.gd.top; + rNO.Left:=xp-5; + rNO.top:=yp-5; + rNO.Right:=xp+5; + rNO.Bottom:=yp+5; + end; +end; + +// Accroche les poignées et bouge le rectangle de sélection graphique +procedure Accroche_Rectangle_selection(indexTCO,x,y : integer); +var dx,dy : integer; + r : Trect; + rien : boolean; +begin + rien:=not(prise_droit) and not(prise_bas) and not(prise_gauche) and not(prise_haut) and not(prise_NE) and not(prise_NO) and not(prise_SE) and not(prise_SO); + + //poignée haut + r:=Rect_Select.rN; + if ((x>=r.left) and (x<=r.Right) and (y>=r.top) and (y<=r.bottom)) or prise_haut then + begin + screen.cursor:=crSizeNS; + //if (not(prise_droit) and not(prise_bas) and not(prise_gauche) and not(prise_NE) and not(prise_NO) and not(prise_SE) and not(prise_SO)) and clicsouris then + if (rien and clicsouris) or prise_haut then + begin + // efface l'ancien + Affiche_Rectangle(IndexTCO,Rect_select); + if y=r.left) and (x<=r.Right) and (y>=r.top) and (y<=r.bottom)) or prise_droit) then + begin + screen.cursor:=crSizeWE; + //if (not(prise_haut) and not(prise_bas) and not(prise_gauche) and not(prise_NE) and not(prise_NO) and not(prise_SE) and not(prise_SO)) and clicsouris then + if (rien and clicsouris) or prise_droit then + begin + // efface l'ancien + Affiche_Rectangle(IndexTCO,Rect_select); + prise_droit:=true; + if x>rect_select.Gd.Left then + begin + rect_Select.gd.right:=x; + end + else + begin + // inversion + rect_Select.gd.left:=x; + end; + init_rectangle(indexTCO,rect_select); + Affiche_Rectangle(indexTCO,rect_Select); + end; + exit; + end; + + // poignée bas + r:=Rect_Select.rS; + if (((x>=r.left) and (x<=r.Right) and (y>=r.top) and (y<=r.bottom)) or prise_bas) then + begin + screen.cursor:=crSizeNS; + if (rien and clicsouris) or prise_bas then + begin + // efface l'ancien + Affiche_Rectangle(IndexTCO,Rect_select); + prise_bas:=true; + if y>rect_select.Gd.top then + begin + rect_Select.gd.bottom:=y; + end + else + begin + // inversion + rect_Select.gd.top:=y; + end; + init_rectangle(indexTCO,rect_select); + Affiche_Rectangle(indexTCO,rect_Select); + end; + exit; + end; + + // poignée gauche + r:=Rect_Select.rO; + if (((x>=r.left) and (x<=r.Right) and (y>=r.top) and (y<=r.bottom)) or prise_gauche) then + begin + screen.cursor:=crSizeWE; + if (rien and clicsouris) or prise_gauche then + begin + // efface l'ancien + Affiche_Rectangle(IndexTCO,Rect_select); + prise_gauche:=true; + if x=r.left) and (x<=r.Right) and (y>=r.top) and (y<=r.bottom)) or prise_NE) then + begin + screen.cursor:=crSizeNESW; + if (rien and clicsouris) or prise_NE then + begin + // efface l'ancien + Affiche_Rectangle(IndexTCO,Rect_select); + prise_NE:=true; + rect_Select.gd.right:=x; + rect_Select.gd.top:=y; + init_rectangle(indexTCO,rect_select); + Affiche_Rectangle(indexTCO,rect_Select); + end; + exit; + end; + + // poignée NO + r:=Rect_Select.rNO; + if (((x>=r.left) and (x<=r.Right) and (y>=r.top) and (y<=r.bottom)) or prise_NO) then + begin + screen.cursor:=crSizeNWSE; + if (rien and clicsouris) or prise_NO then + begin + // efface l'ancien + Affiche_Rectangle(IndexTCO,Rect_select); + prise_NO:=true; + rect_Select.gd.left:=x; + rect_Select.gd.top:=y; + init_rectangle(indexTCO,rect_select); + Affiche_Rectangle(indexTCO,rect_Select); + end; + exit; + end; + + // poignée SE + r:=Rect_Select.rSE; + if (((x>=r.left) and (x<=r.Right) and (y>=r.top) and (y<=r.bottom)) or prise_SE) then + begin + screen.cursor:=crSizeNWSE; + if (rien and clicsouris) or prise_SE then + begin + // efface l'ancien + Affiche_Rectangle(IndexTCO,Rect_select); + prise_SE:=true; + rect_Select.gd.right:=x; + rect_Select.gd.bottom:=y; + init_rectangle(indexTCO,rect_select); + Affiche_Rectangle(indexTCO,rect_Select); + end; + exit; + end; + + // poignée SO + r:=Rect_Select.rSO; + if (((x>=r.left) and (x<=r.Right) and (y>=r.top) and (y<=r.bottom)) or prise_SO) then + begin + screen.cursor:=crSizeNESW; + if (rien and clicsouris) or prise_SO then + begin + // efface l'ancien + Affiche_Rectangle(IndexTCO,Rect_select); + prise_SO:=true; + rect_Select.gd.left:=x; + rect_Select.gd.bottom:=y; + init_rectangle(indexTCO,rect_select); + Affiche_Rectangle(indexTCO,rect_Select); + end; + exit; + end; + + // selec ractangle : bouger en toutes directions + r:=Rect_select.Gd; + if ((y>r.top) and (yr.Left) and (x0 then begin Affiche('ETCO3',clred);closefile(fichier);exit;end; if coulFonte=0 then - begin coulFonte:=clfond;sauve_tco:=true;end; + begin coulFonte:=clfond[indexTCO];sauve_tco:=true;end; tco[indexTCO,x,y].CouleurFond:=coulFonte; delete(s,1,i); @@ -1129,14 +1475,14 @@ begin AssignFile(fichier,nomfichierTCO[i]); rewrite(fichier); Writeln(fichier,'/ Définitions TCO version '+version+sousversion); - Writeln(fichier,clFond_ch+'='+IntToHex(clfond,6)); - Writeln(fichier,clVoies_ch+'='+IntToHex(ClVoies,6)); - Writeln(fichier,clAllume_ch+'='+IntToHex(ClAllume,6)); - Writeln(fichier,clGrille_ch+'='+IntToHex(ClGrille,6)); + Writeln(fichier,clFond_ch+'='+IntToHex(clfond[i],6)); + Writeln(fichier,clVoies_ch+'='+IntToHex(ClVoies[i],6)); + Writeln(fichier,clAllume_ch+'='+IntToHex(ClAllume[i],6)); + Writeln(fichier,clGrille_ch+'='+IntToHex(ClGrille[i],6)); Writeln(fichier,clTexte_ch+'='+IntToHex(ClTexte,6)); - Writeln(fichier,clQuai_ch+'='+IntToHex(ClQuai,6)); - Writeln(fichier,clPiedSignal_ch+'='+intToHex(clPiedSignal,6)); - Writeln(fichier,ClCanton_ch+'='+IntToHex(ClCanton,6)); + Writeln(fichier,clQuai_ch+'='+IntToHex(ClQuai[i],6)); + Writeln(fichier,clPiedSignal_ch+'='+intToHex(clPiedSignal[i],6)); + Writeln(fichier,ClCanton_ch+'='+IntToHex(ClCanton[i],6)); Writeln(fichier,ModeCouleurCanton_ch+'='+intToSTR(ModeCouleurCanton)); if avecGrille[i] then s:='1' else s:='0'; Writeln(fichier,Avecgrille_ch+'='+s); @@ -1216,7 +1562,7 @@ begin; Yorg:=(y-1)*HauteurCell[indexTCO]; With PcanvasTCO[indexTCO] do begin - Pen.Color:=clGrille; + Pen.Color:=clGrille[IndexTCO]; Pen.mode:=PmCopy; Pen.width:=1; MoveTo(Xorg,YOrg); @@ -1269,6 +1615,22 @@ begin Canvas.Arc(x1,y1,x2,y2,x3,y3,x4,y4); end; +procedure affiche_selection(indexTCO : integer); +var r : Trect; +begin +with PImageTCO[indexTCO].Canvas do + begin + Pen.Mode:=PmXor; + Pen.color:=clGrille[IndexTCO]; + Brush.Color:=clblue; + //FillRect(r); + r:=Rect(xminiSel+1,YminiSel+1,XmaxiSel+LargeurCell[indexTCO],yMaxiSel+hauteurCell[indexTCO]); + + Rectangle(r); + end; +end; + + procedure efface_selection(indexTCO : integer); begin if SelectionAffichee[indexTCO] then @@ -1277,7 +1639,7 @@ begin with formtco[indexTCO].imageTCO.Canvas do begin Pen.Mode:=PmXor; - Pen.color:=clGrille; + Pen.color:=clGrille[IndexTCO]; Brush.Color:=clblue; //FillRect(r); Rectangle(rAncien); @@ -1314,8 +1676,8 @@ begin if but<>0 then begin case mode of - 0 : couleur:=clVoies; - 1 : couleur:=clAllume; + 0 : couleur:=clVoies[indexTCO]; + 1 : couleur:=clAllume[indexTCO]; 2 : couleur:=couleurtrain[index_couleur]; end; pen.color:=couleur; @@ -1344,8 +1706,8 @@ begin begin if detecteur[Adr].etat then begin - brush.Color:=clAllume; - pen.color:=clAllume; + brush.Color:=clAllume[indexTCO]; + pen.color:=clAllume[indexTCO]; end else begin @@ -1363,8 +1725,8 @@ begin jy1:=y0+(HauteurCell[indexTCO] div 2); case mode of - 0 : couleur:=clVoies; - 1 : couleur:=clAllume; + 0 : couleur:=clVoies[indexTCO]; + 1 : couleur:=clAllume[indexTCO]; 2 : couleur:=couleurtrain[index_couleur]; end; pen.color:=couleur; @@ -1374,7 +1736,7 @@ begin end; end; -// renvoie vrai si l'élément i est un aiguillage ou une TJD/S +// renvoie vrai si l'élément i est un aiguillage ou une TJD/S ou un croisement function IsAigTCO(i : integer) : boolean; begin result:=((i=2) or (i=3) or (i=4) or (i=5) or (i=12) or (i=13) or (i=14) or @@ -1464,7 +1826,7 @@ begin c:=PcanvasTCO[indextco]; b:=tco[indextco,x,y].BImage; - if (b=51) then PCanvasTCO[indextco].Brush.Color:=clQuai else PCanvasTCO[indextco].Brush.Color:=tco[indextco,x,y].CouleurFond; + if (b=51) then PCanvasTCO[indextco].Brush.Color:=clQuai[indexTCO] else PCanvasTCO[indextco].Brush.Color:=tco[indextco,x,y].CouleurFond; c.Font.Color:=tco[indextco,x,y].CoulFonte; ss:=tco[indextco,x,y].fonte; if ss='' then ss:='Arial'; @@ -1549,12 +1911,12 @@ var i,j,x0,y0,xc,yc,jy2,xf,yf,position,jy1,connect1,connect2,connect3,connect4 : procedure trajet_droit; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_droit then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -1578,12 +1940,12 @@ var i,j,x0,y0,xc,yc,jy2,xf,yf,position,jy1,connect1,connect2,connect3,connect4 : procedure trajet_devie; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_devie then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -1646,8 +2008,8 @@ begin Pen.Color:=fond; Pen.Width:=epaisseur; - Brush.Color:=clVoies; - Pen.Color:=clVoies; + Brush.Color:=clVoies[indexTCO]; + Pen.Color:=clVoies[indexTCO]; Pen.Mode:=pmCopy; if mode>0 then @@ -1702,12 +2064,12 @@ var x0,y0,xc,yc,jy2,xf,yf,position,jy1,ep : integer; procedure trajet_droit; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_droit then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -1724,16 +2086,16 @@ var x0,y0,xc,yc,jy2,xf,yf,position,jy1,ep : integer; procedure trajet_devie; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_devie then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; - + with canvas do begin pen.color:=couleur; @@ -1762,8 +2124,8 @@ begin Pen.Color:=fond; Pen.Width:=epaisseur; - Brush.Color:=clVoies; - Pen.Color:=clVoies; + Brush.Color:=clVoies[indexTCO]; + Pen.Color:=clVoies[indexTCO]; Pen.Mode:=pmCopy; if mode>0 then @@ -1820,12 +2182,12 @@ var x0,y0,xc,yc,jy2,xf,yf,position,x1,y1,x2,y2,x3,y3,x4,y4,ep : integer; procedure trajet_droit; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_droit then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -1842,12 +2204,12 @@ var x0,y0,xc,yc,jy2,xf,yf,position,x1,y1,x2,y2,x3,y3,x4,y4,ep : integer; procedure trajet_devie; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_devie then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -1885,8 +2247,8 @@ begin Pen.Color:=fond; Pen.Width:=epaisseur; - Brush.Color:=clVoies; - Pen.Color:=clVoies; + Brush.Color:=clVoies[indexTCO]; + Pen.Color:=clVoies[indexTCO]; Pen.Mode:=pmCopy; if mode>0 then @@ -1949,12 +2311,12 @@ var x0,y0,xc,yc,jy1,xf,yf,position,ep : integer; procedure trajet_droit; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_droit then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -1971,12 +2333,12 @@ var x0,y0,xc,yc,jy1,xf,yf,position,ep : integer; procedure trajet_devie; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_devie then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -2009,8 +2371,8 @@ begin Pen.Color:=fond; Pen.Width:=epaisseur; - Brush.Color:=clVoies; - Pen.Color:=clVoies; + Brush.Color:=clVoies[indexTCO]; + Pen.Color:=clVoies[indexTCO]; Pen.Mode:=pmCopy; if mode>0 then @@ -2062,12 +2424,12 @@ var x0,y0,xc,yc,jy1,xf,yf,position,x1,y1,x2,y2,x3,y3,x4,y4,ep : integer; procedure trajet_droit; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_droit then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -2084,12 +2446,12 @@ var x0,y0,xc,yc,jy1,xf,yf,position,x1,y1,x2,y2,x3,y3,x4,y4,ep : integer; procedure trajet_devie; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_devie then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -2119,7 +2481,6 @@ begin position:=positionTCO(indexTCO,x,y); fond:=tco[indextco,x,y].CouleurFond; - efface_selection(1); with canvas do begin @@ -2128,8 +2489,8 @@ begin Pen.Color:=fond; Pen.Width:=epaisseur; - Brush.Color:=clVoies; - Pen.Color:=clVoies; + Brush.Color:=clVoies[indexTCO]; + Pen.Color:=clVoies[indexTCO]; Pen.Mode:=pmCopy; if mode>0 then @@ -2202,12 +2563,12 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; fond : tcolor; procedure trajet_droit; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_droit then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -2224,12 +2585,12 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; procedure trajet_devie; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_devie then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -2262,8 +2623,8 @@ begin Pen.Color:=fond; Pen.Width:=epaisseur; - Brush.Color:=clVoies; - Pen.Color:=clVoies; + Brush.Color:=clVoies[indexTCO]; + Pen.Color:=clVoies[indexTCO]; Pen.Mode:=pmCopy; if mode>0 then @@ -2285,7 +2646,7 @@ begin trajet_devie; trajet_droit; end; - + if (position=const_Devie) then begin // effacement du morceau @@ -2321,12 +2682,12 @@ var x0,y0,xc,yc,xf,yf,x1,y1,x2,y2,x3,y3,x4,y4,position,ep : integer; procedure trajet_droit; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_droit then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -2343,12 +2704,12 @@ var x0,y0,xc,yc,xf,yf,x1,y1,x2,y2,x3,y3,x4,y4,position,ep : integer; procedure trajet_devie; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_devie then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -2387,8 +2748,8 @@ begin Pen.Color:=fond; Pen.Width:=epaisseur; - Brush.Color:=clVoies; - Pen.Color:=clVoies; + Brush.Color:=clVoies[indexTCO]; + Pen.Color:=clVoies[indexTCO]; Pen.Mode:=pmCopy; if mode>0 then @@ -2453,21 +2814,21 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; procedure trajet_droit; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_droit then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; - with canvas do + with canvas do begin if testbit(ep,7) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; pen.color:=couleur; - moveto(x0,yc);lineto(xc,yc); + moveto(x0,yc);lineto(xc,yc); if testbit(ep,3) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; lineto(xf,yc); end; @@ -2475,18 +2836,18 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; procedure trajet_devie; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_devie then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; with canvas do - begin + begin pen.color:=couleur; if testbit(ep,0) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; moveto(x0,y0);lineto(xc,yc); @@ -2494,7 +2855,7 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; lineto(xf,yc); end; end; - + begin x0:=(x-1)*LargeurCell[indexTCO]; // x origine y0:=(y-1)*hauteurCell[indexTCO]; // y origine @@ -2513,8 +2874,8 @@ begin Pen.Color:=fond; Pen.Width:=epaisseur; - Brush.Color:=clVoies; - Pen.Color:=clVoies; + Brush.Color:=clVoies[indexTCO]; + Pen.Color:=clVoies[indexTCO]; Pen.Mode:=pmCopy; if mode>0 then @@ -2572,12 +2933,12 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; procedure trajet_droit; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_droit then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -2594,12 +2955,12 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; procedure trajet_devie; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_devie then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -2636,8 +2997,8 @@ begin Pen.Color:=fond; Pen.Width:=epaisseur; - Brush.Color:=clVoies; - Pen.Color:=clVoies; + Brush.Color:=clVoies[indexTCO]; + Pen.Color:=clVoies[indexTCO]; Pen.Mode:=pmCopy; if mode>0 then @@ -2711,8 +3072,8 @@ begin Pen.Width:=1; case mode of - 0: couleur:=clVoies; - 1: couleur:=ClCanton; + 0: couleur:=clVoies[indexTCO]; + 1: couleur:=ClCanton[indexTCO]; 2: couleur:=couleurtrain[index_couleur]; end; Pen.Width:=epaisseur; @@ -2750,8 +3111,8 @@ begin Pen.Width:=1; case mode of - 0: couleur:=clVoies; - 1: couleur:=ClCanton; + 0: couleur:=clVoies[indexTCO]; + 1: couleur:=ClCanton[indexTCO]; 2: couleur:=couleurtrain[index_couleur]; end; @@ -2787,8 +3148,8 @@ begin //FillRect(r); case mode of - 0: couleur:=clVoies; - 1: couleur:=ClCanton; + 0: couleur:=clVoies[indexTCO]; + 1: couleur:=ClCanton[indexTCO]; 2: couleur:=couleurtrain[index_couleur]; end; Brush.Color:=Couleur; @@ -2827,8 +3188,8 @@ begin //FillRect(r); case mode of - 0: couleur:=clVoies; - 1: couleur:=ClCanton; + 0: couleur:=clVoies[indexTCO]; + 1: couleur:=ClCanton[indexTCO]; 2: couleur:=couleurtrain[index_couleur]; end; Brush.Color:=Couleur; @@ -2863,8 +3224,8 @@ begin //FillRect(r); case mode of - 0: couleur:=clVoies; - 1: couleur:=ClCanton; + 0: couleur:=clVoies[indexTCO]; + 1: couleur:=ClCanton[indexTCO]; 2: couleur:=couleurtrain[index_couleur]; end; Brush.Color:=Couleur; @@ -2903,8 +3264,8 @@ begin //FillRect(r); case mode of - 0: couleur:=clVoies; - 1: couleur:=ClCanton; + 0: couleur:=clVoies[indexTCO]; + 1: couleur:=ClCanton[indexTCO]; 2: couleur:=couleurtrain[index_couleur]; end; Brush.Color:=Couleur; @@ -2939,8 +3300,8 @@ begin //FillRect(r); case mode of - 0: couleur:=clVoies; - 1: couleur:=ClCanton; + 0: couleur:=clVoies[indexTCO]; + 1: couleur:=ClCanton[indexTCO]; 2: couleur:=couleurtrain[index_couleur]; end; Brush.Color:=Couleur; @@ -2982,8 +3343,8 @@ begin //FillRect(r); case mode of - 0: couleur:=clVoies; - 1: couleur:=ClCanton; + 0: couleur:=clVoies[indexTCO]; + 1: couleur:=ClCanton[indexTCO]; 2: couleur:=couleurtrain[index_couleur]; end; Brush.Color:=Couleur; @@ -3025,8 +3386,8 @@ begin if but<>0 then begin case mode of - 0 : couleur:=clVoies; - 1 : couleur:=clAllume; + 0 : couleur:=clVoies[indexTCO]; + 1 : couleur:=clAllume[indexTCO]; 2 : couleur:=couleurtrain[index_couleur]; end; pen.color:=couleur; @@ -3054,23 +3415,22 @@ begin begin if detecteur[Adr].etat then begin - brush.Color:=clAllume; - pen.color:=clAllume; + brush.Color:=clAllume[indexTCO]; + pen.color:=clAllume[indexTCO]; end else begin pen.color:=tco[indextco,x,y].CouleurFond; brush.color:=tco[indextco,x,y].CouleurFond; end; - // if avecGrille then r:=Rect(x0+1,jy1,x0+LargeurCell[indexTCO]-1,jy2) else pen.Width:=epaisseur+3; MoveTo(x0+LargeurCell[indexTCO],y0);LineTo(x0,y0+hauteurCell[indexTCO]); end; // voie case mode of - 0 : couleur:=clVoies; - 1 : couleur:=clAllume; + 0 : couleur:=clVoies[indexTCO]; + 1 : couleur:=clAllume[indexTCO]; 2 : couleur:=couleurtrain[index_couleur]; end; pen.color:=couleur; @@ -3101,8 +3461,8 @@ begin if testbit(but,0) or testbit(but,4) then begin case mode of - 0 : couleur:=clVoies; - 1 : couleur:=clAllume; + 0 : couleur:=clVoies[indexTCO]; + 1 : couleur:=clAllume[indexTCO]; 2 : couleur:=couleurtrain[index_couleur]; end; pen.color:=couleur; @@ -3131,8 +3491,8 @@ begin begin if detecteur[Adr].etat then begin - brush.Color:=clAllume; - pen.color:=clAllume; + brush.Color:=clAllume[indexTCO]; + pen.color:=clAllume[indexTCO]; end else begin @@ -3146,8 +3506,8 @@ begin // voie case mode of - 0 : couleur:=clVoies; - 1 : couleur:=clAllume; + 0 : couleur:=clVoies[indexTCO]; + 1 : couleur:=clAllume[indexTCO]; 2 : couleur:=couleurtrain[index_couleur]; end; pen.color:=couleur; @@ -3165,12 +3525,12 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; procedure trajet_droit; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_droit then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -3187,12 +3547,12 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; procedure trajet_devie; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_devie then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -3230,8 +3590,8 @@ begin //FillRect(r); // efface la cellule Pen.Width:=epaisseur; - Brush.Color:=clVoies; - Pen.Color:=clVoies; + Brush.Color:=clVoies[indexTCO]; + Pen.Color:=clVoies[indexTCO]; Pen.Mode:=pmCopy; if (position=const_Devie) or (position=const_inconnu) then @@ -3277,12 +3637,12 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; fond : tcolor; procedure trajet_droit; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_droit then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -3292,20 +3652,20 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; pen.color:=couleur; if testbit(ep,0) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; pen.color:=couleur; - moveto(x0,y0);lineto(xc,yc); + moveto(x0,y0);lineto(xc,yc); if testbit(ep,4) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; - lineto(xf,yf); + lineto(xf,yf); end; end; procedure trajet_devie; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_devie then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -3343,8 +3703,8 @@ begin Brush.Color:=fond; Pen.Color:=fond; Pen.Width:=epaisseur; - Brush.Color:=clVoies; - Pen.Color:=clVoies; + Brush.Color:=clVoies[indexTCO]; + Pen.Color:=clVoies[indexTCO]; Pen.Mode:=pmCopy; if mode>0 then @@ -3412,12 +3772,12 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,position,ep : integer; procedure trajet_droit; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_droit then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -3434,12 +3794,12 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,position,ep : integer; procedure trajet_devie; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_devie then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -3474,8 +3834,8 @@ begin //FillRect(r); // efface la cellule Pen.Width:=epaisseur; - Brush.Color:=clVoies; - Pen.Color:=clVoies; + Brush.Color:=clVoies[indexTCO]; + Pen.Color:=clVoies[indexTCO]; Pen.Mode:=pmCopy; if (position=const_Devie) or (position=const_inconnu) then @@ -3522,12 +3882,12 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; procedure trajet_droit; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_droit then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -3537,7 +3897,7 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; pen.color:=couleur; if testbit(ep,2) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; pen.color:=couleur; - moveto(xf,y0);lineto(xc,yc); + moveto(xf,y0);lineto(xc,yc); if testbit(ep,6) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; lineto(x0,yf); end; @@ -3545,12 +3905,12 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; procedure trajet_devie; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_devie then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -3589,8 +3949,8 @@ begin Pen.Color:=fond; Pen.Width:=epaisseur; - Brush.Color:=clVoies; - Pen.Color:=clVoies; + Brush.Color:=clVoies[indexTCO]; + Pen.Color:=clVoies[indexTCO]; Pen.Mode:=pmCopy; if mode>0 then @@ -3656,12 +4016,12 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; procedure trajet_droit; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_droit then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -3670,7 +4030,7 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; begin if testbit(ep,7) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; pen.color:=couleur; - moveto(x0,y0);lineto(xc,yc); + moveto(x0,y0);lineto(xc,yc); if testbit(ep,3) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; lineto(xf,yf); end; @@ -3678,12 +4038,12 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; procedure trajet_devie; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_devie then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -3717,8 +4077,8 @@ begin //FillRect(r); // efface la cellule Pen.Width:=epaisseur; - Brush.Color:=clVoies; - Pen.Color:=clVoies; + Brush.Color:=clVoies[indexTCO]; + Pen.Color:=clVoies[indexTCO]; Pen.Mode:=pmCopy; if mode>0 then @@ -3775,12 +4135,12 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position : integer; procedure trajet_droit; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_droit then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -3794,12 +4154,12 @@ procedure trajet_droit; procedure trajet_devie; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_devie then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -3837,8 +4197,8 @@ begin //FillRect(r); // efface la cellule Pen.Width:=epaisseur; - Brush.Color:=clVoies; - Pen.Color:=clVoies; + Brush.Color:=clVoies[indexTCO]; + Pen.Color:=clVoies[indexTCO]; Pen.Mode:=pmCopy; if mode>0 then @@ -3899,19 +4259,19 @@ begin end; -// Element 15 fait +// Element 15 procedure dessin_15L(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,position,ep : integer; fond : Tcolor; procedure trajet_droit; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_droit then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -3928,12 +4288,12 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,position,ep : integer; procedure trajet_devie; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_devie then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -3968,8 +4328,8 @@ begin //FillRect(r); // efface la cellule Pen.Width:=epaisseur; - Brush.Color:=clVoies; - Pen.Color:=clVoies; + Brush.Color:=clVoies[indexTCO]; + Pen.Color:=clVoies[indexTCO]; Pen.Mode:=pmCopy; if mode>0 then @@ -4017,19 +4377,18 @@ begin end; end; -// fait procedure dessin_15C(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; fond : Tcolor; procedure trajet_droit; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_droit then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -4047,12 +4406,12 @@ procedure trajet_droit; procedure trajet_devie; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_devie then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -4088,8 +4447,8 @@ begin Pen.Width:=1; Brush.Color:=fond; Pen.Color:=fond; - Brush.Color:=clVoies; - Pen.Color:=clVoies; + Brush.Color:=clVoies[indexTCO]; + Pen.Color:=clVoies[indexTCO]; Pen.Mode:=pmCopy; if mode>0 then @@ -4165,8 +4524,8 @@ begin //FillRect(r); case mode of - 0: couleur:=clVoies; - 1: couleur:=ClCanton; + 0: couleur:=clVoies[indexTCO]; + 1: couleur:=ClCanton[indexTCO]; 2: couleur:=couleurtrain[index_couleur]; end; Brush.Color:=Couleur; @@ -4199,8 +4558,8 @@ begin Brush.Color:=tco[indextco,x,y].CouleurFond; Pen.Width:=1; case mode of - 0: couleur:=clVoies; - 1: couleur:=ClCanton; + 0: couleur:=clVoies[indexTCO]; + 1: couleur:=ClCanton[indexTCO]; 2: couleur:=couleurtrain[index_couleur]; end; Brush.Color:=Couleur; @@ -4234,8 +4593,8 @@ begin Brush.Color:=tco[indextco,x,y].CouleurFond; Pen.Width:=1; case mode of - 0: couleur:=clVoies; - 1: couleur:=ClCanton; + 0: couleur:=clVoies[indexTCO]; + 1: couleur:=ClCanton[indexTCO]; 2: couleur:=couleurtrain[index_couleur]; end; Brush.Color:=couleur; @@ -4246,7 +4605,7 @@ begin end; end; -// Element 17 fait +// Element 17 procedure dessin_17c(indexTCO : integer;Canvas : Tcanvas;x,y,mode: integer); var x0,y0,xc,yc,x1,y1,x2,y2,x3,y3,x4,y4,xf,yf,ep : integer; begin @@ -4267,8 +4626,8 @@ begin Brush.Color:=tco[indextco,x,y].CouleurFond; Pen.Width:=1; case mode of - 0: couleur:=clVoies; - 1: couleur:=ClCanton; + 0: couleur:=clVoies[indexTCO]; + 1: couleur:=ClCanton[indexTCO]; 2: couleur:=couleurtrain[index_couleur]; end; Brush.Color:=couleur; @@ -4285,7 +4644,7 @@ begin if graphisme=2 then dessin_17C(indexTco,Canvas,x,y,Mode); end; -// Elément 18 fait +// Elément 18 procedure dessin_18l(indexTCO : integer;Canvas : Tcanvas;x,y,mode: integer); var x0,y0,xc,yc,ep : integer; begin @@ -4300,8 +4659,8 @@ begin Brush.Color:=tco[indextco,x,y].CouleurFond; Pen.Width:=1; case mode of - 0: couleur:=clVoies; - 1: couleur:=ClCanton; + 0: couleur:=clVoies[indexTCO]; + 1: couleur:=ClCanton[indexTCO]; 2: couleur:=couleurtrain[index_couleur]; end; Brush.Color:=Couleur; @@ -4312,7 +4671,6 @@ begin end; end; -// fait procedure dessin_18c(indexTCO : integer;Canvas : Tcanvas;x,y,mode: integer); var x0,y0,xc,yc,x1,y1,x2,y2,x3,y3,x4,y4,xf,yf,ep : integer; begin @@ -4333,11 +4691,11 @@ begin Brush.Color:=tco[indextco,x,y].CouleurFond; Pen.Width:=1; case mode of - 0: couleur:=clVoies; - 1: couleur:=ClCanton; + 0: couleur:=clVoies[indexTCO]; + 1: couleur:=ClCanton[indexTCO]; 2: couleur:=couleurtrain[index_couleur]; end; - Brush.Color:=clfond; + Brush.Color:=clfond[indexTCO]; pen.color:=Couleur; Pen.Mode:=pmCopy; if testbit(ep,1) or testbit(ep,6) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; @@ -4367,8 +4725,8 @@ begin Brush.Color:=tco[indextco,x,y].CouleurFond; Pen.Width:=1; case mode of - 0: couleur:=clVoies; - 1: couleur:=ClCanton; + 0: couleur:=clVoies[indexTCO]; + 1: couleur:=ClCanton[indexTCO]; 2: couleur:=couleurtrain[index_couleur]; end; Brush.Color:=Couleur; @@ -4401,8 +4759,8 @@ begin Pen.Width:=1; case mode of - 0: couleur:=clVoies; - 1: couleur:=ClCanton; + 0: couleur:=clVoies[indexTCO]; + 1: couleur:=ClCanton[indexTCO]; 2: couleur:=couleurtrain[index_couleur]; end; Brush.Color:=Couleur; @@ -4443,8 +4801,8 @@ begin if but<>0 then begin case mode of - 0 : couleur:=clVoies; - 1 : couleur:=clAllume; + 0 : couleur:=clVoies[indexTCO]; + 1 : couleur:=clAllume[indexTCO]; 2 : couleur:=couleurtrain[index_couleur]; end; pen.color:=couleur; @@ -4475,8 +4833,8 @@ begin begin if detecteur[Adr].etat then begin - Brush.Color:=clAllume; - pen.color:=clAllume; + Brush.Color:=clAllume[indexTCO]; + pen.color:=clAllume[indexTCO]; end else begin @@ -4493,8 +4851,8 @@ begin // voie case mode of - 0: couleur:=clVoies; - 1: couleur:=ClCanton; + 0: couleur:=clVoies[indexTCO]; + 1: couleur:=ClCanton[indexTCO]; 2: couleur:=couleurtrain[index_couleur]; end; Brush.Color:=couleur; @@ -4505,7 +4863,7 @@ begin end; end; -// Element 21 - croisement - TJD fait +// Element 21 - croisement - TJD procedure dessin_21(indexTCO : integer;Canvas : Tcanvas;x,y,mode : integer); var yp,x1,x2,y1,y2,x0,y0,xc,yc,xf,yf,trajet,ep,pont : integer; a1,b1,a2,b2 : double; @@ -4545,8 +4903,8 @@ begin with canvas do begin Pen.Width:=1; - Brush.Color:=clvoies; - pen.color:=clvoies; + Brush.Color:=clvoies[indexTCO]; + pen.color:=clvoies[indexTCO]; horizontale; diagonale; @@ -4555,14 +4913,14 @@ begin if testbit(pont,3) or testbit(pont,7) then begin // dessiner le pont - pen.color:=clfond; + pen.color:=clfond[indexTCO]; yp:=yc-(epaisseur); moveto(x0+5,yp);lineTo(xf-5,yp); yp:=yc+(epaisseur); moveto(x0+5,yp);lineTo(xf-5,yp); // barrières du pont - pen.color:=clwhite; + pen.color:=clBarriere[indexTCO]; pen.Width:=epaisseur div 2; moveto(x0+5,yp);lineTo(xf-5,yp); yp:=yc-(epaisseur); @@ -4572,42 +4930,43 @@ begin // diagonale if testbit(pont,2) or testbit(pont,6) then begin - pen.color:=clfond; + pen.color:=clfond[indexTCO]; droite(xf,y0,x0,yf,a1,b1); // droite a2,b2 // passant par x2,y2 a2:=a1; - // masquage G - x2:=xf-round(21*frxGlob[indexTCO]);y2:=y0+round(12*fryGlob[indexTCO]); + // masquage sup + x2:=xf-round(24*frxGlob[indexTCO]);y2:=y0+round(12*fryGlob[indexTCO]); b2:=y2-a2*x2; x1:=x0+round(6*frxGlob[indexTCO]); y1:=round(a2*x1+b2); moveto(x1,y1);lineTo(x2,y2); - // barrière + // barrière sup pen.width:=epaisseur div 2; - pen.color:=clWhite; - x2:=xf-round(21*frxGlob[indexTCO]);y2:=y0+round(12*fryGlob[indexTCO]); + pen.color:=clBarriere[indexTCO]; + x2:=xf-round(24*frxGlob[indexTCO]);y2:=y0+round(12*fryGlob[indexTCO]); b2:=y2-a2*x2; x1:=x0+round(6*frxGlob[indexTCO]); y1:=round(a2*x1+b2); moveto(x1,y1);lineTo(x2,y2); - // masquage D + // masquage inf pen.Width:=epaisseur; - pen.color:=clFond; - x2:=xf-round(10*frxGlob[indexTCO]);y2:=y0+round(18*fryGlob[indexTCO]); + pen.color:=clFond[indexTCO]; + x2:=xf-round(7*frxGlob[indexTCO]);y2:=y0+round(18*fryGlob[indexTCO]); b2:=y2-a2*x2; x1:=x0+round(16*frxGlob[indexTCO]); y1:=round(a2*x1+b2); moveto(x1,y1);lineTo(x2,y2); - // barrière + // barrière inf pen.width:=epaisseur div 2; - pen.color:=clwhite; - x2:=xf-round(10*frxGlob[indexTCO]);y2:=y0+round(18*fryGlob[indexTCO]); + pen.color:=clBarriere[indexTCO]; + //x2:=xf-round(10*frxGlob[indexTCO]);y2:=y0+round(18*fryGlob[indexTCO]); + x2:=xf-round(7*frxGlob[indexTCO]);y2:=y0+round(18*fryGlob[indexTCO]); b2:=y2-a2*x2; - x1:=x0+round(16*frxGlob[indexTCO]); + x1:=x0+round(22*frxGlob[indexTCO]); y1:=round(a2*x1+b2); moveto(x1,y1);lineTo(x2,y2); end; @@ -4617,8 +4976,8 @@ begin begin trajet:=tco[indextco,x,y].trajet; case mode of - 0: couleur:=clVoies; - 1: couleur:=ClCanton; + 0: couleur:=clVoies[indexTCO]; + 1: couleur:=ClCanton[indexTCO]; 2: couleur:=couleurtrain[index_couleur]; end; Brush.Color:=couleur; @@ -4643,7 +5002,7 @@ begin end; end; -// Element 22 fait +// Element 22 procedure dessin_22(indexTCO : integer;Canvas : Tcanvas;x,y,mode : integer); var pont,yp,x1,y1,x2,y2,x0,y0,xc,yc,xf,yf,trajet,ep : integer; a1,b1,a2,b2 : double; @@ -4686,8 +5045,8 @@ begin //r:=Rect(x0,y0,x0+LargeurCell[indexTCO],y0+hauteurCell[indexTCO]); //FillRect(r); - Brush.Color:=clvoies; - pen.color:=clvoies; + Brush.Color:=clvoies[indexTCO]; + pen.color:=clvoies[indexTCO]; pen.width:=epaisseur; diagonale; @@ -4697,14 +5056,14 @@ begin if testbit(pont,3) or testbit(pont,7) then begin // dessiner le pont - pen.color:=clFond; + pen.color:=clFond[indexTCO]; yp:=yc-(epaisseur); moveto(x0+5,yp);lineTo(xf-5,yp); yp:=yc+(epaisseur); moveto(x0+5,yp);lineTo(xf-5,yp); // barrières du pont - pen.color:=clwhite; + pen.color:=clBarriere[indexTCO]; pen.Width:=epaisseur div 2; moveto(x0+5,yp);lineTo(xf-5,yp); yp:=yc-(epaisseur); @@ -4714,7 +5073,7 @@ begin // diagonale if testbit(pont,0) or testbit(pont,4) then begin - pen.color:=clfond; + pen.color:=clfond[indexTCO]; droite(x0,y0,xf,yf,a1,b1); // droite a2,b2 // passant par x2,y2 a2:=a1; @@ -4728,7 +5087,7 @@ begin // barrière pen.width:=epaisseur div 2; - pen.color:=clWhite; + pen.color:=clBarriere[indexTCO]; x2:=x0+round(8*frxGlob[indexTCO]);y2:=y0+round(18*fryGlob[indexTCO]); b2:=y2-a2*x2; x1:=xf-round(18*frxGlob[indexTCO]); @@ -4737,7 +5096,7 @@ begin // masquage D pen.Width:=epaisseur; - pen.color:=clfond; + pen.color:=clfond[indexTCO]; x2:=x0+round(20*frxGlob[indexTCO]);y2:=y0+round(11*fryGlob[indexTCO]); b2:=y2-a2*x2; x1:=xf-round(8*frxGlob[indexTCO]); @@ -4758,8 +5117,8 @@ begin begin trajet:=tco[indextco,x,y].trajet; case mode of - 0: couleur:=clVoies; - 1: couleur:=ClCanton; + 0: couleur:=clVoies[indexTCO]; + 1: couleur:=ClCanton[indexTCO]; 2: couleur:=couleurtrain[index_couleur]; end; Brush.Color:=couleur; @@ -4799,8 +5158,8 @@ begin //r:=Rect(x0,y0,x0+LargeurCell[indexTCO],y0+hauteurCell[indexTCO]); //FillRect(r); - Brush.Color:=clQuai; - pen.color:=clQuai; + Brush.Color:=clQuai[indexTCO]; + pen.color:=clQuai[indexTCO]; x1:=x0; x2:=x0+LargeurCell[indexTCO]; @@ -4871,7 +5230,7 @@ begin end; end; -// Element 24 fait +// Element 24 procedure dessin_24L(indexTCO : integer;Canvas : Tcanvas;x,y,mode: integer); var x0,y0,xc,yc,jx1,jy1,xf,yf,position,ep : integer; r : Trect; @@ -4879,12 +5238,12 @@ var x0,y0,xc,yc,jx1,jy1,xf,yf,position,ep : integer; procedure trajet_droit; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_droit then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -4901,12 +5260,12 @@ var x0,y0,xc,yc,jx1,jy1,xf,yf,position,ep : integer; procedure trajet_devie; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_devie then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -4939,8 +5298,8 @@ begin Pen.Color:=Fond;; Pen.Width:=epaisseur; - Brush.Color:=clVoies; - Pen.Color:=clVoies; + Brush.Color:=clVoies[indexTCO]; + Pen.Color:=clVoies[indexTCO]; Pen.Mode:=pmCopy; if mode>0 then @@ -4996,12 +5355,12 @@ var x0,y0,xc,yc,jx1,jy1,xf,yf,x1,y1,x2,y2,x3,y3,x4,y4,position,ep : integer; procedure trajet_droit; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_droit then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -5018,12 +5377,12 @@ procedure trajet_droit; procedure trajet_devie; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_devie then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -5060,8 +5419,8 @@ begin Pen.Color:=Fond;; Pen.Width:=epaisseur; - Brush.Color:=clVoies; - Pen.Color:=clVoies; + Brush.Color:=clVoies[indexTCO]; + Pen.Color:=clVoies[indexTCO]; Pen.Mode:=pmCopy; if mode>0 then @@ -5152,8 +5511,8 @@ begin //r:=Rect(x0,y0,x0+LargeurCell[indexTCO],y0+hauteurCell[indexTCO]); //FillRect(r); - Brush.Color:=clvoies; - pen.color:=clvoies; + Brush.Color:=clvoies[indexTCO]; + pen.color:=clvoies[indexTCO]; pen.width:=epaisseur; diagonale; @@ -5163,14 +5522,14 @@ begin if testbit(pont,1) or testbit(pont,5) then begin // masquages - pen.color:=clfond; + pen.color:=clfond[indexTCO]; xp:=xc-(epaisseur); moveto(xp,y0+epaisseur);lineTo(xp,yf-epaisseur); xp:=xc+(epaisseur); moveto(xp,y0+epaisseur);lineTo(xp,yf-epaisseur); // barrières du pont - pen.color:=clwhite; + pen.color:=clBarriere[indexTCO]; pen.Width:=epaisseur div 2; xp:=xc-(epaisseur); moveto(xp,y0+epaisseur);lineTo(xp,yf-epaisseur); @@ -5181,7 +5540,7 @@ begin // diagonale if testbit(pont,2) or testbit(pont,6) then begin - pen.color:=clfond; + pen.color:=clfond[indexTCO]; droite(xf,y0,x0,yf,a1,b1); // droite a2,b2 // passant par x2,y2 a2:=a1; @@ -5195,7 +5554,7 @@ begin // barrière pen.width:=epaisseur div 2; - pen.color:=clWhite; + pen.color:=clBarriere[indexTCO]; x2:=xf-round(21*frxGlob[indexTCO]);y2:=y0+round(12*fryGlob[indexTCO]); b2:=y2-a2*x2; x1:=x0+round(6*frxGlob[indexTCO]); @@ -5204,7 +5563,7 @@ begin // masquage D pen.Width:=epaisseur; - pen.color:=clFond; + pen.color:=clFond[indexTCO]; x2:=xf-round(10*frxGlob[indexTCO]);y2:=y0+round(18*fryGlob[indexTCO]); b2:=y2-a2*x2; x1:=x0+round(16*frxGlob[indexTCO]); @@ -5213,7 +5572,7 @@ begin // barrière pen.width:=epaisseur div 2; - pen.color:=clwhite; + pen.color:=clBarriere[indexTCO]; x2:=xf-round(10*frxGlob[indexTCO]);y2:=y0+round(18*fryGlob[indexTCO]); b2:=y2-a2*x2; x1:=x0+round(16*frxGlob[indexTCO]); @@ -5226,13 +5585,13 @@ begin begin trajet:=tco[indextco,x,y].trajet; case mode of - 0: couleur:=clVoies; - 1: couleur:=ClCanton; + 0: couleur:=clVoies[indexTCO]; + 1: couleur:=ClCanton[indexTCO]; 2: couleur:=couleurtrain[index_couleur]; end; Brush.Color:=couleur; pen.color:=couleur; - if trajet=1 then verticale; + if trajet=1 then verticale; if trajet=2 then diagonale; if trajet=3 then begin @@ -5301,8 +5660,8 @@ begin //r:=Rect(x0,y0,x0+LargeurCell[indexTCO],y0+hauteurCell[indexTCO]); //FillRect(r); - Brush.Color:=clvoies; - pen.color:=clvoies; + Brush.Color:=clvoies[indexTCO]; + pen.color:=clvoies[indexTCO]; pen.width:=epaisseur; verticale; @@ -5312,14 +5671,14 @@ begin if testbit(pont,1) or testbit(pont,5) then begin // masquages - pen.color:=clfond; + pen.color:=clfond[indexTCO]; xp:=xc-(epaisseur); moveto(xp,y0+epaisseur);lineTo(xp,yf-epaisseur); xp:=xc+(epaisseur); moveto(xp,y0+epaisseur);lineTo(xp,yf-epaisseur); // barrières du pont - pen.color:=clwhite; + pen.color:=clBarriere[indexTCO]; pen.Width:=epaisseur div 2; xp:=xc-(epaisseur); moveto(xp,y0+epaisseur);lineTo(xp,yf-epaisseur); @@ -5330,7 +5689,7 @@ begin // diagonale if testbit(pont,0) or testbit(pont,4) then begin - pen.color:=clfond; + pen.color:=clfond[indexTCO]; droite(x0,y0,xf,yf,a1,b1); // droite a2,b2 // passant par x2,y2 a2:=a1; @@ -5344,7 +5703,7 @@ begin // barrière pen.width:=epaisseur div 2; - pen.color:=clWhite; + pen.color:=clBarriere[indexTCO]; x2:=x0+round(8*frxGlob[indexTCO]);y2:=y0+round(18*fryGlob[indexTCO]); b2:=y2-a2*x2; x1:=xf-round(18*frxGlob[indexTCO]); @@ -5353,7 +5712,7 @@ begin // masquage D pen.Width:=epaisseur; - pen.color:=clfond; + pen.color:=clfond[indexTCO]; x2:=x0+round(20*frxGlob[indexTCO]);y2:=y0+round(11*fryGlob[indexTCO]); b2:=y2-a2*x2; x1:=xf-round(8*frxGlob[indexTCO]); @@ -5361,7 +5720,7 @@ begin moveto(x1,y1);lineTo(x2,y2); pen.width:=epaisseur div 2; - pen.color:=clwhite; + pen.color:=clBarriere[indexTCO]; x2:=x0+round(20*frxGlob[indexTCO]);y2:=y0+round(11*fryGlob[indexTCO]); b2:=y2-a2*x2; x1:=xf-round(8*frxGlob[indexTCO]); @@ -5375,8 +5734,8 @@ begin begin trajet:=tco[indextco,x,y].trajet; case mode of - 0: couleur:=clVoies; - 1: couleur:=ClCanton; + 0: couleur:=clVoies[indexTCO]; + 1: couleur:=ClCanton[indexTCO]; 2: couleur:=couleurtrain[index_couleur]; end; @@ -5410,12 +5769,12 @@ var x0,y0,xc,yc,jx1,jy1,xf,yf,position,ep : integer; procedure trajet_droit; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_droit then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -5432,12 +5791,12 @@ var x0,y0,xc,yc,jx1,jy1,xf,yf,position,ep : integer; procedure trajet_devie; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_devie then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -5446,7 +5805,7 @@ var x0,y0,xc,yc,jx1,jy1,xf,yf,position,ep : integer; begin pen.color:=couleur; if testbit(ep,5) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; - moveto(xc,yf);lineto(xc,yc); + moveto(xc,yf);lineto(xc,yc); if testbit(ep,2) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; lineTo(xf,y0); end; @@ -5473,8 +5832,8 @@ begin //FillRect(r); // efface la cellule Pen.Width:=epaisseur; - Brush.Color:=clVoies; - Pen.Color:=clVoies; + Brush.Color:=clVoies[indexTCO]; + Pen.Color:=clVoies[indexTCO]; Pen.Mode:=pmCopy; if mode>0 then @@ -5531,12 +5890,12 @@ var x0,y0,xc,yc,jx1,jy1,xf,yf,x1,y1,x2,y2,x3,y3,x4,y4,position,ep : integer; procedure trajet_droit; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_droit then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -5545,7 +5904,7 @@ procedure trajet_droit; begin pen.color:=couleur; if testbit(ep,1) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; - moveto(xc,y0);lineto(xc,yc); + moveto(xc,y0);lineto(xc,yc); if testbit(ep,5) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; lineto(xc,yf); end; @@ -5553,12 +5912,12 @@ procedure trajet_droit; procedure trajet_devie; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_devie then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -5571,8 +5930,6 @@ procedure trajet_droit; end; end; - - begin x0:=(x-1)*LargeurCell[indexTCO]; // x origine y0:=(y-1)*hauteurCell[indexTCO]; // y origine @@ -5597,8 +5954,8 @@ begin Pen.Color:=Fond;; Pen.Width:=epaisseur; - Brush.Color:=clVoies; - Pen.Color:=clVoies; + Brush.Color:=clVoies[indexTCO]; + Pen.Color:=clVoies[indexTCO]; Pen.Mode:=pmCopy; if mode>0 then @@ -5651,7 +6008,7 @@ begin if graphisme=2 then dessin_26C(indexTco,Canvas,x,y,Mode); end; -// Element 27 fait +// Element 27 procedure dessin_27L(indexTCO : integer;Canvas : Tcanvas;x,y,mode: integer); var x0,y0,jx2,jy2,jx3,jy3,xc,yc,jx1,jy1,xf,yf,position,ep : integer; r : Trect; @@ -5659,12 +6016,12 @@ var x0,y0,jx2,jy2,jx3,jy3,xc,yc,jx1,jy1,xf,yf,position,ep : integer; procedure trajet_droit; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_droit then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -5673,7 +6030,7 @@ var x0,y0,jx2,jy2,jx3,jy3,xc,yc,jx1,jy1,xf,yf,position,ep : integer; begin if testbit(ep,1) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; pen.color:=couleur; - moveto(xc,y0);lineto(xc,yc); + moveto(xc,y0);lineto(xc,yc); if testbit(ep,5) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; lineto(xc,yf); end; @@ -5681,12 +6038,12 @@ var x0,y0,jx2,jy2,jx3,jy3,xc,yc,jx1,jy1,xf,yf,position,ep : integer; procedure trajet_devie; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_devie then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -5722,8 +6079,8 @@ begin //FillRect(r); // efface la cellule Pen.Width:=epaisseur; - Brush.Color:=clVoies; - Pen.Color:=clVoies; + Brush.Color:=clVoies[indexTCO]; + Pen.Color:=clVoies[indexTCO]; Pen.Mode:=pmCopy; if mode>0 then @@ -5772,7 +6129,7 @@ begin end; end; -// Element 27c fait +// Element 27c procedure dessin_27C(indexTCO : integer;Canvas : Tcanvas;x,y,mode: integer); var x0,y0,xc,yc,jx1,jy1,jx2,jy2,xf,yf,x1,y1,x2,y2,x3,y3,x4,y4,position,ep, jx3,jy3 : integer; @@ -5781,12 +6138,12 @@ var x0,y0,xc,yc,jx1,jy1,jx2,jy2,xf,yf,x1,y1,x2,y2,x3,y3,x4,y4,position,ep, procedure trajet_droit; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_droit then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -5803,12 +6160,12 @@ procedure trajet_droit; procedure trajet_devie; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_devie then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -5846,8 +6203,8 @@ begin Pen.Color:=Fond;; Pen.Width:=epaisseur; - Brush.Color:=clVoies; - Pen.Color:=clVoies; + Brush.Color:=clVoies[indexTCO]; + Pen.Color:=clVoies[indexTCO]; Pen.Mode:=pmCopy; if mode>0 then @@ -5902,7 +6259,7 @@ begin if graphisme=2 then dessin_27C(indexTco,Canvas,x,y,Mode); end; -// Element 28 fait +// Element 28 procedure dessin_28L(indexTCO : integer;Canvas : Tcanvas;x,y,mode: integer); var x0,y0,jx2,jy2,jx3,jy3,xc,yc,jx1,jy1,xf,yf,position,ep : integer; r : Trect; @@ -5910,12 +6267,12 @@ var x0,y0,jx2,jy2,jx3,jy3,xc,yc,jx1,jy1,xf,yf,position,ep : integer; procedure trajet_droit; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_droit then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -5932,12 +6289,12 @@ var x0,y0,jx2,jy2,jx3,jy3,xc,yc,jx1,jy1,xf,yf,position,ep : integer; procedure trajet_devie; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_devie then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -5973,8 +6330,8 @@ begin //FillRect(r); // efface la cellule Pen.Width:=epaisseur; - Brush.Color:=clVoies; - Pen.Color:=clVoies; + Brush.Color:=clVoies[indexTCO]; + Pen.Color:=clVoies[indexTCO]; Pen.Mode:=pmCopy; if (position=const_Devie) or (position=const_inconnu) then @@ -6013,7 +6370,7 @@ begin end; end; -// Element 28 fait +// Element 28 procedure dessin_28C(indexTCO : integer;Canvas : Tcanvas;x,y,mode: integer); var x0,y0,xc,yc,jx1,jy1,jx2,jy2,xf,yf,x1,y1,x2,y2,x3,y3,x4,y4,position,ep, jx3,jy3 : integer; @@ -6022,12 +6379,12 @@ var x0,y0,xc,yc,jx1,jy1,jx2,jy2,xf,yf,x1,y1,x2,y2,x3,y3,x4,y4,position,ep, procedure trajet_droit; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_droit then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -6036,7 +6393,7 @@ procedure trajet_droit; begin if testbit(ep,1) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; pen.color:=couleur; - moveto(xc,y0);lineto(xc,yc); + moveto(xc,y0);lineto(xc,yc); if testbit(ep,5) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; lineto(xc,yf); end; @@ -6044,12 +6401,12 @@ procedure trajet_droit; procedure trajet_devie; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_devie then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -6086,8 +6443,8 @@ begin Pen.Color:=Fond;; Pen.Width:=epaisseur; - Brush.Color:=clVoies; - Pen.Color:=clVoies; + Brush.Color:=clVoies[indexTCO]; + Pen.Color:=clVoies[indexTCO]; Pen.Mode:=pmCopy; if mode>0 then @@ -6142,19 +6499,19 @@ begin if graphisme=2 then dessin_28C(indexTco,Canvas,x,y,Mode); end; -// Element 29 fait +// Element 29 procedure dessin_29L(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; fond : tcolor; procedure trajet_droit; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_droit then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -6171,12 +6528,12 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; procedure trajet_devie; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_devie then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -6185,7 +6542,7 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; begin pen.color:=couleur; if testbit(ep,0) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; - moveto(x0,y0);lineto(xc,yc); + moveto(x0,y0);lineto(xc,yc); if testbit(ep,5) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; lineto(xc,yf); end; @@ -6212,8 +6569,8 @@ begin //FillRect(r); // efface la cellule Pen.Width:=epaisseur; - Brush.Color:=clVoies; - Pen.Color:=clVoies; + Brush.Color:=clVoies[indexTCO]; + Pen.Color:=clVoies[indexTCO]; Pen.Mode:=pmCopy; if (position=const_Devie) or (position=const_inconnu) then @@ -6254,18 +6611,17 @@ begin end; end; -// fait procedure dessin_29C(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; fond : tcolor; procedure trajet_droit; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_droit then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -6282,12 +6638,12 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; procedure trajet_devie; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_devie then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -6323,8 +6679,8 @@ begin Brush.Color:=fond; Pen.Color:=fond; Pen.Width:=epaisseur; - Brush.Color:=clVoies; - Pen.Color:=clVoies; + Brush.Color:=clVoies[indexTCO]; + Pen.Color:=clVoies[indexTCO]; Pen.Mode:=pmCopy; if mode>0 then @@ -6381,7 +6737,7 @@ begin if graphisme=2 then dessin_29C(indexTco,Canvas,x,y,Mode); end; -// Elément 32 fait +// Elément 32 procedure dessin_32L(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,position,ep : integer; r : Trect; @@ -6389,12 +6745,12 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,position,ep : integer; procedure trajet_droit; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_droit then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -6411,12 +6767,12 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,position,ep : integer; procedure trajet_devie; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_devie then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -6452,8 +6808,8 @@ begin //FillRect(r); // efface la cellule Pen.Width:=epaisseur; - Brush.Color:=clVoies; - Pen.Color:=clVoies; + Brush.Color:=clVoies[indexTCO]; + Pen.Color:=clVoies[indexTCO]; Pen.Mode:=pmCopy; if mode>0 then @@ -6509,12 +6865,12 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; procedure trajet_droit; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_droit then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -6531,12 +6887,12 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; procedure trajet_devie; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_devie then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -6575,8 +6931,8 @@ begin Pen.Color:=fond; Pen.Width:=epaisseur; - Brush.Color:=clVoies; - Pen.Color:=clVoies; + Brush.Color:=clVoies[indexTCO]; + Pen.Color:=clVoies[indexTCO]; Pen.Mode:=pmCopy; if mode>0 then @@ -6634,7 +6990,7 @@ begin if graphisme=2 then dessin_32C(indexTco,Canvas,x,y,Mode); end; -// Element 33 fait +// Element 33 procedure dessin_33L(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; r : Trect; @@ -6642,12 +6998,12 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; procedure trajet_droit; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_droit then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -6664,12 +7020,12 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; procedure trajet_devie; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_devie then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -6706,8 +7062,8 @@ begin //FillRect(r); // efface la cellule Pen.Width:=epaisseur; - Brush.Color:=clVoies; - Pen.Color:=clVoies; + Brush.Color:=clVoies[indexTCO]; + Pen.Color:=clVoies[indexTCO]; Pen.Mode:=pmCopy; if mode>0 then @@ -6757,7 +7113,6 @@ begin end; end; -// fait procedure dessin_33c(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; r : Trect; @@ -6765,12 +7120,12 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; procedure trajet_droit; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_droit then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -6787,12 +7142,12 @@ procedure trajet_droit; procedure trajet_devie; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_devie then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -6832,8 +7187,8 @@ begin //FillRect(r); // efface la cellule Pen.Width:=epaisseur; - Brush.Color:=clVoies; - Pen.Color:=clVoies; + Brush.Color:=clVoies[indexTCO]; + Pen.Color:=clVoies[indexTCO]; Pen.Mode:=pmCopy; if mode>0 then @@ -6892,19 +7247,19 @@ begin if graphisme=2 then dessin_33C(indexTco,Canvas,x,y,Mode); end; -// Element 34 fait +// Element 34 procedure dessin_34L(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; fond : Tcolor; procedure trajet_droit; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_droit then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -6921,12 +7276,12 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; procedure trajet_devie; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_devie then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -6961,8 +7316,8 @@ begin //FillRect(r); // efface la cellule Pen.Width:=epaisseur; - Brush.Color:=clVoies; - Pen.Color:=clVoies; + Brush.Color:=clVoies[indexTCO]; + Pen.Color:=clVoies[indexTCO]; Pen.Mode:=pmCopy; if (position=const_Devie) or (position=const_inconnu) then @@ -7008,12 +7363,12 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; procedure trajet_droit; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_droit then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -7030,12 +7385,12 @@ procedure trajet_droit; procedure trajet_devie; begin - couleur:=clvoies; + couleur:=clvoies[indexTCO]; if mode>0 then begin if position=const_devie then begin - if mode=1 then couleur:=clcanton; + if mode=1 then couleur:=clcanton[indexTCO]; if mode=2 then couleur:=couleurtrain[index_couleur]; end; end; @@ -7075,8 +7430,8 @@ begin //FillRect(r); // efface la cellule Pen.Width:=epaisseur; - Brush.Color:=clVoies; - Pen.Color:=clVoies; + Brush.Color:=clVoies[indexTCO]; + Pen.Color:=clVoies[indexTCO]; Pen.Mode:=pmCopy; if mode>0 then @@ -7217,7 +7572,7 @@ begin with PcanvasTCO[index] do begin Pen.Width:=2; - Pen.Color:=clPiedSignal; + Pen.Color:=clPiedSignal[index]; x1:=0;y1:=12; moveTo( x+round(x1*frX),y+round(y1*frYR) ); LineTo( x+round((x1-6)*frX),y+round((y1+0)*frYR) ); @@ -7235,7 +7590,7 @@ begin with PcanvasTCO[index] do begin Pen.Width:=2; - Pen.Color:=clPiedSignal; + Pen.Color:=clPiedSignal[index]; x1:=35;y1:=12; moveTo( x+round(x1*frX),y+round(y1*frYR) ); LineTo( x+round((x1+6)*frX),y+round((y1+0)*frYR) ); @@ -7250,7 +7605,7 @@ begin with PcanvasTCO[index] do begin Pen.Width:=2; - Pen.Color:=clPiedSignal; + Pen.Color:=clPiedSignal[index]; x1:=12;y1:=35; moveTo( x+round((x1+0)*frX),y+round(y1*frY) ); LineTo( x+round((x1+0)*frX),y+round((y1+6)*frY) ); @@ -7268,7 +7623,7 @@ begin with PcanvasTCO[index] do begin Pen.Width:=2; - Pen.Color:=clPiedSignal; + Pen.Color:=clPiedSignal[index]; x1:=45;y1:=12; moveTo( x+round(x1*frX),y+round(y1*frY) ); LineTo( x+round((x1+6)*frX),y+round((y1+0)*frY) ); @@ -7286,7 +7641,7 @@ begin with PcanvasTCO[index] do begin Pen.Width:=2; - Pen.Color:=clPiedSignal; + Pen.Color:=clPiedSignal[index]; x1:=0;y1:=12; moveTo( x+round(x1*frX),y+round(y1*frY) ); LineTo( x+round((x1-4)*frX),y+round((y1+0)*frY) ); @@ -7301,7 +7656,7 @@ begin with PcanvasTCO[index] do begin Pen.Width:=2; - Pen.Color:=clPiedSignal; + Pen.Color:=clPiedSignal[index]; x1:=12;y1:=42; moveTo( x+round((x1+0)*frX),y+round(y1*frY) ); LineTo( x+round((x1+0)*frX),y+round((y1+6)*frY) ); @@ -7319,7 +7674,7 @@ begin with PcanvasTCO[index] do begin Pen.Width:=2; - Pen.Color:=clPiedSignal; + Pen.Color:=clPiedSignal[index]; x1:=0;y1:=12; moveTo( x+round(x1*frX),y+round(y1*frY) ); LineTo( x+round((x1-6)*frX),y+round((y1+0)*frY) ); @@ -7337,7 +7692,7 @@ begin with PcanvasTCO[index] do begin Pen.Width:=2; - Pen.Color:=clPiedSignal; + Pen.Color:=clPiedSignal[index]; x1:=55;y1:=12; moveTo( x+round(x1*frX),y+round(y1*frY) ); LineTo( x+round((x1+6)*frX),y+round((y1+0)*frY) ); @@ -7352,7 +7707,7 @@ begin with PcanvasTCO[index] do begin Pen.Width:=2; - Pen.Color:=clPiedSignal; + Pen.Color:=clPiedSignal[index]; x1:=12;y1:=55; moveTo( x+round((x1+0)*frX),y+round(y1*frY) ); LineTo( x+round((x1+0)*frX),y+round((y1+7)*frY) ); @@ -7370,7 +7725,7 @@ begin with PcanvasTCO[index] do begin Pen.Width:=2; - Pen.Color:=clPiedSignal; + Pen.Color:=clPiedSignal[index]; x1:=90;y1:=38; moveTo( x+round(x1*frX),y+round(y1*frY) ); LineTo( x+round((x1+7)*frX),y+round((y1+0)*frY) ); @@ -7388,7 +7743,7 @@ begin with PcanvasTCO[index] do begin Pen.Width:=2; - Pen.Color:=clPiedSignal; + Pen.Color:=clPiedSignal[index]; x1:=66;y1:=12; moveTo( x+round(x1*frX),y+round(y1*frY) ); LineTo( x+round((x1+6)*frX),y+round((y1+0)*frY) ); @@ -7406,7 +7761,7 @@ begin with PcanvasTCO[index] do begin Pen.Width:=2; - Pen.Color:=clPiedSignal; + Pen.Color:=clPiedSignal[index]; x1:=0;y1:=12; moveTo( x+round(x1*frX),y+round(y1*frY) ); LineTo( x+round((x1-6)*frX),y+round((y1+0)*frY) ); @@ -7421,7 +7776,7 @@ begin with PcanvasTCO[index] do begin Pen.Width:=2; - Pen.Color:=clPiedSignal; + Pen.Color:=clPiedSignal[index]; x1:=12;y1:=65; moveTo( x+round((x1+0)*frX),y+round(y1*frY) ); LineTo( x+round((x1+0)*frX),y+round((y1+7)*frY) ); @@ -7440,7 +7795,7 @@ begin with PcanvasTCO[index] do begin Pen.Width:=2; - Pen.Color:=clPiedSignal; + Pen.Color:=clPiedSignal[index]; x1:=75;y1:=38; moveTo( x+round(x1*frX),y+round(y1*frY) ); LineTo( x+round((x1+7)*frX),y+round((y1+0)*frY) ); @@ -7457,7 +7812,7 @@ begin frYR:=frY*ratioC/10; with PcanvasTCO[index] do begin - Pen.Color:=clPiedSignal; + Pen.Color:=clPiedSignal[index]; Pen.Width:=2; x1:=0;y1:=12; moveTo( x+round(x1*frX),y+round(y1*frYR) ); @@ -7473,7 +7828,7 @@ begin with PcanvasTCO[index] do begin Pen.Width:=2; - Pen.Color:=clPiedSignal; + Pen.Color:=clPiedSignal[index]; x1:=12;y1:=75; moveTo( x+round((x1+0)*frX),y+round(y1*frY) ); LineTo( x+round((x1+0)*frX),y+round((y1+7)*frY) ); @@ -7490,7 +7845,7 @@ begin frYR:=frY*ratioC/10; with PcanvasTCO[index] do begin - Pen.Color:=clPiedSignal; + Pen.Color:=clPiedSignal[index]; pen.Width:=2; x1:=0;y1:=12; // segment horizontal @@ -7508,7 +7863,7 @@ begin with PcanvasTCO[index] do begin Pen.Width:=2; - Pen.Color:=clPiedSignal; + Pen.Color:=clPiedSignal[index]; x1:=12;y1:=90; moveTo( x+round((x1+0)*frX),y+round(y1*frY) ); LineTo( x+round((x1+0)*frX),y+round((y1+7)*frY) ); @@ -7550,6 +7905,14 @@ begin Brush.style:=bsSolid; fillRect(r); end; + + if avecGrille[indexTCO] then + begin + canvas.pen.color:=clGrille[indexTCO]; + r:=Rect(x0,y0,x0+LargeurCell[indexTCO]+1,y0+hauteurCell[indexTCO]+1); + canvas.rectangle(r); + end; + end; // Dessine un signal dans le canvasDest en x,y , dont l'adresse se trouve à la cellule x,y @@ -7571,8 +7934,6 @@ begin if Orientation=0 then Orientation:=1; // cas d'un signal non encore renseigné index:=Index_Signal(adresse); - if index=0 then exit; - aspect:=feux[index].aspect; if aspect=0 then aspect:=9; //if aspect>9 then exit; @@ -7760,8 +8121,7 @@ var i,index,repr,Xorg,Yorg,xt,yt,mode,adresse,Bimage,aspect,oriente,pied : integ inverse : boolean; s : string; begin - if AvecGrille[indexTCO] then entoure_cell_grille(indexTCO,x,y); // grille derrière - //if tco[indextco,x,y].BImage=0 then exit; + if tco[indextco,x,y].BImage=0 then exit; //Affiche('Affiche_cellule',clLime); PcanvasTCO[indexTCO].pen.Mode:=PmCopy; //pcanvasTCO.Brush.Style:=BsClear; @@ -7836,13 +8196,13 @@ begin 3 : yt:=hauteurCell[indexTCO]-round(17*fryGlob[indexTCO]); // bas end; - { // affiche/efface le nom du train du détecteur s:=s+' '; case repr of 1,3 : yt:=1; // haut 2 : yt:=hauteurCell[indexTCO]-round(17*fryGlob[indexTCO]); // bas end; } + i:=detecteur[adresse].AdrTrain; if i<>0 then begin @@ -8015,6 +8375,7 @@ begin end; + // affiche le tco suivant le tableau TCO procedure Affiche_TCO(indexTCO : integer) ; var x,y,x1,y1,DimX,DimY : integer; @@ -8032,8 +8393,11 @@ begin PImageTCO[indexTCO].Height:=DimY; PImageTCO[indexTCO].Width:=DimX; + ClBarriere[indexTCO]:=not(clfond[indexTCO]) and $FFFFFF; + PBitMapTCO[indexTCO].Height:=DimY; PBitMapTCO[indexTCO].Width:=DimX; + with formTCO[indexTCO].ScrollBox do begin HorzScrollBar.Range:=DimX; @@ -8047,13 +8411,13 @@ begin calcul_reduction(frxGlob[indexTCO],fryGlob[indexTCO],LargeurCell[indexTCO],hauteurCell[indexTCO]); //Affiche(formatfloat('0.000000',frxGlob[indexTCO]),clyellow); - //effacer tout - + //effacer toutes cellules par cellule car chaque cellule a une couleur de fond spécifique with PcanvasTCO[indexTCO] do begin Pen.width:=1; Brush.Style:=bsSolid; pen.color:=clyellow; + pen.Mode:=PmCopy; for y:=1 to NbreCellY[indexTCO] do for x:=1 to NbreCellX[indexTCO] do @@ -8067,6 +8431,28 @@ begin end; end; + if AvecGrille[indexTCO] then + begin + y1:=HauteurCell[IndexTCO]*NbreCellY[indexTCO]; + PcanvasTCO[indexTCO].pen.color:=clGrille[IndexTCO]; + + //Affiche(intToSTr(clGrille[IndexTCO]),clred); + with PcanvasTCO[indexTCO] do + begin + for x:=1 to NbreCellX[indexTCO] do + begin + x1:=(x-1)*largeurCell[indexTCO]; + moveto(x1,0);LineTo(x1,y1); // lignes verticales + end; + x1:=LargeurCell[IndexTCO]*NbreCellX[indexTCO]; + for y:=1 to NbreCellY[indexTCO] do + begin + y1:=(y-1)*HauteurCell[indexTCO]; + moveto(0,y1);LineTo(x1,y1); // lignes horizontales + end; + end; + end; + //afficher les cellules sauf les signaux for y:=1 to NbreCellY[indexTCO] do for x:=1 to NbreCellX[indexTCO] do @@ -8090,25 +8476,24 @@ begin if s<>'' then Affiche_texte(indexTCO,x,y); end; - if entoure[indexTCO] then - begin - Entoure_cell(indexTCO,Xentoure[indexTCO],Yentoure[indexTCO]); - end; + // afficher les sélections si elles sont présentes + 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; -procedure grise_ligne_tco(indexTCO : integer); -var x : integer; -begin - for x:=1 to NbreCellX[indexTCO] do Affiche_Cellule(indexTCO,x,YClicCell[indexTCO]); -end; procedure TFormTCO.FormCreate(Sender: TObject); var s : string; begin if affevt or (debug=1) then Affiche('FormTCO'+intToSTR(indexTCOCreate)+' create',clyellow); + {TCO_Timer[indexTCOCreate]:=TTimer.create(formTCO[indexTCOCreate]); + tco_timer[indexTCOCreate].Interval:=500; + tco_timer[indexTCOCreate].OnTimer:=} offsetSourisY:=-10; offsetSourisX:=-10; + RadioGroupSel.ItemIndex:=0; auto_tcurs:=true; TCO_modifie:=false; rangUndo:=1; @@ -8119,7 +8504,6 @@ begin indexTrace:=0; KeyPreview:=true; // valide les évènements clavier TrackBarZoom.Tabstop:=false; // permet d'avoir les evts curseurs - Buttonredessine.TabStop:=false; ButtonSauveTCO.TabStop:=false; ButtonConfigTCO.TabStop:=false; Buttonmasquer.TabStop:=false; @@ -8127,16 +8511,12 @@ begin ButtonDessiner.TabStop:=false; TrackBarZoom.position:=78; - Clfond:=$000040; couleurAdresse:=Cyan; xMiniSel:=99999;yMiniSel:=99999; xMaxiSel:=0;yMaxiSel:=0; SelectionAffichee[indexTCOCreate]:=false; // ImageTCO.Canvas.font.Name:='Arial'; <--- peut générer exception out of ressource!! - clAllume:=clYellow; - clVoies:=clOrange; clTexte:=ClLime; - clGrille:=$404040; // évite le clignotement pendant les affichages mais ne marche pas //DoubleBuffered:=true; comborepr.Enabled:=false; @@ -8159,55 +8539,56 @@ begin modeTrace[indexTCOCreate]:=false; // pour tracer les voies à la souris //controlStyle:=controlStyle+[csOpaque]; - //TCOCree:=true; s:='Voie'; - ImagePalette6.Hint:=s;ImagePalette6.ShowHint:=true; - ImagePalette7.Hint:=s;ImagePalette7.ShowHint:=true; - ImagePalette8.Hint:=s;ImagePalette8.ShowHint:=true; - ImagePalette9.Hint:=s;ImagePalette9.ShowHint:=true; - ImagePalette10.Hint:=s;ImagePalette10.ShowHint:=true; - ImagePalette11.Hint:=s;ImagePalette11.ShowHint:=true; - ImagePalette16.Hint:=s;ImagePalette16.ShowHint:=true; - ImagePalette17.Hint:=s;ImagePalette17.ShowHint:=true; - ImagePalette18.Hint:=s;ImagePalette18.ShowHint:=true; - ImagePalette19.Hint:=s;ImagePalette19.ShowHint:=true; + ImagePalette6.Hint:=s;ImagePalette6.ShowHint:=true; + ImagePalette7.Hint:=s;ImagePalette7.ShowHint:=true; + ImagePalette8.Hint:=s;ImagePalette8.ShowHint:=true; + ImagePalette9.Hint:=s;ImagePalette9.ShowHint:=true; + ImagePalette10.Hint:=s;ImagePalette10.ShowHint:=true; + ImagePalette11.Hint:=s;ImagePalette11.ShowHint:=true; + ImagePalette16.Hint:=s;ImagePalette16.ShowHint:=true; + ImagePalette17.Hint:=s;ImagePalette17.ShowHint:=true; + ImagePalette18.Hint:=s;ImagePalette18.ShowHint:=true; + ImagePalette19.Hint:=s;ImagePalette19.ShowHint:=true; - s:='Voie pouvant porter un détecteur ou buttoir'; - ImagePalette1.Hint:=s;ImagePalette1.ShowHint:=true; - ImagePalette20.Hint:=s;ImagePalette20.ShowHint:=true; + s:='Voie pouvant porter un détecteur ou buttoir'; + ImagePalette1.Hint:=s;ImagePalette1.ShowHint:=true; + ImagePalette20.Hint:=s;ImagePalette20.ShowHint:=true; - s:='Voie ou buttoir'; - ImagePalette10.Hint:=s;ImagePalette1.ShowHint:=true; - ImagePalette11.Hint:=s;ImagePalette20.ShowHint:=true; + s:='Voie ou buttoir'; + ImagePalette10.Hint:=s;ImagePalette1.ShowHint:=true; + ImagePalette11.Hint:=s;ImagePalette20.ShowHint:=true; - s:='Aiguillage'; - ImagePalette2.Hint:=s;ImagePalette2.ShowHint:=true; - ImagePalette3.Hint:=s;ImagePalette3.ShowHint:=true; - ImagePalette4.Hint:=s;ImagePalette4.ShowHint:=true; - ImagePalette5.Hint:=s;ImagePalette5.ShowHint:=true; - ImagePalette12.Hint:=s;ImagePalette12.ShowHint:=true; - ImagePalette13.Hint:=s;ImagePalette13.ShowHint:=true; - ImagePalette14.Hint:=s;ImagePalette14.ShowHint:=true; - ImagePalette15.Hint:=s;ImagePalette15.ShowHint:=true; - ImagePalette24.Hint:=s;ImagePalette24.ShowHint:=true; - ImagePalette26.Hint:=s;ImagePalette26.ShowHint:=true; - ImagePalette27.Hint:=s;ImagePalette27.ShowHint:=true; - ImagePalette28.Hint:=s;ImagePalette28.ShowHint:=true; - ImagePalette29.Hint:=s;ImagePalette29.ShowHint:=true; - ImagePalette32.Hint:=s;ImagePalette32.ShowHint:=true; - ImagePalette33.Hint:=s;ImagePalette33.ShowHint:=true; - ImagePalette34.Hint:=s;ImagePalette34.ShowHint:=true; + s:='Aiguillage'; + ImagePalette2.Hint:=s;ImagePalette2.ShowHint:=true; + ImagePalette3.Hint:=s;ImagePalette3.ShowHint:=true; + ImagePalette4.Hint:=s;ImagePalette4.ShowHint:=true; + ImagePalette5.Hint:=s;ImagePalette5.ShowHint:=true; + ImagePalette12.Hint:=s;ImagePalette12.ShowHint:=true; + ImagePalette13.Hint:=s;ImagePalette13.ShowHint:=true; + ImagePalette14.Hint:=s;ImagePalette14.ShowHint:=true; + ImagePalette15.Hint:=s;ImagePalette15.ShowHint:=true; + ImagePalette24.Hint:=s;ImagePalette24.ShowHint:=true; + ImagePalette26.Hint:=s;ImagePalette26.ShowHint:=true; + ImagePalette27.Hint:=s;ImagePalette27.ShowHint:=true; + ImagePalette28.Hint:=s;ImagePalette28.ShowHint:=true; + ImagePalette29.Hint:=s;ImagePalette29.ShowHint:=true; + ImagePalette32.Hint:=s;ImagePalette32.ShowHint:=true; + ImagePalette33.Hint:=s;ImagePalette33.ShowHint:=true; + ImagePalette34.Hint:=s;ImagePalette34.ShowHint:=true; - - s:='Croisement ou TJD ou TJS ou pont'; - ImagePalette21.Hint:=s;ImagePalette21.ShowHint:=true; - ImagePalette22.Hint:=s;ImagePalette22.ShowHint:=true; - ImagePalette23.Hint:=s;ImagePalette22.ShowHint:=true; - ImagePalette25.Hint:=s;ImagePalette25.ShowHint:=true; + s:='Croisement ou TJD ou TJS ou pont'; + ImagePalette21.Hint:=s;ImagePalette21.ShowHint:=true; + ImagePalette22.Hint:=s;ImagePalette22.ShowHint:=true; + ImagePalette23.Hint:=s;ImagePalette22.ShowHint:=true; + ImagePalette25.Hint:=s;ImagePalette25.ShowHint:=true; tcoCree:=true; if debug=1 then Affiche('Fin création fenêtre TCO',clLime); + + + end; @@ -8987,7 +9368,7 @@ begin end; -procedure positionne_icone_G2(ip : timage;lbl : tlabel;i : integer); +procedure positionne_icone_G2(IndexTCO : integer;ip : timage;lbl : tlabel;i : integer); const NbElLi=12; var s : string; l : integer; @@ -9005,8 +9386,8 @@ begin top:= ((i-1) div NbElLi)*(hicone+10)+8; with canvas do begin - Pen.Color:=clFond; - Brush.color:=clFond; + Pen.Color:=clFond[IndexTCO]; + Brush.color:=clFond[IndexTCO]; Rectangle(0,0,licone,hicone); end; end; @@ -9025,7 +9406,7 @@ begin end; // dessine l'icone d'image ip et la place en x y d'après son index -procedure positionne_iconeLbIm(ip : timage;lbl : tlabel;i : integer); +procedure positionne_iconeLbIm(IndexTCO : integer;ip : timage;lbl : tlabel;i : integer); const NbElLi=12; var s : string; l : integer; @@ -9044,8 +9425,8 @@ begin top:= ((i-1) div NbElLi)*(hicone+10)+8; with canvas do begin - Pen.Color:=clFond; - Brush.color:=clFond; + Pen.Color:=clFond[IndexTCO]; + Brush.color:=clFond[IndexTCO]; Rectangle(0,0,licone,hicone); end; end; @@ -9067,8 +9448,6 @@ begin end; end; - - // dessine les icones du tco et les aligne procedure dessine_icones(indexTCO : integer); var ancH,ancW,i,lf,hf: integer; @@ -9082,14 +9461,14 @@ begin begin ip:=findComponent('ImagePalette'+intToSTR(i)) as Timage; lbl:=findComponent('Label'+intToSTR(i)) as Tlabel; - positionne_iconeLbIm(ip,lbl,i); + positionne_iconeLbIm(indexTCO,ip,lbl,i); end; for i:=32 to 34 do begin ip:=findComponent('ImagePalette'+intToSTR(i)) as Timage; lbl:=findComponent('Label'+intToSTR(i)) as Tlabel; - positionne_iconeLbIm(ip,lbl,i); + positionne_iconeLbIm(IndexTCO,ip,lbl,i); end; @@ -9097,17 +9476,15 @@ begin i:=Id_signal; ip:=findComponent('ImagePalette'+intToSTR(i)) as Timage; lbl:=findComponent('Label'+intToSTR(i)) as Tlabel; - positionne_icone_G2(ip,lbl,i); + positionne_icone_G2(IndexTCO,ip,lbl,i); i:=Id_Quai; ip:=findComponent('ImagePalette'+intToSTR(i)) as Timage; lbl:=findComponent('Label'+intToSTR(i)) as Tlabel; - positionne_icone_G2(ip,lbl,i); + positionne_icone_G2(IndexTCO,ip,lbl,i); i:=Id_action; ip:=findComponent('ImagePalette'+intToSTR(i)) as Timage; lbl:=findComponent('Label'+intToSTR(i)) as Tlabel; - positionne_icone_G2(ip,lbl,i); - - + positionne_icone_G2(IndexTCO,ip,lbl,i); // signal ip:=findComponent('ImagePalette51') as Timage; @@ -9117,8 +9494,8 @@ begin begin with canvas do begin - Pen.Color:=clFond; - Brush.color:=clFond; + Pen.Color:=clFond[IndexTCO]; + Brush.color:=clFond[IndexTCO]; Rectangle(0,0,licone,hicone); end; end; @@ -9188,10 +9565,42 @@ begin hauteurCell[indexTCO]:=ancH; end; +procedure positionne(indexTCO : integer); +var clLarge,ClHaut : integer; +begin + with formTCO[indexTCO] do + begin + clLarge:=Width; + clHaut:=Height; + + panel1.width:=clLarge-20; + Panel1.Top:=clHaut-Panel1.Height-64; // 64=entete de la fenetre + + with ScrollBox do + begin + Width:=clLarge-55; // laisser 50 pixels pour la trackbarzoom + scrollBar + top:=1; + left:=1; + end; + + if MasqueBandeauTCO then + begin + BandeauMasque:=true; + Panel1.Hide; + ScrollBox.Height:=clHaut-32; + end + else + begin + BandeauMasque:=false; + Panel1.show; + ScrollBox.Height:=ClHaut-Panel1.Height-ScrollBox.Top-64; + end; + end; +end; procedure TFormTCO.FormActivate(Sender: TObject); //procedure PFormTCO[indexTCO].FormActivate(Sender: TObject); -var clLarge,ClHaut,indextco : integer; +var indextco : integer; begin indextco:=index_TCO(sender); IndexTCOCourant:=indexTCO; @@ -9208,7 +9617,6 @@ begin ButtonSimu.Visible:=not(Diffusion); ImageTemp.Visible:=not(Diffusion); ImageTemp2.Visible:=not(Diffusion); - ButtonAfficheBandeau.visible:=false; hauteurCell[indexTCO]:=ImagePalette1.Height; LargeurCell[indexTCO]:=ImagePalette1.Width; @@ -9238,37 +9646,7 @@ begin TrackBarZoom.Min:=ZoomMin; TrackBarZoom.position:=34; - // height est la taille utile de la fenetre = taille fenetre-32 - clLarge:=formTCO[indexTCO].Width; - clHaut:=formTCO[indexTCO].Height; - //Affiche('large='+intToSTR(clLarge)+' Haut='+intToSTR(clHaut),clyellow); - ButtonAfficheBandeau.Left:=clLarge-70; - - panel1.width:=clLarge-12; - Panel1.Top:=clHaut-Panel1.Height-32; // 32=entete de la fenetre - - with ScrollBox do - begin - Width:=clLarge-55; // laisser 50 pixels pour la trackbarzoom + scrollBar - top:=1; - left:=1; - end; - - if MasqueBandeauTCO then - begin - ButtonAfficheBandeau.visible:=true; - BandeauMasque:=true; - Panel1.Hide; - ScrollBox.Height:=clHaut-32; - end - else - begin - BandeauMasque:=false; - Panel1.show; - ScrollBox.Height:=ClHaut-Panel1.Height-ScrollBox.Top-32; - end; - - //Panel1.top:=scrollBox.top+ScrollBox.height; + positionne(indexTCO); FormInit[indexTCO]:=true; end; @@ -9488,9 +9866,9 @@ begin if not(AvecGrille[indexTCO]) then exit; With PCanvasTCO[indexTCO] do begin - pen.color:=ClGrille; + pen.color:=ClGrille[IndexTCO]; pen.Width:=1; - Brush.Color:=ClFond; + Brush.Color:=ClFond[IndexTCO]; pen.mode:=PmCopy; // lignes verticales for x:=1 to NbreCellX[indexTCO] do @@ -9527,7 +9905,6 @@ begin end; end; - procedure couper(indexTCO: integer); var x,y,XCell1,YCell1,xCell2,yCell2 : integer; begin @@ -9538,6 +9915,20 @@ begin EditTexte.Text:=''; end; + // couper par la fenetre graphique + if FormTCO[indexTCO].RadioGroupSel.ItemIndex=1 then + begin + xMiniSel:=Rect_select.Gd.Left; + yMiniSel:=Rect_select.Gd.top; + xMaxiSel:=Rect_select.Gd.right; + yMaxiSel:=Rect_select.Gd.bottom; + if xminiSel>xMaxiSel then echange(xminiSel,xMaxiSel); + if yminiSel>yMaxiSel then echange(yminiSel,yMaxiSel); + // effacer le rectangle + Affiche_Rectangle(IndexTCO,Rect_select); + Rect_select.NumTCO:=0; // indicateur de non affichage + end; + // couper sans sélection : on coupe une seule cellule if not(SelectionAffichee[indexTCO]) then begin @@ -9617,7 +10008,7 @@ begin with formTCO[indexTCO].ImageTCO.canvas do begin Pen.Mode:=PmXor; - Pen.color:=clGrille; + Pen.color:=clGrille[IndexTCO]; Brush.Color:=clblue; Rectangle(rAncien); end; @@ -9637,7 +10028,7 @@ begin with formTCO[indexTCO].ImageTCO.canvas do begin Pen.Mode:=PmXor; - Pen.color:=clGrille; + Pen.color:=clGrille[IndexTCO]; Brush.Color:=clblue; //FillRect(r); Rectangle(r); @@ -9651,8 +10042,18 @@ var s,d,indexTCO,x,y : integer; procede : boolean; begin if affevt then Affiche('TCO.FormKeyDown',clOrange); - if not(auto_tcurs) then exit; + indexTCO:=index_TCO(Sender); + if (RadioGroupSel.ItemIndex=1) and (Key=Vk_Escape) then + begin + if Rect_select.NumTCO=indexTCO then affiche_rectangle(IndexTCO,Rect_select); + Rect_select.NumTCO:=0; + selectionAffichee[indexTCO]:=false; + exit; + end; + + if not(auto_tcurs) or (RadioGroupSel.ItemIndex=1) then exit; + procede:=false; // indicateur on a tapé une touche de curseur //Affiche(intToSTR(key),clyellow); @@ -10208,9 +10609,7 @@ begin end; procedure TFormTCO.ButtonSauveTCOClick(Sender: TObject); -var indexTCO : integer; begin - indexTCO:=Index_TCO(sender); sauve_fichiers_tco; defocusControl(ButtonSauveTCO,true); end; @@ -10272,11 +10671,11 @@ begin Annule(indexTCO); end; -// renvoie un élément du TCO par l'icone en fonction du tracé désiré 4 +// renvoie un élément du TCO par l'icone en fonction des 4 tracés désiré // exemple : deux lignes qui se croisent renvoie un croisement // el = élement à remplacer // Bim = élément d'origine -// quadrant du tracé (2=NE 3=Est 4=SE 5=S ) +// 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é // on regarde si l'élément est connecté par testbit(tco[indextco,x,y].liaisons,numbit) numbit=0=NO 1=N 2=NE 3=E 4=SE 5=S 6=SO 7=O @@ -10716,7 +11115,8 @@ end; // évènement qui se produit quand on clique gauche ou droit procedure TFormTCO.ImageTCOMouseDown(Sender: TObject; Button: TMouseButton;Shift: TShiftState; X, Y: Integer); var position : Tpoint; - indexTCO,i,n,Bimage,xt,yt,xf,yf,xclic,yclic : integer; + indexTCO,i,n,adresse,Bimage,xt,yt,xf,yf,xclic,yclic : integer; + s : string; begin indexTCO:=index_tco(sender); GetCursorPos(Position); @@ -10733,6 +11133,13 @@ begin begin if affEvt then Affiche('TCO Souris clicG enfoncée',clYellow); if dbleClicTCO then begin dbleClicTCO:=false;exit;end; + + if not(clicSouris) then + begin + // front montant souris + + end; + auto_tcurs:=true; clicsouris:=true; @@ -10744,11 +11151,11 @@ begin n:=tco[indextco,xclic,yclic].feuoriente; if i=1 then Affiche_fenetre_TCO(n,true); if i=2 then with formprinc do - begin - windowState:=wsNormal; //Maximized; - show; - BringToFront; - end; + begin + windowState:=wsNormal; //Maximized; + show; + BringToFront; + end; if (i=3) and (CDMhd<>0) then begin ShowWindow(CDMhd,SW_MAXIMIZE);end; end; @@ -10882,7 +11289,30 @@ begin exit; end; - //Temposouris:=0; + // si clic souris en mode fenetre graphique: initialisation + if (RadioGroupSel.ItemIndex=1) then + begin + if rect_select.NumTCO<>indexTCO then + begin + affiche_rectangle(rect_select.NumTCO,Rect_select); // effacer sur l'autre tco + end; + if not(selectionAffichee[indexTCO]) then + begin + rect_select.NumTCO:=indexTCO; // indicateur d'affichage + with Rect_select.Gd do + begin + Left:=(xclic-1)*largeurcell[indexTCO]; + Top:=(yclic-1)*hauteurCell[indexTCO]; + Right:=(xclic)*largeurCell[indexTCO]; + Bottom:=(yclic)*hauteurCell[indexTCO]; + end; + Init_rectangle(IndexTCO,Rect_Select); + Affiche_Rectangle(indexTCO,Rect_select); + selectionAffichee[indexTCO]:=true; + end; + end + else + begin xMiniSel:=99999;yMiniSel:=99999; xMaxiSel:=0;yMaxiSel:=0; @@ -10894,7 +11324,7 @@ begin with formTCO[n].imageTCO.Canvas do begin Pen.Mode:=PmXor; - Pen.color:=clGrille; + Pen.color:=clGrille[n]; Brush.Color:=clblue; Rectangle(rAncien); end; @@ -10903,12 +11333,61 @@ begin // clic gauche clicTCO:=true; - //Affiche('xcliccell='+IntToSTR(XclicCell)+' ycliccell='+IntToSTR(YclicCell),clyellow); + //Affiche('xcliccell='+IntToSTR(XclicCell[indexTCO])+' ycliccell='+IntToSTR(YclicCell[indexTCO]),clyellow); + if Bimage=id_signal then + begin + adresse:=tco[IndexTCO,xClic,yClic].Adresse; + if (adresse=0) or (index_signal(adresse)=0) then s:='Signal sans adresse' else + s:=infosignal(adresse); + ImageTCO.Hint:=s; + end + else + if IsAigTCO(Bimage) then + begin + adresse:=tco[IndexTCO,xClic,yClic].Adresse; + if adresse=0 then s:='Aiguillage sans adresse' + else + begin + i:=index_aig(adresse); + if aiguillage[i].modele<>crois then + begin + if Adresse<>0 then + begin + s:='Aiguillage '+intToSTR(adresse)+' Position='; + n:=aiguillage[i].position; + case n of + const_inconnu : s:=s+'inconnue '; + const_droit : s:=s+'droit '; + const_devie : s:=s+'devie '; + end; + if ((aiguillage[i].modele=tjd) or (aiguillage[i].modele=tjs)) and (aiguillage[i].EtatTJD=4) then + begin + adresse:=aiguillage[i].DDevie; + s:=s+#13+'Aiguillage '+intToSTR(adresse)+' Position='; + i:=index_aig(adresse); + n:=aiguillage[i].position; + case n of + const_inconnu : s:=s+'inconnue'; + const_droit : s:=s+'droit'; + const_devie : s:=s+'devie'; + end; + end; + end + else + s:='Croisement '+intToSTR(adresse); + end; + end; + ImageTCO.Hint:=s; + end + else ImageTCO.Hint:=''; + if Xclic>NbreCellX[indexTCO] then exit; if Yclic>NbreCellY[indexTCO] then exit; if not(selectionaffichee[indexTCO]) then _entoure_cell_clic(indexTCO); actualise(indexTCO); // actualise la fenetre de config cellule + end; + clicTCO:=false; end; @@ -10928,30 +11407,40 @@ begin XclicCellInserer:=XClic; YclicCellInserer:=YClic; - //Entoure_cell(XclicCellInserer,YclicCellInserer); EditAdrElement.Text:=IntToSTR(tco[indextco,XClicCellInserer,YClicCellInserer].Adresse); EditTypeImage.Text:=IntToSTR(tco[indextco,XClicCellInserer,YClicCellInserer].Bimage); end; end; + procedure TFormTCO.ImageTCOMouseMove(Sender: TObject; Shift: TShiftState;X, Y: Integer); var r : Trect; - indexTCO,cellX,cellY,XSel1,YSel1,XSel2,YSel2,Bimage,xMiniSelP,yMiniSelP,xMaxiSelP,yMaxiSelP : integer; + indexTCO,XSel1,YSel1,XSel2,YSel2,Bimage,xMiniSelP,yMiniSelP,xMaxiSelP,yMaxiSelP : integer; ok : boolean; begin if affevt then Affiche('ImageTCOMouseMove',clLime); if dbleClicTCO then begin dbleClicTCO:=false;exit;end; + //Affiche(IntToSTR(tempoSouris),clred); + indexTCO:=index_tco(sender); + + // exécuté uniquement si souris enfoncée et changement position souris + if (radioGroupSel.ItemIndex=1) and ((ax<>x) or (ay<>y)) and selectionAffichee[indexTCO] then + begin + //Affiche(IntToSTR(tick),clred); + Accroche_Rectangle_selection(indexTCO,x,y); + exit; + end; + if Temposouris>0 then exit; // Affiche('*',cllime); - indexTCO:=index_tco(sender); //affiche(intToSTR(y),clorange); - cellX:=x div LargeurCell[indexTCO]+1; + cellX:=x div LargeurCell[indexTCO]+1; // variables globales cellY:=y div hauteurCell[indexTCO]+1; - //Affiche('Cellx='+IntToSTR(Cellx)+' Celly='+intToSTR(Celly)+' AncienCellx='+IntToSTR(AncienXClicCell)+' AncienCelly='+intToSTR(AncienYClicCell),clorange); if (AncienXClicCell=CellX) and (AncienYClicCell=CellY) then exit; + PimageTCO[indexTCO].Hint:=''; AncienXClicCell:=CellX; AncienYClicCell:=CellY; @@ -11003,6 +11492,7 @@ begin exit; end; + TpsBougeSouris:=5; if not(clicsouris) or (temposouris>0) then exit; // zone de sélection bleue en coordonnées souris @@ -11029,7 +11519,7 @@ begin with imageTCO.Canvas do begin Pen.Mode:=PmXor; - Pen.color:=clGrille; + Pen.color:=clGrille[IndexTCO]; Brush.Color:=clblue; Rectangle(rAncien); end; @@ -11046,14 +11536,9 @@ begin //Affiche(intToSTR(Xsel1)+' '+intToStr(Ysel1)+' '+intToSTR(Xsel2)+' '+intToStr(Ysel2),clYellow); // Affiche le nouveau rectangle de sélection Rancien:=r; - with imageTCO.Canvas do - begin - Pen.Mode:=PmXor; - Pen.color:=clGrille; - Brush.Color:=clblue; - //FillRect(r); - Rectangle(r); - end; + Affiche_selection(indexTCO); + + SelectionAffichee[indexTCO]:=true; //Affiche('Sélection affichée',clLime); if entoure[indexTCO] then begin Entoure_cell(indexTCO,Xentoure[indexTCO],Yentoure[indexTCO]);entoure[indexTCO]:=false;end; // efface @@ -11064,6 +11549,16 @@ procedure TFormTCO.ImageTCOMouseUp(Sender: TObject; Button: TMouseButton; begin if affevt then Affiche('Souris clic relachée',clyellow); clicsouris:=false; + + prise_droit:=false; + prise_gauche:=false; + prise_bas:=false; + prise_haut:=false; + prise_NE:=false; + prise_SO:=false; + prise_SE:=false; + prise_NO:=false; + prise_N:=false; end; procedure TFormTCO.ButtonRedessineClick(Sender: TObject); @@ -11071,7 +11566,6 @@ var indexTCO : integer; begin indexTCO:=index_TCO(sender); Affiche_TCO(indexTCO); - defocusControl(ButtonRedessine,true); end; // changement de l'adresse d'un élément @@ -11083,7 +11577,7 @@ begin if clicTCO then exit; if (ConfCellTCO) then exit; clicTCO:=true; - auto_tcurs:=false; // interdit le déplacement du curseur encadré du TCO (pour que les tuouches curseur s'applique au Tedit) + auto_tcurs:=false; // interdit le déplacement du curseur encadré du TCO (pour que les touches curseur s'applique au Tedit) indexTCO:=index_TCO(sender); s:=formTCO[indexTCO].EditAdrElement.Text; if length(s)>1 then @@ -11221,7 +11715,8 @@ var l,h,indexTCO : integer; begin l:=Formprinc.Image9feux.width; //57 h:=Formprinc.Image9feux.height; //105 - indexTCO:=Index_tco(sender); + indexTCO:=Index_tco(sender); + TCODrag:=IndexTCO; ImagePalette50.BeginDrag(true); BitBlt(OldBmp.Canvas.Handle,0,0,LargeurCell[indexTCO],hauteurCell[indexTCO],ImageTCO.Canvas.Handle,offsetSourisX,offsetSourisY,SRCCOPY); drag:=true; @@ -11229,7 +11724,7 @@ begin with formTCO[indexTCO].ImageTemp2.Canvas do begin - pen.Color:=clfond; + pen.Color:=clfond[IndexTCO]; brush.Color:=clblack; Rectangle(0,0,91,91); end; @@ -11247,7 +11742,7 @@ var BImage : integer; begin if actualize then exit; BImage:=tco[indextco,XClicCell[indexTCO],YClicCell[indexTCO]].Bimage; - if Bimage<>50 then exit; + if Bimage<>Id_signal then exit; TCO_modifie:=true; @@ -11292,7 +11787,7 @@ var BImage,aspect,adresse : integer; begin if actualize then exit; BImage:=tco[indextco,XClicCell[indexTCO],YClicCell[indexTCO]].Bimage; - if Bimage<>50 then exit; + if Bimage<>Id_signal then exit; TCO_modifie:=true; @@ -11335,7 +11830,7 @@ begin c:=c.GetParentComponent; // formTCO indexTCO:=index_tco(c); tourne90D(indextco); -end; +end; procedure vertical(indexTCO : integer); var BImage ,aspect,Adresse : integer; @@ -11343,7 +11838,7 @@ begin if actualize then exit; BImage:=tco[indextco,XClicCell[indexTCO],YClicCell[indexTCO]].Bimage; // si c'est autre chose qu'un signal, sortir - if Bimage<>50 then exit; + if Bimage<>Id_signal then exit; TCO_modifie:=true; adresse:=tco[indextco,XClicCell[indexTCO],YClicCell[indexTCO]].Adresse; @@ -11398,6 +11893,8 @@ begin calcul_cellules(indexTCO); Affiche_TCO(indexTCO); SelectionAffichee[indexTCO]:=false; + Rect_select.NumTCO:=0; + tabstop:=false; defocusControl(trackbarZoom,true); { Affiche(intToSTR(FormTCO.ScrollBox.HorzScrollBar.Range),clyellow); @@ -11416,9 +11913,9 @@ var indexTCO : integer; begin if clicTCO then exit; if affevt then Affiche('TCO.EditTextChange',clOrange); - auto_tcurs:=false; // interdit le déplacement du curseur encadré du TCO (pour que les tuouches curseur s'applique au Tedit) + auto_tcurs:=false; // interdit le déplacement du curseur encadré du TCO (pour que les touches curseur s'applique au Tedit) indexTCO:=index_TCO(sender); - PCanvasTCO[indexTCO].Brush.Color:=Clfond; + PCanvasTCO[indexTCO].Brush.Color:=Clfond[IndexTCO]; efface_entoure(indexTCO); if tco[indextco,XClicCell[indexTCO],YClicCell[indexTCO]].texte='' then @@ -11474,29 +11971,20 @@ begin if (xClicCell[indexTCO]=0) or (xClicCell[indexTCO]>NbreCellX[indexTCO]) or (yClicCell[indexTCO]=0) or (yClicCell[indexTCO]>NbreCelly[indexTCO]) then exit; Bimage:=tco[indextco,xClicCell[indexTCO],yClicCell[indexTCO]].Bimage; if IsAIgTCO(Bimage) then - begin - tco[indextco,xClicCell[indexTCO],yClicCell[indexTCO]].inverse:=CheckPinv.checked; - TCO_modifie:=true; - end; + begin + tco[indextco,xClicCell[indexTCO],yClicCell[indexTCO]].inverse:=CheckPinv.checked; + TCO_modifie:=true; + end; end; procedure TFormTCO.ButtonMasquerClick(Sender: TObject); begin Panel1.Hide; - ButtonAfficheBandeau.visible:=true; ScrollBox.Height:=ClientHeight-32; BandeauMasque:=true; defocusControl(ButtonMasquer,true); end; -procedure TFormTCO.ButtonAfficheBandeauClick(Sender: TObject); -begin - Panel1.Show; - ButtonAfficheBandeau.visible:=false; - ScrollBox.Height:=ClientHeight-Panel1.Height-ScrollBox.Top-32; - BandeauMasque:=false; -end; - procedure TFormTCO.ImageTCODblClick(Sender: TObject); var Bimage,Adresse,i,indextco : integer; tjdC : boolean; @@ -11917,7 +12405,6 @@ var oriente,piedFeu,indexTCO : integer; c : Tcomponent; begin if affevt then Affiche('on popup',clyellow); - indexTCO:=1; c:=popupmenu1.PopupComponent ; // imageTCO c:=c.GetParentComponent; // scrollBox @@ -11983,7 +12470,7 @@ begin FormConfCellTCO.show; FormConfCellTCO.BringToFront; - actualise(IndexTCOCourant); // actualiser après avoir affiché formConfCellTCO + actualise(IndexTCO); // actualiser après avoir affiché formConfCellTCO end; @@ -11997,15 +12484,11 @@ begin indexTCO:=index_tco(c); if NbreCellY[indexTCO]>=MaxCellY then exit; TamponAffecte:=false; - SetLength(TCO[indexTCO],NbreCellX[indexTCO]+2,NbreCellY[indexTCO]+3); // ajoute une ligne en Y init_tampon_copiercoller; for y:=NbreCellY[indexTCO]-1 downto YClicCell[indexTCO] do begin - for x:=1 to NbreCellX[indexTCO] do - begin - tco[indextco,x,y+1]:=tco[indextco,x,y]; - end; + for x:=1 to NbreCellX[indexTCO] do tco[indextco,x,y+1]:=tco[indextco,x,y]; end; for x:=1 to NbreCellX[indexTCO] do begin @@ -12015,7 +12498,7 @@ begin tco[indextco,x,YClicCell[indexTCO]].repr:=0; tco[indextco,x,YClicCell[indexTCO]].texte:=''; tco[indextco,x,YClicCell[indexTCO]].fonte:=''; - tco[indextco,x,YClicCell[indexTCO]].CouleurFond:=Clfond; + tco[indextco,x,YClicCell[indexTCO]].CouleurFond:=Clfond[IndexTCO]; tco[indextco,x,YClicCell[indexTCO]].PiedFeu:=0; tco[indextco,x,YClicCell[indexTCO]].FeuOriente:=0; end; @@ -12033,7 +12516,6 @@ begin indexTCO:=index_tco(c); if NbreCellY[indexTCO]>=MaxCellY then exit; TamponAffecte:=false; - SetLength(TCO[indexTCO],NbreCellX[indexTCO]+2,NbreCellY[indexTCO]+3); // ajoute une ligne en Y init_tampon_copiercoller; for y:=NbreCellY[indexTCO] downto YClicCell[indexTCO]+1 do @@ -12048,7 +12530,7 @@ begin tco[indextco,x,YClicCell[indexTCO]+1].repr:=0; tco[indextco,x,YClicCell[indexTCO]+1].texte:=''; tco[indextco,x,YClicCell[indexTCO]+1].fonte:=''; - tco[indextco,x,YClicCell[indexTCO]+1].Couleurfond:=Clfond; + tco[indextco,x,YClicCell[indexTCO]+1].Couleurfond:=Clfond[IndexTCO]; tco[indextco,x,YClicCell[indexTCO]+1].PiedFeu:=0; tco[indextco,x,YClicCell[indexTCO]+1].FeuOriente:=0; end; @@ -12097,7 +12579,7 @@ begin tco[indextco,x,NbreCellY[indexTCO]].repr:=0; tco[indextco,x,NbreCellY[indexTCO]].texte:=''; tco[indextco,x,NbreCellY[indexTCO]].fonte:=''; - tco[indextco,x,NbreCellY[indexTCO]].Couleurfond:=Clfond; + tco[indextco,x,NbreCellY[indexTCO]].Couleurfond:=Clfond[IndexTCO]; tco[indextco,x,NbreCellY[indexTCO]].PiedFeu:=0; tco[indextco,x,NbreCellY[indexTCO]].FeuOriente:=0; tco[indextco,x,NbreCellY[indexTCO]].Buttoir:=0; @@ -12105,7 +12587,6 @@ begin tco[indextco,x,NbreCellY[indexTCO]].Pont:=0; end; dec(NbreCellY[indexTCO]); - SetLength(TCO[indexTCO],NbreCellX[indexTCO]+2,NbreCellY[indexTCO]+2); // ajuste la taille du tableau affiche_TCO(indexTCO); end; @@ -12120,7 +12601,6 @@ begin indexTCO:=index_tco(c); if NbreCellX[indexTCO]>=MaxCellX then exit; TamponAffecte:=false; - SetLength(TCO[indexTCO],NbreCellX[indexTCO]+3,NbreCellY[indexTCO]+2); // ajoute taille X init_tampon_copiercoller; for x:=NbreCellX[indexTCO] downto XClicCell[indexTCO] do @@ -12135,7 +12615,7 @@ begin tco[indextco,XClicCell[indexTCO],y].repr:=0; tco[indextco,XClicCell[indexTCO],y].texte:=''; tco[indextco,XClicCell[indexTCO],y].fonte:=''; - tco[indextco,XClicCell[indexTCO],y].Couleurfond:=Clfond; + tco[indextco,XClicCell[indexTCO],y].Couleurfond:=Clfond[IndexTCO]; tco[indextco,XClicCell[indexTCO],y].PiedFeu:=0; tco[indextco,XClicCell[indexTCO],y].FeuOriente:=0; end; @@ -12154,7 +12634,6 @@ begin if NbreCellX[indexTCO]>=MaxCellX then exit; TamponAffecte:=false; - SetLength(TCO[indextco],NbreCellX[indexTCO]+3,NbreCellY[indexTCO]+2); // ajoute taille X init_tampon_copiercoller; for x:=NbreCellX[indexTCO] downto XClicCell[indexTCO]+1 do @@ -12169,7 +12648,7 @@ begin tco[indextco,XClicCell[indexTCO]+1,y].repr:=0; tco[indextco,XClicCell[indexTCO]+1,y].texte:=''; tco[indextco,XClicCell[indexTCO]+1,y].fonte:=''; - tco[indextco,XClicCell[indexTCO]+1,y].Couleurfond:=Clfond; + tco[indextco,XClicCell[indexTCO]+1,y].Couleurfond:=Clfond[IndexTCO]; tco[indextco,XClicCell[indexTCO]+1,y].PiedFeu:=0; tco[indextco,XClicCell[indexTCO]+1,y].FeuOriente:=0; end; @@ -12217,12 +12696,11 @@ begin tco[indextco,NbreCellx[indexTCO],y].repr:=0; tco[indextco,NbreCellx[indexTCO],y].texte:=''; tco[indextco,NbreCellx[indexTCO],y].fonte:=''; - tco[indextco,NbreCellx[indexTCO],y].CouleurFond:=Clfond; + tco[indextco,NbreCellx[indexTCO],y].CouleurFond:=Clfond[IndexTCO]; tco[indextco,NbreCellx[indexTCO],y].PiedFeu:=0; tco[indextco,NbreCellx[indexTCO],y].FeuOriente:=0; end; dec(NbreCellX[indexTCO]); - SetLength(TCO[indexTCO],NbreCellX[indexTCO]+2,NbreCellY[indexTCO]+2); // ajuste taille affiche_TCO(indexTCO); end; @@ -12325,7 +12803,7 @@ begin with formTCO[indexTCO] do begin - cs:='ColorA='+IntToHex(clfond,6); // pour rajouter aux couleurs personnalisées + cs:='ColorA='+IntToHex(clfond[IndexTCO],6); // pour rajouter aux couleurs personnalisées colorDialog1.CustomColors.Add(cs); if colorDialog1.Execute then begin @@ -12411,16 +12889,14 @@ begin with formTCO[indexTCO].imageTCO.Canvas do begin Pen.Mode:=PmXor; - Pen.color:=clGrille; + Pen.color:=clGrille[IndexTCO]; Brush.Color:=clblue; Rectangle(rAncien); end; end; -procedure TFormTCO.ButtonDessinerClick(Sender: TObject); -var indexTCO : integer; +procedure dessinerTCO(indexTCO : integer); begin - indexTCO:=index_tco(sender); if not(modetrace[indexTCO]) then begin modetrace[indexTCO]:=true; @@ -12433,6 +12909,14 @@ begin screen.cursor:=crUpArrow; end else stop_modetrace(indexTCO); + +end; + +procedure TFormTCO.ButtonDessinerClick(Sender: TObject); +var indexTCO : integer; +begin + indexTCO:=index_tco(sender); + dessinerTCO(indexTCO); defocusControl(buttonDessiner,true); end; @@ -12616,5 +13100,96 @@ begin end; +procedure TFormTCO.RadioGroupSelClick(Sender: TObject); +var indexTCO : integer; +begin + indextco:=index_TCO(sender); + if indexTCO=0 then exit; + // sélection par cellules + if RadioGroupSel.ItemIndex=0 then + begin + // si le rectangle est affiché dans ce tco, l'effacer + if Rect_select.NumTCO=indexTCO then affiche_rectangle(IndexTCO,Rect_select); + Rect_select.NumTCO:=0; + selectionAffichee[indexTCO]:=false; + end; + // sélection par outil graphique + if RadioGroupSel.ItemIndex=1 then + begin + efface_entoure(indexTCO); + efface_selection(IndexTCO); + selectionAffichee[indexTCO]:=false; + end; + + defocusControl(RadioGroupSel,true); +end; + +function TformTCO.index_TCOMainMenu : integer; +var t : Tcontrol; + s : string; +begin + t:=FindControl(mainmenuTCO.WindowHandle); // on ne peut pas remonter au parent d'un mainmenu avec getparentcomponent + s:=t.name; + result:=extract_int(s); +end; + +procedure TFormTCO.SauvegarderleTCO1Click(Sender: TObject); +begin + sauve_fichiers_tco; +end; + +procedure TFormTCO.DessinerleTCO1Click(Sender: TObject); +var indexTCO : integer; + +begin + indexTCO:=index_TCOMainMenu; + dessinerTCO(indexTCO); +end; + +procedure TFormTCO.ConfigurationduTCO1Click(Sender: TObject); +begin + TformconfigTCO.create(self); + formconfigTCO.showmodal; + formconfigTCO.close; + defocusControl(ButtonConfigTCO,true); +end; + +procedure TFormTCO.Redessine1Click(Sender: TObject); +var indexTCO : integer; +begin + indexTCO:=index_TCOMainMenu; + Affiche_TCO(indexTCO); +end; + +procedure TFormTCO.Affichebandeau1Click(Sender: TObject); +var indexTCO : integer; +begin + indexTCO:=index_TCOMainMenu; + Panel1.Show; + positionne(indexTCO); + BandeauMasque:=false; +end; + +procedure TFormTCO.Mosaquehorizontale1Click(Sender: TObject); +begin + mosaiqueH; +end; + +procedure TFormTCO.Mosaqueverticale1Click(Sender: TObject); +begin + mosaiqueV; +end; + +procedure TFormTCO.AfficherSignauxComplexes1Click(Sender: TObject); +begin + with formprinc do + begin + windowState:=wsNormal; //Maximized; + show; + BringToFront; + end; +end; + + end. diff --git a/verif_version.pas b/verif_version.pas index 3960079..0d856de 100644 --- a/verif_version.pas +++ b/verif_version.pas @@ -4,8 +4,8 @@ interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, - Dialogs, StdCtrls , ComCtrls ,WinInet, ExtCtrls , StrUtils, unitPrinc, - ShellAPI; + Dialogs, StdCtrls , ComCtrls ,WinInet, ExtCtrls , StrUtils, unitPrinc, + ShellAPI; type TFormVersion = class(TForm) @@ -25,7 +25,7 @@ var verifVersion,notificationVersion : boolean; date_creation,nombre_tel : string; -Const Version='8.24'; // sert à la comparaison de la version publiée +Const Version='8.25'; // 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; @@ -246,7 +246,7 @@ begin end; comm[i]:=supprime_anti(description); - ncomm:=i; + ncomm:=i-1; end; @@ -291,7 +291,7 @@ begin FormVersion.Left:=10; FormVersion.show; s:='Vous utilisez la version '+version+SousVersion+' mais il existe la version '+Version_p+SV_publie; - if length(description)>0 then + if nComm>0 then begin FormVersion.Memo1.lines.Clear; Aff('Nouveautés de la V'+version_p+SV_publie+' de Signaux_Complexes_GL du '+date_creation); diff --git a/versions.txt b/versions.txt index 8e848f8..f32ae5b 100644 --- a/versions.txt +++ b/versions.txt @@ -197,6 +197,8 @@ version 8.22 : Corrections diverses, dont un probl version 8.23 : Correction bug si changement aspect du signal. Pilotage des décodeurs de signaux personnalisés par COM/USB/Sockets version 8.24 : Traitement de cas particuliers de l'importation de réseaux CDM rail. +version 8.25 : Intégration d'un outil graphique de sélection dans le TCO. + Intégration d'un menu dans la fenêtre du TCO.