diff --git a/Signaux_complexes_GL.cfg b/Signaux_complexes_GL.cfg index 733e635..69e7fa7 100644 --- a/Signaux_complexes_GL.cfg +++ b/Signaux_complexes_GL.cfg @@ -31,5 +31,5 @@ -M -$M16384,1048576 -K$00400000 --LE"c:\program files\borland\delphi7\Projects\Bpl" --LN"c:\program files\borland\delphi7\Projects\Bpl" +-LE"c:\program files (x86)\borland\delphi7\Projects\Bpl" +-LN"c:\program files (x86)\borland\delphi7\Projects\Bpl" diff --git a/Signaux_complexes_GL.exe b/Signaux_complexes_GL.exe index 1e1999f..75f4506 100644 Binary files a/Signaux_complexes_GL.exe and b/Signaux_complexes_GL.exe differ diff --git a/UnitConfig.dcu b/UnitConfig.dcu index dc5d206..4463e34 100644 Binary files a/UnitConfig.dcu and b/UnitConfig.dcu differ diff --git a/UnitConfig.dfm b/UnitConfig.dfm index f088a84..2d93df8 100644 --- a/UnitConfig.dfm +++ b/UnitConfig.dfm @@ -1776,7 +1776,7 @@ object FormConfig: TFormConfig Top = 8 Width = 585 Height = 441 - ActivePage = TabSheetSig + ActivePage = TabSheetCDM Font.Charset = DEFAULT_CHARSET Font.Color = clBackground Font.Height = -11 @@ -2091,6 +2091,29 @@ object FormConfig: TFormConfig TabOrder = 4 end end + object GroupBox15: TGroupBox + Left = 296 + Top = 328 + Width = 273 + Height = 73 + Caption = 'Divers' + TabOrder = 5 + object Label31: TLabel + Left = 8 + Top = 16 + Width = 204 + Height = 13 + Caption = 'Seuil du nombre de d'#233'tecteurs trop distants' + end + object EditNbDetDist: TEdit + Left = 232 + Top = 12 + Width = 25 + Height = 21 + TabOrder = 0 + Text = 'EditNbDetDist' + end + end end object TabSheetAutonome: TTabSheet Caption = 'Mode autonome' @@ -2760,7 +2783,7 @@ object FormConfig: TFormConfig Top = 48 Width = 129 Height = 21 - ItemHeight = 13 + ItemHeight = 0 TabOrder = 1 OnChange = ComboBoxDecChange end diff --git a/UnitConfig.pas b/UnitConfig.pas index 1345f90..af575ef 100644 --- a/UnitConfig.pas +++ b/UnitConfig.pas @@ -182,6 +182,9 @@ type EditEtatActionneur: TEdit; CheckRAZ: TCheckBox; CheckFenEt: TCheckBox; + GroupBox15: TGroupBox; + EditNbDetDist: TEdit; + Label31: TLabel; procedure ButtonAppliquerEtFermerClick(Sender: TObject); procedure Button2Click(Sender: TObject); procedure FormActivate(Sender: TObject); @@ -226,6 +229,7 @@ function envoi_CDM(s : string) : boolean; procedure connecte_CDM; function place_id(s : string) : string; procedure decodeAig(s : string;var adr : integer;var B : char); +procedure sauve_config; implementation @@ -500,7 +504,7 @@ begin if j<>0 then s:=s+','+IntToSTR(feux[i].Adr_det2)+','+TypeEl_To_char(feux[i].Btype_suiv2)+IntToSTR(feux[i].Adr_el_suiv2); j:=feux[i].Adr_det3; if j<>0 then s:=s+','+IntToSTR(feux[i].Adr_det3)+','+TypeEl_To_char(feux[i].Btype_suiv3)+IntToSTR(feux[i].Adr_el_suiv3); - j:=feux[i].Adr_det4; + j:=feux[i].Adr_det4; if j<>0 then s:=s+','+IntToSTR(feux[i].Adr_det4)+','+TypeEl_To_char(feux[i].Btype_suiv4)+IntToSTR(feux[i].Adr_el_suiv4); s:=s+'),'; end @@ -518,11 +522,15 @@ begin end; s:=s+')'; end; - end; + end; //verrouillage au carré - if aspect<10 then if feux[i].verrouCarre then s:=s+'1' else s:=s+'0'; - + if aspect<10 then + begin + if feux[i].verrouCarre then s:=s+'1' else s:=s+'0'; + // si unsemaf, paramètre supplémentaire + if feux[i].decodeur=6 then s:=s+','+intToSTR(feux[i].unisemaf); + end; encode_sig:=s; end; @@ -596,6 +604,11 @@ begin // plein écran writeln(fichierN,'Fenetre=',fenetre); copie_commentaire; + + // Nombre maxi de détecteurs considérés distants + writeln(fichierN,'Nb_Det_Dist=',Nb_Det_Dist); + copie_commentaire; + // Vérification des versions au démarrage if verifVersion then s:='1' else s:='0'; @@ -736,13 +749,16 @@ begin end; -procedure TFormConfig.ButtonAppliquerEtFermerClick(Sender: TObject); + +procedure Sauve_config; var i,erreur : integer; s : string; ChangeCDM,changeInterface,changeUSB,change_srv : boolean; begin // Vérification de la configuration------------------------------------------- // contrôle adresse IP CDM + with FormConfig do + begin s:=EditAdrIPCDM.text; if not(IpOk(s)) then begin labelInfo.Caption:='Adresse IP CDM rail incorrecte';exit;end; ChangeCDM:=s<>AdresseIPCDM; @@ -780,6 +796,11 @@ begin if erreur<>0 then begin labelInfo.Caption:='Valeur temporisation de réponse interface';exit;end; TimoutMaxInterface:=i; + val(EditNbDetDist.text,i,erreur); + if (erreur<>0) or (i<3) then begin labelInfo.Caption:='Valeur nombre de détecteurs trop distants incorrecte';exit;end; + Nb_Det_Dist:=i; + + if RadioButton1.checked then Valeur_entete:=0; if RadioButton2.checked then Valeur_entete:=1; if RadioButton3.checked then Valeur_entete:=2; @@ -848,11 +869,18 @@ begin Srvc_PosTrain:=CheckServPosTrains.checked; Srvc_Sig:=CheckBoxSrvSig.checked; Raz_Acc_signaux:=CheckBoxRazSignaux.checked; - + end; + if change_srv then services_CDM; // générer le fichiers config.cfg et clieng-GL.cfg genere_config2; + +end; + +procedure TFormConfig.ButtonAppliquerEtFermerClick(Sender: TObject); +begin + Sauve_config; formConfig.close; end; @@ -889,7 +917,8 @@ begin EditDroit_BD.ReadOnly:=false; Edit_HG.ReadOnly:=false; - + + EditNbDetDist.text:=IntToSTR(Nb_Det_dist); EditAdrIPCDM.text:=adresseIPCDM; EditPortCDM.Text:=IntToSTR(portCDM); EditIPLenz.text:=AdresseIP; diff --git a/UnitDebug.dfm b/UnitDebug.dfm index b59c810..4573fcb 100644 --- a/UnitDebug.dfm +++ b/UnitDebug.dfm @@ -121,7 +121,7 @@ object FormDebug: TFormDebug Anchors = [akLeft, akTop, akRight, akBottom] Lines.Strings = ( 'MemoDebug') - ScrollBars = ssVertical + ScrollBars = ssBoth TabOrder = 3 WordWrap = False end diff --git a/UnitPrinc.dcu b/UnitPrinc.dcu index e18181d..dc6265e 100644 Binary files a/UnitPrinc.dcu and b/UnitPrinc.dcu differ diff --git a/UnitPrinc.pas b/UnitPrinc.pas index d8399f6..ce5f597 100644 --- a/UnitPrinc.pas +++ b/UnitPrinc.pas @@ -163,7 +163,7 @@ const_devieG_CDM=3; // positions aiguillages transmises par cdm const_devieD_CDM=2; // positions aiguillages transmises par cdm const_droit_CDM=0; // positions aiguillages transmises par cdm ClBleuClair=$FF7070 ; -Cyan=$FFA0A0; +Cyan=$FF6060; clviolet=$FF00FF; GrisF=$414141; clOrange=$0077FF; @@ -225,7 +225,7 @@ var ancien_tablo_signalCplx,EtatsignalCplx : array[0..MaxAcc] of word; AvecInitAiguillages,tempsCli,NbreFeux,pasreponse,AdrDevie,fenetre, NombreImages,signalCpx,branche_trouve,Indexbranche_trouve,Actuel,Signal_suivant, Nbre_recu_cdm,Tempo_chgt_feux,Adj1,Adj2,NbrePN,ServeurInterfaceCDM, - ServeurRetroCDM,TailleFonte : integer; + ServeurRetroCDM,TailleFonte,Nb_Det_Dist : integer; Hors_tension2,traceSign,TraceZone,Ferme,parSocket,ackCdm,PremierFD, NackCDM,MsgSim,succes,recu_cv,AffActionneur,AffAigDet,Option_demarrage, @@ -404,23 +404,6 @@ begin combine:=BitNum(CodeBin and $fc00); end; -procedure Xcode_to_aspect(codebin : word;var premierbit,combine : word) ; -var i,mot : word; -begin - mot:=codebin; - i:=0;premierbit:=0;Combine:=0; - - while (i<15) do - begin - if (mot and 1)=1 then // si bit 0 du mot est à 1 - begin - if (premierbit=0) then premierbit:=i+1 else Combine:=i+1; - end; - mot:=mot shr 1; //décaler à droite - inc(i); - end; -end; - // dessine un cercle plein dans le feu procedure cercle(ACanvas : Tcanvas;x,y,rayon : integer;couleur : Tcolor); begin @@ -433,7 +416,7 @@ begin //Affiche(IntToSTR(y),clyellow); end; -// dessine les feux sur une cible à 2 feux +// 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 procedure dessine_feu2(Acanvas : Tcanvas;x,y : integer;frX,frY : real;EtatSignal : word;orientation : integer); @@ -442,7 +425,7 @@ var Temp,rayon,xViolet,YViolet,xBlanc,yBlanc, ech : real; code,combine : word; begin - code_to_aspect(Etatsignal,code,combine); // et aspect + code_to_aspect(Etatsignal,code,combine); rayon:=round(6*frX); // récupérer les dimensions de l'image d'origine du feu @@ -3476,7 +3459,7 @@ end; procedure lit_config; var s,sa,chaine,SOrigine: string; c,paig : char; - tec,tjd,tjs,s2,trouve,triple,debugConfig,multiple,fini,finifeux : boolean; + tec,tjd,tjs,s2,trouve,triple,debugConfig,multiple,fini,finifeux,trouve_NbDetDist : boolean; bd,virgule,i_detect,i,erreur,aig,aig2,detect,offset,index, adresse,j,position,temporisation,invers,indexPointe,indexDevie,indexDroit, ComptEl,Compt_IT,Num_Element,k,modele,adr,adr2,erreur2,l,t,Nligne,postriple, postjd,postjs,nv,it : integer; @@ -3524,6 +3507,8 @@ var s,sa,chaine,SOrigine: string; begin debugConfig:=false; + trouve_NbDetDist:=false; + Nb_Det_Dist:=3; // initialisation des aiguillages avec des valeurs par défaut for i:=1 to MaxAcc do begin @@ -3751,12 +3736,28 @@ begin ServeurRetroCDM:=i; end; + sa:='NB_DET_DIST='; + i:=pos(sa,s); + if i<>0 then + begin + inc(nv); + trouve_NbDetDist:=true; + delete(s,i,length(sa)); + i:=0; + val(s,i,erreur); + if i<2 then i:=2; + Nb_Det_Dist:=i; + end; inc(it); - until (Nv>=17) or (it>30); - //affiche(IntToSTR(Nv)+' variables',clblue); - if it>30 then - begin affiche('ERREUR: manque variables dans config-gl.cfg',clred);exit;end; + until (Nv>=18) or (it>30); + //affiche(IntToSTR(Nv)+' variables',cyan); + if (it>30) then + begin + s:='ERREUR: manque variables dans config-gl.cfg'; + if not(trouve_NbDetDist) then s:=s+' : NB_DET_DIST'; + affiche(s,clred); + end; //Affiche('Valeurs d''initialisation des aiguillages',clyellow); closefile(fichier); @@ -5242,7 +5243,7 @@ begin end; } end; - if NivDebug=3 then AfficheDebug('Le suivant est le '+intToSTR(AdrSuiv),clYellow); + if (NivDebug=3) and (AdrSuiv<9996) then AfficheDebug('618 : Le suivant est le '+intToSTR(AdrSuiv),clYellow); detecteur_suivant:=AdrSuiv; end; @@ -5345,7 +5346,7 @@ begin j:=1; // J=1 test en incrément J=2 test en décrément // étape 1 : trouver le sens de progression (en incrément ou en décrément) - + repeat //préparer les variables AdrPrec:=el1;TypePrec:=typeDet1; @@ -5386,10 +5387,10 @@ begin AdrPrec:=AdrFonc;TypePrec:=TypeFonc; AdrFonc:=Adr;TypeFonc:=typeGen; inc(i); - sortie:=((typeDet2=TypeGen) and (Adr=el2)) or (Adr=0) or (Adr>=9996) or (i=15) or (N_Det=3); + sortie:=((typeDet2=TypeGen) and (Adr=el2)) or (Adr=0) or (Adr>=9996) or (i=15) or (N_Det=Nb_det_dist); until sortie ; if (i=15) and (Nivdebug=3) then afficheDebug('Pas trouvé',clyellow); - if (N_det=3) and (Nivdebug=3) then afficheDebug('Détecteurs trop distants',clyellow); + if (N_det=Nb_det_dist) and (Nivdebug=3) then afficheDebug('Détecteurs trop distants',clyellow); end else @@ -5397,7 +5398,7 @@ begin // déja trouvé adr:=el2;typeGen:=TypeDet2; end; - + if (typeDet2=TypeGen) and (Adr=el2) then begin if Nivdebug=3 then AfficheDebug('614 : Trouvé '+intToSTR(el2),clYellow); @@ -5422,6 +5423,7 @@ begin inc(i); sortie:=(TypeGen=1) or (Adr=0) or (Adr>=9996) or (i=10); until sortie; + if TypeGen=1 then begin if NivDebug=3 then @@ -5437,6 +5439,7 @@ begin inc(j); //AfficheDebug('j='+intToSTR(j),clyellow); until j=3; + detecteur_suivant_el:=9996; if NivDebug=3 then affichedebug('------------------',clyellow); end; @@ -6045,12 +6048,20 @@ function PresTrainPrec(AdrFeu : integer) : boolean; var PresTrain : boolean; j,i,Det_initial,Adr_El_Suiv,Btype_el_suivant,DetPrec1,DetPrec2,DetPrec3,DetPrec4 : integer; begin - if (AffSignal) or (NivDebug=3) then AfficheDebug('Le feu '+intToSTR(AdrFeu)+' est verrouillable au carré',clyellow); + i:=index_feu(Adrfeu); + if i=0 then + begin + Affiche('Erreur 602 - feu '+IntToSTR(adrFeu)+' non trouvé',clred); + if NivDebug=3 then AfficheDebug('Erreur 602 - feu '+IntToSTR(adrFeu)+' non trouvé',clred); + PresTrainPrec:=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; - i:=index_feu(Adrfeu); + repeat if NivDebug=3 then afficheDebug('Séquence '+IntToSTR(j)+' de recherche des 4 détecteurs précédents-----',clOrange); if (j=1) then @@ -6084,25 +6095,28 @@ begin if (det_initial<>0) then begin DetPrec1:=detecteur_suivant(Adr_El_Suiv,Btype_el_suivant,det_initial,1); - if DetPrec1<9996 then // route bloquée par aiguillage mal positionné + if DetPrec1<1024 then // route bloquée par aiguillage mal positionné begin DetPrec2:=detecteur_suivant_El(det_initial,1,DetPrec1,1); - if DetPrec2<9996 then + if DetPrec2<1024 then begin DetPrec3:=detecteur_suivant_El(DetPrec1,1,DetPrec2,1); - if DetPrec3<9996 then + if DetPrec3<1024 then begin DetPrec4:=detecteur_suivant_El(DetPrec2,1,DetPrec3,1); - if AffSignal or (NivDebug=3) then AfficheDebug('les détecteurs précédents au feu '+IntToSTR(Adrfeu)+' sont:'+intToSTR(Det_initial)+' '+intToSTR(DetPrec1)+' '+intToSTR(DetPrec2)+' '+intToSTR(DetPrec3)+' '+intToSTR(DetPrec4),clyellow); - PresTrain:=MemZone[DetPrec4,detPrec3] or - MemZone[DetPrec3,detPrec2] or MemZone[DetPrec2,detPrec1] or MemZone[DetPrec1,Det_initial] or presTrain ; - if AffSignal or (NivDebug=3) then + if DetPrec4<1024 then begin - if MemZone[DetPrec4,detPrec3] then AfficheDebug('0.présence train '+IntToSTR(DetPrec4)+' '+IntToSTR(detPrec3),clyellow); - if MemZone[DetPrec3,detPrec2] then AfficheDebug('1.présence train '+IntToSTR(DetPrec3)+' '+IntToSTR(detPrec2),clyellow); - if MemZone[DetPrec2,detPrec1] then AfficheDebug('2.présence train '+IntToSTR(DetPrec2)+' '+IntToSTR(detPrec1),clyellow); - if MemZone[DetPrec1,det_initial] then AfficheDebug('3.présence train '+IntToSTR(DetPrec1)+' '+IntToSTR(det_Initial),clyellow); - //if PresTrain then AfficheDebug('présence train',clyellow) else afficheDebug('abscence train',clyellow); + if AffSignal or (NivDebug=3) then AfficheDebug('les détecteurs précédents au feu '+IntToSTR(Adrfeu)+' sont:'+intToSTR(Det_initial)+' '+intToSTR(DetPrec1)+' '+intToSTR(DetPrec2)+' '+intToSTR(DetPrec3)+' '+intToSTR(DetPrec4),clyellow); + PresTrain:=MemZone[DetPrec4,detPrec3] or + MemZone[DetPrec3,detPrec2] or MemZone[DetPrec2,detPrec1] or MemZone[DetPrec1,Det_initial] or presTrain ; + if AffSignal or (NivDebug=3) then + begin + if MemZone[DetPrec4,detPrec3] then AfficheDebug('0.présence train '+IntToSTR(DetPrec4)+' '+IntToSTR(detPrec3),clyellow); + if MemZone[DetPrec3,detPrec2] then AfficheDebug('1.présence train '+IntToSTR(DetPrec3)+' '+IntToSTR(detPrec2),clyellow); + if MemZone[DetPrec2,detPrec1] then AfficheDebug('2.présence train '+IntToSTR(DetPrec2)+' '+IntToSTR(detPrec1),clyellow); + if MemZone[DetPrec1,det_initial] then AfficheDebug('3.présence train '+IntToSTR(DetPrec1)+' '+IntToSTR(det_Initial),clyellow); + //if PresTrain then AfficheDebug('présence train',clyellow) else afficheDebug('abscence train',clyellow); + end; end; //if AffSignal then AfficheDebug('MemZone'+intToSTR(DetPrec3)+' '+IntToSTR(detPrec2) = '+MemZone[DetPrec3,detPrec2] end; @@ -6676,10 +6690,6 @@ begin begin If traceListe then AfficheDebug('Le feu '+IntToSTR(AdrFeu)+' est précédé d''un buttoir',clyellow); MemZone[0,AdrDetFeu]:=true; - //NivDebug:=3; - // AffSignal:=true; - // Aiguillage[20].position:=const_devie; - // Aiguillage[7].position:=const_droit; maj_feu(AdrFeu); end; end; @@ -7204,29 +7214,27 @@ var ProcessEntry32 : TProcessEntry32; // pointeur sur la structure ProcessEntry32 processID : DWord; begin - Result:=false; + Result:=false; + hSnapShot:=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0); + Win32Check(hSnapShot <> INVALID_HANDLE_VALUE); - hSnapShot:=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0); - Win32Check(hSnapShot <> INVALID_HANDLE_VALUE); + sExeName:=LowerCase (sExeName); + FillChar(ProcessEntry32,SizeOf(TProcessEntry32),#0); + ProcessEntry32.dwSize:=SizeOf(TProcessEntry32); // contient la structure de tous les process - sExeName:=LowerCase (sExeName); - - FillChar(ProcessEntry32,SizeOf(TProcessEntry32),#0); - ProcessEntry32.dwSize:=SizeOf(TProcessEntry32); // contient la structure de tous les process - - if (Process32First(hSnapShot,ProcessEntry32)) then - repeat - //Affiche(ProcessEntry32.szExeFile,ClYellow); - if (Pos(sExeName,LowerCase(ProcessEntry32.szExeFile))=1) then - begin - processID:=ProcessEntry32.th32ProcessID; - CDMhd:=GetWindowFromID(processID); - Affiche('CDM rail processID='+IntToSTR(ProcessID)+' handle='+IntToSTR(CDMhd),clOrange); - Result:=true; - Break; - end; - until (Process32Next(hSnapShot,ProcessEntry32)=false); - CloseHandle(hSnapShot); + if (Process32First(hSnapShot,ProcessEntry32)) then + repeat + //Affiche(ProcessEntry32.szExeFile,ClYellow); + if (Pos(sExeName,LowerCase(ProcessEntry32.szExeFile))=1) then + begin + processID:=ProcessEntry32.th32ProcessID; + CDMhd:=GetWindowFromID(processID); + Affiche('CDM rail processID='+IntToSTR(ProcessID)+' handle='+IntToSTR(CDMhd),clOrange); + Result:=true; + Break; + end; + until (Process32Next(hSnapShot,ProcessEntry32)=false); + CloseHandle(hSnapShot); end; @@ -7460,10 +7468,9 @@ var V_utile : real; CibleHandle : Thandle; begin - //AvecMaj:=false; TraceSign:=True; PremierFD:=false; - // services commIP CDM + // services commIP CDM par défaut Srvc_Aig:=true; Srvc_Det:=true; Srvc_Act:=true; @@ -7573,8 +7580,6 @@ begin for i:=0 to Max_Event_det_tick do begin event_det_tick[i].aiguillage:=-1; - //for j:=1 to 1100 do - //event_det_tick[i].detecteur[j]:=-1; // initialiser les détecteurs à -1 event_det_tick[i].detecteur:=-1; event_det_tick[i].etat:=-1; event_det_tick[i].aiguillage:=-1; diff --git a/UnitTCO.dcu b/UnitTCO.dcu index 2469043..5f8b02c 100644 Binary files a/UnitTCO.dcu and b/UnitTCO.dcu differ diff --git a/client-GL.cfg b/client-GL.cfg index cc2c579..73f3f2b 100644 --- a/client-GL.cfg +++ b/client-GL.cfg @@ -1,6 +1,6 @@ /****************************************** / fichier de configuration de client-GL.log -/ JFP - 2020 +/ gily - f1iwq - 2018 /****************************************** / ce programme permet de commander les signaux complexes avec ou sans / CDM rail. Il a trois modes de fonctionnement: @@ -28,7 +28,7 @@ IpV4_PC=127.0.0.1:9999 / Adresse IP V4 de l'interface LI-USB Ethernet : port / par défaut le port est 5550 / ne pas connecter le port ou mettre 0 si on travaille avec l'interface USB -IPV4_Interface=192.168.1.55:5550 +IPV4_Interface=192.168.1.23:5550 / / port COM de l'adresse USB de l'interface LU-USB - LI100 - LI100F - LI101F - GENLI / attention de COM1 à 9 - Si le port de l'interface USB >9, il faut le changer @@ -38,10 +38,11 @@ IPV4_Interface=192.168.1.55:5550 / Com:vitesse,parité,nombre de bits,bits de stop,protocole: 0=aucun 1=Xon-Xoff 2=RTS-CTS 3=RTS-Xon-Xoff 4=CTS / voir notice page 29 / -Protocole_serie=COM5:9600,N,8,1,0 +Protocole_serie=COM3:57600,N,8,1,2 +/COM8:9600,N,8,1,0 / / Temporisation en ms d'envoi entre deux octets de la trame -Inter_Car=30 +Inter_Car=50 / Temporisation maximale de contrôle après non réponse de l'interface, en tranches de 100ms / à adapter en fonction de l'interface. Ex 7=700ms d'attente maxi Tempo_maxi=7 @@ -50,7 +51,7 @@ Tempo_maxi=7 / Entete=0 - n'ajoute rien aux trames - pour une interface RS232 ou GENLI / Entete=1 - Ajoute FF FE au début de chaque trame envoyée à l'interface : pour une interface USB, entete=1 / Entete=2 - Ajoute E4 au début de chaque trame et 0D 0D 0A en fin de chaque trame : pour compatibilité arduino -Entete=0 +Entete=1 / =============================================================================== / / Avec (1) ou sans (0) initialisation des aiguillages au démarrage selon le tableau ci après @@ -59,6 +60,9 @@ Init_Aig=0 / Fenêtre d'exécution en plein écran (1) ou réduite (0) Fenetre=0 / +/ Nombre de détecteurs considérés comme trop distants dans la recherche d'un détecteur "suivant" +Nb_Det_Dist=3 +/ / Vérification des versions au démarrage verif_version=1 / Notification de nouvelle version @@ -69,7 +73,7 @@ TCO=0 CDM=0 / Nom du fichier LAY à ouvrir depuis CDM sans caractères spéciaux ( : / ) /reseau_gily_signal_ajoute.lay -lay=DJEFF252RETROSIGNALISATION23.LAY +LAY=RESEAU_GILY_SIGNAL_AJOUTE.LAY / / Démarrage du serveur d'interface automatique / 0=ne pas démarrer automatiquement le serveur d'interfaces @@ -81,7 +85,7 @@ lay=DJEFF252RETROSIGNALISATION23.LAY / 6=FIS88 FeedBack (S88/S88N) / 7=RS2PC (Rs FeedBack interface) / 8=DCC++ -Serveur_interface=1 +Serveur_interface=0 / / Interface de rétrosignalisation pour LENZ/DCC++ / 1=auto @@ -90,8 +94,7 @@ Serveur_interface=1 / 4=LI-100F / 5=LI-100 / 6=GENLI -retro=6 -/ +retro=1 / / / Valeurs des initialisations des aiguillages au démarrage ----------------------------------------------- @@ -100,64 +103,38 @@ retro=6 / une position différente de 1 ou 2 sera à 1. Une temporisation de 0 sera à 5. / la liste doit être terminée par 0,0,0 [section_init] -77,2,3,0 -78,2,3,0 -79,2,3,0 -81,2,3,0 -82,2,3,0 -83,2,3,0 -84,2,3,0 -85,2,3,0 -86,2,3,0 -87,2,3,0 -88,2,3,0 -89,2,3,0 -90,2,3,0 -91,2,3,0 -92,2,3,0 -93,2,3,0 -94,2,3,0 -95,2,3,0 -96,2,3,0 -97,2,3,0 -98,2,3,0 -99,2,3,0 -100,2,3,0 -101,2,3,0 -102,2,3,0 -103,2,3,0 -104,2,3,0 -105,2,3,0 -106,2,3,0 -107,2,3,0 -108,2,3,0 -109,2,3,0 -110,2,3,0 -111,2,3,0 -112,2,3,0 -113,2,3,0 -114,2,3,0 -115,2,3,0 -116,2,3,0 -117,2,3,0 -118,2,3,0 -119,2,3,0 -120,2,3,0 -121,2,3,0 -122,2,3,0 -123,2,3,0 -124,2,3,0 -125,2,3,0 -126,2,3,0 -127,2,3,0 -128,2,3,0 -128,2,3,0 -130,2,3,0 -131,2,3,0 -132,2,3,0 -133,2,3,0 -134,2,3,0 -135,2,3,0 -136,2,3,0 +1,2,3,0 +2,2,3,0 +3,2,3,0 +4,2,3,0 +5,1,3,0 +6,2,3,0 +7,1,3,0 +8,2,3,0 +9,2,3,0 +10,2,3,0 +11,2,3,0 +12,1,3,0 +13,1,3,0 +14,1,3,0 +15,1,3,0 +16,1,4,0 +17,1,3,0 +18,2,4,0 +19,1,4,0 +20,2,4,0 +21,2,3,0 +22,1,3,0 +23,1,3,0 +24,1,3,0 +25,1,3,0 +26,2,3,0 +27,2,3,0 +28,2,3,0 +29,2,3,0 +30,2,3,0 +31,1,3,0 +32,1,3,0 0,0,0,0 -/ \ No newline at end of file +/ + diff --git a/config.cfg b/config.cfg index 8b14bf6..d7f5d04 100644 --- a/config.cfg +++ b/config.cfg @@ -1,158 +1,138 @@ /****************************************** / fichier de configuration de signaux_complexes -/ JFP - 2020 - nouvelles tjd +/ gily - f1iwq - 2019 /****************************************** / Sans Log=0 / Avec Log=1 : génère un fichier log Log=0 / Affichage du débug du calcul des routes, et enregistrement dans le log si la variable précédente est à 1 TraceDet=0 -/ Envoie un 0 après le pilotage des décodeurs LEB -RazSignaux=0 +/ Envoie un 0 après le pilotage des décodeurs +/ Mettre 1 si utilisation de décodeurs LEB +RazSignaux=1 / / modélisation des aiguillages : détermine les éléments connectés aux 3 branches des aiguilles (Pointe, Droit, Dévié (S) -/ adresse d'aiguillage [TJS,TJD,TRI],P=élément vers pointe D=élément vers Droit, S=élément vers dévié, INV si aiguillage inversé +/ adresse d'aiguillage,P=élément vers pointe D=élément vers Droit, S=élément vers dévié. +/ [60 ou 30 dans le cas d'un aiguillage en position déviée qui doit être fanchie à 30 ou 60] / Elément = détecteur (valeur uniquement numérique) ou aiguillage (adresse+branche de connexion (P S ou D) / Exemple : 1,P518,D523,S3P signifie : définition de l'aiguillage @1 : sur pointe relié au détecteur 518 / sur Droit relié au détecteur 518 / sur Dévié, relié à l'aiguillage 3 en pointe -/ Pour une TJD : 26TJD,D(connectD,DirectionD),S(connectS,DirectionS) +/ Pour une TJD : 26TJD,D530,S529,P28 +/ P désigne l'autre adresse de la TJD +/ Aiguillage triple / / S'il n'y a pas de détecteur connecté à une branche d'aiguillage, mettre 0. -/77TJD,P78,D599,S600 -/78TJD,P77,D598,S79D -77TJD,D(599,78D),S(600,78S),I1 -78TJD,D(598,S77D),S(79D,77S),I1 -79,P601,D78S,S597 -81,P515,D513,S82S -82,P83P,D516,S81S -83,P82P,D514,S517 -85,P524,D89D,S86D -86,P87P,D85S,S525 -87,P86P,D88P,S89S -88,P87D,D548,S94D -89TJD,D(85D,90D),S(87S,90S),I1 -90TJD,D(547,89D),S(91S,89S),I1 -/89TJD,P90,D85D,S87S -/90TJD,P89,D547,S91S -/91TJD,P92,D540,S90S -/92TJD,P91,D546,S96S -91TJD,D(540,92D),S(90S,92S),I1 -92TJD,D(546,91D),S(96S,91S),I1 -/93TJD,P94,D95S,S549 -/94TJD,P93,D88S,S542 -93TJD,D(88S,94D),S(542,94S) -94TJD,D(549,93D),S(95S,93S) -95,P97S,D543,S93D -96,P545,D538,S92S -97,P102S,D544,S95P -98,P550,D555,S101S -99,P101D,D551,S100D -100,P552,D99S,S553 -101,P556,D99P,S98S -102,P103D,D557,S97P -/103TJD,P104,D102P,S563 -/104TJD,P103,D564,S109D -103TJD,D(102P,104D),S(563,104S),I1 -104TJD,D(564,103D),S(109D,103S),I1 -105,P558,D106P,S107D -106,P105D,D566,S568 -/107TJD,P108,D105S,S559 -/108TJD,P107,D110S,S581 -107TJD,D(105S,108D),S(559,108S),I1 -108TJD,D(110S,107D),S(581,107S),I1 -109,P112S,D104S,S562 -110,P111P,S108D,D560 -111,P110P,D589,S113S -112,P113D,D561,S109P -113,P590,D112P,S111S -114,P603,D115P,S604 -115,P114D,D116S,S606 -116,P607,D605,S115D -117,P602,D591,S118P -118,P117S,D119P,S592 -119,P118D,D120P,S593 -120,P119D,D595,S594 -121,P122D,D588,S587 -122,P123D,D121P,S586 -123,P124S,D122P,S585 -124,P583,D584,S123P -125,P579,D577,S578 -126,P580,D569,S127P -127,P126S,D128P,S570 -128,P127D,D129P,S571 -129,P128D,D130P,S572 -130,P129D,D574,S573 -131,P132D,D529,S530 -132,P133D,D131P,S531 -133,P134D,D132P,S532 -134,P135D,D133P,S533 -135,P523,D134p,S534 -136,P522,D535,S536 +1,P518,D523,S3P,30 +2,P12S,D519,S5S +3,P1S,D4P,S5D +4,P3D,D6S,S514 +5,P515,D3S,S2S +6,P516,D0,S4D +7,P527,D519,S520 +8,P527,D521,S522 +9,P526,D513,S515,60 +10,P19P,D29P,S528,30 +11,P18P,D30D,S525 +12,P517,D20S,S2P +17,P525,D535,S528 +18,P11P,D23P,S517 +19,P10P,D22P,S531 +20,P520,D21P,S12D +21,P20D,D28D,S28D +22,P19D,D537,S538 +23,P18D,D538,S534 +24,P538,D32S,S533 +25,P31S,D529,S27P +26TJD,D(530,28D),S(529,28S),I0 +27,P25S,D530,S537 +28TJD,D(21D,26D),S(21S,26S),I0 +29,P10D,D513,S30S,60 +30,P524,D11D,S29D +31,P534,D0,S25P +32,P22S,D0,S24D 0 -/ +// / modélisation du réseau par branche / 1 ligne par branche - le sens de parcours de la branche est arbitraire. -/ Chaque ligne (branche) doit commmencer et finir par un aiguilage ou un buttoir (0) +/ Chaque ligne (branche) doit commmencer et finir par un aiguillage +/ Une ligne qui finit par un 0 signifie un heurtoir / @ détecteur A=@aiguillage / Terminer par 0 / Exemple : 519 est un détecteur - A2 est l'aiguillage 2 / -A83,514,518,520,524,A85,A89,A90,547,560,A110,A111,589,597,A79 -A77,599,590,A113,A112,561,548,A88,A87,A86,525,521,519,513,A81 -A106,A105,558,545,A96,538,537,0 -A108,581,582,0 -A107,559,546,A92,A91,537,540,0 -A112,A109,562,549,A93,A94,542,541,0 -A104,564,565,0 -A103,A102,A97,A95,543,528,0 -A97,544,0 -A102,557,555,A98,550,0 -A103,563,556,A101,A99,551,0 -A99,A100,552,0 -A100,553,554,0 -A106,566,567,0 -A106,568,603,A114,604,0 -A114,A115,606,608,0 -A115,A116,607,0 -A116,605,0 -A135,534,574,A130 -A134,533,573,A130 -A133,532,572,A129 -A132,531,571,A128 -A131,530,570,A127 -A82,516,527,576,580,A126,569,529,A131,A132,A133,A134,A135,523,515,A81 -A136,536,578,A125 -A77,600,579,A125,577,535,A136,522,517,A83 -A79,601,596,583,A124,584,595,A120,A119,A118,A117,602,598,A78 -A117,591,588,A121 -A118,592,587,A121 -A119,593,586,A122 -A120,594,585,A123 +A2,A12,517,A18,A11,A30,524,521,A8,527,A7,519,A2 +A7,520,A20,A12 +A1,A3,A4,514,522,A8 +A1,523,526,A9,513,A29,A10,A19,531,518,A1 +A9,515,A5 +A11,525,A17,528,A10 +A17,535,533,A24,538,A23 +A7,520,A20,A21,A28,A26,530,A27,A25,A31,534,A23,A18 +A26,529,A25 +A22,537,A27 +A22,A32,A24 +A6,516,0 +A31,0 0 -/ -/ liste signaux +/ liste des adresses des signaux et leur forme, pour affichage de l'image correspondante , +/ avec ou sans bouton de commande pour le feu blanc, type de décodeur [, type de cible (pour les décodeurs Unisemaf uniquement)] / la liste doit être terminée par une adresse à 0 -/ forme : 2=2 feux(carré violet/blanc) / 3=3 feux / 4=4 feux (carré) / 5=5 feux (carré + blanc) -/ 7=7 feux (carré+blanc + ralentissement / 9=9 feux (blanc ou violet + rappel ralentissement) -/ type de décodeur : 0=virtuel 1=digital Bahn 2=CDF 3=LDT 4=LEB 5=NMRA 6=Unisemaf Paco -/ l'énumération des détecteurs ne nécessite pas de parenthèses si il est seul, mais il faut des parenthèses si -/ le signal concerne plusieurs voies (donc détecteurs) +/ forme : 2=2 feux(carré violet/blanc) / 3=3 feux / 4=4 feux / 5=5 feux (carré + blanc ou violet) +/ 7=7 feux (blanc ou violet + ralentissement / 9=9 feux (blanc ou violet + rappel ralentissement) +/ Dx : signal directionnel à x feux +/ type de décodeur : 1=digital Bahn 2=CDF 3=LDT 4=LEB 5=NMRA 6=Unisemaf / Notation de chaque ligne: -/ adresse de base du signal, forme, réserve, type de décodeur [, (détecteur,..detecteur , élément suivant ..) , -/ avec ou sans demande de verrouillage du feu au carré (0 ou 1)] -197,3,0,6,(598,A78),1,3 -201,4,0,6,(597,A79),1,4 -205,9,0,6,(590,A113),1,93 -209,9,0,6,(560,A110),1,92 -213,9,0,6,(548,A88),1,92 -217,9,0,6,(524,A85),1,93 -221,7,0,6,(518,520),1,73 -225,3,0,6,(521,519),1,3 -229,9,0,6,(516,A82),1,92 -233,4,0,6,(513,A81),1,92 +/ adresse de base du signal, forme, avec ou sans bouton de commande du feu blanc, type de décodeur [, détecteur (det2, det3, ...) , élément suivant , +/ avec ou sans demande de verrouillage du feu au carré] +/ +/ signaux de test +/610,4,0,0,(521,a8),1 +/615,5,0,0,(521,a8),1 +/616,5,0,2,(521,a8),1 +/617,5,0,3,(521,a8),1 +/618,5,0,5,(521,a8),1 +/619,5,0,6,(521,a8),1,52 +176,7,0,1,(520,A20),1 +190,7,0,1,(523,526),0 +204,9,0,1,(527,A7),1 +218,7,0,1,(525,A17),1 +232,2,1,1,(516,A6),0 +260,9,1,1,(518,A1),1 +274,3,0,1,(524,521),0 +288,7,0,1,(522,A8),1 +302,9,0,1,(526,A9),1 +316,7,1,1,(515,A5),1 +330,7,0,1,(519,A2),1 +344,9,0,1,(528,A10),1 +358,9,0,1,(517,A18),1 +372,D3,1,(A10D)(A19S)(A19D,A22D)(A19D,A22S) +382,D3,1,(A29S,A10S)(A19S)(A19D,A22D)(A19D,A22S) +392,3,0,1,(535,533),1 +420,7,0,1,(529,A25,530,A27,537,A27),1 +448,7,0,1,(533,A24),1 +462,9,0,1,(513,A29),1 +476,9,0,1,(538,A23),1 +497,9,0,4,(531,A19),1 +600,7,0,0,(521,A8),1 +1000,9,0,0,(530,A26),1 +1001,9,0,0,(529,A26),1 0 / +/ Section actionneurs. Ne fonctionne qu'en mode connecté à CDM en run / Fonctions Fx à envoyer aux locomotives sur passage d'un actionneur -/ Uniquement en mode connecté à CDM -/ actionneur,état,Nom de la loco,fonction,temporisation en ms avant remise à 0 +/ actionneur,état,Nom du train,fonction,temporisation en ms avant remise à 0 +/ +/ Passages à niveau (PN) +/ (act_ferme_voie1,act_ouvre_voie1),(act_ferme_voie2,act_ouvre_voie2),...,PN(adresse_ferme,adresse_ouvre) +/ +/ Klaxon (F2) +/815,1,CC406526,F2,400 +/ +/ passage à niveau à 2 voies +/(815,830),(820,840),PN(121+,121-) +/ +/ passage à niveau à 1 voie +/(815,809),PN(131+,131-) +/ +813,1,CC406526,A613,2,Z 0 diff --git a/verif_version.dcu b/verif_version.dcu index 1f73817..5e3b9e8 100644 Binary files a/verif_version.dcu and b/verif_version.dcu differ diff --git a/verif_version.pas b/verif_version.pas index c4ba71a..0c49ae3 100644 --- a/verif_version.pas +++ b/verif_version.pas @@ -23,7 +23,7 @@ var Lance_verif : integer; verifVersion,notificationVersion : boolean; -Const Version='2.2'; // sert à la comparaison de la version publiée +Const Version='2.21'; // sert à la comparaison de la version publiée implementation diff --git a/versions.txt b/versions.txt index 4e56777..c0d22e7 100644 --- a/versions.txt +++ b/versions.txt @@ -1,5 +1,5 @@ Version 1.0 : première version -Version 1.01 : gestion des trajectoires vers les buttoirs +Version 1.01 : gestion des routes vers les buttoirs Version 1.02 : vérification automatique des versions Version 1.1 : gestion des tableaux indicateurs de direction gestion du décodeur de signaux Unisemaf Paco (expérimental) @@ -40,6 +40,9 @@ version 2.11 : Suppression du message d'erreur "Element 9999 non trouv Ajout de l'option fenêtre étendue dans le panneau de configuration Version 2.2 : Correction d'un bug sur le verrouillage des signaux au carré sur les trains en approche. Mise à jour du fichier de config.cfg si modification des signaux dans la configuration. +version 2.21 : Paramétrage du nombre de détecteurs considérés comme trop distants + Correction d'un bug de la 2.2 +