diff --git a/Notice d'utilisation des signaux_complexes_GL_V3.83.pdf b/Notice d'utilisation des signaux_complexes_GL_V3.84.pdf similarity index 76% rename from Notice d'utilisation des signaux_complexes_GL_V3.83.pdf rename to Notice d'utilisation des signaux_complexes_GL_V3.84.pdf index 9f05d97..78e9081 100644 Binary files a/Notice d'utilisation des signaux_complexes_GL_V3.83.pdf and b/Notice d'utilisation des signaux_complexes_GL_V3.84.pdf differ diff --git a/UnitConfig.dcu b/UnitConfig.dcu index 181d574..0352f92 100644 Binary files a/UnitConfig.dcu and b/UnitConfig.dcu differ diff --git a/UnitConfig.dfm b/UnitConfig.dfm index 24d5e5a..b70e05a 100644 --- a/UnitConfig.dfm +++ b/UnitConfig.dfm @@ -2392,7 +2392,7 @@ object FormConfig: TFormConfig Caption = 'LabelTJD1' end object LabelL: TLabel - Left = 10 + Left = 18 Top = 69 Width = 8 Height = 16 @@ -2491,9 +2491,9 @@ object FormConfig: TFormConfig OnKeyPress = EditDevieS2KeyPress end object EditL: TEdit - Left = 40 + Left = 32 Top = 68 - Width = 25 + Width = 33 Height = 21 TabOrder = 9 Visible = False diff --git a/UnitConfig.pas b/UnitConfig.pas index 723a697..369436b 100644 --- a/UnitConfig.pas +++ b/UnitConfig.pas @@ -668,7 +668,7 @@ begin c:=aiguillage[index].AdevieB;if c<>'Z' then s:=s+c; s:=s+','+intToSTR(aiguillage[index].DDevie)+aiguillage[index].DDevieB+')'; end; - + if tjsC then begin s:=s+',L'+intToSTR(aiguillage[index].Tjsint)+aiguillage[index].TjsintB; @@ -2643,11 +2643,12 @@ begin // signaux RichSig.clear; + ComboBoxDec.items.Clear; for i:=1 to NbDecodeur do begin ComboBoxDec.items.add(decodeur[i-1]); end; - + for i:=1 to NbreFeux do begin s:=encode_sig_feux(i); // encode la ligne depuis le tableau feux @@ -2804,8 +2805,8 @@ begin ComboBoxAig.ItemIndex:=2; EditL.Visible:=true; LabelL.Visible:=true; - LabelL.Caption:='L'+IntToSTR(aiguillage[ind].tjsint); - EditL.Text:=aiguillage[ind].tjsintB; + LabelL.Caption:='L'; + EditL.Text:=IntToSTR(aiguillage[ind].tjsint)+aiguillage[ind].tjsintB; end; ImageAffiche.Picture.BitMap:=Imagetjd.Picture.Bitmap; labelBG.Caption:='S'; @@ -3132,7 +3133,7 @@ begin 9 : ComboBoxAsp.ItemIndex:=5; else ComboBoxAsp.ItemIndex:=d-10+4; - end; + end; if ((d=2) or (d>=5)) and (d<10) then checkBoxFB.Visible:=true else checkBoxFB.Visible:=false; @@ -6445,10 +6446,10 @@ begin if (aiguillage[i].modele=tjd) or (aiguillage[i].modele=tjs) then begin - if not(radioButtonTJD2.Checked) and not(radioButtonTJD4.Checked) then - radioButtonTJD2.Checked:=true; + if not(radioButtonTJD2.Checked) and not(radioButtonTJD4.Checked) then radioButtonTJD2.Checked:=true; + if (aiguillage[i].tjsIntB<>'S') and (aiguillage[i].tjsIntB<>'D') then aiguillage[i].tjsIntB:='D'; end; - + s:=encode_aig(i); formconfig.RichAig.Lines[ligneclicAig]:=s; clicliste:=true; @@ -6920,6 +6921,7 @@ end; procedure TFormConfig.EditLChange(Sender: TObject); var s : string; + i, erreur :integer; begin if clicliste or (ligneclicAig<0) then exit; if affevt then affiche('Evt EditL Change',clyellow); @@ -6927,11 +6929,14 @@ begin begin s:=EditL.Text; if s='' then exit; - if (s[1]<>'S') and (s[1]<>'D') then + val(s,i,erreur); + if (s[erreur]<>'S') and (s[erreur]<>'D') then begin - LabelInfo.caption:='Erreur Champ L : D ou S';exit; - end; - aiguillage[ligneclicAig+1].tjsintb:=s[1]; + LabelInfo.caption:='Erreur Champ L manque D ou S';exit + end + else LabelInfo.caption:=''; + aiguillage[ligneclicAig+1].tjsint:=i; + aiguillage[ligneclicAig+1].tjsintb:=s[erreur]; s:=encode_aig(ligneclicAig+1); RichAig.Lines[ligneclicAig]:=s; end; diff --git a/UnitPilote.dcu b/UnitPilote.dcu index 264b53e..9e48fb7 100644 Binary files a/UnitPilote.dcu and b/UnitPilote.dcu differ diff --git a/UnitPilote.pas b/UnitPilote.pas index 785234c..101429b 100644 --- a/UnitPilote.pas +++ b/UnitPilote.pas @@ -102,7 +102,7 @@ begin if i<>0 then //ImagePilote.Picture.Bitmap:=FormPilote.ImagePilote.picture.bitmap; - EtatFeuPilote:=EtatSignalCplx[0]; + EtatFeuPilote:=feux[0].EtatSignal; Vcanvas:=FormPilote.ImagePilote.picture.bitmap.Canvas; case feux[i].aspect of @@ -184,6 +184,7 @@ end; procedure TFormPilote.FormClose(Sender: TObject; var Action: TCloseAction); begin + //Affiche('close',clyellow); AdrPilote:=0; // pour désactiver le test des clignotements end; @@ -215,8 +216,8 @@ end; procedure TFormPilote.FormCreate(Sender: TObject); begin - radioVert.Checked:=false; - radioVertCli.Checked:=false; +// radioVert.Checked:=false; +// radioVertCli.Checked:=false; end; procedure TFormPilote.ButtonPiloteClick(Sender: TObject); @@ -225,9 +226,7 @@ begin i:=index_feu(AdrPilote); if feux[i].aspect<10 then begin - EtatSignalCplx[AdrPilote]:=EtatSignalCplx[0]; - //Affiche(IntToSTR(EtatSignalCplx[AdrPilote]),clyellow); - feux[i].EtatSignal:=EtatSignalCplx[0]; + feux[i].EtatSignal:=feux[0].EtatSignal; envoi_signal(AdrPilote); end else @@ -248,7 +247,7 @@ if ord(Key) = VK_RETURN then begin if (i>=0) and (i<=6) then begin - EtatSignalCplx[0]:=i; + feux[0].EtatSignal:=i; dessine_feu_pilote; end; if (i<0) and (i>6) then EditNbreFeux.text:='1'; diff --git a/UnitPrinc.dcu b/UnitPrinc.dcu index e63827e..c1050ed 100644 Binary files a/UnitPrinc.dcu and b/UnitPrinc.dcu differ diff --git a/UnitPrinc.pas b/UnitPrinc.pas index d6c9548..11ea482 100644 --- a/UnitPrinc.pas +++ b/UnitPrinc.pas @@ -3,7 +3,7 @@ Unit UnitPrinc; programme signaux complexes Graphique Lenz delphi 7 + activeX Tmscomm + clientSocket ******************************************** - 24/3/2022 15h + 6/4/2022 14h note sur le pilotage des accessoires: raquette octet sortie + 2 = aiguillage droit = sortie 2 de l'adresse d'accessoire @@ -220,7 +220,7 @@ Max_Simule=10000; EtatSign : array[0..13] of string[20] =('carré','sémaphore','sémaphore cli','vert','vert cli','violet', 'blanc','blanc cli','jaune','jaune cli','ral 30','ral 60','rappel 30','rappel 60'); NbDecodeur = 8; -decodeur : array[0..NbDecodeur-1] of string[20] =('rien','digital Bahn','CDF','LDT','LEB','NMRA','Unisemaf','SR'); +decodeur : array[0..NbDecodeur-1] of string[20] =('rien','Digital Bahn','CDF','LDT','LEB','NMRA','Unisemaf','SR'); Etats : array[0..19] of string[30]=('Non commandé','carré','sémaphore','sémaphore cli','vert','vert cli','violet', 'blanc','blanc cli','jaune','jaune cli','ralen 30','ralen 60','ralen 60 + jaune cli','rappel 30','rappel 60', 'rappel 30 + jaune','rappel 30 + jaune cli','rappel 60 + jaune','rappel 60 + jaune cli'); @@ -293,7 +293,8 @@ TFeu = record Btype_suiv4 : TEquipement ; // VerrouCarre : boolean ; // si vrai, le feu se verrouille au carré si pas de train avant le signal modifie : boolean; // feu modifié - EtatSignal : word ; // comme EtatSignalCplx (doublon) + EtatSignal : word ; // + AncienEtat : word ; UniSemaf : integer ; // définition supplémentaire de la cible pour les décodeurs UNISEMAF AigDirection : array[1..6] of array of record // pour les signaux directionnels : contient la liste des aiguillages associés Adresse : integer; // 6 feux max associés à un tableau dynamique décrivant les aiguillages @@ -311,7 +312,6 @@ TFeu = record var - ancien_tablo_signalCplx,EtatsignalCplx : array[0..MaxAcc] of word; // attention tableau indicé par l'adresse du signal et non son index!! tempsCli,NbreFeux,pasreponse,AdrDevie,fenetre,Tempo_Aig,Tempo_feu, NombreImages,signalCpx,branche_trouve,Indexbranche_trouve,Actuel,Signal_suivant, Nbre_recu_cdm,Tempo_chgt_feux,Adj1,Adj2,NbrePN,ServeurInterfaceCDM, @@ -386,7 +386,7 @@ var // l'indice du tableau aiguillage n'est pas son adresse aiguillage : array[0..MaxAcc] of Taiguillage; // signaux - L'index du tableau n'est pas son adresse - feux : array[1..MaxAcc] of Tfeu; + feux : array[0..MaxAcc] of Tfeu; trains : array[1..Max_Trains] of record nom_train : string; adresse,vitmax : integer; @@ -544,7 +544,7 @@ begin if (aspect=8) and (combine=13) then result:=18; //rappel 60 + jaune if (aspect=9) and (combine=13) then result:=19; //rappel 60 + jaune cli end; - code_to_etat:=result; + code_to_etat:=result; {'Non commandé','carré','sémaphore','sémaphore cli','vert','vert cli','violet', 'blanc','blanc cli','jaune','jaune cli','ralen 30','ralen 60','ralen 60 + jaune cli','rappel 30','rappel 60', 7 8 9 10 11 12 13 14 15 @@ -565,7 +565,7 @@ end; // dessine les feux sur une cible à 2 feux dans le canvas spécifié // x,y : offset en pixels du coin supérieur gauche du feu -// frX, frY : facteurs de réduction +// frX, frY : facteurs de réduction (pour agrandisseent) procedure dessine_feu2(Acanvas : Tcanvas;x,y : integer;frX,frY : real;EtatSignal : word;orientation : integer); var Temp,rayon,xViolet,YViolet,xBlanc,yBlanc, LgImage,HtImage : integer; @@ -578,8 +578,8 @@ begin // récupérer les dimensions de l'image d'origine du feu LgImage:=Formprinc.Image2feux.Picture.Bitmap.Width; HtImage:=Formprinc.Image2feux.Picture.Bitmap.Height; - - XBlanc:=13; YBlanc:=11; + //zizi + XBlanc:=13; YBlanc:=11; xViolet:=13; yViolet:=23; if (orientation=2) then @@ -1268,18 +1268,18 @@ begin if i<>0 then case feux[i].aspect of // feux de signalisation - 2 : dessine_feu2(CanvasDest,x,y,frx,fry,EtatSignalCplx[adresse],orientation); - 3 : dessine_feu3(CanvasDest,x,y,frx,fry,EtatSignalCplx[adresse],orientation); - 4 : dessine_feu4(CanvasDest,x,y,frx,fry,EtatSignalCplx[adresse],orientation); - 5 : dessine_feu5(CanvasDest,x,y,frx,fry,EtatSignalCplx[adresse],orientation); - 7 : dessine_feu7(CanvasDest,x,y,frx,fry,EtatSignalCplx[adresse],orientation); - 9 : dessine_feu9(CanvasDest,x,y,frx,fry,EtatSignalCplx[adresse],orientation); + 2 : dessine_feu2(CanvasDest,x,y,frx,fry,feux[i].EtatSignal,orientation); + 3 : dessine_feu3(CanvasDest,x,y,frx,fry,feux[i].EtatSignal,orientation); + 4 : dessine_feu4(CanvasDest,x,y,frx,fry,feux[i].EtatSignal,orientation); + 5 : dessine_feu5(CanvasDest,x,y,frx,fry,feux[i].EtatSignal,orientation); + 7 : dessine_feu7(CanvasDest,x,y,frx,fry,feux[i].EtatSignal,orientation); + 9 : dessine_feu9(CanvasDest,x,y,frx,fry,feux[i].EtatSignal,orientation); // indicateurs de direction - 12 : dessine_dir2(CanvasDest,EtatSignalCplx[adresse]); - 13 : dessine_dir3(CanvasDest,EtatSignalCplx[adresse]); - 14 : dessine_dir4(CanvasDest,EtatSignalCplx[adresse]); - 15 : dessine_dir5(CanvasDest,EtatSignalCplx[adresse]); - 16 : dessine_dir6(CanvasDest,EtatSignalCplx[adresse]); + 12 : dessine_dir2(CanvasDest,feux[i].EtatSignal); + 13 : dessine_dir3(CanvasDest,feux[i].EtatSignal); + 14 : dessine_dir4(CanvasDest,feux[i].EtatSignal); + 15 : dessine_dir5(CanvasDest,feux[i].EtatSignal); + 16 : dessine_dir6(CanvasDest,feux[i].EtatSignal); end; end; @@ -1312,7 +1312,7 @@ begin ImagePilote.Transparent:=true; ImagePilote.Picture.BitMap:=Feux[i].Img.Picture.Bitmap; LabelTitrePilote.Caption:='Pilotage du signal '+intToSTR(AdrPilote); - EtatSignalCplx[0]:=EtatSignalCplx[AdrPilote]; + feux[0].EtatSignal:=feux[i].EtatSignal; if feux[i].aspect>10 then begin GroupBox1.Visible:=false; @@ -1354,11 +1354,12 @@ end; // créée une image dynamiquement pour un nouveau feu déclaré dans le fichier de config // rang commence à 1 procedure cree_image(rang : integer); -var TypeFeu,adresse : integer; +var adresse,TypeFeu : integer; s : string; begin TypeFeu:=feux[rang].aspect; if typeFeu<=0 then exit; + adresse:=feux[rang].adresse; Feux[rang].Img:=Timage.create(Formprinc.ScrollBox1); with Feux[rang].Img do begin @@ -1366,10 +1367,7 @@ begin Name:='ImageFeu'+IntToSTR(rang); // nom de l'image - sert à identifier le composant si on fait clic droit. Top:=(HtImg+espY+20)*((rang-1) div NbreImagePLigne); // détermine les points d'origine Left:=10+ (LargImg+5)*((rang-1) mod (NbreImagePLigne)); - //Affiche(intToSTR(rang)+' '+intToSTR(left),clorange); - width:=57; - Height:=105; - s:='Index='+IntToSTR(rang)+' @='+inttostr(feux[rang].Adresse)+' Décodeur='+intToSTR(feux[rang].Decodeur)+ + s:='Index='+IntToSTR(rang)+' @='+inttostr(Adresse)+' Décodeur='+intToSTR(feux[rang].Decodeur)+ ' Adresse détecteur associé='+intToSTR(feux[rang].Adr_det1)+ ' Adresse élement suivant='+intToSTR(feux[rang].Adr_el_suiv1); if feux[rang].Btype_suiv1=aig then s:=s+' (aig)'; @@ -1386,11 +1384,10 @@ begin picture.Bitmap:=Select_dessin_feu(TypeFeu); // mettre rouge par défaut - adresse:=Feux[rang].adresse; - if TypeFeu=2 then EtatSignalCplx[adresse]:=violet_F; - if TypeFeu=3 then EtatSignalCplx[adresse]:=semaphore_F; - if (TypeFeu>3) and (TypeFeu<10) then EtatSignalCplx[adresse]:=carre_F; - if TypeFeu>10 then EtatSignalCplx[adresse]:=0; + if TypeFeu=2 then feux[rang].EtatSignal:=violet_F; + if TypeFeu=3 then feux[rang].EtatSignal:=semaphore_F; + if (TypeFeu>3) and (TypeFeu<10) then feux[rang].EtatSignal:=carre_F; + if TypeFeu>10 then feux[rang].EtatSignal:=0; dessine_feu_mx(Feux[rang].Img.Canvas,0,0,1,1,feux[rang].adresse,1); //if feux[rang].aspect=5 then cercle(Picture.Bitmap.Canvas,13,22,6,ClYellow); @@ -1412,7 +1409,7 @@ begin if feux[rang].FeuBlanc then begin Feux[rang].check:=TCheckBox.create(Formprinc.ScrollBox1); // ranger l'adresse de la Checkbox dans la structure du feu - //Feux[rang].check.onClick:=formprinc.proc_checkBoxFB; // affecter l'adresse de la procédure de traitement quand on clique dessus non utilisé + Feux[rang].check.onClick:=formprinc.proc_checkBoxFB; // affecter l'adresse de la procédure de traitement quand on clique dessus Feux[rang].check.Hint:=intToSTR(adresse); // affecter l'adresse du feu dans le HINT pour pouvoir le retrouver plus tard with Feux[rang].Check do @@ -1604,8 +1601,6 @@ var so,sx,s : string; begin { exemple de commande envoyée au serveur pour manoeuvrer un accessoire C-C-00-0004-CMDACC-DCCAC|018|02|AD=100;STATE=1; - " NAME : nom de l'aiguille - " OBJ: numéro CDM-Rail de l'aiguille (index) " AD: adresse (DCC) de l'aiguille " AD2: adresse #2 (DCC) de l'aiguille (TJD bi-moteurs ou aiguille triples) " STATE: état de l'aiguille @@ -1831,54 +1826,53 @@ var i : integer; begin // ('0carré','1sémaphore','2sémaphore cli','3vert','4vert cli','5violet', // '6blanc','7blanc cli','8jaune','9jaune cli','10ral 30','11ral 60','12rappel 30','13rappel 60'); - if testBit((EtatSignalCplx[adresse]),aspect)=false then // si le bit dans l'état du signal n'est pas allumé, procéder. + + 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. begin // effacement du motif de bits en fonction du nouvel état demandé suivant la règle des signaux complexes if (aspect<=blanc_cli) then begin - EtatSignalCplx[adresse]:=0; //Tout aspect <=7 efface les autres + feux[i].EtatSignal:=0; //Tout aspect <=7 efface les autres end; if (aspect=jaune) then // jaune begin - EtatSignalCplx[adresse]:=RazBit(EtatSignalCplx[adresse],jaune_cli); // cas du jaune: efface le bit du jaune clignotant (bit 9) - EtatSignalCplx[adresse]:=RazBit(EtatSignalCplx[adresse],ral_30); // cas du jaune: efface le bit du ral_30 (bit 10) - EtatSignalCplx[adresse]:=RazBit(EtatSignalCplx[adresse],ral_60); // cas du jaune: efface le bit du ral_60 (bit 11) - EtatSignalCplx[adresse]:=EtatSignalCplx[adresse] and not($00FF); // et effacer les bits 0 à 7 + feux[i].EtatSignal:=RazBit(feux[i].EtatSignal,jaune_cli); // cas du jaune: efface le bit du jaune clignotant (bit 9) + feux[i].EtatSignal:=RazBit(feux[i].EtatSignal,ral_30); // cas du jaune: efface le bit du ral_30 (bit 10) + feux[i].EtatSignal:=RazBit(feux[i].EtatSignal,ral_60); // cas du jaune: efface le bit du ral_60 (bit 11) + feux[i].EtatSignal:=feux[i].EtatSignal and not($00FF); // et effacer les bits 0 à 7 end; if (aspect=jaune_cli) then // jaune clignotant begin - EtatSignalCplx[adresse]:=RazBit(EtatSignalCplx[adresse],jaune); // cas du jaunecli: efface le bit du jaune (bit 8) - EtatSignalCplx[adresse]:=EtatSignalCplx[adresse] and $FF00; // et effacer les bits 0 à 7 + feux[i].EtatSignal:=RazBit(feux[i].EtatSignal,jaune); // cas du jaunecli: efface le bit du jaune (bit 8) + feux[i].EtatSignal:=feux[i].EtatSignal and $FF00; // et effacer les bits 0 à 7 end; if (aspect=ral_30) then // ralentissement 30 begin - EtatSignalCplx[adresse]:=EtatSignalCplx[adresse] and not($3BFF); // cas du ral 30: efface les bits 0 1 2 3 4 5 6 7 8 9 11 12 et 13 : 11 1000 1111 1111 + feux[i].EtatSignal:=feux[i].EtatSignal and not($3BFF); // cas du ral 30: efface les bits 0 1 2 3 4 5 6 7 8 9 11 12 et 13 : 11 1000 1111 1111 end; if (aspect=ral_60) then // ralentissement 60 begin - EtatSignalCplx[adresse]:=EtatSignalCplx[adresse] and not($35FF); // cas du ral 60: efface les bits 8 10 12 et 13 et de 0 à 7 : 11 0100 1111 1111 + feux[i].EtatSignal:=feux[i].EtatSignal and not($35FF); // cas du ral 60: efface les bits 8 10 12 et 13 et de 0 à 7 : 11 0100 1111 1111 end; if (aspect=rappel_30) then // rappel 30 begin - EtatSignalCplx[adresse]:=EtatSignalCplx[adresse] and not($2cff); // cas du rappel 30: efface les bits 0 1 2 3 4 5 6 7 10 11 et 13 : 10 1100 1111 0000 + feux[i].EtatSignal:=feux[i].EtatSignal and not($2cff); // cas du rappel 30: efface les bits 0 1 2 3 4 5 6 7 10 11 et 13 : 10 1100 1111 0000 end; if (aspect=rappel_60) then // rappel 60 begin - EtatSignalCplx[adresse]:=EtatSignalCplx[adresse] and not($1Cff); // cas du rappel 60: efface les bits 0 1 2 3 4 5 6 7 10 11 et 12 1 1100 1111 0000 + feux[i].EtatSignal:=feux[i].EtatSignal and not($1Cff); // cas du rappel 60: efface les bits 0 1 2 3 4 5 6 7 10 11 et 12 1 1100 1111 0000 end; if (aspect=aspect8) then // ral_60_jaune_cli décodeur LDT begin - EtatSignalCplx[adresse]:=jaune_cli_F or ral_60_F; // cas du ralentissement 60 + avertissement clignotant : efface les bits 10 11 et 12 + feux[i].EtatSignal:=jaune_cli_F or ral_60_F; // cas du ralentissement 60 + avertissement clignotant : efface les bits 10 11 et 12 end; if (aspect<>aspect8) then begin - EtatSignalCplx[adresse]:=SetBit(EtatSignalCplx[adresse],aspect); // allume le numéro du bit de la fonction du signal - // Affiche(IntToSTR(EtatSignalCplx[adresse]),clyellow); + feux[i].EtatSignal:=SetBit(feux[i].EtatSignal,aspect); // allume le numéro du bit de la fonction du signal end; end; - // mise à jour de l'état du signal dans le tableau Feux - i:=Index_feu(adresse); - if i<>0 then feux[i].EtatSignal:=EtatSignalCplx[adresse]; + end; @@ -1888,8 +1882,10 @@ sur un panneau directionnel - adresse : adresse du signal - code de 1 ; le panneau directionnel à 1, 2 ou 3 leds. ============================================== } procedure envoi_directionBahn(adr : integer;code : integer); +var i : integer; begin - if (EtatSignalCplx[adr]<>code) then + i:=index_feu(adr); + if (feux[i].EtatSignal<>code) then begin if (traceSign) then Affiche('Signal directionnel: ad'+IntToSTR(adr)+'='+intToSTR(code),clOrange); if AffSignal then AfficheDebug('Signal directionnel: ad'+IntToSTR(adr)+'='+intToSTR(code),clOrange); @@ -1924,7 +1920,7 @@ begin sleep(Tempo_Feu); end; end; - EtatSignalCplx[adr]:=code; + feux[i].EtatSignal:=code; Dessine_feu_mx(Feux[Index_Feu(adr)].Img.Canvas,0,0,1,1,adr,1); end; end; @@ -1936,8 +1932,10 @@ adresse : adresse du signal - code de 1 le panneau directionnel à 1, 2, 3 ou 4 leds. ============================================== } procedure envoi_directionCDF(adr : integer;code : integer); +var i : integer; begin - if (EtatSignalCplx[adr]<>code) then + i:=index_feu(adr); + if (feux[i].EtatSignal<>code) then begin if traceSign then Affiche('signal directionnel CDF: '+IntToSTR(adr)+' '+intToSTR(code),ClOrange); if AffSignal then AfficheDebug('signal directionnel CDF: '+IntToSTR(adr)+' '+intToSTR(code),ClOrange); @@ -1967,13 +1965,15 @@ begin sleep(200); end; end; - EtatSignalCplx[adr]:=code; + feux[i].EtatSignal:=code; end; end; procedure Envoi_DirectionLEB(Adr : integer;code : integer); +var i : integer; begin - if (EtatSignalCplx[adr]<>code) then + i:=index_feu(i); + if feux[i].EtatSignal<>code then begin if traceSign then Affiche('signal directionnel LEB: '+IntToSTR(adr)+' '+intToSTR(code),ClOrange); if aFFsIGNAL then AfficheDebug('signal directionnel LEB: '+IntToSTR(adr)+' '+intToSTR(code),ClOrange); @@ -1984,7 +1984,7 @@ begin 2 : begin pilote_acc(adr+5,2,feu) ; pilote_acc(adr+6,1,feu) ;end; //01 3 : begin pilote_acc(adr+5,1,feu) ; pilote_acc(adr+6,1,feu) ;end; //11 end; - EtatSignalCplx[adr]:=code; + feux[i].EtatSignal:=code; end; end; @@ -1994,11 +1994,13 @@ envoie les donn procedure envoi_CDF(adresse : integer); var code,aspect,combine : word; + i : integer; s : string; begin - if (ancien_tablo_signalCplx[adresse]<>EtatSignalCplx[adresse]) then //; && (stop_cmd==FALSE)) + i:=index_feu(adresse); + if (feux[i].AncienEtat<>feux[i].EtatSignal) then //; && (stop_cmd==FALSE)) begin - code:=EtatSignalCplx[adresse]; + code:=feux[i].EtatSignal; code_to_aspect(code,aspect,combine); s:='Signal CDF: ad'+IntToSTR(adresse)+'='+chaine_signal(code); if traceSign then affiche(s,clOrange); @@ -2026,14 +2028,14 @@ var index,i,etat : integer; s : string; begin - if (ancien_tablo_signalCplx[adresse]<>EtatSignalCplx[adresse]) then //; && (stop_cmd==FALSE)) + index:=index_feu(adresse); + if (feux[index].AncienEtat<>feux[index].EtatSignal) then //; && (stop_cmd==FALSE)) begin - code:=EtatSignalCplx[adresse]; + code:=feux[index].EtatSignal; //code_to_aspect(code,aspect,combine); s:='Signal SR: ad'+IntToSTR(adresse)+'='+chaine_signal(code); if traceSign then affiche(s,clOrange); if Affsignal then afficheDebug(s,clOrange); - index:=index_feu(adresse); etat:=code_to_etat(code); //Affiche('Code a chercher='+IntToSTR(etat),clyellow); @@ -2065,7 +2067,8 @@ end; envoie les données au décodeur LEB ===========================================================================*} procedure envoi_LEB(adresse : integer); -var code,aspect,combine : word; +var code,aspect,combine : word; + index : integer; s : string; procedure envoi5_LEB(selection :byte); var i : integer; @@ -2084,10 +2087,10 @@ var code,aspect,combine : word; //Affiche(s,clOrange); end; begin - -if (ancien_tablo_signalCplx[adresse]<>EtatSignalCplx[adresse]) then //; && (stop_cmd==FALSE)) +index:=index_feu(adresse); +if (feux[index].AncienEtat<>feux[index].EtatSignal) then //; && (stop_cmd==FALSE)) begin - code:=EtatSignalCplx[adresse]; + code:=feux[index].EtatSignal; code_to_aspect(code,aspect,combine); s:='Signal LEB: ad'+IntToSTR(adresse)+'='+chaine_signal(code); if traceSign then affiche(s,clOrange); @@ -2154,13 +2157,14 @@ envoie les donn /*===========================================================================*) procedure envoi_NMRA(adresse: integer); -var valeur : integer ; +var valeur,i : integer ; aspect,combine,code : word; s : string; begin - if (ancien_tablo_signalCplx[adresse]<>EtatSignalCplx[adresse]) then + i:=index_feu(adresse); + if (feux[i].AncienEtat<>feux[i].EtatSignal) then begin - code:=EtatSignalCplx[adresse]; + code:=feux[i].EtatSignal; code_to_aspect(code,aspect,combine); s:='Signal NMRA: ad'+IntToSTR(adresse)+'='+chaine_signal(code); if traceSign then affiche(s,clOrange); @@ -2206,9 +2210,9 @@ var modele,index: integer ; begin index:=Index_feu(adresse); // tranforme l'adresse du feu en index tableau - if (ancien_tablo_signalCplx[adresse]<>EtatSignalCplx[adresse]) then + if (feux[index].AncienEtat<>feux[index].EtatSignal) then begin - code:=EtatSignalCplx[adresse]; + code:=feux[index].EtatSignal; code_to_aspect(code,aspect,combine); s:='Signal Unisemaf: ad'+IntToSTR(adresse)+'='+chaine_signal(code); if traceSign then affiche(s,clOrange); @@ -2217,6 +2221,7 @@ begin // pour Unisemaf, la cible est définie dans le champ Unisemaf de la structure feux modele:=feux[index].Unisemaf; + if modele=0 then Affiche('Erreur 741 : spécification unisemaf signal '+intToSTR(adresse)+' non défini',clred); //Affiche('Adresse='+intToSTR(Adresse)+' code='+intToSTR(code)+' combine'+intToSTR(combine),clyellow); // pilotage qui marche chez JEF @@ -2715,11 +2720,13 @@ envoie les donn ===========================================================================} procedure envoi_LDT(adresse : integer); var code,aspect,combine,mode : word; + i : integer; s : string; begin - if (ancien_tablo_signalCplx[adresse]<>EtatSignalCplx[adresse]) then //; && (stop_cmd==FALSE)) + i:=index_feu(adresse); + if (feux[i].AncienEtat<>feux[i].EtatSignal) then //; && (stop_cmd==FALSE)) begin - code:=EtatSignalCplx[adresse]; + code:=feux[i].EtatSignal; code_to_aspect(code,aspect,combine); s:='Signal LDT: ad'+IntToSTR(adresse)+'='+chaine_signal(code); if traceSign then affiche(s,clOrange); @@ -2765,11 +2772,13 @@ end; procedure envoi_virtuel(adresse : integer); var combine,aspect,code : word; + i : integer; s : string; begin - if (ancien_tablo_signalCplx[adresse]<>EtatSignalCplx[adresse]) then //; && (stop_cmd==FALSE)) + i:=index_feu(adresse); + if (feux[i].AncienEtat<>feux[i].EtatSignal) then //; && (stop_cmd==FALSE)) begin - code:=EtatSignalCplx[adresse]; + code:=feux[i].EtatSignal; code_to_aspect(code,aspect,combine); s:='Signal virtuel: ad'+IntToSTR(adresse)+'='+chaine_signal(code); if traceSign then affiche(s,clOrange); @@ -2787,11 +2796,13 @@ envoie les donn procedure envoi_signalBahn(adresse : integer); var aspect,code,combine : word; ralrap, jau ,Ancralrap,Ancjau : boolean; + i : integer; s : string; begin - if (ancien_tablo_signalCplx[adresse]<>EtatSignalCplx[adresse]) then //; && (stop_cmd==FALSE)) + i:=index_feu(adresse); + if (feux[i].AncienEtat<>feux[i].EtatSignal) then //; && (stop_cmd==FALSE)) begin - code:=EtatSignalCplx[adresse]; + code:=feux[i].EtatSignal; code_to_aspect(code,aspect,combine); s:='Signal Bahn: ad'+IntToSTR(adresse)+'='+chaine_signal(code); if traceSign then affiche(s,clOrange); @@ -2801,10 +2812,10 @@ begin // spécifique au décodeur digital bahn: // si le signal affichait un signal combiné, il faut éteindre le signal avec un sémaphore // avant d'afficher le nouvel état non combiné - Ancralrap:=(TestBit(ancien_tablo_signalCplx[adresse],ral_30)) or (TestBit(ancien_tablo_signalCplx[adresse],ral_60)) or - (TestBit(ancien_tablo_signalCplx[adresse],rappel_30)) or (TestBit(ancien_tablo_signalCplx[adresse],rappel_60)) ; + Ancralrap:=(TestBit(feux[i].AncienEtat,ral_30)) or (TestBit(feux[i].AncienEtat,ral_60)) or + (TestBit(feux[i].AncienEtat,rappel_30)) or (TestBit(feux[i].AncienEtat,rappel_60)) ; // si ancien état du signal=jaune ou jaune cli - Ancjau:=(TestBit(ancien_tablo_signalCplx[adresse],jaune)) or (TestBit(ancien_tablo_signalCplx[adresse],jaune_cli)) ; + Ancjau:=(TestBit(feux[i].AncienEtat,jaune)) or (TestBit(feux[i].AncienEtat,jaune_cli)) ; // si état demandé du signal=ralentissement ou rappel ralrap:=(TestBit(code,ral_30)) or (TestBit(code,ral_60)) or @@ -2834,7 +2845,7 @@ begin end; -// pilotage d'un signal +// pilotage d'un signal , et mise à jour du graphisme du feu dans les 3 fenetres procedure envoi_signal(Adr : integer); var i,adresse,det,a,b,aspect,x,y,x0,y0,TailleX,TailleY,Orientation : integer; ImageFeu : TImage; @@ -2850,7 +2861,7 @@ begin exit; end; //Affiche(intToSTR(Adr)+' '+intToSTR(i),clWhite); - if (ancien_tablo_signalCplx[adr]<>EtatSignalCplx[adr]) then //*** + if (feux[i].AncienEtat<>feux[i].EtatSignal) then begin if feux[i].aspect<10 then // si signal non directionnel begin @@ -2869,8 +2880,8 @@ begin // Gestion démarrage temporisé des trains si on quitte le rouge : ne fonctionne qu'avec CDM rail connecté if Option_demarrage and cdm_connecte then begin - a:=ancien_tablo_signalCplx[adr]; - b:=EtatSignalCplx[adr]; + a:=feux[i].AncienEtat; + b:=feux[i].EtatSignal; if ((a=semaphore_F) or (a=carre_F) or (a=violet_F)) and ((b<>semaphore_F) and (b<>carre_F) and (b<>violet_F)) then begin if not(Diffusion) then Affiche('On quitte le rouge du signal '+intToSTR(adr),clyellow); @@ -2893,7 +2904,7 @@ begin end; end; - ancien_tablo_signalCplx[adr]:=EtatSignalCplx[adr]; + feux[i].AncienEtat:=feux[i].EtatSignal; // allume les signaux du feu dans la fenêtre de droite Dessine_feu_mx(Feux[i].Img.Canvas,0,0,1,1,adr,1); @@ -2948,8 +2959,7 @@ end; procedure envoi_signauxCplx; var i,signalCplx : integer; begin - //Affiche('Envoi des signaux (envoi_signaixCplx)',ClGreen); - //chaque signal doit être appellé en fonction de sa procédure suivant le décodeur + //Affiche('Envoi des signaux (envoi_signauxCplx)',ClGreen); for i:=1 to NbreFeux do begin signalCplx:=feux[i].adresse; @@ -2970,12 +2980,12 @@ begin inc(i); trouve:=s[i] in ['0'..'9']; end; - if trouve then + if trouve then begin val(copy(s,i,l),j,erreur); extract_int:=j; end - else extract_int:=0; + else extract_int:=0; end; // trouve l'index d'un détecteur dans une branche @@ -3014,7 +3024,7 @@ var i,adr : integer; procedure recherche; begin repeat - adr:=BrancheN[Num_Branche,i].adresse; + adr:=BrancheN[Num_Branche,i].adresse; trouve:=(AdrAig=adr) and ((BrancheN[Num_Branche,i].Btype=aig) or (BrancheN[Num_branche,i].BType=buttoir)); // cherche un aiguillage //Affiche('cherche='+intToSTR(det)+'/explore='+intToSTR(adr)+' Branche='+intToStr(Num_branche)+' index='+intToStr(i),ClWhite); if not(trouve) then inc(i); @@ -3095,19 +3105,6 @@ begin end; -// front descendant sur un détecteur -function detecteur_0(adresse : integer) : boolean; -begin - detecteur_0:=(Ancien_detecteur[adresse]=true) and ((detecteur[adresse].etat)=false); - Ancien_detecteur[adresse]:=detecteur[adresse].etat; -end; - -function detecteur_1(adresse : integer) : boolean; -begin - detecteur_1:=(Ancien_detecteur[adresse]=false) and ((detecteur[adresse].etat)=true); - Ancien_detecteur[adresse]:=detecteur[adresse].etat; -end; - // trouve un élément dans les branches à partir de la branche offset renvoie branche_trouve IndexBranche_trouve // el : adresse de l'élément TypeEL=(1=détécteur 2=aig 3=aig Bis 4=aig triple) procedure trouve_element(el: integer; TypeEl : TEquipement; Offset : integer); @@ -4477,7 +4474,7 @@ begin begin // oui inc(num_feu); - Etat:=EtatSignalCplx[AdrFeu]; + Etat:=feux[index_feu(AdrFeu)].EtatSignal; code_to_aspect(Etat,aspect,combine); Signal_suivant:=AdrFeu; if NivDebug=3 then AfficheDebug('Trouvé feu suivant Adr='+IntToSTR(AdrFeu)+': '+IntToSTR(etat)+'='+EtatSign[aspect]+' '+EtatSign[combine],clorange); @@ -4499,7 +4496,7 @@ begin begin // oui inc(num_feu); - Etat:=EtatSignalCplx[AdrFeu]; + Etat:=feux[index_feu(AdrFeu)].EtatSignal; code_to_aspect(Etat,aspect,combine); Signal_suivant:=AdrFeu; if NivDebug=3 then AfficheDebug('Sur même détecteur, trouvé feu2 suivant Adr='+IntToSTR(AdrFeu)+': '+IntToSTR(etat)+'='+EtatSign[aspect]+' '+EtatSign[combine],clorange); @@ -4848,7 +4845,7 @@ end; // si 9999 : pas de route // si 10 : ok route trouvée function test_route_valide(det1,det2,det3 : integer) : integer; -var det_suiv,resultat : integer; +var det_suiv : integer; begin if TraceListe then AfficheDebug('test route valide '+IntToSTR(det1)+' '+IntToSTR(det2)+' vers '+IntToSTR(det3)+' ',clyellow); det_suiv:=detecteur_suivant_el(det1,det,det2,det,1); @@ -5002,12 +4999,12 @@ begin PresTrainPrecVieux:=false; exit; end; - + // **** un feu peut être associé à 4 détecteurs (pour 4 voies convergentes) ***** // il faut donc explorer les 4 détecteurs probables PresTrain:=FALSE; j:=1; - + repeat if NivDebug=3 then afficheDebug('Séquence '+IntToSTR(j)+' de recherche des 4 détecteurs précédents-----',clYellow); if (j=1) then @@ -5015,7 +5012,7 @@ begin det_initial:=feux[i].Adr_det1; Adr_El_Suiv:=feux[i].Adr_el_suiv1; Btype_el_suivant:=feux[i].Btype_suiv1; - end; + end; if (j=2) then begin det_initial:=feux[i].Adr_det2; @@ -5163,7 +5160,7 @@ begin //if AffSignal then AfficheDebug('Debut du traitement général',clYellow); // traitement des feux >3 feux différents de violet (cas général) - if (Feux[index].aspect>=3) and (EtatSignalCplx[AdrFeu]<>violet_F) then + if (Feux[index].aspect>=3) and (feux[index].EtatSignal<>violet_F) then begin PresTrain:=false; // détecteurs précédent le feu , pour déterminer si leurs mémoires de zones sont à 1 pour libérer le carré @@ -5183,14 +5180,13 @@ begin // si on quitte le détecteur on affiche un sémaphore : attention tester le sens de circulation // pour ne pas passer au rouge un feu à contresens. // trouver la mémoire de zone MemZone[Adr_det,?] qui a déclenché le feu rouge - //if adrFeu=1002 then NivDebug:=3; if AffSignal then AfficheDebug('test du sémaphore',clYellow); Aff_semaphore:=test_memoire_zones(AdrFeu); // test si présence train après signal //Nivdebug:=0; if Aff_Semaphore then begin if AffSignal then AfficheDebug('Présence train après signal'+intToSTR(AdrFeu)+' -> sémaphore ou carré',clYellow); - if testBit(EtatSignalCplx[Adrfeu],carre)=FALSE then Maj_Etat_Signal(AdrFeu,semaphore); + if testBit(feux[index].EtatSignal,carre)=FALSE then Maj_Etat_Signal(AdrFeu,semaphore); end else begin @@ -5200,7 +5196,7 @@ begin begin indexAig:=Index_aig(aig); if AffSignal then AfficheDebug('Aiguille '+intToSTR(aig)+' du signal '+intToSTR(AdrFeu)+' déviée',clYellow); - EtatSignalCplx[AdrFeu]:=0; + feux[index].EtatSignal:=0; if (aiguillage[indexAig].vitesse=30) or (aiguillage[indexAig].vitesse=0) then Maj_Etat_Signal(AdrFeu,rappel_30); if aiguillage[indexAig].vitesse=60 then Maj_Etat_Signal(AdrFeu,rappel_60); @@ -5219,14 +5215,14 @@ begin begin if AffSignal then AfficheDebug('pas d''aiguille déviée',clYellow); // effacer la signbalisation combinée - EtatSignalCplx[adrFeu]:=EtatSignalCplx[adrFeu] and not($3c00); + feux[index].EtatSignal:=feux[index].EtatSignal and not($3c00); if TestBit(etat,carre) or testBit(etat,semaphore) or testBit(etat,semaphore_cli )then Maj_Etat_Signal(AdrFeu,jaune) else begin // si signal suivant affiche rappel if TestBit(etat,rappel_30) or TestBit(etat,rappel_60) then begin - EtatSignalCplx[AdrFeu]:=0; + feux[index].EtatSignal:=0; if TestBit(etat,rappel_30) then Maj_Etat_Signal(AdrFeu,ral_30); if TestBit(etat,rappel_60) then begin @@ -6644,7 +6640,7 @@ begin Srvc_sig:=false; config_modifie:=false; - AF:='Client TCP-IP CDM Rail ou USB - système XpressNet - Version '+Version+sousVersion+' BETA'; + AF:='Client TCP-IP CDM Rail ou USB - système XpressNet - Version '+Version+sousVersion; Caption:=AF; Application.onHint:=doHint; @@ -6903,8 +6899,8 @@ begin //tester chaque feu pour voir s'il y a un code de clignotement for i:=1 to NbreFeux do begin + a:=feux[i].EtatSignal; // a = état binaire du feu adresse:=feux[i].adresse; - a:=EtatsignalCplx[adresse]; // a = état binaire du feu if TestBit(a,jaune_cli) or TestBit(a,ral_60) or TestBit(a,rappel_60) or testBit(a,semaphore_cli) or testBit(a,vert_cli) or testbit(a,blanc_cli) then @@ -6927,7 +6923,8 @@ begin if Bimage=30 then begin adresse:=TCO[x,y].adresse; - a:=EtatsignalCplx[adresse]; // a = état binaire du feu + i:=index_feu(adresse); + a:=feux[i].EtatSignal; // a = état binaire du feu if TestBit(a,jaune_cli) or TestBit(a,ral_60) or TestBit(a,rappel_60) or testBit(a,semaphore_cli) or testBit(a,vert_cli) or testbit(a,blanc_cli) then @@ -6957,7 +6954,7 @@ begin // fenêtre de pilotage manuel du feu if AdrPilote<>0 then begin - a:=EtatsignalCplx[0]; + a:=feux[0].EtatSignal; if TestBit(a,jaune_cli) or TestBit(a,ral_60) or TestBit(a,rappel_60) or testBit(a,semaphore_cli) or testBit(a,vert_cli) or testbit(a,blanc_cli) then @@ -7156,7 +7153,6 @@ begin end; // procédure Event appelée si on clique sur un checkbox de demande de feu blanc des images des feux -// non utilisé procedure TFormprinc.proc_checkBoxFB(Sender : Tobject); var s : string; Cb : TcheckBox; @@ -7173,16 +7169,16 @@ begin i:=index_feu(adresse); if i=0 then exit; etat:=feux[i].EtatSignal; - affiche(IntToSTR(etat),clyellow); + //affiche(IntToSTR(etat),clyellow); // si le feu est vert et que la coche est mise, substituer le blanc - if (etat=vert_F) and coche then + if ((etat=vert_F) or (etat=vert_cli_F)) and coche then begin Maj_Etat_Signal(Adresse,blanc); Envoi_signauxCplx; end; // si pas coché, on revient en normal if not(coche) then rafraichit; - end; + end; end; procedure TFormPrinc.ButtonInfoClick(Sender: TObject); diff --git a/UnitSR.dcu b/UnitSR.dcu index 1138f36..e16210d 100644 Binary files a/UnitSR.dcu and b/UnitSR.dcu differ diff --git a/UnitTCO.dcu b/UnitTCO.dcu index 9bb4ea3..aec2c3d 100644 Binary files a/UnitTCO.dcu and b/UnitTCO.dcu differ diff --git a/UnitTCO.dfm b/UnitTCO.dfm index d33fad8..04ab6ba 100644 --- a/UnitTCO.dfm +++ b/UnitTCO.dfm @@ -1,6 +1,6 @@ object FormTCO: TFormTCO - Left = 152 - Top = 41 + Left = 162 + Top = 174 Width = 1139 Height = 694 VertScrollBar.Visible = False diff --git a/UnitTCO.pas b/UnitTCO.pas index 3c4f4f5..e7ef340 100644 --- a/UnitTCO.pas +++ b/UnitTCO.pas @@ -2445,6 +2445,17 @@ begin end; end; +function style(s : string) : TfontStyles; +var fs : tFontStyles; +begin + fs:=[]; + if pos('G',s)<>0 then fs:=fs+[fsbold]; + if pos('I',s)<>0 then fs:=fs+[fsItalic]; + if pos('S',s)<>0 then fs:=fs+[fsUnderline]; + if pos('B',s)<>0 then fs:=fs+[fsStrikeout]; + style:=fs; +end; + // affiche la cellule x et y en cases procedure affiche_cellule(x,y : integer); var i,repr,p,Xorg,Yorg,xt,yt,mode,adresse,Bimage,aspect,oriente,pos,pos2 : integer; @@ -2534,8 +2545,9 @@ begin with PCanvasTCO do begin Brush.Color:=fond; - Font.Color:=clYellow; + Font.Color:=tco[x,y].coulFonte; Font.Name:='Arial'; + Font.Style:=style(tco[x,y].FontStyle); xt:=0;yt:=0; if Bimage=2 then begin xt:=3;yt:=1;end; if Bimage=3 then begin xt:=3;yt:=HauteurCell-round(20*fryGlob);end; @@ -2558,8 +2570,9 @@ begin with PCanvasTCO do begin Brush.Color:=fond; - Font.Color:=clWhite; + Font.Color:=tco[x,y].coulFonte; Font.Name:='Arial'; + Font.Style:=style(tco[x,y].FontStyle); xt:=round(15*frXGlob); case repr of 1 : yt:=(HauteurCell div 2)-round(7*fryGlob); // milieu @@ -2579,7 +2592,8 @@ begin begin Brush.Color:=fond; Font.Name:='Arial'; - Font.Color:=clWhite; + Font.Style:=style(tco[x,y].FontStyle); + Font.Color:=tco[x,y].coulFonte; TextOut(xOrg+round(2*frXGlob),yOrg+round(2*fryGlob),s); //exit; end; @@ -2590,7 +2604,8 @@ begin with PCanvasTCO do begin Brush.Color:=fond; - Font.Color:=clWhite; + Font.Color:=tco[x,y].coulFonte;; + Font.Style:=style(tco[x,y].FontStyle); Font.Name:='Arial'; TextOut(xOrg+round(28*frXGlob),yOrg+round(2*fryGlob),s); //exit; @@ -2624,7 +2639,8 @@ begin with PCanvasTCO do begin Brush.Color:=fond; - Font.Color:=clLime; + Font.Color:=tco[x,y].coulFonte; + Font.Style:=style(tco[x,y].FontStyle); Font.Name:='Arial'; TextOut(xOrg+xt,yOrg+yt,s); end; @@ -2695,12 +2711,8 @@ begin if ss='' then ss:='Arial'; PcanvasTCO.Font.Name:=ss; ss:=tco[x,y].FontStyle; - fs:=[]; - if pos('G',ss)<>0 then fs:=fs+[fsbold]; - if pos('I',ss)<>0 then fs:=fs+[fsItalic]; - if pos('S',ss)<>0 then fs:=fs+[fsUnderline]; - if pos('B',ss)<>0 then fs:=fs+[fsStrikeout]; - PcanvasTCO.Font.Style:=fs; + + PcanvasTCO.Font.Style:=style(ss); repr:=tco[x,y].repr; taillefonte:=tco[x,y].TailleFonte; @@ -3159,6 +3171,7 @@ end; procedure TFormTCO.FormActivate(Sender: TObject); begin + //Affiche('Form TCO activate',clyellow); if not(Forminit) then begin FormInit:=true; @@ -3229,8 +3242,9 @@ begin end; //Affiche_tco; + TrackBarZoom.Position:=(ZoomMax+Zoommin) div 2; end; - TrackBarZoom.Position:=(ZoomMax+Zoommin) div 2; + end; // evt qui se produit quand on clic droit dans l'image @@ -3369,6 +3383,7 @@ begin YclicCell:=Yclic div hauteurCell +1; dessin_AigPD_AD(ImageTCO.Canvas,XClicCell,YClicCell,0,9); tco[XClicCell,YClicCell].BImage:=5; // image 5 + tco[xClicCell,YClicCell].CoulFonte:=clYellow; entoure_cell_grille(XClicCell,YClicCell); _entoure_cell_clic; EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); @@ -3387,6 +3402,7 @@ begin XclicCell:=Xclic div largeurCell +1; YclicCell:=Yclic div hauteurCell +1; tco[XClicCell,YClicCell].BImage:=2; // image 2 + tco[xClicCell,YClicCell].CoulFonte:=clYellow; dessin_AigG_PD(ImageTCO.Canvas,XClicCell,YClicCell,0,9); entoure_cell_grille(XClicCell,YClicCell); _entoure_cell_clic; @@ -3408,6 +3424,7 @@ begin if (x=0) and (y=0) then exit; efface_entoure; TCO_modifie:=true; + tco[xClicCell,YClicCell].CoulFonte:=clYellow; Xclic:=X;YClic:=Y; XclicCell:=Xclic div largeurCell +1; YclicCell:=Yclic div hauteurCell +1; @@ -3437,6 +3454,7 @@ begin YclicCell:=Yclic div hauteurCell +1; dessin_AigD_PG(ImageTCO.Canvas,XClicCell,YClicCell,0,9); tco[XClicCell,YClicCell].BImage:=4; // image 4 + tco[xClicCell,YClicCell].CoulFonte:=clYellow; entoure_cell_grille(XClicCell,YClicCell); _entoure_cell_clic; EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); @@ -3460,6 +3478,7 @@ begin YclicCell:=Yclic div hauteurCell +1; dessin_voie(ImageTCO.Canvas,XClicCell,YClicCell,0); tco[XClicCell,YClicCell].BImage:=1; // image 1 + tco[xClicCell,YClicCell].CoulFonte:=clYellow; tco[XClicCell,YClicCell].Adresse:=0; entoure_cell_grille(XClicCell,YClicCell); _entoure_cell_clic; @@ -3660,6 +3679,7 @@ begin dessin_Aig45PG_AG(ImageTCO.Canvas,XClicCell,YClicCell,0,9); tco[XClicCell,YClicCell].BImage:=12; // image 12 tco[XClicCell,YClicCell].Adresse:=0; // rien + tco[xClicCell,YClicCell].CoulFonte:=clYellow; entoure_cell_grille(XClicCell,YClicCell); _entoure_cell_clic; EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); @@ -3682,6 +3702,7 @@ begin dessin_Aig45PD_AD(ImageTCO.Canvas,XClicCell,YClicCell,0,9); tco[XClicCell,YClicCell].BImage:=13; // image 13 tco[XClicCell,YClicCell].Adresse:=0; // rien + tco[xClicCell,YClicCell].CoulFonte:=clYellow; entoure_cell_grille(XClicCell,YClicCell); _entoure_cell_clic; EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); @@ -3703,6 +3724,7 @@ begin dessin_Aig45PD_AG(ImageTCO.Canvas,XClicCell,YClicCell,0,9); tco[XClicCell,YClicCell].BImage:=14; // image 14 tco[XClicCell,YClicCell].Adresse:=0; // rien + tco[xClicCell,YClicCell].CoulFonte:=clYellow; entoure_cell_grille(XClicCell,YClicCell); _entoure_cell_clic; EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); @@ -3723,6 +3745,7 @@ begin Dessin_Aig45PG_AD(ImageTCO.Canvas,XClicCell,YClicCell,0,9); tco[XClicCell,YClicCell].BImage:=15; // image 15 tco[XClicCell,YClicCell].Adresse:=0; // rien + tco[xClicCell,YClicCell].CoulFonte:=clYellow; entoure_cell_grille(XClicCell,YClicCell); _entoure_cell_clic; EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); @@ -3842,6 +3865,7 @@ begin Dessin_21(ImageTCO.Canvas,XClicCell,YClicCell,0,9,9); tco[XClicCell,YClicCell].BImage:=21; tco[XClicCell,YClicCell].Adresse:=0; // rien + tco[xClicCell,YClicCell].CoulFonte:=clYellow; entoure_cell_grille(XClicCell,YClicCell); _entoure_cell_clic; EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); @@ -3862,6 +3886,7 @@ begin Dessin_22(ImageTCO.Canvas,XClicCell,YClicCell,0,9,9); tco[XClicCell,YClicCell].BImage:=22; tco[XClicCell,YClicCell].Adresse:=0; // rien + tco[xClicCell,YClicCell].CoulFonte:=clYellow; entoure_cell_grille(XClicCell,YClicCell); _entoure_cell_clic; EditAdrElement.Text:=IntToSTR( tco[XClicCell,YClicCell].Adresse); @@ -4336,6 +4361,8 @@ begin tco[XClicCell,YClicCell].BImage:=30; tco[XClicCell,YClicCell].Adresse:=0; tco[XClicCell,YClicCell].FeuOriente:=1; + tco[XClicCell,YClicCell].coulFonte:=clWhite; + tco[XClicCell,YClicCell].x:=0; tco[XClicCell,YClicCell].y:=0; @@ -4582,7 +4609,7 @@ begin TFormPilote.Create(Self); with formPilote do begin - show; + show; ImagePilote.top:=40;ImagePilote.left:=220; ImagePilote.Parent:=FormPilote; ImagePilote.Picture.Bitmap.TransparentMode:=tmAuto; @@ -4591,12 +4618,14 @@ begin ImagePilote.Picture.BitMap:=feux[i].Img.Picture.Bitmap; LabelTitrePilote.Caption:='Pilotage du signal '+intToSTR(Adresse); - EtatSignalCplx[0]:=EtatSignalCplx[Adresse]; + feux[0].EtatSignal:=feux[i].EtatSignal; + LabelNbFeux.Visible:=False; EditNbreFeux.Visible:=false; GroupBox1.Visible:=true; - GroupBox2.Visible:=true; - efface_entoure;SelectionAffichee:=false; + GroupBox2.Visible:=true; + efface_entoure; + SelectionAffichee:=false; sourisclic:=false; // évite de générer un cadre de sélection end; end; @@ -4781,10 +4810,14 @@ begin end; procedure TFormTCO.ButtonFonteClick(Sender: TObject); -var s : string; +var s,ss : string; fs : TFontStyles; begin - titre_Fonte:='Fonte et couleur pour la cellule ('+intToSTR(xClicCell)+','+intToSTR(YClicCell)+') Texte: '+tco[xClicCell,YClicCell].Texte; + s:='Fonte et couleur pour la cellule ('+intToSTR(xClicCell)+','+intToSTR(YClicCell)+') Texte: '; + ss:=tco[xClicCell,YClicCell].Texte; + if ss='' then s:=s+inttoSTR(tco[xClicCell,YClicCell].Adresse) else s:=s+ss; + + titre_fonte:=s; FontDialog1.Font.Name:=tco[XclicCell,YclicCell].Fonte; FontDialog1.Font.Color:=tco[XclicCell,YclicCell].CoulFonte; FontDialog1.Font.Size:=tco[XclicCell,YclicCell].taillefonte; diff --git a/verif_version.dcu b/verif_version.dcu index a97f818..239f91c 100644 Binary files a/verif_version.dcu and b/verif_version.dcu differ diff --git a/verif_version.pas b/verif_version.pas index 44c6105..a6d9817 100644 --- a/verif_version.pas +++ b/verif_version.pas @@ -23,7 +23,7 @@ var Lance_verif : integer; verifVersion,notificationVersion : boolean; -Const Version='3.83'; // sert à la comparaison de la version publiée +Const Version='3.84'; // sert à la comparaison de la version publiée SousVersion=' '; // en cas d'absence de sous version mettre un espace implementation diff --git a/versions.txt b/versions.txt index 43702a2..538e48f 100644 --- a/versions.txt +++ b/versions.txt @@ -92,6 +92,9 @@ version 3.81 : Pilotage des TJD depuis le TCO. version 3.82 : Application d'un train destinataire pour les actionneurs de fonctions F. version 3.83 : Quais pour le TCO. Fontes, couleurs et styles variables pour les textes des TCO. +version 3.84 : Possibilité d'affecter des couleurs différentes pour chaque texte ou adresse de + signal, d'aiguillage ou de détecteur. Pour le passage de la V3.83 à la V3.84 vous devrez + entrer une couleur de fonte pour chaque cellule contenant une adresse.