diff --git a/ConfigGenerale.cfg b/ConfigGenerale.cfg index dc8a56e..c362603 100644 --- a/ConfigGenerale.cfg +++ b/ConfigGenerale.cfg @@ -1,15 +1,15 @@ -/ Fichier de configuration de signaux_complexes_GL version 7.0 +/ Fichier de configuration de signaux_complexes_GL version 7.1 AvecVerifIconesTCO=1 Algo_localisation=1 Avec_roulage=1 Debug=0 Filtrage_det=0 AntiTimeoutEthLenz=0 -Fonte=10 +Fonte=12 Protocole=1 Verif_AdrXpressNet=1 IpV4_PC=127.0.0.1:9999 -ServicesCDM=15 +ServicesCDM=7 Ipv4_interface=192.168.1.23:5550 MaxCom=30 Protocole_serie=COMX:115200,N,8,1,0 @@ -29,7 +29,7 @@ TCO=0 MasqueBandeauTCO=0 CDM=0 Lay=RESEAU_GILY_SIGNAL_AJOUTE.LAY -NomModuleCDM=reseau_gily_signal_ajoute_top.cdm +NomModuleCDM=RESEAU_GILY_SIGNAL_AJOUTE.cdm Serveur_interface=1 retro=1 RazSignaux=0 @@ -38,12 +38,12 @@ 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) 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) 9,P526,D103D,S515,V60,I0,INIT(1,2) @@ -91,13 +91,23 @@ A31,A34,0 0 /------------ [section_decodeurs] -Personnalisé 1 +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] @@ -105,8 +115,7 @@ Nation=1 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 -520,9,1,1,(518,A1),1,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 @@ -123,6 +132,7 @@ Nation=1 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),0,FVC0,FRC0,(A1S,A3S,A5S),CFB(A1S,A3D,A4D,A6S) 600,7,0,0,(521,A8),1,FVC0,FRC0 0 /------------ diff --git a/Notice d'utilisation des signaux_complexes_GL_V7.0.pdf b/Notice d'utilisation des signaux_complexes_GL_V7.1.pdf similarity index 78% rename from Notice d'utilisation des signaux_complexes_GL_V7.0.pdf rename to Notice d'utilisation des signaux_complexes_GL_V7.1.pdf index dc11eb5..9323f67 100644 Binary files a/Notice d'utilisation des signaux_complexes_GL_V7.0.pdf and b/Notice d'utilisation des signaux_complexes_GL_V7.1.pdf differ diff --git a/Signaux_complexes_GL.cfg b/Signaux_complexes_GL.cfg index 1e45cf1..e9e902f 100644 --- a/Signaux_complexes_GL.cfg +++ b/Signaux_complexes_GL.cfg @@ -14,8 +14,8 @@ -$N+ -$O- -$P+ --$Q- --$R- +-$Q+ +-$R+ -$S- -$T- -$U- diff --git a/Signaux_complexes_GL.dof b/Signaux_complexes_GL.dof index 2a4eebc..f78f51d 100644 --- a/Signaux_complexes_GL.dof +++ b/Signaux_complexes_GL.dof @@ -17,8 +17,8 @@ M=0 N=1 O=0 P=1 -Q=0 -R=0 +Q=1 +R=1 S=0 T=0 U=0 diff --git a/UnitAnalyseSegCDM.pas b/UnitAnalyseSegCDM.pas index 73a6f12..769403a 100644 --- a/UnitAnalyseSegCDM.pas +++ b/UnitAnalyseSegCDM.pas @@ -574,7 +574,6 @@ begin exit; end; - //turnout_3way if segType='turnout_sym' then begin s2:=isole_valeur(s,'radius:'); @@ -827,7 +826,7 @@ begin end; -// trouve si le point (x,y) est sur le segment x1,y1 x2,y2 +// trouve si le point (x,y) est sur le segment (droit) x1,y1 x2,y2 // s*l = distance du point au segment function point_Sur_Segment(x,y,x1,y1,x2,y2 : integer): Boolean; var l,r,s : Double; @@ -4173,8 +4172,7 @@ begin end; procedure TFormAnalyseCDM.ButtonAnimeClick(Sender: TObject); -var bmp : tbitmap; - zom,ang : single; +var zom,ang : single; x,y : integer; begin x:=100;y:=200; diff --git a/UnitCDF.pas b/UnitCDF.pas index 9b88d95..358b4df 100644 --- a/UnitCDF.pas +++ b/UnitCDF.pas @@ -103,7 +103,7 @@ procedure TFormCDF.FormActivate(Sender: TObject); var erreur : integer; begin Val(FormConfig.EditAdrSig.text,Adresse,erreur); - index:=index_feu(Adresse); + index:=index_Signal(Adresse); LabelTitre.caption:='Adresse du signal: '+intToSTR(adresse); erreur:=feux[index].decodeur; feux[0]:=feux[index]; diff --git a/UnitConfig.dfm b/UnitConfig.dfm index 8ff4b0f..21e171e 100644 --- a/UnitConfig.dfm +++ b/UnitConfig.dfm @@ -1,6 +1,6 @@ object FormConfig: TFormConfig - Left = 332 - Top = 149 + Left = 319 + Top = 128 Hint = 'Modifie la configuration selon les s'#233'lections choisies' BorderStyle = bsDialog Caption = 'Configuration g'#233'n'#233'rale' @@ -1571,7 +1571,7 @@ object FormConfig: TFormConfig Top = 8 Width = 633 Height = 497 - ActivePage = TabSheetSig + ActivePage = TabSheetAct Font.Charset = DEFAULT_CHARSET Font.Color = clBlack Font.Height = -11 @@ -1584,7 +1584,7 @@ object FormConfig: TFormConfig Caption = 'CDM Rail' object Label36: TLabel Left = 24 - Top = 456 + Top = 448 Width = 369 Height = 13 Caption = @@ -2029,7 +2029,7 @@ object FormConfig: TFormConfig ImageIndex = 1 object Label9: TLabel Left = 16 - Top = 456 + Top = 448 Width = 294 Height = 13 Caption = 'Ces param'#232'tres sont utilis'#233's en fonctionnement sans CDM Rail' @@ -3182,7 +3182,7 @@ object FormConfig: TFormConfig Width = 129 Height = 21 Style = csDropDownList - ItemHeight = 13 + ItemHeight = 0 TabOrder = 1 OnChange = ComboBoxDecChange end @@ -3286,7 +3286,7 @@ object FormConfig: TFormConfig Width = 129 Height = 21 Style = csDropDownList - ItemHeight = 13 + ItemHeight = 0 TabOrder = 2 OnChange = ComboBoxAspChange end @@ -3930,7 +3930,7 @@ object FormConfig: TFormConfig object EditTempo: TEdit Left = 112 Top = 38 - Width = 33 + Width = 41 Height = 21 TabOrder = 0 OnChange = EditTempoChange @@ -3997,7 +3997,7 @@ object FormConfig: TFormConfig end end object GroupBoxPN: TGroupBox - Left = 152 + Left = 200 Top = 16 Width = 233 Height = 401 diff --git a/UnitConfig.pas b/UnitConfig.pas index b5f5cb3..42df17d 100644 --- a/UnitConfig.pas +++ b/UnitConfig.pas @@ -2475,7 +2475,7 @@ end; // compile les décodeurs personnalisés procedure compile_dec_pers; -var nv,i,j,k,l,adr : integer; +var nv,j,k,l,adr : integer; begin Nligne:=1; repeat // boucle de décodeurs @@ -2665,8 +2665,8 @@ begin begin trains[i].x:=-999999; trains[i].y:=-999999; - end; - + end; + end; // trie les signaux @@ -3592,7 +3592,7 @@ procedure clicListeSignal(lc : integer); var AncAdresse,index,adresse,erreur : integer; s : string; begin - index:=index_feu(lc)-1; + index:=index_Signal(lc)-1; s:=Uppercase(FormConfig.RichSig.Lines[index]); // ligne cliquée if s='' then begin @@ -3936,7 +3936,6 @@ begin ComboTS1[i].Visible:=false; ComboTS2[i].Visible:=false; ShapeT[i].Visible:=false; - end; end; end; @@ -4057,8 +4056,6 @@ begin Style:=csDropDownList; onChange:=formConfig.modif_ComboTS; end; - - end; for i:=1 to NbreDecPers do @@ -4084,7 +4081,7 @@ var erreur,i : integer; begin if s='' then begin B:='?';adr:=0;exit;end; if (s[1]='P') or (s[1]='S') or (s[1]='D') then delete(s,1,1); - if s='' then + if s='' then begin adr:=0; B:='Z'; @@ -4168,7 +4165,7 @@ begin else LabelInfo.Caption:='Nombre d''états de la TJD/S inconnu'; end; - if tjs then + if tjs then begin ComboBoxAig.ItemIndex:=2; EditL.Visible:=true; @@ -4209,7 +4206,7 @@ begin // milieu haut gauche EditP1.Text:=intToSTR(adresse)+aiguillage[Index].DDroitB; // milieu bas gauche - EditP2.Text:=intToSTR(adresse)+aiguillage[Index].DDevieB; + EditP2.Text:=intToSTR(adresse)+aiguillage[Index].DDevieB; // milieu haut droit EditP3.Text:=intToSTR(aiguillage[index].Ddevie)+aiguillage[index].DDevieB; @@ -4233,7 +4230,7 @@ begin begin // droit haut EditDevie_HD.Text:=intToSTR(aiguillage[index].Ddevie)+aiguillage[index].DdevieB; - EditDevie_HD.Hint:=TypeElAIg_to_char(aiguillage[index].Ddevie,aiguillage[index].DdevieB); + EditDevie_HD.Hint:=TypeElAIg_to_char(aiguillage[index].Ddevie,aiguillage[index].DdevieB); LabelTJD1.Caption:=IntToSTR(adresse); // droit bas @@ -4267,7 +4264,7 @@ begin labelTJD2.Visible:=false; labelcrois.Visible:=true; end; - + // aiguillage normal ou tri if (not(tjd) and not(tjs) and not(croi)) or tri then begin @@ -4275,12 +4272,12 @@ begin Label20.Visible:=false; LabelL.Visible:=false; ComboBoxAig.ItemIndex:=0; - if not(tri) then + if not(tri) then begin ImageAffiche.Picture.BitMap:=Imageaig.Picture.Bitmap; EditDevieS2.Visible:=false; EditAigTriple.Visible:=false; - end; + end; labelBG.Caption:='P'; EditPointe_BG.ReadOnly:=false; Edit_HG.Visible:=false; @@ -4291,7 +4288,7 @@ begin EditP4.Visible:=false; labelTJD1.Visible:=false; LabelTJD2.Visible:=false; - + Label18.Visible:=false; CheckInverse.checked:=aiguillage[Index_Aig(adresse)].inversionCDM=1; if aiguillage[Index].vitesse=0 then begin RadioButtonSans.checked:=true;RadioButton30kmh.checked:=false;RadioButtonSpecifique.checked:=false;RadioButton60kmh.checked:=false;end @@ -4302,18 +4299,17 @@ begin else begin RadioButtonSans.checked:=false;RadioButton30kmh.checked:=false;RadioButtonSpecifique.checked:=true;RadioButton60kmh.checked:=false;end ; - EditPointe_BG.Text:=intToSTR(aiguillage[index].Apointe)+aiguillage[index].ApointeB; EditPointe_BG.Hint:=TypeElAIg_to_char(aiguillage[index].Apointe,aiguillage[index].ApointeB); EditDevie_HD.Text:=intToSTR(aiguillage[index].Adevie)+aiguillage[index].AdevieB; - EditDevie_HD.Hint:=TypeElAIg_to_char(aiguillage[index].Adevie,aiguillage[index].AdevieB); + EditDevie_HD.Hint:=TypeElAIg_to_char(aiguillage[index].Adevie,aiguillage[index].AdevieB); EditDroit_BD.Text:=intToSTR(aiguillage[index].Adroit)+aiguillage[index].AdroitB; EditDroit_BD.Hint:=TypeElAIg_to_char(aiguillage[index].Adroit,aiguillage[index].AdroitB); - if tri then + if tri then begin - ComboBoxAig.ItemIndex:=3; // 0=n'existe pas 1=aiguillage 2=TJD 3=TJS 4=aiguillage triple + ComboBoxAig.ItemIndex:=3; // index de la combobox 0=aiguillage 1=TJD 2=TJS 3=aiguillage triple EditAigTriple.Visible:=true; labelTJD1.Visible:=false; LabelTJD2.Visible:=false; @@ -4327,7 +4323,7 @@ begin i:=aiguillage[index].Adrtriple; EditAigTriple.Text:=intToSTR(i); if i=0 then EditAigTriple.Color:=clred else EditAigTriple.Color:=clWindow; - end; + end; end; end; @@ -4337,7 +4333,7 @@ begin if position=const_devie then formconfig.ComboBoxDD.ItemIndex:=0; formconfig.EditTempo10.text:=InttoSTr(aiguillage[index].temps); formconfig.EditTempo10.text:=InttoSTr(aiguillage[index].temps); - + clicListe:=false; end; @@ -4691,7 +4687,7 @@ begin EditDet4.Text:=IntToSTR(j);EditSuiv4.Text:=TypeEl_To_char(feux[i].Btype_suiv4)+IntToSTR(feux[i].Adr_el_suiv4); EditSuiv4.Hint:=chaine_element(feux[i].Btype_suiv4,feux[i].Adr_el_suiv4); end - else begin EditDet4.Text:='';EditSuiv4.Text:='';EditSuiv4.Hint:='';end; + else begin EditDet4.Text:='';EditSuiv4.Text:='';EditSuiv4.Hint:='';end; checkVerrouCarre.Checked:=feux[i].VerrouCarre; checkBoxFB.Checked:=feux[i].FeuBlanc; @@ -4843,23 +4839,6 @@ begin if Tablo_actionneur[i].act then begin champs_type_act; - { - case typ of - 0 : with formconfig do - begin - //radioButtonActDet.Checked:=true; - //radioButtonZones.Checked:=false; - //editAct2.Visible:=false; - end; - 1 : with formconfig do - begin - end; - 2 : with formconfig do - begin - end; - end; - } - etatAct:=Tablo_actionneur[i].etat ; Adresse:=Tablo_actionneur[i].adresse; sortie:=Tablo_actionneur[i].sortie; @@ -4889,7 +4868,7 @@ begin radioButtonActDet.Checked:=true; radioButtonZones.Checked:=false; editAct2.Visible:=false; - LabelActionneur.Caption:='Actionneur Détecteur'; + LabelActionneur.Caption:='Actionneur Détecteur'; end; if typ=1 then with formconfig do begin @@ -5048,7 +5027,7 @@ begin end; end end; - + procedure raz_champs_act; begin with formConfig do @@ -5351,7 +5330,7 @@ begin s:=encode_aig(index); formconfig.RichAig.Lines[index-1]:=s; end; - + end; end; @@ -6085,7 +6064,6 @@ begin Suiv4; end; - procedure TFormConfig.EditActChange(Sender: TObject); var s,s2 : string; act,erreur,det2,suiv : integer; @@ -6302,7 +6280,7 @@ begin if ligneClicAct<0 then exit; if FormConfig.PageControl.ActivePage=FormConfig.TabSheetAct then with Formconfig do - begin + begin if radioButtonLoc.Checked or RadioButtonAccess.Checked or RadioButtonSon.Checked then begin fichier:=EditSon.Text; @@ -6432,7 +6410,7 @@ begin EditAdrSig.Color:=clred; LabelInfo.caption:='Erreur adresse signal ';exit; end; - if (index_feu(i)<>0) then + if (index_Signal(i)<>0) then begin EditAdrSig.Color:=clred; LabelInfo.caption:='Signal '+intToSTR(i)+' existe, il ne sera pas écrasé';exit; @@ -6567,7 +6545,7 @@ begin for y:=1 to NbreCellY do for x:=1 to NbreCellX do begin - if TCO[x,y].BImage=30 then + if TCO[x,y].BImage=50 then begin AdresseFeu:=feux[index].adresse; if tco[x,y].Adresse=AdresseFeu then affiche_tco; @@ -6626,7 +6604,7 @@ begin end; procedure TFormConfig.RadioButtonLocClick(Sender: TObject); -var champ,i,erreur : integer; +var champ,i,erreur : integer; s : string; begin // rendre visible le groupbox Actionneur fonction F loco @@ -6637,8 +6615,8 @@ begin Tablo_Actionneur[i].loco:=true; Tablo_Actionneur[i].Act:=false; Tablo_Actionneur[i].Son:=false; - champs_type_loco; - + champs_type_loco; + val(editact.Text,champ,erreur); Tablo_actionneur[i].adresse:=champ ; val(editEtatActionneur.Text,champ,erreur); @@ -6698,7 +6676,7 @@ begin Tablo_Actionneur[i].loco:=false; Tablo_Actionneur[i].Act:=false; Tablo_Actionneur[i].Son:=true; - + champs_type_son; val(editact.Text,champ,erreur); @@ -7499,7 +7477,7 @@ function nombre_adresses_signal(adr : integer) : integer; var x,dec,nc,i,j : integer; begin nc:=0; - i:=index_feu(adr); + i:=index_Signal(adr); dec:=feux[i].decodeur; x:=feux[i].aspect; @@ -8254,10 +8232,10 @@ begin for x:=1 to NbreCellX do begin i:=TCO[x,y].BImage; - if i=30 then + if i=50 then begin adr:=TCO[x,y].adresse; - if index_feu(adr)=0 then + if index_Signal(adr)=0 then begin Affiche('Un signal '+IntToSTR(adr)+' est déclaré dans le TCO['+intToSTR(x)+','+intToSTR(y)+'] mais absent de la configuration',clred); ok:=false; @@ -8374,7 +8352,6 @@ begin s:='Erreur 18: l''actionneur '+IntToSTR(Tablo_actionneur[i].adresse)+' est enclenché par les détecteurs '+intToSTR(adresse)+' ' +intToSTR(adresse2)+' qui ne sont pas contigus'; Affiche(s,clred); end; - end; end; diff --git a/UnitConfigCellTCO.pas b/UnitConfigCellTCO.pas index 85aebad..00a05dc 100644 --- a/UnitConfigCellTCO.pas +++ b/UnitConfigCellTCO.pas @@ -69,34 +69,36 @@ uses UnitPrinc; procedure actualise; var Bimage,oriente,piedFeu : integer; s : string; + ip : Timage; + r : trect; begin - Bimage:=tco[XClicCell,YClicCell].Bimage; + Bimage:=tco[XClicCell,YClicCell].Bimage; - if formConfCellTCOAff then + if formConfCellTCOAff then + begin + // si aiguillage, mettre à jour l'option de pilotage inverse + if (bimage=2) or (bimage=3) or (bimage=4) or (bimage=5) or (bimage=12) or (bimage=13) + or (bimage=14) or (bimage=15) or (bimage=24) then begin - // si aiguillage, mettre à jour l'option de pilotage inverse - if (bimage=2) or (bimage=3) or (bimage=4) or (bimage=5) or (bimage=12) or (bimage=13) - or (bimage=14) or (bimage=15) or (bimage=24) then - begin - // aiguillage inversé - with FormConfCellTCO.CheckPinv do - begin - enabled:=true; - checked:=TCO[XClicCell,YClicCell].inverse; - end; - FormTCO.CheckPinv.checked:=TCO[XClicCell,YClicCell].inverse; - FormTCO.CheckPinv.enabled:=true ; - end - else + // aiguillage inversé + with FormConfCellTCO.CheckPinv do begin - FormTCO.CheckPinv.enabled:=false; - FormConfCellTCO.checkPinv.enabled:=false; + enabled:=true; + checked:=TCO[XClicCell,YClicCell].inverse; end; + FormTCO.CheckPinv.checked:=TCO[XClicCell,YClicCell].inverse; + FormTCO.CheckPinv.enabled:=true ; + end + else + begin + FormTCO.CheckPinv.enabled:=false; + FormConfCellTCO.checkPinv.enabled:=false; end; + end; // si voie ou rien ou signal ou quai - if (Bimage=1) or (Bimage=0) or (Bimage=23) or (Bimage=31) or (Bimage=30) then + if (Bimage=1) or (Bimage=0) or (Bimage=50) or (Bimage=51) then begin s:=Tco[XClicCell,YClicCell].Texte; with formTCO do @@ -134,7 +136,7 @@ begin formConfCellTCO.EditTypeImage.Text:=intToSTR(Bimage); // si signal - if Bimage<30 then + if Bimage=50 then With formConfCellTCO.ImagePalette do begin Height:=FormTCO.ImagePalette1.Picture.Height; @@ -143,7 +145,7 @@ begin end; // si pas signal - if Bimage<>30 then + if Bimage<>50 then with formConfCellTCO do begin RadioButtonV.Enabled:=false; @@ -154,101 +156,95 @@ begin end; //mettre l'image de la cellule cliquée dans l'icone de la fenetre de config cellule - with formConfCellTCO.ImagePalette.Picture do - case Bimage of - 1: Assign(FormTCO.ImagePalette1.Picture); - 2: Assign(FormTCO.ImagePalette2.Picture); - 3: Assign(FormTCO.ImagePalette3.Picture); - 4: Assign(FormTCO.ImagePalette4.Picture); - 5: Assign(FormTCO.ImagePalette5.Picture); - 6: Assign(FormTCO.ImagePalette6.Picture); - 7: Assign(FormTCO.ImagePalette7.Picture); - 8: Assign(FormTCO.ImagePalette8.Picture); - 9: Assign(FormTCO.ImagePalette9.Picture); - 10: Assign(FormTCO.ImagePalette10.Picture); - 11: Assign(FormTCO.ImagePalette11.Picture); - 12: Assign(FormTCO.ImagePalette12.Picture); - 13: Assign(FormTCO.ImagePalette13.Picture); - 14: Assign(FormTCO.ImagePalette14.Picture); - 15: Assign(FormTCO.ImagePalette15.Picture); - 16: Assign(FormTCO.ImagePalette16.Picture); - 17: Assign(FormTCO.ImagePalette17.Picture); - 18: Assign(FormTCO.ImagePalette18.Picture); - 19: Assign(FormTCO.ImagePalette19.Picture); - 20: Assign(FormTCO.ImagePalette20.Picture); - 21: Assign(FormTCO.ImagePalette21.Picture); - 22: Assign(FormTCO.ImagePalette22.Picture); - 23,31: Assign(FormTCO.ImagePalette31.Picture); - 24: Assign(FormTCO.ImagePalette24.Picture); - 25: Assign(FormTCO.ImagePalette25.Picture); - 30: begin - With formConfCellTCO.ImagePalette do - begin - Height:=FormTCO.ImagePalette30.Height; - Width:=FormTCO.ImagePalette30.Width; + if Bimage=0 then + begin + with FormConfCellTCO.ImagePalette do + begin + r:=Rect(0,0,width,height); + with canvas do + begin + Pen.Mode:=pmCopy; + Pen.Width:=1; + Pen.color:=tco[XClicCell,YClicCell].CouleurFond; + Brush.Color:=tco[XClicCell,YClicCell].CouleurFond; + Brush.style:=bsSolid; + fillRect(r); + end; + end; - Picture.Assign(FormTCO.ImagePalette30.Picture); - Picture.Bitmap.TransparentMode:=tmAuto; - Picture.Bitmap.TransparentColor:=clblue; - Transparent:=true; - end; - with formconfCellTCO do - begin - RadioButtonV.Enabled:=true; - RadioButtonHG.Enabled:=true; - RadioButtonHD.Enabled:=true; - RadioButtonG.Enabled:=true; - RadioButtonD.Enabled:=true; - oriente:=tco[XClicCell,YClicCell].Feuoriente; - if oriente=1 then - begin - RadioButtonV.checked:=true; - RadioButtonHG.checked:=false; - RadioButtonHD.checked:=false; - end; - if oriente=2 then - begin + with formConfCellTCO do + begin + RadioButtonV.Enabled:=false; + RadioButtonHG.Enabled:=false; + RadioButtonHD.Enabled:=false; + RadioButtonG.Enabled:=false; + RadioButtonD.Enabled:=false; + end; + end + + else + + begin + ip:=formTCO.findComponent('ImagePalette'+intToSTR(Bimage)) as Timage; + if ip=nil then exit; + formConfCellTCO.ImagePalette.picture.Assign(ip.picture); + + if Bimage=50 then + begin // signal + With formConfCellTCO.ImagePalette do + begin + Height:=FormTCO.ImagePalette50.Height; + Width:=FormTCO.ImagePalette50.Width; + //Picture.Assign(FormTCO.ImagePalette50.Picture); + Picture.Bitmap.TransparentMode:=tmAuto; + Picture.Bitmap.TransparentColor:=clblue; + Transparent:=true; + end; + with formconfCellTCO do + begin + RadioButtonV.Enabled:=true; + RadioButtonHG.Enabled:=true; + RadioButtonHD.Enabled:=true; + RadioButtonG.Enabled:=true; + RadioButtonD.Enabled:=true; + oriente:=tco[XClicCell,YClicCell].Feuoriente; + if oriente=1 then + begin + RadioButtonV.checked:=true; + RadioButtonHG.checked:=false; + RadioButtonHD.checked:=false; + end; + if oriente=2 then + begin RadioButtonV.checked:=false; RadioButtonHG.checked:=true; RadioButtonHD.checked:=false; - end; - if oriente=3 then - begin - RadioButtonV.checked:=false; - RadioButtonHG.checked:=false; - RadioButtonHD.checked:=true; - end; + end; + if oriente=3 then + begin + RadioButtonV.checked:=false; + RadioButtonHG.checked:=false; + RadioButtonHD.checked:=true; + end; - PiedFeu:=tco[XClicCell,YClicCell].PiedFeu; - if PiedFeu=1 then - begin - RadioButtonG.checked:=true; - RadioButtonD.checked:=false; - end; - if PiedFeu=2 then - begin - RadioButtonG.checked:=false; - RadioButtonD.checked:=true; - end; - end; - end - else - begin - with formConfCellTCO do - begin - ImagePalette.Picture:=nil; - RadioButtonV.Enabled:=false; - RadioButtonHG.Enabled:=false; - RadioButtonHD.Enabled:=false; - RadioButtonG.Enabled:=false; - RadioButtonD.Enabled:=false; - end; - end; + PiedFeu:=tco[XClicCell,YClicCell].PiedFeu; + if PiedFeu=1 then + begin + RadioButtonG.checked:=true; + RadioButtonD.checked:=false; + end; + if PiedFeu=2 then + begin + RadioButtonG.checked:=false; + RadioButtonD.checked:=true; + end; + end; + end; end; // aiguillage if ((BImage=2) or (BImage=3) or (BImage=4) or (BImage=5) or (BImage=12) or (BImage=13) or (BImage=14) or - (BImage=15) or (BImage=21) or (BImage=22) or (BImage=24) or (BImage=25)) then + (BImage=15) or (BImage=21) or (BImage=22) or (BImage>=24) ) and (Bimage<50) then formConfCellTCO.checkPinv.Enabled:=true else formConfCellTCO.checkPinv.Enabled:=false; @@ -277,9 +273,9 @@ begin formTCO.EditAdrElement.Text:=intToSTR(adr); - if tco[XClicCell,YClicCell].BImage=30 then + if tco[XClicCell,YClicCell].BImage=50 then begin - index:=Index_feu(adr); + index:=Index_Signal(adr); if index=0 then exit else begin @@ -341,32 +337,9 @@ begin begin Parent:=FormConfCellTCO; Name:='i'+IntToSTR(i); // nom de l'image - sert à identifier le composant si on fait clic droit. - case i of - 1 : ImageSRC:=FormTCO.ImagePalette1; - 2 : ImageSRC:=FormTCO.ImagePalette2; - 3 : ImageSRC:=FormTCO.ImagePalette3; - 4 : ImageSRC:=FormTCO.ImagePalette4; - 5 : ImageSRC:=FormTCO.ImagePalette5; - 6 : ImageSRC:=FormTCO.ImagePalette6; - 7 : ImageSRC:=FormTCO.ImagePalette7; - 8 : ImageSRC:=FormTCO.ImagePalette8; - 9 : ImageSRC:=FormTCO.ImagePalette9; - 10 : ImageSRC:=FormTCO.ImagePalette10; - 11 : ImageSRC:=FormTCO.ImagePalette11; - 12 : ImageSRC:=FormTCO.ImagePalette12; - 13 : ImageSRC:=FormTCO.ImagePalette13; - 14 : ImageSRC:=FormTCO.ImagePalette14; - 15 : ImageSRC:=FormTCO.ImagePalette15; - 16 : ImageSRC:=FormTCO.ImagePalette16; - 17 : ImageSRC:=FormTCO.ImagePalette17; - 18 : ImageSRC:=FormTCO.ImagePalette18; - 19 : ImageSRC:=FormTCO.ImagePalette19; - 20 : ImageSRC:=FormTCO.ImagePalette20; - 21 : ImageSRC:=FormTCO.ImagePalette21; - 22 : ImageSRC:=FormTCO.ImagePalette22; - 23,31 : ImageSRC:=FormTCO.ImagePalette31; - 24 : ImageSRC:=FormTCO.ImagePalette30; - end; + + ImageSRC:=findComponent('ImagePalette'+intToSTR(i)) as Timage; + picture.Bitmap:=ImageSRC.picture.BitMap; width:=ImageSRC.Width; height:=ImageSRC.Height; @@ -460,7 +433,7 @@ begin if clicTCO or not(formConfCellTCOAff) or actualize then exit; if affevt then Affiche('TCO evt editTypeImageKeyPress',clorange); Val(EditTypeImage.Text,Bimage,erreur); - if (erreur<>0) or not(Bimage in[0..22,24..25,30,31]) then + if (erreur<>0) or not(Bimage in[0..29,32..34,50,51]) then begin exit; end; @@ -469,6 +442,7 @@ begin FormTCO.EditTypeImage.text:=intToSTR(BImage); actualise; // pour mise à jour de l'image de la fenetre FormConfCellTCO efface_entoure; + Efface_Cellule(FormTCO.ImageTCO.Canvas,XClicCell,yClicCell,pmCopy); affiche_cellule(XClicCell,YClicCell); end; diff --git a/UnitConfigTCO.dfm b/UnitConfigTCO.dfm index 0252aed..9c3e00a 100644 --- a/UnitConfigTCO.dfm +++ b/UnitConfigTCO.dfm @@ -281,7 +281,7 @@ object FormConfigTCO: TFormConfigTCO object RadioGroup1: TRadioGroup Left = 16 Top = 96 - Width = 281 + Width = 273 Height = 57 Caption = 'Graphisme' TabOrder = 8 diff --git a/UnitDebug.dfm b/UnitDebug.dfm index 2360597..8f717cf 100644 --- a/UnitDebug.dfm +++ b/UnitDebug.dfm @@ -1,9 +1,10 @@ object FormDebug: TFormDebug - Left = 209 - Top = 192 + Left = 321 + Top = 0 Width = 864 - Height = 788 + Height = 718 VertScrollBar.Increment = 67 + VertScrollBar.Position = 98 VertScrollBar.Tracking = True Caption = 'Fen'#234'tre de d'#233'bug' Color = clWindow @@ -21,12 +22,12 @@ object FormDebug: TFormDebug OnKeyPress = FormKeyPress DesignSize = ( 839 - 757) + 687) PixelsPerInch = 96 TextHeight = 13 object Label1: TLabel Left = 595 - Top = 4 + Top = -94 Width = 108 Height = 13 Anchors = [akTop, akRight] @@ -42,7 +43,7 @@ object FormDebug: TFormDebug end object Label2: TLabel Left = 443 - Top = 2 + Top = -96 Width = 131 Height = 18 Anchors = [akTop, akRight] @@ -56,7 +57,7 @@ object FormDebug: TFormDebug end object EditNivDebug: TEdit Left = 754 - Top = 2 + Top = -96 Width = 49 Height = 21 Anchors = [akTop, akRight] @@ -72,7 +73,7 @@ object FormDebug: TFormDebug end object ButtonEcrLog: TButton Left = 442 - Top = 328 + Top = 230 Width = 97 Height = 29 Anchors = [akTop, akRight] @@ -82,7 +83,7 @@ object FormDebug: TFormDebug end object ButtonRazTampon: TButton Left = 442 - Top = 360 + Top = 262 Width = 97 Height = 33 Anchors = [akTop, akRight] @@ -93,7 +94,7 @@ object FormDebug: TFormDebug end object ButtonCherche: TButton Left = 442 - Top = 296 + Top = 198 Width = 97 Height = 25 Hint = 'Cherche la cha'#238'ne "erreur"' @@ -106,7 +107,7 @@ object FormDebug: TFormDebug end object ButtonAffEvtChrono: TButton Left = 442 - Top = 256 + Top = 158 Width = 97 Height = 33 Anchors = [akTop, akRight] @@ -117,7 +118,7 @@ object FormDebug: TFormDebug end object ButtonCop: TButton Left = 442 - Top = 208 + Top = 110 Width = 97 Height = 41 Anchors = [akTop, akRight] @@ -134,7 +135,7 @@ object FormDebug: TFormDebug end object ButtonRazLog: TButton Left = 442 - Top = 400 + Top = 302 Width = 97 Height = 33 Anchors = [akTop, akRight] @@ -145,7 +146,7 @@ object FormDebug: TFormDebug end object GroupBox1: TGroupBox Left = 448 - Top = 600 + Top = 502 Width = 369 Height = 185 Anchors = [akTop, akRight] @@ -283,9 +284,11 @@ object FormDebug: TFormDebug Width = 185 Height = 25 Hint = - 'Renvoie l'#39#233'l'#233'ment suivant aux deux '#233'l'#233'ments (d'#233'tecteurs ou aigui' + - 'llages) ' + 'Renvoie l'#39#233'l'#233'ment suivant aux deux '#233'l'#233'ments contigus (d'#233'tecteurs' + + ' ou aiguillages) ' Caption = 'Element suivant aux '#233'l'#233'ments' + ParentShowHint = False + ShowHint = True TabOrder = 3 OnClick = ButtonElSuivClick end @@ -293,7 +296,7 @@ object FormDebug: TFormDebug end object GroupBox2: TGroupBox Left = 440 - Top = 20 + Top = -78 Width = 401 Height = 149 Anchors = [akTop, akRight] @@ -485,9 +488,9 @@ object FormDebug: TFormDebug end object RichDebug: TRichEdit Left = 8 - Top = 8 + Top = -90 Width = 425 - Height = 741 + Height = 671 Anchors = [akLeft, akTop, akRight, akBottom] Lines.Strings = ( 'RichDebug') @@ -498,7 +501,7 @@ object FormDebug: TFormDebug end object GroupBox5: TGroupBox Left = 448 - Top = 488 + Top = 390 Width = 372 Height = 57 Anchors = [akTop, akRight] @@ -565,7 +568,7 @@ object FormDebug: TFormDebug end object ButtonRazTout: TButton Left = 443 - Top = 176 + Top = 78 Width = 97 Height = 25 Hint = @@ -580,7 +583,7 @@ object FormDebug: TFormDebug end object GroupBox6: TGroupBox Left = 448 - Top = 552 + Top = 454 Width = 372 Height = 41 Anchors = [akTop, akRight] @@ -657,7 +660,7 @@ object FormDebug: TFormDebug end object MemoEvtDet: TRichEdit Left = 544 - Top = 174 + Top = 76 Width = 281 Height = 307 Anchors = [akTop, akRight] diff --git a/UnitPareFeu.dcu b/UnitPareFeu.dcu new file mode 100644 index 0000000..f4fb31c Binary files /dev/null and b/UnitPareFeu.dcu differ diff --git a/UnitPilote.dfm b/UnitPilote.dfm index 2f00f66..01f64d9 100644 --- a/UnitPilote.dfm +++ b/UnitPilote.dfm @@ -52,7 +52,7 @@ object FormPilote: TFormPilote object LabelDec: TLabel Left = 200 Top = 192 - Width = 129 + Width = 72 Height = 19 Alignment = taCenter Caption = 'LabelDec' diff --git a/UnitPilote.pas b/UnitPilote.pas index 681cc05..640c23e 100644 --- a/UnitPilote.pas +++ b/UnitPilote.pas @@ -118,7 +118,7 @@ procedure dessine_feu_pilote; var i : integer; Vcanvas : Tcanvas; begin - i:=Index_feu(AdrPilote); // adresse du feu d'origine + i:=Index_Signal(AdrPilote); // adresse du feu d'origine if i<>0 then //ImagePilote.Picture.Bitmap:=FormPilote.ImagePilote.picture.bitmap; @@ -261,7 +261,7 @@ end; procedure TFormPilote.ButtonPiloteClick(Sender: TObject); var i,index,e : integer; begin - index:=index_feu(AdrPilote); + index:=index_Signal(AdrPilote); if (feux[index].aspect>10) and (feux[index].aspect<20 )then begin val(EditNbreFeux.Text,i,e); @@ -296,7 +296,7 @@ procedure TFormPilote.FormActivate(Sender: TObject); var n,i,d : integer; begin // mise à jour du champ décodeur - i:=index_feu(AdrPilote); + i:=Index_Signal(AdrPilote); d:=feux[i].decodeur; n:=feux[i].aspect; LabelDec.Caption:=decodeur[d]; @@ -378,7 +378,7 @@ end; procedure TFormPilote.CheckVerrouCarreClick(Sender: TObject); var i : integer; begin - i:=index_feu(AdrPilote); + i:=Index_Signal(AdrPilote); feux[i].VerrouilleCarre:=checkVerrouCarre.Checked=true; if feux[i].VerrouilleCarre then begin diff --git a/UnitPrinc.pas b/UnitPrinc.pas index 88c2013..72ba479 100644 --- a/UnitPrinc.pas +++ b/UnitPrinc.pas @@ -1,10 +1,10 @@ Unit UnitPrinc; -// 1/8 20h +// 8/8 22h (******************************************** programme signaux complexes Graphique Lenz Delphi 7 + activeX Tmscomm + clientSocket ou RadStudio - option de compilations: options du debugger/exception du langage : décocher "arreter sur exceptions delphi" + options de compilation: options du debugger/exception du langage : décocher "arreter sur exceptions delphi" sinon une exception surgira au moment de l'ouverture du com Dans projet/option/fiches : fiches disponibles : formtco uniquement ******************************************** @@ -24,7 +24,7 @@ Unit UnitPrinc; netsh advfirewall firewall add rule name="cdm rail" dir=in action=allow program="C:\Program Files (x86)\CDM-Rail\cdr.exe" enable=yes *) -// en mode simulation run: +// En mode simulation run: // CDM ne renvoie pas les détecteurs au départ du RUN. // il ne renvoie pas non plus le nom des trains sur les actionneurs // les noms des trains sont bien renvoyés sur les détecteurs à 1 @@ -638,7 +638,7 @@ var {$R *.dfm} // utilisation des procédures et fonctions dans les autres unités -function Index_feu(adresse : integer) : integer; +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 : word;orientation : integer); @@ -1147,8 +1147,7 @@ end; procedure dessine_feu9(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 : integer; - LgImage,HtImage,xt,yt,code,combine : integer; + Xrap1,Yrap1,Xrap2,Yrap2,Temp,LgImage,HtImage,xt,yt,code,combine : integer; ech : real; begin @@ -1249,8 +1248,8 @@ begin end; end; -// Ecrire sur un canvas un texte incliné, avec ou sans bordure, monochrome ou à face texturée -procedure AffTexteIncliBordeTexture( C : TCanvas; X,Y : integer; Fonte : tFont; +// Ecrire sur un canvas un texte avec un angle, avec ou sans bordure, monochrome ou à face texturée +procedure AffTexteIncliBordeTexture(C : TCanvas; X,Y : integer; Fonte : tFont; clBord : TColor; EpBord : integer; PenMode : TPenMode; Texture : tBitMap; Texte : string; AngleDD : longint); // params : C = Canvas-cible @@ -1262,69 +1261,68 @@ procedure AffTexteIncliBordeTexture( C : TCanvas; X,Y : integer; Fonte : tFont; // Texture = BitMap de texture : Si Texture = Nil alors la face sera de la couleur de Fonte avec un contour de clBord si EpBord > 0. // Texte = Texte à écrire. // AngleDD = Angle d'inclinaison en Dixièmes de degré. -var dc : HDC; - lgFont : LOGFONT; - AncFonte,NouvFonte : HFONT; - AncPen,NouvPen : HPEN; - AncBrush,NouvBrush : HBRUSH; +var dc : Hdc; + lgFont : Logfont; + AncFonte,NouvFonte : Hfont; + AncPen,NouvPen : Hpen; + AncBrush,NouvBrush : Hbrush; begin - C.Pen.Mode:=PenMode; - dc := C.Handle; - - // Initialisation de la fonte - zeroMemory(@lgFont,sizeOf(lgFont)); - strPCopy(lgFont.lfFaceName,Fonte.Name); - lgFont.lfHeight := Fonte.Height; - if Fonte.style=[] then lgFont.lfWeight:=FW_REGULAR; // Normal - if Fonte.style=[fsBold] then lgFont.lfWeight:=FW_BOLD; // Gras - - if fsItalic in Fonte.style then lgFont.lfItalic:=1; - if fsUnderline in Fonte.style then lgFont.lfUnderline:=1; - if fsStrikeout in Fonte.style then lgFont.lfStrikeout:=1; - - lgFont.lfEscapement:=AngleDD; // Modification de l'inclinaison - - NouvFonte := CreateFontInDirect(lgFont); - AncFonte := SelectObject(dc,NouvFonte); - - // Initialisation du contour : - if EpBord<>0 then NouvPen := CreatePen(PS_SOLID,EpBord,clBord) - else NouvPen := CreatePen(PS_NULL,0,0); - AncPen := SelectObject(dc,NouvPen); - - // Initialisation de la couleur de la police ou de la Texture : - if Texture=nil then NouvBrush := CreateSolidBrush(Fonte.color) - else NouvBrush := CreatePatternBrush(Texture.Handle); - AncBrush := SelectObject(dc,NouvBrush); - // Le contexte doit être transparent - SetBkMode(dc,TRANSPARENT); - - // Dessin du texe : - BeginPath(dc); - TextOut(dc,X,Y,PChar(Texte),length(texte)); //<- au lieu de TextOut(dc,X,Y,PansiChar(Texte),length(texte)) pour rendre le code compatible avec toutes les versions de Delphi (de D2 à XE2); - EndPath(dc); - StrokeAndFillPath(dc); + C.Pen.Mode:=PenMode; + dc:=C.Handle; - // Restauration objets et libération mémoire - SelectObject(dc,AncFonte); - DeleteObject(NouvFonte); - SelectObject(dc,AncPen); - DeleteObject(NouvPen); - SelectObject(dc,AncBrush); - DeleteObject(NouvBrush); - -end; // AffTexteIncliBordeTexture + // Initialisation de la fonte + zeroMemory(@lgFont,sizeOf(lgFont)); + strPCopy(lgFont.lfFaceName,Fonte.Name); + lgFont.lfHeight := Fonte.Height; + if Fonte.style=[] then lgFont.lfWeight:=FW_REGULAR; // Normal + if Fonte.style=[fsBold] then lgFont.lfWeight:=FW_BOLD; // Gras + + if fsItalic in Fonte.style then lgFont.lfItalic:=1; + if fsUnderline in Fonte.style then lgFont.lfUnderline:=1; + if fsStrikeout in Fonte.style then lgFont.lfStrikeout:=1; + + lgFont.lfEscapement:=AngleDD; // Modification de l'inclinaison + + NouvFonte:=CreateFontInDirect(lgFont); + AncFonte:=SelectObject(dc,NouvFonte); + + // Initialisation du contour : + if EpBord<>0 then NouvPen := CreatePen(PS_SOLID,EpBord,clBord) + else NouvPen := CreatePen(PS_NULL,0,0); + AncPen:= SelectObject(dc,NouvPen); + + // Initialisation de la couleur de la police ou de la Texture : + if Texture=nil then NouvBrush := CreateSolidBrush(Fonte.color) + else NouvBrush := CreatePatternBrush(Texture.Handle); + AncBrush:=SelectObject(dc,NouvBrush); + // Le contexte doit être transparent + SetBkMode(dc,TRANSPARENT); + + // Dessin du texe : + BeginPath(dc); + TextOut(dc,X,Y,PChar(Texte),length(texte)); //<- au lieu de TextOut(dc,X,Y,PansiChar(Texte),length(texte)) pour rendre le code compatible avec toutes les versions de Delphi (de D2 à XE2); + EndPath(dc); + StrokeAndFillPath(dc); + + // Restauration objets et libération mémoire + SelectObject(dc,AncFonte); + DeleteObject(NouvFonte); + SelectObject(dc,AncPen); + DeleteObject(NouvPen); + SelectObject(dc,AncBrush); + DeleteObject(NouvBrush); +end; -// inverse une image horz et la met dans dest +// inverse une image horizontale (miroir) et la met dans dest procedure inverse_image(imageDest,ImageSrc : Timage); var mrect,nrect : trect; larg,haut : integer; begin larg:=ImageSrc.Width; haut:=ImageSrc.Height; - mRect:= rect(0, 0, larg, haut); + mRect:= rect(0,0,larg,haut); nRect:= rect(larg-1,0,-1,haut); - ImageDest.canvas.CopyRect(mRect, ImageSrc.canvas, nRect); + ImageDest.canvas.CopyRect(mRect,ImageSrc.canvas,nRect); end; // dessine les feux sur une cible belge à 5 feux @@ -1346,11 +1344,6 @@ begin largeur:=57; rayon:=round(6*frX); - {Xblanc:=12;YBlanc:=51; - Xrouge:=12;Yrouge:=25; - xJauneBas:=12;yJauneBas:=38; - xJauneHaut:=38;yJauneHaut:=12; - xVert:=12;YVert:=12;} xVert:=15; yvert:=24; xrouge:=15; yrouge:=37; xjauneBas:=15;yjauneBas:=50; @@ -1365,7 +1358,7 @@ begin XChiffre:=14;Ychiffre:=76; Xfin:=26;yFin:=99; - index:=index_feu(adresse); + index:=index_signal(adresse); if feux[index].contrevoie then begin xvert:=largeur-xvert; @@ -1405,7 +1398,7 @@ begin if (orientation=3) then begin - //rotation 90° vers la droite des feux + // rotation 90° vers la droite des feux // calcul des facteurs de réduction pour la rotation ech:=frY;frY:=frX;FrX:=ech; Temp:=LgImage-XjauneBas;XJauneBas:=YJauneBas;YjauneBas:=Temp; @@ -1526,10 +1519,7 @@ begin r.Right:=Xfin-2;r.Bottom:=Yfin-1; Fillrect(r); end; - end; - - end; @@ -1544,20 +1534,20 @@ begin if n=2 then x2:=25 else x2:=22; x1:=11;x3:=33;x4:=43;x5:=53;x6:=63; y1:=13;y2:=13;y3:=13;y4:=13;y5:=13;y6:=13; - - case N of + + case n of 2 : with Formprinc.Image2Dir.Picture.Bitmap do - begin + begin LgImage:=Width; HtImage:=Height; end; 3 : with Formprinc.Image3Dir.Picture.Bitmap do - begin + begin LgImage:=Width; HtImage:=Height; - end; + end; 4 : with Formprinc.Image4Dir.Picture.Bitmap do - begin + begin LgImage:=Width; HtImage:=Height; end; @@ -1603,7 +1593,7 @@ begin X4:=round(X4*Frx)+x; Y4:=round(Y4*Fry)+Y; X5:=round(X5*FrX)+x; Y5:=round(Y5*FrY)+Y; X6:=round(X6*FrX)+x; Y6:=round(Y6*FrY)+Y; - + if EtatSignal=0 then begin cercle(ACanvas,x1,y1,rayon,GrisF); @@ -1735,9 +1725,9 @@ begin if trouve then index_train_adresse:=i else index_train_adresse:=0 ; end; -// renvoie l'index du feu dans le tableau feux[] en fonction de son adresse +// renvoie l'index du signal dans le tableau feux[] en fonction de son adresse // si pas trouvé renvoie 0 -function Index_feu(adresse : integer) : integer; +function Index_signal(adresse : integer) : integer; var i : integer; trouve : boolean; begin @@ -1746,7 +1736,7 @@ begin trouve:=feux[i].adresse=adresse; if not(trouve) then inc(i); until (trouve) or (i>NbreFeux); - if trouve then Index_feu:=i else Index_feu:=0 ; + if trouve then Index_Signal:=i else Index_Signal:=0 ; end; // renvoie l'index de l'aiguillage dans le tableau aiguillages[] en fonction de son adresse @@ -1767,7 +1757,7 @@ end; procedure Dessine_feu_mx(CanvasDest : Tcanvas;x,y : integer;FrX,frY : real;adresse : integer;orientation : integer); var i,aspect : integer; begin - i:=Index_feu(adresse); + i:=Index_Signal(adresse); if i<>0 then begin aspect:=feux[i].aspect ; @@ -1819,7 +1809,7 @@ begin if i<>0 then s:=copy(s,1,i-1); val(s,AdrPilote,erreur); if adrPilote=0 then exit; - i:=Index_feu(AdrPilote); + i:=Index_Signal(AdrPilote); if i=0 then exit; with Formpilote do @@ -2092,7 +2082,7 @@ end; Function chaine_CDM_Func(fonction,etat : integer;train : string) : string; var so,sx,s : string; begin - { exemple de commande envoyée au serveur pour une fonction + { exemple de commande envoyée au serveur CDM pour une fonction C-C-00-0002-CMDTRN-DCCSF|029|02|NAME=nomdutrain;FXnumfonction=etat; C-C-00-0002-CMDTRN-DCCSF|029|02|NAME=train;FX0=0; C-C-00-0002-CMDTRN-DCCSF|029|02|NAME=train;FX1=0; @@ -2194,6 +2184,7 @@ begin if protocole=2 then Affiche('D1: Commande DCC++ pas encore implantée',clred); end; +// envoie un octet 1 ou 2 à l'adresse DCC en Xpressnet, sans remise à 0 de l'adresse procedure pilote_direct01(adresse:integer;octet:integer); var groupe : integer ; fonction : byte; @@ -2448,7 +2439,7 @@ function chaine_signal(etat,adresse : word) : string; var a,i,aspect,combine,nation : integer; s : string; begin - i:=index_feu(adresse); + i:=Index_Signal(adresse); nation:=1; a:=feux[i].aspect; if a=20 then nation:=2; @@ -2497,14 +2488,12 @@ end; procedure Maj_Etat_Signal_Belge(adresse,aspect : integer); var i : integer; etats : word; -// La signalisation combinée est à partir du bit 10 (chiffre, chevron) +// La signalisation combinée belge est à partir du bit 10 (chiffre, chevron) begin if debug=3 then formprinc.Caption:='Maj_Etat_Signal '+IntToSTR(adresse)+' '+intToSTR(aspect); - i:=index_feu(adresse); -// if testBit(feux[i].EtatSignal,aspect)=false then // si le bit dans l'état du signal n'est pas allumé, procéder. + i:=Index_Signal(adresse); begin // signalisation de base - if aspect<=$3f then begin // razer tous les bits non combinés @@ -2517,21 +2506,19 @@ begin if (aspect and $1C0)<>0 then begin etats:=feux[i].EtatSignal; - //si le bit 15 est à 1, c'est l'indicateur de mise à 1 + //si le bit 15 (bita1) est à 1, c'est l'indicateur de mise à 1 if testBit(aspect,bita1) then begin - etats:=etats or (aspect and $1C0); + etats:=etats or (aspect and $1C0); // mise à 1 par masquage feux[i].EtatSignal:=feux[i].EtatSignal or etats; end else begin - etats:=etats and not(aspect and $1c0); + etats:=etats and not(aspect and $1c0); // mise à 0 par masquage feux[i].EtatSignal:=feux[i].EtatSignal and etats; end; - end; end; - end; // mise à jour état signal complexe francais dans le tableau de bits du signal EtatSignalCplx @@ -2545,7 +2532,7 @@ begin // '6blanc','7blanc cli','8jaune','9jaune cli','10ral 30','11ral 60','12rappel 30','13rappel 60'); if debug=3 then formprinc.Caption:='Maj_Etat_Signal '+IntToSTR(adresse); - i:=index_feu(adresse); + i:=Index_Signal(adresse); if testBit(feux[i].EtatSignal,aspect)=false then // si le bit dans l'état du signal n'est pas allumé, procéder. begin // effacement du motif de bits en fonction du nouvel état demandé suivant la règle des signaux complexes @@ -2596,9 +2583,9 @@ end; procedure Maj_Etat_Signal(adresse,aspect : integer); var i,d : integer; begin - i:=index_feu(adresse); + i:=Index_Signal(adresse); d:=feux[i].aspect; - if d=20 then Maj_Etat_Signal_belge(adresse,aspect) + if d=20 then Maj_Etat_Signal_belge(adresse,aspect) else Maj_Etat_Signal_fr(adresse,aspect); end; @@ -2610,7 +2597,7 @@ sur un panneau directionnel - adresse : adresse du signal - code de 1 procedure envoi_directionBahn(adr : integer;code : integer); var i : integer; begin - i:=index_feu(adr); + i:=Index_Signal(adr); if (feux[i].EtatSignal<>code) then begin if (traceSign) then Affiche('Signal directionnel: ad'+IntToSTR(adr)+'='+intToSTR(code),clOrange); @@ -2647,7 +2634,7 @@ begin end; end; feux[i].EtatSignal:=code; - Dessine_feu_mx(Feux[Index_Feu(adr)].Img.Canvas,0,0,1,1,adr,1); + Dessine_feu_mx(Feux[Index_Signal(adr)].Img.Canvas,0,0,1,1,adr,1); end; end; @@ -2659,7 +2646,7 @@ le panneau directionnel procedure envoi_directionCDF(adr : integer;code : integer); var i : integer; begin - i:=index_feu(adr); + i:=Index_Signal(adr); if (feux[i].EtatSignal<>code) then begin if traceSign then Affiche('signal directionnel CDF: '+IntToSTR(adr)+' '+intToSTR(code),ClOrange); @@ -2697,7 +2684,7 @@ end; procedure Envoi_DirectionLEB(Adr : integer;code : integer); var i : integer; begin - i:=index_feu(i); + i:=Index_Signal(i); if feux[i].EtatSignal<>code then begin if traceSign then Affiche('signal directionnel LEB: '+IntToSTR(adr)+' '+intToSTR(code),ClOrange); @@ -2861,7 +2848,7 @@ var end; begin - i:=index_feu(adresse); + i:=Index_Signal(adresse); if (feux[i].AncienEtat<>feux[i].EtatSignal) then //; && (stop_cmd==FALSE)) begin code:=feux[i].EtatSignal; @@ -2917,7 +2904,7 @@ var index,i,etat : integer; s : string; begin - index:=index_feu(adresse); + index:=Index_Signal(adresse); if (feux[index].AncienEtat<>feux[index].EtatSignal) then //; && (stop_cmd==FALSE)) begin code:=feux[index].EtatSignal; @@ -2983,7 +2970,7 @@ var code,aspect,combine : integer; end; begin - index:=index_feu(adresse); + index:=Index_Signal(adresse); if (feux[index].AncienEtat<>feux[index].EtatSignal) then //; && (stop_cmd==FALSE)) begin code:=feux[index].EtatSignal; @@ -3036,7 +3023,7 @@ procedure envoi_arcomora(adresse :integer); var asp,aspect,combine,code,offset,sortie : integer; s : string; begin - index:=index_feu(adresse); + index:=Index_Signal(adresse); if (feux[index].AncienEtat<>feux[index].EtatSignal) then //; && (stop_cmd==FALSE)) begin code:=feux[index].EtatSignal; @@ -3156,7 +3143,7 @@ var valeur,i : integer ; aspect,combine,code : integer; s : string; begin - i:=index_feu(adresse); + i:=Index_Signal(adresse); if (feux[i].AncienEtat<>feux[i].EtatSignal) then begin code:=feux[i].EtatSignal; @@ -3205,7 +3192,7 @@ var modele,index: integer ; s : string; code,aspect,combine : integer; begin - index:=Index_feu(adresse); // tranforme l'adresse du feu en index tableau + index:=Index_Signal(adresse); // tranforme l'adresse du feu en index tableau if (feux[index].AncienEtat<>feux[index].EtatSignal) then begin @@ -3719,7 +3706,7 @@ var na,code,aspect,combine : integer; afb,recht,i : integer; s : string; begin - i:=index_feu(adresse); + i:=Index_Signal(adresse); if (feux[i].AncienEtat<>feux[i].EtatSignal) then begin code:=feux[i].EtatSignal; @@ -3839,7 +3826,7 @@ var code,aspect,combine : integer; i : integer; s : string; begin - i:=index_feu(adresse); + i:=Index_Signal(adresse); if (feux[i].AncienEtat<>feux[i].EtatSignal) then //; && (stop_cmd==FALSE)) begin code:=feux[i].EtatSignal; @@ -3874,7 +3861,7 @@ var code,aspect,combine,mode : integer; i : integer; s : string; begin - i:=index_feu(adresse); + i:=Index_Signal(adresse); if (feux[i].AncienEtat<>feux[i].EtatSignal) then //; && (stop_cmd==FALSE)) begin code:=feux[i].EtatSignal; @@ -3931,7 +3918,7 @@ var i : integer; s : string; begin - i:=index_feu(adresse); + i:=Index_Signal(adresse); if (feux[i].AncienEtat<>feux[i].EtatSignal) then //; && (stop_cmd==FALSE)) begin code:=feux[i].EtatSignal; @@ -4019,7 +4006,7 @@ procedure ecrire(v : integer); end; begin - i:=index_feu(adresse); + i:=Index_Signal(adresse); if (feux[i].AncienEtat<>feux[i].EtatSignal) then //; && (stop_cmd==FALSE)) begin code:=feux[i].EtatSignal; @@ -4078,7 +4065,7 @@ var i,aspect,code,combine : integer; s : string; begin connecte:=cdm_connecte or portCommOuvert or parSocketLenz; - i:=index_feu(adresse); + i:=Index_Signal(adresse); if (feux[i].AncienEtat<>feux[i].EtatSignal) then //; && (stop_cmd==FALSE)) begin code:=feux[i].EtatSignal; @@ -4136,7 +4123,7 @@ var s : string; d,dp,i,j,etat,asp,combine,aspect,nAdresses : integer; trouve1,trouve2,trouve3,trouve4 : boolean; begin - i:=index_feu(adresse); + i:=Index_Signal(adresse); etat:=feux[i].EtatSignal; if (feux[i].AncienEtat<>etat) then //; && (stop_cmd==FALSE)) begin @@ -4281,7 +4268,7 @@ var i,it,j,index_train,adresse,detect,detsuiv,a,b,aspect,x,y,TailleX,TailleY,Ori frX,frY : real; s : string; begin - i:=index_feu(Adr); + i:=Index_Signal(Adr); if i=0 then begin s:='Erreur 75: index signal '+intToSTR(adr)+' nul'; @@ -4381,10 +4368,10 @@ begin for y:=1 to NbreCellY do for x:=1 to NbreCellX do begin - if TCO[x,y].Bimage=30 then + if TCO[x,y].Bimage=50 then begin adresse:=TCO[x,y].adresse; // vérifie si le feu existe dans le TCO - aspect:=feux[index_feu(adresse)].Aspect; + aspect:=feux[Index_Signal(adresse)].Aspect; case aspect of 2 : ImageFeu:=Formprinc.Image2feux; 3 : ImageFeu:=Formprinc.Image3feux; @@ -4545,7 +4532,7 @@ begin if (UniSem<>2) and (UniSem<>3) and (UniSem<>4) and (UniSem<>51) and (UniSem<>52) and (UniSem<>71) and (UniSem<>72) and (UniSem<>73) and ((UniSem<90) or (UniSem>99)) then begin verif_UniSemaf:=1;exit;end; - i:=index_feu(adresse); + i:=Index_Signal(adresse); if i<>0 then begin aspect:=feux[i].aspect; @@ -6251,7 +6238,7 @@ var i,l,k,NCondCarre,adrAig,index : integer; resultatET,resultatOU: boolean; s : string; begin - i:=index_feu(adresse); + i:=Index_Signal(adresse); if i=0 then begin s:='Erreur 602 - Signal '+IntToSTR(adresse)+' non trouvé'; @@ -6305,7 +6292,7 @@ var i,l,k,NCondCarre,adrAig,index : integer; resultatET,resultatOU: boolean; s : string; begin - i:=index_feu(adresse); + i:=Index_Signal(adresse); if i=0 then begin s:='Erreur 602 - Signal '+IntToSTR(adresse)+' non trouvé'; @@ -6366,7 +6353,7 @@ begin ReserveTrainTiers:=false; if (NivDebug>=1) then AfficheDebug('Proc carre_signal '+IntToSTR(adresse),clyellow); - i:=Index_feu(adresse); + i:=Index_Signal(adresse); if i=0 then begin s:='Erreur 603 - Signal '+IntToSTR(adresse)+' non trouvé'; @@ -6690,7 +6677,7 @@ var num_feu,etat,AdrFeu,i,j,prec,AdrSuiv,index2,voie : integer; s : string; begin if NivDebug>=2 then AfficheDebug('Cherche état du signal suivant au '+IntToSTR(adresse),clyellow); - i:=Index_feu(adresse); + i:=Index_Signal(adresse); if i=0 then begin if NivDebug>=2 then AfficheDebug('Signal '+IntToSTR(adresse)+' non trouvé',clyellow); @@ -6791,7 +6778,7 @@ begin begin // oui inc(num_feu); - Etat:=feux[index_feu(AdrFeu)].EtatSignal; + Etat:=feux[Index_Signal(AdrFeu)].EtatSignal; code_to_aspect(Etat,aspect,combine); Signal_suivant:=AdrFeu; if NivDebug=3 then @@ -6819,7 +6806,7 @@ begin begin // oui inc(num_feu); - Etat:=feux[index_feu(AdrFeu)].EtatSignal; + Etat:=feux[Index_Signal(AdrFeu)].EtatSignal; code_to_aspect(Etat,aspect,combine); Signal_suivant:=AdrFeu; if NivDebug=3 then @@ -6860,7 +6847,7 @@ var AdrFeu,i,j,prec,AdrSuiv,Actuel,index,index2,voie : integer; begin if NivDebug>=2 then AfficheDebug('Test si aiguille déviée après signal '+IntToSTR(Adresse),clyellow); j:=0; - i:=Index_feu(adresse); + i:=Index_Signal(adresse); if i=0 then begin Affiche('Erreur 168: signal '+intToSTR(adresse)+' non trouvé',clred); @@ -6920,7 +6907,7 @@ end; procedure pilote_direction(Adr,nbre : integer); var i,j : integer; begin - i:=index_feu(Adr); + i:=Index_Signal(Adr); j:=feux[i].decodeur; case j of // 0 : envoi_directionvirtuel(Adr,nbre); @@ -6937,7 +6924,7 @@ var NAig,i,id,j,NfeuxDir,AdrAigFeu,Position : integer; PosAigFeu : char; Positionok : boolean; begin - id:=Index_feu(Adr); + id:=Index_Signal(Adr); NfeuxDir:=feux[id].aspect-10; i:=1; // i=1 position éteinte du feu ; pour les autres valeurs de i : nombre de feux allumés repeat @@ -6976,7 +6963,7 @@ var s : string; begin if NivDebug>=1 then AfficheDebug('Proc test_memoire_zones('+intToSTR(adresse)+')',clyellow); - i:=Index_feu(adresse); + i:=Index_Signal(adresse); if (i=0) then begin s:='Erreur 605 - Signal '+IntToSTR(adresse)+' non trouvé'; @@ -7196,7 +7183,7 @@ var begin if debug=3 then formprinc.Caption:='Signal_precedent '+IntToSTR(adresse); if NivDebug>=1 then AfficheDebug('Proc Signal_Precedent'+intToSTR(adresse)+')',clyellow); - i:=Index_feu(adresse); + i:=Index_Signal(adresse); if (i=0) then begin s:='Erreur 605 - Signal '+IntToSTR(adresse)+' non trouvé'; @@ -7340,7 +7327,7 @@ begin else s:=s+'sur zones de détecteurs uniquement'; AfficheDebug(s,clyellow); end; - i:=Index_feu(adresse); + i:=Index_Signal(adresse); if (i=0) then begin AfficheDebug('Erreur 605 - Signal '+IntToSTR(adresse)+' non trouvé',clred); @@ -7531,7 +7518,7 @@ begin if affSignal then AfficheDebug('Signal belge',clOrange); - index:=Index_feu(AdrFeu); + index:=Index_Signal(AdrFeu); Adr_det:=Feux[index].Adr_det1; // détecteur sur le signal Adr_El_Suiv:=Feux[index].Adr_el_suiv1; // adresse élément suivant au feu Btype_el_suivant:=Feux[index].Btype_suiv1; @@ -7655,7 +7642,7 @@ begin nivDebug:=3; end; - index:=index_feu(Adrfeu); + index:=Index_Signal(Adrfeu); if (Nivdebug>=1) then AfficheDebug('Proc Maj_feu '+IntToSTR(adrFeu),clorange); if (AdrFeu=0) or (index=0) then exit; @@ -7929,7 +7916,7 @@ var i,it,suiv,succ,actuel : integer; begin if debug=3 then formprinc.Caption:='Signal_sens '+IntToSTR(AdrSig); it:=0; - i:=index_feu(adrsig); + i:=Index_Signal(adrsig); if i=0 then begin result:=false; @@ -8014,7 +8001,7 @@ begin if not(cas2) then AdrSig:=signal_suivant_det(detecteur1,detecteur2); if traceListe then afficheDebug('le signal suivant est '+intToSTR(AdrSig),clyellow); - etat:=feux[index_feu(AdrSig)].etatSignal; + etat:=feux[Index_Signal(AdrSig)].etatSignal; etatSuiv:=etat_signal_suivant(AdrSig,1,AdrSignalsuivant); //réserve le canton du signal AdrSig au suivant : AdresseFeuSuivant // dans le bon sens @@ -8330,7 +8317,7 @@ begin if j<>0 then begin Maj_Feu(j,false); - k:=index_feu(j); + k:=Index_Signal(j); // si le feu j est au rouge etatSig:=feux[k].etatsignal; if (testBit(etatSig,carre)) or (testBit(etatSig,semaphore)) or (testBit(etatSig,semaphore_cli)) then @@ -8776,7 +8763,7 @@ begin if j<>0 then begin Maj_Feu(j,false); - k:=index_feu(j); + k:=Index_Signal(j); // si le feu j est au rouge etatSig:=feux[k].etatsignal; if (testBit(etatSig,carre)) or (testBit(etatSig,semaphore)) or (testBit(etatSig,semaphore_cli)) then @@ -9444,7 +9431,7 @@ begin if j<>0 then begin Maj_Feu(j,false); - k:=index_feu(j); + k:=Index_Signal(j); // si le feu j est au rouge etatSig:=feux[k].etatsignal; if (testBit(etatSig,carre)) or (testBit(etatSig,semaphore)) or (testBit(etatSig,semaphore_cli)) then @@ -10384,7 +10371,7 @@ begin if (acc=feu) and not(Raz_Acc_signaux) then exit; // si aiguillage, faire une temporisation - //if (index_feu(adresse)=0) or (Acc=aig) then + //if (Index_Signal(adresse)=0) or (Acc=aig) then if Acc=AigP then begin temp:=aiguillage[indexAig].temps;if temp=0 then temp:=4; @@ -11560,7 +11547,7 @@ begin SetForegroundWindow(CDMhd); // met CDM en premier plan pour le télécommander par le clavier simulé Application.ProcessMessages; - // démarre le serveur IP : il faut avoir chargé un réseau sinon le permier menu est fermé------------------------------------ + // démarre le serveur IP : il faut avoir chargé un réseau sinon le permier menu est fermé------------------------------------ // prépare le tableau pour sendinput KeybdInput(VK_MENU,0); // enfonce Alt KeybdInput(Ord('C'),0); // enfonce C @@ -11648,7 +11635,7 @@ end; procedure Raz_reservations ; var i : integer; begin - // raz des réservations + // raz des réservations des aiguillages for i:=1 to MaxAiguillage do aiguillage[i].AdrTrain:=0; end; @@ -12454,10 +12441,10 @@ begin begin PcanvasTCO.pen.mode:=pmCOpy; BImage:=TCO[x,y].bImage; - if Bimage=30 then + if Bimage=50 then begin adresse:=TCO[x,y].adresse; - i:=index_feu(adresse); + i:=Index_Signal(adresse); a:=feux[i].EtatSignal; // a = état binaire du feu faire:=false; if feux[i].aspect<>20 then @@ -12471,7 +12458,7 @@ begin end; if faire then begin - aspect:=feux[index_feu(adresse)].Aspect; + aspect:=feux[Index_Signal(adresse)].Aspect; case aspect of 2 : ImageFeu:=Formprinc.Image2feux; 3 : ImageFeu:=Formprinc.Image3feux; @@ -12753,7 +12740,7 @@ begin adresse:=extract_int(s); if adresse<>0 then begin - i:=index_feu(adresse); + i:=Index_Signal(adresse); if i=0 then exit; etat:=feux[i].EtatSignal; code_to_aspect(etat,aspect,combine); @@ -12782,7 +12769,7 @@ begin adresse:=extract_int(s); if adresse<>0 then begin - i:=index_feu(adresse); + i:=Index_Signal(adresse); if i=0 then exit; etat:=feux[i].EtatSignal; // si le feu est vert et que la coche est mise, substituer le blanc @@ -12810,7 +12797,7 @@ begin adresse:=extract_int(s); if adresse<>0 then begin - i:=index_feu(adresse); + i:=Index_Signal(adresse); if i=0 then exit; etat:=feux[i].EtatSignal; //affiche(IntToSTR(etat),clyellow); @@ -14228,8 +14215,11 @@ end; procedure TFormPrinc.Affichefentredebug1Click(Sender: TObject); begin - // formdebug.Create(nil); - if debugaffiche then formDebug.show; + if debugaffiche then + begin + formdebug.windowState:=wsNormal; //Maximized; + formDebug.show; + end; end; procedure TFormPrinc.locoClick(Sender: TObject); @@ -14417,7 +14407,7 @@ begin //Affiche(s,clOrange); // nom de l'image du signal (ex: ImageFeu260) adresse:=extract_int(s); // extraire l'adresse (ex 260) - i:=index_feu(Adresse); + i:=Index_Signal(Adresse); n:=feux[i].aspect; if (n>10) and (n<20) then exit; if n=20 then nation:=2 else nation:=1; @@ -14477,20 +14467,20 @@ begin if (aspect=jaune_cli) and (nation=1) then begin i:=etat_signal_suivant(Adresse,1,AdrSignalsuivant); - index:=index_feu(AdrSignalSuivant); + index:=Index_Signal(AdrSignalSuivant); Affiche(s+'son signal suivant '+intToSTR(AdrSignalsuivant)+' est au '+chaine_signal(i,adresse),clyellow); end; // ralen 30 if (combine=10) and (nation=1) then begin i:=etat_signal_suivant(Adresse,1,AdrSignalsuivant); - index:=index_feu(AdrSignalSuivant); + index:=Index_Signal(AdrSignalSuivant); Affiche(s+'son signal suivant '+intToSTR(AdrSignalsuivant)+' est au '+chaine_signal(i,adresse),clyellow); end; if (combine=11) and (nation=1) then begin i:=etat_signal_suivant(Adresse,1,AdrSignalsuivant); - index:=index_feu(AdrSignalSuivant); + index:=Index_Signal(AdrSignalSuivant); Affiche(s+'car son signal suivant '+intToSTR(AdrSignalsuivant)+' est au '+chaine_signal(i,adresse),clyellow); end; if ((combine=rappel_30) or (combine=rappel_60)) and (nation=1) then diff --git a/UnitSR.pas b/UnitSR.pas index 3713de0..acdeed1 100644 --- a/UnitSR.pas +++ b/UnitSR.pas @@ -183,7 +183,7 @@ procedure TFormSR.FormActivate(Sender: TObject); var erreur,etat1,etat2 : integer; begin Val(FormConfig.EditAdrSig.text,Adr,erreur); - indexSig:=index_feu(Adr); + indexSig:=index_Signal(Adr); if IndexSig=0 then LabelErreur.caption:='Erreur feu inexistant' else begin diff --git a/UnitTCO.dfm b/UnitTCO.dfm index 0eef534..1edae3c 100644 --- a/UnitTCO.dfm +++ b/UnitTCO.dfm @@ -1,7 +1,7 @@ object FormTCO: TFormTCO - Left = 4 - Top = 99 - Width = 1141 + Left = 197 + Top = 29 + Width = 1142 Height = 678 VertScrollBar.Visible = False Caption = 'FormTCO' @@ -22,8 +22,8 @@ object FormTCO: TFormTCO OnKeyPress = FormKeyPress OnMouseWheel = FormMouseWheel DesignSize = ( - 1125 - 639) + 1134 + 647) PixelsPerInch = 96 TextHeight = 13 object LabelCoord: TLabel @@ -39,7 +39,7 @@ object FormTCO: TFormTCO Font.Style = [fsBold] ParentFont = False end - object Label2: TLabel + object LabelCellule: TLabel Left = 8 Top = 0 Width = 49 @@ -66,8 +66,8 @@ object FormTCO: TFormTCO Height = 13 Caption = '0' end - object Label19: TLabel - Left = 1077 + object LabelZoom: TLabel + Left = 1078 Top = 391 Width = 32 Height = 13 @@ -93,9 +93,9 @@ object FormTCO: TFormTCO Height = 121 end object ScrollBox: TScrollBox - Left = 8 - Top = 18 - Width = 827 + Left = 16 + Top = 26 + Width = 828 Height = 351 HorzScrollBar.Smooth = True HorzScrollBar.Tracking = True @@ -107,12 +107,12 @@ object FormTCO: TFormTCO ParentColor = False TabOrder = 1 DesignSize = ( - 823 + 824 347) object ImageTCO: TImage - Left = 0 - Top = 0 - Width = 715 + Left = 48 + Top = 32 + Width = 716 Height = 305 Anchors = [akLeft, akTop, akRight, akBottom] AutoSize = True @@ -127,7 +127,7 @@ object FormTCO: TFormTCO end end object TrackBarZoom: TTrackBar - Left = 1077 + Left = 1078 Top = 18 Width = 41 Height = 350 @@ -144,9 +144,9 @@ object FormTCO: TFormTCO OnChange = TrackBarZoomChange end object Panel1: TPanel - Left = 0 + Left = 8 Top = 464 - Width = 1123 + Width = 1124 Height = 173 Anchors = [akLeft, akRight, akBottom] Color = clActiveBorder @@ -159,9 +159,9 @@ object FormTCO: TFormTCO TabOrder = 2 OnDragOver = Panel1DragOver DesignSize = ( - 1123 + 1124 173) - object Label6: TLabel + object Label1: TLabel Left = 216 Top = 22 Width = 9 @@ -174,8 +174,8 @@ object FormTCO: TFormTCO Font.Style = [fsBold] ParentFont = False end - object Label7: TLabel - Left = 288 + object Label2: TLabel + Left = 272 Top = 22 Width = 9 Height = 19 @@ -187,8 +187,8 @@ object FormTCO: TFormTCO Font.Style = [fsBold] ParentFont = False end - object Label10: TLabel - Left = 504 + object Label5: TLabel + Left = 440 Top = 22 Width = 9 Height = 19 @@ -200,7 +200,7 @@ object FormTCO: TFormTCO Font.Style = [fsBold] ParentFont = False end - object Label11: TLabel + object Label6: TLabel Left = 216 Top = 70 Width = 9 @@ -213,8 +213,8 @@ object FormTCO: TFormTCO Font.Style = [fsBold] ParentFont = False end - object Label12: TLabel - Left = 288 + object Label7: TLabel + Left = 272 Top = 70 Width = 9 Height = 19 @@ -226,8 +226,8 @@ object FormTCO: TFormTCO Font.Style = [fsBold] ParentFont = False end - object Label13: TLabel - Left = 360 + object Label8: TLabel + Left = 328 Top = 70 Width = 9 Height = 19 @@ -239,9 +239,9 @@ object FormTCO: TFormTCO Font.Style = [fsBold] ParentFont = False end - object Label14: TLabel - Left = 432 - Top = 70 + object Label9: TLabel + Left = 384 + Top = 62 Width = 9 Height = 19 Caption = '9' @@ -252,8 +252,8 @@ object FormTCO: TFormTCO Font.Style = [fsBold] ParentFont = False end - object Label8: TLabel - Left = 360 + object Label3: TLabel + Left = 328 Top = 22 Width = 9 Height = 19 @@ -265,8 +265,8 @@ object FormTCO: TFormTCO Font.Style = [fsBold] ParentFont = False end - object Label9: TLabel - Left = 432 + object Label4: TLabel + Left = 384 Top = 22 Width = 9 Height = 19 @@ -278,7 +278,7 @@ object FormTCO: TFormTCO Font.Style = [fsBold] ParentFont = False end - object Label16: TLabel + object Label10: TLabel Left = 208 Top = 118 Width = 18 @@ -291,8 +291,8 @@ object FormTCO: TFormTCO Font.Style = [fsBold] ParentFont = False end - object Label17: TLabel - Left = 280 + object Label11: TLabel + Left = 272 Top = 118 Width = 17 Height = 19 @@ -304,12 +304,12 @@ object FormTCO: TFormTCO Font.Style = [fsBold] ParentFont = False end - object Label18: TLabel - Left = 352 - Top = 118 + object Label50: TLabel + Left = 680 + Top = 110 Width = 18 Height = 19 - Caption = '30' + Caption = '50' Font.Charset = ANSI_CHARSET Font.Color = clWindowText Font.Height = -16 @@ -317,8 +317,8 @@ object FormTCO: TFormTCO Font.Style = [fsBold] ParentFont = False end - object Label20: TLabel - Left = 568 + object Label12: TLabel + Left = 488 Top = 22 Width = 18 Height = 19 @@ -330,8 +330,8 @@ object FormTCO: TFormTCO Font.Style = [fsBold] ParentFont = False end - object Label3: TLabel - Left = 640 + object Label13: TLabel + Left = 552 Top = 22 Width = 18 Height = 19 @@ -343,9 +343,9 @@ object FormTCO: TFormTCO Font.Style = [fsBold] ParentFont = False end - object Label21: TLabel - Left = 712 - Top = 22 + object Label14: TLabel + Left = 608 + Top = 14 Width = 18 Height = 19 Caption = '14' @@ -356,9 +356,9 @@ object FormTCO: TFormTCO Font.Style = [fsBold] ParentFont = False end - object Label22: TLabel - Left = 784 - Top = 22 + object Label15: TLabel + Left = 664 + Top = 14 Width = 18 Height = 19 Caption = '15' @@ -369,9 +369,9 @@ object FormTCO: TFormTCO Font.Style = [fsBold] ParentFont = False end - object Label24: TLabel - Left = 496 - Top = 70 + object Label16: TLabel + Left = 432 + Top = 62 Width = 18 Height = 19 Caption = '16' @@ -382,9 +382,9 @@ object FormTCO: TFormTCO Font.Style = [fsBold] ParentFont = False end - object Label25: TLabel - Left = 568 - Top = 70 + object Label17: TLabel + Left = 488 + Top = 62 Width = 18 Height = 19 Caption = '17' @@ -395,9 +395,9 @@ object FormTCO: TFormTCO Font.Style = [fsBold] ParentFont = False end - object Label26: TLabel - Left = 640 - Top = 70 + object Label18: TLabel + Left = 544 + Top = 62 Width = 18 Height = 19 Caption = '18' @@ -408,9 +408,9 @@ object FormTCO: TFormTCO Font.Style = [fsBold] ParentFont = False end - object Label27: TLabel - Left = 712 - Top = 70 + object Label19: TLabel + Left = 608 + Top = 62 Width = 18 Height = 19 Caption = '19' @@ -421,9 +421,9 @@ object FormTCO: TFormTCO Font.Style = [fsBold] ParentFont = False end - object Label28: TLabel - Left = 784 - Top = 70 + object Label20: TLabel + Left = 664 + Top = 62 Width = 18 Height = 19 Caption = '20' @@ -434,9 +434,9 @@ object FormTCO: TFormTCO Font.Style = [fsBold] ParentFont = False end - object Label29: TLabel - Left = 856 - Top = 22 + object Label21: TLabel + Left = 728 + Top = 14 Width = 18 Height = 19 Caption = '21' @@ -447,9 +447,9 @@ object FormTCO: TFormTCO Font.Style = [fsBold] ParentFont = False end - object Label30: TLabel - Left = 928 - Top = 22 + object Label22: TLabel + Left = 784 + Top = 14 Width = 18 Height = 19 Caption = '22' @@ -460,12 +460,12 @@ object FormTCO: TFormTCO Font.Style = [fsBold] ParentFont = False end - object Label31: TLabel - Left = 424 - Top = 118 + object Label51: TLabel + Left = 720 + Top = 110 Width = 18 Height = 19 - Caption = '31' + Caption = '51' Font.Charset = ANSI_CHARSET Font.Color = clWindowText Font.Height = -16 @@ -473,9 +473,9 @@ object FormTCO: TFormTCO Font.Style = [fsBold] ParentFont = False end - object Label5: TLabel - Left = 856 - Top = 70 + object Label24: TLabel + Left = 728 + Top = 62 Width = 18 Height = 19 Caption = '24' @@ -486,9 +486,9 @@ object FormTCO: TFormTCO Font.Style = [fsBold] ParentFont = False end - object Label32: TLabel - Left = 928 - Top = 70 + object Label25: TLabel + Left = 792 + Top = 62 Width = 18 Height = 19 Caption = '25' @@ -502,98 +502,98 @@ object FormTCO: TFormTCO object ImagePalette1: TImage Left = 232 Top = 8 - Width = 41 - Height = 41 + Width = 33 + Height = 33 OnDragOver = ImagePalette1DragOver OnEndDrag = ImagePalette1EndDrag OnMouseDown = ImagePalette1MouseDown end object ImagePalette2: TImage - Left = 304 + Left = 288 Top = 8 - Width = 41 - Height = 41 + Width = 33 + Height = 33 OnDragOver = ImagePalette2DragOver OnEndDrag = ImagePalette2EndDrag OnMouseDown = ImagePalette2MouseDown end object ImagePalette3: TImage - Left = 376 + Left = 344 Top = 8 - Width = 41 - Height = 41 + Width = 33 + Height = 33 OnDragOver = ImagePalette3DragOver OnEndDrag = ImagePalette3EndDrag OnMouseDown = ImagePalette3MouseDown end object ImagePalette4: TImage - Left = 448 + Left = 400 Top = 8 - Width = 41 - Height = 41 + Width = 33 + Height = 33 OnDragOver = ImagePalette4DragOver OnEndDrag = ImagePalette4EndDrag OnMouseDown = ImagePalette4MouseDown end object ImagePalette5: TImage - Left = 520 + Left = 448 Top = 8 - Width = 41 - Height = 41 + Width = 33 + Height = 33 OnDragOver = ImagePalette5DragOver OnEndDrag = ImagePalette5EndDrag OnMouseDown = ImagePalette5MouseDown end object ImagePalette12: TImage - Left = 592 + Left = 512 Top = 8 - Width = 41 - Height = 41 + Width = 33 + Height = 33 OnDragOver = ImagePalette12DragOver OnEndDrag = ImagePalette12EndDrag OnMouseDown = ImagePalette12MouseDown end object ImagePalette13: TImage - Left = 664 + Left = 576 Top = 8 - Width = 41 - Height = 41 + Width = 33 + Height = 33 OnDragOver = ImagePalette13DragOver OnEndDrag = ImagePalette13EndDrag OnMouseDown = ImagePalette13MouseDown end object ImagePalette14: TImage - Left = 736 + Left = 624 Top = 8 - Width = 41 - Height = 41 + Width = 33 + Height = 33 OnDragOver = ImagePalette14DragOver OnEndDrag = ImagePalette14EndDrag OnMouseDown = ImagePalette14MouseDown end object ImagePalette15: TImage - Left = 808 + Left = 688 Top = 8 - Width = 41 - Height = 41 + Width = 33 + Height = 33 OnDragOver = ImagePalette15DragOver OnEndDrag = ImagePalette15EndDrag OnMouseDown = ImagePalette15MouseDown end object ImagePalette21: TImage - Left = 880 + Left = 752 Top = 8 - Width = 41 - Height = 41 + Width = 33 + Height = 33 OnDragOver = ImagePalette21DragOver OnEndDrag = ImagePalette21EndDrag OnMouseDown = ImagePalette21MouseDown end object ImagePalette22: TImage - Left = 952 + Left = 808 Top = 8 - Width = 41 - Height = 41 + Width = 33 + Height = 33 OnDragOver = ImagePalette22DragOver OnEndDrag = ImagePalette22EndDrag OnMouseDown = ImagePalette22MouseDown @@ -601,89 +601,89 @@ object FormTCO: TFormTCO object ImagePalette6: TImage Left = 232 Top = 56 - Width = 41 - Height = 41 + Width = 33 + Height = 33 OnDragOver = ImagePalette6DragOver OnEndDrag = ImagePalette6EndDrag OnMouseDown = ImagePalette6MouseDown end object ImagePalette7: TImage - Left = 304 + Left = 288 Top = 56 - Width = 41 - Height = 41 + Width = 33 + Height = 33 OnDragOver = ImagePalette7DragOver OnEndDrag = ImagePalette7EndDrag OnMouseDown = ImagePalette7MouseDown end object ImagePalette9: TImage - Left = 448 + Left = 400 Top = 56 - Width = 41 - Height = 41 + Width = 33 + Height = 33 OnDragOver = ImagePalette9DragOver OnEndDrag = ImagePalette9EndDrag OnMouseDown = ImagePalette9MouseDown end object ImagePalette16: TImage - Left = 520 + Left = 448 Top = 56 - Width = 41 - Height = 41 + Width = 33 + Height = 33 OnDragOver = ImagePalette16DragOver OnEndDrag = ImagePalette16EndDrag OnMouseDown = ImagePalette16MouseDown end object ImagePalette17: TImage - Left = 592 + Left = 504 Top = 56 - Width = 41 - Height = 41 + Width = 33 + Height = 33 OnDragOver = ImagePalette17DragOver OnEndDrag = ImagePalette17EndDrag OnMouseDown = ImagePalette17MouseDown end object ImagePalette18: TImage - Left = 664 + Left = 576 Top = 56 - Width = 41 - Height = 41 + Width = 33 + Height = 33 OnDragOver = ImagePalette18DragOver OnEndDrag = ImagePalette18EndDrag OnMouseDown = ImagePalette18MouseDown end object ImagePalette19: TImage - Left = 736 + Left = 624 Top = 56 - Width = 41 - Height = 41 + Width = 33 + Height = 33 OnDragOver = ImagePalette19DragOver OnEndDrag = ImagePalette19EndDrag OnMouseDown = ImagePalette19MouseDown end object ImagePalette20: TImage - Left = 808 + Left = 688 Top = 56 - Width = 41 - Height = 41 + Width = 33 + Height = 33 OnDragOver = ImagePalette20DragOver OnEndDrag = ImagePalette20EndDrag OnMouseDown = ImagePalette20MouseDown end object ImagePalette24: TImage - Left = 880 + Left = 752 Top = 56 - Width = 41 - Height = 41 + Width = 33 + Height = 33 OnDragOver = ImagePalette24DragOver OnEndDrag = ImagePalette24EndDrag OnMouseDown = ImagePalette24MouseDown end object ImagePalette25: TImage - Left = 952 + Left = 808 Top = 56 - Width = 41 - Height = 41 + Width = 33 + Height = 33 OnDragOver = ImagePalette25DragOver OnEndDrag = ImagePalette25EndDrag OnMouseDown = ImagePalette25MouseDown @@ -691,35 +691,35 @@ object FormTCO: TFormTCO object ImagePalette10: TImage Left = 232 Top = 104 - Width = 41 - Height = 41 + Width = 33 + Height = 33 OnDragOver = ImagePalette10DragOver OnEndDrag = ImagePalette10EndDrag OnMouseDown = ImagePalette10MouseDown end object ImagePalette11: TImage - Left = 304 + Left = 288 Top = 104 - Width = 41 - Height = 41 + Width = 33 + Height = 33 OnDragOver = ImagePalette11DragOver OnEndDrag = ImagePalette11EndDrag OnMouseDown = ImagePalette11MouseDown end - object ImagePalette31: TImage - Left = 448 + object ImagePalette51: TImage + Left = 736 Top = 104 - Width = 41 - Height = 41 + Width = 33 + Height = 33 Hint = 'Quai' ParentShowHint = False ShowHint = True - OnDragOver = ImagePalette31DragOver - OnEndDrag = ImagePalette31EndDrag - OnMouseDown = ImagePalette31MouseDown + OnDragOver = ImagePalette51DragOver + OnEndDrag = ImagePalette51EndDrag + OnMouseDown = ImagePalette51MouseDown end - object ImagePalette30: TImage - Left = 384 + object ImagePalette50: TImage + Left = 696 Top = 104 Width = 25 Height = 41 @@ -727,23 +727,199 @@ object FormTCO: TFormTCO ParentShowHint = False ShowHint = True Stretch = True - OnDragOver = ImagePalette30DragOver - OnEndDrag = ImagePalette30EndDrag - OnMouseDown = ImagePalette30MouseDown + OnDragOver = ImagePalette50DragOver + OnEndDrag = ImagePalette50EndDrag + OnMouseDown = ImagePalette50MouseDown end object ImagePalette8: TImage - Left = 376 + Left = 344 Top = 56 - Width = 41 - Height = 41 + Width = 33 + Height = 33 OnDragOver = ImagePalette8DragOver OnEndDrag = ImagePalette8EndDrag OnMouseDown = ImagePalette8MouseDown end + object ImagePalette26: TImage + Left = 344 + Top = 104 + Width = 33 + Height = 33 + OnDragOver = ImagePalette26DragOver + OnEndDrag = ImagePalette26EndDrag + OnMouseDown = ImagePalette26MouseDown + end + object Label26: TLabel + Left = 320 + Top = 118 + Width = 18 + Height = 19 + Caption = '26' + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Arial' + Font.Style = [fsBold] + ParentFont = False + end + object ImagePalette23: TImage + Left = 496 + Top = 104 + Width = 33 + Height = 33 + OnDragOver = ImagePalette23DragOver + OnEndDrag = ImagePalette23EndDrag + OnMouseDown = ImagePalette23MouseDown + end + object Label23: TLabel + Left = 480 + Top = 110 + Width = 18 + Height = 19 + Caption = '23' + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Arial' + Font.Style = [fsBold] + ParentFont = False + end + object Label27: TLabel + Left = 376 + Top = 118 + Width = 18 + Height = 19 + Caption = '27' + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Arial' + Font.Style = [fsBold] + ParentFont = False + end + object ImagePalette27: TImage + Left = 400 + Top = 104 + Width = 33 + Height = 33 + OnDragOver = ImagePalette27DragOver + OnEndDrag = ImagePalette27EndDrag + OnMouseDown = ImagePalette27MouseDown + end + object ImagePalette28: TImage + Left = 448 + Top = 104 + Width = 33 + Height = 33 + OnDragOver = ImagePalette28DragOver + OnEndDrag = ImagePalette28EndDrag + OnMouseDown = ImagePalette28MouseDown + end + object Label28: TLabel + Left = 432 + Top = 110 + Width = 18 + Height = 19 + Caption = '28' + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Arial' + Font.Style = [fsBold] + ParentFont = False + end + object Label29: TLabel + Left = 536 + Top = 110 + Width = 18 + Height = 19 + Caption = '29' + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Arial' + Font.Style = [fsBold] + ParentFont = False + end + object ImagePalette29: TImage + Left = 552 + Top = 104 + Width = 33 + Height = 33 + OnDragOver = ImagePalette29DragOver + OnEndDrag = ImagePalette29EndDrag + OnMouseDown = ImagePalette29MouseDown + end + object Label32: TLabel + Left = 584 + Top = 110 + Width = 18 + Height = 19 + Caption = '32' + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Arial' + Font.Style = [fsBold] + ParentFont = False + end + object ImagePalette32: TImage + Left = 600 + Top = 104 + Width = 33 + Height = 33 + OnDragOver = ImagePalette32DragOver + OnEndDrag = ImagePalette32EndDrag + OnMouseDown = ImagePalette32MouseDown + end + object Label33: TLabel + Left = 632 + Top = 110 + Width = 18 + Height = 19 + Caption = '33' + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Arial' + Font.Style = [fsBold] + ParentFont = False + end + object ImagePalette33: TImage + Left = 648 + Top = 104 + Width = 33 + Height = 33 + OnDragOver = ImagePalette33DragOver + OnEndDrag = ImagePalette33EndDrag + OnMouseDown = ImagePalette33MouseDown + end + object Label34: TLabel + Left = 208 + Top = 150 + Width = 18 + Height = 19 + Caption = '34' + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = 'Arial' + Font.Style = [fsBold] + ParentFont = False + end + object ImagePalette34: TImage + Left = 232 + Top = 136 + Width = 33 + Height = 33 + OnDragOver = ImagePalette34DragOver + OnEndDrag = ImagePalette34EndDrag + OnMouseDown = ImagePalette34MouseDown + end object ButtonSauveTCO: TButton - Left = 1015 + Left = 1025 Top = 48 - Width = 92 + Width = 96 Height = 33 Anchors = [akTop, akRight] Caption = 'Sauvegarder TCO' @@ -753,9 +929,9 @@ object FormTCO: TFormTCO OnClick = ButtonSauveTCOClick end object ButtonRedessine: TButton - Left = 1015 + Left = 1025 Top = 8 - Width = 92 + Width = 96 Height = 33 Anchors = [akTop, akRight] Caption = 'Redessine' @@ -764,8 +940,8 @@ object FormTCO: TFormTCO OnClick = ButtonRedessineClick end object Button1: TButton - Left = 496 - Top = 136 + Left = 928 + Top = 56 Width = 89 Height = 25 Caption = 'Simu det 1' @@ -773,8 +949,8 @@ object FormTCO: TFormTCO OnClick = Button1Click end object Button2: TButton - Left = 496 - Top = 104 + Left = 928 + Top = 32 Width = 89 Height = 25 Caption = 'Simu Det 0' @@ -782,9 +958,9 @@ object FormTCO: TFormTCO OnClick = Button2Click end object ButtonConfigTCO: TButton - Left = 1015 + Left = 1025 Top = 88 - Width = 92 + Width = 96 Height = 33 Anchors = [akTop, akRight] Caption = 'Configuration TCO' @@ -793,8 +969,8 @@ object FormTCO: TFormTCO OnClick = ButtonConfigTCOClick end object ButtonSimu: TButton - Left = 592 - Top = 128 + Left = 728 + Top = 136 Width = 113 Height = 25 Caption = 'Simu canton occup'#233 @@ -802,9 +978,9 @@ object FormTCO: TFormTCO OnClick = ButtonSimuClick end object ButtonMasquer: TButton - Left = 1015 + Left = 1025 Top = 128 - Width = 92 + Width = 96 Height = 33 Anchors = [akTop, akRight] Caption = 'Masquer bandeau' @@ -826,7 +1002,7 @@ object FormTCO: TFormTCO Font.Style = [] ParentFont = False TabOrder = 7 - object Label4: TLabel + object Label41: TLabel Left = 8 Top = 16 Width = 103 @@ -839,7 +1015,7 @@ object FormTCO: TFormTCO Font.Style = [] ParentFont = False end - object Label15: TLabel + object Label71: TLabel Left = 8 Top = 38 Width = 93 @@ -852,7 +1028,7 @@ object FormTCO: TFormTCO Font.Style = [] ParentFont = False end - object Label23: TLabel + object Label230: TLabel Left = 56 Top = 64 Width = 27 @@ -865,7 +1041,7 @@ object FormTCO: TFormTCO Font.Style = [] ParentFont = False end - object Label1: TLabel + object Label65: TLabel Left = 8 Top = 88 Width = 75 @@ -897,6 +1073,7 @@ object FormTCO: TFormTCO ParentFont = False TabOrder = 0 OnChange = EditAdrElementChange + OnClick = EditAdrElementClick end object EditTypeImage: TEdit Left = 144 @@ -975,9 +1152,9 @@ object FormTCO: TFormTCO end end object buttonRaz: TButton - Left = 911 + Left = 920 Top = 128 - Width = 92 + Width = 96 Height = 33 Anchors = [akTop, akRight] Caption = 'Raz des occupations' @@ -987,8 +1164,8 @@ object FormTCO: TFormTCO OnClick = buttonRazClick end object ButtonCalibrage: TButton - Left = 592 - Top = 104 + Left = 848 + Top = 136 Width = 75 Height = 25 Caption = 'Calibrage' @@ -996,9 +1173,9 @@ object FormTCO: TFormTCO OnClick = ButtonCalibrageClick end object ButtonDessiner: TButton - Left = 816 - Top = 128 - Width = 89 + Left = 920 + Top = 88 + Width = 96 Height = 33 Hint = 'Dessine le TCO '#224' la souris. Clic droit pour lever le pointeur. T' + @@ -1012,8 +1189,8 @@ object FormTCO: TFormTCO OnClick = ButtonDessinerClick end object ButtonTrajet: TButton - Left = 712 - Top = 128 + Left = 936 + Top = 8 Width = 75 Height = 25 Caption = 'Trajets' @@ -1022,7 +1199,7 @@ object FormTCO: TFormTCO end end object ButtonAfficheBandeau: TButton - Left = 1069 + Left = 1070 Top = 415 Width = 57 Height = 33 diff --git a/UnitTCO.pas b/UnitTCO.pas index 27a56d7..b1986b7 100644 --- a/UnitTCO.pas +++ b/UnitTCO.pas @@ -1,5 +1,5 @@ unit UnitTCO; - +// na pas utiliser les éléments 30 et 31 qui sont les anciens signaux et quais interface uses @@ -10,7 +10,7 @@ uses type TFormTCO = class(TForm) LabelCoord: TLabel; - Label2: TLabel; + LabelCellule: TLabel; PopupMenu1: TPopupMenu; MenuCouper: TMenuItem; N1: TMenuItem; @@ -25,41 +25,41 @@ type Pos_vert: TMenuItem; TrackBarZoom: TTrackBar; Panel1: TPanel; + Label1: TLabel; + Label2: TLabel; + Label5: TLabel; Label6: TLabel; Label7: TLabel; - Label10: TLabel; - Label11: TLabel; - Label12: TLabel; - Label13: TLabel; - Label14: TLabel; Label8: TLabel; Label9: TLabel; - Label16: TLabel; - Label17: TLabel; - Label18: TLabel; + Label3: TLabel; + Label4: TLabel; + Label10: TLabel; + Label11: TLabel; + Label50: TLabel; ButtonSauveTCO: TButton; ButtonRedessine: TButton; Button1: TButton; Button2: TButton; - Label19: TLabel; + LabelZoom: TLabel; ButtonConfigTCO: TButton; Annulercouper: TMenuItem; N5: TMenuItem; - Label20: TLabel; - Label3: TLabel; - Label21: TLabel; - Label22: TLabel; + Label12: TLabel; + Label13: TLabel; + Label14: TLabel; + Label15: TLabel; ButtonSimu: TButton; - Label24: TLabel; - Label25: TLabel; - Label26: TLabel; - Label27: TLabel; - Label28: TLabel; + Label16: TLabel; + Label17: TLabel; + Label18: TLabel; + Label19: TLabel; + Label20: TLabel; ButtonMasquer: TButton; ButtonAfficheBandeau: TButton; - Label29: TLabel; - Label30: TLabel; - Label31: TLabel; + Label21: TLabel; + Label22: TLabel; + Label51: TLabel; FontDialog1: TFontDialog; N2: TMenuItem; Signalgauchedelavoie1: TMenuItem; @@ -68,15 +68,15 @@ type Signal1: TMenuItem; N4: TMenuItem; GroupBox1: TGroupBox; - Label4: TLabel; + Label41: TLabel; EditAdrElement: TEdit; EditTypeImage: TEdit; - Label15: TLabel; + Label71: TLabel; ButtonFonte: TButton; - Label23: TLabel; + Label230: TLabel; EditTexte: TEdit; ComboRepr: TComboBox; - Label1: TLabel; + Label65: TLabel; CheckPinv: TCheckBox; N6: TMenuItem; Inserer: TMenuItem; @@ -93,8 +93,8 @@ type ButtonCoulFond: TButton; ColorDialog1: TColorDialog; ShapeCoulFond: TShape; - Label5: TLabel; - Label32: TLabel; + Label24: TLabel; + Label25: TLabel; ImagePalette1: TImage; ImagePalette2: TImage; ImagePalette3: TImage; @@ -118,14 +118,30 @@ type ImagePalette25: TImage; ImagePalette10: TImage; ImagePalette11: TImage; - ImagePalette31: TImage; - ImagePalette30: TImage; + ImagePalette51: TImage; + ImagePalette50: TImage; ImagePalette8: TImage; ImageTemp: TImage; ImageTemp2: TImage; outslectionner1: TMenuItem; ButtonDessiner: TButton; ButtonTrajet: TButton; + ImagePalette26: TImage; + Label26: TLabel; + ImagePalette23: TImage; + Label23: TLabel; + Label27: TLabel; + ImagePalette27: TImage; + ImagePalette28: TImage; + Label28: TLabel; + Label29: TLabel; + ImagePalette29: TImage; + Label32: TLabel; + ImagePalette32: TImage; + Label33: TLabel; + ImagePalette33: TImage; + Label34: TLabel; + ImagePalette34: TImage; procedure FormCreate(Sender: TObject); procedure FormActivate(Sender: TObject); procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); @@ -168,7 +184,6 @@ type procedure MenuCopierClick(Sender: TObject); procedure MenuCollerClick(Sender: TObject); procedure ButtonRedessineClick(Sender: TObject); - procedure grille; procedure EditAdrElementChange(Sender: TObject); procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); @@ -180,8 +195,8 @@ type procedure ImagePalette11MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); procedure ButtonConfigTCOClick(Sender: TObject); - procedure ImagePalette30EndDrag(Sender, Target: TObject; X, Y: Integer); - procedure ImagePalette30MouseDown(Sender: TObject; Button: TMouseButton; + procedure ImagePalette50EndDrag(Sender, Target: TObject; X, Y: Integer); + procedure ImagePalette50MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); procedure Tourner90GClick(Sender: TObject); procedure Tourner90DClick(Sender: TObject); @@ -281,15 +296,15 @@ type Y: Integer; State: TDragState; var Accept: Boolean); procedure ImagePalette11DragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); - procedure ImagePalette30DragOver(Sender, Source: TObject; X, + procedure ImagePalette50DragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); procedure Panel1DragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); - procedure ImagePalette31DragOver(Sender, Source: TObject; X, + procedure ImagePalette51DragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); - procedure ImagePalette31EndDrag(Sender, Target: TObject; X, + procedure ImagePalette51EndDrag(Sender, Target: TObject; X, Y: Integer); - procedure ImagePalette31MouseDown(Sender: TObject; + procedure ImagePalette51MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); procedure ButtonFonteClick(Sender: TObject); procedure FontDialog1Show(Sender: TObject); @@ -332,14 +347,65 @@ type procedure outslectionner1Click(Sender: TObject); procedure ButtonDessinerClick(Sender: TObject); procedure ButtonTrajetClick(Sender: TObject); - - private + procedure ImagePalette26DragOver(Sender, Source: TObject; X, + Y: Integer; State: TDragState; var Accept: Boolean); + procedure ImagePalette26EndDrag(Sender, Target: TObject; X, + Y: Integer); + procedure ImagePalette26MouseDown(Sender: TObject; + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + procedure ImagePalette23EndDrag(Sender, Target: TObject; X, + Y: Integer); + procedure ImagePalette23DragOver(Sender, Source: TObject; X, + Y: Integer; State: TDragState; var Accept: Boolean); + procedure ImagePalette23MouseDown(Sender: TObject; + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + procedure ImagePalette27DragOver(Sender, Source: TObject; X, + Y: Integer; State: TDragState; var Accept: Boolean); + procedure ImagePalette27MouseDown(Sender: TObject; + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + procedure ImagePalette27EndDrag(Sender, Target: TObject; X, + Y: Integer); + procedure ImagePalette28DragOver(Sender, Source: TObject; X, + Y: Integer; State: TDragState; var Accept: Boolean); + procedure ImagePalette28EndDrag(Sender, Target: TObject; X, + Y: Integer); + procedure ImagePalette28MouseDown(Sender: TObject; + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + procedure ImagePalette29DragOver(Sender, Source: TObject; X, + Y: Integer; State: TDragState; var Accept: Boolean); + procedure ImagePalette29EndDrag(Sender, Target: TObject; X, + Y: Integer); + procedure ImagePalette29MouseDown(Sender: TObject; + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + procedure ImagePalette32DragOver(Sender, Source: TObject; X, + Y: Integer; State: TDragState; var Accept: Boolean); + procedure ImagePalette32EndDrag(Sender, Target: TObject; X, + Y: Integer); + procedure ImagePalette32MouseDown(Sender: TObject; + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + procedure ImagePalette33DragOver(Sender, Source: TObject; X, + Y: Integer; State: TDragState; var Accept: Boolean); + procedure ImagePalette33EndDrag(Sender, Target: TObject; X, + Y: Integer); + procedure ImagePalette33MouseDown(Sender: TObject; + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + procedure ImagePalette34DragOver(Sender, Source: TObject; X, + Y: Integer; State: TDragState; var Accept: Boolean); + procedure ImagePalette34EndDrag(Sender, Target: TObject; X, + Y: Integer); + procedure ImagePalette34MouseDown(Sender: TObject; + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); + procedure EditAdrElementClick(Sender: TObject); + + private { Déclarations privées } public { Déclarations publiques } end; const + licone=35; + hicone=35; maxUndo=30; ZoomMax=50;ZoomMin=15; MaxCellX=150;MaxCellY=70; @@ -357,16 +423,19 @@ const AvecGrille_ch='AvecGrille'; ModeCouleurCanton_ch='ModeCouleurCanton'; Graphisme_ch='Graphisme'; - // liaisons des voies pour chaque icone par bit (0=NO 1=Nors 2=NE 3=Est 4=SE 5=S 6=SO 7=Ouest) - Liaisons : array[0..31] of integer= - (0,$88,$c8,$8c,$98,$89,$9,$84,$90,$48,$44,$11,$19,$c4,$91,$4c,$21,$24,$42,$12,$22,$cc,$99,$00,$23,$33,0,0,0,0,0,0) ; + // liaisons des voies pour chaque icone par bit (0=NO 1=Nord 2=NE 3=Est 4=SE 5=S 6=SO 7=Ouest) + Liaisons : array[0..51] of integer= + // 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 + (0,$88,$c8,$8c,$98,$89,$9,$84,$90,$48,$44,$11,$19,$c4,$91,$4c,$21,$24,$42,$12,$22,$cc,$99,$66,$23,$33,$26,$62,$32,$31,0,0, + // 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 + $62,$13,$46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) ; type // structure du TCO TTCO = record Adresse : integer; // adresse du détecteur ou de l'aiguillage ou du feu - BImage : integer; // 0=rien 1=voie 2=aiguillage gauche gauche ... 30=feu + BImage : integer; // 0=rien 1=voie 2=aiguillage gauche gauche ... 50=feu mode : integer; // couleur de voie 0=éteint 1=ClVoies 2=couleur en fonction du train - trajet : integer; // décrit le trajet ouvert sur la voie (cas d'un croisement ou d'ue tjd/S) + 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 Texte : string; // texte de la cellule @@ -378,6 +447,7 @@ type // pour les signaux seulement PiedFeu : integer; // type de pied au signal : signal à gauche=1 ou à droite=2 de la voie 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 liaisons : integer; // quadrants des liaisons end; @@ -389,7 +459,7 @@ var Forminit,SelectionAffichee,TamponAffecte,entoure,TCO_modifie,clicsouris, clicTCO,piloteAig,BandeauMasque,eval_format,sauve_tco,formConfCellTCOAff, - drag,TCOActive,TCOCree,modeTrace,ancienok,dbleClicTCO : boolean; + drag,TCOActive,TCOCree,modeTrace,ancienok,dbleClicTCO,auto_tcurs : boolean; HtImageTCO,LargImageTCO,XclicCell,YclicCell,XminiSel,YminiSel,XCoupe,Ycoupe,Temposouris, XmaxiSel,YmaxiSel,AncienXMiniSel,AncienXMaxiSel ,AncienYMiniSel,AncienYMaxiSel, @@ -404,11 +474,7 @@ var Undo : array[1..MaxUndo] of record nombre : integer; - element : array[1..100] of - record - x,y,Bimage : integer; - texte : string; - end; + element : array[1..100] of TTCO ; end; // pour copier coller @@ -451,6 +517,7 @@ procedure change_couleur_fond; function verif_cellule(x,y,Bim : integer) : boolean; procedure dessine_icones; procedure echange(var a,b : integer); +procedure Efface_Cellule(Canvas : Tcanvas;x,y : integer;Mode : TPenMode); implementation @@ -489,7 +556,7 @@ begin NbreCellX:=35;NbreCellY:=20;LargeurCell:=35;HauteurCell:=35; largeurCelld2:=largeurCell div 2;HauteurCelld2:=HauteurCell div 2; RatioC:=10; - ClFond:=$202050; + ClFond:=$000040; ClVoies:=$0077FF; ClAllume:=$00FFFF; ClGrille:=$404040; @@ -503,7 +570,21 @@ begin SetLength(TamponTCO,NbreCellX+1,NbreCellY+1); for x:=1 to NbreCellX do for y:=1 to NbreCellY do - tco[x,y].CouleurFond:=clfond; + with tco[x,y] do + begin + CouleurFond:=clfond; + Adresse:=0; + Bimage:=0; + repr:=0; + Texte:=''; + fonte:=''; + fontSTyle:=''; + piedFeu:=0; + x:=0; + y:=0; + FeuOriente:=0; + Liaisons:=0; + end; exit; end; {$I-} @@ -756,7 +837,8 @@ begin i:=pos(',',s); if i=0 then begin Affiche('ETCO6',clred);closefile(fichier);exit;end; val(copy(s,1,i-1),valeur,erreur);if erreur<>0 then begin Affiche('ETCO7',clred);closefile(fichier);exit;end; - if valeur=23 then begin valeur:=31;sauve_tco:=true;end; // nouvelle version icone 23 passe à 31 + if valeur=30 then begin valeur:=50;sauve_tco:=true;end; + if valeur=31 then begin valeur:=51;sauve_tco:=true;end; tco[x,y].Bimage:=valeur; tco[x,y].liaisons:=liaisons[valeur]; delete(s,1,i); @@ -781,9 +863,9 @@ begin delete(s,1,i); // si c'est un signal, remplir les paramètres du signal - if tco[x,y].Bimage=30 then + if tco[x,y].Bimage=50 then begin - i:=index_feu(adresse); + i:=Index_Signal(adresse); if i<>0 then begin //Affiche('Feu '+IntToSTR(Adresse)+' aspect='+intToSTR(aspect),clyellow); @@ -911,7 +993,7 @@ begin if TCO[x,y].inverse then s:=s+'1,' else s:=s+'0,'; - if TCO[x,y].BImage=30 then + if TCO[x,y].BImage=50 then begin s:=s+IntToSTR(TCO[x,y].FeuOriente)+','+IntToSTR(TCO[x,y].PiedFeu)+','; end @@ -970,29 +1052,6 @@ begin; end; -procedure TformTCO.grille; -var x,y : integer; -begin - if not(AvecGrille) then exit; - With PCanvasTCO do - begin - pen.color:=ClGrille; - pen.Width:=1; - Brush.Color:=ClFond; - pen.mode:=PmCopy; - // lignes verticales - for x:=1 to NbreCellX do - begin - moveto(x*LargeurCell,1); - LineTo(x*LargeurCell,HauteurCell*NbreCelly); - end; - for y:=1 to NbreCelly do - begin - moveto(1,y*HauteurCell); - LineTo(LargeurCell*NbreCellX,y*HauteurCell); - end; - end; -end; function positionTCO(x,y : integer) : integer; var position,i : integer; @@ -2878,7 +2937,6 @@ end; procedure dessin_13C(Canvas : Tcanvas;x,y : integer;Mode : integer); var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position : integer; - r : Trect; fond : tcolor; procedure trajet_droit; @@ -3564,7 +3622,6 @@ begin xf:=x0+largeurCell; // x fin yf:=y0+HauteurCell; // y fin // mode rond - // mode rond x1:=x0-(2*largeurCell)-(largeurcell div 2);y1:=y0-(hauteurCell div 3); x2:=x0+(largeurcell div 2);y2:=yf+hauteurcell+(hauteurCell div 3); x3:=xc;y3:=yf; @@ -3892,7 +3949,6 @@ end; // Element 22 procedure dessin_22(Canvas : Tcanvas;x,y,mode : integer); var x0,y0,xc,yc,trajet : integer; - r : Trect; begin x0:=(x-1)*LargeurCell; y0:=(y-1)*HauteurCell; @@ -3939,8 +3995,8 @@ begin end; end; -// Element 23 (31) -procedure dessin_31(Canvas : Tcanvas;x,y,mode: integer); +// Element 51 (quai) +procedure dessin_51(Canvas : Tcanvas;x,y,mode: integer); var x0,y0,x1,x2,jy1,jy2 : integer; r : Trect; begin @@ -4017,7 +4073,7 @@ var x0,y0,xc,yc,jx1,jy1,xf,yf,position : integer; moveto(xc,y0);lineto(xc,yf); // verticale complete moveTo(x0,y0);lineto(xc,yc); // partie déviée end; - + if (mode=1) or (mode=2) then with canvas do begin @@ -4033,7 +4089,7 @@ var x0,y0,xc,yc,jx1,jy1,xf,yf,position : integer; moveto(x0,y0);LineTo(xc,yc);LineTo(xc,yf); // trajet déviée end; end; - + begin x0:=(x-1)*LargeurCell; // x origine @@ -4068,14 +4124,14 @@ begin trajet_droit; end; - + if (position=const_Devie) then begin // effacement du morceau pen.color:=fond; Brush.Color:=fond; pen.width:=1; - jy1:=yc - Epaisseur-1; + jy1:=yc - Epaisseur-1; jx1:=xc-(Epaisseur div 2); pen.width:=1; Polygon([point(jx1,jy1),Point(jx1+epaisseur,jy1+epaisseur),Point(jx1+epaisseur,jy1-epaisseur),Point(jx1,jy1-epaisseur)]); @@ -4155,7 +4211,7 @@ begin x2:=x0+(largeurcell div 2);y2:=yf+hauteurcell+(hauteurCell div 3); x3:=xc;y3:=yf; x4:=x0;y4:=y0; - + with canvas do begin Pen.Width:=1; @@ -4217,6 +4273,59 @@ begin end; end; +// Element 23 croisement +procedure dessin_23(Canvas : Tcanvas;x,y,mode: integer); +var x0,y0,xf,yf,xc,yc,trajet : integer; +begin + x0:=(x-1)*LargeurCell; + y0:=(y-1)*HauteurCell; + xc:=x0+(LargeurCell div 2); + yc:=y0+(hauteurCell div 2); + xf:=x0+LargeurCell; + yf:=y0+HauteurCell; + + with canvas do + begin + Pen.Width:=1; + Brush.Color:=TCO[x,y].CouleurFond; + //r:=Rect(x0,y0,x0+LargeurCell,y0+HauteurCell); + //FillRect(r); + + Brush.Color:=clvoies; + pen.color:=clvoies; + pen.width:=epaisseur; + + moveto(xf,y0);lineTo(x0,yf); // diagonale + moveTo(xc,y0);LineTo(xc,yf); // verticale + + // regarder d'ou on vient de la route du tco + if mode>0 then + begin + trajet:=tco[x,y].trajet; + case mode of + 0: couleur:=clVoies; + 1: couleur:=ClCanton; + 2: couleur:=couleurtrain[index_couleur]; + end; + Brush.Color:=couleur; + pen.color:=couleur; + if trajet=1 then begin moveTo(xc,y0);LineTo(xc,yf);end; // verticale + if trajet=2 then begin moveto(xf,y0);lineTo(x0,yf);end; // diagonale + if trajet=3 then + begin + moveto(xf,y0);LineTo(xc,yc);lineTo(xc,yf); // + end; + if trajet=4 then + begin + moveto(xc,y0);LineTo(xc,yc);lineTo(x0,yf); // -\ + end; + + end; + end; +end; + + + procedure dessin_24(Canvas : Tcanvas;x,y : integer;Mode : integer); begin if graphisme=1 then dessin_24L(Canvas,x,y,Mode); @@ -4274,7 +4383,1781 @@ begin end; end; +// Element 26 +procedure dessin_26L(Canvas : Tcanvas;x,y,mode: integer); +var x0,y0,xc,yc,jx1,jy1,xf,yf,position : integer; + r : Trect; + fond: tcolor; + procedure trajet_droit; + begin + if mode=0 then + with canvas do + begin + pen.color:=clvoies; + Brush.Color:=clvoies; + moveto(xc,y0);lineto(xc,yf); // partie droite + moveto(xf,y0);lineto(xc,yc); // partie déviée + end; + + if (mode=1) or (mode=2) then + with canvas do + begin + pen.color:=clvoies; + Brush.Color:=clvoies; + moveto(xf,y0);lineto(xc,yc); // partie déviée éteinte + + if mode=1 then couleur:=ClCanton; + if mode=2 then couleur:=couleurtrain[index_couleur]; + pen.color:=couleur; + Brush.Color:=couleur; + // 2eme partie droite toujours allumée + moveto(xc,yf);LineTo(xc,yc); + + // 1ere partie en fonction de la position + if position=const_devie then + begin + pen.color:=clvoies; + Brush.Color:=clvoies; + end; + LineTo(xc,y0); + end; + end; + + procedure trajet_devie; + begin + if mode=0 then + with canvas do + begin + pen.color:=clvoies; + Brush.Color:=clvoies; + moveto(xc,y0);lineto(xc,yf); // verticale complete + moveTo(xf,y0);lineto(xc,yc); // partie déviée + end; + + if (mode=1) or (mode=2) then + with canvas do + begin + // partie horz d en couleur de voie + pen.color:=clvoies; + Brush.Color:=clvoies; + moveto(xc,y0);LineTo(xc,yc); + + if mode=1 then couleur:=ClCanton; + if mode=2 then couleur:=couleurtrain[index_couleur]; + pen.color:=couleur; + Brush.Color:=couleur; + moveto(xf,y0);LineTo(xc,yc);LineTo(xc,yf); // trajet déviée + end; + end; + + +begin + x0:=(x-1)*LargeurCell; // x origine + y0:=(y-1)*HauteurCell; // y origine + yc:=y0+(HauteurCell div 2); // y centre + xc:=x0+(LargeurCell div 2); // x centre + xf:=x0+largeurCell; // x fin + yf:=y0+HauteurCell; // y fin + position:=positionTCO(x,y); + fond:=TCO[x,y].CouleurFond; + + with canvas do + begin + Pen.Width:=1; + Brush.Color:=fond; + Pen.Color:=Fond;; + //r:=Rect(x0,y0,xf,yf); + //FillRect(r); // efface la cellule + + Pen.Width:=epaisseur; + Brush.Color:=clVoies; + Pen.Color:=clVoies; + Pen.Mode:=pmCopy; + + if (position=const_Devie) or (position=const_inconnu) then + begin + trajet_devie; // affiche la position de la branche déviée + end; + + if (position=const_droit) or (position=const_inconnu) then + begin + trajet_droit; + end; + + if (position=const_Devie) then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.width:=1; + jy1:=yc - 2*Epaisseur-1; + jx1:=xc- (Epaisseur div 2); + pen.width:=1; + Polygon([point(jx1,jy1),Point(jx1+epaisseur,jy1),Point(jx1+epaisseur,jy1+epaisseur),Point(jx1,jy1+2*epaisseur)]); + end; + + if position=const_droit then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.Width:=1; + jx1:=xc+(Epaisseur div 2)+1; + r:=rect(jx1,yc-15,jx1+Epaisseur,yc+10); + FillRect(r); + end; + end; +end; + +// Element 26 +procedure dessin_26C(Canvas : Tcanvas;x,y,mode: integer); +var x0,y0,xc,yc,jx1,jy1,xf,yf,x1,y1,x2,y2,x3,y3,x4,y4,position : integer; + r : Trect; + fond: tcolor; + +procedure trajet_droit; + begin + couleur:=clvoies; + if mode>0 then + begin + if position=const_droit then + begin + if mode=1 then couleur:=clcanton; + if mode=2 then couleur:=couleurtrain[index_couleur]; + end; + end; + + with canvas do + begin + pen.color:=couleur; + moveto(xc,y0);lineto(xc,yf); // partie droite + end; + end; + + procedure trajet_devie; + begin + couleur:=clvoies; + if mode>0 then + begin + if position=const_devie then + begin + if mode=1 then couleur:=clcanton; + if mode=2 then couleur:=couleurtrain[index_couleur]; + end; + end; + + with canvas do + begin + pen.color:=couleur; + Arc(x1,y1,x2,y2,x3,y3,x4,y4); //courbe + end; + end; + + + +begin + x0:=(x-1)*LargeurCell; // x origine + y0:=(y-1)*HauteurCell; // y origine + yc:=y0+(HauteurCell div 2); // y centre + xc:=x0+(LargeurCell div 2); // x centre + xf:=x0+largeurCell; // x fin + yf:=y0+HauteurCell; // y fin + position:=positionTCO(x,y); + fond:=TCO[x,y].CouleurFond; + + // mode rond + x1:=x0+(largeurcell div 2);y1:=y0-(hauteurCell div 3); + x2:=xf+(2*largeurCell)+(largeurcell div 2);y2:=yf+hauteurcell+(hauteurCell div 3); + x3:=xf;y3:=y0; + x4:=xc;y4:=yf; + + with canvas do + begin + Pen.Width:=1; + Brush.Color:=fond; + Pen.Color:=Fond;; + + Pen.Width:=epaisseur; + Brush.Color:=clVoies; + Pen.Color:=clVoies; + Pen.Mode:=pmCopy; + + if mode>0 then + begin + if (position=const_devie) or (position=const_inconnu) then + begin + trajet_droit; + trajet_devie; + end; + if (position=const_droit) then + begin + trajet_devie; + trajet_droit; + end; + end + + else + begin + trajet_devie; + trajet_droit; + end; + + if (position=const_Devie) then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.width:=1; + jx1:=xc-(Epaisseur div 2); jy1:=yc - Epaisseur-5; + pen.width:=1; + Polygon([point(jx1,jy1),Point(jx1+epaisseur,jy1),Point(jx1+epaisseur,jy1+epaisseur),Point(jx1,jy1+4*epaisseur)]); + end; + + if position=const_droit then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.Width:=1; + jx1:=xc+(Epaisseur div 2); + r:=rect(jx1+1,yc-15,jx1+Epaisseur,yf); + FillRect(r); + end; + end; +end; + +procedure dessin_26(Canvas : Tcanvas;x,y : integer;Mode : integer); +begin + if graphisme=1 then dessin_26L(Canvas,x,y,Mode); + if graphisme=2 then dessin_26C(Canvas,x,y,Mode); +end; + +// Element 27 +procedure dessin_27L(Canvas : Tcanvas;x,y,mode: integer); +var x0,y0,jx2,jy2,jx3,jy3,xc,yc,jx1,jy1,xf,yf,position : integer; + r : Trect; + fond: tcolor; + + procedure trajet_droit; + begin + if mode=0 then + with canvas do + begin + pen.color:=clvoies; + Brush.Color:=clvoies; + moveto(xc,y0);lineto(xc,yf); // partie droite + moveto(x0,yf);lineto(xc,yc); // partie déviée + end; + + if (mode=1) or (mode=2) then + with canvas do + begin + pen.color:=clvoies; + Brush.Color:=clvoies; + moveto(x0,yf);lineto(xc,yc); // partie déviée éteinte + + if mode=1 then couleur:=ClCanton; + if mode=2 then couleur:=couleurtrain[index_couleur]; + pen.color:=couleur; + Brush.Color:=couleur; + // 2eme partie droite toujours allumée + moveto(xc,y0);LineTo(xc,yc); + + // 1ere partie en fonction de la position + if position=const_devie then + begin + pen.color:=clvoies; + Brush.Color:=clvoies; + end; + LineTo(xc,yf); + end; + end; + + procedure trajet_devie; + begin + if mode=0 then + with canvas do + begin + pen.color:=clvoies; + Brush.Color:=clvoies; + moveto(xc,y0);lineto(xc,yf); // verticale complete + moveTo(x0,yf);lineto(xc,yc); // partie déviée + end; + + if (mode=1) or (mode=2) then + with canvas do + begin + pen.color:=clvoies; + Brush.Color:=clvoies; + moveto(xc,yf);LineTo(xc,yc); + + if mode=1 then couleur:=ClCanton; + if mode=2 then couleur:=couleurtrain[index_couleur]; + pen.color:=couleur; + Brush.Color:=couleur; + moveto(x0,yf);LineTo(xc,yc);LineTo(xc,y0); // trajet déviée + end; + end; + + +begin + x0:=(x-1)*LargeurCell; // x origine + y0:=(y-1)*HauteurCell; // y origine + yc:=y0+(HauteurCell div 2); // y centre + xc:=x0+(LargeurCell div 2); // x centre + xf:=x0+largeurCell; // x fin + yf:=y0+HauteurCell; // y fin + position:=positionTCO(x,y); + fond:=TCO[x,y].CouleurFond; + + with canvas do + begin + Pen.Width:=1; + Brush.Color:=fond; + Pen.Color:=Fond;; + //r:=Rect(x0,y0,xf,yf); + //FillRect(r); // efface la cellule + + Pen.Width:=epaisseur; + Brush.Color:=clVoies; + Pen.Color:=clVoies; + Pen.Mode:=pmCopy; + + if (position=const_Devie) or (position=const_inconnu) then + begin + trajet_devie; // affiche la position de la branche déviée + end; + + if (position=const_droit) or (position=const_inconnu) then + begin + trajet_droit; + end; + + if (position=const_Devie) then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.width:=1; + jx1:=xc-(Epaisseur div 2); jy1:=yc + Epaisseur+2; + jx2:=jx1+epaisseur;jy2:=jy1-epaisseur; + jx3:=jx2;jy3:=yc+2*epaisseur; + pen.width:=1; + Polygon([point(jx1,jy1),Point(jx2,jy2),Point(jx3,jy3),Point(jx1,jy3)]); + end; + + if position=const_droit then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.Width:=1; + jx1:=xc-(Epaisseur div 2); + r:=rect(jx1,yc-3*epaisseur,jx1-Epaisseur,yf); + FillRect(r); + end; + end; +end; + +// Element 27 +procedure dessin_27C(Canvas : Tcanvas;x,y,mode: integer); +var x0,y0,xc,yc,jx1,jy1,jx2,jy2,xf,yf,x1,y1,x2,y2,x3,y3,x4,y4,position, + jx3,jy3 : integer; + r : Trect; + fond: tcolor; + +procedure trajet_droit; + begin + couleur:=clvoies; + if mode>0 then + begin + if position=const_droit then + begin + if mode=1 then couleur:=clcanton; + if mode=2 then couleur:=couleurtrain[index_couleur]; + end; + end; + + with canvas do + begin + pen.color:=couleur; + moveto(xc,y0);lineto(xc,yf); // partie droite + end; + end; + + procedure trajet_devie; + begin + couleur:=clvoies; + if mode>0 then + begin + if position=const_devie then + begin + if mode=1 then couleur:=clcanton; + if mode=2 then couleur:=couleurtrain[index_couleur]; + end; + end; + + with canvas do + begin + pen.color:=couleur; + Arc(x1,y1,x2,y2,x3,y3,x4,y4); //courbe + end; + end; + +begin + x0:=(x-1)*LargeurCell; // x origine + y0:=(y-1)*HauteurCell; // y origine + yc:=y0+(HauteurCell div 2); // y centre + xc:=x0+(LargeurCell div 2); // x centre + xf:=x0+largeurCell; // x fin + yf:=y0+HauteurCell; // y fin + position:=positionTCO(x,y); + fond:=TCO[x,y].CouleurFond; + + // mode rond + x1:=x0-(2*largeurCell)-(largeurcell div 3);y1:=y0-hauteurcell-(hauteurCell div 3); + x2:=xc;y2:=yf+(hauteurCell div 3); // div 3 permet d'avoir un angle a 45° plutot que div 2 + + x3:=x0;y3:=yf; + x4:=xc;y4:=y0; + + with canvas do + begin + Pen.Width:=1; + Brush.Color:=fond; + Pen.Color:=Fond;; + + Pen.Width:=epaisseur; + Brush.Color:=clVoies; + Pen.Color:=clVoies; + Pen.Mode:=pmCopy; + + if mode>0 then + begin + if (position=const_devie) or (position=const_inconnu) then + begin + trajet_droit; + trajet_devie; + end; + if (position=const_droit) then + begin + trajet_devie; + trajet_droit; + end; + end + + else + begin + trajet_devie; + trajet_droit; + end; + + if (position=const_Devie) then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.width:=1; + jx1:=xc-(Epaisseur div 2); jy1:=yc + Epaisseur; + jx2:=jx1+epaisseur;jy2:=jy1-3*epaisseur; + jx3:=jx2;jy3:=yc+2*epaisseur; + pen.width:=1; + Polygon([point(jx1,jy1),Point(jx2,jy2),Point(jx3,jy3),Point(jx1,jy3)]); + end; + + if position=const_droit then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.Width:=1; + jx1:=xc-(Epaisseur div 2); + r:=rect(jx1,yc-3*epaisseur,jx1-Epaisseur,yf); + FillRect(r); + end; + end; +end; + +procedure dessin_27(Canvas : Tcanvas;x,y : integer;Mode : integer); +begin + if graphisme=1 then dessin_27L(Canvas,x,y,Mode); + if graphisme=2 then dessin_27C(Canvas,x,y,Mode); +end; + +// Element 28 +procedure dessin_28L(Canvas : Tcanvas;x,y,mode: integer); +var x0,y0,jx2,jy2,jx3,jy3,xc,yc,jx1,jy1,xf,yf,position : integer; + r : Trect; + fond: tcolor; + + procedure trajet_droit; + begin + if mode=0 then + with canvas do + begin + pen.color:=clvoies; + Brush.Color:=clvoies; + moveto(xc,y0);lineto(xc,yf); // partie droite + moveto(xf,yf);lineto(xc,yc); // partie déviée + end; + + if (mode=1) or (mode=2) then + with canvas do + begin + pen.color:=clvoies; + Brush.Color:=clvoies; + moveto(xf,yf);lineto(xc,yc); // partie déviée éteinte + + if mode=1 then couleur:=ClCanton; + if mode=2 then couleur:=couleurtrain[index_couleur]; + pen.color:=couleur; + Brush.Color:=couleur; + // 2eme partie droite toujours allumée + moveto(xc,y0);LineTo(xc,yc); + + // 1ere partie en fonction de la position + if position=const_devie then + begin + pen.color:=clvoies; + Brush.Color:=clvoies; + end; + LineTo(xc,yf); + + end; + end; + + procedure trajet_devie; + begin + if mode=0 then + with canvas do + begin + pen.color:=clvoies; + Brush.Color:=clvoies; + moveto(xc,y0);lineto(xc,yf); // verticale complete + moveTo(xf,yf);lineto(xc,yc); // partie déviée + end; + + if (mode=1) or (mode=2) then + with canvas do + begin + pen.color:=clvoies; + Brush.Color:=clvoies; + moveto(xc,yf);LineTo(xc,yc); + + if mode=1 then couleur:=ClCanton; + if mode=2 then couleur:=couleurtrain[index_couleur]; + pen.color:=couleur; + Brush.Color:=couleur; + moveto(xf,yf);LineTo(xc,yc);LineTo(xc,y0); // trajet déviée + end; + end; + + +begin + x0:=(x-1)*LargeurCell; // x origine + y0:=(y-1)*HauteurCell; // y origine + yc:=y0+(HauteurCell div 2); // y centre + xc:=x0+(LargeurCell div 2); // x centre + xf:=x0+largeurCell; // x fin + yf:=y0+HauteurCell; // y fin + position:=positionTCO(x,y); + fond:=TCO[x,y].CouleurFond; + + with canvas do + begin + Pen.Width:=1; + Brush.Color:=fond; + Pen.Color:=Fond;; + //r:=Rect(x0,y0,xf,yf); + //FillRect(r); // efface la cellule + + Pen.Width:=epaisseur; + Brush.Color:=clVoies; + Pen.Color:=clVoies; + Pen.Mode:=pmCopy; + + if (position=const_Devie) or (position=const_inconnu) then + begin + trajet_devie; // affiche la position de la branche déviée + end; + + if (position=const_droit) or (position=const_inconnu) then + begin + trajet_droit; + end; + + if (position=const_Devie) then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.width:=1; + jx1:=xc-(Epaisseur div 2); jy1:=yc + (Epaisseur div 2); + jx2:=jx1+epaisseur;jy2:=jy1+epaisseur; + jx3:=jx2;jy3:=yc+2*epaisseur; + pen.width:=1; + Polygon([point(jx1,jy1),Point(jx2,jy2),Point(jx3,jy3),Point(jx1,jy3)]); + end; + + if position=const_droit then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.Width:=1; + jx1:=xc+(Epaisseur div 2)+1; + r:=rect(jx1,yc-3*epaisseur,jx1+Epaisseur,yf); + FillRect(r); + end; + end; +end; + +// Element 28 +procedure dessin_28C(Canvas : Tcanvas;x,y,mode: integer); +var x0,y0,xc,yc,jx1,jy1,jx2,jy2,xf,yf,x1,y1,x2,y2,x3,y3,x4,y4,position, + jx3,jy3 : integer; + r : Trect; + fond: tcolor; + +procedure trajet_droit; + begin + couleur:=clvoies; + if mode>0 then + begin + if position=const_droit then + begin + if mode=1 then couleur:=clcanton; + if mode=2 then couleur:=couleurtrain[index_couleur]; + end; + end; + + with canvas do + begin + pen.color:=couleur; + moveto(xc,y0);lineto(xc,yf); // partie droite + end; + end; + + procedure trajet_devie; + begin + couleur:=clvoies; + if mode>0 then + begin + if position=const_devie then + begin + if mode=1 then couleur:=clcanton; + if mode=2 then couleur:=couleurtrain[index_couleur]; + end; + end; + + with canvas do + begin + pen.color:=couleur; + Arc(x1,y1,x2,y2,x3,y3,x4,y4); //courbe + end; + end; + +begin + x0:=(x-1)*LargeurCell; // x origine + y0:=(y-1)*HauteurCell; // y origine + yc:=y0+(HauteurCell div 2); // y centre + xc:=x0+(LargeurCell div 2); // x centre + xf:=x0+largeurCell; // x fin + yf:=y0+HauteurCell; // y fin + position:=positionTCO(x,y); + fond:=TCO[x,y].CouleurFond; + + // mode rond + x1:=x0+(largeurcell div 2);y1:=y0-hauteurCell-(hauteurCell div 3); + x2:=xf+(2*largeurCell)+(largeurcell div 2);y2:=yf+(hauteurCell div 3); + x3:=xc;y3:=y0; + x4:=xf;y4:=yf; + + with canvas do + begin + Pen.Width:=1; + Brush.Color:=fond; + Pen.Color:=Fond;; + + Pen.Width:=epaisseur; + Brush.Color:=clVoies; + Pen.Color:=clVoies; + Pen.Mode:=pmCopy; + + if mode>0 then + begin + if (position=const_devie) or (position=const_inconnu) then + begin + trajet_droit; + trajet_devie; + end; + if (position=const_droit) then + begin + trajet_devie; + trajet_droit; + end; + end + + else + begin + trajet_devie; + trajet_droit; + end; + + if (position=const_Devie) then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.width:=1; + jx1:=xc-(Epaisseur div 2); jy1:=yc - (2*Epaisseur ); + jx2:=jx1+epaisseur;jy2:=yc+epaisseur; + jx3:=jx2;jy3:=yc+2*epaisseur; + pen.width:=1; + Polygon([point(jx1,jy1),Point(jx2,jy2),Point(jx3,jy3),Point(jx1,jy3)]); + end; + + if position=const_droit then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.Width:=1; + jx1:=xc+(Epaisseur div 2); + r:=rect(jx1,yc-3*epaisseur,jx1+Epaisseur,yf); + FillRect(r); + end; + end; +end; + +procedure dessin_28(Canvas : Tcanvas;x,y : integer;Mode : integer); +begin + if graphisme=1 then dessin_28L(Canvas,x,y,Mode); + if graphisme=2 then dessin_28C(Canvas,x,y,Mode); +end; + +// Element 29 +procedure dessin_29L(Canvas : Tcanvas;x,y : integer;Mode : integer); +var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position : integer; + fond : tcolor; + + procedure trajet_droit; + begin + if mode=0 then + with canvas do + begin + pen.color:=clvoies; + Brush.Color:=clvoies; + moveto(x0,y0);lineto(xf,yf); // diag complete + moveto(xc,yc);lineto(xc,yf); // partie droite + end; + if (mode=1) or (mode=2) then + with canvas do + begin + // partie droite couleur voies + pen.color:=clvoies; + Brush.Color:=clvoies; + moveto(xc,yc);lineto(xc,yf); // partie droite + + if mode=1 then couleur:=ClCanton; + if mode=2 then couleur:=couleurtrain[index_couleur]; + pen.color:=couleur; + Brush.Color:=couleur; + // première partie haute toujours allumée + moveto(x0,y0);LineTo(xc,yc); + + // 2eme partie en fonction de la position + if position=const_devie then + begin + pen.color:=clvoies; + Brush.Color:=clvoies; + end; + LineTo(xf,yf); + end; + end; + + procedure trajet_devie; + begin + if mode=0 then + with canvas do + begin + pen.color:=clvoies; + Brush.Color:=clvoies; + moveto(x0,y0);lineto(xf,yf); // diag complete + moveto(xc,yc);lineto(xc,yf); // partie droite + end; + if (mode=1) or (mode=2) then + with canvas do + begin + // partie sup en couleur de voie + pen.color:=clvoies; + Brush.Color:=clvoies; + moveto(xc,yc);LineTo(xf,yf); + + if mode=1 then couleur:=ClCanton; + if mode=2 then couleur:=couleurtrain[index_couleur]; + pen.color:=couleur; + Brush.Color:=couleur; + moveto(x0,y0);LineTo(xc,yc);LineTo(xc,yf); + end; + end; + +begin + x0:=(x-1)*LargeurCell; // x origine + y0:=(y-1)*HauteurCell; // y origine + yc:=y0+(HauteurCell div 2); // y centre + xc:=x0+(LargeurCell div 2); // x centre + xf:=x0+largeurCell; // x fin + yf:=y0+HauteurCell; // y fin + position:=positionTCO(x,y); + fond:=TCO[x,y].CouleurFond; + + with canvas do + begin + Pen.Width:=1; + Brush.Color:=fond; + Pen.Color:=fond; + //r:=Rect(x0,y0,xf,yf); + //FillRect(r); // efface la cellule + + Pen.Width:=epaisseur; + Brush.Color:=clVoies; + Pen.Color:=clVoies; + Pen.Mode:=pmCopy; + + if (position=const_Devie) or (position=const_inconnu) then + begin + trajet_devie; // affiche la position de la branche déviée + end; + + if (position=const_droit) or (position=const_inconnu) then + begin + trajet_droit; + end; + + if (position=const_Devie) then + begin + // effacement du morceau + pen.width:=1; + x1:=xc+(epaisseur div 2)+1;y1:=yc-epaisseur; + x2:=x1+epaisseur;y2:=y1; + x3:=x2;y3:=y2+4*epaisseur; + x4:=x1;y4:=y3; + pen.color:=fond; + Brush.Color:=fond; + Polygon([point(x1,y1),Point(x2,y2),Point(x3,y3),Point(x4,y4)]); + end; + + if position=const_droit then + begin + // effacement du morceau + pen.Width:=1; + x1:=xc-(epaisseur div 2);y1:=yc+(epaisseur div 2); + x2:=x1+epaisseur;y2:=y1+epaisseur; + x3:=x2;y3:=y2+(epaisseur div 2); + x4:=x1;y4:=y3; + pen.color:=fond; + Brush.Color:=fond; + Polygon([point(x1,y1),Point(x2,y2),Point(x3,y3),Point(x4,y4)]); + end; + end; +end; + +procedure dessin_29C(Canvas : Tcanvas;x,y : integer;Mode : integer); +var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position : integer; + fond : tcolor; + procedure trajet_droit; + begin + couleur:=clvoies; + if mode>0 then + begin + if position=const_droit then + begin + if mode=1 then couleur:=clcanton; + if mode=2 then couleur:=couleurtrain[index_couleur]; + end; + end; + + with canvas do + begin + pen.color:=couleur; + moveto(x0,y0);lineto(xf,yf); // partie droite + end; + end; + + procedure trajet_devie; + begin + couleur:=clvoies; + if mode>0 then + begin + if position=const_devie then + begin + if mode=1 then couleur:=clcanton; + if mode=2 then couleur:=couleurtrain[index_couleur]; + end; + end; + + with canvas do + begin + pen.color:=couleur; + Arc(x1,y1,x2,y2,x3,y3,x4,y4); //courbe + end; + end; + + + +begin + x0:=(x-1)*LargeurCell; // x origine + y0:=(y-1)*HauteurCell; // y origine + yc:=y0+(HauteurCell div 2); // y centre + xc:=x0+(LargeurCell div 2); // x centre + xf:=x0+largeurCell; // x fin + yf:=y0+HauteurCell; // y fin + // mode rond + x1:=x0-(2*largeurCell)-(largeurcell div 2);y1:=y0-(hauteurCell div 3); + x2:=x0+(largeurcell div 2);y2:=yf+hauteurcell+(hauteurCell div 3); + x3:=xc;y3:=yf; + x4:=x0;y4:=y0; + + + position:=positionTCO(x,y); + fond:=TCO[x,y].CouleurFond; + + with canvas do + begin + Pen.Width:=1; + Brush.Color:=fond; + Pen.Color:=fond; + Pen.Width:=epaisseur; + Brush.Color:=clVoies; + Pen.Color:=clVoies; + Pen.Mode:=pmCopy; + + if mode>0 then + begin + if (position=const_devie) or (position=const_inconnu) then + begin + trajet_droit; + trajet_devie; + end; + if (position=const_droit) then + begin + trajet_devie; + trajet_droit; + end; + end + + else + begin + trajet_devie; + trajet_droit; + end; + + if (position=const_Devie) then + begin + // effacement du morceau + pen.width:=1; + x1:=xc-round(epaisseur*1);y1:=yc-round(2.2*epaisseur); + x2:=xc+round(epaisseur*0.7);y2:=y1; + x3:=x2-round(epaisseur*0.2);y3:=yc+round(1.8*epaisseur); + x4:=x1;y4:=yc-round(1.5*epaisseur); + pen.color:=fond; + Brush.Color:=fond; + Polygon([point(x1,y1),Point(x2,y2),Point(x3,y3),Point(x4,y4)]); + end; + + if position=const_droit then + begin + // effacement du morceau + pen.Width:=1; + x1:=xc-round(epaisseur*2.3);y1:=yc-round(epaisseur*1.4); + x2:=x1+3*epaisseur;y2:=y1+3*epaisseur; + x3:=x2;y3:=y2+(epaisseur div 2); + x4:=x1;y4:=y3; + pen.color:=fond; + Brush.Color:=fond; + Polygon([point(x1,y1),Point(x2,y2),Point(x3,y3),Point(x4,y4)]); + end; + end; +end; + +procedure dessin_29(Canvas : Tcanvas;x,y : integer;Mode : integer); +begin + if graphisme=1 then dessin_29L(Canvas,x,y,Mode); + if graphisme=2 then dessin_29C(Canvas,x,y,Mode); +end; + +// Elément 32 +procedure dessin_32L(Canvas : Tcanvas;x,y : integer;Mode : integer); +var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,position : integer; + r : Trect; + fond : tcolor; + + procedure trajet_droit; + begin + if mode=0 then + with canvas do + begin + pen.color:=clvoies; + Brush.Color:=clvoies; + moveto(x0,yf);lineto(xf,y0); // diag complete + moveto(xc,yf);lineto(xc,yc); // partie droite + end; + if (mode=1) or (mode=2) then + with canvas do + begin + // partie horz couleur voies + pen.color:=clvoies; + Brush.Color:=clvoies; + moveto(xc,yf);lineto(xc,yc); // partie déviée + + if mode=1 then couleur:=ClCanton; + if mode=2 then couleur:=couleurtrain[index_couleur]; + pen.color:=couleur; + Brush.Color:=couleur; + // première partie basse toujours allumée + moveto(x0,yf);LineTo(xc,yc); + + // 2eme partie en fonction de la position + if position=const_devie then + begin + pen.color:=clvoies; + Brush.Color:=clvoies; + end; + LineTo(xf,y0); + end; + end; + + procedure trajet_devie; + begin + if mode=0 then + with canvas do + begin + pen.color:=clvoies; + Brush.Color:=clvoies; + moveto(x0,yf);lineto(xf,y0); // diag complete + moveto(xc,yf);lineto(xc,yc); // partie droite + end; + if (mode=1) or (mode=2) then + with canvas do + begin + // partie en couleur de voie + pen.color:=clvoies; + Brush.Color:=clvoies; + moveto(xc,yc);LineTo(x0,yf); + + if mode=1 then couleur:=ClCanton; + if mode=2 then couleur:=couleurtrain[index_couleur]; + pen.color:=couleur; + Brush.Color:=couleur; + moveto(xc,yf);LineTo(xc,yc);LineTo(xf,y0); + end; + end; + +begin + x0:=(x-1)*LargeurCell; // x origine + y0:=(y-1)*HauteurCell; // y origine + yc:=y0+(HauteurCell div 2); // y centre + xc:=x0+(LargeurCell div 2); // x centre + xf:=x0+largeurCell; // x fin + yf:=y0+HauteurCell; // y fin + position:=positionTCO(x,y); + fond:=TCO[x,y].CouleurFond; + + with canvas do + begin + Pen.Width:=1; + Brush.Color:=fond; + Pen.Color:=fond; + //r:=Rect(x0,y0,xf,yf); + //FillRect(r); // efface la cellule + + Pen.Width:=epaisseur; + Brush.Color:=clVoies; + Pen.Color:=clVoies; + Pen.Mode:=pmCopy; + + if (position=const_Devie) or (position=const_inconnu) then + begin + trajet_devie; // affiche la position de la branche déviée + end; + + if (position=const_droit) or (position=const_inconnu) then + begin + trajet_droit; + end; + + if (position=const_Devie) then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.width:=1; + x1:=xc-2*epaisseur-5;y1:=yc+(epaisseur div 2)+1; + x2:=xc+epaisseur+10;y2:=y1+epaisseur; + r:=rect(x1,y1,x2,y2); + rectangle(r); + end; + + if position=const_droit then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.width:=1; + x1:=xc-(epaisseur div 2)+1;y1:=yc-(epaisseur div 2)-1; + x2:=x1-epaisseur-1; + x3:=x2-epaisseur;y3:=yc+(epaisseur div 2)+1; + x4:=x1-epaisseur-1; + polygon([point(x1,y1),point(x2,y1),point(x3,y3),point(x4,y3)]); + end; + end; +end; + +procedure dessin_32C(Canvas : Tcanvas;x,y : integer;Mode : integer); +var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position : integer; + fond : tcolor; + + procedure trajet_droit; + begin + couleur:=clvoies; + if mode>0 then + begin + if position=const_droit then + begin + if mode=1 then couleur:=clcanton; + if mode=2 then couleur:=couleurtrain[index_couleur]; + end; + end; + + with canvas do + begin + pen.color:=couleur; + moveto(x0,yf);lineto(xf,y0); // partie droite + end; + end; + + procedure trajet_devie; + begin + couleur:=clvoies; + if mode>0 then + begin + if position=const_devie then + begin + if mode=1 then couleur:=clcanton; + if mode=2 then couleur:=couleurtrain[index_couleur]; + end; + end; + + with canvas do + begin + pen.color:=couleur; + Arc(x1,y1,x2,y2,x3,y3,x4,y4); //courbe + end; + end; + + + +begin + x0:=(x-1)*LargeurCell; // x origine + y0:=(y-1)*HauteurCell; // y origine + yc:=y0+(HauteurCell div 2); // y centre + xc:=x0+(LargeurCell div 2); // x centre + xf:=x0+largeurCell; // x fin + yf:=y0+HauteurCell; // y fin + // mode rond + x1:=x0+(largeurcell div 2);y1:=y0-(hauteurCell div 3); + x2:=xf+(2*largeurCell)+(largeurcell div 2);y2:=yf+hauteurcell+(hauteurCell div 3); + x3:=xf;y3:=y0; + x4:=xc;y4:=yf; + + position:=positionTCO(x,y); + fond:=TCO[x,y].CouleurFond; + + with canvas do + begin + Pen.Width:=1; + Brush.Color:=fond; + Pen.Color:=fond; + + Pen.Width:=epaisseur; + Brush.Color:=clVoies; + Pen.Color:=clVoies; + Pen.Mode:=pmCopy; + + if mode>0 then + begin + if (position=const_devie) or (position=const_inconnu) then + begin + trajet_droit; + trajet_devie; + end; + if (position=const_droit) then + begin + trajet_devie; + trajet_droit; + end; + end + + else + begin + trajet_devie; + trajet_droit; + end; + + + if (position=const_Devie) then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.width:=1; + x1:=xc-round(0.7*epaisseur);y1:=yc-round(1.6*epaisseur); + x2:=xc+round(0.9*epaisseur);y2:=y1; + x3:=xc-round(0.3*epaisseur);y3:=yc+round(1.4*epaisseur); + x4:=xc-round(0.7*epaisseur);y4:=y3; + polygon([point(x1,y1),point(x2,y2),point(x3,y3),point(x4,y4)]); + end; + + if position=const_droit then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.width:=1; + x1:=xc+round(2.8*epaisseur);y1:=yc-(2*epaisseur); + x2:=xc+(4*epaisseur); + x3:=xc+(1*epaisseur);y3:=yc+(epaisseur); + x4:=xc-round(0.2*epaisseur);y4:=y3; + polygon([point(x1,y1),point(x2,y1),point(x3,y3),point(x4,y4)]); + end; + end; +end; + +procedure dessin_32(Canvas : Tcanvas;x,y : integer;Mode : integer); +begin + if graphisme=1 then dessin_32L(Canvas,x,y,Mode); + if graphisme=2 then dessin_32C(Canvas,x,y,Mode); +end; + +// Element 34 +procedure dessin_33L(Canvas : Tcanvas;x,y : integer;Mode : integer); +var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position : integer; + r : Trect; + fond : tcolor; + + procedure trajet_droit; + begin + if mode=0 then + with canvas do + begin + pen.color:=clvoies; + Brush.Color:=clvoies; + moveto(x0,y0);lineto(xf,yf); // diag complete + moveto(xc,y0);lineto(xc,yc); // partie droite + end; + if (mode=1) or (mode=2) then + with canvas do + begin + // partie droite couleur voies + pen.color:=clvoies; + Brush.Color:=clvoies; + moveto(xc,y0);lineto(xc,yc); // partie droite + + if mode=1 then couleur:=ClCanton; + if mode=2 then couleur:=couleurtrain[index_couleur]; + pen.color:=couleur; + Brush.Color:=couleur; + // première partie basse toujours allumée + moveto(xf,yf);LineTo(xc,yc); + + // 2eme partie en fonction de la position + if position=const_devie then + begin + pen.color:=clvoies; + Brush.Color:=clvoies; + end; + LineTo(x0,y0); + end; + end; + + procedure trajet_devie; + begin + if mode=0 then + with canvas do + begin + pen.color:=clvoies; + Brush.Color:=clvoies; + moveto(x0,y0);lineto(xf,yf); // diag complete + moveto(xc,y0);lineto(xc,yc); // partie verticale + end; + if (mode=1) or (mode=2) then + with canvas do + begin + // partie sup en couleur de voie + pen.color:=clvoies; + Brush.Color:=clvoies; + moveto(x0,y0);LineTo(xc,yc); + + if mode=1 then couleur:=ClCanton; + if mode=2 then couleur:=couleurtrain[index_couleur]; + pen.color:=couleur; + Brush.Color:=couleur; + moveto(xf,yf);LineTo(xc,yc);LineTo(xc,y0); + end; + end; + + +begin + x0:=(x-1)*LargeurCell; // x origine + y0:=(y-1)*HauteurCell; // y origine + yc:=y0+(HauteurCell div 2); // y centre + xc:=x0+(LargeurCell div 2); // x centre + xf:=x0+largeurCell; // x fin + yf:=y0+HauteurCell; // y fin + position:=positionTCO(x,y); + fond:=TCO[x,y].CouleurFond; + + with canvas do + begin + Pen.Width:=1; + Brush.Color:=fond; + Pen.Color:=fond; + //r:=Rect(x0,y0,xf,yf); + //FillRect(r); // efface la cellule + + Pen.Width:=epaisseur; + Brush.Color:=clVoies; + Pen.Color:=clVoies; + Pen.Mode:=pmCopy; + + if mode>0 then + begin + if (position=const_devie) or (position=const_inconnu) then + begin + trajet_droit; + trajet_devie; + end; + if (position=const_droit) then + begin + trajet_devie; + trajet_droit; + end; + end + + else + begin + trajet_devie; + trajet_droit; + end; + + if (position=const_Devie) then + begin + // effacement du morceau + pen.width:=1; + x1:=xc-2*epaisseur;y1:=yc-(3*epaisseur); + x2:=xc-(epaisseur div 2);y2:=yc+epaisseur; + pen.color:=fond; + Brush.Color:=fond; + r:=rect(x1,y1,x2,y2); + rectangle(r); + end; + + if position=const_droit then + begin + // effacement du morceau + pen.Width:=1; + x1:=xc-round(1.3*epaisseur);y1:=yc-(2*epaisseur) ; + x2:=xc+round(0.6*epaisseur);y2:=y1; + x3:=xc+round(2.5*epaisseur);y3:=yc+(epaisseur div 2); + x4:=xc+round(1.2*epaisseur);y4:=y3; + pen.color:=fond; + Brush.Color:=fond; + Polygon([point(x1,y1),Point(x2,y2),Point(x3,y3),Point(x4,y4)]); + end; + end; +end; + +procedure dessin_33c(Canvas : Tcanvas;x,y : integer;Mode : integer); +var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position : integer; + r : Trect; + fond : tcolor; + +procedure trajet_droit; + begin + couleur:=clvoies; + if mode>0 then + begin + if position=const_droit then + begin + if mode=1 then couleur:=clcanton; + if mode=2 then couleur:=couleurtrain[index_couleur]; + end; + end; + + with canvas do + begin + pen.color:=couleur; + moveto(x0,y0);lineto(xf,yf); // partie droite + end; + end; + + procedure trajet_devie; + begin + couleur:=clvoies; + if mode>0 then + begin + if position=const_devie then + begin + if mode=1 then couleur:=clcanton; + if mode=2 then couleur:=couleurtrain[index_couleur]; + end; + end; + + with canvas do + begin + pen.color:=couleur; + Arc(x1,y1,x2,y2,x3,y3,x4,y4); //courbe + end; + end; + + +begin + x0:=(x-1)*LargeurCell; // x origine + y0:=(y-1)*HauteurCell; // y origine + yc:=y0+(HauteurCell div 2); // y centre + xc:=x0+(LargeurCell div 2); // x centre + xf:=x0+largeurCell; // x fin + yf:=y0+HauteurCell; // y fin + // mode rond + x1:=x0+(largeurcell div 2);y1:=y0-hauteurCell-(hauteurCell div 3); + x2:=xf+(2*largeurCell)+(largeurcell div 2);y2:=yf+(hauteurCell div 3); + x3:=xc;y3:=y0; + x4:=xf;y4:=yf; + + position:=positionTCO(x,y); + fond:=TCO[x,y].CouleurFond; + + with canvas do + begin + Pen.Width:=1; + Brush.Color:=fond; + Pen.Color:=fond; + //r:=Rect(x0,y0,xf,yf); + //FillRect(r); // efface la cellule + + Pen.Width:=epaisseur; + Brush.Color:=clVoies; + Pen.Color:=clVoies; + Pen.Mode:=pmCopy; + + if mode>0 then + begin + if (position=const_devie) or (position=const_inconnu) then + begin + trajet_droit; + trajet_devie; + end; + if (position=const_droit) then + begin + trajet_devie; + trajet_droit; + end; + end + + else + begin + trajet_devie; + trajet_droit; + end; + + + if (position=const_Devie) then + begin + // effacement du morceau + pen.width:=1; + x1:=xc-round(1.5*epaisseur);y1:=yc-round(2.5*epaisseur); + x2:=xc-round(0.6*epaisseur);y2:=y1; + x3:=xc+round(1.3*epaisseur);y3:=yc+2*epaisseur; + x4:=xc+round(0.4*epaisseur);y4:=y3; + pen.color:=fond; + Brush.Color:=fond; + r:=rect(x1,y1,x2,y2); + Polygon([point(x1,y1),Point(x2,y2),Point(x3,y3),Point(x4,y4)]); + end; + + if position=const_droit then + begin + // effacement du morceau + pen.Width:=1; + x1:=xc-round(1.3*epaisseur);y1:=yc-(2*epaisseur); + x2:=xc+round(0.9*epaisseur);y2:=y1; + x3:=xc+round(3.5*epaisseur);y3:=yc+2*epaisseur; + x4:=xc+round(2.9*epaisseur);y4:=y3; + pen.color:=fond; + Brush.Color:=fond; + Polygon([point(x1,y1),Point(x2,y2),Point(x3,y3),Point(x4,y4)]); + end; + end; +end; + +procedure dessin_33(Canvas : Tcanvas;x,y : integer;Mode : integer); +begin + if graphisme=1 then dessin_33L(Canvas,x,y,Mode); + if graphisme=2 then dessin_33C(Canvas,x,y,Mode); +end; + +// Element 34 +procedure dessin_34L(Canvas : Tcanvas;x,y : integer;Mode : integer); +var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position : integer; + fond : Tcolor; + + procedure trajet_droit; + begin + if mode=0 then + with canvas do + begin + pen.color:=clvoies; + Brush.Color:=clvoies; + moveto(x0,yf);lineto(xf,y0); // diag complete + moveto(xc,yc);lineto(xc,y0); // partie droite + end; + if (mode=1) or (mode=2) then + with canvas do + begin + // partie droite couleur voies + pen.color:=clvoies; + Brush.Color:=clvoies; + moveto(xc,yc);lineto(xc,y0); // partie droite + + if mode=1 then couleur:=ClCanton; + if mode=2 then couleur:=couleurtrain[index_couleur]; + pen.color:=couleur; + Brush.Color:=couleur; + // première partie basse toujours allumée + moveto(x0,yf);LineTo(xc,yc); + + // 2eme partie en fonction de la position + if position=const_devie then + begin + pen.color:=clvoies; + Brush.Color:=clvoies; + end; + LineTo(xf,y0); + end; + end; + + procedure trajet_devie; + begin + if mode=0 then + with canvas do + begin + pen.color:=clvoies; + Brush.Color:=clvoies; + moveto(x0,yf);lineto(xf,y0); // diag complete + moveto(xc,yc);lineto(xc,y0); // partie droite + end; + if (mode=1) or (mode=2) then + with canvas do + begin + // partie sup en couleur de voie + pen.color:=clvoies; + Brush.Color:=clvoies; + moveto(xc,yc);LineTo(xf,y0); + + if mode=1 then couleur:=ClCanton; + if mode=2 then couleur:=couleurtrain[index_couleur]; + pen.color:=couleur; + Brush.Color:=couleur; + moveto(x0,yf);LineTo(xc,yc);LineTo(xc,y0); + end; + end; + +begin + x0:=(x-1)*LargeurCell; // x origine + y0:=(y-1)*HauteurCell; // y origine + yc:=y0+(HauteurCell div 2); // y centre + xc:=x0+(LargeurCell div 2); // x centre + xf:=x0+largeurCell; // x fin + yf:=y0+HauteurCell; // y fin + position:=positionTCO(x,y); + fond:=TCO[x,y].CouleurFond; + + with canvas do + begin + Pen.Width:=1; + Brush.Color:=fond; + Pen.Color:=fond; + //r:=Rect(x0,y0,xf,yf); + //FillRect(r); // efface la cellule + + Pen.Width:=epaisseur; + Brush.Color:=clVoies; + Pen.Color:=clVoies; + Pen.Mode:=pmCopy; + + if (position=const_Devie) or (position=const_inconnu) then + begin + trajet_devie; // affiche la position de la branche déviée + end; + + if (position=const_droit) or (position=const_inconnu) then + begin + trajet_droit; + end; + + if (position=const_Devie) then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.width:=1; + x1:=xc+round(0.5*epaisseur);y1:=yc-round(3*epaisseur); + x2:=xc+round(1.5*epaisseur);y2:=yc+epaisseur; + polygon([point(x1,y1),point(x2,y1),point(x2,y2),point(x1,y2)]); + end; + + if position=const_droit then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.Width:=1; + x1:=xc-round(0.5*epaisseur);y1:=yc-round(2*epaisseur); + x2:=xc+round(0.5*epaisseur);y2:=y1; + x3:=x2;y3:=yc-round(1.3*epaisseur); + x4:=x1;y4:=yc-round(0.3*epaisseur); + polygon([point(x1,y1),point(x2,y2),point(x3,y3),point(x4,y4)]); + end; + end; +end; + +procedure dessin_34C(Canvas : Tcanvas;x,y : integer;Mode : integer); +var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position : integer; + fond : Tcolor; + +procedure trajet_droit; + begin + couleur:=clvoies; + if mode>0 then + begin + if position=const_droit then + begin + if mode=1 then couleur:=clcanton; + if mode=2 then couleur:=couleurtrain[index_couleur]; + end; + end; + + with canvas do + begin + pen.color:=couleur; + moveto(x0,yf);lineto(xf,y0); // partie droite + end; + end; + + procedure trajet_devie; + begin + couleur:=clvoies; + if mode>0 then + begin + if position=const_devie then + begin + if mode=1 then couleur:=clcanton; + if mode=2 then couleur:=couleurtrain[index_couleur]; + end; + end; + + with canvas do + begin + pen.color:=couleur; + Arc(x1,y1,x2,y2,x3,y3,x4,y4); //courbe + end; + end; + + +begin + x0:=(x-1)*LargeurCell; // x origine + y0:=(y-1)*HauteurCell; // y origine + yc:=y0+(HauteurCell div 2); // y centre + xc:=x0+(LargeurCell div 2); // x centre + xf:=x0+largeurCell; // x fin + yf:=y0+HauteurCell; // y fin + // mode rond + x1:=x0-(2*largeurCell)-(largeurcell div 2);y1:=y0-hauteurCell-(hauteurCell div 3); + x2:=x0+(largeurcell div 2);y2:=yf+(hauteurCell div 3); + x3:=x0;y3:=yf; + x4:=xc;y4:=y0; + + position:=positionTCO(x,y); + fond:=TCO[x,y].CouleurFond; + + with canvas do + begin + Pen.Width:=1; + Brush.Color:=fond; + Pen.Color:=fond; + //r:=Rect(x0,y0,xf,yf); + //FillRect(r); // efface la cellule + + Pen.Width:=epaisseur; + Brush.Color:=clVoies; + Pen.Color:=clVoies; + Pen.Mode:=pmCopy; + + if mode>0 then + begin + if (position=const_devie) or (position=const_inconnu) then + begin + trajet_droit; + trajet_devie; + end; + if (position=const_droit) then + begin + trajet_devie; + trajet_droit; + end; + end + + else + begin + trajet_devie; + trajet_droit; + end; + + if (position=const_Devie) then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.width:=1; + x1:=xc+round(0.1*epaisseur);y1:=yc-round(1*epaisseur); + x2:=xc+round(2*epaisseur);y2:=y1; + x3:=xc-round(0.5*epaisseur);y3:=yc+round(3*epaisseur); + x4:=xc-round(2*epaisseur);y4:=y3; + polygon([point(x1,y1),point(x2,y2),point(x3,y3),point(x4,y4)]); + end; + + if position=const_droit then + begin + // effacement du morceau + pen.color:=fond; + Brush.Color:=fond; + pen.Width:=1; + x1:=xc-round(2.3*epaisseur);y1:=yc-round(2*epaisseur); + x2:=xc+round(epaisseur);y2:=y1; + x3:=x2;y3:=yc-round(2*epaisseur); + x4:=x1;y4:=yc+round(1.1*epaisseur); + polygon([point(x1,y1),point(x2,y2),point(x3,y3),point(x4,y4)]); + end; + end; +end; + +procedure dessin_34(Canvas : Tcanvas;x,y : integer;Mode : integer); +begin + if graphisme=1 then dessin_34L(Canvas,x,y,Mode); + if graphisme=2 then dessin_34C(Canvas,x,y,Mode); +end; // calcul des facteurs de réductions X et Y pour l'adapter à l'image de destination procedure calcul_reduction(Var frx,fry : real;DimDestX,DimDestY,DimOrgX,DimOrgY : integer); @@ -4708,7 +6591,7 @@ begin Orientation:=TCO[x,y].FeuOriente; if Orientation=0 then Orientation:=1; // cas d'un signal non encore renseigné - index:=index_feu(adresse); + index:=Index_Signal(adresse); aspect:=feux[index].aspect; if aspect=0 then aspect:=9; //if aspect>9 then exit; @@ -4901,10 +6784,19 @@ begin 20 : dessin_20(PCanvasTCO,X,Y,mode); 21 : dessin_21(PCanvasTCO,X,Y,mode); 22 : dessin_22(PCanvasTCO,X,Y,mode); - 23,31 : dessin_31(PCanvasTCO,X,Y,mode); + 23 : dessin_23(PCanvasTCO,X,Y,mode); 24 : dessin_24(PCanvasTCO,X,Y,mode); 25 : dessin_25(PCanvasTCO,X,Y,mode); - 30 : dessin_Signal(PCanvasTCO,X,Y); + 26 : dessin_26(PCanvasTCO,X,Y,mode); + 27 : dessin_27(PCanvasTCO,X,Y,mode); + 28 : dessin_28(PCanvasTCO,X,Y,mode); + 29 : dessin_29(PCanvasTCO,X,Y,mode); + 32 : dessin_32(PCanvasTCO,X,Y,mode); + 33 : dessin_33(PCanvasTCO,X,Y,mode); + 34 : dessin_34(PCanvasTCO,X,Y,mode); + + 50 : dessin_Signal(PCanvasTCO,X,Y); + 51 : dessin_51(PCanvasTCO,X,Y,mode); end; PCanvasTCO.font.Size:=(LargeurCell div 10)+4 ; @@ -4912,9 +6804,10 @@ begin // affiche le texte des aiguillages if ((BImage=2) or (BImage=3) or (BImage=4) or (BImage=5) or (BImage=12) or (BImage=13) or (BImage=14) or - (BImage=15) or (BImage=21) or (BImage=22) or (BImage=24) or (BImage=25)) and (adresse<>0) then + (BImage=15) or + ((BImage>=21) and (BImage<=34) )) and (adresse<>0) then begin - if adresse<>0 then s:='A'+s else s:=' '; + if adresse<>0 then s:='A'+s+' ' else s:=' '; with PCanvasTCO do begin Brush.Color:=tco[x,y].CouleurFond; @@ -4935,6 +6828,15 @@ begin if Bimage=22 then begin xt:=3;yt:=HauteurCell-round(15*frYGlob);end; if Bimage=24 then begin xt:=LargeurCell-round(20*frXGlob);yt:=HauteurCell-round(15*frYGlob);end; if Bimage=25 then begin xt:=1;yt:=HauteurCell-round(15*frYGlob);end; + if Bimage=26 then begin xt:=1;yt:=HauteurCell-round(15*frYGlob);end; + if Bimage=27 then begin xt:=1;yt:=1;end; + if Bimage=28 then begin xt:=1;yt:=1;end; + if Bimage=29 then begin xt:=LargeurCell div 2;yt:=1;end; + if Bimage=32 then begin xt:=1;yt:=1;end; + if Bimage=33 then begin xt:=1;yt:=HauteurCell-round(15*frYGlob);end; + if Bimage=34 then begin xt:=LargeurCell-round(30*frXGlob);yt:=HauteurCell-round(15*frYGlob);end; + + TextOut(xOrg+xt,yOrg+yt,s); end; end; @@ -5015,9 +6917,9 @@ begin end; // adresse des signaux - if (BImage=30) and (adresse<>0) then + if (BImage=50) and (adresse<>0) then begin - index:=index_feu(adresse); + index:=Index_Signal(adresse); aspect:=feux[index].Aspect; oriente:=TCO[x,y].FeuOriente; pied:=TCO[x,y].PiedFeu; @@ -5137,7 +7039,7 @@ begin y0:=(y-1)*hauteurcell; //PCanvasTCO.Brush.Style:=bsSolid; - if (TCO[x,y].BImage=23) or (TCO[x,y].BImage=31) then PCanvasTCO.Brush.Color:=clQuai else PCanvasTCO.Brush.Color:=tco[x,y].CouleurFond; + if (TCO[x,y].BImage=51) then PCanvasTCO.Brush.Color:=clQuai else PCanvasTCO.Brush.Color:=tco[x,y].CouleurFond; //PCanvasTCO.pen.color:=clyellow; PcanvasTCO.Font.Color:=tco[x,y].CoulFonte; ss:=tco[x,y].fonte; @@ -5224,7 +7126,7 @@ begin for y:=1 to NbreCellY do for x:=1 to NbreCellX do begin - if TCO[x,y].BImage<>30 then + if TCO[x,y].BImage<>50 then begin affiche_cellule(x,y); end; @@ -5234,7 +7136,7 @@ begin for y:=1 to NbreCellY do for x:=1 to NbreCellX do begin - if TCO[x,y].BImage=30 then + if TCO[x,y].BImage=50 then begin affiche_cellule(x,y); end; @@ -5260,10 +7162,10 @@ end; procedure TFormTCO.FormCreate(Sender: TObject); begin - if affevt then Affiche('FormTCO create',clyellow); - if debug=1 then Affiche('Création fenêtre TCO',clLime); + if affevt or (debug=1) then Affiche('FormTCO create',clyellow); offsetSourisY:=-10; offsetSourisX:=-10; + auto_tcurs:=true; caption:='TCO'; TCO_modifie:=false; rangUndo:=1; @@ -5349,7 +7251,7 @@ procedure Erreur_TCO(x,y : integer); var s : string; i,adresse : integer; begin - s:='Erreur TCO: '; + s:='Erreur 92 TCO : cellule '+intToSTR(x)+','+intToSTR(y)+' '; adresse:=tco[x,y].Adresse; i:=index_aig(adresse); if i=0 then s:=s+'aiguillage '+intToSTR(adresse)+' inconnu'; @@ -5366,7 +7268,7 @@ end; procedure zone_TCO(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; - memtrouve,sortir,horz,diag : boolean; + memtrouve,sortir,horz,diag,casok : boolean; mdl : Tequipement; s : string; begin @@ -5378,8 +7280,6 @@ begin trouve_det(det2,Xdet2,Ydet2); if (Xdet2=0) or (Ydet2=0) then exit; - // inverser coordonnées des détecteurs si à l'envers en X - if debugTCO then begin AfficheDebug('trouvé '+intToSTR(det1)+' en '+IntToSTR(xDet1)+'/'+intToSTR(ydet1),clyellow); @@ -5388,39 +7288,46 @@ begin memtrouve:=false; - Direction:=1; + 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; + 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 - // commencer par descendre et à droite + // descendre et à droite + casok:=true; ancieny:=ydet1+1; ancienx:=xdet1+1; end; if direction=2 then begin - // commencer par monter et à gauche + // monter et à gauche + casok:=true; ancieny:=ydet1-1; ancienx:=xdet1-1; end; if direction=3 then begin - // commencer par descendre et à droite + // commencer par descendre et à gauche + casok:=true; ancieny:=ydet1+1; - ancienx:=xdet1+1; + ancienx:=xdet1-1; end; if direction=4 then begin // commencer par monter et à droite + casok:=true; ancieny:=ydet1-1; ancienx:=xdet1+1; end; - + + // boucle de remplissage du tableau routeTCO de det1 à det2 repeat routeTCO[ir].x:=x; @@ -5434,7 +7341,7 @@ begin adresse:=TCO[x,y].Adresse ; Bimage:=TCO[x,y].Bimage; - + casok:=false; // vers case suivante: trouver le trajet pour rejoindre det1 à det2 case Bimage of // voie @@ -5450,43 +7357,43 @@ begin 2 : begin //if debugTCO then AfficheDebug('El 2',clyellow); pos:=positionTCO(x,y); - if (ancienXx) and (ancienY=Y) then begin xn:=x-1;if pos=const_devie then yn:=y+1;end; - if (ancienXy) then xn:=x+1; + if (ancienXy) then begin xn:=x+1; end; if (pos=const_inconnu) then begin Erreur_TCO(x,y);exit;end; end; 3 : begin //if debugTCO then AfficheDebug('El 3',clyellow); pos:=positionTCO(x,y); if (ancienXx) and (ancienY=Y) then xn:=x-1; - if (ancienX>x) and (ancienYx) and (ancienY=Y) then begin xn:=x-1;end; + if (ancienX>x) and (ancienYx) and (ancienY=Y) then xn:=x-1; - if (ancienX>x) and (ancienY>y) then xn:=x-1; + if (ancienX>x) and (ancienY=Y) then begin xn:=x-1;end; + if (ancienX>x) and (ancienY>y) then begin xn:=x-1;end; if (pos=const_inconnu) then begin Erreur_TCO(x,y);exit;end; end; 5 : begin //if debugTCO then AfficheDebug('El 5',clyellow); pos:=positionTCO(x,y); - if (ancienXx) and (ancienY=Y) then begin xn:=x-1;if pos=const_devie then yn:=y-1;end; - if (ancienXx) and (ancienY=Y) then begin xn:=x-1;if pos=const_devie then yn:=y-1;end; + if (ancienXx) and (ancienY=Y) then begin xn:=x-1;yn:=y-1;end; + if (ancienX>x) and (ancienY=Y) then begin xn:=x-1;yn:=y-1;end; if (ancienX>x) and (ancienY>y) then begin xn:=x-1;yn:=y-1;end; if (pos=const_inconnu) then begin Erreur_TCO(x,y);exit;end; end; @@ -5507,7 +7414,7 @@ begin //if debugTCO then AfficheDebug('El 13',clyellow); pos:=positionTCO(x,y); if (ancienXx) and (ancienYx) and (ancienYy) then begin xn:=x+1;yn:=y-1;end; if (pos=const_inconnu) then begin Erreur_TCO(x,y);exit;end; end; @@ -5523,19 +7430,26 @@ begin //if debugTCO then AfficheDebug('El 15',clyellow); pos:=positionTCO(x,y); if (ancienXY) then begin xn:=x+1;if pos=const_droit then yn:=y-1;end; - if (ancienX>x) and (ancienYx) and (ancienYx) and (ancienY=y) then begin xn:=x-1;yn:=y+1;end; if (pos=const_inconnu) then begin Erreur_TCO(x,y);exit;end; end; - 16 : if ancienX0 then s:=s+'adr='+intToStr(adresse); + AfficheDebug(s,clyellow); + end; xn:=x; + casok:=true; if (ancienYx) and (ancienY=Y) then xn:=x-1; + if (ancienXx) and (ancienY=Y) then begin xn:=x-1;end; if (ancienXY) then begin xn:=x+1;yn:=y-1;end; if (ancienX>x) and (ancienYx) and (ancienY=Y) then xn:=x-1; - if (ancienX>x) and (ancienY>Y) then begin xn:=x-1;yn:=y-1;end; - 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 + pos:=aiguillage[j].position; + if (pos=const_inconnu) then begin Erreur_TCO(x,y);exit;end; + + if ((mdl=tjd) or (mdl=tjs)) and (aiguillage[j].EtatTJD=4) then + begin + j:=Index_Aig(aiguillage[j].Ddroit); + pos2:=aiguillage[j].position; // 2eme adresse de la TJD + if (pos2=const_inconnu) then begin Erreur_TCO(x,y);exit;end; + if (pos=const_droit) and (pos2=const_droit) then + begin + if ancienXx) 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 48 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); pos:=positionTCO(x,y); @@ -5696,7 +7697,7 @@ begin pos:=aiguillage[j].position; if (pos=const_inconnu) then begin Erreur_TCO(x,y);exit;end; - if (mdl=tjd) or (mdl=tjs) and (aiguillage[j].EtatTJD=4) then + if ((mdl=tjd) or (mdl=tjs)) and (aiguillage[j].EtatTJD=4) then begin j:=Index_Aig(aiguillage[j].Ddroit); pos2:=aiguillage[j].position; // 2eme adresse de la TJD @@ -5718,7 +7719,7 @@ begin 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; + if (ancienXx) and (ancienY>Y) then begin casok:=true;xn:=x-1;yn:=yn-1;end; + if (ancienX=x) and (ancienYY) then begin casok:=true;xn:=x;yn:=y-1;end; end; + if (mdl=aig) then + begin + Affiche('Erreur 48 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); + pos:=positionTCO(x,y); + // on vient d'en bas + if (ancienY>y) and (ancienX=x) then + begin + yn:=y-1;if pos=const_devie then xn:=x+1 else xn:=x; + end; + // on vient d'en haut + if (ancienYx) then + begin + yn:=y+1;xn:=x; + end; + if (pos=const_inconnu) then begin Erreur_TCO(x,y);exit;end; + end; + 27 : begin + if debugTCO then AfficheDebug('El 27',clyellow); + pos:=positionTCO(x,y); + // on vient d'en bas + if (ancienY>y) and (ancienX=x) then + begin + yn:=y-1;xn:=x; + end; + // on vient d'en haut + if (ancienYy) and (ancienXy) and (ancienX=x) then + begin + yn:=y-1;xn:=x; + end; + // on vient d'en haut + if (ancienYy) and (ancienX>x) then + begin + yn:=y-1;xn:=x; + end; + if (pos=const_inconnu) then begin Erreur_TCO(x,y);exit;end; + end; + 29 : begin + //if debugTCO then AfficheDebug('El 12',clyellow); + pos:=positionTCO(x,y); + // on vient à de haut à gauche + if (ancienXx) and (ancienY>Y) then begin xn:=x-1;yn:=y-1;end; + // on vient de bas + if (ancienX=x) and (ancienY>y) then begin xn:=x-1;yn:=y-1;end; + if (pos=const_inconnu) then begin Erreur_TCO(x,y);exit;end; + end; + 32 : begin + if debugTCO then AfficheDebug('El 32',clyellow); + pos:=positionTCO(x,y); + // on vient d'en bas à gauche + if (ancienXY) then begin xn:=x+1;yn:=y-1;end; + // on vient d'en bas + if (ancienX=x) and (ancienY>Y) 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 yn:=y-1;if pos=const_droit then xn:=x-1 else xn:=x;end; + if (pos=const_inconnu) then begin Erreur_TCO(x,y);exit;end; + end; + 34 : begin + pos:=positionTCO(x,y); + // on vient du SE + if (ancienXy) then begin yn:=y-1;if pos=const_droit then xn:=x+1 else xn:=x;end; + // on vient du N + if (ancienX=x) and (ancienYx) and (ancienYNbCellulesTCO) or (x>NbreCellX) or (y>NbreCellY) or (x=0) or (y=0) or sortir; + until (memTrouve) or (i>NbCellulesTCO) or (x>NbreCellX) or (y>NbreCellY) or (x=0) or (y=0) or sortir; // or not(casok) ; + + { if not(casok) then + begin + Affiche('Erreur TCO incohérence tracé cellule '+intToSTR(x)+','+intToSTR(y),clred); + exit; + end; } + if (i>NbCellulesTCO) then AfficheDebug('Erreur 1000 TCO : dépassement d''itérations - Route de '+IntToSTR(det1)+' à '+IntToSTR(det2),clred); inc(direction) until (direction=5) or memtrouve ; - + //Affiche(intToSTR(x),clLime); if i>NbCellulesTCO then begin @@ -5774,6 +7896,8 @@ begin exit; end; + 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 @@ -5827,6 +7951,26 @@ begin if tco[x,y].trajet=0 then affiche('Erreur 51 TCO',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; + if (ax-x=0) and (ay-y=-1) and (sx-x=0) and (sy-y=1) then tco[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[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[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[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[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[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[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[x,y].trajet:=4; // de bas gauche vers haut + if tco[x,y].trajet=0 then affiche('Erreur 52 TCO',clred); + end; + // croisement if (bimage=25) and (i>1) then begin @@ -5844,55 +7988,98 @@ begin if (ax-x=0) and (ay-y=1) and (sx-x=-1) and (sy-y=-1) then tco[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[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[x,y].trajet:=4; // de bas droit vers haut - if tco[x,y].trajet=0 then affiche('Erreur 52 TCO',clred); + if tco[x,y].trajet=0 then affiche('Erreur 53 TCO',clred); end; Affiche_cellule(x,y); end; end; -procedure dessine_icones; -var w,h,ancH,ancW,i : integer; - ip : TImage; +procedure dessine_icone(ip : timage;lbl : tlabel;i : integer); +const NbElLi=12; +var s : string; begin - with formTCO do - begin - // dessine le fond des icones - for i:=1 to 25 do - begin - ip:=findComponent('ImagePalette'+intToSTR(i)) as Timage; - if ip<>nil then + if i=50 then i:=35; // pour affichage en XY + if i=51 then i:=36; + if ip<>nil then begin with ip do begin - w:=width; - h:=height; + width:=licone; + height:=hicone; + left:=((i-1) mod NbElLi)*(licone+20)+230; + top:= ((i-1) div NbElLi)*(hicone+10)+8; with canvas do begin Pen.Color:=clFond; Brush.color:=clFond; - Rectangle(0,0,w,h); + Rectangle(0,0,licone,hicone); end; end; end; + if lbl<>nil then + begin + with lbl do + begin + if (i=35) or (i=36) then s:=intToSTR(i+15) else + s:=intToSTR(i); + if i<10 then s:=' '+s; + caption:=s; + left:=((i-1) mod NbElLi)*(licone+20)+212; + top:= ((i-1) div NbElLi)*(hicone+10)+16; + end; + end; +end; + + + +// dessine les icones du tco et les aligne +procedure dessine_icones; +var ancH,ancW,i,lf,hf: integer; + ip : TImage; + lbl : Tlabel; +begin + with formTCO do + begin + for i:=1 to 29 do + begin + ip:=findComponent('ImagePalette'+intToSTR(i)) as Timage; + lbl:=findComponent('Label'+intToSTR(i)) as Tlabel; + dessine_icone(ip,lbl,i); end; - ip:=findComponent('ImagePalette31') as Timage; + for i:=32 to 34 do + begin + ip:=findComponent('ImagePalette'+intToSTR(i)) as Timage; + lbl:=findComponent('Label'+intToSTR(i)) as Tlabel; + dessine_icone(ip,lbl,i); + end; + + + i:=50; + ip:=findComponent('ImagePalette'+intToSTR(i)) as Timage; + lbl:=findComponent('Label'+intToSTR(i)) as Tlabel; + dessine_icone(ip,lbl,i); + i:=51; + ip:=findComponent('ImagePalette'+intToSTR(i)) as Timage; + lbl:=findComponent('Label'+intToSTR(i)) as Tlabel; + dessine_icone(ip,lbl,i); + + // signal + ip:=findComponent('ImagePalette51') as Timage; if ip<>nil then begin with ip do begin - w:=width; - h:=height; with canvas do begin Pen.Color:=clFond; Brush.color:=clFond; - Rectangle(0,0,w,h); + Rectangle(0,0,licone,hicone); end; end; end; - epaisseur:=5; + epaisseur:=4; ancw:=LargeurCell; AncH:=hauteurCell; HauteurCell:=ImagePalette1.Height; @@ -5919,9 +8106,36 @@ begin dessin_20(ImagePalette20.canvas,1,1,0); dessin_21(ImagePalette21.canvas,1,1,0); dessin_22(ImagePalette22.canvas,1,1,0); - dessin_31(ImagePalette31.canvas,1,1,0); + dessin_23(ImagePalette23.canvas,1,1,0); dessin_24(ImagePalette24.canvas,1,1,0); dessin_25(ImagePalette25.canvas,1,1,0); + dessin_26(ImagePalette26.canvas,1,1,0); + dessin_27(ImagePalette27.canvas,1,1,0); + dessin_28(ImagePalette28.canvas,1,1,0); + dessin_29(ImagePalette29.canvas,1,1,0); + dessin_32(ImagePalette32.canvas,1,1,0); + dessin_33(ImagePalette33.canvas,1,1,0); + dessin_34(ImagePalette34.canvas,1,1,0); + + dessin_51(ImagePalette51.canvas,1,1,0); //quai + + LargeurCell:=20; + + with formprinc.Image9Feux do + begin + lf:=width; + hf:=height; + end; + With ImagePalette50 do + begin + Picture.Bitmap.TransparentMode:=tmAuto; + Picture.Bitmap.TransparentColor:=clblue; + Transparent:=true; + end; + //Picture.Bitmap:=Formprinc.Image9feux.Picture.Bitmap; + TransparentBlt(ImagePalette50.canvas.Handle,8,0,largeurCell,Hauteurcell, + formprinc.Image9Feux.Canvas.Handle,0,0,50,90,clBlue); + // end; end; LargeurCell:=ancW; HauteurCell:=ancH; @@ -5980,6 +8194,14 @@ begin ImagePalette14.Hint:=s;ImagePalette14.ShowHint:=true; ImagePalette15.Hint:=s;ImagePalette15.ShowHint:=true; ImagePalette24.Hint:=s;ImagePalette24.ShowHint:=true; + ImagePalette26.Hint:=s;ImagePalette26.ShowHint:=true; + ImagePalette27.Hint:=s;ImagePalette27.ShowHint:=true; + ImagePalette28.Hint:=s;ImagePalette28.ShowHint:=true; + ImagePalette29.Hint:=s;ImagePalette29.ShowHint:=true; + ImagePalette32.Hint:=s;ImagePalette32.ShowHint:=true; + ImagePalette33.Hint:=s;ImagePalette33.ShowHint:=true; + ImagePalette34.Hint:=s;ImagePalette34.ShowHint:=true; + s:='Croisement ou TJD ou TJS'; ImagePalette21.Hint:=s;ImagePalette21.ShowHint:=true; @@ -6001,14 +8223,7 @@ begin PImageTemp:=FormTCO.ImageTemp; PImageTemp.Canvas.Rectangle(0,0,PImageTemp.Width,PimageTemp.Height); - With ImagePalette30 do - begin - Picture.Bitmap.TransparentMode:=tmAuto; - Picture.Bitmap.TransparentColor:=clblue; - Transparent:=true; - Picture.Bitmap:=Formprinc.Image9feux.Picture.Bitmap; - end; //Affiche_tco par r trackBarZoom.Position:=(ZoomMax+Zoommin) div 2; @@ -6032,7 +8247,6 @@ begin end; - // vérifie que les icones adjacentes sont cohérentes function verif_cellule(x,y,Bim : integer) : boolean; var res,verif : boolean; @@ -6040,7 +8254,7 @@ var res,verif : boolean; begin result:=true; verif:=false; - if (bim=23) or (bim>=30) or (AvecVerifIconesTCO=0) then exit; + if (bim>=50) or (AvecVerifIconesTCO=0) then exit; //exit; res:=true; bl:=liaisons[Bim]; @@ -6197,10 +8411,10 @@ begin begin xPlace:=xCoupe+x-TamponTCO_Org.x1; // destination yPlace:=yCoupe+y-TamponTCO_Org.y1; - if (xPlace<=NbreCellX) and (yPlace<=NbreCellY) then + if (xPlace<=NbreCellX) and (yPlace<=NbreCellY) then begin tco[xPlace,yPlace]:=tamponTCO[x,y]; - if tco[xPlace,yPlace].Bimage=30 then + if tco[xPlace,yPlace].Bimage=50 then begin adresse:=tco[xPlace,yPlace].Adresse; end; @@ -6218,21 +8432,13 @@ begin dec(rangUndo); for i:=1 to undo[rangUndo].nombre do begin - with undo[rangUndo].element[i] do - begin - xu:=x; - yu:=y; - if (xu<=NbreCellX) and (yu<=NbreCellY) then - begin - tco[xu,yu].BImage:=Bimage; - tco[xu,yu].Texte:=texte; - end; - end; + xu:=undo[rangUndo].element[i].Xundo; + yu:=undo[rangUndo].element[i].Yundo; + if (xu<=NbreCellX) and (yu<=NbreCellY) then tco[xu,yu]:=undo[rangUndo].element[i]; end; Affiche_tco; exit; end; - end; @@ -6251,14 +8457,118 @@ begin screen.cursor:=crDefault; end; +procedure grille; +var x,y : integer; +begin + if not(AvecGrille) then exit; + With PCanvasTCO do + begin + pen.color:=ClGrille; + pen.Width:=1; + Brush.Color:=ClFond; + pen.mode:=PmCopy; + // lignes verticales + for x:=1 to NbreCellX do + begin + moveto(x*LargeurCell,1); + LineTo(x*LargeurCell,HauteurCell*NbreCelly); + end; + for y:=1 to NbreCelly do + begin + moveto(1,y*HauteurCell); + LineTo(LargeurCell*NbreCellX,y*HauteurCell); + end; + end; +end; + + +procedure copier; +var x,y : integer; +begin + if SelectionAffichee then + begin + TamponTCO_org.NbreCellX:=NbreCellX; + TamponTCO_org.NbreCellY:=NbreCellY; + + TamponTCO_Org.x1:=XminiSel div LargeurCell +1; + TamponTCO_Org.x2:=XmaxiSel div LargeurCell +1; + TamponTCO_Org.y1:=yminiSel div HauteurCell +1; + TamponTCO_Org.y2:=ymaxiSel div HauteurCell +1; + for y:=TamponTCO_Org.y1 to TamponTCO_Org.y2 do + for x:=TamponTCO_Org.x1 to TamponTCO_Org.x2 do + tamponTCO[x,y]:=tco[x,y]; + TamponAffecte:=true; + end; +end; + + +procedure couper; +var x,y,XCell1,YCell1,xCell2,yCell2 : integer; +begin + with formTCO do + begin + TamponTCO_org.NbreCellX:=NbreCellX; + TamponTCO_org.NbreCellY:=NbreCellY; + EditAdrElement.Text:=''; + EditTypeImage.Text:=''; + EditTexte.Text:=''; + end; + + // couper sans sélection : on coupe une seule cellule + if not(SelectionAffichee) then + begin + tamponTCO[XclicCell,YclicCell]:=tco[XclicCell,YclicCell]; // pour pouvoir faire annuler couper + TamponTCO_org.x1:=XclicCell;TamponTCO_org.y1:=YclicCell; + TamponTCO_org.x2:=XclicCell;TamponTCO_org.y2:=YclicCell; + + tco[XclicCell,YClicCell].Adresse:=0; + tco[XclicCell,YClicCell].Bimage:=0; + tco[XclicCell,YClicCell].liaisons:=0; + tco[XclicCell,YClicCell].Texte:=''; + + efface_entoure; + efface_cellule(formTCO.ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); + TamponAffecte:=true; + xCoupe:=XclicCell;yCoupe:=YclicCell; + Affiche_tco; + exit; + end; + + TCO_modifie:=true; + copier; + SelectionAffichee:=false; + + xCell1:=XminiSel div LargeurCell +1; + xCell2:=XmaxiSel div LargeurCell +1; + yCell1:=yminiSel div HauteurCell +1; + yCell2:=ymaxiSel div HauteurCell +1; + + xCoupe:=XCell1;yCoupe:=yCell1; + for y:=yCell1 to yCell2 do + for x:=xCell1 to xCell2 do + begin + tco[x,y].Adresse:=0; + tco[x,y].BImage:=0; + tco[x,y].liaisons:=0; + tco[x,y].Texte:=''; + //Affiche('Efface cellules '+IntToSTR(X)+' '+intToSTR(y),clyellow); + efface_entoure; + efface_cellule(formTCO.ImageTCO.Canvas,X,Y,PmCopy); + if avecGrille then grille; + end; +end; + + +// pour avoir les evts keydown, il faut dévalider les propriétés tabstop des boutons de la form. procedure TFormTCO.FormKeyDown(Sender: TObject; var Key: Word;Shift: TShiftState); var s,d : integer; procede : boolean; begin if affevt then Affiche('TCO.FormKeyDown',clOrange); - procede:=false; + procede:=false; // indicateur on a tapé une touche de curseur //Affiche(intToSTR(key),clyellow); + if auto_tcurs then case Key of VK_right : if XClicCell=100 then exit; + + tco[xu,yu].Xundo:=xu; // stocke les coordonnées de la cellule concernée + tco[xu,yu].Yundo:=yu; + + undo[rangUndo].element[i]:=tco[xu,yu]; + //affiche('Rang undo='+intToSTR(rangundo),clYellow); end; procedure TFormTCO.ImagePalette5EndDrag(Sender, Target: TObject; X,Y: Integer); @@ -7051,25 +9365,6 @@ begin TCO_modifie:=true; end; -procedure copier; -var x,y : integer; -begin - if SelectionAffichee then - begin - TamponTCO_org.NbreCellX:=NbreCellX; - TamponTCO_org.NbreCellY:=NbreCellY; - - TamponTCO_Org.x1:=XminiSel div LargeurCell +1; - TamponTCO_Org.x2:=XmaxiSel div LargeurCell +1; - TamponTCO_Org.y1:=yminiSel div HauteurCell +1; - TamponTCO_Org.y2:=ymaxiSel div HauteurCell +1; - for y:=TamponTCO_Org.y1 to TamponTCO_Org.y2 do - for x:=TamponTCO_Org.x1 to TamponTCO_Org.x2 do - tamponTCO[x,y]:=tco[x,y]; - TamponAffecte:=true; - end; - -end; procedure TFormTCO.MenuCopierClick(Sender: TObject); begin @@ -7078,54 +9373,8 @@ end; // supprimer la sélection procedure TFormTCO.MenuCouperClick(Sender: TObject); -var x,y,XCell1,YCell1,xCell2,yCell2 : integer; begin - TamponTCO_org.NbreCellX:=NbreCellX; - TamponTCO_org.NbreCellY:=NbreCellY; - - // couper sans sélection : on coupe une seule cellule - if not(SelectionAffichee) then - begin - tamponTCO[XclicCell,YclicCell]:=tco[XclicCell,YclicCell]; // pour pouvoir faire annuler couper - TamponTCO_org.x1:=XclicCell;TamponTCO_org.y1:=YclicCell; - TamponTCO_org.x2:=XclicCell;TamponTCO_org.y2:=YclicCell; - - tco[XclicCell,YClicCell].Adresse:=0; - tco[XclicCell,YClicCell].Bimage:=0; - tco[XclicCell,YClicCell].liaisons:=0; - tco[XclicCell,YClicCell].Texte:=''; - - efface_entoure; - efface_cellule(ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); - TamponAffecte:=true; - xCoupe:=XclicCell;yCoupe:=YclicCell; - - Affiche_tco; - exit; - end; - - TCO_modifie:=true; - copier; - SelectionAffichee:=false; - - xCell1:=XminiSel div LargeurCell +1; - xCell2:=XmaxiSel div LargeurCell +1; - yCell1:=yminiSel div HauteurCell +1; - yCell2:=ymaxiSel div HauteurCell +1; - - xCoupe:=XCell1;yCoupe:=yCell1; - for y:=yCell1 to yCell2 do - for x:=xCell1 to xCell2 do - begin - tco[x,y].Adresse:=0; - tco[x,y].BImage:=0; - tco[x,y].liaisons:=0; - tco[x,y].Texte:=''; - //Affiche('Efface cellules '+IntToSTR(X)+' '+intToSTR(y),clyellow); - efface_entoure; - efface_cellule(ImageTCO.Canvas,X,Y,PmCopy); - if avecGrille then grille; - end; + couper; end; @@ -7138,13 +9387,14 @@ end; // exemple : deux lignes qui se croisent renvoie un croisement // el = élement à remplacer // Bim = élément d'origine -// quadrant du tracé (1=N 2=NE 3=Est 4=SE ) -// premier : si c'est le premier élément -// dernier : si c'est le dernier élément +// quadrant du tracé (2=NE 3=Est 4=SE 5=S ) +// premier : si c'est le premier élément du tracé +// dernier : si c'est le dernier élément du tracé +// on regarde si l'élément est connecté par testbit(tco[x,y].liaisons,numbit) numbit=0=NO 1=N 2=NE 3=E 4=SE 5=S 6=SO 7=O function replace(x,y,el,quadrant : integer;premier,dernier : boolean) : integer; var bim : integer; begin - if debugTCO then Affiche('Quadrant '+intToSTR(quadrant),clred); + //if debugTCO then Affiche('Quadrant '+intToSTR(quadrant),clred); result:=0; bim:=tco[x,y].BImage; // élément d'origine @@ -7294,9 +9544,17 @@ begin end; if quadrant=5 then begin - if premier then result:=17; - if dernier then result:=18; - + if premier then + begin + // SO + if testbit(tco[x-1,y+1].liaisons,2) then result:=32 else result:=17; + end; + if dernier then + begin + // NE + if testbit(tco[x+1,y-1].liaisons,6) then result:=34 else result:=18; + end; + if not(premier) and not(dernier) then result:=23; end; end; 11 : begin @@ -7314,15 +9572,23 @@ begin if testbit(tco[x-1,y-1].liaisons,4) and not(testbit(tco[x+1,y+1].liaisons,0)) then result:=5; end; end; - if (quadrant=4) then result:=11; + if quadrant=4 then result:=11; if quadrant=5 then begin - if dernier then result:=19; - if premier then result:=16; + if dernier then + begin + // NO + if testbit(tco[x-1,y-1].liaisons,4) then result:=33 else result:=19; + end; + if premier then + begin + // SE + if testbit(tco[x+1,y+1].liaisons,0) then result:=29 else result:=16; + end; if not(premier) and not(dernier) then result:=25; end; end; - 12 : begin + 12 : begin if quadrant=4 then result:=12; if quadrant=3 then begin @@ -7331,7 +9597,7 @@ begin if not(premier) and not(dernier) then result:=22; end; end; - 13 : begin + 13 : begin if quadrant=2 then result:=13; if quadrant=3 then begin @@ -7340,7 +9606,7 @@ begin if not(premier) and not(dernier) then result:=21; end; end; - 14 : begin + 14 : begin if quadrant=4 then result:=14; if quadrant=3 then begin @@ -7350,7 +9616,7 @@ begin end; end; - 15 : begin + 15 : begin if quadrant=2 then result:=15; if quadrant=3 then begin @@ -7358,12 +9624,15 @@ begin if premier then result:=15; if not(premier) and not(dernier) then result:=21; end; + end; - 16 : begin + 16 : begin if quadrant=4 then begin + if premier then result:=29; if dernier then result:=16; + if not(premier) and not(dernier) then result:=29; end; if quadrant=5 then begin @@ -7371,26 +9640,60 @@ begin end; end; - 17 : begin - if quadrant=2 then result:=17; - if quadrant=5 then result:=17; + 17 : begin + if quadrant=2 then + begin + if premier then result:=17; + if dernier then result:=32; + if not(premier) and not(dernier) then result:=32; + end; + if quadrant=5 then + begin + if premier then result:=17; + if dernier then result:=26; + if not(premier) and not(dernier) then result:=26; + end; end; - 18 : begin - if quadrant=2 then result:=18; - if quadrant=5 then result:=18; + 18 : begin + if quadrant=2 then result:=34; + if quadrant=5 then + begin + if premier then result:=27; + if dernier then + begin + if testbit(tco[x,y+1].liaisons,1) then result:=21;result:=18; + end; + if not(premier) and not(dernier) then result:=27; + end; end; - 19 : begin + 19 : begin if quadrant=4 then result:=19; - if quadrant=5 then result:=19; + if quadrant=5 then + begin + result:=28; + end; end; - 20 : begin + 20 : begin if (quadrant=2) then begin - if premier and not(testbit(tco[x,y-1].liaisons,5)) then result:=17; - if dernier then result:=18; + if premier then + begin + // /N + if not(testbit(tco[x,y-1].liaisons,5)) then result:=17 else result:=26; + // SO + if (testbit(tco[x-1,y+1].liaisons,2)) then result:=23; + // /SO N + if not(testbit(tco[x-1,y+1].liaisons,2)) and testbit(tco[x-1,y].liaisons,5) then result:=26; + end; + if dernier then + begin + // /S + if not(testbit(tco[x,y+1].liaisons,1)) then result:=18 else result:=27; + end; + if not(premier) and not(dernier) then result:=23; end; if quadrant=4 then begin @@ -7403,7 +9706,11 @@ begin if premier then begin if (testbit(tco[x-1,y-1].liaisons,4)) then result:=25; - if not(testbit(tco[x-1,y-1].liaisons,4)) then result:=19; + // /NO /S + if not(testbit(tco[x-1,y-1].liaisons,4)) and not(testbit(tco[x,y+1].liaisons,1)) then result:=19; + // /NO S + if not(testbit(tco[x-1,y-1].liaisons,4)) and (testbit(tco[x,y+1].liaisons,1)) then result:=28; + end; if not(premier) and not(dernier) then result:=25; end; @@ -7411,6 +9718,7 @@ begin end; 21 : result:=21; 22 : result:=22; + 23 : result:=23; 24 : begin if quadrant=4 then begin @@ -7425,8 +9733,93 @@ begin if quadrant=5 then result:=24; end; 25 : result:=25; + 26 : begin + if quadrant=2 then + begin + if premier then result:=26; + if dernier then result:=23; + if not(premier) and not(dernier) then result:=23; + end; + end; + + 27 : begin + if quadrant=2 then + begin + if premier then result:=23; + if dernier then result:=27; + if not(premier) and not(dernier) then result:=23; + end; + if quadrant=5 then result:=27; + end; + + 28 : begin + if quadrant=4 then + begin + if premier then result:=28; + if dernier then + begin + if (testbit(tco[x,y-1].liaisons,5)) and (testbit(tco[x+1,y+1].liaisons,0)) and (testbit(tco[x,y+1].liaisons,1)) then result:=25 else result:=28; + end; + if not(premier) and not(dernier) then result:=25; + end; + if quadrant=5 then result:=28; + end; + 29 : begin + if quadrant=4 then result:=29; + if quadrant=5 then + begin + if dernier then result:=25; + if premier then result:=29; + if not(premier) and not(dernier) then result:=25; + end; + end; + 32 : begin + if quadrant=2 then result:=32; + if quadrant=5 then + begin + if dernier then result:=23; + if premier then + begin + // N + if (testbit(tco[x,y-1].liaisons,5)) then result:=23 else result:=32; + end; + if not(premier) and not(dernier) then + begin + // N + if (testbit(tco[x,y-1].liaisons,5)) then result:=23 else result:=32; + end; + end; + end; + 33 : begin + if quadrant=1 then + begin + if premier then result:=32; + if dernier then result:=25; + if not(premier) and not(dernier) then result:=25; + end; + if quadrant=5 then + begin + if premier then result:=25; + if dernier then result:=33; + if not(premier) and not(dernier) then result:=25; + end; + if quadrant=4 then result:=33; + end; + 34 : begin + if quadrant=2 then result:=34; + if quadrant=5 then + begin + if dernier then result:=34; + if premier then result:=23; + if not(premier) and not(dernier) then result:=23; + end; + end; end; tco[x,y].coulFonte:=clyellow; + if result=1 then + begin + tco[x,y].repr:=2; + end; end; @@ -7440,6 +9833,7 @@ begin begin if affEvt then Affiche('TCO Souris clicG enfoncée',clYellow); if dbleClicTCO then begin dbleClicTCO:=false;exit;end; + auto_tcurs:=true; clicsouris:=true; GetCursorPos(Position); Position:=formTCO.ImageTCO.screenToCLient(Position); @@ -7462,7 +9856,7 @@ begin if indextrace=1 then begin - // vérifier coordonnées valides + // vérifier coordonnées valides if ( abs(XClicCell-traceXY[1].x)=abs(YClicCell-traceXY[1].y) ) or ( XClicCell-traceXY[1].x=0 ) or ( YClicCell-traceXY[1].y=0 ) then begin @@ -7609,6 +10003,7 @@ begin if button=mbRight then begin if affEvt then Affiche('TCO Souris clicD enfoncée',clLime); + auto_tcurs:=true; if modetrace then begin @@ -7644,7 +10039,7 @@ begin if affevt then Affiche('ImageTCOMouseMove',clLime); if dbleClicTCO then begin dbleClicTCO:=false;exit;end; if Temposouris>0 then begin exit;end; - // Affiche('*',cllime); + // Affiche('*',cllime); SourisX.Caption:=IntToSTR(x); SourisY.Caption:=IntToSTR(y); //affiche(intToSTR(x),clorange); @@ -7668,55 +10063,46 @@ begin if modeTrace then begin if indexTrace>0 then + begin + with ImageTCO.canvas do begin + Pen.Mode:=pmXor; + Pen.Color:=clwhite; + Pen.Width:=2; + // efface le précédent + if traceXY[indextrace+1].x<>0 then begin - with ImageTCO.canvas do - begin - Pen.Mode:=pmXor; - Pen.Color:=clwhite; - Pen.Width:=2; - // efface le précédent - if traceXY[indextrace+1].x<>0 then - begin - if debugTCO then Affiche('Efface précédent',clyellow); - if ancienok then Pen.color:=clyellow else pen.color:=clGray; - MoveTo(traceXY[indexTrace].x*largeurCell-LargeurCelld2,traceXY[indexTrace].y*hauteurCell-HauteurCelld2); - LineTo(ancienTraceX*largeurcell-largeurCelld2,ancienTraceY*HauteurCell-HauteurCelld2); - end; - if debugTCO then Affiche('Trace',clyellow); + if debugTCO then Affiche('Efface précédent',clyellow); + if ancienok then Pen.color:=clyellow else pen.color:=clGray; + MoveTo(traceXY[indexTrace].x*largeurCell-LargeurCelld2,traceXY[indexTrace].y*hauteurCell-HauteurCelld2); + LineTo(ancienTraceX*largeurcell-largeurCelld2,ancienTraceY*HauteurCell-HauteurCelld2); + end; + if debugTCO then Affiche('Trace',clyellow); + ancienTraceX:=cellx; + ancienTraceY:=celly; + ok:=( abs(cellX-traceXY[indexTrace].x)=abs(cellY-traceXY[indexTrace].y) ) or + ( cellX-traceXY[indexTrace].x=0 ) or ( cellY-traceXY[indexTrace].y=0 ) ; - ancienTraceX:=cellx; - ancienTraceY:=celly; + if (ancienok=false) and ok then screen.cursor:=crUpArrow; + if ancienok and (ok=false) then screen.cursor:=crNoDrop; + Ancienok:=ok; + if ok then Pen.color:=clyellow else pen.color:=clGray; - ok:=( abs(cellX-traceXY[indexTrace].x)=abs(cellY-traceXY[indexTrace].y) ) or - ( cellX-traceXY[indexTrace].x=0 ) or ( cellY-traceXY[indexTrace].y=0 ) ; + MoveTo(traceXY[indexTrace].x*largeurCell-LargeurCelld2,traceXY[indexTrace].y*hauteurCell-HauteurCelld2); + LineTo(cellX*largeurCell-largeurCelld2,CellY*hauteurCell-HauteurCelld2); - if (ancienok=false) and ok then screen.cursor:=crUpArrow; - if ancienok and (ok=false) then screen.cursor:=crNoDrop; - - Ancienok:=ok; - if ok then Pen.color:=clyellow else pen.color:=clGray; - - - - - MoveTo(traceXY[indexTrace].x*largeurCell-LargeurCelld2,traceXY[indexTrace].y*hauteurCell-HauteurCelld2); - LineTo(cellX*largeurCell-largeurCelld2,CellY*hauteurCell-HauteurCelld2); - - if ok then - begin - traceXY[indextrace+1].x:=cellX; - traceXY[indextrace+1].y:=cellY; - end; - end; + if ok then + begin + traceXY[indextrace+1].x:=cellX; + traceXY[indextrace+1].y:=cellY; end; end; + end; exit; end; if not(clicsouris) or (temposouris>0) then exit; - //Affiche('haaa',clyellow); xMiniSel:=(XclicCell-1)*LargeurCell; yMiniSel:=(YclicCell-1)*HauteurCell; xMaxiSel:=(cellX-1)*LargeurCell; @@ -7785,11 +10171,23 @@ end; // changement de l'adresse d'un élément procedure TFormTCO.EditAdrElementChange(Sender: TObject); var Adr,erreur,index : integer; + s: string; begin //Affiche('Chgt adresse',clyellow); if clicTCO or not(formConfCellTCOAff) then exit; - Val(EditAdrElement.Text,Adr,erreur); + clicTCO:=true; + auto_tcurs:=false; // interdit le déplacement du curseur encadré du TCO (pour que les tuouches curseur s'applique au Tedit) + + s:=EditAdrElement.Text; + if length(s)>1 then + begin + if (s[1]='A') or (s[1]='a') then delete(s,1,1); + EditAdrElement.Text:=s; + end; + + Val(s,Adr,erreur); if (erreur<>0) or (Adr<0) or (Adr>2048) then Adr:=0; + clicTCO:=false; if Adr=0 then tco[XClicCell,YClicCell].repr:=2; @@ -7799,9 +10197,9 @@ begin tco_Modifie:=true; // si signal - if tco[XClicCell,YClicCell].BImage=30 then + if tco[XClicCell,YClicCell].BImage=50 then begin - index:=Index_feu(adr); + index:=Index_Signal(adr); if index=0 then exit else begin @@ -7914,7 +10312,7 @@ begin defocusControl(ButtonConfigTCO,true); end; -procedure TFormTCO.ImagePalette30EndDrag(Sender, Target: TObject; X, Y: Integer); +procedure TFormTCO.ImagePalette50EndDrag(Sender, Target: TObject; X, Y: Integer); begin if not(Target is TImage) then exit; if (Target as TImage).Name<>'ImageTCO' then exit; @@ -7928,7 +10326,7 @@ begin stocke_undo(1,XClicCell,YClicCell); maj_undo(1); efface_cellule(ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); - tco[XClicCell,YClicCell].BImage:=30; + tco[XClicCell,YClicCell].BImage:=50; tco[XClicCell,YClicCell].liaisons:=0; tco[XClicCell,YClicCell].Adresse:=0; tco[XClicCell,YClicCell].FeuOriente:=1; @@ -7943,12 +10341,12 @@ begin end; -procedure TFormTCO.ImagePalette30MouseDown(Sender: TObject; Button: TMouseButton;Shift: TShiftState; X, Y: Integer); +procedure TFormTCO.ImagePalette50MouseDown(Sender: TObject; Button: TMouseButton;Shift: TShiftState; X, Y: Integer); var l,h : integer; begin l:=Formprinc.Image9feux.width; //57 h:=Formprinc.Image9feux.height; //105 - ImagePalette30.BeginDrag(true); + ImagePalette50.BeginDrag(true); BitBlt(OldBmp.Canvas.Handle,0,0,LargeurCell,HauteurCell,ImageTCO.Canvas.Handle,offsetSourisX,offsetSourisY,SRCCOPY); drag:=true; oldx:=offsetSourisX;oldy:=offsetSourisY; @@ -7974,7 +10372,7 @@ var BImage : integer; begin if actualize then exit; BImage:=TCO[XClicCell,YClicCell].Bimage; - if Bimage<>30 then exit; + if Bimage<>50 then exit; TCO_modifie:=true; @@ -8013,12 +10411,12 @@ var BImage,aspect,adresse : integer; begin if actualize then exit; BImage:=TCO[XClicCell,YClicCell].Bimage; - if Bimage<>30 then exit; + if Bimage<>50 then exit; TCO_modifie:=true; adresse:=TCO[XClicCell,YClicCell].Adresse; - aspect:=feux[index_feu(adresse)].Aspect; + aspect:=feux[Index_Signal(adresse)].Aspect; if aspect=0 then aspect:=9; // ancien signal orienté orienté 90D @@ -8058,11 +10456,11 @@ begin if actualize then exit; BImage:=TCO[XClicCell,YClicCell].Bimage; // si c'est autre chose qu'un signal, sortir - if Bimage<>30 then exit; + if Bimage<>50 then exit; TCO_modifie:=true; adresse:=TCO[XClicCell,YClicCell].Adresse; - aspect:=feux[index_feu(adresse)].Aspect; + aspect:=feux[Index_Signal(adresse)].Aspect; if aspect=0 then aspect:=9; // effacement de l'ancien signal @@ -8123,6 +10521,8 @@ procedure TFormTCO.EditTexteChange(Sender: TObject); begin if clicTCO then exit; if affevt then Affiche('TCO.EditTextChange',clOrange); + auto_tcurs:=false; // interdit le déplacement du curseur encadré du TCO (pour que les tuouches curseur s'applique au Tedit) + PCanvasTCO.Brush.Color:=Clfond; efface_entoure; @@ -8140,18 +10540,18 @@ end; procedure TFormTCO.ButtonSimuClick(Sender: TObject); begin - aiguillage[Index_Aig(1)].position:=const_droit; + aiguillage[Index_Aig(1)].position:=const_devie; aiguillage[Index_Aig(2)].position:=const_devie; aiguillage[Index_Aig(3)].position:=const_droit; aiguillage[Index_Aig(4)].position:=const_devie; aiguillage[Index_Aig(5)].position:=const_devie; - aiguillage[Index_Aig(8)].position:=const_devie; - aiguillage[Index_Aig(9)].position:=const_droit; + aiguillage[Index_Aig(8)].position:=const_droit; + aiguillage[Index_Aig(9)].position:=const_devie; aiguillage[Index_Aig(7)].position:=const_devie; aiguillage[Index_Aig(12)].position:=const_devie; aiguillage[Index_Aig(20)].position:=const_droit; aiguillage[Index_Aig(21)].position:=const_droit; - aiguillage[Index_Aig(26)].position:=const_devie; + aiguillage[Index_Aig(26)].position:=const_droit; aiguillage[Index_Aig(28)].position:=const_droit; index_couleur:=1; aiguillage[Index_Aig(81)].position:=const_droit; @@ -8161,13 +10561,13 @@ begin aiguillage[Index_Aig(116)].position:=const_droit; aiguillage[Index_Aig(117)].position:=const_devie; - zone_TCO(530,520,1); - zone_TCO(515,517,1); - zone_tco(518,523,1); - zone_tco(522,527,1); + //debugTco:=true; + zone_tco(518,514,1); + // zone_tco(518,515,1); - zone_tco(599,527,1); + //zone_tco(522,514,1); + //zone_tco(514,522,1); end; procedure TFormTCO.CheckPinvClick(Sender: TObject); @@ -8209,6 +10609,8 @@ var Bimage,Adresse,i : integer; begin if affEvt then Affiche('Double clic',clYellow); clicsouris:=false; + auto_tcurs:=true; // autorise le déplacement du des touches curseur encadré du TCO + Bimage:=Tco[xClicCell,yClicCell].BImage; Adresse:=Tco[xClicCell,yClicCell].Adresse; if adresse=0 then exit; @@ -8222,14 +10624,16 @@ begin tjdC:=false; // commande tjd/c - if (Bimage=21) or (Bimage=22) or (Bimage=25) then + if (Bimage=21) or (Bimage=22) or (Bimage=23) or (Bimage=25) then begin + i:=Index_aig(Adresse); tjdC:=(aiguillage[i].modele=tjd) or (aiguillage[i].modele=tjs); end; // commande aiguillage if (Bimage=2) or (Bimage=3) or (Bimage=4) or (Bimage=5) or (Bimage=12) or - (Bimage=13) or (Bimage=14) or (Bimage=15) or (Bimage=24) or TJDc then + (Bimage=13) or (Bimage=14) or (Bimage=15) or (Bimage=24) or ((Bimage>=26) and (Bimage<=34)) or + TJDc then begin aiguille:=Adresse; i:=Index_aig(Adresse); @@ -8247,10 +10651,10 @@ begin end; // commande de signal - if Bimage=30 then + if Bimage=50 then begin AdrPilote:=adresse; - i:=Index_feu(adresse); + i:=Index_Signal(adresse); if i=0 then exit; TFormPilote.Create(Self); with formPilote do @@ -8370,7 +10774,7 @@ begin accept:=true; end; -procedure TFormTCO.ImagePalette31DragOver(Sender, Source: TObject; X, +procedure TFormTCO.ImagePalette51DragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); begin accept:=true; @@ -8395,7 +10799,7 @@ begin end; -procedure TFormTCO.ImagePalette31EndDrag(Sender, Target: TObject; X, +procedure TFormTCO.ImagePalette51EndDrag(Sender, Target: TObject; X, Y: Integer); begin if not(Target is TImage) then exit; @@ -8408,10 +10812,10 @@ begin XclicCell:=Xclic div largeurCell +1; YclicCell:=Yclic div hauteurCell +1; efface_cellule(ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); - Dessin_31(ImageTCO.Canvas,XClicCell,YClicCell,0); + Dessin_51(ImageTCO.Canvas,XClicCell,YClicCell,0); stocke_undo(1,XClicCell,YClicCell); maj_undo(1); - tco[XClicCell,YClicCell].BImage:=31; + tco[XClicCell,YClicCell].BImage:=51; tco[XClicCell,YClicCell].liaisons:=0; tco[XClicCell,YClicCell].Adresse:=0; EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); @@ -8441,6 +10845,7 @@ begin tco[XClicCell,YClicCell].BImage:=24; tco[XClicCell,YClicCell].liaisons:=liaisons[24]; tco[XClicCell,YClicCell].Adresse:=0; + tco[xClicCell,YClicCell].CoulFonte:=clYellow; EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); end; @@ -8466,6 +10871,7 @@ begin tco[XClicCell,YClicCell].BImage:=25; tco[XClicCell,YClicCell].liaisons:=liaisons[25]; tco[XClicCell,YClicCell].Adresse:=0; + tco[xClicCell,YClicCell].CoulFonte:=clYellow; EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); end; @@ -8495,10 +10901,10 @@ begin EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); end; -procedure TFormTCO.ImagePalette31MouseDown(Sender: TObject; +procedure TFormTCO.ImagePalette51MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin - debut_drag(ImagePalette31); + debut_drag(ImagePalette51); end; procedure TFormTCO.ImagePalette24MouseDown(Sender: TObject; @@ -8579,7 +10985,7 @@ begin accept:=true; end; -procedure TFormTCO.ImagePalette30DragOver(Sender, Source: TObject; X, +procedure TFormTCO.ImagePalette50DragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); begin accept:=true; @@ -8649,7 +11055,7 @@ end; procedure signalD; begin if actualize then exit; - if TCO[XClicCell,YClicCell].Bimage=30 then + if TCO[XClicCell,YClicCell].Bimage=50 then begin TCO[XClicCell,YClicCell].PiedFeu:=2; Affiche_TCO; @@ -8666,7 +11072,7 @@ end; procedure signalG; begin if actualize then exit; - if TCO[XClicCell,YClicCell].Bimage=30 then + if TCO[XClicCell,YClicCell].Bimage=50 then begin TCO[XClicCell,YClicCell].PiedFeu:=1; Affiche_TCO; @@ -8694,7 +11100,7 @@ begin PopUpMenu1.Items[10][1].Caption:='Colonne '+intToSTR(XclicCell); // grise ou non l'entrée signal du menu - if tco[XClicCell,YClicCell].Bimage=30 then + if tco[XClicCell,YClicCell].Bimage=50 then begin PopUpMenu1.Items[6].Enabled:=true; oriente:=tco[XClicCell,YClicCell].Feuoriente; @@ -8943,7 +11349,7 @@ begin dec(NbreCellX); SetLength(TCO,NbreCellX+1,NbreCellY+1); // ajuste taille SetLength(TamponTCO,NbreCellX+1,NbreCellY+1); // ajuste taille - + affiche_TCO; end; @@ -9095,7 +11501,7 @@ begin if affevt then Affiche('TCO evt editTypeImageChange',clorange); if actualize then exit; Val(EditTypeImage.Text,Bimage,erreur); - if (erreur<>0) or not(Bimage in[0..22,24..25,30,31]) then + if (erreur<>0) or not(Bimage in[0..22,24..25,50,51]) then begin exit; end; @@ -9142,11 +11548,6 @@ begin defocusControl(buttonDessiner,true); end; - - - - - procedure TFormTCO.ButtonTrajetClick(Sender: TObject); var c : Tcanvas; begin @@ -9161,10 +11562,323 @@ begin TCO[9,3].Adresse:=1;dessin_14(c,9,3,1); TCO[11,3].Adresse:=1;dessin_15(c,11,3,1); TCO[5,5].Adresse:=1;dessin_24(c,5,5,1); - + end; +procedure TFormTCO.ImagePalette26DragOver(Sender, Source: TObject; X, + Y: Integer; State: TDragState; var Accept: Boolean); +begin + accept:=true; +end; + +procedure TFormTCO.ImagePalette26EndDrag(Sender, Target: TObject; X, + Y: Integer); +begin + if not(Target is TImage) then exit; + if (Target as TImage).Name<>'ImageTCO' then exit; + if (x=0) and (y=0) then exit; + BitBlt(imageTCO.canvas.handle,oldx,oldy,LargeurCell,HauteurCell,oldbmp.canvas.handle,0,0,SRCCOPY); + efface_entoure; + imageTCO.repaint; + Xclic:=X;YClic:=Y; + XclicCell:=Xclic div largeurCell +1; + YclicCell:=Yclic div hauteurCell +1; + if not(verif_cellule(XclicCell,YclicCell,26)) then exit; + efface_cellule(ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); + TCO_modifie:=true; + + Dessin_26(ImageTCO.Canvas,XClicCell,YClicCell,0); + stocke_undo(1,XClicCell,YClicCell); + maj_undo(1); + tco[XClicCell,YClicCell].BImage:=26; + tco[XClicCell,YClicCell].liaisons:=liaisons[26]; + tco[XClicCell,YClicCell].Adresse:=0; + tco[xClicCell,YClicCell].CoulFonte:=clYellow; + EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); + EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); +end; + +procedure TFormTCO.ImagePalette26MouseDown(Sender: TObject; + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + debut_drag(ImagePalette26); +end; + +procedure TFormTCO.ImagePalette23EndDrag(Sender, Target: TObject; X, + Y: Integer); +begin + if not(Target is TImage) then exit; + if (Target as TImage).Name<>'ImageTCO' then exit; + if (x=0) and (y=0) then exit; + BitBlt(imageTCO.canvas.handle,oldx,oldy,LargeurCell,HauteurCell,oldbmp.canvas.handle,0,0,SRCCOPY); + efface_entoure; + imageTCO.repaint; + Xclic:=X;YClic:=Y; + XclicCell:=Xclic div largeurCell +1; + YclicCell:=Yclic div hauteurCell +1; + if not(verif_cellule(XclicCell,YclicCell,23)) then exit; + efface_cellule(ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); + TCO_modifie:=true; + Dessin_23(ImageTCO.Canvas,XClicCell,YClicCell,0); + stocke_undo(1,XClicCell,YClicCell); + maj_undo(1); + tco[XClicCell,YClicCell].BImage:=23; + tco[XClicCell,YClicCell].liaisons:=liaisons[23]; + tco[XClicCell,YClicCell].Adresse:=0; + tco[xClicCell,YClicCell].CoulFonte:=clYellow; + EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); + EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); +end; + +procedure TFormTCO.ImagePalette23DragOver(Sender, Source: TObject; X, + Y: Integer; State: TDragState; var Accept: Boolean); +begin + accept:=true; +end; + +procedure TFormTCO.ImagePalette23MouseDown(Sender: TObject; + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + debut_drag(ImagePalette23); +end; + +procedure TFormTCO.ImagePalette27DragOver(Sender, Source: TObject; X, + Y: Integer; State: TDragState; var Accept: Boolean); +begin + accept:=true; +end; + +procedure TFormTCO.ImagePalette27MouseDown(Sender: TObject; + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + debut_drag(ImagePalette27); +end; + +procedure TFormTCO.ImagePalette27EndDrag(Sender, Target: TObject; X, + Y: Integer); +begin + if not(Target is TImage) then exit; + if (Target as TImage).Name<>'ImageTCO' then exit; + if (x=0) and (y=0) then exit; + BitBlt(imageTCO.canvas.handle,oldx,oldy,LargeurCell,HauteurCell,oldbmp.canvas.handle,0,0,SRCCOPY); + efface_entoure; + imageTCO.repaint; + Xclic:=X;YClic:=Y; + XclicCell:=Xclic div largeurCell +1; + YclicCell:=Yclic div hauteurCell +1; + if not(verif_cellule(XclicCell,YclicCell,27)) then exit; + efface_cellule(ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); + TCO_modifie:=true; + + Dessin_27(ImageTCO.Canvas,XClicCell,YClicCell,0); + stocke_undo(1,XClicCell,YClicCell); + maj_undo(1); + tco[XClicCell,YClicCell].BImage:=27; + tco[XClicCell,YClicCell].liaisons:=liaisons[27]; + tco[XClicCell,YClicCell].Adresse:=0; + tco[xClicCell,YClicCell].CoulFonte:=clYellow; + EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); + EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); +end; + +procedure TFormTCO.ImagePalette28DragOver(Sender, Source: TObject; X, + Y: Integer; State: TDragState; var Accept: Boolean); +begin + accept:=true; +end; + +procedure TFormTCO.ImagePalette28EndDrag(Sender, Target: TObject; X, + Y: Integer); +begin + if not(Target is TImage) then exit; + if (Target as TImage).Name<>'ImageTCO' then exit; + if (x=0) and (y=0) then exit; + BitBlt(imageTCO.canvas.handle,oldx,oldy,LargeurCell,HauteurCell,oldbmp.canvas.handle,0,0,SRCCOPY); + efface_entoure; + imageTCO.repaint; + Xclic:=X;YClic:=Y; + XclicCell:=Xclic div largeurCell +1; + YclicCell:=Yclic div hauteurCell +1; + if not(verif_cellule(XclicCell,YclicCell,28)) then exit; + efface_cellule(ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); + TCO_modifie:=true; + + Dessin_28(ImageTCO.Canvas,XClicCell,YClicCell,0); + stocke_undo(1,XClicCell,YClicCell); + maj_undo(1); + tco[XClicCell,YClicCell].BImage:=28; + tco[XClicCell,YClicCell].liaisons:=liaisons[28]; + tco[XClicCell,YClicCell].Adresse:=0; + tco[xClicCell,YClicCell].CoulFonte:=clYellow; + EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); + EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); + +end; + +procedure TFormTCO.ImagePalette28MouseDown(Sender: TObject; + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + debut_drag(ImagePalette28); +end; + +procedure TFormTCO.ImagePalette29DragOver(Sender, Source: TObject; X, + Y: Integer; State: TDragState; var Accept: Boolean); +begin + accept:=true; +end; + +procedure TFormTCO.ImagePalette29EndDrag(Sender, Target: TObject; X, + Y: Integer); +begin + if not(Target is TImage) then exit; + if (Target as TImage).Name<>'ImageTCO' then exit; + if (x=0) and (y=0) then exit; + BitBlt(imageTCO.canvas.handle,oldx,oldy,LargeurCell,HauteurCell,oldbmp.canvas.handle,0,0,SRCCOPY); + efface_entoure; + imageTCO.repaint; + Xclic:=X;YClic:=Y; + XclicCell:=Xclic div largeurCell +1; + YclicCell:=Yclic div hauteurCell +1; + if not(verif_cellule(XclicCell,YclicCell,29)) then exit; + efface_cellule(ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); + TCO_modifie:=true; + Dessin_29(ImageTCO.Canvas,XClicCell,YClicCell,0); + stocke_undo(1,XClicCell,YClicCell); + maj_undo(1); + tco[XClicCell,YClicCell].BImage:=29; + tco[XClicCell,YClicCell].liaisons:=liaisons[29]; + tco[XClicCell,YClicCell].Adresse:=0; + tco[xClicCell,YClicCell].CoulFonte:=clYellow; + EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); + EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); +end; + +procedure TFormTCO.ImagePalette29MouseDown(Sender: TObject; + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + debut_drag(ImagePalette29); +end; + +procedure TFormTCO.ImagePalette32DragOver(Sender, Source: TObject; X, + Y: Integer; State: TDragState; var Accept: Boolean); +begin + accept:=true; +end; + +procedure TFormTCO.ImagePalette32EndDrag(Sender, Target: TObject; X, + Y: Integer); +begin + if not(Target is TImage) then exit; + if (Target as TImage).Name<>'ImageTCO' then exit; + if (x=0) and (y=0) then exit; + BitBlt(imageTCO.canvas.handle,oldx,oldy,LargeurCell,HauteurCell,oldbmp.canvas.handle,0,0,SRCCOPY); + efface_entoure; + imageTCO.repaint; + Xclic:=X;YClic:=Y; + XclicCell:=Xclic div largeurCell +1; + YclicCell:=Yclic div hauteurCell +1; + if not(verif_cellule(XclicCell,YclicCell,32)) then exit; + efface_cellule(ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); + TCO_modifie:=true; + Dessin_32(ImageTCO.Canvas,XClicCell,YClicCell,0); + stocke_undo(1,XClicCell,YClicCell); + maj_undo(1); + tco[XClicCell,YClicCell].BImage:=32; + tco[XClicCell,YClicCell].liaisons:=liaisons[32]; + tco[XClicCell,YClicCell].Adresse:=0; + tco[xClicCell,YClicCell].CoulFonte:=clYellow; + EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); + EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); +end; + +procedure TFormTCO.ImagePalette32MouseDown(Sender: TObject; + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + debut_drag(ImagePalette32); +end; + +procedure TFormTCO.ImagePalette33DragOver(Sender, Source: TObject; X, + Y: Integer; State: TDragState; var Accept: Boolean); +begin + accept:=true; +end; + +procedure TFormTCO.ImagePalette33EndDrag(Sender, Target: TObject; X, + Y: Integer); +begin + if not(Target is TImage) then exit; + if (Target as TImage).Name<>'ImageTCO' then exit; + if (x=0) and (y=0) then exit; + BitBlt(imageTCO.canvas.handle,oldx,oldy,LargeurCell,HauteurCell,oldbmp.canvas.handle,0,0,SRCCOPY); + efface_entoure; + imageTCO.repaint; + Xclic:=X;YClic:=Y; + XclicCell:=Xclic div largeurCell +1; + YclicCell:=Yclic div hauteurCell +1; + if not(verif_cellule(XclicCell,YclicCell,33)) then exit; + efface_cellule(ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); + TCO_modifie:=true; + Dessin_33(ImageTCO.Canvas,XClicCell,YClicCell,0); + stocke_undo(1,XClicCell,YClicCell); + maj_undo(1); + tco[XClicCell,YClicCell].BImage:=33; + tco[XClicCell,YClicCell].liaisons:=liaisons[33]; + tco[XClicCell,YClicCell].Adresse:=0; + tco[xClicCell,YClicCell].CoulFonte:=clYellow; + EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); + EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); +end; + +procedure TFormTCO.ImagePalette33MouseDown(Sender: TObject; + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + debut_drag(ImagePalette33); +end; + +procedure TFormTCO.ImagePalette34DragOver(Sender, Source: TObject; X, + Y: Integer; State: TDragState; var Accept: Boolean); +begin + accept:=true; +end; + +procedure TFormTCO.ImagePalette34EndDrag(Sender, Target: TObject; X, + Y: Integer); +begin + if not(Target is TImage) then exit; + if (Target as TImage).Name<>'ImageTCO' then exit; + if (x=0) and (y=0) then exit; + BitBlt(imageTCO.canvas.handle,oldx,oldy,LargeurCell,HauteurCell,oldbmp.canvas.handle,0,0,SRCCOPY); + efface_entoure; + imageTCO.repaint; + Xclic:=X;YClic:=Y; + XclicCell:=Xclic div largeurCell +1; + YclicCell:=Yclic div hauteurCell +1; + if not(verif_cellule(XclicCell,YclicCell,34)) then exit; + efface_cellule(ImageTCO.Canvas,XclicCell,YClicCell,PmCopy); + TCO_modifie:=true; + Dessin_34(ImageTCO.Canvas,XClicCell,YClicCell,0); + stocke_undo(1,XClicCell,YClicCell); + maj_undo(1); + tco[XClicCell,YClicCell].BImage:=34; + tco[XClicCell,YClicCell].liaisons:=liaisons[34]; + tco[XClicCell,YClicCell].Adresse:=0; + tco[xClicCell,YClicCell].CoulFonte:=clYellow; + EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); + EdittypeImage.Text:=IntToSTR(tco[XClicCell,YClicCell].BImage); +end; + +procedure TFormTCO.ImagePalette34MouseDown(Sender: TObject; + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + debut_drag(ImagePalette34); +end; + +procedure TFormTCO.EditAdrElementClick(Sender: TObject); +begin + auto_tcurs:=false; +end; + end. diff --git a/Unitplace.pas b/Unitplace.pas index 4692b21..94779c1 100644 --- a/Unitplace.pas +++ b/Unitplace.pas @@ -357,7 +357,7 @@ begin // si il y a un signal sur le détecteur de démarrage du train est il au rouge? if adrFeu<>0 then begin - id:=index_feu(AdrFeu); + id:=index_Signal(AdrFeu); a:=feux[id].EtatSignal; if ((a=semaphore_F) or (a=carre_F) or (a=violet_F)) then rouge:=true; end; diff --git a/tco.cfg b/tco.cfg index 4a18419..ac2255b 100644 --- a/tco.cfg +++ b/tco.cfg @@ -1,4 +1,4 @@ -/ Définitions TCO version 6.3 +/ Définitions TCO version 7.1 CoulFond=202050 CoulVoies=0077FF CoulAllume=00FFFF @@ -8,7 +8,7 @@ CoulQuai=808080 CoulPiedSig=4080FF CoulCanton=00FFFF ModeCouleurCanton=1 -AvecGrille=1 +AvecGrille=0 Graphisme=2 / Taille de la matrice x,y Matrice=39,13 @@ -17,16 +17,16 @@ Ratio=10 /Matrice TCO [Matrice] / couleur fond,adresse,image,inversion aiguillage,Orientation du signal, pied du signal , [texte], representation, fonte, taille fonte, couleur fonte, style, réserve -(202050,358,30,0,1,1,,2,,0,FFFFFF,,0)(202050,0,20,0,0,0,,2,,0,00FFFF,G,0)(202050,0,20,0,0,0,,2,,0,00FFFF,,0)(202050,497,30,0,1,2,,2,,0,FFFFFF,G,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,00FFFF,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,00FFFF,,0)(202050,0,0,0,0,0,,2,,0,00FFFF,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,TCO GARE PRINCIPALE,1,ARIAL,20,00FFFF,GI,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,FFFFFF,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0) -(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,20,0,0,0,,2,,0,00FFFF,,0)(202050,0,20,0,0,0,,2,,0,00FFFF,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,00FFFF,,0)(202050,0,0,0,0,0,,2,,0,00FFFF,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,00FFFF,,0)(202050,0,0,0,0,0,,2,,0,00FFFF,,0)(202050,0,0,0,0,0,,2,,0,00FFFF,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,8,00FF00,,0)(202050,0,0,0,0,0,,2,,8,00FF00,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,00FFFF,,0)(202050,0,0,0,0,0,,2,,0,00FFFF,,0)(202050,0,0,0,0,0,,2,,0,00FFFF,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,9,0,0,0,,2,,0,000000,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,0,,0,00FFFF,,0)(202050,0,8,0,0,0,,0,,0,00FFFF,,0)(202050,0,20,0,0,0,,2,,0,000000,,0)(202050,0,20,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0) -(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,517,20,0,0,0,,2,,0,00FFFF,,0)(202050,531,20,0,0,0,,2,,0,00FFFF,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,6,2,0,0,0,,2,,0,00FF00,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,516,1,0,0,0,,2,,0,00FFFF,,0)(202050,516,1,0,0,0,,0,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,0,0,0,0,,2,,0,00FFFF,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,00FFFF,,0)(202050,0,0,0,0,0,,2,,0,00FFFF,,0)(202050,0,0,0,0,0,,2,,0,00FFFF,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,10,0,0,0,,2,,0,000000,,0)(202050,0,9,0,0,0,,2,,0,000000,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,0,,0,00FFFF,,0)(202050,0,8,0,0,0,,2,,0,00FFFF,,0)(202050,103,25,0,0,0,,2,MS SANS SERIF,10,00FF00,,0)(202050,0,20,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0) -(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,20,0,0,0,,2,,0,00FFFF,,0)(202050,0,20,0,0,0,,2,,0,00FFFF,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,00FFFF,,0)(202050,0,0,0,0,0,,2,,0,00FFFF,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,10,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,232,30,0,3,1,,2,,0,00FF00,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,00FFFF,,0)(202050,0,0,0,0,0,,2,,0,00FFFF,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,00FFFF,,0)(202050,0,0,0,0,0,,2,,0,00FFFF,,0)(202050,0,0,0,0,0,,2,,0,FFFFFF,,0)(202050,288,30,0,2,1,,2,,0,FFFFFF,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,10,0,0,0,,2,MS SANS SERIF,10,00FFFF,,0)(202050,0,10,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,302,30,0,1,1,,0,,0,FFFFFF,,0)(202050,9,24,0,0,0,,2,MS SANS SERIF,10,00FF00,,0)(202050,8,24,0,0,0,,0,MS SANS SERIF,10,00FF00,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0) -(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,20,0,0,0,,2,,0,00FFFF,,0)(202050,0,20,0,0,0,,2,,0,00FFFF,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,372,30,0,1,1,,2,,0,FFFFFF,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,4,15,0,0,0,,2,,0,00FF00,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,514,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,522,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,7,0,0,0,,2,,0,000000,,0)(202050,0,10,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,00FFFF,,0)(202050,0,0,0,0,0,,2,,0,00FFFF,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,FFFFFF,,0)(202050,0,20,0,0,0,,0,,0,00FFFF,,0)(202050,0,20,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0) -(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,20,0,0,0,,2,,0,00FFFF,,0)(202050,0,20,0,0,0,,2,,0,00FFFF,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,3,15,0,0,0,,2,,0,00FF00,,0)(202050,5,2,0,0,0,,2,,0,00FF00,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,515,1,0,0,0,,2,,0,00FFFF,,0)(202050,515,1,0,0,0,,0,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,7,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,00FFFF,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,00FFFF,,0)(202050,0,0,0,0,0,,0,,0,FFFFFF,,0)(202050,526,20,0,0,0,,2,,0,00FFFF,,0)(202050,0,20,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,00FFFF,,0)(202050,0,0,0,0,0,,0,,0,000000,,0) -(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,19,0,0,0,,2,,0,00FFFF,,0)(202050,0,19,0,0,0,,2,,0,00FFFF,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,520,30,0,2,1,,2,,0,00FF00,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,10,0,0,0,,2,,0,000000,,0)(202050,0,10,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,316,30,0,3,1,,2,,0,00FF00,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,31,0,0,0,,2,,0,000000,,0)(202050,0,31,0,0,0,,2,,0,000000,,0)(202050,0,31,0,0,0,QUAI 1,1,ARIAL,12,FFFFFF,G,0)(202050,0,31,0,0,0,,2,,8,00FF00,,0)(202050,0,31,0,0,0,,2,,8,00FF00,,0)(202050,0,31,0,0,0,,2,,0,000000,,0)(202050,0,31,0,0,0,,2,,0,000000,,0)(202050,0,31,0,0,0,,2,,0,000000,,0)(202050,0,31,0,0,0,,2,,0,000000,,0)(202050,0,31,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,190,30,0,2,1,,2,,0,00FF00,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,00FFFF,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,18,0,0,0,,0,,0,00FFFF,,0)(202050,0,18,0,0,0,,0,,0,00FFFF,,0)(202050,0,0,0,0,0,,0,,0,00FFFF,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0) -(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,11,0,0,0,,2,,0,00FFFF,,0)(202050,0,6,0,0,0,,2,,0,000000,,0)(202050,518,1,0,0,0,,0,,0,00FFFF,,0)(202050,518,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,1,3,0,0,0,,2,,8,00FF00,,0)(202050,100,21,0,0,0,,2,,0,00FF00,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,VOIE 2,2,ARIAL,10,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,523,1,0,0,0,,0,,0,00FFFF,,0)(202050,523,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,7,0,0,0,,2,,0,00FFFF,,0)(202050,0,10,0,0,0,,0,,0,00FFFF,,0)(202050,0,0,0,0,0,,0,,0,00FFFF,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0) -(202050,530,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,8,0,0,0,,2,,0,00FFFF,,0)(202050,0,6,0,0,0,,2,,0,000000,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,12,4,1,0,0,,2,,0,00FF00,,0)(202050,2,3,0,0,0,,2,,0,00FF00,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,519,1,0,0,0,,2,,0,00FFFF,,0)(202050,519,1,0,0,0,,0,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,VOIE 1,2,ARIAL,10,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,8,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,7,2,0,0,0,,2,,0,00FF00,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,527,1,0,0,0,,2,,8,00FFFF,,0)(202050,0,1,0,0,0,,3,,8,00FFFF,,0)(202050,0,1,0,0,0,,0,,0,00FFFF,,0)(202050,0,7,0,0,0,,0,,0,00FFFF,,0)(202050,0,0,0,0,0,,0,,0,00FFFF,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0) -(202050,529,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,0,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,26,22,0,0,0,,0,,0,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,0,,0,00FFFF,,0)(202050,0,1,0,0,0,,0,,0,00FFFF,,0)(202050,0,8,0,0,0,,0,,0,000000,,0)(202050,0,11,0,0,0,,0,,0,000000,,0)(202050,330,30,0,3,1,,0,,0,00FF00,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,31,0,0,0,,0,,0,000000,,0)(202050,0,31,0,0,0,,0,,0,000000,,0)(202050,0,31,0,0,0,QUAI 2,1,ARIAL,12,FFFFFF,G,0)(202050,0,31,0,0,0,,0,,0,000000,,0)(202050,0,31,0,0,0,,0,,0,000000,,0)(202050,0,31,0,0,0,,0,,0,000000,,0)(202050,0,31,0,0,0,,0,,0,000000,,0)(202050,0,31,0,0,0,,0,,0,000000,,0)(202050,0,31,0,0,0,,0,,0,000000,,0)(202050,0,31,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,10,0,0,0,,0,,0,000000,,0)(202050,204,30,0,3,1,,0,,0,00FF00,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,8,00FF00,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0) -(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,6,0,0,0,,0,,0,00FFFF,,0)(202050,0,1,0,0,0,,0,,0,00FFFF,,0)(202050,0,1,0,0,0,,0,,0,00FFFF,,0)(202050,0,1,0,0,0,,0,,0,00FFFF,,0)(202050,21,5,0,0,0,,0,,0,00FF00,,0)(202050,20,5,0,0,0,,0,,0,00FF00,,0)(202050,520,1,0,0,0,,2,,8,00FFFF,,0)(202050,520,1,0,0,0,,0,,0,00FFFF,,0)(202050,520,1,0,0,0,,0,,0,00FFFF,,0)(202050,0,1,0,0,0,,0,,8,00FFFF,,0)(202050,0,1,0,0,0,,0,,0,00FFFF,,0)(202050,0,1,0,0,0,,0,,0,00FFFF,,0)(202050,0,1,0,0,0,,0,,8,00FFFF,,0)(202050,0,1,0,0,0,,0,,0,00FFFF,,0)(202050,0,1,0,0,0,,0,,0,00FFFF,,0)(202050,0,1,0,0,0,,0,,8,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,1,0,0,0,,0,,0,00FFFF,,0)(202050,0,1,0,0,0,,0,,8,00FFFF,,0)(202050,0,1,0,0,0,,0,,0,00FFFF,,0)(202050,0,1,0,0,0,,0,,8,00FFFF,,0)(202050,0,1,0,0,0,,2,,0,00FFFF,,0)(202050,0,7,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,8,00FF00,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0) -(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,176,30,0,3,1,,0,,0,00FF00,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,3,,8,00FF00,,0)(202050,0,0,0,0,0,,0,,8,00FF00,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,8,00FF00,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,8,00FF00,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,8,00FF00,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,00FFFF,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,2,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0) -(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,00FFFF,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0)(202050,0,0,0,0,0,,0,,0,000000,,0) +(000040,358,50,0,1,1,,2,,0,FFFFFF,,0)(000040,0,20,0,0,0,,2,,0,00FFFF,G,0)(000040,0,20,0,0,0,,2,,0,00FFFF,,0)(000040,497,50,0,1,2,,2,,0,FFFFFF,G,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,TCO GARE PRINCIPALE,1,ARIAL,20,00FFFF,GI,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,FFFFFF,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0) +(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,20,0,0,0,,2,,0,00FFFF,,0)(000040,0,20,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,8,00FF00,,0)(000040,0,0,0,0,0,,2,,8,00FF00,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,9,0,0,0,,2,,0,000000,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,0,,0,00FFFF,,0)(000040,0,8,0,0,0,,0,,0,00FFFF,,0)(000040,0,20,0,0,0,,2,,0,000000,,0)(000040,0,20,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0) +(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,517,20,0,0,0,,2,,0,00FFFF,,0)(000040,531,20,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,6,2,0,0,0,,2,,0,00FF00,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,516,1,0,0,0,,2,,0,00FFFF,,0)(000040,516,1,0,0,0,,0,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,10,0,0,0,,2,,0,000000,,0)(000040,0,9,0,0,0,,2,,0,000000,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,0,,0,00FFFF,,0)(000040,0,8,0,0,0,,2,,0,00FFFF,,0)(000040,103,25,0,0,0,,2,MS SANS SERIF,10,00FF00,,0)(000040,0,20,0,0,0,,0,,0,000000,,0)(000040,600,50,0,1,1,,2,,0,FFFFFF,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0) +(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,20,0,0,0,,2,,0,00FFFF,,0)(000040,0,20,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,10,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,232,50,0,3,1,,2,,0,00FF00,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,FFFFFF,,0)(000040,288,50,0,2,1,,2,,0,FFFFFF,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,10,0,0,0,,2,MS SANS SERIF,10,00FFFF,,0)(000040,0,10,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,302,50,0,1,1,,0,,0,FFFFFF,,0)(000040,9,24,0,0,0,,2,MS SANS SERIF,10,00FF00,,0)(000040,8,24,0,0,0,,0,MS SANS SERIF,10,00FF00,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0) +(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,20,0,0,0,,2,,0,00FFFF,,0)(000040,0,20,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,372,50,0,1,1,,2,,0,FFFFFF,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,4,15,0,0,0,,2,,0,00FF00,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,514,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,522,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,7,0,0,0,,2,,0,000000,,0)(000040,0,10,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,FFFFFF,,0)(000040,0,20,0,0,0,,0,,0,00FFFF,,0)(000040,0,20,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0) +(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,20,0,0,0,,2,,0,00FFFF,,0)(000040,0,20,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,3,15,0,0,0,,2,,0,00FF00,,0)(000040,5,2,0,0,0,,2,,0,00FF00,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,515,1,0,0,0,,2,,0,00FFFF,,0)(000040,515,1,0,0,0,,0,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,7,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,00FFFF,,0)(000040,0,0,0,0,0,,0,,0,FFFFFF,,0)(000040,526,20,0,0,0,,2,,0,00FFFF,,0)(000040,0,20,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,00FFFF,,0)(000040,0,0,0,0,0,,0,,0,000000,,0) +(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,19,0,0,0,,2,,0,00FFFF,,0)(000040,0,19,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,520,50,0,2,1,,2,,0,00FF00,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,10,0,0,0,,2,,0,000000,,0)(000040,0,10,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,316,50,0,3,1,,2,,0,00FF00,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,51,0,0,0,,2,,0,000000,,0)(000040,0,51,0,0,0,,2,,0,000000,,0)(000040,0,51,0,0,0,QUAI 1,1,ARIAL,12,FFFFFF,G,0)(000040,0,51,0,0,0,,2,,8,00FF00,,0)(000040,0,51,0,0,0,,2,,8,00FF00,,0)(000040,0,51,0,0,0,,2,,0,000000,,0)(000040,0,51,0,0,0,,2,,0,000000,,0)(000040,0,51,0,0,0,,2,,0,000000,,0)(000040,0,51,0,0,0,,2,,0,000000,,0)(000040,0,51,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,190,50,0,2,1,,2,,0,00FF00,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,00FFFF,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,18,0,0,0,,0,,0,00FFFF,,0)(000040,0,18,0,0,0,,0,,0,00FFFF,,0)(000040,0,0,0,0,0,,0,,0,00FFFF,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0) +(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,11,0,0,0,,2,,0,00FFFF,,0)(000040,0,6,0,0,0,,2,,0,000000,,0)(000040,518,1,0,0,0,,0,,0,00FFFF,,0)(000040,518,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,1,3,0,0,0,,2,,8,00FF00,,0)(000040,100,21,0,0,0,,2,,0,00FF00,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,VOIE 2,2,ARIAL,10,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,523,1,0,0,0,,0,,0,00FFFF,,0)(000040,523,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,7,0,0,0,,2,,0,00FFFF,,0)(000040,0,10,0,0,0,,0,,0,00FFFF,,0)(000040,0,0,0,0,0,,0,,0,00FFFF,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0) +(000040,530,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,8,0,0,0,,2,,0,00FFFF,,0)(000040,0,6,0,0,0,,2,,0,000000,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,12,4,1,0,0,,2,,0,00FF00,,0)(000040,2,3,0,0,0,,2,,0,00FF00,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,519,1,0,0,0,,2,,0,00FFFF,,0)(000040,519,1,0,0,0,,0,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,VOIE 1,2,ARIAL,10,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,8,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,7,2,0,0,0,,2,,0,00FF00,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,527,1,0,0,0,,2,,8,00FFFF,,0)(000040,0,1,0,0,0,,3,,8,00FFFF,,0)(000040,0,1,0,0,0,,0,,0,00FFFF,,0)(000040,0,7,0,0,0,,0,,0,00FFFF,,0)(000040,0,0,0,0,0,,0,,0,00FFFF,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0) +(000040,529,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,0,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,26,22,0,0,0,,0,,0,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,0,,0,00FFFF,,0)(000040,0,1,0,0,0,,0,,0,00FFFF,,0)(000040,0,8,0,0,0,,0,,0,000000,,0)(000040,0,11,0,0,0,,0,,0,000000,,0)(000040,330,50,0,3,1,,0,,0,00FF00,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,51,0,0,0,,0,,0,000000,,0)(000040,0,51,0,0,0,,0,,0,000000,,0)(000040,0,51,0,0,0,QUAI 2,1,ARIAL,12,FFFFFF,G,0)(000040,0,51,0,0,0,,0,,0,000000,,0)(000040,0,51,0,0,0,,0,,0,000000,,0)(000040,0,51,0,0,0,,0,,0,000000,,0)(000040,0,51,0,0,0,,0,,0,000000,,0)(000040,0,51,0,0,0,,0,,0,000000,,0)(000040,0,51,0,0,0,,0,,0,000000,,0)(000040,0,51,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,10,0,0,0,,0,,0,000000,,0)(000040,204,50,0,3,1,,0,,0,00FF00,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,8,00FF00,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0) +(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,6,0,0,0,,0,,0,00FFFF,,0)(000040,0,1,0,0,0,,0,,0,00FFFF,,0)(000040,0,1,0,0,0,,0,,0,00FFFF,,0)(000040,0,1,0,0,0,,0,,0,00FFFF,,0)(000040,21,5,0,0,0,,0,,0,00FF00,,0)(000040,20,5,0,0,0,,0,,0,00FF00,,0)(000040,520,1,0,0,0,,2,,8,00FFFF,,0)(000040,520,1,0,0,0,,0,,0,00FFFF,,0)(000040,520,1,0,0,0,,0,,0,00FFFF,,0)(000040,0,1,0,0,0,,0,,8,00FFFF,,0)(000040,0,1,0,0,0,,0,,0,00FFFF,,0)(000040,0,1,0,0,0,,0,,0,00FFFF,,0)(000040,0,1,0,0,0,,0,,8,00FFFF,,0)(000040,0,1,0,0,0,,0,,0,00FFFF,,0)(000040,0,1,0,0,0,,0,,0,00FFFF,,0)(000040,0,1,0,0,0,,0,,8,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,1,0,0,0,,0,,0,00FFFF,,0)(000040,0,1,0,0,0,,0,,8,00FFFF,,0)(000040,0,1,0,0,0,,0,,0,00FFFF,,0)(000040,0,1,0,0,0,,0,,8,00FFFF,,0)(000040,0,1,0,0,0,,2,,0,00FFFF,,0)(000040,0,7,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,00FFFF,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,8,00FF00,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0) +(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,176,50,0,3,1,,0,,0,00FF00,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,3,,8,00FF00,,0)(000040,0,0,0,0,0,,0,,8,00FF00,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,8,00FF00,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,8,00FF00,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,8,00FF00,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,00FFFF,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,FFFFFF,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0) +(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,2,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,00FFFF,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,000000,,0)(000040,0,0,0,0,0,,0,,0,FFFFFF,,0) diff --git a/verif_version.pas b/verif_version.pas index 87ca59d..3420470 100644 --- a/verif_version.pas +++ b/verif_version.pas @@ -24,7 +24,7 @@ var Lance_verif : integer; verifVersion,notificationVersion : boolean; -Const Version='7.0'; // sert à la comparaison de la version publiée +Const Version='7.1'; // 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; @@ -140,7 +140,7 @@ begin InternetReadFile(hService,@lpBuffer,1024,dwBytesRead); fs.WriteBuffer(lpBuffer,dwBytesRead); t:=t+dwBytesRead; - if dwBytesRead=0 then break; + if dwBytesRead=0 then break; end; Result := True; taille:=t; @@ -319,7 +319,6 @@ begin else formVersion.Free; end; result:=V_publie; - end; end else diff --git a/versions.txt b/versions.txt index 539399f..35d56cd 100644 --- a/versions.txt +++ b/versions.txt @@ -45,7 +45,7 @@ version 2.21 : Param version 2.3 : Changement de la méthode de réception des trames du protocole IPC de CDM-Rail Affichage au démarrage des variables manquantes du fichier config-gl.cfg version 2.31 : Amélioration calcul des routes depuis buttoir - Lancement du TCO à la validation dans la configuration + Lancement du TCO à la validation dans la configuration version 2.4 : Optimisation de la gestion des évènements aiguillages Gestion des aiguillages inversés dans CDM pour le mode autonome Debug pilotage feux LEB @@ -53,9 +53,9 @@ version 2.5 : Panneau de configuration: Correction gestion des conditions supplémentaires d'affichage du carré Affichage de champs modifiables supplémentaires version 3.0 : Ajout des fonctions Nouveau / supprimer feu, accessoires dans le panneau de configuration. - Tous les éléments des feux, aiguillages, branches et actionneurs peuvent être modifiés depuis le panneau. + Tous les éléments des feux, aiguillages, branches et actionneurs peuvent être modifiés depuis le panneau. Nécessite de nommer les sections dans le fichier config.cfg - Il n'est donc plus nécessaire de modifier les fichiers de configuration. + Il n'est donc plus nécessaire de modifier les fichiers de configuration. version 3.1 : Renforcement de la vérification de la configuration. Modification de la liste d'initialisation des aiguillages en mode autonome. Indépendance des modifications entre les onglets du panneau de configuration. @@ -173,6 +173,9 @@ version 6.3 : Choix du graphisme du TCO en lignes bris version 6.4 : Gestion des signaux belges (avec chevron et réduction de vitesse). version 7.0 : Possibilité de créer des décodeurs spécifiques de signaux. Affichage du feu blanc sur les signaux sur position spécifique d'aiguillages. +version 7.1 : Nouveaux éléments graphiques pour le TCO. + +