verification automatique des versions
This commit is contained in:
Binary file not shown.
@@ -31,12 +31,12 @@
|
|||||||
-M
|
-M
|
||||||
-$M16384,1048576
|
-$M16384,1048576
|
||||||
-K$00400000
|
-K$00400000
|
||||||
-LE"c:\program files\borland\delphi7\Projects\Bpl"
|
-LE"c:\program files (x86)\borland\delphi7\Projects\Bpl"
|
||||||
-LN"c:\program files\borland\delphi7\Projects\Bpl"
|
-LN"c:\program files (x86)\borland\delphi7\Projects\Bpl"
|
||||||
-U"c:\program files\borland\delphi7\Lib\Debug"
|
-U"c:\program files (x86)\borland\delphi7\Lib\Debug"
|
||||||
-O"c:\program files\borland\delphi7\Lib\Debug"
|
-O"c:\program files (x86)\borland\delphi7\Lib\Debug"
|
||||||
-I"c:\program files\borland\delphi7\Lib\Debug"
|
-I"c:\program files (x86)\borland\delphi7\Lib\Debug"
|
||||||
-R"c:\program files\borland\delphi7\Lib\Debug"
|
-R"c:\program files (x86)\borland\delphi7\Lib\Debug"
|
||||||
-w-UNSAFE_TYPE
|
-w-UNSAFE_TYPE
|
||||||
-w-UNSAFE_CODE
|
-w-UNSAFE_CODE
|
||||||
-w-UNSAFE_CAST
|
-w-UNSAFE_CAST
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ AutoIncBuild=1
|
|||||||
MajorVer=1
|
MajorVer=1
|
||||||
MinorVer=0
|
MinorVer=0
|
||||||
Release=0
|
Release=0
|
||||||
Build=2
|
Build=3
|
||||||
Debug=0
|
Debug=0
|
||||||
PreRelease=0
|
PreRelease=0
|
||||||
Special=0
|
Special=0
|
||||||
@@ -122,7 +122,7 @@ CodePage=1252
|
|||||||
[Version Info Keys]
|
[Version Info Keys]
|
||||||
CompanyName=
|
CompanyName=
|
||||||
FileDescription=
|
FileDescription=
|
||||||
FileVersion=1.0.0.2
|
FileVersion=1.0.0.3
|
||||||
InternalName=
|
InternalName=
|
||||||
LegalCopyright=
|
LegalCopyright=
|
||||||
LegalTrademarks=
|
LegalTrademarks=
|
||||||
|
|||||||
@@ -3,12 +3,14 @@ program Signaux_complexes_GL;
|
|||||||
uses
|
uses
|
||||||
Forms,
|
Forms,
|
||||||
UnitPrinc in 'UnitPrinc.pas' {FormPrinc},
|
UnitPrinc in 'UnitPrinc.pas' {FormPrinc},
|
||||||
UnitDebug in 'UnitDebug.pas' {FormDebug};
|
UnitDebug in 'UnitDebug.pas' {FormDebug},
|
||||||
|
verif_version in 'verif_version.pas' {FormVersion};
|
||||||
|
|
||||||
{$R *.res}
|
{$R *.res}
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Application.Initialize;
|
Application.Initialize;
|
||||||
Application.CreateForm(TFormPrinc, FormPrinc);
|
Application.CreateForm(TFormPrinc, FormPrinc);
|
||||||
|
Application.CreateForm(TFormDebug, FormDebug);
|
||||||
Application.Run;
|
Application.Run;
|
||||||
end.
|
end.
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
BIN
UnitDebug.dcu
BIN
UnitDebug.dcu
Binary file not shown.
BIN
UnitPrinc.dcu
BIN
UnitPrinc.dcu
Binary file not shown.
@@ -16,7 +16,7 @@ interface
|
|||||||
uses
|
uses
|
||||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||||
Dialogs, StdCtrls, OleCtrls, ExtCtrls, jpeg, ComCtrls,
|
Dialogs, StdCtrls, OleCtrls, ExtCtrls, jpeg, ComCtrls,
|
||||||
ImgList, ScktComp, StrUtils, Menus, ActnList, MSCommLib_TLB ;
|
ImgList, ScktComp, StrUtils, Menus, ActnList, MSCommLib_TLB;
|
||||||
|
|
||||||
type
|
type
|
||||||
TFormPrinc = class(TForm)
|
TFormPrinc = class(TForm)
|
||||||
@@ -121,7 +121,7 @@ type
|
|||||||
// L'oeilleton est cablé sur la sortie 4, il est géré directement par le décodeur. **/
|
// L'oeilleton est cablé sur la sortie 4, il est géré directement par le décodeur. **/
|
||||||
// code des aspects des signaux
|
// code des aspects des signaux
|
||||||
const
|
const
|
||||||
AF='Client TCP-IP CDM Rail ou USB - système LENZ - Version 1.01';
|
|
||||||
carre =0 ; carre_F=1;
|
carre =0 ; carre_F=1;
|
||||||
semaphore =1 ; semaphore_F=2;
|
semaphore =1 ; semaphore_F=2;
|
||||||
semaphore_cli =2 ; semaphore_cli_F=4;
|
semaphore_cli =2 ; semaphore_cli_F=4;
|
||||||
@@ -202,7 +202,7 @@ var ancien_tablo_signalCplx,EtatsignalCplx : array[0..MaxAcc] of word;
|
|||||||
event_det : array[1..20] of integer;
|
event_det : array[1..20] of integer;
|
||||||
branche : array [1..100] of string;
|
branche : array [1..100] of string;
|
||||||
parcours : array[1..MaxElParcours] of TBranche ; // parcours des locos en fonction des détecteurs
|
parcours : array[1..MaxElParcours] of TBranche ; // parcours des locos en fonction des détecteurs
|
||||||
|
|
||||||
const
|
const
|
||||||
ClBleuClair=$FF7070 ;
|
ClBleuClair=$FF7070 ;
|
||||||
Cyan=$FFA0A0;
|
Cyan=$FFA0A0;
|
||||||
@@ -215,7 +215,7 @@ var
|
|||||||
ack,portCommOuvert,trace,AffMem,AfficheDet,Bis,CDM_connecte,parSocketCDM,
|
ack,portCommOuvert,trace,AffMem,AfficheDet,Bis,CDM_connecte,parSocketCDM,
|
||||||
DebugOuv : boolean;
|
DebugOuv : boolean;
|
||||||
tablo : array of byte;
|
tablo : array of byte;
|
||||||
Enregistrement,AdresseIP,chaine_Envoi,chaine_recue,AdresseIPCDM,recuCDM,Id_CDM : string;
|
Enregistrement,AdresseIP,chaine_Envoi,chaine_recue,AdresseIPCDM,recuCDM,Id_CDM,Af : string;
|
||||||
maxaiguillage,detecteur_chgt,Temps,TpsRecuCom,NumPort,Tempo_init,Suivant,
|
maxaiguillage,detecteur_chgt,Temps,TpsRecuCom,NumPort,Tempo_init,Suivant,
|
||||||
timerSimule,NbreImagePligne,Port,NbreBranches,Index2_det,branche_det,Index_det,portCDM : integer;
|
timerSimule,NbreImagePligne,Port,NbreBranches,Index2_det,branche_det,Index_det,portCDM : integer;
|
||||||
Ancien_detecteur,detecteur : array[0..1024] of boolean; // anciens état des détecteurs et adresses des détecteurs et leur état
|
Ancien_detecteur,detecteur : array[0..1024] of boolean; // anciens état des détecteurs et adresses des détecteurs et leur état
|
||||||
@@ -265,7 +265,7 @@ var
|
|||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses UnitDebug;
|
uses UnitDebug, verif_version;
|
||||||
|
|
||||||
procedure menu_interface(MA : TMA);
|
procedure menu_interface(MA : TMA);
|
||||||
var val : boolean;
|
var val : boolean;
|
||||||
@@ -637,6 +637,9 @@ begin
|
|||||||
until (temps<=0);
|
until (temps<=0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// envoi d'une chaîne à la centrale par USBLenz ou socket, puis attend l'ack ou le nack
|
// envoi d'une chaîne à la centrale par USBLenz ou socket, puis attend l'ack ou le nack
|
||||||
function envoi(s : string) : boolean;
|
function envoi(s : string) : boolean;
|
||||||
var temps : integer;
|
var temps : integer;
|
||||||
@@ -1128,9 +1131,12 @@ envoie les donn
|
|||||||
18. rappel 60 + avertissement clignotant
|
18. rappel 60 + avertissement clignotant
|
||||||
|
|
||||||
/*===========================================================================*)
|
/*===========================================================================*)
|
||||||
procedure envoi_NMRA(adresse,code : integer);
|
procedure envoi_NMRA(adresse: integer);
|
||||||
var valeur : integer ;
|
var valeur,index,code : integer ;
|
||||||
begin
|
begin
|
||||||
|
index:=Index_feu(adresse); // tranforme l'adresse du feu en index tableau
|
||||||
|
code:=feux[index].aspect; // aspect du feu;
|
||||||
|
|
||||||
if (ancien_tablo_signalCplx[adresse]<>EtatSignalCplx[adresse]) then
|
if (ancien_tablo_signalCplx[adresse]<>EtatSignalCplx[adresse]) then
|
||||||
begin
|
begin
|
||||||
ancien_tablo_signalCplx[adresse]:=EtatSignalCplx[adresse];
|
ancien_tablo_signalCplx[adresse]:=EtatSignalCplx[adresse];
|
||||||
@@ -1227,6 +1233,7 @@ begin
|
|||||||
aspect:=code_to_aspect(code); // transforme le motif de bits en numéro "code des aspects des signaux"
|
aspect:=code_to_aspect(code); // transforme le motif de bits en numéro "code des aspects des signaux"
|
||||||
if (tracesign) then Affiche('Signal virtuel: '+intToSTR(adresse)+' Etat '+etatSign[aspect],clyellow);
|
if (tracesign) then Affiche('Signal virtuel: '+intToSTR(adresse)+' Etat '+etatSign[aspect],clyellow);
|
||||||
end;
|
end;
|
||||||
|
dessine_feu(adresse);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
(*==========================================================================
|
(*==========================================================================
|
||||||
@@ -2166,7 +2173,7 @@ begin
|
|||||||
signalCplx:=feux[i].adresse;
|
signalCplx:=feux[i].adresse;
|
||||||
if not(ferme) and (signalCplx<>0) then
|
if not(ferme) and (signalCplx<>0) then
|
||||||
begin
|
begin
|
||||||
case feux[i].decodeur of
|
case feux[i].decodeur of
|
||||||
0 : envoi_virtuel(signalCplx);
|
0 : envoi_virtuel(signalCplx);
|
||||||
1 : envoi_signalBahn(signalCplx);
|
1 : envoi_signalBahn(signalCplx);
|
||||||
2 : envoi_CDF(signalCplx);
|
2 : envoi_CDF(signalCplx);
|
||||||
@@ -4755,12 +4762,19 @@ begin
|
|||||||
begin
|
begin
|
||||||
pIsWow64Process(GetCurrentProcess,IsWow64);
|
pIsWow64Process(GetCurrentProcess,IsWow64);
|
||||||
end;
|
end;
|
||||||
|
FreeLibrary(DLL);
|
||||||
|
end;
|
||||||
Result:=IsWow64;
|
Result:=IsWow64;
|
||||||
end;
|
end;
|
||||||
{$J-}
|
{$J-}
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
procedure TFormPrinc.FormCreate(Sender: TObject);
|
procedure TFormPrinc.FormCreate(Sender: TObject);
|
||||||
|
var
|
||||||
|
i : integer;
|
||||||
s,s2,Url,LocalFile : string;
|
s,s2,Url,LocalFile : string;
|
||||||
|
trouve,AvecMaj : Boolean;
|
||||||
V_utile,V_publie : real;
|
V_utile,V_publie : real;
|
||||||
begin
|
begin
|
||||||
|
|
||||||
@@ -4768,11 +4782,16 @@ begin
|
|||||||
TraceSign:=True;
|
TraceSign:=True;
|
||||||
AF:='Client TCP-IP CDM Rail ou USB - système LENZ - Version '+Version;
|
AF:='Client TCP-IP CDM Rail ou USB - système LENZ - Version '+Version;
|
||||||
Caption:=AF;
|
Caption:=AF;
|
||||||
avecMSCom:=false;
|
avecMSCom:=false;
|
||||||
Application.onHint:=doHint;
|
Application.onHint:=doHint;
|
||||||
LabelEtat.Caption:='Initialisations en cours';
|
LabelEtat.Caption:='Initialisations en cours';
|
||||||
|
Menu_interface(devalide);
|
||||||
|
|
||||||
// ouvre la fenetre debug
|
// ouvre la fenetre debug
|
||||||
|
FormDebug:=TFormDebug.Create(Self);
|
||||||
|
FormDebug.Caption:=AF+' debug';
|
||||||
|
//FormDebug.Show;
|
||||||
|
|
||||||
DebugOuv:=True;
|
DebugOuv:=True;
|
||||||
|
|
||||||
FormVersion:=TformVersion.Create(self);
|
FormVersion:=TformVersion.Create(self);
|
||||||
@@ -4850,6 +4869,7 @@ begin
|
|||||||
//maj_feu(201);
|
//maj_feu(201);
|
||||||
//etat_signal_suivant(201,1);
|
//etat_signal_suivant(201,1);
|
||||||
//Aiguille_deviee(462);
|
//Aiguille_deviee(462);
|
||||||
|
//i:=detecteur_suivant(23,false,538,false); // donne l'élément suivant de AdrPrec à AdrFonc et dans Bis si c'est un aig bis
|
||||||
// i:=etat_signal_suivant(462,2);
|
// i:=etat_signal_suivant(462,2);
|
||||||
//NivDebug:=3;
|
//NivDebug:=3;
|
||||||
//Affiche(IntToSTR(detecteur_suivant_El(531,false,518,false)),clyellow);
|
//Affiche(IntToSTR(detecteur_suivant_El(531,false,518,false)),clyellow);
|
||||||
@@ -4877,10 +4897,9 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TFormPrinc.FormClose(Sender: TObject; var Action: TCloseAction);
|
procedure TFormPrinc.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||||
begin
|
|
||||||
Ferme:=true;
|
|
||||||
begin
|
begin
|
||||||
Ferme:=true;
|
Ferme:=true;
|
||||||
|
if portCommOuvert then begin portCommOuvert:=false;MSComm1.Portopen:=false; end;
|
||||||
portCommOuvert:=false;
|
portCommOuvert:=false;
|
||||||
ClientSocketCDM.close;
|
ClientSocketCDM.close;
|
||||||
ClientSocketLenz.close;
|
ClientSocketLenz.close;
|
||||||
|
|||||||
BIN
VerifVersion.dcu
Normal file
BIN
VerifVersion.dcu
Normal file
Binary file not shown.
130
VerifVersion.pas
Normal file
130
VerifVersion.pas
Normal file
@@ -0,0 +1,130 @@
|
|||||||
|
unit VerifVersion;
|
||||||
|
|
||||||
|
interface
|
||||||
|
//procedure verifie_version;
|
||||||
|
|
||||||
|
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||||
|
Dialogs, StdCtrls , ComCtrls ,WinInet;
|
||||||
|
|
||||||
|
procedure verifie_version;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
function GetCurrentProcessEnvVar(const VariableName: string): string;
|
||||||
|
var
|
||||||
|
nSize: DWord;
|
||||||
|
begin
|
||||||
|
nSize:= 0;
|
||||||
|
nSize:= GetEnvironmentVariable(PChar(VariableName), nil, nSize);
|
||||||
|
if nSize = 0 then
|
||||||
|
begin
|
||||||
|
result:= '';
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
SetLength(result, nSize - 1);
|
||||||
|
if GetEnvironmentVariable(PChar(VariableName), PChar(result), nSize) <> nSize - 1 then
|
||||||
|
raise Exception.Create(SysErrorMessage(GetlastError))
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function DownloadURL_NOCache(aUrl: string;s : string): Boolean;
|
||||||
|
var
|
||||||
|
hSession: HINTERNET;
|
||||||
|
hService: HINTERNET;
|
||||||
|
Fs:TFileStream;
|
||||||
|
lpBuffer: array[0..1024 + 1] of byte;
|
||||||
|
dwBytesRead: DWORD;
|
||||||
|
begin
|
||||||
|
Result := False;
|
||||||
|
|
||||||
|
Try Fs := TFileStream.Create(s,fmCreate);
|
||||||
|
hSession := InternetOpen('MyApp', INTERNET_OPEN_TYPE_PRECONFIG, nil, nil, 0);
|
||||||
|
try
|
||||||
|
if Assigned(hSession) then
|
||||||
|
begin
|
||||||
|
hService := InternetOpenUrl(hSession, PChar(aUrl), nil, 0, INTERNET_FLAG_RELOAD, 0);
|
||||||
|
if Assigned(hService) then
|
||||||
|
try
|
||||||
|
while True do
|
||||||
|
begin
|
||||||
|
dwBytesRead := 1024;
|
||||||
|
InternetReadFile(hService, @lpBuffer, 1024, dwBytesRead);
|
||||||
|
fs.WriteBuffer(lpBuffer, dwBytesRead);
|
||||||
|
if dwBytesRead = 0 then break;
|
||||||
|
end;
|
||||||
|
Result := True;
|
||||||
|
finally
|
||||||
|
InternetCloseHandle(hService);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
InternetCloseHandle(hSession);
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
fs.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure verifie_version;
|
||||||
|
var s,s2,Url,LocalFile : string;
|
||||||
|
trouve : boolean;
|
||||||
|
fichier : text;
|
||||||
|
i : integer;
|
||||||
|
V_publie,V_utile : real;
|
||||||
|
begin
|
||||||
|
Url:='http://cdmrail.free.fr/ForumCDR/viewtopic.php?f=77&t=3906#p50499';
|
||||||
|
LocalFile:='page.txt';
|
||||||
|
trouve:=false;
|
||||||
|
if DownloadURL_NOCache(Url,localFile) then
|
||||||
|
begin
|
||||||
|
AssignFile(fichier,LocalFile);
|
||||||
|
reset(fichier);
|
||||||
|
while not(eof(fichier) or trouve) do
|
||||||
|
begin
|
||||||
|
readln(fichier,s);
|
||||||
|
s:=UpperCase(s);
|
||||||
|
//Affiche(s,clyellow);
|
||||||
|
i:=pos('VERSION ',s);
|
||||||
|
trouve:=i<>0;
|
||||||
|
end;
|
||||||
|
closefile(fichier);
|
||||||
|
if trouve then
|
||||||
|
begin
|
||||||
|
delete(s,1,i+7);
|
||||||
|
i:=pos('VERSION ',s);
|
||||||
|
i:=pos(' ',s);
|
||||||
|
s:=copy(s,1,i-1);
|
||||||
|
//Affiche('Version '+s,clgreen);
|
||||||
|
// changer le . en ,
|
||||||
|
i:=pos('.',s);s[i]:=',';
|
||||||
|
s2:=version;
|
||||||
|
i:=pos('.',s2);s2[i]:=',';
|
||||||
|
|
||||||
|
V_publie:=StrToFloat(s);
|
||||||
|
V_utile:=StrToFloat(s2);
|
||||||
|
if V_utile<V_publie then
|
||||||
|
begin
|
||||||
|
s:='Vous utilisez la version '+version+' mais il existe la version '+s;
|
||||||
|
//Affiche(s,clOrange);
|
||||||
|
if MessageDlg(s+' Voulez-vous la télécharger?',
|
||||||
|
mtConfirmation,[mbYes,mbNo],0)=mrYes then
|
||||||
|
begin
|
||||||
|
s:=GetCurrentProcessEnvVar('USERPROFILE')+'\Downloads\Signaux_Complexes_GL.Zip';
|
||||||
|
//Affiche('A télécharger dans '+s,ClLime);
|
||||||
|
if DownloadURL_NOCache('http://cdmrail.free.fr/ForumCDR/download/file.php?id=12070',s) then
|
||||||
|
//Affiche('Téléchargement réussi',clLime);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
//if V_utile=V_publie then Affiche('Version Actuelle=Version publiée : votre version est à jour',clLime);
|
||||||
|
|
||||||
|
end;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
//Affiche('Pas d''accès au site CDM rail',ClLime);
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
||||||
181
config.cfg
181
config.cfg
@@ -1,112 +1,109 @@
|
|||||||
/******************************************
|
/******************************************
|
||||||
/ fichier de configuration de signaux complexes
|
/ fichier de configuration de signaux_complexes
|
||||||
/ cap de bouheyre avec signaux - 2018
|
/ gily - f1iwq - 2018
|
||||||
/****************************************
|
/******************************************
|
||||||
/ Sans Log=0 / Avec Log=1 : génère un fichier log
|
/ Sans Log=0 / Avec Log=1 : génère un fichier log
|
||||||
Log=0
|
Log=0
|
||||||
/ Affichage du débug du calcul des routes, et enregistrement dans le log si la variable précédente est à 1
|
/ Affichage du débug du calcul des routes, et enregistrement dans le log si la variable précédente est à 1
|
||||||
TraceDet=0
|
TraceDet=0
|
||||||
/ si 1 envoie un 0 après le pilotage des décodeurs LEB
|
/ Envoie un 0 après le pilotage des décodeurs LEB
|
||||||
RazSignaux=0
|
RazSignaux=0
|
||||||
/
|
/
|
||||||
/ modélisation des aiguillages : détermine les éléments connectés aux 3 branches des aiguilles (Pointe, Droit, Dévié (S)
|
/ modélisation des aiguillages : détermine les éléments connectés aux 3 branches des aiguilles (Pointe, Droit, Dévié (S)
|
||||||
/ adresse d'aiguillage[B],P=élément vers pointe D=élément vers Droit, S=élément vers dévié
|
/ adresse d'aiguillage,P=élément vers pointe D=élément vers Droit, S=élément vers dévié.
|
||||||
/ B pour adresse d'aiguillage déja utilisée
|
/ [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 [TRI,TJS,TJD]+branche de connexion (P S ou D)
|
/ Elément = détecteur (valeur uniquement numérique) ou aiguillage (adresse+branche de connexion (P S ou D)
|
||||||
/ Exemples : 1,P518,D523,S3P signifie : définition de l'aiguillage @1 : sur pointe relié au détecteur 518
|
/ 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 Droit relié au détecteur 518
|
||||||
/ sur Dévié, relié à l'aiguillage 3 en pointe
|
/ sur Dévié, relié à l'aiguillage 3 en pointe
|
||||||
/ Voir la documentation des signaux complexes pour une description complete
|
/ 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.
|
/ S'il n'y a pas de détecteur connecté à une branche d'aiguillage, mettre 0.
|
||||||
1,P2P,D3P,S1BS
|
1,P518,S3P,D523,30
|
||||||
1B,P553,D16P,S1S
|
2,P12S,S5S,D519
|
||||||
2,P1P,D4P,S2BS
|
3,P1S,S5D,D4P
|
||||||
2B,P521,D16D,S2S
|
4,P3D,S514,D6S
|
||||||
3,P1D,D522,S5BP
|
5,P515,S2S,D3S
|
||||||
4,P2D,D554,S6BP
|
6,P516,S4D,D0
|
||||||
5,P9P,S15P,D5BS
|
7,P527,S520,D519
|
||||||
5B,P3S,S5D,D545
|
8,P527,S522,D521
|
||||||
6,P10P,S546,D6BS
|
9,P526,S515,D513,60
|
||||||
6B,P4S,D545,S6D
|
10,P19P,S528,D29P,30
|
||||||
7,P15S,D566,S565
|
11,P18P,D30D,S525
|
||||||
8,P20P,D566,S565
|
12,P517,D20S,S2P
|
||||||
9,P5P,D530,S17P
|
17,P525,D535,S528
|
||||||
10,P6P,D530,S18P
|
18,P11P,S517,D23P
|
||||||
13,P17S,D563,S564
|
19,P10P,S531,D22P
|
||||||
14,P18S,D563,S564
|
20,P520,D21P,S12D
|
||||||
15,P5S,D546,S7P
|
21,P20D,S28D,D28D
|
||||||
16,P1BD,S16BS,D2BD
|
22,P19D,S538,D537
|
||||||
16B,P0,S16S,D557
|
23,P18D,S534,D538
|
||||||
17,P9S,D531,S13P
|
24,P538,S533,D32S
|
||||||
18,P10S,D562,S14P
|
25,P31S,D529,S27P
|
||||||
20,P8P,D547,S0
|
26TJD,D530,S529,P28
|
||||||
21,P25P,S537,D23S
|
28TJD,D21D,S21S,P26
|
||||||
22,P24P,S561,D25S
|
27,P25S,D530,S537
|
||||||
23,P569,S21D,D538
|
29,P10D,S30S,D513,60
|
||||||
24,P22P,S26P,D513
|
30,P524,S29D,D11D
|
||||||
25,P21P,S22D,D570
|
31,P534,S25P,D0
|
||||||
26,P24S,S515,D514
|
32,P22S,S24D,D0
|
||||||
28,P30P,S29P,D570
|
|
||||||
29,P28S,D516,S31P
|
|
||||||
30,P28P,D32S,S539
|
|
||||||
31TRI,27,P28S,D518,S0,S2-517
|
|
||||||
32,P571,D538,S30D
|
|
||||||
0
|
0
|
||||||
//
|
//
|
||||||
/ modélisation du réseau par branche
|
/ modélisation du réseau par branche
|
||||||
/ 1 ligne par branche - le sens de parcours de la description n'a pas d'importance.
|
/ 1 ligne par branche - le sens de parcours de la branche est arbitraire.
|
||||||
/ Chaque ligne (branche) doit comporter au moins un détecteur et au moins aiguillage
|
/ Chaque ligne (branche) doit commmencer et finir par un aiguillage
|
||||||
|
/ Une ligne qui finit par un 0 signifie un heurtoir
|
||||||
/ @ détecteur A=@aiguillage
|
/ @ détecteur A=@aiguillage
|
||||||
/ chaque ligne doit commencer par un aiguillage et se terminer par un aiguillage
|
/ Terminer par 0
|
||||||
/ Terminer par les brances par 0
|
/ Exemple : 519 est un détecteur - A2 est l'aiguillage 2
|
||||||
/ Exemple : 519 est un détecteur - A2 est l'aiguillage 2 - A1B est l'aiguillage 1bis
|
|
||||||
/
|
/
|
||||||
/ rouge - jaune
|
A2,A12,517,A18,A11,A30,524,521,A8,527,A7,519,A2
|
||||||
A20,547,561,A22,A24,A26,515,518,A31,A29,A28,A30,539,522,A3,A1,A2,A4,A6B,545,A5B,A3
|
A7,520,A20,A12
|
||||||
A26,514,517,A31
|
A1,A3,A4,514,522,A8
|
||||||
A26,515,518,A31
|
A1,523,526,A9,513,A29,A10,A19,531,518,A1
|
||||||
A24,513,516,A29
|
A9,515,A5
|
||||||
/grande boucle extérieure départ de couche rouge: de 569 à 569
|
A11,525,A17,528,A10
|
||||||
A23,538,A32,571,553,A1B,A16,A2B,521,569,A23
|
A17,535,533,A24,538,A23
|
||||||
/ grande boucle intérieure
|
A7,520,A20,A21,A28,A26,530,A27,A25,A31,534,A23,A18
|
||||||
A21,A25,570,A28
|
A26,529,A25
|
||||||
A4,554,537,A21
|
A22,537,A27
|
||||||
/ couche jaune
|
A22,A32,A24
|
||||||
A10,530,A9,A5,A15,546,A6
|
A6,516,0
|
||||||
A18,562,531,A17
|
A31,0
|
||||||
A14,563,A13
|
|
||||||
A14,564,A13
|
|
||||||
/
|
|
||||||
A7,565,A8
|
|
||||||
A7,566,A8
|
|
||||||
A16B,557,0
|
|
||||||
0
|
0
|
||||||
/
|
/ liste des adresses des signaux et leur forme, pour affichage de l'image correspondante ,
|
||||||
/ liste des signaux
|
/ avec ou sans bouton de commande pour le feu blanc, type de décodeur.
|
||||||
/ la liste doit être terminée par une adresse à 0
|
/ 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)
|
/ forme : 2=2 feux(carré violet/blanc) / 3=3 feux / 4=4 feux / 5=5 feux (carré + blanc ou violet)
|
||||||
/ 7=7 feux (carré+blanc + ralentissement / 9=9 feux (blanc ou violet + rappel ralentissement)
|
/ 7=7 feux (blanc ou violet + ralentissement / 9=9 feux (blanc ou violet + rappel ralentissement)
|
||||||
/ type de décodeur : 0=feu virtuel 1=digital Bahn 2=CDF 3=LDT 4=LEB
|
/ type de décodeur : 1=digital Bahn 2=CDF 3=LDT 4=LEB
|
||||||
/ 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)
|
|
||||||
/ Notation de chaque ligne:
|
/ Notation de chaque ligne:
|
||||||
/ adresse de base du signal, forme, réserve, type de décodeur [, (détecteur,..detecteur , élément suivant ..) ,
|
/ 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é (0 ou 1)]
|
/ avec ou sans demande de verrouillage du feu au carré]
|
||||||
161,4,0,4,(538,A32),0
|
176,7,0,1,(520,A20),1
|
||||||
169,9,0,4,(539,A30),0,
|
190,7,0,1,(523,526),1
|
||||||
177,9,0,4,(569,A23),0
|
204,9,0,1,(527,A7),1
|
||||||
185,4,0,4,(570,A25),0
|
218,7,0,1,(525,A17),1
|
||||||
193,4,0,4,(516,A29),0
|
232,2,1,1,(516,A6),1
|
||||||
201,2,0,4,(517,31TRI,518,31TRI),0
|
260,9,1,1,(518,A1),1
|
||||||
209,9,0,4,(561,547),0
|
274,3,0,1,(524,521),1
|
||||||
217,2,0,4,(514,A26,515,A26),0
|
288,7,0,1,(522,A8),1
|
||||||
225,9,0,4,(516,A29),0
|
302,9,0,1,(526,A9),1
|
||||||
233,4,0,4,(547,A20),0
|
316,7,1,1,(515,A5),1
|
||||||
1001,3,0,0,(537,554),0
|
330,7,0,1,(519,A2),1
|
||||||
1003,3,0,0,(553,A1B),0
|
344,9,0,1,(528,A10),1
|
||||||
1005,3,0,0,(571,553),0
|
358,9,0,1,(517,A18),1
|
||||||
1007,3,0,0,(554,A4),0
|
392,3,0,1,(535,533),1
|
||||||
1009,3,0,0,(522,539),0
|
420,7,0,1,(529,A25,530,A27,537,A27),1
|
||||||
1011,3,0,0,(521,569),0
|
448,7,0,1,(533,A24),1
|
||||||
1013,3,0,0,(565,A7),0
|
462,9,0,1,(513,A29),1
|
||||||
|
476,9,0,1,(538,A23),1
|
||||||
|
497,9,0,4,(531,A19),1
|
||||||
|
600,7,0,1,(521,A8),1
|
||||||
0
|
0
|
||||||
|
/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
112
configcapde.cfg
Normal file
112
configcapde.cfg
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
/******************************************
|
||||||
|
/ fichier de configuration de signaux complexes
|
||||||
|
/ cap de bouheyre avec signaux - 2018
|
||||||
|
/****************************************
|
||||||
|
/ 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
|
||||||
|
/ si 1 envoie un 0 après le pilotage des décodeurs LEB
|
||||||
|
RazSignaux=0
|
||||||
|
/
|
||||||
|
/ modélisation des aiguillages : détermine les éléments connectés aux 3 branches des aiguilles (Pointe, Droit, Dévié (S)
|
||||||
|
/ adresse d'aiguillage[B],P=élément vers pointe D=élément vers Droit, S=élément vers dévié
|
||||||
|
/ B pour adresse d'aiguillage déja utilisée
|
||||||
|
/ Elément = détecteur (valeur uniquement numérique) ou aiguillage (adresse [TRI,TJS,TJD]+branche de connexion (P S ou D)
|
||||||
|
/ Exemples : 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
|
||||||
|
/ Voir la documentation des signaux complexes pour une description complete
|
||||||
|
/ S'il n'y a pas de détecteur connecté à une branche d'aiguillage, mettre 0.
|
||||||
|
1,P2P,D3P,S1BS
|
||||||
|
1B,P553,D16P,S1S
|
||||||
|
2,P1P,D4P,S2BS
|
||||||
|
2B,P521,D16D,S2S
|
||||||
|
3,P1D,D522,S5BP
|
||||||
|
4,P2D,D554,S6BP
|
||||||
|
5,P9P,S15P,D5BS
|
||||||
|
5B,P3S,S5D,D545
|
||||||
|
6,P10P,S546,D6BS
|
||||||
|
6B,P4S,D545,S6D
|
||||||
|
7,P15S,D566,S565
|
||||||
|
8,P20P,D566,S565
|
||||||
|
9,P5P,D530,S17P
|
||||||
|
10,P6P,D530,S18P
|
||||||
|
13,P17S,D563,S564
|
||||||
|
14,P18S,D563,S564
|
||||||
|
15,P5S,D546,S7P
|
||||||
|
16,P1BD,S16BS,D2BD
|
||||||
|
16B,P0,S16S,D557
|
||||||
|
17,P9S,D531,S13P
|
||||||
|
18,P10S,D562,S14P
|
||||||
|
20,P8P,D547,S0
|
||||||
|
21,P25P,S537,D23S
|
||||||
|
22,P24P,S561,D25S
|
||||||
|
23,P569,S21D,D538
|
||||||
|
24,P22P,S26P,D513
|
||||||
|
25,P21P,S22D,D570
|
||||||
|
26,P24S,S515,D514
|
||||||
|
28,P30P,S29P,D570
|
||||||
|
29,P28S,D516,S31P
|
||||||
|
30,P28P,D32S,S539
|
||||||
|
31TRI,27,P28S,D518,S0,S2-517
|
||||||
|
32,P571,D538,S30D
|
||||||
|
0
|
||||||
|
//
|
||||||
|
/ modélisation du réseau par branche
|
||||||
|
/ 1 ligne par branche - le sens de parcours de la description n'a pas d'importance.
|
||||||
|
/ Chaque ligne (branche) doit comporter au moins un détecteur et au moins aiguillage
|
||||||
|
/ @ détecteur A=@aiguillage
|
||||||
|
/ chaque ligne doit commencer par un aiguillage et se terminer par un aiguillage
|
||||||
|
/ Terminer par les brances par 0
|
||||||
|
/ Exemple : 519 est un détecteur - A2 est l'aiguillage 2 - A1B est l'aiguillage 1bis
|
||||||
|
/
|
||||||
|
/ rouge - jaune
|
||||||
|
A20,547,561,A22,A24,A26,515,518,A31,A29,A28,A30,539,522,A3,A1,A2,A4,A6B,545,A5B,A3
|
||||||
|
A26,514,517,A31
|
||||||
|
A26,515,518,A31
|
||||||
|
A24,513,516,A29
|
||||||
|
/grande boucle extérieure départ de couche rouge: de 569 à 569
|
||||||
|
A23,538,A32,571,553,A1B,A16,A2B,521,569,A23
|
||||||
|
/ grande boucle intérieure
|
||||||
|
A21,A25,570,A28
|
||||||
|
A4,554,537,A21
|
||||||
|
/ couche jaune
|
||||||
|
A10,530,A9,A5,A15,546,A6
|
||||||
|
A18,562,531,A17
|
||||||
|
A14,563,A13
|
||||||
|
A14,564,A13
|
||||||
|
/
|
||||||
|
A7,565,A8
|
||||||
|
A7,566,A8
|
||||||
|
A16B,557,0
|
||||||
|
0
|
||||||
|
/
|
||||||
|
/ liste des signaux
|
||||||
|
/ 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=feu virtuel 1=digital Bahn 2=CDF 3=LDT 4=LEB
|
||||||
|
/ 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)
|
||||||
|
/ 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)]
|
||||||
|
161,4,0,4,(538,A32),0
|
||||||
|
169,9,0,4,(539,A30),0,
|
||||||
|
177,9,0,4,(569,A23),0
|
||||||
|
185,4,0,4,(570,A25),0
|
||||||
|
193,4,0,4,(516,A29),0
|
||||||
|
201,2,0,4,(517,31TRI,518,31TRI),0
|
||||||
|
209,9,0,4,(561,547),0
|
||||||
|
217,2,0,4,(514,A26,515,A26),0
|
||||||
|
225,9,0,4,(516,A29),0
|
||||||
|
233,4,0,4,(547,A20),0
|
||||||
|
1001,3,0,0,(537,554),0
|
||||||
|
1003,3,0,0,(553,A1B),0
|
||||||
|
1005,3,0,0,(571,553),0
|
||||||
|
1007,3,0,0,(554,A4),0
|
||||||
|
1009,3,0,0,(522,539),0
|
||||||
|
1011,3,0,0,(521,569),0
|
||||||
|
1013,3,0,0,(565,A7),0
|
||||||
|
0
|
||||||
109
configgily.cfg
109
configgily.cfg
@@ -1,109 +0,0 @@
|
|||||||
/******************************************
|
|
||||||
/ fichier de configuration de signaux_complexes
|
|
||||||
/ gily - f1iwq - 2018
|
|
||||||
/******************************************
|
|
||||||
/ 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
|
|
||||||
/
|
|
||||||
/ modélisation des aiguillages : détermine les éléments connectés aux 3 branches des aiguilles (Pointe, Droit, Dévié (S)
|
|
||||||
/ 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,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.
|
|
||||||
1,P518,S3P,D523,30
|
|
||||||
2,P12S,S5S,D519
|
|
||||||
3,P1S,S5D,D4P
|
|
||||||
4,P3D,S514,D6S
|
|
||||||
5,P515,S2S,D3S
|
|
||||||
6,P516,S4D,D0
|
|
||||||
7,P527,S520,D519
|
|
||||||
8,P527,S522,D521
|
|
||||||
9,P526,S515,D513,60
|
|
||||||
10,P19P,S528,D29P,30
|
|
||||||
11,P18P,D30D,S525
|
|
||||||
12,P517,D20S,S2P
|
|
||||||
17,P525,D535,S528
|
|
||||||
18,P11P,S517,D23P
|
|
||||||
19,P10P,S531,D22P
|
|
||||||
20,P520,D21P,S12D
|
|
||||||
21,P20D,S28D,D28D
|
|
||||||
22,P19D,S538,D537
|
|
||||||
23,P18D,S534,D538
|
|
||||||
24,P538,S533,D32S
|
|
||||||
25,P31S,D529,S27P
|
|
||||||
26TJD,D530,S529,P28
|
|
||||||
28TJD,D21D,S21S,P26
|
|
||||||
27,P25S,D530,S537
|
|
||||||
29,P10D,S30S,D513,60
|
|
||||||
30,P524,S29D,D11D
|
|
||||||
31,P534,S25P,D0
|
|
||||||
32,P22S,S24D,D0
|
|
||||||
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 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
|
|
||||||
/
|
|
||||||
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 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.
|
|
||||||
/ la liste doit être terminée par une adresse à 0
|
|
||||||
/ 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)
|
|
||||||
/ type de décodeur : 1=digital Bahn 2=CDF 3=LDT 4=LEB
|
|
||||||
/ Notation de chaque ligne:
|
|
||||||
/ 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é]
|
|
||||||
176,7,0,1,(520,A20),1
|
|
||||||
190,7,0,1,(523,526),1
|
|
||||||
204,9,0,1,(527,A7),1
|
|
||||||
218,7,0,1,(525,A17),1
|
|
||||||
232,2,1,1,(516,A6),1
|
|
||||||
260,9,1,1,(518,A1),1
|
|
||||||
274,3,0,1,(524,521),1
|
|
||||||
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
|
|
||||||
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,1,(521,A8),1
|
|
||||||
0
|
|
||||||
/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
BIN
verif_version.dcu
Normal file
BIN
verif_version.dcu
Normal file
Binary file not shown.
35
verif_version.dfm
Normal file
35
verif_version.dfm
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
object FormVersion: TFormVersion
|
||||||
|
Left = 500
|
||||||
|
Top = 341
|
||||||
|
Width = 468
|
||||||
|
Height = 194
|
||||||
|
Caption = 'V'#233'rification de version'
|
||||||
|
Color = clBtnFace
|
||||||
|
Font.Charset = ANSI_CHARSET
|
||||||
|
Font.Color = clBlack
|
||||||
|
Font.Height = -16
|
||||||
|
Font.Name = 'Arial Narrow'
|
||||||
|
Font.Style = []
|
||||||
|
OldCreateOrder = False
|
||||||
|
Position = poScreenCenter
|
||||||
|
OnCreate = FormCreate
|
||||||
|
PixelsPerInch = 96
|
||||||
|
TextHeight = 20
|
||||||
|
object Memo1: TMemo
|
||||||
|
Left = 16
|
||||||
|
Top = 32
|
||||||
|
Width = 425
|
||||||
|
Height = 105
|
||||||
|
Font.Charset = ANSI_CHARSET
|
||||||
|
Font.Color = clBlack
|
||||||
|
Font.Height = -12
|
||||||
|
Font.Name = 'Arial Narrow'
|
||||||
|
Font.Style = []
|
||||||
|
ParentFont = False
|
||||||
|
ScrollBars = ssVertical
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
object TimerVerif: TTimer
|
||||||
|
OnTimer = TimerVerifTimer
|
||||||
|
end
|
||||||
|
end
|
||||||
201
verif_version.pas
Normal file
201
verif_version.pas
Normal file
@@ -0,0 +1,201 @@
|
|||||||
|
unit verif_version;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||||
|
Dialogs, StdCtrls , ComCtrls ,WinInet, ExtCtrls;
|
||||||
|
|
||||||
|
type
|
||||||
|
TFormVersion = class(TForm)
|
||||||
|
TimerVerif: TTimer;
|
||||||
|
Memo1: TMemo;
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure TimerVerifTimer(Sender: TObject);
|
||||||
|
private
|
||||||
|
{ Déclarations privées }
|
||||||
|
public
|
||||||
|
{ Déclarations publiques }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
FormVersion: TFormVersion;
|
||||||
|
Lance_verif : integer;
|
||||||
|
|
||||||
|
Const Version='1.02';// sert à la comparaison de la version publiée
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Procedure Aff(s : string);
|
||||||
|
begin
|
||||||
|
FormVersion.Memo1.lines.add(s);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function GetCurrentProcessEnvVar(const VariableName: string): string;
|
||||||
|
var
|
||||||
|
nSize: DWord;
|
||||||
|
begin
|
||||||
|
nSize:= 0;
|
||||||
|
nSize:= GetEnvironmentVariable(PChar(VariableName), nil, nSize);
|
||||||
|
if nSize = 0 then
|
||||||
|
begin
|
||||||
|
result:= '';
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
SetLength(result, nSize - 1);
|
||||||
|
if GetEnvironmentVariable(PChar(VariableName), PChar(result), nSize) <> nSize - 1 then
|
||||||
|
raise Exception.Create(SysErrorMessage(GetlastError))
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function DownloadURL_NOCache(aUrl: string;s : string): Boolean;
|
||||||
|
var
|
||||||
|
hSession: HINTERNET;
|
||||||
|
hService: HINTERNET;
|
||||||
|
Fs:TFileStream;
|
||||||
|
lpBuffer: array[0..1024 + 1] of byte;
|
||||||
|
dwBytesRead: DWORD;
|
||||||
|
begin
|
||||||
|
Result:=False;
|
||||||
|
|
||||||
|
Try Fs:=TFileStream.Create(s,fmCreate);
|
||||||
|
hSession:=InternetOpen('MyApp', INTERNET_OPEN_TYPE_PRECONFIG, nil, nil, 0);
|
||||||
|
try
|
||||||
|
if Assigned(hSession) then
|
||||||
|
begin
|
||||||
|
hService:=InternetOpenUrl(hSession, PChar(aUrl), nil, 0, INTERNET_FLAG_RELOAD, 0);
|
||||||
|
if Assigned(hService) then
|
||||||
|
try
|
||||||
|
while True do
|
||||||
|
begin
|
||||||
|
dwBytesRead:=1024;
|
||||||
|
InternetReadFile(hService,@lpBuffer,1024,dwBytesRead);
|
||||||
|
fs.WriteBuffer(lpBuffer, dwBytesRead);
|
||||||
|
if dwBytesRead=0 then break;
|
||||||
|
end;
|
||||||
|
Result:=True;
|
||||||
|
finally
|
||||||
|
InternetCloseHandle(hService);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
InternetCloseHandle(hSession);
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
fs.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure verifie_version;
|
||||||
|
var s,s2,s3,Version_p,Url,LocalFile : string;
|
||||||
|
trouve_version,trouve_zip : boolean;
|
||||||
|
fichier : text;
|
||||||
|
i,j : integer;
|
||||||
|
V_publie,V_utile : real;
|
||||||
|
begin
|
||||||
|
Url:='http://cdmrail.free.fr/ForumCDR/viewtopic.php?f=77&t=3906#p50499';
|
||||||
|
LocalFile:='page.txt';
|
||||||
|
trouve_version:=false;
|
||||||
|
trouve_zip:=false;
|
||||||
|
if DownloadURL_NOCache(Url,localFile) then
|
||||||
|
begin
|
||||||
|
AssignFile(fichier,LocalFile);
|
||||||
|
reset(fichier);
|
||||||
|
while not(eof(fichier)) and (not(trouve_version) or not(trouve_zip)) do
|
||||||
|
begin
|
||||||
|
readln(fichier,s);
|
||||||
|
s:=LowerCase(s);
|
||||||
|
if not(trouve_version) then
|
||||||
|
begin
|
||||||
|
i:=pos('version ',s);
|
||||||
|
trouve_version:=i<>0;
|
||||||
|
if trouve_version then s2:=s;
|
||||||
|
end;
|
||||||
|
if not(trouve_zip) then
|
||||||
|
begin
|
||||||
|
i:=pos('.zip',s);
|
||||||
|
trouve_zip:=i<>0;
|
||||||
|
if trouve_zip then s3:=s;
|
||||||
|
end;
|
||||||
|
// Aff(s)
|
||||||
|
end;
|
||||||
|
closefile(fichier);
|
||||||
|
if trouve_version then
|
||||||
|
begin
|
||||||
|
// isoler le champ version
|
||||||
|
i:=pos('version ',s2);
|
||||||
|
delete(s2,1,i+7);
|
||||||
|
j:=pos(' ',s2);
|
||||||
|
Version_p:=copy(s2,1,j-1); // version dans version_p
|
||||||
|
// isoler l'url du zip
|
||||||
|
i:=pos('href="',s3);
|
||||||
|
delete(s3,1,i+5);
|
||||||
|
j:=pos('"',s3);
|
||||||
|
s3:=copy(s3,1,j-1);
|
||||||
|
i:=pos('.',s3);
|
||||||
|
if i<>0 then delete(s3,i,1); // supprimer le .
|
||||||
|
s3:='http://cdmrail.free.fr/ForumCDR'+s3 ;
|
||||||
|
//aff(s3); // lien dans s3
|
||||||
|
|
||||||
|
// changer le . en ,
|
||||||
|
s:=Version_p;
|
||||||
|
i:=pos('.',s);if i<>0 then s[i]:=',';
|
||||||
|
s2:=version;
|
||||||
|
i:=pos('.',s2);if i<>0 then s2[i]:=',';
|
||||||
|
|
||||||
|
V_publie:=StrToFloat(s);
|
||||||
|
V_utile:=StrToFloat(s2);
|
||||||
|
if V_utile<V_publie then
|
||||||
|
begin
|
||||||
|
FormVersion.show;
|
||||||
|
s:='Vous utilisez la version '+version+' mais il existe la version '+Version_p;
|
||||||
|
Aff(s);
|
||||||
|
if MessageDlg(s+' Voulez-vous la télécharger?',mtConfirmation,[mbYes,mbNo],0)=mrYes then
|
||||||
|
begin
|
||||||
|
s:=GetCurrentProcessEnvVar('USERPROFILE')+'\Downloads\Signaux_Complexes_GL.Zip';
|
||||||
|
Aff('Téléchargement de '+s3+' dans ');
|
||||||
|
Aff(s);
|
||||||
|
|
||||||
|
if DownloadURL_NOCache(s3,s) then
|
||||||
|
begin
|
||||||
|
Aff('Téléchargement réussi');
|
||||||
|
Aff('Vous pouvez ouvrir le dossier de téléchargement, décomprimer le zip et l''installer');
|
||||||
|
end
|
||||||
|
else Aff('Echec de téléchargement');
|
||||||
|
end
|
||||||
|
else formVersion.Free;
|
||||||
|
end;
|
||||||
|
|
||||||
|
//if V_utile=V_publie then Affiche('Version Actuelle=Version publiée : votre version est à jour',clLime);
|
||||||
|
|
||||||
|
end;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
//Aff('Pas d''accès au site CDM rail');
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TFormVersion.FormCreate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Timerverif.Interval:=1000;
|
||||||
|
Lance_verif:=2;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TFormVersion.TimerVerifTimer(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if lance_verif>0 then dec(lance_verif);
|
||||||
|
if lance_verif=1 then verifie_version;
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
||||||
|
|
||||||
Reference in New Issue
Block a user