diff --git a/Notice d'utilisation des signaux_complexes_GL_V8.26.pdf b/Notice d'utilisation des signaux_complexes_GL_V8.27.pdf similarity index 78% rename from Notice d'utilisation des signaux_complexes_GL_V8.26.pdf rename to Notice d'utilisation des signaux_complexes_GL_V8.27.pdf index aa871ff..0cff53d 100644 Binary files a/Notice d'utilisation des signaux_complexes_GL_V8.26.pdf and b/Notice d'utilisation des signaux_complexes_GL_V8.27.pdf differ diff --git a/Signaux_complexes_GL.map b/Signaux_complexes_GL.map index 7de3bd6..5ba485e 100644 --- a/Signaux_complexes_GL.map +++ b/Signaux_complexes_GL.map @@ -1,8 +1,8 @@ Start Length Name Class - 0001:00000000 0016718CH .text CODE + 0001:00000000 001688D8H .text CODE 0002:00000000 00002BE8H .data DATA - 0002:00002BE8 041CBB51H .bss BSS + 0002:00002BE8 041CEA31H .bss BSS Detailed map of segments @@ -85,20 +85,20 @@ Detailed map of segments 0001:000A358C 000015B4 C=CODE S=.text G=(none) M=UnitPilote ACBP=A9 0001:000A4B40 000004D0 C=CODE S=.text G=(none) M=Importation ACBP=A9 0001:000A5010 00010280 C=CODE S=.text G=(none) M=UnitAnalyseSegCDM ACBP=A9 - 0001:000B5290 00002690 C=CODE S=.text G=(none) M=UnitConfigTCO ACBP=A9 - 0001:000B7920 000009C0 C=CODE S=.text G=(none) M=Unit_Pilote_aig ACBP=A9 - 0001:000B82E0 00003458 C=CODE S=.text G=(none) M=UnitConfigCellTCO ACBP=A9 - 0001:000BB738 0002DB7C C=CODE S=.text G=(none) M=UnitTCO ACBP=A9 - 0001:000E92B4 00002C18 C=CODE S=.text G=(none) M=UnitSR ACBP=A9 - 0001:000EBECC 00002404 C=CODE S=.text G=(none) M=UnitCDF ACBP=A9 - 0001:000EE2D0 000015D3 C=CODE S=.text G=(none) M=verif_version ACBP=A9 - 0001:000EF8A4 0000114C C=CODE S=.text G=(none) M=UnitPareFeu ACBP=A9 - 0001:000F09F0 00037308 C=CODE S=.text G=(none) M=UnitConfig ACBP=A9 - 0001:00127CF8 0000290C C=CODE S=.text G=(none) M=UnitDebug ACBP=A9 - 0001:0012A604 00000C00 C=CODE S=.text G=(none) M=UnitSimule ACBP=A9 - 0001:0012B204 00002390 C=CODE S=.text G=(none) M=Unitplace ACBP=A9 - 0001:0012D594 00039768 C=CODE S=.text G=(none) M=UnitPrinc ACBP=A9 - 0001:00166CFC 0000048D C=CODE S=.text G=(none) M=Signaux_complexes_GL ACBP=A9 + 0001:000B5290 00002698 C=CODE S=.text G=(none) M=UnitConfigTCO ACBP=A9 + 0001:000B7928 000009C0 C=CODE S=.text G=(none) M=Unit_Pilote_aig ACBP=A9 + 0001:000B82E8 00003988 C=CODE S=.text G=(none) M=UnitConfigCellTCO ACBP=A9 + 0001:000BBC70 0002ED60 C=CODE S=.text G=(none) M=UnitTCO ACBP=A9 + 0001:000EA9D0 00002C18 C=CODE S=.text G=(none) M=UnitSR ACBP=A9 + 0001:000ED5E8 00002404 C=CODE S=.text G=(none) M=UnitCDF ACBP=A9 + 0001:000EF9EC 000015D3 C=CODE S=.text G=(none) M=verif_version ACBP=A9 + 0001:000F0FC0 0000114C C=CODE S=.text G=(none) M=UnitPareFeu ACBP=A9 + 0001:000F210C 0003732C C=CODE S=.text G=(none) M=UnitConfig ACBP=A9 + 0001:00129438 0000290C C=CODE S=.text G=(none) M=UnitDebug ACBP=A9 + 0001:0012BD44 00000C00 C=CODE S=.text G=(none) M=UnitSimule ACBP=A9 + 0001:0012C944 00002390 C=CODE S=.text G=(none) M=Unitplace ACBP=A9 + 0001:0012ECD4 00039774 C=CODE S=.text G=(none) M=UnitPrinc ACBP=A9 + 0001:00168448 0000048D C=CODE S=.text G=(none) M=Signaux_complexes_GL ACBP=A9 0002:00000000 000000CC C=DATA S=.data G=DGROUP M=System ACBP=A9 0002:000000CC 00000020 C=DATA S=.data G=DGROUP M=SysInit ACBP=A9 0002:000000EC 00000254 C=DATA S=.data G=DGROUP M=SysUtils ACBP=A9 @@ -212,16 +212,16 @@ Detailed map of segments 0002:00007C40 00000014 C=BSS S=.bss G=DGROUP M=UnitConfigTCO ACBP=A9 0002:00007C54 00000014 C=BSS S=.bss G=DGROUP M=Unit_Pilote_aig ACBP=A9 0002:00007C68 00000014 C=BSS S=.bss G=DGROUP M=UnitConfigCellTCO ACBP=A9 - 0002:00007C7C 00044EE8 C=BSS S=.bss G=DGROUP M=UnitTCO ACBP=A9 - 0002:0004CB64 00000010 C=BSS S=.bss G=DGROUP M=UnitSR ACBP=A9 - 0002:0004CB74 00000014 C=BSS S=.bss G=DGROUP M=UnitCDF ACBP=A9 - 0002:0004CB88 00000018 C=BSS S=.bss G=DGROUP M=verif_version ACBP=A9 - 0002:0004CBA0 00000004 C=BSS S=.bss G=DGROUP M=UnitPareFeu ACBP=A9 - 0002:0004CBA4 000004F8 C=BSS S=.bss G=DGROUP M=UnitConfig ACBP=A9 - 0002:0004D09C 0000002C C=BSS S=.bss G=DGROUP M=UnitDebug ACBP=A9 - 0002:0004D0C8 0000000C C=BSS S=.bss G=DGROUP M=UnitSimule ACBP=A9 - 0002:0004D0D4 00000008 C=BSS S=.bss G=DGROUP M=Unitplace ACBP=A9 - 0002:0004D0DC 04181A74 C=BSS S=.bss G=DGROUP M=UnitPrinc ACBP=A9 + 0002:00007C7C 00047DC8 C=BSS S=.bss G=DGROUP M=UnitTCO ACBP=A9 + 0002:0004FA44 00000010 C=BSS S=.bss G=DGROUP M=UnitSR ACBP=A9 + 0002:0004FA54 00000014 C=BSS S=.bss G=DGROUP M=UnitCDF ACBP=A9 + 0002:0004FA68 00000018 C=BSS S=.bss G=DGROUP M=verif_version ACBP=A9 + 0002:0004FA80 00000004 C=BSS S=.bss G=DGROUP M=UnitPareFeu ACBP=A9 + 0002:0004FA84 000004F8 C=BSS S=.bss G=DGROUP M=UnitConfig ACBP=A9 + 0002:0004FF7C 0000002C C=BSS S=.bss G=DGROUP M=UnitDebug ACBP=A9 + 0002:0004FFA8 0000000C C=BSS S=.bss G=DGROUP M=UnitSimule ACBP=A9 + 0002:0004FFB4 00000008 C=BSS S=.bss G=DGROUP M=Unitplace ACBP=A9 + 0002:0004FFBC 04181A74 C=BSS S=.bss G=DGROUP M=UnitPrinc ACBP=A9 Bound resource files @@ -247,4 +247,4 @@ Signaux_complexes_GL.res Signaux_complexes_GL.drf -Program entry point at 0001:0016700C +Program entry point at 0001:00168758 diff --git a/UnitAnalyseSegCDM.pas b/UnitAnalyseSegCDM.pas index 2af91ee..93fcbc4 100644 --- a/UnitAnalyseSegCDM.pas +++ b/UnitAnalyseSegCDM.pas @@ -897,7 +897,7 @@ begin with FormAnalyseCdm.ImageCDM.canvas do begin pen.Width:=1; - pen.color:=Cyan; + pen.color:=clCyan; TextOut(x,y,s); Moveto(0,0); LineTo(x,y); diff --git a/UnitConfig.dfm b/UnitConfig.dfm index fcb2f6e..8b46803 100644 --- a/UnitConfig.dfm +++ b/UnitConfig.dfm @@ -668,7 +668,7 @@ object FormConfig: TFormConfig Top = 8 Width = 633 Height = 497 - ActivePage = TabSheetCDM + ActivePage = TabSheetAutonome Font.Charset = DEFAULT_CHARSET Font.Color = clBlack Font.Height = -11 @@ -1465,7 +1465,7 @@ object FormConfig: TFormConfig Top = 16 Width = 25 Height = 21 - Hint = 'Temps de filtrage d'#39'un d'#233'tecteur qui passe '#224' 0' + Hint = 'Temps de filtrage des d'#233'tecteurs qui passent '#224' 0' ParentShowHint = False ShowHint = True TabOrder = 0 @@ -2318,7 +2318,7 @@ object FormConfig: TFormConfig Width = 137 Height = 21 Style = csDropDownList - ItemHeight = 0 + ItemHeight = 13 TabOrder = 1 OnChange = ComboBoxDecChange end @@ -2425,7 +2425,7 @@ object FormConfig: TFormConfig Width = 137 Height = 21 Style = csDropDownList - ItemHeight = 0 + ItemHeight = 13 TabOrder = 2 OnChange = ComboBoxAspChange end @@ -2719,7 +2719,7 @@ object FormConfig: TFormConfig Width = 193 Height = 21 AutoComplete = False - ItemHeight = 0 + ItemHeight = 13 TabOrder = 0 OnChange = ComboBoxDecodeurPersoChange end @@ -2738,7 +2738,7 @@ object FormConfig: TFormConfig Width = 145 Height = 21 Style = csDropDownList - ItemHeight = 0 + ItemHeight = 13 TabOrder = 2 OnChange = ComboBoxNationChange end @@ -2784,7 +2784,7 @@ object FormConfig: TFormConfig Width = 193 Height = 21 Style = csDropDownList - ItemHeight = 0 + ItemHeight = 13 TabOrder = 6 OnChange = ComboBoxDecCdeChange end @@ -3163,7 +3163,7 @@ object FormConfig: TFormConfig Height = 21 Hint = 'Nom de l'#39'accessoire d'#233'fini dans l'#39'onglet "p'#233'riph'#233'riques COM/USB"' Style = csDropDownList - ItemHeight = 0 + ItemHeight = 13 ParentShowHint = False ShowHint = True TabOrder = 6 @@ -3344,7 +3344,7 @@ object FormConfig: TFormConfig Height = 21 Hint = 'Nom de l'#39'accessoire d'#233'fini dans l'#39'onglet "p'#233'riph'#233'riques COM/USB"' Style = csDropDownList - ItemHeight = 0 + ItemHeight = 13 ParentShowHint = False ShowHint = True TabOrder = 10 diff --git a/UnitConfig.pas b/UnitConfig.pas index 29f3aa8..5eb885b 100644 --- a/UnitConfig.pas +++ b/UnitConfig.pas @@ -805,7 +805,7 @@ begin end else begin - if adresseIPCDM='0' then Affiche('La connexion à CDM n''est pas demandée car l''adresse IP est nulle dans '+NomConfig,cyan); + if adresseIPCDM='0' then Affiche('La connexion à CDM n''est pas demandée car l''adresse IP est nulle dans '+NomConfig,clcyan); end; end; diff --git a/UnitConfigCellTCO.dfm b/UnitConfigCellTCO.dfm index d09d44e..dbf95f6 100644 --- a/UnitConfigCellTCO.dfm +++ b/UnitConfigCellTCO.dfm @@ -4,7 +4,7 @@ object FormConfCellTCO: TFormConfCellTCO BorderStyle = bsDialog Caption = 'FormConfCellTCO' ClientHeight = 430 - ClientWidth = 282 + ClientWidth = 284 Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText @@ -291,10 +291,10 @@ object FormConfCellTCO: TFormConfCellTCO TabOrder = 5 end object GroupBoxAction: TGroupBox - Left = 24 - Top = 184 + Left = 8 + Top = 80 Width = 249 - Height = 105 + Height = 129 Caption = 'Action' Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText @@ -303,6 +303,20 @@ object FormConfCellTCO: TFormConfCellTCO Font.Style = [] ParentFont = False TabOrder = 6 + object Label3: TLabel + Left = 104 + Top = 74 + Width = 38 + Height = 13 + Caption = 'Adresse' + end + object Labela: TLabel + Left = 184 + Top = 74 + Width = 6 + Height = 13 + Caption = #224 + end object RadioButtonAffTCO: TRadioButton Left = 8 Top = 24 @@ -338,6 +352,34 @@ object FormConfCellTCO: TFormConfCellTCO TabOrder = 3 OnClick = RadioButtonCDMClick end + object RadioButtonAction: TRadioButton + Left = 8 + Top = 72 + Width = 89 + Height = 17 + Caption = 'Activer sortie' + TabOrder = 4 + OnClick = RadioButtonActionClick + end + object EditAdrSortie: TEdit + Left = 144 + Top = 68 + Width = 33 + Height = 21 + TabOrder = 5 + OnChange = EditAdrSortieChange + end + object EditEtat: TEdit + Left = 200 + Top = 68 + Width = 25 + Height = 21 + Hint = '1 ou 2' + ParentShowHint = False + ShowHint = True + TabOrder = 6 + OnChange = EditEtatChange + end end end object CheckPinv: TCheckBox diff --git a/UnitConfigCellTCO.pas b/UnitConfigCellTCO.pas index 311ccf6..b77961b 100644 --- a/UnitConfigCellTCO.pas +++ b/UnitConfigCellTCO.pas @@ -36,6 +36,11 @@ type EditNumTCO: TEdit; RadioButtonSC: TRadioButton; RadioButtonCDM: TRadioButton; + RadioButtonAction: TRadioButton; + Label3: TLabel; + EditAdrSortie: TEdit; + EditEtat: TEdit; + Labela: TLabel; procedure EditAdrElementChange(Sender: TObject); procedure EditTexteCCTCOChange(Sender: TObject); procedure ButtonFonteClick(Sender: TObject); @@ -59,6 +64,9 @@ type procedure FormHide(Sender: TObject); procedure RadioButtonSCClick(Sender: TObject); procedure RadioButtonCDMClick(Sender: TObject); + procedure EditAdrSortieChange(Sender: TObject); + procedure EditEtatChange(Sender: TObject); + procedure RadioButtonActionClick(Sender: TObject); private { Déclarations privées } public @@ -69,7 +77,7 @@ var FormConfCellTCO: TFormConfCellTCO; actualize,ConfCellTCO : boolean; IconeX,IconeY : integer; - + procedure actualise(indexTCO : integer); implementation @@ -131,7 +139,18 @@ begin RadioButtonAffTCO.Checked:=tco[indexTCO,Xclic,Yclic].PiedFeu=1; RadioButtonSC.Checked:=tco[indexTCO,Xclic,Yclic].PiedFeu=2; RadioButtonCDM.Checked:=tco[indexTCO,Xclic,Yclic].PiedFeu=3; + RadioButtonAction.Checked:=tco[indexTCO,Xclic,Yclic].PiedFeu=4; editNumTCO.Text:=intToSTR(tco[indexTCO,Xclic,Yclic].FeuOriente); + if RadioButtonAction.Checked then + begin + EditAdrSortie.Text:=intToSTR(tco[indexTCO,Xclic,Yclic].Adresse); + EditEtat.Text:=intToSTR(tco[indexTCO,Xclic,Yclic].sortie); + end + else + begin + EditAdrSortie.Text:=''; + EditEtat.Text:=''; + end; end; end; end @@ -823,6 +842,44 @@ begin end; end; +procedure TFormConfCellTCO.EditAdrSortieChange(Sender: TObject); +var i,erreur : integer; +begin + if clicTCO then exit; + + val(EditAdrSortie.Text,i,erreur); + if erreur<>0 then exit; + + tco[IndexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]].adresse:=i; +end; + +procedure TFormConfCellTCO.EditEtatChange(Sender: TObject); +var i,erreur : integer; +begin + if clicTCO then exit; + + val(EditEtat.Text,i,erreur); + if erreur<>0 then exit; + + tco[IndexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]].sortie:=i; +end; + + +procedure TFormConfCellTCO.RadioButtonActionClick(Sender: TObject); +var x,y : integer; +begin + if clicTCO or actualize then exit; + if RadioButtonAction.Checked then + begin + x:=XClicCell[IndexTCOCourant]; + y:=yClicCell[IndexTCOCourant]; + tco[IndexTCOCourant,x,y].PiedFeu:=4; + efface_cellule(indexTCOCourant,PCanvasTCO[indexTCOcourant],x,y,pmcopy); + affiche_cellule(IndexTCOCourant,x,y); + actualise(indexTCOCourant); + end; +end; + begin end. diff --git a/UnitConfigTCO.pas b/UnitConfigTCO.pas index 5380630..b9c0f26 100644 --- a/UnitConfigTCO.pas +++ b/UnitConfigTCO.pas @@ -446,7 +446,6 @@ var ok : boolean; s : string; begin ok:=true; - if verif_config_TCO(indexTCOCourant) then begin with FormTCO[indexTCOCourant].ImageTCO do diff --git a/UnitPrinc.pas b/UnitPrinc.pas index 1507ecf..a9bc9b5 100644 --- a/UnitPrinc.pas +++ b/UnitPrinc.pas @@ -390,13 +390,12 @@ const_droit_CDM=0; // positions aiguillages transmises par cdm const_inconnu=9; // position inconnue NbCouleurTrain=8; MaxCdeDccpp=20; -ClBleuClair=$FF7070 ; clRose=$AAAAFF; -Cyan=$FF6060; +clCyan=$FFA0A0; clviolet=$FF00FF; GrisF=$333333; clOrange=$0077FF; -couleurTrain : array[0..NbCouleurTrain] of Tcolor = (clRose,clYellow,clLime,clOrange,clAqua,clFuchsia,clLtGray,clred,clWhite); +couleurTrain : array[0..NbCouleurTrain] of Tcolor = (clRose,clYellow,clLime,ClCyan,clAqua,clFuchsia,clLtGray,clred,clWhite); Max_Simule=10000; Max_Event_det_tick=30000; EtatSign : array[0..13] of string[20] =('carré','sémaphore','sémaphore cli','vert','vert cli','violet', @@ -841,7 +840,7 @@ procedure ferme_pn_usb(i : integer); procedure ouvre_pn_socket(i : integer); procedure ferme_pn_socket(i : integer); function com_socket(i : integer) : integer; -function liste_portcom : tStrings; +procedure liste_portcom; procedure mosaiqueH; procedure mosaiqueV; function InfoSignal(adresse : integer) : string; @@ -4837,10 +4836,11 @@ begin end; // trouve l'index d'un détecteur dans une branche -// si pas trouvé, renvoie 0 +// si pas trouvé, renvoie 0 sinon renvoie l'index du détecteur dans la branche function index_detecteur(detecteur,Num_branche : integer) : integer; var i,adr : integer; trouve : boolean; + // trouve si detecteur est dans la branche num_branche à partir de l'index i procedure recherche; begin repeat @@ -4853,11 +4853,13 @@ var i,adr : integer; end; begin if debug=3 then formprinc.Caption:='index_detecteur '+IntToSTR(detecteur); + { i:=1;index2_det:=0; recherche; if trouve then result:=i else result:=0; //affiche(inttostr(ai+1),clOrange); - i:=2; // à voir + } + i:=1; //affiche('------------------------',clWhite); recherche; //affiche('------------------------',clGreen); @@ -6282,7 +6284,7 @@ begin dernier:=0; // faire en incrément - if afdeb then afficheDebug('incrément',cyan); + if afdeb then afficheDebug('incrément',clcyan); suiv1:=BrancheN[Branche_Det,indexBranche_det+1].adresse; type1:=BrancheN[Branche_Det,indexBranche_det+1].Btype; // det aig buttoir @@ -6309,7 +6311,7 @@ begin end; // faire en décrément - if afdeb then afficheDebug('décrément',cyan); + if afdeb then afficheDebug('décrément',clcyan); if not(trouve) then begin suiv1:=BrancheN[Branche_Det,indexBranche_det-1].adresse; @@ -9294,8 +9296,8 @@ begin if (det10 then + if indexAig<>0 then begin - Affiche('Pilotage impossible, l''aiguillage '+intToSTR(adresse)+' est réservé par le train @'+intToSTR(AdrTrain),clred); - Result:=false; - exit; - end; - if (aiguillage[indexAig].inversionCDM=1) then - begin - if octet=1 then pilotage:=2 else pilotage:=1; - end; + AdrTrain:=aiguillage[indexAig].AdrTrain; + if AdrTrain<>0 then + begin + Affiche('Pilotage impossible, l''aiguillage '+intToSTR(adresse)+' est réservé par le train @'+intToSTR(AdrTrain),clred); + Result:=false; + exit; + end; + if (aiguillage[indexAig].inversionCDM=1) then + begin + if octet=1 then pilotage:=2 else pilotage:=1; + end; + end; end; // pilotage par CDM rail ----------------- @@ -11846,8 +11851,8 @@ begin editadrtrain.Text:=inttostr(trains[1].adresse); end; end; - Affiche('CDM rail déconnecté',Cyan); - AfficheDebug('CDM rail déconnecté',Cyan); + Affiche('CDM rail déconnecté',clCyan); + AfficheDebug('CDM rail déconnecté',clCyan); Formprinc.StatusBar1.Panels[2].text:='CDM déconnecté'; filtrageDet0:=SauvefiltrageDet0; end; @@ -11964,6 +11969,7 @@ begin if (numport<1) or (numport>255) then begin affiche('Erreur portCom cde acc <0 ou >255',clred); + result:=false; exit; end; trouve:=false; @@ -12048,6 +12054,7 @@ begin if (index<0) or (index>10) then begin affiche('Le nombre maxi de périphériques est atteint - Le socket '+Tablo_periph[index].protocole+' ne sera pas ouvert',clred); + result:=false; exit; end; @@ -12642,7 +12649,7 @@ begin else s:=s+' non positionné'; end; - Affiche(s,cyan); + Affiche(s,clcyan); aiguillage[index].position:=pos; end; end; @@ -13197,7 +13204,7 @@ begin //DoubleBuffered:=true; - { + { aiguillage[index_aig(1)].position:=const_droit; aiguillage[index_aig(2)].position:=const_droit; aiguillage[index_aig(3)].position:=const_devie; @@ -13209,6 +13216,7 @@ begin aiguillage[index_aig(10)].position:=const_devie; aiguillage[index_aig(11)].position:=const_droit; aiguillage[index_aig(12)].position:=const_devie; + aiguillage[index_aig(17)].position:=const_devie; aiguillage[index_aig(18)].position:=const_devie; aiguillage[index_aig(19)].position:=const_devie; aiguillage[index_aig(20)].position:=const_devie; @@ -13221,9 +13229,9 @@ begin aiguillage[index_aig(31)].position:=const_devie; aiguillage[index_aig(25)].position:=const_droit; aiguillage[index_aig(9)].position:=const_droit; - {zone_tco(1,519,527,1); - zone_tco(1,521,527,2); - + // zone_tco(1,519,527,1); + // zone_tco(1,521,527,2); + { Event_Detecteur(524,true,'A'); Event_Detecteur(524,false,'A'); @@ -13232,16 +13240,17 @@ begin Event_Detecteur(527,true,'A'); Event_Detecteur(527,false,'A'); + aiguillage[index_aig(7)].position:=const_devie; + } + //zone_TCO(1,560,562,1); - Event_Detecteur(524,true,'B'); - Event_Detecteur(524,false,'B'); - - Event_Detecteur(521,true,'B'); - Event_Detecteur(521,false,'B'); - - } + //zone_TCO_V2(1,527,519,1); + // Event_Detecteur(524,true,'B'); + //(524,false,'B'); + // Event_Detecteur(521,true,'B'); + // Event_Detecteur(521,false,'B'); // roulage:=true; { formatY:=2; ‹y 00001010000101000111010000> format 0 @@ -13361,7 +13370,7 @@ end; // timer à 100 ms procedure TFormPrinc.Timer1Timer(Sender: TObject); -var i,a,combine,adresse,TailleX,TailleY,orientation,indexTCO,x,y,Bimage,aspect : integer; +var i,a,adresse,TailleX,TailleY,orientation,indexTCO,x,y,Bimage,aspect : integer; imageFeu : Timage; frx,fry : real; faire : boolean; @@ -13593,7 +13602,7 @@ begin begin if not(MsgSim) then begin - Affiche('Simulation en cours ',Cyan);MsgSim:=true; + Affiche('Simulation en cours ',clCyan);MsgSim:=true; end; if intervalle_courant>=Intervalle then @@ -13627,7 +13636,7 @@ begin I_Simule:=0; MsgSim:=false; filtrageDet0:=SauvefiltrageDet0; - Affiche('Fin de simulation',Cyan); + Affiche('Fin de simulation',clCyan); StatusBar1.Panels[1].text:=''; end; end; @@ -14006,8 +14015,8 @@ procedure TFormPrinc.Codificationdesaiguillages1Click(Sender: TObject); var i,adr : integer ; s : string; begin - Affiche('Codification interne des aiguillages',Cyan); - Affiche('D=position droite S=position déviée P=pointe Z=détecteur',Cyan); + Affiche('Codification interne des aiguillages',clCyan); + Affiche('D=position droite S=position déviée P=pointe Z=détecteur',clCyan); for i:=1 to MaxAiguillage do begin adr:=aiguillage[i].adresse; @@ -15156,11 +15165,11 @@ var i,typ,adract,etatAct,fonction,v,acc,sortie : integer; begin if (maxTablo_act=0) and (NbrePN=0) then begin - Affiche('Aucun actionneur déclaré',Cyan); + Affiche('Aucun actionneur déclaré',clCyan); exit; end; - Affiche('Codification interne des actionneurs',Cyan); + Affiche('Codification interne des actionneurs',clCyan); for i:=1 to maxTablo_act do begin s:=Tablo_actionneur[i].trainDecl; @@ -15237,7 +15246,7 @@ begin MsgSim:=false; filtrageDet0:=SauvefiltrageDet0; StopSimu:=true; - Affiche('Fin de simulation',Cyan); + Affiche('Fin de simulation',clCyan); end; procedure TFormPrinc.OuvrirunfichiertramesCDM1Click(Sender: TObject); @@ -15382,7 +15391,7 @@ begin aff:=MemZone[i,j].etat; if aff then begin - Affiche('MemZone['+intToSTR(i)+','+intToSTR(j)+'] '+MemZone[i,j].train+' @='+intToSTR(MemZone[i,j].AdrTrain)+' Train n°'+intToSTR(MemZone[i,j].Numtrain),clYellow); + Affiche('MemZone['+intToSTR(i)+','+intToSTR(j)+'] '+MemZone[i,j].train+' @='+intToSTR(MemZone[i,j].AdrTrain)+' Train n°'+intToSTR(MemZone[i,j].Numtrain),couleurTrain[MemZone[i,j].Numtrain]); rien:=false; end; inc(j); @@ -15403,14 +15412,14 @@ begin if n<>0 then s:=s+' @'+intToSTR(n); ss:=event_det_train[i].nom_train; if ss<>'' then s:=s+' '+ss; - Affiche(s,clOrange); + Affiche(s,couleurTrain[i]); n:=event_det_train[i].signal_rouge; if n<>0 then Affiche('Arreté devant signal '+intToSTR(n),clyellow); for j:=1 to event_det_train[i].NbEl do begin s:=intToSTR(event_det_train[i].Det[j].adresse); - Affiche(s,clyellow); + Affiche(s,couleurTrain[i]); end; end; @@ -15880,7 +15889,7 @@ begin if i=0 then Affiche('Aucun port com',clyellow); end; -function liste_portcom : tStrings; +procedure liste_portcom ; begin try CoInitialize(nil); diff --git a/UnitTCO.pas b/UnitTCO.pas index 251c2c7..5a8ed15 100644 --- a/UnitTCO.pas +++ b/UnitTCO.pas @@ -469,13 +469,13 @@ const type // structure d'une cellule du TCO TTCO = record - Adresse : integer; // adresse du détecteur ou de l'aiguillage ou du feu + Adresse : integer; // adresse du détecteur ou de l'aiguillage ou du feu OU si action sortie : adresse BImage : integer; // icone: 0=rien 1=voie 2=aiguillage gauche ... 50=feu mode : integer; // couleur de voie 0=éteint 1=ClVoies 2=couleur dans le champ train train : integer; // numéro du train trajet : integer; // décrit le trajet ouvert sur la voie (cas d'un croisement ou d'une tjd/S) inverse : boolean; // aiguillage piloté inversé - repr : integer; // position de la représentation texte 0 = rien 1=centrale 2=Haut 3=Bas 4=réparti + repr : integer; // position de la représentation texte 0 = rien 1=centré 2=Haut 3=Bas 4=réparti 5=double centré Texte : string; // texte de la cellule Fonte : string; // fonte du texte FontStyle : string; // GSIB (Gras Souligné Italique Barré) @@ -487,10 +487,11 @@ type x,y : integer; // coordonnées pixels relativés du coin sup gauche du signal pour le décalage par rapport au 0,0 cellule Xundo,Yundo : integer; // coordonnées x,y de la cellule pour le undo FeuOriente : integer; // orientation du signal : 1 vertical en bas / 2 horizontal gauche / 3 horizontal droit / OU si action : numéro du TCO etc - liaisons : integer; // quadrants des liaisons + liaisons : integer; // quadrants des liaisons epaisseurs : integer; // épaisseur des liaisons : si le bit n est à 1 : liaison fine pont : integer; // définition du pont : si le bit n est à 1 : pont (bits symétriques) buttoir : integer; // définition des buttoirs : si le bit n est à 1 : buttoir + sortie : integer; // si action sortie : état end; Trect_Select= record @@ -589,6 +590,7 @@ function IsAigTCO(i : integer) : boolean; function index_TCO(t : Tobject) : integer; procedure Init_TCO(indexTCO : integer); procedure init_tampon_copiercoller; +//procedure zone_tco_V2(indexTCO,det1,det2,mode: integer); implementation @@ -1421,7 +1423,7 @@ begin i:=pos(')',s); j:=pos(',',s); if j0 then tco[indexTCO,x,y].Adresse:=0; // pas d'adresse dans un buttoir - //delete(s,1,i-1); //ne pas supprimer la virgule + //if i<>0 then tco[indexTCO,x,y].Adresse:=0; // pas d'adresse dans un buttoir + i:=pos(')',s); j:=pos(',',s);if j=16 then + begin + delete(s,1,1); // supprimer la virgule + val(s,i,erreur); + tco[indexTCO,x,y].sortie:=i; + delete(s,1,erreur-1); end; i:=pos(')',s); @@ -1549,6 +1561,7 @@ begin s:=s+','+intToSTR(tco[i,x,y].epaisseurs); s:=s+','+intToSTR(tco[i,x,y].pont); s:=s+','+intToSTR(tco[i,x,y].buttoir); + s:=s+','+intToSTR(tco[i,x,y].sortie); s:=s+')'; end; writeln(fichier,s); @@ -1821,8 +1834,9 @@ begin //Affiche(s+' '+intToSTR(tf*length(s+st[i])),clyellow); until (round(0.8*tf*length(s+st[i]))>larg) or (i>NombreMots); //yl:=(y-1)*round((l*tf)); + delete(s,length(s),1); yl:=round(1.5*l*tf)+((y-1)*haut); - PCanvasTCO[indexTCO].TextOut((x-1)*larg,yl,s+' '); + PCanvasTCO[indexTCO].TextOut((x-1)*larg+5,yl+3,s); inc(l); until (i>NombreMots); end; @@ -1841,7 +1855,7 @@ end; procedure affiche_texte(indextco,x,y : integer); var b,x0,y0,xt,yt,repr,taillefont,tf : integer; - ss,s : string; + ss,s,nf : string; c : Tcanvas; begin @@ -1856,9 +1870,9 @@ begin b:=tco[indextco,x,y].BImage; if (b=51) then PCanvasTCO[indextco].Brush.Color:=clQuai[indexTCO] else PCanvasTCO[indextco].Brush.Color:=tco[indextco,x,y].CouleurFond; c.Font.Color:=tco[indextco,x,y].CoulFonte; - ss:=tco[indextco,x,y].fonte; - if ss='' then ss:='Arial'; - c.Font.Name:=ss; + nf:=tco[indextco,x,y].fonte; + if nf='' then ss:='Arial'; + c.Font.Name:=nf; ss:=tco[indextco,x,y].FontStyle; @@ -1875,13 +1889,13 @@ begin if b=id_action then c.Brush.Color:=ClGray; //affiche(intToSTR(taillefont*LargeurCell[indexTCO] div 40),clyellow); // champ texte - + //Affiche(nf+' '+intToSTR(tf)+' '+s,clred); case repr of - 0,1 : yt:=(hauteurCell[indexTCO] div 2)-round(tailleFont*fryGlob[indexTCO]); // milieu + 0,1 : yt:=(hauteurCell[indexTCO] div 2)-round(tailleFont*fryGlob[indexTCO]); // au milieu 2 : yt:=1; // haut 3 : yt:=hauteurCell[indexTCO]-round(2*TailleFont*fryGlob[indexTCO]); // bas - 5 : begin // double centré - xt:=(largeurCell[indexTCO] div 2)-(round(length(s)*(taillefont)*frxGlob[indexTCO]) div 3); + 5 : begin // double centré XY + xt:=(largeurCell[indexTCO] div 2)-(round(length(s)*(taillefont)*frxGlob[indexTCO]) div 2); yt:=(hauteurCell[indexTCO] div 2)-round(tailleFont*fryGlob[indexTCO]); // texte centré end; end; @@ -5184,6 +5198,7 @@ begin end; end; +// action procedure dessin_52(indexTCO : integer;Canvas : Tcanvas;x,y,mode: integer); var x0,y0,xf,yf,act : integer; r : Trect; @@ -5193,7 +5208,7 @@ begin y0:=(y-1)*hauteurCell[indexTCO]+2; xf:=x0+LargeurCell[indexTCO]-4; yf:=y0+HauteurCell[indexTCO]-4; - + with canvas do begin Pen.Width:=1; @@ -5206,26 +5221,36 @@ begin if TCOActive then begin - tco[indexTCO,x,y].repr:=5; + s:=tco[indexTCO,x,y].Fonte; + if s='' then tco[indexTCO,x,y].Fonte:='Arial'; + //s:=tco[indexTCO,x,y].texte; + s:=''; + if s='' then tco[indexTCO,x,y].repr:=5; // centré en X et Y act:=tco[indexTCO,x,y].PiedFeu; if act=1 then begin - s:='TCO'+intToSTR(tco[indexTCO,x,y].FeuOriente); // feuoriente contient le numéro du TCO + if s='' then s:='TCO'+intToSTR(tco[indexTCO,x,y].FeuOriente); // feuoriente contient le numéro du TCO tco[indexTCO,x,y].texte:=s; - tco[indexTCO,x,y].TailleFonte:=8; tco[indexTCO,x,y].FontStyle:='G'; end; if act=2 then begin - s:='SC'; + if s='' then s:='SC'; + tco[indexTCO,x,y].texte:=s; + tco[indexTCO,x,y].TailleFonte:=8; + tco[indexTCO,x,y].FontStyle:='G'; + end; + if act=3 then + begin + if s='' then s:='CDM'; tco[indexTCO,x,y].texte:=s; tco[indexTCO,x,y].TailleFonte:=8; tco[indexTCO,x,y].FontStyle:='G'; end; - if act=3 then + if act=4 then begin - s:='CDM'; + if s='' then s:=intToSTR(tco[indexTCO,x,y].adresse); tco[indexTCO,x,y].texte:=s; tco[indexTCO,x,y].TailleFonte:=8; tco[indexTCO,x,y].FontStyle:='G'; @@ -8523,7 +8548,7 @@ begin ButtonDessiner.TabStop:=false; //TrackBarZoom.position:=78; - couleurAdresse:=Cyan; + couleurAdresse:=clCyan; xMiniSel:=99999;yMiniSel:=99999; xMaxiSel:=0;yMaxiSel:=0; SelectionAffichee[indexTCOCreate]:=false; @@ -8643,15 +8668,872 @@ begin Affiche(s,clred); end; +procedure affiche_trajet(indexTCO,ir,mode : integer); +var i,j,sx,sy,x,y,ax,ay,Bimage,adresse : integer; + mdl : tEquipement; +begin +// et affichage de la route + for i:=1 to ir do + begin + x:=routetco[i].x; + y:=routetco[i].y; + tco[Indextco,x,y].mode:=mode; //mode; // pour la couleur + TCO[IndexTCO,x,y].train:=index_couleur; + //Affiche(intToSTR(x)+' '+intToSTR(y),clorange); + + bimage:=tco[indextco,x,y].BImage; + adresse:=tco[indextco,x,y].Adresse; + tco[indextco,x,y].trajet:=0; + + // croisement + if (bimage=21) and (i>1) then + begin + j:=index_aig(adresse); + mdl:=aiguillage[j].modele; + ax:=routetco[i-1].x; + ay:=routetco[i-1].y; + sx:=routetco[i+1].x; // suivant + sy:=routetco[i+1].y; + tco[indextco,x,y].trajet:=0; + if (ax-x=-1) and (ay-y=0) and (sx-x=1) and (sy-y=0) then tco[indextco,x,y].trajet:=1; // de gauche à droite + if (ax-x=1) and (ay-y=0) and (sx-x=-1) and (sy-y=0) then tco[indextco,x,y].trajet:=1; // de droite à gauche + if (ax-x=-1) and (ay-y=1) and (sx-x=1) and (sy-y=-1) then tco[indextco,x,y].trajet:=2; // de bas gauche vers haut droit + if (ax-x=1) and (ay-y=-1) and (sx-x=-1) and (sy-y=1) then tco[indextco,x,y].trajet:=2; // de haut droit vers bas gauche + if (ax-x=-1) and (ay-y=0) and (sx-x=1) and (sy-y=-1) then tco[indextco,x,y].trajet:=4; // de gauche vers haut droite + if (ax-x=1) and (ay-y=-1) and (sx-x=-1) and (sy-y=0) then tco[indextco,x,y].trajet:=4; // de haut droite vers gauche + if (ax-x=-1) and (ay-y=1) and (sx-x=1) and (sy-y=0) then tco[indextco,x,y].trajet:=3; // de bas gauche vers droite + if (ax-x=1) and (ay-y=0) and (sx-x=-1) and (sy-y=1) then tco[indextco,x,y].trajet:=3; // de gauche vers haut droite + if tco[indextco,x,y].trajet=0 then affiche('Erreur 70 TCO - Cellule '+intToSTR(x)+','+intToSTR(y),clred); + end; + + // croisement + if (bimage=22) and (i>1) then + begin + j:=index_aig(adresse); + mdl:=aiguillage[j].modele; + ax:=routetco[i-1].x; // précédent + ay:=routetco[i-1].y; + sx:=routetco[i+1].x; // suivant + sy:=routetco[i+1].y; + tco[indextco,x,y].trajet:=0; + if (ax-x=-1) and (ay-y=0) and (sx-x=1) and (sy-y=0) then tco[indextco,x,y].trajet:=1; // de gauche à droite + if (ax-x=1) and (ay-y=0) and (sx-x=-1) and (sy-y=0) then tco[indextco,x,y].trajet:=1; // de droite à gauche + if (ax-x=-1) and (ay-y=-1) and (sx-x=1) and (sy-y=1) then tco[indextco,x,y].trajet:=2; // de haut gauche vers bas droit + if (ax-x=1) and (ay-y=1) and (sx-x=-1) and (sy-y=-1) then tco[indextco,x,y].trajet:=2; // de bas droit vers haut gauche + if (ax-x=1) and (ay-y=0) and (sx-x=-1) and (sy-y=-1) then tco[indextco,x,y].trajet:=3; // de droit vers en haut à gauche + if (ax-x=-1) and (ay-y=-1) and (sx-x=1) and (sy-y=0) then tco[indextco,x,y].trajet:=3; // de haut à gauche vers droit + if (ax-x=1) and (ay-y=1) and (sx-x=-1) and (sy-y=0) then tco[indextco,x,y].trajet:=4; // de bas à droite vers gauche + if (ax-x=-1) and (ay-y=0) and (sx-x=1) and (sy-y=1) then tco[indextco,x,y].trajet:=4; // de gauche vers en bas a droite + if tco[indextco,x,y].trajet=0 then affiche('Erreur 71 TCO - Cellule '+intToSTR(x)+','+intToSTR(y),clred); + end; + + // croisement + if (bimage=23) and (i>1) then + begin + j:=index_aig(adresse); + mdl:=aiguillage[j].modele; + ax:=routetco[i-1].x; // précédent + ay:=routetco[i-1].y; + sx:=routetco[i+1].x; // suivant + sy:=routetco[i+1].y; + tco[indextco,x,y].trajet:=0; + if (ax-x=0) and (ay-y=-1) and (sx-x=0) and (sy-y=1) then tco[indextco,x,y].trajet:=1; // de haut à bas + if (ax-x=0) and (ay-y=1) and (sx-x=0) and (sy-y=-1) then tco[indextco,x,y].trajet:=1; // de bas à haut + if (ax-x=1) and (ay-y=-1) and (sx-x=-1) and (sy-y=1) then tco[indextco,x,y].trajet:=2; // de haut droit vers bas gauche + if (ax-x=-1) and (ay-y=1) and (sx-x=1) and (sy-y=-1) then tco[indextco,x,y].trajet:=2; // de bas gauche vers haut droit + if (ax-x=1) and (ay-y=-1) and (sx-x=0) and (sy-y=1) then tco[indextco,x,y].trajet:=3; // de haut droit vers bas + if (ax-x=0) and (ay-y=1) and (sx-x=1) and (sy-y=-1) then tco[indextco,x,y].trajet:=3; // de bas vers haut droit + if (ax-x=0) and (ay-y=-1) and (sx-x=-1) and (sy-y=1) then tco[indextco,x,y].trajet:=4; // de haut vers bas gauche + if (ax-x=-1) and (ay-y=1) and (sx-x=0) and (sy-y=-1) then tco[indextco,x,y].trajet:=4; // de bas gauche vers haut + if tco[indextco,x,y].trajet=0 then affiche('Erreur 72 TCO - Cellule '+intToSTR(x)+','+intToSTR(y),clred); + end; + + // croisement + if (bimage=25) and (i>1) then + begin + j:=index_aig(adresse); + mdl:=aiguillage[j].modele; + ax:=routetco[i-1].x; // précédent + ay:=routetco[i-1].y; + sx:=routetco[i+1].x; // suivant + sy:=routetco[i+1].y; + tco[indextco,x,y].trajet:=0; + if (ax-x=0) and (ay-y=-1) and (sx-x=0) and (sy-y=1) then tco[indextco,x,y].trajet:=1; // de haut à bas + if (ax-x=0) and (ay-y=1) and (sx-x=0) and (sy-y=-1) then tco[indextco,x,y].trajet:=1; // de bas à haut + if (ax-x=-1) and (ay-y=-1) and (sx-x=1) and (sy-y=1) then tco[indextco,x,y].trajet:=2; // de haut gauche vers bas droit + if (ax-x=1) and (ay-y=1) and (sx-x=-1) and (sy-y=-1) then tco[indextco,x,y].trajet:=2; // de bas droit vers haut gauche + if (ax-x=-1) and (ay-y=-1) and (sx-x=0) and (sy-y=1) then tco[indextco,x,y].trajet:=3; // de NO vers S + if (ax-x=0) and (ay-y=1) and (sx-x=-1) and (sy-y=-1) then tco[indextco,x,y].trajet:=3; // de S vers haut gauche + if (ax-x=0) and (ay-y=-1) and (sx-x=1) and (sy-y=1) then tco[indextco,x,y].trajet:=4; // de N vers SE + if (ax-x=1) and (ay-y=1) and (sx-x=0) and (sy-y=-1) then tco[indextco,x,y].trajet:=4; // de SE vers N + if tco[indextco,x,y].trajet=0 then affiche('Erreur 73 TCO - Cellule '+intToSTR(x)+','+intToSTR(y),clred); + end; + Affiche_cellule(indexTCO,x,y); + end; +end; + // allume ou éteint (mode=0 ou 1) la voie, zone de det1 à det2 sur le TCO // si mode=0 : éteint // =1 : couleur détecteur allumé // =2 : couleur de l'index train +// Ne nécessite pas que les aiguillages aoient bien positionnés entre det1 et det2 +// procédure récursive quand on passe par un aiguillage +procedure zone_tco(indexTCO,det1,det2,mode: integer); +var i,ir,adresse,Bimage,direction,ancienX,ancienY,x,y,xn,yn,Xdet1,yDet1,iteration,indexIr : integer; + memtrouve,sortir,casok,indextrouve : boolean; + s : string; -procedure zone_TCO(indexTCO,det1,det2,mode: integer); +// stocke la route dans le tableau, et incrémente l'index +procedure maj_route(x,y : integer;var ir : integer); +begin + if debugTCO then AfficheDebug('Ir='+IntToSTR(ir)+'->'+intToSTR(x)+' '+intToSTR(y),clyellow); + routetco[ir].x:=x; + routetco[ir].y:=y; + if ir<500 then inc(ir); +end; + +// mise à jour de x,y, nouvelles coordonnées par xn,yn (var globales de la procédure zone_tco) +procedure Maj_coords(var ancienX,ancienY,x,y : integer); +begin + ancienX:=x; + ancienY:=y; + x:=xn; + y:=yn; +end; + +// El_Tco : trouve l'élément en x,y et constuit la route à l'élément de destination suivant, suivant +// les variables ancienX et ancienY +// x, y et ir sont locales pour des récursivités différentes, donc on les passe en paramètre pour transmettre à la +// récursivité suivante leur valeur, mais elles reprennent leur valeurs initiales à la remontée vers la résursivité appellante. +procedure El_tco(x,y : integer; ir : integer); +var mdl : Tequipement; + i,j :integer; + sortir : boolean; +begin + // répète la route depuis un aiguillage + inc(iteration); + if DebugTCO then AfficheDebug('El_TCO',clorange); + + i:=0; + repeat + maj_route(x,y,ir); + adresse:=tco[indextco,x,y].Adresse ; + Bimage:=tco[indextco,x,y].Bimage; + if debugTCO then + begin + s:='X='+intToSTR(x)+' y='+intToSTR(y)+' Elément='+intToSTR(Bimage); + if adresse<>0 then s:=s+' Adresse='+intToSTR(adresse); + AfficheDebug(s,clyellow); + end; + casok:=false; + // vers case suivante: trouver le trajet pour rejoindre det1 à det2 + + case Bimage of + // voie + 1 : begin + if debugTCO then + begin + s:='El 1';if adresse<>0 then s:=s+'adr='+intToStr(adresse); + AfficheDebug(s,clyellow); + end; + yn:=y; + if ancienXy) then begin xn:=x+1;xn:=x+1;end; + if (ancienX>x) and (ancienY=Y) then + begin + //pris en pointe + ancienX:=x; + ancienY:=y; + x:=x-1; + el_tco(x,y,ir); // essaye droit + // essayer dévié + if not(memtrouve) then + begin + AncienY:=y; + AncienX:=x+1; + y:=y+1; + x:=x; + el_tco(x,y,ir); // nouvelle itération + end; + end; + end; + 3 : begin + //if debugTCO then AfficheDebug('El 3',clyellow); + if (ancienX>x) and (ancienY<=Y) then begin xn:=x-1;end; + if (ancienXx) and (ancienY=Y) then begin xn:=x-1;end; + if (ancienX>x) and (ancienY>y) then begin xn:=x-1;end; + if (ancienXx) and (ancienY=Y) then + begin + // pris en pointe droite + x:=x-1;y:=y; + ancienx:=x;ancieny:=y; + el_tco(x,y,ir); + if not(memtrouve) then + begin + // essai dévié + AncienY:=y; + AncienX:=x+1; + y:=y-1;x:=x; + el_tco(x,y,ir); + end; + end; + end; + 6 : if ancienXx) and (ancienY>=Y) then begin xn:=x-1;yn:=y-1;end; + if (ancienX=Y) then begin xn:=x+1;yn:=y-1;end; + if (ancienX>x) and (ancienYx) and (ancienY>y) then + begin + // pris en pointe droit + ancienX:=x;ancienY:=y; + x:=x-1;y:=y-1; + el_tco(x,y,ir); + if not(memtrouve) then + begin + // essai dévié + AncienY:=y+1; + AncienX:=x+1; + y:=y+1;x:=x; + el_tco(x,y,ir); + end; + end; + end; + 15 : begin + if (ancienX>x) and (ancienY<=Y) then begin xn:=x-1;yn:=y+1;end; + if (ancienXY) then + begin + // aiguillage pris en pointe + ancienX:=x;ancienY:=y; + x:=x+1;y:=y-1; + // essayer droit + el_tco(x,y,ir); + // essayer dévié + if not(memtrouve) then + begin + AncienY:=y+1; + AncienX:=x-1; + y:=y+1; + x:=x; + el_tco(x,y,ir); // nouvelle itération + end; + end; + + end; + 16 : if ancienX0 then s:=s+'adr='+intToStr(adresse); + AfficheDebug(s,clyellow); + end; + xn:=x; + casok:=true; + if (ancienY0 then + begin + j:=Index_Aig(adresse); + mdl:=aiguillage[j].modele; + if (mdl=tjs) or (mdl=tjd) then + begin + // tjd ou tjs + if ancienXx) and not(Memtrouve) then // on va à gauche + begin + // essayer vers O + ancienX:=x;ancienY:=y; + x:=x-1; + el_tco(x,y,ir); + if not(memtrouve) then + begin + // essai vers SO + AncienY:=y; + AncienX:=x+1; + y:=y+1;x:=x; + el_tco(x,y,ir); + end; + end; + end; + end; + + if (adresse=0) or (mdl=crois) then + // croisement + begin + if DebugTCO then AfficheDebug('Croisement',clyellow); + if (ancienXx) and (ancienY=Y) then begin xn:=x-1;yn:=y;end; + if (ancienXY) then begin xn:=x+1;yn:=y-1;end; + if (ancienX>x) and (ancienY0 then + begin + j:=Index_Aig(adresse); + mdl:=aiguillage[j].modele; + if (mdl=tjs) or (mdl=tjd) then + begin + // tjd ou tjs + if ancienXx) and not(Memtrouve) then // on va à gauche + begin + // essayer vers O + ancienX:=x;ancienY:=y; + x:=x-1; + el_tco(x,y,ir); + if not(memtrouve) then + begin + // essai vers NO + AncienY:=y; + AncienX:=x+1; + y:=y-1;x:=x; + el_tco(x,y,ir); + end; + end; + end; + end; + + if (adresse=0) or (mdl=crois) then + // croisement + begin + if DebugTCO then AfficheDebug('croisement',clyellow); + if (ancienXx) and (ancienY=Y) then begin casok:=true;xn:=x-1;end; + if (ancienX>x) and (ancienY>Y) then begin casok:=true;xn:=x-1;yn:=y-1;end; + if (ancienX0 then + begin + j:=Index_Aig(adresse); + mdl:=aiguillage[j].modele; + // tjd ou tjs + if (mdl=tjd) or (mdl=tjs) then + begin + if ancienYy) and not(Memtrouve) then // on monte + begin + // essayer vers N + ancienX:=x;ancienY:=y; + y:=y-1; + el_tco(x,y,ir); + if not(memtrouve) then + begin + // essai vers NE + AncienY:=y+1; + AncienX:=x; + x:=x+1; + el_tco(x,y,ir); + end; + end; + end; + end; + if (adresse=0) or (mdl=crois) then + // croisement + begin + if DebugTCO then AfficheDebug('Croisement',clyellow); + if (ancienX>x) and (ancienYY) then begin xn:=x+1;yn:=yn-1;end; + if (ancienX=x) and (ancienYY) then begin xn:=x;yn:=y-1;end; + end; + if (mdl=aig) then + begin + Affiche('Erreur 50 TCO : la cellule '+intToSTR(x)+','+intToSTR(y)+' d''adresse '+intToSTR(Adresse)+' est décrite comme un aiguillage ',clred); + Affiche('mais la cellule représente un croisement ou une TJD/S',clred); + exit; + end; + end; + + 24 : begin + if debugTCO then AfficheDebug('El 24',clyellow); + // on vient d'en haut ou en haut à gauche + if (ancienYy) and (ancienX=x) then + begin + ancienX:=x;ancienY:=y; + y:=y-1; + // essayer droit + el_tco(x,y,ir); + // essayer dévié + if not(memtrouve) then + begin + AncienY:=y+1; + AncienX:=x; + x:=x-1; + el_tco(x,y,ir); // nouvelle itération + end; + end; + end; + + // tjd ou croisement + 25 : begin + mdl:=rien; + if adresse<>0 then + begin + j:=Index_Aig(adresse); + mdl:=aiguillage[j].modele; + // tjd ou tjs + if (mdl=tjd) or (mdl=tjs) then + begin + if ancienYy) and not(Memtrouve) then // on monte + begin + // essayer vers N + ancienX:=x;ancienY:=y; + y:=y-1; + el_tco(x,y,ir); + if not(memtrouve) then + begin + // essai vers NO + AncienY:=y+1; + AncienX:=x; + x:=x-1; + el_tco(x,y,ir); + end; + end; + end; + end; + if (adresse=0) or (mdl=crois) then + // croisement + begin + if DebugTCO then AfficheDebug('Croisement',clyellow); + if (ancienXx) and (ancienY>Y) then begin xn:=x-1;yn:=yn-1;end; + if (ancienX=x) and (ancienYY) then begin xn:=x;yn:=y-1;end; + end; + if (mdl=aig) then + begin + Affiche('Erreur 51 TCO : la cellule '+intToSTR(x)+','+intToSTR(y)+' d''adresse '+intToSTR(Adresse)+' est décrite comme un aiguillage ',clred); + Affiche('mais la cellule représente un croisement ou une TJD/S',clred); + exit; + end; + end; + + 26 : begin + if debugTCO then AfficheDebug('El 26',clyellow); + if (ancienY=x) then begin yn:=y+1;xn:=x;end; + // on vient d'en bas + if (ancienY>y) and (ancienX=x) then + begin + ancienX:=x;ancienY:=y; + y:=y-1; + // essayer droit + el_tco(x,y,ir); + // essayer dévié + if not(memtrouve) then + begin + AncienY:=y+1; + AncienX:=x; + x:=x+1; + el_tco(x,y,ir); // nouvelle itération + end; + end; + end; + 27 : begin + if debugTCO then AfficheDebug('El 27',clyellow); + // on vient d'en bas + if (ancienY>y) and (ancienX<=x) then begin yn:=y-1;xn:=x;end; + // on vient d'en haut: pris en pointe + if (ancienYy) and (ancienX>=x) then begin yn:=y-1;xn:=x; end; + + // on vient d'en haut + if (ancienY=x) and (ancienY>Y) then begin xn:=x-1;yn:=y-1;end; + // on vient de NO + if (ancienXY) then begin xn:=x+1;yn:=y-1;end; + // on vient d'en haut à droite + if (ancienX>x) and (ancienYx) and (ancienY>y) then + begin + // on vient de SE + ancienX:=x;ancienY:=y; + y:=y-1;x:=x-1; + // essayer droit + el_tco(x,y,ir); + // essayer dévié + if not(memtrouve) then + begin + AncienY:=y+1; + AncienX:=x+1; + x:=x+1; + el_tco(x,y,ir); // nouvelle itération + end; + end; + end; + 34 : begin + // on vient du N ou NE + if (ancienX>=x) and (ancienYy) then + begin + ancienX:=x;ancienY:=y; + y:=y-1;x:=x+1; + // essayer droit + el_tco(x,y,ir); + // essayer dévié + if not(memtrouve) then + begin + AncienY:=y+1; + AncienX:=x-1; + x:=x-1; + el_tco(x,y,ir); // nouvelle itération + end; + end; + end; + + else + + begin + // fausse route, sortir + if DebugTCO then + AfficheDebug('Sortie de calcul route TCO par élement '+intToSTR(Bimage)+' inconnu en x='+intToSTR(x)+' y='+intToSTR(y)+' sur route '+intToSTR(det1)+' à '+intToSTR(det2),clOrange); + sortir:=true; + end; + end; + + inc(i); + if (adresse=det2) then memTrouve:=true; + if ((Bimage=1) or (Bimage=20) or (Bimage=10) or (Bimage=11)) and ((adresse<>det2) and (adresse<>det1) and (adresse<>0)) then sortir:=true; + if (i>200) or (iteration>200) then sortir:=true; + Maj_coords(AncienX,AncienY,x,y); + + until sortir or memtrouve; + + //mémoriser l'index de route si on a trouvé det2, et uniquement sur la première itération quand on l'a trouvé + if memTrouve and not(indextrouve) then + begin + indexTrouve:=true; + indexIr:=ir-1; + end; + if i>200 then Affiche('Erreur 487 : limite d''itérations TCO',clred); + if iteration>200 then Affiche('Erreur 488 : limite de récursivité TCO',clred); +end; + + +// Début de la procédure zone_tco +begin + if debugTCO then AfficheDebug('Zone_TCO det1='+intToSTR(det1)+' det2='+intToSTR(det2)+' mode='+intToSTR(mode),clyellow); + trouve_det(indexTCO,det1,Xdet1,Ydet1); + if (Xdet1=0) or (Ydet1=0) then exit; + + memtrouve:=false; + indextrouve:=false; + + Direction:=1; // on teste 4 directions: 1=SE 2=NO 3=SO 4=NE + + repeat // boucle de test de direction + sortir:=false; + x:=xDet1;y:=Ydet1; + xn:=x;yn:=y; + ir:=1; // index de la route du tco + i:=0; // itérations + if debugTCO then afficheDebug('Direction '+intToSTR(direction),clOrange); + + // initialiser les points d'où l'on vient + if direction=1 then + begin + // vers SE + ancieny:=ydet1+1; + ancienx:=xdet1+1; + end; + if direction=2 then + begin + // vers NO + ancieny:=ydet1-1; + ancienx:=xdet1-1; + end; + if direction=3 then + begin + // SO + ancieny:=ydet1+1; + ancienx:=xdet1-1; + end; + if direction=4 then + begin + // vers NE + ancieny:=ydet1-1; + ancienx:=xdet1+1; + end; + + + if debugTCO then AfficheDebug('X='+intToSTR(x)+' Y='+IntToSTR(Y)+' AncienX='+intToSTR(ancienX)+' AncienY='+IntToSTR(ancienY),clyellow); + + // Affiche la cellule en fonction du mode + iteration:=0; + ir:=1; + El_tco(x,y,ir); // trouve l'élément suivant, et explore les ports de l'aiguillage en récursif + + inc(i); + if (adresse=det2) then memTrouve:=true; + if ((Bimage=1) or (Bimage=20) or (Bimage=10) or (Bimage=11)) and ((adresse<>det2) and (adresse<>det1) and (adresse<>0)) then sortir:=true; + + if (i>NbCellulesTCO[indexTCO]) then AfficheDebug('Erreur 1000 TCO : dépassement d''itérations - Route de '+IntToSTR(det1)+' à '+IntToSTR(det2),clred); + inc(direction) + until (direction=5) or memtrouve ; + + if memTrouve then + begin + if debugTco then afficheDebug('TCO: Trouvé route de '+intToSTR(det1)+' à '+intToSTR(det2)+' en '+intToSTR(x)+','+intToSTR(y),clLime); + Affiche_trajet(indexTCO,indexIr,mode); // affiche le trajet dans le TCO + end; +end; + +// allume ou éteint (mode=0 ou 1) la voie, zone de det1 à det2 sur le TCO +// si mode=0 : éteint +// =1 : couleur détecteur allumé +// =2 : couleur de l'index train +// nécessite que les aiguillages aoient bien positionnés entre det1 et det2 +procedure zone_TCO_ancien(indexTCO,det1,det2,mode: integer); var direction,i,j,x,y,xn,yn,ancienY,ancienX,Xdet1,Ydet1,Xdet2,Ydet2,Bimage,adresse, - pos,pos2,ir,ax,ay,sx,sy: integer; + pos,pos2,ir,ay,sx,sy: integer; memtrouve,sortir,horz,diag,casok : boolean; mdl : Tequipement; s : string; @@ -8684,28 +9566,28 @@ begin // initialiser les points d'où l'on vient if direction=1 then begin - // descendre et à droite + // vers SE casok:=true; ancieny:=ydet1+1; ancienx:=xdet1+1; end; if direction=2 then begin - // monter et à gauche + // vers NO casok:=true; ancieny:=ydet1-1; ancienx:=xdet1-1; end; if direction=3 then begin - // commencer par descendre et à gauche + // SO casok:=true; ancieny:=ydet1+1; ancienx:=xdet1-1; end; if direction=4 then begin - // commencer par monter et à droite + // vers NE casok:=true; ancieny:=ydet1-1; ancienx:=xdet1+1; @@ -8742,7 +9624,11 @@ begin //if debugTCO then AfficheDebug('El 2',clyellow); pos:=positionTCO(indexTCO,x,y); if (ancienXx) and (ancienY=Y) then begin xn:=x-1;if pos=const_devie then yn:=y+1;end; + if (ancienX>x) and (ancienY=Y) then + begin + xn:=x-1; + if pos=const_devie then yn:=y+1; + end; if (ancienXy) then begin xn:=x+1; end; if (pos=const_inconnu) then begin Erreur_TCO(indexTCO,x,y);sortir:=true;end; end; @@ -9284,104 +10170,8 @@ begin if DebugTCO then AfficheDebug('trouvé liaison de '+IntToSTR(det1)+' à '+IntToSTR(det2),clLime); dec(ir); - // et affichage de la route - for i:=1 to ir do - begin - x:=routetco[i].x; - y:=routetco[i].y; - tco[Indextco,x,y].mode:=mode;//zizi //mode; // pour la couleur - TCO[IndexTCO,x,y].train:=index_couleur; - //Affiche(intToSTR(x)+' '+intToSTR(y),clorange); + Affiche_trajet(indexTCO,ir,mode); - bimage:=tco[indextco,x,y].BImage; - adresse:=tco[indextco,x,y].Adresse; - tco[indextco,x,y].trajet:=0; - - // croisement - if (bimage=21) and (i>1) then - begin - j:=index_aig(adresse); - mdl:=aiguillage[j].modele; - ax:=routetco[i-1].x; - ay:=routetco[i-1].y; - sx:=routetco[i+1].x; // suivant - sy:=routetco[i+1].y; - tco[indextco,x,y].trajet:=0; - if (ax-x=-1) and (ay-y=0) and (sx-x=1) and (sy-y=0) then tco[indextco,x,y].trajet:=1; // de gauche à droite - if (ax-x=1) and (ay-y=0) and (sx-x=-1) and (sy-y=0) then tco[indextco,x,y].trajet:=1; // de droite à gauche - if (ax-x=-1) and (ay-y=1) and (sx-x=1) and (sy-y=-1) then tco[indextco,x,y].trajet:=2; // de bas gauche vers haut droit - if (ax-x=1) and (ay-y=-1) and (sx-x=-1) and (sy-y=1) then tco[indextco,x,y].trajet:=2; // de haut droit vers bas gauche - if (ax-x=-1) and (ay-y=0) and (sx-x=1) and (sy-y=-1) then tco[indextco,x,y].trajet:=4; // de gauche vers haut droite - if (ax-x=1) and (ay-y=-1) and (sx-x=-1) and (sy-y=0) then tco[indextco,x,y].trajet:=4; // de haut droite vers gauche - if (ax-x=-1) and (ay-y=1) and (sx-x=1) and (sy-y=0) then tco[indextco,x,y].trajet:=3; // de bas gauche vers droite - if (ax-x=1) and (ay-y=0) and (sx-x=-1) and (sy-y=1) then tco[indextco,x,y].trajet:=3; // de gauche vers haut droite - if tco[indextco,x,y].trajet=0 then affiche('Erreur 70 TCO - Cellule '+intToSTR(x)+','+intToSTR(y),clred); - end; - - // croisement - if (bimage=22) and (i>1) then - begin - j:=index_aig(adresse); - mdl:=aiguillage[j].modele; - ax:=routetco[i-1].x; // précédent - ay:=routetco[i-1].y; - sx:=routetco[i+1].x; // suivant - sy:=routetco[i+1].y; - tco[indextco,x,y].trajet:=0; - if (ax-x=-1) and (ay-y=0) and (sx-x=1) and (sy-y=0) then tco[indextco,x,y].trajet:=1; // de gauche à droite - if (ax-x=1) and (ay-y=0) and (sx-x=-1) and (sy-y=0) then tco[indextco,x,y].trajet:=1; // de droite à gauche - if (ax-x=-1) and (ay-y=-1) and (sx-x=1) and (sy-y=1) then tco[indextco,x,y].trajet:=2; // de haut gauche vers bas droit - if (ax-x=1) and (ay-y=1) and (sx-x=-1) and (sy-y=-1) then tco[indextco,x,y].trajet:=2; // de bas droit vers haut gauche - if (ax-x=1) and (ay-y=0) and (sx-x=-1) and (sy-y=-1) then tco[indextco,x,y].trajet:=3; // de droit vers en haut à gauche - if (ax-x=-1) and (ay-y=-1) and (sx-x=1) and (sy-y=0) then tco[indextco,x,y].trajet:=3; // de haut à gauche vers droit - if (ax-x=1) and (ay-y=1) and (sx-x=-1) and (sy-y=0) then tco[indextco,x,y].trajet:=4; // de bas à droite vers gauche - if (ax-x=-1) and (ay-y=0) and (sx-x=1) and (sy-y=1) then tco[indextco,x,y].trajet:=4; // de gauche vers en bas a droite - if tco[indextco,x,y].trajet=0 then affiche('Erreur 71 TCO - Cellule '+intToSTR(x)+','+intToSTR(y),clred); - end; - - // croisement - if (bimage=23) and (i>1) then - begin - j:=index_aig(adresse); - mdl:=aiguillage[j].modele; - ax:=routetco[i-1].x; // précédent - ay:=routetco[i-1].y; - sx:=routetco[i+1].x; // suivant - sy:=routetco[i+1].y; - tco[indextco,x,y].trajet:=0; - if (ax-x=0) and (ay-y=-1) and (sx-x=0) and (sy-y=1) then tco[indextco,x,y].trajet:=1; // de haut à bas - if (ax-x=0) and (ay-y=1) and (sx-x=0) and (sy-y=-1) then tco[indextco,x,y].trajet:=1; // de bas à haut - if (ax-x=1) and (ay-y=-1) and (sx-x=-1) and (sy-y=1) then tco[indextco,x,y].trajet:=2; // de haut droit vers bas gauche - if (ax-x=-1) and (ay-y=1) and (sx-x=1) and (sy-y=-1) then tco[indextco,x,y].trajet:=2; // de bas gauche vers haut droit - if (ax-x=1) and (ay-y=-1) and (sx-x=0) and (sy-y=1) then tco[indextco,x,y].trajet:=3; // de haut droit vers bas - if (ax-x=0) and (ay-y=1) and (sx-x=1) and (sy-y=-1) then tco[indextco,x,y].trajet:=3; // de bas vers haut droit - if (ax-x=0) and (ay-y=-1) and (sx-x=-1) and (sy-y=1) then tco[indextco,x,y].trajet:=4; // de haut vers bas gauche - if (ax-x=-1) and (ay-y=1) and (sx-x=0) and (sy-y=-1) then tco[indextco,x,y].trajet:=4; // de bas gauche vers haut - if tco[indextco,x,y].trajet=0 then affiche('Erreur 72 TCO - Cellule '+intToSTR(x)+','+intToSTR(y),clred); - end; - - // croisement - if (bimage=25) and (i>1) then - begin - j:=index_aig(adresse); - mdl:=aiguillage[j].modele; - ax:=routetco[i-1].x; // précédent - ay:=routetco[i-1].y; - sx:=routetco[i+1].x; // suivant - sy:=routetco[i+1].y; - tco[indextco,x,y].trajet:=0; - if (ax-x=0) and (ay-y=-1) and (sx-x=0) and (sy-y=1) then tco[indextco,x,y].trajet:=1; // de haut à bas - if (ax-x=0) and (ay-y=1) and (sx-x=0) and (sy-y=-1) then tco[indextco,x,y].trajet:=1; // de bas à haut - if (ax-x=-1) and (ay-y=-1) and (sx-x=1) and (sy-y=1) then tco[indextco,x,y].trajet:=2; // de haut gauche vers bas droit - if (ax-x=1) and (ay-y=1) and (sx-x=-1) and (sy-y=-1) then tco[indextco,x,y].trajet:=2; // de bas droit vers haut gauche - if (ax-x=-1) and (ay-y=1) and (sx-x=0) and (sy-y=1) then tco[indextco,x,y].trajet:=3; // de haut gauche vers bas - if (ax-x=0) and (ay-y=1) and (sx-x=-1) and (sy-y=-1) then tco[indextco,x,y].trajet:=3; // de bas vers haut gauche - if (ax-x=0) and (ay-y=-1) and (sx-x=1) and (sy-y=1) then tco[indextco,x,y].trajet:=4; // de haut vers bas droite - if (ax-x=-1) and (ay-y=1) and (sx-x=0) and (sy-y=-1) then tco[indextco,x,y].trajet:=4; // de bas droit vers haut - if tco[indextco,x,y].trajet=0 then affiche('Erreur 73 TCO - Cellule '+intToSTR(x)+','+intToSTR(y),clred); - end; - Affiche_cellule(indexTCO,x,y); - end; end; @@ -9961,6 +10751,7 @@ begin tco[indextco,XclicCell[indexTCO],YClicCell[indexTCO]].epaisseurs:=0; tco[indextco,XclicCell[indexTCO],YClicCell[indexTCO]].buttoir:=0; tco[indextco,XclicCell[indexTCO],YClicCell[indexTCO]].pont:=0; + tco[indextco,XclicCell[indexTCO],YClicCell[indexTCO]].sortie:=0; tco[indextco,XclicCell[indexTCO],YClicCell[indexTCO]].Texte:=''; efface_entoure(indexTCO); @@ -9989,6 +10780,7 @@ begin tco[indextco,x,y].epaisseurs:=0; tco[indextco,x,y].pont:=0; tco[indextco,x,y].buttoir:=0; + tco[indextco,x,y].sortie:=0; tco[indextco,x,y].liaisons:=0; tco[indextco,x,y].epaisseurs:=0; tco[indextco,x,y].pont:=0; @@ -11170,6 +11962,12 @@ begin BringToFront; end; if (i=3) and (CDMhd<>0) then begin ShowWindow(CDMhd,SW_MAXIMIZE);end; + // action + if i=4 then + begin + // pilotage impulsionnel + pilote_acc(tco[indextco,xclic,yclic].Adresse,tco[indextco,xclic,yclic].sortie,AigP); + end; end; TempoSouris:=2 ; // démarre la tempo souris @@ -11701,10 +12499,10 @@ begin tco[indextco,XClic,YClic].epaisseurs:=0; tco[indextco,XClic,YClic].pont:=0; tco[indextco,XClic,YClic].buttoir:=0; + tco[indextco,Xclic,YClic].sortie:=0; tco[indextco,XClic,YClic].FeuOriente:=1; tco[indextco,XClic,YClic].PiedFeu:=1; tco[indextco,XClic,YClic].coulFonte:=clWhite; - tco[indextco,XClic,YClic].x:=0; tco[indextco,XClic,YClic].y:=0; // ne pas convertir l'adresse sinon evt changement du composant et on écrase l'aspect EditAdrElement.Text:=IntToSTR( tco[indextco,XClicCell,YClicCell].Adresse); @@ -12586,6 +13384,7 @@ begin tco[indextco,x,NbreCellY[indexTCO]].PiedFeu:=0; tco[indextco,x,NbreCellY[indexTCO]].FeuOriente:=0; tco[indextco,x,NbreCellY[indexTCO]].Buttoir:=0; + tco[indextco,x,NbreCellY[indexTCO]].Sortie:=0; tco[indextco,x,NbreCellY[indexTCO]].epaisseurs:=0; tco[indextco,x,NbreCellY[indexTCO]].Pont:=0; end; @@ -12621,6 +13420,9 @@ begin tco[indextco,XClicCell[indexTCO],y].Couleurfond:=Clfond[IndexTCO]; tco[indextco,XClicCell[indexTCO],y].PiedFeu:=0; tco[indextco,XClicCell[indexTCO],y].FeuOriente:=0; + tco[indextco,xClicCell[indexTCO],y].Buttoir:=0; + tco[indextco,xClicCell[indexTCO],y].sortie:=0; + end; inc(NbreCellX[indexTCO]); affiche_TCO(indexTCO); @@ -12654,6 +13456,8 @@ begin tco[indextco,XClicCell[indexTCO]+1,y].Couleurfond:=Clfond[IndexTCO]; tco[indextco,XClicCell[indexTCO]+1,y].PiedFeu:=0; tco[indextco,XClicCell[indexTCO]+1,y].FeuOriente:=0; + tco[indextco,XClicCell[indexTCO]+1,y].sortie:=0; + tco[indextco,XClicCell[indexTCO]+1,y].Buttoir:=0; end; inc(NbreCellX[indexTCO]); affiche_TCO(indexTCO); @@ -12702,6 +13506,8 @@ begin tco[indextco,NbreCellx[indexTCO],y].CouleurFond:=Clfond[IndexTCO]; tco[indextco,NbreCellx[indexTCO],y].PiedFeu:=0; tco[indextco,NbreCellx[indexTCO],y].FeuOriente:=0; + tco[indextco,NbreCellx[indexTCO],y].Buttoir:=0; + tco[indextco,NbreCellx[indexTCO],y].Sortie:=0; end; dec(NbreCellX[indexTCO]); @@ -13081,7 +13887,7 @@ end; procedure TFormTCO.ImagePalette52EndDrag(Sender, Target: TObject; X, Y: Integer); begin - end_drag(id_action,x,y,sender,target); + end_drag(id_action,x,y,sender,target); end; procedure TFormTCO.ImagePalette52MouseDown(Sender: TObject; diff --git a/verif_version.pas b/verif_version.pas index 4ef6aff..8a4a48f 100644 --- a/verif_version.pas +++ b/verif_version.pas @@ -25,7 +25,7 @@ var verifVersion,notificationVersion : boolean; date_creation,nombre_tel : string; -Const Version='8.26'; // sert à la comparaison de la version publiée +Const Version='8.27'; // sert à la comparaison de la version publiée SousVersion=' '; // A B C ... en cas d'absence de sous version mettre un espace function GetCurrentProcessEnvVar(const VariableName: string): string; diff --git a/versions.txt b/versions.txt index 38091c0..b49d2ef 100644 --- a/versions.txt +++ b/versions.txt @@ -201,5 +201,9 @@ version 8.25 : Int Intégration d'un menu dans la fenêtre du TCO. version 8.26 : Amélioration de l'affichage du suivi des trains dans les TCOs. Restitution du Zoom du TCO lors de sa sauvegarde. +version 8.27 : Nouvel algorithme de suivi des trains dans les TCO. + Correction suivi de deux trains consécutifs. + Création d'une action TCO "pilotage d'accessoire" +