verification automatique des versions
This commit is contained in:
@@ -16,7 +16,7 @@ interface
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, StdCtrls, OleCtrls, ExtCtrls, jpeg, ComCtrls,
|
||||
ImgList, ScktComp, StrUtils, Menus, ActnList, MSCommLib_TLB ;
|
||||
ImgList, ScktComp, StrUtils, Menus, ActnList, MSCommLib_TLB;
|
||||
|
||||
type
|
||||
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. **/
|
||||
// code des aspects des signaux
|
||||
const
|
||||
AF='Client TCP-IP CDM Rail ou USB - système LENZ - Version 1.01';
|
||||
|
||||
carre =0 ; carre_F=1;
|
||||
semaphore =1 ; semaphore_F=2;
|
||||
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;
|
||||
branche : array [1..100] of string;
|
||||
parcours : array[1..MaxElParcours] of TBranche ; // parcours des locos en fonction des détecteurs
|
||||
|
||||
|
||||
const
|
||||
ClBleuClair=$FF7070 ;
|
||||
Cyan=$FFA0A0;
|
||||
@@ -215,7 +215,7 @@ var
|
||||
ack,portCommOuvert,trace,AffMem,AfficheDet,Bis,CDM_connecte,parSocketCDM,
|
||||
DebugOuv : boolean;
|
||||
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,
|
||||
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
|
||||
@@ -265,7 +265,7 @@ var
|
||||
|
||||
implementation
|
||||
|
||||
uses UnitDebug;
|
||||
uses UnitDebug, verif_version;
|
||||
|
||||
procedure menu_interface(MA : TMA);
|
||||
var val : boolean;
|
||||
@@ -637,6 +637,9 @@ begin
|
||||
until (temps<=0);
|
||||
end;
|
||||
|
||||
|
||||
|
||||
|
||||
// envoi d'une chaîne à la centrale par USBLenz ou socket, puis attend l'ack ou le nack
|
||||
function envoi(s : string) : boolean;
|
||||
var temps : integer;
|
||||
@@ -1128,9 +1131,12 @@ envoie les donn
|
||||
18. rappel 60 + avertissement clignotant
|
||||
|
||||
/*===========================================================================*)
|
||||
procedure envoi_NMRA(adresse,code : integer);
|
||||
var valeur : integer ;
|
||||
procedure envoi_NMRA(adresse: integer);
|
||||
var valeur,index,code : integer ;
|
||||
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
|
||||
begin
|
||||
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"
|
||||
if (tracesign) then Affiche('Signal virtuel: '+intToSTR(adresse)+' Etat '+etatSign[aspect],clyellow);
|
||||
end;
|
||||
dessine_feu(adresse);
|
||||
end;
|
||||
|
||||
(*==========================================================================
|
||||
@@ -2166,7 +2173,7 @@ begin
|
||||
signalCplx:=feux[i].adresse;
|
||||
if not(ferme) and (signalCplx<>0) then
|
||||
begin
|
||||
case feux[i].decodeur of
|
||||
case feux[i].decodeur of
|
||||
0 : envoi_virtuel(signalCplx);
|
||||
1 : envoi_signalBahn(signalCplx);
|
||||
2 : envoi_CDF(signalCplx);
|
||||
@@ -4755,12 +4762,19 @@ begin
|
||||
begin
|
||||
pIsWow64Process(GetCurrentProcess,IsWow64);
|
||||
end;
|
||||
FreeLibrary(DLL);
|
||||
end;
|
||||
Result:=IsWow64;
|
||||
end;
|
||||
{$J-}
|
||||
end;
|
||||
|
||||
|
||||
|
||||
procedure TFormPrinc.FormCreate(Sender: TObject);
|
||||
var
|
||||
i : integer;
|
||||
s,s2,Url,LocalFile : string;
|
||||
trouve,AvecMaj : Boolean;
|
||||
V_utile,V_publie : real;
|
||||
begin
|
||||
|
||||
@@ -4768,11 +4782,16 @@ begin
|
||||
TraceSign:=True;
|
||||
AF:='Client TCP-IP CDM Rail ou USB - système LENZ - Version '+Version;
|
||||
Caption:=AF;
|
||||
avecMSCom:=false;
|
||||
avecMSCom:=false;
|
||||
Application.onHint:=doHint;
|
||||
LabelEtat.Caption:='Initialisations en cours';
|
||||
LabelEtat.Caption:='Initialisations en cours';
|
||||
Menu_interface(devalide);
|
||||
|
||||
// ouvre la fenetre debug
|
||||
FormDebug:=TFormDebug.Create(Self);
|
||||
FormDebug.Caption:=AF+' debug';
|
||||
//FormDebug.Show;
|
||||
|
||||
DebugOuv:=True;
|
||||
|
||||
FormVersion:=TformVersion.Create(self);
|
||||
@@ -4850,6 +4869,7 @@ begin
|
||||
//maj_feu(201);
|
||||
//etat_signal_suivant(201,1);
|
||||
//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);
|
||||
//NivDebug:=3;
|
||||
//Affiche(IntToSTR(detecteur_suivant_El(531,false,518,false)),clyellow);
|
||||
@@ -4877,10 +4897,9 @@ begin
|
||||
end;
|
||||
|
||||
procedure TFormPrinc.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
Ferme:=true;
|
||||
begin
|
||||
Ferme:=true;
|
||||
if portCommOuvert then begin portCommOuvert:=false;MSComm1.Portopen:=false; end;
|
||||
portCommOuvert:=false;
|
||||
ClientSocketCDM.close;
|
||||
ClientSocketLenz.close;
|
||||
|
||||
Reference in New Issue
Block a user