V2.4
This commit is contained in:
Binary file not shown.
Binary file not shown.
BIN
UnitConfig.dcu
BIN
UnitConfig.dcu
Binary file not shown.
@@ -1,6 +1,6 @@
|
||||
object FormConfig: TFormConfig
|
||||
Left = 194
|
||||
Top = 249
|
||||
Left = 228
|
||||
Top = 189
|
||||
Hint =
|
||||
'Modifie les fichiers de configuration selon les s'#233'lections chois' +
|
||||
'ies'
|
||||
@@ -1753,7 +1753,7 @@ object FormConfig: TFormConfig
|
||||
end
|
||||
object ButtonAppliquerEtFermer: TButton
|
||||
Left = 384
|
||||
Top = 464
|
||||
Top = 472
|
||||
Width = 201
|
||||
Height = 25
|
||||
Caption = 'Enregistrer la configuration et Fermer'
|
||||
@@ -1764,7 +1764,7 @@ object FormConfig: TFormConfig
|
||||
end
|
||||
object Button2: TButton
|
||||
Left = 24
|
||||
Top = 464
|
||||
Top = 472
|
||||
Width = 201
|
||||
Height = 25
|
||||
Caption = 'Fermer sans enregistrer la configuration'
|
||||
@@ -1775,8 +1775,8 @@ object FormConfig: TFormConfig
|
||||
Left = 8
|
||||
Top = 8
|
||||
Width = 585
|
||||
Height = 441
|
||||
ActivePage = TabSheetBranches
|
||||
Height = 457
|
||||
ActivePage = TabSheetAig
|
||||
Font.Charset = DEFAULT_CHARSET
|
||||
Font.Color = clBackground
|
||||
Font.Height = -11
|
||||
@@ -2120,7 +2120,7 @@ object FormConfig: TFormConfig
|
||||
ImageIndex = 1
|
||||
object Label9: TLabel
|
||||
Left = 8
|
||||
Top = 384
|
||||
Top = 400
|
||||
Width = 297
|
||||
Height = 13
|
||||
Caption = 'Ces param'#232'tres sont utilis'#233's en fonctionnement sans CDM Rail'
|
||||
@@ -2131,7 +2131,7 @@ object FormConfig: TFormConfig
|
||||
Top = 8
|
||||
Width = 297
|
||||
Height = 113
|
||||
Caption = 'Acc'#232's USB - S'#233'rie '#224' l'#39'interface vers la centrale LENZ'
|
||||
Caption = 'Acc'#232's USB/S'#233'rie '#224' l'#39'interface vers la centrale via XpressNet'
|
||||
TabOrder = 0
|
||||
object Label3: TLabel
|
||||
Left = 16
|
||||
@@ -2212,7 +2212,7 @@ object FormConfig: TFormConfig
|
||||
object RadioButton3: TRadioButton
|
||||
Left = 8
|
||||
Top = 56
|
||||
Width = 265
|
||||
Width = 273
|
||||
Height = 17
|
||||
Caption = '2 : Ent'#234'te E4 - Suffixe 0D 0D 0A (arduino XpressNet)'
|
||||
TabOrder = 2
|
||||
@@ -2223,7 +2223,7 @@ object FormConfig: TFormConfig
|
||||
Top = 216
|
||||
Width = 297
|
||||
Height = 73
|
||||
Caption = 'Acc'#232's r'#233'seau '#224' l'#39'interface vers la centrale LENZ Ethernet'
|
||||
Caption = 'Acc'#232's Ethernet '#224' l'#39'interface vers la centrale via XpressNet'
|
||||
TabOrder = 2
|
||||
object Label7: TLabel
|
||||
Left = 14
|
||||
@@ -2267,8 +2267,8 @@ object FormConfig: TFormConfig
|
||||
BevelKind = bkFlat
|
||||
BorderStyle = bsNone
|
||||
Lines.Strings = (
|
||||
'1. Port COM de l'#39'adresse USB de l'#39'interface LI-USB - '
|
||||
'LI100 - LI100F - LI101F - GENLI.'
|
||||
'1. Port COM de l'#39'adresse USB de l'#39'interface '
|
||||
'XpressNet.'
|
||||
'Attention de COM1 '#224' 9 - Si le port de l'#39'interface '
|
||||
'USB>9, il faut le changer manuellement dans le '
|
||||
'gestionnaire des p'#233'riph'#233'riques. Mettre 0 si inutilis'#233'e. '
|
||||
@@ -2335,9 +2335,16 @@ object FormConfig: TFormConfig
|
||||
Left = 8
|
||||
Top = 296
|
||||
Width = 297
|
||||
Height = 81
|
||||
Height = 89
|
||||
Caption = 'Divers'
|
||||
TabOrder = 7
|
||||
object Label32: TLabel
|
||||
Left = 14
|
||||
Top = 66
|
||||
Width = 200
|
||||
Height = 13
|
||||
Caption = 'Temporisation de s'#233'quencement d'#39'init (ms)'
|
||||
end
|
||||
object CheckBoxRazSignaux: TCheckBox
|
||||
Left = 8
|
||||
Top = 16
|
||||
@@ -2362,6 +2369,14 @@ object FormConfig: TFormConfig
|
||||
TabOrder = 1
|
||||
WordWrap = True
|
||||
end
|
||||
object EditTempoAig: TEdit
|
||||
Left = 224
|
||||
Top = 62
|
||||
Width = 41
|
||||
Height = 21
|
||||
TabOrder = 2
|
||||
Text = 'EditTempoAig'
|
||||
end
|
||||
end
|
||||
end
|
||||
object TabSheetAig: TTabSheet
|
||||
@@ -2502,9 +2517,9 @@ object FormConfig: TFormConfig
|
||||
Caption = 'LabelTJD1'
|
||||
end
|
||||
object GroupBox10: TGroupBox
|
||||
Left = 40
|
||||
Left = 8
|
||||
Top = 64
|
||||
Width = 201
|
||||
Width = 273
|
||||
Height = 73
|
||||
Caption = 'Vitesse de franchissement d'#233'vi'#233' :'
|
||||
TabOrder = 0
|
||||
@@ -2693,9 +2708,9 @@ object FormConfig: TFormConfig
|
||||
object LabelAdrSig: TLabel
|
||||
Left = 13
|
||||
Top = 20
|
||||
Width = 154
|
||||
Width = 52
|
||||
Height = 19
|
||||
Caption = 'Adresse du signal = '
|
||||
Caption = 'Signal '
|
||||
Font.Charset = ANSI_CHARSET
|
||||
Font.Color = clBlack
|
||||
Font.Height = -16
|
||||
@@ -2798,7 +2813,7 @@ object FormConfig: TFormConfig
|
||||
Top = 48
|
||||
Width = 129
|
||||
Height = 21
|
||||
ItemHeight = 0
|
||||
ItemHeight = 13
|
||||
TabOrder = 1
|
||||
OnChange = ComboBoxDecChange
|
||||
end
|
||||
@@ -2883,6 +2898,15 @@ object FormConfig: TFormConfig
|
||||
TabOrder = 10
|
||||
OnClick = CheckVerrouCarreClick
|
||||
end
|
||||
object EditAdrSig: TEdit
|
||||
Left = 72
|
||||
Top = 18
|
||||
Width = 41
|
||||
Height = 21
|
||||
TabOrder = 11
|
||||
Text = ' '
|
||||
OnChange = EditAdrSigChange
|
||||
end
|
||||
end
|
||||
object RichSig: TRichEdit
|
||||
Left = 0
|
||||
|
||||
@@ -186,6 +186,9 @@ type
|
||||
Label31: TLabel;
|
||||
RichAct: TRichEdit;
|
||||
CheckBoxInitAig: TCheckBox;
|
||||
EditAdrSig: TEdit;
|
||||
Label32: TLabel;
|
||||
EditTempoAig: TEdit;
|
||||
procedure ButtonAppliquerEtFermerClick(Sender: TObject);
|
||||
procedure Button2Click(Sender: TObject);
|
||||
procedure FormActivate(Sender: TObject);
|
||||
@@ -224,6 +227,7 @@ type
|
||||
procedure CheckRAZClick(Sender: TObject);
|
||||
procedure Edit_HGChange(Sender: TObject);
|
||||
procedure CheckInverseClick(Sender: TObject);
|
||||
procedure EditAdrSigChange(Sender: TObject);
|
||||
private
|
||||
{ Déclarations privées }
|
||||
public
|
||||
@@ -248,6 +252,7 @@ TCO_ch='TCO';
|
||||
CDM_ch='CDM';
|
||||
Serveur_interface_ch='Serveur_interface';
|
||||
fenetre_ch='Fenetre';
|
||||
Tempo_aig_ch='Tempo_Aig';
|
||||
NOTIF_VERSION_ch='NOTIF_VERSION';
|
||||
verif_version_ch='verif_version';
|
||||
Fonte_ch='Fonte';
|
||||
@@ -484,8 +489,10 @@ begin
|
||||
if c<>'Z' then s:=s+c;
|
||||
end;
|
||||
// vitesse de franchissement
|
||||
if aiguillage[i].vitesse=30 then s:=s+',30';
|
||||
if aiguillage[i].vitesse=60 then s:=s+',60';
|
||||
if aiguillage[i].vitesse=0 then s:=s+',V0';
|
||||
if aiguillage[i].vitesse=30 then s:=s+',V30';
|
||||
if aiguillage[i].vitesse=60 then s:=s+',V60';
|
||||
if aiguillage[i].inversionCDM=1 then s:=s+',I1' else s:=s+',I0';
|
||||
end
|
||||
|
||||
else
|
||||
@@ -663,6 +670,10 @@ begin
|
||||
writeln(fichierN,Init_Aig_ch+'='+s);
|
||||
copie_commentaire;
|
||||
|
||||
// temporisation initialisation des aiguillages
|
||||
writeln(fichierN,Tempo_aig_ch+'=',IntToSTR(Tempo_aig));
|
||||
copie_commentaire;
|
||||
|
||||
// plein écran
|
||||
writeln(fichierN,Fenetre_ch+'=',fenetre);
|
||||
copie_commentaire;
|
||||
@@ -844,6 +855,10 @@ begin
|
||||
changeInterface:=changeInterface or (i<>port);
|
||||
port:=i;
|
||||
|
||||
Val(editTempoAig.Text,i,erreur);
|
||||
if i>3000 then begin labelInfo.Caption:='Temporisation de séquencement incorrecte ';exit;end;
|
||||
Tempo_Aig:=i;
|
||||
|
||||
// contrôle protocole interface COM3:57600,N,8,1,2
|
||||
s:=EditComUSB.Text;
|
||||
if not(config_com(s)) then begin labelInfo.Caption:='Protocole série USB Interface incorrect';exit;end;
|
||||
@@ -969,7 +984,7 @@ begin
|
||||
EditP2.Visible:=false;
|
||||
EditP3.Visible:=false;
|
||||
EditP4.Visible:=false;
|
||||
CheckInverse.Visible:=false;
|
||||
// CheckInverse.Visible:=false;
|
||||
LabelTJD1.Visible:=false;
|
||||
LabelTJD2.Visible:=false;
|
||||
EditDevieS2.Visible:=false;
|
||||
@@ -994,6 +1009,7 @@ begin
|
||||
EditPortCDM.Text:=IntToSTR(portCDM);
|
||||
EditIPLenz.text:=AdresseIP;
|
||||
EditportLenz.text:=IntToSTR(Port);
|
||||
EditTempoAig.Text:=IntToSTR(Tempo_Aig);
|
||||
EditComUSB.Text:=PortCom;
|
||||
EditTempoOctetUSB.text:=IntToSTR(TempoOctet);
|
||||
EditTempoReponse.Text:=IntToSTR(TimoutMaxInterface);
|
||||
@@ -1257,12 +1273,16 @@ begin
|
||||
EditP2.Visible:=false;
|
||||
EditP3.Visible:=false;
|
||||
EditP4.Visible:=false;
|
||||
CheckInverse.Visible:=false;
|
||||
// CheckInverse.Visible:=false;
|
||||
labelTJD1.Visible:=false;
|
||||
LabelTJD2.Visible:=false;
|
||||
EditDevieS2.Visible:=false;
|
||||
Label18.Visible:=false;
|
||||
tjd:=false;
|
||||
CheckInverse.checked:=aiguillage[adresse].inversionCDM=1;
|
||||
if aiguillage[adresse].vitesse=0 then begin RadioButtonSans.checked:=true;RadioButton30kmh.checked:=false;RadioButton60kmh.checked:=false;end;
|
||||
if aiguillage[adresse].vitesse=30 then begin RadioButtonSans.checked:=false;RadioButton30kmh.checked:=true;RadioButton60kmh.checked:=false;end;
|
||||
if aiguillage[adresse].vitesse=60 then begin RadioButtonSans.checked:=false;RadioButton30kmh.checked:=false;RadioButton60kmh.checked:=true;end;
|
||||
end;
|
||||
end;
|
||||
// affiche(s,clOrange);
|
||||
@@ -1370,8 +1390,7 @@ begin
|
||||
|
||||
RE_ColorLine(Formconfig.RichSig,ligneCliquee,Clyellow);
|
||||
|
||||
ss:='Signal '+InttoSTr(Adresse);
|
||||
formconfig.LabelAdrSig.Caption:= ss;
|
||||
FormConfig.EditAdrSig.text:=InttoSTr(Adresse);
|
||||
i:=Index_feu(adresse);
|
||||
with formconfig.ImageSignal do
|
||||
begin
|
||||
@@ -2359,6 +2378,25 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TFormConfig.EditAdrSigChange(Sender: TObject);
|
||||
var s : string;
|
||||
i, erreur : integer;
|
||||
begin
|
||||
if clicliste then exit;
|
||||
|
||||
if FormConfig.PageControl.ActivePage=FormConfig.TabSheetSig then
|
||||
with Formconfig do
|
||||
begin
|
||||
s:=EditAdrSig.Text;
|
||||
Val(s,i,erreur);
|
||||
if erreur<>0 then begin LabelInfo.caption:='Erreur adresse signal ';exit;end;
|
||||
LabelInfo.caption:=' ';
|
||||
feux[lignecliquee+1].Adresse:=i;
|
||||
s:=encode_sig(lignecliquee+1);
|
||||
RichSig.Lines[lignecliquee]:=s;
|
||||
feux[lignecliquee+1].modifie:=true;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
|
||||
BIN
UnitDebug.dcu
BIN
UnitDebug.dcu
Binary file not shown.
@@ -99,7 +99,6 @@ var
|
||||
NbEl : integer;
|
||||
Det : array[1..3] of integer; // tableau des evts détecteurs par train
|
||||
end;
|
||||
// tick 1/10s,détecteur
|
||||
N_Event_tick : integer ; // dernier index
|
||||
|
||||
// tableau des évènements détecteurs et aiguillages
|
||||
|
||||
BIN
UnitPilote.dcu
BIN
UnitPilote.dcu
Binary file not shown.
@@ -31,17 +31,30 @@ object FormPilote: TFormPilote
|
||||
end
|
||||
object ImagePilote: TImage
|
||||
Left = 208
|
||||
Top = 64
|
||||
Top = 48
|
||||
Width = 113
|
||||
Height = 129
|
||||
end
|
||||
object LabelNbFeux: TLabel
|
||||
Left = 208
|
||||
Top = 208
|
||||
Top = 224
|
||||
Width = 120
|
||||
Height = 13
|
||||
Caption = 'Nombre de feux '#224' allumer'
|
||||
end
|
||||
object LabelDec: TLabel
|
||||
Left = 216
|
||||
Top = 192
|
||||
Width = 72
|
||||
Height = 19
|
||||
Caption = 'LabelDec'
|
||||
Font.Charset = ANSI_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -16
|
||||
Font.Name = 'Arial'
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object GroupBox1: TGroupBox
|
||||
Left = 8
|
||||
Top = 40
|
||||
|
||||
@@ -31,6 +31,7 @@ type
|
||||
ButtonPilote: TButton;
|
||||
EditNbreFeux: TEdit;
|
||||
LabelNbFeux: TLabel;
|
||||
LabelDec: TLabel;
|
||||
procedure RadioVertClick(Sender: TObject);
|
||||
procedure RadioVertCliClick(Sender: TObject);
|
||||
procedure RadioJauneClick(Sender: TObject);
|
||||
@@ -211,11 +212,14 @@ begin
|
||||
end;
|
||||
|
||||
procedure TFormPilote.FormCreate(Sender: TObject);
|
||||
var i : integer;
|
||||
var i,d : integer;
|
||||
begin
|
||||
radioVert.Checked:=false;
|
||||
radioVertCli.Checked:=false;
|
||||
i:=index_feu(AdrPilote);
|
||||
d:=feux[i].decodeur;
|
||||
//labelDec.Caption:=decodeur[d];
|
||||
//Affiche(decodeur[d],clred);
|
||||
|
||||
end;
|
||||
|
||||
@@ -259,4 +263,5 @@ if ord(Key) = VK_RETURN then
|
||||
end;
|
||||
|
||||
|
||||
|
||||
end.
|
||||
|
||||
BIN
UnitPrinc.dcu
BIN
UnitPrinc.dcu
Binary file not shown.
@@ -1235,7 +1235,7 @@ object FormPrinc: TFormPrinc
|
||||
Top = 24
|
||||
Width = 49
|
||||
Height = 21
|
||||
Hint = 'Adresse accessoire ou de CV'
|
||||
Hint = 'Adresse accessoire'
|
||||
TabOrder = 0
|
||||
Text = '1'
|
||||
end
|
||||
|
||||
236
UnitPrinc.pas
236
UnitPrinc.pas
@@ -194,13 +194,12 @@ type TBranche = record
|
||||
end;
|
||||
|
||||
Taiguillage = record
|
||||
objet : integer; // objet dans CDM rail
|
||||
modele : integer; // 0=n'existe pas 1=aiguillage 2=TJD 3=TJS 4=aiguillage triple
|
||||
position, // position actuelle : 1=dévié 2=droit (positions centrale lenz)
|
||||
position, // position actuelle : 1=dévié 2=droit (centrale LENZ)
|
||||
Adrtriple, // 2eme adresse pour un aiguillage triple
|
||||
temps, // temps de pilotage (durée de l'impulsion en x 100 ms)
|
||||
inversion : integer; // pilotage inversé pour la commande (en mode sans CDM) 0=normal 1=inversé (positionné dans fichier config_gl section_init
|
||||
InversionCDM : integer ; // inversion pour les aiguillages en lecture (paramètre I)
|
||||
InversionCDM : integer ; // inversion pour les aiguillages en lecture (paramètre I1)
|
||||
vitesse : integer; // vitesse de franchissement de l'aiguillage en position déviée (60 ou 90)
|
||||
|
||||
ADroit : integer ; // (TJD:identifiant extérieur) connecté sur la position droite en talon
|
||||
@@ -234,7 +233,7 @@ TMA = (valide,devalide);
|
||||
|
||||
var
|
||||
ancien_tablo_signalCplx,EtatsignalCplx : array[0..MaxAcc] of word;
|
||||
tempsCli,NbreFeux,pasreponse,AdrDevie,fenetre,
|
||||
tempsCli,NbreFeux,pasreponse,AdrDevie,fenetre,Tempo_Aig,
|
||||
NombreImages,signalCpx,branche_trouve,Indexbranche_trouve,Actuel,Signal_suivant,
|
||||
Nbre_recu_cdm,Tempo_chgt_feux,Adj1,Adj2,NbrePN,ServeurInterfaceCDM,
|
||||
ServeurRetroCDM,TailleFonte,Nb_Det_Dist : integer;
|
||||
@@ -360,6 +359,7 @@ procedure connecte_USB;
|
||||
procedure deconnecte_usb;
|
||||
function IsWow64Process: Boolean;
|
||||
procedure Dessine_feu_mx(CanvasDest : Tcanvas;x,y : integer;FrX,frY : real;adresse : integer;orientation : integer);
|
||||
procedure Pilote_acc0_X(adresse : integer;octet : byte);
|
||||
procedure pilote_acc(adresse : integer;octet : byte;Acc : TAccessoire);
|
||||
function etat_signal_suivant(Adresse,rang : integer) : integer;
|
||||
function suivant_alg3(prec : integer;typeELprec : integer;var actuel : integer;typeElActuel : integer;alg : integer) : integer;
|
||||
@@ -1086,7 +1086,7 @@ function Index_feu(adresse : integer) : integer;
|
||||
var i : integer;
|
||||
trouve : boolean;
|
||||
begin
|
||||
i:=1;
|
||||
i:=1;
|
||||
repeat
|
||||
trouve:=feux[i].adresse=adresse;
|
||||
if not(trouve) then inc(i);
|
||||
@@ -1121,7 +1121,6 @@ Procedure TFormprinc.ImageOnClick(Sender : Tobject);
|
||||
var s : string;
|
||||
P_image_pilote : Timage;
|
||||
i,erreur : integer;
|
||||
|
||||
begin
|
||||
P_image_pilote:=Sender as TImage; // récupérer l'objet image de la forme pilote
|
||||
s:=P_Image_pilote.Hint;
|
||||
@@ -1354,8 +1353,8 @@ begin
|
||||
temps:=0;
|
||||
repeat
|
||||
Application.processMessages;
|
||||
inc(temps);Sleep(100);
|
||||
until ferme or ack or nack or (temps>TimoutMaxInterface); // l'interface répond < 5s en mode normal et 1,5 mn en mode programmation
|
||||
inc(temps);Sleep(50);
|
||||
until ferme or ack or nack or (temps>(TimoutMaxInterface*3)); // l'interface répond < 5s en mode normal et 1,5 mn en mode programmation
|
||||
if not(ack) or nack then
|
||||
begin
|
||||
Affiche('Pas de réponse de l''interface',clRed);inc(pasreponse);
|
||||
@@ -1402,7 +1401,7 @@ begin
|
||||
end;
|
||||
|
||||
// prépare la chaîne de commande pour un accessoire via CDM
|
||||
Function chaine_CDM_Acc(adresse,etat1 : integer) : string;
|
||||
Function chaine_CDM_Acc(adresse,etat : integer) : string;
|
||||
var so,sx,s : string;
|
||||
begin
|
||||
{ exemple de commande envoyée au serveur pour un manoeuvrer accessoire
|
||||
@@ -1421,7 +1420,7 @@ begin
|
||||
}
|
||||
so:=place_id('C-C-01-0004-CMDACC-DCCAC');
|
||||
s:=s+'AD='+format('%.*d',[1,adresse])+';';
|
||||
s:=s+'STATE='+format('%.*d',[1,etat1])+';';
|
||||
s:=s+'STATE='+format('%.*d',[1,etat])+';';
|
||||
|
||||
sx:=format('%.*d',[2,2])+'|'; // 2 paramètres
|
||||
so:=so+ '|'+format('%.*d',[3,length(s)+length(sx)])+'|'+sx;
|
||||
@@ -1477,38 +1476,6 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
|
||||
// pilote accessoire en entrée 0->2 1->1
|
||||
procedure pilote_acc01(adresse : integer;octet : byte);
|
||||
var groupe : integer ;
|
||||
fonction : byte;
|
||||
s : string;
|
||||
begin
|
||||
// test si pilotage inversé
|
||||
if octet=0 then octet:=2;
|
||||
if aiguillage[adresse].inversion=1 then
|
||||
begin
|
||||
if octet=1 then octet:=2 else octet:=1;
|
||||
end;
|
||||
if (octet=0) or (octet>2) then exit;
|
||||
groupe:=(adresse-1) div 4;
|
||||
fonction:=((adresse-1) mod 4)*2 + (octet-1);
|
||||
// pilotage à 1
|
||||
s:=#$52+Char(groupe)+char(fonction or $88); // activer la sortie
|
||||
s:=checksum(s);
|
||||
envoi(s); // envoi de la trame et attente Ack
|
||||
sleep(10); // temps minimal pour ne pas avoir le défaut station occupée qd on pilote un signal leb
|
||||
//temps:=aiguillage[adresse].temps;if temps=0 then temps:=4;
|
||||
// si l'accessoire est un feu, fixer l tempo à 1
|
||||
//if index_feu(adresse)<>0 then temps:=1;
|
||||
|
||||
//if portCommOuvert or parSocketLenz then tempo(temps);
|
||||
// pilotage à 0 pour éteindre le pilotage de la bobine du relais
|
||||
s:=#$52+Char(groupe)+char(fonction or $80); // désactiver la sortie
|
||||
s:=checksum(s);
|
||||
envoi(s); // envoi de la trame et attente Ack
|
||||
end;
|
||||
|
||||
procedure vitesse_loco(loco : integer;vitesse : integer;sens : boolean);
|
||||
var s : string;
|
||||
begin
|
||||
@@ -1763,15 +1730,16 @@ var code,aspect,combine : word;
|
||||
s : string;
|
||||
procedure envoi5_LEB(selection :byte);
|
||||
var i : integer;
|
||||
octet : byte;
|
||||
begin
|
||||
s:='';
|
||||
for i:=0 to 4 do
|
||||
begin
|
||||
if (testBit(selection,i)) then begin pilote_acc(adresse+i,1,feu);s:=s+'1';end
|
||||
else begin pilote_acc(adresse+i,2,feu) ; s:=s+'0';end;
|
||||
//if (testBit(selection,i)) then begin pilote_acc(adresse+i,1);s:=s+'1';end
|
||||
//else begin pilote_acc(adresse+i,2) ; s:=s+'0';end;
|
||||
//Sleep(60);
|
||||
if (testBit(selection,i)) then begin octet:=1;s:=s+'1';end
|
||||
else begin octet:=2 ; s:=s+'0';end;
|
||||
Pilote_acc(adresse+i,octet,feu);
|
||||
// le décodeur LEB nécessite qu'on envoie 0 après son pilotage ; si on est en mode usb ou ethernet
|
||||
if (portCommOuvert or parSocketLenz) then Pilote_acc0_X(adresse+i,octet);
|
||||
end;
|
||||
//Affiche(inttoStr(selection),clOrange);
|
||||
//Affiche(s,clOrange);
|
||||
@@ -3407,10 +3375,10 @@ var s,sa,chaine,SOrigine: string;
|
||||
IndexBranche_trouve:=i;
|
||||
end;
|
||||
|
||||
procedure lit_config;
|
||||
procedure lit_config;
|
||||
var s,sa,chaine,SOrigine: string;
|
||||
c,paig : char;
|
||||
tec,tjd,tjs,s2,trouve,triple,debugConfig,multiple,fini,finifeux,trouve_NbDetDist,trouve_ipv4_PC,trouve_retro,
|
||||
c,paig : char;
|
||||
tec,tjd,tjs,s2,trouve,triple,debugConfig,multiple,fini,finifeux,trouve_NbDetDist,trouve_ipv4_PC,trouve_retro,
|
||||
trouve_sec_init,trouve_init_aig,trouve_lay,trouve_IPV4_INTERFACE,trouve_PROTOCOLE_SERIE,trouve_INTER_CAR,
|
||||
trouve_Tempo_maxi,trouve_Entete,trouve_tco,trouve_cdm,trouve_Serveur_interface,trouve_fenetre,
|
||||
trouve_NOTIF_VERSION,trouve_verif_version,trouve_fonte,trouve_tempo_aig : boolean;
|
||||
@@ -3460,6 +3428,7 @@ begin
|
||||
end;
|
||||
|
||||
begin
|
||||
debugConfig:=false;
|
||||
trouve_NbDetDist:=false;
|
||||
trouve_ipv4_PC:=false;
|
||||
trouve_retro:=false;
|
||||
@@ -3483,7 +3452,6 @@ begin
|
||||
Nb_Det_Dist:=3;
|
||||
// initialisation des aiguillages avec des valeurs par défaut
|
||||
for i:=1 to MaxAcc do
|
||||
begin
|
||||
begin
|
||||
Aiguillage[i].modele:=0 ; // sans existence
|
||||
Aiguillage[i].position:=const_inconnu; // position inconnue
|
||||
@@ -3491,16 +3459,17 @@ begin
|
||||
Aiguillage[i].inversion:=0;
|
||||
Aiguillage[i].inversionCDM:=0;
|
||||
end;
|
||||
for i:=1 to 1024 do
|
||||
for i:=1 to 1024 do
|
||||
begin
|
||||
Detecteur[i].etat:=false;
|
||||
Detecteur[i].etat:=false;
|
||||
Detecteur[i].train:='0';
|
||||
Ancien_detecteur[i]:=false;
|
||||
end;
|
||||
|
||||
Affiche('lecture du fichier de configuration client-GL.cfg',clyellow);
|
||||
Affiche('lecture du fichier de configuration client-GL.cfg',clyellow);
|
||||
{$I+}
|
||||
try
|
||||
try
|
||||
assign(fichier,'client-GL.cfg');
|
||||
reset(fichier);
|
||||
except
|
||||
Affiche('Erreur fatale: fichier client-gl.cfg non trouvé',clred);
|
||||
@@ -3623,6 +3592,17 @@ begin
|
||||
if i<>0 then
|
||||
begin
|
||||
inc(nv);
|
||||
trouve_fenetre:=true;
|
||||
delete(s,i,length(sa));
|
||||
val(s,fenetre,erreur);
|
||||
if fenetre=1 then Formprinc.windowState:=wsMaximized;
|
||||
end;
|
||||
|
||||
sa:=uppercase(Tempo_Aig_ch)+'=';
|
||||
i:=pos(sa,s);
|
||||
if i<>0 then
|
||||
begin
|
||||
inc(nv);
|
||||
trouve_Tempo_aig:=true;
|
||||
delete(s,i,length(sa));
|
||||
val(s,Tempo_Aig,erreur);
|
||||
@@ -3731,11 +3711,11 @@ begin
|
||||
trouve_NbDetDist:=true;
|
||||
delete(s,i,length(sa));
|
||||
i:=0;
|
||||
val(s,i,erreur);
|
||||
val(s,i,erreur);
|
||||
if i<2 then begin i:=2;Affiche('Attention '+nb_det_dist_ch+' ramené à '+IntToSTR(i),clOrange); end;
|
||||
Nb_Det_Dist:=i;
|
||||
end;
|
||||
inc(it);
|
||||
inc(it);
|
||||
|
||||
until (Nv>=19) or (it>30);
|
||||
|
||||
@@ -3750,6 +3730,7 @@ begin
|
||||
if not(trouve_init_aig) then s:=s+' '+INIT_AIG_ch;
|
||||
if not(trouve_lay) then s:=s+' '+LAY_ch;
|
||||
if not(trouve_INTER_CAR) then s:=s+' '+INTER_CAR_ch;
|
||||
if not(trouve_Tempo_maxi) then s:=s+' '+Tempo_maxi_ch;
|
||||
if not(trouve_Entete) then s:=s+' '+Entete_ch;
|
||||
if not(trouve_TCO) then s:=s+' '+TCO_ch;
|
||||
if not(trouve_CDM) then s:=s+' '+CDM_ch;
|
||||
@@ -3761,12 +3742,15 @@ begin
|
||||
if not(trouve_fonte) then s:=s+' '+fonte_ch;
|
||||
|
||||
if s<>'' then affiche(s,clred);
|
||||
|
||||
//Affiche('Valeurs d''initialisation des aiguillages',clyellow);
|
||||
|
||||
closefile(fichier);
|
||||
|
||||
Affiche('lecture du fichier de configuration config.cfg',clyellow);
|
||||
{$I+}
|
||||
try
|
||||
assign(fichier,'config.cfg');
|
||||
reset(fichier);
|
||||
except
|
||||
Affiche('Fichier config.cfg non trouvé',clred);
|
||||
@@ -3835,14 +3819,14 @@ begin
|
||||
ComptEl:=0;Compt_It:=0;Num_element:=Num_element+1;
|
||||
// préparer l'enregistrement pour la boucle de ligne
|
||||
virgule:=pos(',',s);
|
||||
if tjd then enregistrement:=s else
|
||||
begin
|
||||
enregistrement:=copy(s,1,virgule-1);
|
||||
if tjd then enregistrement:=s else
|
||||
begin
|
||||
enregistrement:=copy(s,1,virgule-1);
|
||||
delete(s,1,virgule);
|
||||
end;
|
||||
|
||||
Num_Champ:=1;
|
||||
itl:=0;
|
||||
repeat // parcoure la ligne
|
||||
if (debugConfig) then Affiche('boucle de ligne: '+s,clYellow);
|
||||
if (length(enregistrement)<>0) then
|
||||
@@ -3860,9 +3844,9 @@ begin
|
||||
virgule:=pos(',',s);if virgule=0 then virgule:=length(s)+1;
|
||||
enregistrement:=copy(s,1,virgule-1);
|
||||
delete(s,1,virgule);
|
||||
|
||||
end;
|
||||
|
||||
|
||||
if (length(enregistrement)<>0) then // section droite
|
||||
if (enregistrement[1]='D') then
|
||||
begin
|
||||
@@ -3899,6 +3883,7 @@ begin
|
||||
virgule:=pos(',',s);if virgule=0 then virgule:=length(s)+1;
|
||||
enregistrement:=copy(s,1,virgule-1);
|
||||
delete(s,1,virgule);
|
||||
end;
|
||||
end;
|
||||
|
||||
if (length(enregistrement)<>0) then
|
||||
@@ -3946,20 +3931,30 @@ begin
|
||||
if S2 and not(tec) then begin aiguillage[aig].Adevie2:=detect;aiguillage[aig].Adevie2B:=c;end;
|
||||
if S2 and tec then begin aiguillage[aig].Adevie2:=detect;aiguillage[aig].Adevie2B:='T';end;
|
||||
|
||||
virgule:=pos(',',s);if virgule=0 then virgule:=length(s)+1;
|
||||
enregistrement:=copy(s,1,virgule-1);
|
||||
delete(s,1,virgule);
|
||||
end;
|
||||
end;
|
||||
|
||||
// inversion aiguillage
|
||||
if (length(enregistrement)<>0) then
|
||||
if (Num_champ=5) then
|
||||
begin
|
||||
if (enregistrement[1]='I') then
|
||||
begin
|
||||
inc(Num_Champ);
|
||||
delete(enregistrement,1,1);
|
||||
end;
|
||||
Val(enregistrement,adr,erreur);
|
||||
Val(enregistrement,adr,erreur);
|
||||
if erreur<>0 then begin Affiche('Erreur Inversion ; ligne '+sOrigine,clred);closefile(fichier);exit;end;
|
||||
enregistrement:='';
|
||||
//Affiche(intTostr(adr),clblue);
|
||||
Aiguillage[aig].inversionCDM:=adr;
|
||||
end;
|
||||
|
||||
// si vitesse définie
|
||||
Aiguillage[aig].inversionCDM:=adr;
|
||||
if Num_Champ=4 then
|
||||
begin
|
||||
inc(num_champ);
|
||||
if (length(enregistrement)<>0) then
|
||||
@@ -3967,17 +3962,17 @@ begin
|
||||
Val(enregistrement,adr,erreur);
|
||||
if (erreur=0) or (erreur=1) then
|
||||
begin
|
||||
//Affiche('section vitesse définie aig='+intToSTR(aig)+'/'+intToSTR(adr),clyellow);
|
||||
//Affiche('section vitesse définie aig='+intToSTR(aig)+'/'+intToSTR(adr),clyellow);
|
||||
aiguillage[aig].vitesse:=adr;
|
||||
enregistrement:='';
|
||||
virgule:=pos(',',s);if virgule=0 then virgule:=length(s)+1;
|
||||
enregistrement:='';
|
||||
delete(s,1,virgule);
|
||||
virgule:=pos(',',s);if virgule=0 then virgule:=length(s)+1;
|
||||
enregistrement:=copy(s,1,virgule-1);
|
||||
delete(s,1,virgule);
|
||||
s:='';//enregistrement:='';
|
||||
end;
|
||||
end;
|
||||
inc(itl);
|
||||
until enregistrement='' ;
|
||||
end;
|
||||
until (enregistrement='') or (itl>2);
|
||||
if itl>2 then begin Affiche('Erreur 400 ligne '+sOrigine,clred);closefile(fichier);exit;end;
|
||||
end;
|
||||
until (s='0');
|
||||
@@ -6290,12 +6285,16 @@ Procedure Maj_feux;
|
||||
end;
|
||||
end;
|
||||
envoi_signauxCplx;
|
||||
end;
|
||||
|
||||
Procedure Maj_feux;
|
||||
var i : integer;
|
||||
begin
|
||||
//Affiche('MAJ FEUX',clOrange);
|
||||
if not(maj_feux_cours) then
|
||||
begin
|
||||
Maj_feux_cours:=TRUE;
|
||||
|
||||
for i:=1 to NbreFeux do
|
||||
begin
|
||||
Maj_feu(Feux[i].Adresse);
|
||||
@@ -6558,10 +6557,14 @@ end;
|
||||
s:=checksum(s);
|
||||
envoi(s);
|
||||
end;
|
||||
end;
|
||||
|
||||
// demande l'état de tous les accessoires par l'interface
|
||||
procedure demande_etat_acc;
|
||||
var i : integer;
|
||||
begin
|
||||
if portCommOuvert or parSocketLenz then
|
||||
begin
|
||||
Affiche('Demande état des aiguillages',ClYellow);
|
||||
for i:=1 to maxaiguillage do
|
||||
begin
|
||||
@@ -6778,19 +6781,29 @@ begin
|
||||
// attention à partir de cette section le code est susceptible de ne pas être exécuté
|
||||
|
||||
// Mettre à jour le TCO
|
||||
if AvecTCO then
|
||||
if AvecTCO then
|
||||
begin
|
||||
formTCO.Maj_TCO(Adresse);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
// évènement d'aiguillage (accessoire)
|
||||
|
||||
// évènement d'aiguillage
|
||||
procedure Event_Aig(adresse,pos : integer);
|
||||
// pos = const_droit=2 ou const_devie=1
|
||||
procedure Event_Aig(adresse,pos : integer);
|
||||
var s: string;
|
||||
faire_event,inv : boolean;
|
||||
prov,i : integer;
|
||||
begin
|
||||
// vérifier que l'évènement accessoire vient bien d'un aiguillage et pas d'un feu
|
||||
i:=0;
|
||||
repeat
|
||||
inc(i);
|
||||
until (i>MaxAiguillage) or (i=adresse);
|
||||
faire_event: boolean;
|
||||
begin
|
||||
if i>MaxAiguillage then exit; // non ce n'est pas un aiguillage, on sort
|
||||
|
||||
// si l'aiguillage est inversé dans CDM et qu'on est en mode autonome, inverser sa position
|
||||
inv:=false;
|
||||
{ init objet
|
||||
if (aiguillage[adresse].inversionCDM=1) then // and (portCommOuvert or parSocketLenz) then
|
||||
begin
|
||||
prov:=pos;
|
||||
inv:=true;
|
||||
@@ -6800,13 +6813,13 @@ begin
|
||||
// ne pas faire l'évaluation si l'ancien état de l'aiguillage est indéterminée (9)
|
||||
// car le RUN vient de démarrer
|
||||
faire_event:=aiguillage[adresse].position<>9;
|
||||
aiguillage[adresse].position:=pos;
|
||||
aiguillage[adresse].position:=pos;
|
||||
|
||||
// ------------- stockage évènement aiguillage dans tampon event_det_tick -------------------------
|
||||
if (N_Event_tick>=Max_Event_det_tick) then
|
||||
begin
|
||||
N_Event_tick:=0;
|
||||
Affiche('Raz Evts ',clLime);
|
||||
Affiche('Raz Evts détecteurs',clLime);
|
||||
end;
|
||||
s:='Tick='+IntToSTR(tick)+' Evt Aig '+intToSTR(adresse)+'='+intToSTR(pos);
|
||||
if pos=const_droit then s:=s+' droit' else s:=s+' dévié';
|
||||
@@ -6816,7 +6829,6 @@ begin
|
||||
Affiche(s,clyellow);
|
||||
AfficheDebug(s,clyellow);
|
||||
end;
|
||||
FormDebug.MemoEvtDet.lines.add(s) ;
|
||||
FormDebug.MemoEvtDet.lines.add(s) ;
|
||||
if (n_Event_tick mod 10) =0 then affiche_memoire;
|
||||
inc(N_Event_tick);
|
||||
@@ -6828,17 +6840,34 @@ begin
|
||||
if AvecTCO then
|
||||
begin
|
||||
formTCO.Maj_TCO(Adresse);
|
||||
end;
|
||||
|
||||
// l'évaluation des routes est à faire selon conditions
|
||||
if faire_event then evalue;
|
||||
end;
|
||||
|
||||
|
||||
// pilote une sortie à 0 dont l'adresse est à octet
|
||||
procedure Pilote_acc0_X(adresse : integer;octet : byte);
|
||||
var groupe : integer ;
|
||||
fonction : byte;
|
||||
s : string;
|
||||
begin
|
||||
if debug_dec_sig then AfficheDebug('Tick='+IntToSTR(Tick)+' signal '+intToSTR(adresse)+' '+intToSTR(octet),clorange);
|
||||
groupe:=(adresse-1) div 4;
|
||||
fonction:=((adresse-1) mod 4)*2 + (octet-1);
|
||||
|
||||
s:=#$52+Char(groupe)+char(fonction or $80); // désactiver la sortie
|
||||
s:=checksum(s);
|
||||
envoi(s); // envoi de la trame et attente Ack
|
||||
end;
|
||||
|
||||
// pilotage d'un accessoire (décodeur d'aiguillage, de signal)
|
||||
// octet = 1 (dévié) ou 2 (droit)
|
||||
// la sortie "octet" est mise à 1 puis à 0
|
||||
// acc = aig ou feu
|
||||
procedure pilote_acc(adresse : integer;octet : byte;Acc : TAccessoire);
|
||||
procedure pilote_acc(adresse : integer;octet : byte;Acc : TAccessoire);
|
||||
var groupe,temps : integer ;
|
||||
fonction : byte;
|
||||
s : string;
|
||||
label mise0;
|
||||
begin
|
||||
@@ -6847,24 +6876,23 @@ begin
|
||||
// pilotage par CDM rail -----------------
|
||||
if CDM_connecte then
|
||||
begin
|
||||
//AfficheDebug(intToSTR(adresse),clred);
|
||||
if debug_dec_sig and (acc=feu) then AfficheDebug('Tick='+IntToSTR(Tick)+' signal '+intToSTR(adresse)+' '+intToSTR(octet),clorange);
|
||||
s:=chaine_CDM_Acc(adresse,octet);
|
||||
envoi_CDM(s);
|
||||
if (acc=feu) and not(Raz_Acc_signaux) then exit;
|
||||
if debug_dec_sig and (acc=feu) then AfficheDebug('Tick='+IntToSTR(Tick)+' signal '+intToSTR(adresse)+' 0',clorange);
|
||||
if debug_dec_sig and (acc=feu) then AfficheDebug('Tick='+IntToSTR(Tick)+' signal '+intToSTR(adresse)+' 0',clorange);
|
||||
s:=chaine_CDM_Acc(adresse,0);
|
||||
envoi_CDM(s);
|
||||
sleep(50);
|
||||
s:=chaine_CDM_Acc(adresse,0);
|
||||
envoi_CDM(s);
|
||||
exit;
|
||||
// pilotage par USB ou par éthernet de la centrale
|
||||
end;
|
||||
|
||||
// pilotage par USB ou par éthernet de la centrale ------------
|
||||
if (hors_tension2=false) and (portCommOuvert or parSocketLenz) then
|
||||
begin
|
||||
// test si pilotage aiguillage inversé
|
||||
if aiguillage[adresse].inversion=1 then
|
||||
if (acc=aig) and (aiguillage[adresse].inversion=1) then
|
||||
begin
|
||||
if octet=1 then octet:=2 else octet:=1;
|
||||
end;
|
||||
@@ -6872,10 +6900,10 @@ begin
|
||||
if (octet=0) or (octet>2) then exit;
|
||||
|
||||
groupe:=(adresse-1) div 4;
|
||||
fonction:=((adresse-1) mod 4)*2 + (octet-1);
|
||||
// pilotage à 1
|
||||
s:=#$52+Char(groupe)+char(fonction or $88); // activer la sortie
|
||||
s:=checksum(s);
|
||||
s:=checksum(s);
|
||||
if debug_dec_sig and (acc=feu) then AfficheDebug('Tick='+IntToSTR(Tick)+' signal '+intToSTR(adresse)+' '+intToSTR(octet),clorange);
|
||||
envoi(s); // envoi de la trame et attente Ack
|
||||
|
||||
@@ -6883,7 +6911,7 @@ begin
|
||||
if (acc=feu) and not(Raz_Acc_signaux) then exit;
|
||||
|
||||
// si aiguillage, faire une temporisation
|
||||
//if (index_feu(adresse)=0) or (Acc=aig) then
|
||||
//if (index_feu(adresse)=0) or (Acc=aig) then
|
||||
if Acc=Aig then
|
||||
begin
|
||||
temps:=aiguillage[adresse].temps;if temps=0 then temps:=4;
|
||||
@@ -7587,7 +7615,7 @@ begin
|
||||
TraceSign:=True;
|
||||
PremierFD:=false;
|
||||
// services commIP CDM par défaut
|
||||
Srvc_Aig:=true;
|
||||
Srvc_Aig:=true;
|
||||
Srvc_Det:=true;
|
||||
Srvc_Act:=true;
|
||||
Srvc_PosTrain:=false;
|
||||
@@ -7642,9 +7670,9 @@ begin
|
||||
ButtonAffTCO.visible:=AvecTCO;
|
||||
Loco.Visible:=not(Diffusion);
|
||||
|
||||
// tenter la liaison vers CDM rail
|
||||
// tenter la liaison vers CDM rail
|
||||
if not(CDM_connecte) then connecte_CDM;
|
||||
|
||||
|
||||
// si CDM n'est pas connecté, on ouvre la liaison vers la centrale
|
||||
if not(CDM_connecte) then
|
||||
begin
|
||||
@@ -7652,7 +7680,7 @@ begin
|
||||
// ouverture par USB
|
||||
Affiche('Demande connexion à la centrale par USB protocole XpressNet',clyellow);
|
||||
connecte_USB;
|
||||
if not(portCommOuvert) then
|
||||
if not(portCommOuvert) then
|
||||
begin
|
||||
// sinon ouvrir socket vers la centrale
|
||||
// Initialisation de la comm socket LENZ
|
||||
@@ -7788,6 +7816,7 @@ begin
|
||||
for i:=1 to maxaiguillage do
|
||||
begin
|
||||
if aiguillage[i].modele<>0 then // si l'aiguillage existe
|
||||
begin
|
||||
pos:=aiguillage[i].position;
|
||||
s:='Init aiguillage '+intToSTR(i)+'='+intToSTR(pos);
|
||||
if pos=1 then s:=s+' (dévié)' else s:=s+' (droit)';
|
||||
@@ -8042,7 +8071,7 @@ begin
|
||||
begin
|
||||
s:='Erreur '+IntToSTR(ErrorCode)+' socket IP Lenz';
|
||||
case ErrorCode of
|
||||
10053 : s:=s+': Connexion avortée - Timeout';
|
||||
10053 : s:=s+': Connexion avortée - Timeout';
|
||||
10054 : s:=s+': Connexion avortée par tiers';
|
||||
10060 : s:=s+': Timeout';
|
||||
10061 : s:=s+': Connexion refusée';
|
||||
@@ -8061,7 +8090,7 @@ begin
|
||||
begin
|
||||
s:='Erreur '+IntToSTR(ErrorCode)+' socket IP CDM Rail';
|
||||
case ErrorCode of
|
||||
10053 : s:=s+': Connexion avortée - Timeout';
|
||||
10053 : s:=s+': Connexion avortée - Timeout';
|
||||
10054 : s:=s+': Connexion avortée par tiers';
|
||||
10060 : s:=s+': Timeout';
|
||||
10061 : s:=s+': Connexion refusée';
|
||||
@@ -8181,7 +8210,7 @@ begin
|
||||
if Detecteur[adr].etat then s:=s+'1' else s:=s+'0';
|
||||
s:=s+' '+Detecteur[Adr].train;
|
||||
//s:=s+' Mem=';
|
||||
//if Mem[adresse_detecteur[j]] then s:=s+'1' else s:=s+'0';
|
||||
//if Mem[adresse_detecteur[j]] then s:=s+'1' else s:=s+'0';
|
||||
Affiche(s,clYellow);
|
||||
end;
|
||||
end;
|
||||
@@ -8194,8 +8223,6 @@ begin
|
||||
begin
|
||||
model:=aiguillage[i].modele ;
|
||||
if model<>0 then
|
||||
begin
|
||||
s:='Aiguillage '+IntToSTR(i)+' : '+intToSTR(aiguillage[i].position);
|
||||
begin
|
||||
s:='Aiguillage '+IntToSTR(i)+' : '+intToSTR(aiguillage[i].position);
|
||||
if aiguillage[i].position=const_devie then s:=s+' (dévié)' ;
|
||||
@@ -8237,7 +8264,7 @@ begin
|
||||
s:=s+' Dévie='+IntToSTR(aiguillage[i].ADevie)+aiguillage[i].ADevieB+
|
||||
' Droit='+IntToSTR(aiguillage[i].ADroit)+aiguillage[i].ADroitB;
|
||||
if aiguillage[i].modele=2 then
|
||||
begin
|
||||
begin
|
||||
s:=s+' DestDroit='+intToSTR(aiguillage[i].Ddroit)+aiguillage[i].DdroitB;
|
||||
s:=s+' DestDévié='+intToSTR(aiguillage[i].DDevie)+aiguillage[i].DdevieB;
|
||||
end;
|
||||
@@ -8374,19 +8401,20 @@ begin
|
||||
Delete(commandeCDM,i,7);
|
||||
|
||||
//Affiche('Aig '+inttostr(adr)+' pos='+IntToSTR(etat),clyellow);
|
||||
//Affiche(commandeCDM,clyellow);
|
||||
//Affiche(commandeCDM,clyellow);
|
||||
|
||||
// aiguillage normal
|
||||
if aiguillage[adr].modele=1 then
|
||||
begin
|
||||
//Affiche('Normal',clyellow);
|
||||
if etat=const_droit_CDM then etatAig:=const_droit else etatAig:=const_devie;
|
||||
Event_Aig(adr,etatAig);
|
||||
end;
|
||||
|
||||
// TJD TJS
|
||||
if (aiguillage[adr].modele=2) or (aiguillage[adr].modele=3) then
|
||||
begin
|
||||
//Affiche('TJD/S',clyellow);
|
||||
// TJD TJS
|
||||
if (aiguillage[adr].modele=2) or (aiguillage[adr].modele=3) then
|
||||
begin
|
||||
//Affiche('TJD/S',clyellow);
|
||||
//adr2:=aiguillage[adr].Apointe; // 2eme adresse de la TJD
|
||||
case etat of
|
||||
1 : begin etatAig:=const_devie;EtatAig2:=const_droit;end;
|
||||
|
||||
BIN
UnitTCO.dcu
BIN
UnitTCO.dcu
Binary file not shown.
@@ -1,4 +1,3 @@
|
||||
/******************************************
|
||||
/ fichier de configuration de client-GL.log
|
||||
/ gily - f1iwq - 2018
|
||||
/******************************************
|
||||
@@ -28,7 +27,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.23: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,11 +37,12 @@ IPV4_Interface=192.168.1.23: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=COM3:57600,N,8,1,2
|
||||
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=50
|
||||
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
|
||||
@@ -55,25 +55,27 @@ Entete=1
|
||||
/ ===============================================================================
|
||||
/
|
||||
/ Avec (1) ou sans (0) initialisation des aiguillages au démarrage selon le tableau ci après
|
||||
Init_Aig=0
|
||||
Init_Aig=1
|
||||
/Temporisation entre aiguillages en ms à l'initialisation en mode autonome
|
||||
Tempo_Aig=100
|
||||
/
|
||||
/ 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
|
||||
nb_det_dist=3
|
||||
/
|
||||
/ Vérification des versions au démarrage
|
||||
verif_version=1
|
||||
/ Notification de nouvelle version
|
||||
notif_version=0
|
||||
NOTIF_VERSION=0
|
||||
/ Avec TCO
|
||||
TCO=0
|
||||
/ Lancement de CDM Rail au démarrage
|
||||
CDM=0
|
||||
/ Nom du fichier LAY à ouvrir depuis CDM sans caractères spéciaux ( : / )
|
||||
/reseau_gily_signal_ajoute.lay
|
||||
LAY=RESEAU_GILY_SIGNAL_AJOUTE.LAY
|
||||
Lay=RESEAU_GILY_SIGNAL_AJOUTE.LAY
|
||||
/
|
||||
/ Démarrage du serveur d'interface automatique
|
||||
/ 0=ne pas démarrer automatiquement le serveur d'interfaces
|
||||
@@ -85,7 +87,7 @@ LAY=RESEAU_GILY_SIGNAL_AJOUTE.LAY
|
||||
/ 6=FIS88 FeedBack (S88/S88N)
|
||||
/ 7=RS2PC (Rs FeedBack interface)
|
||||
/ 8=DCC++
|
||||
Serveur_interface=0
|
||||
Serveur_interface=1
|
||||
/
|
||||
/ Interface de rétrosignalisation pour LENZ/DCC++
|
||||
/ 1=auto
|
||||
|
||||
66
config.cfg
66
config.cfg
@@ -8,7 +8,7 @@ Log=0
|
||||
TraceDet=0
|
||||
/ Envoie un 0 après le pilotage des décodeurs
|
||||
/ Mettre 1 si utilisation de décodeurs LEB
|
||||
RazSignaux=1
|
||||
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é.
|
||||
@@ -17,39 +17,39 @@ RazSignaux=1
|
||||
/ 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
|
||||
/ Pour une TJD : 26TJD,D530,S529,P28 - P désigne l'autre adresse de la TJD
|
||||
/ V=Vitesse de franchissement de l'aiguillage en position déviée (0,30,60)
|
||||
/ I1=aiguillage à inversion de commande dans CDM
|
||||
/
|
||||
/ S'il n'y a pas de détecteur connecté à une branche d'aiguillage, mettre 0.
|
||||
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
|
||||
1,P518,D523,S3P,V30,I0
|
||||
2,P12S,D519,S5S,V0,I0
|
||||
3,P1S,D4P,S5D,V0,I0
|
||||
4,P3D,D6S,S514,V0,I0
|
||||
5,P515,D3S,S2S,V0,I0
|
||||
6,P516,D0,S4D,V0,I0
|
||||
7,P527,D519,S520,V0,I0
|
||||
8,P527,D521,S522,V0,I0
|
||||
9,P526,D513,S515,V60,I0
|
||||
10,P19P,D29P,S528,V30,I0
|
||||
11,P18P,D30D,S525,V0,I0
|
||||
12,P517,D20S,S2P,V0,I0
|
||||
17,P525,D535,S528,V0,I0
|
||||
18,P11P,D23P,S517,V0,I0
|
||||
19,P10P,D22P,S531,V0,I0
|
||||
20,P520,D21P,S12D,V0,I0
|
||||
21,P20D,D28D,S28D,V0,I0
|
||||
22,P19D,D537,S538,V0,I0
|
||||
23,P18D,D538,S534,V0,I0
|
||||
24,P538,D32S,S533,V0,I0
|
||||
25,P31S,D529,S27P,V0,I0
|
||||
26TJD,D(530,28D),S(529,28S),I0
|
||||
27,P25S,D530,S537
|
||||
27,P25S,D530,S537,V0,I0
|
||||
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
|
||||
29,P10D,D513,S30S,V60,I0
|
||||
30,P524,D11D,S29D,V0,I0
|
||||
31,P534,D0,S25P,V0,I0
|
||||
32,P22S,D0,S24D,V0,I0
|
||||
0
|
||||
//
|
||||
/ modélisation du réseau par branche
|
||||
@@ -95,7 +95,7 @@ A31,0
|
||||
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
|
||||
218,7,0,1,(525,A17),0
|
||||
232,2,1,1,(516,A6),0
|
||||
260,9,1,1,(518,A1),1
|
||||
274,3,0,1,(524,521),0
|
||||
@@ -126,10 +126,10 @@ A31,0
|
||||
/ (act_ferme_voie1,act_ouvre_voie1),(act_ferme_voie2,act_ouvre_voie2),...,PN(adresse_ferme,adresse_ouvre)
|
||||
/
|
||||
/ Klaxon (F2)
|
||||
/815,1,CC406526,F2,400
|
||||
815,1,CC406526,F2,400
|
||||
/
|
||||
/ passage à niveau à 2 voies
|
||||
/(815,830),(820,840),PN(121+,121-)
|
||||
(815,830),(820,840),PN(121+,121-)
|
||||
/
|
||||
/ passage à niveau à 1 voie
|
||||
/(815,809),PN(131+,131-)
|
||||
|
||||
@@ -23,7 +23,7 @@ var
|
||||
Lance_verif : integer;
|
||||
verifVersion,notificationVersion : boolean;
|
||||
|
||||
Const Version='2.31'; // sert à la comparaison de la version publiée
|
||||
Const Version='2.4'; // sert à la comparaison de la version publiée
|
||||
|
||||
implementation
|
||||
|
||||
|
||||
@@ -45,6 +45,11 @@ version 2.21 : Param
|
||||
version 2.3 : Changement de la méthode de réception des trames du protocole IPC de CDM-Rail
|
||||
Affichage au démarrage des variables manquantes du fichier config-gl.cfg
|
||||
version 2.31 : Amélioration calcul des routes depuis buttoir
|
||||
Lancement du TCO à la validation dans la configuration
|
||||
version 2.4 : Optimisation de la gestion des évènements aiguillages
|
||||
Gestion des aiguillages inversés dans CDM pour le mode autonome
|
||||
Debug pilotage feux LEB
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user