V1.611
This commit is contained in:
BIN
UnitConfig.dcu
BIN
UnitConfig.dcu
Binary file not shown.
1591
UnitConfig.dfm
1591
UnitConfig.dfm
File diff suppressed because it is too large
Load Diff
266
UnitConfig.pas
266
UnitConfig.pas
@@ -4,7 +4,7 @@ interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, ExtCtrls, StdCtrls , verif_version ;
|
||||
Dialogs, ExtCtrls, StdCtrls , verif_version, jpeg ;
|
||||
|
||||
type
|
||||
TFormConfig = class(TForm)
|
||||
@@ -20,7 +20,7 @@ type
|
||||
EditTempoOctetUSB: TEdit;
|
||||
Label5: TLabel;
|
||||
EditTempoReponse: TEdit;
|
||||
Button1: TButton;
|
||||
ButtonAppliquerEtFermer: TButton;
|
||||
GroupBox3: TGroupBox;
|
||||
Label7: TLabel;
|
||||
EditIPLenz: TEdit;
|
||||
@@ -30,17 +30,39 @@ type
|
||||
RadioButton1: TRadioButton;
|
||||
RadioButton2: TRadioButton;
|
||||
RadioButton3: TRadioButton;
|
||||
Label6: TLabel;
|
||||
LabelInfo: TLabel;
|
||||
Button2: TButton;
|
||||
Label9: TLabel;
|
||||
Label10: TLabel;
|
||||
Label11: TLabel;
|
||||
Label12: TLabel;
|
||||
GroupBox5: TGroupBox;
|
||||
CheckVerifVersion: TCheckBox;
|
||||
CheckInfoVersion: TCheckBox;
|
||||
procedure Button1Click(Sender: TObject);
|
||||
CheckLanceCDM: TCheckBox;
|
||||
CheckAvecTCO: TCheckBox;
|
||||
EditNomLay: TEdit;
|
||||
Label13: TLabel;
|
||||
GroupBox6: TGroupBox;
|
||||
RadioButton4: TRadioButton;
|
||||
RadioButton5: TRadioButton;
|
||||
RadioButton6: TRadioButton;
|
||||
RadioButton7: TRadioButton;
|
||||
RadioButton8: TRadioButton;
|
||||
RadioButton9: TRadioButton;
|
||||
RadioButton10: TRadioButton;
|
||||
RadioButton11: TRadioButton;
|
||||
RadioButton12: TRadioButton;
|
||||
GroupBox7: TGroupBox;
|
||||
RadioButton13: TRadioButton;
|
||||
RadioButton14: TRadioButton;
|
||||
RadioButton15: TRadioButton;
|
||||
RadioButton16: TRadioButton;
|
||||
RadioButton17: TRadioButton;
|
||||
RadioButton18: TRadioButton;
|
||||
Label14: TLabel;
|
||||
Label9: TLabel;
|
||||
Label10: TLabel;
|
||||
Image1: TImage;
|
||||
procedure ButtonAppliquerEtFermerClick(Sender: TObject);
|
||||
procedure Button2Click(Sender: TObject);
|
||||
procedure FormActivate(Sender: TObject);
|
||||
private
|
||||
@@ -212,7 +234,193 @@ begin
|
||||
config_com:=not( (copy(sa,1,3)<>'COM') or (NumPort>9) or (protocole=-1) or (protocole>4) or (i=0) );
|
||||
end;
|
||||
|
||||
procedure TFormConfig.Button1Click(Sender: TObject);
|
||||
// modifie les fichiers de config en fonction du paramétrage
|
||||
procedure genere_config2;
|
||||
var s: string;
|
||||
fichier,fichierN : text;
|
||||
i : integer;
|
||||
continue : boolean;
|
||||
|
||||
// lit une ligne du fichier source "fichier", si c'est une ligne de commentaire, copie jusqu'à ne plus rencontrer
|
||||
// de ligne commentaire, et retourne la ligne en sortie
|
||||
function copie_commentaire : string ;
|
||||
var c : char;
|
||||
begin
|
||||
repeat
|
||||
readln(fichier,s);
|
||||
//Affiche(s,clWhite);
|
||||
if length(s)>0 then c:=s[1];
|
||||
if c='/' then writeln(fichierN,s); // copie le commentaire
|
||||
until ((c<>'/') and (s<>'')) or eof(fichier) ;
|
||||
copie_commentaire:=s;
|
||||
end;
|
||||
|
||||
begin
|
||||
try
|
||||
assign(fichier,'client-GL.cfg');
|
||||
reset(fichier);
|
||||
except
|
||||
Affiche('Fichier client-gl.cfg non trouvé',clred);
|
||||
exit;
|
||||
end;
|
||||
|
||||
assign(fichierN,'client-GL.tmp');
|
||||
rewrite(fichierN);
|
||||
|
||||
// entête
|
||||
copie_commentaire;
|
||||
// taille de la fonte
|
||||
writeln(fichierN,TailleFonte);
|
||||
copie_commentaire;
|
||||
|
||||
// adresse ip et port de CDM
|
||||
writeln(fichierN,adresseIPCDM+':'+intToSTR(portCDM));
|
||||
copie_commentaire;
|
||||
|
||||
// adresse ip interface XpressNet
|
||||
writeln(fichierN,adresseIP+':'+intToSTR(port));
|
||||
copie_commentaire;
|
||||
|
||||
// port com
|
||||
writeln(fichierN,portcom);
|
||||
copie_commentaire;
|
||||
|
||||
// temporisation caractère TempoOctet
|
||||
writeln(fichierN,IntToSTR(TempoOctet));
|
||||
copie_commentaire;
|
||||
|
||||
// temporisation attente maximale interface
|
||||
writeln(fichierN,IntToSTR(TimoutMaxInterface));
|
||||
copie_commentaire;
|
||||
|
||||
// entete Valeur_entete
|
||||
writeln(fichierN,intToSTR(Valeur_entete));
|
||||
copie_commentaire;
|
||||
|
||||
// avec ou sans initialisation des aiguillages
|
||||
writeln(fichierN,IntToSTR(AvecInitAiguillages));
|
||||
copie_commentaire;
|
||||
|
||||
writeln(fichierN,s);
|
||||
// valeurs des initialisations
|
||||
repeat
|
||||
readln(fichier,s);
|
||||
writeln(fichierN,s);
|
||||
continue:=s[1]<>'0';
|
||||
until not(continue);
|
||||
copie_commentaire;
|
||||
|
||||
// Vérification des versions au démarrage
|
||||
if verifVersion then s:='1' else s:='0';
|
||||
writeln(fichierN,s);
|
||||
copie_commentaire;
|
||||
|
||||
// Notification de nouvelle version
|
||||
if notificationVersion then s:='1' else s:='0';
|
||||
writeln(fichierN,s);
|
||||
copie_commentaire;
|
||||
|
||||
// Avec TCO
|
||||
if AvecTCO then s:='1' else s:='0';
|
||||
writeln(fichierN,s);
|
||||
copie_commentaire;
|
||||
|
||||
// lancement de CDM
|
||||
if LanceCDM then s:='1' else s:='0';
|
||||
writeln(fichierN,s);
|
||||
copie_commentaire;
|
||||
|
||||
// Nom du LAY
|
||||
writeln(fichierN,Lay);
|
||||
copie_commentaire;
|
||||
|
||||
// Serveur d'interface de CDM
|
||||
writeln(fichierN,intToSTR(ServeurInterfaceCDM));
|
||||
copie_commentaire;
|
||||
|
||||
// Serveur de rétrosignalisation Lenz de CDM
|
||||
writeln(fichierN,intToSTR(ServeurRetroCDM));
|
||||
copie_commentaire;
|
||||
|
||||
closefile(fichier);
|
||||
closefile(fichierN);
|
||||
|
||||
try
|
||||
assign(fichier,'config.cfg');
|
||||
reset(fichier);
|
||||
except
|
||||
Affiche('Fichier config.cfg non trouvé',clred);
|
||||
exit;
|
||||
end;
|
||||
|
||||
assign(fichierN,'config.tmp');
|
||||
rewrite(fichierN);
|
||||
|
||||
// entête
|
||||
copie_commentaire;
|
||||
// 2 variables inutilisées
|
||||
writeln(fichierN,'Log=0');
|
||||
copie_commentaire;
|
||||
// fichier log
|
||||
writeln(fichierN,'TraceDet=0');
|
||||
copie_commentaire;
|
||||
// Raz Signaux
|
||||
if Raz_Acc_signaux then s:='1' else s:='0';
|
||||
writeln(fichierN,'RazSignaux='+s);
|
||||
copie_commentaire;
|
||||
|
||||
writeln(fichierN,s);
|
||||
// modélisation des aiguillages
|
||||
if s[1]<>'0' then
|
||||
repeat
|
||||
readln(fichier,s);
|
||||
writeln(fichierN,s);
|
||||
continue:=s[1]<>'0';
|
||||
until not(continue);
|
||||
copie_commentaire;
|
||||
|
||||
writeln(fichierN,s);
|
||||
// modélisation des branches de réseau
|
||||
if s[1]<>'0' then
|
||||
repeat
|
||||
readln(fichier,s);
|
||||
writeln(fichierN,s);
|
||||
continue:=s[1]<>'0';
|
||||
until not(continue);
|
||||
copie_commentaire;
|
||||
|
||||
writeln(fichierN,s);
|
||||
// modélisation des signaux
|
||||
if s[1]<>'0' then
|
||||
repeat
|
||||
readln(fichier,s);
|
||||
writeln(fichierN,s);
|
||||
continue:=s[1]<>'0';
|
||||
until not(continue);
|
||||
copie_commentaire;
|
||||
|
||||
writeln(fichierN,s);
|
||||
// Fonctions Fx
|
||||
if s[1]<>'0' then
|
||||
repeat
|
||||
readln(fichier,s);
|
||||
writeln(fichierN,s);
|
||||
continue:=s[1]<>'0';
|
||||
until not(continue);
|
||||
copie_commentaire;
|
||||
|
||||
closefile(fichier);
|
||||
closefile(fichierN);
|
||||
|
||||
deletefile('config.cfg');
|
||||
deletefile('client-GL.cfg');
|
||||
|
||||
renameFile('config.tmp','config.cfg');
|
||||
renameFile('client-GL.tmp','client-GL.cfg');
|
||||
|
||||
end;
|
||||
|
||||
procedure TFormConfig.ButtonAppliquerEtFermerClick(Sender: TObject);
|
||||
var i,erreur : integer;
|
||||
s : string;
|
||||
ChangeCDM,changeInterface,changeUSB : boolean;
|
||||
@@ -283,6 +491,28 @@ begin
|
||||
verifVersion:=CheckVerifVersion.Checked;
|
||||
notificationVersion:=CheckInfoVersion.Checked;
|
||||
|
||||
LanceCDM:=CheckLanceCDM.Checked;
|
||||
AvecTCO:=CheckAvecTCO.checked;
|
||||
Lay:=EditNomLay.Text;
|
||||
if RadioButton4.Checked then ServeurInterfaceCDM:=0;
|
||||
if RadioButton5.Checked then ServeurInterfaceCDM:=1;
|
||||
if RadioButton6.Checked then ServeurInterfaceCDM:=2;
|
||||
if RadioButton7.Checked then ServeurInterfaceCDM:=3;
|
||||
if RadioButton8.Checked then ServeurInterfaceCDM:=4;
|
||||
if RadioButton9.Checked then ServeurInterfaceCDM:=5;
|
||||
if RadioButton10.Checked then ServeurInterfaceCDM:=6;
|
||||
if RadioButton11.Checked then ServeurInterfaceCDM:=7;
|
||||
if RadioButton12.Checked then ServeurInterfaceCDM:=8;
|
||||
if RadioButton12.Checked then ServeurInterfaceCDM:=13;
|
||||
if RadioButton13.Checked then ServeurRetroCDM:=1;
|
||||
if RadioButton14.Checked then ServeurRetroCDM:=2;
|
||||
if RadioButton15.Checked then ServeurRetroCDM:=3;
|
||||
if RadioButton16.Checked then ServeurRetroCDM:=4;
|
||||
if RadioButton17.Checked then ServeurRetroCDM:=5;
|
||||
if RadioButton18.Checked then ServeurRetroCDM:=6;
|
||||
|
||||
// générer le fichier clieng-GL.cfg
|
||||
genere_config2;
|
||||
formConfig.close;
|
||||
end;
|
||||
|
||||
@@ -314,7 +544,27 @@ begin
|
||||
|
||||
CheckVerifVersion.Checked:=verifVersion;
|
||||
CheckInfoVersion.Checked:=notificationVersion;
|
||||
|
||||
CheckLanceCDM.Checked:=LanceCDM;
|
||||
CheckAvecTCO.checked:=avecTCO;
|
||||
EditNomLay.Text:=Lay;
|
||||
RadioButton4.Checked:=ServeurInterfaceCDM=0;
|
||||
RadioButton5.Checked:=ServeurInterfaceCDM=1;
|
||||
RadioButton6.Checked:=ServeurInterfaceCDM=2;
|
||||
RadioButton7.Checked:=ServeurInterfaceCDM=3;
|
||||
RadioButton8.Checked:=ServeurInterfaceCDM=4;
|
||||
RadioButton9.Checked:=ServeurInterfaceCDM=5;
|
||||
RadioButton10.Checked:=ServeurInterfaceCDM=6;
|
||||
RadioButton11.Checked:=ServeurInterfaceCDM=7;
|
||||
RadioButton12.Checked:=ServeurInterfaceCDM=8;
|
||||
RadioButton12.Checked:=ServeurInterfaceCDM=13;
|
||||
RadioButton13.Checked:=ServeurRetroCDM=1;
|
||||
RadioButton14.Checked:=ServeurRetroCDM=2;
|
||||
RadioButton15.Checked:=ServeurRetroCDM=3;
|
||||
RadioButton16.Checked:=ServeurRetroCDM=4;
|
||||
RadioButton17.Checked:=ServeurRetroCDM=5;
|
||||
RadioButton18.Checked:=ServeurRetroCDM=6;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
end.
|
||||
|
||||
BIN
UnitPrinc.dcu
BIN
UnitPrinc.dcu
Binary file not shown.
@@ -214,7 +214,7 @@ var ancien_tablo_signalCplx,EtatsignalCplx : array[0..MaxAcc] of word;
|
||||
AvecInitAiguillages,tempsCli,combine,NbreFeux,pasreponse,AdrDevie,
|
||||
NombreImages,signalCpx,branche_trouve,Indexbranche_trouve,Actuel,Signal_suivant,
|
||||
Nbre_recu_cdm,Tempo_chgt_feux,Adj1,Adj2,NbrePN,ServeurInterfaceCDM,
|
||||
ServeurRetroCDM : integer;
|
||||
ServeurRetroCDM,TailleFonte : integer;
|
||||
|
||||
Hors_tension2,traceSign,TraceZone,Ferme,parSocket,ackCdm,PremierFD,
|
||||
NackCDM,MsgSim,succes,recu_cv,AffActionneur,AffAigDet,
|
||||
@@ -3388,19 +3388,18 @@ begin
|
||||
assign(fichier,'client-GL.cfg');
|
||||
reset(fichier);
|
||||
except
|
||||
Affiche('Fichier client-gl.cfg non trouvé',clred);
|
||||
Affiche('Fichier client-gl.cfg non trouvé',clred);
|
||||
end;
|
||||
|
||||
{lecture du fichier de configuration}
|
||||
// taille de fonte
|
||||
{lecture du fichier de configuration}
|
||||
// taille de fonte
|
||||
s:=lit_ligne;
|
||||
i:=StrToINT(s);
|
||||
TailleFonte:=StrToINT(s);
|
||||
with FormPrinc.ListBox1 do
|
||||
begin
|
||||
Font.Height:=TailleFonte;
|
||||
ItemHeight:=TailleFonte+1;
|
||||
end;
|
||||
// adresse ip et port de CDM
|
||||
|
||||
// adresse ip et port de CDM
|
||||
s:=lit_ligne;
|
||||
@@ -6758,11 +6757,10 @@ begin
|
||||
|
||||
// en sortie si Lance_CDM=true, il a été lancé, sinon il était déja lancé.
|
||||
function Lance_CDM : boolean;
|
||||
var i : integer;
|
||||
var i : integer;
|
||||
s : string;
|
||||
begin
|
||||
s:='CDR';
|
||||
if (ProcessRunning(s)) then begin Lance_CDM:=false;exit;end;
|
||||
s:='CDR';
|
||||
if (ProcessRunning(s)) then begin Lance_CDM:=false;exit;end;
|
||||
|
||||
Affiche('Lancement de CDM '+lay,clyellow);
|
||||
@@ -6776,11 +6774,16 @@ begin
|
||||
Lance_CDM:=false;exit;
|
||||
end
|
||||
|
||||
else
|
||||
begin
|
||||
else
|
||||
begin
|
||||
Sleep(2000);
|
||||
Application.ProcessMessages;
|
||||
// démarre le serveur IP : Alt C , return 2 fois
|
||||
SendKey(CDMHd,ord('C'),false,true,false);
|
||||
SendKey(CDMHd,ord('C'),false,false,false);
|
||||
SendKey(CDMHd,VK_RETURN,false,false,false); // ouvre le menu
|
||||
Sleep(200); // attend l'ouverture de la fenêtre
|
||||
SendKey(CDMHd,VK_RETURN,false,false,false); // sélectionne le menu démarre le serveur IP
|
||||
SendKey(CDMHd,VK_RETURN,false,false,false); // acquitte la fentêtre
|
||||
Sleep(200);
|
||||
Application.ProcessMessages;
|
||||
@@ -6799,6 +6802,7 @@ begin
|
||||
|
||||
Affiche('Ouvre '+Lay,clyellow);
|
||||
s:=convert_VK(LAY);
|
||||
Sleep(1000);
|
||||
for i:=1 to length(s) do
|
||||
SendKey(CDMHd,ord(s[i]),false,false,false);
|
||||
SendKey(CDMHd,VK_return,false,false,false);
|
||||
@@ -6874,8 +6878,8 @@ begin
|
||||
|
||||
// créée la fenetre debug
|
||||
FormDebug:=TFormDebug.Create(Self);
|
||||
FormDebug.Caption:=AF+' debug';
|
||||
N_Trains:=0;
|
||||
FormDebug.Caption:=AF+' debug';
|
||||
N_Trains:=0;
|
||||
NivDebug:=0;
|
||||
TempoAct:=0;
|
||||
DebugOuv:=True;
|
||||
@@ -7749,27 +7753,7 @@ end;
|
||||
s:=s+')';
|
||||
end;
|
||||
end;
|
||||
Affiche(s,clYellow);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TFormPrinc.Versions1Click(Sender: TObject);
|
||||
begin
|
||||
Affiche('Version 1.0 : première version',clLime);
|
||||
Affiche('Version 1.01 : gestion des trajectoires vers les buttoirs',clLime);
|
||||
Affiche('Version 1.02 : vérification automatique des versions',clLime);
|
||||
Affiche('Version 1.1 : gestion des tableaux indicateurs de direction',clLime);
|
||||
Affiche(' gestion du décodeur de signaux Unisemaf Paco (expérimental)',clLime);
|
||||
Affiche(' changement dynamique des feux en cliquant sur son image',clLime);
|
||||
Affiche('Version 1.11 : compatibilité pour la rétrosignalisation non XpressNet (intellibox)',clLime);
|
||||
Affiche(' verrouillages routes pour trains consécutifs',clLime);
|
||||
Affiche('Version 1.2 : Renforcement de l''algorithme de suivi des trains',clLime);
|
||||
Affiche('Version 1.3 : Décodeur Unisemaf fonctionnel - Lecture/écriture des CV',clLime);
|
||||
Affiche(' Protocoles variables de l''interface',clLime);
|
||||
Affiche(' Configuration statique modifiable dans menu',clLime);
|
||||
Affiche('Version 1.31 : Correction des positions aiguillages triples et TJD',clLime);
|
||||
Affiche('Version 1.4 : Gestion des Fx vers les locomotives par actionneurs',clLime);
|
||||
Affiche('Version 1.41 : Gestion des passages à niveaux par actionneurs',clLime);
|
||||
Affiche(s,clYellow);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ var
|
||||
Lance_verif : integer;
|
||||
verifVersion,notificationVersion : boolean;
|
||||
|
||||
Const Version='1.6'; //Version='1.2';// sert à la comparaison de la version publiée
|
||||
Const Version='1.61'; //Version='1.2';// sert à la comparaison de la version publiée
|
||||
|
||||
implementation
|
||||
|
||||
|
||||
Reference in New Issue
Block a user