V8.36
This commit is contained in:
135
UnitConfig.pas
135
UnitConfig.pas
@@ -352,6 +352,9 @@ type
|
||||
ButtonPFCDM: TButton;
|
||||
CheckBoxZ21: TCheckBox;
|
||||
RadioButtonDCCpp: TRadioButton;
|
||||
CheckBoxSombre: TCheckBox;
|
||||
ButtonCouleur: TButton;
|
||||
ColorDialogFond: TColorDialog;
|
||||
procedure ButtonAppliquerEtFermerClick(Sender: TObject);
|
||||
procedure FormActivate(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
@@ -533,6 +536,8 @@ type
|
||||
|
||||
procedure EditChercherChange(Sender: TObject);
|
||||
|
||||
procedure SBMonteClick(Sender: TObject);
|
||||
|
||||
procedure SBDescClick(Sender: TObject);
|
||||
|
||||
procedure CheckBoxResaClick(Sender: TObject);
|
||||
@@ -551,6 +556,8 @@ const
|
||||
|
||||
procedure EditP2Exit(Sender: TObject);
|
||||
|
||||
procedure EditDevieS2Change(Sender: TObject);
|
||||
|
||||
procedure ButtonCouleurClick(Sender: TObject);
|
||||
|
||||
procedure ColorDialogFondShow(Sender: TObject);
|
||||
@@ -681,6 +688,7 @@ procedure trier_detecteurs;
|
||||
LabelDecCde : array[1..19] of TLabel;
|
||||
|
||||
shape1,ShapeZ : Tshape;
|
||||
ShapeT : array[1..10] of TShape;
|
||||
|
||||
BoutonCom : Tbutton;
|
||||
|
||||
@@ -1697,6 +1705,9 @@ begin
|
||||
intToSTR(trains[index].vitmax)+','+intToSTR(trains[index].vitnominale)+','+
|
||||
intToSTR(trains[index].vitRalenti);
|
||||
end;
|
||||
|
||||
// modifie le fichier de config en fonction du paramétrage
|
||||
procedure genere_config;
|
||||
var s: string;
|
||||
fichierN : text;
|
||||
i,j,n,k : integer;
|
||||
@@ -2975,6 +2986,22 @@ var s,sa,SOrigine: string;
|
||||
Tablo_periph[NbPeriph].NumCom:=i;
|
||||
Tablo_com_cde[NbPeriph].NumPeriph:=NbPeriph;
|
||||
end;
|
||||
until (sOrigine='0') or (NbPeriph>=NbMaxi_Periph);
|
||||
end;
|
||||
|
||||
|
||||
procedure lit_flux;
|
||||
label ici1,ici2,ici3,ici4 ;
|
||||
var i : integer;
|
||||
|
||||
begin
|
||||
// valeurs par défaut
|
||||
Nb_cantons_Sig:=3;
|
||||
nv:=0; it:=0;
|
||||
// taille de fonte
|
||||
repeat
|
||||
s:=lit_ligne;
|
||||
|
||||
sa:=uppercase(debug_ch)+'=';
|
||||
i:=pos(sa,s);
|
||||
if i=1 then
|
||||
@@ -3967,6 +3994,7 @@ begin
|
||||
if RadioButtonECOS.Checked then ServeurInterfaceCDM:=7;
|
||||
if RadioButtonDccpl.Checked then ServeurInterfaceCDM:=8;
|
||||
if RadioButton13.Checked then ServeurRetroCDM:=1;
|
||||
if RadioButton14.Checked then ServeurRetroCDM:=2;
|
||||
if RadioButton15.Checked then ServeurRetroCDM:=3;
|
||||
if RadioButton16.Checked then ServeurRetroCDM:=4;
|
||||
if RadioButton17.Checked then ServeurRetroCDM:=5;
|
||||
@@ -4029,7 +4057,7 @@ begin
|
||||
// LC=index du signal
|
||||
procedure clicListeSignal(index : integer);
|
||||
var AncAdresse,adresse,erreur : integer;
|
||||
if index<1 then exit;
|
||||
s : string;
|
||||
begin
|
||||
if index<1 then exit;
|
||||
s:=Uppercase(FormConfig.ListBoxSig.Items[index-1]); // ligne cliquée
|
||||
@@ -4128,6 +4156,7 @@ begin
|
||||
RadioButtonXN.Checked:=ServeurInterfaceCDM=1;
|
||||
RadioButtonP50.Checked:=ServeurInterfaceCDM=2;
|
||||
RadioButtonSP.Checked:=ServeurInterfaceCDM=3;
|
||||
RadioButtonFIS.Checked:=ServeurInterfaceCDM=4;
|
||||
RadioButtonRS.Checked:=ServeurInterfaceCDM=5;
|
||||
RadioButtonDCCpp.Checked:=ServeurInterfaceCDM=6;
|
||||
RadioButtonECOS.Checked:=ServeurInterfaceCDM=7;
|
||||
@@ -4514,7 +4543,7 @@ begin
|
||||
end
|
||||
else inc(i);
|
||||
until i>NbreDecPers;
|
||||
// textbox du protocole
|
||||
end;
|
||||
|
||||
// textbox du protocole
|
||||
procedure TformConfig.tb_onChange(sender : TObject);
|
||||
@@ -4541,6 +4570,52 @@ begin
|
||||
|
||||
maj_champs_combos(ligneClicAccPeriph+1);
|
||||
|
||||
// recalculer le nombre de sockets et de comusb
|
||||
// et réaffecter les numéros de composants
|
||||
NbPeriph_COMUSB:=0;
|
||||
NbPeriph_Socket:=0;
|
||||
for i:=1 to NbMaxi_Periph do
|
||||
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_periph[i].numComposant:=NbPeriph_COMUSB;
|
||||
Tablo_com_cde[i].NumPeriph:=NbPeriph_COMUSB;
|
||||
end;
|
||||
if v=2 then
|
||||
begin
|
||||
inc(NbPeriph_Socket);
|
||||
if NbPeriph_Socket>MaxComSocketPeriph then labelInfo.Caption:='Nombre maxi de périphériques socket atteint';
|
||||
Tablo_periph[NbPeriph].numComposant:=NbPeriph_socket;
|
||||
Tablo_com_cde[i].NumPeriph:=NbPeriph_Socket;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure couleurs_config;
|
||||
var i : integer;
|
||||
c : tcomponent;
|
||||
begin
|
||||
if sombre then
|
||||
with formconfig do
|
||||
begin
|
||||
Color:=Couleurfond;
|
||||
// page principale
|
||||
for i:=0 to formconfig.ComponentCount-1 do
|
||||
begin
|
||||
c:=Components[i];
|
||||
composant(c,couleurfond,couleurTexte);
|
||||
end;
|
||||
|
||||
// onglet cdmrail
|
||||
for i:=0 to TabSheetCDM.ComponentCount-1 do
|
||||
begin
|
||||
c:=TabSheetCDM.Components[i];
|
||||
Affiche(c.Name,clred);
|
||||
composant(c,couleurfond,couleurTexte);
|
||||
end;
|
||||
|
||||
// onglet décodeurs
|
||||
for i:=0 to TabSheetDecodeurs.ComponentCount-1 do
|
||||
@@ -4559,10 +4634,17 @@ end;
|
||||
// périphériques
|
||||
for i:=0 to TabSheetPeriph.ComponentCount-1 do
|
||||
begin
|
||||
end;
|
||||
c:=TabSheetPeriph.Components[i];
|
||||
composant(c,couleurfond,couleurTexte);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
// on change textBoxCde des décodeurs
|
||||
procedure TformConfig.tbCde_onchange(sender : Tobject);
|
||||
var tb : tEdit;
|
||||
s,te : string;
|
||||
i : integer;
|
||||
begin
|
||||
if affevt then affiche('tbCde_onchange',clyellow);
|
||||
tb:=sender as Tedit;
|
||||
@@ -4593,7 +4675,6 @@ begin
|
||||
Aig_supprime.Adresse:=0;
|
||||
Feu_Supprime.Adresse:=0;
|
||||
Feu_sauve.adresse:=0;
|
||||
Compt_ligne:=0;
|
||||
clicListe:=false;
|
||||
ligneCherche:=0;
|
||||
Compt_ligne:=0;
|
||||
@@ -4611,7 +4692,7 @@ begin
|
||||
begin
|
||||
y:=i*40+20;
|
||||
|
||||
begin
|
||||
// rectangle
|
||||
ShapeT[i]:=Tshape.create(FormConfig.TabSheetDecodeurs);
|
||||
with ShapeT[i] do
|
||||
begin
|
||||
@@ -4625,7 +4706,7 @@ begin
|
||||
|
||||
ComboL1[i]:=TcomboBox.create(FormConfig.TabSheetDecodeurs);
|
||||
with ComboL1[i] do
|
||||
text:='';
|
||||
begin
|
||||
Name:='ComboL1'+intToSTR(i);
|
||||
text:='';
|
||||
left:=10;Top:=y;Width:=150;Height:=15;
|
||||
@@ -4690,6 +4771,7 @@ begin
|
||||
parent:=TabSheetDecodeurs;
|
||||
itemIndex:=-1;
|
||||
items.add('- 1 rouge dévié');
|
||||
items.add('+ 2 vert droit');
|
||||
if (i-1) mod 2=0 then s:='Sortie 1' else s:='Sortie 2';
|
||||
Hint:=s;
|
||||
ShowHint:=true;
|
||||
@@ -5350,8 +5432,8 @@ begin
|
||||
end;
|
||||
inc(i);
|
||||
until (CdeDccpp[i]='') or (i>MaxCdeDccpp);
|
||||
EditBase.Text:=intToSTR(AdrBaseDetDccpp);
|
||||
|
||||
|
||||
CheckEnvAigDccpp.Checked:=EnvAigDccpp=1;
|
||||
EditBase.Text:=intToSTR(AdrBaseDetDccpp);
|
||||
|
||||
with ListBoxTrains do
|
||||
@@ -5447,7 +5529,6 @@ begin
|
||||
readOnly:=true;
|
||||
color:=clBtnFace;
|
||||
//Font.Color:=clAqua;
|
||||
ShowHint:=true;
|
||||
clear;
|
||||
Hint:='Références croisées de l''utilisation des périphériques';
|
||||
ShowHint:=true;
|
||||
@@ -5458,7 +5539,7 @@ begin
|
||||
begin
|
||||
Left:=100;Top:=ButtonOuvreCom.top;Width:=75;Height:=20;
|
||||
caption:='Lister COMs';
|
||||
ShowHint:=true;
|
||||
name:='BoutonCom';
|
||||
parent:=FormConfig.TabSheetPeriph;
|
||||
hint:='Affiche les ports COM/USB disponibles';
|
||||
ShowHint:=true;
|
||||
@@ -5517,6 +5598,7 @@ begin
|
||||
parent:=groupBoxDesc;
|
||||
Left:=10;Top:=CheckBoxCR.top+20;Width:=100;Height:=12;
|
||||
caption:='Mode visible';
|
||||
name:='cbVis';
|
||||
hint:='Affiche le texte à l''écran lors des envois';
|
||||
ShowHint:=true;
|
||||
onclick:=formconfig.cb_onclick;
|
||||
@@ -5635,7 +5717,6 @@ var Adresse,Adr2,ind,id2,erreur,position : integer;
|
||||
|
||||
if n=0 then s:=s+'Le périphérique '+intToSTR(ligneClicAccPeriph+1)+' n''est pas utilisé'+#13;
|
||||
utilisateurs_peripheriques:=s;
|
||||
|
||||
end;
|
||||
|
||||
|
||||
@@ -5650,6 +5731,7 @@ begin
|
||||
cbVis.Checked:=Tablo_periph[index].ScvVis;
|
||||
CheckBoxCR.Checked:=Tablo_periph[index].cr;
|
||||
EditPortCde.text:=Tablo_periph[index].protocole;
|
||||
MemoPeriph.Clear;
|
||||
clicliste:=false;
|
||||
end;
|
||||
|
||||
@@ -5657,7 +5739,6 @@ begin
|
||||
procedure Aff_champs_aig_tablo(index : integer);
|
||||
var Adresse,Adr2,ind,id2,erreur,position : integer;
|
||||
tjd,tri,tjs,croi : boolean;
|
||||
B : char;
|
||||
s,ss : string;
|
||||
i : integer;
|
||||
begin
|
||||
@@ -6744,7 +6825,8 @@ begin
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
end
|
||||
end;
|
||||
|
||||
procedure raz_champs_act;
|
||||
begin
|
||||
@@ -8123,11 +8205,11 @@ begin
|
||||
modele: TEquipement;
|
||||
c : char;
|
||||
begin
|
||||
if FormConfig.PageControl.ActivePage=FormConfig.TabSheetAig then
|
||||
if clicliste then exit;
|
||||
if ligneclicAig<0 then exit;
|
||||
if FormConfig.PageControl.ActivePage=FormConfig.TabSheetAig then
|
||||
with Formconfig do
|
||||
Val(s,i,erreur);
|
||||
begin
|
||||
s:=EditAdrAig.Text;
|
||||
Val(s,i,erreur);
|
||||
if (erreur<>0) or (i<=0) or (i>MaxAcc) then
|
||||
@@ -12746,6 +12828,7 @@ begin
|
||||
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;
|
||||
@@ -13052,7 +13135,7 @@ begin
|
||||
clicliste:=false;
|
||||
config_modifie:=true;
|
||||
end;
|
||||
// menu contextuel des listBox
|
||||
|
||||
|
||||
// menu contextuel des listBox
|
||||
procedure TFormConfig.Supprimer1Click(Sender: TObject);
|
||||
@@ -13471,7 +13554,7 @@ begin
|
||||
LabelNumeroP.caption:='';
|
||||
|
||||
// inverse les deux entrées de la listebox
|
||||
ListBoxPeriph.Items[i]:=s;
|
||||
s:=ListBoxPeriph.Items[i+1];
|
||||
ListBoxPeriph.Items[i+1]:=ListBoxPeriph.Items[i];
|
||||
ListBoxPeriph.Items[i]:=s;
|
||||
|
||||
@@ -13495,6 +13578,22 @@ procedure TFormConfig.EditP2Exit(Sender: TObject);
|
||||
reaffecte_index_combos(indexListe+1,IndexListe+2,IndexListe+2,IndexListe+1);
|
||||
fabrique_combos_periph;
|
||||
|
||||
aff_champs_Act(ligneclicAct+1);
|
||||
// réaffiche les champs qui contiennent les 3 combobox de périphériques
|
||||
maj_decodeurs;
|
||||
aff_champs_Act(ligneclicAct+1);
|
||||
Aff_champs_PN(lignecliqueePN+1);
|
||||
|
||||
config_modifie:=true;
|
||||
|
||||
end;
|
||||
|
||||
procedure TFormConfig.CheckBoxResaClick(Sender: TObject);
|
||||
|
||||
begin
|
||||
avecResa:=CheckBoxResa.Checked;
|
||||
end;
|
||||
|
||||
|
||||
procedure TFormConfig.EditPortServeurExit(Sender: TObject);
|
||||
|
||||
var i,erreur : integer;
|
||||
|
||||
Reference in New Issue
Block a user