diff --git a/Notice d'utilisation des signaux_complexes_GL_V9.0.pdf b/Notice d'utilisation des signaux_complexes_GL_V9.1.pdf similarity index 80% rename from Notice d'utilisation des signaux_complexes_GL_V9.0.pdf rename to Notice d'utilisation des signaux_complexes_GL_V9.1.pdf index 0e66b51..9b3bfcb 100644 Binary files a/Notice d'utilisation des signaux_complexes_GL_V9.0.pdf and b/Notice d'utilisation des signaux_complexes_GL_V9.1.pdf differ diff --git a/Signaux_complexes_GL.cfg b/Signaux_complexes_GL.cfg index 2d571d5..326b5d5 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 290450a..73b43da 100644 --- a/Signaux_complexes_GL.dof +++ b/Signaux_complexes_GL.dof @@ -17,8 +17,8 @@ M=0 N=1 O=0 P=0 -Q=1 -R=1 +Q=0 +R=0 S=0 T=0 U=0 diff --git a/Signaux_complexes_GL.map b/Signaux_complexes_GL.map index 010dfe7..aa0ab54 100644 --- a/Signaux_complexes_GL.map +++ b/Signaux_complexes_GL.map @@ -1,148 +1,148 @@ Start Length Name Class - 0001:00000000 001E689CH .text CODE - 0002:00000000 00002E04H .data DATA - 0002:00002E04 06950F41H .bss BSS + 0001:00000000 001DD698H .text CODE + 0002:00000000 00002F10H .data DATA + 0002:00002F10 0698FB35H .bss BSS Detailed map of segments - 0001:00000000 00005F3F C=CODE S=.text G=(none) M=System ACBP=A9 - 0001:00005F40 00000140 C=CODE S=.text G=(none) M=SysInit ACBP=A9 - 0001:00006080 00000108 C=CODE S=.text G=(none) M=Types ACBP=A9 - 0001:00006188 00000F28 C=CODE S=.text G=(none) M=Windows ACBP=A9 - 0001:000070B0 00000038 C=CODE S=.text G=(none) M=Messages ACBP=A9 - 0001:000070E8 00000338 C=CODE S=.text G=(none) M=SysConst ACBP=A9 - 0001:00007420 00006F90 C=CODE S=.text G=(none) M=SysUtils ACBP=A9 - 0001:0000E3B0 0000081B C=CODE S=.text G=(none) M=VarUtils ACBP=A9 - 0001:0000EBCC 0000806E C=CODE S=.text G=(none) M=Variants ACBP=A9 - 0001:00016C3C 000001A0 C=CODE S=.text G=(none) M=RTLConsts ACBP=A9 - 0001:00016DDC 0000083C C=CODE S=.text G=(none) M=TypInfo ACBP=A9 - 0001:00017618 00000368 C=CODE S=.text G=(none) M=ActiveX ACBP=A9 - 0001:00017980 0000A7FE C=CODE S=.text G=(none) M=Classes ACBP=A9 - 0001:00022180 00000378 C=CODE S=.text G=(none) M=Consts ACBP=A9 - 0001:000224F8 00009DC7 C=CODE S=.text G=(none) M=Graphics ACBP=A9 - 0001:0002C2C0 00000124 C=CODE S=.text G=(none) M=Math ACBP=A9 - 0001:0002C3E4 000002B8 C=CODE S=.text G=(none) M=Contnrs ACBP=A9 - 0001:0002C69C 00000198 C=CODE S=.text G=(none) M=CommCtrl ACBP=A9 - 0001:0002C834 00000787 C=CODE S=.text G=(none) M=MultiMon ACBP=A9 - 0001:0002CFBC 00000038 C=CODE S=.text G=(none) M=Imm ACBP=A9 - 0001:0002CFF4 00000FF8 C=CODE S=.text G=(none) M=HelpIntfs ACBP=A9 - 0001:0002DFEC 00000058 C=CODE S=.text G=(none) M=WinSpool ACBP=A9 - 0001:0002E044 000010C8 C=CODE S=.text G=(none) M=Printers ACBP=A9 - 0001:0002F10C 0000031F C=CODE S=.text G=(none) M=FlatSB ACBP=A9 - 0001:0002F42C 000003F0 C=CODE S=.text G=(none) M=SyncObjs ACBP=A9 - 0001:0002F81C 000009BB C=CODE S=.text G=(none) M=UxTheme ACBP=A9 - 0001:000301D8 00000038 C=CODE S=.text G=(none) M=RichEdit ACBP=A9 - 0001:00030210 00000038 C=CODE S=.text G=(none) M=ToolWin ACBP=A9 - 0001:00030248 00000040 C=CODE S=.text G=(none) M=ShellAPI ACBP=A9 - 0001:00030288 00000038 C=CODE S=.text G=(none) M=RegStr ACBP=A9 - 0001:000302C0 00000058 C=CODE S=.text G=(none) M=WinInet ACBP=A9 - 0001:00030318 00000038 C=CODE S=.text G=(none) M=UrlMon ACBP=A9 - 0001:00030350 000000EC C=CODE S=.text G=(none) M=ShlObj ACBP=A9 - 0001:0003043C 00000060 C=CODE S=.text G=(none) M=CommDlg ACBP=A9 - 0001:0003049C 00000038 C=CODE S=.text G=(none) M=Dlgs ACBP=A9 - 0001:000304D4 000036D1 C=CODE S=.text G=(none) M=Dialogs ACBP=A9 - 0001:00033BA8 0000602A C=CODE S=.text G=(none) M=ExtCtrls ACBP=A9 - 0001:00039BD4 00000090 C=CODE S=.text G=(none) M=ComStrs ACBP=A9 - 0001:00039C64 000007A0 C=CODE S=.text G=(none) M=Clipbrd ACBP=A9 - 0001:0003A404 00000128 C=CODE S=.text G=(none) M=StrUtils ACBP=A9 - 0001:0003A52C 00003821 C=CODE S=.text G=(none) M=Buttons ACBP=A9 - 0001:0003DD50 00000038 C=CODE S=.text G=(none) M=ExtDlgs ACBP=A9 - 0001:0003DD88 00000068 C=CODE S=.text G=(none) M=IniFiles ACBP=A9 - 0001:0003DDF0 00000068 C=CODE S=.text G=(none) M=Registry ACBP=A9 - 0001:0003DE58 0000006C C=CODE S=.text G=(none) M=Mapi ACBP=A9 - 0001:0003DEC4 00000058 C=CODE S=.text G=(none) M=ExtActns ACBP=A9 - 0001:0003DF1C 00000038 C=CODE S=.text G=(none) M=ListActns ACBP=A9 - 0001:0003DF54 00009948 C=CODE S=.text G=(none) M=ComCtrls ACBP=A9 - 0001:0004789C 00000EA0 C=CODE S=.text G=(none) M=Themes ACBP=A9 - 0001:0004873C 0000C698 C=CODE S=.text G=(none) M=StdCtrls ACBP=A9 - 0001:00054DD4 00000168 C=CODE S=.text G=(none) M=StdActns ACBP=A9 - 0001:00054F3C 00000D1F C=CODE S=.text G=(none) M=WinHelpViewer ACBP=A9 - 0001:00055C5C 00011403 C=CODE S=.text G=(none) M=Controls ACBP=A9 - 0001:00067060 00001292 C=CODE S=.text G=(none) M=ActnList ACBP=A9 - 0001:000682F4 00001C04 C=CODE S=.text G=(none) M=ImgList ACBP=A9 - 0001:00069EF8 000066E1 C=CODE S=.text G=(none) M=Menus ACBP=A9 - 0001:000705DC 0000CF8C C=CODE S=.text G=(none) M=Forms ACBP=A9 - 0001:0007D568 00000050 C=CODE S=.text G=(none) M=JConsts ACBP=A9 - 0001:0007D5B8 000133EC C=CODE S=.text G=(none) M=jpeg ACBP=A9 - 0001:000909A4 00000060 C=CODE S=.text G=(none) M=ComConst ACBP=A9 - 0001:00090A04 00001259 C=CODE S=.text G=(none) M=ComObj ACBP=A9 - 0001:00091C60 00000038 C=CODE S=.text G=(none) M=StdVCL ACBP=A9 - 0001:00091C98 00001793 C=CODE S=.text G=(none) M=AxCtrls ACBP=A9 - 0001:0009342C 00000060 C=CODE S=.text G=(none) M=OleConst ACBP=A9 - 0001:0009348C 00003519 C=CODE S=.text G=(none) M=OleCtrls ACBP=A9 - 0001:000969A8 00000314 C=CODE S=.text G=(none) M=TlHelp32 ACBP=A9 - 0001:00096CBC 00000128 C=CODE S=.text G=(none) M=WinSock ACBP=A9 - 0001:00096DE4 00003A78 C=CODE S=.text G=(none) M=ScktComp ACBP=A9 - 0001:0009A85C 000008EA C=CODE S=.text G=(none) M=OleServer ACBP=A9 - 0001:0009B148 000005A0 C=CODE S=.text G=(none) M=MSCommLib_TLB ACBP=A9 - 0001:0009B6E8 00000040 C=CODE S=.text G=(none) M=MMSystem ACBP=A9 - 0001:0009B728 00000038 C=CODE S=.text G=(none) M=Nb30 ACBP=A9 - 0001:0009B760 00000038 C=CODE S=.text G=(none) M=DateUtils ACBP=A9 - 0001:0009B798 00000A18 C=CODE S=.text G=(none) M=MaskUtils ACBP=A9 - 0001:0009C1B0 00002108 C=CODE S=.text G=(none) M=Mask ACBP=A9 - 0001:0009E2B8 000092A4 C=CODE S=.text G=(none) M=Grids ACBP=A9 - 0001:000A755C 00001BFC C=CODE S=.text G=(none) M=Spin ACBP=A9 - 0001:000A9158 00003762 C=CODE S=.text G=(none) M=UnitPilote ACBP=A9 - 0001:000AC8BC 0000057C C=CODE S=.text G=(none) M=Importation ACBP=A9 - 0001:000ACE38 000196A8 C=CODE S=.text G=(none) M=UnitAnalyseSegCDM ACBP=A9 - 0001:000C64E0 00002E3F C=CODE S=.text G=(none) M=UnitConfigTCO ACBP=A9 - 0001:000C9320 00000D84 C=CODE S=.text G=(none) M=Unit_Pilote_aig ACBP=A9 - 0001:000CA0A4 000011F4 C=CODE S=.text G=(none) M=UnitFicheHoraire ACBP=A9 - 0001:000CB298 00000038 C=CODE S=.text G=(none) M=ShellConsts ACBP=A9 - 0001:000CB2D0 000004E0 C=CODE S=.text G=(none) M=ShellCtrls ACBP=A9 - 0001:000CB7B0 00001A0C C=CODE S=.text G=(none) M=UnitRoute ACBP=A9 - 0001:000CD1BC 00002134 C=CODE S=.text G=(none) M=UnitRouteTrains ACBP=A9 - 0001:000CF2F0 00000298 C=CODE S=.text G=(none) M=UnitInfo ACBP=A9 - 0001:000CF588 00002D68 C=CODE S=.text G=(none) M=selection_train ACBP=A9 - 0001:000D22F0 00006230 C=CODE S=.text G=(none) M=UnitConfigCellTCO ACBP=A9 - 0001:000D8520 00001908 C=CODE S=.text G=(none) M=UnitClock ACBP=A9 - 0001:000D9E28 00051884 C=CODE S=.text G=(none) M=UnitTCO ACBP=A9 - 0001:0012B6AC 000039DC C=CODE S=.text G=(none) M=UnitSR ACBP=A9 - 0001:0012F088 00002BF8 C=CODE S=.text G=(none) M=UnitCDF ACBP=A9 - 0001:00131C80 000088F8 C=CODE S=.text G=(none) M=UnitModifAction ACBP=A9 - 0001:0013A578 00000F64 C=CODE S=.text G=(none) M=UnitHorloge ACBP=A9 - 0001:0013B4DC 000025FB C=CODE S=.text G=(none) M=verif_version ACBP=A9 - 0001:0013DAD8 00001190 C=CODE S=.text G=(none) M=UnitPareFeu ACBP=A9 - 0001:0013EC68 00000F6C C=CODE S=.text G=(none) M=UnitSimule ACBP=A9 - 0001:0013FBD4 00057434 C=CODE S=.text G=(none) M=Unitprinc ACBP=A9 - 0001:00197008 0004C358 C=CODE S=.text G=(none) M=UnitConfig ACBP=A9 - 0001:001E3360 00002F78 C=CODE S=.text G=(none) M=UnitDebug ACBP=A9 - 0001:001E62D8 000005C4 C=CODE S=.text G=(none) M=Signaux_complexes_GL ACBP=A9 + 0001:00000000 00005F63 C=CODE S=.text G=(none) M=System ACBP=A9 + 0001:00005F64 00000140 C=CODE S=.text G=(none) M=SysInit ACBP=A9 + 0001:000060A4 00000108 C=CODE S=.text G=(none) M=Types ACBP=A9 + 0001:000061AC 00000F28 C=CODE S=.text G=(none) M=Windows ACBP=A9 + 0001:000070D4 00000038 C=CODE S=.text G=(none) M=Messages ACBP=A9 + 0001:0000710C 00000338 C=CODE S=.text G=(none) M=SysConst ACBP=A9 + 0001:00007444 00006F90 C=CODE S=.text G=(none) M=SysUtils ACBP=A9 + 0001:0000E3D4 00000823 C=CODE S=.text G=(none) M=VarUtils ACBP=A9 + 0001:0000EBF8 0000873A C=CODE S=.text G=(none) M=Variants ACBP=A9 + 0001:00017334 000001A0 C=CODE S=.text G=(none) M=RTLConsts ACBP=A9 + 0001:000174D4 0000083C C=CODE S=.text G=(none) M=TypInfo ACBP=A9 + 0001:00017D10 00000368 C=CODE S=.text G=(none) M=ActiveX ACBP=A9 + 0001:00018078 0000A7FE C=CODE S=.text G=(none) M=Classes ACBP=A9 + 0001:00022878 00000378 C=CODE S=.text G=(none) M=Consts ACBP=A9 + 0001:00022BF0 00009DC7 C=CODE S=.text G=(none) M=Graphics ACBP=A9 + 0001:0002C9B8 00000124 C=CODE S=.text G=(none) M=Math ACBP=A9 + 0001:0002CADC 000002B8 C=CODE S=.text G=(none) M=Contnrs ACBP=A9 + 0001:0002CD94 00000198 C=CODE S=.text G=(none) M=CommCtrl ACBP=A9 + 0001:0002CF2C 00000787 C=CODE S=.text G=(none) M=MultiMon ACBP=A9 + 0001:0002D6B4 00000038 C=CODE S=.text G=(none) M=Imm ACBP=A9 + 0001:0002D6EC 00000FF8 C=CODE S=.text G=(none) M=HelpIntfs ACBP=A9 + 0001:0002E6E4 00000058 C=CODE S=.text G=(none) M=WinSpool ACBP=A9 + 0001:0002E73C 000010C8 C=CODE S=.text G=(none) M=Printers ACBP=A9 + 0001:0002F804 0000031F C=CODE S=.text G=(none) M=FlatSB ACBP=A9 + 0001:0002FB24 000003F0 C=CODE S=.text G=(none) M=SyncObjs ACBP=A9 + 0001:0002FF14 000009BB C=CODE S=.text G=(none) M=UxTheme ACBP=A9 + 0001:000308D0 00000038 C=CODE S=.text G=(none) M=RichEdit ACBP=A9 + 0001:00030908 00000038 C=CODE S=.text G=(none) M=ToolWin ACBP=A9 + 0001:00030940 00000040 C=CODE S=.text G=(none) M=ShellAPI ACBP=A9 + 0001:00030980 00000038 C=CODE S=.text G=(none) M=RegStr ACBP=A9 + 0001:000309B8 00000058 C=CODE S=.text G=(none) M=WinInet ACBP=A9 + 0001:00030A10 00000038 C=CODE S=.text G=(none) M=UrlMon ACBP=A9 + 0001:00030A48 000000EC C=CODE S=.text G=(none) M=ShlObj ACBP=A9 + 0001:00030B34 00000060 C=CODE S=.text G=(none) M=CommDlg ACBP=A9 + 0001:00030B94 00000038 C=CODE S=.text G=(none) M=Dlgs ACBP=A9 + 0001:00030BCC 000036D1 C=CODE S=.text G=(none) M=Dialogs ACBP=A9 + 0001:000342A0 0000602A C=CODE S=.text G=(none) M=ExtCtrls ACBP=A9 + 0001:0003A2CC 00000090 C=CODE S=.text G=(none) M=ComStrs ACBP=A9 + 0001:0003A35C 000007A0 C=CODE S=.text G=(none) M=Clipbrd ACBP=A9 + 0001:0003AAFC 00000128 C=CODE S=.text G=(none) M=StrUtils ACBP=A9 + 0001:0003AC24 00003821 C=CODE S=.text G=(none) M=Buttons ACBP=A9 + 0001:0003E448 00000038 C=CODE S=.text G=(none) M=ExtDlgs ACBP=A9 + 0001:0003E480 00000068 C=CODE S=.text G=(none) M=IniFiles ACBP=A9 + 0001:0003E4E8 00000068 C=CODE S=.text G=(none) M=Registry ACBP=A9 + 0001:0003E550 0000006C C=CODE S=.text G=(none) M=Mapi ACBP=A9 + 0001:0003E5BC 00000058 C=CODE S=.text G=(none) M=ExtActns ACBP=A9 + 0001:0003E614 00000038 C=CODE S=.text G=(none) M=ListActns ACBP=A9 + 0001:0003E64C 00009948 C=CODE S=.text G=(none) M=ComCtrls ACBP=A9 + 0001:00047F94 00000EA0 C=CODE S=.text G=(none) M=Themes ACBP=A9 + 0001:00048E34 0000C698 C=CODE S=.text G=(none) M=StdCtrls ACBP=A9 + 0001:000554CC 00000168 C=CODE S=.text G=(none) M=StdActns ACBP=A9 + 0001:00055634 00000D1F C=CODE S=.text G=(none) M=WinHelpViewer ACBP=A9 + 0001:00056354 00011403 C=CODE S=.text G=(none) M=Controls ACBP=A9 + 0001:00067758 00001292 C=CODE S=.text G=(none) M=ActnList ACBP=A9 + 0001:000689EC 00001C04 C=CODE S=.text G=(none) M=ImgList ACBP=A9 + 0001:0006A5F0 000066E1 C=CODE S=.text G=(none) M=Menus ACBP=A9 + 0001:00070CD4 0000CF8C C=CODE S=.text G=(none) M=Forms ACBP=A9 + 0001:0007DC60 00000050 C=CODE S=.text G=(none) M=JConsts ACBP=A9 + 0001:0007DCB0 000133EC C=CODE S=.text G=(none) M=jpeg ACBP=A9 + 0001:0009109C 00000060 C=CODE S=.text G=(none) M=ComConst ACBP=A9 + 0001:000910FC 00001259 C=CODE S=.text G=(none) M=ComObj ACBP=A9 + 0001:00092358 00000038 C=CODE S=.text G=(none) M=StdVCL ACBP=A9 + 0001:00092390 00001793 C=CODE S=.text G=(none) M=AxCtrls ACBP=A9 + 0001:00093B24 00000060 C=CODE S=.text G=(none) M=OleConst ACBP=A9 + 0001:00093B84 00003519 C=CODE S=.text G=(none) M=OleCtrls ACBP=A9 + 0001:000970A0 00000314 C=CODE S=.text G=(none) M=TlHelp32 ACBP=A9 + 0001:000973B4 00000128 C=CODE S=.text G=(none) M=WinSock ACBP=A9 + 0001:000974DC 00003A78 C=CODE S=.text G=(none) M=ScktComp ACBP=A9 + 0001:0009AF54 000008EA C=CODE S=.text G=(none) M=OleServer ACBP=A9 + 0001:0009B840 000005A0 C=CODE S=.text G=(none) M=MSCommLib_TLB ACBP=A9 + 0001:0009BDE0 00000040 C=CODE S=.text G=(none) M=MMSystem ACBP=A9 + 0001:0009BE20 00000038 C=CODE S=.text G=(none) M=Nb30 ACBP=A9 + 0001:0009BE58 00000038 C=CODE S=.text G=(none) M=DateUtils ACBP=A9 + 0001:0009BE90 00000A18 C=CODE S=.text G=(none) M=MaskUtils ACBP=A9 + 0001:0009C8A8 00002108 C=CODE S=.text G=(none) M=Mask ACBP=A9 + 0001:0009E9B0 000092A4 C=CODE S=.text G=(none) M=Grids ACBP=A9 + 0001:000A7C54 00001BFC C=CODE S=.text G=(none) M=Spin ACBP=A9 + 0001:000A9850 00003762 C=CODE S=.text G=(none) M=UnitPilote ACBP=A9 + 0001:000ACFB4 0000057C C=CODE S=.text G=(none) M=Importation ACBP=A9 + 0001:000AD530 000196A8 C=CODE S=.text G=(none) M=UnitAnalyseSegCDM ACBP=A9 + 0001:000C6BD8 00002E3F C=CODE S=.text G=(none) M=UnitConfigTCO ACBP=A9 + 0001:000C9A18 00000D84 C=CODE S=.text G=(none) M=Unit_Pilote_aig ACBP=A9 + 0001:000CA79C 000011F4 C=CODE S=.text G=(none) M=UnitFicheHoraire ACBP=A9 + 0001:000CB990 00000038 C=CODE S=.text G=(none) M=ShellConsts ACBP=A9 + 0001:000CB9C8 000004E0 C=CODE S=.text G=(none) M=ShellCtrls ACBP=A9 + 0001:000CBEA8 00001A0C C=CODE S=.text G=(none) M=UnitRoute ACBP=A9 + 0001:000CD8B4 00002140 C=CODE S=.text G=(none) M=UnitRouteTrains ACBP=A9 + 0001:000CF9F4 00000298 C=CODE S=.text G=(none) M=UnitInfo ACBP=A9 + 0001:000CFC8C 00002DD4 C=CODE S=.text G=(none) M=selection_train ACBP=A9 + 0001:000D2A60 000062A8 C=CODE S=.text G=(none) M=UnitConfigCellTCO ACBP=A9 + 0001:000D8D08 00001908 C=CODE S=.text G=(none) M=UnitClock ACBP=A9 + 0001:000DA610 0005820C C=CODE S=.text G=(none) M=UnitTCO ACBP=A9 + 0001:0013281C 000039DC C=CODE S=.text G=(none) M=UnitSR ACBP=A9 + 0001:001361F8 00002BF8 C=CODE S=.text G=(none) M=UnitCDF ACBP=A9 + 0001:00138DF0 000088F8 C=CODE S=.text G=(none) M=UnitModifAction ACBP=A9 + 0001:001416E8 00000F64 C=CODE S=.text G=(none) M=UnitHorloge ACBP=A9 + 0001:0014264C 000025FB C=CODE S=.text G=(none) M=verif_version ACBP=A9 + 0001:00144C48 00001190 C=CODE S=.text G=(none) M=UnitPareFeu ACBP=A9 + 0001:00145DD8 00000F6C C=CODE S=.text G=(none) M=UnitSimule ACBP=A9 + 0001:00146D44 00046E24 C=CODE S=.text G=(none) M=Unitprinc ACBP=A9 + 0001:0018DB68 0004C5F4 C=CODE S=.text G=(none) M=UnitConfig ACBP=A9 + 0001:001DA15C 00002F78 C=CODE S=.text G=(none) M=UnitDebug ACBP=A9 + 0001:001DD0D4 000005C4 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 - 0002:00000340 00000008 C=DATA S=.data G=DGROUP M=VarUtils ACBP=A9 - 0002:00000348 000001B2 C=DATA S=.data G=DGROUP M=Variants ACBP=A9 - 0002:000004FC 0000000C C=DATA S=.data G=DGROUP M=TypInfo ACBP=A9 - 0002:00000508 00000010 C=DATA S=.data G=DGROUP M=ActiveX ACBP=A9 - 0002:00000518 00000080 C=DATA S=.data G=DGROUP M=Classes ACBP=A9 - 0002:00000598 0000030C C=DATA S=.data G=DGROUP M=Graphics ACBP=A9 - 0002:000008A4 00000004 C=DATA S=.data G=DGROUP M=Printers ACBP=A9 - 0002:000008A8 00000180 C=DATA S=.data G=DGROUP M=Dialogs ACBP=A9 - 0002:00000A28 0000018C C=DATA S=.data G=DGROUP M=ExtCtrls ACBP=A9 - 0002:00000BB4 0000009E C=DATA S=.data G=DGROUP M=Buttons ACBP=A9 - 0002:00000C54 00000008 C=DATA S=.data G=DGROUP M=IniFiles ACBP=A9 - 0002:00000C5C 00000008 C=DATA S=.data G=DGROUP M=Registry ACBP=A9 - 0002:00000C64 00000008 C=DATA S=.data G=DGROUP M=Mapi ACBP=A9 - 0002:00000C6C 000000B9 C=DATA S=.data G=DGROUP M=ComCtrls ACBP=A9 - 0002:00000D28 00000068 C=DATA S=.data G=DGROUP M=Themes ACBP=A9 - 0002:00000D90 00000154 C=DATA S=.data G=DGROUP M=StdCtrls ACBP=A9 - 0002:00000EE4 0000013C C=DATA S=.data G=DGROUP M=Controls ACBP=A9 - 0002:00001020 00000020 C=DATA S=.data G=DGROUP M=ImgList ACBP=A9 - 0002:00001040 000000EC C=DATA S=.data G=DGROUP M=Menus ACBP=A9 - 0002:0000112C 00000124 C=DATA S=.data G=DGROUP M=Forms ACBP=A9 - 0002:00001250 00000908 C=DATA S=.data G=DGROUP M=jpeg ACBP=A9 - 0002:00001B58 00000030 C=DATA S=.data G=DGROUP M=ComObj ACBP=A9 - 0002:00001B88 0000002C C=DATA S=.data G=DGROUP M=OleCtrls ACBP=A9 - 0002:00001BB4 00000080 C=DATA S=.data G=DGROUP M=MSCommLib_TLB ACBP=A9 - 0002:00001C34 00000009 C=DATA S=.data G=DGROUP M=MaskUtils ACBP=A9 - 0002:00001C40 00000004 C=DATA S=.data G=DGROUP M=Mask ACBP=A9 - 0002:00001C44 00000006 C=DATA S=.data G=DGROUP M=Grids ACBP=A9 - 0002:00001C4C 00000068 C=DATA S=.data G=DGROUP M=ShellCtrls ACBP=A9 - 0002:00001CB4 000000D8 C=DATA S=.data G=DGROUP M=UnitTCO ACBP=A9 - 0002:00001D8C 0000060D C=DATA S=.data G=DGROUP M=Unitprinc ACBP=A9 + 0002:00000340 00000110 C=DATA S=.data G=DGROUP M=VarUtils ACBP=A9 + 0002:00000450 000001B2 C=DATA S=.data G=DGROUP M=Variants ACBP=A9 + 0002:00000604 0000000C C=DATA S=.data G=DGROUP M=TypInfo ACBP=A9 + 0002:00000610 00000010 C=DATA S=.data G=DGROUP M=ActiveX ACBP=A9 + 0002:00000620 00000080 C=DATA S=.data G=DGROUP M=Classes ACBP=A9 + 0002:000006A0 0000030C C=DATA S=.data G=DGROUP M=Graphics ACBP=A9 + 0002:000009AC 00000004 C=DATA S=.data G=DGROUP M=Printers ACBP=A9 + 0002:000009B0 00000180 C=DATA S=.data G=DGROUP M=Dialogs ACBP=A9 + 0002:00000B30 0000018C C=DATA S=.data G=DGROUP M=ExtCtrls ACBP=A9 + 0002:00000CBC 0000009E C=DATA S=.data G=DGROUP M=Buttons ACBP=A9 + 0002:00000D5C 00000008 C=DATA S=.data G=DGROUP M=IniFiles ACBP=A9 + 0002:00000D64 00000008 C=DATA S=.data G=DGROUP M=Registry ACBP=A9 + 0002:00000D6C 00000008 C=DATA S=.data G=DGROUP M=Mapi ACBP=A9 + 0002:00000D74 000000B9 C=DATA S=.data G=DGROUP M=ComCtrls ACBP=A9 + 0002:00000E30 00000068 C=DATA S=.data G=DGROUP M=Themes ACBP=A9 + 0002:00000E98 00000154 C=DATA S=.data G=DGROUP M=StdCtrls ACBP=A9 + 0002:00000FEC 0000013C C=DATA S=.data G=DGROUP M=Controls ACBP=A9 + 0002:00001128 00000020 C=DATA S=.data G=DGROUP M=ImgList ACBP=A9 + 0002:00001148 000000EC C=DATA S=.data G=DGROUP M=Menus ACBP=A9 + 0002:00001234 00000124 C=DATA S=.data G=DGROUP M=Forms ACBP=A9 + 0002:00001358 00000908 C=DATA S=.data G=DGROUP M=jpeg ACBP=A9 + 0002:00001C60 00000030 C=DATA S=.data G=DGROUP M=ComObj ACBP=A9 + 0002:00001C90 0000002C C=DATA S=.data G=DGROUP M=OleCtrls ACBP=A9 + 0002:00001CBC 00000080 C=DATA S=.data G=DGROUP M=MSCommLib_TLB ACBP=A9 + 0002:00001D3C 00000009 C=DATA S=.data G=DGROUP M=MaskUtils ACBP=A9 + 0002:00001D48 00000004 C=DATA S=.data G=DGROUP M=Mask ACBP=A9 + 0002:00001D4C 00000006 C=DATA S=.data G=DGROUP M=Grids ACBP=A9 + 0002:00001D54 00000068 C=DATA S=.data G=DGROUP M=ShellCtrls ACBP=A9 + 0002:00001DBC 000000D8 C=DATA S=.data G=DGROUP M=UnitTCO ACBP=A9 + 0002:00001E94 0000060D C=DATA S=.data G=DGROUP M=Unitprinc ACBP=A9 0002:00003000 00000664 C=BSS S=.bss G=DGROUP M=System ACBP=A9 0002:00003664 00000010 C=BSS S=.bss G=DGROUP M=SysInit ACBP=A9 0002:00003674 00000004 C=BSS S=.bss G=DGROUP M=Types ACBP=A9 @@ -234,17 +234,17 @@ Detailed map of segments 0002:0001D1CC 00000CB0 C=BSS S=.bss G=DGROUP M=selection_train ACBP=A9 0002:0001DE7C 00000020 C=BSS S=.bss G=DGROUP M=UnitConfigCellTCO ACBP=A9 0002:0001DE9C 00000034 C=BSS S=.bss G=DGROUP M=UnitClock ACBP=A9 - 0002:0001DED0 0048FB5C C=BSS S=.bss G=DGROUP M=UnitTCO ACBP=A9 - 0002:004ADA2C 00000010 C=BSS S=.bss G=DGROUP M=UnitSR ACBP=A9 - 0002:004ADA3C 00000014 C=BSS S=.bss G=DGROUP M=UnitCDF ACBP=A9 - 0002:004ADA50 0000001C C=BSS S=.bss G=DGROUP M=UnitModifAction ACBP=A9 - 0002:004ADA6C 00000038 C=BSS S=.bss G=DGROUP M=UnitHorloge ACBP=A9 - 0002:004ADAA4 000001EC C=BSS S=.bss G=DGROUP M=verif_version ACBP=A9 - 0002:004ADC90 00000004 C=BSS S=.bss G=DGROUP M=UnitPareFeu ACBP=A9 - 0002:004ADC94 0000000C C=BSS S=.bss G=DGROUP M=UnitSimule ACBP=A9 - 0002:004ADCA0 064A5CAC C=BSS S=.bss G=DGROUP M=Unitprinc ACBP=A9 - 0002:0695394C 000005C8 C=BSS S=.bss G=DGROUP M=UnitConfig ACBP=A9 - 0002:06953F14 0000002C C=BSS S=.bss G=DGROUP M=UnitDebug ACBP=A9 + 0002:0001DED0 004CD3C0 C=BSS S=.bss G=DGROUP M=UnitTCO ACBP=A9 + 0002:004EB290 00000010 C=BSS S=.bss G=DGROUP M=UnitSR ACBP=A9 + 0002:004EB2A0 00000014 C=BSS S=.bss G=DGROUP M=UnitCDF ACBP=A9 + 0002:004EB2B4 0000001C C=BSS S=.bss G=DGROUP M=UnitModifAction ACBP=A9 + 0002:004EB2D0 00000038 C=BSS S=.bss G=DGROUP M=UnitHorloge ACBP=A9 + 0002:004EB308 000001EC C=BSS S=.bss G=DGROUP M=verif_version ACBP=A9 + 0002:004EB4F4 00000004 C=BSS S=.bss G=DGROUP M=UnitPareFeu ACBP=A9 + 0002:004EB4F8 0000000C C=BSS S=.bss G=DGROUP M=UnitSimule ACBP=A9 + 0002:004EB504 064A703C C=BSS S=.bss G=DGROUP M=Unitprinc ACBP=A9 + 0002:06992540 000005C8 C=BSS S=.bss G=DGROUP M=UnitConfig ACBP=A9 + 0002:06992B08 0000002C C=BSS S=.bss G=DGROUP M=UnitDebug ACBP=A9 Bound resource files @@ -278,4 +278,4 @@ Signaux_complexes_GL.res Signaux_complexes_GL.drf -Program entry point at 0001:001E6640 +Program entry point at 0001:001DD43C diff --git a/UnitConfig.dfm b/UnitConfig.dfm index 2a588f3..b2446c5 100644 --- a/UnitConfig.dfm +++ b/UnitConfig.dfm @@ -682,7 +682,7 @@ object FormConfig: TFormConfig Top = 8 Width = 633 Height = 505 - ActivePage = TabSheetTrains + ActivePage = TabSheetSig Font.Charset = DEFAULT_CHARSET Font.Color = clBlack Font.Height = -11 @@ -2340,7 +2340,7 @@ object FormConfig: TFormConfig Width = 137 Height = 21 Style = csDropDownList - ItemHeight = 0 + ItemHeight = 13 TabOrder = 1 OnChange = ComboBoxDecChange end @@ -2447,7 +2447,7 @@ object FormConfig: TFormConfig Width = 137 Height = 21 Style = csDropDownList - ItemHeight = 0 + ItemHeight = 13 TabOrder = 2 OnChange = ComboBoxAspChange end @@ -2755,7 +2755,7 @@ object FormConfig: TFormConfig Top = 56 Width = 193 Height = 21 - ItemHeight = 0 + ItemHeight = 13 TabOrder = 0 OnChange = ComboBoxDecodeurPersoChange end @@ -2774,7 +2774,7 @@ object FormConfig: TFormConfig Width = 145 Height = 21 Style = csDropDownList - ItemHeight = 0 + ItemHeight = 13 TabOrder = 2 OnChange = ComboBoxNationChange end @@ -2820,7 +2820,7 @@ object FormConfig: TFormConfig Width = 193 Height = 21 Style = csDropDownList - ItemHeight = 0 + ItemHeight = 13 TabOrder = 6 OnChange = ComboBoxDecCdeChange end @@ -3289,7 +3289,7 @@ object FormConfig: TFormConfig Height = 21 Hint = 'Nom de l'#39'accessoire d'#233'fini dans l'#39'onglet "p'#233'riph'#233'riques COM/USB"' Style = csDropDownList - ItemHeight = 0 + ItemHeight = 13 ParentShowHint = False ShowHint = True TabOrder = 10 diff --git a/UnitConfig.pas b/UnitConfig.pas index 3fdaaab..fa37ce1 100644 --- a/UnitConfig.pas +++ b/UnitConfig.pas @@ -723,6 +723,7 @@ function compile_branche(s : string;i : integer) : boolean; function encode_signal(i : integer): string; procedure valide_branches; procedure trier_aig; +procedure trier_cantons; procedure trier_detecteurs; procedure trier_actionneurs; function decodeDCC(s : string) : string; @@ -2281,6 +2282,26 @@ begin closefile(fichierN); end; +// trier les cantons +procedure trier_cantons; +var i,j : integer; + temp : TCanton; + s : string; +begin + for i:=1 to nCantons-1 do + begin + for j:=i+1 to nCantons do + begin + if canton[i].numero>canton[j].numero then + begin + temp:=canton[i]; + canton[i]:=canton[j]; + canton[j]:=temp; + end; + end; + end; +end; + // trier les détecteurs procedure trier_detecteurs; var i,j,temp : integer; @@ -7299,9 +7320,10 @@ begin ImageSignaux.picture.Assign(formpilote.ImageSignaux.Picture); EditComUSB.Hint:='COMX:vitesse,parité,nombre de bits,bits de stop,protocole'+#13+ - 'procotole = 0 : sans protocole, avec temporisation d''envoi (Genli, LZV200)'+#13+ - ' = 1 ou 3 : protocole logiciel XON-XOFF avec temporisation d''envoi'+#13+ + 'procotole = 0 : sans protocole, avec temporisation d''envoi entre trames (Genli, LZV200)'+#13+ + ' = 1 : protocole logiciel XON-XOFF avec temporisation d''envoi'+#13+ ' = 2 : protocole matériel RTS-CTS sans temporisation d''envoi (Interfaces Lenz LI)'+#13+ + ' = 3 : sans protocole, sans temporisation d''envoi entre octets'+#13+ ' = 4 : contrôle de la ligne CTS avant d''émettre un caractère avec temporisation d''envoi'; EditComUSB.showHint:=true; ListBoxAig.Height:=382; @@ -7721,7 +7743,7 @@ begin result:=s+intToSTR(adr); end; -// mise à jour des champs du signal d'après le tableau feux +// mise à jour des champs du signal d'après le tableau signaux Procedure aff_champs_signaux(index : integer); var j,l,d,p,k,nc,decodeur : integer; s : string; @@ -7763,7 +7785,8 @@ begin EditSpecUni.Text:=IntToSTR(Signaux[index].Unisemaf); editSpecUni.Hint:='Paramètre de description de la cible LEB'+#13+'Mettre 100 pour les anciens décodeurs (mode binaire uniquement)'; editSpecUni.ShowHint:=true; - RadioGroupLEB.Visible:=true; + j:=Signaux[index].UniSemaf; + if j=100 then RadioGroupLEB.Visible:=false else RadioGroupLEB.Visible:=true; RadioGroupLEB.ItemIndex:=signaux[index].BinLin; end; 7 : ButtonConfigSR.Visible:=true; @@ -9090,6 +9113,7 @@ begin erreur:=verif_LEB(Adr,i); if erreur=1 then begin LabelInfo.caption:='Erreur code cible LEB';exit;end; if erreur=2 then begin LabelInfo.caption:='Erreur cohérence aspect signal';exit;end; + if i=100 then radioGroupLEB.Visible:=false else radioGroupLEB.Visible:=true; LabelInfo.caption:=' '; Signaux[ligneClicSig+1].Unisemaf:=i; end; diff --git a/UnitConfigCellTCO.dfm b/UnitConfigCellTCO.dfm index c03503b..2a304be 100644 --- a/UnitConfigCellTCO.dfm +++ b/UnitConfigCellTCO.dfm @@ -572,7 +572,7 @@ object FormConfCellTCO: TFormConfCellTCO Caption = 'Num'#233'ro du canton : ' end object LabelInfo: TLabel - Left = 160 + Left = 152 Top = 20 Width = 10 Height = 13 diff --git a/UnitConfigCellTCO.pas b/UnitConfigCellTCO.pas index a87dac8..647691e 100644 --- a/UnitConfigCellTCO.pas +++ b/UnitConfigCellTCO.pas @@ -1258,6 +1258,7 @@ begin sens:=SensHaut; end; TCO[indexTCOCourant,x,y].SensCirc:=Sens; + canton[Idc].SensCirc:=sens; end; procedure TFormConfCellTCO.RadioButtonDBClick(Sender: TObject); @@ -1279,6 +1280,7 @@ begin sens:=SensBas; end; TCO[indexTCOCourant,x,y].SensCirc:=Sens; + canton[Idc].SensCirc:=sens; end; procedure TFormConfCellTCO.RadioButtonDSClick(Sender: TObject); @@ -1294,6 +1296,7 @@ begin else ImageSens.Picture:=ImageHB.Picture; TCO[indexTCOCourant,x,y].SensCirc:=0; + canton[Idc].SensCirc:=0; end; procedure TFormConfCellTCO.CheckBoxEncadreClick(Sender: TObject); diff --git a/UnitDebug.dfm b/UnitDebug.dfm index a18a176..0e908ac 100644 --- a/UnitDebug.dfm +++ b/UnitDebug.dfm @@ -415,7 +415,7 @@ object FormDebug: TFormDebug object Button2: TButton Left = 200 Top = 16 - Width = 57 + Width = 65 Height = 49 Hint = 'Teste si la position des aiguillages en aval du signal doivent i' + @@ -428,7 +428,7 @@ object FormDebug: TFormDebug OnClick = Button2Click end object ButtonAigDevie: TButton - Left = 256 + Left = 264 Top = 16 Width = 57 Height = 49 diff --git a/UnitPrinc.pas b/UnitPrinc.pas index 0bab3aa..fbbd3ae 100644 --- a/UnitPrinc.pas +++ b/UnitPrinc.pas @@ -1,5 +1,5 @@ unit Unitprinc; -// 01/07/2024 14h +// 31/07/2024 21h (******************************************** Programme signaux complexes Graphique Lenz [Delphi 7 ou RadStudio (Delphi 11)] + activeX Tmscomm + clientSocket @@ -11,7 +11,7 @@ unit Unitprinc; Notes pour compilation sous Embarcadero : -------------------------------------------------- Pour compilation avec Rad Studio (Delphi11): Projet / Options // Application / Apparence / - Embarcadero technologies / coher tous les thèmes : carbon Auric etc / et choisir le sytle par défaut : windows sinon plantage + Embarcadero technologies / cocher tous les thèmes : carbon Auric etc / et choisir le sytle par défaut : windows sinon plantage Pour le mode sombre sous Embarcadero, il faut sélectionner: Projet / Options // Application / manifeste / fichier manifeste : personnaliser @@ -33,8 +33,6 @@ unit Unitprinc; + 2 = vert = aiguillage droit = sortie 2 de l'adresse d'accessoire - 1 = rouge = aiguillage dévié = sortie 1 de l'adresse d'accessoire - vitesse port com interface lenz LI-USB-ETH par défaut=57600 - ligne de commande en mode administrateur pour valider le socket du pare feu: netsh advfirewall firewall add rule name="cdm rail" dir=in action=allow program="C:\Program Files (x86)\CDM-Rail\cdr.exe" enable=yes *) @@ -423,6 +421,7 @@ MaxTrainZone=40; // nombre maximal de trains pour le tableau d'historique d Mtd=128; // nombre maxi de détecteurs précédents stockés Max_event_det=4000; // nombre maximal d'évenements détecteurs Max_action=100; // nombre maximal d'actions +Long_tampon_interface=5000; Max_actionneurs=2048; Maxelements=100; // nombre maxi d'éléments scannés/réservés MaxBranches=200; // nombre maxi de branches @@ -549,7 +548,7 @@ IconeDeclSignal=23; type Tinterface = (_interface,periph1,periph2); // interface USB : interface vers centrale, périphérique 1 ou 2 -Taccessoire = (aigP,signal); // aiguillage ou signal +Taccessoire = (aigP,signal); // aiguillage ou signal pour la procédure pilote_acc TEquipement = (rien,aig,tjd,tjs,triple,det,buttoir,voie,crois,act,sig); // voie uniquement pour le tco TBranche = record BType : Tequipement ; // ne prend que les valeurs suivantes: dét aig Buttoir @@ -726,6 +725,14 @@ TElroute=array[1..MaxRoutes] of TUneroute; Tparcours=array[1..MaxParcours] of integer; +TchaineBIN=array[0..Long_tampon_interface] of byte; + +{$IF CompilerVersion >= 28.0} // si delphi>=11 +BinaryString = UnicodeString; +{$ELSE} +BinaryString = String; +{$IFEND} + var maxaiguillage,detecteur_chgt,Temps,Tempo_init,Suivant,ntrains,MaxPortCom, N_Cv,index_simule,NDetecteurs,N_Trains,N_routes,espY,Tps_affiche_retour_dcc, @@ -739,7 +746,7 @@ var TpsTimeoutSL,formatY,OsBits,NbreDecPers,NbDecodeur,NbDecodeurdeBase, LargeurF,HauteurF,OffsetXF,OffsetYF,PosSplitter,NbPeriph,NbPeriph_COMUSB,NbPeriph_Socket, AigMal,AncMinute,axFP,ayFP,NbreOperations,NbreDeclencheurs,index_seqAct,NbreConditions, - SensAig,NbreRoutes,nbreIti,DetAtrouve,DetDepart,iteration,IdActTr, + SensAig,NbreRoutes,nbreIti,DetAtrouve,DetDepart,iteration,IdActTr,Long_recue, prec1,prec2,Eprec,Esuiv : integer; ack,portCommOuvert,traceTrames,AffMem,CDM_connecte,dupliqueEvt,affiche_retour_dcc, @@ -761,11 +768,13 @@ var FormPrinc: TFormPrinc; - Enregistrement,chaine_Envoi,chaine_recue,Id_CDM,Af,version_Interface,entete,suffixe,Lay, + Enregistrement,chaine_Envoi,Id_CDM,Af,version_Interface,entete,suffixe,Lay, CheminProgrammes,cheminWin,fichierAide : string; Ancien_detecteur : array[0..NbMaxDet] of boolean; // anciens état des détecteurs et adresses des détecteurs et leur état + trameIF : array of Byte; + detecteur : array[0..NbMaxDet] of // détecteurs indexés par l'adresse record Etat : boolean; // état 0/1 du détecteur @@ -977,6 +986,7 @@ var Signal_supprime,Signal_sauve : TSignal; Aig_supprime,Aig_sauve : TAiguillage; BrancheN : array[1..MaxBranches,1..MaxElBranches] of TBranche; + chaine_recue : TchaineBIN; {$R *.dfm} @@ -1088,7 +1098,7 @@ function detecteur_suivant(prec : integer;TypeElPrec : TEquipement;actuel : inte procedure prepare_route(depart,arrivee,sens : integer); function route_to_string(tablo : tUneRoute) : string; procedure supprime_route_train(idtrain : integer); -procedure trouve_element_V1(el: integer; TypeEl : TEquipement; Offset,branche_pref : integer); +procedure trouve_element_V1(el: integer; TypeEl : TEquipement; Offset,branche_pref : integer; erreur : boolean); procedure procetape(s : string); implementation @@ -1259,6 +1269,7 @@ begin Affiche_Fenetre_TCO(i,avecTCO); end; renseigne_tous_cantons; // les cantons doivent être renseignés pour les evts détecteurs + renseigne_TJDs; interface_ou_cdm; // démarrer l'interface , génère les evts détecteurs ; ou cdm @@ -1280,7 +1291,7 @@ end; // envoie une chaine s à un périphérique COM/USB en fonction du composant comp // contrôle si le pointeur comp est valide par traitement de l'exception -procedure envoi_usb_comp(comp : Tmscomm;s : string); +procedure envoi_usb_comp(comp : Tmscomm;s : variant); var i : integer; begin if comp=nil then @@ -2948,6 +2959,19 @@ begin checksum:=s+char(check); end; +function tablo_HEX(s: TchaineBIN) : string; +var i : integer; + sa_hex: string; +begin + sa_hex:=''; + for i:=1 to long_recue do + begin + sa_hex:=sa_hex+IntToHex(chaine_recue[i],2)+' '; + end; + tablo_HEX:=sa_hex; +end; + + // renvoie une chaine ASCI Hexa affichable à partir d'une chaîne function chaine_HEX(s: string) : string; var i : integer; @@ -2977,17 +3001,27 @@ begin end; -// envoi d'une chaîne à la centrale par USBLenz ou socket, n'attend pas l'ack +// envoi la chaîne trameIF à la centrale par USBLenz ou socket, n'attend pas l'ack // pour le protole XpressNet (1), on ajoute l'entete et le suffixe dans la trame. // ici on envoie pas à CDM procedure envoi_ss_ack(s : string); -var i,timeout,valto : integer; +var i,timeout,valto,l1,l2,l : integer; begin // XpressNet - if protocole=1 then + if (protocole=1) then begin - s:=entete+s+suffixe; - if traceTrames then AfficheDebug('Tick='+IntToSTR(tick)+'/Env '+chaine_Hex(s),ClLime); + entete:=entete; + l1:=length(entete); + l2:=length(s); + l:=l1+l2; + Setlength(TrameIF,l); + for i:=0 to l1-1 do trameIF[i]:=ord(entete[i+1]); + for i:=0 to l2-1 do + begin + TrameIF[i+l1]:=byte(ord(s[i+1])); + end; + + if traceTrames then AfficheDebug('Tick='+IntToSTR(tick)+'/Env '+chaine_Hex(entete+s),ClLime); end; // DCC++ if (protocole=2) and TraceTrames then AfficheDebug('Tick='+IntToSTR(tick)+'/Env '+s,ClLime); @@ -2997,7 +3031,7 @@ begin begin if (prot_serie=4) then // le protocole 4 contrôle simplement la ligne CTS avant de transmettre et temporise octet par octet begin - i:=1; + i:=0; valto:=10; //Affiche('envoi en tenant compte cts',clyellow); repeat @@ -3006,45 +3040,49 @@ begin //Application.ProcessMessages; inc(timeout); Sleep(20); - until (MSCommUSBInterface.CTSHolding=true) or (timeout>valto); + until (MSCommUSBInterface.CTSHolding=false) or (timeout>valto); if timeout<=valto then begin - //if formprinc.MSCommUSBLenz.CTSHolding then sa:='CTS=1 ' else sa:='CTS=0 '; - envoi_usb_comp(MSCommUSBInterface,s[i]); - if terminal then Affiche(chaine_hex(s[i]),clyellow); + envoi_usb_comp(MSCommUSBInterface,char(TrameIF[i])); + //Affiche(intToSTR(TrameIF[i]),clyellow); inc(i); end; - until (i=length(s)+1) or (timeout>valto); + until (i=l) or (timeout>valto); if timeout>valto then affiche('Erreur attente interface trop longue',clred); end; - // protocole Rts Cts ou sans temporisation + // protocole Rts Cts ou avec temporisation entre trames if (prot_serie=2) or (tempoOctet=0) then begin envoi_usb_comp(MSCommUSBInterface,s); - exit; + Sleep(TempoOctet); end; - // procotole xon xoff ou xon-rts + // procotole xon xoff ou temporisé if (prot_serie=1) or (prot_serie=3) then begin - for i:=1 to length(s) do + for i:=0 to l-1 do begin - envoi_usb_comp(MSCommUSBInterface,s[i]); + envoi_usb_comp(MSCommUSBInterface,char(TrameIF[i])); //Affiche(s[i],clyellow);// else Affiche(chaine_hex(s[i]),clyellow); Sleep(TempoOctet); end; end; + // temporisé entre trames if (prot_serie=0) then begin - envoi_usb_comp(MSCommUSBInterface,s); + envoi_usb_comp(MSCommUSBInterface,TrameIF); Sleep(TempoOctet); end; end; // par socket (ethernet) - if parSocketLenz or (etat_init_interface>=11) then Formprinc.ClientSocketInterface.Socket.SendText(s); + if parSocketLenz or (etat_init_interface>=11) then + begin + Formprinc.ClientSocketInterface.Socket.SendBuf(TrameIF[0],l); + Sleep(TempoOctet); + end; end; // envoi d'une chaîne à l'interface par USB ou socket, puis attend l'ack ou le nack @@ -3997,13 +4035,16 @@ var index,mode,code,aspect,cible,combine,offset,sortie : integer; if (testBit(selection,i)) then begin octet:=1;end else begin octet:=2 ;end; Pilote_acc(adresse+i,octet,signal); - // le décodeur LEB nécessite qu'on envoie 0 après son pilotage ; si on est en mode usb ou ethernet - //sleep(100); - if (portCommOuvert or parSocketLenz) then Pilote_acc0_X(adresse+i,octet); - //sleep(100); + if (Cdm_connecte or portCommOuvert or parSocketLenz) then + begin + Sleep(Tempo_Signal); + Application.ProcessMessages; + // le décodeur LEB nécessite qu'on envoie 0 après son pilotage + Pilote_acc0_X(adresse+i,octet); + Sleep(Tempo_Signal); + Application.ProcessMessages; + end; end; - //Affiche(inttoStr(selection),clOrange); - //Affiche(s,clOrange); end; begin @@ -4021,7 +4062,7 @@ begin // mode binaire ancien if (cible=100) then begin - s:='Signal LEB (binaire) : ad'+IntToSTR(adresse)+'='+chaine_signal(adresse); + s:='Signal LEB (ancien binaire) : ad'+IntToSTR(adresse)+'='+chaine_signal(adresse); if (aspect<>-1) and (combine=-1) then begin if (aspect=carre) then envoi5_LEB(0); @@ -4099,19 +4140,19 @@ begin if mode=1 then begin s:='Signal LEB (linéaire) : ad'+IntToSTR(adresse)+'='+chaine_signal(adresse); - pilote_acc(adresse+offset,sortie,aigP); + pilote_acc(adresse+offset,sortie,signal); + Pilote_acc0_X(adresse+offset,sortie); // remise à 0 obligatoire pour LEB end; - end; end; if AffSig then affiche(s,clOrange); if Affsignal then afficheDebug(s,clOrange); - if AffDetSig then + {if AffDetSig then begin s:='Tick='+IntToSTR(tick)+' Signal '+IntToSTR(adresse)+'='+chaine_signal(adresse); AfficheDebug(s,clyellow); - end; + end; } end; end; @@ -5461,7 +5502,7 @@ function detecteur_suivant(prec : integer;TypeElPrec : TEquipement;actuel : inte var actuelCalc,PrecCalc,j,AdrSuiv,ia : integer; TypeprecCalc,TypeActuelCalc : TEquipement; begin - if NivDebug>=2 then + if (NivDebug>=2) or procPrinc then AfficheDebug('Proc Detecteur_suivant '+IntToSTR(prec)+','+BTypeToChaine(typeElPrec)+'/'+intToSTR(actuel)+','+ BTypeToChaine(TypeElActuel)+ ' Alg='+IntToSTR(algo),clyellow); @@ -5478,7 +5519,7 @@ begin //Affiche(intToSTR(AdrSuiv)+'=alg3('+intToSTR(precCalc)+','+intToSTR(actuelCalc)+')',clWhite); // modif spécial TJD ============== ia:=index_aig(actuelCalc); - if aiguillage[ia].modele=tjd then + if (aiguillage[ia].modele=tjd) and (aiguillage[ia].EtatTJD=4) then PrecCalc:=aiguillage[ia].Ddevie else // ================================ @@ -5970,8 +6011,10 @@ end; // trouve un élément en balayant les branches à partir de la branche offset renvoie branche_trouve IndexBranche_trouve // el : adresse de l'élément TypeEL=(1=détécteur 2=aig 3=aig Bis 4=aig triple - Buttoir) // explore les branches +// si une branche preférée est choisie, elle est non nulle. +// erreur=true affiche le message d'erreur // si pas trouvé, Branche_trouve=0 IndexBranche_trouve=0 -procedure trouve_element_V1(el: integer; TypeEl : TEquipement; Offset,branche_pref : integer); +procedure trouve_element_V1(el: integer; TypeEl : TEquipement; Offset,branche_pref : integer;erreur : boolean); var i,adr,Branche : integer ; s : string; BT : TEquipement; @@ -6002,14 +6045,17 @@ begin branche_trouve:=Branche; IndexBranche_trouve:=i-1; end - else begin s:='Erreur 175 : élément '+intToSTR(el)+' '; - s:=s+BTypeToChaine(TypeEl); - s:=s+' non trouvé';Affiche(s,clred); - branche_trouve:=0; IndexBranche_trouve:=0; - AfficheDebug(s,clred); + else begin + branche_trouve:=0; IndexBranche_trouve:=0; + if erreur then + begin + s:='Erreur 175 : élément '+intToSTR(el)+' '; + s:=s+BTypeToChaine(TypeEl); + s:=s+' non trouvé';Affiche(s,clred); + AfficheDebug(s,clred); + end; end; if debug=3 then formprinc.Caption:=''; - end; // trouve un élément dans les branches depuis les index. @@ -6017,7 +6063,7 @@ end; // el : adresse de l'élément TypeEL=(1=détécteur 2=aig 3=aig Bis 4=aig triple - Buttoir) // avec cet algorithme, un détecteur ne peut se trouver qu'à un seul endroit dans les branches // si branche_Pref<>0 : recherche un aig sur la branche_Pref -procedure trouve_element(el: integer; TypeEl : TEquipement;Branche_pref : integer); overload; +procedure trouve_element(el: integer; TypeEl : TEquipement;Branche_pref : integer;erreur : boolean); overload; var s : string; begin if debug=3 then formprinc.Caption:='Trouve_element '+IntToSTR(el); @@ -6049,7 +6095,7 @@ begin if (TypeEl=triple) or (typeEL=aig) or (typeEL=crois) or (typeEL=tjd) or (typeEL=tjs) then begin - Trouve_element_V1(el,TypeEl,1,branche_pref); + Trouve_element_V1(el,TypeEl,1,branche_pref,erreur); end; if typeEL=buttoir then @@ -6069,35 +6115,42 @@ begin if IndexBranche_trouve=0 then begin - s:='Erreur 176 : élément '+intToSTR(el)+' '; - s:=s+BTypeToChaine(TypeEl); - s:=s+' non trouvé dans les branches';Affiche(s,clred); branche_trouve:=0; IndexBranche_trouve:=0; - AfficheDebug(s,clred); + if erreur then + begin + s:='Erreur 176 : élément '+intToSTR(el)+' '; + s:=s+BTypeToChaine(TypeEl); + s:=s+' non trouvé dans les branches';Affiche(s,clred); + AfficheDebug(s,clred); + end; end; if debug=3 then formprinc.Caption:=''; end; procedure trouve_element(el: integer; TypeEl : TEquipement); overload; begin - trouve_element(el,TypeEl,0); + trouve_element(el,TypeEl,0,true); end; // trouve actionneur_aig -// trouve les actionneurs de l'aiguillage "index" au suivant -// index = index aiguillage - suivant +// trouve les actionneurs de l'aiguillage "index" au suivant (qui peut être un détecteur ou un aig) +// index = index d'aiguillage - suivant +// Index et Suivant doivent être contigus !!!! procedure trouve_actionneurs_aig(index,suivant : integer;tsuiv : tequipement); var i,adrAig,indexBranche_aig,branche_trouve_aig,indexBranche_Suiv,branche_trouve_Suiv : integer; typ : tequipement; + s : string; begin adrAig:=aiguillage[index].Adresse; typ:=aiguillage[index].modele; - if nivDebug=3 then AfficheDebug('trouve_actionneurs_aig '+intToSTR(adrAig)+' '+intToSTR(suivant),clCyan); + if (nivDebug=3) or procPrinc then AfficheDebug('trouve_actionneurs_aig '+intToSTR(adrAig)+' '+intToSTR(suivant),clCyan); if suivant=0 then // possible sur buttoir begin exit; end; + + // si suivant est un détecteur la recherche de l'aig se fera dans la même branche if tSuiv=det then begin @@ -6111,11 +6164,23 @@ begin branche_trouve_Suiv:=branche_trouve; // chercher l'aig dans la même branche - trouve_element(AdrAig,typ,Branche_trouve_Suiv); + trouve_element(AdrAig,typ,Branche_trouve_Suiv,false); // ne pas afficher l'erreur if IndexBranche_trouve=0 then begin - if NivDebug=3 then AfficheDebug('34. Element '+intToSTR(adrAig)+' non trouvé',clred); - exit; + // si pas trouvé, c'est peut être une TJD, elle a été déclarée par sa 2eme adresse dans les branches + if (typ=tjd) and (aiguillage[index].EtatTJD=4) then + begin + AdrAig:=aiguillage[index].DDroit; // homologue + index:=index_aig(adrAig); + trouve_element(AdrAig,typ,Branche_trouve_Suiv,false); // ne pas afficher l'erreur + if IndexBranche_trouve=0 then + begin + //if NivDebug=3 then + AfficheDebug('34. Element '+intToSTR(adrAig)+' non trouvé en branche '+intToSTR(Branche_trouve_Suiv),clred); + exit; + end; + end + else exit; end; indexBranche_aig:=IndexBranche_trouve; branche_trouve_aig:=branche_trouve; @@ -6127,7 +6192,24 @@ begin if tSuiv=aig then begin if nivDebug=3 then AfficheDebug('SuivAig',clred); + // vérifier que si index est une TJD 4 états, et vérifier la contiguité avec suivant + if (aiguillage[index].EtatTJD=4) and (aiguillage[index].modele=tjd) then + begin + if (aiguillage[index].ADroit<>suivant) and (aiguillage[index].ADevie<>suivant) then + begin + index:=index_aig(aiguillage[index].ddroit); // homologue + AdrAig:=aiguillage[index].Adresse; + if (aiguillage[index].ADroit<>suivant) and (aiguillage[index].ADevie<>suivant) then + begin + s:='Erreur 68 - Appel proc trouve_actionneurs_aig a échoué : '+intToSTR(adrAig)+' '+intToSTR(suivant)+' : éléments non contigus'; + Affiche(s,clred); + AfficheDebug(s,Clred); + end; + end; + end; + suivant_alg3(adraig,typ,suivant,tsuiv,1); + if nivDebug=3 then AfficheDebug('FinProc trouve_actionneurs',clCyan); exit; end; @@ -6152,15 +6234,12 @@ begin if idActTr<11 then Actionneur_trouve[idActTr]:=BrancheN[branche_trouve_suiv,i].Adresse; end; end; + if nivDebug=3 then AfficheDebug('FinProc trouve_actionneurs',clCyan); exit; end; //suivant_alg3(adresse,typ,suivant,tsuiv,1); - AfficheDebug('cas non prévu',clred); - exit; - - - + AfficheDebug('cas non prévu - Fin proc trouve_actionneurs',clCyan); end; @@ -6225,7 +6304,7 @@ end; // la variable "actuel" peut etre changée en cas de TJD! function suivant_alg3(prec : integer;typeELprec : TEquipement;actuel : integer;typeElActuel : TEquipement;alg : integer) : integer; var Adr,AdrPrec,indexBranche_prec,branche_trouve_prec,indexBranche_actuel,branche_trouve_actuel, - tjsc1,tjsc2,AdrTjdP,Adr2,N_iteration,index,NetatTJD,index2,k,delta : integer; + tjsc1,tjsc2,AdrTjdP,Adr2,N_iteration,index,NetatTJD,index2,k,delta,posPrec,IndexPrec : integer; tjscourbe1,tjscourbe2,tjdC,tjsC,id : boolean; A,Aprec,tjsc1B,tjsc2B,typeprec: char; TypeGenS,Md,BT,BtypePrec,TypeEL : TEquipement; @@ -6458,7 +6537,7 @@ begin suivant_alg3:=9997; // attention code incorrect devrait être 9994 exit; end; - + // aiguillage index (adr) pris en pointe if (aiguillage[index].Apointe=prec) then begin @@ -6490,6 +6569,7 @@ begin exit; end; + if aiguillage[index].position=const_devie then begin if NivDebug=3 then AfficheDebug('133 - aiguillage '+intToSTR(Adr)+' Pris en pointe dévié',clyellow); @@ -6583,7 +6663,7 @@ begin else begin s:='Impossible de déterminer le passage de l''aiguillage '+intToSTR(adr); - if nivDebug=3 then AfficheDebug(s,clred); + if (nivDebug=3) or ProcPrinc then AfficheDebug(s,clred); Affiche(s,clred); result:=9999; exit; @@ -6691,120 +6771,127 @@ begin //---------------TJD 2 états if (NetatTJD=2) and tjdC then begin - if aiguillage[index].position=const_droit then + if (TypeElPrec=aig) or (TypeElPrec=triple) or (TypeElPrec=Tjd) then begin - // d'où vient t-on de la tjd - if BtypePrec=Aig then + IndexPrec:=index_Aig(prec); + posPrec:=aiguillage[IndexPrec].position; + if posPrec=const_droit then Aprec:=aiguillage[indexPrec].ADroitB; + if posPrec=const_devie then Aprec:=aiguillage[indexPrec].AdevieB; + end; + if TypeElPrec=det then Aprec:='Z'; + // d'ou vient t-on de la TJD + // extrémité 1 530 + if (aiguillage[index].ADroit=prec) and (aiguillage[index].ADroitB=Aprec) then + begin + if aiguillage[index].position=const_droit then begin - if (aiguillage[index].Ddroit=prec) and - ( - ((aiguillage[index].DdroitB='D') and (aiguillage[index_aig(prec)].position=const_droit)) or - ((aiguillage[index].DdroitB='S') and (aiguillage[index_aig(prec)].position=const_devie)) - ) then - begin - Adr:=aiguillage[index].Adroit; - A:=aiguillage[index].AdroitB; - end - else - begin - if (nivdebug>1) or traceliste then - begin - s:='Erreur 120 : TJD 2 états '+intToSTR(Adr)+' non résolue'; - AfficheDebug(s,clred); - suivant_alg3:=9999; - exit; - end; - end; - - if (A='Z') or (a=#0) then typeGenS:=det else typeGenS:=aig; - suivant_alg3:=adr; - if nivDebug=3 then Affichedebug('le port de destination de la tjd 2 états est '+IntToSTR(adr)+a,clyellow); - trouve_actionneurs_aig(index,adr,TypeGenS); - typeGen:=TypeGenS; + adr:=aiguillage[index].Ddroit; + a:=aiguillage[index].DDroitB; + end + else + if aiguillage[index].position=const_devie then + begin + adr:=aiguillage[index].DDevie; + a:=aiguillage[index].DdevieB; + end + else + begin + s:='Erreur 121.1 : position inconnue de la TJD 2 états '+intToSTR(Adr); + AfficheDebug(s,clred); + suivant_alg3:=9996; exit; end; + end + else - if BtypePrec=det then + // extrémité 2 - 21D + if (aiguillage[index].DDroit=prec) and (aiguillage[index].DDroitB=Aprec) then + begin + if aiguillage[index].position=const_droit then begin - if aiguillage[index].Adroit=prec then - begin - Adr:=aiguillage[index].DDroit; - A:=aiguillage[index].DdroitB; - end; - if aiguillage[index].Adevie=prec then - begin - Adr:=aiguillage[index].Ddevie; - A:=aiguillage[index].DdevieB; - end; - if (A='Z') or (a=#0) then typeGenS:=det else typeGenS:=aig; - suivant_alg3:=adr; - if nivDebug=3 then Affichedebug('le port de destination de la tjd 2 états est '+IntToSTR(adr)+a,clyellow); - trouve_actionneurs_aig(index,adr,TypeGenS); - typeGen:=TypeGenS; + adr:=aiguillage[index].Adroit; + a:=aiguillage[index].ADroitB; + end + else + if aiguillage[index].position=const_devie then + begin + adr:=aiguillage[index].ADevie; + a:=aiguillage[index].AdevieB; + end + else + begin + s:='Erreur 121.2 : position inconnue de la TJD 2 états '+intToSTR(Adr); + AfficheDebug(s,clred); + suivant_alg3:=9996; + exit; + end; + end + else + + // extrémité 3 - 529 + if (aiguillage[index].ADevie=prec) and (aiguillage[index].AdevieB=Aprec) then + begin + if aiguillage[index].position=const_droit then + begin + adr:=aiguillage[index].Ddevie; + a:=aiguillage[index].DdevieB; + end + else + if aiguillage[index].position=const_devie then + begin + adr:=aiguillage[index].Ddroit; + a:=aiguillage[index].DdroitB; + end + else + begin + s:='Erreur 121.2 : position inconnue de la TJD 2 états '+intToSTR(Adr); + AfficheDebug(s,clred); + suivant_alg3:=9996; + exit; + end; + end + else + + // extrémité 4 - 21S + if (aiguillage[index].DDevie=prec) and (aiguillage[index].DDevieB=Aprec) then + begin + if aiguillage[index].position=const_droit then + begin + adr:=aiguillage[index].ADevie; + a:=aiguillage[index].ADevieB; + end + else + if aiguillage[index].position=const_devie then + begin + adr:=aiguillage[index].ADroit; + a:=aiguillage[index].AdroitB; + end + else + begin + s:='Erreur 121.4 : position inconnue de la TJD 2 états '+intToSTR(Adr); + AfficheDebug(s,clred); + suivant_alg3:=9996; + exit; + end; + end + else + + begin + if (nivdebug>1) or traceliste then + begin + s:='Erreur 120 : TJD 2 états '+intToSTR(Adr)+' non résolue'; + AfficheDebug(s,clred); + suivant_alg3:=9999; exit; end; end; - if aiguillage[index].position=const_devie then - begin - if (alg and 8)=8 then - begin - typeGen:=rien; - AdrDevie:=Adr; - suivant_alg3:=9997; - exit; - end; - if BtypePrec=Aig then - begin - if (aiguillage[index].Ddroit=prec) and - ( - ((aiguillage[index].DdroitB='D') and (aiguillage[index_aig(prec)].position=const_droit)) or - ((aiguillage[index].DdroitB='S') and (aiguillage[index_aig(prec)].position=const_devie)) - ) - then - begin - Adr:=aiguillage[index].Adevie; - A:=aiguillage[index].AdevieB; - end - else - begin - if (nivdebug>1) or traceliste then - begin - s:='Erreur 121 : TJD 2 états '+intToSTR(Adr)+' non résolue'; - AfficheDebug(s,clred); - suivant_alg3:=9999; - exit; - end; - end; - - if (A='Z') or (a=#0) then typeGenS:=det else typeGens:=aig; - suivant_alg3:=adr; - if nivDebug=3 then Affichedebug('A. le port de destination de la tjd 2 états est '+IntToSTR(adr)+a,clyellow); - trouve_actionneurs_aig(index,adr,TypeGenS); - typeGen:=TypeGenS; - exit; - end; - - if BtypePrec=det then - begin - if aiguillage[index].Adroit=prec then - begin - Adr:=aiguillage[index].Ddevie; - A:=aiguillage[index].DdevieB; - end; - if aiguillage[index].Adevie=prec then - begin - Adr:=aiguillage[index].Ddroit; - A:=aiguillage[index].DdroitB; - end; - if (A='Z') or (a=#0) then typeGenS:=det else typeGenS:=aig; - suivant_alg3:=adr; - if nivDebug=3 then Affichedebug('B. le port de destination de la tjd 2 états est '+IntToSTR(adr)+a,clyellow); - trouve_actionneurs_aig(index,adr,TypeGenS); - typeGen:=TypeGenS; - exit; - end; - end; + if (A='Z') or (a=#0) then typeGenS:=det else typeGenS:=aig; + suivant_alg3:=adr; + if nivDebug=3 then Affichedebug('le port de destination de la tjd 2 états est '+IntToSTR(adr)+a,clyellow); + trouve_actionneurs_aig(index,adr,TypeGenS); + typeGen:=TypeGenS; + exit; end; //--------------- 4 états ou TJS @@ -6867,7 +6954,7 @@ begin suivant_alg3:=adr; Actuel:=aiguillage[index2].Adresse; // substitution de la TJS if nivDebug=3 then Affichedebug('A. le port de destination de la tjd/s est '+IntToSTR(adr)+a,clyellow); - trouve_actionneurs_aig(index,adr2,TypeGenS); + trouve_actionneurs_aig(index,adr,TypeGenS); typeGen:=TypeGenS; exit; end; @@ -7801,7 +7888,7 @@ begin // modif spécial TJD ============== ia:=index_aig(AdrFonc); - if aiguillage[ia].modele=tjd then + if (aiguillage[ia].modele=tjd) and (aiguillage[ia].EtatTJD=4) then AdrPrec:=aiguillage[ia].Ddevie else // ================================ @@ -8613,7 +8700,7 @@ begin // modif spécial TJD ============== ia:=index_aig(adrfonc); - if aiguillage[ia].modele=tjd then + if (aiguillage[ia].modele=tjd) and (aiguillage[ia].EtatTJD=4) then AdrPrec:=aiguillage[ia].Ddevie else // ================================ AdrPrec:=AdrFonc;TypePrec:=TypeFonc; @@ -8661,7 +8748,7 @@ begin // modif spécial TJD ============== ia:=index_aig(ADrFonc); - if aiguillage[ia].modele=tjd then + if (aiguillage[ia].modele=tjd) and (aiguillage[ia].EtatTJD=4) then AdrPrec:=aiguillage[ia].Ddevie else // ================================ @@ -8813,7 +8900,7 @@ begin // modif spécial TJD ============== ia:=index_aig(adrfonc); - if aiguillage[ia].modele=tjd then + if (aiguillage[ia].modele=tjd) and (aiguillage[ia].EtatTJD=4) then AdrPrec:=aiguillage[ia].Ddevie else // ================================ AdrPrec:=AdrFonc;TypePrec:=TypeFonc; @@ -8862,7 +8949,7 @@ begin // modif spécial TJD ============== ia:=index_aig(ADrFonc); - if aiguillage[ia].modele=tjd then + if (aiguillage[ia].modele=tjd) and (aiguillage[ia].EtatTJD=4) then AdrPrec:=aiguillage[ia].Ddevie else // ================================ @@ -8984,7 +9071,7 @@ begin // modif spécial TJD ============== ia:=index_aig(AdrFonc); - if aiguillage[ia].modele=tjd then + if (aiguillage[ia].modele=tjd) and (aiguillage[ia].EtatTJD=4) then AdrPrec:=aiguillage[ia].Ddevie else // ================================ @@ -9239,7 +9326,7 @@ begin begin // modif spécial TJD ============== ia:=index_aig(Actuel); - if aiguillage[ia].modele=tjd then + if (aiguillage[ia].modele=tjd) and (aiguillage[ia].EtatTJD=4) then prec:=aiguillage[ia].Ddevie else // ================================ @@ -9413,7 +9500,7 @@ begin // modif spécial TJD ============== ia:=index_aig(actuel); - if aiguillage[ia].modele=tjd then + if (aiguillage[ia].modele=tjd) and (aiguillage[ia].EtatTJD=4) then prec:=aiguillage[ia].Ddevie else // ================================ @@ -9593,7 +9680,7 @@ begin // modif spécial TJD ============== ia:=index_aig(Actuel); - if aiguillage[ia].modele=tjd then + if (aiguillage[ia].modele=tjd) and (aiguillage[ia].EtatTJD=4) then Prec:=aiguillage[ia].Ddevie else // ================================ @@ -9762,7 +9849,7 @@ begin // modif spécial TJD ============== ia:=index_aig(Actuel); - if aiguillage[ia].modele=tjd then + if (aiguillage[ia].modele=tjd) and (aiguillage[ia].EtatTJD=4) then Prec:=aiguillage[ia].Ddevie else // ================================ @@ -9972,7 +10059,7 @@ begin // modif spécial TJD ============== ia:=index_aig(Actuel); - if aiguillage[ia].modele=tjd then + if (aiguillage[ia].modele=tjd) and (aiguillage[ia].EtatTJD=4) then Prec:=aiguillage[ia].Ddevie else // ================================ @@ -10066,7 +10153,7 @@ begin // modif spécial TJD ============== ia:=index_aig(Actuel); - if aiguillage[ia].modele=tjd then + if (aiguillage[ia].modele=tjd) and (aiguillage[ia].EtatTJD=4) then Prec:=aiguillage[ia].Ddevie else // ================================ @@ -10225,7 +10312,7 @@ begin begin // modif spécial TJD ============== ia:=index_aig(Actuel); - if aiguillage[ia].modele=tjd then + if (aiguillage[ia].modele=tjd) and (aiguillage[ia].EtatTJD=4) then Prec:=aiguillage[ia].Ddevie else // ================================ @@ -10448,7 +10535,7 @@ begin begin // modif spécial TJD ============== ia:=index_aig(Actuel); - if aiguillage[ia].modele=tjd then + if (aiguillage[ia].modele=tjd) and (aiguillage[ia].EtatTJD=4) then Prec:=aiguillage[ia].Ddevie else // ================================ @@ -11046,7 +11133,7 @@ begin // modif spécial TJD ============== ia:=index_aig(suiv); - if aiguillage[ia].modele=tjd then + if (aiguillage[ia].modele=tjd) and (aiguillage[ia].EtatTJD=4) then actuel:=aiguillage[ia].Ddevie else // ================================ @@ -11437,7 +11524,7 @@ begin // modif spécial TJD ============== ia:=index_aig(adrfonc); - if aiguillage[ia].modele=tjd then + if (aiguillage[ia].modele=tjd) and (aiguillage[ia].EtatTJD=4) then adrPrec:=aiguillage[ia].Ddevie else // ================================ @@ -11484,7 +11571,7 @@ begin // modif spécial TJD ============== ia:=index_aig(adrprec); - if aiguillage[ia].modele=tjd then + if (aiguillage[ia].modele=tjd) and (aiguillage[ia].EtatTJD=4) then AdrFonc:=aiguillage[ia].Ddevie else // ================================ @@ -12819,6 +12906,7 @@ procedure demande_etat_det; var i,j,adr,t : integer; s : string; begin +// exit; // if portCommOuvert or parSocketLenz or (etat_init_interface>=11) then begin Affiche('Demande état des détecteurs',ClYellow); @@ -13587,8 +13675,8 @@ end; // traitement des évènements détecteurs procedure Event_Detecteur(Adresse : integer;etat : boolean;train : string); var sens,dr,i,AdrSuiv,AdrSignal,AdrDetSignal,index,Etat01,AdrPrec,d1,d2,suivant,AdrTrain, - e1c,e2c : integer; - typeSuiv,t1,t2 : tequipement; + e1c,e2c,prec : integer; + typeSuiv,t1,t2,typePrec : tequipement; s : string; trouve : boolean; begin @@ -13688,7 +13776,6 @@ begin if trouve then begin dec(i); - sens:=0;suivant:=0; sens:=canton[i].sensLoco; AdrTrain:=canton[i].adresseTrain; @@ -13698,13 +13785,15 @@ begin begin e1c:=canton[i].el2;t1:=canton[i].typ2; e2c:=canton[i].el1;t2:=canton[i].typ1; - suivant:=suivant_alg3(e1c,t1,e2c,t2,1); + suivant:=suivant_alg3(e1c,t1,e2c,t2,1); typeSuiv:=TypeGen; + prec:=suivant_alg3(e2c,t2,adresse,det,1); typePrec:=TypeGen; end; sensDroit,sensBas : begin e1c:=canton[i].el1;t1:=canton[i].typ1; e2c:=canton[i].el2;t2:=canton[i].typ2; - suivant:=suivant_alg3(e1c,t1,e2c,t2,1); + suivant:=suivant_alg3(e1c,t1,e2c,t2,1); typeSuiv:=TypeGen; + prec:=suivant_alg3(e2c,t2,adresse,det,1); typePrec:=TypeGen; end; end; @@ -13713,10 +13802,10 @@ begin if sens<>0 then begin detecteur[adresse].suivant:=suivant; - detecteur[adresse].TypSuivant:=TypeGen; + detecteur[adresse].TypSuivant:=TypeSuiv; // le précédent - detecteur[adresse].precedent:=suivant_alg3(suivant,typeGen,adresse,det,1); - detecteur[adresse].TypPrecedent:=typegen; + detecteur[adresse].precedent:=prec; + detecteur[adresse].TypPrecedent:=typePrec; end; end; @@ -13978,8 +14067,22 @@ begin if bjd then evalue; end; - // Mettre à jour les TCOs - for i:=1 to NbreTCO do Maj_TCO(i,Adresse); + // Mettre à jour les TCOs contenant l'adresse + id:=Index_Aig(adresse); + if id<>0 then + for i:=1 to NbreTCO do + begin + // vérifier si TJD à 2 adresses pour changer sa position dans le TCO + if (aiguillage[id].modele=TJD) or (aiguillage[id].modele=TJS) then + begin + if aiguillage[id].EtatTJD=4 then + begin + adr:=aiguillage[id].Ddevie; // homologue + Maj_TCO(i,adr); + end; + end; + Maj_TCO(i,Adresse); + end; end; // pilote une sortie à 0 à l'interface dont l'adresse est à 1 ou 2 (octet) @@ -13997,13 +14100,19 @@ begin fonction:=((adresse-1) mod 4)*2 + (octet-1); s:=#$52+Char(groupe)+char(fonction or $80); // désactiver la sortie s:=checksum(s); - envoi(s); // envoi de la trame à l'interface et attente Ack + if avecAck then envoi(s) else envoi_ss_ack(s); end; if protocole=2 then begin //la RAZ d'une sortie n'existe pas en DCC+! end; end; + if cdm_connecte then + begin + // remise à 0 + s:=chaine_CDM_Acc(adresse,0); + envoi_CDM(s); + end; end; // envoi d'une chaîne Com_IPC à CDM par socket, puis attend l'ack ou le nack @@ -14078,6 +14187,19 @@ begin envoi_CDM(s); if Acc<>Signal then event_aig(adresse,pilotage); + + // si l'accessoire est un signal et sans raz des signaux, sortir + if (acc=signal) and not(Raz_Acc_signaux) then exit; + if Acc=AigP then + begin + temp:=aiguillage[indexAig].temps;if temp=0 then temp:=4; // mini pour pilotage en signaux LEB + if portCommOuvert or parSocketLenz then tempo(temp); + end; + + // remise à 0 + s:=chaine_CDM_Acc(adresse,0); + envoi_CDM(s); + result:=true; exit; end; @@ -14102,21 +14224,16 @@ begin s:=#$52+Char(groupe)+char(fonction or $88); // activer la sortie s:=checksum(s); if debug_dec_sig and (acc=signal) then AfficheDebug('Tick='+IntToSTR(Tick)+' signal '+intToSTR(adresse)+' '+intToSTR(pilotage),clorange); - //affiche('1.Acc='+intToSTR(adresse)+' '+intToSTR(tick),clwhite); if avecAck then envoi(s) else envoi_ss_ack(s); // envoi de la trame avec/sans attente Ack - //affiche('2.'+intToSTR(tick),clyellow); if acc<>signal then event_aig(adresse,pilotage); - //affiche('3.'+intToSTR(tick),clyellow); // si l'accessoire est un signal et sans raz des signaux, sortir if (acc=signal) and not(Raz_Acc_signaux) then exit; // si aiguillage, faire une temporisation - //if (Index_Signal(adresse)=0) or (Acc=aig) then - //Affiche('*',clyellow); if Acc=AigP then begin - temp:=aiguillage[indexAig].temps;if temp=0 then temp:=4; // mini pour pilotage en signaux LEB + temp:=aiguillage[indexAig].temps;if temp=0 then temp:=4; if portCommOuvert or parSocketLenz then tempo(temp); end; @@ -14167,7 +14284,6 @@ begin pilote_acc_sc(adresse,octet,Acc,9999); end; - // pilotage l'accessoire si l'accesoire est réservé par adrTrain ou non réservé Function pilote_acc(adresse : integer;octet : byte;adrTrain : integer) : boolean; overload; begin @@ -14626,18 +14742,18 @@ begin result:=''; end; -// vérifie le checksum -function check(s : string;n : integer): boolean; +// vérifie le checksum de l'interface +function check(s : TchaineBIN;n : integer): boolean; var x: byte; i,l : integer; begin x:=0; i:=1; - l:=length(s); + l:=Long_recue; if l>0 then begin repeat - x:=x xor ord(s[i]); + x:=x xor (s[i]); inc(i); until (i>l) or (i>n); end; @@ -14646,10 +14762,37 @@ begin end; +procedure Delete_tablo(var cb : TchaineBIN;offset,longueur : integer); +var i,j : integer; +begin + if (Long_recue3 then + if Long_recue>3 then repeat inc(it); //AfficheDebug('It='+IntToSTR(it),clLime); connu:=false; traite:=false; - if length(chaineINT)>4 then + if Long_recue>4 then begin // supprimer l'entete éventuelle FFFE ou FFFD - if (chaineINT[1]=#$ff) and ((chaineINT[2]=#$fe) or (chaineINT[2]=#$fd)) then Delete(chaineINT,1,2); + if (chaineINT[1]=$ff) and ((chaineINT[2]=$fe) or (chaineINT[2]=$fd)) then Delete_tablo(chaineINT,1,2); end; - l:=length(chaineINT); + l:=Long_recue; - if (chaineINT[1]=#$01) then + if (chaineINT[1]=$01) then begin nOctets:=3; connu:=true; @@ -14683,28 +14826,28 @@ begin if check(chaineINT,nOctets) then begin case chaineINT[2] of // page 13 doc XpressNet - #$01 : begin nack:=true;msg:='Erreur timout transmission';end; - #$02 : begin nack:=true;msg:='Erreur timout centrale';end; - #$03 : begin nack:=true;msg:='Erreur communication inconnue';end; - #$04 : begin succes:=true;msg:='Succès';end; - #$05 : begin nack:=true;msg:='Plus de time slot';end; - #$06 : begin nack:=true;msg:='Débordement tampon LI100';end; + $01 : begin nack:=true;msg:='Erreur timeout transmission - Voir doc XpressNet p13';end; + $02 : begin nack:=true;msg:='Erreur timout centrale - Voir doc XpressNet p13';end; + $03 : begin nack:=true;msg:='Erreur communication inconnue - Voir doc XpressNet p13';end; + $04 : begin succes:=true;msg:='Succès';end; + $05 : begin nack:=true;msg:='Plus de time slot - Voir doc XpressNet p13';end; + $06 : begin nack:=true;msg:='Débordement tampon LI100 - Voir doc XpressNet p13';end; end; - if traceTrames and (chaineINT[2]=#4) then AfficheDebug(msg,clYellow); - if traceTrames and (chaineINT[2]<>#4) then AfficheDebug(msg,clRed); - + if traceTrames and (chaineINT[2]=4) then AfficheDebug(msg,clYellow); + if traceTrames and (chaineINT[2]<>4) then AfficheDebug(msg,clRed); + if (chaineINT[2]<>4) then Affiche(msg,clRed); traite:=true; end else begin - if TraceTrames then AfficheDebug('ErrCheck '+chaine_hex(copy(chaineINT,1,nOctets)),clred); + if TraceTrames then AfficheDebug('ErrCheck '+tablo_hex(chaineINT),clred); end; - delete(chaineINT,1,nOctets); + delete_tablo(chaineINT,1,nOctets); end; end else - if (chaineINT[1]=#$02) then + if (chaineINT[1]=$02) then begin connu:=true; nOctets:=4; @@ -14712,16 +14855,16 @@ begin begin if check(chaineINT,nOctets) then begin - msg:='Version matérielle '+intTohex(ord(chaineINT[2]),2)+' - Version soft '+intToHex(ord(chaineINT[3]),2); + msg:='Version matérielle '+intTohex(chaineINT[2],2)+' - Version soft '+intToHex(chaineINT[3],2); Affiche(msg,clYellow); - version_Interface:=chaineInt; + version_Interface:=intToSTR(chaineint[2]); traite:=true; end else begin - if TraceTrames then AfficheDebug('ErrCheck '+chaine_hex(copy(chaineINT,1,nOctets)),clred); + if TraceTrames then AfficheDebug('ErrCheck '+tablo_hex(copy_tablo(chaineINT,1,nOctets)),clred); end; - delete(chaineINT,1,nOctets); + delete_tablo(chaineINT,1,nOctets); end; end else @@ -14730,7 +14873,7 @@ begin if (ord(chaineINT[1]) and $F0)=$40 then begin connu:=true; - n:=ord(chaineINT[1]) and $0F; // nombre d'octets (doit être pair) + n:=(chaineINT[1]) and $0F; // nombre d'octets (doit être pair) nOctets:=n+2; if (l>=nOctets) then begin @@ -14739,60 +14882,68 @@ begin n:= n div 2; for i:=1 to n do begin - decode_retro_XpressNet(ord(chaineInt[i*2]),ord(chaineInt[i*2+1])); + decode_retro_XpressNet((chaineInt[i*2]),(chaineInt[i*2+1])); end; traite:=true; end else begin - s:='ErrCheck '+chaine_hex(copy(chaineINT,1,nOctets)); + s:='ErrCheck '+tablo_hex(copy_tablo(chaineINT,1,nOctets)); if TraceTrames then AfficheDebug(s,clred); end; - delete(chaineINT,1,nOctets); + delete_tablo(chaineINT,1,nOctets); end; end else // recu 61 01 60 - if (chaineINT[1]=#$61) then + if (chaineINT[1]=$61) then begin nOctets:=3; connu:=true; - if l>nOctets then + if l>=nOctets then begin if check(chaineINT,nOctets) then begin case chaineINT[2] of - #$00 : begin ack:=true;msg:='Voie hors tension';end; - #$01 : begin ack:=true;msg:='Reprise';Hors_tension:=false;end; + $00 : begin ack:=true;msg:='Voie hors tension';end; + $01 : begin ack:=true;msg:='Reprise';Hors_tension:=false;end; + $02 : begin ack:=true;msg:='Mode programmation ';end; - #$02 : begin ack:=true;msg:='Mode programmation ';end; + $11 : begin nack:=true;msg:='Voie prog Station prête';end; + $12 : begin ack:=true;msg:='Voie prog court-circuit';Hors_tension:=false;end; + $13 : begin ack:=true;msg:='Voie prog octet non trouvé';end; + $1F : begin nack:=true;msg:='Voie prog Station occupée - Voir doc XpressNet p29';end; - #$11 : begin nack:=true;msg:='Voie prog Station prête';end; - #$12 : begin ack:=true;msg:='Voie prog court-circuit';Hors_tension:=false;end; - #$13 : begin ack:=true;msg:='Voie prog octet non trouvé';end; - #$1F : begin nack:=true;msg:='Voie prog Station occupée - Voir doc XpressNet p29';end; - - #$80 : begin nack:=true;msg:='Erreurs de transferts (Chk erroné) - Voir doc XpressNet p29';end; - #$81 : begin nack:=true;msg:='Station occupée - Voir doc XpressNet p29';end; - #$82 : begin nack:=true;msg:='Commande non implantée';end; + $80 : begin nack:=true;msg:='Erreurs de transferts (Chk erroné) - Voir doc XpressNet p29';end; + $81 : begin nack:=true;msg:='Station occupée - Voir doc XpressNet p29';end; + $82 : begin nack:=true;msg:='Commande non implantée';end; else begin nack:=true;msg:='Réception inconnue';end; end; - if nack then affiche(msg,clred) else affiche(msg,clyellow); + if nack then + begin + afficheDebug(msg,clred); + Affiche(msg,clred); + end + else + begin + afficheDebug(msg,clyellow); + affiche(msg,clyellow); + end; traite:=true; end else begin - if TraceTrames then AfficheDebug('ErrCheck '+chaine_hex(copy(chaineINT,1,nOctets)),clred); + if TraceTrames then AfficheDebug('ErrCheck '+tablo_hex(copy_tablo(chaineINT,1,nOctets)),clred); end; - delete(chaineINT,1,nOctets); + delete_tablo(chaineINT,1,nOctets); end; end else - if (chaineINT[1]=#$63) then // V3.6 uniquement + if (chaineINT[1]=$63) then // V3.6 uniquement begin connu:=true; nOctets:=5; @@ -14800,41 +14951,41 @@ begin begin if check(chaineINT,nOctets) then begin - if chaineINT[2]=#$14 then + if chaineINT[2]=$14 then begin // réception d'un CV. DocXpressNet p26 63 14 01 03 chk - cvLoc:=ord(chaineINT[3]); + cvLoc:=(chaineINT[3]); //Affiche('Réception CV'+IntToSTR(cvLoc)+' à '+IntToSTR(ord(chaineINT[2])),clyellow); if cvLoc>255 then Affiche('Erreur Recu CV>255',clRed) else begin - tablo_cv[cvLoc]:=ord(chaineINT[4]); + tablo_cv[cvLoc]:=(chaineINT[4]); inc(N_Cv); // nombre de CV recus end; recu_cv:=true; traite:=true; end; - if chaineINT[2]=#$10 then + if chaineINT[2]=$10 then begin traite:=true; end; - if chaineINT[2]=#$21 then + if chaineINT[2]=$21 then begin traite:=true; end; end else begin - if TraceTrames then AfficheDebug('ErrCheck '+chaine_hex(copy(chaineINT,1,nOctets)),clred); + if TraceTrames then AfficheDebug('ErrCheck '+tablo_hex(copy_tablo(chaineINT,1,nOctets)),clred); end; - delete(chaineINT,1,nOctets); + delete_tablo(chaineINT,1,nOctets); end; end else // 81 00 mise hors tension - if (chaineINT[1]=#$81) then // arrêt urgence 3 octets + if (chaineINT[1]=$81) then // arrêt urgence 3 octets begin connu:=true; nOctets:=3; @@ -14848,9 +14999,9 @@ begin end else begin - if TraceTrames then AfficheDebug('ErrCheck '+chaine_hex(copy(chaineINT,1,nOctets)),clred); + if TraceTrames then AfficheDebug('ErrCheck '+tablo_hex(copy_tablo(chaineINT,1,nOctets)),clred); end; - delete(chaineINT,1,nOctets); + delete_tablo(chaineINT,1,nOctets); end; end else @@ -14863,7 +15014,7 @@ begin // A3 5 // A4 6 - if (chaineInt[1]=#$E1) then + if (chaineInt[1]=$E1) then begin NOctets:=3; connu:=true; @@ -14875,9 +15026,9 @@ begin end else begin - if TraceTrames then AfficheDebug('ErrCheck '+chaine_hex(copy(chaineINT,1,NOctets)),clred); + if TraceTrames then AfficheDebug('ErrCheck '+tablo_hex(copy_tablo(chaineINT,1,NOctets)),clred); end; - delete(chaineInt,1,NOctets); + delete_tablo(chaineInt,1,NOctets); end; end else @@ -14885,7 +15036,7 @@ begin // E2 4 // E3 - if (chaineInt[1]=#$E3) then + if (chaineInt[1]=$E3) then begin connu:=true; nOctets:=5; @@ -14894,25 +15045,25 @@ begin // la loco ah al est pilotée par le PC if check(chaineINT,nOctets) then begin - if chaineInt[1]=#$40 then + if chaineInt[1]=$40 then begin end; - if chaineInt[2]=#$50 then + if chaineInt[2]=$50 then begin end; traite:=true; end else begin - if TraceTrames then AfficheDebug('ErrCheck '+chaine_hex(copy(chaineINT,1,nOctets)),clred); + if TraceTrames then AfficheDebug('ErrCheck '+tablo_hex(copy_tablo(chaineINT,1,nOctets)),clred); end; - delete(chaineInt,1,nOctets); + delete_tablo(chaineInt,1,nOctets); end; end else // E4 id speed FcA FcB xor loco information - if (chaineInt[1]=#$E4) then + if (chaineInt[1]=$E4) then begin connu:=true; nOctets:=6; @@ -14920,17 +15071,17 @@ begin begin if check(chaineINT,nOctets) then begin - AdrTrainLoc:=ord(chaineInt[2]); // identification - i:=ord(chaineInt[3]); // vitesse - Fa:=ord(chaineInt[4]); // fonction A - Fb:=ord(chaineInt[5]); // fonction B + AdrTrainLoc:=(chaineInt[2]); // identification + i:=(chaineInt[3]); // vitesse + Fa:=(chaineInt[4]); // fonction A + Fb:=(chaineInt[5]); // fonction B traite:=true; end else begin - if TraceTrames then AfficheDebug('ErrCheck '+chaine_hex(copy(chaineINT,1,nOctets)),clred); + if TraceTrames then AfficheDebug('ErrCheck '+tablo_hex(copy_tablo(chaineINT,1,nOctets)),clred); end; - delete(chaineInt,1,nOctets); + delete_tablo(chaineInt,1,nOctets); end; end else @@ -14940,7 +15091,7 @@ begin // spécifique Z21 : E7 0C 89 00 00 00 00 00 62 // on n'en fait rien, c'est un genre d'ack à la réponse de stop loco ? - if (chaineINT[1]=#$E7) then + if (chaineINT[1]=$E7) then begin connu:=true; nOctets:=9; @@ -14952,39 +15103,54 @@ begin end else begin - if TraceTrames then AfficheDebug('ErrCheck '+chaine_hex(copy(chaineINT,1,nOctets)),clred); + if TraceTrames then AfficheDebug('ErrCheck '+tablo_hex(copy_tablo(chaineINT,1,nOctets)),clred); end; - delete(chaineINT,1,nOctets); + delete_tablo(chaineINT,1,nOctets); end; end; // suppression du caractère inconnu car il n'a pas été traité if not(connu) then begin - if traceTrames then AfficheDebug('Suppression '+chaine_Hex(copy(chaineINT,1,1)),clred); - delete(chaineINT,1,1); + if traceTrames then AfficheDebug('Suppression '+intToHex(chaineINT[1],2),clred); + delete_tablo(chaineINT,1,1); traite:=true; end; - until (length(chaineINT)<3) or not(traite) or (it>20); // conditions de sortie du repeat until + until ((Long_recue<3) or not(traite) or (it>20)); // conditions de sortie du repeat until if it>=20 then begin s:='Erreur 623 : itérations trames XpressNet'; Affiche(s,clred); AfficheDebug(s,clred); - chaineINT:=''; + Long_recue:=0; end; decode_chaine_retro_Xpress:=chaineINT; end; +function pos_tablo(b : byte;t : tchaineBIN) : integer; +var i : integer; + trouve : boolean; +begin + i:=0; + repeat + inc(i); + trouve:=t[i]=b; + until trouve or (i>=Long_recue); + if trouve then result:=i else result:=0; +end; + // procédure appellée après réception sur le port USB ou socket // la chaine peut contenir plusieurs informations // on boucle tant qu'on a pas traitée toute la chaine -function interprete_reponse(chaine : string): string; -var chaineInt: string; - i,j : integer; +function interprete_reponse(chaine : tchaineBIN): tchaineBIN; +var chaineInt: TchaineBIN; + s : string; + i,j : integer; + balise : boolean; + c : char; begin chaineINT:=chaine; if protocole=1 then @@ -14994,14 +15160,26 @@ begin if protocole=2 then begin - i:=pos('<',chaineINT); - j:=pos('>',chaineINT); + // transformer chaine en s ascii + s:=''; + for i:=1 to Long_recue do + begin + c:=char(chaine[i]); + if c<>#0 then s:=s+c else Affiche('DCC caractère #0 filtré',clOrange); + end; + i:=pos('<',s); + j:=pos('>',s); while (i<>0) and (j<>0) do begin - chaineINT:=decode_chaine_retro_dcc(chaineINT); - i:=pos('<',chaineINT); - j:=pos('>',chaineINT); + balise:=true; + s:=decode_chaine_retro_dcc(s); + i:=pos('<',s); + j:=pos('>',s); end; + if not(balise) then Affiche(s,clLime); + // retransformer en tchaineBIN + for i:=1 to length(s) do chaineINT[i]:=ord(s[i]); + long_recue:=length(s); end; interprete_reponse:=chaineINT; @@ -15099,6 +15277,8 @@ function test_protocole : boolean; var s: string; temp : integer; begin +// result:=true; +// exit; // begin if protocole=1 then // Xpressnet begin @@ -15132,17 +15312,11 @@ begin exit; end else - + begin if length(version_interface)>0 then begin - if (protocole=1) and (version_interface[1]=#2) then - begin - Affiche_suivi(' et l''interface a répondu correctement en '+intToSTR(temp)+'00 ms',clLime); - result:=true; - exit; - end; - if (protocole=2) and (version_interface<>'') then + if (version_interface<>'') then begin Affiche_suivi(' et l''interface a répondu correctement en '+intToSTR(temp)+'00 ms',clLime); result:=true; @@ -15346,8 +15520,16 @@ begin sc:=copy(portCom,i+1,j-i-1); Settings:=sc; // vitesse,n,8,1 - if prot_serie>=4 then Handshaking:=0 {0=aucun 1=Xon-Xoff 2=cts 3=RTS-Xon-Xoff 4=5=protocoles "maison"} - else Handshaking:=prot_serie; + + case prot_serie of + 0 : Handshaking:=0; // aucun, envoi la trame complète + 1 : Handshaking:=1; // xon-xoff + 2 : Handshaking:=2; // rts-cts + 3 : Handshaking:=0; // aucun, mais envoi octet par octet temporisé + 4 : Handshaking:=0; // controle CTS avant émission :on utilise sans protocole + end; + + {HandShaking: 0=aucun 1=Xon-Xoff 2=cts 3=RTS-Xon-Xoff 4=5=protocoles "maison"} SThreshold:=1; RThreshold:=1; InputLen:=0; @@ -15361,7 +15543,7 @@ begin if protocole=2 then DTREnable:=false // évite de reset de l'arduino à la connexion else DTREnable:=True; if prot_serie=4 then RTSEnable:=True //pour la genli - else RTSenable:=False; + else RTSenable:=false; InputMode:=comInputModeBinary; end; @@ -15665,15 +15847,15 @@ begin deconnecte_USB; Affiche('Lance les fonctions automatiques de CDM',clyellow); SetForegroundWindow(formprinc.Handle); // met SC devant - Sleep(250*TempoTC); + Sleep(300*TempoTC); Application.processMessages; - Sleep(380*tempoTC); // attend le lancement de CDM - if serveurIPCDM_touche then sleep(250*tempoTC); + Sleep(400*tempoTC); // attend le lancement de CDM + if serveurIPCDM_touche then sleep(300*tempoTC); ProcessRunning(s); // récupérer le handle de CDM SetForegroundWindow(CDMhd); // met CDM en premier plan pour le télécommander par le clavier simulé SetActiveWindow(CdmHd); Application.ProcessMessages; - if serveurIPCDM_Touche then sleep(380*tempoTC); + if serveurIPCDM_Touche then sleep(400*tempoTC); // démarre le serveur IP de CDM par simulation de touches if serveurIPCDM_Touche then @@ -15696,16 +15878,16 @@ begin // envoie les touches i:=SendInput(Length(KeyInputs),KeyInputs[0],SizeOf(KeyInputs[0]));SetLength(KeyInputs,0); // la fenetre serveur démarré est affichée - Sleep(200*tempoTC); + Sleep(300*tempoTC); Application.ProcessMessages; end; KeybdInput(VK_RETURN,0); KeybdInput(VK_RETURN,KEYEVENTF_KEYUP); SendInput(Length(KeyInputs),KeyInputs[0],SizeOf(KeyInputs[0]));SetLength(KeyInputs,0); //fermer la fenetre du serveur ip - Sleep(200*tempoTC); + Sleep(300*tempoTC); connecte_CDM; - Sleep(300*tempoTC); + Sleep(400*tempoTC); Application.processMessages; // Serveur d'interface -------------------------------------- @@ -15724,7 +15906,7 @@ begin KeybdInput(VK_RETURN,0); KeybdInput(VK_RETURN,KEYEVENTF_KEYUP); SendInput(Length(KeyInputs), KeyInputs[0], SizeOf(KeyInputs[0]));SetLength(KeyInputs,0); // affiche la fenetre d'interface - Sleep(180*tempoTC); + Sleep(240*tempoTC); // descendre le curseur n fois pour sélectionner le serveur for i:=1 to ServeurInterfaceCDM-1 do @@ -15737,7 +15919,7 @@ begin KeybdInput(VK_TAB,0);KeybdInput(VK_TAB,KEYEVENTF_KEYUP); KeybdInput(VK_SPACE,0);KeybdInput(VK_SPACE,KEYEVENTF_KEYUP); SendInput(Length(KeyInputs), KeyInputs[0], SizeOf(KeyInputs[0]));SetLength(KeyInputs,0); - Sleep(180*tempoTC); + Sleep(240*tempoTC); // Interface if (ServeurInterfaceCDM=1) or (ServeurInterfaceCDM=5) then @@ -15762,18 +15944,18 @@ begin // TAB pour sélectionner OK KeybdInput(VK_TAB,0);KeybdInput(VK_TAB,KEYEVENTF_KEYUP); SendInput(Length(KeyInputs),KeyInputs[0],SizeOf(KeyInputs[0]));SetLength(KeyInputs,0); - Sleep(200*tempoTC); + Sleep(240*tempoTC); end; KeybdInput(VK_SPACE,0);KeybdInput(VK_SPACE,KEYEVENTF_KEYUP); // valide la fenetre d'interface SendInput(Length(KeyInputs), KeyInputs[0], SizeOf(KeyInputs[0]));SetLength(KeyInputs,0); - Sleep(400*tempoTC); + Sleep(500*tempoTC); application.ProcessMessages; KeybdInput(VK_RETURN,0);KeybdInput(VK_RETURN, KEYEVENTF_KEYUP); // valide la fenetre finale SendInput(Length(KeyInputs), KeyInputs[0], SizeOf(KeyInputs[0]));SetLength(KeyInputs,0); - Sleep(200*tempoTC); + Sleep(300*tempoTC); application.ProcessMessages; KeybdInput(VK_RETURN,0);KeybdInput(VK_RETURN, KEYEVENTF_KEYUP); // valide la fenetre finale SendInput(Length(KeyInputs), KeyInputs[0], SizeOf(KeyInputs[0]));SetLength(KeyInputs,0); @@ -16559,7 +16741,7 @@ var n,t,i,index,OrgMilieu : integer; Sr : TSearchRec; tmP,tmA : tMenuItem; begin - af:='Client TCP-IP ou USB CDM Rail - Système XpressNet DCC++ Version '+VersionSC+sousVersion; + af:='Client TCP-IP ou USB CDM Rail - Système XpressNet DCC++ Version '+VersionSC+sousVersion+' Gamma 2'; {$IF CompilerVersion >= 28.0} af:=af+' D11'; {$IFEND} @@ -16600,8 +16782,8 @@ begin ConfCellTCO:=false; confasauver:=false; config_modifie:=false; - chaine_recue:=''; Application.onHint:=doHint; + Long_recue:=0; // box2=CV GroupBoxCV.Left:=633; @@ -16738,7 +16920,8 @@ begin AfficheDebug(s,clred); Affiche(s,clred); end; - if MSCommUSBInterface<>nil then MSCommUSBInterface.onComm:=RecuInterface; + if MSCommUSBInterface<>nil then MSCommUSBInterface.onComm:=RecuInterface; // procédure de réception + Setlength(TrameIF,100); // pour deux périphériques COM/USB try MSCommCde1:=TMSComm.Create(formprinc); @@ -16877,7 +17060,6 @@ begin lire_fichier_tco(i); end; - verif_coherence; procetape('La configuration a été lue'); @@ -17081,7 +17263,7 @@ end; // évènement réception d'une trame sur le port COM USB centrale Xpressnet procedure TFormPrinc.RecuInterface(Sender: TObject); -var i,tev : integer; +var i,tev,l : integer; tablo : array of byte; // tableau rx usb begin tev:=MSCommUSBInterface.commEvent; @@ -17114,15 +17296,21 @@ begin if tev=comEvReceive then begin tablo:=MSCommUSBInterface.Input; - for i:=0 to length(tablo)-1 do - begin - chaine_recue:=chaine_recue+char(tablo[i]); - end; + l:=long_recue; // résidu précédent à chainer - longueur du tampon + i:=0; + repeat + // Affiche(intToSTR(tablo[i]),clYellow); + if i+l+1Long_tampon_interface) or (i>=length(tablo)); + + Long_recue:=l+length(tablo); + //chaine_recue[0]:=l+length(tablo); setlength(tablo,0); if traceTrames then begin - if protocole=1 then AfficheDebug('Tick='+IntToSTR(tick)+'/Rec '+chaine_Hex(chaine_recue),Clwhite); - if protocole=2 then AfficheDebug('Tick='+IntToSTR(tick)+'/Rec '+chaine_recue,Clwhite); + if protocole=1 then AfficheDebug('Tick='+IntToSTR(tick)+'/Rec '+tablo_Hex(chaine_recue),Clwhite); + if protocole=2 then AfficheDebug('Tick='+IntToSTR(tick)+'/Rec '+tablo_hex(chaine_recue),Clwhite); end; chaine_recue:=interprete_reponse(chaine_recue); end; @@ -17813,11 +18001,21 @@ end; // lecture depuis socket interface procedure TFormPrinc.ClientSocketInterfaceRead(Sender: TObject; Socket: TCustomWinSocket); -var s : string; -begin - s:=ClientSocketInterface.Socket.ReceiveText; - if traceTrames then afficheDebug(chaine_hex(s),clWhite); - chaine_recue:=chaine_recue+s; +var tampon : TchaineBIN; + i,l,j,lo : integer; +begin + l:=ClientSocketInterface.Socket.ReceiveBuf(tampon[1],100); // réception binaire + + lo:=long_recue; + j:=1; + for i:=lo+1 to lo+1+l do + begin + chaine_recue[i]:=tampon[j]; + inc(j); + end; + long_recue:=l+lo; + + if traceTrames then afficheDebug(tablo_hex(tampon),clWhite); chaine_recue:=interprete_reponse(chaine_recue); end; @@ -21351,7 +21549,7 @@ end; // trouve toutes les routes de prec à actuel et remplit le tableau tabloroute[route,i] (route=index de la route trouvée) -// on teste les aiguillages ou les tjs sur toutes leurs positions +// on teste les aiguillages et les tjd sur toutes leurs positions // procédure récursive // tabloroute[n,0].adresse contient le nombre d'éléments de la route n // prec,typePrec ; actuel,TypActuel : éléments contigus à explorer ; nroute : numéro de la route , id=index dans la route; ir = n° de récursivité : départ,fin : détecteurs de départ et de fin cliqués. @@ -21410,13 +21608,13 @@ const itmax=90; var suivant,indexAig,IndexAigSuiv,it,r,c1,c2,sensEL1,sensEL2,el1,el2,sensCirc1,SensCirc2, -NumCanton1,NumCanton2 : integer; +NumCanton1,NumCanton2,origine,position,idx,indexAig2,AdrEntreTJD,nEtats : integer; typSuiv,tel1,tel2 : tEquipement; ok,AffRouteR,taig,Horz1,Horz2 : boolean; c : char; begin inc(ctot); - //AffRouteR:=true; + AffRouteR:=false; if ctot>200000 then begin @@ -21715,16 +21913,67 @@ begin if (typactuel=tjd) or (typactuel=tjs) then begin inc(id); - // faire droit - actuel:=aiguillage[indexAig].Ddroit; - indexAig:=index_aig(actuel); // homologue + // faire droit TJD + origine:=tabloroute[nroute,id-2].adresse; // d'où on vient + position:=tabloroute[nroute,id-2].pos; // position de l'élément d'ou on vient + indexAig:=index_aig(actuel); // 28: entrée TJD + AdrEntreTJD:=actuel; // mémoriser l'adresse d'entrée de la TJD 4 états - tabloroute[nroute,id-1].pos:=const_droit; + // TJD d'entrée + tabloroute[nroute,id-1].pos:=const_droit; // faire droit + tabloroute[nroute,id-1].typ:=tjd; + tabloroute[nroute,id-1].adresse:=actuel; // 28 + nEtats:=aiguillage[indexAig].EtatTJD; + + if nEtats=4 then + begin + actuel:=aiguillage[indexAig].Ddroit; // homologue :26 + indexAig2:=index_aig(actuel); + + if tabloroute[nroute,id-2].typ=aig then + begin + idx:=index_Aig(origine); + if position=0 then c:='P'; + if aiguillage[idx].InversionCDM=1 then + begin + if position=const_droit then c:='S'; + if position=const_devie then c:='D'; + end + else + begin + if position=const_droit then c:='D'; + if position=const_devie then c:='S'; + end; + end; + + inc(id); + + if (aiguillage[indexAig].ADroit=origine) and (aiguillage[indexAig].ADroitB=c) then + begin + // on vient de la position droite de l'entrée de la TJD, ce qui détermine l'aiguille de sortie + tabloroute[nroute,id-1].pos:=const_droit; + end; + if (aiguillage[indexAig].ADevie=origine) and (aiguillage[indexAig].ADevieB=c) then + begin + // on vient de la position déviée de l'entrée de la TJD, ce qui détermine l'aiguille de sortie + tabloroute[nroute,id-1].pos:=const_devie; + end; + + // sortie de TJD 4 états + actuel:=aiguillage[indexAig2].Adresse; + tabloroute[nroute,id-1].typ:=tjd; + tabloroute[nroute,id-1].adresse:=actuel; + end; + if nEtats=2 then + begin + indexAig2:=IndexAig; + end; + + //--------------faire droit TJD tabloroute[nroute,id-1].talon:=false; - if affRouteR then - Affiche('Faire droit tjd '+intToSTR(actuel),clorange); - suivant:=aiguillage[indexAig].ADroit; - c:=aiguillage[indexAig].AdroitB; + if affRouteR then Affiche('Faire droit tjd '+intToSTR(actuel),clorange); + suivant:=aiguillage[indexAig2].ADroit; // 26 sortie TJD, direction droit + c:=aiguillage[indexAig2].AdroitB; if (c='S') or (c='D') or (c='P') then typSuiv:=aig else TypSuiv:=det; if typSuiv=aig then begin @@ -21734,22 +21983,22 @@ begin if suivant=0 then TypSuiv:=buttoir; r:=explore_El(actuel,typActuel,Suivant,TypSuiv,nroute,id,ir,depart,fin,ctot); if affrouteR then affiche('3.Retour explore_el de la tjd '+intToSTR(actuel)+' pos droit :'+intToSTR(r),clCyan); - if r=9 then + if r=9 then // demande de sortie begin result:=r; exit; end; - if r=10 then + if r=10 then // trouvé le détecteur de fin begin result:=11; end; - // dévié - //if (actuel=77) or (actuel=78) then AffRouteR:=true; + // faire dévié dévié TJD if affRouteR then Affiche('Faire dévié tjd '+intToSTR(actuel),clorange); - suivant:=aiguillage[indexAig].ADevie; - c:=aiguillage[indexAig].AdevieB; + //suivant:=aiguillage[indexAig].ADevie; // 28 entrée TJD + suivant:=aiguillage[indexAig2].ADevie; // 26 sortie TJD + c:=aiguillage[indexAig2].AdevieB; if (c='S') or (c='D') or (c='P') then typSuiv:=aig else TypSuiv:=det; if typSuiv=aig then begin @@ -21757,8 +22006,16 @@ begin TypSuiv:=aiguillage[indexAigSuiv].modele; end; if suivant=0 then TypSuiv:=buttoir; - tabloroute[nroute,id-1].pos:=const_devie; - tabloroute[nroute,id-1].talon:=false; + if nEtats=4 then + begin + tabloroute[nroute,id-2].pos:=const_devie; // 28 entrée de la TJD + tabloroute[nroute,id-2].talon:=false; + end; + if nEtats=2 then + begin + tabloroute[nroute,id-1].pos:=const_devie; + tabloroute[nroute,id-1].talon:=false; + end; r:=explore_El(actuel,typActuel,Suivant,TypSuiv,nroute,id,ir,depart,fin,ctot); if affrouteR then affiche('4.Retour explore_el de la tjd '+intToSTR(actuel)+' pos dévié :'+intToSTR(r),clCyan); @@ -21879,7 +22136,7 @@ begin id:=2; ctot:=0; - r:=explore_el(DetDepart,det,suivant,TypSuivant,nroute,id,0,DetDepart,detAtrouve,ctot); + r:=explore_el(DetDepart,det,suivant,TypSuivant,nroute,id,0,DetDepart,detAtrouve,ctot); // trouve toutes les routes {for j:=1 to NbreRoutes do begin @@ -21981,17 +22238,17 @@ begin end; procedure TFormPrinc.Button3Click(Sender: TObject); +var sb : tchaineBin; begin -{ aiguillage[index_aig(30)].position:=const_devie; - aiguillage[index_aig(29)].position:=const_devie; - aiguillage[index_aig(10)].position:=const_droit; - aiguillage[index_aig(11)].position:=const_droit; - aiguillage[index_aig(18)].position:=const_devie; - aiguillage[index_aig(19)].position:=const_devie; - //debugTCO:=true; - } - Zone_TCO(1,519,517,1,4,1,true); - //formDebug.Show; + traceTrames:=true; + FormDebug.Show; + //MSCommUSBInterface.Output:=#$01+#$80+#$41; + long_recue:=4; + sb[1]:=$42; + sb[2]:=0; + sb[3]:=02; + sb[4]:=$40; + decode_chaine_retro_Xpress(sb); end; diff --git a/UnitRoute.pas b/UnitRoute.pas index 55a3c58..a8d1cf5 100644 --- a/UnitRoute.pas +++ b/UnitRoute.pas @@ -100,7 +100,7 @@ begin end; // Affiche sans effacer l'ancienne, la route du TCO du tableau ParcoursDet[] -// détruit l'index du train dans le canton !!!! zizi +// détruit l'index du train dans le canton !!!! function Affiche_route_TCO : boolean ; var i,n,det1,det2,indexAig : integer; t :tequipement; diff --git a/UnitRouteTrains.pas b/UnitRouteTrains.pas index 13c0386..934c211 100644 --- a/UnitRouteTrains.pas +++ b/UnitRouteTrains.pas @@ -64,7 +64,6 @@ begin AdrTrain:=Trains[indexTrain].adresse; Train:=Trains[indexTrain].nom_train; - detect:=trains[indexTrain].dernierdet; index_signal_det(detect,voie1,indexSig1,voie2,indexSig2); AdrSig1:=0;AdrSig2:=0; @@ -150,7 +149,9 @@ begin trains[indexTrain].roulage:=2; if traceListe then AfficheDebug(s,clyellow); - trains[indextrain].TempoDemarre:=trains[indexTrain].TempsDemarreSig; + i:=trains[indexTrain].TempsDemarreSig; + if i=0 then i:=1; + trains[indextrain].TempoDemarre:=i; end; @@ -406,7 +407,8 @@ begin else s:=s+' non positionné'; end; - if traceListe then Affiche(s,clWhite); + //if traceListe then + Affiche(s,clWhite); if portCommOuvert or parSocketLenz or CDM_connecte then sleep(Tempo_Aig); end; // réservation @@ -432,7 +434,7 @@ begin // si le train est doté d'une route if trains[indexTrainFR].route[0].adresse>0 then begin - aig_canton(indexTrainFR,trains[indexTrainFR].route[1].adresse); + aig_canton(indexTrainFR,trains[indexTrainFR].route[1].adresse); // positionne aiguillage et fait les réservations demarre:=demarre_index_train(indexTrainFR); // met la mémoire de roulage du train à 1 end; close; diff --git a/UnitTCO.pas b/UnitTCO.pas index 6fe8f0e..68b3763 100644 --- a/UnitTCO.pas +++ b/UnitTCO.pas @@ -457,6 +457,17 @@ const SensDroit=2; SensHaut=3; SensBas=4; + // sens dans les TCO + SensTCO_O=5; // gauche + SensTCO_NO=9; // NO + SensTCO_E=6; // droite + SensTCO_N=7; // haut + SensTCO_NE=10; // NE + SensTCO_S=8; // bas + SensTCO_SE=11; // SE + SensTCO_SO=12; // SO + + MaxCellX=150;MaxCellY=70; licone=26; // largeur icone du bas 35 hicone=licone; @@ -525,8 +536,46 @@ type pont : integer; // définition du pont : si le bit n est à 1 : pont (bits symétriques) OU si canton: alignement train (0=centré 1=Gauche/haut 2=droite/bas) buttoir : integer; // définition des buttoirs : si le bit n°n est à 1 : buttoir ; ou encadre cellule sortie : integer; // si action sortie : état + suivHG,suivBD : integer; // suivant haut ou gauche / suivant bas ou droit dans le cas d'une TJD/S + typHG,typBD :tequipement; + // adjacents aux TJD + TjdNO,TjdN,TjdNE,TjdE,TjdSE,TjdS,TjdSO,TjdO : integer; // adresses de la tjd attachée aux éléments ci dessous + suivNO,SuivN,SuivNE,SuivE,SuivSE,SuivS,SuivSO,SuivO : integer; + typeNO,typeN,typeNE,typeE,typeSE,typeS,typeSO,typeO : tequipement; end; + // élément graphique "canton" + Tcanton = record + numero : integer; // numéro du canton + SensLoco : integer; // sens de la loco stockée sur le canton 1=gauche 2=droit 3=haut 4=bas + Ntco : integer; // numéro du tco + Nelements : integer; // nombre de cellules du canton + nom : string; // nom du canton + x,y : integer; // début du canton dans le TCO + // éléments contigus + el1,el2 : integer; // éléments contigus au canton el1=gauche/haut el2=droit/bas + typ1,typ2 : tEquipement; // type des éléments contigus au canton: un des deux doit être un détecteur + det1,det2 : integer; // détecteurs contigus, changement en fonction des aiguillages + SensEl1,SensEl2 : integer;// indique le sens de l'élément par rapport au canton + SensCirc : integer; // sens de la circulation des trains dans canton tous sens=0 Gauche=1 Droit=2 Haut=3 Bas=4 + // + signal : integer; // adresse du signal associé (le canton est avant le signal) + NomTrain : string; // nom du train sur le canton + indexTrain : integer; // index du train sur le canton + adresseTrain : integer; // adresse du train sur le canton + Gd : tRect; // rectangle de sélection (contour du canton) + rO,rE,rS,rN : tRect; // rectangles des 4 poignées + Xicone,yIcone : integer; // début de l'image du train (coord absolues) + Licone,HIcone : integer; // largeur, hauteur icone du train + bouton : integer; // état du bouton de commande du canton: 0=jaune 1=vert 2=bleu 3=drapeau vert 4=drapeau rouge + select : boolean; // si le canton a été sélectionné par clic souris + horizontal : boolean; // si le canton est horizontal ou verticel + maxi,mini : integer; // valeurs mini et maxi des coordonnées à ne pas dépasser lors d'un tirage des poignées + NumcantonOrg,NumCantonDest + : integer; // canton origine et destination d'une route , concerne le canton départ ou arrivée + AdrTrainRoute : integer; // adresse du train qui a une route, concerne le canton départ ou arrivée + end; + // rectangle graphique de sélection Trect_Select= record NumTCO : integer; // affectation du rectangle à ce tco @@ -537,7 +586,7 @@ type var couleurAdresse,cltexte,CoulFonte,clFondCantonV,clFondCantonR : Tcolor; - TamponAffecte,TCO_modifie,clicsouris,prise_N, + TamponAffecte,TCO_modifie,clicsouris,prise_N,affPosFil, clicTCO,piloteAig,BandeauMasque,eval_format,sauve_tco,prise_droit,prise_haut,deja_calcule, prise_bas,prise_gauche,prise_NE,prise_NO,prise_SE,prise_SO,ligneAffiche,colonneAffiche, TCOActive,TCOCree,ancienok,dbleClicTCO,auto_tcurs,EvtClicDet,SelecBouge,NB : boolean; @@ -560,36 +609,7 @@ var // élements dupliqués dans le TCO : //TCO[i,x,y].FeuOriente=Nelements //TCO[i,x,y].PiedFeu=numéro - canton : array[1..MaxCantons] of record - numero : integer; // numéro du canton - SensLoco : integer; // sens de la loco 1=gauche 2=droit 3=haut 4=bas - Ntco : integer; // numéro du tco - Nelements : integer; // nombre de cellules du canton - nom : string; // nom du canton - x,y : integer; // début du canton dans le TCO - // éléments contigus - el1,el2 : integer; // éléments contigus au canton el1=gauche/haut el2=droit/bas - typ1,typ2 : tEquipement; // type des éléments contigus au canton: un des deux doit être un détecteur - det1,det2 : integer; // détecteurs contigus, changement en fonction des aiguillages - SensEl1,SensEl2 : integer;// indique le sens de l'élément par rapport au canton - SensCirc : integer; // sens de la circulation des trains dans canton tous sens=0 SensGauche=1 SensDroit=2 SensHaut=3 SensBas=4 - // - signal : integer; // adresse du signal associé (le canton est avant le signal) - NomTrain : string; // nom du train sur le canton - indexTrain : integer; // index du train sur le canton - adresseTrain : integer; // adresse du train sur le canton - Gd : tRect; // rectangle de sélection (contour du canton) - rO,rE,rS,rN : tRect; // rectagles des 4 poignées - Xicone,yIcone : integer; // début de l'image du train (coord absolues) - Licone,HIcone : integer; // largeur, hauteur icone du train - bouton : integer; // état du bouton de commande du canton: 0=jaune 1=vert 2=bleu 3=drapeau vert 4=drapeau rouge - select : boolean; // si le canton a été sélectionné par clic souris - horizontal : boolean; // si le canton est horizontal ou verticel - maxi,mini : integer; // valeurs mini et maxi des coordonnées à ne pas dépasser lors d'un tirage des poignées - NumcantonOrg,NumCantonDest - : integer; // canton origine et destination d'une route - AdrTrainRoute : integer; // adresse du train qui a une route, sur le canton départ ou arrivée - end; + canton : array[1..MaxCantons] of Tcanton; // structure de tous les tco TCO : array[1..10] of @@ -650,7 +670,8 @@ var procedure calcul_reduction(Var frx,fry : real;DimDestX,DimDestY : integer); procedure calcul_cellules(indextco : integer); procedure sauve_fichiers_tco; -function zone_tco(indexTCO,det1,det2,train,adrTrain,mode: integer;posAig : boolean) : boolean; +function zone_tco(indexTCO,det1,det2,train,adrTrain,mode: integer;posAig : boolean) : boolean; overload; +function zone_tco(indexTCO,adr : integer;typEl : tequipement;Sens,mode: integer;posAig : boolean) : boolean; overload; procedure _entoure_cell_clic(indexTCO: integer); procedure Affiche_TCO(indexTCO : integer) ; procedure affiche_cellule(indexTCO,x,y : integer); @@ -692,6 +713,7 @@ procedure supprime_canton(c : integer); procedure renseigne_tous_cantons; procedure renseigne_canton(i : integer); overload; function index_canton_numero(n : integer) : integer; +procedure renseigne_TJDs; implementation @@ -764,11 +786,8 @@ var s : string; f : tcustomform; i,erreur : integer; begin - // s:=(t as Tcomponent).name; - // Affiche(s,clWhite); f:=getparentForm(t as Tcontrol); s:=(f as Tcomponent).Name; - //Affiche(s,clYellow); i:=0; repeat @@ -1374,7 +1393,6 @@ begin exit; end; - // si hors sélection, on remet le curseur normal screen.cursor:=crDefault; result:=false; @@ -1418,8 +1436,6 @@ end; // remplit la base des cantons avec les éléments adjacents, et des détecteurs adjacents // Cantons uniquement TCO1 // i : indexCanton - - // remplit les champs horizontal, el1,el2,typ1,typ2,sens1,sens2 de canton[] // et les champs canton1 et canton2 du tableau detecteurs[] procedure renseigne_canton(i : integer;Horz :boolean) ; overload; @@ -1495,6 +1511,233 @@ begin end; end; +// renseigne les éléments contigus des tjd des tco +procedure renseigne_TJDs; +var t,x,y,adr1,Bim,Netats,Adr2,index1,index2 : integer; + typEL : tequipement; + deb : boolean; +begin + deb:=false; + for t:=1 to NbreTco do + begin + for y:=1 to NbreCellY[t] do + for x:=1 to NbreCellX[t] do + begin + Bim:=tco[t,x,y].BImage; + adr1:=tco[t,x,y].Adresse; + if adr1<>0 then + begin + index1:=index_aig(adr1); + if index1<>0 then + begin + TypEl:=aiguillage[index1].modele; + NEtats:=aiguillage[index1].EtatTJD; + if Netats=4 then + begin + Adr2:=aiguillage[index1].DDroit; // homologue + Index2:=index_aig(adr2); + end; + if (typEL=Tjd) or (typel=Tjs) then + begin + if deb then Affiche(intToSTR(adr1),clred); + + case Bim of + 21 : begin + zone_tco(t,adr1,typEl,SensTCO_E,13,false); // chercher 1er élément à droite - xcanton Tel1 + tco[t,x,y].SuivE:=xCanton; + tco[t,x,y].TypeE:=tel1; + if deb then Affiche('E='+intToSTR(xcanton),clLime); + + zone_tco(t,adr1,typEl,SensTCO_SO,13,false); // chercher 1er élément SO + tco[t,x,y].SuivSO:=xCanton; + tco[t,x,y].TypeSO:=tel1; + if deb then Affiche('SO='+intToSTR(xcanton),clLime); + + zone_tco(t,adr1,typEl,SensTCO_O,13,false); // élément à gauche + tco[t,x,y].SuivO:=xCanton; + tco[t,x,y].TypeO:=tel1; + if deb then Affiche('O='+intToSTR(xcanton),clLime); + + zone_tco(t,adr1,typEl,SensTCO_NE,13,false); // chercher 1er élément NE + tco[t,x,y].SuivNE:=xCanton; + tco[t,x,y].TypeNE:=tel1; + if deb then Affiche('NE='+intToSTR(xcanton),clLime); + + if (aiguillage[index1].Adroit=tco[t,x,y].SuivE) or (aiguillage[index1].Adroit=tco[t,x,y].SuivNE) then + begin + tco[t,x,y].TjdE:=Adr1; + tco[t,x,y].TjdNE:=Adr1; + if deb then Affiche('La partie droite est attachée à la TJD '+intToSTR(adr1),clCyan); + end; + if (aiguillage[index1].Adroit=tco[t,x,y].SuivO) or (aiguillage[index1].Adroit=tco[t,x,y].SuivSO) then + begin + tco[t,x,y].TjdO:=Adr1; + tco[t,x,y].TjdSO:=Adr1; + if deb then Affiche('La partie gauche est attachée à la TJD '+intToSTR(adr1),clCyan); + end; + if (aiguillage[index2].Adroit=tco[t,x,y].SuivE) or (aiguillage[index2].Adroit=tco[t,x,y].SuivNE) then + begin + tco[t,x,y].TjdE:=Adr2; + tco[t,x,y].TjdNE:=Adr2; + if deb then Affiche('La partie droite est attachée à la TJD '+intToSTR(adr2),clCyan); + end; + if (aiguillage[index2].Adroit=tco[t,x,y].SuivO) or (aiguillage[index2].Adroit=tco[t,x,y].SuivSO) then + begin + tco[t,x,y].TjdO:=Adr2; + tco[t,x,y].TjdSO:=Adr2; + if deb then Affiche('La partie gauche est attachée à la TJD '+intToSTR(adr2),clCyan); + end; + + end; + + 22 : begin + zone_tco(t,adr1,typEl,SensTCO_E,13,false); // chercher 1er élément à droite - xcanton Tel1 + tco[t,x,y].SuivE:=xCanton; + tco[t,x,y].TypeE:=tel1; + if deb then Affiche('E='+intToSTR(xcanton),clLime); + + zone_tco(t,adr1,typEl,SensTCO_SE,13,false); // chercher 1er élément à droite - xcanton Tel1 + tco[t,x,y].SuivSE:=xCanton; + tco[t,x,y].TypeSE:=tel1; + if deb then Affiche('SE='+intToSTR(xcanton),clLime); + + zone_tco(t,adr1,typEl,SensTCO_O,13,false); // élément à gauche + tco[t,x,y].SuivO:=xCanton; + tco[t,x,y].TypeO:=tel1; + if deb then Affiche('O='+intToSTR(xcanton),clLime); + + zone_tco(t,adr1,typEl,SensTCO_NO,13,false); // chercher 1er élément à droite - xcanton Tel1 + tco[t,x,y].SuivNO:=xCanton; + tco[t,x,y].TypeNO:=tel1; + if deb then Affiche('NO='+intToSTR(xcanton),clLime); + + if (aiguillage[index1].Adroit=tco[t,x,y].SuivE) or (aiguillage[index1].Adroit=tco[t,x,y].SuivSE) then + begin + tco[t,x,y].TjdE:=Adr1; + tco[t,x,y].TjdSE:=Adr1; + if deb then Affiche('La partie droite est attachée à la TJD '+intToSTR(adr1),clCyan); + end; + if (aiguillage[index1].Adroit=tco[t,x,y].SuivO) or (aiguillage[index1].Adroit=tco[t,x,y].SuivNO) then + begin + tco[t,x,y].TjdO:=Adr1; + tco[t,x,y].TjdNO:=Adr1; + if deb then Affiche('La partie gauche est attachée à la TJD '+intToSTR(adr1),clCyan); + end; + if (aiguillage[index2].Adroit=tco[t,x,y].SuivE) or (aiguillage[index2].Adroit=tco[t,x,y].SuivSE) then + begin + tco[t,x,y].TjdE:=Adr2; + tco[t,x,y].TjdSE:=Adr2; + if deb then Affiche('La partie droite est attachée à la TJD '+intToSTR(adr2),clCyan); + end; + if (aiguillage[index2].Adroit=tco[t,x,y].SuivO) or (aiguillage[index2].Adroit=tco[t,x,y].SuivNO) then + begin + tco[t,x,y].TjdO:=Adr2; + tco[t,x,y].TjdNO:=Adr2; + if deb then Affiche('La partie gauche est attachée à la TJD '+intToSTR(adr2),clCyan); + end; + end; + 23 : begin + zone_tco(t,adr1,typEl,SensTCO_N,13,false); // haut + tco[t,x,y].SuivN:=xCanton; + tco[t,x,y].TypeN:=tel1; + if deb then Affiche('N='+intToSTR(xcanton),clLime); + + zone_tco(t,adr1,typEl,SensTCO_S,13,false); // élément bas + tco[t,x,y].SuivS:=xCanton; + tco[t,x,y].TypeS:=tel1; + if deb then Affiche('S='+intToSTR(xcanton),clLime); + + zone_tco(t,adr1,typEl,SensTCO_NE,13,false); + tco[t,x,y].SuivNE:=xCanton; + tco[t,x,y].TypeNE:=tel1; + if deb then Affiche('NE='+intToSTR(xcanton),clLime); + + zone_tco(t,adr1,typEl,SensTCO_SO,13,false); + tco[t,x,y].SuivSO:=xCanton; + tco[t,x,y].TypeSO:=tel1; + if deb then Affiche('SO='+intToSTR(xcanton),clLime); + + if (aiguillage[index1].Adroit=tco[t,x,y].SuivN) or (aiguillage[index1].Adroit=tco[t,x,y].SuivNE) then + begin + tco[t,x,y].TjdN:=Adr1; + tco[t,x,y].TjdNE:=Adr1; + if deb then Affiche('La partie haute est attachée à la TJD '+intToSTR(adr1),clCyan); + end; + if (aiguillage[index1].Adroit=tco[t,x,y].SuivS) or (aiguillage[index1].Adroit=tco[t,x,y].SuivSO) then + begin + tco[t,x,y].TjdS:=Adr1; + tco[t,x,y].TjdSO:=Adr1; + if deb then Affiche('La partie basse est attachée à la TJD '+intToSTR(adr1),clCyan); + end; + if (aiguillage[index2].Adroit=tco[t,x,y].SuivN) or (aiguillage[index2].Adroit=tco[t,x,y].SuivNE) then + begin + tco[t,x,y].TjdN:=Adr2; + tco[t,x,y].TjdNE:=Adr2; + if deb then Affiche('La partie haute est attachée à la TJD '+intToSTR(adr2),clCyan); + end; + if (aiguillage[index2].Adroit=tco[t,x,y].SuivS) or (aiguillage[index2].Adroit=tco[t,x,y].SuivSO) then + begin + tco[t,x,y].TjdS:=Adr2; + tco[t,x,y].TjdSO:=Adr2; + if deb then Affiche('La partie basse est attachée à la TJD '+intToSTR(adr2),clCyan); + end; + end; + + 25 : begin + zone_tco(t,adr1,typEl,SensTCO_N,13,false); // haut + tco[t,x,y].SuivN:=xCanton; + tco[t,x,y].TypeN:=tel1; + if deb then Affiche('N='+intToSTR(xcanton),clLime); + + zone_tco(t,adr1,typEl,SensTCO_S,13,false); // élément bas + tco[t,x,y].SuivS:=xCanton; + tco[t,x,y].TypeS:=tel1; + if deb then Affiche('S='+intToSTR(xcanton),clLime); + + zone_tco(t,adr1,typEl,SensTCO_NO,13,false); // chercher 1er élément à droite - xcanton Tel1 + tco[t,x,y].SuivNO:=xCanton; + tco[t,x,y].TypeNO:=tel1; + if deb then Affiche('NO='+intToSTR(xcanton),clLime); + + zone_tco(t,adr1,typEl,SensTCO_SE,13,false); // chercher 1er élément à droite - xcanton Tel1 + tco[t,x,y].SuivSE:=xCanton; + tco[t,x,y].TypeSE:=tel1; + if deb then Affiche('SE='+intToSTR(xcanton),clLime); + + if (aiguillage[index1].Adroit=tco[t,x,y].SuivN) or (aiguillage[index1].Adroit=tco[t,x,y].SuivNO) then + begin + tco[t,x,y].TjdN:=Adr1; + tco[t,x,y].TjdNO:=Adr1; + if deb then Affiche('La partie haute est attachée à la TJD '+intToSTR(adr1),clCyan); + end; + if (aiguillage[index1].Adroit=tco[t,x,y].SuivS) or (aiguillage[index1].Adroit=tco[t,x,y].SuivSE) then + begin + tco[t,x,y].TjdS:=Adr1; + tco[t,x,y].TjdSE:=Adr1; + if deb then Affiche('La partie basse est attachée à la TJD '+intToSTR(adr1),clCyan); + end; + if (aiguillage[index2].Adroit=tco[t,x,y].SuivN) or (aiguillage[index2].Adroit=tco[t,x,y].SuivNO) then + begin + tco[t,x,y].TjdN:=Adr2; + tco[t,x,y].TjdNO:=Adr2; + if deb then Affiche('La partie haute est attachée à la TJD '+intToSTR(adr2),clCyan); + end; + if (aiguillage[index2].Adroit=tco[t,x,y].SuivS) or (aiguillage[index2].Adroit=tco[t,x,y].SuivSE) then + begin + tco[t,x,y].TjdS:=Adr2; + tco[t,x,y].TjdSE:=Adr2; + if deb then Affiche('La partie basse est attachée à la TJD '+intToSTR(adr2),clCyan); + end; + end; + end; + end; + end; + end; + end; + end; +end; + + // créée un nouveau TCO qui n'existait pas procedure Init_TCO(indexTCO : integer); @@ -2089,6 +2332,9 @@ begin inc(y);x:=1; end; closefile(fichier); + trier_cantons; + + e:=sizeof(Tco) div 1024; //Affiche('Dimensions du tco : '+intToSTR(NbreCellX)+'x'+intToSTR(NbreCellY)+' / '+IntToSTR(e)+'Ko',clyellow); if not(trouve_clPiedSignal) then clPiedSignal:=Clvoies; @@ -2217,6 +2463,7 @@ begin end; +// renvoie la position de l'aiguillage en position x,y du tco indextco function positionTCO(indexTCO,x,y : integer) : integer; var position,i : integer; begin @@ -2541,7 +2788,6 @@ begin end else - case repr of 0,1 : yt:=(hauteurCell[indexTCO] div 2)-round(tailleFont*fryGlob[indexTCO]); // au milieu 2 : yt:=1; // haut @@ -2681,24 +2927,44 @@ begin if (position=const_Devie) then begin - // effacement du morceau - pen.color:=fond; - Brush.Color:=fond; - pen.width:=1; - jy1:=yc-(Epaisseur div 2); // pos Y de la bande sup - pen.width:=1; - Polygon([point(x0+1,y0+hauteurCell[indexTCO]-epaisseur),Point(xc-(epaisseur div 2),jy1),Point(xc-epaisseur-epaisseur,jy1),Point(x0+1,y0+hauteurCell[indexTCO]-epaisseur-epaisseur)]); + if not(affPosFil) then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.width:=1; + jy1:=yc-(Epaisseur div 2); // pos Y de la bande sup + pen.width:=1; + Polygon([point(x0+1,y0+hauteurCell[indexTCO]-epaisseur),Point(xc-(epaisseur div 2),jy1),Point(xc-epaisseur-epaisseur,jy1),Point(x0+1,y0+hauteurCell[indexTCO]-epaisseur-epaisseur)]); + end; + if affPosFil then + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(xf,yc);LineTo(xc,yc);LineTo(x0,yf); + end; end; if position=const_droit then begin - // effacement du morceau - pen.color:=fond; - Brush.Color:=fond; - pen.Width:=1; - jy2:=yc+(Epaisseur div 2); // pos Y de la bande inf - r:=rect(x0+1,jy2+1,x0+LargeurCell[indexTCO]-1,jy2+epaisseur); - FillRect(r); + if not(affPosFil) then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.Width:=1; + jy2:=yc+(Epaisseur div 2); // pos Y de la bande inf + r:=rect(x0+1,jy2+1,x0+LargeurCell[indexTCO]-1,jy2+epaisseur); + FillRect(r); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(x0,yc);LineTo(xf,yc); + end; end; end; @@ -2804,26 +3070,44 @@ begin if (position=const_Devie) then begin // effacement du morceau - pen.color:=fond; - Brush.Color:=fond; - pen.width:=1; - pen.width:=1; - Polygon([ - point(x0+3,yf-epaisseur-5), - Point(xc+2*epaisseur,yc-epaisseur), - Point(xc-epaisseur,yc-epaisseur)]); - //Point(x0+1,y0+hauteurCell[indexTCO]-epaisseur-epaisseur)]); + if not(affPosFil) then + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=1; + Polygon([ + point(x0+3,yf-epaisseur-5), + Point(xc+2*epaisseur,yc-epaisseur), + Point(xc-epaisseur,yc-epaisseur)]); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(xf,yc);LineTo(xc+round(4*frxGlob[indexTCO]),yc);LineTo(x0,yf); + end; end; if position=const_droit then begin - // effacement du morceau - pen.color:=fond; - Brush.Color:=fond; - pen.Width:=1; - jy2:=yc+(Epaisseur div 2); // pos Y de la bande inf - r:=rect(x0+1,jy2+1,x0+LargeurCell[indexTCO]-1,jy2+epaisseur); - FillRect(r); + if not(affPosFil) then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.Width:=1; + jy2:=yc+(Epaisseur div 2); // pos Y de la bande inf + r:=rect(x0+1,jy2+1,x0+LargeurCell[indexTCO]-1,jy2+epaisseur); + FillRect(r); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(x0,yc);LineTo(xf,yc); + end; end; end; end; @@ -2926,23 +3210,43 @@ begin end; if (position=const_Devie) then begin - // effacement du morceau - pen.color:=fond; - Brush.Color:=fond; - pen.width:=1; - pen.width:=1; - Polygon([point(xc+epaisseur-4,yc+epaisseur-1),point(xc+2*epaisseur-1,yc-epaisseur),point(xc+3*epaisseur,yc-epaisseur),point(xc+2*epaisseur,yc+epaisseur-1)]); + if not(AffPosFil) then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.width:=1; + pen.width:=1; + Polygon([point(xc+epaisseur-4,yc+epaisseur-1),point(xc+2*epaisseur-1,yc-epaisseur),point(xc+3*epaisseur,yc-epaisseur),point(xc+2*epaisseur,yc+epaisseur-1)]); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(x0,yc);LineTo(xc,yc);LineTo(xf,y0); + end; end; if position=const_droit then begin - // effacement du morceau - pen.color:=fond; - Brush.Color:=fond; - pen.Width:=1; - jy1:=yc-(Epaisseur div 2); // pos Y de la bande sup - r:=rect(x0+1,jy1,x0+LargeurCell[indexTCO]-1,jy1-epaisseur); - FillRect(r); + if not(AffPosFil) then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.Width:=1; + jy1:=yc-(Epaisseur div 2); // pos Y de la bande sup + r:=rect(x0+1,jy1,x0+LargeurCell[indexTCO]-1,jy1-epaisseur); + FillRect(r); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(x0,yc);LineTo(xf,yc); + end; end; end; end; @@ -3045,30 +3349,50 @@ begin if (position=const_Devie) then begin - // effacement du morceau - pen.color:=fond; - Brush.Color:=fond; - pen.width:=1; - pen.width:=1; - x1:=xc-2*epaisseur;y1:=yc+epaisseur-1; - x2:=xc+2*epaisseur-2;y2:=yc-epaisseur; - x3:=x2+epaisseur;y3:=y2; - x4:=x1+epaisseur;y4:=y1; - Polygon([point(x1,y1), - point(x2,y2), - point(x3,y3), - point(x4,y4)]); + if not(affPosFil) then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.width:=1; + pen.width:=1; + x1:=xc-2*epaisseur;y1:=yc+epaisseur-1; + x2:=xc+2*epaisseur-2;y2:=yc-epaisseur; + x3:=x2+epaisseur;y3:=y2; + x4:=x1+epaisseur;y4:=y1; + Polygon([point(x1,y1), + point(x2,y2), + point(x3,y3), + point(x4,y4)]); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(x0,yc);LineTo(xc-round(4*FrxGlob[indexTCO]),yc);LineTo(xf,y0); + end; end; if position=const_droit then begin - // effacement du morceau - pen.color:=fond; - Brush.Color:=fond; - pen.Width:=1; - jy1:=yc-(Epaisseur div 2); // pos Y de la bande sup - r:=rect(x0+1,jy1,x0+LargeurCell[indexTCO]-1,jy1-epaisseur); - FillRect(r); + if not(affPosFil) then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.Width:=1; + jy1:=yc-(Epaisseur div 2); // pos Y de la bande sup + r:=rect(x0+1,jy1,x0+LargeurCell[indexTCO]-1,jy1-epaisseur); + FillRect(r); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(x0,yc);LineTo(xf,yc); + end; end; end; end; @@ -3172,28 +3496,48 @@ begin if (position=const_Devie) then begin - // effacement du morceau - pen.color:=fond; - Brush.Color:=fond; - pen.width:=1; - x1:=xc+round(0.3*epaisseur);y1:=yc-(epaisseur div 2)-1; - x2:=x1+epaisseur;y2:=y1; - x3:=x2+epaisseur;y3:=y2+epaisseur; - x4:=x1+epaisseur;y4:=y3; - Polygon([point(x1,y1),Point(x2,y2),Point(x3,y3),Point(x4,y4)]); + if not(AffPosFil) then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.width:=1; + x1:=xc+round(0.3*epaisseur);y1:=yc-(epaisseur div 2)-1; + x2:=x1+epaisseur;y2:=y1; + x3:=x2+epaisseur;y3:=y2+epaisseur; + x4:=x1+epaisseur;y4:=y3; + Polygon([point(x1,y1),Point(x2,y2),Point(x3,y3),Point(x4,y4)]); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(x0,yc);LineTo(xc,yc);LineTo(xf,yf); + end; end; if position=const_droit then begin - // effacement du morceau - pen.color:=fond; - Brush.Color:=fond; - pen.Width:=1; - // efface le morceau - x1:=xc-epaisseur-1;y1:=yc+(epaisseur div 2)+1; - x2:=x1+25;y2:=y1+5; - r:=rect(x1,y1,x2,y2); - rectangle(r); + if not(AffPosFil) then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.Width:=1; + // efface le morceau + x1:=xc-epaisseur-1;y1:=yc+(epaisseur div 2)+1; + x2:=x1+25;y2:=y1+5; + r:=rect(x1,y1,x2,y2); + rectangle(r); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(x0,yc);LineTo(xf,yc); + end; end; end; end; @@ -3297,28 +3641,48 @@ begin if (position=const_Devie) then begin - // effacement du morceau - pen.color:=fond; - Brush.Color:=fond; - pen.width:=1; - x1:=xc-12;y1:=yc-(epaisseur div 2)-1; - x2:=x1+15;y2:=y1; - x3:=x2+6;y3:=y2+8; - x4:=x1+12;y4:=y3; - Polygon([point(xc-round(2.1*epaisseur),yc-epaisseur-1),point(xc,yc-epaisseur-1),point(xc+3*epaisseur,yc+epaisseur),point(xc+round(2.0*epaisseur),yc+epaisseur)]); + if not(AffPosfil) then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.width:=1; + x1:=xc-12;y1:=yc-(epaisseur div 2)-1; + x2:=x1+15;y2:=y1; + x3:=x2+6;y3:=y2+8; + x4:=x1+12;y4:=y3; + Polygon([point(xc-round(2.1*epaisseur),yc-epaisseur-1),point(xc,yc-epaisseur-1),point(xc+3*epaisseur,yc+epaisseur),point(xc+round(2.0*epaisseur),yc+epaisseur)]); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(x0,yc);LineTo(xc-round(4*frxGlob[indexTCO]),yc);LineTo(xf,yf); + end; end; if position=const_droit then begin - // effacement du morceau - pen.color:=fond; - Brush.Color:=fond; - pen.Width:=1; - // efface le morceau - x1:=xc-3*epaisseur;y1:=yc+(epaisseur div 2)+1; - x2:=xc+2*epaisseur+2;y2:=y1+5; - r:=rect(x1,y1,x2,y2); - rectangle(r); + if not(AffPosfil) then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.Width:=1; + // efface le morceau + x1:=xc-3*epaisseur;y1:=yc+(epaisseur div 2)+1; + x2:=xc+2*epaisseur+2;y2:=y1+5; + r:=rect(x1,y1,x2,y2); + rectangle(r); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(x0,yc);LineTo(xf,yc); + end; end; end; end; @@ -3423,28 +3787,47 @@ begin if (position=const_Devie) then begin - // effacement du morceau - pen.width:=1; - x1:=xc-(epaisseur div 2);y1:=yc+(epaisseur div 2); - x2:=x1-epaisseur;y2:=y1; - x3:=x2-epaisseur;y3:=y2-epaisseur-1; - x4:=x3+epaisseur;y4:=y3; - pen.color:=fond; - Brush.Color:=fond; - Polygon([point(x1,y1),Point(x2,y2),Point(x3,y3),Point(x4,y4)]); + if not(AffPosFil) then + begin + // effacement du morceau + pen.width:=1; + x1:=xc-(epaisseur div 2);y1:=yc+(epaisseur div 2); + x2:=x1-epaisseur;y2:=y1; + x3:=x2-epaisseur;y3:=y2-epaisseur-1; + x4:=x3+epaisseur;y4:=y3; + pen.color:=fond; + Brush.Color:=fond; + Polygon([point(x1,y1),Point(x2,y2),Point(x3,y3),Point(x4,y4)]); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(xf,yc);LineTo(xc,yc);LineTo(x0,y0); + end; end; if position=const_droit then begin - // effacement du morceau - pen.Width:=1; - // efface le morceau - x1:=xc-(epaisseur div 2)-10;y1:=yc-(epaisseur div 2); - x2:=x1+20;y2:=y1-epaisseur; - pen.color:=fond; - Brush.Color:=fond; - r:=rect(x1,y1,x2,y2); - rectangle(r); + if not(AffPosFil) then + begin + // effacement du morceau + pen.Width:=1; + x1:=xc-(epaisseur div 2)-10;y1:=yc-(epaisseur div 2); + x2:=x1+20;y2:=y1-epaisseur; + pen.color:=fond; + Brush.Color:=fond; + r:=rect(x1,y1,x2,y2); + rectangle(r); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(xf,yc);LineTo(x0,yc); + end; end; end; end; @@ -3546,28 +3929,48 @@ begin if (position=const_Devie) then begin - // effacement du morceau - pen.width:=1; - x1:=xc+2*epaisseur;y1:=yc+(epaisseur div 2); - x2:=x1-3*epaisseur;y2:=y1; - x3:=x2;y3:=y2-epaisseur-2; - x4:=x3+epaisseur;y4:=y3; - pen.color:=fond; - Brush.Color:=fond; - Polygon([point(x1,y1),Point(x2,y2),Point(x3,y3)]); + if not(affPosFil) then + begin + // effacement du morceau + pen.width:=1; + x1:=xc+2*epaisseur;y1:=yc+(epaisseur div 2); + x2:=x1-3*epaisseur;y2:=y1; + x3:=x2;y3:=y2-epaisseur-2; + x4:=x3+epaisseur;y4:=y3; + pen.color:=fond; + Brush.Color:=fond; + Polygon([point(x1,y1),Point(x2,y2),Point(x3,y3)]); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(xf,yc);LineTo(xc+round(5*frxGlob[indexTCO]),yc);LineTo(x0,y0); + end; end; if position=const_droit then begin - // effacement du morceau - pen.Width:=1; - // efface le morceau - x1:=xc-(epaisseur div 2)-15;y1:=yc-(epaisseur div 2); - x2:=xf;y2:=y1-epaisseur-2; - pen.color:=fond; - Brush.Color:=fond; - r:=rect(x1,y1,x2,y2-1); - rectangle(r); + if not(AffPosFil) then + begin + // effacement du morceau + pen.Width:=1; + // efface le morceau + x1:=xc-(epaisseur div 2)-15;y1:=yc-(epaisseur div 2); + x2:=xf;y2:=y1-epaisseur-2; + pen.color:=fond; + Brush.Color:=fond; + r:=rect(x1,y1,x2,y2-1); + rectangle(r); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(x0,yc);LineTo(xf,yc); + end; end; end; end; @@ -4135,29 +4538,48 @@ begin if (position=const_Devie) then begin - // effacement du morceau - pen.width:=1; - x1:=xc-epaisseur;y1:=yc+(epaisseur div 2)+1; - x2:=x1+3*epaisseur;y2:=y1; - x3:=x2;y3:=y2+epaisseur; - x4:=x1;y4:=y3; - pen.color:=fond; - Brush.COlor:=fond; - Polygon([point(x1,y1),Point(x2,y2),Point(x3,y3),Point(x4,y4)]); + if not affposfil then + begin + // effacement du morceau + pen.width:=1; + x1:=xc-epaisseur;y1:=yc+(epaisseur div 2)+1; + x2:=x1+3*epaisseur;y2:=y1; + x3:=x2;y3:=y2+epaisseur; + x4:=x1;y4:=y3; + pen.color:=fond; + Brush.COlor:=fond; + Polygon([point(x1,y1),Point(x2,y2),Point(x3,y3),Point(x4,y4)]); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(x0,y0);LineTo(xc,yc);LineTo(xf,yc); + end; end; - if position=const_droit then begin - // effacement du morceau - pen.Width:=1; - x1:=xc+(epaisseur div 2)-2;y1:=yc-(epaisseur div 2)-1; - x2:=x1+epaisseur;y2:=y1; - x3:=x2+epaisseur+2;y3:=y2+epaisseur+2; - x4:=x3-epaisseur;y4:=y3; - pen.color:=fond; - Brush.COlor:=fond; - Polygon([point(x1,y1),Point(x2,y2),Point(x3,y3),Point(x4,y4)]); - end; + if not affposfil then + begin + // effacement du morceau + pen.Width:=1; + x1:=xc+(epaisseur div 2)-2;y1:=yc-(epaisseur div 2)-1; + x2:=x1+epaisseur;y2:=y1; + x3:=x2+epaisseur+2;y3:=y2+epaisseur+2; + x4:=x3-epaisseur;y4:=y3; + pen.color:=fond; + Brush.COlor:=fond; + Polygon([point(x1,y1),Point(x2,y2),Point(x3,y3),Point(x4,y4)]); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(x0,y0);LineTo(xf,yf); + end; + end; end; end; @@ -4255,28 +4677,48 @@ begin if (position=const_Devie) then begin - // effacement du morceau - pen.width:=1; - x1:=xc-2*epaisseur;y1:=yc-(epaisseur); - x2:=xc+2*epaisseur;y2:=yc+2; - x3:=x2;y3:=yc+(epaisseur div 2)+epaisseur; - x4:=x1;y4:=y3; - pen.color:=fond; - Brush.Color:=fond; - Polygon([point(x1,y1),Point(x2,y2),Point(x3,y3),Point(x4,y4)]); + if not affPosFil then + begin + // effacement du morceau + pen.width:=1; + x1:=xc-2*epaisseur;y1:=yc-(epaisseur); + x2:=xc+2*epaisseur;y2:=yc+2; + x3:=x2;y3:=yc+(epaisseur div 2)+epaisseur; + x4:=x1;y4:=y3; + pen.color:=fond; + Brush.Color:=fond; + Polygon([point(x1,y1),Point(x2,y2),Point(x3,y3),Point(x4,y4)]); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(x0,y0);LineTo(xc-round(4*FrxGlob[indexTCO]),yc-round(6*FryGlob[indexTCO]));LineTo(xf,yc); + end; end; if position=const_droit then begin - // effacement du morceau - x1:=xc-epaisseur-1;y1:=yc-(2*epaisseur)-1; - x2:=x1+epaisseur;y2:=y1; - x3:=x2+2*epaisseur+5;y3:=y2+3*epaisseur; - x4:=x3-epaisseur;y4:=y3; - pen.Width:=1; - pen.color:=fond; - Brush.Color:=fond; - Polygon([point(x1,y1),Point(x2,y2),Point(x3,y3),Point(x4,y4)]); + if not affposfil then + begin + // effacement du morceau + x1:=xc-epaisseur-1;y1:=yc-(2*epaisseur)-1; + x2:=x1+epaisseur;y2:=y1; + x3:=x2+2*epaisseur+5;y3:=y2+3*epaisseur; + x4:=x3-epaisseur;y4:=y3; + pen.Width:=1; + pen.color:=fond; + Brush.Color:=fond; + Polygon([point(x1,y1),Point(x2,y2),Point(x3,y3),Point(x4,y4)]); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(x0,y0);LineTo(xf,yf); + end; end; end; end; @@ -4386,27 +4828,46 @@ begin if (position=const_Devie) then begin - // effacement du morceau - pen.color:=fond; - Brush.Color:=fond; - pen.width:=1; - x1:=xc-2*epaisseur-5;y1:=yc+(epaisseur div 2)+1; - x2:=xc+epaisseur+10;y2:=y1+epaisseur; - r:=rect(x1,y1,x2,y2); - rectangle(r); + if not affposFil then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.width:=1; + x1:=xc-2*epaisseur-5;y1:=yc+(epaisseur div 2)+1; + x2:=xc+epaisseur+10;y2:=y1+epaisseur; + r:=rect(x1,y1,x2,y2); + rectangle(r); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(xf,y0);LineTo(xc,yc);LineTo(x0,yc); + end; end; - if position=const_droit then begin - // effacement du morceau - pen.color:=fond; - Brush.Color:=fond; - pen.width:=1; - x1:=xc-round(0.4*epaisseur);y1:=yc-(epaisseur div 2); - x2:=x1-epaisseur; - x3:=x2-epaisseur;y3:=yc+(epaisseur div 2)+1; - x4:=x1-epaisseur-1; - polygon([point(x1,y1),point(x2,y1),point(x3,y3),point(x4,y3)]); + if not affPosFil then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.width:=1; + x1:=xc-round(0.4*epaisseur);y1:=yc-(epaisseur div 2); + x2:=x1-epaisseur; + x3:=x2-epaisseur;y3:=yc+(epaisseur div 2)+1; + x4:=x1-epaisseur-1; + polygon([point(x1,y1),point(x2,y1),point(x3,y3),point(x4,y3)]); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(xf,y0);LineTo(x0,yf); + end; end; end; end; @@ -4509,28 +4970,48 @@ begin if (position=const_Devie) then begin - // effacement du morceau - pen.color:=fond; - Brush.Color:=fond; - pen.width:=1; - x1:=xc+(epaisseur)+3;y1:=yc-(epaisseur); - x2:=xc+2*epaisseur+3;y2:=y1; - x3:=xc;y3:=yc+epaisseur; - x4:=xc-(3*epaisseur);y4:=y3; - polygon([point(x1,y1),point(x2,y2),point(x3,y3),point(x4,y4)]); + if not affPosFil then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.width:=1; + x1:=xc+(epaisseur)+3;y1:=yc-(epaisseur); + x2:=xc+2*epaisseur+3;y2:=y1; + x3:=xc;y3:=yc+epaisseur; + x4:=xc-(3*epaisseur);y4:=y3; + polygon([point(x1,y1),point(x2,y2),point(x3,y3),point(x4,y4)]); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(xf,y0);LineTo(xc+round(6*FrxGlob[indexTCO]),yc-round(6*FryGlob[indexTCO]));LineTo(x0,yc); + end; end; if position=const_droit then begin - // effacement du morceau - pen.color:=fond; - Brush.Color:=fond; - pen.width:=1; - x1:=xc-(epaisseur div 2);y1:=yc-(2*epaisseur); - x2:=xc+epaisseur; - x3:=xc-epaisseur-2;y3:=yc+(epaisseur div 2)+1; - x4:=xc-2*epaisseur;y4:=y3; - polygon([point(x1,y1),point(x2,y1),point(x3,y3),point(x4,y4)]); + if not affposFil then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.width:=1; + x1:=xc-(epaisseur div 2);y1:=yc-(2*epaisseur); + x2:=xc+epaisseur; + x3:=xc-epaisseur-2;y3:=yc+(epaisseur div 2)+1; + x4:=xc-2*epaisseur;y4:=y3; + polygon([point(x1,y1),point(x2,y1),point(x3,y3),point(x4,y4)]); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(xf,y0);LineTo(x0,yf); + end; end; end; end; @@ -4636,28 +5117,48 @@ begin if (position=const_Devie) then begin - // effacement du morceau - pen.width:=1; - x1:=xc-2*epaisseur-5;y1:=yc-(epaisseur div 2); - x2:=x1+3*epaisseur;y2:=y1-epaisseur; - pen.color:=fond; - Brush.Color:=fond; - r:=rect(x1,y1,x2,y2); - rectangle(r); + if not(affposfil) then + begin + // effacement du morceau + pen.width:=1; + x1:=xc-2*epaisseur-5;y1:=yc-(epaisseur div 2); + x2:=x1+3*epaisseur;y2:=y1-epaisseur; + pen.color:=fond; + Brush.Color:=fond; + r:=rect(x1,y1,x2,y2); + rectangle(r); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(xf,yf);LineTo(xc,yc);lineto(x0,yc); + end; end; if position=const_droit then begin - // effacement du morceau - pen.Width:=1; - x1:=xc-epaisseur-3;y1:=yc-(epaisseur div 2)-1; - x2:=x1-epaisseur;y2:=y1; - x3:=x2+epaisseur+2;y3:=y2+epaisseur+2; - x4:=x3+epaisseur;y4:=y3; - pen.color:=fond; - Brush.Color:=fond; - Polygon([point(x1,y1),Point(x2,y2),Point(x3,y3),Point(x4,y4)]); - end; + if not(affposfil) then + begin + // effacement du morceau + pen.Width:=1; + x1:=xc-epaisseur-3;y1:=yc-(epaisseur div 2)-1; + x2:=x1-epaisseur;y2:=y1; + x3:=x2+epaisseur+2;y3:=y2+epaisseur+2; + x4:=x3+epaisseur;y4:=y3; + pen.color:=fond; + Brush.Color:=fond; + Polygon([point(x1,y1),Point(x2,y2),Point(x3,y3),Point(x4,y4)]); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(xf,yf);lineto(x0,y0); + end; + end; end; end; @@ -4757,30 +5258,50 @@ begin if (position=const_Devie) then begin - // effacement du morceau - pen.width:=1; - x1:=xc-epaisseur-2;y1:=yc-(epaisseur div 2); - x2:=xc+epaisseur;y2:=y1; - x3:=xc+3*epaisseur+3;y3:=yc+2*epaisseur; - x4:=xc+2*epaisseur+4;y4:=y3; - pen.color:=fond; - Brush.Color:=fond; - r:=rect(x1,y1,x2,y2); - Polygon([point(x1,y1),Point(x2,y2),Point(x3,y3),Point(x4,y4)]); + if not(AffPosFil) then + begin + // effacement du morceau + pen.width:=1; + x1:=xc-epaisseur-2;y1:=yc-(epaisseur div 2); + x2:=xc+epaisseur;y2:=y1; + x3:=xc+3*epaisseur+3;y3:=yc+2*epaisseur; + x4:=xc+2*epaisseur+4;y4:=y3; + pen.color:=fond; + Brush.Color:=fond; + r:=rect(x1,y1,x2,y2); + Polygon([point(x1,y1),Point(x2,y2),Point(x3,y3),Point(x4,y4)]); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(xf,yf);LineTo(xc,yc+round(4*fryGlob[indexTCO]));lineto(x0,yc); + end; end; if position=const_droit then begin - // effacement du morceau - pen.Width:=1; - x1:=xc-(2*epaisseur)+3;y1:=yc-(epaisseur div 2)-1; - x2:=xc-(3*epaisseur)+4;y2:=y1; - x3:=xc;y3:=yc+2*epaisseur; - x4:=xc+epaisseur;y4:=y3; - pen.color:=fond; - Brush.Color:=fond; - Polygon([point(x1,y1),Point(x2,y2),Point(x3,y3),Point(x4,y4)]); - end; + if not(AffPosFil) then + begin + // effacement du morceau + pen.Width:=1; + x1:=xc-(2*epaisseur)+3;y1:=yc-(epaisseur div 2)-1; + x2:=xc-(3*epaisseur)+4;y2:=y1; + x3:=xc;y3:=yc+2*epaisseur; + x4:=xc+epaisseur;y4:=y3; + pen.color:=fond; + Brush.Color:=fond; + Polygon([point(x1,y1),Point(x2,y2),Point(x3,y3),Point(x4,y4)]); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(xf,yf);lineto(x0,y0); + end; + end; end; end; @@ -4887,25 +5408,45 @@ begin if (position=const_Devie) then begin - // effacement du morceau - pen.color:=fond; - Brush.Color:=fond; - pen.width:=1; - x1:=xc-epaisseur;y1:=yc-(epaisseur div 2)-1; - x2:=xc+epaisseur+10;y2:=yc-epaisseur-3; - polygon([point(x1,y1),point(x2,y1),point(x2,y2),point(x1,y2)]); + if not(AffPosFil) then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.width:=1; + x1:=xc-epaisseur;y1:=yc-(epaisseur div 2)-1; + x2:=xc+epaisseur+10;y2:=yc-epaisseur-3; + polygon([point(x1,y1),point(x2,y1),point(x2,y2),point(x1,y2)]); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(x0,yf);LineTo(xc,yc);LineTo(xf,yc); + end; end; if position=const_droit then begin - // effacement du morceau - pen.color:=fond; - Brush.Color:=fond; - pen.Width:=1; - x1:=xc+(epaisseur div 2);y1:=yc+(epaisseur div 2); - x2:=x1+epaisseur-1;y2:=yc-(epaisseur div 2); - x3:=x1+10; - polygon([point(x1,y1),point(x2,y2),point(x3,y2),point(x3,y1)]); + if not(AffPosFil) then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.Width:=1; + x1:=xc+(epaisseur div 2);y1:=yc+(epaisseur div 2); + x2:=x1+epaisseur-1;y2:=yc-(epaisseur div 2); + x3:=x1+10; + polygon([point(x1,y1),point(x2,y2),point(x3,y2),point(x3,y1)]); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(x0,yf);LineTo(xf,y0); + end; end; end; end; @@ -5005,28 +5546,48 @@ begin if (position=const_Devie) then begin - // effacement du morceau - pen.color:=fond; - Brush.Color:=fond; - pen.width:=1; - x1:=xc-epaisseur;y1:=yc-(epaisseur div 2)-1; - x2:=xc+epaisseur+10;y2:=y1; - x3:=xc-epaisseur-5;y3:=yc+epaisseur; - x4:=xc-2*epaisseur;y4:=y3; - polygon([point(x1,y1),point(x2,y2),point(x3,y3),point(x4,y4)]); + if not(AffPosFil) then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.width:=1; + x1:=xc-epaisseur;y1:=yc-(epaisseur div 2)-1; + x2:=xc+epaisseur+10;y2:=y1; + x3:=xc-epaisseur-5;y3:=yc+epaisseur; + x4:=xc-2*epaisseur;y4:=y3; + polygon([point(x1,y1),point(x2,y2),point(x3,y3),point(x4,y4)]); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(x0,yf);LineTo(xc,yc+round(4*fryGlob[indexTCO]));LineTo(xf,yc); + end; end; if position=const_droit then begin - // effacement du morceau - pen.color:=fond; - Brush.Color:=fond; - pen.Width:=1; - x1:=xc+(epaisseur)+epaisseur-1;y1:=yc-(epaisseur); - x2:=x1+2*epaisseur;y2:=y1; - x3:=xc+(epaisseur);y3:=yc+(2*epaisseur); - x4:=xc-epaisseur-1;y4:=y3; - polygon([point(x1,y1),point(x2,y2),point(x3,y3),point(x4,y4)]); + if not(AffPosFil) then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.Width:=1; + x1:=xc+(epaisseur)+epaisseur-1;y1:=yc-(epaisseur); + x2:=x1+2*epaisseur;y2:=y1; + x3:=xc+(epaisseur);y3:=yc+(2*epaisseur); + x4:=xc-epaisseur-1;y4:=y3; + polygon([point(x1,y1),point(x2,y2),point(x3,y3),point(x4,y4)]); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(x0,yf);LineTo(xf,y0); + end; end; end; end; @@ -5390,9 +5951,10 @@ end; // Element 21 - croisement - TJD procedure dessin_21(indexTCO : integer;Canvas : Tcanvas;x,y,mode : integer); -var yp,x1,x2,y1,y2,x3,y3,x4,y4,x0,y0,xc,yc,xf,yf,trajet,ep,pont : integer; +var yp,x1,x2,y1,y2,x3,y3,x4,y4,x0,y0,xc,yc,xf,yf,trajet,ep,pont,adr1,adr2, + index1,index2,etatTJD,position1,position2,sHG,sBD : integer; a1,b1,a2,b2 : double; - md : tequipement; + md,tHG,tBD : tequipement; procedure horizontale; begin with canvas do @@ -5453,6 +6015,7 @@ begin yf:=y0+hauteurCell[indexTCO]; ep:=tco[indextco,x,y].epaisseurs; pont:=tco[indextco,x,y].pont; + md:=aiguillage[index_aig(tco[indextco,x,y].Adresse)].modele; with canvas do begin @@ -5462,7 +6025,7 @@ begin horizontale; diagonale; - md:=aiguillage[index_aig(tco[indextco,x,y].Adresse)].modele; + if (md=tjd) or (md=tjs) then begin tjdbas; @@ -5562,13 +6125,99 @@ begin end; end; end; + + // dessin position de la tjd + adr1:=tco[indexTCO,x,y].Adresse; + Index1:=Index_aig(adr1); + md:=aiguillage[Index1].modele; + if (md=tjd) or (md=tjs) then + begin + EtatTJD:=aiguillage[index1].EtatTJD; // nombre d'états de la tjd (2 ou 4) + position1:=aiguillage[index1].position; + sHG:=TCO[indexTCO,x,y].suivHG;tHG:=TCO[indexTCO,x,y].typHG; + sBD:=TCO[indexTCO,x,y].suivBD;tBD:=TCO[indexTCO,x,y].typBD; + canvas.pen.color:=clfond[indexTCO]; + canvas.pen.Width:=epaisseur div 2; + if etatTJD=4 then + begin + adr2:=aiguillage[index1].DDevie; // homologue + Index2:=Index_aig(adr2); + position2:=aiguillage[index2].position; + + if (position1=const_devie) and (position2=const_devie) then + begin + with canvas do begin + moveTo(x0,yf);LineTo(xf,y0); + end; + end; + + if (position1=const_droit) and (position2=const_droit) then + begin + with canvas do begin + moveTo(x0,yc);LineTo(xf,yc); + end; + end; + + if (position1=const_droit) and (position2=const_devie) then + begin + if tco[indexTCO,x,y].tjdE=adr1 then + with canvas do begin + moveTo(x0,yc);LineTo(xc,yc);Lineto(xf,y0); + end; + if tco[indexTCO,x,y].tjdE=adr2 then + with canvas do begin + moveTo(x0,yf);LineTo(xc,yc);Lineto(xf,yc); + end; + end; + + if (position1=const_devie) and (position2=const_droit) then + begin + if tco[indexTCO,x,y].tjdE=adr1 then + with canvas do begin + moveTo(x0,yf);LineTo(xc,yc);Lineto(xf,yc); + end; + if tco[indexTCO,x,y].tjdE=adr2 then + with canvas do begin + moveTo(x0,yc);LineTo(xc,yc);Lineto(xf,y0); + end; + end; + end; + + if etatTJD=2 then + begin + if position1=const_droit then + with canvas do + begin + moveTo(x0,yf);LineTo(xf,y0); + moveTo(x0,yc);LineTo(xf,yc); + end; + if position1=const_devie then + with canvas do + begin + // donne l'équation de droite y=ax+b passant par les points (x1,y1) (x2,y2) + droite(xc,yc,xf,y0,a1,b1); + //haut + moveTo(x0,yc); LineTo(xc-epaisseur,yc); + LineTo(xc+epaisseur,round((xc+epaisseur)*a1+b1) ); LineTo(xf,y0); + //bas + moveTo(x0,yf); + LineTo(xc-epaisseur,round((xc-epaisseur)*a1+b1) ); + lineTo(xc+epaisseur,yc); + LineTo(xf,yc); + end; + end; + end; + + end; // Element 22 procedure dessin_22(indexTCO : integer;Canvas : Tcanvas;x,y,mode : integer); -var pont,yp,x1,y1,x2,y2,x3,y3,x4,y4,x0,y0,xc,yc,xf,yf,trajet,ep : integer; - md : tequipement; +var pont,yp,x1,y1,x2,y2,x3,y3,x4,y4,x0,y0,xc,yc,xf,yf,trajet,ep,position1,position2, + adr1,adr2,index1,index2,etatTJD,sHG,sBD : integer; + md,tHG,tBD : tequipement; a1,b1,a2,b2 : double; + fond : Tcolor; procedure horizontale; begin with canvas do @@ -5591,7 +6240,7 @@ var pont,yp,x1,y1,x2,y2,x3,y3,x4,y4,x0,y0,xc,yc,xf,yf,trajet,ep : integer; end; end; - procedure TJDbas; + procedure TJDbas; // morceau courbe bas begin x1:=x0-LargeurCell[indexTCO]-(LargeurCell[indexTCO] div 3);y1:=yc; x2:=xf+(LargeurCell[indexTCO] div 3);y2:=yf+2*hauteurCell[indexTCO]+(hauteurCell[indexTCO] div 2); @@ -5605,7 +6254,7 @@ var pont,yp,x1,y1,x2,y2,x3,y3,x4,y4,x0,y0,xc,yc,xf,yf,trajet,ep : integer; end; end; - procedure TJDHaut; + procedure TJDHaut; // morceau courbe haut begin x1:=x0-(LargeurCell[indexTCO] div 3);y1:=y0-2*hauteurCell[indexTCO]-(hauteurCell[indexTCO] div 2); x2:=xf+LargeurCell[indexTCO]+(LargeurCell[indexTCO] div 3);y2:=yc; @@ -5627,6 +6276,8 @@ begin yf:=y0+hauteurCell[indexTCO]; ep:=tco[indextco,x,y].epaisseurs; pont:=tco[indextco,x,y].pont; + fond:=tco[indextco,x,y].CouleurFond; + md:=aiguillage[index_aig(tco[indextco,x,y].Adresse)].modele; with canvas do begin @@ -5641,7 +6292,7 @@ begin diagonale; horizontale; - md:=aiguillage[index_aig(tco[indextco,x,y].Adresse)].modele; + if (md=tjd) or (md=tjs) then begin TJDbas; @@ -5707,6 +6358,7 @@ begin y1:=round(a2*x1+b2); moveto(x1,y1);lineTo(x2,y2); end; + // regarder d'ou on vient de la route du tco if mode>0 then @@ -5723,22 +6375,93 @@ begin if trajet=2 then diagonale; if trajet=3 then // NO centre E \- begin - { if testbit(ep,0) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; - moveto(x0,y0);LineTo(xc,yc); - if testbit(ep,3) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; - lineTo(xf,yc);} tjdhaut; end; if trajet=4 then // O C SE -\ begin - { if testbit(ep,7) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; - moveto(x0,yc);LineTo(xc,yc); - if testbit(ep,4) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; - lineTo(xf,yf); } tjdbas; end; end; end; + + // position de la tjd + adr1:=tco[indexTCO,x,y].Adresse; + Index1:=Index_aig(adr1); + if (md=tjd) or (md=tjs) then + begin + EtatTJD:=aiguillage[index1].EtatTJD; // nombre d'états de la tjd (2 ou 4) + position1:=aiguillage[index1].position; + sHG:=TCO[indexTCO,x,y].suivHG;tHG:=TCO[indexTCO,x,y].typHG; + sBD:=TCO[indexTCO,x,y].suivBD;tBD:=TCO[indexTCO,x,y].typBD; + canvas.pen.color:=clfond[indexTCO]; + canvas.pen.Width:=epaisseur div 2; + if etatTJD=4 then + begin + adr2:=aiguillage[index1].DDevie; // homologue + Index2:=Index_aig(adr2); + position2:=aiguillage[index2].position; + + if (position1=const_devie) and (position2=const_devie) then + begin + with canvas do begin + moveTo(x0,yc);LineTo(xf,yc); + end; + end; + + if (position1=const_droit) and (position2=const_droit) then + begin + with canvas do begin + moveTo(x0,y0);LineTo(xf,yf); + end; + end; + + if (position1=const_droit) and (position2=const_devie) then + begin + if tco[indexTCO,x,y].tjdE=adr1 then + with canvas do begin + moveTo(x0,y0);LineTo(xc,yc);Lineto(xf,yc); + end; + if tco[indexTCO,x,y].tjdE=adr2 then + with canvas do begin + moveTo(x0,yc);LineTo(xc,yc);Lineto(xf,yf); + end; + end; + + if (position1=const_devie) and (position2=const_droit) then + begin + if tco[indexTCO,x,y].tjdE=adr1 then + with canvas do begin + moveTo(x0,yc);LineTo(xc,yc);Lineto(xf,yf); + end; + if tco[indexTCO,x,y].tjdE=adr2 then + with canvas do begin + moveTo(x0,y0);LineTo(xc,yc);Lineto(xf,yc); + end; + end; + end; + + if etatTJD=2 then + begin + if position1=const_droit then + with canvas do + begin + moveTo(x0,y0);LineTo(xf,yf); + moveTo(x0,yc);LineTo(xf,yc); + end; + if position1=const_devie then + with canvas do + begin + // donne l'équation de droite y=ax+b passant par les points (x1,y1) (x2,y2) + droite(x0,y0,xc,yc,a1,b1); + moveTo(x0,y0);LineTo(xc-epaisseur,round((xc-epaisseur)*a1+b1) ); LineTo(xc+epaisseur,yc); LineTo(xf,yc); + + moveTo(x0,yc);lineTo(xc-epaisseur,yc); + LineTo(xc+epaisseur,round((xc+epaisseur)*a1+b1) ); + LineTo(xf,yf); + end; + end; + end; + end; // Element 51 (quai) @@ -6465,25 +7188,45 @@ begin if (position=const_Devie) then begin - // effacement du morceau - pen.color:=fond; - Brush.Color:=fond; - pen.width:=1; - jy1:=yc - Epaisseur-1; - jx1:=xc-(Epaisseur div 2); - pen.width:=1; - Polygon([point(jx1,jy1),Point(jx1+epaisseur,jy1+epaisseur),Point(jx1+epaisseur,jy1-epaisseur),Point(jx1,jy1-epaisseur)]); + if not(affposFil) then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.width:=1; + jy1:=yc - Epaisseur-1; + jx1:=xc-(Epaisseur div 2); + pen.width:=1; + Polygon([point(jx1,jy1),Point(jx1+epaisseur,jy1+epaisseur),Point(jx1+epaisseur,jy1-epaisseur),Point(jx1,jy1-epaisseur)]); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(xc,yf);LineTo(xc,yc);LineTo(x0,y0); + end; end; if position=const_droit then begin - // effacement du morceau - pen.color:=fond; - Brush.Color:=fond; - pen.Width:=1; - jx1:=xc-(Epaisseur div 2); // pos Y de la bande inf - r:=rect(jx1,yc-10,jx1-Epaisseur,yc+10); - FillRect(r); + if not(affposFil) then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.Width:=1; + jx1:=xc-(Epaisseur div 2); // pos Y de la bande inf + r:=rect(jx1,yc-10,jx1-Epaisseur,yc+10); + FillRect(r); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(xc,yf);LineTo(xc,y0); + end; end; end; end; @@ -6587,33 +7330,55 @@ begin if (position=const_Devie) then begin - // effacement du morceau - pen.color:=fond; - Brush.Color:=fond; - pen.width:=1; - jx1:=xc-(Epaisseur div 2); jy1:=yc - Epaisseur+5; - pen.width:=1; - Polygon([point(jx1,jy1),Point(jx1+epaisseur,jy1+epaisseur+10),Point(jx1+epaisseur,jy1-epaisseur),Point(jx1,jy1-epaisseur)]); + if not(affPosFil) then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.width:=1; + jx1:=xc-(Epaisseur div 2); jy1:=yc - Epaisseur+5; + pen.width:=1; + Polygon([point(jx1,jy1),Point(jx1+epaisseur,jy1+epaisseur+10),Point(jx1+epaisseur,jy1-epaisseur),Point(jx1,jy1-epaisseur)]); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(xc,yf);LineTo(xc,yc+round(8*fryGlob[indexTCO]));LineTo(x0,y0); + end; end; if position=const_droit then begin - // effacement du morceau - pen.color:=fond; - Brush.Color:=fond; - pen.Width:=1; - jx1:=xc-(Epaisseur div 2); // pos Y de la bande inf - r:=rect(jx1,yc-15,jx1-Epaisseur,yf); - FillRect(r); + if not(affPosFil) then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.Width:=1; + jx1:=xc-(Epaisseur div 2); // pos Y de la bande inf + r:=rect(jx1,yc-15,jx1-Epaisseur,yf); + FillRect(r); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(xc,yf);LineTo(xc,y0); + end; + end; end; end; // Element 23 croisement procedure dessin_23(indexTCO : integer;Canvas : Tcanvas;x,y,mode: integer); -var x1,x2,y1,y2,xp,x0,y0,x3,y3,x4,y4,xf,yf,xc,yc,trajet,ep,pont : integer; +var x1,x2,y1,y2,xp,x0,y0,x3,y3,x4,y4,xf,yf,xc,yc,trajet,ep,pont, + adr1,adr2,index1,index2,position1,position2,EtatTJD,sHG,sBD : integer; a1,b1,a2,b2 : double; - md : tEquipement; + md,tHG,tBD: tEquipement; procedure verticale; begin with canvas do @@ -6789,6 +7554,88 @@ begin end; end; end; + + // dessin position de la tjd + adr1:=tco[indexTCO,x,y].Adresse; + Index1:=Index_aig(adr1); + md:=aiguillage[Index1].modele; + if (md=tjd) or (md=tjs) then + begin + EtatTJD:=aiguillage[index1].EtatTJD; // nombre d'états de la tjd (2 ou 4) + position1:=aiguillage[index1].position; + sHG:=TCO[indexTCO,x,y].suivHG;tHG:=TCO[indexTCO,x,y].typHG; + sBD:=TCO[indexTCO,x,y].suivBD;tBD:=TCO[indexTCO,x,y].typBD; + canvas.pen.color:=clfond[indexTCO];; + canvas.pen.Width:=epaisseur div 2; + if etatTJD=4 then + begin + adr2:=aiguillage[index1].DDevie; // homologue + Index2:=Index_aig(adr2); + position2:=aiguillage[index2].position; + + if (position1=const_devie) and (position2=const_devie) then + begin + with canvas do begin + moveTo(xc,y0);LineTo(xc,yf); + end; + end; + + if (position1=const_droit) and (position2=const_droit) then + begin + with canvas do begin + moveTo(x0,yf);LineTo(xf,y0); + end; + end; + + if (position1=const_droit) and (position2=const_devie) then + begin + if tco[indexTCO,x,y].tjdS=adr1 then + with canvas do begin + moveTo(xf,y0);LineTo(xc,yc);Lineto(xc,yf); + end; + if tco[indexTCO,x,y].tjdS=adr2 then + with canvas do begin + moveTo(xc,y0);LineTo(xc,yc);Lineto(x0,yf); + end; + end; + + if (position1=const_devie) and (position2=const_droit) then + begin + if tco[indexTCO,x,y].tjdS=adr1 then + with canvas do begin + moveTo(xc,y0);LineTo(xc,yc);Lineto(x0,yf); + end; + if tco[indexTCO,x,y].tjdS=adr2 then + with canvas do begin + moveTo(xf,y0);LineTo(xc,yc);Lineto(xc,yf); + end; + end; + end; + + if etatTJD=2 then + begin + if position1=const_droit then + with canvas do + begin + moveTo(xc,y0);LineTo(xc,yf); + moveTo(xf,y0);LineTo(x0,yf); + end; + if position1=const_devie then + with canvas do + begin + // donne l'équation de droite y=ax+b passant par les points (x1,y1) (x2,y2) + droite(xc,yc,x0,yf,a1,b1); + //gauche + moveTo(xc,y0); LineTo(xc,yc-epaisseur); + LineTo(xc-epaisseur,round((xc-epaisseur)*a1+b1) ); LineTo(x0,yf); + //droite + moveTo(xc,yf); + lineTo(xc,yc+epaisseur); + LineTo(xc+epaisseur,round((xc+epaisseur)*a1+b1) ); + LineTo(xf,y0); + end; + end; + end; end; procedure dessin_24(indexTCO : integer;Canvas : Tcanvas;x,y : integer;Mode : integer); @@ -6799,9 +7646,10 @@ end; // Element 25 croisement procedure dessin_25(indexTCO : integer;Canvas : Tcanvas;x,y,mode: integer); -var xp,x0,y0,x3,y3,x4,y4,xf,yf,xc,yc,trajet,ep,pont,x1,x2,y1,y2 : integer; +var xp,x0,y0,x3,y3,x4,y4,xf,yf,xc,yc,trajet,ep,pont,x1,x2,y1,y2, + adr1,adr2,index1,index2,position1,position2,EtatTJD,sHG,sBD : integer; a1,b1,a2,b2 : double; - md : tEquipement; + md,tHG,tBD : tEquipement; procedure verticale; begin with canvas do @@ -6977,6 +7825,89 @@ begin end; end; end; + + // dessin position de la tjd + adr1:=tco[indexTCO,x,y].Adresse; + Index1:=Index_aig(adr1); + md:=aiguillage[Index1].modele; + if (md=tjd) or (md=tjs) then + begin + EtatTJD:=aiguillage[index1].EtatTJD; // nombre d'états de la tjd (2 ou 4) + position1:=aiguillage[index1].position; + sHG:=TCO[indexTCO,x,y].suivHG;tHG:=TCO[indexTCO,x,y].typHG; + sBD:=TCO[indexTCO,x,y].suivBD;tBD:=TCO[indexTCO,x,y].typBD; + canvas.pen.color:=clfond[indexTCO]; + canvas.pen.Width:=epaisseur div 2; + if etatTJD=4 then + begin + adr2:=aiguillage[index1].DDevie; // homologue + Index2:=Index_aig(adr2); + position2:=aiguillage[index2].position; + + if (position1=const_devie) and (position2=const_devie) then + begin + with canvas do begin + moveTo(x0,y0);LineTo(xf,yf); + end; + end; + + if (position1=const_droit) and (position2=const_droit) then + begin + with canvas do begin + moveTo(xc,yf);LineTo(xc,y0); + end; + end; + + if (position1=const_droit) and (position2=const_devie) then + begin + if tco[indexTCO,x,y].tjdS=adr1 then + with canvas do begin + moveTo(xc,y0);LineTo(xc,yc);Lineto(xf,yf); + end; + if tco[indexTCO,x,y].tjdS=adr2 then + with canvas do begin + moveTo(x0,y0);LineTo(xc,yc);Lineto(xc,yf); + end; + end; + + if (position1=const_devie) and (position2=const_droit) then + begin + if tco[indexTCO,x,y].tjdS=adr1 then + with canvas do begin + moveTo(x0,y0);LineTo(xc,yc);Lineto(xc,yf); + end; + if tco[indexTCO,x,y].tjdS=adr2 then + with canvas do begin + moveTo(xc,y0);LineTo(xc,yc);Lineto(xf,yf); + end; + end; + end; + + if etatTJD=2 then + begin + if position1=const_droit then + with canvas do + begin + moveTo(xc,y0);LineTo(xc,yf); + moveTo(x0,y0);LineTo(xf,yf); + end; + if position1=const_devie then + with canvas do + begin + // donne l'équation de droite y=ax+b passant par les points (x1,y1) (x2,y2) + droite(x0,y0,xf,yf,a1,b1); + //gauche + moveTo(xc,yf); LineTo(xc,yc+epaisseur); + LineTo(xc-epaisseur,round((xc-epaisseur)*a1+b1) ); LineTo(x0,y0); + //droite + moveTo(xc,y0); + lineTo(xc,yc-epaisseur); + LineTo(xc+epaisseur,round((xc+epaisseur)*a1+b1) ); + LineTo(xf,yf); + end; + end; + end; + end; // Element 26 @@ -7077,25 +8008,45 @@ begin if (position=const_Devie) then begin - // effacement du morceau - pen.color:=fond; - Brush.Color:=fond; - pen.width:=1; - jy1:=yc - 2*Epaisseur-1; - jx1:=xc- (Epaisseur div 2); - pen.width:=1; - Polygon([point(jx1,jy1),Point(jx1+epaisseur,jy1),Point(jx1+epaisseur,jy1+epaisseur),Point(jx1,jy1+2*epaisseur)]); + if not affposFil then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.width:=1; + jy1:=yc - 2*Epaisseur-1; + jx1:=xc- (Epaisseur div 2); + pen.width:=1; + Polygon([point(jx1,jy1),Point(jx1+epaisseur,jy1),Point(jx1+epaisseur,jy1+epaisseur),Point(jx1,jy1+2*epaisseur)]); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(xc,yf);LineTo(xc,yc);LineTo(xf,y0); + end; end; if position=const_droit then begin - // effacement du morceau - pen.color:=fond; - Brush.Color:=fond; - pen.Width:=1; - jx1:=xc+(Epaisseur div 2)+1; - r:=rect(jx1,yc-15,jx1+Epaisseur,yc+10); - FillRect(r); + if not affposfil then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.Width:=1; + jx1:=xc+(Epaisseur div 2)+1; + r:=rect(jx1,yc-15,jx1+Epaisseur,yc+10); + FillRect(r); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(xc,yf);LineTo(xc,y0); + end; end; end; end; @@ -7198,24 +8149,45 @@ begin if (position=const_Devie) then begin - // effacement du morceau - pen.color:=fond; - Brush.Color:=fond; - pen.width:=1; - jx1:=xc-(Epaisseur div 2); jy1:=yc - Epaisseur-5; - pen.width:=1; - Polygon([point(jx1,jy1),Point(jx1+epaisseur,jy1),Point(jx1+epaisseur,jy1+epaisseur),Point(jx1,jy1+4*epaisseur)]); + if not AffPosFil then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.width:=1; + jx1:=xc-(Epaisseur div 2); jy1:=yc - Epaisseur-5; + pen.width:=1; + Polygon([point(jx1,jy1),Point(jx1+epaisseur,jy1),Point(jx1+epaisseur,jy1+epaisseur),Point(jx1,jy1+4*epaisseur)]); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(xc,yf);LineTo(xc,yc+round(4*FryGlob[indexTCO]));LineTo(xf,y0); + end; + end; if position=const_droit then begin - // effacement du morceau - pen.color:=fond; - Brush.Color:=fond; - pen.Width:=1; - jx1:=xc+(Epaisseur div 2); - r:=rect(jx1+1,yc-15,jx1+Epaisseur,yf); - FillRect(r); + if not affposfil then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.Width:=1; + jx1:=xc+(Epaisseur div 2); + r:=rect(jx1+1,yc-15,jx1+Epaisseur,yf); + FillRect(r); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(xc,yf);LineTo(xc,y0); + end; end; end; end; @@ -7323,26 +8295,46 @@ begin if (position=const_Devie) then begin - // effacement du morceau - pen.color:=fond; - Brush.Color:=fond; - pen.width:=1; - jx1:=xc-(Epaisseur div 2); jy1:=yc + Epaisseur+2; - jx2:=jx1+epaisseur;jy2:=jy1-epaisseur; - jx3:=jx2;jy3:=yc+2*epaisseur; - pen.width:=1; - Polygon([point(jx1,jy1),Point(jx2,jy2),Point(jx3,jy3),Point(jx1,jy3)]); + if not affPosFil then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.width:=1; + jx1:=xc-(Epaisseur div 2); jy1:=yc + Epaisseur+2; + jx2:=jx1+epaisseur;jy2:=jy1-epaisseur; + jx3:=jx2;jy3:=yc+2*epaisseur; + pen.width:=1; + Polygon([point(jx1,jy1),Point(jx2,jy2),Point(jx3,jy3),Point(jx1,jy3)]); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(xc,y0);LineTo(xc,yc);LineTo(x0,yf); + end; end; if position=const_droit then begin - // effacement du morceau - pen.color:=fond; - Brush.Color:=fond; - pen.Width:=1; - jx1:=xc-(Epaisseur div 2); - r:=rect(jx1,yc-3*epaisseur,jx1-Epaisseur,yf); - FillRect(r); + if not affposfil then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.Width:=1; + jx1:=xc-(Epaisseur div 2); + r:=rect(jx1,yc-3*epaisseur,jx1-Epaisseur,yf); + FillRect(r); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(xc,y0);LineTo(xc,yf); + end; end; end; end; @@ -7447,26 +8439,46 @@ begin if (position=const_Devie) then begin - // effacement du morceau - pen.color:=fond; - Brush.Color:=fond; - pen.width:=1; - jx1:=xc-(Epaisseur div 2); jy1:=yc + Epaisseur; - jx2:=jx1+epaisseur;jy2:=jy1-3*epaisseur; - jx3:=jx2;jy3:=yc+2*epaisseur; - pen.width:=1; - Polygon([point(jx1,jy1),Point(jx2,jy2),Point(jx3,jy3),Point(jx1,jy3)]); + if not affposfil then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.width:=1; + jx1:=xc-(Epaisseur div 2); jy1:=yc + Epaisseur; + jx2:=jx1+epaisseur;jy2:=jy1-3*epaisseur; + jx3:=jx2;jy3:=yc+2*epaisseur; + pen.width:=1; + Polygon([point(jx1,jy1),Point(jx2,jy2),Point(jx3,jy3),Point(jx1,jy3)]); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(xc,y0);LineTo(xc,yc-round(4*frxGlob[indexTCO]));LineTo(x0,yf); + end; end; if position=const_droit then begin - // effacement du morceau - pen.color:=fond; - Brush.Color:=fond; - pen.Width:=1; - jx1:=xc-(Epaisseur div 2); - r:=rect(jx1,yc-3*epaisseur,jx1-Epaisseur,yf); - FillRect(r); + if not affposfil then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.Width:=1; + jx1:=xc-(Epaisseur div 2); + r:=rect(jx1,yc-3*epaisseur,jx1-Epaisseur,yf); + FillRect(r); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(xc,y0);LineTo(xc,yf); + end; end; end; end; @@ -7571,26 +8583,46 @@ begin if (position=const_Devie) then begin - // effacement du morceau - pen.color:=fond; - Brush.Color:=fond; - pen.width:=1; - jx1:=xc-(Epaisseur div 2); jy1:=yc + (Epaisseur div 2); - jx2:=jx1+epaisseur;jy2:=jy1+epaisseur; - jx3:=jx2;jy3:=yc+2*epaisseur; - pen.width:=1; - Polygon([point(jx1,jy1),Point(jx2,jy2),Point(jx3,jy3),Point(jx1,jy3)]); + if not(AffPoSFil) then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.width:=1; + jx1:=xc-(Epaisseur div 2); jy1:=yc + (Epaisseur div 2); + jx2:=jx1+epaisseur;jy2:=jy1+epaisseur; + jx3:=jx2;jy3:=yc+2*epaisseur; + pen.width:=1; + Polygon([point(jx1,jy1),Point(jx2,jy2),Point(jx3,jy3),Point(jx1,jy3)]); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(xc,y0);LineTo(xc,yc);LineTo(xf,yf); + end; end; if position=const_droit then begin - // effacement du morceau - pen.color:=fond; - Brush.Color:=fond; - pen.Width:=1; - jx1:=xc+(Epaisseur div 2); - r:=rect(jx1,yc-3*epaisseur,jx1+Epaisseur,yf); - FillRect(r); + if not(AffPoSFil) then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.Width:=1; + jx1:=xc+(Epaisseur div 2); + r:=rect(jx1,yc-3*epaisseur,jx1+Epaisseur,yf); + FillRect(r); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(xc,y0);LineTo(xc,yf); + end; end; end; end; @@ -7692,28 +8724,49 @@ begin trajet_droit; end; + if (position=const_Devie) then begin - // effacement du morceau - pen.color:=fond; - Brush.Color:=fond; - pen.width:=1; - jx1:=xc-(Epaisseur div 2); jy1:=yc - (2*Epaisseur ); - jx2:=jx1+epaisseur;jy2:=yc+epaisseur; - jx3:=jx2;jy3:=yc+2*epaisseur; - pen.width:=1; - Polygon([point(jx1,jy1),Point(jx2,jy2),Point(jx3,jy3),Point(jx1,jy3)]); + if not(affPosFil) then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.width:=1; + jx1:=xc-(Epaisseur div 2); jy1:=yc - (2*Epaisseur ); + jx2:=jx1+epaisseur;jy2:=yc+epaisseur; + jx3:=jx2;jy3:=yc+2*epaisseur; + pen.width:=1; + Polygon([point(jx1,jy1),Point(jx2,jy2),Point(jx3,jy3),Point(jx1,jy3)]); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(xc,y0);LineTo(xc,yc-round(4*fryGlob[indexTCO]));LineTo(xf,yf); + end; end; if position=const_droit then begin - // effacement du morceau - pen.color:=fond; - Brush.Color:=fond; - pen.Width:=1; - jx1:=xc+(Epaisseur div 2); - r:=rect(jx1,yc-3*epaisseur,jx1+Epaisseur,yf); - FillRect(r); + if not(affPosFil) then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.Width:=1; + jx1:=xc+(Epaisseur div 2); + r:=rect(jx1,yc-3*epaisseur,jx1+Epaisseur,yf); + FillRect(r); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(xc,y0);LineTo(xc,yf); + end; end; end; end; @@ -7815,32 +8868,51 @@ begin begin trajet_devie; trajet_droit; - end; + end; if (position=const_Devie) then begin - // effacement du morceau - pen.width:=1; - x1:=xc+(epaisseur div 2)+1;y1:=yc-epaisseur; - x2:=x1+epaisseur;y2:=y1; - x3:=x2;y3:=y2+4*epaisseur; - x4:=x1;y4:=y3; - pen.color:=fond; - Brush.Color:=fond; - Polygon([point(x1,y1),Point(x2,y2),Point(x3,y3),Point(x4,y4)]); + if not(AffPosFil) then + begin + // effacement du morceau + pen.width:=1; + x1:=xc+(epaisseur div 2)+1;y1:=yc-epaisseur; + x2:=x1+epaisseur;y2:=y1; + x3:=x2;y3:=y2+4*epaisseur; + x4:=x1;y4:=y3; + pen.color:=fond; + Brush.Color:=fond; + Polygon([point(x1,y1),Point(x2,y2),Point(x3,y3),Point(x4,y4)]); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(x0,y0);lineTo(xc,yc);LineTo(xc,yf); + end; end; - if position=const_droit then begin - // effacement du morceau - pen.Width:=1; - x1:=xc-(epaisseur div 2);y1:=yc+(epaisseur div 2); - x2:=x1+epaisseur;y2:=y1+epaisseur; - x3:=x2;y3:=y2+(epaisseur div 2); - x4:=x1;y4:=y3; - pen.color:=fond; - Brush.Color:=fond; - Polygon([point(x1,y1),Point(x2,y2),Point(x3,y3),Point(x4,y4)]); + if not(AffPosFil) then + begin + // effacement du morceau + pen.Width:=1; + x1:=xc-(epaisseur div 2);y1:=yc+(epaisseur div 2); + x2:=x1+epaisseur;y2:=y1+epaisseur; + x3:=x2;y3:=y2+(epaisseur div 2); + x4:=x1;y4:=y3; + pen.color:=fond; + Brush.Color:=fond; + Polygon([point(x1,y1),Point(x2,y2),Point(x3,y3),Point(x4,y4)]); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(x0,y0);LineTo(xf,yf); + end; end; end; end; @@ -7864,7 +8936,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,4) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; lineto(xf,yf); end; @@ -7939,28 +9011,48 @@ begin if (position=const_Devie) then begin - // effacement du morceau - pen.width:=1; - x1:=xc-round(epaisseur*1);y1:=yc-round(2.2*epaisseur); - x2:=xc+round(epaisseur*0.7);y2:=y1; - x3:=x2-round(epaisseur*0.2);y3:=yc+round(1.8*epaisseur); - x4:=x1;y4:=yc-round(1.5*epaisseur); - pen.color:=fond; - Brush.Color:=fond; - Polygon([point(x1,y1),Point(x2,y2),Point(x3,y3),Point(x4,y4)]); + if not(AffPosFil) then + begin + // effacement du morceau + pen.width:=1; + x1:=xc-round(epaisseur*1);y1:=yc-round(2.2*epaisseur); + x2:=xc+round(epaisseur*0.7);y2:=y1; + x3:=x2-round(epaisseur*0.2);y3:=yc+round(1.8*epaisseur); + x4:=x1;y4:=yc-round(1.5*epaisseur); + pen.color:=fond; + Brush.Color:=fond; + Polygon([point(x1,y1),Point(x2,y2),Point(x3,y3),Point(x4,y4)]); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(x0,y0);LineTo(xc-round(6*FrxGlob[indexTCO]),yc);LineTo(xc,yf); + end; end; if position=const_droit then begin - // effacement du morceau - pen.Width:=1; - x1:=xc-round(epaisseur*2.3);y1:=yc-round(epaisseur*1.4); - x2:=x1+3*epaisseur;y2:=y1+3*epaisseur; - x3:=x2;y3:=y2+(epaisseur div 2); - x4:=x1;y4:=y3; - pen.color:=fond; - Brush.Color:=fond; - Polygon([point(x1,y1),Point(x2,y2),Point(x3,y3),Point(x4,y4)]); + if not(AffPosFil) then + begin + // effacement du morceau + pen.Width:=1; + x1:=xc-round(epaisseur*2.3);y1:=yc-round(epaisseur*1.4); + x2:=x1+3*epaisseur;y2:=y1+3*epaisseur; + x3:=x2;y3:=y2+(epaisseur div 2); + x4:=x1;y4:=y3; + pen.color:=fond; + Brush.Color:=fond; + Polygon([point(x1,y1),Point(x2,y2),Point(x3,y3),Point(x4,y4)]); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(x0,y0);LineTo(xf,yf); + end; end; end; end; @@ -8065,27 +9157,47 @@ begin if (position=const_Devie) then begin - // effacement du morceau - pen.color:=fond; - Brush.Color:=fond; - pen.width:=1; - x1:=xc-round(1.5*epaisseur);y1:=yc-(epaisseur)+1; - x2:=xc-(epaisseur div 2);y2:=y1+4*epaisseur; - r:=rect(x1,y1,x2,y2); - rectangle(r); + if not affposfil then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.width:=1; + x1:=xc-round(1.5*epaisseur);y1:=yc-(epaisseur)+1; + x2:=xc-(epaisseur div 2);y2:=y1+4*epaisseur; + r:=rect(x1,y1,x2,y2); + rectangle(r); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(xf,y0);LineTo(xc,yc);LineTo(xc,yf); + end; end; if position=const_droit then begin - // effacement du morceau - pen.color:=fond; - Brush.Color:=fond; - pen.width:=1; - x1:=xc+round(0.9*epaisseur);y1:=yc; - x2:=x1+round(1.0*epaisseur); - x3:=xc-round(0.5*epaisseur);y3:=y1+round(2.2*epaisseur); - x4:=x3-round(0.9*epaisseur); - polygon([point(x1,y1),point(x2,y1),point(x3,y3),point(x4,y3)]); + if not affposfil then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.width:=1; + x1:=xc+round(0.9*epaisseur);y1:=yc; + x2:=x1+round(1.0*epaisseur); + x3:=xc-round(0.5*epaisseur);y3:=y1+round(2.2*epaisseur); + x4:=x3-round(0.9*epaisseur); + polygon([point(x1,y1),point(x2,y1),point(x3,y3),point(x4,y3)]); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(xf,y0);LineTo(x0,yf); + end; end; end; end; @@ -8187,28 +9299,48 @@ begin if (position=const_Devie) then begin - // effacement du morceau - pen.color:=fond; - Brush.Color:=fond; - pen.width:=1; - x1:=xc-round(0.7*epaisseur);y1:=yc-round(1.6*epaisseur); - x2:=xc+round(0.9*epaisseur);y2:=y1; - x3:=xc-round(0.3*epaisseur);y3:=yc+round(1.4*epaisseur); - x4:=xc-round(0.7*epaisseur);y4:=y3; - polygon([point(x1,y1),point(x2,y2),point(x3,y3),point(x4,y4)]); + if not affposfil then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.width:=1; + x1:=xc-round(0.7*epaisseur);y1:=yc-round(1.6*epaisseur); + x2:=xc+round(0.9*epaisseur);y2:=y1; + x3:=xc-round(0.3*epaisseur);y3:=yc+round(1.4*epaisseur); + x4:=xc-round(0.7*epaisseur);y4:=y3; + polygon([point(x1,y1),point(x2,y2),point(x3,y3),point(x4,y4)]); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(xf,y0);LineTo(xc+round(4*frxGlob[indexTCO]),yc);LineTo(xc,yf); + end; end; if position=const_droit then begin - // effacement du morceau - pen.color:=fond; - Brush.Color:=fond; - pen.width:=1; - x1:=xc+round(2.8*epaisseur);y1:=yc-(2*epaisseur); - x2:=xc+(4*epaisseur); - x3:=xc+(1*epaisseur);y3:=yc+(epaisseur); - x4:=xc-round(0.2*epaisseur);y4:=y3; - polygon([point(x1,y1),point(x2,y1),point(x3,y3),point(x4,y4)]); + if not affposfil then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.width:=1; + x1:=xc+round(2.8*epaisseur);y1:=yc-(2*epaisseur); + x2:=xc+(4*epaisseur); + x3:=xc+(1*epaisseur);y3:=yc+(epaisseur); + x4:=xc-round(0.2*epaisseur);y4:=y3; + polygon([point(x1,y1),point(x2,y1),point(x3,y3),point(x4,y4)]); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(xf,y0);LineTo(x0,yf); + end; end; end; end; @@ -8316,28 +9448,48 @@ begin if (position=const_Devie) then begin - // effacement du morceau - pen.width:=1; - x1:=xc-2*epaisseur;y1:=yc-(3*epaisseur); - x2:=xc-(epaisseur div 2);y2:=yc+epaisseur; - pen.color:=fond; - Brush.Color:=fond; - r:=rect(x1,y1,x2,y2); - rectangle(r); + if not(affPosFil) then + begin + // effacement du morceau + pen.width:=1; + x1:=xc-2*epaisseur;y1:=yc-(3*epaisseur); + x2:=xc-(epaisseur div 2);y2:=yc+epaisseur; + pen.color:=fond; + Brush.Color:=fond; + r:=rect(x1,y1,x2,y2); + rectangle(r); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(xf,yf);lineTo(x0,y0); + end; end; if position=const_droit then begin - // effacement du morceau - pen.Width:=1; - x1:=xc-round(1.3*epaisseur);y1:=yc-(2*epaisseur) ; - x2:=xc+round(0.6*epaisseur);y2:=y1; - x3:=xc+round(2.5*epaisseur);y3:=yc+(epaisseur div 2); - x4:=xc+round(1.2*epaisseur);y4:=y3; - pen.color:=fond; - Brush.Color:=fond; - Polygon([point(x1,y1),Point(x2,y2),Point(x3,y3),Point(x4,y4)]); - end; + if not(affPosFil) then + begin + // effacement du morceau + pen.Width:=1; + x1:=xc-round(1.3*epaisseur);y1:=yc-(2*epaisseur) ; + x2:=xc+round(0.6*epaisseur);y2:=y1; + x3:=xc+round(2.5*epaisseur);y3:=yc+(epaisseur div 2); + x4:=xc+round(1.2*epaisseur);y4:=y3; + pen.color:=fond; + Brush.Color:=fond; + Polygon([point(x1,y1),Point(x2,y2),Point(x3,y3),Point(x4,y4)]); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(xf,yf);LineTo(xc,yc);LineTo(xc,y0); + end; + end; end; end; @@ -8440,29 +9592,49 @@ begin if (position=const_Devie) then begin - // effacement du morceau - pen.width:=1; - x1:=xc-round(1.5*epaisseur);y1:=yc-round(2.5*epaisseur); - x2:=xc-round(0.6*epaisseur);y2:=y1; - x3:=xc+round(1.3*epaisseur);y3:=yc+2*epaisseur; - x4:=xc+round(0.4*epaisseur);y4:=y3; - pen.color:=fond; - Brush.Color:=fond; - r:=rect(x1,y1,x2,y2); - Polygon([point(x1,y1),Point(x2,y2),Point(x3,y3),Point(x4,y4)]); + if not(AffPosFil) then + begin + // effacement du morceau + pen.width:=1; + x1:=xc-round(1.5*epaisseur);y1:=yc-round(2.5*epaisseur); + x2:=xc-round(0.6*epaisseur);y2:=y1; + x3:=xc+round(1.3*epaisseur);y3:=yc+2*epaisseur; + x4:=xc+round(0.4*epaisseur);y4:=y3; + pen.color:=fond; + Brush.Color:=fond; + r:=rect(x1,y1,x2,y2); + Polygon([point(x1,y1),Point(x2,y2),Point(x3,y3),Point(x4,y4)]); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(xf,yf);LineTo(xc+round(4*FrxGlob[indexTCO]),yc);LineTo(xc,y0); + end; end; if position=const_droit then begin - // effacement du morceau - pen.Width:=1; - x1:=xc-round(1.3*epaisseur);y1:=yc-(2*epaisseur); - x2:=xc+round(0.9*epaisseur);y2:=y1; - x3:=xc+round(3.5*epaisseur);y3:=yc+2*epaisseur; - x4:=xc+round(2.9*epaisseur);y4:=y3; - pen.color:=fond; - Brush.Color:=fond; - Polygon([point(x1,y1),Point(x2,y2),Point(x3,y3),Point(x4,y4)]); + if not(AffPosFil) then + begin + // effacement du morceau + pen.Width:=1; + x1:=xc-round(1.3*epaisseur);y1:=yc-(2*epaisseur); + x2:=xc+round(0.9*epaisseur);y2:=y1; + x3:=xc+round(3.5*epaisseur);y3:=yc+2*epaisseur; + x4:=xc+round(2.9*epaisseur);y4:=y3; + pen.color:=fond; + Brush.Color:=fond; + Polygon([point(x1,y1),Point(x2,y2),Point(x3,y3),Point(x4,y4)]); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(x0,y0);LineTo(xf,yf); + end; end; end; end; @@ -8565,26 +9737,46 @@ begin if (position=const_Devie) then begin - // effacement du morceau - pen.color:=fond; - Brush.Color:=fond; - pen.width:=1; - x1:=xc+round(0.5*epaisseur);y1:=yc-round(3*epaisseur); - x2:=xc+round(1.5*epaisseur);y2:=yc+epaisseur; - polygon([point(x1,y1),point(x2,y1),point(x2,y2),point(x1,y2)]); + if not affposFil then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.width:=1; + x1:=xc+round(0.5*epaisseur);y1:=yc-round(3*epaisseur); + x2:=xc+round(1.5*epaisseur);y2:=yc+epaisseur; + polygon([point(x1,y1),point(x2,y1),point(x2,y2),point(x1,y2)]); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(x0,yf);LineTo(xc,yc);LineTo(xc,y0); + end; end; if position=const_droit then begin - // effacement du morceau - pen.color:=fond; - Brush.Color:=fond; - pen.Width:=1; - x1:=xc-round(0.5*epaisseur);y1:=yc-round(2*epaisseur); - x2:=xc+round(0.5*epaisseur);y2:=y1; - x3:=x2;y3:=yc-round(1.3*epaisseur); - x4:=x1;y4:=yc-round(0.3*epaisseur); - polygon([point(x1,y1),point(x2,y2),point(x3,y3),point(x4,y4)]); + if not affposfil then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.Width:=1; + x1:=xc-round(0.5*epaisseur);y1:=yc-round(2*epaisseur); + x2:=xc+round(0.5*epaisseur);y2:=y1; + x3:=x2;y3:=yc-round(1.3*epaisseur); + x4:=x1;y4:=yc-round(0.3*epaisseur); + polygon([point(x1,y1),point(x2,y2),point(x3,y3),point(x4,y4)]); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(x0,yf);LineTo(xf,y0); + end; end; end; end; @@ -8687,28 +9879,48 @@ begin if (position=const_Devie) then begin - // effacement du morceau - pen.color:=fond; - Brush.Color:=fond; - pen.width:=1; - x1:=xc+round(0.1*epaisseur);y1:=yc-round(1*epaisseur); - x2:=xc+round(2*epaisseur);y2:=y1; - x3:=xc-round(0.5*epaisseur);y3:=yc+round(3*epaisseur); - x4:=xc-round(2*epaisseur);y4:=y3; - polygon([point(x1,y1),point(x2,y2),point(x3,y3),point(x4,y4)]); + if not affPosFil then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.width:=1; + x1:=xc+round(0.1*epaisseur);y1:=yc-round(1*epaisseur); + x2:=xc+round(2*epaisseur);y2:=y1; + x3:=xc-round(0.5*epaisseur);y3:=yc+round(3*epaisseur); + x4:=xc-round(2*epaisseur);y4:=y3; + polygon([point(x1,y1),point(x2,y2),point(x3,y3),point(x4,y4)]); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(x0,yf);LineTo(xc-round(6*frxGlob[indexTCO]),yc);LineTo(xc,y0); + end; end; if position=const_droit then begin - // effacement du morceau - pen.color:=fond; - Brush.Color:=fond; - pen.Width:=1; - x1:=xc-round(2.3*epaisseur);y1:=yc-round(2*epaisseur); - x2:=xc+round(epaisseur);y2:=y1; - x3:=x2;y3:=yc-round(2*epaisseur); - x4:=x1;y4:=yc+round(1.1*epaisseur); - polygon([point(x1,y1),point(x2,y2),point(x3,y3),point(x4,y4)]); + if not affposfil then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.Width:=1; + x1:=xc-round(2.3*epaisseur);y1:=yc-round(2*epaisseur); + x2:=xc+round(epaisseur);y2:=y1; + x3:=x2;y3:=yc-round(2*epaisseur); + x4:=x1;y4:=yc+round(1.1*epaisseur); + polygon([point(x1,y1),point(x2,y2),point(x3,y3),point(x4,y4)]); + end + else + begin + pen.color:=fond; + Brush.Color:=fond; + pen.width:=epaisseur div 2; + moveTo(x0,yf);LineTo(xf,y0); + end; end; end; end; @@ -9714,9 +10926,9 @@ begin xt:=0;yt:=0; if Bimage=2 then begin xt:=LargeurCell[indexTCO] div 2;yt:=1;end; if Bimage=3 then begin xt:=3;yt:=hauteurCell[indexTCO]-round(18*fryGlob[indexTCO]);end; - if Bimage=4 then begin xt:=3;yt:=1;end; + if Bimage=4 then begin xt:=10*round(frxGlob[indexTCO]);yt:=1;end; if Bimage=5 then begin xt:=3;yt:=hauteurCell[indexTCO]-round(18*fryGlob[indexTCO]);end; - if Bimage=12 then begin xt:=3;yt:=hauteurCell[indexTCO]-round(18*fryGlob[indexTCO]);end; + if Bimage=12 then begin xt:=round(35*frxGlob[indexTCO]);yt:=2;end; if Bimage=13 then begin xt:=LargeurCell[indexTCO]-round(30*frxGlob[indexTCO]);yt:=hauteurCell[indexTCO]-round(15*fryGlob[indexTCO]);end; if Bimage=14 then begin xt:=LargeurCell[indexTCO]-round(30*frxGlob[indexTCO]);yt:=1;end; if Bimage=15 then begin xt:=3;yt:=1;end; @@ -9725,9 +10937,9 @@ begin if Bimage=23 then begin xt:=round(33*frxGlob[indexTCO]);yt:=round(35*fryGlob[indexTCO]);end; if Bimage=24 then begin xt:=LargeurCell[indexTCO]-round(20*frxGlob[indexTCO]);yt:=hauteurCell[indexTCO]-round(15*fryGlob[indexTCO]);end; if Bimage=25 then begin xt:=round(34*frxGlob[indexTCO]);yt:=round(8*fryGlob[indexTCO]);end; - if Bimage=26 then begin xt:=3;yt:=hauteurCell[indexTCO]-round(15*fryGlob[indexTCO]);end; + if Bimage=26 then begin xt:=round(35*frxGlob[indexTCO]);yt:=hauteurCell[indexTCO]-round(15*fryGlob[indexTCO]);end; if Bimage=27 then begin xt:=3;yt:=1;end; - if Bimage=28 then begin xt:=3;yt:=1;end; + if Bimage=28 then begin xt:=round(35*frxGlob[indexTCO]);yt:=1;end; if Bimage=29 then begin xt:=LargeurCell[indexTCO] div 2;yt:=1;end; if Bimage=32 then begin xt:=3;yt:=1;end; if Bimage=33 then begin xt:=3;yt:=hauteurCell[indexTCO]-round(15*fryGlob[indexTCO]);end; @@ -10204,6 +11416,7 @@ procedure TFormTCO.FormCreate(Sender: TObject); var s : string; begin NB:=false; + if affevt or (debug=1) then Affiche('FormTCO'+intToSTR(indexTCOCreate)+' create',clLime); procetape('Création fenêtre TCO'); //Screen.OnActiveControlChange := ActiveControlChanged; @@ -10217,6 +11430,7 @@ begin end; {$IFEND} + affPosFil:=true; visible:=false; // ne s'affiche pas par défaut et évite l'effet fenetre fantome. ClTexte:=$00FF00; clFondCantonV:=$206020; @@ -10556,12 +11770,13 @@ end; // =11 : det1=indexcanton det2=direction - renvoie les éléments adjacent du canton dans la direction indiquée dans xCanton et tel1 // =12 : det1 = détecteur de départ - renvoie l'élément sursuivant (peut être un aiguillage)dans la direction demandée dans xCanton et tel1 // direction: 1=gauche 2=droite 3=bas 4=haut +// =13 : det1=adresse de l'élément TypEL : type de l'élément, s'arrête au suivant suivant direction // Ne nécessite pas que les aiguillages en talon soient bien positionnés entre det1 et det2 // PosAig = False:teste toutes les routes en récursif les aiguillages en pointe // True: les aiguillages en pointe doivent être positionnés // en sortie : true si det2 a été trouvé // -function zone_tco(indexTCO,det1,det2,train,adrTrain,mode: integer;posAig : boolean) : boolean; +function zone_tco_gx(indexTCO,det1: integer;typEL : tequipement;det2,train,adrTrain,mode: integer;posAig : boolean) : boolean; var i,ir,adresse,But,Bimage,direction,ancienX,ancienY,x,y,xn,yn,Xdet1,yDet1,iteration,indexIr,AdrTr, NbTrouve,AdrTr1,adrTr2 : integer; memtrouve,sortir,indextrouve : boolean; @@ -10660,6 +11875,7 @@ var i,ir,adresse,But,Bimage,direction,ancienX,ancienY,x,y,xn,yn,Xdet1,yDet1,iter // spécial mode 11 et 12 nepasfaire:=(mode=12) and (adresse<>0) and (adresse<>det1); nepasfaire:=(mode=11) and (adresse<>0) or nepasfaire; + nepasfaire:=(mode=13) and (adresse<>0) and (adresse<>det1) or nepasfaire; if not(nepasFaire) then case Bimage of @@ -10884,35 +12100,69 @@ var i,ir,adresse,But,Bimage,direction,ancienX,ancienY,x,y,xn,yn,Xdet1,yDet1,iter if (mdl=tjs) or (mdl=tjd) then begin // tjd ou tjs - if ancienXx) and not(Memtrouve) then // on va à gauche - begin - // essayer vers O - ancienX:=x;ancienY:=y; - x:=x-1; - el_tco(ancienx,ancienY,x,y,train,ir); - if not(memtrouve) then + + if (ancienX>x) and (ancienYy) then // on va au NE en mode 13 + begin + ancienX:=x;ancienY:=y; + inc(x);dec(y); + el_tco(ancienx,ancienY,x,y,train,ir); + end; + + if (ancienX>x) and (ancienY=y) then // on va au O en mode 13 + begin + ancienX:=x;ancienY:=y; + dec(x); + el_tco(ancienx,ancienY,x,y,train,ir); + end; + end + + else + begin + if ancienXx) and not(Memtrouve) then // on va à gauche + begin + // essayer vers O + ancienX:=x;ancienY:=y; + x:=x-1; + el_tco(ancienx,ancienY,x,y,train,ir); + if not(memtrouve) then + begin + // essai vers SO + AncienY:=y; + AncienX:=x+1; + y:=y+1;x:=x; + el_tco(ancienx,ancienY,x,y,train,ir); + end; + end; end; end; end; @@ -10943,36 +12193,70 @@ var i,ir,adresse,But,Bimage,direction,ancienX,ancienY,x,y,xn,yn,Xdet1,yDet1,iter if (mdl=tjs) or (mdl=tjd) then begin // tjd ou tjs - if ancienXx) and not(Memtrouve) then // on va à gauche - begin - // essayer vers O - ancienX:=x;ancienY:=y; - x:=x-1; - el_tco(ancienx,ancienY,x,y,train,ir); - if not(memtrouve) then - begin - // essai vers NO - AncienY:=y; - AncienX:=x+1; - y:=y-1;x:=x; + ancienX:=x;ancienY:=y; + x:=x+1; el_tco(ancienx,ancienY,x,y,train,ir); end; - end; + + if (ancienXx) and (ancienY>y) then // on va au NO en mode 13 + begin + ancienX:=x;ancienY:=y; + dec(x);dec(y); + el_tco(ancienx,ancienY,x,y,train,ir); + end; + + if (ancienX>x) and (ancienY=y) then // on va au O en mode 13 + begin + ancienX:=x;ancienY:=y; + dec(x); + el_tco(ancienx,ancienY,x,y,train,ir); + end; + end + + else + begin + if (ancienXx) and not(Memtrouve)) then // on va à gauche + begin + // essayer vers O + ancienX:=x;ancienY:=y; + x:=x-1; + el_tco(ancienx,ancienY,x,y,train,ir); + if not(memtrouve) then + begin + // essai vers NO + AncienY:=y; + AncienX:=x+1; + y:=y-1;x:=x; + el_tco(ancienx,ancienY,x,y,train,ir); + end; + end; + end; end; end; @@ -11004,35 +12288,68 @@ var i,ir,adresse,But,Bimage,direction,ancienX,ancienY,x,y,xn,yn,Xdet1,yDet1,iter // tjd ou tjs if (mdl=tjd) or (mdl=tjs) then begin - if ancienYy) then // on va à N en mode 13 begin - // essai vers SO - AncienY:=y-1; - AncienX:=x; - x:=x-1; + ancienX:=x;ancienY:=y; + dec(y); el_tco(ancienx,ancienY,x,y,train,ir); end; - end; - if (ancienY>y) and not(Memtrouve) then // on monte - begin - // essayer vers N - ancienX:=x;ancienY:=y; - y:=y-1; - el_tco(ancienx,ancienY,x,y,train,ir); - if not(memtrouve) then + + if (ancienX>x) and (ancienYy) then // on va au NE en mode 13 + begin + ancienX:=x;ancienY:=y; + inc(x);dec(y); + el_tco(ancienx,ancienY,x,y,train,ir); + end; + + if (ancienX=x) and (ancienYy) and not(Memtrouve) then // on monte + begin + // essayer vers N + ancienX:=x;ancienY:=y; + y:=y-1; + el_tco(ancienx,ancienY,x,y,train,ir); + if not(memtrouve) then + begin + // essai vers NE + AncienY:=y+1; + AncienX:=x; + x:=x+1; + el_tco(ancienx,ancienY,x,y,train,ir); + end; + end; end; end; end; @@ -11079,56 +12396,90 @@ var i,ir,adresse,But,Bimage,direction,ancienX,ancienY,x,y,xn,yn,Xdet1,yDet1,iter // tjd ou croisement 25 : begin - mdl:=rien; - if adresse<>0 then + mdl:=rien; + if adresse<>0 then + begin + j:=Index_Aig(adresse); + mdl:=aiguillage[j].modele; + // tjd ou tjs + if (mdl=tjd) or (mdl=tjs) then + begin + if (mode=13) then begin - j:=Index_Aig(adresse); - mdl:=aiguillage[j].modele; - // tjd ou tjs - if (mdl=tjd) or (mdl=tjs) then + if (ancienX=x) and (ancienYx) and (ancienY>y) then // on va au NO en mode 13 + begin + ancienX:=x;ancienY:=y; + dec(x);dec(y); + el_tco(ancienx,ancienY,x,y,train,ir); + end; + + if (ancienX=x) and (ancienY>y) then // on va au N en mode 13 + begin + ancienX:=x;ancienY:=y; + dec(y); + el_tco(ancienx,ancienY,x,y,train,ir); + end; + end + else + + begin + if ancienYy) and not(Memtrouve) then // on monte + end; + if (ancienY>y) and not(Memtrouve) then // on monte + begin + // essayer vers N + ancienX:=x;ancienY:=y; + y:=y-1; + el_tco(ancienx,ancienY,x,y,train,ir); + if not(memtrouve) then begin - // essayer vers N - ancienX:=x;ancienY:=y; - y:=y-1; + // essai vers NO + AncienY:=y+1; + AncienX:=x; + x:=x-1; el_tco(ancienx,ancienY,x,y,train,ir); - if not(memtrouve) then - begin - // essai vers NO - AncienY:=y+1; - AncienX:=x; - x:=x-1; - el_tco(ancienx,ancienY,x,y,train,ir); - end; end; end; end; - if (adresse=0) or (mdl=crois) then - // croisement - begin - if DebugTCO then AfficheDebug('Croisement',clyellow); - if (ancienXx) and (ancienY>Y) then begin xn:=x-1;yn:=yn-1;end; - if (ancienX=x) and (ancienYY) then begin xn:=x;yn:=y-1;end; - end; - if (mdl=aig) then + end; + end; + if (adresse=0) or (mdl=crois) then + // croisement + begin + if DebugTCO then AfficheDebug('Croisement',clyellow); + if (ancienXx) and (ancienY>Y) then begin xn:=x-1;yn:=yn-1;end; + if (ancienX=x) and (ancienYY) then begin xn:=x;yn:=y-1;end; + end; + if (mdl=aig) then begin Affiche('Erreur 51 TCO : la cellule '+intToSTR(x)+','+intToSTR(y)+' d''adresse '+intToSTR(Adresse)+' est décrite comme un aiguillage ',clred); Affiche('mais la cellule représente un croisement ou une TJD/S',clred); @@ -11316,7 +12667,10 @@ var i,ir,adresse,But,Bimage,direction,ancienX,ancienY,x,y,xn,yn,Xdet1,yDet1,iter inc(i); // éléments adj if (mode=11) and ( (adresse<>0) or (tco[indexTCO,x,y].buttoir<>0)) then sortir:=true; - if (mode=12) and ( ((adresse<>0) and (adresse<>det1)) or (tco[indexTCO,x,y].buttoir<>0)) then sortir:=true; + if (mode=12) and ( ((adresse<>0) and (adresse<>det1)) or (tco[indexTCO,x,y].buttoir<>0)) then sortir:=true; + + if (mode=13) and ( ((adresse<>0) and (adresse<>det1)) or (tco[indexTCO,x,y].buttoir<>0)) then begin + sortir:=true;memtrouve:=true;end; if (adresse=det2) and (adresse<>0) then memTrouve:=true; if (adresse=0) and (det2=0) and (but<>0) then memTrouve:=true; @@ -11342,7 +12696,7 @@ var i,ir,adresse,But,Bimage,direction,ancienX,ancienY,x,y,xn,yn,Xdet1,yDet1,iter end; -// Début de la procédure zone_tco, qui affiche le tracé +// Début de la procédure zone_tco_gx, qui affiche le tracé begin if debugTCO then begin @@ -11394,6 +12748,11 @@ begin begin trouve_El(indexTCO,det1,det,x,y); end; + if mode=13 then + begin + if (typEL=tjd) or (typEL=tjs) then typEL:=aig; + trouve_El(indexTCO,det1,TypEl,x,y); + end; xn:=x;yn:=y; ir:=1; // index de la route du tco @@ -11435,20 +12794,40 @@ begin begin ancieny:=y+1; ancienx:=x; end; end; - // uniquement modes 11/12: recherche élément à gauche - 5 : begin + // uniquement modes 11/12/13: recherche élément à gauche + SensTCO_O : begin ancienx:=x+1; ancieny:=y; end; - // uniquement mode 11/12: recherche élément à droite - 6 : begin + // uniquement mode 11/12/13: recherche élément à droite + SensTCO_E : begin ancienx:=x-1; ancieny:=y; end; - // uniquement mode 11: recherche élément en haut - 7 : begin + // uniquement mode 11/12/13: recherche élément NO + SensTCO_NO : begin + ancienx:=x+1; ancieny:=y+1; + end; + + // uniquement mode 11/12/13: recherche élément NE + SensTCO_NE : begin + ancienx:=x-1; ancieny:=y+1; + end; + + // uniquement mode 11/12/13: recherche élément SE + SensTCO_SE : begin + ancienx:=x-1; ancieny:=y-1; + end; + + // uniquement mode 11/12/13: recherche élément SO + SensTCO_SO : begin + ancienx:=x+1; ancieny:=y-1; + end; + + // uniquement mode 11/12/13: recherche élément en haut + SensTCO_N : begin ancienx:=x; ancieny:=y+1; end; - // uniquement mode 11: recherche élément en bas - 8 : begin + // uniquement mode 11/12/13: recherche élément en bas + SensTCO_S : begin ancienx:=x; ancieny:=y-1; end; end; @@ -11473,7 +12852,7 @@ begin if isAigTCO(Bimage) then Tel1:=aig else tel1:=det; if but<>0 then tel1:=Buttoir; end; - if (mode=12) and (adresse<>det1) then + if ((mode=12) or (mode=13)) and (adresse<>det1) then begin Xcanton:=adresse; if isAigTCO(Bimage) then Tel1:=aig else tel1:=det; @@ -11515,6 +12894,18 @@ begin end; end; +// fonction appellable en modes 1 2 3 10 11 12 +function zone_tco(indexTCO,det1,det2,train,adrTrain,mode: integer;posAig : boolean) : boolean; overload; +begin + result:=zone_tco_gx(indexTCO,det1,det,det2,train,adrTrain,mode,posAig); +end; + +// fonction appellable en mode 13 +function zone_tco(indexTCO,adr : integer;typEl : tequipement;sens,mode: integer;posAig : boolean) : boolean; overload; +begin + result:=zone_tco_gx(indexTCO,adr,typEL,sens,0,0,mode,posAig); +end; + // positionne l'icone du groupe G2 (signal, quai, action) procedure positionne_icone_G2(IndexTCO : integer;ip : timage;lbl : tlabel;i : integer); @@ -11814,6 +13205,7 @@ begin positionne(indexTCO); renseigne_tous_cantons; + renseigne_TJDs; FormInit[indexTCO]:=true; end; @@ -12743,7 +14135,7 @@ end; procedure end_Drag(icone,x,y : integer;Sender, Target: TObject); var s : string; -indexTCO,i,xclic,Yclic,bim,nc,maxi : integer; +indexTCO,i,xclic,Yclic,bim,nc,maxi,libre : integer; begin if not(Target is TImage) then exit; s:=(Target as TImage).Name; @@ -12872,13 +14264,18 @@ begin end; // pour le numéro de canton, - maxi:=0; + maxi:=0; Libre:=0; for nc:=1 to nCantons do begin if canton[nc].numero>maxi then maxi:=canton[nc].numero; + if (nc>=2) and (nccanton[nc+1].numero then + begin + libre:=canton[nc].numero+1; + for i:=1 to nCantons do if canton[i].numero=Libre then Libre:=0; + end; end; inc(maxi); - + if libre<>0 then Maxi:=Libre; inc(Ncantons); canton[Ncantons].horizontal:=Bim=1; diff --git a/selection_train.pas b/selection_train.pas index 52161ff..58b9117 100644 --- a/selection_train.pas +++ b/selection_train.pas @@ -326,6 +326,7 @@ begin ColWidths[6]:=30; ColWidths[7]:=35; + Cells[0,0]:='N°'; Cells[1,0]:='Icône'; Cells[2,0]:='Nom du train'; Cells[3,0]:='Affectation'+#13+'au canton'; @@ -341,6 +342,7 @@ begin begin with StringGridTrains do begin + cells[0,i]:=intToSTR(i); cells[2,i]:=trains[i].nom_train; end; end; diff --git a/versions.txt b/versions.txt index 8dae26b..76e51fc 100644 --- a/versions.txt +++ b/versions.txt @@ -259,4 +259,8 @@ version 9.0 : Pilotage des nouveaux d Pilotage des trains depuis le TCO Proposition des routes possibles depuis un train sur un détecteur de départ vers un détecteur d'arrivée sur le TCO. Pilotage des accessoires sans accusé de réception, ce qui fluidifie le trafic XpressNet - +version 9.1 : Représentation de la position des TJD dans les TCOs. + Corrections sur les TJD 2 états. + Correction connection en mode autonome aux interfaces pour la version D11. + Correction pilotage décodeur LEB ancienne version. +