V8.21D
This commit is contained in:
313
UnitConfig.pas
313
UnitConfig.pas
@@ -311,7 +311,7 @@ type
|
||||
outcopierentatquetexte1: TMenuItem;
|
||||
CheckBoxAffMemo: TCheckBox;
|
||||
RadioButtonCde: TRadioButton;
|
||||
TabSheetAccessoires: TTabSheet;
|
||||
TabSheetPeriph: TTabSheet;
|
||||
ListBoxAcc: TListBox;
|
||||
ButtonAjAccCom: TButton;
|
||||
ButtonSupAccCom: TButton;
|
||||
@@ -515,6 +515,7 @@ type
|
||||
{ Déclarations privées }
|
||||
public
|
||||
{ Déclarations publiques }
|
||||
procedure modif_editT(Sender : TObject);
|
||||
procedure modif_ComboTS(Sender : TObject);
|
||||
procedure modif_ComboL(Sender : TObject);
|
||||
procedure cb_onclick(Sender : Tobject);
|
||||
@@ -590,7 +591,7 @@ var
|
||||
|
||||
var
|
||||
FormConfig: TFormConfig;
|
||||
AdresseIPCDM,AdresseIP,PortCom,recuCDM,residuCDM,trainsauve : string;
|
||||
AdresseIPCDM,AdresseIP,PortCom,recuCDM,residuCDM,trainsauve : string;
|
||||
|
||||
portCDM,TempoOctet,TimoutMaxInterface,Valeur_entete,PortInterface,prot_serie,NumPort,debug,
|
||||
LigneCliqueePN,AncLigneCliqueePN,clicMemo,Nb_cantons_Sig,protocole,Port,
|
||||
@@ -611,6 +612,7 @@ var
|
||||
EditZdet1V1F,EditZdet2V1F,EditZdet1V1O,EditZdet2V1O,
|
||||
EditZdet1V2F,EditZdet2V2F,EditZdet1V2O,EditZdet2V2O,
|
||||
EditZdet1V3F,EditZdet2V3F,EditZdet1V3O,EditZdet2V3O,
|
||||
EditZdet1V4F,EditZdet2V4F,EditZdet1V4O,EditZdet2V4O,
|
||||
EditZdet1V5F,EditZdet2V5F,EditZdet1V5O,EditZdet2V5O :Tedit;
|
||||
LabelPortCde,LbPnVoie1,LbAPnVoie1,LbAPnVoie2,LbAPnVoie3,LbAPnVoie4,LbAPnVoie5,LbATitre,
|
||||
LbZTitre,LbZPnVoie1,LbZPnVoie2,LbZPnVoie3,LbZPnVoie4,LbZPnVoie5 : Tlabel;
|
||||
@@ -634,6 +636,8 @@ implementation
|
||||
procedure valide_branches;
|
||||
procedure trier_aig;
|
||||
function decodeDCC(s : string) : string;
|
||||
|
||||
implementation
|
||||
|
||||
uses UnitDebug,UnitTCO, UnitSR, UnitCDF,UnitAnalyseSegCDM, unitPilote;
|
||||
|
||||
@@ -1575,7 +1579,7 @@ begin
|
||||
s:=s+','+IntToSTR(Tablo_Actionneur[i].Etat)+','+Tablo_Actionneur[i].trainDecl+
|
||||
',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;
|
||||
end;
|
||||
|
||||
if Tablo_Actionneur[i].son then
|
||||
s:=s+','+IntToSTR(Tablo_Actionneur[i].Etat)+','+Tablo_Actionneur[i].trainDecl+',"'+Tablo_Actionneur[i].FichierSon+'"';
|
||||
@@ -2018,7 +2022,7 @@ var s,sa,SOrigine: string;
|
||||
Tablo_Actionneur[i].typdeclenche:=0;
|
||||
Tablo_actionneur[i].accessoire:=0;
|
||||
Tablo_actionneur[i].sortie:=0;
|
||||
Tablo_actionneur[i].fichierSon:='';
|
||||
Tablo_actionneur[i].fichierSon:='';
|
||||
// Tablo_actionneur[i].det:=false;
|
||||
Tablo_actionneur[i].loco:=false;
|
||||
Tablo_actionneur[i].act:=false;
|
||||
@@ -2095,7 +2099,7 @@ var s,sa,SOrigine: string;
|
||||
// "fichierson"
|
||||
// ACCnum
|
||||
if upcase(s[1])='F' then
|
||||
begin
|
||||
begin
|
||||
// -----------------fonction loco
|
||||
Tablo_actionneur[maxtablo_act].act:=false;
|
||||
Tablo_actionneur[maxtablo_act].loco:=true;
|
||||
@@ -2118,7 +2122,7 @@ var s,sa,SOrigine: string;
|
||||
end;
|
||||
|
||||
if uppercase(copy(s,1,3))='ACC' then
|
||||
begin
|
||||
begin
|
||||
// -----------------fonction commande périphérique com usb
|
||||
Tablo_actionneur[maxtablo_act].act:=false;
|
||||
Tablo_actionneur[maxtablo_act].loco:=false;
|
||||
@@ -2146,7 +2150,7 @@ var s,sa,SOrigine: string;
|
||||
else
|
||||
|
||||
if length(s)>0 then if s[1]='"' then
|
||||
begin
|
||||
begin
|
||||
// -----------------son
|
||||
Tablo_actionneur[maxtablo_act].act:=false;
|
||||
Tablo_actionneur[maxtablo_act].son:=true;
|
||||
@@ -2161,7 +2165,7 @@ var s,sa,SOrigine: string;
|
||||
inc(maxTablo_act);
|
||||
end
|
||||
else
|
||||
if length(s)>0 then if (upcase(s[1])='A') and (upcase(s[2])<>'C') then
|
||||
if length(s)>0 then if (upcase(s[1])='A') and (upcase(s[2])<>'C') then
|
||||
begin
|
||||
Tablo_actionneur[maxtablo_act].act:=true;
|
||||
Tablo_actionneur[maxtablo_act].son:=false;
|
||||
@@ -3826,33 +3830,32 @@ begin
|
||||
ok:=verifie_panneau_config;
|
||||
if ok then
|
||||
begin
|
||||
Sauve_config;
|
||||
formConfig.close; // si la config est ok, on ferme la fenetre
|
||||
end;
|
||||
end;
|
||||
Sauve_config;
|
||||
formConfig.close; // si la config est ok, on ferme la fenetre
|
||||
end;
|
||||
end;
|
||||
|
||||
// affiche les champs du signal index
|
||||
// LC=Adresse du signal
|
||||
// LC=index du signal
|
||||
var AncAdresse,index,adresse,erreur : integer;
|
||||
procedure clicListeSignal(index : integer);
|
||||
var AncAdresse,adresse,erreur,i : integer;
|
||||
s : string;
|
||||
begin
|
||||
if index<1 then exit;
|
||||
s:=Uppercase(FormConfig.ListBoxSig.Items[index-1]); // ligne cliquée
|
||||
if s='' then
|
||||
begin
|
||||
begin
|
||||
ligneclicSig:=-1;
|
||||
exit;
|
||||
end;
|
||||
|
||||
|
||||
// ne pas déselectionner tout!!
|
||||
with FormConfig.ListBoxSig do
|
||||
with FormConfig.ListBoxSig do
|
||||
for i:=0 to Count-1 do Selected[i]:=false;
|
||||
begin
|
||||
for i:=0 to Count-1 do Selected[i]:=false;
|
||||
FormConfig.ListBoxSig.Selected[index-1]:=true;
|
||||
end;
|
||||
}
|
||||
|
||||
|
||||
Feu_Sauve:=feux[index]; // sauvegarde
|
||||
|
||||
@@ -3865,7 +3868,7 @@ begin
|
||||
val(FormConfig.ListBoxSig.Items[AncLigneClicSig],AncAdresse,erreur);
|
||||
end;
|
||||
|
||||
Val(s,Adresse,erreur); // Adresse du signal
|
||||
Val(s,Adresse,erreur); // Adresse du signal
|
||||
if adresse=0 then exit;
|
||||
|
||||
FormConfig.EditAdrSig.Color:=clWindow;
|
||||
@@ -3977,7 +3980,7 @@ begin
|
||||
|
||||
LabelNbDecPers.caption:=intToSTR(NbreDecPers);
|
||||
|
||||
|
||||
|
||||
//l'onglet affiché est sélectionné à l'appel de la fiche dans l'unité UnitPrinc
|
||||
clicListe:=false;
|
||||
activ:=false;
|
||||
@@ -4048,6 +4051,11 @@ begin
|
||||
EditT[i].Visible:=false;
|
||||
ComboTS1[i].Visible:=false;
|
||||
ComboTS2[i].Visible:=false;
|
||||
ShapeT[i].Visible:=false;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TformConfig.Bt_onclick(sender : TObject);
|
||||
begin
|
||||
liste_portcom;
|
||||
@@ -4138,14 +4146,14 @@ begin
|
||||
NbPeriph_COMUSB:=0;
|
||||
NbPeriph_Socket:=0;
|
||||
for i:=1 to NbMaxi_Periph do
|
||||
begin
|
||||
begin
|
||||
v:=com_socket(i);
|
||||
if v=1 then
|
||||
begin
|
||||
inc(NbPeriph_COMUSB);
|
||||
if NbPeriph_COMUSB>MaxComUSBPeriph then labelInfo.Caption:='Nombre maxi de périphériques COM/USB atteint';
|
||||
Tablo_acc_COMUSB[i].numComposant:=NbPeriph_COMUSB;
|
||||
Tablo_com_cde[i].NumAcc:=NbPeriph_COMUSB;
|
||||
Tablo_com_cde[i].NumAcc:=NbPeriph_COMUSB;
|
||||
end;
|
||||
if v=2 then
|
||||
begin
|
||||
@@ -4816,7 +4824,7 @@ begin
|
||||
PixelLength:=ListboxPN.Canvas.TextWidth(LongestString)+8;
|
||||
// positionne une scrollbar dans la listbox - pour l'enlever, envoyer 0 dans pixelLength
|
||||
SendMessage(ListBoxPN.Handle,LB_SETHORIZONTALEXTENT,PixelLength,0);
|
||||
|
||||
|
||||
GroupBoxRadio.Visible:=false;
|
||||
GroupBoxAct.Visible:=false;
|
||||
GroupBoxPN.Visible:=false;
|
||||
@@ -4854,16 +4862,16 @@ begin
|
||||
begin
|
||||
items.Add(encode_Periph(i));
|
||||
ajoute_champs_combos(i);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
// composants dynamiques car on ne peut plus ajouter de composants en mode conception!
|
||||
//--------- groupbox
|
||||
//--------- groupbox
|
||||
gp1:=TgroupBox.Create(FormConfig.TabSheetPeriph);
|
||||
with gp1 do
|
||||
begin
|
||||
Left:=264;Top:=groupBoxDesc.top+groupBoxDesc.Height+10;Width:=groupBoxDesc.Width;Height:=90;
|
||||
parent:=TabSheetAccessoires;
|
||||
parent:=TabSheetPeriph;
|
||||
caption:='Services envoyés au périphérique';
|
||||
Name:='Gp1';
|
||||
end;
|
||||
@@ -4874,7 +4882,7 @@ begin
|
||||
Left:=10;Top:=25;Width:=100;Height:=12;
|
||||
caption:='Détecteurs';
|
||||
name:='cbDet';
|
||||
parent:=gp1;
|
||||
parent:=gp1;
|
||||
hint:='Envoie les évènements détecteurs';
|
||||
ShowHint:=true;
|
||||
onclick:=formconfig.cb_onclick;
|
||||
@@ -4885,22 +4893,59 @@ begin
|
||||
Left:=10;Top:=45;Width:=100;Height:=12;
|
||||
caption:='Actionneurs';
|
||||
name:='cbAct';
|
||||
parent:=gp1;
|
||||
parent:=gp1;
|
||||
hint:='Envoie les évènements actionneurs';
|
||||
ShowHint:=true;
|
||||
onclick:=formconfig.cb_onclick;
|
||||
end;
|
||||
onclick:=formconfig.cb_onclick;
|
||||
end;
|
||||
cb1:=TCheckBox.Create(FormConfig.TabSheetPeriph);
|
||||
with cb1 do
|
||||
begin
|
||||
begin
|
||||
Left:=10;Top:=65;Width:=170;Height:=12;
|
||||
caption:='Aiguillages et accessoires';
|
||||
name:='cbAig';
|
||||
parent:=gp1;
|
||||
hint:='Envoie les évènements aiguillages';
|
||||
hint:='Envoie les évènements aiguillages (accessoires)';
|
||||
ShowHint:=true;
|
||||
onclick:=formconfig.cb_onclick;
|
||||
end;
|
||||
|
||||
BoutonCom:=Tbutton.Create(FormConfig.TabSheetPeriph);
|
||||
with BoutonCom do
|
||||
begin
|
||||
Left:=100;Top:=357;Width:=75;Height:=20;
|
||||
caption:='Lister COMs';
|
||||
name:='BoutonCom';
|
||||
parent:=FormConfig.TabSheetPeriph;
|
||||
hint:='Affiche les ports COM/USB disponibles';
|
||||
ShowHint:=true;
|
||||
onclick:=formconfig.Bt_onclick;
|
||||
end;
|
||||
|
||||
EditPortCde:=TEdit.Create(FormConfig.TabSheetPeriph);
|
||||
with EditPortCde do
|
||||
begin
|
||||
Left:=150;Top:=EditNomAcc.top+30;Width:=170;Height:=12;
|
||||
name:='EditPortCde';
|
||||
text:='';
|
||||
parent:=GroupBoxDesc;
|
||||
hint:='Port COM/USB : COMX:vitesse,parité,nombre de bits de données, nombre de bits de stop ou'+#13+
|
||||
'________________________________'+#13+#13+
|
||||
'Socket : AdresseIPV4:port';
|
||||
ShowHint:=true;
|
||||
OnChange:=formconfig.tb_onChange;
|
||||
end;
|
||||
|
||||
LabelPortCde:=TLabel.Create(FormConfig.TabSheetPeriph);
|
||||
with LabelPortCde do
|
||||
begin
|
||||
Left:=10;Top:=EditNomAcc.top+32;Width:=170;Height:=12;
|
||||
caption:='Protocole de communication';
|
||||
name:='LabelPortCde';
|
||||
parent:=GroupBoxDesc;
|
||||
hint:='Protocole de communication';
|
||||
ShowHint:=true;
|
||||
end;
|
||||
end;
|
||||
|
||||
CheckBoxCR:=TCheckBox.Create(FormConfig.TabSheetPeriph);
|
||||
with CheckBoxCR do
|
||||
@@ -4909,35 +4954,11 @@ begin
|
||||
caption:='Envoyer CR (retour chariot)';
|
||||
name:='CheckBoxCR';
|
||||
parent:=GroupBoxDesc;
|
||||
hint:='Envoie un CR après toute chaîne';
|
||||
ShowHint:=true;
|
||||
onclick:=formconfig.cb_onclick;
|
||||
end;
|
||||
|
||||
EditPortCde:=TEdit.Create(FormConfig.TabSheetAccessoires);
|
||||
with EditPortCde do
|
||||
begin
|
||||
Left:=150;Top:=95;Width:=170;Height:=12;
|
||||
name:='EditPortCde';
|
||||
text:='';
|
||||
parent:=GroupBoxDesc;
|
||||
hint:='COMX:vitesse,parité,nombre de bits de données, nombre de bits de stop ou'+#13+
|
||||
'AdresseIPV4:port';
|
||||
ShowHint:=true;
|
||||
OnChange:=formconfig.tb_onChange;
|
||||
end;
|
||||
|
||||
LabelPortCde:=TLabel.Create(FormConfig.TabSheetAccessoires);
|
||||
with LabelPortCde do
|
||||
begin
|
||||
Left:=10;Top:=98;Width:=170;Height:=12;
|
||||
caption:='Protocole de communication';
|
||||
name:='LabelPortCde';
|
||||
parent:=GroupBoxDesc;
|
||||
hint:='Envoie un CR après toute chaîne';
|
||||
ShowHint:=true;
|
||||
onclick:=formconfig.cb_onclick;
|
||||
end;
|
||||
|
||||
|
||||
cbVis:=TCheckBox.Create(FormConfig.TabSheetPeriph);
|
||||
with cbVis do
|
||||
begin
|
||||
@@ -4946,7 +4967,6 @@ begin
|
||||
caption:='Mode visible';
|
||||
name:='cbVis';
|
||||
hint:='Affiche le texte à l''écran lors des envoi';
|
||||
ShowHint:=true;
|
||||
ShowHint:=true;
|
||||
onclick:=formconfig.cb_onclick;
|
||||
end;
|
||||
@@ -4967,6 +4987,7 @@ end;
|
||||
ligneClicAct:=-1;
|
||||
AncLigneClicAct:=-1;
|
||||
ligneClicAccCOM:=-1;
|
||||
AncligneClicAccCOM:=-1;
|
||||
end;
|
||||
|
||||
|
||||
@@ -5864,7 +5885,7 @@ begin
|
||||
EditAct2.Text:=inttostr(Tablo_actionneur[i].adresse2);
|
||||
//CheckRaz.Checked:=Tablo_actionneur[i].Raz;
|
||||
EditTrainDecl.Text:=s2;
|
||||
EditSon.Text:=s;
|
||||
EditSon.Text:=s;
|
||||
EditEtatActionneur.Text:=IntToSTR(etatAct);
|
||||
end;
|
||||
end;
|
||||
@@ -5988,7 +6009,7 @@ begin
|
||||
val(s,adresse,erreur);
|
||||
i:=0;
|
||||
repeat
|
||||
inc(i);
|
||||
inc(i);
|
||||
trouve:=(Tablo_PN[i].AdresseFerme=adresse);
|
||||
until trouve or (i>NbrePN);
|
||||
if not(trouve) then exit;
|
||||
@@ -7584,6 +7605,8 @@ begin
|
||||
feux[index].aspect:=aspect;
|
||||
|
||||
s:=encode_sig_feux(index);
|
||||
ListBoxSig.Items[ligneClicSig]:=s;
|
||||
aff_champs_sig_feux(index); // redessine les champs et le feu
|
||||
|
||||
if not(verif_dec_sig(false)) then labelInfo.Caption:='Combinaison décodeur / aspect incompatible';
|
||||
|
||||
@@ -7667,7 +7690,7 @@ begin
|
||||
// rendre visible le groupbox Actionneur fonction F loco
|
||||
if clicListe or (ligneclicAct<0) then exit;
|
||||
i:=ligneClicAct+1;
|
||||
if AffEvt then Affiche('RadioLoc '+IntToSTR(i),clyellow);
|
||||
if AffEvt then Affiche('RadioLoc '+IntToSTR(i),clyellow);
|
||||
|
||||
Tablo_Actionneur[i].loco:=true;
|
||||
Tablo_Actionneur[i].Act:=false;
|
||||
@@ -7699,7 +7722,7 @@ begin
|
||||
// rendre visible le groupbox Actionneur fonction F loco
|
||||
if clicListe or (ligneclicAct<0) then exit;
|
||||
i:=ligneClicAct+1;
|
||||
if AffEvt then Affiche('RadioAccessoire '+IntToSTR(i),clyellow);
|
||||
if AffEvt then Affiche('RadioAccessoire '+IntToSTR(i),clyellow);
|
||||
|
||||
Tablo_Actionneur[i].loco:=false;
|
||||
Tablo_Actionneur[i].Act:=true;
|
||||
@@ -7732,7 +7755,7 @@ begin
|
||||
// rendre visible le groupbox Actionneur fonction F loco
|
||||
if clicListe or (ligneclicAct<0) then exit;
|
||||
i:=ligneClicAct+1;
|
||||
if AffEvt then Affiche('RadioSon '+IntToSTR(i),clyellow);
|
||||
if AffEvt then Affiche('RadioSon '+IntToSTR(i),clyellow);
|
||||
|
||||
Tablo_Actionneur[i].loco:=false;
|
||||
Tablo_Actionneur[i].Act:=false;
|
||||
@@ -7763,7 +7786,7 @@ begin
|
||||
s : string;
|
||||
begin
|
||||
if clicListe or (ligneclicAct<0) then exit;
|
||||
i:=ligneClicAct+1;
|
||||
i:=ligneClicAct+1;
|
||||
if AffEvt then Affiche('RadioCde '+IntToSTR(i),clyellow);
|
||||
Tablo_Actionneur[i].loco:=false;
|
||||
Tablo_Actionneur[i].Act:=false;
|
||||
@@ -8178,7 +8201,6 @@ begin
|
||||
FormConfig.ListBoxPN.items.Add(s);
|
||||
end;
|
||||
|
||||
lignecliqueePN:=-1;
|
||||
lignecliqueePN:=-1;
|
||||
AncLigneCliqueePN:=-1;
|
||||
ligneclicAct:=-1;
|
||||
@@ -8838,7 +8860,7 @@ begin
|
||||
end;
|
||||
if ((km=aig) or (km=tjs) or (km=tjd) or (km=triple)) then
|
||||
begin
|
||||
// aiguillage
|
||||
// aiguillage
|
||||
if index_aig(i)=0 then
|
||||
begin
|
||||
ok:=false;
|
||||
@@ -8926,7 +8948,7 @@ begin
|
||||
|
||||
if (model2=aig) or (model2=triple) then
|
||||
begin
|
||||
if c='D' then
|
||||
if c='D' then
|
||||
begin
|
||||
extr:=aiguillage[index2].ADroit;
|
||||
if adr<>extr then Affiche('Erreur 10.23: Discordance de déclaration aiguillages '+intToSTR(adr)+'S: '+intToSTR(adr2)+'D différent de '+intToSTR(extr),clred);
|
||||
@@ -9279,7 +9301,7 @@ begin
|
||||
begin
|
||||
AdrOk:=false;
|
||||
ok:=false;
|
||||
Affiche('Erreur 15: l''actionneur '+IntToSTR(Tablo_actionneur[i].adresse)+' enclenche l''accessoire '+intToSTR(adresse),clred);
|
||||
Affiche('Erreur 15: l''actionneur '+IntToSTR(Tablo_actionneur[i].adresse)+' enclenche l''accessoire '+intToSTR(adresse),clred);
|
||||
Affiche('qui se trouve dans la plage des accessoires DCC interdits (257-272) en Xpressnet',clred);
|
||||
end;
|
||||
end;
|
||||
@@ -9309,7 +9331,7 @@ begin
|
||||
sauve_config;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
// actionneurs
|
||||
for i:=1 to maxTablo_act do
|
||||
@@ -9762,7 +9784,7 @@ begin
|
||||
clicliste:=false;
|
||||
LabelInfo.caption:='Changement de la TJD homologue de '+IntToSTR(adr2)+' à '+intToSTR(adr) ;
|
||||
|
||||
adr2:=aiguillage[index].Ddroit; // 'ancienne' adresse homologue avant écrasement
|
||||
adr2:=aiguillage[index].Ddroit; // 'ancienne' adresse homologue avant écrasement
|
||||
aiguillage[index].Ddroit:=adr;
|
||||
//aiguillage[index].DdroitB:=B;
|
||||
aiguillage[index].Ddevie:=adr;
|
||||
@@ -10386,6 +10408,7 @@ begin
|
||||
formCDF.showmodal;
|
||||
formCDF.close;
|
||||
end;
|
||||
ListBoxSig.selected[ligneClicSig]:=true;
|
||||
clicListe:=false;
|
||||
end;
|
||||
|
||||
@@ -11800,120 +11823,6 @@ begin
|
||||
MemoBlanc.Lines[ligne-1]:=s;
|
||||
clicListe:=false;
|
||||
sO:=s;
|
||||
j:=1;
|
||||
if s<>'' then
|
||||
repeat
|
||||
if s[1]<>'A' then begin LabelInfo.Caption:='Erreur manque A : '+sO;exit;end;
|
||||
delete(s,1,1);
|
||||
val(s,adr,erreur); // adresse
|
||||
if adr=0 then exit;
|
||||
c:=#0;
|
||||
if erreur<>0 then c:=s[erreur]; // S ou D
|
||||
if (c<>'D') and (c<>'S') then begin LabelInfo.Caption:='Erreur manque D ou S : '+sO;exit;end;
|
||||
setlength(feux[ligneClicSig+1].condFeuBlanc[ligne],j+1);
|
||||
feux[ligneClicSig+1].condFeuBlanc[ligne][j].PosAig:=c;
|
||||
feux[ligneClicSig+1].condFeuBlanc[ligne][j].Adresse:=adr;
|
||||
delete(s,1,erreur); // supprime jusque D
|
||||
if length(s)<>0 then if s[1]=',' then delete(s,1,1);
|
||||
inc(j);
|
||||
until s=''
|
||||
else
|
||||
setlength(feux[ligneClicSig+1].condFeuBlanc[ligne],0);
|
||||
end;
|
||||
|
||||
s:=encode_sig_feux(ligneClicSig+1);
|
||||
ListBoxSig.Items[ligneClicSig]:=s;
|
||||
ListBoxSig.selected[ligneClicSig]:=true;
|
||||
LabelInfo.Caption:='';
|
||||
clicListe:=false;
|
||||
end;
|
||||
|
||||
{
|
||||
procedure TFormConfig.ListBoxAigKeyDown(Sender: TObject; var Key: Word;
|
||||
|
||||
Shift: TShiftState);
|
||||
var lc,curseur,i : integer;
|
||||
begin
|
||||
if key=VK_delete then supprime_aig;
|
||||
|
||||
if ord(Key)=VK_UP then
|
||||
begin
|
||||
if clicListe then exit;
|
||||
clicListe:=true;
|
||||
if affevt then affiche('Evt ListBoxAig keydown',clyellow);
|
||||
with Formconfig.ListBoxAig do
|
||||
begin
|
||||
i:=Selstart;
|
||||
lc:=Perform(EM_LINEFROMCHAR,i,0); // numéro de la lignée cliquée
|
||||
if lc>0 then
|
||||
begin
|
||||
dec(lc);
|
||||
AncligneClicAig:=ligneClicAig;
|
||||
ligneClicAig:=lc;
|
||||
curseur:=SelStart; // position initiale du curseur
|
||||
if AncligneClicAig<>ligneClicAig then
|
||||
begin
|
||||
if AncligneClicAig<>-1 then
|
||||
begin
|
||||
RE_ColorLine(ListBoxAig,AncligneClicAig,ClAqua);
|
||||
end;
|
||||
RE_ColorLine(ListBoxAig,ligneClicAig,ClYellow);
|
||||
selStart:=curseur; // remettre le curseur en position initiale
|
||||
aff_champs_Aig_tablo(lc+1);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
if ord(Key)=VK_DOWN then
|
||||
begin
|
||||
if clicListe then exit;
|
||||
clicListe:=true;
|
||||
if affevt then affiche('Evt ListBoxAig keydown',clyellow);
|
||||
with Formconfig.ListBoxAig do
|
||||
begin
|
||||
i:=Selstart;
|
||||
lc:=Perform(EM_LINEFROMCHAR,i,0); // numéro de la lignée cliquée
|
||||
if lc<maxaiguillage-1 then
|
||||
begin
|
||||
inc(lc);
|
||||
AncligneClicAig:=ligneClicAig;
|
||||
ligneClicAig:=lc;
|
||||
curseur:=SelStart; // position initiale du curseur
|
||||
if AncligneClicAig<>ligneClicAig then
|
||||
begin
|
||||
if AncligneClicAig<>-1 then
|
||||
begin
|
||||
RE_ColorLine(ListBoxAig,AncligneClicAig,ClAqua);
|
||||
end;
|
||||
RE_ColorLine(ListBoxAig,ligneClicAig,ClYellow);
|
||||
selStart:=curseur; // remettre le curseur en position initiale
|
||||
aff_champs_Aig_tablo(lc+1);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
clicListe:=false;
|
||||
|
||||
end;
|
||||
}
|
||||
{
|
||||
|
||||
procedure TFormConfig.ListBoxAigMouseDown(Sender: TObject;
|
||||
|
||||
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
||||
var i,lc,adresse,erreur : integer;
|
||||
s : string;
|
||||
begin
|
||||
clicliste:=true;
|
||||
// HideCaret(ListBoxAig.Handle);
|
||||
raz_champs_aig;
|
||||
ComboBoxAig.ItemIndex:=-1;
|
||||
formconfig.ComboBoxDD.ItemIndex:=-1;
|
||||
|
||||
with Formconfig.ListBoxAig do
|
||||
begin
|
||||
i:=Selstart;
|
||||
j:=1;
|
||||
if s<>'' then
|
||||
repeat
|
||||
@@ -11937,7 +11846,7 @@ begin
|
||||
|
||||
s:=encode_sig_feux(ligneClicSig+1);
|
||||
ListBoxSig.Items[ligneClicSig]:=s;
|
||||
|
||||
ListBoxSig.selected[ligneClicSig]:=true;
|
||||
LabelInfo.Caption:='';
|
||||
clicListe:=false;
|
||||
end;
|
||||
@@ -12059,11 +11968,7 @@ procedure TFormConfig.Slectionnertout1Click(Sender: TObject);
|
||||
aff_champs_PN(lignecliqueePN+1);
|
||||
end;
|
||||
end;
|
||||
aff_champs_PN(lignecliqueePN+1);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
if ord(Key)=VK_DOWN then
|
||||
@@ -12084,7 +11989,7 @@ var ss,s : string;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
clicListe:=false;
|
||||
end;
|
||||
|
||||
|
||||
@@ -12166,11 +12071,11 @@ begin
|
||||
clicliste:=false;
|
||||
end;
|
||||
|
||||
clicliste:=false;
|
||||
procedure ajoute_acc;
|
||||
var i : integer;
|
||||
s : string;
|
||||
begin
|
||||
var i : integer;
|
||||
if NbPeriph>=NbMaxi_Periph then
|
||||
begin
|
||||
Affiche('Nombre maximal de périphériques COM/USB sockets',clRed);
|
||||
exit;
|
||||
@@ -12179,7 +12084,6 @@ begin
|
||||
|
||||
// désélectionne tout
|
||||
with formconfig.ListBoxAcc do
|
||||
|
||||
for i:=0 to items.Count-1 do Selected[i]:=false;
|
||||
|
||||
inc(NbPeriph);
|
||||
@@ -12248,17 +12152,18 @@ begin
|
||||
if s='ListBoxAig' then
|
||||
begin
|
||||
ajoute_aiguillage;
|
||||
if s='ListBoxAig' then
|
||||
end;
|
||||
if s='ListBoxTrains' then
|
||||
ajoute_aiguillage;
|
||||
begin
|
||||
ajoute_train;
|
||||
end;
|
||||
if s='ListBoxAcc' then ajoute_acc;
|
||||
end;
|
||||
end;
|
||||
if s='ListBoxAcc' then ajoute_acc;
|
||||
|
||||
procedure TFormConfig.outcopierentatquetexte1Click(Sender: TObject);
|
||||
var tl: TListBox;
|
||||
begin
|
||||
tl:=(Tpopupmenu(Tmenuitem(sender).GetParentMenu).PopupComponent) as TlistBox ;
|
||||
|
||||
ClipBoard.SetTextBuf(tl.Items.GetText);
|
||||
end;
|
||||
|
||||
@@ -12284,8 +12189,6 @@ begin
|
||||
if connecte_port_usb_periph(index) then
|
||||
Affiche('COM'+intToSTR(tablo_acc_comusb[index].numcom)+' périphérique ouvert',clLime)
|
||||
else Affiche('COM'+intToSTR(tablo_acc_comusb[index].numcom)+' périphérique non ouvert',clOrange);
|
||||
begin
|
||||
if connecte_port_usb_acc(index) then
|
||||
end
|
||||
else
|
||||
begin // si port com socket
|
||||
@@ -12309,13 +12212,11 @@ begin
|
||||
if affevt then affiche('Evt Edit act Change',clyellow);
|
||||
with Formconfig do
|
||||
begin
|
||||
begin
|
||||
s:=EditNomAcc.Text;
|
||||
Tablo_acc_COMUSB[ligneClicAccCOM+1].nom:=s;
|
||||
maj_champs_combos(ligneClicAccCOM+1);
|
||||
s:=encode_Periph(ligneClicAccCOM+1);
|
||||
ListBoxAcc.Items[ligneClicAccCOM]:=s;
|
||||
ListBoxAcc.Selected[ligneClicAccCOM]:=true;
|
||||
ListBoxAcc.Selected[ligneClicAccCOM]:=true;
|
||||
end;
|
||||
end;
|
||||
|
||||
Reference in New Issue
Block a user