diff --git a/Importation.dfm b/Importation.dfm index cfd8a4a..552adde 100644 --- a/Importation.dfm +++ b/Importation.dfm @@ -35,7 +35,10 @@ object FormImportation: TFormImportation Top = 32 Width = 113 Height = 17 + Hint = 'Affiche le debug importation en page Debug' Caption = 'Debug importation' + ParentShowHint = False + ShowHint = True TabOrder = 0 OnClick = CheckDebugAnalyseClick end @@ -44,7 +47,10 @@ object FormImportation: TFormImportation Top = 56 Width = 97 Height = 17 + Hint = 'Affiche le debug branches en page Debug' Caption = 'Debug branches' + ParentShowHint = False + ShowHint = True TabOrder = 1 OnClick = CheckDebugBranchesClick end diff --git a/Notice d'utilisation des signaux_complexes_GL_V8.21.pdf b/Notice d'utilisation des signaux_complexes_GL_V8.24.pdf similarity index 78% rename from Notice d'utilisation des signaux_complexes_GL_V8.21.pdf rename to Notice d'utilisation des signaux_complexes_GL_V8.24.pdf index b9e6454..ffafd27 100644 Binary files a/Notice d'utilisation des signaux_complexes_GL_V8.21.pdf and b/Notice d'utilisation des signaux_complexes_GL_V8.24.pdf differ diff --git a/Signaux_complexes_GL.cfg b/Signaux_complexes_GL.cfg index 8d97c47..bcc5ab2 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 845db12..c53d8d5 100644 --- a/Signaux_complexes_GL.dof +++ b/Signaux_complexes_GL.dof @@ -17,8 +17,8 @@ M=0 N=1 O=0 P=1 -Q=0 -R=0 +Q=1 +R=1 S=0 T=0 U=0 diff --git a/Signaux_complexes_GL.map b/Signaux_complexes_GL.map index 6aff3a5..da5ce6a 100644 --- a/Signaux_complexes_GL.map +++ b/Signaux_complexes_GL.map @@ -1,104 +1,104 @@ Start Length Name Class - 0001:00000000 00160C9CH .text CODE - 0002:00000000 00002C00H .data DATA - 0002:00002C00 041A0B91H .bss BSS + 0001:00000000 0018EDC8H .text CODE + 0002:00000000 00002C10H .data DATA + 0002:00002C10 041C8A05H .bss BSS Detailed map of segments - 0001:00000000 00005DFB C=CODE S=.text G=(none) M=System ACBP=A9 - 0001:00005DFC 00000140 C=CODE S=.text G=(none) M=SysInit ACBP=A9 - 0001:00005F3C 00000108 C=CODE S=.text G=(none) M=Types ACBP=A9 - 0001:00006044 00000EF8 C=CODE S=.text G=(none) M=Windows ACBP=A9 - 0001:00006F3C 00000038 C=CODE S=.text G=(none) M=Messages ACBP=A9 - 0001:00006F74 00000338 C=CODE S=.text G=(none) M=SysConst ACBP=A9 - 0001:000072AC 00006E28 C=CODE S=.text G=(none) M=SysUtils ACBP=A9 - 0001:0000E0D4 0000081B C=CODE S=.text G=(none) M=VarUtils ACBP=A9 - 0001:0000E8F0 00008042 C=CODE S=.text G=(none) M=Variants ACBP=A9 - 0001:00016934 00000198 C=CODE S=.text G=(none) M=RTLConsts ACBP=A9 - 0001:00016ACC 0000083C C=CODE S=.text G=(none) M=TypInfo ACBP=A9 - 0001:00017308 00000358 C=CODE S=.text G=(none) M=ActiveX ACBP=A9 - 0001:00017660 0000A236 C=CODE S=.text G=(none) M=Classes ACBP=A9 - 0001:00021898 00000370 C=CODE S=.text G=(none) M=Consts ACBP=A9 - 0001:00021C08 00009BFB C=CODE S=.text G=(none) M=Graphics ACBP=A9 - 0001:0002B804 00000124 C=CODE S=.text G=(none) M=Math ACBP=A9 - 0001:0002B928 000002B8 C=CODE S=.text G=(none) M=Contnrs ACBP=A9 - 0001:0002BBE0 00000198 C=CODE S=.text G=(none) M=CommCtrl ACBP=A9 - 0001:0002BD78 00000787 C=CODE S=.text G=(none) M=MultiMon ACBP=A9 - 0001:0002C500 00000038 C=CODE S=.text G=(none) M=Imm ACBP=A9 - 0001:0002C538 00000FF8 C=CODE S=.text G=(none) M=HelpIntfs ACBP=A9 - 0001:0002D530 00000058 C=CODE S=.text G=(none) M=WinSpool ACBP=A9 - 0001:0002D588 000010C8 C=CODE S=.text G=(none) M=Printers ACBP=A9 - 0001:0002E650 0000031F C=CODE S=.text G=(none) M=FlatSB ACBP=A9 - 0001:0002E970 000001A4 C=CODE S=.text G=(none) M=SyncObjs ACBP=A9 - 0001:0002EB14 000009BB C=CODE S=.text G=(none) M=UxTheme ACBP=A9 - 0001:0002F4D0 00000038 C=CODE S=.text G=(none) M=RichEdit ACBP=A9 - 0001:0002F508 00000038 C=CODE S=.text G=(none) M=ToolWin ACBP=A9 - 0001:0002F540 00000040 C=CODE S=.text G=(none) M=ShellAPI ACBP=A9 - 0001:0002F580 00000038 C=CODE S=.text G=(none) M=RegStr ACBP=A9 - 0001:0002F5B8 00000058 C=CODE S=.text G=(none) M=WinInet ACBP=A9 - 0001:0002F610 00000038 C=CODE S=.text G=(none) M=UrlMon ACBP=A9 - 0001:0002F648 0000006C C=CODE S=.text G=(none) M=ShlObj ACBP=A9 - 0001:0002F6B4 00000060 C=CODE S=.text G=(none) M=CommDlg ACBP=A9 - 0001:0002F714 00000038 C=CODE S=.text G=(none) M=Dlgs ACBP=A9 - 0001:0002F74C 000036D1 C=CODE S=.text G=(none) M=Dialogs ACBP=A9 - 0001:00032E20 00004ADA C=CODE S=.text G=(none) M=ExtCtrls ACBP=A9 - 0001:000378FC 00000090 C=CODE S=.text G=(none) M=ComStrs ACBP=A9 - 0001:0003798C 000007A0 C=CODE S=.text G=(none) M=Clipbrd ACBP=A9 - 0001:0003812C 00000128 C=CODE S=.text G=(none) M=StrUtils ACBP=A9 - 0001:00038254 00003821 C=CODE S=.text G=(none) M=Buttons ACBP=A9 - 0001:0003BA78 00000038 C=CODE S=.text G=(none) M=ExtDlgs ACBP=A9 - 0001:0003BAB0 00000068 C=CODE S=.text G=(none) M=IniFiles ACBP=A9 - 0001:0003BB18 00000690 C=CODE S=.text G=(none) M=Registry ACBP=A9 - 0001:0003C1A8 0000006C C=CODE S=.text G=(none) M=Mapi ACBP=A9 - 0001:0003C214 00000058 C=CODE S=.text G=(none) M=ExtActns ACBP=A9 - 0001:0003C26C 00000038 C=CODE S=.text G=(none) M=ListActns ACBP=A9 - 0001:0003C2A4 00009948 C=CODE S=.text G=(none) M=ComCtrls ACBP=A9 - 0001:00045BEC 00000EA0 C=CODE S=.text G=(none) M=Themes ACBP=A9 - 0001:00046A8C 0000C698 C=CODE S=.text G=(none) M=StdCtrls ACBP=A9 - 0001:00053124 00000168 C=CODE S=.text G=(none) M=StdActns ACBP=A9 - 0001:0005328C 00000D1F C=CODE S=.text G=(none) M=WinHelpViewer ACBP=A9 - 0001:00053FAC 00011403 C=CODE S=.text G=(none) M=Controls ACBP=A9 - 0001:000653B0 00001292 C=CODE S=.text G=(none) M=ActnList ACBP=A9 - 0001:00066644 00001B9C C=CODE S=.text G=(none) M=ImgList ACBP=A9 - 0001:000681E0 000066E1 C=CODE S=.text G=(none) M=Menus ACBP=A9 - 0001:0006E8C4 0000CEFC C=CODE S=.text G=(none) M=Forms ACBP=A9 - 0001:0007B7C0 00000060 C=CODE S=.text G=(none) M=ComConst ACBP=A9 - 0001:0007B820 00001259 C=CODE S=.text G=(none) M=ComObj ACBP=A9 - 0001:0007CA7C 00000038 C=CODE S=.text G=(none) M=StdVCL ACBP=A9 - 0001:0007CAB4 00001793 C=CODE S=.text G=(none) M=AxCtrls ACBP=A9 - 0001:0007E248 00000060 C=CODE S=.text G=(none) M=OleConst ACBP=A9 - 0001:0007E2A8 00003519 C=CODE S=.text G=(none) M=OleCtrls ACBP=A9 - 0001:000817C4 00000050 C=CODE S=.text G=(none) M=JConsts ACBP=A9 - 0001:00081814 000133EC C=CODE S=.text G=(none) M=jpeg ACBP=A9 - 0001:00094C00 00000314 C=CODE S=.text G=(none) M=TlHelp32 ACBP=A9 - 0001:00094F14 000000D8 C=CODE S=.text G=(none) M=WinSock ACBP=A9 - 0001:00094FEC 00001F40 C=CODE S=.text G=(none) M=ScktComp ACBP=A9 - 0001:00096F2C 000008EA C=CODE S=.text G=(none) M=OleServer ACBP=A9 - 0001:00097818 000005A0 C=CODE S=.text G=(none) M=MSCommLib_TLB ACBP=A9 - 0001:00097DB8 00000040 C=CODE S=.text G=(none) M=MMSystem ACBP=A9 - 0001:00097DF8 00000038 C=CODE S=.text G=(none) M=Nb30 ACBP=A9 - 0001:00097E30 00000A18 C=CODE S=.text G=(none) M=MaskUtils ACBP=A9 - 0001:00098848 00002108 C=CODE S=.text G=(none) M=Mask ACBP=A9 - 0001:0009A950 0000924C C=CODE S=.text G=(none) M=Grids ACBP=A9 - 0001:000A3B9C 000015B4 C=CODE S=.text G=(none) M=UnitPilote ACBP=A9 - 0001:000A5150 000004D0 C=CODE S=.text G=(none) M=Importation ACBP=A9 - 0001:000A5620 0000FE58 C=CODE S=.text G=(none) M=UnitAnalyseSegCDM ACBP=A9 - 0001:000B5478 000025F4 C=CODE S=.text G=(none) M=UnitConfigTCO ACBP=A9 - 0001:000B7A6C 000009C0 C=CODE S=.text G=(none) M=Unit_Pilote_aig ACBP=A9 - 0001:000B842C 00003450 C=CODE S=.text G=(none) M=UnitConfigCellTCO ACBP=A9 - 0001:000BB87C 0002B264 C=CODE S=.text G=(none) M=UnitTCO ACBP=A9 - 0001:000E6AE0 00002C18 C=CODE S=.text G=(none) M=UnitSR ACBP=A9 - 0001:000E96F8 00002404 C=CODE S=.text G=(none) M=UnitCDF ACBP=A9 - 0001:000EBAFC 000015DB C=CODE S=.text G=(none) M=verif_version ACBP=A9 - 0001:000ED0D8 0000114C C=CODE S=.text G=(none) M=UnitPareFeu ACBP=A9 - 0001:000EE224 00034A3C C=CODE S=.text G=(none) M=UnitConfig ACBP=A9 - 0001:00122C60 00002904 C=CODE S=.text G=(none) M=UnitDebug ACBP=A9 - 0001:00125564 00000C00 C=CODE S=.text G=(none) M=UnitSimule ACBP=A9 - 0001:00126164 00002390 C=CODE S=.text G=(none) M=Unitplace ACBP=A9 - 0001:001284F4 00038318 C=CODE S=.text G=(none) M=UnitPrinc ACBP=A9 - 0001:0016080C 0000048D C=CODE S=.text G=(none) M=Signaux_complexes_GL ACBP=A9 + 0001:00000000 00005E33 C=CODE S=.text G=(none) M=System ACBP=A9 + 0001:00005E34 00000140 C=CODE S=.text G=(none) M=SysInit ACBP=A9 + 0001:00005F74 00000108 C=CODE S=.text G=(none) M=Types ACBP=A9 + 0001:0000607C 00000ED8 C=CODE S=.text G=(none) M=Windows ACBP=A9 + 0001:00006F54 00000038 C=CODE S=.text G=(none) M=Messages ACBP=A9 + 0001:00006F8C 00000338 C=CODE S=.text G=(none) M=SysConst ACBP=A9 + 0001:000072C4 00006E28 C=CODE S=.text G=(none) M=SysUtils ACBP=A9 + 0001:0000E0EC 0000081B C=CODE S=.text G=(none) M=VarUtils ACBP=A9 + 0001:0000E908 0000809A C=CODE S=.text G=(none) M=Variants ACBP=A9 + 0001:000169A4 00000188 C=CODE S=.text G=(none) M=RTLConsts ACBP=A9 + 0001:00016B2C 0000083C C=CODE S=.text G=(none) M=TypInfo ACBP=A9 + 0001:00017368 00000358 C=CODE S=.text G=(none) M=ActiveX ACBP=A9 + 0001:000176C0 0000A236 C=CODE S=.text G=(none) M=Classes ACBP=A9 + 0001:000218F8 00000370 C=CODE S=.text G=(none) M=Consts ACBP=A9 + 0001:00021C68 00009BFB C=CODE S=.text G=(none) M=Graphics ACBP=A9 + 0001:0002B864 00000124 C=CODE S=.text G=(none) M=Math ACBP=A9 + 0001:0002B988 000002B8 C=CODE S=.text G=(none) M=Contnrs ACBP=A9 + 0001:0002BC40 00000198 C=CODE S=.text G=(none) M=CommCtrl ACBP=A9 + 0001:0002BDD8 00000787 C=CODE S=.text G=(none) M=MultiMon ACBP=A9 + 0001:0002C560 00000038 C=CODE S=.text G=(none) M=Imm ACBP=A9 + 0001:0002C598 00000FF8 C=CODE S=.text G=(none) M=HelpIntfs ACBP=A9 + 0001:0002D590 00000058 C=CODE S=.text G=(none) M=WinSpool ACBP=A9 + 0001:0002D5E8 000010C8 C=CODE S=.text G=(none) M=Printers ACBP=A9 + 0001:0002E6B0 0000031F C=CODE S=.text G=(none) M=FlatSB ACBP=A9 + 0001:0002E9D0 000001A4 C=CODE S=.text G=(none) M=SyncObjs ACBP=A9 + 0001:0002EB74 000009BB C=CODE S=.text G=(none) M=UxTheme ACBP=A9 + 0001:0002F530 00000038 C=CODE S=.text G=(none) M=RichEdit ACBP=A9 + 0001:0002F568 00000038 C=CODE S=.text G=(none) M=ToolWin ACBP=A9 + 0001:0002F5A0 00000040 C=CODE S=.text G=(none) M=ShellAPI ACBP=A9 + 0001:0002F5E0 00000038 C=CODE S=.text G=(none) M=RegStr ACBP=A9 + 0001:0002F618 00000058 C=CODE S=.text G=(none) M=WinInet ACBP=A9 + 0001:0002F670 00000038 C=CODE S=.text G=(none) M=UrlMon ACBP=A9 + 0001:0002F6A8 0000006C C=CODE S=.text G=(none) M=ShlObj ACBP=A9 + 0001:0002F714 00000060 C=CODE S=.text G=(none) M=CommDlg ACBP=A9 + 0001:0002F774 00000038 C=CODE S=.text G=(none) M=Dlgs ACBP=A9 + 0001:0002F7AC 000036D1 C=CODE S=.text G=(none) M=Dialogs ACBP=A9 + 0001:00032E80 00004ADA C=CODE S=.text G=(none) M=ExtCtrls ACBP=A9 + 0001:0003795C 00000090 C=CODE S=.text G=(none) M=ComStrs ACBP=A9 + 0001:000379EC 000007A0 C=CODE S=.text G=(none) M=Clipbrd ACBP=A9 + 0001:0003818C 00000128 C=CODE S=.text G=(none) M=StrUtils ACBP=A9 + 0001:000382B4 00003821 C=CODE S=.text G=(none) M=Buttons ACBP=A9 + 0001:0003BAD8 00000038 C=CODE S=.text G=(none) M=ExtDlgs ACBP=A9 + 0001:0003BB10 00000068 C=CODE S=.text G=(none) M=IniFiles ACBP=A9 + 0001:0003BB78 00000068 C=CODE S=.text G=(none) M=Registry ACBP=A9 + 0001:0003BBE0 0000006C C=CODE S=.text G=(none) M=Mapi ACBP=A9 + 0001:0003BC4C 00000058 C=CODE S=.text G=(none) M=ExtActns ACBP=A9 + 0001:0003BCA4 00000038 C=CODE S=.text G=(none) M=ListActns ACBP=A9 + 0001:0003BCDC 00009948 C=CODE S=.text G=(none) M=ComCtrls ACBP=A9 + 0001:00045624 00000EA0 C=CODE S=.text G=(none) M=Themes ACBP=A9 + 0001:000464C4 0000C698 C=CODE S=.text G=(none) M=StdCtrls ACBP=A9 + 0001:00052B5C 00000168 C=CODE S=.text G=(none) M=StdActns ACBP=A9 + 0001:00052CC4 00000D1F C=CODE S=.text G=(none) M=WinHelpViewer ACBP=A9 + 0001:000539E4 00011403 C=CODE S=.text G=(none) M=Controls ACBP=A9 + 0001:00064DE8 00001292 C=CODE S=.text G=(none) M=ActnList ACBP=A9 + 0001:0006607C 00001B9C C=CODE S=.text G=(none) M=ImgList ACBP=A9 + 0001:00067C18 000066E1 C=CODE S=.text G=(none) M=Menus ACBP=A9 + 0001:0006E2FC 0000CEFC C=CODE S=.text G=(none) M=Forms ACBP=A9 + 0001:0007B1F8 00000060 C=CODE S=.text G=(none) M=ComConst ACBP=A9 + 0001:0007B258 00001259 C=CODE S=.text G=(none) M=ComObj ACBP=A9 + 0001:0007C4B4 00000038 C=CODE S=.text G=(none) M=StdVCL ACBP=A9 + 0001:0007C4EC 00001793 C=CODE S=.text G=(none) M=AxCtrls ACBP=A9 + 0001:0007DC80 00000060 C=CODE S=.text G=(none) M=OleConst ACBP=A9 + 0001:0007DCE0 00003519 C=CODE S=.text G=(none) M=OleCtrls ACBP=A9 + 0001:000811FC 00000050 C=CODE S=.text G=(none) M=JConsts ACBP=A9 + 0001:0008124C 000133EC C=CODE S=.text G=(none) M=jpeg ACBP=A9 + 0001:00094638 00000314 C=CODE S=.text G=(none) M=TlHelp32 ACBP=A9 + 0001:0009494C 000000D8 C=CODE S=.text G=(none) M=WinSock ACBP=A9 + 0001:00094A24 00001F40 C=CODE S=.text G=(none) M=ScktComp ACBP=A9 + 0001:00096964 000008EA C=CODE S=.text G=(none) M=OleServer ACBP=A9 + 0001:00097250 000005A0 C=CODE S=.text G=(none) M=MSCommLib_TLB ACBP=A9 + 0001:000977F0 00000040 C=CODE S=.text G=(none) M=MMSystem ACBP=A9 + 0001:00097830 00000038 C=CODE S=.text G=(none) M=Nb30 ACBP=A9 + 0001:00097868 00000A18 C=CODE S=.text G=(none) M=MaskUtils ACBP=A9 + 0001:00098280 00002108 C=CODE S=.text G=(none) M=Mask ACBP=A9 + 0001:0009A388 0000924C C=CODE S=.text G=(none) M=Grids ACBP=A9 + 0001:000A35D4 000015B4 C=CODE S=.text G=(none) M=UnitPilote ACBP=A9 + 0001:000A4B88 000004D0 C=CODE S=.text G=(none) M=Importation ACBP=A9 + 0001:000A5058 00013AFC C=CODE S=.text G=(none) M=UnitAnalyseSegCDM ACBP=A9 + 0001:000B8B54 000025F4 C=CODE S=.text G=(none) M=UnitConfigTCO ACBP=A9 + 0001:000BB148 000009C0 C=CODE S=.text G=(none) M=Unit_Pilote_aig ACBP=A9 + 0001:000BBB08 00003450 C=CODE S=.text G=(none) M=UnitConfigCellTCO ACBP=A9 + 0001:000BEF58 0003CD0C C=CODE S=.text G=(none) M=UnitTCO ACBP=A9 + 0001:000FBC64 000030E4 C=CODE S=.text G=(none) M=UnitSR ACBP=A9 + 0001:000FED48 000027D4 C=CODE S=.text G=(none) M=UnitCDF ACBP=A9 + 0001:0010151C 0003F1C8 C=CODE S=.text G=(none) M=UnitConfig ACBP=A9 + 0001:001406E4 00001803 C=CODE S=.text G=(none) M=verif_version ACBP=A9 + 0001:00141EE8 0000114C C=CODE S=.text G=(none) M=UnitPareFeu ACBP=A9 + 0001:00143034 00002A70 C=CODE S=.text G=(none) M=UnitDebug ACBP=A9 + 0001:00145AA4 00000D2C C=CODE S=.text G=(none) M=UnitSimule ACBP=A9 + 0001:001467D0 00002558 C=CODE S=.text G=(none) M=Unitplace ACBP=A9 + 0001:00148D28 00045C10 C=CODE S=.text G=(none) M=UnitPrinc ACBP=A9 + 0001:0018E938 0000048D C=CODE S=.text G=(none) M=Signaux_complexes_GL ACBP=A9 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 @@ -215,13 +215,13 @@ Detailed map of segments 0002:00007C7C 00041DA4 C=BSS S=.bss G=DGROUP M=UnitTCO ACBP=A9 0002:00049A20 00000010 C=BSS S=.bss G=DGROUP M=UnitSR ACBP=A9 0002:00049A30 00000014 C=BSS S=.bss G=DGROUP M=UnitCDF ACBP=A9 - 0002:00049A44 00000018 C=BSS S=.bss G=DGROUP M=verif_version ACBP=A9 - 0002:00049A5C 00000004 C=BSS S=.bss G=DGROUP M=UnitPareFeu ACBP=A9 - 0002:00049A60 00000450 C=BSS S=.bss G=DGROUP M=UnitConfig ACBP=A9 - 0002:00049EB0 00000028 C=BSS S=.bss G=DGROUP M=UnitDebug ACBP=A9 - 0002:00049ED8 0000000C C=BSS S=.bss G=DGROUP M=UnitSimule ACBP=A9 - 0002:00049EE4 00000008 C=BSS S=.bss G=DGROUP M=Unitplace ACBP=A9 - 0002:00049EEC 04159CA4 C=BSS S=.bss G=DGROUP M=UnitPrinc ACBP=A9 + 0002:00049A44 000004F0 C=BSS S=.bss G=DGROUP M=UnitConfig ACBP=A9 + 0002:00049F34 00000018 C=BSS S=.bss G=DGROUP M=verif_version ACBP=A9 + 0002:00049F4C 00000004 C=BSS S=.bss G=DGROUP M=UnitPareFeu ACBP=A9 + 0002:00049F50 0000002C C=BSS S=.bss G=DGROUP M=UnitDebug ACBP=A9 + 0002:00049F7C 0000000C C=BSS S=.bss G=DGROUP M=UnitSimule ACBP=A9 + 0002:00049F88 00000008 C=BSS S=.bss G=DGROUP M=Unitplace ACBP=A9 + 0002:00049F90 04181A74 C=BSS S=.bss G=DGROUP M=UnitPrinc ACBP=A9 Bound resource files @@ -237,8 +237,8 @@ UnitConfigCellTCO.dfm UnitTCO.dfm UnitSR.dfm UnitCDF.dfm -verif_version.dfm UnitConfig.dfm +verif_version.dfm UnitDebug.dfm UnitSimule.dfm Unitplace.dfm @@ -247,4 +247,4 @@ Signaux_complexes_GL.res Signaux_complexes_GL.drf -Program entry point at 0001:00160B1C +Program entry point at 0001:0018EC48 diff --git a/UnitAnalyseSegCDM.pas b/UnitAnalyseSegCDM.pas index 17425a9..47bd81c 100644 --- a/UnitAnalyseSegCDM.pas +++ b/UnitAnalyseSegCDM.pas @@ -169,7 +169,7 @@ var Segment : array of Tsegment; reducX,reducY,ArcTanHautLargTrain : double; FormAnalyseCDM: TFormAnalyseCDM; sBranche,NomModuleCDM : string; - debugBranche,debugAnalyse,clic,premaff : boolean; + clic,premaff : boolean; Aig_CDM : array[0..NbreMaxiAiguillages] of TAig_CDM; Det_CDM : array[1..500] of integer; FWICImage : tBitmap; @@ -377,8 +377,8 @@ begin s2:=isole_valeur(s,'connect status:'); Segment[nSeg-1].port[nPort-1].connecte:=s2='connected'; - if Segment[nSeg-1].port[nPort-1].typ='dummy_port' then - exit; + if Segment[nSeg-1].port[nPort-1].typ='dummy_port' then exit; + if not(Segment[nSeg-1].port[nPort-1].connecte) then exit; inc(nligne); s:=AnsiLowerCase(lignes[nligne]); @@ -831,9 +831,11 @@ end; // s*l = distance du point au segment function point_Sur_Segment(x,y,x1,y1,x2,y2 : integer): Boolean; var l,r,s : Double; + p : integer; begin Result:=False; - l:=sqrt(((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1))); + p:=((x2-x1)*(x2-x1))+((y2-y1)*(y2-y1)); + l:=sqrt(p); if l<>0 then begin r:=((y1-y)*(y1-y2)-(x1-x)*(x2-x1))/(l*l); @@ -1990,7 +1992,7 @@ end; // fonction récursive // explore le port,segment jusqu'a trouver une adresse d'aiguillage, de croisement, ou de détecteur -// renvoie l'adresse de l'aiguillage ou du détecteur et dans C le port (P D S) +// renvoie l'adresse de l'aiguillage ou du détecteur et dans C le port (P D S ou Z pour un détecteur) function explore_port(seg,port : integer;var c : string) : integer; var i,j,IdSeg,IdPort,NombrePeriph,port1,port2,portSuivant,segSuivant,portLocal, xp,yp,xd,yd,detect,nb_det : integer; @@ -2201,8 +2203,9 @@ begin s:=' Port '+intToSTR(j)+' '; // explorer les ports de l'aiguillage element:=explore_port(numsegment,segment[i].port[j].numero,c); + if length(c)=0 then c:='Z'; - case j of + case j of // j=numéro de port 0 : begin s:=s+'D';Aig_cdm[nAig_cdm].ddroit:=element;if length(c)<>0 then Aig_cdm[nAig_cdm].ddroitB:=c[1];end; 1 : begin s:=s+'S';Aig_cdm[nAig_cdm].dDevie:=element;if length(c)<>0 then Aig_cdm[nAig_cdm].ddevieB:=c[1];end; 2 : begin s:=s+'D';Aig_cdm[nAig_cdm].ADroit:=element;if length(c)<>0 then Aig_cdm[nAig_cdm].aDroitB:=c[1];end; @@ -2315,6 +2318,8 @@ begin // explorer les ports de l'aiguillage element:=explore_port(numsegment,segment[i].port[j].numero,c); + if length(c)=0 then c:='Z'; + s:=s+' Element : '+intToStr(element)+c; if debugAnalyse then AfficheDebug(s,clorange); @@ -2364,6 +2369,7 @@ begin end; end; end; + if nAig_CDM=0 then affiche('Aucun aiguillage avec adresse',clyellow); end; // trouve le port de destination sur un segment en fonction du port d'origine 'port' @@ -2479,6 +2485,13 @@ begin end; end; +// vérifier si un détecteur est dans le champ d'une ligne +// exemple s='A21,533,568,566' det=533 résultat vrai +function presence_detecteur(s : string;det : integer) : boolean; +begin + result:=pos(','+intToSTR(det),s)<>0; +end; + // renvoie le dernier champ d'une chaine séparés par des virgules // s='aa,bb,ccc,ddd,ee' : renvoie ee @@ -2506,13 +2519,14 @@ end; // créée la branche depuis un aiguillage dont un des ports est un détecteur -// indexSeg,port : index su segment et port de départ +// indexSeg,port : index du segment et port de départ // AdrAig : adresse de l'aiguillage qui a servi de départ +// et remplit la branche (sBranche) procedure cree_branche_aig(indexSeg,Indexport,adrAig,NbreMaxiAigRencontres : integer); -var i,j,k,naig,IndexportSuivant,indexSegSuivant,NombrePeriph, +var i,j,k,l,naig,IndexportSuivant,indexSegSuivant,NombrePeriph, detecteur,indexElBranche,AdrAigRencontre,numSegment, rien,erreur,det2,nb_det,xp,yp,xd,yd,Adr2,AdrDer,idx : integer; - trouve : boolean; + trouve,doublon : boolean; s,ss,ctype,derch: string; sdetect : Tdetect_cdm; begin @@ -2548,7 +2562,7 @@ begin if segment_aig(ctype) then begin AdrAigRencontre:=segment[indexSegSuivant].adresse; - if NivDebug=3 then Affichedebug('aig '+intTostr(adrAigRencontre),clyellow); + if debugBranche then Affichedebug('Aiguillage '+intTostr(adrAigRencontre),clyellow); if (ctype='dbl_slip_switch') and (segment[indexSegSuivant].adresse2<>0) then begin // dernier élément rencontré @@ -2557,7 +2571,6 @@ begin derch:=dernier_champ(sBranche); if derch[1]='A' then begin derch:=copy(derch,2,length(derch)-1);end; val(derch,AdrDer,erreur); - // if AdrDer=ADrAigRencontre then idx:=index_aig(AdrAigRencontre); // trouver de quel côté on va à la TJD @@ -2570,7 +2583,9 @@ begin sbranche:=sbranche+',A'+intToSTR(adr2)+',A'+intToSTR(AdrAigRencontre) else begin - Affiche('TJD '+intToSTR(Adr2)+'/'+intToSTR(adrAigRencontre)+'non résolue en branche '+intToSTR(nbreBranches)+'. Une vérification manuelle est nécessaire.',clred); + s:='TJD '+intToSTR(Adr2)+'/'+intToSTR(adrAigRencontre)+'non résolue en branche '+intToSTR(nbreBranches)+'. Une vérification manuelle est nécessaire.'; + Affiche(s,clred); + if debugBranche then AfficheDebug(s,clred); sbranche:=sbranche+',A??,A??'; end; end; @@ -2591,7 +2606,7 @@ begin if ctype='crossing' then begin sBranche:=sBranche+',A'+intToSTR(segment[indexSegSuivant].adresse); - if NivDebug=3 then Affichedebug('croisement',clyellow); + if debugBranche then Affichedebug('croisement',clyellow); //if debugBranche then AfficheDebug('Croisement '+intToSTR(segment[indexSegSuivant].adresse),clorange); raz_detect(sdetect); end; @@ -2630,7 +2645,7 @@ begin detecteur:=segment[indexSegSuivant].periph[j].adresse; if detecteur<>0 then begin - if NivDebug=3 then Affichedebug('Détecteur '+inttoStr(detecteur),clyellow); + if debugBranche then Affichedebug('Détecteur '+inttoStr(detecteur),clyellow); // incrémenter le compteur du détecteur rencontré inc(nb_det); sDetect[nb_det].adresse:=detecteur ; @@ -2647,25 +2662,39 @@ begin inc(j); until (j>NombrePeriph-1) ; - // trier les détecteurs du segment dans l'ordre de la distance de la plus - // courte à la plus grande au port if nb_det<>0 then begin + // trier les détecteurs du segment dans l'ordre de la distance de la plus + // courte à la plus grande au port trier(Sdetect,nb_det); for j:=1 to nb_det do begin + // vérifier si le détecteur est déja dans la branche + // nouveau détecteur doublon detecteur:=sDetect[j].adresse; - ss:=dernier_champ(sbranche); + doublon:=presence_detecteur(sbranche,detecteur); + if not(doublon) then + begin + sbranche:=sbranche+','+intToSTR(detecteur); + if debugBranche then Affichedebug('Détecteur '+intToSTR(j)+'/'+intToSTR(nb_det)+': pris en compte : '+intToSTR(detecteur),clyellow); + end + else + begin + if debugBranche then Affichedebug('Détecteur '+intToSTR(j)+'/'+intToSTR(nb_det)+': non pris en compte : '+intToSTR(detecteur),clOrange); + end; + + { ss:=dernier_champ(sbranche); k:=0; val(ss,k,erreur); if ss<>'' then if not(ss[1] in['0'..'9']) then k:=0; - // vérifier si le détecteur est déja en fin de branche - if k<>detecteur then + // vérifier si le détecteur est déja en fin de branche et que si on est au 2eme élément du tableau, on ne doit pas rencontrer le meme détecteur + if (k<>detecteur) then begin - sbranche:=sbranche+','+intToSTR(detecteur); - if NivDebug=3 then Affichedebug('Détecteur pris en compte : '+intToSTR(detecteur),clyellow); - end; + sbranche:=sbranche+','+intToSTR(detecteur); + if debugBranche then Affichedebug('Détecteur '+intToSTR(j)+'/'+intToSTR(nb_det)+': pris en compte : '+intToSTR(detecteur),clyellow); + end; } + inc(indexElBranche); end; end; @@ -2749,9 +2778,9 @@ begin if debugBranche then begin AfficheDebug('La branche '+sBranche,clorange); - AfficheDebug('est inutile car un de ses détecteurs '+intToSTR(detecteur)+' existe dans la branche '+intToSTR(i-1),clOrange); - exit; + AfficheDebug('est inutile car un de ses détecteurs '+intToSTR(detecteur)+' existe déjà dans la branche '+intToSTR(i-1),clOrange); end; + exit; end; // ok @@ -2772,7 +2801,6 @@ begin essai_port: if debugBranche then begin - AfficheDebug('------------------',clyellow); AfficheDebug('Créée branche détecteur '+intToSTR(detecteur)+' sur port '+intToSTR(indexPort),clOrange); end; trouve:=trouve_IndexSegPortDetecteur(detecteur,indexSeg,indexPeriph); @@ -2848,7 +2876,7 @@ var i,j,k,adresse,detecteur,indexSeg,det2,erreur : integer; trouve : boolean; c : char; s : string; -begin +begin // l'origine d'une branche est la pointe d'un aiguillage connecté à un détecteur ---------- NbreBranches:=0; @@ -2935,7 +2963,11 @@ begin end; if not(trouve) then begin - if debugBranche then AfficheDebug('le détecteur '+intToSTR(detecteur)+' est absent des branches ',clOrange); + if debugBranche then + begin + AfficheDebug('------------------',clyellow); + AfficheDebug('Le détecteur '+intToSTR(detecteur)+' est absent des branches, création d''une branche le contenant ',clOrange); + end; cree_branche_det(detecteur); //if debugBranche then AfficheDebug(sbranche,clWhite); end; @@ -3050,7 +3082,7 @@ begin closefile(f); Affiche('Le fichier de segments CDM : '+NomModuleCDM+' a été créé',clYellow); formprinc.Affiche_fenetre_CDM.enabled:=true; - confasauver:=true; + config_modifie:=true; end; procedure lit_fichier_segments_cdm; @@ -3268,6 +3300,7 @@ end; // et crée les branches procedure Importation; var i : integer; + s: string; begin if MaxAiguillage<>0 then begin @@ -3310,8 +3343,26 @@ begin end; MaxAiguillage:=NAig_CDM; trier_aig; + // construit les index des aiguillages + for i:=1 to maxAiguillage do + begin + index_accessoire[aiguillage[i].adresse]:=i; + end; - // créer les branches + // remplit la list box les aiguillages + formconfig.ListBoxAig.Clear; + for i:=1 to MaxAiguillage do + begin + s:=encode_aig(i); + formconfig.ListBoxAig.Items.AddObject(s, Pointer(clRed)); + Aiguillage[i].modifie:=false; + end; + FormConfig.ListBoxAig.itemindex:=0; + AncligneclicAig:=-1; + ligneclicAig:=-1; + + // créer les branches. Pour créer les branches, les aiguillages doivent être présents et leurs index construits + NbreBranches:=0; creee_branches; Affiche('Validation des branches',ClLime); @@ -3322,6 +3373,7 @@ begin Affiche('Importation terminée',clWhite); Affiche('Vérification de la cohérence :',clWhite); if verif_coherence then Affiche('Configuration cohérente',clLime); + if debugbranche or debugAnalyse then formDebug.Show; end; // compile le fichier Texte de CDM et l'importe @@ -3351,8 +3403,14 @@ begin ndet_cdm:=0; //debugAnalyse:=true; //debugBranche:=true; + + if DebugAnalyse or DebugBranche then formDebug.RichDebug.Clear; Lignes:=Formprinc.FenRich.Lines; - nligne:=0; nSeg:=0; + nligne:=0; + nSeg:=0; + nPort:=0; + nPeriph:=0; + nInter:=0; DernAdrAig:=0; xminiCDM:=0;yMiniCDM:=0;xmaxiCDM:=0;yMaxiCDM:=0; @@ -3361,6 +3419,7 @@ begin formAnalyseCDM.Show; Affiche('Compilation en cours',clWhite); + // on compile: on crée la base de données if DebugBranche then AfficheDebug('Compilation des segments, ports, inter et périphériques de CDM rail',ClWhite); repeat s:=supprime_espaces(lignes[nligne]); @@ -3401,7 +3460,10 @@ begin // sauvegarde sauve_ficher_cdm; - Importation; + // crée les branches + if nAig_CDM=0 then Affiche('Aucun aiguillage avec adresse, les branches ne peuvent pas être créées',clOrange) + else + Importation; end; diff --git a/UnitConfig.dfm b/UnitConfig.dfm index 1298884..3c8e1b3 100644 --- a/UnitConfig.dfm +++ b/UnitConfig.dfm @@ -1,6 +1,6 @@ object FormConfig: TFormConfig - Left = 331 - Top = 136 + Left = 278 + Top = 142 Hint = 'Modifie la configuration selon les s'#233'lections choisies' BorderStyle = bsDialog Caption = 'Configuration g'#233'n'#233'rale' @@ -668,7 +668,7 @@ object FormConfig: TFormConfig Top = 8 Width = 633 Height = 497 - ActivePage = TabSheetPeriph + ActivePage = TabSheetAig Font.Charset = DEFAULT_CHARSET Font.Color = clBlack Font.Height = -11 @@ -1995,7 +1995,7 @@ object FormConfig: TFormConfig end object Label34: TLabel Left = 472 - Top = 192 + Top = 200 Width = 136 Height = 26 Caption = 'Tapez CTRL-Z pour annuler une modification r'#233'cente' @@ -2012,12 +2012,12 @@ object FormConfig: TFormConfig Left = 464 Top = 24 Width = 153 - Height = 161 + Height = 169 Caption = 'Commandes' TabOrder = 0 object LabelResult: TLabel Left = 11 - Top = 112 + Top = 136 Width = 3 Height = 13 Caption = '-' @@ -2050,6 +2050,29 @@ object FormConfig: TFormConfig WordWrap = True OnClick = ButtonVerifConfigClick end + object EditChercher: TEdit + Left = 8 + Top = 104 + Width = 57 + Height = 21 + Hint = 'Chercher une cha'#238'ne' + ParentShowHint = False + ShowHint = True + TabOrder = 2 + OnChange = EditChercherChange + end + object ButtonCherche: TButton + Left = 72 + Top = 104 + Width = 75 + Height = 20 + Hint = 'Cherche une chaine' + Caption = 'Cherche' + ParentShowHint = False + ShowHint = True + TabOrder = 3 + OnClick = ButtonChercheClick + end end object RichBranche: TRichEdit Left = 0 @@ -2066,7 +2089,7 @@ object FormConfig: TFormConfig Lines.Strings = ( 'RichBranche') ParentFont = False - PopupMenu = PopupMenuBranches + PopupMenu = PopupMenuRichedit ScrollBars = ssBoth TabOrder = 1 WordWrap = False @@ -2075,9 +2098,9 @@ object FormConfig: TFormConfig end object Memo5: TMemo Left = 464 - Top = 232 + Top = 240 Width = 153 - Height = 209 + Height = 201 Lines.Strings = ( 'Une ligne doit commencer par ' 'un aiguillage (ou un buttoir) et ' @@ -2111,8 +2134,8 @@ object FormConfig: TFormConfig 'fficher la description du signal' end object Label35: TLabel - Left = 40 - Top = 444 + Left = 72 + Top = 436 Width = 201 Height = 13 Caption = 'Temporisation entre deux commandes (ms)' @@ -2281,7 +2304,7 @@ object FormConfig: TFormConfig Hint = 'Une ligne contient les conditions en ET. Les lignes sont cha'#238'n'#233'e' + 's en OU' - Color = clScrollBar + Color = cl3DLight ParentShowHint = False ScrollBars = ssBoth ShowHint = True @@ -2292,10 +2315,10 @@ object FormConfig: TFormConfig object ComboBoxDec: TComboBox Left = 144 Top = 48 - Width = 129 + Width = 137 Height = 21 Style = csDropDownList - ItemHeight = 0 + ItemHeight = 13 TabOrder = 1 OnChange = ComboBoxDecChange end @@ -2399,10 +2422,10 @@ object FormConfig: TFormConfig object ComboBoxAsp: TComboBox Left = 144 Top = 72 - Width = 129 + Width = 137 Height = 21 Style = csDropDownList - ItemHeight = 0 + ItemHeight = 13 TabOrder = 2 OnChange = ComboBoxAspChange end @@ -2502,7 +2525,7 @@ object FormConfig: TFormConfig Hint = 'Une ligne contient les conditions en ET. Les lignes sont cha'#238'n'#233'e' + 's en OU' - Color = clScrollBar + Color = cl3DLight ParentShowHint = False ScrollBars = ssBoth ShowHint = True @@ -2538,7 +2561,7 @@ object FormConfig: TFormConfig OnClick = ButtonInsFeuClick end object CheckBoxRazSignaux: TCheckBox - Left = 0 + Left = 24 Top = 402 Width = 169 Height = 17 @@ -2549,8 +2572,8 @@ object FormConfig: TFormConfig TabOrder = 4 end object EditTempoFeu: TEdit - Left = 0 - Top = 440 + Left = 16 + Top = 432 Width = 33 Height = 21 TabOrder = 5 @@ -2581,7 +2604,7 @@ object FormConfig: TFormConfig ImageIndex = 8 object Label61: TLabel Left = 13 - Top = 4 + Top = 12 Width = 173 Height = 13 Caption = 'D'#233'codeurs personnalis'#233's de signaux' @@ -2605,7 +2628,7 @@ object FormConfig: TFormConfig Font.Style = [] ParentFont = False end - object Label63: TLabel + object LabelDecal: TLabel Left = 168 Top = 32 Width = 49 @@ -2619,7 +2642,7 @@ object FormConfig: TFormConfig ParentFont = False WordWrap = True end - object Label66: TLabel + object LabelSorties: TLabel Left = 248 Top = 40 Width = 32 @@ -2635,9 +2658,9 @@ object FormConfig: TFormConfig end object GroupBox26: TGroupBox Left = 376 - Top = 64 + Top = 40 Width = 241 - Height = 393 + Height = 401 Caption = 'Commandes' TabOrder = 0 object Label67: TLabel @@ -2653,9 +2676,9 @@ object FormConfig: TFormConfig Font.Style = [fsBold] ParentFont = False end - object Label65: TLabel + object LabelNa: TLabel Left = 19 - Top = 96 + Top = 304 Width = 126 Height = 39 Alignment = taRightJustify @@ -2664,37 +2687,45 @@ object FormConfig: TFormConfig end object Label64: TLabel Left = 64 - Top = 160 + Top = 248 Width = 105 Height = 13 Caption = 'Signalisation nationale' end object Label68: TLabel - Left = 23 - Top = 356 + Left = 15 + Top = 84 Width = 178 Height = 13 Caption = 'Nombre de d'#233'codeurs personnalis'#233's :' end object LabelNbDecPers: TLabel - Left = 208 - Top = 356 + Left = 200 + Top = 84 Width = 6 Height = 13 Caption = '0' end + object LabelTypCde: TLabel + Left = 40 + Top = 200 + Width = 152 + Height = 13 + Caption = 'P'#233'riph'#233'rique COM/USB/Socket' + end object ComboBoxDecodeurPerso: TComboBox Left = 24 Top = 56 Width = 193 Height = 21 - ItemHeight = 0 + AutoComplete = False + ItemHeight = 13 TabOrder = 0 OnChange = ComboBoxDecodeurPersoChange end object EditNbreAdr: TEdit Left = 168 - Top = 104 + Top = 312 Width = 49 Height = 21 TabOrder = 1 @@ -2703,17 +2734,17 @@ object FormConfig: TFormConfig end object ComboBoxNation: TComboBox Left = 48 - Top = 176 + Top = 272 Width = 145 Height = 21 Style = csDropDownList - ItemHeight = 0 + ItemHeight = 13 TabOrder = 2 OnChange = ComboBoxNationChange end object BoutonNouveau: TButton - Left = 86 - Top = 216 + Left = 14 + Top = 360 Width = 75 Height = 25 Hint = 'Ajouter un nouveau d'#233'codeur personnalis'#233 @@ -2724,8 +2755,8 @@ object FormConfig: TFormConfig OnClick = BoutonNouveauClick end object ButtonSup: TButton - Left = 86 - Top = 248 + Left = 150 + Top = 360 Width = 75 Height = 25 Hint = 'Supprimer le d'#233'codeur personnalis'#233 @@ -2735,6 +2766,28 @@ object FormConfig: TFormConfig TabOrder = 4 OnClick = ButtonSupClick end + object RadioCdeDec: TRadioGroup + Left = 8 + Top = 112 + Width = 225 + Height = 65 + Caption = 'Type de commande' + Items.Strings = ( + 'Command'#233' par la centrale' + 'Command'#233' par port COM/USB/Socket') + TabOrder = 5 + OnClick = RadioCdeDecClick + end + object ComboBoxDecCde: TComboBox + Left = 24 + Top = 216 + Width = 193 + Height = 21 + Style = csDropDownList + ItemHeight = 13 + TabOrder = 6 + OnChange = ComboBoxDecCdeChange + end end end object TabSheetAct: TTabSheet @@ -2752,14 +2805,14 @@ object FormConfig: TFormConfig object GroupBox13: TGroupBox Left = 352 Top = 32 - Width = 257 + Width = 265 Height = 433 Caption = 'Description de l'#39'action' TabOrder = 0 object GroupBoxRadio: TGroupBox Left = 8 Top = 24 - Width = 225 + Width = 249 Height = 89 Caption = 'Type d'#39'action' TabOrder = 0 @@ -2801,17 +2854,17 @@ object FormConfig: TFormConfig end end object GroupBoxAct: TGroupBox - Left = 16 - Top = 128 - Width = 233 + Left = 8 + Top = 120 + Width = 249 Height = 321 Caption = 'Action fonction de locomotive ' TabOrder = 1 object GroupBox18: TGroupBox Left = 8 Top = 16 - Width = 217 - Height = 153 + Width = 233 + Height = 161 Caption = 'D'#233'clencheur ' TabOrder = 0 object LabelActionneur: TLabel @@ -2874,7 +2927,7 @@ object FormConfig: TFormConfig object RadioGroup1: TRadioGroup Left = 8 Top = 16 - Width = 193 + Width = 217 Height = 73 Caption = 'Type de d'#233'clenchement' TabOrder = 3 @@ -2916,9 +2969,9 @@ object FormConfig: TFormConfig end end object GroupBox19: TGroupBox - Left = 16 + Left = 8 Top = 136 - Width = 217 + Width = 233 Height = 137 Caption = 'Destinataire de l'#39'action ' TabOrder = 1 @@ -3110,7 +3163,7 @@ object FormConfig: TFormConfig Height = 21 Hint = 'Nom de l'#39'accessoire d'#233'fini dans l'#39'onglet "p'#233'riph'#233'riques COM/USB"' Style = csDropDownList - ItemHeight = 0 + ItemHeight = 13 ParentShowHint = False ShowHint = True TabOrder = 6 @@ -3131,25 +3184,25 @@ object FormConfig: TFormConfig end end object GroupBoxPNA: TGroupBox - Left = 32 - Top = 120 + Left = 88 + Top = 72 Width = 169 Height = 121 Caption = 'Actionneurs PN simples' TabOrder = 2 end object GroupBoxPNZ: TGroupBox - Left = 56 - Top = 136 + Left = 120 + Top = 64 Width = 169 Height = 65 Caption = 'Zones de d'#233'tection' TabOrder = 3 end object GroupBoxPN: TGroupBox - Left = 8 - Top = 56 - Width = 241 + Left = 136 + Top = 24 + Width = 249 Height = 193 Caption = 'Action gestion passage '#224' niveau' ParentShowHint = False @@ -3208,7 +3261,7 @@ object FormConfig: TFormConfig OnChange = EditCdeOuvreChange end object ButtonTestFerme: TButton - Left = 200 + Left = 208 Top = 80 Width = 27 Height = 21 @@ -3220,7 +3273,7 @@ object FormConfig: TFormConfig OnClick = ButtonTestFermeClick end object ButtonTestOuvre: TButton - Left = 200 + Left = 208 Top = 104 Width = 27 Height = 21 @@ -3287,11 +3340,11 @@ object FormConfig: TFormConfig object ComboBoxPNCom: TComboBox Left = 8 Top = 104 - Width = 129 + Width = 145 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 @@ -3561,6 +3614,7 @@ object FormConfig: TFormConfig Font.Name = 'MS Sans Serif' Font.Style = [] ParentFont = False + PopupMenu = PopupMenuRichedit TabOrder = 0 OnChange = RichCdeDccppChange OnKeyDown = RichCdeDccppKeyDown @@ -3914,7 +3968,7 @@ object FormConfig: TFormConfig Width = 3 Height = 13 end - object ListBoxAcc: TListBox + object ListBoxPeriph: TListBox Left = 8 Top = 72 Width = 233 @@ -3930,8 +3984,8 @@ object FormConfig: TFormConfig ParentFont = False PopupMenu = PopupMenuListes TabOrder = 0 - OnKeyDown = ListBoxAccKeyDown - OnMouseDown = ListBoxAccMouseDown + OnKeyDown = ListBoxPeriphKeyDown + OnMouseDown = ListBoxPeriphMouseDown end object ButtonAjAccCom: TButton Left = 8 @@ -4007,9 +4061,16 @@ object FormConfig: TFormConfig Left = 668 Top = 468 end - object PopupMenuBranches: TPopupMenu + object PopupMenuRichedit: TPopupMenu Left = 728 Top = 88 + object outslectionner1: TMenuItem + Caption = 'Tout s'#233'lectionner' + OnClick = Toutslectionner1Click + end + object N3: TMenuItem + Caption = '-' + end object Copier1: TMenuItem Caption = 'Copier' OnClick = Copier1Click diff --git a/UnitConfig.pas b/UnitConfig.pas index 5d21df0..a78de27 100644 --- a/UnitConfig.pas +++ b/UnitConfig.pas @@ -273,7 +273,7 @@ type CheckBoxVerifXpressNet: TCheckBox; ImageTrain: TImage; ButtonPFCDM: TButton; - PopupMenuBranches: TPopupMenu; + PopupMenuRichedit: TPopupMenu; Copier1: TMenuItem; Coller1: TMenuItem; CheckBoxVersContrevoie: TCheckBox; @@ -283,12 +283,12 @@ type TabSheetDecodeurs: TTabSheet; Label61: TLabel; Label62: TLabel; - Label63: TLabel; - Label66: TLabel; + LabelDecal: TLabel; + LabelSorties: TLabel; GroupBox26: TGroupBox; Label67: TLabel; ComboBoxDecodeurPerso: TComboBox; - Label65: TLabel; + LabelNa: TLabel; EditNbreAdr: TEdit; Label64: TLabel; ComboBoxNation: TComboBox; @@ -312,7 +312,7 @@ type CheckBoxAffMemo: TCheckBox; RadioButtonCde: TRadioButton; TabSheetPeriph: TTabSheet; - ListBoxAcc: TListBox; + ListBoxPeriph: TListBox; ButtonAjAccCom: TButton; ButtonSupAccCom: TButton; GroupBoxDesc: TGroupBox; @@ -338,6 +338,13 @@ type RadioButtonZone: TRadioButton; RadioGroupActPN: TRadioGroup; ComboBoxPNCom: TComboBox; + RadioCdeDec: TRadioGroup; + ComboBoxDecCde: TComboBox; + LabelTypCde: TLabel; + N3: TMenuItem; + outslectionner1: TMenuItem; + EditChercher: TEdit; + ButtonCherche: TButton; procedure ButtonAppliquerEtFermerClick(Sender: TObject); procedure FormActivate(Sender: TObject); procedure FormCreate(Sender: TObject); @@ -495,18 +502,23 @@ type procedure ButtonOuvreComClick(Sender: TObject); procedure ButtonAjAccComClick(Sender: TObject); procedure EditNomAccChange(Sender: TObject); - procedure ListBoxAccMouseDown(Sender: TObject; Button: TMouseButton; + procedure ListBoxPeriphMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); procedure ComboBoxAccComUSBChange(Sender: TObject); procedure ButtonSupAccComClick(Sender: TObject); - procedure ListBoxAccKeyDown(Sender: TObject; var Key: Word; + procedure ListBoxPeriphKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); procedure RadioButtonSimpleClick(Sender: TObject); procedure RadioButtonZoneClick(Sender: TObject); procedure RadioGroupActPNClick(Sender: TObject); procedure ComboBoxPNComChange(Sender: TObject); + procedure ComboBoxDecCdeChange(Sender: TObject); + procedure RadioCdeDecClick(Sender: TObject); + procedure Toutslectionner1Click(Sender: TObject); + procedure ButtonChercheClick(Sender: TObject); + procedure EditChercherChange(Sender: TObject); - private + private { Déclarations privées } public { Déclarations publiques } @@ -516,6 +528,7 @@ type procedure cb_onclick(Sender : Tobject); procedure tb_onChange(sender : TObject); procedure Bt_onclick(sender : Tobject); + procedure tbCde_onchange(Sender : Tobject); end; const @@ -564,6 +577,8 @@ AvecVerifIconesTCO_ch='AvecVerifIconesTCO'; NomModuleCDM_ch='NomModuleCDM'; Nba_ch='NombreAdresses'; nation_ch='Nation'; +Periph_ch='Periph'; +comm_ch='Commande'; nom_dec_pers_ch='Nom_dec_pers'; Nom_fich_TCO_ch='Nom_fichier_TCO'; LargeurF_ch='LargeurF'; @@ -593,7 +608,7 @@ var ligneclicAig,AncLigneClicAig,ligneClicSig,AncligneClicSig,EnvAigDccpp,AdrBaseDetDccpp, ligneClicBr,AncligneClicBr,ligneClicAct,AncLigneClicAct,Indexfeuclic,NumTrameCDM, Algo_localisation,Verif_AdrXpressNet,ligneclicTrain,AncligneclicTrain,AntiTimeoutEthLenz, - ligneDCC,decCourant,AffMemoFenetre,ligneClicAccCOM,AncligneClicAccCOM : integer; + ligneDCC,decCourant,AffMemoFenetre,ligneClicAccCOM,AncligneClicAccCOM,ligneCherche,compt_Ligne : integer; ack_cdm,clicliste,config_modifie,clicproprietes,confasauver,trouve_MaxPort, modif_branches,ConfigPrete,trouve_section_dccpp,trouve_section_trains,trouve_section_acccomusb, @@ -608,7 +623,7 @@ var EditZdet1V2F,EditZdet2V2F,EditZdet1V2O,EditZdet2V2O, EditZdet1V3F,EditZdet2V3F,EditZdet1V3O,EditZdet2V3O, EditZdet1V4F,EditZdet2V4F,EditZdet1V4O,EditZdet2V4O, - EditZdet1V5F,EditZdet2V5F,EditZdet1V5O,EditZdet2V5O :Tedit; + EditZdet1V5F,EditZdet2V5F,EditZdet1V5O,EditZdet2V5O : Tedit; LabelPortCde,LbPnVoie1,LbAPnVoie1,LbAPnVoie2,LbAPnVoie3,LbAPnVoie4,LbAPnVoie5,LbATitre, LbZTitre,LbZPnVoie1,LbZPnVoie2,LbZPnVoie3,LbZPnVoie4,LbZPnVoie5 : Tlabel; shape1,ShapeZ : Tshape; @@ -616,6 +631,8 @@ var EditT : Array[1..10] of Tedit; ComboL1,ComboL2,ComboTS1,ComboTS2 : Array[1..10] of TComboBox; ShapeT : array[1..10] of TShape; + LabelDecCde : array[1..19] of TLabel; + TextBoxCde : array[1..19] of Tedit; function config_com(s : string) : boolean; function envoi_CDM(s : string) : boolean; @@ -631,6 +648,7 @@ function encode_sig_feux(i : integer): string; procedure valide_branches; procedure trier_aig; function decodeDCC(s : string) : string; +function encode_aig(index : integer): string; implementation @@ -860,13 +878,13 @@ end; function encode_Periph(index : integer) : string; var s : string; begin - s:=Tablo_acc_COMUSB[index].nom; - if Tablo_acc_COMUSB[index].ScvAig then s:=s+',1' else s:=s+',0'; - if Tablo_acc_COMUSB[index].ScvDet then s:=s+',1' else s:=s+',0'; - if Tablo_acc_COMUSB[index].ScvAct then s:=s+',1' else s:=s+',0'; - if Tablo_acc_COMUSB[index].ScvVis then s:=s+',1' else s:=s+',0'; - if Tablo_acc_COMUSB[index].cr then s:=s+',1' else s:=s+',0'; - s:=s+','+Tablo_acc_COMUSB[index].protocole; + s:=Tablo_periph[index].nom; + if Tablo_periph[index].ScvAig then s:=s+',1' else s:=s+',0'; + if Tablo_periph[index].ScvDet then s:=s+',1' else s:=s+',0'; + if Tablo_periph[index].ScvAct then s:=s+',1' else s:=s+',0'; + if Tablo_periph[index].ScvVis then s:=s+',1' else s:=s+',0'; + if Tablo_periph[index].cr then s:=s+',1' else s:=s+',0'; + s:=s+','+Tablo_periph[index].protocole; result:=s; end; @@ -894,17 +912,17 @@ begin // P s:=s+'P';s:=s+intToSTR(aiguillage[index].Apointe); c:=aiguillage[index].APointeB ; - if (c<>'Z') and (c<>#0) then s:=s+c; + if (c<>'Z') and (c<>#0) and (c<>' ') then s:=s+c; //if c=#0 then s:=s+'Z'; // D s:=s+',D';s:=s+intToSTR(aiguillage[index].Adroit); c:=aiguillage[index].ADroitB ; - if (c<>'Z') and (c<>#0) then s:=s+c; + if (c<>'Z') and (c<>#0) and (c<>' ') then s:=s+c; //if c=#0 then s:=s+'Z'; // S s:=s+',S';s:=s+intToSTR(aiguillage[index].Adevie); c:=aiguillage[index].AdevieB ; - if (c<>'Z') and (c<>#0) then s:=s+c; + if (c<>'Z') and (c<>#0) and (c<>' ') then s:=s+c; //if c=#0 then s:=s+'Z'; // S2 aiguillage triple if triC then @@ -912,7 +930,7 @@ begin s:=s+',S2-'; s:=s+intToSTR(aiguillage[index].Adevie2); c:=aiguillage[index].Adevie2B ; - if (c<>'Z') and (c<>#0) then s:=s+c; + if (c<>'Z') and (c<>#0) and (c<>' ') then s:=s+c; //if c=#0 then s:=s+'Z'; end; end; @@ -922,31 +940,31 @@ begin begin s:=s+'D('+intToSTR(aiguillage[index].Adroit); - c:=aiguillage[index].AdroitB;if (c<>'Z') and (c<>#0) then s:=s+c; + c:=aiguillage[index].AdroitB;if (c<>'Z') and (c<>#0) and (c<>' ') then s:=s+c; s:=s+','+intToSTR(aiguillage[index].DDroit); - c:=aiguillage[index].DDroitB;if (c<>'Z') and (c<>#0) then s:=s+c; + c:=aiguillage[index].DDroitB;if (c<>'Z') and (c<>#0) and (c<>' ') then s:=s+c; s:=s+'),'; s:=s+'S('+intToSTR(aiguillage[index].Adevie); - c:=aiguillage[index].AdevieB;if (c<>'Z') and (c<>#0) then s:=s+c; + c:=aiguillage[index].AdevieB;if (c<>'Z') and (c<>#0) and (c<>' ') then s:=s+c; s:=s+','+intToSTR(aiguillage[index].DDevie); - c:=aiguillage[index].DDevieB;if (c<>'Z') and (c<>#0) then s:=s+c; + c:=aiguillage[index].DDevieB;if (c<>'Z') and (c<>#0) and (c<>' ') then s:=s+c; s:=s+')'; end; if croi then begin s:=s+'D('+intToSTR(aiguillage[index].Adroit); - c:=aiguillage[index].AdroitB;if (c<>'Z') and (c<>#0) then s:=s+c; + c:=aiguillage[index].AdroitB;if (c<>'Z') and (c<>#0) and (c<>' ')then s:=s+c; s:=s+','+intToSTR(aiguillage[index].DDroit); - c:=aiguillage[index].DDroitB;if (c<>'Z') and (c<>#0) then s:=s+c; + c:=aiguillage[index].DDroitB;if (c<>'Z') and (c<>#0) and (c<>' ')then s:=s+c; s:=s+'),'; s:=s+'S('+intToSTR(aiguillage[index].Adevie); - c:=aiguillage[index].AdevieB;if (c<>'Z') and (c<>#0) then s:=s+c; + c:=aiguillage[index].AdevieB;if (c<>'Z') and (c<>#0) and (c<>' ')then s:=s+c; s:=s+','+intToSTR(aiguillage[index].DDevie); - c:=aiguillage[index].DDevieB;if (c<>'Z') and (c<>#0) then s:=s+c; + c:=aiguillage[index].DDevieB;if (c<>'Z') and (c<>#0) and (c<>' ')then s:=s+c; s:=s+')'; end; @@ -1651,7 +1669,7 @@ end; procedure genere_config; var s: string; fichierN : text; - i,j,n : integer; + i,j,n,k : integer; begin assign(fichierN,NomConfig); rewrite(fichierN); @@ -1814,7 +1832,7 @@ begin writeln(fichierN,'/------------'); - // décodeurs de signaux personnalisés (sauver avant les signaux pour avoir la liste des décodeurs personnalisés + // décodeurs de signaux personnalisés (sauver avant les signaux pour avoir la liste des décodeurs personnalisés) writeln(fichierN,section_DecPers_ch); for i:=1 to NbreDecPers do begin @@ -1825,14 +1843,39 @@ begin n:=decodeur_pers[i].nation; s:=nation_ch+'='+intToSTR(n); writeln(fichierN,s); - - for j:=1 to decodeur_pers[i].NbreAdr do - begin - s:=intToSTR(decodeur_pers[i].desc[j].etat1)+','+intToSTR(decodeur_pers[i].desc[j].etat2)+','+ - intToSTR(decodeur_pers[i].desc[j].offsetAdresse)+','+intToSTR(decodeur_pers[i].desc[j].sortie1)+','+ - intToSTR(decodeur_pers[i].desc[j].sortie2); - writeln(fichierN,s); - end; + s:=comm_ch+'='+intToSTR(decodeur_pers[i].commande); + writeln(fichierN,s); + s:=Periph_ch+'='+intToSTR(decodeur_pers[i].Peripherique); + writeln(fichierN,s); + // commande par centrale + if decodeur_pers[i].commande=0 then + for j:=1 to decodeur_pers[i].NbreAdr do + begin + s:=intToSTR(decodeur_pers[i].desc[j].etat1)+','+intToSTR(decodeur_pers[i].desc[j].etat2)+','+ + intToSTR(decodeur_pers[i].desc[j].offsetAdresse)+','+intToSTR(decodeur_pers[i].desc[j].sortie1)+','+ + intToSTR(decodeur_pers[i].desc[j].sortie2); + writeln(fichierN,s); + end; + // commande par périphérique + if decodeur_pers[i].commande=1 then + begin + k:=decodeur_Pers[i].nation; + if k=1 then + for j:=1 to 19 do + begin + s:=etats[j]+','+decodeur_pers[i].desc[j].Chcommande; + writeln(fichierN,s); + end; + if k=2 then + begin + for j:=1 to 9 do + begin + s:=EtatSignBelge[j]+','+decodeur_pers[i].desc[j].Chcommande; + writeln(fichierN,s); + end; + for j:=10 to 19 do writeln(fichierN,' ,'); + end; + end; end; writeln(fichierN,'0'); @@ -2023,7 +2066,6 @@ var s,sa,SOrigine: string; Tablo_actionneur[i].act:=false; Tablo_actionneur[i].son:=false; Tablo_actionneur[i].periph:=false; - end; maxTablo_act:=1; @@ -2441,11 +2483,7 @@ var s,sa,SOrigine: string; tec:=erreur<>0; // ne supprimer que le 2 if (tec) then delete(s,erreur+1,1); - //val(enregistrement,detect,erreur); // extraction de l'adresse decodeAig(s,detect,c); - //if ((detect=0) and (erreur=0)) then Affiche('Erreur pas d''adresse dans section S: '+s,clred); - //c:='Z'; - //if (erreur<>0) then begin delete(enregistrement,1,erreur-1);c:=enregistrement[1];end; if not(S2) and not(tec) then begin aiguillage[maxaiguillage].Adevie:=detect;aiguillage[maxaiguillage].AdevieB:=c;end; if S2 and not(tec) then begin aiguillage[maxaiguillage].Adevie2:=detect;aiguillage[maxaiguillage].Adevie2B:=c;end; @@ -2542,13 +2580,14 @@ var s,sa,SOrigine: string; // compile les décodeurs personnalisés procedure compile_dec_pers; - var nv,j,k,l,adr : integer; + var nv,j,k,l,adr,c : integer; begin Nligne:=1; + s:=''; repeat // boucle de décodeurs nv:=0; // compteur nombre de variables - repeat // boucle d'un décodeur - s:=lit_ligne; + c:=0; // commande par centrale + repeat // boucle d'entete d'un décodeur inc(Nligne); if s<>'0' then begin @@ -2558,20 +2597,22 @@ var s,sa,SOrigine: string; k:=pos(uppercase(nom_dec_pers_ch)+'=',s); if k=1 then begin - delete(sOrigine,1,length(nom_dec_pers_ch)+1); s:=''; inc(NbreDecPers); - decodeur_pers[NbreDecPers].nom:=sOrigine; - decodeur[NbDecodeurdeBase+NbreDecPers-1]:=sOrigine; + k:=pos('=',sOrigine); + decodeur_pers[NbreDecPers].nom:=copy(sOrigine,k+1,length(sOrigine)-k+1); + decodeur[NbDecodeurdeBase+NbreDecPers-1]:=copy(sOrigine,k+1,length(sOrigine)-k+1); inc(nv); end; + // nombre d'adresses k:=pos(uppercase(nba_ch)+'=',s); if (k=1) and (NbreDecPers>0) then begin delete(s,1,length(nba_ch)+1); - val(s,j,erreur); // ne pas écraser j + val(s,j,erreur); // ne pas écraser j il va être lu après + if j>10 then j:=10; decodeur_pers[NbreDecPers].NbreAdr:=j; inc(nv); end; @@ -2586,42 +2627,77 @@ var s,sa,SOrigine: string; decodeur_pers[NbreDecPers].Nation:=k; inc(nv); end; + + // commande comm_ch + k:=pos(uppercase(comm_ch)+'=',s); + if (k=1) and (NbreDecPers>0) then + begin + delete(s,1,length(comm_ch)+1); + val(s,c,erreur); + if (c<0) or (c>1) then c:=0; + decodeur_pers[NbreDecPers].commande:=c; // ne pas écraser c + if c=1 then j:=19; // dire que la boucle des commandes est de 19 paramètres + inc(nv); + end; + + // périphérique + k:=pos(uppercase(Periph_ch)+'=',s); + if (k=1) and (NbreDecPers>0) then + begin + delete(s,1,length(periph_ch)+1); + val(s,k,erreur); + decodeur_pers[NbreDecPers].Peripherique:=k; + inc(nv); + end; end; end; - until eof(fichier) or (s='0') or (nv=3); // on sort de la boucle si on a lu les 3 variables + s:=lit_ligne; + until eof(fichier) or (pos('=',sOrigine)=0) or (nv=5); // on sort de la boucle si on a lu les 5 variables adr:=1; - if s<>'0' then + if sOrigine<>'0' then repeat - s:=lit_ligne; if s<>'0' then begin - k:=pos(',',s); - val(s,l,erreur); - delete(s,1,k); - decodeur_pers[NbreDecPers].desc[adr].etat1:=l; - k:=pos(',',s); - val(s,l,erreur); - delete(s,1,k); - decodeur_pers[NbreDecPers].desc[adr].etat2:=l; - k:=pos(',',s); - val(s,l,erreur); - delete(s,1,k); - decodeur_pers[NbreDecPers].desc[adr].offsetadresse:=l; - k:=pos(',',s); - val(s,l,erreur); - delete(s,1,k); - decodeur_pers[NbreDecPers].desc[adr].sortie1:=l; - k:=pos(',',s); - val(s,l,erreur); - delete(s,1,k); - decodeur_pers[NbreDecPers].desc[adr].sortie2:=l; - s:=''; - inc(adr); - end - else Affiche('Section décodeurs - Nombre de descriptions du décodeur "'+decodeur_pers[NbreDecPers].nom+'" différents du nombre des adresses déclarées',clred); + if c=0 then //type commande 0=par centrale 1=com/socket + begin + k:=pos(',',s); + val(s,l,erreur); + delete(s,1,k); + decodeur_pers[NbreDecPers].desc[adr].etat1:=l; + k:=pos(',',s); + val(s,l,erreur); + delete(s,1,k); + decodeur_pers[NbreDecPers].desc[adr].etat2:=l; + k:=pos(',',s); + val(s,l,erreur); + delete(s,1,k); + decodeur_pers[NbreDecPers].desc[adr].offsetadresse:=l; + k:=pos(',',s); + val(s,l,erreur); + delete(s,1,k); + decodeur_pers[NbreDecPers].desc[adr].sortie1:=l; + k:=pos(',',s); + val(s,l,erreur); + delete(s,1,k); + decodeur_pers[NbreDecPers].desc[adr].sortie2:=l; + s:=''; + inc(adr); + end; + if c=1 then + begin + k:=pos(',',sOrigine); + decodeur_pers[NbreDecPers].desc[adr].Chcommande:=copy(sOrigine,k+1,length(sOrigine)-k+1); + s:=''; + inc(adr); + end; + end; + s:=lit_ligne; + + //else Affiche('Section décodeurs - Nombre de descriptions du décodeur "'+decodeur_pers[NbreDecPers].nom+'" différents du nombre des adresses déclarées',clred); until (adr>j) or (s='0'); - until eof(fichier) or (s='0'); + + until eof(fichier) or (s='0'); end; procedure compile_dccpp; @@ -2748,47 +2824,47 @@ var s,sa,SOrigine: string; inc(NbPeriph); sa:=sOrigine; i:=pos(',',sa); - Tablo_acc_COMUSB[NbPeriph].nom:=copy(sa,1,i-1); + Tablo_periph[NbPeriph].nom:=copy(sa,1,i-1); delete(sa,1,i); val(sa,i,erreur); - Tablo_acc_COMUSB[NbPeriph].ScvAig:=i=1; + Tablo_periph[NbPeriph].ScvAig:=i=1; i:=pos(',',sa);Delete(sa,1,i); val(sa,i,erreur); - Tablo_acc_COMUSB[NbPeriph].ScvDet:=i=1; + Tablo_periph[NbPeriph].ScvDet:=i=1; i:=pos(',',sa);Delete(sa,1,i); val(sa,i,erreur); - Tablo_acc_COMUSB[NbPeriph].ScvAct:=i=1; + Tablo_periph[NbPeriph].ScvAct:=i=1; i:=pos(',',sa);Delete(sa,1,i); val(sa,i,erreur); - Tablo_acc_COMUSB[NbPeriph].ScvVis:=i=1; + Tablo_periph[NbPeriph].ScvVis:=i=1; i:=pos(',',sa);Delete(sa,1,i); val(sa,i,erreur); - Tablo_acc_COMUSB[NbPeriph].cr:=i=1; + Tablo_periph[NbPeriph].cr:=i=1; i:=pos(',',sa);Delete(sa,1,i); val(sa,i,erreur); - Tablo_acc_COMUSB[NbPeriph].protocole:=sa; + Tablo_periph[NbPeriph].protocole:=sa; i:=com_socket(NbPeriph); if i=1 then begin inc(NbPeriph_COMUSB); - Tablo_acc_COMUSB[NbPeriph].numComposant:=NbPeriph_COMUSB; + Tablo_periph[NbPeriph].numComposant:=NbPeriph_COMUSB; end; if i=2 then begin inc(NbPeriph_socket); - Tablo_acc_COMUSB[NbPeriph].numComposant:=NbPeriph_socket; + Tablo_periph[NbPeriph].numComposant:=NbPeriph_socket; end; // extraire le numéro de com5:9600,n,8,1 i:=extract_int(sa); if i=0 then Affiche('Erreur COM nul : '+sOrigine,clred); - Tablo_acc_COMUSB[NbPeriph].NumCom:=i; + Tablo_periph[NbPeriph].NumCom:=i; Tablo_com_cde[NbPeriph].NumAcc:=NbPeriph; end; until (sOrigine='0') or (NbPeriph>=NbMaxi_Periph); @@ -3985,9 +4061,117 @@ begin end; +procedure champs_dec_centrale; +var i,nombre : integer; +begin + if decCourant<1 then exit; + decodeur_pers[decCourant].commande:=0; + nombre:=decodeur_pers[decCourant].nbreAdr; + for i:=1 to nombre do + begin + ComboTS1[i].Visible:=true; + ComboTS2[i].Visible:=true; + EditT[i].visible:=true; + ComboL1[i].Visible:=true; + ComboL2[i].Visible:=true; + ShapeT[i].Visible:=true; + end; + for i:=nombre+1 to 10 do + begin + ComboTS1[i].Visible:=false; + ComboTS2[i].Visible:=false; + EditT[i].visible:=false; + ComboL1[i].Visible:=false; + ComboL2[i].Visible:=false; + ShapeT[i].Visible:=false; + end; + + with FormConfig do + begin + ComboBoxDecCde.Visible:=false; + LabelTypCde.Visible:=false; + LabelNA.Visible:=true; + EditNbreAdr.Visible:=true; + end; + + for i:=1 to 19 do + begin + LabelDecCde[i].Visible:=false; + TextBoxCde[i].Visible:=false; + end; + + with formconfig do + begin + labelDecal.caption:='Décalage'+#13+'d''adresse'; + LabelDecal.Left:=168; + LabelSorties.visible:=true; + end; +end; + +procedure Champs_dec_Com; +var i,n : integer; +begin + if decCourant<1 then exit; + decodeur_pers[decCourant].commande:=1; + decodeur_pers[decCourant].NbreAdr:=10; + for i:=1 to 10 do + begin + ComboTS1[i].Visible:=false; + ComboTS2[i].Visible:=false; + EditT[i].visible:=false; + ComboL1[i].Visible:=false; + ComboL2[i].Visible:=false; + ShapeT[i].Visible:=false; + end; + with FormConfig do begin + ComboBoxDecCde.Visible:=true; + LabelTypCde.Visible:=true; + LabelNA.Visible:=false; + EditNbreAdr.Visible:=false; + end; + + for i:=1 to 19 do + begin + LabelDecCde[i].Visible:=true; + TextBoxCde[i].Visible:=true; + TextBoxCde[i].Text:=decodeur_pers[decCourant].desc[i].Chcommande; + end; + + n:=decodeur_pers[decCourant].nation; + if n=2 then + begin + for i:=1 to 9 do + begin + LabelDecCde[i].caption:=EtatSignBelge[i]; + LabelDecCde[i].visible:=true; + end; + for i:=10 to 19 do + begin + LabelDecCde[i].visible:=false; + TextBoxCde[i].Visible:=false; + end; + + end; + + if n=1 then + for i:=1 to 19 do + begin + LabelDecCde[i].caption:=Etats[i]; + LabelDecCde[i].visible:=true; + end; + + with formconfig do + begin + ComboBoxDecCde.ItemIndex:=decodeur_pers[DecCourant].Peripherique-1; + formconfig.labelDecal.caption:='Commande'+#13+'Ascii'; + LabelDecal.Left:=150; + formconfig.LabelSorties.visible:=false; + end; +end; + // met à jour le décodeur courant dans le tableau de config procedure maj_decodeurs; -var nAdr,i,j,a,nation : integer; +var nAdr,i,j,a,nation,typ : integer; begin begin // si pas de décodeur courant, on rend invisible toutes les adresses @@ -3997,58 +4181,68 @@ begin nAdr:=decodeur_pers[decCourant].NbreAdr; FormConfig.EditNbreAdr.Text:=intToSTR(decodeur_pers[decCourant].NbreAdr); nation:=decodeur_pers[decCourant].nation; + typ:=decodeur_pers[decCourant].commande; //0=centrale 1=com/usb end; - for i:=1 to nAdr do - begin + if typ=0 then + begin + for i:=1 to nAdr do + begin + comboL1[i].Items.Clear; + comboL2[i].Items.Clear; + if nation=1 then + begin + for j:=0 to 20 do + begin + comboL1[i].Items.add(Etats[j]); + comboL2[i].Items.add(Etats[j]); + end; + end + else + for j:=0 to 9 do + begin + begin + comboL1[i].Items.add(EtatSignBelge[j]); + comboL2[i].Items.add(EtatSignBelge[j]); + end; + end; + a:=decodeur_pers[decCourant].desc[i].etat1; + ComboL1[i].itemIndex:=a; + ComboL1[i].Visible:=true; - comboL1[i].Items.Clear; - comboL2[i].Items.Clear; - if nation=1 then - begin - for j:=0 to 20 do - begin - comboL1[i].Items.add(Etats[j]); - comboL2[i].Items.add(Etats[j]); - end; - end - else - for j:=0 to 9 do - begin - begin - comboL1[i].Items.add(EtatSignBelge[j]); - comboL2[i].Items.add(EtatSignBelge[j]); - end; + a:=decodeur_pers[decCourant].desc[i].etat2; + ComboL2[i].Itemindex:=a; + ComboL2[i].Visible:=true; + + EditT[i].Text:=intToSTR(decodeur_pers[decCourant].desc[i].offsetAdresse); + EditT[i].Visible:=true; + a:=decodeur_pers[decCourant].desc[i].sortie1; + ComboTS1[i].Itemindex:=a-1; + ComboTS1[i].Visible:=true; + a:=decodeur_pers[decCourant].desc[i].sortie2; + ComboTS2[i].Itemindex:=a-1; + ComboTS2[i].Visible:=true; + ShapeT[i].Visible:=true; + end; - a:=decodeur_pers[decCourant].desc[i].etat1; - ComboL1[i].itemIndex:=a; - ComboL1[i].Visible:=true; - - a:=decodeur_pers[decCourant].desc[i].etat2; - ComboL2[i].Itemindex:=a; - ComboL2[i].Visible:=true; - - EditT[i].Text:=intToSTR(decodeur_pers[decCourant].desc[i].offsetAdresse); - EditT[i].Visible:=true; - a:=decodeur_pers[decCourant].desc[i].sortie1; - ComboTS1[i].Itemindex:=a-1; - ComboTS1[i].Visible:=true; - a:=decodeur_pers[decCourant].desc[i].sortie2; - ComboTS2[i].Itemindex:=a-1; - ComboTS2[i].Visible:=true; - ShapeT[i].Visible:=true; + for i:=nADr+1 to 10 do + begin + ComboL1[i].Visible:=false; + ComboL2[i].Visible:=false; + EditT[i].Visible:=false; + ComboTS1[i].Visible:=false; + ComboTS2[i].Visible:=false; + ShapeT[i].Visible:=false; + end; end; - for i:=nADr+1 to 10 do - begin - ComboL1[i].Visible:=false; - ComboL2[i].Visible:=false; - EditT[i].Visible:=false; - ComboTS1[i].Visible:=false; - ComboTS2[i].Visible:=false; - ShapeT[i].Visible:=false; - end; + + + FormConfig.RadioCdeDec.ItemIndex:=typ; + if typ=0 then Champs_Dec_Centrale; + if typ=1 then Champs_dec_Com; end; + end; procedure TformConfig.Bt_onclick(sender : TObject); @@ -4064,43 +4258,41 @@ begin if clicliste or (ligneClicAccCOM<0) then exit; cb:=(sender as Tcheckbox); s := cb.Name; - if pos('Aig',s)<>0 then Tablo_acc_COMUSB[ligneClicAccCOM+1].ScvAig:=cb.Checked; - if pos('Det',s)<>0 then Tablo_acc_COMUSB[ligneClicAccCOM+1].ScvDet:=cb.Checked; - if pos('Act',s)<>0 then Tablo_acc_COMUSB[ligneClicAccCOM+1].ScvAct:=cb.Checked; - if pos('Vis',s)<>0 then Tablo_acc_COMUSB[ligneClicAccCOM+1].ScvVis:=cb.Checked; - if s='CheckBoxCR' then Tablo_acc_COMUSB[ligneClicAccCOM+1].CR:=cb.Checked; + if pos('Aig',s)<>0 then Tablo_periph[ligneClicAccCOM+1].ScvAig:=cb.Checked; + if pos('Det',s)<>0 then Tablo_periph[ligneClicAccCOM+1].ScvDet:=cb.Checked; + if pos('Act',s)<>0 then Tablo_periph[ligneClicAccCOM+1].ScvAct:=cb.Checked; + if pos('Vis',s)<>0 then Tablo_periph[ligneClicAccCOM+1].ScvVis:=cb.Checked; + if s='CheckBoxCR' then Tablo_periph[ligneClicAccCOM+1].CR:=cb.Checked; s:=encode_Periph(ligneClicAccCOM+1); - ListBoxAcc.Items[ligneClicAccCOM]:=s; - ListBoxAcc.Selected[ligneClicAccCOM]:=true; + ListBoxPeriph.Items[ligneClicAccCOM]:=s; + ListBoxPeriph.Selected[ligneClicAccCOM]:=true; end; +// ajoute les champs des périphériques dans les combos procedure ajoute_champs_combos(i : integer); var j : integer; s : string; begin - j:=com_socket(i); - if j=1 then - begin - s:=Tablo_acc_COMUSB[i].nom+' (COM'+intToSTR(Tablo_acc_COMUSB[i].NumCom)+')'; - formConfig.ComboBoxAccComUSB.Items.Add(s); - formconfig.ComboBoxPNCom.Items.Add(s); - end; - if j=2 then - begin - s:=Tablo_acc_COMUSB[i].nom+' ('+Tablo_acc_COMUSB[i].protocole+')'; - formconfig.ComboBoxAccComUSB.Items.Add(s); - formconfig.ComboBoxPNCom.Items.Add(s); - end; + j:=com_socket(i); + if j=1 then s:=Tablo_periph[i].nom+' (COM'+intToSTR(Tablo_periph[i].NumCom)+')'; + if j=2 then s:=Tablo_periph[i].nom+' ('+Tablo_periph[i].protocole+')'; + With formconfig do + begin + ComboBoxAccComUSB.Items.Add(s); + ComboBoxPNCom.Items.Add(s); + ComboBoxDecCde.Items.Add(s); + end; end; +// met à jour le nom d'un champ d'index i dans les combos procedure maj_champs_combos(i: integer); var j,n : integer; s : string; begin j:=com_socket(i); - if j=1 then s:=Tablo_acc_COMUSB[i].nom+' (COM'+intToSTR(Tablo_acc_COMUSB[i].NumCom)+')'; - if j=2 then s:=Tablo_acc_COMUSB[i].nom+' ('+Tablo_acc_COMUSB[i].protocole+')'; + if j=1 then s:=Tablo_periph[i].nom+' (COM'+intToSTR(Tablo_periph[i].NumCom)+')'; + if j=2 then s:=Tablo_periph[i].nom+' ('+Tablo_periph[i].protocole+')'; with formconfig do begin n:=comboBoxACCComUSB.Items.Count; @@ -4108,7 +4300,8 @@ begin if nMaxComUSBPeriph then labelInfo.Caption:='Nombre maxi de périphériques COM/USB atteint'; - Tablo_acc_COMUSB[i].numComposant:=NbPeriph_COMUSB; + Tablo_periph[i].numComposant:=NbPeriph_COMUSB; Tablo_com_cde[i].NumAcc:=NbPeriph_COMUSB; end; if v=2 then begin inc(NbPeriph_Socket); if NbPeriph_Socket>MaxComSocketPeriph then labelInfo.Caption:='Nombre maxi de périphériques socket atteint'; - Tablo_acc_COMUSB[NbPeriph].numComposant:=NbPeriph_socket; + Tablo_periph[NbPeriph].numComposant:=NbPeriph_socket; Tablo_com_cde[i].NumAcc:=NbPeriph_Socket; end; end; end; +// on change dus textBoxCde des décodeurs +procedure TformConfig.tbCde_onchange(sender : Tobject); +var tb : tEdit; + s,te : string; + i : integer; +begin + if affevt then affiche('tbCde_onchange',clyellow); + tb:=(sender as Tedit); + s:=tb.Name; + te:=tb.text; + i:=extract_int(s); + if (i<1) or (i>19) or (decCourant<1) then exit; + decodeur_pers[decCourant].desc[i].Chcommande:=te; + +end; procedure TFormConfig.FormCreate(Sender: TObject); var i,j,y,l,LongestLength,PixelLength : integer; @@ -4174,6 +4383,8 @@ begin Feu_Supprime.Adresse:=0; Feu_sauve.adresse:=0; clicListe:=false; + ligneCherche:=0; + Compt_ligne:=0; ConfigPrete:=true; richBranche.HideSelection:=false; // pour pouvoir copier coller la fenetre @@ -4278,8 +4489,37 @@ begin end; end; + // composants dynamiques des décodeurs pilotés par périph + + for i:=1 to 19 do + begin + y:=i*21+20; + LabelDecCde[i]:=Tlabel.Create(FormConfig.TabSheetDecodeurs); + with LabelDecCde[i] do + begin + Name:='LabelDecCde'+intToSTR(i); + left:=20;Top:=y+20;Width:=110;Height:=13; + caption:=etats[i]; + parent:=TabSheetDecodeurs; + ShowHint:=false; + visible:=false; + end; + TextBoxCde[i]:=Tedit.Create(FormConfig.TabSheetDecodeurs); + with TextBoxCde[i] do + begin + Name:='TextBoxCde'+intToSTR(i); + left:=150;Top:=y+20;Width:=120;Height:=15; + text:=''; + parent:=TabSheetDecodeurs; + ShowHint:=false; + visible:=false; + onChange:=formconfig.tbCde_onchange; + end; + end; + + GroupBoxPN.Top:=16; - // composants passage à niveau + // composants onglet passage à niveau with GroupBoxPNA do begin Left:=8; @@ -4328,6 +4568,8 @@ begin left:=64;Top:=50;Width:=41;Height:=21; text:=''; parent:=GroupBoxPNA; + hint:='Actionneur de fermeture'; + showhint:=true; onChange:=formConfig.modif_editT; end; EditV1O:=TEdit.create(FormConfig.GroupBoxPNA); @@ -4336,6 +4578,8 @@ begin Name:='EditV1O'; left:=152;Top:=50;Width:=41;Height:=21; text:=''; + hint:='Actionneur d''ouverture'; + showhint:=true; parent:=GroupBoxPNA; onChange:=formConfig.modif_editT; end; @@ -4355,6 +4599,8 @@ begin Name:='EditV2F'; left:=64;Top:=74;Width:=41;Height:=21; text:=''; + hint:='Actionneur de fermeture'; + showhint:=true; parent:=GroupBoxPNA; onChange:=formConfig.modif_editT; end; @@ -4364,6 +4610,8 @@ begin Name:='EditV2O'; left:=152;Top:=74;Width:=41;Height:=21; text:=''; + hint:='Actionneur d''ouverture'; + showhint:=true; parent:=GroupBoxPNA; onChange:=formConfig.modif_editT; end; @@ -4382,6 +4630,8 @@ begin Name:='EditV3F'; left:=64;Top:=98;Width:=41;Height:=21; text:=''; + hint:='Actionneur de fermeture'; + showhint:=true; parent:=GroupBoxPNA; onChange:=formConfig.modif_editT; end; @@ -4391,6 +4641,8 @@ begin Name:='EditV3O'; left:=152;Top:=98;Width:=41;Height:=21; text:=''; + hint:='Actionneur d''ouverture'; + showhint:=true; parent:=GroupBoxPNA; onChange:=formConfig.modif_editT; end; @@ -4409,6 +4661,8 @@ begin Name:='EditV4F'; left:=64;Top:=122;Width:=41;Height:=21; text:=''; + hint:='Actionneur de fermeture'; + showhint:=true; parent:=GroupBoxPNA; onChange:=formConfig.modif_editT; end; @@ -4418,6 +4672,8 @@ begin Name:='EditV4O'; left:=152;Top:=122;Width:=41;Height:=21; text:=''; + hint:='Actionneur d''ouverture'; + showhint:=true; parent:=GroupBoxPNA; onChange:=formConfig.modif_editT; end; @@ -4438,6 +4694,8 @@ begin left:=64;Top:=146;Width:=41;Height:=21; text:=''; parent:=GroupBoxPNA; + hint:='Actionneur de fermeture'; + showhint:=true; onChange:=formConfig.modif_editT; end; EditV5O:=TEdit.create(FormConfig.GroupBoxPNA); @@ -4446,6 +4704,8 @@ begin Name:='EditV5O'; left:=152;Top:=146;Width:=41;Height:=21; text:=''; + hint:='Actionneur d''ouverture'; + showhint:=true; parent:=GroupBoxPNA; onChange:=formConfig.modif_editT; end; @@ -4481,6 +4741,8 @@ begin Name:='EditZDet1V1F'; left:=64;Top:=50;Width:=35;Height:=21; text:=''; + hint:='Détecteur 1 de fermeture'; + showhint:=true; parent:=GroupBoxPNZ; onChange:=formConfig.modif_editT; end; @@ -4490,6 +4752,8 @@ begin Name:='EditZDet2V1F'; left:=100;Top:=50;Width:=35;Height:=21; text:=''; + hint:='Détecteur 2 de fermeture'; + showhint:=true; parent:=GroupBoxPNZ; onChange:=formConfig.modif_editT; end; @@ -4499,6 +4763,8 @@ begin Name:='EditZDet1V1O'; left:=152;Top:=50;Width:=35;Height:=21; text:=''; + hint:='Détecteur 1 d''ouverture'; + showhint:=true; parent:=GroupBoxPNZ; onChange:=formConfig.modif_editT; end; @@ -4508,6 +4774,8 @@ begin Name:='EditZDet2V1O'; left:=190;Top:=50;Width:=35;Height:=21; text:=''; + hint:='Détecteur 2 d''ouverture'; + showhint:=true; parent:=GroupBoxPNZ; onChange:=formConfig.modif_editT; end; @@ -4526,6 +4794,8 @@ begin Name:='EditZDet1V2F'; left:=64;Top:=74;Width:=35;Height:=21; text:=''; + hint:='Détecteur 1 de fermeture'; + showhint:=true; parent:=GroupBoxPNZ; onChange:=formConfig.modif_editT; end; @@ -4535,6 +4805,8 @@ begin Name:='EditZDet2V2F'; left:=100;Top:=74;Width:=35;Height:=21; text:=''; + hint:='Détecteur 2 de fermeture'; + showhint:=true; parent:=GroupBoxPNZ; onChange:=formConfig.modif_editT; end; @@ -4544,6 +4816,8 @@ begin Name:='EditZDet1V2O'; left:=152;Top:=74;Width:=35;Height:=21; text:=''; + hint:='Détecteur 1 d''ouverture'; + showhint:=true; parent:=GroupBoxPNZ; onChange:=formConfig.modif_editT; end; @@ -4553,6 +4827,8 @@ begin Name:='EditZDet2V2O'; left:=190;Top:=74;Width:=35;Height:=21; text:=''; + hint:='Détecteur 2 d''ouverture'; + showhint:=true; parent:=GroupBoxPNZ; onChange:=formConfig.modif_editT; end; @@ -4572,6 +4848,8 @@ begin Name:='EditZDet1V3F'; left:=64;Top:=98;Width:=35;Height:=21; text:=''; + hint:='Détecteur 1 de fermeture'; + showhint:=true; parent:=GroupBoxPNZ; onChange:=formConfig.modif_editT; end; @@ -4581,6 +4859,8 @@ begin Name:='EditZDet2V3F'; left:=100;Top:=98;Width:=35;Height:=21; text:=''; + hint:='Détecteur 2 de fermeture'; + showhint:=true; parent:=GroupBoxPNZ; onChange:=formConfig.modif_editT; end; @@ -4591,6 +4871,8 @@ begin left:=152;Top:=98;Width:=35;Height:=21; text:=''; parent:=GroupBoxPNZ; + hint:='Détecteur 1 d''ouverture'; + showhint:=true; onChange:=formConfig.modif_editT; end; EditZDet2V3O:=TEdit.create(FormConfig.GroupBoxPNA); @@ -4600,6 +4882,8 @@ begin left:=190;Top:=98;Width:=35;Height:=21; text:=''; parent:=GroupBoxPNZ; + hint:='Détecteur 2 d''ouverture'; + showhint:=true; onChange:=formConfig.modif_editT; end; // voie 4 @@ -4617,6 +4901,8 @@ begin Name:='EditZDet1V4F'; left:=64;Top:=122;Width:=35;Height:=21; text:=''; + hint:='Détecteur 1 de fermeture'; + showhint:=true; parent:=GroupBoxPNZ; onChange:=formConfig.modif_editT; end; @@ -4626,6 +4912,8 @@ begin Name:='EditZDet2V4F'; left:=100;Top:=122;Width:=35;Height:=21; text:=''; + hint:='Détecteur 2 de fermeture'; + showhint:=true; parent:=GroupBoxPNZ; onChange:=formConfig.modif_editT; end; @@ -4636,6 +4924,8 @@ begin left:=152;Top:=122;Width:=35;Height:=21; text:=''; parent:=GroupBoxPNZ; + hint:='Détecteur 1 d''ouverture'; + showhint:=true; onChange:=formConfig.modif_editT; end; EditZDet2V4O:=TEdit.create(FormConfig.GroupBoxPNA); @@ -4645,6 +4935,8 @@ begin left:=190;Top:=122;Width:=35;Height:=21; text:=''; parent:=GroupBoxPNZ; + hint:='Détecteur 2 d''ouverture'; + showhint:=true; onChange:=formConfig.modif_editT; end; // voie 5 @@ -4663,6 +4955,8 @@ begin left:=64;Top:=146;Width:=35;Height:=21; text:=''; parent:=GroupBoxPNZ; + hint:='Détecteur 1 de fermeture'; + showhint:=true; onChange:=formConfig.modif_editT; end; EditZDet2V5F:=TEdit.create(FormConfig.GroupBoxPNA); @@ -4672,6 +4966,8 @@ begin left:=100;Top:=146;Width:=35;Height:=21; text:=''; parent:=GroupBoxPNZ; + hint:='Détecteur 2 de fermeture'; + showhint:=true; onChange:=formConfig.modif_editT; end; EditZDet1V5O:=TEdit.create(FormConfig.GroupBoxPNA); @@ -4681,6 +4977,8 @@ begin left:=152;Top:=146;Width:=35;Height:=21; text:=''; parent:=GroupBoxPNZ; + hint:='Détecteur 1 d''ouverture'; + showhint:=true; onChange:=formConfig.modif_editT; end; EditZDet2V5O:=TEdit.create(FormConfig.GroupBoxPNA); @@ -4690,10 +4988,13 @@ begin left:=190;Top:=146;Width:=35;Height:=21; text:=''; parent:=GroupBoxPNZ; + hint:='Détecteur 2 d''ouverture'; + showhint:=true; onChange:=formConfig.modif_editT; end; // remplit les 5 fenêtres de config des aiguillages branches signaux, actionneurs, accessoires comusb + formconfig.ComboBoxDecodeurPerso.AutoComplete:=false; // mettre absolument à false sinon remplissage auto quand on tape et l'index sélec peut changer!!! for i:=1 to NbreDecPers do begin s:=decodeur_pers[i].nom; @@ -4708,6 +5009,7 @@ begin else formconfig.ComboBoxDecodeurPerso.ItemIndex:=-1; maj_decodeurs; + // aiguillages ListBoxAig.Clear; for i:=1 to MaxAiguillage do @@ -4848,7 +5150,7 @@ begin end; // périphériques - with listBoxAcc do + with listBoxPeriph do begin clear; formConfig.ComboBoxAccComUSB.Clear; @@ -4983,16 +5285,21 @@ begin AncLigneClicAct:=-1; ligneClicAccCOM:=-1; AncligneClicAccCOM:=-1; + end; // décode un morceau d'une chaine d'aiguillage ('P5S') -// +// // si erreur, B='?' procedure decodeAig(s : string;var adr : integer;var B : char); var erreur,i : integer; begin - if s='' then begin B:='?';adr:=0;exit;end; + if s='' then + begin + B:='?';adr:=0; + exit; + end; if (s[1]='P') or (s[1]='S') or (s[1]='D') then delete(s,1,1); if s='' then begin @@ -5019,13 +5326,13 @@ procedure Aff_champs_accCOMUSB_tablo(index : integer); begin if (index<1) or (index>NbPeriph) then exit; clicliste:=true; - formConfig.editNomAcc.Text:=Tablo_acc_COMUSB[index].nom; - cb1.Checked:=Tablo_acc_COMUSB[index].ScvAig; - cb2.Checked:=Tablo_acc_COMUSB[index].ScvDet; - cb3.Checked:=Tablo_acc_COMUSB[index].ScvAct; - cbVis.Checked:=Tablo_acc_COMUSB[index].ScvVis; - CheckBoxCR.Checked:=Tablo_acc_COMUSB[index].cr; - EditPortCde.text:=Tablo_acc_COMUSB[index].protocole; + formConfig.editNomAcc.Text:=Tablo_periph[index].nom; + cb1.Checked:=Tablo_periph[index].ScvAig; + cb2.Checked:=Tablo_periph[index].ScvDet; + cb3.Checked:=Tablo_periph[index].ScvAct; + cbVis.Checked:=Tablo_periph[index].ScvVis; + CheckBoxCR.Checked:=Tablo_periph[index].cr; + EditPortCde.text:=Tablo_periph[index].protocole; clicliste:=false; end; @@ -5166,7 +5473,6 @@ begin EditDroit_BD.Hint:=TypeElAIg_to_char(aiguillage[index].Ddroit,aiguillage[index].DdroitB); LabelTJD2.Caption:=IntToSTR(adresse); end; - CheckInverse.checked:=aiguillage[Index_Aig(adresse)].inversionCDM=1; @@ -5270,6 +5576,14 @@ procedure champs_type_pn; begin with formconfig do begin + GroupBoxPN.width:=GroupBox13.width-15; + RadioGroupActPN.Width:=GroupBoxPN.Width-15; + GroupBoxPNA.width:=GroupBox13.Width-15; + GroupBoxPNZ.width:=GroupBox13.Width-15; + + ButtonTestFerme.Left:=215; + ButtonTestOuvre.Left:=215; + GroupBoxRadio.Visible:=false; GroupBoxAct.Visible:=false; GroupBoxPN.Top:=16; @@ -5294,15 +5608,28 @@ begin begin GroupBoxRadio.Visible:=true; GroupBoxRadio.top:=16; - GroupBoxRadio.Left:=16; + GroupBoxRadio.Left:=8; + GroupBoxRadio.Width:=GroupBox13.width-15; + + GroupBox13.Width:=266; + GroupBoxAct.Top:=GroupBoxRadio.Top+GroupBoxRadio.Height+8; - GroupBoxAct.Left:=16; + GroupBoxAct.Left:=8; GroupBoxAct.Height:=310; + GroupBoxAct.Width:=GroupBox13.width-15; + GroupBox18.Top:=16; + GroupBox18.Width:=GroupBoxAct.Width-15; GroupBox18.Height:=150; + GroupBox19.Top:=GroupBox18.Top+GroupBox18.Height+8; + GroupBox19.Left:=8; + GroupBox19.Width:=GroupBoxAct.Width-15; GroupBox19.Height:=96; ButtonTestAct.Top:=GroupBox19.Top+GroupBox19.Height+8; + + RadioGroup1.Width:=GroupBox18.width-15; + RadioGroup1.Height:=74; end; end; @@ -5353,7 +5680,7 @@ begin GroupBoxAct.Caption:='Action pour commande sur COM/USB'; LabelTempo.Visible:=true; EditTempo.visible:=true; editEtatFoncSortie.visible:=false;LabelA.Visible:=false; LabelFonction.visible:=true; - LabelFonction.caption:='Périphérique COM/USB'; + LabelFonction.caption:='Périphérique COM/USB/Socket'; LabelFonction.Top:=18; ComboBoxAccComUSB.Top:=32; @@ -5950,36 +6277,38 @@ begin end; end; -procedure champs_pn_COMUSB; +procedure champs_pn_COMUSBSockets; var s : string; begin with formConfig do begin comboBoxPNCom.Visible:=true; + ComboBoxPNCom.Width:=150; + ComboBoxPNCom.Left:=4; EditAdrFerme.visible:=false; editAdrOuvre.Visible:=false; CheckPnPulse.Visible:=false; - EditCdeOuvre.width:=65; - editCdeFerme.width:=65; + EditCdeOuvre.width:=50; + editCdeFerme.width:=50; editCdeFerme.top:=128; - editCdeFerme.Left:=144; - editCdeOuvre.Left:=144; + editCdeFerme.Left:=160; + editCdeOuvre.Left:=160; ButtonTestFerme.Hint:='Test de fermeture (par interface COM/USB)'; ButtonTestOuvre.Hint:='Test d''ouverture (par interface COM/USB)'; editcdeFerme.Hint:='Commande ASCII de fermeture'; EditCdeOuvre.Hint:='Commande ASCII d''ouverture'; Label22.visible:=false; ButtonTestFerme.Top:=128; - Label21.Caption:='Périphérique COM/USB Commandes'; + Label21.Caption:='Périphérique COM/USB/Socket Commandes'; EditCdeFerme.Text:=Tablo_PN[lignecliqueePN+1].CommandeF; EditCdeOuvre.Text:=Tablo_PN[lignecliqueePN+1].CommandeO; - ComboBoxPnCom.ItemIndex:=Tablo_PN[lignecliqueePN+1].AdresseFerme; + ComboBoxPnCom.ItemIndex:=Tablo_PN[lignecliqueePN+1].AdresseFerme-1; end; end; // affiche les champs de l'actionneur PN en fonction de l'index du tableau procedure aff_champs_PN(i : integer); -var adresse,erreur,j,v : integer; +var adresse,erreur,j,v,periph : integer; trouve : boolean; s : string; begin @@ -5998,23 +6327,24 @@ begin if s[1]='(' then begin champs_type_pn; - // trouver l'index dans le tableau - i:=pos('PN(',s); - delete(s,1,i+2); - val(s,adresse,erreur); + // trouver le numéro de périphérique + v:=pos('PN(',s); + delete(s,1,v+2); + val(s,periph,erreur); + { i:=0; repeat inc(i); trouve:=(Tablo_PN[i].AdresseFerme=adresse); until trouve or (i>NbrePN); - if not(trouve) then exit; + if not(trouve) then exit;} - with formConfig do + with formConfig do begin RadioGroupActPN.itemindex:=Tablo_PN[i].TypeCde; if Tablo_PN[i].TypeCde=0 then champs_pn_act; - if Tablo_PN[i].TypeCde=1 then champs_pn_comusb; + if Tablo_PN[i].TypeCde=1 then champs_pn_comusbSockets; if Tablo_PN[i].Pulse=1 then trouve:=true else trouve:=false; CheckPnPulse.Checked:=trouve; @@ -6673,7 +7003,7 @@ end; function verif_dec_sig(aff : boolean) : boolean; var Adr,i,dec,aspect,indexAspect : integer; begin - result:=true; // ok + result:=true; for i:=1 to NbreFeux do begin dec:=feux[i].decodeur; @@ -6784,8 +7114,6 @@ begin end; - - procedure TFormConfig.EditDet1Change(Sender: TObject); var s : string; i,erreur : integer; @@ -6868,7 +7196,6 @@ begin Suiv1; end; - procedure Det2; var s : string; i,erreur : integer; @@ -7005,7 +7332,6 @@ begin det3; end; - procedure Suiv3; var s : string; erreur,i : integer; @@ -7177,12 +7503,10 @@ begin else LabelInfo.Caption:=''; end else LabelInfo.Caption:=''; - end; end; end; - procedure TFormConfig.EditAct2Change(Sender: TObject); var s : string; det1,det2,erreur,suiv : integer; @@ -7571,7 +7895,7 @@ var indexTCO,x,y,i,index,aspect,adresseFeu : integer; bm :tbitmap; begin if clicListe then exit; - indexTCO:=index_TCO(sender); + if affevt then Affiche('Evt aspect',clOrange); i:=ComboBoxAsp.ItemIndex; //Affiche(IntToSTR(i),clyellow); @@ -7612,18 +7936,22 @@ begin if bm=nil then exit; Feux[index].Img.picture.Bitmap:=bm; dessine_signal_mx(Feux[index].Img.Canvas,0,0,1,1,feux[index].adresse,1); // dessine les feux du signal - // et dans le TCO - if formTCO[indexTCO].Showing then + + // et dans les TCOs + for IndexTCO:=1 to NbreTCO do begin - for y:=1 to NbreCellY[indexTCO] do - for x:=1 to NbreCellX[indexTCO] do + if formTCO[indexTCO]<>nil then + begin + for y:=1 to NbreCellY[indexTCO] do + for x:=1 to NbreCellX[indexTCO] do begin - if TCO[1,x,y].BImage=Id_Signal then // &&& balayer tous les tco + if TCO[indexTCO,x,y].BImage=Id_Signal then // &&& balayer tous les tco begin AdresseFeu:=feux[index].adresse; - if tco[1,x,y].Adresse=AdresseFeu then affiche_tco(indexTCO); + if tco[IndexTCO,x,y].Adresse=AdresseFeu then affiche_tco(indexTCO); end; end; + end; end; end; @@ -8504,7 +8832,7 @@ begin begin index_accessoire[aiguillage[i].adresse]:=i; end; - + // vérification de la cohérence1 // parcoure les branches jusqu'à trouver un aiguillage pour voir s'il a été décrit ok:=true; @@ -8999,7 +9327,7 @@ begin ok:=false; end; end; - + if (model2=aig) or (model2=triple) then begin if c='D' then @@ -9047,7 +9375,7 @@ begin if (adr<>aiguillage[index2].Adevie) and (adr<>aiguillage[index2].ADroit) and (adr<>aiguillage[index3].ADevie) and (adr<>aiguillage[index3].Adroit) then begin - Affiche('Erreur 10.42: Discordance de déclaration aiguillage '+intToSTR(adr)+': '+intToSTR(adr2),clred); + Affiche('Erreur 10.42: Discordance de déclaration aiguillage '+intToSTR(adr)+': '+intToSTR(adr2),clred); ok:=false; end; end; @@ -9071,7 +9399,7 @@ begin end; end; end; - end; + end; end; end; end; @@ -9306,7 +9634,7 @@ begin j:=Tablo_actionneur[i].fonction; if j>10 then begin Affiche('Erreur 15.1 pilotage actionneur '+intToSTR(Tablo_actionneur[i].adresse),clred);ok:=false;end; if j=0 then begin Affiche('Erreur 15.2 L''actionneur '+intToSTR(Tablo_actionneur[i].adresse)+' n''a pas d''accessoire COM/USB d''affecté',clOrange);ok:=false;end; - if (j>0) and (j<11) and (Tablo_acc_COMUSB[j].NumCom=0) then + if (j>0) and (j<11) and (Tablo_periph[j].NumCom=0) then begin Affiche('Erreur 15.3 L''actionneur '+intToSTR(Tablo_actionneur[i].adresse)+' n''a pas d''accessoire COM/USB d''affecté',clOrange); ok:=false; @@ -9345,6 +9673,7 @@ begin begin adresse:=Tablo_actionneur[i].Adresse; adresse2:=Tablo_actionneur[i].Adresse2; + //Affiche('Det_contigu '+intToSTR(adresse)+' '+intToSTR(adresse2),clred); det_contigu(adresse,adresse2,suivant,SuivModel); if (suivant=0) or (suivant>9995) then begin @@ -9358,6 +9687,33 @@ begin // vérification des compatibilités des décodeurs de signaux et des aspects if not(verif_dec_sig(true)) then ok:=false; + // vérifie dans les branches si on a pas de doublon de détecteur + for i:=1 to NbreBranches do + begin + j:=1; + repeat + detect:=BrancheN[i][j].Adresse; + model:=BrancheN[i][j].BType; // 1= détecteur 2= aiguillage 4=Buttoir + + if model=det then + begin + k:=j+1; + repeat + if BrancheN[i][k].Btype=det then + begin + l:=BrancheN[i][k].Adresse; + if detect=l then + begin + Affiche('Erreur 20 : détecteur '+intToSTR(detect)+' défini plusieurs fois en branche '+intToSTR(i),clred); + ok:=false; + end; + end; + inc(k); + until (BrancheN[i,k].BType=rien) and (BrancheN[i,k].Adresse=0); + end; + j:=j+1; + until((model=rien) and (detect=0)); + end; verif_coherence:=ok; end; @@ -10010,8 +10366,8 @@ begin end; BrancheN[i,j].adresse:=adresse; BrancheN[i,j].btype:=aig; // ident aiguillage - aiguillage[adresse].NumBranche:=i; - aiguillage[adresse].IndexBranche:=j; + aiguillage[index_aig(adresse)].NumBranche:=i; // aiguillage[] est indexé par un index + aiguillage[index_aig(adresse)].IndexBranche:=j; end else begin @@ -10031,7 +10387,7 @@ begin end; BrancheN[i,j].adresse:=detect; // adresse BrancheN[i,j].btype:=det;// ident détecteur - detecteur[detect].NumBranche:=i; + detecteur[detect].NumBranche:=i; // detecteur[] est indexé par le détecteur detecteur[detect].IndexBranche:=j; if detect=0 then begin BrancheN[i,j].btype:=buttoir;end; // buttoir @@ -10419,9 +10775,8 @@ end; procedure TFormConfig.SpeedButtonJoueClick(Sender: TObject); begin - if (ligneclicAct<0) then exit; - if PlaySound(pchar(EditSon.Text),0,SND_ASYNC)=false then - labelInfo.Caption:='Erreur'; + if (ligneclicAct<0) then exit; + if PlaySound(pchar(EditSon.Text),0,SND_ASYNC)=false then labelInfo.Caption:='Erreur'; end; @@ -10672,6 +11027,12 @@ begin end; end; end; + + if (Shift = [ssCtrl]) and (key = ord('A')) then + begin + ListBoxAig.SelectAll; + end; + clicListe:=false; end; @@ -10684,8 +11045,6 @@ begin if ok then Sauve_config; end; - - procedure TFormConfig.ButtonTestFermeClick(Sender: TObject); var i,adr,cmd,erreur : integer; ts : Taccessoire; @@ -10704,7 +11063,7 @@ begin else begin cmd:=Tablo_PN[i].AdresseFerme; // numéro accessoire - cmd:=com_socket(cmd); + cmd:=com_socket(cmd); // si cmd ou socket if cmd=1 then ferme_pn_usb(i); if cmd=2 then ferme_pn_socket(i); end; @@ -10907,12 +11266,10 @@ begin ListBoxTrains.items[ligneclicTrain]:=Train_tablo(ligneclicTrain+1); ListBoxTrains.selected[ligneclicTrain]:=true; - i:=formprinc.ComboTrains.ItemIndex; if i<0 then exit; formprinc.ComboTrains.Items[ligneclicTrain]:=EditNomTrain.text; if i=ligneclicTrain then formprinc.ComboTrains.Text:=EditNomTrain.text; - end; procedure TFormConfig.EditAdresseTrainChange(Sender: TObject); @@ -11120,6 +11477,9 @@ begin end; end; end; + + if (Shift = [ssCtrl]) and (key = ord('A')) then ListBoxAct.SelectAll; + clicListe:=false; end; @@ -11211,6 +11571,9 @@ begin end; end; end; + + if (Shift = [ssCtrl]) and (key = ord('A')) then ListBoxTrains.SelectAll; + clicListe:=false; end; @@ -11259,14 +11622,18 @@ procedure TFormConfig.EditLAYExit(Sender: TObject); end; procedure TFormConfig.Copier1Click(Sender: TObject); - begin - RichBranche.CopyToClipboard; - RichBranche.SetFocus; + var tc : Trichedit; +begin + tc:=(Tpopupmenu(Tmenuitem(sender).GetParentMenu).PopupComponent) as TRichEdit ; + tc.CopyToClipboard; + tc.SetFocus; end; procedure TFormConfig.Coller1Click(Sender: TObject); - begin - With RichBranche do + var tc : Trichedit; +begin + tc:=(Tpopupmenu(Tmenuitem(sender).GetParentMenu).PopupComponent) as TRichEdit ; + With tc do begin PasteFromClipboard; SetFocus; @@ -11298,6 +11665,12 @@ begin LabelInfo.caption:=decodeDCC(lines[ligneDCC]); end; + + if (Shift=[ssCtrl]) and (key=ord('A')) then + begin + RichCdeDccpp.SelectAll; + end; + end; @@ -11483,7 +11856,6 @@ begin if not(V5Valide) then tablo_PN[i].NbVoies:=4; end; - s:=encode_act_PN(i); ListBoxPN.items[lignecliqueePN]:=s; ListBoxPN.Selected[lignecliqueePN]:=true; @@ -11565,7 +11937,6 @@ begin EditT[i].visible:=false; ComboL1[i].Visible:=false; ComboL2[i].Visible:=false; - end; end; @@ -11577,11 +11948,12 @@ end; begin if NbreDecPers>=NbreMaxiDecPers then exit; - inc(NbreDecPers); s:='Personnalisé '+intToSTR(NbreDecPers); decodeur_pers[NbreDecPers].nom:=s; decodeur_pers[NbreDecPers].Nation:=1; + decodeur_pers[NbreDecPers].Commande:=0; + nombre:=4; decodeur_pers[NbreDecPers].NbreAdr:=nombre; formconfig.EditNbreAdr.Text:=intToSTR(nombre); @@ -11635,6 +12007,9 @@ begin if affevt then Affiche('Evt ComboBoxDecodeurPerso',clyellow); a:=ComboBoxDecodeurPerso.ItemIndex; + if a>=0 then decCourant:=a+1; + + //Affiche(intToSTR(a+1)+' courant='+intToSTR(decCourant),clred); if a=-1 then begin // changement du nom @@ -11653,7 +12028,7 @@ begin exit; end; - decCourant:=a+1; + EditNbreAdr.Text:=intToSTR(decodeur_pers[decCourant].NbreAdr); //Affiche('Décodeur courant = '+intToSTR(decCourant),clyellow); maj_decodeurs; @@ -11736,7 +12111,6 @@ begin dec(feux[i].decodeur); // et décrémenter les autres décodeurs personnalisés de rang supérieur aff:=true; end; - end; // réafficher le richedit des signaux @@ -11787,34 +12161,34 @@ begin // signal normal - // boucle de ligne - for ligne:=1 to 6 do - begin - s:=uppercase(MemoBlanc.Lines[ligne-1]); - clicListe:=true; - MemoBlanc.Lines[ligne-1]:=s; - clicListe:=false; - sO:=s; - j:=1; - if s<>'' then - repeat - if s[1]<>'A' then begin LabelInfo.Caption:='Erreur manque A : '+sO;exit;end; - delete(s,1,1); - val(s,adr,erreur); // adresse - if adr=0 then exit; - c:=#0; - if erreur<>0 then c:=s[erreur]; // S ou D - if (c<>'D') and (c<>'S') then begin LabelInfo.Caption:='Erreur manque D ou S : '+sO;exit;end; - setlength(feux[ligneClicSig+1].condFeuBlanc[ligne],j+1); - feux[ligneClicSig+1].condFeuBlanc[ligne][j].PosAig:=c; - feux[ligneClicSig+1].condFeuBlanc[ligne][j].Adresse:=adr; - delete(s,1,erreur); // supprime jusque D - if length(s)<>0 then if s[1]=',' then delete(s,1,1); - inc(j); - until s='' - else - setlength(feux[ligneClicSig+1].condFeuBlanc[ligne],0); - end; + // boucle de ligne + for ligne:=1 to 6 do + begin + s:=uppercase(MemoBlanc.Lines[ligne-1]); + clicListe:=true; + MemoBlanc.Lines[ligne-1]:=s; + clicListe:=false; + sO:=s; + j:=1; + if s<>'' then + repeat + if s[1]<>'A' then begin LabelInfo.Caption:='Erreur manque A : '+sO;exit;end; + delete(s,1,1); + val(s,adr,erreur); // adresse + if adr=0 then exit; + c:=#0; + if erreur<>0 then c:=s[erreur]; // S ou D + if (c<>'D') and (c<>'S') then begin LabelInfo.Caption:='Erreur manque D ou S : '+sO;exit;end; + setlength(feux[ligneClicSig+1].condFeuBlanc[ligne],j+1); + feux[ligneClicSig+1].condFeuBlanc[ligne][j].PosAig:=c; + feux[ligneClicSig+1].condFeuBlanc[ligne][j].Adresse:=adr; + delete(s,1,erreur); // supprime jusque D + if length(s)<>0 then if s[1]=',' then delete(s,1,1); + inc(j); + until s='' + else + setlength(feux[ligneClicSig+1].condFeuBlanc[ligne],0); + end; s:=encode_sig_feux(ligneClicSig+1); ListBoxSig.Items[ligneClicSig]:=s; @@ -11893,6 +12267,12 @@ begin end; end; end; + + if (Shift = [ssCtrl]) and (key = ord('A')) then + begin + ListBoxSig.SelectAll; + end; + clicListe:=false; end; @@ -11908,7 +12288,6 @@ begin if nbrePN<1 then exit; for i:=0 to ListBoxAct.items.Count-1 do ListBoxAct.selected[i]:=false; - lignecliqueePN:=listBoxPN.ItemIndex; if lignecliqueePN<0 then exit; // désactiver la ligne act @@ -11960,6 +12339,9 @@ begin end; end; end; + + if (Shift = [ssCtrl]) and (key = ord('A')) then ListBoxPN.SelectAll; + clicListe:=false; end; @@ -11980,9 +12362,9 @@ var ss,s : string; n:=0; for i:=0 to NbPeriph-1 do begin - if formconfig.ListBoxAcc.selected[i] then + if formconfig.ListBoxPeriph.selected[i] then begin - ss:=ss+ tablo_acc_comusb[i+1].nom+' '; + ss:=ss+ Tablo_periph[i+1].nom+' '; inc(n); end; end; @@ -12001,16 +12383,16 @@ var ss,s : string; n:=0; i:=1; repeat - if formconfig.ListBoxAcc.selected[i-1] then + if formconfig.ListBoxPeriph.selected[i-1] then begin for j:=i to NbPeriph-1 do begin - formconfig.ListBoxAcc.selected[j-1]:=formconfig.ListBoxAcc.selected[j]; - tablo_acc_comusb[j]:=tablo_acc_comusb[j+1]; + formconfig.ListBoxPeriph.selected[j-1]:=formconfig.ListBoxPeriph.selected[j]; + Tablo_periph[j]:=Tablo_periph[j+1]; end; dec(NbPeriph); - tablo_acc_comusb[NbPeriph+1].NumCom:=0; + Tablo_periph[NbPeriph+1].NumCom:=0; i:=0; end; inc(i); @@ -12019,9 +12401,11 @@ var ss,s : string; if NbPeriph<=NbMaxi_periph then formConfig.LabelInfoAcc.caption:=''; config_modifie:=true; - FormConfig.ListBoxAcc.Clear; + FormConfig.ListBoxPeriph.Clear; + //supprimer les champs des combos formConfig.ComboBoxAccComUSB.Clear; formconfig.ComboBoxPNCom.Clear; + formConfig.comboBoxDecCde.Clear; // réafficher la liste for i:=1 to NbPeriph do @@ -12030,8 +12414,8 @@ var ss,s : string; if s<>'' then begin Tablo_com_cde[i].NumAcc:=i; - FormConfig.ListBoxAcc.items.Add(s); - maj_champs_combos(i); + FormConfig.ListBoxPeriph.items.Add(s); + ajoute_champs_combos(i); end; end; ligneclicAccCom:=-1; @@ -12039,7 +12423,7 @@ var ss,s : string; clicliste:=false; end; -procedure ajoute_acc; +procedure ajoute_Periph; var i : integer; s : string; begin @@ -12051,19 +12435,19 @@ begin clicliste:=true; // désélectionne tout - with formconfig.ListBoxAcc do + with formconfig.ListBoxPeriph do for i:=0 to items.Count-1 do Selected[i]:=false; - inc(NbPeriph); + inc(NbPeriph); if NbPeriph>10 then formConfig.LabelInfoAcc.caption:='Nombre maxi de périphériques atteint : '+intToStr(NbPeriph); i:=NbPeriph; - Tablo_acc_COMUSB[i].nom:=''; - Tablo_acc_COMUSB[i].NumCom:=0; + Tablo_periph[i].nom:=''; + Tablo_periph[i].NumCom:=0; s:=encode_Periph(i); // scroller à la fin et sélectionner - with formconfig.ListBoxAcc do + with formconfig.ListBoxPeriph do begin items.add(s); selected[i-1]:=true; @@ -12078,7 +12462,7 @@ begin s:='Nouveau périphérique'; formConfig.ComboBoxAccComUSB.Items.Add(s); formconfig.ComboBoxPNCom.Items.Add(s); - formconfig.EditNomAcc.text:=s; + formconfig.EditNomAcc.text:=s; // ??? clicliste:=false; config_modifie:=true; end; @@ -12095,7 +12479,7 @@ begin if s='ListBoxSig' then supprime_sig; if s='ListBoxAig' then supprime_aig; if s='ListBoxTrains' then supprime_Train; - if s='ListBoxAcc' then supprime_periph; + if s='ListBoxPeriph' then supprime_periph; end; @@ -12105,27 +12489,12 @@ var tl: TListBox; begin tl:=(Tpopupmenu(Tmenuitem(sender).GetParentMenu).PopupComponent) as TlistBox ; s:=tl.name; - if s='ListBoxAct' then - begin - ajoute_actionneur; - end; - if s='ListBoxPN' then - begin - ajoute_PN; - end; - if s='ListBoxSig' then - begin - ajoute_signal; - end; - if s='ListBoxAig' then - begin - ajoute_aiguillage; - end; - if s='ListBoxTrains' then - begin - ajoute_train; - end; - if s='ListBoxAcc' then ajoute_acc; + if s='ListBoxAct' then ajoute_actionneur; + if s='ListBoxPN' then ajoute_PN; + if s='ListBoxSig' then ajoute_signal; + if s='ListBoxAig' then ajoute_aiguillage; + if s='ListBoxTrains' then ajoute_train; + if s='ListBoxPeriph' then ajoute_periph; end; procedure TFormConfig.outcopierentatquetexte1Click(Sender: TObject); @@ -12150,19 +12519,17 @@ begin for i:=1 to NbPeriph do begin - index:=tablo_com_cde[i].NumAcc; - if com_socket(i)=1 then // si port comusb begin - if connecte_port_usb_periph(index) then - Affiche('COM'+intToSTR(tablo_acc_comusb[index].numcom)+' périphérique ouvert',clLime) - else Affiche('COM'+intToSTR(tablo_acc_comusb[index].numcom)+' périphérique non ouvert',clOrange); + if connecte_port_usb_periph(i) then + Affiche('COM'+intToSTR(Tablo_periph[i].numcom)+' périphérique ouvert',clLime) + else Affiche('COM'+intToSTR(Tablo_periph[i].numcom)+' périphérique non ouvert',clOrange); end else begin // si port com socket - if connecte_socket_periph(i) then Affiche('Socket '+tablo_acc_comusb[i].protocole+' demande ouverture ',clLime) + if connecte_socket_periph(i) then Affiche('Socket '+Tablo_periph[i].protocole+' demande ouverture ',clLime) else - Affiche('Socket '+tablo_acc_comusb[i].protocole+' commande périphérique non ouvert',clOrange); + Affiche('Socket '+Tablo_periph[i].protocole+' commande périphérique non ouvert',clOrange); end; end; end; @@ -12170,7 +12537,7 @@ end; procedure TFormConfig.ButtonAjAccComClick(Sender: TObject); begin - ajoute_acc; + ajoute_Periph; end; procedure TFormConfig.EditNomAccChange(Sender: TObject); @@ -12181,22 +12548,22 @@ begin with Formconfig do begin s:=EditNomAcc.Text; - Tablo_acc_COMUSB[ligneClicAccCOM+1].nom:=s; + Tablo_periph[ligneClicAccCOM+1].nom:=s; maj_champs_combos(ligneClicAccCOM+1); s:=encode_Periph(ligneClicAccCOM+1); - ListBoxAcc.Items[ligneClicAccCOM]:=s; - ListBoxAcc.Selected[ligneClicAccCOM]:=true; + ListBoxPeriph.Items[ligneClicAccCOM]:=s; + ListBoxPeriph.Selected[ligneClicAccCOM]:=true; end; end; -procedure TFormConfig.ListBoxAccMouseDown(Sender: TObject; +procedure TFormConfig.ListBoxPeriphMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); var i,lc : integer; s : string; begin clicliste:=true; if NbPeriph<1 then exit; - with Formconfig.ListBoxAcc do + with Formconfig.ListBoxPeriph do begin i:=0; lc:=itemindex; @@ -12230,10 +12597,10 @@ end; procedure TFormConfig.ButtonSupAccComClick(Sender: TObject); begin - supprime_periph + supprime_periph; end; - procedure TFormConfig.ListBoxAccKeyDown(Sender: TObject; var Key: Word; + procedure TFormConfig.ListBoxPeriphKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); begin if NbPeriph<1 then exit; @@ -12242,8 +12609,8 @@ begin begin if clicListe then exit; clicListe:=true; - if affevt then affiche('Evt ListBoxAcc.Items keydown',clyellow); - with Formconfig.ListBoxAcc.Items do + if affevt then affiche('Evt ListBoxPeriph.Items keydown',clyellow); + with Formconfig.ListBoxPeriph.Items do begin if ligneclicAccCom>0 then begin @@ -12261,8 +12628,8 @@ begin begin if clicListe then exit; clicListe:=true; - if affevt then affiche('Evt ListBoxAcc.Items keydown',clyellow); - with Formconfig.ListBoxAcc.Items do + if affevt then affiche('Evt ListBoxPeriph.Items keydown',clyellow); + with Formconfig.ListBoxPeriph.Items do begin if ligneclicAccCom0; + inc(LigneCherche); + until (LigneCherche>=Lines.Count) or trouve; + + if trouve then + begin + inc(compt_Ligne); + //Affiche('trouvé en '+Lines[ligneErreur-1],clred); + l:=0; + for i:=0 to ligneCherche-1 do + begin + l:=l+length(Lines[i])+2; + end; + SelStart:= l-length(s)+positionErreur-3; + SelLength:=length(sc); + //SetFocus; // afficher la sélection + Perform(EM_SCROLLCARET,0,0); // et scroller à l'endroit de la sélection + end + else + begin + LigneCherche:=0; + end; + end; + +end; + +procedure TFormConfig.EditChercherChange(Sender: TObject); + begin + ligneCherche:=0; +end; + end. diff --git a/UnitDebug.pas b/UnitDebug.pas index dfdcfdf..0010771 100644 --- a/UnitDebug.pas +++ b/UnitDebug.pas @@ -248,9 +248,9 @@ var i,l,positionErreur : integer; s : string; trouve : boolean; begin - // faire avec with RichDebug do begin + ligneErreur:=0; repeat s:=lowercase(Lines[ligneErreur]); positionErreur:=pos('erreur',s); diff --git a/UnitPareFeu.pas b/UnitPareFeu.pas index f7dc5d0..f566286 100644 --- a/UnitPareFeu.pas +++ b/UnitPareFeu.pas @@ -24,7 +24,7 @@ Const NET_FW_MODIFY_STATE_INBOUND_BLOCKED=2; nom_regle_cdm='CDM rail'; -// Ajoute une règle à un programme en utilisant Microsoft Windows Firewall APIs. +// Ajoute une règle au pare feu pour un programme en utilisant Microsoft Windows Firewall APIs. function AddApplicationRule : boolean; var CurrentProfiles,fwPolicy2,RulesObject,NewRule : OleVariant; @@ -32,7 +32,7 @@ var r : boolean; begin fichier:=CheminProgrammes+'\CDM-Rail\cdr.exe'; - + // Crée l'objet FwPolicy2 fwPolicy2:=CreateOleObject('HNetCfg.FwPolicy2'); RulesObject:=fwPolicy2.Rules; diff --git a/UnitPilote.dfm b/UnitPilote.dfm index 6f79c89..eb40253 100644 --- a/UnitPilote.dfm +++ b/UnitPilote.dfm @@ -1,6 +1,6 @@ object FormPilote: TFormPilote - Left = 479 - Top = 202 + Left = 464 + Top = 227 BorderStyle = bsDialog Caption = 'Pilotage' ClientHeight = 350 diff --git a/UnitPrinc.dfm b/UnitPrinc.dfm index 793f8e3..00cfe3d 100644 --- a/UnitPrinc.dfm +++ b/UnitPrinc.dfm @@ -1,6 +1,6 @@ object FormPrinc: TFormPrinc - Left = 51 - Top = 236 + Left = 178 + Top = 243 Width = 1222 Height = 653 Caption = 'Signaux complexes' @@ -18,8 +18,8 @@ object FormPrinc: TFormPrinc OnCreate = FormCreate OnResize = FormResize DesignSize = ( - 1214 - 602) + 1206 + 594) PixelsPerInch = 96 TextHeight = 13 object LabelTitre: TLabel @@ -226,7 +226,7 @@ object FormPrinc: TFormPrinc Visible = False end object Image7feux: TImage - Left = 144 + Left = 376 Top = 0 Width = 57 Height = 105 @@ -1442,8 +1442,8 @@ object FormPrinc: TFormPrinc end object StatusBar1: TStatusBar Left = 0 - Top = 580 - Width = 1214 + Top = 572 + Width = 1206 Height = 22 Panels = < item @@ -1492,12 +1492,12 @@ object FormPrinc: TFormPrinc object Panel2: TPanel Left = 0 Top = 32 - Width = 1057 + Width = 1129 Height = 473 Anchors = [akLeft, akTop, akRight] TabOrder = 3 DesignSize = ( - 1057 + 1129 473) object SplitterV: TSplitter Left = 1 @@ -1533,10 +1533,10 @@ object FormPrinc: TFormPrinc OnMouseDown = FenRichMouseDown end object ScrollBox1: TScrollBox - Left = 550 + Left = 488 Top = 192 - Width = 563 - Height = 321 + Width = 497 + Height = 249 HorzScrollBar.Increment = 48 HorzScrollBar.Tracking = True VertScrollBar.Smooth = True @@ -1548,7 +1548,7 @@ object FormPrinc: TFormPrinc end object GroupBox1: TGroupBox Left = 489 - Top = 5 + Top = 13 Width = 265 Height = 52 Anchors = [akTop, akRight] @@ -1577,6 +1577,8 @@ object FormPrinc: TFormPrinc Height = 25 Hint = 'Ecriture des accessoires DCC' Caption = 'droit' + ParentShowHint = False + ShowHint = True TabOrder = 1 WordWrap = True OnClick = ButtonDroitClick @@ -1588,14 +1590,16 @@ object FormPrinc: TFormPrinc Height = 25 Hint = 'Ecriture des accessoires DCC' Caption = 'devi'#233 + ParentShowHint = False + ShowHint = True TabOrder = 2 WordWrap = True OnClick = ButtonDevieClick end end object GroupBox3: TGroupBox - Left = 505 - Top = 32 + Left = 489 + Top = 56 Width = 265 Height = 129 Anchors = [akTop, akRight] @@ -1830,7 +1834,7 @@ object FormPrinc: TFormPrinc end end object Panel1: TPanel - Left = 753 + Left = 761 Top = 5 Width = 296 Height = 180 @@ -1868,6 +1872,8 @@ object FormPrinc: TFormPrinc 'Mise '#224' jour des signaux suivant les zones occup'#233'es et les aiguil' + 'lages' Caption = 'Rafraichissement' + ParentShowHint = False + ShowHint = True TabOrder = 0 OnClick = BoutonRafClick end @@ -1898,6 +1904,8 @@ object FormPrinc: TFormPrinc Height = 33 Hint = 'Lance CDM Rail' Caption = 'Lance CDM rail' + ParentShowHint = False + ShowHint = True TabOrder = 3 OnClick = ButtonLanceCDMClick end @@ -1908,6 +1916,8 @@ object FormPrinc: TFormPrinc Height = 33 Hint = 'Affichage du panneau de contr'#244'le des trains ou des CV' Caption = 'Trains / CVs' + ParentShowHint = False + ShowHint = True TabOrder = 4 OnClick = ButtonLocCVClick end @@ -1920,6 +1930,8 @@ object FormPrinc: TFormPrinc 'Supprime les trains d'#233'tect'#233's ou en cas de nouveau RUN, permet de' + ' partir de 0' Caption = 'Raz trains ou nouveau RUN' + ParentShowHint = False + ShowHint = True TabOrder = 5 WordWrap = True OnClick = BoutonRazTrainsClick @@ -1930,6 +1942,8 @@ object FormPrinc: TFormPrinc Width = 89 Height = 33 Caption = 'Affiche le r'#233'seau CDM' + ParentShowHint = False + ShowHint = False TabOrder = 6 Visible = False WordWrap = True @@ -1967,8 +1981,8 @@ object FormPrinc: TFormPrinc end end object GroupBox2: TGroupBox - Left = 489 - Top = 64 + Left = 521 + Top = 40 Width = 265 Height = 105 Anchors = [akTop, akRight] @@ -2417,8 +2431,15 @@ object FormPrinc: TFormPrinc Top = 65528 end object PopupMenuFenRich: TPopupMenu - Left = 208 - Top = 16 + Left = 192 + Top = 8 + object outslectionner1: TMenuItem + Caption = 'Tout s'#233'lectionner' + OnClick = outslectionner1Click + end + object N15: TMenuItem + Caption = '-' + end object Copier1: TMenuItem Caption = 'Copier' OnClick = Copier1Click diff --git a/UnitPrinc.pas b/UnitPrinc.pas index 4b9e8d1..e0022ae 100644 --- a/UnitPrinc.pas +++ b/UnitPrinc.pas @@ -52,8 +52,8 @@ interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, OleCtrls, ExtCtrls, jpeg, ComCtrls, ShellAPI, TlHelp32, - ImgList, ScktComp, StrUtils, Menus, ActnList, MSCommLib_TLB, MMSystem , registry, - Buttons, NB30 ; + ImgList, ScktComp, StrUtils, Menus, ActnList, MSCommLib_TLB, MMSystem , + Buttons, NB30, comObj, activeX ; type TFormPrinc = class(TForm) @@ -214,6 +214,8 @@ type ClientSocketCde2: TClientSocket; EditEnvoi: TEdit; ButtonEnv: TButton; + N15: TMenuItem; + outslectionner1: TMenuItem; procedure FormCreate(Sender: TObject); procedure MSCommUSBLenzComm(Sender: TObject); @@ -346,6 +348,7 @@ type var ErrorCode: Integer); procedure ClientSocketCde2Read(Sender: TObject; Socket: TCustomWinSocket); + procedure outslectionner1Click(Sender: TObject); // procedure MSCommCdeComm(Sender: TObject); private { Déclarations privées } @@ -370,7 +373,7 @@ MaxZones=250; // nombre de zones de d MaxTrainZone=40; // nombre maximal de trains pour le tableau d'historique des zones Max_event_det=4000; // nombre maximal d'évenements détecteurs Max_actionneurs=100; -MaxBranches=100; +MaxBranches=200; MaxElBranches=200; NbreMaxiAiguillages=200; NbreMaxiSignaux=200; @@ -447,14 +450,14 @@ Taiguillage = record vitesse : integer; // vitesse de franchissement de l'aiguillage en position déviée (60 ou 90) AdrTrain : integer; // adresse du train qui a réservé l'aiguillage - ADroit : integer ; // (TJD:identifiant extérieur) connecté sur la position droite en talon + ADroit : integer ; // adresse (TJD:identifiant extérieur) connecté sur la position droite en talon ADroitB : char ; // P D S Z - ADevie : integer ; // (TJD:identifiant extérieur) adresse de l'élément connecté en position déviée + ADevie : integer ; // adresse (TJD:identifiant extérieur) adresse de l'élément connecté en position déviée ADevieB : char; // caractère (D ou S)si aiguillage de l'élément connecté en position déviée APointe : integer; // adresse de l'élément connecté en position droite ; - APointeB : char; + APointeB : char; // P D S Z DDroit : integer; // destination de la TJD en position droite DDroitB : char ; @@ -572,6 +575,7 @@ var IndexTrain : integer; // index du train NumBranche,IndexBranche : integer; // ou se trouve le détecteur dans les branches end; + Adresse_detecteur : array[0..NbMaxDet] of integer; // adresses des détecteurs par index Ecran : array[1..10] of record x0,y0,larg,haut : integer; @@ -585,8 +589,7 @@ var TypeGen : TEquipement; - Adresse_detecteur : array[0..NbMaxDet] of integer; // adresses des détecteurs par index - + // Historique des zones d'occupation par train TrainZone : array[1..MaxTrainZone] of // train, index @@ -610,8 +613,8 @@ var Index_Accessoire : array[0..MaxAcc] of integer; // tableau d'index des accessoires aiguillages et signaux sur le bus DCC - // tableau des accessoires - Tablo_acc_COMUSB : array[1..NbMaxi_Periph] of record + // tableau des périphériques + Tablo_periph : array[1..NbMaxi_Periph] of record nom : string; NumCom : integer; // numéro de port COM si c'est une liaison com usb numComposant : integer ; // numéro de composant MSCOM ou clientSocket @@ -657,10 +660,16 @@ var decodeur_pers : array[1..NbreMaxiDecPers] of record nom : string; - NbreAdr,nation : integer; - desc : array[1..10] of //index=adresse d'offset + NbreAdr, + nation : integer; // 1=FR 2=BE + commande : integer; // =0 pilotage par centrale =1 pilotage par périphérique COM/USB/Socket + Peripherique : integer; // numéro du périphérique + desc : array[1..20] of //index=adresse d'offset record - etat1,etat2,offsetAdresse,sortie1,sortie2 : integer; + etat1,etat2, // états (rouge, sémaphore etc) + offsetAdresse, // décalage d'adresse des deux sorties + sortie1,sortie2 : integer; // valeur des deux sorties pour les états + Chcommande : string; // si commande com/usb/socket end; end; @@ -676,7 +685,7 @@ var commandeOuvre : integer; // commande d'ouverture (1 ou 2) NbVoies : integer; // Nombre de voies du PN Pulse : integer; // 0=commande maintenue 1=Impulsionnel - TypeCde : integer; // 0=par accessoire / 1=par COMUSB + TypeCde : integer; // 0=par accessoire / 1=par COMUSB/sockets commandeF,CommandeO : string; compteur : integer; // comptage actionneurs fermeture et décomptage actionneurs ouverture Voie : array [1..5] of record @@ -696,7 +705,7 @@ var couleur : Tcolor; // modélisations des fichiers config - branche : array [1..100] of string; + branche : array [1..MaxBranches] of string; // l'indice du tableau aiguillage n'est pas son adresse aiguillage : array[0..NbreMaxiAiguillages] of Taiguillage; // signaux - L'index du tableau n'est pas son adresse @@ -1126,9 +1135,9 @@ begin // extinctions - if not((code=jaune_cli) and clignotant) and not(ancCode=jaune_cli) then cercle(ACanvas,xJaune,yJaune,rayon,GrisF); - if not((code=vert_cli) and clignotant) and not(ancCode=vert_cli) then cercle(ACanvas,xVert,yVert,rayon,GrisF); - if not((code=semaphore_cli) and clignotant) and not(ancCode=semaphore_cli) then cercle(ACanvas,xSem,ySem,rayon,GrisF); + if not((code=jaune_cli) and clignotant) then cercle(ACanvas,xJaune,yJaune,rayon,GrisF); + if not((code=vert_cli) and clignotant) then cercle(ACanvas,xVert,yVert,rayon,GrisF); + if not((code=semaphore_cli) and clignotant) then cercle(ACanvas,xSem,ySem,rayon,GrisF); // allumages if ((code=vert_cli) and (clignotant)) or (code=vert) then cercle(ACanvas,xVert,yVert,rayon,clGreen); @@ -1954,7 +1963,7 @@ end; function index_signal(adresse : integer) : integer; begin if adresse>MaxAcc then result:=0 else - result:=Index_Accessoire[adresse]; + result:=Index_Accessoire[adresse]; end; // renvoie l'index de l'aiguillage dans le tableau aiguillages[] en fonction de son adresse @@ -2053,9 +2062,8 @@ begin with Formpilote do begin - TFormPilote.Create(Self); // rajouté + // TFormPilote.Create(Self); show; - end; end; @@ -2109,11 +2117,13 @@ begin width:=LargImg; Height:=HtImg; + // hint s:='Index='+IntToSTR(rang)+' @='+inttostr(Adresse)+' Décodeur='+decodeur[feux[rang].Decodeur]+ ' Adresse détecteur associé='+intToSTR(feux[rang].Adr_det1)+ ' Adresse élement suivant='+intToSTR(feux[rang].Adr_el_suiv1); if feux[rang].Btype_suiv1=aig then s:=s+' (aig)'; Hint:=s; + showHint:=true; onClick:=Formprinc.Imageonclick; // affectation procédure clique sur image onMouseDown:=Formprinc.ProcOnMouseDown; @@ -2215,8 +2225,6 @@ begin Left:=10+ (LargImg+5)*((i-1) mod (NbreImagePLigne)); repaint; end; - - end; end; @@ -3945,7 +3953,7 @@ begin begin code:=feux[i].EtatSignal; code_to_aspect(code,aspect,combine); - combine:=code and $fc00; + combine:=code and $01c0; s:='Signal b_models: ad'+IntToSTR(adresse)+'='+chaine_signal(adresse); if traceSign then affiche(s,clOrange); if Affsignal then afficheDebug(s,clOrange); @@ -3959,7 +3967,7 @@ begin // marqué recht et Afb dans la doc !! afb:=1; // afb rouge recht:=2; // recht vert - if aspect=semaphore then + if aspect=rouge then begin pilote_acc(adresse,afb,feu); if (na>=4) then @@ -4352,9 +4360,10 @@ begin end; end; +// pilote un signal par un décodeur personnalisé procedure envoi_decodeur_pers(Adresse : integer); var s : string; - d,dp,i,j,etat,asp,combine,aspect,nAdresses : integer; + d,dp,i,j,k,etat,asp,combine,aspect,nAdresses,numcom,v,numacc,cmd : integer; trouve1,trouve2,trouve3,trouve4 : boolean; begin i:=Index_Signal(adresse); @@ -4362,84 +4371,226 @@ begin if (feux[i].AncienEtat<>etat) then //; && (stop_cmd==FALSE)) begin d:=feux[i].decodeur; - dp:=d-NbDecodeurdeBase+NbreDecPers-1; + dp:=d-NbDecodeurdeBase+1; if dp<0 then exit; s:='Signal '+decodeur_pers[dp].nom+' : ad'+IntToSTR(adresse)+'='+chaine_signal(adresse); Affiche(s,clOrange); + nAdresses:=decodeur_pers[dp].NbreAdr; + asp:=feux[i].aspect; if asp<>20 then - // français + // français -------------------------------------------- begin if decodeur_pers[dp].nation<>1 then begin - Affiche('Erreur 380 : le signal '+IntToSTR(adresse)+' est français mais un décodeur belge',clred); + Affiche('Erreur 380 : le signal '+IntToSTR(adresse)+' est français mais son décodeur est belge',clred); exit; end; - j:=1; - code_to_aspect(etat,aspect,combine); - nAdresses:=decodeur_pers[dp].NbreAdr; - // trouver l'état dans le décodeur - repeat - if (aspect<>-1) and (combine=-1) then - begin - // base - trouve1:=decodeur_pers[dp].desc[j].etat1=aspect+1; - trouve2:=decodeur_pers[dp].desc[j].etat2=aspect+1; - end; - if (aspect=-1) and (combine<>-1) then - begin - // signalisation non combinée (ralen30,60 rappel 30,60) - trouve3:=decodeur_pers[dp].desc[j].etat1=combine+1; - trouve4:=decodeur_pers[dp].desc[j].etat2=combine+1; - end; - // combinée - if (combine<>-1) and (aspect<>-1) then - begin - // ral_60+jaune cli - trouve3:=false;trouve4:=false; - if (aspect=jaune_cli) and (combine=ral_60) then - begin - trouve3:=(decodeur_pers[dp].desc[j].etat1=15); - trouve4:=(decodeur_pers[dp].desc[j].etat2=15); - end; - // rappel_30+jaune - if (aspect=jaune) and (combine=rappel_30) then - begin - trouve3:=(decodeur_pers[dp].desc[j].etat1=16); - trouve4:=(decodeur_pers[dp].desc[j].etat2=16); - end; - // rappel_30+jaune cli - if (aspect=jaune_cli) and (combine=rappel_30) then - begin - trouve3:=(decodeur_pers[dp].desc[j].etat1=17); - trouve4:=(decodeur_pers[dp].desc[j].etat2=17); - end; - // rappel_60+jaune - if (aspect=jaune) and (combine=rappel_60) then - begin - trouve3:=(decodeur_pers[dp].desc[j].etat1=18); - trouve4:=(decodeur_pers[dp].desc[j].etat2=18); - end; - // rappel_60+jaune cli - if (aspect=jaune_cli) and (combine=rappel_60) then - begin - trouve3:=(decodeur_pers[dp].desc[j].etat1=19); - trouve4:=(decodeur_pers[dp].desc[j].etat2=19); - end; - end; - inc(j); - until trouve1 or trouve2 or trouve3 or trouve4 or (j>nAdresses) or (j=11); - dec(j); - if trouve1 or trouve3 then + + // commande par centrale + if decodeur_pers[dp].commande=0 then begin - pilote_ACC(adresse+decodeur_pers[dp].desc[j].offsetAdresse,decodeur_pers[dp].desc[j].sortie1,feu) ; - // Affiche(intToSTR(adresse+decodeur_pers[dp].desc[j].offsetAdresse)+' '+intToSTR(decodeur_pers[dp].desc[j].sortie1),clYellow); + j:=1; + code_to_aspect(etat,aspect,combine); + + // trouver l'état dans le décodeur + repeat + if (aspect<>-1) and (combine=-1) then + begin + // base + trouve1:=decodeur_pers[dp].desc[j].etat1=aspect+1; + trouve2:=decodeur_pers[dp].desc[j].etat2=aspect+1; + end; + if (aspect=-1) and (combine<>-1) then + begin + // signalisation non combinée (ralen30,60 rappel 30,60) + trouve3:=decodeur_pers[dp].desc[j].etat1=combine+1; + trouve4:=decodeur_pers[dp].desc[j].etat2=combine+1; + end; + // combinée + if (combine<>-1) and (aspect<>-1) then + begin + // ral_60+jaune cli + trouve3:=false;trouve4:=false; + if (aspect=jaune_cli) and (combine=ral_60) then + begin + trouve3:=(decodeur_pers[dp].desc[j].etat1=15); + trouve4:=(decodeur_pers[dp].desc[j].etat2=15); + end; + // rappel_30+jaune + if (aspect=jaune) and (combine=rappel_30) then + begin + trouve3:=(decodeur_pers[dp].desc[j].etat1=16); + trouve4:=(decodeur_pers[dp].desc[j].etat2=16); + end; + // rappel_30+jaune cli + if (aspect=jaune_cli) and (combine=rappel_30) then + begin + trouve3:=(decodeur_pers[dp].desc[j].etat1=17); + trouve4:=(decodeur_pers[dp].desc[j].etat2=17); + end; + // rappel_60+jaune + if (aspect=jaune) and (combine=rappel_60) then + begin + trouve3:=(decodeur_pers[dp].desc[j].etat1=18); + trouve4:=(decodeur_pers[dp].desc[j].etat2=18); + end; + // rappel_60+jaune cli + if (aspect=jaune_cli) and (combine=rappel_60) then + begin + trouve3:=(decodeur_pers[dp].desc[j].etat1=19); + trouve4:=(decodeur_pers[dp].desc[j].etat2=19); + end; + end; + inc(j); + until trouve1 or trouve2 or trouve3 or trouve4 or (j>nAdresses) or (j=11); + dec(j); + if trouve1 or trouve3 then + begin + pilote_ACC(adresse+decodeur_pers[dp].desc[j].offsetAdresse,decodeur_pers[dp].desc[j].sortie1,feu) ; + // Affiche(intToSTR(adresse+decodeur_pers[dp].desc[j].offsetAdresse)+' '+intToSTR(decodeur_pers[dp].desc[j].sortie1),clYellow); + end; + if trouve2 or trouve4 then + begin + pilote_ACC(adresse+decodeur_pers[dp].desc[j].offsetAdresse,decodeur_pers[dp].desc[j].sortie2,feu) ; + // Affiche(intToSTR(adresse+decodeur_pers[dp].desc[j].offsetAdresse)+' '+intToSTR(decodeur_pers[dp].desc[j].sortie2),clYellow); + end; end; - if trouve2 or trouve4 then + + // commande par com/USB/Socket + if decodeur_pers[dp].commande=1 then begin - pilote_ACC(adresse+decodeur_pers[dp].desc[j].offsetAdresse,decodeur_pers[dp].desc[j].sortie2,feu) ; - // Affiche(intToSTR(adresse+decodeur_pers[dp].desc[j].offsetAdresse)+' '+intToSTR(decodeur_pers[dp].desc[j].sortie2),clYellow); + j:=1; + numAcc:=decodeur_pers[dp].Peripherique; + code_to_aspect(etat,aspect,combine); + if combine=-1 then + begin + if aspect=carre then j:=1; + if aspect=semaphore then j:=2; + if aspect=semaphore_cli then j:=3; + if aspect=vert then j:=4; + if aspect=vert_cli then j:=5; + if aspect=violet then j:=6; + if aspect=blanc then j:=7; + if aspect=blanc_cli then j:=8; + if aspect=jaune then j:=9; + if aspect=jaune_cli then j:=10; + end; + if aspect=-1 then + begin + if combine=ral_30 then j:=11; + if combine=ral_60 then j:=12; + if combine=rappel_30 then j:=13; + if combine=rappel_60 then j:=14; + end; + if (aspect=jaune_cli) and (combine=ral_60) then j:=15; + if (aspect=jaune) and (combine=rappel_30) then j:=16; + if (aspect=jaune_cli) and (combine=rappel_30) then j:=17; + if (aspect=jaune) and (combine=rappel_60) then j:=18; + if (aspect=jaune_cli) and (combine=rappel_60) then j:=19; + + + + s:=intToSTR(adresse)+' '+decodeur_pers[dp].desc[j].Chcommande; + if Tablo_periph[numacc].cr then s:=s+#13; + + if com_socket(numacc)=1 then + begin + // com USB + v:=Tablo_periph[numacc].NumCom; // numéro de com + if v=0 then exit; + if Tablo_com_cde[numacc].PortOuvert then + begin + cmd:=Tablo_periph[numacc].numComposant; + if numacc=1 then Formprinc.MSCommCde1.Output:=s; + if numacc=2 then Formprinc.MSCommCde2.Output:=s; + if Tablo_periph[numacc].ScvVis then Affiche('Envoi COM'+intToSTR(v)+': '+s,clYellow); + end + else Affiche('Envoi commande impossible ; COM'+intToSTR(v)+' non détecté',clred); + end + else + begin + // socket + begin + numAcc:=decodeur_pers[dp].Peripherique; + cmd:=Tablo_periph[numacc].numComposant; + if numacc=1 then Formprinc.ClientSocketCde1.Socket.SendText(s); + if numacc=2 then Formprinc.ClientSocketCde2.Socket.SendText(s); + if Tablo_periph[numacc].ScvVis then Affiche('Envoi Socket: '+s,clYellow); + end + end; + + end; + + end + + else + // signal belge (aspect=20)--------------------------------- + begin + if decodeur_pers[dp].nation<>2 then + begin + Affiche('Erreur 381 : le signal '+IntToSTR(adresse)+' est belge mais son décodeur est français',clred); + exit; + end; + + // commande par centrale + if decodeur_pers[dp].commande=0 then + begin + nAdresses:=decodeur_pers[dp].NbreAdr; + // trouver l'état dans le décodeur + for j:=0 to 8 do + begin // balayer les bits de 0 à 8 + if testbit(etat,j) then + begin + // explorer les états + for k:=1 to nAdresses do + begin + if decodeur_pers[dp].desc[k].etat1=j+1 then + pilote_ACC(adresse+decodeur_pers[dp].desc[k].offsetAdresse,decodeur_pers[dp].desc[k].sortie1,feu) ; + if decodeur_pers[dp].desc[k].etat2=j+1 then + pilote_ACC(adresse+decodeur_pers[dp].desc[k].offsetAdresse,decodeur_pers[dp].desc[k].sortie2,feu) ; + end; + end; + end; + end; + // commande par com/usb/socket + if decodeur_pers[dp].commande=1 then + begin + numAcc:=decodeur_pers[dp].Peripherique; + // trouver l'état dans le décodeur + for j:=0 to 8 do + begin // balayer les bits de 0 à 8 + if testbit(etat,j) then + begin + s:=intToSTR(adresse)+' '+decodeur_pers[dp].desc[j+1].Chcommande; // chaine à envoyer + if Tablo_periph[numacc].cr then s:=s+#13; + numAcc:=decodeur_pers[dp].Peripherique; + + if com_socket(numacc)=1 then + begin + // com USB + v:=Tablo_periph[numacc].NumCom; // numéro de com + if v=0 then exit; + if Tablo_com_cde[numacc].PortOuvert then + begin + cmd:=Tablo_periph[numacc].numComposant; + if numacc=1 then Formprinc.MSCommCde1.Output:=s; + if numacc=2 then Formprinc.MSCommCde2.Output:=s; + if Tablo_periph[numacc].ScvVis then Affiche('Envoi COM'+intToSTR(v)+': '+s,clYellow); + end + else Affiche('Envoi commande impossible ; COM'+intToSTR(v)+' non détecté',clred); + end + else + begin + // socket + cmd:=Tablo_periph[numacc].numComposant; + if numacc=1 then Formprinc.ClientSocketCde1.Socket.SendText(s); + if numacc=2 then Formprinc.ClientSocketCde2.Socket.SendText(s); + if Tablo_periph[numacc].ScvVis then Affiche('Envoi Socket: '+s,clYellow); + end; + end; + end; end; end; end; @@ -4533,6 +4684,7 @@ begin 10 : envoi_b_models(adr); end; + // décodeur personnalisé if (dec>=NbDecodeurdeBase) then if (decMaxComUSBPeriph) then begin - affiche('Le nombre maxi de portCom périphériques est atteint - Le port COM'+inttostr(tablo_acc_comusb[index].NumCom)+' ne sera pas ouvert',clred); + affiche('Le nombre maxi de portCom périphériques est atteint - Le port COM'+inttostr(Tablo_periph[index].NumCom)+' ne sera pas ouvert',clred); result:=false; exit; end; - numport:=tablo_acc_comusb[index].NumCom; + numport:=Tablo_periph[index].NumCom; if (numport<1) or (numport>255) then begin affiche('Erreur portCom cde acc <0 ou >255',clred); exit; end; trouve:=false; - portComCde:=tablo_acc_comusb[index].protocole; + portComCde:=Tablo_periph[index].protocole; case index of 1 : com:=formprinc.MSCommCde1; @@ -11777,7 +11935,7 @@ begin if index>MaxComUSBPeriph then begin - affiche('Le nombre maxi de portCom périphériques est atteint - Le port COM'+inttostr(tablo_acc_comusb[index].NumCom)+' ne sera pas ouvert',clred); + affiche('Le nombre maxi de portCom périphériques est atteint - Le port COM'+inttostr(Tablo_periph[index].NumCom)+' ne sera pas ouvert',clred); result:=false; exit; end; @@ -11829,14 +11987,15 @@ begin result:=tablo_com_cde[index].PortOuvert; end; -// détermine si l'accessoire i est un comusb ou un socket +// détermine si le périphérique i est un comusb ou un socket // =1 comusb // =2 socket +// i = index de Tablo_acc_ComUSB function com_socket(i : integer) : integer; var s : string; begin result:=0; - s:=Tablo_acc_COMUSB[i].protocole; + s:=Tablo_periph[i].protocole; if length(s)>1 then if upcase(s[1])='C' then result:=1 else result:=2; end; @@ -11847,30 +12006,26 @@ var s: string; begin if (index<0) or (index>10) then begin - affiche('Le nombre maxi de Sockets périphériques est atteint - Le socket '+Tablo_acc_COMUSB[index].protocole+' ne sera pas ouvert',clred); + affiche('Le nombre maxi de périphériques est atteint - Le socket '+Tablo_periph[index].protocole+' ne sera pas ouvert',clred); exit; end; - // déterminer dans l'index le numéro de client - NumSocket:=0; - for i:=1 to index do - begin - if com_socket(i)=2 then inc(NumSocket); - end; + numSocket:= Tablo_periph[index].numComposant; + com:=nil; case numSocket of 1 : com:=formprinc.ClientsocketCde1; 2 : com:=formprinc.ClientSocketCde2; end; - - if NumSocket>MaxComSocketPeriph then + + if (NumSocket>MaxComSocketPeriph) or (com=nil) then begin - affiche('Le nombre maxi de Sockets périphériques est atteint - Le socket '+Tablo_acc_COMUSB[index].protocole+' ne sera pas ouvert',clred); + affiche('Le nombre maxi de Sockets périphériques est atteint - Le socket '+Tablo_periph[index].protocole+' ne sera pas ouvert',clred); result:=false; exit; end; - s:=tablo_acc_comusb[index].protocole; + s:=Tablo_periph[index].protocole; i:=pos(':',s); com.address:=copy(s,1,i-1); delete(s,1,i); @@ -12744,15 +12899,15 @@ begin if index=1 then begin if connecte_port_usb_periph(i) then - Affiche('COM'+intToSTR(tablo_acc_comusb[i].numcom)+' commande périphérique ouvert',clLime) - else Affiche('COM'+intToSTR(tablo_acc_comusb[i].numcom)+' commande périphérique non ouvert',clOrange); + Affiche('COM'+intToSTR(Tablo_periph[i].numcom)+' commande périphérique ouvert',clLime) + else Affiche('COM'+intToSTR(Tablo_periph[i].numcom)+' commande périphérique non ouvert',clOrange); end; if index=2 then begin if connecte_socket_periph(i) then - Affiche('Socket '+tablo_acc_comusb[i].protocole+' demande ouverture ',clLime) + Affiche('Socket '+Tablo_periph[i].protocole+' demande ouverture ',clLime) else - Affiche('Socket '+tablo_acc_comusb[i].protocole+' commande périphérique non ouvert',clOrange) + Affiche('Socket '+Tablo_periph[i].protocole+' commande périphérique non ouvert',clOrange) end; end; @@ -12904,14 +13059,17 @@ begin for index:=1 to nbreTCO do begin begin + tcoCree:=false; IndexTCOCreate:=index; formTCO[index]:=TformTCO.Create(self); formTCO[index].Name:='FormTCO'+intToSTR(index); formTCO[index].Caption:='TCO'+intToSTR(index); + repeat + Application.ProcessMessages; + until tcoCree; end; Affiche_Fenetre_TCO(index,avecTCO); - //tcocree:=true; - end; + end; if debug=1 then Affiche('Initialisations',clLime); raz_tout; @@ -13666,7 +13824,7 @@ begin tablo_com_cde[index].PortOuvert:=false; if index=1 then Formprinc.MscommCde1.Portopen:=false; if index=2 then Formprinc.MscommCde2.Portopen:=false; - if debug>0 then Affiche('Port COM'+intToSTR(tablo_acc_comusb[index].NumCom)+' périphérique déconnecté',clyellow); + if debug>0 then Affiche('Port COM'+intToSTR(Tablo_periph[index].NumCom)+' périphérique déconnecté',clyellow); Formprinc.StatusBar1.Panels[3].Text:=''; end; end; @@ -13679,7 +13837,7 @@ begin tablo_com_cde[index].PortOuvert:=false; if index=1 then Formprinc.ClientSocketCde1.Close; if index=2 then Formprinc.ClientSocketCde1.close; - if debug>0 then Affiche('Socket '+intToSTR(tablo_acc_comusb[index].NumCom)+' périphérique déconnecté',clyellow); + if debug>0 then Affiche('Socket '+intToSTR(Tablo_periph[index].NumCom)+' périphérique déconnecté',clyellow); Formprinc.StatusBar1.Panels[3].Text:=''; end; end; @@ -15110,6 +15268,12 @@ begin FenRich.SetFocus; end; + +procedure TFormPrinc.outslectionner1Click(Sender: TObject); +begin + FenRich.SelectAll; +end; + procedure TFormPrinc.Etatdessignaux1Click(Sender: TObject); var Adr,etat,i : integer; s : string; @@ -15214,6 +15378,10 @@ begin FenRich.SelAttributes.Style:=[fsUnderline]; FenRich.lines.add('https://github.com/f1iwq2/Signaux_complexes_GL'); RE_ColorLine(FenRich,FenRich.lines.count-1,clAqua); + FenRich.SelStart:=length(FenRich.Text); + FenRich.SelAttributes.Style:=[fsUnderline]; + FenRich.Lines.add('https://github.com/f1iwq2/Signaux_complexes_GL/releases'); + RE_ColorLine(FenRich,FenRich.lines.count-1,clAqua); FenRich.SelStart:=length(FenRich.Text); FenRich.SelAttributes.Style:=[fsUnderline]; @@ -15610,32 +15778,50 @@ begin // ouvre_simulation('C:\temp\Signaux_complexes_GL\2trains_autonome.txt'); end; +procedure GetWin32_SerialPortInfo; +const + WbemUser=''; + WbemPassword=''; + WbemComputer='localhost'; + wbemFlagForwardOnly=$00000020; +var + FSWbemLocator,FWMIService,FWbemObjectSet,FWbemObject : OLEVariant; + oEnum : IEnumvariant; + iValue : LongWord; + i : integer; + s : string; +begin + FSWbemLocator:=CreateOleObject('WbemScripting.SWbemLocator'); + FWMIService:=FSWbemLocator.ConnectServer(WbemComputer,'root\CIMV2',WbemUser,WbemPassword); // nom de l'espace par défaut et classes du matériel du pc + FWbemObjectSet:=FWMIService.ExecQuery('SELECT * FROM Win32_SerialPort','WQL',wbemFlagForwardOnly); // retourne les infos des ports série + oEnum:=IUnknown(FWbemObjectSet._NewEnum) as IEnumVariant; + i:=0; + while oEnum.Next(1,FWbemObject,iValue)=0 do + begin + inc(i); + // pour les autres champs: https://learn.microsoft.com/en-us/windows/win32/cimwin32prov/win32-serialport + s:=FWbemObject.DeviceID+' '+FWbemObject.Name+' '+FWbemObject.Description; + Affiche(s,clyellow); + FWbemObject:=Unassigned; + end; + if i=0 then Affiche('Aucun port com',clyellow); +end; function liste_portcom : tStrings; -var - reg: TRegistry; - I:Integer; - ts : tStrings; begin - Reg := TRegistry.Create(KEY_READ); - try - Reg.RootKey := HKEY_LOCAL_MACHINE; - if Reg.OpenKey('HARDWARE\DEVICEMAP\SERIALCOMM', false) then //Ordinateur\HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM - begin - ts:=TStringList.Create; - Reg.GetValueNames(ts); - for I := 0 to ts.Count - 1 do - begin - ts[i]:= Reg.ReadString(ts[i]); - Affiche(ts[i],clWhite); - end; - end; - finally - Reg.Free; - end; - if ts.count=0 then Affiche('Aucun port COM/USB',clyellow); - - result:=tS; + try + CoInitialize(nil); + try + GetWin32_SerialPortInfo; + finally + CoUninitialize; + end; + except + on E:EOleException do + Affiche(Format('EOleException %s %x', [E.Message,E.ErrorCode]),clyellow); + on E:Exception do + Affiche(E.Classname+ ':'+ E.Message,clyellow); + end; end; procedure TFormPrinc.Evenementsdetecteurspartrain1Click(Sender: TObject); @@ -16645,6 +16831,7 @@ begin end; end; +// réception des périphériques procedure TFormPrinc.MSCommCde1Comm(Sender: TObject); var recu : string; tablo : array of byte; // tableau rx usb @@ -16759,5 +16946,6 @@ end; + end. diff --git a/UnitTCO.pas b/UnitTCO.pas index e4b227f..1f7f230 100644 --- a/UnitTCO.pas +++ b/UnitTCO.pas @@ -577,7 +577,7 @@ begin repeat inc(i); trouve:=s[i] in ['0'..'9']; - until trouve or (i>length(s)); + until trouve or (i>=length(s)); if trouve then begin delete(s,1,i-1); @@ -1189,9 +1189,11 @@ begin end; +// calcule les Hauteur et Largeur des cellules en fonction du Zoom procedure calcul_cellules(indexTCO : integer); var pos : integer; begin + if affevt then affiche('Calcul_cellules',clyellow); pos:=ZoomMax-FormTCO[indexTCO].TrackBarZoom.Position+ZoomMin; //Affiche('Position TrackBar°'+intToSTR(indexTCO)+'='+intToSTR(pos),clyellow); LargeurCell[indexTCO]:=pos; @@ -7556,7 +7558,7 @@ var index,x0,y0,xp,yp,orientation,adresse,aspect,PiedFeu,TailleX,TailleY,larg,h ImageFeu : Timage; frX,frY : real; begin - if (x>NbreCellX[indexTCO]) or (y>NbreCellY[indexTCO]) or (x<1) or (y<1) then exit; + if (x>NbreCellX[indexTCO]) or (y>NbreCellY[indexTCO]) or (x<1) or (y<1) or (NbreFeux=0) then exit; larg:=LargeurCell[indexTCO]; haut:=hauteurCell[indexTCO]; @@ -7569,6 +7571,8 @@ begin if Orientation=0 then Orientation:=1; // cas d'un signal non encore renseigné index:=Index_Signal(adresse); + if index=0 then exit; + aspect:=feux[index].aspect; if aspect=0 then aspect:=9; //if aspect>9 then exit; @@ -7644,7 +7648,7 @@ begin // si inversion if feux[index].contrevoie then begin - inverse_image(FormTCO[index].ImageTemp,ImageFeu); + inverse_image(FormTCO[indexTCO].ImageTemp,ImageFeu); // copie avec mise à l'échelle de l'image du signal TransparentBlt(canvasDest.Handle,x0,y0,round(TailleX*frX),round(TailleY*frY), FormTCO[indexTCO].ImageTemp.Canvas.Handle,0,0,TailleX,TailleY,clBlue); @@ -7990,25 +7994,24 @@ end; procedure _entoure_cell_clic(indexTCO: integer); begin if not(entoure[indexTCO]) then + begin + Entoure_cell(indexTCO,XclicCell[indexTCO],YclicCell[indexTCO]); + Xentoure[indexTCO]:=XClicCell[indexTCO]; + Yentoure[indexTCO]:=YclicCell[indexTCO]; + entoure[indexTCO]:=true; + end + else + begin + Entoure_cell(indexTCO,Xentoure[indexTCO],Yentoure[indexTCO]); // efface l'ancien + // si on clique sur le même on l'efface sans afficher un nouveau + if (Xentoure[indexTCO]<>XclicCell[indexTCO]) or (Yentoure[indexTCO]<>YClicCell[indexTCO]) then begin Entoure_cell(indexTCO,XclicCell[indexTCO],YclicCell[indexTCO]); - Xentoure[indexTCO]:=XClicCell[indexTCO]; - Yentoure[indexTCO]:=YclicCell[indexTCO]; - entoure[indexTCO]:=true; end - else - begin - Entoure_cell(indexTCO,Xentoure[indexTCO],Yentoure[indexTCO]); // efface l'ancien - // si on clique sur le même on l'efface sans afficher un nouveau - if (Xentoure[indexTCO]<>XclicCell[indexTCO]) or (Yentoure[indexTCO]<>YClicCell[indexTCO]) then - begin - Entoure_cell(indexTCO,XclicCell[indexTCO],YclicCell[indexTCO]); - end - else entoure[indexTCO]:=false; - - Xentoure[indexTCO]:=XClicCell[indexTCO]; - Yentoure[indexTCO]:=YclicCell[indexTCO]; - end; + else entoure[indexTCO]:=false; + Xentoure[indexTCO]:=XClicCell[indexTCO]; + Yentoure[indexTCO]:=YclicCell[indexTCO]; + end; end; @@ -8156,7 +8159,7 @@ begin modeTrace[indexTCOCreate]:=false; // pour tracer les voies à la souris //controlStyle:=controlStyle+[csOpaque]; - TCOCree:=true; + //TCOCree:=true; s:='Voie'; ImagePalette6.Hint:=s;ImagePalette6.ShowHint:=true; @@ -8203,7 +8206,7 @@ begin ImagePalette23.Hint:=s;ImagePalette22.ShowHint:=true; ImagePalette25.Hint:=s;ImagePalette25.ShowHint:=true; - + tcoCree:=true; if debug=1 then Affiche('Fin création fenêtre TCO',clLime); end; @@ -9195,7 +9198,8 @@ begin if affevt then Affiche('Form TCO'+intToSTR(indexTCO)+' activate',clyellow); Caption:='TCO'+intToSTR(indexTCO)+' : '+NomFichierTCO[indexTCO]; - //if not(Forminit[indexTCO]) then + {initalisation des dimensions du tco - à ne faire qu'une fois} + if not(Forminit[indexTCO]) then begin Button1.Visible:=not(Diffusion); @@ -12283,17 +12287,18 @@ end; procedure TFormTCO.ButtonCalibrageClick(Sender: TObject); var indexTCO,x,y : integer; begin - x:=0; - y:=0; - indexTCO:=index_tco(sender); - calcul_reduction(frxGlob[indexTCO],fryGlob[indexTCO],LargeurCell[indexTCO],hauteurCell[indexTCO]); - with imageTCO.Canvas do - begin - pen.color:=clyellow; - moveTo( round(x),round(y*fryGlob[indexTCO]) ); - LineTo( round((x+LargeurCell[indexTCO])),round(y+hauteurCell[indexTCO]*ratioC/10) ); - end; - Affiche(formatfloat('0.000000',fryGlob[indexTCO]),clyellow); + x:=0; + y:=0; + indexTCO:=index_tco(sender); + Affiche('Calibrage='+intToSTR(largeurCell[indexTCO]),clyellow); + calcul_reduction(frxGlob[indexTCO],fryGlob[indexTCO],LargeurCell[indexTCO],hauteurCell[indexTCO]); + with imageTCO.Canvas do + begin + pen.color:=clyellow; + moveTo( round(x),round(y*fryGlob[indexTCO]) ); + LineTo( round((x+LargeurCell[indexTCO])),round(y+hauteurCell[indexTCO]*ratioC/10) ); + end; + Affiche(formatfloat('0.000000',frxGlob[indexTCO]),clyellow); end; procedure change_couleur_fond(indexTCO : integer); diff --git a/verif_version.pas b/verif_version.pas index f4d4825..3960079 100644 --- a/verif_version.pas +++ b/verif_version.pas @@ -25,7 +25,7 @@ var verifVersion,notificationVersion : boolean; date_creation,nombre_tel : string; -Const Version='8.21'; // sert à la comparaison de la version publiée +Const Version='8.24'; // sert à la comparaison de la version publiée SousVersion=' '; // A B C ... en cas d'absence de sous version mettre un espace function GetCurrentProcessEnvVar(const VariableName: string): string; @@ -56,7 +56,7 @@ begin else begin SetLength(result,nSize-1); - if GetEnvironmentVariable(PChar(VariableName), PChar(result), nSize) <> nSize - 1 then + if GetEnvironmentVariable(PChar(VariableName),PChar(result),nSize) <> nSize-1 then raise Exception.Create(SysErrorMessage(GetlastError)) end; end; @@ -200,7 +200,7 @@ begin nombre_tel:=extrait_champ_simple('download_count'); // date de création - date_creation_ang:=extrait_champ('created_at'); + date_creation_ang:=extrait_champ('published_at'); if date_creation_ang<>'' then begin //Affiche(date_creation_ang,clyellow); diff --git a/versions.txt b/versions.txt index 7db9e6b..8e848f8 100644 --- a/versions.txt +++ b/versions.txt @@ -191,7 +191,13 @@ version 8.2 : Optimisation de la rapidit Possibilité d'envoyer des commandes sur un port COM/USB sur évènement actionneur/détecteur/aiguillage. version 8.21 : Correction passage en majuscule de la commande port COM/USB. - Ajout du pilotage des passage à niveaux par COM/USB. + Ajout du pilotage des passage à niveaux par COM/USB/Socket Ajout de l'envoi des commandes/services sur un socket (réseau Ethernet/wifi) +version 8.22 : Corrections diverses, dont un problème d'importation réseau CDM avec des détecteurs confondus et aiguillages inexistants (régression) +version 8.23 : Correction bug si changement aspect du signal. + Pilotage des décodeurs de signaux personnalisés par COM/USB/Sockets +version 8.24 : Traitement de cas particuliers de l'importation de réseaux CDM rail. + +