diff --git a/ConfigGenerale.cfg b/ConfigGenerale.cfg index de0e9d4..9e761f3 100644 --- a/ConfigGenerale.cfg +++ b/ConfigGenerale.cfg @@ -1,18 +1,24 @@ -/ Fichier de configuration de signaux_complexes_GL version 8.0 +/ Fichier de configuration de signaux_complexes_GL version 8.2 +LargeurF=1222 +HauteurF=652 +OffsetX=29 +OffsetY=186 +Splitter=1 AvecVerifIconesTCO=1 Algo_localisation=1 -Avec_roulage=0 +Avec_roulage=1 Debug=0 Filtrage_det=3 AntiTimeoutEthLenz=0 -Fonte=11 +Fonte=10 Protocole=1 Verif_AdrXpressNet=1 IpV4_PC=127.0.0.1:9999 -ServicesCDM=7 +ServicesCDM=15 Ipv4_interface=192.168.1.23:5550 MaxCom=30 Protocole_serie=COMX:115200,N,8,1,0 +ProtocolePortCde=COMX:115200,N,8,1 Inter_car=50 Tempo_maxi=15 Entete=1 @@ -22,21 +28,22 @@ Tempo_Aig=50 Init_demUSBCOM=0 Init_demETH=0 Fenetre=0 +AffMemoFenetre=0 nb_det_dist=3 -verif_version=1 +verif_version=0 notif_version=0 TCO=1 NbreTCO=1 -Nom_fichier_TCO1=tco.cfg -Nom_fichier_TCO2=tco2.cfg -Nom_fichier_TCO3=tco3.cfg -Nom_fichier_TCO4=tco4.cfg -Nom_fichier_TCO5=tco5.cfg -Nom_fichier_TCO6=tco6.cfg -Nom_fichier_TCO7=tco7.cfg -Nom_fichier_TCO8=tco8.cfg -Nom_fichier_TCO9=tco9.cfg -Nom_fichier_TCO10=tco10.cfg +Nom_fichier_TCO1=TCO.CFG +Nom_fichier_TCO2=DEUXIEME.CFG +Nom_fichier_TCO3=TCO3.CFG +Nom_fichier_TCO4=TCO4.CFG +Nom_fichier_TCO5=TCO5.CFG +Nom_fichier_TCO6=TCO6.CFG +Nom_fichier_TCO7=TCO7.CFG +Nom_fichier_TCO8=TCO8.CFG +Nom_fichier_TCO9=TCO9.CFG +Nom_fichier_TCO10=TCO10.CFG MasqueBandeauTCO=0 CDM=0 Lay=RESEAU_GILY_SIGNAL_AJOUTE.LAY @@ -49,14 +56,14 @@ Nb_cantons_Sig=3 Alg_Unisemaf=1 /------------ [section_aig] -1,P518,D100D,S3P,V30,I0,INIT(2,2) +1,P518,D100D,S3P,V30,I0,INIT(1,2) 2,P12S,D519,S100S,V0,I0,INIT(1,2) 3,P1S,D4P,S5D,V0,I0,INIT(2,2) -4,P3D,D6S,S514,V0,I0,INIT(2,2) +4,P3D,D6S,S514,V0,I0,INIT(1,2) 5,P515,D3S,S100S,V0,I0,INIT(1,2) -6,P516,D0,S4D,V0,I0,INIT(2,2) +6,P516,D0,S4D,V0,I0,INIT(1,2) 7,P527,D519,S520,V0,I0,INIT(2,2) -8,P527,D521,S103S,V0,I0,INIT(1,2) +8,P527,D521,S103S,V40,I0,INIT(1,2) 9,P526,D103D,S515,V60,I0,INIT(1,2) 10,P101S,D29P,S528,V30,I0,INIT(1,2) 11,P18P,D30D,S101D,V0,I0,INIT(1,2) @@ -102,6 +109,23 @@ A31,A34,0 0 /------------ [section_decodeurs] +Nom_dec_pers=Personnalisé 1 +NombreAdresses=4 +Nation=1 +1,2,0,1,2 +3,4,1,1,2 +5,9,2,1,2 +10,11,3,1,2 +Nom_dec_pers=grand +NombreAdresses=7 +Nation=1 +1,2,0,1,2 +3,4,1,0,0 +5,6,2,0,0 +7,8,3,0,0 +9,10,4,0,0 +11,12,5,0,0 +13,14,6,0,0 0 /------------ [section_sig] @@ -109,7 +133,7 @@ A31,A34,0 190,7,0,1,(523,526),0,FVC0,FRC0 204,9,0,1,(527,A7),1,FVC0,FRC0 218,7,0,1,(525,A17),0,FVC0,FRC0 -232,2,1,1,(516,A6),0,FVC0,FRC0 +232,2,1,1,(516,A6),0,FVC0,FRC0,CFB(A6D) 274,3,0,1,(524,521),0,FVC0,FRC0 288,7,0,1,(522,A103),1,FVC0,FRC0 302,9,0,1,(526,A9),1,FVC0,FRC0 @@ -126,21 +150,21 @@ A31,A34,0 462,9,0,1,(513,A29),1,FVC0,FRC0 476,9,0,1,(538,A23),1,FVC0,FRC0 497,9,0,4,(531,A19),1,FVC0,FRC0 -520,9,1,1,(518,A1),1,FVC0,FRC0 -600,7,0,0,(521,A8),1,FVC0,FRC0 +520,9,1,1,(518,A1),1,FVC0,FRC0,(A1S,A3S,A5S),CFB(A1S,A3D,A4D,A6S) +600,20,0,10,(521,A8),0,FVC0,FRC0,NA5,VCV0,CV0 0 /------------ [section_act] -A40,2,,A10,1,S +40,1,TGV,COM5,CM5 A91,1,X,F1,100,MONTRAIN -815,1,CC406526,F2,0,TGV +815,1,CC406526,F2,200,TGV Mem[527,520],1,X,"KLAXON_2.WAV" 821,1,BB16024,"KLAXON_3.WAV" 818,1,TGV,A10,1,S A12,2,X,"KLAXON_3.WAV" /------------ -(817,830),(820,840),PN(121,1,121,2),1 -(527-519,519-517),(530-531,531-532),PN(122,0,122,1),0 +(817,830),(820,840),PN(12,2,12,1),1 +(527-519,519-517),(530-531,531-532),(123-456,789-123),(654-654,854-124),(659-154,555-888),PN(122,0,122,1),0 0 /------------ [section_dcc++] diff --git a/Notice d'utilisation des signaux_complexes_GL_V8.1.pdf b/Notice d'utilisation des signaux_complexes_GL_V8.2.pdf similarity index 73% rename from Notice d'utilisation des signaux_complexes_GL_V8.1.pdf rename to Notice d'utilisation des signaux_complexes_GL_V8.2.pdf index 61b8a6c..5ad0112 100644 Binary files a/Notice d'utilisation des signaux_complexes_GL_V8.1.pdf and b/Notice d'utilisation des signaux_complexes_GL_V8.2.pdf differ diff --git a/Signaux_complexes_GL.cfg b/Signaux_complexes_GL.cfg index e9e902f..8d97c47 100644 --- a/Signaux_complexes_GL.cfg +++ b/Signaux_complexes_GL.cfg @@ -14,16 +14,17 @@ -$N+ -$O- -$P+ --$Q+ --$R+ +-$Q- +-$R- -$S- -$T- -$U- -$V+ -$W- -$X+ --$YD +-$Y+ -$Z1 +-GS -cg -AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -H+ @@ -33,3 +34,7 @@ -K$00400000 -LE"c:\program files (x86)\borland\delphi7\Projects\Bpl" -LN"c:\program files (x86)\borland\delphi7\Projects\Bpl" +-U"c:\program files (x86)\borland\delphi7\Lib\Debug" +-O"c:\program files (x86)\borland\delphi7\Lib\Debug" +-I"c:\program files (x86)\borland\delphi7\Lib\Debug" +-R"c:\program files (x86)\borland\delphi7\Lib\Debug" diff --git a/Signaux_complexes_GL.dof b/Signaux_complexes_GL.dof index f78f51d..124f86c 100644 --- a/Signaux_complexes_GL.dof +++ b/Signaux_complexes_GL.dof @@ -17,15 +17,15 @@ M=0 N=1 O=0 P=1 -Q=1 -R=1 +Q=0 +R=0 S=0 T=0 U=0 V=1 W=0 X=1 -Y=1 +Y=2 Z=1 ShowHints=1 ShowWarnings=1 @@ -80,7 +80,7 @@ UnsafeType=1 UnsafeCode=1 UnsafeCast=1 [Linker] -MapFile=0 +MapFile=1 OutputObjs=0 ConsoleApp=1 DebugInfo=0 @@ -94,7 +94,7 @@ OutputDir= UnitOutputDir= PackageDLLOutputDir= PackageDCPOutputDir= -SearchPath= +SearchPath=$(DELPHI)\Lib\Debug Packages=vcl;rtl;vclx;VclSmp;vclshlctrls Conditionals= DebugSourceDirs= @@ -108,8 +108,8 @@ DebugCWD= [Version Info] IncludeVerInfo=1 AutoIncBuild=0 -MajorVer=1 -MinorVer=0 +MajorVer=8 +MinorVer=1 Release=0 Build=5 Debug=0 @@ -120,15 +120,15 @@ DLL=0 Locale=1036 CodePage=1252 [Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.5 +CompanyName=F1IWQ +FileDescription=Signaux complexes +FileVersion=8.1.0.5 InternalName= -LegalCopyright= +LegalCopyright=2023 F1IWQ LegalTrademarks= OriginalFilename= ProductName= -ProductVersion=1.0.0.0 +ProductVersion=8.1.0.0 Comments= [HistoryLists\hlUnitAliases] Count=1 diff --git a/Signaux_complexes_GL.map b/Signaux_complexes_GL.map new file mode 100644 index 0000000..54b5f71 --- /dev/null +++ b/Signaux_complexes_GL.map @@ -0,0 +1,250 @@ + + Start Length Name Class + 0001:00000000 0015E190H .text CODE + 0002:00000000 00002BECH .data DATA + 0002:00002BEC 041A0505H .bss BSS + + +Detailed map of segments + + 0001:00000000 00005DF3 C=CODE S=.text G=(none) M=System ACBP=A9 + 0001:00005DF4 00000140 C=CODE S=.text G=(none) M=SysInit ACBP=A9 + 0001:00005F34 00000108 C=CODE S=.text G=(none) M=Types ACBP=A9 + 0001:0000603C 00000ED8 C=CODE S=.text G=(none) M=Windows ACBP=A9 + 0001:00006F14 00000038 C=CODE S=.text G=(none) M=Messages ACBP=A9 + 0001:00006F4C 00000338 C=CODE S=.text G=(none) M=SysConst ACBP=A9 + 0001:00007284 00006E28 C=CODE S=.text G=(none) M=SysUtils ACBP=A9 + 0001:0000E0AC 0000081B C=CODE S=.text G=(none) M=VarUtils ACBP=A9 + 0001:0000E8C8 00008042 C=CODE S=.text G=(none) M=Variants ACBP=A9 + 0001:0001690C 00000188 C=CODE S=.text G=(none) M=RTLConsts ACBP=A9 + 0001:00016A94 0000083C C=CODE S=.text G=(none) M=TypInfo ACBP=A9 + 0001:000172D0 00000358 C=CODE S=.text G=(none) M=ActiveX ACBP=A9 + 0001:00017628 0000A236 C=CODE S=.text G=(none) M=Classes ACBP=A9 + 0001:00021860 00000370 C=CODE S=.text G=(none) M=Consts ACBP=A9 + 0001:00021BD0 00009BFB C=CODE S=.text G=(none) M=Graphics ACBP=A9 + 0001:0002B7CC 00000124 C=CODE S=.text G=(none) M=Math ACBP=A9 + 0001:0002B8F0 000002B8 C=CODE S=.text G=(none) M=Contnrs ACBP=A9 + 0001:0002BBA8 00000198 C=CODE S=.text G=(none) M=CommCtrl ACBP=A9 + 0001:0002BD40 00000787 C=CODE S=.text G=(none) M=MultiMon ACBP=A9 + 0001:0002C4C8 00000038 C=CODE S=.text G=(none) M=Imm ACBP=A9 + 0001:0002C500 00000FF8 C=CODE S=.text G=(none) M=HelpIntfs ACBP=A9 + 0001:0002D4F8 00000058 C=CODE S=.text G=(none) M=WinSpool ACBP=A9 + 0001:0002D550 000010C8 C=CODE S=.text G=(none) M=Printers ACBP=A9 + 0001:0002E618 0000031F C=CODE S=.text G=(none) M=FlatSB ACBP=A9 + 0001:0002E938 000001A4 C=CODE S=.text G=(none) M=SyncObjs ACBP=A9 + 0001:0002EADC 000009BB C=CODE S=.text G=(none) M=UxTheme ACBP=A9 + 0001:0002F498 00000038 C=CODE S=.text G=(none) M=RichEdit ACBP=A9 + 0001:0002F4D0 00000038 C=CODE S=.text G=(none) M=ToolWin ACBP=A9 + 0001:0002F508 00000040 C=CODE S=.text G=(none) M=ShellAPI ACBP=A9 + 0001:0002F548 00000038 C=CODE S=.text G=(none) M=RegStr ACBP=A9 + 0001:0002F580 00000058 C=CODE S=.text G=(none) M=WinInet ACBP=A9 + 0001:0002F5D8 00000038 C=CODE S=.text G=(none) M=UrlMon ACBP=A9 + 0001:0002F610 0000006C C=CODE S=.text G=(none) M=ShlObj ACBP=A9 + 0001:0002F67C 00000060 C=CODE S=.text G=(none) M=CommDlg ACBP=A9 + 0001:0002F6DC 00000038 C=CODE S=.text G=(none) M=Dlgs ACBP=A9 + 0001:0002F714 000036D1 C=CODE S=.text G=(none) M=Dialogs ACBP=A9 + 0001:00032DE8 00004ADA C=CODE S=.text G=(none) M=ExtCtrls ACBP=A9 + 0001:000378C4 00000090 C=CODE S=.text G=(none) M=ComStrs ACBP=A9 + 0001:00037954 000007A0 C=CODE S=.text G=(none) M=Clipbrd ACBP=A9 + 0001:000380F4 00000128 C=CODE S=.text G=(none) M=StrUtils ACBP=A9 + 0001:0003821C 00003821 C=CODE S=.text G=(none) M=Buttons ACBP=A9 + 0001:0003BA40 00000038 C=CODE S=.text G=(none) M=ExtDlgs ACBP=A9 + 0001:0003BA78 00000068 C=CODE S=.text G=(none) M=IniFiles ACBP=A9 + 0001:0003BAE0 00000068 C=CODE S=.text G=(none) M=Registry ACBP=A9 + 0001:0003BB48 0000006C C=CODE S=.text G=(none) M=Mapi ACBP=A9 + 0001:0003BBB4 00000058 C=CODE S=.text G=(none) M=ExtActns ACBP=A9 + 0001:0003BC0C 00000038 C=CODE S=.text G=(none) M=ListActns ACBP=A9 + 0001:0003BC44 00009948 C=CODE S=.text G=(none) M=ComCtrls ACBP=A9 + 0001:0004558C 00000EA0 C=CODE S=.text G=(none) M=Themes ACBP=A9 + 0001:0004642C 0000D390 C=CODE S=.text G=(none) M=StdCtrls ACBP=A9 + 0001:000537BC 00000168 C=CODE S=.text G=(none) M=StdActns ACBP=A9 + 0001:00053924 00000D1F C=CODE S=.text G=(none) M=WinHelpViewer ACBP=A9 + 0001:00054644 00011403 C=CODE S=.text G=(none) M=Controls ACBP=A9 + 0001:00065A48 00001292 C=CODE S=.text G=(none) M=ActnList ACBP=A9 + 0001:00066CDC 00001B9C C=CODE S=.text G=(none) M=ImgList ACBP=A9 + 0001:00068878 000066E1 C=CODE S=.text G=(none) M=Menus ACBP=A9 + 0001:0006EF5C 0000CEFC C=CODE S=.text G=(none) M=Forms ACBP=A9 + 0001:0007BE58 00000060 C=CODE S=.text G=(none) M=ComConst ACBP=A9 + 0001:0007BEB8 00001259 C=CODE S=.text G=(none) M=ComObj ACBP=A9 + 0001:0007D114 00000038 C=CODE S=.text G=(none) M=StdVCL ACBP=A9 + 0001:0007D14C 00001793 C=CODE S=.text G=(none) M=AxCtrls ACBP=A9 + 0001:0007E8E0 00000060 C=CODE S=.text G=(none) M=OleConst ACBP=A9 + 0001:0007E940 00003519 C=CODE S=.text G=(none) M=OleCtrls ACBP=A9 + 0001:00081E5C 00000050 C=CODE S=.text G=(none) M=JConsts ACBP=A9 + 0001:00081EAC 000133EC C=CODE S=.text G=(none) M=jpeg ACBP=A9 + 0001:00095298 00000314 C=CODE S=.text G=(none) M=TlHelp32 ACBP=A9 + 0001:000955AC 000000D8 C=CODE S=.text G=(none) M=WinSock ACBP=A9 + 0001:00095684 00001F40 C=CODE S=.text G=(none) M=ScktComp ACBP=A9 + 0001:000975C4 000008EA C=CODE S=.text G=(none) M=OleServer ACBP=A9 + 0001:00097EB0 00000598 C=CODE S=.text G=(none) M=MSCommLib_TLB ACBP=A9 + 0001:00098448 00000040 C=CODE S=.text G=(none) M=MMSystem ACBP=A9 + 0001:00098488 00000038 C=CODE S=.text G=(none) M=Nb30 ACBP=A9 + 0001:000984C0 00000A18 C=CODE S=.text G=(none) M=MaskUtils ACBP=A9 + 0001:00098ED8 00002108 C=CODE S=.text G=(none) M=Mask ACBP=A9 + 0001:0009AFE0 0000924C C=CODE S=.text G=(none) M=Grids ACBP=A9 + 0001:000A422C 000015A0 C=CODE S=.text G=(none) M=UnitPilote ACBP=A9 + 0001:000A57CC 000004D0 C=CODE S=.text G=(none) M=Importation ACBP=A9 + 0001:000A5C9C 0000FE58 C=CODE S=.text G=(none) M=UnitAnalyseSegCDM ACBP=A9 + 0001:000B5AF4 000025F4 C=CODE S=.text G=(none) M=UnitConfigTCO ACBP=A9 + 0001:000B80E8 000009C0 C=CODE S=.text G=(none) M=Unit_Pilote_aig ACBP=A9 + 0001:000B8AA8 00003434 C=CODE S=.text G=(none) M=UnitConfigCellTCO ACBP=A9 + 0001:000BBEDC 0002B274 C=CODE S=.text G=(none) M=UnitTCO ACBP=A9 + 0001:000E7150 00002C18 C=CODE S=.text G=(none) M=UnitSR ACBP=A9 + 0001:000E9D68 00002404 C=CODE S=.text G=(none) M=UnitCDF ACBP=A9 + 0001:000EC16C 000015C7 C=CODE S=.text G=(none) M=verif_version ACBP=A9 + 0001:000ED734 0000114C C=CODE S=.text G=(none) M=UnitPareFeu ACBP=A9 + 0001:000EE880 000333DF C=CODE S=.text G=(none) M=UnitConfig ACBP=A9 + 0001:00121C60 00002904 C=CODE S=.text G=(none) M=UnitDebug ACBP=A9 + 0001:00124564 00000C00 C=CODE S=.text G=(none) M=UnitSimule ACBP=A9 + 0001:00125164 00002390 C=CODE S=.text G=(none) M=Unitplace ACBP=A9 + 0001:001274F4 0003680C C=CODE S=.text G=(none) M=UnitPrinc ACBP=A9 + 0001:0015DD00 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 + 0002:00000340 00000008 C=DATA S=.data G=DGROUP M=VarUtils ACBP=A9 + 0002:00000348 000001B2 C=DATA S=.data G=DGROUP M=Variants ACBP=A9 + 0002:000004FC 0000000C C=DATA S=.data G=DGROUP M=TypInfo ACBP=A9 + 0002:00000508 00000010 C=DATA S=.data G=DGROUP M=ActiveX ACBP=A9 + 0002:00000518 00000064 C=DATA S=.data G=DGROUP M=Classes ACBP=A9 + 0002:0000057C 0000030C C=DATA S=.data G=DGROUP M=Graphics ACBP=A9 + 0002:00000888 00000004 C=DATA S=.data G=DGROUP M=Printers ACBP=A9 + 0002:0000088C 00000180 C=DATA S=.data G=DGROUP M=Dialogs ACBP=A9 + 0002:00000A0C 0000018C C=DATA S=.data G=DGROUP M=ExtCtrls ACBP=A9 + 0002:00000B98 0000009E C=DATA S=.data G=DGROUP M=Buttons ACBP=A9 + 0002:00000C38 00000008 C=DATA S=.data G=DGROUP M=IniFiles ACBP=A9 + 0002:00000C40 00000008 C=DATA S=.data G=DGROUP M=Registry ACBP=A9 + 0002:00000C48 00000008 C=DATA S=.data G=DGROUP M=Mapi ACBP=A9 + 0002:00000C50 000000B9 C=DATA S=.data G=DGROUP M=ComCtrls ACBP=A9 + 0002:00000D0C 00000068 C=DATA S=.data G=DGROUP M=Themes ACBP=A9 + 0002:00000D74 00000178 C=DATA S=.data G=DGROUP M=StdCtrls ACBP=A9 + 0002:00000EEC 0000013C C=DATA S=.data G=DGROUP M=Controls ACBP=A9 + 0002:00001028 00000020 C=DATA S=.data G=DGROUP M=ImgList ACBP=A9 + 0002:00001048 000000EC C=DATA S=.data G=DGROUP M=Menus ACBP=A9 + 0002:00001134 00000124 C=DATA S=.data G=DGROUP M=Forms ACBP=A9 + 0002:00001258 00000030 C=DATA S=.data G=DGROUP M=ComObj ACBP=A9 + 0002:00001288 0000002C C=DATA S=.data G=DGROUP M=OleCtrls ACBP=A9 + 0002:000012B4 00000908 C=DATA S=.data G=DGROUP M=jpeg ACBP=A9 + 0002:00001BBC 00000058 C=DATA S=.data G=DGROUP M=MSCommLib_TLB ACBP=A9 + 0002:00001C14 00000009 C=DATA S=.data G=DGROUP M=MaskUtils ACBP=A9 + 0002:00001C20 00000004 C=DATA S=.data G=DGROUP M=Mask ACBP=A9 + 0002:00001C24 00000006 C=DATA S=.data G=DGROUP M=Grids ACBP=A9 + 0002:00001C2C 000000D4 C=DATA S=.data G=DGROUP M=UnitTCO ACBP=A9 + 0002:00001D00 0000060D C=DATA S=.data G=DGROUP M=UnitPrinc ACBP=A9 + 0002:00003000 00000664 C=BSS S=.bss G=DGROUP M=System ACBP=A9 + 0002:00003664 00000010 C=BSS S=.bss G=DGROUP M=SysInit ACBP=A9 + 0002:00003674 00000004 C=BSS S=.bss G=DGROUP M=Types ACBP=A9 + 0002:00003678 00000004 C=BSS S=.bss G=DGROUP M=Windows ACBP=A9 + 0002:0000367C 00000004 C=BSS S=.bss G=DGROUP M=Messages ACBP=A9 + 0002:00003680 00000004 C=BSS S=.bss G=DGROUP M=SysConst ACBP=A9 + 0002:00003684 00000120 C=BSS S=.bss G=DGROUP M=SysUtils ACBP=A9 + 0002:000037A4 0000005C C=BSS S=.bss G=DGROUP M=VarUtils ACBP=A9 + 0002:00003800 00000040 C=BSS S=.bss G=DGROUP M=Variants ACBP=A9 + 0002:00003840 00000004 C=BSS S=.bss G=DGROUP M=RTLConsts ACBP=A9 + 0002:00003844 00000004 C=BSS S=.bss G=DGROUP M=TypInfo ACBP=A9 + 0002:00003848 00000004 C=BSS S=.bss G=DGROUP M=ActiveX ACBP=A9 + 0002:0000384C 00000040 C=BSS S=.bss G=DGROUP M=Classes ACBP=A9 + 0002:0000388C 00000004 C=BSS S=.bss G=DGROUP M=Consts ACBP=A9 + 0002:00003890 00000060 C=BSS S=.bss G=DGROUP M=Graphics ACBP=A9 + 0002:000038F0 00000004 C=BSS S=.bss G=DGROUP M=Math ACBP=A9 + 0002:000038F4 00000004 C=BSS S=.bss G=DGROUP M=Contnrs ACBP=A9 + 0002:000038F8 0000000C C=BSS S=.bss G=DGROUP M=CommCtrl ACBP=A9 + 0002:00003904 00000031 C=BSS S=.bss G=DGROUP M=MultiMon ACBP=A9 + 0002:00003938 00000004 C=BSS S=.bss G=DGROUP M=Imm ACBP=A9 + 0002:0000393C 00000008 C=BSS S=.bss G=DGROUP M=HelpIntfs ACBP=A9 + 0002:00003944 00000004 C=BSS S=.bss G=DGROUP M=WinSpool ACBP=A9 + 0002:00003948 00000004 C=BSS S=.bss G=DGROUP M=Printers ACBP=A9 + 0002:0000394C 00000034 C=BSS S=.bss G=DGROUP M=FlatSB ACBP=A9 + 0002:00003980 00000004 C=BSS S=.bss G=DGROUP M=SyncObjs ACBP=A9 + 0002:00003984 000000CC C=BSS S=.bss G=DGROUP M=UxTheme ACBP=A9 + 0002:00003A50 00000004 C=BSS S=.bss G=DGROUP M=RichEdit ACBP=A9 + 0002:00003A54 00000004 C=BSS S=.bss G=DGROUP M=ToolWin ACBP=A9 + 0002:00003A58 00000004 C=BSS S=.bss G=DGROUP M=ShellAPI ACBP=A9 + 0002:00003A5C 00000004 C=BSS S=.bss G=DGROUP M=RegStr ACBP=A9 + 0002:00003A60 00000004 C=BSS S=.bss G=DGROUP M=WinInet ACBP=A9 + 0002:00003A64 00000004 C=BSS S=.bss G=DGROUP M=UrlMon ACBP=A9 + 0002:00003A68 00000004 C=BSS S=.bss G=DGROUP M=ShlObj ACBP=A9 + 0002:00003A6C 00000004 C=BSS S=.bss G=DGROUP M=CommDlg ACBP=A9 + 0002:00003A70 00000004 C=BSS S=.bss G=DGROUP M=Dlgs ACBP=A9 + 0002:00003A74 0000003C C=BSS S=.bss G=DGROUP M=Dialogs ACBP=A9 + 0002:00003AB0 00000004 C=BSS S=.bss G=DGROUP M=ExtCtrls ACBP=A9 + 0002:00003AB4 00000004 C=BSS S=.bss G=DGROUP M=ComStrs ACBP=A9 + 0002:00003AB8 0000000C C=BSS S=.bss G=DGROUP M=Clipbrd ACBP=A9 + 0002:00003AC4 00000004 C=BSS S=.bss G=DGROUP M=StrUtils ACBP=A9 + 0002:00003AC8 00000030 C=BSS S=.bss G=DGROUP M=Buttons ACBP=A9 + 0002:00003AF8 00000004 C=BSS S=.bss G=DGROUP M=ExtDlgs ACBP=A9 + 0002:00003AFC 00000004 C=BSS S=.bss G=DGROUP M=IniFiles ACBP=A9 + 0002:00003B00 00000004 C=BSS S=.bss G=DGROUP M=Registry ACBP=A9 + 0002:00003B04 00000004 C=BSS S=.bss G=DGROUP M=Mapi ACBP=A9 + 0002:00003B08 00000009 C=BSS S=.bss G=DGROUP M=ExtActns ACBP=A9 + 0002:00003B14 00000004 C=BSS S=.bss G=DGROUP M=ListActns ACBP=A9 + 0002:00003B18 00000010 C=BSS S=.bss G=DGROUP M=ComCtrls ACBP=A9 + 0002:00003B28 00000008 C=BSS S=.bss G=DGROUP M=Themes ACBP=A9 + 0002:00003B30 00000004 C=BSS S=.bss G=DGROUP M=StdCtrls ACBP=A9 + 0002:00003B34 00000004 C=BSS S=.bss G=DGROUP M=StdActns ACBP=A9 + 0002:00003B38 00000014 C=BSS S=.bss G=DGROUP M=WinHelpViewer ACBP=A9 + 0002:00003B4C 00000080 C=BSS S=.bss G=DGROUP M=Controls ACBP=A9 + 0002:00003BCC 00000004 C=BSS S=.bss G=DGROUP M=ActnList ACBP=A9 + 0002:00003BD0 0000000C C=BSS S=.bss G=DGROUP M=ImgList ACBP=A9 + 0002:00003BDC 00000010 C=BSS S=.bss G=DGROUP M=Menus ACBP=A9 + 0002:00003BEC 00000020 C=BSS S=.bss G=DGROUP M=Forms ACBP=A9 + 0002:00003C0C 00000004 C=BSS S=.bss G=DGROUP M=ComConst ACBP=A9 + 0002:00003C10 00000011 C=BSS S=.bss G=DGROUP M=ComObj ACBP=A9 + 0002:00003C24 00000004 C=BSS S=.bss G=DGROUP M=StdVCL ACBP=A9 + 0002:00003C28 0000001C C=BSS S=.bss G=DGROUP M=AxCtrls ACBP=A9 + 0002:00003C44 00000004 C=BSS S=.bss G=DGROUP M=OleConst ACBP=A9 + 0002:00003C48 00000014 C=BSS S=.bss G=DGROUP M=OleCtrls ACBP=A9 + 0002:00003C5C 00000004 C=BSS S=.bss G=DGROUP M=JConsts ACBP=A9 + 0002:00003C60 00000004 C=BSS S=.bss G=DGROUP M=jpeg ACBP=A9 + 0002:00003C64 00000048 C=BSS S=.bss G=DGROUP M=TlHelp32 ACBP=A9 + 0002:00003CAC 00000004 C=BSS S=.bss G=DGROUP M=WinSock ACBP=A9 + 0002:00003CB0 00000194 C=BSS S=.bss G=DGROUP M=ScktComp ACBP=A9 + 0002:00003E44 00000004 C=BSS S=.bss G=DGROUP M=OleServer ACBP=A9 + 0002:00003E48 00000004 C=BSS S=.bss G=DGROUP M=MSCommLib_TLB ACBP=A9 + 0002:00003E4C 00000004 C=BSS S=.bss G=DGROUP M=MMSystem ACBP=A9 + 0002:00003E50 00000004 C=BSS S=.bss G=DGROUP M=Nb30 ACBP=A9 + 0002:00003E54 00000004 C=BSS S=.bss G=DGROUP M=MaskUtils ACBP=A9 + 0002:00003E58 00000004 C=BSS S=.bss G=DGROUP M=Mask ACBP=A9 + 0002:00003E5C 00000004 C=BSS S=.bss G=DGROUP M=Grids ACBP=A9 + 0002:00003E60 00000010 C=BSS S=.bss G=DGROUP M=UnitPilote ACBP=A9 + 0002:00003E70 00000010 C=BSS S=.bss G=DGROUP M=Importation ACBP=A9 + 0002:00003E80 00003DC0 C=BSS S=.bss G=DGROUP M=UnitAnalyseSegCDM ACBP=A9 + 0002:00007C40 00000014 C=BSS S=.bss G=DGROUP M=UnitConfigTCO ACBP=A9 + 0002:00007C54 00000014 C=BSS S=.bss G=DGROUP M=Unit_Pilote_aig ACBP=A9 + 0002:00007C68 00000014 C=BSS S=.bss G=DGROUP M=UnitConfigCellTCO ACBP=A9 + 0002:00007C7C 00041DA4 C=BSS S=.bss G=DGROUP M=UnitTCO ACBP=A9 + 0002:00049A20 00000010 C=BSS S=.bss G=DGROUP M=UnitSR ACBP=A9 + 0002:00049A30 00000014 C=BSS S=.bss G=DGROUP M=UnitCDF ACBP=A9 + 0002:00049A44 00000014 C=BSS S=.bss G=DGROUP M=verif_version ACBP=A9 + 0002:00049A58 00000004 C=BSS S=.bss G=DGROUP M=UnitPareFeu ACBP=A9 + 0002:00049A5C 00000380 C=BSS S=.bss G=DGROUP M=UnitConfig ACBP=A9 + 0002:00049DDC 00000028 C=BSS S=.bss G=DGROUP M=UnitDebug ACBP=A9 + 0002:00049E04 0000000C C=BSS S=.bss G=DGROUP M=UnitSimule ACBP=A9 + 0002:00049E10 00000008 C=BSS S=.bss G=DGROUP M=Unitplace ACBP=A9 + 0002:00049E18 041596EC C=BSS S=.bss G=DGROUP M=UnitPrinc ACBP=A9 + +Bound resource files + +c:\program files (x86)\borland\delphi7\Lib\Buttons.res +c:\program files (x86)\borland\delphi7\Lib\ExtDlgs.res +c:\program files (x86)\borland\delphi7\Lib\Controls.res +UnitPilote.dfm +Importation.dfm +UnitAnalyseSegCDM.dfm +UnitConfigTCO.dfm +Unit_Pilote_aig.dfm +UnitConfigCellTCO.dfm +UnitTCO.dfm +UnitSR.dfm +UnitCDF.dfm +verif_version.dfm +UnitConfig.dfm +UnitDebug.dfm +UnitSimule.dfm +Unitplace.dfm +UnitPrinc.dfm +Signaux_complexes_GL.res +Signaux_complexes_GL.drf + + +Program entry point at 0001:0015E010 diff --git a/Signaux_complexes_GL.res b/Signaux_complexes_GL.res index e60a7bf..ff026ad 100644 Binary files a/Signaux_complexes_GL.res and b/Signaux_complexes_GL.res differ diff --git a/UnitAnalyseSegCDM.pas b/UnitAnalyseSegCDM.pas index 7182106..17425a9 100644 --- a/UnitAnalyseSegCDM.pas +++ b/UnitAnalyseSegCDM.pas @@ -3329,10 +3329,19 @@ procedure Compilation; var s : string; nombre,position : integer; begin - s:=lowercase(Formprinc.fenRich.Lines[0]); - if pos('module',s)=0 then + nombre:=Formprinc.FenRich.Lines.Count; + if nombre>0 then begin - Affiche('Pas de module détecté',clred); + s:=lowercase(Formprinc.fenRich.Lines[0]); + if pos('module',s)=0 then + begin + Affiche('Pas de module CDM détecté',clred); + exit; + end; + end + else + begin + Affiche('Tampon vide',clred); exit; end; @@ -3346,7 +3355,7 @@ begin nligne:=0; nSeg:=0; DernAdrAig:=0; xminiCDM:=0;yMiniCDM:=0;xmaxiCDM:=0;yMaxiCDM:=0; - nombre:=Formprinc.FenRich.Lines.Count; + NomModuleCDM:=AnsiLowerCase(Lignes[0]+'.cdm'); formAnalyseCDM.Caption:='Squelette du réseau '+NomModuleCDM; formAnalyseCDM.Show; diff --git a/UnitCDF.pas b/UnitCDF.pas index d58c17e..cd0e1c5 100644 --- a/UnitCDF.pas +++ b/UnitCDF.pas @@ -186,12 +186,12 @@ begin case feux[i].aspect of // feux de signalisation - 2 : dessine_feu2(Vcanvas,0,0,1,1,EtatFeupilote,1); - 3 : dessine_feu3(Vcanvas,0,0,1,1,EtatFeupilote,AncienEtat,1); - 4 : dessine_feu4(VCanvas,0,0,1,1,EtatFeupilote,1); - 5 : dessine_feu5(VCanvas,0,0,1,1,EtatFeupilote,1); - 7 : dessine_feu7(VCanvas,0,0,1,1,EtatFeupilote,1); - 9 : dessine_feu9(VCanvas,0,0,1,1,EtatFeupilote,1); + 2 : dessine_signal2(Vcanvas,0,0,1,1,EtatFeupilote,1); + 3 : dessine_signal3(Vcanvas,0,0,1,1,EtatFeupilote,AncienEtat,1); + 4 : dessine_signal4(VCanvas,0,0,1,1,EtatFeupilote,1); + 5 : dessine_signal5(VCanvas,0,0,1,1,EtatFeupilote,1); + 7 : dessine_signal7(VCanvas,0,0,1,1,EtatFeupilote,1); + 9 : dessine_signal9(VCanvas,0,0,1,1,EtatFeupilote,1); // indicateurs de direction 12 : dessine_dirN(VCanvas,0,0,1,1,EtatFeupilote,1,2); 13 : dessine_dirN(VCanvas,0,0,1,1,EtatFeupilote,1,3); diff --git a/UnitConfig.dfm b/UnitConfig.dfm index 17c43ae..2bfce5e 100644 --- a/UnitConfig.dfm +++ b/UnitConfig.dfm @@ -1,6 +1,6 @@ object FormConfig: TFormConfig - Left = 178 - Top = 109 + Left = 255 + Top = 125 Hint = 'Modifie la configuration selon les s'#233'lections choisies' BorderStyle = bsDialog Caption = 'Configuration g'#233'n'#233'rale' @@ -1748,7 +1748,7 @@ object FormConfig: TFormConfig object GroupBox6: TGroupBox Left = 312 Top = 8 - Width = 281 + Width = 297 Height = 169 Caption = 'Au d'#233'marrage de CDM Rail : serveur' TabOrder = 2 @@ -1828,8 +1828,8 @@ object FormConfig: TFormConfig object GroupBox7: TGroupBox Left = 312 Top = 184 - Width = 281 - Height = 89 + Width = 297 + Height = 65 Caption = 'Au d'#233'marrage de CDM Rail : interface LENZ' TabOrder = 3 object RadioButton13: TRadioButton @@ -1843,39 +1843,39 @@ object FormConfig: TFormConfig object RadioButton14: TRadioButton Left = 8 Top = 40 - Width = 217 + Width = 81 Height = 17 Caption = 'LI-USB' TabOrder = 1 end object RadioButton15: TRadioButton - Left = 152 + Left = 112 Top = 40 - Width = 105 + Width = 73 Height = 17 Caption = 'LI-101F' TabOrder = 2 end object RadioButton16: TRadioButton - Left = 8 - Top = 56 + Left = 200 + Top = 40 Width = 89 Height = 17 Caption = 'LI-100F' TabOrder = 3 end object RadioButton17: TRadioButton - Left = 152 - Top = 56 + Left = 200 + Top = 24 Width = 89 Height = 17 Caption = 'LI-100' TabOrder = 4 end object RadioButton18: TRadioButton - Left = 152 + Left = 112 Top = 24 - Width = 113 + Width = 65 Height = 17 Caption = 'Genli' TabOrder = 5 @@ -1943,9 +1943,9 @@ object FormConfig: TFormConfig end object GroupBox15: TGroupBox Left = 312 - Top = 288 - Width = 281 - Height = 137 + Top = 256 + Width = 297 + Height = 185 Caption = 'Divers' TabOrder = 5 object Label31: TLabel @@ -1976,6 +1976,13 @@ object FormConfig: TFormConfig Height = 13 Caption = 'Debug' end + object Label28: TLabel + Left = 8 + Top = 134 + Width = 163 + Height = 13 + Caption = 'Protocole COM/USB actionneurs :' + end object EditNbDetDist: TEdit Left = 240 Top = 20 @@ -2022,7 +2029,7 @@ object FormConfig: TFormConfig end object CheckBoxVerifXpressNet: TCheckBox Left = 8 - Top = 112 + Top = 108 Width = 233 Height = 17 Hint = @@ -2035,6 +2042,30 @@ object FormConfig: TFormConfig TabOrder = 4 OnClick = CheckBoxVerifXpressNetClick end + object EditPortCde: TEdit + Left = 176 + Top = 128 + Width = 113 + Height = 21 + Hint = 'Vitesse et protocole liaison COM/USB d'#233'clench'#233's par actionneurs' + ParentShowHint = False + ShowHint = True + TabOrder = 5 + end + object CheckBoxCR: TCheckBox + Left = 8 + Top = 152 + Width = 153 + Height = 17 + Hint = + 'Ajoute un CR apr'#232's l'#39'envoi de la cha'#238'ne sur le COM/USB d'#233'clench'#233 + + ' par un actionneur' + Caption = 'Envoyer CR (retour chariot)' + ParentShowHint = False + ShowHint = True + TabOrder = 6 + OnClick = CheckBoxCRClick + end end end object TabSheetAutonome: TTabSheet @@ -2508,6 +2539,9 @@ object FormConfig: TFormConfig Top = 20 Width = 33 Height = 21 + Hint = 'Adresse de l'#39'aiguillage' + ParentShowHint = False + ShowHint = True TabOrder = 2 OnChange = EditAdrAigChange end @@ -3290,6 +3324,9 @@ object FormConfig: TFormConfig Top = 18 Width = 33 Height = 21 + Hint = 'Adresse du signal' + ParentShowHint = False + ShowHint = True TabOrder = 0 OnChange = EditAdrSigChange end @@ -3657,7 +3694,7 @@ object FormConfig: TFormConfig Left = 8 Top = 16 Width = 225 - Height = 73 + Height = 89 Caption = 'Type d'#39'action' TabOrder = 0 object RadioButtonLoc: TRadioButton @@ -3687,12 +3724,21 @@ object FormConfig: TFormConfig TabOrder = 2 OnClick = RadioButtonSonClick end + object RadioButtonCde: TRadioButton + Left = 24 + Top = 64 + Width = 137 + Height = 17 + Caption = 'Commande COM/USB' + TabOrder = 3 + OnClick = RadioButtonCdeClick + end end object GroupBoxAct: TGroupBox Left = 8 - Top = 84 + Top = 96 Width = 233 - Height = 341 + Height = 321 Caption = 'Action fonction de locomotive ' TabOrder = 1 object GroupBox18: TGroupBox @@ -3804,9 +3850,9 @@ object FormConfig: TFormConfig end object GroupBox19: TGroupBox Left = 8 - Top = 184 + Top = 176 Width = 217 - Height = 129 + Height = 137 Caption = 'Destinataire de l'#39'action ' TabOrder = 1 object LabelTempo: TLabel @@ -3834,8 +3880,8 @@ object FormConfig: TFormConfig Caption = #224 end object LabelNomSon: TLabel - Left = 16 - Top = 32 + Left = 0 + Top = 56 Width = 91 Height = 13 Caption = 'Nom du fichier son:' @@ -3973,15 +4019,15 @@ object FormConfig: TFormConfig OnChange = EditEtatFoncSortieChange end object EditSon: TEdit - Left = 32 - Top = 64 + Left = 16 + Top = 88 Width = 161 Height = 21 TabOrder = 4 OnChange = EditSonChange end object EditTrainDest: TEdit - Left = 72 + Left = 80 Top = 64 Width = 129 Height = 21 @@ -3993,8 +4039,8 @@ object FormConfig: TFormConfig end end object ButtonTestAct: TButton - Left = 64 - Top = 306 + Left = 16 + Top = 294 Width = 89 Height = 20 Hint = 'Test de l'#39'actionneur/d'#233'tecteur en mode RUN' @@ -4004,10 +4050,22 @@ object FormConfig: TFormConfig TabOrder = 2 OnClick = ButtonTestActClick end + object ButtonOuvreCom: TButton + Left = 120 + Top = 296 + Width = 75 + Height = 20 + Hint = 'R'#233'ouvre les ports COMs demand'#233's' + Caption = 'Ouvre COMs' + ParentShowHint = False + ShowHint = True + TabOrder = 3 + OnClick = ButtonOuvreComClick + end end object GroupBoxPN: TGroupBox - Left = 32 - Top = 16 + Left = 216 + Top = 24 Width = 233 Height = 401 Caption = 'Action gestion passage '#224' niveau' diff --git a/UnitConfig.pas b/UnitConfig.pas index 423e666..58ac6f8 100644 --- a/UnitConfig.pas +++ b/UnitConfig.pas @@ -366,6 +366,11 @@ type N2: TMenuItem; outcopierentatquetexte1: TMenuItem; CheckBoxAffMemo: TCheckBox; + RadioButtonCde: TRadioButton; + Label28: TLabel; + EditPortCde: TEdit; + ButtonOuvreCom: TButton; + CheckBoxCR: TCheckBox; procedure ButtonAppliquerEtFermerClick(Sender: TObject); procedure FormActivate(Sender: TObject); procedure FormCreate(Sender: TObject); @@ -549,6 +554,9 @@ type procedure Supprimer1Click(Sender: TObject); procedure Nouveau1Click(Sender: TObject); procedure outcopierentatquetexte1Click(Sender: TObject); + procedure RadioButtonCdeClick(Sender: TObject); + procedure ButtonOuvreComClick(Sender: TObject); + procedure CheckBoxCRClick(Sender: TObject); private { Déclarations privées } @@ -563,6 +571,7 @@ const // constantes du fichier de configuration NomConfig='ConfigGenerale.cfg'; Debug_ch='Debug'; +ProtocolePortCde_ch='ProtocolePortCde'; AntiTimeoutEthLenz_ch='AntiTimeoutEthLenz'; Verif_AdrXpressNet_ch='Verif_AdrXpressNet'; Filtrage_det_ch='Filtrage_det'; @@ -580,6 +589,7 @@ Init_dem_interfaceUSBCOM_ch='Init_demUSBCOM'; Init_dem_interfaceEth_ch='Init_demETH'; IPV4_INTERFACE_ch='Ipv4_interface'; PROTOCOLE_SERIE_ch='Protocole_serie'; +CR_ch='Cr'; INTER_CAR_ch='Inter_car'; Tempo_maxi_ch='Tempo_maxi'; Entete_ch='Entete'; @@ -611,7 +621,6 @@ LargeurF_ch='LargeurF'; HauteurF_ch='HauteurF'; OffsetXF_ch='OffsetX'; OffsetYF_ch='OffsetY'; -etatF_ch='EtatF'; PosSplitter_ch='Splitter'; // sections de config @@ -628,20 +637,21 @@ section_DecPers_ch='[section_decodeurs]'; var FormConfig: TFormConfig; - AdresseIPCDM,AdresseIP,PortCom,recuCDM,residuCDM,trainsauve : string; + AdresseIPCDM,AdresseIP,PortCom,portComCde,recuCDM,residuCDM,trainsauve : string; portCDM,TempoOctet,TimoutMaxInterface,Valeur_entete,PortInterface,prot_serie,NumPort,debug, LigneCliqueePN,AncLigneCliqueePN,clicMemo,Nb_cantons_Sig,protocole,Port, ligneclicAig,AncLigneClicAig,ligneClicSig,AncligneClicSig,EnvAigDccpp,AdrBaseDetDccpp, ligneClicBr,AncligneClicBr,ligneClicAct,AncLigneClicAct,Adressefeuclic,NumTrameCDM, Algo_localisation,Verif_AdrXpressNet,ligneclicTrain,AncligneclicTrain,AntiTimeoutEthLenz, - ligneDCC,decCourant,AffMemoFenetre : integer; + ligneDCC,decCourant,AffMemoFenetre,NbreComCde,avecCR : integer; ack_cdm,clicliste,config_modifie,clicproprietes,confasauver,trouve_MaxPort, modif_branches,ConfigPrete,trouve_section_dccpp,trouve_section_trains, trouveAvecVerifIconesTCO,Affiche_avert,activ,trouve_section_dec_pers : boolean; fichier : text; + EditT : Array[1..10] of Tedit; ComboL1,ComboL2,ComboTS1,ComboTS2 : Array[1..10] of TComboBox; ShapeT : array[1..10] of TShape; @@ -1158,6 +1168,7 @@ begin end; // décode la ligne de signal et la stocke dans l'index i du tableau feux +// sortie vrai si le signal a été stocké - faux si doublon function decode_ligne_feux(chaine_signal : string;i : integer) : boolean; var s,chaine,sa : string; j,k,l,t,id,adresse,adr,erreur ,asp,bd: integer; @@ -1187,6 +1198,7 @@ begin end; end; inc(nbreFeux); + index_accessoire[adresse]:=i; Delete(s,1,j); feux[i].adresse:=adresse; @@ -1306,6 +1318,12 @@ begin if (j=4) then feux[i].Btype_Suiv4:=det; end; Val(s,adr,erreur); + if Adr>NbMemZone then + begin + Affiche('Erreur 677B : ligne '+chaine_signal+' : adresse élément trop grand: '+intToSTR(adr),clred); + Adr:=NbMemZone; + end; + if (j=1) then feux[i].Adr_el_suiv1:=Adr; if (j=2) then feux[i].Adr_el_suiv2:=Adr; if (j=3) then feux[i].Adr_el_suiv3:=Adr; @@ -1551,7 +1569,7 @@ begin // adresse adresse:=Tablo_Actionneur[i].adresse; - // type actionneur + // type déclencheur case Tablo_Actionneur[i].typdeclenche of 0 : begin @@ -1584,6 +1602,9 @@ begin if Tablo_Actionneur[i].son then s:=s+','+IntToSTR(Tablo_Actionneur[i].Etat)+','+Tablo_Actionneur[i].trainDecl+',"'+Tablo_Actionneur[i].FichierSon+'"'; + if Tablo_Actionneur[i].cde then + s:=s+','+IntToSTR(Tablo_Actionneur[i].Etat)+','+Tablo_Actionneur[i].trainDecl+',COM'+IntToSTR(Tablo_Actionneur[i].fonction)+','+Tablo_Actionneur[i].trainDest; + encode_act_loc_son:=s; end; @@ -1654,7 +1675,6 @@ begin writeln(fichierN,hauteurF_ch+'=',hauteurF); writeln(fichierN,OffsetXF_ch+'=',OffsetXF); writeln(fichierN,OffsetYF_ch+'=',OffsetYF); - writeln(fichierN,EtatF_ch+'=',EtatF); writeln(fichierN,PosSplitter_ch+'=',PosSplitter); writeln(fichierN,AvecVerifIconesTCO_ch+'=',AvecVerifIconesTCO); @@ -1692,6 +1712,12 @@ begin // port com writeln(fichierN,Protocole_serie_ch+'=',portcom); + // porotocole COM cde accessoires + writeln(fichierN,ProtocolePortCde_ch+'=',portComcde); + + // avec CR + writeln(fichierN,CR_ch+'=',avecCR); + // temporisation caractère TempoOctet writeln(fichierN,Inter_Car_ch+'=',IntToSTR(TempoOctet)); @@ -1903,6 +1929,33 @@ begin end; +// affecte un index à un com dans le tableau tablo_com_cde +function affecte_index_com(NumCom : integer) : boolean; +var j : integer; + trouve : boolean; +begin + j:=1; + repeat + trouve:=Tablo_com_cde[j].NumPort=NumCom; + if not(trouve) then inc(j); + until (Trouve) or (j>10); + // le com n'a pas été stocké, le stocker et incrémenter l'indice du tableau + if not(trouve) then + begin + if NbreComCde0 then begin @@ -2094,6 +2154,7 @@ var s,sa,SOrigine: string; Tablo_actionneur[maxtablo_act].act:=true; Tablo_actionneur[maxtablo_act].son:=false; Tablo_actionneur[maxtablo_act].loco:=false; + Tablo_actionneur[maxtablo_act].cde:=false; i:=pos(',',s); if i<>0 then @@ -2140,6 +2201,7 @@ var s,sa,SOrigine: string; Tablo_actionneur[maxtablo_act].act:=false; Tablo_actionneur[maxtablo_act].loco:=true; Tablo_actionneur[maxtablo_act].son:=false; + Tablo_actionneur[maxtablo_act].cde:=false; // 815,1,CC406526,F2,450 i:=pos(',',s); @@ -2179,6 +2241,37 @@ var s,sa,SOrigine: string; end; end; + if length(sa)>3 then if copy(sa,1,3)='COM' then + // -----------------fonction commande COM + begin + Tablo_actionneur[maxtablo_act].act:=false; + Tablo_actionneur[maxtablo_act].loco:=false; + Tablo_actionneur[maxtablo_act].son:=false; + Tablo_actionneur[maxtablo_act].cde:=true; + + // 815,1,CC406526,F2,450 + i:=pos(',',s); + val(s,j,erreur); + Tablo_actionneur[maxTablo_act].etat:=j; + Delete(s,1,erreur); + + i:=pos(',',s); + Tablo_actionneur[maxTablo_act].trainDecl:=copy(s,1,i-1); + Delete(s,1,i); + + + delete(sa,1,3); + val(sa,i,erreur); // com + tablo_actionneur[maxTablo_act].fonction:=i; // numéro de COM + + affecte_index_com(i); + + i:=pos(',',sa); + delete(sa,1,i); + tablo_actionneur[maxTablo_act].trainDest:=sa; + inc(maxTablo_act); // incrémenter index de stockage du tableau des actionneurs + end; + // Passage à niveau if (pos('PN',s)<>0) then begin @@ -2299,12 +2392,13 @@ var s,sa,SOrigine: string; postjd:=pos('TJD',enregistrement);tjdC:=postjd<>0;if tjdC then delete(enregistrement,postjd,3); postjs:=pos('TJS',enregistrement);tjsC:=postjs<>0;if tjsC then delete(enregistrement,postjs,3); poscroi:=pos('CROI',enregistrement);croi:=poscroi<>0;if croi then delete(enregistrement,poscroi,4); - + // adresse de l'aiguillage Val(enregistrement,adraig,erreur); // adraig = adresse de l'aiguillage + if erreur<>0 then Affiche('Erreur aiguillage '+intToSTR(adraig)+' ; caractère '+enregistrement[erreur]+' inconnu',clred); if debugConfig then Affiche('Adresse='+IntToSTR(adraig)+' enregistrement='+Enregistrement,clyellow); - + Index_accessoire[adrAig]:=maxAiguillage; aiguillage[maxaiguillage].adresse:=adraig; aiguillage[maxaiguillage].AdroitB:='Z'; aiguillage[maxaiguillage].AdevieB:='Z'; aiguillage[maxaiguillage].DdroitB:='Z'; aiguillage[maxaiguillage].DdevieB:='Z'; @@ -2810,14 +2904,6 @@ end; val(s,OffsetYF,erreur); end; - sa:=uppercase(EtatF_ch)+'='; - i:=pos(sa,s); - if i=1 then - begin - delete(s,i,length(sa)); - val(s,EtatF,erreur); - end; - sa:=uppercase(PosSplitter_ch)+'='; i:=pos(sa,s); if i=1 then @@ -2951,7 +3037,19 @@ end; if (MaxPortCom<1) or (MaxPortCom>255) then MaxPortCom:=30; end; - // configuration du port com + + sa:=uppercase(CR_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + inc(nv); + delete(s,i,length(sa)); + val(s,avecCR,erreur); + if erreur<>0 then Affiche('Erreur CR: '+sOrigine,clred); + if (avecCR<0) or (avecCR>1) then avecCR:=0; + end; + + // configuration du port com interface sa:=uppercase(PROTOCOLE_SERIE_ch)+'='; i:=pos(sa,s); if i=1 then @@ -2964,7 +3062,18 @@ end; portcom:=s; end; - // temporisatflion entre 2 caractères + // configuration du port com interface commande accessoires + sa:=uppercase(ProtocolePortCde_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + inc(nv); + delete(s,i,length(sa)); + portcomcde:=s; + end; + + + // temporisation entre 2 caractères sa:=uppercase(INTER_CAR_ch)+'='; i:=pos(sa,s); if i=1 then @@ -3446,6 +3555,7 @@ begin except Affiche('Fichier '+NomConfig+' non trouvé : création d''un fichier vide par défaut',clred); portcom:='COM3:57600,N,8,1,2'; + portComCde:='COM5:115200,n,8,1'; adresseIPCDM:='127.0.0.1';portCDM:=9999; adresseIP:='192.168.1.23';portInterface:=5550; verifVersion:=true; @@ -3547,7 +3657,7 @@ begin end; function verifie_panneau_config : boolean; -var ChangeCDM,changeInterface,changeUSB,change_srv,ok : boolean; +var ChangeCDM,changeInterface,changeUSB,changeUSBcde,change_srv,ok : boolean; i,erreur : integer; s : string; begin @@ -3611,6 +3721,12 @@ begin changeUSB:=portcom<>s; portcom:=s; + s:=EditPortCDE.Text; + if s='' then s:='COMX:115200,N,8,1'; + changeUSBcde:=portcomcde<>s; + portcomcde:=s; + + val(EditTempoOctetUSB.text,i,erreur); if erreur<>0 then begin labelInfo.Caption:='Valeur temporisation octet incorrecte';ok:=false;end; TempoOctet:=i; @@ -3656,6 +3772,14 @@ begin connecte_USB; end; + { + if changeUSBcde then + begin + deconnecte_USB_cde(1); // &&& a revoir + connecte_port_usb_cde(1); + end; + } + verifVersion:=CheckVerifVersion.Checked; notificationVersion:=CheckInfoVersion.Checked; @@ -3663,6 +3787,7 @@ begin if CheckFenEt.checked then fenetre:=1 else fenetre:=0; if CheckBoxAffMemo.checked then AffMemoFenetre:=1 else AffMemoFenetre:=0; + if checkBoxCR.Checked then avecCR:=1 else avecCR:=0; AvecTCO:=CheckAvecTCO.checked; MasqueBandeauTCO:=CheckBandeauTCO.checked; lay:=editLay.Text; @@ -3737,7 +3862,7 @@ end; // affiche les champs du signal lc // LC=Adresse du signal procedure clicListeSignal(lc : integer); -var i,AncAdresse,index,adresse,erreur : integer; +var AncAdresse,index,adresse,erreur : integer; s : string; begin index:=index_Signal(lc)-1; @@ -3748,11 +3873,13 @@ begin exit; end; + { ne pas déselectionner tout!! with FormConfig.ListBoxSig do begin for i:=0 to Count-1 do Selected[i]:=false; FormConfig.ListBoxSig.Selected[index]:=true; end; + } Feu_Sauve:=feux[index+1]; // sauvegarde @@ -3776,7 +3903,6 @@ end; procedure TFormConfig.FormActivate(Sender: TObject); -var i : integer; begin if affevt then affiche('FormConfig activate',clLime); activ:=true; @@ -3814,6 +3940,7 @@ begin EditFiltrDet.text:=intToSTR(filtrageDet0); EditComUSB.Text:=PortCom; + EditPortCde.Text:=portcomcde; EditFonte.text:=IntToSTR(TailleFonte); editdebug.Text:=IntToSTR(debug); CheckBoxVerifXpressNet.Checked:=Verif_AdrXpressNet=1; @@ -3836,6 +3963,7 @@ begin CheckLanceCDM.Checked:=LanceCDM; CheckAvecTCO.checked:=avecTCO; CheckBandeauTCO.Checked:=MasqueBandeauTCO; + checkBoxCR.Checked:=avecCR=1; RadioButton4.Checked:=ServeurInterfaceCDM=0; RadioButton5.Checked:=ServeurInterfaceCDM=1; @@ -4506,7 +4634,7 @@ begin begin GroupBoxRadio.Visible:=false; GroupBoxAct.Visible:=false; - GroupBoxPN.Top:=24; + GroupBoxPN.Top:=16; GroupBoxPN.Left:=16; GroupBoxPN.Visible:=true; Visible:=true; @@ -4528,13 +4656,14 @@ begin GroupBoxRadio.Visible:=true; GroupBoxRadio.top:=16; GroupBoxRadio.Left:=16; - GroupBoxAct.Top:=92; + GroupBoxAct.Top:=GroupBoxRadio.Top+GroupBoxRadio.Height+8; GroupBoxAct.Left:=16; - GroupBoxAct.Height:=340; + GroupBoxAct.Height:=310; GroupBox18.Top:=16; GroupBox18.Height:=150; - GroupBox19.Top:=190; + GroupBox19.Top:=GroupBox18.Top+GroupBox18.Height+8; GroupBox19.Height:=96; + ButtonTestAct.Top:=GroupBox19.Top+GroupBox19.Height+8; end; end; @@ -4543,15 +4672,21 @@ begin with formconfig do begin positionne; - + ButtonOuvreCom.Visible:=false; CheckRaz.Visible:=false; GroupBoxAct.Caption:='Action pour fonction F de locomotive'; + EditFonctionAccess.Hint:='Numéro de fonction du décodeur du train (0 à 12 ou 28)'; + editTrainDest.Hint:='Train destinataire de la fonction F'; LabelTempo.Visible:=true; EditTempo.visible:=true; editEtatFoncSortie.visible:=false;LabelA.Visible:=false; LabelFonction.visible:=true; LabelFonction.caption:='Action : Fonction'; RadioButtonLoc.Checked:=true; RadioButtonAccess.Checked:=false; RadioButtonSon.Checked:=false; + RadioButtonCde.Checked:=false; + EditFonctionAccess.Top:=14; + LabelFonction.Top:=18; + GroupBoxAct.Visible:=true; GroupBoxPN.Visible:=false; EditSon.Visible:=false; @@ -4561,6 +4696,46 @@ begin LabelNomSon.Visible:=false; editTrainDest.Visible:=true; label42.Visible:=true; + Label42.caption:='Train dest'; + end; +end; + +procedure champs_type_Cde; +begin + with formconfig do + begin + positionne; + editTrainDest.Hint:='Commande ASCII'; + EditFonctionAccess.Hint:='Port Com/Usb d''envoi de la commande'; + + CheckRaz.Visible:=false; + 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:='Port COM/USB :'; + LabelFonction.Top:=22; + + EditFonctionAccess.Visible:=true; + EditFonctionAccess.Top:=20; + + RadioButtonLoc.Checked:=false; + RadioButtonAccess.Checked:=false; + RadioButtonSon.Checked:=false; + RadioButtonCde.Checked:=true; + GroupBoxAct.Visible:=true; + GroupBoxPN.Visible:=false; + EditSon.Visible:=false; + SpeedButtonJoue.Visible:=false; + SpeedButtonCharger.Visible:=false; + + LabelNomSon.Visible:=false; + LabelTempo.Visible:=false; + editTrainDest.Visible:=true; + EditTempo.Visible:=false; + label42.Visible:=true; + Label42.caption:='Commande'; + ButtonOuvreCom.Top:=GroupBox19.Top+GroupBox19.Height+8; + ButtonOuvreCom.Visible:=true; end; end; @@ -4572,6 +4747,7 @@ begin GroupBoxAct.Caption:='Action pour accessoire'; CheckRaz.Visible:=true; + ButtonOuvreCom.Visible:=false; LabelTempo.Visible:=false; EditTempo.visible:=false;editEtatFoncSortie.visible:=true;LabelA.Visible:=true; LabelFonction.visible:=true; LabelFonction.caption:='Action : Accessoire'; @@ -4580,6 +4756,8 @@ begin RadioButtonAccess.Checked:=true; GroupBoxAct.Visible:=true; GroupBoxPN.Visible:=false; + EditFonctionAccess.Top:=14; + LabelFonction.Top:=18; EditSon.Visible:=false; SpeedButtonJoue.Visible:=false; SpeedButtonCharger.Visible:=false; @@ -4597,9 +4775,11 @@ begin Positionne; GroupBoxAct.Caption:='Action pour son'; CheckRaz.Visible:=true; + ButtonOuvreCom.Visible:=false; LabelTempo.Visible:=false; EditTempo.visible:=false; - + EditFonctionAccess.Top:=14; + LabelFonction.Top:=18; editEtatFoncSortie.visible:=false; LabelA.Visible:=false; LabelFonction.visible:=false; @@ -4613,6 +4793,7 @@ begin RadioButtonLoc.Checked:=false; RadioButtonAccess.Checked:=false; RadioButtonSon.checked:=true; + RadioButtonCde.Checked:=false; GroupBoxAct.Visible:=true; GroupBoxPN.Visible:=false; @@ -4957,6 +5138,10 @@ begin 0 : begin champs_decl_actdet; + editAct.Text:=intToSTR(Tablo_actionneur[i].adresse); + editEtatActionneur.Text:=intToSTR(Tablo_actionneur[i].etat); + editEtatFoncSortie.Text:=intToSTR(Tablo_actionneur[i].sortie); + EditTrainDecl.Text:=Tablo_actionneur[i].trainDecl; end; 3 : begin @@ -5057,6 +5242,18 @@ begin EditEtatActionneur.Text:=IntToSTR(etatAct); end; end; + + if Tablo_actionneur[i].cde then + begin + champs_type_cde; + with formConfig do + begin + EditFonctionAccess.text:=inttostr(Tablo_actionneur[i].fonction); + EditEtatFoncSortie.Text:=intToSTR(Tablo_actionneur[i].etat); + EditTrainDest.text:=Tablo_actionneur[i].TrainDest; + end; + end; + end; procedure raz_champs_pn; @@ -6240,7 +6437,7 @@ begin with Formconfig do begin s:=EditAct.Text; - if radioButtonLoc.Checked or RadioButtonAccess.Checked or RadioButtonSon.Checked then + if radioButtonLoc.Checked or RadioButtonAccess.Checked or RadioButtonSon.Checked or radioButtonCde.checked then begin Val(s,act,erreur); if s='' then exit; @@ -6319,7 +6516,7 @@ end; procedure TFormConfig.ListBoxActMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); -var ligne,i : integer; +var i : integer; begin clicliste:=true; if maxTablo_act<1 then exit; @@ -6350,7 +6547,7 @@ begin with Formconfig do begin s:=upperCase(EditEtatActionneur.Text); - if radioButtonLoc.Checked or RadioButtonAccess.Checked or RadioButtonSon.Checked then + if radioButtonLoc.Checked or RadioButtonAccess.Checked or RadioButtonSon.Checked or RadioButtonCde.Checked then begin typ:=tablo_actionneur[ligneClicAct+1].typdeclenche; if (typ=2) and (s<>'') then // aiguillage @@ -6411,7 +6608,7 @@ begin if FormConfig.PageControl.ActivePage=FormConfig.TabSheetAct then with Formconfig do begin - if radioButtonLoc.Checked then + if radioButtonLoc.Checked or RadioButtonCde.Checked then begin train:=EditTrainDest.Text; if train='' then @@ -6464,7 +6661,7 @@ begin with Formconfig do begin s:=EditFonctionAccess.Text; - if radioButtonLoc.Checked or RadioButtonAccess.Checked then + if radioButtonLoc.Checked or RadioButtonAccess.Checked or RadioButtonCde.Checked then begin Val(s,fonction,erreur); if erreur<>0 then @@ -6472,7 +6669,7 @@ begin LabelInfo.caption:='Erreur fonction actionneur';exit end else LabelInfo.caption:=' '; - if radioButtonLoc.Checked then tablo_actionneur[ligneClicAct+1].fonction:=fonction; + if radioButtonLoc.Checked or RadioButtonCde.Checked then tablo_actionneur[ligneClicAct+1].fonction:=fonction; if RadioButtonAccess.Checked then Tablo_Actionneur[ligneClicAct+1].accessoire:=fonction; s:=encode_act_loc_son(ligneClicAct+1); @@ -6580,6 +6777,7 @@ begin EditAdrSig.Color:=clWindow; LabelInfo.caption:=' '; feux[ligneClicSig+1].adresse:=i; + index_accessoire[i]:=ligneClicSig+1; s:=encode_sig_feux(ligneClicSig+1); ListBoxSig.Items[ligneClicSig]:=s; ListBoxSig.selected[ligneClicSig]:=true; @@ -6627,6 +6825,7 @@ begin LabelInfo.caption:=' '; aiguillage[index].adresse:=i; aiguillage[index].modifie:=true; + index_accessoire[i]:=index; s:=encode_aig(index); formconfig.ListBoxAig.items[ligneclicAig]:=s; formconfig.ListBoxAig.selected[ligneclicAig]:=true; @@ -6705,7 +6904,7 @@ begin bm:=Select_dessin_feu(feux[index].aspect); if bm=nil then exit; Feux[index].Img.picture.Bitmap:=bm; - dessine_feu_mx(Feux[index].Img.Canvas,0,0,1,1,feux[index].adresse,1); // dessine les feux du signal + 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 begin @@ -6767,7 +6966,7 @@ begin Maj_Hint_Signal(index); // change l'image du feu dans la feuille graphique principale Feux[index].Img.picture.Bitmap:=Select_dessin_feu(feux[index].aspect); - dessine_feu_mx(Feux[index].Img.Canvas,0,0,1,1,feux[index].adresse,1); // dessine les feux du signal + dessine_signal_mx(Feux[index].Img.Canvas,0,0,1,1,feux[index].adresse,1); // dessine les feux du signal clicListe:=false; end; end; @@ -6784,6 +6983,7 @@ begin Tablo_Actionneur[i].loco:=true; Tablo_Actionneur[i].Act:=false; Tablo_Actionneur[i].Son:=false; + Tablo_Actionneur[i].Cde:=false; champs_type_loco; val(editact.Text,champ,erreur); @@ -6815,6 +7015,7 @@ begin Tablo_Actionneur[i].loco:=false; Tablo_Actionneur[i].Act:=true; Tablo_Actionneur[i].Son:=false; + Tablo_Actionneur[i].Cde:=false; champs_type_act; val(editact.Text,champ,erreur); @@ -6847,6 +7048,7 @@ begin Tablo_Actionneur[i].loco:=false; Tablo_Actionneur[i].Act:=false; Tablo_Actionneur[i].Son:=true; + Tablo_Actionneur[i].Cde:=false; champs_type_son; @@ -6867,9 +7069,41 @@ begin ListBoxAct.Selected[ligneClicAct]:=true; end; +procedure TFormConfig.RadioButtonCdeClick(Sender: TObject); +var champ,i,erreur : integer; + s : string; +begin + if clicListe or (ligneclicAct<0) then exit; + i:=ligneClicAct+1; + if AffEvt then Affiche('RadioCde '+IntToSTR(i),clyellow); + Tablo_Actionneur[i].loco:=false; + Tablo_Actionneur[i].Act:=false; + Tablo_Actionneur[i].Son:=false; + Tablo_Actionneur[i].Cde:=true; + champs_type_Cde; + + val(editact.Text,champ,erreur); + Tablo_actionneur[i].adresse:=champ ; + val(editEtatActionneur.Text,champ,erreur); + Tablo_actionneur[i].etat:=champ; + Tablo_actionneur[i].trainDecl:=EditTrainDecl.Text; + + val(editFonctionAccess.Text,champ,erreur); + Tablo_actionneur[i].fonction:=champ; + //val(editEtatFoncSortie.Text,champ,erreur); + //Tablo_actionneur[i].sortie:=champ; + //val(editTempo.Text,champ,erreur); + //Tablo_actionneur[i].tempo:=champ; + tablo_actionneur[i].TrainDest:=editTrainDest.Text; + + s:=encode_act_loc_son(i); + ListBoxAct.Items[ligneClicAct]:=s; + ListBoxAct.Selected[ligneClicAct]:=true; +end; + procedure TFormConfig.RichPNMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); -var i,ligne : integer; +var ligne : integer; begin clicliste:=true; @@ -7716,6 +7950,16 @@ var AncAdr,i,j,k,l,Indexaig,adr,adr2,extr,detect,condcarre,nc,index2,SuivAdr,ind ok,trouveSuiv,TrouvePrec,AdrOk : boolean; s : string; begin + // validation des index signaux et détecteurs + for i:=1 to NbreFeux do + begin + index_accessoire[feux[i].adresse]:=i; + end; + for i:=1 to maxAiguillage do + 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; @@ -9152,6 +9396,7 @@ begin end; // compile une branche de réseau sous forme de texte, et la stocke dans le tableau des branches +// crée les index dans la structure détecteurs et des aiguillages // i = index de la branche à stocker function compile_branche(s : string;i : integer) : boolean; var offset,j,bd,detect,erreur,adresse,erreur2 : integer; @@ -9196,6 +9441,8 @@ begin end; BrancheN[i,j].adresse:=adresse; BrancheN[i,j].btype:=aig; // ident aiguillage + aiguillage[adresse].NumBranche:=i; + aiguillage[adresse].IndexBranche:=j; end else begin @@ -9215,6 +9462,9 @@ begin end; BrancheN[i,j].adresse:=detect; // adresse BrancheN[i,j].btype:=det;// ident détecteur + detecteur[detect].NumBranche:=i; + detecteur[detect].IndexBranche:=j; + if detect=0 then begin BrancheN[i,j].btype:=buttoir;end; // buttoir // vérifier si le détecteur est déja stocké bd:=0; @@ -9726,10 +9976,8 @@ begin val(EditEtatActionneur.Text,Etat,erreur); val(EditAct.Text,Adr,erreur); val(EditAct2.Text,Adr2,erreur); - if erreur=0 then - begin - Event_act(adr,adr2,etat,''); - end; + Ancien_actionneur[adr]:=0; + Event_act(adr,adr2,etat,''); end; procedure TFormConfig.RadioButtonActDetClick(Sender: TObject); @@ -10687,8 +10935,7 @@ end; procedure TFormConfig.ListBoxTrainsMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); -var j : integer; - s : string; +var s : string; begin //affiche('RichEditTrainChange',clyellow); clicListe:=true; @@ -10895,7 +11142,6 @@ end; procedure TFormConfig.ListBoxActKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); -var i : integer; begin if key=VK_delete then supprime_act; @@ -10941,7 +11187,7 @@ end; procedure TFormConfig.RichPNKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); -var lc,curseur,i : integer; +var lc : integer; begin if ord(Key)=VK_DELETE then supprime_pn; if ord(Key)=VK_UP then @@ -10988,7 +11234,6 @@ end; procedure TFormConfig.ListBoxTrainsKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); -var curseur,i : integer; begin if ord(key)=VK_DELETE then supprime_train; if ord(Key)=VK_UP then @@ -11155,7 +11400,7 @@ begin Feux[ligneClicSig+1].Img.picture.Bitmap:=ImageSIgnal.Picture.Bitmap; // et recopie le feu adr:=feux[ligneClicSig+1].adresse; if feux[ligneClicSig+1].contrevoie then Maj_Etat_Signal(adr,clignote_f or bita1_F) else Maj_Etat_Signal(adr,clignote_F); - dessine_feu_mx(Feux[ligneClicSig+1].Img.Canvas,0,0,1,1,feux[ligneClicSig+1].adresse,1); // dessine les feux du signal + dessine_signal_mx(Feux[ligneClicSig+1].Img.Canvas,0,0,1,1,feux[ligneClicSig+1].adresse,1); // dessine les feux du signal end; end; @@ -11636,8 +11881,7 @@ end; procedure TFormConfig.ListBoxSigMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); -var i : integer; -begin +begin clicliste:=true; if NbreFeux<1 then exit; @@ -11652,8 +11896,7 @@ end; procedure TFormConfig.ListBoxSigKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); - var curseur,i : integer; -begin +begin if NbreFeux<1 then exit; if key=VK_delete then supprime_sig; @@ -11700,8 +11943,8 @@ end; procedure TFormConfig.ListBoxPNMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); -var ligne,i : integer; -begin +var i : integer; +begin clicliste:=true; LabelInfo.caption:=''; raz_champs_PN; @@ -11766,7 +12009,6 @@ end; procedure TFormConfig.Slectionnertout1Click(Sender: TObject); var tl: TListBox; - s : string; begin tl:=(Tpopupmenu(Tmenuitem(sender).GetParentMenu).PopupComponent) as TlistBox ; //Affiche(tl.name,clLime); @@ -11836,12 +12078,42 @@ end; procedure TFormConfig.outcopierentatquetexte1Click(Sender: TObject); var tl: TListBox; - s : string; begin tl:=(Tpopupmenu(Tmenuitem(sender).GetParentMenu).PopupComponent) as TlistBox ; ClipBoard.SetTextBuf(tl.Items.GetText); end; +procedure TFormConfig.ButtonOuvreComClick(Sender: TObject); +var i : integer; +begin + // recrée les indexs des com + NbreComCde:=0; + for i:=1 to 10 do tablo_com_cde[i].NumPort:=0; + for i:=1 to maxTablo_act do + begin + if Tablo_actionneur[i].cde then + begin + affecte_index_com(tablo_actionneur[i].fonction); + end; + end; + + for i:=1 to 10 do + begin + deconnecte_usb_cde(i); + end; + for i:=1 to NbreComCde do + begin + if connecte_port_usb_cde(i) then + Affiche('COM'+intToSTR(tablo_com_cde[i].numport)+' commande actionneurs ouvert',clLime) + else Affiche('COM'+intToSTR(tablo_com_cde[i].numport)+' commande actionneurs non ouvert',clOrange); + end; +end; + +procedure TFormConfig.CheckBoxCRClick(Sender: TObject); +begin + if checkBoxCR.Checked then avecCR:=1 else avecCR:=0; +end; + begin end. diff --git a/UnitConfigTCO.dfm b/UnitConfigTCO.dfm index a708ac9..ed6ef17 100644 --- a/UnitConfigTCO.dfm +++ b/UnitConfigTCO.dfm @@ -1,9 +1,9 @@ object FormConfigTCO: TFormConfigTCO - Left = 294 + Left = 296 Top = 201 BorderStyle = bsDialog Caption = 'Configuration du TCO' - ClientHeight = 400 + ClientHeight = 420 ClientWidth = 665 Color = clBtnFace Font.Charset = DEFAULT_CHARSET @@ -23,8 +23,8 @@ object FormConfigTCO: TFormConfigTCO Height = 13 end object ButtonDessine: TButton - Left = 8 - Top = 368 + Left = 16 + Top = 384 Width = 75 Height = 25 Caption = 'Redessine' @@ -35,7 +35,7 @@ object FormConfigTCO: TFormConfigTCO Left = 304 Top = 8 Width = 353 - Height = 265 + Height = 281 Caption = 'Couleurs ' TabOrder = 1 object Label5: TLabel @@ -112,7 +112,7 @@ object FormConfigTCO: TFormConfigTCO end object Label10: TLabel Left = 56 - Top = 240 + Top = 256 Width = 258 Height = 13 Caption = 'Cliquez sur l'#39'ic'#244'ne pour changer la couleur de l'#39#233'l'#233'ment' @@ -170,7 +170,7 @@ object FormConfigTCO: TFormConfigTCO end object CheckCouleur: TCheckBox Left = 64 - Top = 216 + Top = 224 Width = 281 Height = 17 Caption = 'Couleur du canton activ'#233' par la couleur du train' @@ -180,7 +180,7 @@ object FormConfigTCO: TFormConfigTCO end object Memo1: TMemo Left = 304 - Top = 344 + Top = 360 Width = 353 Height = 49 BevelInner = bvLowered @@ -199,7 +199,7 @@ object FormConfigTCO: TFormConfigTCO end object BitBtnOk: TBitBtn Left = 208 - Top = 368 + Top = 384 Width = 75 Height = 25 TabOrder = 3 @@ -208,15 +208,15 @@ object FormConfigTCO: TFormConfigTCO end object RadioGroup1: TRadioGroup Left = 304 - Top = 280 + Top = 296 Width = 353 Height = 57 Caption = 'Graphisme' TabOrder = 4 end object RadioButtonLignes: TRadioButton - Left = 352 - Top = 296 + Left = 376 + Top = 312 Width = 113 Height = 17 Caption = 'Lignes bris'#233'es' @@ -224,8 +224,8 @@ object FormConfigTCO: TFormConfigTCO OnClick = RadioButtonLignesClick end object RadioButtonCourbes: TRadioButton - Left = 352 - Top = 312 + Left = 376 + Top = 328 Width = 113 Height = 17 Caption = 'Lignes courbes' @@ -315,7 +315,7 @@ object FormConfigTCO: TFormConfigTCO Left = 8 Top = 104 Width = 289 - Height = 257 + Height = 273 Caption = 'Configuration de tous les TCO' TabOrder = 8 object Ratio: TLabel @@ -340,12 +340,28 @@ object FormConfigTCO: TFormConfigTCO Caption = 'Nombre de TCO : ' end object Label2: TLabel - Left = 144 + Left = 104 Top = 184 Width = 64 Height = 13 Caption = '(10 maximum)' end + object Label17: TLabel + Left = 146 + Top = 202 + Width = 49 + Height = 26 + Alignment = taRightJustify + Caption = 'Epaisseur des voies' + WordWrap = True + end + object Label18: TLabel + Left = 208 + Top = 184 + Width = 63 + Height = 13 + Caption = '2 10' + end object StringGridTCO: TStringGrid Left = 8 Top = 16 @@ -384,7 +400,7 @@ object FormConfigTCO: TFormConfigTCO end object CheckBoxCreerEvt: TCheckBox Left = 8 - Top = 232 + Top = 240 Width = 273 Height = 17 Hint = 'Pour simuler l'#39'action d'#39'une locomotive sur un d'#233'tecteur' @@ -394,6 +410,20 @@ object FormConfigTCO: TFormConfigTCO TabOrder = 2 OnClick = CheckBoxCreerEvtClick end + object TrackBarEpaisseur: TTrackBar + Left = 200 + Top = 200 + Width = 81 + Height = 33 + Hint = 'Change les '#233'paisseurs des voies' + Min = 2 + ParentShowHint = False + Position = 2 + ShowHint = True + TabOrder = 3 + TickMarks = tmTopLeft + OnChange = TrackBarEpaisseurChange + end end object ColorDialog1: TColorDialog OnShow = ColorDialog1Show diff --git a/UnitConfigTCO.pas b/UnitConfigTCO.pas index fbb6c69..e2c8abb 100644 --- a/UnitConfigTCO.pas +++ b/UnitConfigTCO.pas @@ -5,7 +5,8 @@ interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls , UnitTCO, ExtCtrls, Menus, - Buttons, Grids; + Buttons, Grids, + ComCtrls; type TFormConfigTCO = class(TForm) @@ -55,6 +56,9 @@ type CheckDessineGrille: TCheckBox; EditEcran: TEdit; Label16: TLabel; + TrackBarEpaisseur: TTrackBar; + Label17: TLabel; + Label18: TLabel; procedure ButtonDessineClick(Sender: TObject); procedure FormActivate(Sender: TObject); procedure ImageAigClick(Sender: TObject); @@ -75,6 +79,7 @@ type procedure RadioButtonLignesClick(Sender: TObject); procedure RadioButtonCourbesClick(Sender: TObject); procedure FormCreate(Sender: TObject); + procedure TrackBarEpaisseurChange(Sender: TObject); private { Déclarations privées } public @@ -298,6 +303,7 @@ begin RadioButtonLignes.checked:=graphisme=1; checkDessineGrille.Checked:=AvecGrille[IndexTCOCourant]; checkCouleur.Checked:=ModeCouleurCanton=1; + trackbarEpaisseur.Position:=Epaisseur_voies; labelMaxX.caption:='Max='+intToSTR(MaxCellX); labelMaxY.caption:='Max='+intToSTR(MaxCellY); Label15.caption:='Nbre de TCOs : '+intToSTR(NbreTCO); @@ -477,6 +483,8 @@ begin graphisme:=2; end; + epaisseur_voies:=trackBarEpaisseur.Position; + val(editEcran.Text,i,erreur); if i<1 then i:=1; if i<>EcranTCO[indexTCOcourant] then tco_modifie:=true; @@ -526,6 +534,8 @@ end; procedure TFormConfigTCO.CheckDessineGrilleClick(Sender: TObject); begin if not(clicConf) then TCO_modifie:=true; + AvecGrille[IndexTCOcourant]:=checkDessineGrille.Checked; + affiche_tco(indexTCOCourant); end; procedure TFormConfigTCO.CheckCouleurClick(Sender: TObject); @@ -548,7 +558,6 @@ end; procedure TFormConfigTCO.FormCreate(Sender: TObject); var i : integer; begin - for i := 0 to stringGridTCO.RowCount - 1 do with stringGridTCO do begin @@ -565,13 +574,19 @@ begin Cells[0,0]:='Num'; Cells[1,0]:='Nom fichier'; Cells[2,0]:='X'; - end; +end; +procedure TFormConfigTCO.TrackBarEpaisseurChange(Sender: TObject); +var i : integer; +begin + i:=trackbarEpaisseur.Position; + Epaisseur_voies:=i; + calcul_cellules(indexTCOCourant); + affiche_tco(indexTCOcourant); + TrackBarEpaisseur.Hint:='Epaisseur = '+IntToSTR(i); end; - - end. diff --git a/UnitPilote.pas b/UnitPilote.pas index c21504b..389a5ba 100644 --- a/UnitPilote.pas +++ b/UnitPilote.pas @@ -128,13 +128,13 @@ begin case feux[i].aspect of // feux de signalisation - 2 : dessine_feu2(Vcanvas,0,0,1,1,EtatFeupilote,1); - 3 : dessine_feu3(Vcanvas,0,0,1,1,EtatFeupilote,AncienEtat,1); - 4 : dessine_feu4(VCanvas,0,0,1,1,EtatFeupilote,1); - 5 : dessine_feu5(VCanvas,0,0,1,1,EtatFeupilote,1); - 7 : dessine_feu7(VCanvas,0,0,1,1,EtatFeupilote,1); - 9 : dessine_feu9(VCanvas,0,0,1,1,EtatFeupilote,1); - 20 : dessine_feu20(VCanvas,0,0,1,1,EtatFeupilote,1,feux[i].adresse,12); + 2 : dessine_signal2(Vcanvas,0,0,1,1,EtatFeupilote,1); + 3 : dessine_signal3(Vcanvas,0,0,1,1,EtatFeupilote,AncienEtat,1); + 4 : dessine_signal4(VCanvas,0,0,1,1,EtatFeupilote,1); + 5 : dessine_signal5(VCanvas,0,0,1,1,EtatFeupilote,1); + 7 : dessine_signal7(VCanvas,0,0,1,1,EtatFeupilote,1); + 9 : dessine_signal9(VCanvas,0,0,1,1,EtatFeupilote,1); + 20 : dessine_signal20(VCanvas,0,0,1,1,EtatFeupilote,1,feux[i].adresse,12); // indicateurs de direction 12 : dessine_dirN(VCanvas,0,0,1,1,EtatFeupilote,1,2); 13 : dessine_dirN(VCanvas,0,0,1,1,EtatFeupilote,1,3); diff --git a/UnitPrinc.dfm b/UnitPrinc.dfm index 3701aac..376cc4e 100644 --- a/UnitPrinc.dfm +++ b/UnitPrinc.dfm @@ -1,8 +1,8 @@ object FormPrinc: TFormPrinc - Left = 74 - Top = 202 + Left = 63 + Top = 148 Width = 1222 - Height = 652 + Height = 653 Caption = 'Signaux complexes' Color = clBtnFace Font.Charset = DEFAULT_CHARSET @@ -19,12 +19,12 @@ object FormPrinc: TFormPrinc OnResize = FormResize DesignSize = ( 1206 - 593) + 595) PixelsPerInch = 96 TextHeight = 13 object LabelTitre: TLabel Left = 8 - Top = 8 + Top = 2 Width = 173 Height = 18 Caption = 'Signaux complexes GL' @@ -1442,14 +1442,34 @@ object FormPrinc: TFormPrinc end object StatusBar1: TStatusBar Left = 0 - Top = 571 + Top = 573 Width = 1206 Height = 22 - Panels = <> - SimplePanel = True + Panels = < + item + Text = 'AideHint' + Width = 600 + end + item + Text = 'SimuMemoire' + Width = 200 + end + item + Text = 'CDM' + Width = 100 + end + item + Text = 'USB' + Width = 120 + end + item + Text = 'IP' + Width = 70 + end> + OnDrawPanel = StatusBar1DrawPanel end object MSCommUSBLenz: TMSComm - Left = 1160 + Left = 1144 Top = 192 Width = 32 Height = 32 @@ -1458,15 +1478,6 @@ object FormPrinc: TFormPrinc 2143341208000000ED030000ED03000001568A64000006000000010000040000 00020000802500000000080000000000000000003F00000011000000} end - object StaticText: TStaticText - Left = 16 - Top = 557 - Width = 14 - Height = 17 - Anchors = [akLeft, akBottom] - Caption = 'xx' - TabOrder = 2 - end object ButtonEnv: TButton Left = 1073 Top = 160 @@ -1474,7 +1485,7 @@ object FormPrinc: TFormPrinc Height = 33 Anchors = [akTop, akRight] Caption = 'Envoi vers centrale DCC++' - TabOrder = 3 + TabOrder = 2 WordWrap = True OnClick = ButtonEnvClick end @@ -1484,7 +1495,7 @@ object FormPrinc: TFormPrinc Width = 121 Height = 21 Anchors = [akTop, akRight] - TabOrder = 4 + TabOrder = 3 Text = '<1>' end object Button1: TButton @@ -1494,7 +1505,7 @@ object FormPrinc: TFormPrinc Height = 25 Anchors = [akTop, akRight] Caption = 'Button1' - TabOrder = 5 + TabOrder = 4 Visible = False OnClick = Button1Click end @@ -1504,7 +1515,7 @@ object FormPrinc: TFormPrinc Width = 1122 Height = 513 Anchors = [akLeft, akTop, akRight] - TabOrder = 6 + TabOrder = 5 DesignSize = ( 1122 513) @@ -1513,7 +1524,7 @@ object FormPrinc: TFormPrinc Top = 1 Width = 9 Height = 511 - Hint = 'Splitter d'#39'agrandissement/r'#233'duissement' + Hint = 'Splitter de s'#233'paration ajustable' Align = alNone Color = clGray MinSize = 200 @@ -1522,8 +1533,8 @@ object FormPrinc: TFormPrinc OnMoved = SplitterVMoved end object FenRich: TRichEdit - Left = 48 - Top = 48 + Left = 24 + Top = 8 Width = 553 Height = 441 Color = clBlack @@ -2015,6 +2026,35 @@ object FormPrinc: TFormPrinc end end end + object ButtonIndex: TButton + Left = 720 + Top = 8 + Width = 75 + Height = 25 + Caption = 'Indexs' + TabOrder = 6 + OnClick = ButtonIndexClick + end + object MSCommCde1: TMSComm + Left = 1144 + Top = 272 + Width = 32 + Height = 32 + OnComm = MSCommCde1Comm + ControlData = { + 2143341208000000ED030000ED03000001568A64000006000000010000040000 + 00020000802500000000080000000000000000003F00000001000000} + end + object MSCommCde2: TMSComm + Left = 1144 + Top = 304 + Width = 32 + Height = 32 + OnComm = MSCommCde2Comm + ControlData = { + 2143341208000000ED030000ED03000001568A64000006000000010000040000 + 00020000802500000000080000000000000000003F00000001000000} + end object Timer1: TTimer Interval = 100 OnTimer = Timer1Timer diff --git a/UnitPrinc.pas b/UnitPrinc.pas index 404263c..72220aa 100644 --- a/UnitPrinc.pas +++ b/UnitPrinc.pas @@ -1,5 +1,5 @@ Unit UnitPrinc; -// 13/9 11h +// 30/9 22h (******************************************** Programme signaux complexes Graphique Lenz Delphi 7 + activeX Tmscomm + clientSocket @@ -8,6 +8,7 @@ Unit UnitPrinc; sinon une exception surgira au moment de l'ouverture du com Dans projet/option/fiches : fiches disponibles : formtco uniquement ******************************************** + pour tmscomm : impossible de générer une instance dynamiquement (avec CreateOleObject) à cause de la licence Attention si le répertoire d'install n'est pas autorisé, windows10-11 va sauver les fichiers dans C:\Users\moi\AppData\Local\VirtualStore\Program Files (x86)\Signaux_complexes il faut autoriser l'utilisateur: Utilisateurs (nom\utilisateurs) @@ -52,7 +53,7 @@ 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; + Buttons, NB30 ; type TFormPrinc = class(TForm) @@ -102,7 +103,6 @@ type OuvrirunfichiertramesCDM1: TMenuItem; LabelEtat: TLabel; Affichefentredebug1: TMenuItem; - StaticText: TStaticText; PopupMenuFenRich: TPopupMenu; Copier1: TMenuItem; Etatdessignaux1: TMenuItem; @@ -209,8 +209,12 @@ type Affichagenormal1: TMenuItem; N14: TMenuItem; Sauvegarderla1: TMenuItem; + ButtonIndex: TButton; + MSCommCde1: TMSComm; + MSCommCde2: TMSComm; procedure FormCreate(Sender: TObject); procedure MSCommUSBLenzComm(Sender: TObject); + procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure Timer1Timer(Sender: TObject); procedure ButtonDroitClick(Sender: TObject); @@ -321,6 +325,12 @@ type procedure FormResize(Sender: TObject); procedure Affichagenormal1Click(Sender: TObject); procedure Sauvegarderla1Click(Sender: TObject); + procedure ButtonIndexClick(Sender: TObject); + procedure StatusBar1DrawPanel(StatusBar: TStatusBar; + Panel: TStatusPanel; const Rect: TRect); + procedure MSCommCde1Comm(Sender: TObject); + procedure MSCommCde2Comm(Sender: TObject); +// procedure MSCommCdeComm(Sender: TObject); private { Déclarations privées } procedure DoHint(Sender : Tobject); @@ -350,6 +360,7 @@ NbreMaxiAiguillages=200; NbreMaxiSignaux=200; NbreMaxiDecPers=10; // nombre maxi de décodeurs personnalisés LargImg=50;HtImg=91; // Dimensions image des feux +MaxComUSBCde=2; // Nombre maxi de périphériques USB commande const_droit=2; // positions aiguillages transmises par la centrale LENZ const_devie=1; // positions aiguillages transmises par la centrale LENZ const_devieG_CDM=3; // positions aiguillages transmises par cdm @@ -444,6 +455,7 @@ Taiguillage = record // si modifié en mode config modifie : boolean ; + NumBranche,IndexBranche : integer; // index dans les branches end; TSignal = record @@ -511,7 +523,7 @@ var ServeurRetroCDM,TailleFonte,Nb_Det_Dist,Tdoubleclic,algo_Unisemaf,fA,fB, etape,idEl,avecRoulage,intervalle_courant,filtrageDet0,SauvefiltrageDet0, TpsTimeoutSL,formatY,OsBits,NbreDecPers,NbDecodeur,NbDecodeurdeBase, - LargeurF,HauteurF,OffsetXF,OffsetYF,etatF,PosSplitter : integer; + LargeurF,HauteurF,OffsetXF,OffsetYF,PosSplitter : integer; ack,portCommOuvert,traceTrames,AffMem,CDM_connecte,dupliqueEvt,affiche_retour_dcc, Raz_Acc_signaux,AvecInit,AvecTCO,terminal,Srvc_Aig,Srvc_Det,Srvc_Act,MasqueBandeauTCO, @@ -535,23 +547,28 @@ var Ancien_detecteur : array[0..NbMemZone] of boolean; // anciens état des détecteurs et adresses des détecteurs et leur état detecteur : array[0..NbMemZone] of // détecteurs indexés par l'adresse record - etat : boolean; // état 0/1 du déecteur - train : string; // nom du train ayant enclenché le détecteur (CDM - pas fiable) - AdrTrain : integer; // adresse du train "train" - tempo0 : integer; // tempo de retombée à 0 du détecteur (filtrage) - IndexTrain : integer; // index du train + etat : boolean; // état 0/1 du déecteur + train : string; // nom du train ayant enclenché le détecteur (CDM - pas fiable) + AdrTrain : integer; // adresse du train "train" + tempo0 : integer; // tempo de retombée à 0 du détecteur (filtrage) + IndexTrain : integer; // index du train + NumBranche,IndexBranche : integer; // ou se trouve le détecteur dans les branches end; Ecran : array[1..10] of record x0,y0,larg,haut : integer; end; + Tablo_com_cde : array[1..10] of record + portOuvert: boolean; + NumPort: integer; + tamponRx : string; + end; 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 @@ -573,6 +590,8 @@ var reaffecte : integer ; // =1 réaffecté au bon train dans le cas de 2 détecteurs contigus qui ne s'enchainent pas bien =2 réaffecté par changement aiguillage end; + Index_Accessoire : array[0..MaxAcc] of integer; // tableau d'index des accessoires aiguillages et signaux + // tableau des croisement rencontrés par la fonction suivant_alg3 croisement : array[1..20] of record @@ -595,13 +614,17 @@ var Tablo_actionneur : array[0..Max_actionneurs] of record - loco,act,son: boolean; // destinataire loco acessoire ou son + loco,act,son,cde: boolean; // destinataire loco acessoire ou son adresse,adresse2, // adresse: adresse de base ; adresse2=cas d'une Zone - etat,fonction,tempo,TempoCourante, + etat, + fonction, // fonction F de train ou COM + tempo,TempoCourante, accessoire,sortie, typdeclenche : integer; // déclencheur: 0=actionneur/détecteur 2=evt aig 3=MemZone Raz : boolean; - FichierSon,trainDecl,TrainDest,TrainCourant : string; + FichierSon,trainDecl, + TrainDest, // train destinataire ou Commande + TrainCourant : string; end; decodeur_pers : array[1..NbreMaxiDecPers] of @@ -711,13 +734,13 @@ var // utilisation des procédures et fonctions dans les autres unités function Index_Signal(adresse : integer) : integer; function Index_Aig(adresse : integer) : integer; -procedure dessine_feu2(Acanvas : Tcanvas;x,y : integer;frX,frY : real;EtatSignal : word;orientation : integer); -procedure dessine_feu3(Acanvas : Tcanvas;x,y : integer;frX,frY : real;EtatSignal,AncienEtat : word;orientation : integer); -procedure dessine_feu4(Acanvas : Tcanvas;x,y : integer;frX,frY : real;EtatSignal : word;orientation : integer); -procedure dessine_feu5(Acanvas : Tcanvas;x,y : integer;frX,frY : real;EtatSignal : word;orientation : integer); -procedure dessine_feu7(Acanvas : Tcanvas;x,y : integer;frX,frY : real;EtatSignal : word;orientation : integer); -procedure dessine_feu9(Acanvas : Tcanvas;x,y : integer;frX,frY : real;etatsignal : word;orientation : integer); -procedure dessine_feu20(Acanvas : Tcanvas;x,y : integer;frX,frY : real;EtatSignal : word;orientation,adresse,tailleChiffre : integer); +procedure dessine_signal2(Acanvas : Tcanvas;x,y : integer;frX,frY : real;EtatSignal : word;orientation : integer); +procedure dessine_signal3(Acanvas : Tcanvas;x,y : integer;frX,frY : real;EtatSignal,AncienEtat : word;orientation : integer); +procedure dessine_signal4(Acanvas : Tcanvas;x,y : integer;frX,frY : real;EtatSignal : word;orientation : integer); +procedure dessine_signal5(Acanvas : Tcanvas;x,y : integer;frX,frY : real;EtatSignal : word;orientation : integer); +procedure dessine_signal7(Acanvas : Tcanvas;x,y : integer;frX,frY : real;EtatSignal : word;orientation : integer); +procedure dessine_signal9(Acanvas : Tcanvas;x,y : integer;frX,frY : real;etatsignal : word;orientation : integer); +procedure dessine_signal20(Acanvas : Tcanvas;x,y : integer;frX,frY : real;EtatSignal : word;orientation,adresse,tailleChiffre : integer); procedure dessine_dirN(Acanvas : Tcanvas;x,y : integer;frX,frY : real;EtatSignal : word;orientation,N : integer); procedure Maj_Etat_Signal(adresse,aspect : integer); procedure Maj_Etat_Signal_Belge(adresse,aspect : integer); @@ -725,9 +748,11 @@ procedure Affiche(s : string;lacouleur : TColor); procedure envoi_signal(Adr : integer); procedure pilote_direction(Adr,nbre : integer); procedure connecte_USB; +function connecte_port_usb_cde(index : integer) : boolean; +procedure deconnecte_usb_cde(index : integer); procedure deconnecte_usb; function IsWow64Process: Boolean; -procedure Dessine_feu_mx(CanvasDest : Tcanvas;x,y : integer;FrX,frY : real;adresse : integer;orientation : integer); +procedure Dessine_signal_mx(CanvasDest : Tcanvas;x,y : integer;FrX,frY : real;adresse : integer;orientation : integer); procedure Pilote_acc0_X(adresse : integer;octet : byte); Function pilote_acc(adresse : integer;octet : byte;Acc : TAccessoire) : boolean; function etat_signal_suivant(Adresse,rang : integer;var AdrSignalsuivant : integer) : integer; @@ -801,7 +826,7 @@ procedure Tformprinc.DoHint(Sender : Tobject); var s: string; begin s:=Application.Hint; - StatusBar1.Simpletext:=s; + StatusBar1.Panels[0].text:=s; end; // fonctions sur les bits @@ -896,7 +921,8 @@ function chaine_signal(adresse : word) : string; var a,i,aspect,etat,combine,nation : integer; s : string; begin - i:=Index_Signal(adresse); + //i:=Index_Signal(adresse); + i:=index_accessoire[adresse]; etat:=feux[i].EtatSignal ; nation:=1; a:=feux[i].aspect; @@ -966,7 +992,7 @@ end; // frX, frY : facteurs de réduction (pour agrandissement) // EtatSignal : état du signal // orientation à donner au signal : 1= vertical 2=90° à gauche 3=90° à droite -procedure dessine_feu2(Acanvas : Tcanvas;x,y : integer;frX,frY : real;EtatSignal : word;orientation : integer); +procedure dessine_signal2(Acanvas : Tcanvas;x,y : integer;frX,frY : real;EtatSignal : word;orientation : integer); var Temp,rayon,xViolet,YViolet,xBlanc,yBlanc, LgImage,HtImage,code,combine : integer; ech : real; @@ -1012,7 +1038,7 @@ begin end; // dessine les feux sur une cible à 3 feux -procedure dessine_feu3(Acanvas : Tcanvas;x,y : integer;frX,frY : real;EtatSignal,AncienEtat : word;orientation : integer); +procedure dessine_signal3(Acanvas : Tcanvas;x,y : integer;frX,frY : real;EtatSignal,AncienEtat : word;orientation : integer); var Temp,rayon,xSem,Ysem,xJaune,Yjaune,Xvert,Yvert, LgImage,HtImage,code,combine,AncCode,AncCombine : integer; ech : real; @@ -1076,7 +1102,7 @@ end; // dessine les feux sur une cible à 4 feux // orientation=1 vertical -procedure dessine_feu4(Acanvas : Tcanvas;x,y : integer;frX,frY : real;EtatSignal : word;orientation : integer); +procedure dessine_signal4(Acanvas : Tcanvas;x,y : integer;frX,frY : real;EtatSignal : word;orientation : integer); var Temp,rayon,xSem,Ysem,xJaune,Yjaune,Xcarre,Ycarre,Xvert,Yvert, LgImage,HtImage,code,combine : integer; ech : real; @@ -1136,7 +1162,7 @@ begin end; // dessine les feux sur une cible à 5 feux -procedure dessine_feu5(Acanvas : Tcanvas;x,y : integer;frX,frY : real;EtatSignal : word;orientation : integer); +procedure dessine_signal5(Acanvas : Tcanvas;x,y : integer;frX,frY : real;EtatSignal : word;orientation : integer); var XBlanc,Yblanc,xJaune,yJaune,Xsem,YSem,Xvert,YVert,Xcarre,Ycarre, Temp,rayon,LgImage,HtImage,code,combine : integer; ech : real; @@ -1205,7 +1231,7 @@ end; // dessine les feux sur une cible à 7 feux -procedure dessine_feu7(Acanvas : Tcanvas;x,y : integer;frX,frY : real;EtatSignal : word;orientation : integer); +procedure dessine_signal7(Acanvas : Tcanvas;x,y : integer;frX,frY : real;EtatSignal : word;orientation : integer); var XBlanc,Yblanc,xJaune,yJaune,Xsem,YSem,Xvert,YVert,Xcarre,Ycarre,Xral1,Yral1,Xral2,YRal2, Temp,rayon,LgImage,HtImage,code,combine : integer; ech : real; @@ -1288,7 +1314,7 @@ begin end; // dessine les feux sur une cible à 9 feux -procedure dessine_feu9(Acanvas : Tcanvas;x,y : integer;frX,frY : real;etatsignal : word;orientation : integer); +procedure dessine_signal9(Acanvas : Tcanvas;x,y : integer;frX,frY : real;etatsignal : word;orientation : integer); var rayon, XBlanc,Yblanc,xJaune,yJaune,Xsem,YSem,Xvert,YVert,Xcarre,Ycarre,Xral1,Yral1,Xral2,YRal2, Xrap1,Yrap1,Xrap2,Yrap2,Temp,LgImage,HtImage,xt,yt,code,combine : integer; @@ -1471,7 +1497,7 @@ end; // dessine les feux sur une cible belge à 5 feux // cette image peut être inversée (contre voie) -procedure dessine_feu20(Acanvas : Tcanvas;x,y : integer;frX,frY : real;EtatSignal : word;orientation,adresse,tailleChiffre : integer); +procedure dessine_signal20(Acanvas : Tcanvas;x,y : integer;frX,frY : real;EtatSignal : word;orientation,adresse,tailleChiffre : integer); var xblanc,xvert,xrouge,Yblanc,xjauneBas,xJauneHaut,yJauneBas,yJauneHaut,YVert,Yrouge,largeur, index,Temp,rayon,LgImage,HtImage,code,combine,x1,y1,x2,y2,x3,y3,xChiffre,yChiffre,xfin,yfin,angle, AdrAig,IndexAig,vitesse,indexTCO : integer; @@ -1506,7 +1532,8 @@ begin XChiffre:=14;Ychiffre:=76; Xfin:=26;yFin:=99; - index:=index_signal(adresse); + //index:=index_signal(adresse); + index:=index_accessoire[adresse]; if feux[index].contrevoie then begin xvert:=largeur-xvert; @@ -1875,7 +1902,7 @@ end; // renvoie l'index du signal dans le tableau feux[] en fonction de son adresse // si pas trouvé renvoie 0 -function Index_signal(adresse : integer) : integer; +function Index_signal_V1(adresse : integer) : integer; var i : integer; trouve : boolean; begin @@ -1884,12 +1911,18 @@ begin trouve:=feux[i].adresse=adresse; if not(trouve) then inc(i); until (trouve) or (i>NbreFeux); - if trouve then Index_Signal:=i else Index_Signal:=0 ; + if trouve then result:=i else result:=0 ; +end; + +function index_signal(adresse : integer) : integer; +begin + if adresse>MaxAcc then result:=0 else + result:=Index_Accessoire[adresse]; end; // renvoie l'index de l'aiguillage dans le tableau aiguillages[] en fonction de son adresse // si pas trouvé renvoie 0 -function Index_Aig(adresse : integer) : integer; +function Index_Aig_V1(adresse : integer) : integer; var i : integer; trouve : boolean; begin @@ -1898,11 +1931,30 @@ begin trouve:=aiguillage[i].adresse=adresse; if not(trouve) then inc(i); until (trouve) or (i>MaxAiguillage); - if trouve then Index_Aig:=i else Index_Aig:=0 ; + if trouve then result:=i else result:=0 ; +end; + +function Index_Aig(adresse : integer) : integer; +begin + if adresse>MaxAcc then result:=0 else + result:=Index_Accessoire[adresse]; +end; + +function Index_com(NumPort : integer) : integer; +var i : integer; + trouve : boolean; +begin + result:=0; + i:=1; + repeat + trouve:=Tablo_com_cde[i].NumPort=NumPort; + if not(trouve) then inc(i); + until (trouve) or (i>10); + if trouve then result:=i; end; // dessine l'aspect du feu en fonction de son adresse dans la partie droite de droite -procedure Dessine_feu_mx(CanvasDest : Tcanvas;x,y : integer;FrX,frY : real;adresse : integer;orientation : integer); +procedure Dessine_signal_mx(CanvasDest : Tcanvas;x,y : integer;FrX,frY : real;adresse : integer;orientation : integer); var i,aspect : integer; begin i:=Index_Signal(adresse); @@ -1911,13 +1963,13 @@ begin aspect:=feux[i].aspect ; case aspect of // feux de signalisation - 2 : dessine_feu2(CanvasDest,x,y,frx,fry,feux[i].EtatSignal,orientation); - 3 : dessine_feu3(CanvasDest,x,y,frx,fry,feux[i].EtatSignal,feux[i].AncienEtat,orientation); - 4 : dessine_feu4(CanvasDest,x,y,frx,fry,feux[i].EtatSignal,orientation); - 5 : dessine_feu5(CanvasDest,x,y,frx,fry,feux[i].EtatSignal,orientation); - 7 : dessine_feu7(CanvasDest,x,y,frx,fry,feux[i].EtatSignal,orientation); - 9 : dessine_feu9(CanvasDest,x,y,frx,fry,feux[i].EtatSignal,orientation); - 20 : dessine_feu20(CanvasDest,x,y,frx,fry,feux[i].EtatSignal,orientation,feux[i].adresse,10); + 2 : dessine_signal2(CanvasDest,x,y,frx,fry,feux[i].EtatSignal,orientation); + 3 : dessine_signal3(CanvasDest,x,y,frx,fry,feux[i].EtatSignal,feux[i].AncienEtat,orientation); + 4 : dessine_signal4(CanvasDest,x,y,frx,fry,feux[i].EtatSignal,orientation); + 5 : dessine_signal5(CanvasDest,x,y,frx,fry,feux[i].EtatSignal,orientation); + 7 : dessine_signal7(CanvasDest,x,y,frx,fry,feux[i].EtatSignal,orientation); + 9 : dessine_signal9(CanvasDest,x,y,frx,fry,feux[i].EtatSignal,orientation); + 20 : dessine_signal20(CanvasDest,x,y,frx,fry,feux[i].EtatSignal,orientation,feux[i].adresse,10); // indicateurs de direction 12..16 : dessine_dirN(CanvasDest,x,y,frx,fry,feux[i].EtatSignal,orientation,aspect-10); end; @@ -2058,7 +2110,7 @@ begin feux[rang].EtatSignal:=feux[rang].EtatSignal+clignote_F; end; end; - dessine_feu_mx(Feux[rang].Img.Canvas,0,0,1,1,feux[rang].adresse,1); + dessine_signal_mx(Feux[rang].Img.Canvas,0,0,1,1,feux[rang].adresse,1); //if feux[rang].aspect=5 then cercle(Picture.Bitmap.Canvas,13,22,6,ClYellow); end; @@ -2777,7 +2829,7 @@ begin end; end; feux[i].EtatSignal:=code; - Dessine_feu_mx(Feux[Index_Signal(adr)].Img.Canvas,0,0,1,1,adr,1); + Dessine_signal_mx(Feux[Index_Signal(adr)].Img.Canvas,0,0,1,1,adr,1); end; end; @@ -4504,7 +4556,7 @@ begin feux[i].AncienEtat:=feux[i].EtatSignal; // allume les signaux du feu dans la fenêtre de droite - Dessine_feu_mx(Feux[i].Img.Canvas,0,0,1,1,adr,1); + Dessine_signal_mx(Feux[i].Img.Canvas,0,0,1,1,adr,1); // allume les signaux du feu dans le TCO if TCOACtive then @@ -4538,7 +4590,7 @@ begin // réduction variable en fonction de la taille des cellules calcul_reduction(frx,fry,LargeurCell[indexTCO],HauteurCell[indexTCO]); // décalage en X pour mettre la tete du feu alignée sur le bord droit de la cellule pour les feux tournés à 90G - Dessine_feu_mx(PCanvasTCO[indexTCO],tco[indexTCO,x,y].x,tco[indextco,x,y].y,frx,fry,adresse,orientation); + Dessine_signal_mx(PCanvasTCO[indexTCO],tco[indexTCO,x,y].x,tco[indextco,x,y].y,frx,fry,adresse,orientation); end; end; end; @@ -4697,15 +4749,17 @@ begin end; end; -// trouve un élément dans les branches à partir de la branche offset renvoie branche_trouve IndexBranche_trouve +// trouve un élément en balayant les branches à partir de la branche offset renvoie branche_trouve IndexBranche_trouve // el : adresse de l'élément TypeEL=(1=détécteur 2=aig 3=aig Bis 4=aig triple - Buttoir) -procedure trouve_element(el: integer; TypeEl : TEquipement; Offset : integer); +// explore les branches +procedure trouve_element_V1(el: integer; TypeEl : TEquipement; Offset : integer); var i,adr,Branche : integer ; s : string; BT : TEquipement; sort : boolean; begin if debug=3 then formprinc.Caption:='Trouve_element '+IntToSTR(el); + Branche:=Offset; branche_trouve:=0; IndexBranche_trouve:=0; @@ -4729,6 +4783,49 @@ begin if NivDebug>=1 then AfficheDebug(s,clred); end; if debug=3 then formprinc.Caption:=''; + +end; + +// trouve un élément dans les branches depuis les index. +// Plus rapide que la procédure précédente. Renvoie branche_trouve IndexBranche_trouve +// el : adresse de l'élément TypeEL=(1=détécteur 2=aig 3=aig Bis 4=aig triple - Buttoir) +// offset ne sert pas!!! +// avec cet algorithme, un détecteur et un aiguillage ne peut se trouver qu'à un seul endroit. +procedure trouve_element(el: integer; TypeEl : TEquipement; Offset : integer); +var s : string; +begin + if debug=3 then formprinc.Caption:='Trouve_element '+IntToSTR(el); + + branche_trouve:=0; + IndexBranche_trouve:=0; + + if typeEL=det then + begin + //Affiche('det ',clred); + branche_trouve:=detecteur[el].NumBranche; // le détecteur det se trouve dans + indexBranche_trouve:=detecteur[el].IndexBranche; // NumBranche et Indexbranche + end; + + if typeEL=aig then + begin + //Affiche('aig ',clred); + branche_trouve:=aiguillage[el].NumBranche; // l'aiguillage aig se trouve dans + indexBranche_trouve:=aiguillage[el].IndexBranche; // NumBranche et Indexbranche + end; + + //Affiche_Suivi(intToSTR(el),clred); + + + if IndexBranche_trouve=0 then + begin + s:='Erreur 175 : élément '+intToSTR(el)+' '; + s:=s+BTypeToChaine(TypeEl); + s:=s+' non trouvé';Affiche(s,clred); + branche_trouve:=0; IndexBranche_trouve:=0; + if NivDebug>=1 then AfficheDebug(s,clred); + end; + if debug=3 then formprinc.Caption:=''; + end; // renvoie l'élément suivant des deux éléments dans le sens (prec,typeElprec) -> (actuel,typeElActuel) quels qu'ils soient mais contigus @@ -4839,11 +4936,13 @@ begin if (btypePrec=aig) then // car btype dans les branches vaut det, aig, buttoir mais jamais tjd ni tjs begin // changer l'adresse du précédent par l'autre adresse de la TJD/S - index:=index_aig(prec); + // V1 index:=index_aig(prec); + index:=index_accessoire[prec]; md:=aiguillage[index].modele; if (md=tjs) or (md=tjd) then begin - prec:=Aiguillage[index_aig(prec)].Ddroit; + //V1 prec:=Aiguillage[index_aig(prec)].Ddroit; + prec:=Aiguillage[index_accessoire[prec]].Ddroit; if NivDebug=3 then AfficheDebug('Le précedent est une TJD/S - substitution du precédent par la pointe de la TJD qui est '+intToSTR(prec),clYellow); end; end; @@ -4859,11 +4958,12 @@ begin exit; end; goto recommence; - end; + end; if (Bt=aig) or (Bt=buttoir) then // aiguillage ou buttoir begin - index:=index_aig(adr); + //V1 index:=index_aig(adr); + index:=index_accessoire[adr]; if index=0 then begin if bt=aig then @@ -4906,6 +5006,7 @@ begin begin if (A='Z') or (a=#0) then TypeEl:=det else TypeEL:=aig; //TypeEL=(1=détécteur 2=aig trouve_element(adr,typeEl,1); // branche_trouve IndexBranche_trouve + if branche_trouve=0 then begin suivant_alg3:=9999;exit;end; typeGen:=BrancheN[branche_trouve,IndexBranche_trouve].Btype; end else @@ -4917,7 +5018,7 @@ begin if aiguillage[index].position=const_devie then begin if NivDebug=3 then AfficheDebug('133 - aiguillage '+intToSTR(Adr)+' Pris en pointe dévié',clyellow); - if (alg and 8)=8 then // on demande d'arreter si l'aiguillage pris en pointe est dévié + if (alg and 8)=8 then // on demande d'arreter sur un aiguillage pris en pointe est dévié begin typeGen:=rien; AdrDevie:=Adr; @@ -4937,6 +5038,7 @@ begin begin if (A='Z') or (a=#0) then TypeEl:=det else TypeEL:=aig; //TypeEL=(1=détécteur 2=aig) trouve_element(adr,TypeEl,1); // branche_trouve IndexBranche_trouve + if branche_trouve=0 then begin suivant_alg3:=9999;exit;end; typeGen:=BrancheN[branche_trouve,IndexBranche_trouve].Btype; end else typeGen:=buttoir; @@ -4961,7 +5063,8 @@ begin if aiguillage[index].position=const_droit then begin // si TJD (modele=2) sur le précédent, alors substituer avec la 2eme adresse de la TJD - md:=aiguillage[index_aig(prec)].modele; + // V1 md:=aiguillage[index_aig(prec)].modele; + md:=aiguillage[index_accessoire[prec]].modele; if (md=tjd) or (md=tjs) then prec:=aiguillage[index_aig(prec)].DDroit; if prec<>aiguillage[index_aig(Adr)].Adroit then //Adroit begin @@ -4979,7 +5082,7 @@ begin // si TJD (modele=2) sur le précédent, alors substituer avec la 2eme adresse de la TJD md:=aiguillage[index_aig(prec)].modele; if (md=tjd) or (md=tjs) then prec:=aiguillage[index_aig(prec)].Ddevie; - if prec<>aiguillage[index].Adevie then + if prec<>aiguillage[index].Adevie then begin if NivDebug=3 then AfficheDebug('135.3 Aiguillage '+intToSTR(adr)+' mal positionné',clyellow); suivant_alg3:=9998; @@ -5008,9 +5111,10 @@ begin // Affiche('trouvé '+intToSTR(adr),clyellow); if (A='Z') or (a=#0) then TypeEl:=det else TypeEL:=aig; //TypeEL=(1=détécteur 2=aig trouve_element(adr,TypeEl,1); // branche_trouve IndexBranche_trouve + if branche_trouve=0 then begin suivant_alg3:=9999;exit;end; typeGen:=BrancheN[branche_trouve,IndexBranche_trouve].Btype; end - else TypeGen:=Buttoir; + else TypeGen:=Buttoir; suivant_alg3:=adr; exit; end; @@ -5037,7 +5141,9 @@ begin // récupérer les élements de la TJD/S AdrTjdP:=aiguillage[index].Ddroit; // 2eme adresse de la TJD/S - index2:=index_aig(AdrTjdP); + // V1 index2:=index_aig(AdrTjdP); + index2:=index_accessoire[AdrTjdP]; + tjdC:=aiguillage[index].modele=tjd; tjsC:=aiguillage[index].modele=tjs; tjsc1:=aiguillage[index].tjsint; // adresses de la courbe de la TJS @@ -5088,7 +5194,7 @@ begin if (NetatTJD=2) and tjdC then begin if aiguillage[index].position=const_droit then - begin + begin // d'où vient t-on de la tjd if BtypePrec=Aig then begin @@ -5318,7 +5424,7 @@ begin if (aiguillage[index].position=const_droit) and (aiguillage[index2].position=const_devie) and tjdC then begin - // d'où vient ton sur la tjd + // d'où vient t-on sur la tjd if BtypePrec=Aig then begin if ( ((aiguillage[index].AdevieB)='S') and (aiguillage[index_aig(prec)].position=const_devie) ) or @@ -5520,6 +5626,7 @@ begin if (A='Z') or (a=#0) then TypeEl:=det else TypeEL:=aig; //TypeEL=(1=détécteur 2=aig if adr=0 then TypeEl:=buttoir; trouve_element(Adr,TypeEl,1); // branche_trouve IndexBranche_trouve + if branche_trouve=0 then begin suivant_alg3:=9999;exit;end; typeGen:=BrancheN[branche_trouve,IndexBranche_trouve].BType; //?? suivant_alg3:=adr; exit; @@ -5532,6 +5639,7 @@ begin if (A='Z') or (a=#0) then TypeEl:=det else TypeEL:=aig; if adr=0 then TypeEl:=buttoir; trouve_element(Adr,TypeEl,1); // branche_trouve IndexBranche_trouve + if branche_trouve=0 then begin suivant_alg3:=9999;exit;end; typeGen:=BrancheN[branche_trouve,IndexBranche_trouve].BType; suivant_alg3:=adr;exit; end; @@ -5542,6 +5650,7 @@ begin Adr:=aiguillage[index].Adevie2; if (A='Z') or (a=#0) then TypeEl:=det else TypeEL:=aig; trouve_element(Adr,TypeEl,1); // branche_trouve IndexBranche_trouve + if branche_trouve=0 then begin suivant_alg3:=9999;exit;end; typeGen:=BrancheN[branche_trouve,IndexBranche_trouve].BType; suivant_alg3:=adr; exit; @@ -5603,6 +5712,7 @@ begin Adr:=aiguillage[index].Apointe; if (A='Z') or (a=#0) then TypeEl:=det else TypeEL:=aig; trouve_element(Adr,TypeEl,1); // branche_trouve IndexBranche_trouve + if branche_trouve=0 then begin suivant_alg3:=9999;exit;end; typeGen:=BrancheN[branche_trouve,IndexBranche_trouve].BType; suivant_alg3:=Adr; exit; @@ -6431,7 +6541,7 @@ end; // renvoie vrai si les aiguillages déclarés dans la définition du signal sont mal positionnés -// (conditions suppplémentares) +// (conditions supplémentaires) function cond_carre(adresse : integer) : boolean; var i,l,k,NCondCarre,adrAig,index : integer; resultatET,resultatOU: boolean; @@ -7092,7 +7202,7 @@ begin begin dec(i,2); // i correspond au nombre de feux à allumer pilote_direction(Adr,i); - end; + end; end; @@ -7150,9 +7260,9 @@ begin TypeActuel:=feux[i].Btype_suiv4; end; // détecteur sur le signal courant - if prec=0 then + if (actuel=0) or (actuel>NbMemZone) or (prec=0) or (prec>NbMemZone) then begin - // sortie si aucun détecteur déclaré sur le feu + // sortie si aucun détecteur déclaré sur le signal test_memoire_zones:=Pres_train; if debug=3 then formprinc.Caption:=''; exit; @@ -7513,7 +7623,13 @@ begin Typeprec:=feux[i].Btype_suiv4; end; // détecteur sur le signal courant - pres_Train:=Detecteur[actuel].etat and detect; + if actuel>NbMemZone then + begin + Affiche('Erreur 179 : détecteur '+intToSTR(actuel)+' trop élevé sur signal '+intToSTR(adresse),clred); + result:=false; + exit; + end; + pres_Train:=Detecteur[actuel].etat and detect; if pres_train and (nivDebug=3) then AfficheDebug('Présence train sur dét '+intToSTR(actuel),clyellow); if pres_train and (AdrTr=0) then AdrTr:=Detecteur[actuel].AdrTrain; @@ -9980,7 +10096,7 @@ end; // traitement des évènements actionneurs (detecteurs aussi) // adr adr2 : pour mémoire de zone procedure Event_act(adr,adr2,etat : integer;trainDecl : string); -var typ,i,v,etatAct,Af,Ao,Access,sortie,dZ1F,dZ2F,dZ1O,dZ2O : integer; +var typ,i,v,etatAct,Af,Ao,Access,sortie,dZ1F,dZ2F,dZ1O,dZ2O,index : integer; s,st,trainDest : string; fm,fd,adresseOk,etatvalide : boolean; Ts : TAccessoire; @@ -10070,6 +10186,25 @@ begin Affiche(st+' son '+Tablo_actionneur[i].FichierSon,clyellow); PlaySound(pchar(Tablo_actionneur[i].FichierSon),0,SND_ASYNC); end; + + // commande COM/USB + if adresseOK and (Tablo_actionneur[i].cde) and ((s=trainDecl) or (s='X') or (trainDecl='X') or (trainDecl='')) and (etatValide) then + begin + v:=Tablo_actionneur[i].fonction; // numéro du port com (ex12) + index:=index_COM(v); + if index=0 then exit; + if Tablo_com_cde[index].PortOuvert then + begin + trainDest:=Tablo_actionneur[i].trainDest; + if avecCR=1 then trainDest:=TrainDest+#13; + if index=1 then Formprinc.MSCommCde1.Output:=TrainDest; + if index=2 then Formprinc.MSCommCde2.Output:=TrainDest; + Affiche(st+' TrainDecl='+trainDecl+' Envoie port COM'+intToSTR(v)+' commande: '+TrainDest,clyellow); + end + else Affiche('Envoi commande impossible ; COM'+intToSTR(v)+' non détecté',clred); + end; + + end; // dans le tableau des PN @@ -10153,7 +10288,7 @@ Procedure affiche_memoire; var s: string; begin s:='Mémoire évènements '+IntToSTR(100*N_Event_tick div Max_Event_det_tick)+' %'; - Formprinc.statictext.caption:=s; + FormPrinc.StatusBar1.Panels[1].text:=s; end; procedure evalue; @@ -11238,6 +11373,7 @@ begin end; Affiche('CDM rail déconnecté',Cyan); AfficheDebug('CDM rail déconnecté',Cyan); + Formprinc.StatusBar1.Panels[2].text:='CDM déconnecté'; filtrageDet0:=SauvefiltrageDet0; end; end; @@ -11340,12 +11476,78 @@ begin end end; -// connecte un port usb. Si le port n'est pas ouvert, renvoie 0, sinon renvoie + +// connecte un port usb pour la comm actionneurs. Si le port n'est pas ouvert, renvoie false +function connecte_port_usb_cde(index : integer) : boolean; +var i,j,numport : integer; + trouve : boolean; + s,sc : string; + com : TMSComm; +begin + if (index<0) or (index>10) then + begin + affiche('Erreur index portCom cde acc',clred); + exit; + end; + + numport:=tablo_com_cde[index].NumPort; + if (numport<1) or (numport>255) then + begin + affiche('Erreur portCom cde acc',clred); + exit; + end; + trouve:=false; + + case index of + 1 : com:=formprinc.MSCommCde1; + 2 : com:=formprinc.MSCommCde2; + end; + + With com do + begin + + if debug=1 then Affiche('Test port com cde'+intToSTR(port),clLime); + i:=pos(':',portComcde); + j:=pos(',',PortComcde); + j:=posEx(',',PortComcde,j+1); + j:=posEx(',',PortComcde,j+1); + //j:=posEx(',',PortComcde,j+1); + + sc:=copy(portCom,i+1,j-i-1); + Settings:=sc; // vitesse,n,8,1 + Handshaking:=0; {0=aucun 1=Xon-Xoff 2=cts 3=RTS-Xon-Xoff 4=5=protocoles "maison"} + SThreshold:=1; + RThreshold:=1; + InputLen:=0; + CommPort:=numport; + DTREnable:=false; // évite de reset de l'arduino à la connexion + RTSEnable:=false; //pour la genli + InputMode:=comInputModeBinary; + end; + + tablo_com_cde[index].PortOuvert:=true; + try + com.portopen:=true; + except + tablo_com_cde[index].PortOuvert:=false; + end; + + if tablo_com_cde[index].PortOuvert then + begin + // portComCmd[index].MsComm.OnComm:=formprinc.Event_MsComm; + + s:='COM'+intToSTR(numport)+':'+sc; + Formprinc.StatusBar1.Panels[3].Text:=s; + end; + result:=tablo_com_cde[index].PortOuvert; +end; + +// connecte un port usb interface. Si le port n'est pas ouvert, renvoie 0, sinon renvoie // le numéro de port function connecte_port_usb(port : integer) : integer; var i,j : integer; trouve : boolean; - s : string; + s,sc : string; begin result:=0; trouve:=false; @@ -11359,8 +11561,8 @@ begin j:=posEx(',',PortCom,j+1); j:=posEx(',',PortCom,j+1); - s:=copy(portCom,i+1,j-i-1); - Settings:=s; // vitesse,n,8,1 + sc:=copy(portCom,i+1,j-i-1); + Settings:=sc; // vitesse,n,8,1 if prot_serie>=4 then Handshaking:=0 {0=aucun 1=Xon-Xoff 2=cts 3=RTS-Xon-Xoff 4=5=protocoles "maison"} else Handshaking:=prot_serie; SThreshold:=1; @@ -11384,7 +11586,10 @@ begin if portCommOuvert then begin - Affiche('Port COM'+intToSTR(port)+' ouvert',clLime); + s:='COM'+intToSTR(port)+' ouvert'; + Affiche(s,clLime); + s:='COM'+intToSTR(port)+':'+sc; + Formprinc.StatusBar1.Panels[3].Text:=s; sleep(1000); trouve:=test_protocole; if not(trouve) then @@ -11482,6 +11687,7 @@ begin if protocole=1 then s:=s+'XpressNet'; if protocole=2 then s:=s+'DCC++'; Affiche(s+' trouvée sur les ports COM de 1 à '+intToSTR(MaxPortCom),clOrange); + Formprinc.StatusBar1.Panels[3].Text:=''; end else begin @@ -11576,13 +11782,13 @@ begin MA:=Hi(GetAsyncKeyState(VK_MENU))>127; MS:=Hi(GetAsyncKeyState(VK_SHIFT))>127; - // Simulation des touches de contrôle + // Simulation des touches de contrôle if Ctrl<>MC then keybd_event(VK_CONTROL,0,Byte(MC)*KEYEVENTF_KEYUP,0); if Alt<>MA then keybd_event(VK_MENU,0,Byte(MA)*KEYEVENTF_KEYUP,0); if Shift<>MS then keybd_event(VK_SHIFT,0,Byte(MS)*KEYEVENTF_KEYUP,0); // Appui sur les touches - keybd_event(VK,0,0,0); + keybd_event(VK,0,0,0); keybd_event(VK,0,KEYEVENTF_KEYUP,0); // keybd_event(MapVirtualKeyA(VK,0),0,0,0); @@ -11597,7 +11803,7 @@ end; // conversion d'une chaine standard en chaîne VK (virtual key) pour envoyer des évènements clavier // 112=F1 .. 135=F20 136 à 143 rien 145 à 159 : spécifique ou non utilisé // $A0 .. $B0 : contrôles curseur -// $BA : spécifique au pays +// $BA : spécifique au pays // $6A à $6F * + espace - . / // BB à BE + - . attention la description diffère function convert_VK(LAY : string) : string; @@ -12126,6 +12332,7 @@ begin formatY:=-1; AvecInit:=true; // &&&& avec initialisation des aiguillages ou pas Diffusion:=AvecInit; // mode diffusion publique + debug mise au point etc + ButtonIndex.Visible:=not(avecInit); roulage1.visible:=false; FenRich.MaxLength:=$7FFFFFF0; @@ -12135,6 +12342,7 @@ begin Decodeur[5]:='Digikeijs 4018';Decodeur[6]:='Unisemaf Paco';Decodeur[7]:='Stéphane Ravaut';Decodeur[8]:='Arcomora'; Decodeur[9]:='LS-DEC-NMBS';Decodeur[10]:='B-models'; + portComcde:='COMX:115200,n,8,1'; OsBits:=0; if IsWow64Process then begin @@ -12162,8 +12370,6 @@ begin VertScrollBar.Smooth:=false; end; - - ferme:=false; CDM_connecte:=false; pasreponse:=0; @@ -12192,6 +12398,13 @@ begin procetape('Lecture de la configuration'); lit_config; + // ouvre com commandes actionneurs, car on a lu les com dans la config + for i:=1 to NbreComCde do + begin + if connecte_port_usb_cde(i) then + Affiche('COM'+intToSTR(tablo_com_cde[i].numport)+' commande actionneurs ouvert',clLime) + else Affiche('COM'+intToSTR(tablo_com_cde[i].numport)+' commande actionneurs non ouvert',clOrange); + end; Menu_tco(NbreTCO); procetape('Lecture du TCO'); @@ -12248,14 +12461,26 @@ begin end; OrgMilieu:=formprinc.width div 2; + with statusbar1 do + begin + SimplePanel:=false; // pour afficher plusieurs panels dans la Statusbar + + Panels[0].Text:=''; + + Panels[1].Text:=''; + Panels[2].Text:=''; + Panels[3].Text:=''; + Panels[4].Text:=''; + //Panels[3].Style:=psOwnerDraw; // pour déclencher l'évenement onDraw + end; with Panel2 do begin left:=5; //Align:=AlLeft; // si on ne met pas AlignLeft, alors le splitter n'est pas accrochable - top:=formprinc.LabelTitre.Height+20; + top:=formprinc.LabelTitre.top+formprinc.LabelTitre.Height+4;; width:=formprinc.width-30; - height:=formprinc.Height-StatusBar1.Height-StaticText.Height-LabelTitre.Height-90; + height:=formprinc.Height-StatusBar1.Height-LabelTitre.Height-63; //height:=400; Anchors:=[akLeft,akTop,akRight,akBottom]; end; @@ -12267,7 +12492,7 @@ begin begin left:=5; Align:=AlLeft; // si on ne met pas AlignLeft, alors le splitter n'est pas accrochable - top:=formprinc.LabelTitre.Height+20; + top:=5; // par rapport au panel width:=(OrgMilieu)-left-10; //height:=formprinc.Height-StatusBar1.Height-StaticText.Height-LabelTitre.Height-90; Anchors:=[akLeft,akTop,akRight,akBottom]; @@ -12320,13 +12545,6 @@ begin end; - // pour Rad studio------------------------ - //FenRich.Height:=Height-150; - //ScrollBox1.Height:=Height-280; - StaticText.AutoSize:=true; - StaticText.Top:=panel2.Height+Panel2.Top+4; - //---------------------------------------- - if (PosSplitter>0) and (PosSPlitter0 then begin a:=feux[0].EtatSignal; @@ -12731,7 +12953,7 @@ begin testBit(a,vert_cli) or testbit(a,blanc_cli) then begin //if clignotant then affiche('1',clyellow) else affiche('0',clwhite); - Dessine_feu_pilote; // dessiner le feu en fonction du bit "clignotant" + Dessine_feu_pilote; // dessiner le signal en fonction du bit "clignotant" end; end else @@ -12831,7 +13053,7 @@ begin begin s:='Simulation '+intToSTR(I_simule)+' Tick='+IntToSTR(tick)+' det='+intToSTR(Tablo_simule[i_simule].adresse)+'='+IntToSTR(Tablo_simule[i_simule].etat); Event_Detecteur(Tablo_simule[i_simule].adresse, Tablo_simule[i_simule].etat=1,''); // créer évt détecteur - StaticText.caption:=s; + StatusBar1.Panels[1].text:=s; //Affiche(s,clyellow); end; @@ -12840,7 +13062,7 @@ begin begin s:='Simulation '+intToSTR(I_simule)+' Tick='+IntToSTR(tick)+' aig='+intToSTR(Tablo_simule[i_simule].adresse)+'='+IntToSTR(Tablo_simule[i_simule].etat); Event_Aig(Tablo_simule[i_simule].Adresse,Tablo_simule[i_simule].etat); // créer évt aiguillage - StaticText.caption:=s; + StatusBar1.Panels[1].text:=s; //Affiche(s,clyellow); end; @@ -12852,7 +13074,7 @@ begin MsgSim:=false; filtrageDet0:=SauvefiltrageDet0; Affiche('Fin de simulation',Cyan); - StaticText.caption:=''; + StatusBar1.Panels[1].text:=''; end; end; inc(intervalle_courant); @@ -12944,6 +13166,7 @@ begin affiche(s,clOrange); end; parSocketLenz:=false; + Formprinc.StatusBar1.Panels[4].Text:=''; ErrorCode:=0; end; @@ -13081,6 +13304,7 @@ begin portCommOuvert:=false; Formprinc.MSCommUSBLenz.Portopen:=false; Affiche('Port USB déconnecté',clyellow); + Formprinc.StatusBar1.Panels[3].Text:=''; end; portCommOuvert:=false; @@ -13094,6 +13318,18 @@ begin end; end; +procedure deconnecte_usb_cde(index : integer); +begin + if tablo_com_cde[index].PortOuvert then + 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_com_cde[index].NumPort)+' actionneurs déconnecté',clyellow); + Formprinc.StatusBar1.Panels[3].Text:=''; + end; +end; + procedure TFormPrinc.DeconnecterUSBClick(Sender: TObject); begin deconnecte_usb; @@ -13261,6 +13497,7 @@ begin ButtonLitCV.Enabled:=true; LireunfichierdeCV1.enabled:=true; LabelTitre.caption:=titre+' Interface connectée par Ethernet'; + Formprinc.StatusBar1.Panels[4].Text:=ClientSocketInterface.Address; etat_init_interface:=11; // socket connecté trouve:=test_protocole; // appelle l'état des détécteurs @@ -13304,6 +13541,7 @@ begin s:='Socket CDM rail connecté'; LabelTitre.caption:=titre+' '+s; Affiche(s,clYellow); + StatusBar1.Panels[2].text:='CDM connecté'; CDM_connecte:=True; MenuConnecterUSB.enabled:=false; DeConnecterUSB.enabled:=false; @@ -14151,6 +14389,7 @@ procedure TFormPrinc.ClientSocketInterfaceDisconnect(Sender: TObject; Socket: TCustomWinSocket); begin parSocketLenz:=False; + Formprinc.StatusBar1.Panels[4].Text:=''; end; procedure TFormPrinc.FichierSimuClick(Sender: TObject); @@ -15826,7 +16065,6 @@ end; procedure TFormPrinc.NouveauTCO1Click(Sender: TObject); -var i : integer; begin if NbreTCO>=10 then begin @@ -15843,6 +16081,7 @@ begin formTCO[nbreTCO]:=TformTCO.Create(self); except Affiche('Erreur 6800 Impossible de créer la fenêtre du TCO',clred); + dec(NbreTCO); exit; end; @@ -15866,14 +16105,12 @@ begin s:='Voulez-vous supprimer le TCO '+intToSTR(TcoS)+' ('+NomFichierTCO[tcoS]+')'; if Application.MessageBox(pchar(s),pchar('confirm'), MB_YESNO or MB_DEFBUTTON2 or MB_ICONQUESTION)=idNo then exit; - SauvNbreTCO:=NbreTCO; // dire au programme Timer qu'il n'y a plus de TCO le temps de supprimer + SauvNbreTCO:=NbreTCO; // dire au programme Timer qu'il n'y a plus de TCO le temps de supprimer sinon il peut tenter d'allumer un feu sur le TCO qu'on supprime->violation NbreTCO:=0; TCOActive:=false; Affiche('Suppression du TCO '+intToSTR(Tcos),clOrange); - //FormTCO[tcos].close; - FormTCO[tcos].Release; // pas free FreeInstance; // annuler le pointeur et raz les mémoires de la form - FormTCO[tcos].close; + FormTCO[tcos].Release; // annuler le pointeur et raz les mémoires de la form for i:=tCos to SauvNbreTCO-1 do begin @@ -15882,6 +16119,7 @@ begin FormTCO[i]:=FormTCO[i+1]; FormTCO[i].Name:='TCO'+intToSTR(i); // renommer le TCO TCO[i]:=Tco[i+1]; // déplacer les données + // et toutes les variables du tco PcanvasTCO[i]:=PcanvasTCO[i+1]; PBitMapTCO[i]:=PBitMapTCO[i+1]; PImageTCO[i]:=PImageTCO[i+1]; @@ -15993,13 +16231,85 @@ begin HauteurF:=Height; OffsetXF:=left; OffsetYF:=top; - etatF:=0; PosSplitter:=splitterV.Left; AffMemoFenetre:=1; sauve_config; end; - +procedure TFormPrinc.ButtonIndexClick(Sender: TObject); +var i,v : integer; +begin + for i:=1 to MaxAcc do + begin + v:=index_accessoire[i]; + if v<>0 then affiche('adresse='+intToSTR(i)+' index = '+intToSTR(v),clLime); + end; + +end; + +procedure TFormPrinc.StatusBar1DrawPanel(StatusBar: TStatusBar; Panel: TStatusPanel; const Rect: TRect); +var + RectForText: TRect; +begin + if (Panel = StatusBar.Panels[3]) then + begin + StatusBar1.Canvas.Font.Color := clwhite; + StatusBar1.Canvas.Brush.color:=clGreen; + RectForText:=Rect; + StatusBar1.Canvas.FillRect(RectForText); + DrawText(StatusBar1.Canvas.Handle, PChar(Panel.Text), -1, RectForText, + DT_SINGLELINE or DT_VCENTER or DT_LEFT); + end; +end; + +procedure TFormPrinc.MSCommCde1Comm(Sender: TObject); +var recu : string; + tablo : array of byte; // tableau rx usb + c : char; + i : integer; +begin + if MSCommCde1.commEvent=ComEvReceive then + begin + tablo:=MSCommCde1.Input; + recu:=''; + for i:=0 to length(tablo)-1 do + begin + c:=char(tablo[i]); + //Affiche(intToSTR(ord(c)),clorange); + if c=#13 then + begin + affiche(tablo_com_cde[1].tamponrx,clyellow); + tablo_com_cde[1].tamponrx:=''; + end; + if (c>#31) and (c<#128) then tablo_com_cde[1].tamponrx:=tablo_com_cde[1].tamponrx+c;; + end; + end; +end; + +procedure TFormPrinc.MSCommCde2Comm(Sender: TObject); +var recu : string; + tablo : array of byte; // tableau rx usb + c : char; + i : integer; +begin + if MSCommCde2.commEvent=ComEvReceive then + begin + tablo:=MSCommCde2.Input; + recu:=''; + for i:=0 to length(tablo)-1 do + begin + c:=char(tablo[i]); + //Affiche(intToSTR(ord(c)),clorange); + if c=#13 then + begin + affiche(tablo_com_cde[2].tamponrx,clyellow); + tablo_com_cde[2].tamponrx:=''; + end; + if (c>#31) and (c<#128) then tablo_com_cde[2].tamponrx:=tablo_com_cde[2].tamponrx+c;; + end; + end; +end; + end. diff --git a/UnitTCO.dfm b/UnitTCO.dfm index 0e178a4..dd30b19 100644 --- a/UnitTCO.dfm +++ b/UnitTCO.dfm @@ -925,8 +925,8 @@ object FormTCO: TFormTCO OnClick = ButtonRedessineClick end object Button1: TButton - Left = 860 - Top = 96 + Left = 900 + Top = 8 Width = 57 Height = 25 Anchors = [akTop, akRight] @@ -935,8 +935,8 @@ object FormTCO: TFormTCO OnClick = Button1Click end object Button2: TButton - Left = 860 - Top = 64 + Left = 844 + Top = 8 Width = 57 Height = 25 Anchors = [akTop, akRight] @@ -956,8 +956,8 @@ object FormTCO: TFormTCO OnClick = ButtonConfigTCOClick end object ButtonSimu: TButton - Left = 740 - Top = 136 + Left = 644 + Top = 152 Width = 113 Height = 25 Anchors = [akTop, akRight] @@ -1172,8 +1172,8 @@ object FormTCO: TFormTCO OnClick = buttonRazClick end object ButtonCalibrage: TButton - Left = 852 - Top = 136 + Left = 764 + Top = 152 Width = 75 Height = 25 Anchors = [akTop, akRight] @@ -1210,8 +1210,8 @@ object FormTCO: TFormTCO end end object ButtonAfficheBandeau: TButton - Left = 876 - Top = 408 + Left = 1132 + Top = 328 Width = 56 Height = 32 Anchors = [akTop, akRight] diff --git a/UnitTCO.pas b/UnitTCO.pas index 1c98828..f475167 100644 --- a/UnitTCO.pas +++ b/UnitTCO.pas @@ -429,6 +429,7 @@ const ModeCouleurCanton_ch='ModeCouleurCanton'; Graphisme_ch='Graphisme'; Ecran_ch='Ecran'; + Epaisseur_voies_ch='EpVoies'; Id_signal=50; Id_Quai=51; Id_action=52; @@ -477,15 +478,12 @@ var HtImageTCO,LargImageTCO,XminiSel,YminiSel,XCoupe,Ycoupe,Temposouris, XmaxiSel,YmaxiSel,AncienXMiniSel,AncienXMaxiSel,AncienYMiniSel,AncienYMaxiSel, Xclic,Yclic,XClicCellInserer,YClicCellInserer,RatioC,ModeCouleurCanton, - AncienXClicCell,AncienYClicCell,TCODrag, + AncienXClicCell,AncienYClicCell,TCODrag,epaisseur_voies, Epaisseur,oldX,oldY,offsetSourisY,offsetSourisX,AvecVerifIconesTCO,indexTrace,IndexTCOCourant, ancienTraceX,ancienTraceY,rangUndo,NbreTCO,IndexTCOCreate: integer; - - titre_Fonte : string; - TCO : array[1..10] of array of array of TTco ; // tco[x,y].variable @@ -620,7 +618,7 @@ begin clPiedSignal:=$4080FF; ClCanton:=$00FFFF; AvecGrille[indexTCO]:=true; - Graphisme:=1; + if indexTCO=1 then Graphisme:=2; SetLength(TCO[indexTCO],NbreCellX[indexTCO]+2,NbreCellY[indexTCO]+2); // +2 pour éviter les erreurs d'index sur +1 et -1 init_tampon_copiercoller; @@ -825,6 +823,17 @@ begin end; + sa:=uppercase(Epaisseur_voies_ch)+'='; + i:=pos(sa,s); + if i<>0 then + begin + inc(nv); + delete(s,i,length(sa)); + val(s,i,erreur); + if (i<1) or (i>10) then i:=5; + Epaisseur_voies:=i; + end; + sa:=uppercase(AvecGrille_ch)+'='; i:=pos(sa,s); if i<>0 then @@ -1133,6 +1142,7 @@ begin Writeln(fichier,Avecgrille_ch+'='+s); writeln(fichier,Graphisme_ch+'=',graphisme); writeln(fichier,Ecran_ch+'=',EcranTCO[i]); + writeln(fichier,Epaisseur_voies_ch+'=',Epaisseur_voies); if EvtClicDet then s:='1' else s:='0'; Writeln(fichier,EvtClicDet_ch+'='+s); @@ -1190,7 +1200,8 @@ begin hauteurCell[indexTCO]:=(LargeurCell[indexTCO] * RatioC) div 10; largeurCelld2[indexTCO]:=largeurCell[indexTCO] div 2; HauteurCelld2[indexTCO]:=HauteurCell[indexTCO] div 2; - Epaisseur:=LargeurCell[indexTCO] div 7; // épaisseur du trait pour PEN + Epaisseur:=LargeurCell[indexTCO]*epaisseur_voies div 30; // épaisseur du trait pour PEN + //Affiche(intToSTR(LargeurCell[indexTCO])+' '+intToSTR(epaisseur),clyellow); end; procedure entoure_cell_grille(indexTCO,x,y : integer); @@ -2106,7 +2117,6 @@ begin position:=positionTCO(indexTCO,x,y); fond:=tco[indextco,x,y].CouleurFond; - //&&& remonter au parent depuis le canvas.....pour trouver l'index du TCO efface_selection(1); with canvas do @@ -4311,7 +4321,7 @@ begin xf:=x0+LargeurCell[indexTCO]; yf:=y0+hauteurCell[indexTCO]; x1:=x0-(2*LargeurCell[indexTCO])-(LargeurCell[indexTCO] div 2);y1:=y0-hauteurCell[indexTCO]-(hauteurCell[indexTCO] div 3); - x2:=x0+(LargeurCell[indexTCO] div 2);y2:=yf+(hauteurCell[indexTCO] div 3); + x2:=x0+(LargeurCell[indexTCO] div 2);y2:=yf+round(hauteurCell[indexTCO] / 2.5); x3:=x0;y3:=yf; x4:=xc;y4:=y0; ep:=tco[indextco,x,y].epaisseurs; @@ -4378,7 +4388,7 @@ begin xf:=x0+LargeurCell[indexTCO]; yf:=y0+hauteurCell[indexTCO]; x1:=x0+(LargeurCell[indexTCO] div 2);y1:=y0-hauteurCell[indexTCO]-(hauteurCell[indexTCO] div 3); - x2:=xf+(2*LargeurCell[indexTCO])+(LargeurCell[indexTCO] div 2);y2:=yf+(hauteurCell[indexTCO] div 3); + x2:=xf+(2*LargeurCell[indexTCO])+(LargeurCell[indexTCO] div 2);y2:=yf+round(hauteurCell[indexTCO] / 3); x3:=xc;y3:=y0; x4:=xf;y4:=yf; ep:=tco[indextco,x,y].epaisseurs; @@ -5783,7 +5793,7 @@ procedure trajet_droit; begin if testbit(ep,1) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; pen.color:=couleur; - moveto(xc,y0);lineto(xc,yc); + moveto(xc,y0);lineto(xc,yc); if testbit(ep,5) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; lineto(xc,yf); end; @@ -5820,9 +5830,9 @@ begin fond:=tco[indextco,x,y].CouleurFond; ep:=tco[indextco,x,y].epaisseurs; - // mode rond + // mode rond x1:=x0-(2*LargeurCell[indexTCO])-(LargeurCell[indexTCO] div 3);y1:=y0-hauteurCell[indexTCO]-(hauteurCell[indexTCO] div 3); - x2:=xc;y2:=yf+(hauteurCell[indexTCO] div 3); // div 3 permet d'avoir un angle a 45° plutot que div 2 + x2:=xc;y2:=yf+round(hauteurCell[indexTCO] / 2.9); x3:=x0;y3:=yf; x4:=xc;y4:=y0; @@ -7689,7 +7699,7 @@ begin end; // allumage des feux du signal ----------------- - dessine_feu_mx(canvasDest,x0,y0,frX,frY,adresse,orientation); + dessine_signal_mx(canvasDest,x0,y0,frX,frY,adresse,orientation); end; @@ -7779,7 +7789,7 @@ begin Font.Name:='Arial'; Font.Style:=style(tco[indextco,x,y].FontStyle); xt:=0;yt:=0; - if Bimage=2 then begin xt:=3;yt:=1;end; + if Bimage=2 then begin xt:=LargeurCell[indexTCO] div 2;yt:=1;end; if Bimage=3 then begin xt:=3;yt:=hauteurCell[indexTCO]-round(20*fryGlob[indexTCO]);end; if Bimage=4 then begin xt:=3;yt:=1;end; if Bimage=5 then begin xt:=3;yt:=hauteurCell[indexTCO]-round(20*fryGlob[indexTCO]);end; @@ -7790,7 +7800,7 @@ begin if Bimage=21 then begin xt:=3;yt:=1;end; if Bimage=22 then begin xt:=3;yt:=hauteurCell[indexTCO]-round(15*fryGlob[indexTCO]);end; if Bimage=24 then begin xt:=LargeurCell[indexTCO]-round(20*frxGlob[indexTCO]);yt:=hauteurCell[indexTCO]-round(15*fryGlob[indexTCO]);end; - if Bimage=25 then begin xt:=1;yt:=hauteurCell[indexTCO]-round(15*fryGlob[indexTCO]);end; + if Bimage=25 then begin xt:=(LargeurCell[indexTCO] div 2) + round(6*frxGlob[indexTCO]);yt:=(hauteurCell[indexTCO] div 2)-round(15*fryGlob[indexTCO]);end; if Bimage=26 then begin xt:=1;yt:=hauteurCell[indexTCO]-round(15*fryGlob[indexTCO]);end; if Bimage=27 then begin xt:=1;yt:=1;end; if Bimage=28 then begin xt:=1;yt:=1;end; @@ -7889,22 +7899,26 @@ begin pied:=tco[indextco,x,y].PiedFeu; inverse:=feux[index].contrevoie; xt:=0;yt:=0; - if (aspect=20) and (Oriente=1) then + // signal belge + if (aspect=20) then begin - if inverse then begin xt:=2;yt:=2*hauteurCell[indexTCO]-round(16*fryGlob[indexTCO]);end - else - begin xt:=(LargeurCell[indexTCO] div 2)+round(5*frxGlob[indexTCO]);yt:=2*hauteurCell[indexTCO]-round(20*fryGlob[indexTCO]); end; - end; - if (aspect=20) and (Oriente=2) then - begin - if inverse then begin xt:=round(20*frxGlob[indexTCO]);yt:=round(3*fryGlob[indexTCO]);end - else - begin xt:=round(10*frxGlob[indexTCO]);yt:=hauteurCell[indexTCO]-round(16*fryGlob[indexTCO]);end; - end; - if (aspect=20) and (Oriente=3) then - begin - if inverse then begin xt:=LargeurCell[indexTCO]+round(10*frxGlob[indexTCO]);yt:=hauteurCell[indexTCO]-round(16*fryGlob[indexTCO]);end - else begin xt:=LargeurCell[indexTCO]+round(10*frxGlob[indexTCO]);yt:=round(1*fryGlob[indexTCO]);end; + if (Oriente=1) then + begin + if inverse then begin xt:=2;yt:=2*hauteurCell[indexTCO]-round(16*fryGlob[indexTCO]);end + else + begin xt:=(LargeurCell[indexTCO] div 2)+round(5*frxGlob[indexTCO]);yt:=2*hauteurCell[indexTCO]-round(20*fryGlob[indexTCO]); end; + end; + if (Oriente=2) then + begin + if inverse then begin xt:=round(20*frxGlob[indexTCO]);yt:=round(3*fryGlob[indexTCO]);end + else + begin xt:=round(10*frxGlob[indexTCO]);yt:=hauteurCell[indexTCO]-round(16*fryGlob[indexTCO]);end; + end; + if (Oriente=3) then + begin + if inverse then begin xt:=LargeurCell[indexTCO]+round(10*frxGlob[indexTCO]);yt:=hauteurCell[indexTCO]-round(16*fryGlob[indexTCO]);end + else begin xt:=LargeurCell[indexTCO]+round(10*frxGlob[indexTCO]);yt:=round(1*fryGlob[indexTCO]);end; + end; end; if (aspect=9) and (Oriente=1) then begin xt:=LargeurCell[indexTCO]-round(25*frxGlob[indexTCO]);yt:=2*hauteurCell[indexTCO]-round(25*fryGlob[indexTCO]);end; if (aspect=9) and (Oriente=2) then begin xt:=round(10*frxGlob[indexTCO]);yt:=hauteurCell[indexTCO]-round(17*fryGlob[indexTCO]);end; // orientation G @@ -7926,6 +7940,7 @@ begin if (aspect=2) and (Oriente=1) and (pied=1) then begin xt:=round(45*frxGlob[indexTCO]);yt:=1;end; // signal à gauche if (aspect=2) and (Oriente=2) then begin xt:=round(10*frxGlob[indexTCO]);yt:=hauteurCell[indexTCO];end; // orientation G if (aspect=2) and (Oriente=3) then begin xt:=round(10*frxGlob[indexTCO]);yt:=hauteurCell[indexTCO];end; // orientation D + // signaux directionnels if (aspect>10) and (aspect<20) and(oriente=1) then begin xt:=1;yt:=hauteurCell[indexTCO]-round(14*fryGlob[indexTCO]);end; if (aspect>10) and (aspect<20) and (oriente=2) then begin xt:=LargeurCell[indexTCO]-round(15*frxGlob[indexTCO]);yt:=0;end; if (aspect>10) and (aspect<20) and (oriente=3) then begin xt:=LargeurCell[indexTCO]-round(15*frxGlob[indexTCO]);yt:=0;end; @@ -8026,8 +8041,6 @@ begin VertScrollBar.Smooth:=false; end; - - calcul_reduction(frxGlob[indexTCO],fryGlob[indexTCO],LargeurCell[indexTCO],hauteurCell[indexTCO]); //Affiche(formatfloat('0.000000',frxGlob[indexTCO]),clyellow); @@ -8040,7 +8053,7 @@ begin pen.color:=clyellow; for y:=1 to NbreCellY[indexTCO] do - for x:=1 to NbreCellX[indexTCO] do + for x:=1 to NbreCellX[indexTCO] do begin x1:=(x-1)*LargeurCell[indexTCO]; y1:=(y-1)*hauteurCell[indexTCO]; @@ -8084,10 +8097,7 @@ end; procedure grise_ligne_tco(indexTCO : integer); var x : integer; begin - for x:=1 to NbreCellX[indexTCO] do - begin - Affiche_Cellule(indexTCO,x,YClicCell[indexTCO]); - end; + for x:=1 to NbreCellX[indexTCO] do Affiche_Cellule(indexTCO,x,YClicCell[indexTCO]); end; procedure TFormTCO.FormCreate(Sender: TObject); @@ -8099,6 +8109,7 @@ begin auto_tcurs:=true; TCO_modifie:=false; rangUndo:=1; + epaisseur_voies:=5; XclicCell[indexTCOCreate]:=1; YclicCell[indexTCOCreate]:=1; xCoupe:=0;yCoupe:=0; @@ -9254,7 +9265,6 @@ begin //Panel1.top:=scrollBox.top+ScrollBox.height; - FormInit[indexTCO]:=true; end; if indexTCO=NbreTCO then TCOActive:=true; @@ -9650,7 +9660,6 @@ begin case Key of VK_right : if x