V2.3B
This commit is contained in:
Binary file not shown.
+23
-24
@@ -1776,7 +1776,7 @@ object FormConfig: TFormConfig
|
|||||||
Top = 8
|
Top = 8
|
||||||
Width = 585
|
Width = 585
|
||||||
Height = 441
|
Height = 441
|
||||||
ActivePage = TabSheetSig
|
ActivePage = TabSheetAct
|
||||||
Font.Charset = DEFAULT_CHARSET
|
Font.Charset = DEFAULT_CHARSET
|
||||||
Font.Color = clBackground
|
Font.Color = clBackground
|
||||||
Font.Height = -11
|
Font.Height = -11
|
||||||
@@ -2783,7 +2783,7 @@ object FormConfig: TFormConfig
|
|||||||
Top = 48
|
Top = 48
|
||||||
Width = 129
|
Width = 129
|
||||||
Height = 21
|
Height = 21
|
||||||
ItemHeight = 13
|
ItemHeight = 0
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
OnChange = ComboBoxDecChange
|
OnChange = ComboBoxDecChange
|
||||||
end
|
end
|
||||||
@@ -2895,31 +2895,13 @@ object FormConfig: TFormConfig
|
|||||||
'Liste de mod'#233'lisation des actionneurs du fichier config.cfg - cl' +
|
'Liste de mod'#233'lisation des actionneurs du fichier config.cfg - cl' +
|
||||||
'iquez sur une ligne pour afficher la description de l'#39'action'
|
'iquez sur une ligne pour afficher la description de l'#39'action'
|
||||||
end
|
end
|
||||||
object MemoAct: TMemo
|
|
||||||
Left = 0
|
|
||||||
Top = 24
|
|
||||||
Width = 289
|
|
||||||
Height = 369
|
|
||||||
Color = clInfoText
|
|
||||||
Font.Charset = DEFAULT_CHARSET
|
|
||||||
Font.Color = clAqua
|
|
||||||
Font.Height = -11
|
|
||||||
Font.Name = 'MS Sans Serif'
|
|
||||||
Font.Style = []
|
|
||||||
ParentFont = False
|
|
||||||
ReadOnly = True
|
|
||||||
ScrollBars = ssVertical
|
|
||||||
TabOrder = 0
|
|
||||||
WordWrap = False
|
|
||||||
OnClick = MemoActClick
|
|
||||||
end
|
|
||||||
object GroupBox13: TGroupBox
|
object GroupBox13: TGroupBox
|
||||||
Left = 304
|
Left = 304
|
||||||
Top = 32
|
Top = 32
|
||||||
Width = 257
|
Width = 257
|
||||||
Height = 345
|
Height = 345
|
||||||
Caption = 'Description de l'#39'actionneur '
|
Caption = 'Description de l'#39'actionneur '
|
||||||
TabOrder = 1
|
TabOrder = 0
|
||||||
object GroupBox14: TGroupBox
|
object GroupBox14: TGroupBox
|
||||||
Left = 16
|
Left = 16
|
||||||
Top = 24
|
Top = 24
|
||||||
@@ -2957,7 +2939,7 @@ object FormConfig: TFormConfig
|
|||||||
end
|
end
|
||||||
object GroupBoxAct: TGroupBox
|
object GroupBoxAct: TGroupBox
|
||||||
Left = 8
|
Left = 8
|
||||||
Top = 200
|
Top = 216
|
||||||
Width = 225
|
Width = 225
|
||||||
Height = 145
|
Height = 145
|
||||||
Caption = 'Actionneur fonction de locomotive '
|
Caption = 'Actionneur fonction de locomotive '
|
||||||
@@ -3011,6 +2993,7 @@ object FormConfig: TFormConfig
|
|||||||
Height = 21
|
Height = 21
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
Text = 'EditAct'
|
Text = 'EditAct'
|
||||||
|
OnChange = EditActChange
|
||||||
end
|
end
|
||||||
object EditTrain: TEdit
|
object EditTrain: TEdit
|
||||||
Left = 112
|
Left = 112
|
||||||
@@ -3019,6 +3002,7 @@ object FormConfig: TFormConfig
|
|||||||
Height = 21
|
Height = 21
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
Text = 'EditTrain'
|
Text = 'EditTrain'
|
||||||
|
OnChange = EditTrainChange
|
||||||
end
|
end
|
||||||
object EditEtatFoncSortie: TEdit
|
object EditEtatFoncSortie: TEdit
|
||||||
Left = 160
|
Left = 160
|
||||||
@@ -3027,6 +3011,7 @@ object FormConfig: TFormConfig
|
|||||||
Height = 21
|
Height = 21
|
||||||
TabOrder = 2
|
TabOrder = 2
|
||||||
Text = 'EditEtatFoncSortie'
|
Text = 'EditEtatFoncSortie'
|
||||||
|
OnChange = EditEtatFoncSortieChange
|
||||||
end
|
end
|
||||||
object EditFonctionAccess: TEdit
|
object EditFonctionAccess: TEdit
|
||||||
Left = 112
|
Left = 112
|
||||||
@@ -3035,6 +3020,7 @@ object FormConfig: TFormConfig
|
|||||||
Height = 21
|
Height = 21
|
||||||
TabOrder = 3
|
TabOrder = 3
|
||||||
Text = 'EditFonc'
|
Text = 'EditFonc'
|
||||||
|
OnChange = EditFonctionAccessChange
|
||||||
end
|
end
|
||||||
object EditTempo: TEdit
|
object EditTempo: TEdit
|
||||||
Left = 112
|
Left = 112
|
||||||
@@ -3043,6 +3029,7 @@ object FormConfig: TFormConfig
|
|||||||
Height = 21
|
Height = 21
|
||||||
TabOrder = 4
|
TabOrder = 4
|
||||||
Text = 'EditTempo'
|
Text = 'EditTempo'
|
||||||
|
OnChange = EditTempoChange
|
||||||
end
|
end
|
||||||
object EditEtatActionneur: TEdit
|
object EditEtatActionneur: TEdit
|
||||||
Left = 184
|
Left = 184
|
||||||
@@ -3051,6 +3038,7 @@ object FormConfig: TFormConfig
|
|||||||
Height = 21
|
Height = 21
|
||||||
TabOrder = 5
|
TabOrder = 5
|
||||||
Text = 'EditEtat'
|
Text = 'EditEtat'
|
||||||
|
OnChange = EditEtatActionneurChange
|
||||||
end
|
end
|
||||||
object CheckRAZ: TCheckBox
|
object CheckRAZ: TCheckBox
|
||||||
Left = 48
|
Left = 48
|
||||||
@@ -3059,11 +3047,12 @@ object FormConfig: TFormConfig
|
|||||||
Height = 17
|
Height = 17
|
||||||
Caption = 'Remise '#224' 0 apr'#232's pilotage'
|
Caption = 'Remise '#224' 0 apr'#232's pilotage'
|
||||||
TabOrder = 6
|
TabOrder = 6
|
||||||
|
OnClick = CheckRAZClick
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
object GroupBoxPN: TGroupBox
|
object GroupBoxPN: TGroupBox
|
||||||
Left = 72
|
Left = 56
|
||||||
Top = 8
|
Top = 56
|
||||||
Width = 225
|
Width = 225
|
||||||
Height = 193
|
Height = 193
|
||||||
Caption = 'Actionneurs gestion passage '#224' niveau'
|
Caption = 'Actionneurs gestion passage '#224' niveau'
|
||||||
@@ -3207,6 +3196,16 @@ object FormConfig: TFormConfig
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
object RichAct: TRichEdit
|
||||||
|
Left = 0
|
||||||
|
Top = 32
|
||||||
|
Width = 289
|
||||||
|
Height = 369
|
||||||
|
Color = clBlack
|
||||||
|
ScrollBars = ssVertical
|
||||||
|
TabOrder = 1
|
||||||
|
OnMouseDown = RichActMouseDown
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
+221
-17
@@ -77,7 +77,6 @@ type
|
|||||||
Label15: TLabel;
|
Label15: TLabel;
|
||||||
TabSheetAct: TTabSheet;
|
TabSheetAct: TTabSheet;
|
||||||
Label16: TLabel;
|
Label16: TLabel;
|
||||||
MemoAct: TMemo;
|
|
||||||
CheckBoxSrvSig: TCheckBox;
|
CheckBoxSrvSig: TCheckBox;
|
||||||
Memo1: TMemo;
|
Memo1: TMemo;
|
||||||
Memo2: TMemo;
|
Memo2: TMemo;
|
||||||
@@ -185,12 +184,12 @@ type
|
|||||||
GroupBox15: TGroupBox;
|
GroupBox15: TGroupBox;
|
||||||
EditNbDetDist: TEdit;
|
EditNbDetDist: TEdit;
|
||||||
Label31: TLabel;
|
Label31: TLabel;
|
||||||
|
RichAct: TRichEdit;
|
||||||
procedure ButtonAppliquerEtFermerClick(Sender: TObject);
|
procedure ButtonAppliquerEtFermerClick(Sender: TObject);
|
||||||
procedure Button2Click(Sender: TObject);
|
procedure Button2Click(Sender: TObject);
|
||||||
procedure FormActivate(Sender: TObject);
|
procedure FormActivate(Sender: TObject);
|
||||||
procedure FormCreate(Sender: TObject);
|
procedure FormCreate(Sender: TObject);
|
||||||
procedure MemoSignauxClick(Sender: TObject);
|
procedure MemoSignauxClick(Sender: TObject);
|
||||||
procedure MemoActClick(Sender: TObject);
|
|
||||||
procedure PageControlChange(Sender: TObject);
|
procedure PageControlChange(Sender: TObject);
|
||||||
procedure RichAigMouseDown(Sender: TObject; Button: TMouseButton;
|
procedure RichAigMouseDown(Sender: TObject; Button: TMouseButton;
|
||||||
Shift: TShiftState; X, Y: Integer);
|
Shift: TShiftState; X, Y: Integer);
|
||||||
@@ -213,6 +212,15 @@ type
|
|||||||
procedure EditSuiv3Change(Sender: TObject);
|
procedure EditSuiv3Change(Sender: TObject);
|
||||||
procedure EditDet4Change(Sender: TObject);
|
procedure EditDet4Change(Sender: TObject);
|
||||||
procedure EditSuiv4Change(Sender: TObject);
|
procedure EditSuiv4Change(Sender: TObject);
|
||||||
|
procedure EditActChange(Sender: TObject);
|
||||||
|
procedure RichActMouseDown(Sender: TObject; Button: TMouseButton;
|
||||||
|
Shift: TShiftState; X, Y: Integer);
|
||||||
|
procedure EditEtatActionneurChange(Sender: TObject);
|
||||||
|
procedure EditTrainChange(Sender: TObject);
|
||||||
|
procedure EditFonctionAccessChange(Sender: TObject);
|
||||||
|
procedure EditEtatFoncSortieChange(Sender: TObject);
|
||||||
|
procedure EditTempoChange(Sender: TObject);
|
||||||
|
procedure CheckRAZClick(Sender: TObject);
|
||||||
private
|
private
|
||||||
{ Déclarations privées }
|
{ Déclarations privées }
|
||||||
public
|
public
|
||||||
@@ -267,7 +275,7 @@ var temps : integer;
|
|||||||
begin
|
begin
|
||||||
if SocketCDM_connecte=false then begin envoi_CDM:=false;exit;end;
|
if SocketCDM_connecte=false then begin envoi_CDM:=false;exit;end;
|
||||||
//Affiche('Envoi à CDM rail',clRed);Affiche(s,ClGreen);
|
//Affiche('Envoi à CDM rail',clRed);Affiche(s,ClGreen);
|
||||||
if trace then affiche(s,clLime);
|
if traceTrames then afficheDebug(s,clLime);
|
||||||
Formprinc.ClientSocketCDM.Socket.SendText(s);
|
Formprinc.ClientSocketCDM.Socket.SendText(s);
|
||||||
// attend l'ack
|
// attend l'ack
|
||||||
ackCDM:=false;nackCDM:=false;
|
ackCDM:=false;nackCDM:=false;
|
||||||
@@ -333,7 +341,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure connecte_CDM;
|
procedure connecte_CDM;
|
||||||
var s , ss : string;
|
var s : string;
|
||||||
i : integer;
|
i : integer;
|
||||||
begin
|
begin
|
||||||
// déconnexion de l'ancienne liaison éventuelle
|
// déconnexion de l'ancienne liaison éventuelle
|
||||||
@@ -389,7 +397,7 @@ end;
|
|||||||
|
|
||||||
// teste si une adresse IP V4 est ok
|
// teste si une adresse IP V4 est ok
|
||||||
function Ipok(s : string) : boolean;
|
function Ipok(s : string) : boolean;
|
||||||
var i,k,posp,n,octet,erreur : integer;
|
var i,k,octet,erreur : integer;
|
||||||
begin
|
begin
|
||||||
for k:=1 to 3 do
|
for k:=1 to 3 do
|
||||||
begin
|
begin
|
||||||
@@ -405,7 +413,7 @@ end;
|
|||||||
// vérifie si la config de la com série/usb est ok
|
// vérifie si la config de la com série/usb est ok
|
||||||
function config_com(s : string) : boolean;
|
function config_com(s : string) : boolean;
|
||||||
var sa : string;
|
var sa : string;
|
||||||
j,i,erreur : integer;
|
i,erreur : integer;
|
||||||
begin
|
begin
|
||||||
sa:=s;
|
sa:=s;
|
||||||
protocole:=-1;
|
protocole:=-1;
|
||||||
@@ -414,19 +422,15 @@ begin
|
|||||||
if i<>0 then
|
if i<>0 then
|
||||||
begin
|
begin
|
||||||
delete(s,1,i);
|
delete(s,1,i);
|
||||||
j:=i;
|
|
||||||
i:=pos(',',s);
|
i:=pos(',',s);
|
||||||
j:=j+i;
|
|
||||||
if i<>0 then
|
if i<>0 then
|
||||||
begin
|
begin
|
||||||
delete(s,1,i);
|
delete(s,1,i);
|
||||||
i:=pos(',',s);
|
i:=pos(',',s);
|
||||||
j:=j+i;
|
|
||||||
if i<>0 then
|
if i<>0 then
|
||||||
begin
|
begin
|
||||||
delete(s,1,i);
|
delete(s,1,i);
|
||||||
i:=pos(',',s);
|
i:=pos(',',s);
|
||||||
j:=j+i;
|
|
||||||
if i<>0 then
|
if i<>0 then
|
||||||
begin
|
begin
|
||||||
delete(s,1,i);
|
delete(s,1,i);
|
||||||
@@ -564,6 +568,30 @@ begin
|
|||||||
encode_sig:=s;
|
encode_sig:=s;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
// transforme l'actionneur type loco ou actionneur du tableau en texte
|
||||||
|
// paramètre d'entrée : index
|
||||||
|
function encode_act_loc(i : integer): string;
|
||||||
|
var s : string;
|
||||||
|
c : char;
|
||||||
|
adresse : integer;
|
||||||
|
begin
|
||||||
|
// adresse
|
||||||
|
|
||||||
|
adresse:=Tablo_Actionneur[i].actionneur;
|
||||||
|
if adresse=0 then begin encode_act_loc:='';exit;end;
|
||||||
|
if Formconfig.radioButtonLoc.Checked then
|
||||||
|
s:=IntToSTR(adresse)+','+IntToSTR(Tablo_Actionneur[i].Etat)+','+Tablo_Actionneur[i].train+',F'+IntToSTR(Tablo_Actionneur[i].fonction)+','+intToSTR(Tablo_Actionneur[i].tempo);
|
||||||
|
if FormConfig.RadioButtonAccess.Checked then
|
||||||
|
begin
|
||||||
|
s:=IntToSTR(adresse)+','+IntToSTR(Tablo_Actionneur[i].Etat)+','+Tablo_Actionneur[i].train+
|
||||||
|
',A'+IntToSTR(Tablo_Actionneur[i].accessoire)+','+intToSTR(Tablo_Actionneur[i].sortie)+',';
|
||||||
|
if Tablo_Actionneur[i].Raz then s:=s+'Z' else s:=s+'S';
|
||||||
|
end;
|
||||||
|
|
||||||
|
encode_act_loc:=s;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
// modifie les fichiers de config en fonction du paramétrage
|
// modifie les fichiers de config en fonction du paramétrage
|
||||||
procedure genere_config;
|
procedure genere_config;
|
||||||
var s: string;
|
var s: string;
|
||||||
@@ -1040,7 +1068,10 @@ begin
|
|||||||
|
|
||||||
// actionneurs
|
// actionneurs
|
||||||
for i:=1 to maxTablo_act do
|
for i:=1 to maxTablo_act do
|
||||||
MemoAct.Lines.Add(mod_Act[i]);
|
begin
|
||||||
|
RichAct.Lines.Add(mod_Act[i]);
|
||||||
|
RE_ColorLine(RichAct,RichAct.lines.count-1,ClAqua)
|
||||||
|
end;
|
||||||
PageControl.ActivePage:=TabSheetCDM; // force le premier onglet sur la page
|
PageControl.ActivePage:=TabSheetCDM; // force le premier onglet sur la page
|
||||||
|
|
||||||
for i:=1 to NbDecodeur do
|
for i:=1 to NbDecodeur do
|
||||||
@@ -1415,9 +1446,12 @@ var i,v, ligne,etatact,erreur, adresse,sortie,fonction,tempo,access : integer;
|
|||||||
s,s2,ss : string;
|
s,s2,ss : string;
|
||||||
trouve : bool;
|
trouve : bool;
|
||||||
begin
|
begin
|
||||||
with formConfig.MemoAct do
|
with formConfig.RichAct do
|
||||||
begin
|
begin
|
||||||
ligne:=Perform(EM_LINEFROMCHAR,-1,0); // numéro de la lignée cliquée
|
ligne:=Perform(EM_LINEFROMCHAR,-1,0); // numéro de la lignée cliquée
|
||||||
|
AncLigneCliquee:=Ligne;
|
||||||
|
ligneCliquee:=ligne;
|
||||||
|
//affiche(intToSTR(ligne),clLime);
|
||||||
s:=Uppercase(Lines[ligne]);
|
s:=Uppercase(Lines[ligne]);
|
||||||
if s='' then exit;
|
if s='' then exit;
|
||||||
SelStart:=Perform(EM_LINEINDEX,Ligne,0); // début de la sélection
|
SelStart:=Perform(EM_LINEINDEX,Ligne,0); // début de la sélection
|
||||||
@@ -1578,11 +1612,6 @@ begin
|
|||||||
Aff_champs_sig;
|
Aff_champs_sig;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TFormConfig.MemoActClick(Sender: TObject);
|
|
||||||
begin
|
|
||||||
Aff_champs_act;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TFormConfig.PageControlChange(Sender: TObject);
|
procedure TFormConfig.PageControlChange(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
if PageControl.ActivePage=TabSheetAig then
|
if PageControl.ActivePage=TabSheetAig then
|
||||||
@@ -2114,6 +2143,181 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TFormConfig.EditActChange(Sender: TObject);
|
||||||
|
var s : string;
|
||||||
|
act,erreur : integer;
|
||||||
|
begin
|
||||||
|
if clicliste then exit;
|
||||||
|
if FormConfig.PageControl.ActivePage=FormConfig.TabSheetAct then
|
||||||
|
with Formconfig do
|
||||||
|
begin
|
||||||
|
s:=EditAct.Text;
|
||||||
|
if radioButtonLoc.Checked or RadioButtonAccess.Checked then
|
||||||
|
begin
|
||||||
|
Val(s,act,erreur);
|
||||||
|
if erreur<>0 then
|
||||||
|
begin
|
||||||
|
LabelInfo.caption:='Erreur adresse actionneur';exit
|
||||||
|
end else LabelInfo.caption:=' ';
|
||||||
|
|
||||||
|
tablo_actionneur[lignecliquee+1].actionneur:=act;
|
||||||
|
s:=encode_act_loc(lignecliquee+1);
|
||||||
|
RichAct.Lines[lignecliquee]:=s;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
procedure TFormConfig.RichActMouseDown(Sender: TObject;
|
||||||
|
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
||||||
|
begin
|
||||||
|
clicliste:=true;
|
||||||
|
LabelInfo.caption:='';
|
||||||
|
Aff_champs_Act;
|
||||||
|
clicliste:=false;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TFormConfig.EditEtatActionneurChange(Sender: TObject);
|
||||||
|
var s : string;
|
||||||
|
etat,erreur : integer;
|
||||||
|
begin
|
||||||
|
if clicliste then exit;
|
||||||
|
if FormConfig.PageControl.ActivePage=FormConfig.TabSheetAct then
|
||||||
|
with Formconfig do
|
||||||
|
begin
|
||||||
|
s:=EditEtatActionneur.Text;
|
||||||
|
if radioButtonLoc.Checked or RadioButtonAccess.Checked then
|
||||||
|
begin
|
||||||
|
Val(s,etat,erreur);
|
||||||
|
if (erreur<>0) or (etat<0) or (etat>1) then
|
||||||
|
begin
|
||||||
|
LabelInfo.caption:='Erreur état actionneur';exit
|
||||||
|
end else LabelInfo.caption:=' ';
|
||||||
|
|
||||||
|
tablo_actionneur[lignecliquee+1].etat:=etat;
|
||||||
|
s:=encode_act_loc(lignecliquee+1);
|
||||||
|
RichAct.Lines[lignecliquee]:=s;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TFormConfig.EditTrainChange(Sender: TObject);
|
||||||
|
var s,train : string;
|
||||||
|
begin
|
||||||
|
if clicliste then exit;
|
||||||
|
if FormConfig.PageControl.ActivePage=FormConfig.TabSheetAct then
|
||||||
|
with Formconfig do
|
||||||
|
begin
|
||||||
|
if radioButtonLoc.Checked or RadioButtonAccess.Checked then
|
||||||
|
begin
|
||||||
|
train:=editTrain.Text;
|
||||||
|
if train='' then
|
||||||
|
begin
|
||||||
|
LabelInfo.caption:='Erreur train';exit
|
||||||
|
end else LabelInfo.caption:=' ';
|
||||||
|
|
||||||
|
tablo_actionneur[lignecliquee+1].train:=train;
|
||||||
|
s:=encode_act_loc(lignecliquee+1);
|
||||||
|
RichAct.Lines[lignecliquee]:=s;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TFormConfig.EditFonctionAccessChange(Sender: TObject);
|
||||||
|
var s : string;
|
||||||
|
fonction,erreur : integer;
|
||||||
|
begin
|
||||||
|
if clicliste then exit;
|
||||||
|
if FormConfig.PageControl.ActivePage=FormConfig.TabSheetAct then
|
||||||
|
with Formconfig do
|
||||||
|
begin
|
||||||
|
s:=EditFonctionAccess.Text;
|
||||||
|
if radioButtonLoc.Checked or RadioButtonAccess.Checked then
|
||||||
|
begin
|
||||||
|
Val(s,fonction,erreur);
|
||||||
|
if erreur<>0 then
|
||||||
|
begin
|
||||||
|
LabelInfo.caption:='Erreur fonction actionneur';exit
|
||||||
|
end else LabelInfo.caption:=' ';
|
||||||
|
|
||||||
|
if radioButtonLoc.Checked then tablo_actionneur[lignecliquee+1].fonction:=fonction;
|
||||||
|
if RadioButtonAccess.Checked then Tablo_Actionneur[lignecliquee+1].accessoire:=fonction;
|
||||||
|
|
||||||
|
s:=encode_act_loc(lignecliquee+1);
|
||||||
|
RichAct.Lines[lignecliquee]:=s;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TFormConfig.EditEtatFoncSortieChange(Sender: TObject);
|
||||||
|
var s : string;
|
||||||
|
Etat,erreur : integer;
|
||||||
|
begin
|
||||||
|
if clicliste then exit;
|
||||||
|
if FormConfig.PageControl.ActivePage=FormConfig.TabSheetAct then
|
||||||
|
with Formconfig do
|
||||||
|
begin
|
||||||
|
s:=EditEtatFoncSortie.Text;
|
||||||
|
if radioButtonAccess.Checked then
|
||||||
|
begin
|
||||||
|
Val(s,etat,erreur);
|
||||||
|
if (erreur<>0) or (etat<0) or (etat>2) then
|
||||||
|
begin
|
||||||
|
LabelInfo.caption:='Erreur Etat actionneur';exit
|
||||||
|
end else LabelInfo.caption:=' ';
|
||||||
|
|
||||||
|
tablo_actionneur[lignecliquee+1].sortie:=etat;
|
||||||
|
s:=encode_act_loc(lignecliquee+1);
|
||||||
|
RichAct.Lines[lignecliquee]:=s;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TFormConfig.EditTempoChange(Sender: TObject);
|
||||||
|
var s : string;
|
||||||
|
tempo,erreur : integer;
|
||||||
|
begin
|
||||||
|
if clicliste then exit;
|
||||||
|
if FormConfig.PageControl.ActivePage=FormConfig.TabSheetAct then
|
||||||
|
with Formconfig do
|
||||||
|
begin
|
||||||
|
s:=EditTempo.Text;
|
||||||
|
if radioButtonLoc.Checked then
|
||||||
|
begin
|
||||||
|
Val(s,tempo,erreur);
|
||||||
|
if erreur<>0 then
|
||||||
|
begin
|
||||||
|
LabelInfo.caption:='Erreur Tempo actionneur';exit
|
||||||
|
end else LabelInfo.caption:=' ';
|
||||||
|
|
||||||
|
tablo_actionneur[lignecliquee+1].tempo:=tempo;
|
||||||
|
s:=encode_act_loc(lignecliquee+1);
|
||||||
|
RichAct.Lines[lignecliquee]:=s;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
procedure TFormConfig.CheckRAZClick(Sender: TObject);
|
||||||
|
var s : string;
|
||||||
|
Etat,erreur : integer;
|
||||||
|
begin
|
||||||
|
if clicliste then exit;
|
||||||
|
if FormConfig.PageControl.ActivePage=FormConfig.TabSheetAct then
|
||||||
|
with Formconfig do
|
||||||
|
begin
|
||||||
|
if radioButtonAccess.Checked then
|
||||||
|
begin
|
||||||
|
tablo_actionneur[lignecliquee+1].raz:=CheckRAZ.checked;
|
||||||
|
s:=encode_act_loc(lignecliquee+1);
|
||||||
|
RichAct.Lines[lignecliquee]:=s;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
+51
-36
@@ -1,7 +1,7 @@
|
|||||||
object FormDebug: TFormDebug
|
object FormDebug: TFormDebug
|
||||||
Left = 329
|
Left = 329
|
||||||
Top = 122
|
Top = 122
|
||||||
Width = 842
|
Width = 855
|
||||||
Height = 762
|
Height = 762
|
||||||
Caption = 'Fen'#234'tre de d'#233'bug'
|
Caption = 'Fen'#234'tre de d'#233'bug'
|
||||||
Color = clWindow
|
Color = clWindow
|
||||||
@@ -15,12 +15,12 @@ object FormDebug: TFormDebug
|
|||||||
Position = poMainFormCenter
|
Position = poMainFormCenter
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
DesignSize = (
|
DesignSize = (
|
||||||
826
|
839
|
||||||
724)
|
724)
|
||||||
PixelsPerInch = 96
|
PixelsPerInch = 96
|
||||||
TextHeight = 13
|
TextHeight = 13
|
||||||
object Label1: TLabel
|
object Label1: TLabel
|
||||||
Left = 642
|
Left = 655
|
||||||
Top = 4
|
Top = 4
|
||||||
Width = 108
|
Width = 108
|
||||||
Height = 13
|
Height = 13
|
||||||
@@ -36,7 +36,7 @@ object FormDebug: TFormDebug
|
|||||||
ParentFont = False
|
ParentFont = False
|
||||||
end
|
end
|
||||||
object Label2: TLabel
|
object Label2: TLabel
|
||||||
Left = 474
|
Left = 487
|
||||||
Top = 2
|
Top = 2
|
||||||
Width = 131
|
Width = 131
|
||||||
Height = 18
|
Height = 18
|
||||||
@@ -50,7 +50,7 @@ object FormDebug: TFormDebug
|
|||||||
ParentFont = False
|
ParentFont = False
|
||||||
end
|
end
|
||||||
object Label3: TLabel
|
object Label3: TLabel
|
||||||
Left = 472
|
Left = 485
|
||||||
Top = 160
|
Top = 160
|
||||||
Width = 99
|
Width = 99
|
||||||
Height = 185
|
Height = 185
|
||||||
@@ -68,7 +68,7 @@ object FormDebug: TFormDebug
|
|||||||
WordWrap = True
|
WordWrap = True
|
||||||
end
|
end
|
||||||
object EditNivDebug: TEdit
|
object EditNivDebug: TEdit
|
||||||
Left = 754
|
Left = 767
|
||||||
Top = 2
|
Top = 2
|
||||||
Width = 49
|
Width = 49
|
||||||
Height = 21
|
Height = 21
|
||||||
@@ -84,7 +84,7 @@ object FormDebug: TFormDebug
|
|||||||
OnKeyPress = EditNivDebugKeyPress
|
OnKeyPress = EditNivDebugKeyPress
|
||||||
end
|
end
|
||||||
object MemoEvtDet: TMemo
|
object MemoEvtDet: TMemo
|
||||||
Left = 578
|
Left = 591
|
||||||
Top = 344
|
Top = 344
|
||||||
Width = 239
|
Width = 239
|
||||||
Height = 225
|
Height = 225
|
||||||
@@ -103,7 +103,7 @@ object FormDebug: TFormDebug
|
|||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
end
|
end
|
||||||
object ButtonEcrLog: TButton
|
object ButtonEcrLog: TButton
|
||||||
Left = 474
|
Left = 487
|
||||||
Top = 464
|
Top = 464
|
||||||
Width = 97
|
Width = 97
|
||||||
Height = 29
|
Height = 29
|
||||||
@@ -112,52 +112,40 @@ object FormDebug: TFormDebug
|
|||||||
TabOrder = 2
|
TabOrder = 2
|
||||||
OnClick = ButtonEcrLogClick
|
OnClick = ButtonEcrLogClick
|
||||||
end
|
end
|
||||||
object MemoDebug: TMemo
|
|
||||||
Left = 0
|
|
||||||
Top = 0
|
|
||||||
Width = 465
|
|
||||||
Height = 721
|
|
||||||
Anchors = [akLeft, akTop, akRight, akBottom]
|
|
||||||
Lines.Strings = (
|
|
||||||
'MemoDebug')
|
|
||||||
ScrollBars = ssBoth
|
|
||||||
TabOrder = 3
|
|
||||||
WordWrap = False
|
|
||||||
end
|
|
||||||
object ButtonRazTampon: TButton
|
object ButtonRazTampon: TButton
|
||||||
Left = 474
|
Left = 487
|
||||||
Top = 536
|
Top = 536
|
||||||
Width = 97
|
Width = 97
|
||||||
Height = 33
|
Height = 33
|
||||||
Anchors = [akTop, akRight]
|
Anchors = [akTop, akRight]
|
||||||
Caption = 'Raz Tampon Ev'#232'nements ---->'
|
Caption = 'Raz Tampon Ev'#232'nements ---->'
|
||||||
TabOrder = 4
|
TabOrder = 3
|
||||||
WordWrap = True
|
WordWrap = True
|
||||||
OnClick = ButtonRazTamponClick
|
OnClick = ButtonRazTamponClick
|
||||||
end
|
end
|
||||||
object ButtonCherche: TButton
|
object ButtonCherche: TButton
|
||||||
Left = 474
|
Left = 487
|
||||||
Top = 432
|
Top = 432
|
||||||
Width = 97
|
Width = 97
|
||||||
Height = 25
|
Height = 25
|
||||||
Anchors = [akTop, akRight]
|
Anchors = [akTop, akRight]
|
||||||
Caption = 'Chercher erreurs'
|
Caption = 'Chercher erreurs'
|
||||||
TabOrder = 5
|
TabOrder = 4
|
||||||
OnClick = ButtonChercheClick
|
OnClick = ButtonChercheClick
|
||||||
end
|
end
|
||||||
object ButtonAffEvtChrono: TButton
|
object ButtonAffEvtChrono: TButton
|
||||||
Left = 474
|
Left = 487
|
||||||
Top = 392
|
Top = 392
|
||||||
Width = 97
|
Width = 97
|
||||||
Height = 33
|
Height = 33
|
||||||
Anchors = [akTop, akRight]
|
Anchors = [akTop, akRight]
|
||||||
Caption = 'Affiche Evts d'#233'tecteurs et aig'
|
Caption = 'Affiche Evts d'#233'tecteurs et aig'
|
||||||
TabOrder = 6
|
TabOrder = 5
|
||||||
WordWrap = True
|
WordWrap = True
|
||||||
OnClick = ButtonAffEvtChronoClick
|
OnClick = ButtonAffEvtChronoClick
|
||||||
end
|
end
|
||||||
object ButtonCop: TButton
|
object ButtonCop: TButton
|
||||||
Left = 474
|
Left = 487
|
||||||
Top = 344
|
Top = 344
|
||||||
Width = 97
|
Width = 97
|
||||||
Height = 41
|
Height = 41
|
||||||
@@ -169,34 +157,40 @@ object FormDebug: TFormDebug
|
|||||||
Font.Name = 'MS Sans Serif'
|
Font.Name = 'MS Sans Serif'
|
||||||
Font.Style = []
|
Font.Style = []
|
||||||
ParentFont = False
|
ParentFont = False
|
||||||
TabOrder = 7
|
TabOrder = 6
|
||||||
WordWrap = True
|
WordWrap = True
|
||||||
OnClick = ButtonCopClick
|
OnClick = ButtonCopClick
|
||||||
end
|
end
|
||||||
object RichEdit: TRichEdit
|
object RichEdit: TRichEdit
|
||||||
Left = 578
|
Left = 591
|
||||||
Top = 160
|
Top = 160
|
||||||
Width = 239
|
Width = 239
|
||||||
Height = 185
|
Height = 185
|
||||||
Anchors = [akTop, akRight]
|
Anchors = [akTop, akRight]
|
||||||
|
Font.Charset = DEFAULT_CHARSET
|
||||||
|
Font.Color = clWhite
|
||||||
|
Font.Height = -11
|
||||||
|
Font.Name = 'Arial'
|
||||||
|
Font.Style = []
|
||||||
HideScrollBars = False
|
HideScrollBars = False
|
||||||
|
ParentFont = False
|
||||||
PopupMenu = PopupMenuRE
|
PopupMenu = PopupMenuRE
|
||||||
ScrollBars = ssVertical
|
ScrollBars = ssVertical
|
||||||
TabOrder = 8
|
TabOrder = 7
|
||||||
end
|
end
|
||||||
object ButtonRazLog: TButton
|
object ButtonRazLog: TButton
|
||||||
Left = 474
|
Left = 487
|
||||||
Top = 496
|
Top = 496
|
||||||
Width = 97
|
Width = 97
|
||||||
Height = 33
|
Height = 33
|
||||||
Anchors = [akTop, akRight]
|
Anchors = [akTop, akRight]
|
||||||
Caption = 'Raz Tampon Log <-----'
|
Caption = 'Raz Tampon Log <-----'
|
||||||
TabOrder = 9
|
TabOrder = 8
|
||||||
WordWrap = True
|
WordWrap = True
|
||||||
OnClick = ButtonRazLogClick
|
OnClick = ButtonRazLogClick
|
||||||
end
|
end
|
||||||
object GroupBox1: TGroupBox
|
object GroupBox1: TGroupBox
|
||||||
Left = 472
|
Left = 485
|
||||||
Top = 576
|
Top = 576
|
||||||
Width = 353
|
Width = 353
|
||||||
Height = 145
|
Height = 145
|
||||||
@@ -210,7 +204,7 @@ object FormDebug: TFormDebug
|
|||||||
Font.Style = []
|
Font.Style = []
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
ParentFont = False
|
ParentFont = False
|
||||||
TabOrder = 10
|
TabOrder = 9
|
||||||
object GroupBox3: TGroupBox
|
object GroupBox3: TGroupBox
|
||||||
Left = 8
|
Left = 8
|
||||||
Top = 16
|
Top = 16
|
||||||
@@ -332,7 +326,7 @@ object FormDebug: TFormDebug
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
object GroupBox2: TGroupBox
|
object GroupBox2: TGroupBox
|
||||||
Left = 472
|
Left = 485
|
||||||
Top = 20
|
Top = 20
|
||||||
Width = 345
|
Width = 345
|
||||||
Height = 137
|
Height = 137
|
||||||
@@ -346,7 +340,7 @@ object FormDebug: TFormDebug
|
|||||||
Font.Style = []
|
Font.Style = []
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
ParentFont = False
|
ParentFont = False
|
||||||
TabOrder = 11
|
TabOrder = 10
|
||||||
object CheckAffSig: TCheckBox
|
object CheckAffSig: TCheckBox
|
||||||
Left = 8
|
Left = 8
|
||||||
Top = 16
|
Top = 16
|
||||||
@@ -455,6 +449,19 @@ object FormDebug: TFormDebug
|
|||||||
OnClick = CheckBoxAffDebDecSigClick
|
OnClick = CheckBoxAffDebDecSigClick
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
object RichDebug: TRichEdit
|
||||||
|
Left = 8
|
||||||
|
Top = 8
|
||||||
|
Width = 470
|
||||||
|
Height = 705
|
||||||
|
Anchors = [akLeft, akTop, akRight, akBottom]
|
||||||
|
Lines.Strings = (
|
||||||
|
'RichDebug')
|
||||||
|
PopupMenu = PopupMenuRD
|
||||||
|
ScrollBars = ssBoth
|
||||||
|
TabOrder = 11
|
||||||
|
OnChange = RichDebugChange
|
||||||
|
end
|
||||||
object SaveDialog: TSaveDialog
|
object SaveDialog: TSaveDialog
|
||||||
Left = 768
|
Left = 768
|
||||||
Top = 488
|
Top = 488
|
||||||
@@ -467,4 +474,12 @@ object FormDebug: TFormDebug
|
|||||||
OnClick = copier1Click
|
OnClick = copier1Click
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
object PopupMenuRD: TPopupMenu
|
||||||
|
Left = 808
|
||||||
|
Top = 360
|
||||||
|
object Copier2: TMenuItem
|
||||||
|
Caption = 'Copier'
|
||||||
|
OnClick = Copier2Click
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
+36
-19
@@ -15,7 +15,6 @@ type
|
|||||||
SaveDialog: TSaveDialog;
|
SaveDialog: TSaveDialog;
|
||||||
ButtonEcrLog: TButton;
|
ButtonEcrLog: TButton;
|
||||||
Label3: TLabel;
|
Label3: TLabel;
|
||||||
MemoDebug: TMemo;
|
|
||||||
ButtonRazTampon: TButton;
|
ButtonRazTampon: TButton;
|
||||||
ButtonCherche: TButton;
|
ButtonCherche: TButton;
|
||||||
ButtonAffEvtChrono: TButton;
|
ButtonAffEvtChrono: TButton;
|
||||||
@@ -44,6 +43,9 @@ type
|
|||||||
EditActuel: TEdit;
|
EditActuel: TEdit;
|
||||||
Button1: TButton;
|
Button1: TButton;
|
||||||
Button2: TButton;
|
Button2: TButton;
|
||||||
|
RichDebug: TRichEdit;
|
||||||
|
PopupMenuRD: TPopupMenu;
|
||||||
|
Copier2: TMenuItem;
|
||||||
procedure FormCreate(Sender: TObject);
|
procedure FormCreate(Sender: TObject);
|
||||||
procedure ButtonEcrLogClick(Sender: TObject);
|
procedure ButtonEcrLogClick(Sender: TObject);
|
||||||
procedure EditNivDebugKeyPress(Sender: TObject; var Key: Char);
|
procedure EditNivDebugKeyPress(Sender: TObject; var Key: Char);
|
||||||
@@ -65,6 +67,8 @@ type
|
|||||||
procedure ButtonCanSuivSigClick(Sender: TObject);
|
procedure ButtonCanSuivSigClick(Sender: TObject);
|
||||||
procedure Button1Click(Sender: TObject);
|
procedure Button1Click(Sender: TObject);
|
||||||
procedure Button2Click(Sender: TObject);
|
procedure Button2Click(Sender: TObject);
|
||||||
|
procedure Copier2Click(Sender: TObject);
|
||||||
|
procedure RichDebugChange(Sender: TObject);
|
||||||
private
|
private
|
||||||
{ Déclarations privées }
|
{ Déclarations privées }
|
||||||
public
|
public
|
||||||
@@ -113,11 +117,6 @@ uses UnitPrinc;
|
|||||||
|
|
||||||
{$R *.dfm}
|
{$R *.dfm}
|
||||||
|
|
||||||
procedure AfficheDebug(s : string;lacouleur : TColor);
|
|
||||||
begin
|
|
||||||
FormDebug.MemoDebug.Lines.add(s);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure RE_ColorLine(ARichEdit : TRichEdit;ARow : Integer;AColor : TColor);
|
procedure RE_ColorLine(ARichEdit : TRichEdit;ARow : Integer;AColor : TColor);
|
||||||
begin
|
begin
|
||||||
with ARichEdit do
|
with ARichEdit do
|
||||||
@@ -129,6 +128,13 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure AfficheDebug(s : string;lacouleur : TColor);
|
||||||
|
begin
|
||||||
|
FormDebug.RichDebug.Lines.add(s);
|
||||||
|
RE_ColorLine(FormDebug.RichDebug,FormDebug.RichDebug.lines.count-1,lacouleur);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TFormDebug.FormCreate(Sender: TObject);
|
procedure TFormDebug.FormCreate(Sender: TObject);
|
||||||
var s: string;
|
var s: string;
|
||||||
i : integer;
|
i : integer;
|
||||||
@@ -138,14 +144,14 @@ begin
|
|||||||
s:=s+'comportement du programme. Positionner le niveau de 1 à 3 pour';
|
s:=s+'comportement du programme. Positionner le niveau de 1 à 3 pour';
|
||||||
s:=s+' afficher des informations plus ou moins détaillées.';
|
s:=s+' afficher des informations plus ou moins détaillées.';
|
||||||
Label3.caption:=s;
|
Label3.caption:=s;
|
||||||
MemoDebug.WordWrap:=false; // interdit la coupure des chaînes en limite du composant
|
RichDebug.WordWrap:=false; // interdit la coupure des chaînes en limite du composant
|
||||||
MemoDebug.color:=$33;
|
RichDebug.color:=$33;
|
||||||
initform:=false;
|
initform:=false;
|
||||||
MemoDebug.clear;
|
RichDebug.clear;
|
||||||
s:=DateToStr(date)+' '+TimeToStr(Time)+' ';
|
s:=DateToStr(date)+' '+TimeToStr(Time)+' ';
|
||||||
if IsWow64Process then s:=s+' OS 64 Bits' else s:=s+' OS 32 Bits';
|
if IsWow64Process then s:=s+' OS 64 Bits' else s:=s+' OS 32 Bits';
|
||||||
RichEdit.color:=$111122;
|
RichEdit.color:=$111122;
|
||||||
MemoDebug.Lines.add(s);
|
RichDebug.Lines.add(s);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TFormDebug.ButtonEcrLogClick(Sender: TObject);
|
procedure TFormDebug.ButtonEcrLogClick(Sender: TObject);
|
||||||
@@ -163,7 +169,7 @@ begin
|
|||||||
assignFile(fte,s);
|
assignFile(fte,s);
|
||||||
rewrite(fte);
|
rewrite(fte);
|
||||||
writeln(fte,s);
|
writeln(fte,s);
|
||||||
with MemoDebug do
|
with RichDebug do
|
||||||
for i:=0 to Lines.Count do
|
for i:=0 to Lines.Count do
|
||||||
begin
|
begin
|
||||||
writeln(fte,Lines[i]);
|
writeln(fte,Lines[i]);
|
||||||
@@ -186,7 +192,7 @@ begin
|
|||||||
end
|
end
|
||||||
else EditNivDebug.text:='0';
|
else EditNivDebug.text:='0';
|
||||||
end;
|
end;
|
||||||
MemoDebug.Lines.add('Niveau='+intToSTR(NivDebug));
|
RichDebug.Lines.add('Niveau='+intToSTR(NivDebug));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@@ -208,7 +214,7 @@ var i : integer;
|
|||||||
trouve : boolean;
|
trouve : boolean;
|
||||||
begin
|
begin
|
||||||
|
|
||||||
with MemoDebug do
|
with RichDebug do
|
||||||
begin
|
begin
|
||||||
i:=0;
|
i:=0;
|
||||||
repeat
|
repeat
|
||||||
@@ -229,7 +235,7 @@ procedure TFormDebug.ButtonAffEvtChronoClick(Sender: TObject);
|
|||||||
var i,j,etat : integer;
|
var i,j,etat : integer;
|
||||||
s : string;
|
s : string;
|
||||||
begin
|
begin
|
||||||
MemoDebug.Clear;
|
RichDebug.Clear;
|
||||||
if N_event_tick=0 then
|
if N_event_tick=0 then
|
||||||
begin
|
begin
|
||||||
AfficheDebug('Il n''y a aucun évènement détecteur ou aiguillage',clyellow);
|
AfficheDebug('Il n''y a aucun évènement détecteur ou aiguillage',clyellow);
|
||||||
@@ -269,17 +275,15 @@ end;
|
|||||||
|
|
||||||
procedure TFormDebug.CheckTrameClick(Sender: TObject);
|
procedure TFormDebug.CheckTrameClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
trace:=CheckTrame.Checked;
|
traceTrames:=CheckTrame.Checked;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TFormDebug.ButtonCopClick(Sender: TObject);
|
procedure TFormDebug.ButtonCopClick(Sender: TObject);
|
||||||
var i : integer;
|
var i : integer;
|
||||||
begin
|
begin
|
||||||
MemoDebug.Lines:=Formprinc.ListBox1.Items
|
RichDebug.Lines:=Formprinc.FenRich.lines;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
procedure TFormDebug.copier1Click(Sender: TObject);
|
procedure TFormDebug.copier1Click(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
RichEdit.SelectAll;
|
RichEdit.SelectAll;
|
||||||
@@ -289,7 +293,7 @@ end;
|
|||||||
|
|
||||||
procedure TFormDebug.ButtonRazLogClick(Sender: TObject);
|
procedure TFormDebug.ButtonRazLogClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
MemoDebug.Clear;
|
RichDebug.Clear;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TFormDebug.CheckBoxActClick(Sender: TObject);
|
procedure TFormDebug.CheckBoxActClick(Sender: TObject);
|
||||||
@@ -376,4 +380,17 @@ begin
|
|||||||
NivDebug:=AncDebug;
|
NivDebug:=AncDebug;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TFormDebug.Copier2Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
RichDebug.SelectAll;
|
||||||
|
RichDebug.CopyToClipboard;
|
||||||
|
RichDebug.SetFocus;
|
||||||
|
end;
|
||||||
|
|
||||||
|
// pour déplacer l'ascenseur de l'affichage automatiquement en bas
|
||||||
|
procedure TFormDebug.RichDebugChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
SendMessage(RichDebug.handle, WM_VSCROLL, SB_BOTTOM, 0);
|
||||||
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|||||||
Binary file not shown.
+37
-24
@@ -1,6 +1,6 @@
|
|||||||
object FormPrinc: TFormPrinc
|
object FormPrinc: TFormPrinc
|
||||||
Left = 12
|
Left = 1296
|
||||||
Top = 210
|
Top = 222
|
||||||
Width = 1212
|
Width = 1212
|
||||||
Height = 664
|
Height = 664
|
||||||
Caption = 'Client TCP-IP CDM Rail ou USB - syst'#232'me LENZ'
|
Caption = 'Client TCP-IP CDM Rail ou USB - syst'#232'me LENZ'
|
||||||
@@ -1201,24 +1201,6 @@ object FormPrinc: TFormPrinc
|
|||||||
Font.Style = []
|
Font.Style = []
|
||||||
ParentFont = False
|
ParentFont = False
|
||||||
end
|
end
|
||||||
object ListBox1: TListBox
|
|
||||||
Left = 8
|
|
||||||
Top = 48
|
|
||||||
Width = 609
|
|
||||||
Height = 505
|
|
||||||
Style = lbOwnerDrawFixed
|
|
||||||
Anchors = [akLeft, akTop, akRight, akBottom]
|
|
||||||
Color = clBlack
|
|
||||||
Font.Charset = ANSI_CHARSET
|
|
||||||
Font.Color = clBlue
|
|
||||||
Font.Height = 16
|
|
||||||
Font.Name = 'Arial'
|
|
||||||
Font.Style = []
|
|
||||||
ItemHeight = 16
|
|
||||||
ParentFont = False
|
|
||||||
TabOrder = 0
|
|
||||||
OnDrawItem = ListBox1DrawItem
|
|
||||||
end
|
|
||||||
object ScrollBox1: TScrollBox
|
object ScrollBox1: TScrollBox
|
||||||
Left = 631
|
Left = 631
|
||||||
Top = 168
|
Top = 168
|
||||||
@@ -1231,7 +1213,7 @@ object FormPrinc: TFormPrinc
|
|||||||
Anchors = [akTop, akRight, akBottom]
|
Anchors = [akTop, akRight, akBottom]
|
||||||
Color = clWhite
|
Color = clWhite
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
TabOrder = 1
|
TabOrder = 0
|
||||||
end
|
end
|
||||||
object GroupBox1: TGroupBox
|
object GroupBox1: TGroupBox
|
||||||
Left = 631
|
Left = 631
|
||||||
@@ -1240,7 +1222,7 @@ object FormPrinc: TFormPrinc
|
|||||||
Height = 129
|
Height = 129
|
||||||
Anchors = [akTop, akRight]
|
Anchors = [akTop, akRight]
|
||||||
Caption = 'Commande d'#39'accessoires'
|
Caption = 'Commande d'#39'accessoires'
|
||||||
TabOrder = 2
|
TabOrder = 1
|
||||||
object Label2: TLabel
|
object Label2: TLabel
|
||||||
Left = 7
|
Left = 7
|
||||||
Top = 16
|
Top = 16
|
||||||
@@ -1339,7 +1321,7 @@ object FormPrinc: TFormPrinc
|
|||||||
Width = 281
|
Width = 281
|
||||||
Height = 129
|
Height = 129
|
||||||
Anchors = [akTop, akRight]
|
Anchors = [akTop, akRight]
|
||||||
TabOrder = 5
|
TabOrder = 4
|
||||||
object BoutonRaf: TButton
|
object BoutonRaf: TButton
|
||||||
Left = 8
|
Left = 8
|
||||||
Top = 8
|
Top = 8
|
||||||
@@ -1439,7 +1421,7 @@ object FormPrinc: TFormPrinc
|
|||||||
Height = 25
|
Height = 25
|
||||||
Anchors = [akTop, akRight]
|
Anchors = [akTop, akRight]
|
||||||
Caption = 'Panel2'
|
Caption = 'Panel2'
|
||||||
TabOrder = 6
|
TabOrder = 5
|
||||||
object Label1: TLabel
|
object Label1: TLabel
|
||||||
Left = 16
|
Left = 16
|
||||||
Top = 4
|
Top = 4
|
||||||
@@ -1468,7 +1450,26 @@ object FormPrinc: TFormPrinc
|
|||||||
Height = 17
|
Height = 17
|
||||||
Anchors = [akLeft, akRight, akBottom]
|
Anchors = [akLeft, akRight, akBottom]
|
||||||
Caption = 'xx'
|
Caption = 'xx'
|
||||||
|
TabOrder = 6
|
||||||
|
end
|
||||||
|
object FenRich: TRichEdit
|
||||||
|
Left = 8
|
||||||
|
Top = 48
|
||||||
|
Width = 617
|
||||||
|
Height = 497
|
||||||
|
Anchors = [akLeft, akTop, akRight, akBottom]
|
||||||
|
Color = clBlack
|
||||||
|
Font.Charset = DEFAULT_CHARSET
|
||||||
|
Font.Color = clYellow
|
||||||
|
Font.Height = -13
|
||||||
|
Font.Name = 'MS Sans Serif'
|
||||||
|
Font.Style = []
|
||||||
|
ParentFont = False
|
||||||
|
PopupMenu = PopupMenuFenRich
|
||||||
|
ReadOnly = True
|
||||||
|
ScrollBars = ssBoth
|
||||||
TabOrder = 7
|
TabOrder = 7
|
||||||
|
OnChange = FenRichChange
|
||||||
end
|
end
|
||||||
object Timer1: TTimer
|
object Timer1: TTimer
|
||||||
Interval = 100
|
Interval = 100
|
||||||
@@ -1499,6 +1500,10 @@ object FormPrinc: TFormPrinc
|
|||||||
Caption = 'Etat des aiguillages'
|
Caption = 'Etat des aiguillages'
|
||||||
OnClick = Etatdesaiguillages1Click
|
OnClick = Etatdesaiguillages1Click
|
||||||
end
|
end
|
||||||
|
object Etatdessignaux1: TMenuItem
|
||||||
|
Caption = 'Etat des signaux'
|
||||||
|
OnClick = Etatdessignaux1Click
|
||||||
|
end
|
||||||
object N3: TMenuItem
|
object N3: TMenuItem
|
||||||
Caption = '-'
|
Caption = '-'
|
||||||
end
|
end
|
||||||
@@ -1611,4 +1616,12 @@ object FormPrinc: TFormPrinc
|
|||||||
Left = 888
|
Left = 888
|
||||||
Top = 16
|
Top = 16
|
||||||
end
|
end
|
||||||
|
object PopupMenuFenRich: TPopupMenu
|
||||||
|
Left = 208
|
||||||
|
Top = 24
|
||||||
|
object Copier1: TMenuItem
|
||||||
|
Caption = 'Copier'
|
||||||
|
OnClick = Copier1Click
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
+94
-81
@@ -20,7 +20,6 @@ uses
|
|||||||
|
|
||||||
type
|
type
|
||||||
TFormPrinc = class(TForm)
|
TFormPrinc = class(TForm)
|
||||||
ListBox1: TListBox;
|
|
||||||
Timer1: TTimer;
|
Timer1: TTimer;
|
||||||
LabelTitre: TLabel;
|
LabelTitre: TLabel;
|
||||||
ScrollBox1: TScrollBox;
|
ScrollBox1: TScrollBox;
|
||||||
@@ -91,6 +90,10 @@ type
|
|||||||
ButtonLanceCDM: TButton;
|
ButtonLanceCDM: TButton;
|
||||||
Affichefentredebug1: TMenuItem;
|
Affichefentredebug1: TMenuItem;
|
||||||
StaticText: TStaticText;
|
StaticText: TStaticText;
|
||||||
|
FenRich: TRichEdit;
|
||||||
|
PopupMenuFenRich: TPopupMenu;
|
||||||
|
Copier1: TMenuItem;
|
||||||
|
Etatdessignaux1: TMenuItem;
|
||||||
procedure FormCreate(Sender: TObject);
|
procedure FormCreate(Sender: TObject);
|
||||||
procedure MSCommUSBLenzComm(Sender: TObject);
|
procedure MSCommUSBLenzComm(Sender: TObject);
|
||||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||||
@@ -98,8 +101,6 @@ type
|
|||||||
procedure BoutVersionClick(Sender: TObject);
|
procedure BoutVersionClick(Sender: TObject);
|
||||||
procedure ButtonCommandeClick(Sender: TObject);
|
procedure ButtonCommandeClick(Sender: TObject);
|
||||||
procedure EditvalEnter(Sender: TObject);
|
procedure EditvalEnter(Sender: TObject);
|
||||||
procedure ListBox1DrawItem(Control: TWinControl; Index: Integer;
|
|
||||||
Rect: TRect; State: TOwnerDrawState);
|
|
||||||
procedure BoutonRafClick(Sender: TObject);
|
procedure BoutonRafClick(Sender: TObject);
|
||||||
procedure ClientSocketLenzError(Sender: TObject; Socket: TCustomWinSocket;
|
procedure ClientSocketLenzError(Sender: TObject; Socket: TCustomWinSocket;
|
||||||
ErrorEvent: TErrorEvent; var ErrorCode: Integer);
|
ErrorEvent: TErrorEvent; var ErrorCode: Integer);
|
||||||
@@ -143,7 +144,9 @@ type
|
|||||||
procedure ButtonAffTCOClick(Sender: TObject);
|
procedure ButtonAffTCOClick(Sender: TObject);
|
||||||
procedure ButtonLanceCDMClick(Sender: TObject);
|
procedure ButtonLanceCDMClick(Sender: TObject);
|
||||||
procedure Affichefentredebug1Click(Sender: TObject);
|
procedure Affichefentredebug1Click(Sender: TObject);
|
||||||
procedure Button1Click(Sender: TObject);
|
procedure FenRichChange(Sender: TObject);
|
||||||
|
procedure Copier1Click(Sender: TObject);
|
||||||
|
procedure Etatdessignaux1Click(Sender: TObject);
|
||||||
private
|
private
|
||||||
{ Déclarations privées }
|
{ Déclarations privées }
|
||||||
procedure DoHint(Sender : Tobject);
|
procedure DoHint(Sender : Tobject);
|
||||||
@@ -236,7 +239,7 @@ var
|
|||||||
branche : array [1..100] of string;
|
branche : array [1..100] of string;
|
||||||
|
|
||||||
FormPrinc: TFormPrinc;
|
FormPrinc: TFormPrinc;
|
||||||
ack,portCommOuvert,trace,AffMem,AfficheDet,CDM_connecte,SocketCDM_connecte,
|
ack,portCommOuvert,traceTrames,AffMem,AfficheDet,CDM_connecte,SocketCDM_connecte,
|
||||||
Raz_Acc_signaux,AvecInit,AvecTCO,terminal,Srvc_Aig,Srvc_Det,Srvc_Act,
|
Raz_Acc_signaux,AvecInit,AvecTCO,terminal,Srvc_Aig,Srvc_Det,Srvc_Act,
|
||||||
Srvc_PosTrain,Srvc_Sig,debugtrames : boolean;
|
Srvc_PosTrain,Srvc_Sig,debugtrames : boolean;
|
||||||
tablo : array of byte; // tableau rx usb
|
tablo : array of byte; // tableau rx usb
|
||||||
@@ -414,10 +417,8 @@ begin
|
|||||||
begin
|
begin
|
||||||
brush.Color:=couleur;
|
brush.Color:=couleur;
|
||||||
Pen.Color:=clBlack;
|
Pen.Color:=clBlack;
|
||||||
//Affiche('clignote '+IntToSTR(x)+' '+intToSTR(y),clyellow);
|
|
||||||
Ellipse(x-rayon,y-rayon,x+rayon,y+rayon);
|
Ellipse(x-rayon,y-rayon,x+rayon,y+rayon);
|
||||||
end;
|
end;
|
||||||
//Affiche(IntToSTR(y),clyellow);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// dessine les feux sur une cible à 2 feux dans le canvas spécifié
|
// dessine les feux sur une cible à 2 feux dans le canvas spécifié
|
||||||
@@ -1045,7 +1046,7 @@ begin
|
|||||||
cercle(ACanvas,12,13,6,GrisF);
|
cercle(ACanvas,12,13,6,GrisF);
|
||||||
cercle(ACanvas,25,13,6,GrisF);
|
cercle(ACanvas,25,13,6,GrisF);
|
||||||
end;
|
end;
|
||||||
if EtatSignal=1 then
|
if EtatSignal=1 then
|
||||||
begin
|
begin
|
||||||
cercle(ACanvas,12,13,6,clWhite);
|
cercle(ACanvas,12,13,6,clWhite);
|
||||||
cercle(ACanvas,25,13,6,GrisF);
|
cercle(ACanvas,25,13,6,GrisF);
|
||||||
@@ -1058,19 +1059,18 @@ begin
|
|||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
// affiche un texte dans la fenêtre
|
|
||||||
procedure Affiche(s : string;lacouleur : TColor);
|
procedure Affiche(s : string;lacouleur : TColor);
|
||||||
begin
|
begin
|
||||||
couleur:=lacouleur;
|
with formprinc do
|
||||||
with formprinc.ListBox1 do
|
|
||||||
begin
|
begin
|
||||||
Items.addObject(s,pointer(lacouleur));
|
FenRich.lines.add(s);
|
||||||
TopIndex:= Items.Count - 1;
|
RE_ColorLine(FenRich,FenRich.lines.count-1,lacouleur);
|
||||||
|
//FenRich.SetFocus;
|
||||||
|
//FenRich.SelStart := FenRich.GetTextLen;
|
||||||
|
//FenRich.Perform(EM_SCROLLCARET, 0, 0);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
// renvoie l'index du feu dans le tableau feux[] en fonction de son adresse
|
// renvoie l'index du feu dans le tableau feux[] en fonction de son adresse
|
||||||
//si pas de feu renvoie 0
|
//si pas de feu renvoie 0
|
||||||
function Index_feu(adresse : integer) : integer;
|
function Index_feu(adresse : integer) : integer;
|
||||||
@@ -1265,7 +1265,7 @@ end;
|
|||||||
// Affiche une chaîne en Hexa Ascii
|
// Affiche une chaîne en Hexa Ascii
|
||||||
procedure affiche_chaine_hex(s : string;couleur : Tcolor);
|
procedure affiche_chaine_hex(s : string;couleur : Tcolor);
|
||||||
begin
|
begin
|
||||||
if trace then Affiche(chaine_HEX(s),couleur);
|
if traceTrames then AfficheDebug(chaine_HEX(s),couleur);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// temporisation en x 100 ms (0,1 s)
|
// temporisation en x 100 ms (0,1 s)
|
||||||
@@ -1285,7 +1285,7 @@ var i,timeout,valto : integer;
|
|||||||
begin
|
begin
|
||||||
// com:=formprinc.MSCommUSBLenz;
|
// com:=formprinc.MSCommUSBLenz;
|
||||||
s:=entete+s+suffixe;
|
s:=entete+s+suffixe;
|
||||||
if Trace then Affiche('Tick='+IntToSTR(tick)+'/Env '+chaine_Hex(s),ClGreen);
|
if traceTrames then AfficheDebug('Tick='+IntToSTR(tick)+'/Env '+chaine_Hex(s),ClGreen);
|
||||||
// par port com-usb
|
// par port com-usb
|
||||||
|
|
||||||
if portCommOuvert then
|
if portCommOuvert then
|
||||||
@@ -3570,10 +3570,9 @@ begin
|
|||||||
trouve_fonte:=true;
|
trouve_fonte:=true;
|
||||||
delete(s,i,length(sa));
|
delete(s,i,length(sa));
|
||||||
TailleFonte:=StrToINT(s);
|
TailleFonte:=StrToINT(s);
|
||||||
with FormPrinc.ListBox1 do
|
with FormPrinc.FenRich do
|
||||||
begin
|
begin
|
||||||
Font.Height:=TailleFonte;
|
Font.Size:=TailleFonte;
|
||||||
ItemHeight:=TailleFonte+1;
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -4041,8 +4040,7 @@ begin
|
|||||||
s:=lit_ligne;
|
s:=lit_ligne;
|
||||||
mod_Branches[Nligne]:=s;inc(Nligne);
|
mod_Branches[Nligne]:=s;inc(Nligne);
|
||||||
//Affiche(s,clWhite);
|
//Affiche(s,clWhite);
|
||||||
//adresse:=pos('0',s);
|
|
||||||
//s:='A16B,557,0' ;
|
|
||||||
if s<>'0' then
|
if s<>'0' then
|
||||||
begin
|
begin
|
||||||
branche[i]:=s;
|
branche[i]:=s;
|
||||||
@@ -4077,6 +4075,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
//Affiche(IntToSTR(detect),clyellow);
|
//Affiche(IntToSTR(detect),clyellow);
|
||||||
//Affiche(s,clorange); Affiche(IntToStr(detect),clorange);
|
//Affiche(s,clorange); Affiche(IntToStr(detect),clorange);
|
||||||
|
//if detect=0 then affiche('buttoir'+sOrigine,clyellow);
|
||||||
BrancheN[i,j].adresse:=detect; // adresse
|
BrancheN[i,j].adresse:=detect; // adresse
|
||||||
BrancheN[i,j].btype:=1;// ident détecteur
|
BrancheN[i,j].btype:=1;// ident détecteur
|
||||||
if detect=0 then begin BrancheN[i,j].btype:=4;end; // buttoir
|
if detect=0 then begin BrancheN[i,j].btype:=4;end; // buttoir
|
||||||
@@ -5239,7 +5238,8 @@ end;
|
|||||||
|
|
||||||
// renvoie l'adresse du détecteur suivant des deux éléments contigus
|
// renvoie l'adresse du détecteur suivant des deux éléments contigus
|
||||||
// TypeElprec/actuel: 1= détecteur 2= aiguillage 4=Buttoir
|
// TypeElprec/actuel: 1= détecteur 2= aiguillage 4=Buttoir
|
||||||
function detecteur_suivant(prec : integer;TypeElPrec : integer;actuel : integer;TypeElActuel : integer) : integer ;
|
// algo= type d'algorythme pour suivant_alg3
|
||||||
|
function detecteur_suivant(prec : integer;TypeElPrec : integer;actuel : integer;TypeElActuel,algo : integer) : integer ;
|
||||||
var actuelCalc,PrecCalc,etat,i,j,AdrSuiv ,
|
var actuelCalc,PrecCalc,etat,i,j,AdrSuiv ,
|
||||||
TypeprecCalc,TypeActuelCalc : integer;
|
TypeprecCalc,TypeActuelCalc : integer;
|
||||||
begin
|
begin
|
||||||
@@ -5253,7 +5253,7 @@ begin
|
|||||||
// étape 1 trouver le sens
|
// étape 1 trouver le sens
|
||||||
repeat
|
repeat
|
||||||
inc(j);
|
inc(j);
|
||||||
AdrSuiv:=suivant_alg3(precCalc,TypeprecCalc,actuelCalc,TypeActuelCalc,1);
|
AdrSuiv:=suivant_alg3(precCalc,TypeprecCalc,actuelCalc,TypeActuelCalc,algo);
|
||||||
if (typeGen=2) and false then // si le précédent est une TJD/S et le suivant aussi
|
if (typeGen=2) and false then // si le précédent est une TJD/S et le suivant aussi
|
||||||
begin
|
begin
|
||||||
if ((aiguillage[AdrSuiv].modele=2) or (aiguillage[AdrSuiv].modele=3)) and
|
if ((aiguillage[AdrSuiv].modele=2) or (aiguillage[AdrSuiv].modele=3)) and
|
||||||
@@ -5270,6 +5270,7 @@ begin
|
|||||||
TypeActuelCalc:=typeGen;
|
TypeActuelCalc:=typeGen;
|
||||||
//Affiche('Suivant signalaig='+IntToSTR(AdrSuiv),clyellow);
|
//Affiche('Suivant signalaig='+IntToSTR(AdrSuiv),clyellow);
|
||||||
until (j=10) or (typeGen=1) or (AdrSuiv=0) or (AdrSuiv>=9996); // arret si détecteur
|
until (j=10) or (typeGen=1) or (AdrSuiv=0) or (AdrSuiv>=9996); // arret si détecteur
|
||||||
|
|
||||||
// si trouvé le sens, trouver le suivant
|
// si trouvé le sens, trouver le suivant
|
||||||
if AdrSuiv=actuel then
|
if AdrSuiv=actuel then
|
||||||
begin
|
begin
|
||||||
@@ -5398,7 +5399,7 @@ begin
|
|||||||
if j=2 then i1:=IndexBranche_det1-1;
|
if j=2 then i1:=IndexBranche_det1-1;
|
||||||
if NivDebug=3 then
|
if NivDebug=3 then
|
||||||
begin
|
begin
|
||||||
s:='Test 1 en ';
|
s:='Test en ';
|
||||||
if (j=1) then s:=s+'incrément ' else s:=s+'décrément ';
|
if (j=1) then s:=s+'incrément ' else s:=s+'décrément ';
|
||||||
s:=s+'- départ depuis élément '+IntToSTR(el1)+' trouvé en index='+intToSTR(IndexBranche_det1)+' Branche='+intToSTR(branche_trouve_det1);
|
s:=s+'- départ depuis élément '+IntToSTR(el1)+' trouvé en index='+intToSTR(IndexBranche_det1)+' Branche='+intToSTR(branche_trouve_det1);
|
||||||
AfficheDebug(s,clyellow);
|
AfficheDebug(s,clyellow);
|
||||||
@@ -5434,7 +5435,7 @@ begin
|
|||||||
sortie:=((typeDet2=TypeGen) and (Adr=el2)) or (Adr=0) or (Adr>=9996) or (i=15) or (N_Det=Nb_det_dist);
|
sortie:=((typeDet2=TypeGen) and (Adr=el2)) or (Adr=0) or (Adr>=9996) or (i=15) or (N_Det=Nb_det_dist);
|
||||||
until sortie ;
|
until sortie ;
|
||||||
if (i=15) and (Nivdebug=3) then afficheDebug('Pas trouvé',clyellow);
|
if (i=15) and (Nivdebug=3) then afficheDebug('Pas trouvé',clyellow);
|
||||||
if (N_det=Nb_det_dist) and (Nivdebug=3) then afficheDebug('Détecteurs trop distants',clyellow);
|
if (N_det=Nb_det_dist) and (Nivdebug=3) then afficheDebug('Détecteurs trop distants',clred);
|
||||||
end
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
@@ -5443,7 +5444,7 @@ begin
|
|||||||
adr:=el2;typeGen:=TypeDet2;
|
adr:=el2;typeGen:=TypeDet2;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if (typeDet2=TypeGen) and (Adr=el2) then
|
if (typeDet2=TypeGen) and (Adr=el2) and (N_Det<>Nb_det_dist) then
|
||||||
begin
|
begin
|
||||||
if Nivdebug=3 then AfficheDebug('614 : Trouvé '+intToSTR(el2),clYellow);
|
if Nivdebug=3 then AfficheDebug('614 : Trouvé '+intToSTR(el2),clYellow);
|
||||||
i:=0;
|
i:=0;
|
||||||
@@ -5458,6 +5459,7 @@ begin
|
|||||||
case typeGen of
|
case typeGen of
|
||||||
1 : s:=s+' detecteur';
|
1 : s:=s+' detecteur';
|
||||||
2 : s:=s+' aiguillage';
|
2 : s:=s+' aiguillage';
|
||||||
|
4 : s:=s+' buttoir';
|
||||||
end;
|
end;
|
||||||
AfficheDebug(s,clorange);
|
AfficheDebug(s,clorange);
|
||||||
end;
|
end;
|
||||||
@@ -5468,7 +5470,7 @@ begin
|
|||||||
sortie:=(TypeGen=1) or (Adr=0) or (Adr>=9996) or (i=10);
|
sortie:=(TypeGen=1) or (Adr=0) or (Adr>=9996) or (i=10);
|
||||||
until sortie;
|
until sortie;
|
||||||
|
|
||||||
if TypeGen=1 then
|
if (TypeGen=1) or (TypeGen=4) then
|
||||||
begin
|
begin
|
||||||
if NivDebug=3 then
|
if NivDebug=3 then
|
||||||
begin
|
begin
|
||||||
@@ -5482,7 +5484,7 @@ begin
|
|||||||
if (i=10) then if NivDebug=3 then AfficheDebug('201 : Itération trop longue',clred);
|
if (i=10) then if NivDebug=3 then AfficheDebug('201 : Itération trop longue',clred);
|
||||||
inc(j);
|
inc(j);
|
||||||
//AfficheDebug('j='+intToSTR(j),clyellow);
|
//AfficheDebug('j='+intToSTR(j),clyellow);
|
||||||
until j=3;
|
until j=3; // boucle incrément/décrément
|
||||||
|
|
||||||
detecteur_suivant_el:=9996;
|
detecteur_suivant_el:=9996;
|
||||||
if NivDebug=3 then affichedebug('------------------',clyellow);
|
if NivDebug=3 then affichedebug('------------------',clyellow);
|
||||||
@@ -5866,7 +5868,7 @@ begin
|
|||||||
ife:=1; // index feu de 1 à 4 pour explorer les 4 détecteurs d'un feu
|
ife:=1; // index feu de 1 à 4 pour explorer les 4 détecteurs d'un feu
|
||||||
repeat
|
repeat
|
||||||
j:=0;
|
j:=0;
|
||||||
if NivDebug=3 then AfficheDebug('Boucle de test feu '+intToSTR(ife)+'/4',clred);
|
if NivDebug=3 then AfficheDebug('Boucle de test feu '+intToSTR(ife)+'/4',clOrange);
|
||||||
if (ife=1) then
|
if (ife=1) then
|
||||||
begin
|
begin
|
||||||
prec:=feux[i].Adr_det1;
|
prec:=feux[i].Adr_det1;
|
||||||
@@ -5934,7 +5936,7 @@ begin
|
|||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if NivDebug=3 then AfficheDebug('130 - suivant='+IntToSTR(adrsuiv),clred);
|
if NivDebug=3 then AfficheDebug('132 - suivant='+IntToSTR(adrsuiv),clYellow);
|
||||||
if actuel=0 then
|
if actuel=0 then
|
||||||
begin
|
begin
|
||||||
// si c'est un buttoir
|
// si c'est un buttoir
|
||||||
@@ -6072,13 +6074,13 @@ begin
|
|||||||
test_route_valide:=10 ;
|
test_route_valide:=10 ;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
// présence train 3 détecteurs avant le feu
|
// présence train 3 détecteurs avant le feu
|
||||||
function PresTrainPrec(AdrFeu : integer) : boolean;
|
function PresTrainPrec(AdrFeu : integer) : boolean;
|
||||||
var PresTrain : boolean;
|
var PresTrain : boolean;
|
||||||
j,i,Det_initial,Adr_El_Suiv,Btype_el_suivant,DetPrec1,DetPrec2,DetPrec3,DetPrec4 : integer;
|
j,i,Det_initial,Adr_El_Suiv,Btype_el_suivant,DetPrec1,DetPrec2,DetPrec3,DetPrec4 : integer;
|
||||||
begin
|
begin
|
||||||
i:=index_feu(Adrfeu);
|
i:=index_feu(Adrfeu);
|
||||||
//memZone[518,520]:=true;
|
|
||||||
if i=0 then
|
if i=0 then
|
||||||
begin
|
begin
|
||||||
Affiche('Erreur 602 - feu '+IntToSTR(adrFeu)+' non trouvé',clred);
|
Affiche('Erreur 602 - feu '+IntToSTR(adrFeu)+' non trouvé',clred);
|
||||||
@@ -6104,27 +6106,27 @@ begin
|
|||||||
if (j=2) then
|
if (j=2) then
|
||||||
begin
|
begin
|
||||||
det_initial:=feux[i].Adr_det2;Adr_El_Suiv:=feux[i].Adr_el_suiv2;
|
det_initial:=feux[i].Adr_det2;Adr_El_Suiv:=feux[i].Adr_el_suiv2;
|
||||||
if feux[i].Btype_suiv1=1 then Btype_el_suivant:=1;
|
if feux[i].Btype_suiv2=1 then Btype_el_suivant:=1;
|
||||||
if feux[i].Btype_suiv1=2 then Btype_el_suivant:=2;
|
if feux[i].Btype_suiv2=2 then Btype_el_suivant:=2;
|
||||||
if feux[i].Btype_suiv1=4 then Btype_el_suivant:=2;
|
if feux[i].Btype_suiv2=4 then Btype_el_suivant:=2;
|
||||||
end;
|
end;
|
||||||
if (j=3) then
|
if (j=3) then
|
||||||
begin
|
begin
|
||||||
det_initial:=feux[i].Adr_det3;Adr_El_Suiv:=feux[i].Adr_el_suiv3;
|
det_initial:=feux[i].Adr_det3;Adr_El_Suiv:=feux[i].Adr_el_suiv3;
|
||||||
if feux[i].Btype_suiv1=1 then Btype_el_suivant:=1;
|
if feux[i].Btype_suiv3=1 then Btype_el_suivant:=1;
|
||||||
if feux[i].Btype_suiv1=2 then Btype_el_suivant:=2;
|
if feux[i].Btype_suiv3=2 then Btype_el_suivant:=2;
|
||||||
if feux[i].Btype_suiv1=4 then Btype_el_suivant:=2;
|
if feux[i].Btype_suiv3=4 then Btype_el_suivant:=2;
|
||||||
end;
|
end;
|
||||||
if (j=4) then
|
if (j=4) then
|
||||||
begin
|
begin
|
||||||
det_initial:=feux[i].Adr_det4;Adr_El_Suiv:=feux[i].Adr_el_suiv4;
|
det_initial:=feux[i].Adr_det4;Adr_El_Suiv:=feux[i].Adr_el_suiv4;
|
||||||
if feux[i].Btype_suiv1=1 then Btype_el_suivant:=1;
|
if feux[i].Btype_suiv4=1 then Btype_el_suivant:=1;
|
||||||
if feux[i].Btype_suiv1=2 then Btype_el_suivant:=2;
|
if feux[i].Btype_suiv4=2 then Btype_el_suivant:=2;
|
||||||
if feux[i].Btype_suiv1=4 then Btype_el_suivant:=2;
|
if feux[i].Btype_suiv4=4 then Btype_el_suivant:=2;
|
||||||
end;
|
end;
|
||||||
if (det_initial<>0) then
|
if (det_initial<>0) then
|
||||||
begin
|
begin
|
||||||
DetPrec1:=detecteur_suivant(Adr_El_Suiv,Btype_el_suivant,det_initial,1);
|
DetPrec1:=detecteur_suivant(Adr_El_Suiv,Btype_el_suivant,det_initial,1,2); // 2= algo2 = arret sur aiguillage en talon mal positionné
|
||||||
if DetPrec1<1024 then // route bloquée par aiguillage mal positionné
|
if DetPrec1<1024 then // route bloquée par aiguillage mal positionné
|
||||||
begin
|
begin
|
||||||
DetPrec2:=detecteur_suivant_El(det_initial,1,DetPrec1,1);
|
DetPrec2:=detecteur_suivant_El(det_initial,1,DetPrec1,1);
|
||||||
@@ -6295,6 +6297,8 @@ begin
|
|||||||
// si le signal suivant est rouge
|
// si le signal suivant est rouge
|
||||||
begin
|
begin
|
||||||
if AffSignal then AfficheDebug('pas d''aiguille déviée',clYellow);
|
if AffSignal then AfficheDebug('pas d''aiguille déviée',clYellow);
|
||||||
|
// effacer la signbalisation combinée
|
||||||
|
EtatSignalCplx[adrFeu]:=EtatSignalCplx[adrFeu] and not($3c00);
|
||||||
if TestBit(etat,carre) or testBit(etat,semaphore) or testBit(etat,semaphore_cli )then Maj_Etat_Signal(AdrFeu,jaune)
|
if TestBit(etat,carre) or testBit(etat,semaphore) or testBit(etat,semaphore_cli )then Maj_Etat_Signal(AdrFeu,jaune)
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
@@ -6505,7 +6509,7 @@ begin
|
|||||||
if (AdrDetFeu=Det3) and (feux[i].aspect<10) then
|
if (AdrDetFeu=Det3) and (feux[i].aspect<10) then
|
||||||
begin
|
begin
|
||||||
AdrSuiv:=Feux[i].Adr_el_suiv1;TypeSuiv:=Feux[i].Btype_suiv1;
|
AdrSuiv:=Feux[i].Adr_el_suiv1;TypeSuiv:=Feux[i].Btype_suiv1;
|
||||||
AdrPrec:=detecteur_suivant(AdrSuiv,typeSuiv,AdrDetFeu,1) ; // détecteur précédent le feu
|
AdrPrec:=detecteur_suivant(AdrSuiv,typeSuiv,AdrDetFeu,1,1) ; // détecteur précédent le feu ; algo 1
|
||||||
if AdrPrec=0 then
|
if AdrPrec=0 then
|
||||||
begin
|
begin
|
||||||
if TraceListe then Affiche('FD - Le feu '+IntToSTR(AdrFeu)+' est précédé d''un buttoir',clyellow);
|
if TraceListe then Affiche('FD - Le feu '+IntToSTR(AdrFeu)+' est précédé d''un buttoir',clyellow);
|
||||||
@@ -6726,7 +6730,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
AdrSuiv:=Feux[i].Adr_el_suiv1;TypeSuiv:=Feux[i].Btype_suiv1;
|
AdrSuiv:=Feux[i].Adr_el_suiv1;TypeSuiv:=Feux[i].Btype_suiv1;
|
||||||
if AffSignal then AfficheDebug('Pour Feu '+intToSTR(AdrFeu)+' detecteursuivant('+intToSTR(AdrSuiv)+','+IntToSTR(typeSuiv)+','+intToSTR(AdrDetFeu)+',1)',clyellow);
|
if AffSignal then AfficheDebug('Pour Feu '+intToSTR(AdrFeu)+' detecteursuivant('+intToSTR(AdrSuiv)+','+IntToSTR(typeSuiv)+','+intToSTR(AdrDetFeu)+',1)',clyellow);
|
||||||
AdrPrec:=detecteur_suivant(AdrSuiv,typeSuiv,AdrDetFeu,1) ; // détecteur précédent le feu
|
AdrPrec:=detecteur_suivant(AdrSuiv,typeSuiv,AdrDetFeu,1,1) ; // détecteur précédent le feu, algo 1
|
||||||
if AdrPrec=0 then
|
if AdrPrec=0 then
|
||||||
begin
|
begin
|
||||||
If traceListe then AfficheDebug('Le feu '+IntToSTR(AdrFeu)+' est précédé d''un buttoir',clyellow);
|
If traceListe then AfficheDebug('Le feu '+IntToSTR(AdrFeu)+' est précédé d''un buttoir',clyellow);
|
||||||
@@ -6885,22 +6889,22 @@ begin
|
|||||||
if (valeur and $C)=$8 then
|
if (valeur and $C)=$8 then
|
||||||
begin
|
begin
|
||||||
Event_Aig(adraig+3,const_droit,0);
|
Event_Aig(adraig+3,const_droit,0);
|
||||||
if trace then begin s:='accessoire '+intToSTR(adraig+3)+'=2';Affiche(s,clYellow);end;
|
if traceTrames then begin s:='accessoire '+intToSTR(adraig+3)+'=2';AfficheDebug(s,clYellow);end;
|
||||||
end;
|
end;
|
||||||
if (valeur and $C)=$4 then
|
if (valeur and $C)=$4 then
|
||||||
begin
|
begin
|
||||||
Event_Aig(adraig+3,const_devie,0);
|
Event_Aig(adraig+3,const_devie,0);
|
||||||
if trace then begin s:='accessoire '+intToSTR(adraig+3)+'=1';Affiche(s,clYellow);end;
|
if traceTrames then begin s:='accessoire '+intToSTR(adraig+3)+'=1';AfficheDebug(s,clYellow);end;
|
||||||
end;
|
end;
|
||||||
if (valeur and $3)=$2 then
|
if (valeur and $3)=$2 then
|
||||||
begin
|
begin
|
||||||
Event_Aig(adraig+2,const_droit,0);
|
Event_Aig(adraig+2,const_droit,0);
|
||||||
if trace then begin s:='accessoire '+intToSTR(adraig+2)+'=2';Affiche(s,clYellow);end;
|
if traceTrames then begin s:='accessoire '+intToSTR(adraig+2)+'=2';AfficheDebug(s,clYellow);end;
|
||||||
end;
|
end;
|
||||||
if (valeur and $3)=$1 then
|
if (valeur and $3)=$1 then
|
||||||
begin
|
begin
|
||||||
Event_Aig(adraig+2,const_devie,0);
|
Event_Aig(adraig+2,const_devie,0);
|
||||||
if trace then begin s:='accessoire '+intToSTR(adraig+2)+'=1';Affiche(s,clYellow);end;
|
if traceTrames then begin s:='accessoire '+intToSTR(adraig+2)+'=1';AfficheDebug(s,clYellow);end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@@ -6941,22 +6945,22 @@ begin
|
|||||||
if (valeur and $C)=$8 then
|
if (valeur and $C)=$8 then
|
||||||
begin
|
begin
|
||||||
Event_Aig(adraig+1,const_droit,0);
|
Event_Aig(adraig+1,const_droit,0);
|
||||||
if trace then begin s:='accessoire '+intToSTR(adraig+1)+'=2';Affiche(s,clYellow);end;
|
if traceTrames then begin s:='accessoire '+intToSTR(adraig+1)+'=2';AfficheDebug(s,clYellow);end;
|
||||||
end;
|
end;
|
||||||
if (valeur and $C)=$4 then
|
if (valeur and $C)=$4 then
|
||||||
begin
|
begin
|
||||||
Event_Aig(adraig+1,const_devie,0);
|
Event_Aig(adraig+1,const_devie,0);
|
||||||
if trace then begin s:='accessoire '+intToSTR(adraig+1)+'=1';Affiche(s,clYellow);end;
|
if traceTrames then begin s:='accessoire '+intToSTR(adraig+1)+'=1';AfficheDebug(s,clYellow);end;
|
||||||
end;
|
end;
|
||||||
if (valeur and $3)=$2 then
|
if (valeur and $3)=$2 then
|
||||||
begin
|
begin
|
||||||
Event_Aig(adraig,const_droit,0);
|
Event_Aig(adraig,const_droit,0);
|
||||||
if trace then begin s:='accessoire '+intToSTR(adraig)+'=2';Affiche(s,clYellow);end;
|
if traceTrames then begin s:='accessoire '+intToSTR(adraig)+'=2';AfficheDebug(s,clYellow);end;
|
||||||
end;
|
end;
|
||||||
if (valeur and $3)=$1 then
|
if (valeur and $3)=$1 then
|
||||||
begin
|
begin
|
||||||
Event_Aig(adraig,const_devie,0);
|
Event_Aig(adraig,const_devie,0);
|
||||||
if trace then begin s:='accessoire '+intToSTR(adraig)+'=1';Affiche(s,clYellow);end;
|
if traceTrames then begin s:='accessoire '+intToSTR(adraig)+'=1';AfficheDebug(s,clYellow);end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@@ -6982,8 +6986,8 @@ begin
|
|||||||
#5 : begin nack:=true;msg:='plus de time slot';end;
|
#5 : begin nack:=true;msg:='plus de time slot';end;
|
||||||
#6 : begin nack:=true;msg:='débordement tampon LI100';end;
|
#6 : begin nack:=true;msg:='débordement tampon LI100';end;
|
||||||
end;
|
end;
|
||||||
if trace and (chaineINT[2]=#4) then Affiche(msg,clYellow);
|
if traceTrames and (chaineINT[2]=#4) then AfficheDebug(msg,clYellow);
|
||||||
if trace and (chaineINT[2]<>#4) then Affiche(msg,clRed);
|
if traceTrames and (chaineINT[2]<>#4) then AfficheDebug(msg,clRed);
|
||||||
delete(chaineINT,1,3);
|
delete(chaineINT,1,3);
|
||||||
decode_chaine_retro:=chaineINT;
|
decode_chaine_retro:=chaineINT;
|
||||||
exit;
|
exit;
|
||||||
@@ -7682,7 +7686,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
chaine_recue:=chaine_recue+char(tablo[i]);
|
chaine_recue:=chaine_recue+char(tablo[i]);
|
||||||
end;
|
end;
|
||||||
if trace then Affiche('Tick='+IntToSTR(tick)+'/Rec '+chaine_Hex(chaine_recue),Clwhite);
|
if traceTrames then AfficheDebug('Tick='+IntToSTR(tick)+'/Rec '+chaine_Hex(chaine_recue),Clwhite);
|
||||||
if terminal then Affiche(chaine_recue,clLime);
|
if terminal then Affiche(chaine_recue,clLime);
|
||||||
interprete_reponse(chaine_recue);
|
interprete_reponse(chaine_recue);
|
||||||
chaine_recue:='';
|
chaine_recue:='';
|
||||||
@@ -7946,17 +7950,6 @@ begin
|
|||||||
if (Editval.Text<>'1') and (Editval.Text<>'2') then editval.text:='1';
|
if (Editval.Text<>'1') and (Editval.Text<>'2') then editval.text:='1';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// gestion de la couleur des textes de la list box
|
|
||||||
procedure TFormPrinc.ListBox1DrawItem(Control: TWinControl; Index: Integer;
|
|
||||||
Rect: TRect; State: TOwnerDrawState);
|
|
||||||
begin
|
|
||||||
//with control as Tlistbox do
|
|
||||||
with listbox1.Canvas do
|
|
||||||
begin
|
|
||||||
Font.color:=Tcolor(ListBox1.Items.Objects[index]);
|
|
||||||
TextOut(Rect.Left,Rect.Top+4,ListBox1.Items[index]);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TFormPrinc.BoutonRafClick(Sender: TObject);
|
procedure TFormPrinc.BoutonRafClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
@@ -8010,7 +8003,7 @@ procedure TFormPrinc.ClientSocketLenzRead(Sender: TObject;
|
|||||||
var s : string;
|
var s : string;
|
||||||
begin
|
begin
|
||||||
s:=ClientSocketLenz.Socket.ReceiveText;
|
s:=ClientSocketLenz.Socket.ReceiveText;
|
||||||
if trace then affiche(chaine_hex(s),clWhite);
|
if traceTrames then afficheDebug(chaine_hex(s),clWhite);
|
||||||
interprete_reponse(s);
|
interprete_reponse(s);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -8035,7 +8028,6 @@ begin
|
|||||||
Affiche('en circulation sur le réseau',ClYellow);
|
Affiche('en circulation sur le réseau',ClYellow);
|
||||||
Affiche('Il est nécessaire de renseigner les fichiers config.cfg et config-gl.cfg',ClOrange);
|
Affiche('Il est nécessaire de renseigner les fichiers config.cfg et config-gl.cfg',ClOrange);
|
||||||
Affiche('En vert : Trames envoyées à l''interface',ClWhite);
|
Affiche('En vert : Trames envoyées à l''interface',ClWhite);
|
||||||
Affiche('En blanc : Trames reçues de l''interface',ClWhite);
|
|
||||||
Affiche('En violet : Trames brutes reçues de l''interface',ClWhite);
|
Affiche('En violet : Trames brutes reçues de l''interface',ClWhite);
|
||||||
Affiche('En rouge : erreurs et défauts',ClWhite);
|
Affiche('En rouge : erreurs et défauts',ClWhite);
|
||||||
Affiche('En orange : pilotage des signaux / erreurs mineures',ClWhite);
|
Affiche('En orange : pilotage des signaux / erreurs mineures',ClWhite);
|
||||||
@@ -8078,6 +8070,7 @@ procedure TFormPrinc.MenuConnecterEthernetClick(Sender: TObject);
|
|||||||
begin
|
begin
|
||||||
if AdresseIP<>'0' then
|
if AdresseIP<>'0' then
|
||||||
begin
|
begin
|
||||||
|
Affiche('Demande de connexion de l''interface Lenz en ethernet '+AdresseIP+':'+IntToSTR(Port),clyellow);
|
||||||
ClientSocketLenz.port:=port;
|
ClientSocketLenz.port:=port;
|
||||||
ClientSocketLenz.Address:=AdresseIP;
|
ClientSocketLenz.Address:=AdresseIP;
|
||||||
ClientSocketLenz.Open;
|
ClientSocketLenz.Open;
|
||||||
@@ -8484,20 +8477,19 @@ begin
|
|||||||
inc(Nbre_recu_cdm);
|
inc(Nbre_recu_cdm);
|
||||||
//if Nbre_recu_cdm>1 then Affiche('Empilement de trames CDM: '+intToSTR(Nbre_recu_cdm),clred);
|
//if Nbre_recu_cdm>1 then Affiche('Empilement de trames CDM: '+intToSTR(Nbre_recu_cdm),clred);
|
||||||
recuCDM:=ClientSocketCDM.Socket.ReceiveText; // commandeCDM est le morceau tronquée de la fin de la réception précédente
|
recuCDM:=ClientSocketCDM.Socket.ReceiveText; // commandeCDM est le morceau tronquée de la fin de la réception précédente
|
||||||
//if residuCDM<>'' then Affiche(recuCDM,clLime);
|
|
||||||
residuCDM:='';
|
residuCDM:='';
|
||||||
if trace then
|
if traceTrames then AfficheDebug(recuCDM,clWhite);
|
||||||
begin
|
|
||||||
|
{begin
|
||||||
n:=80;
|
n:=80;
|
||||||
Affiche('recu de CDM Tick='+IntToSTR(tick)+' '+IntToSTR(length(recuCDM))+' car',clWhite);Affiche(copy(recuCDM,1,n),clWhite);
|
|
||||||
AfficheDebug(recuCDM,clWhite);
|
|
||||||
l:=length(recuCDM);
|
l:=length(recuCDM);
|
||||||
i:=1;
|
i:=0;
|
||||||
repeat
|
repeat
|
||||||
Affiche(copy(recuCDM,i*n,n),clWhite);
|
AfficheDebug(copy(recuCDM,(i*n)+1,n),clWhite);
|
||||||
inc(i);
|
inc(i);
|
||||||
until l<i*n;
|
until l<i*n;
|
||||||
end;
|
end;}
|
||||||
Interprete_trameCDM(recuCDM);
|
Interprete_trameCDM(recuCDM);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -8881,17 +8873,38 @@ begin
|
|||||||
vitesse_loco(3,20,true);
|
vitesse_loco(3,20,true);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
// pour déplacer l'ascenseur de l'affichage automatiquement en bas
|
||||||
procedure TFormPrinc.Button1Click(Sender: TObject);
|
procedure TFormPrinc.FenRichChange(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
Interprete_trameCDM('yfytrf');
|
SendMessage(FenRich.handle, WM_VSCROLL, SB_BOTTOM, 0);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TFormPrinc.Copier1Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
FenRich.CopyToClipboard;
|
||||||
|
FenRich.SetFocus;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
procedure TFormPrinc.Etatdessignaux1Click(Sender: TObject);
|
||||||
|
var Adr,etat,i : integer;
|
||||||
|
aspect,combine : word;
|
||||||
|
s : string;
|
||||||
begin
|
begin
|
||||||
|
for i:=1 to NbreFeux do
|
||||||
|
begin
|
||||||
|
Adr:=Feux[i].Adresse;
|
||||||
|
Etat:=Feux[i].EtatSignal;
|
||||||
|
s:='Feu '+IntToSTR(Adr)+' Etat=';
|
||||||
|
code_to_aspect(Etat,aspect,combine);
|
||||||
|
s:=s+IntToSTR(etat)+'='+EtatSign[aspect]+' '+EtatSign[combine];
|
||||||
|
Affiche(s,clYellow);
|
||||||
|
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
-1609
File diff suppressed because it is too large
Load Diff
+968
-706
File diff suppressed because it is too large
Load Diff
Binary file not shown.
BIN
Binary file not shown.
+4
-3
@@ -130,12 +130,13 @@ begin
|
|||||||
begin
|
begin
|
||||||
i:=pos('.zip',s);
|
i:=pos('.zip',s);
|
||||||
trouve_zip:=i<>0;
|
trouve_zip:=i<>0;
|
||||||
if trouve_zip then s3:=s;
|
if trouve_zip then
|
||||||
|
s3:=s;
|
||||||
end;
|
end;
|
||||||
// Aff(s)
|
// Aff(s)
|
||||||
end;
|
end;
|
||||||
closefile(fichier);
|
closefile(fichier);
|
||||||
if trouve_version then
|
if trouve_version and trouve_zip then
|
||||||
begin
|
begin
|
||||||
// isoler le champ version
|
// isoler le champ version
|
||||||
i:=pos('version ',s2);
|
i:=pos('version ',s2);
|
||||||
@@ -190,7 +191,7 @@ begin
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
if notificationVersion then Affiche('Pas d''accès au site CDM rail',clorange);
|
if notificationVersion then Affiche('Pas d''accès au site CDM rail ou échec téléchargement',clorange);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|||||||
@@ -1,35 +0,0 @@
|
|||||||
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 = -13
|
|
||||||
Font.Name = 'Arial Narrow'
|
|
||||||
Font.Style = []
|
|
||||||
ParentFont = False
|
|
||||||
ScrollBars = ssVertical
|
|
||||||
TabOrder = 0
|
|
||||||
end
|
|
||||||
object TimerVerif: TTimer
|
|
||||||
OnTimer = TimerVerifTimer
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,210 +0,0 @@
|
|||||||
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;
|
|
||||||
verifVersion,notificationVersion : boolean;
|
|
||||||
|
|
||||||
Const Version='2.11'; // sert à la comparaison de la version publiée
|
|
||||||
|
|
||||||
implementation
|
|
||||||
|
|
||||||
uses UnitPrinc;
|
|
||||||
|
|
||||||
{$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;
|
|
||||||
|
|
||||||
|
|
||||||
// téléchargement d'une page internet sans cache dans un fichier
|
|
||||||
function DownloadURL_NOCache(aUrl: string;s : string): Boolean;
|
|
||||||
var
|
|
||||||
hSession: HINTERNET;
|
|
||||||
hService: HINTERNET;
|
|
||||||
Fs:TFileStream;
|
|
||||||
lpBuffer: array[0..1024 + 1] of byte;
|
|
||||||
dwBytesRead: DWORD;
|
|
||||||
dwTimeout : integer;
|
|
||||||
begin
|
|
||||||
Result:=False;
|
|
||||||
DeleteFile(s);
|
|
||||||
Try Fs:=TFileStream.Create(s,fmCreate,fmShareDenyNone);
|
|
||||||
hSession:=InternetOpen('MyApp',INTERNET_OPEN_TYPE_PRECONFIG, nil, nil, 0);
|
|
||||||
try
|
|
||||||
if Assigned(hSession) then
|
|
||||||
begin
|
|
||||||
// fonction longue
|
|
||||||
dwTimeout:=2000; //2s
|
|
||||||
InternetSetOption(hSession,INTERNET_OPTION_CONNECT_TIMEOUT,@dwTimeOut, SizeOf(dwTimeOut));
|
|
||||||
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,erreur : integer;
|
|
||||||
V_publie,V_utile : real;
|
|
||||||
begin
|
|
||||||
//Affiche('vérifie version',clLime);
|
|
||||||
if not(AvecInit) then exit ;
|
|
||||||
if not(verifVersion) then exit;
|
|
||||||
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]:=',';
|
|
||||||
|
|
||||||
val(s,V_publie,erreur); if erreur<>0 then exit;
|
|
||||||
val(s2,V_utile,erreur); if erreur<>0 then exit;
|
|
||||||
|
|
||||||
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
|
|
||||||
// récupérer depuis la variable d'environnement windows USERPROFILE le repertoire de la session ouverte
|
|
||||||
s:=GetCurrentProcessEnvVar('USERPROFILE')+'\Downloads\Signaux_Complexes_GL.Zip';
|
|
||||||
Aff('Téléchargement de '+s3+' dans ');
|
|
||||||
Aff(s);
|
|
||||||
|
|
||||||
if DownloadURL_NOCache(s3,s) then
|
|
||||||
//if true 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) and notificationVersion then Affiche('Votre version '+Version_p+' est à jour',clLime);
|
|
||||||
|
|
||||||
end;
|
|
||||||
end
|
|
||||||
else
|
|
||||||
begin
|
|
||||||
if notificationVersion then Affiche('Pas d''accès au site CDM rail',clorange);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
procedure TFormVersion.FormCreate(Sender: TObject);
|
|
||||||
begin
|
|
||||||
Timerverif.Interval:=1000; // timer à 1 seconde
|
|
||||||
Lance_verif:=2; // lancer la vérification de version dans 1s
|
|
||||||
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