V9.74
This commit is contained in:
1 parent
40d91f9ca8
commit
95cf06b007
16 files changed
+427
-264
No files matched your search
Binary file not shown.
BIN
Binary file not shown.
+12
-10
@@ -856,7 +856,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// coordonnées image en CDM
|
// coordonnées fenêtre image en CDM
|
||||||
procedure inv_coords(var x,y : integer);
|
procedure inv_coords(var x,y : integer);
|
||||||
begin
|
begin
|
||||||
x:=x-(cadre div 2);
|
x:=x-(cadre div 2);
|
||||||
@@ -866,7 +866,7 @@ begin
|
|||||||
y:=ymaxiCDM-(round(y*1000/reducY));
|
y:=ymaxiCDM-(round(y*1000/reducY));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// coordonnées CDM en image
|
// coordonnées CDM en fenêtre image
|
||||||
procedure Coords(var x,y : integer);
|
procedure Coords(var x,y : integer);
|
||||||
begin
|
begin
|
||||||
x:=(round( (x - xMiniCDM) * reducX/1000 )) + (cadre div 2);
|
x:=(round( (x - xMiniCDM) * reducX/1000 )) + (cadre div 2);
|
||||||
@@ -925,6 +925,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
// trouve si le point x,y est sur l'arc de centre CentreX,Y de rayon ..
|
// trouve si le point x,y est sur l'arc de centre CentreX,Y de rayon ..
|
||||||
|
// deb = debug affichage
|
||||||
function point_sur_arc(x,y,CentreX,centreY,rayon : integer;StartDegres,StopDegres : single;deb : boolean) : boolean;
|
function point_sur_arc(x,y,CentreX,centreY,rayon : integer;StartDegres,StopDegres : single;deb : boolean) : boolean;
|
||||||
var a : single;
|
var a : single;
|
||||||
cosA,SinA : extended;
|
cosA,SinA : extended;
|
||||||
@@ -944,7 +945,7 @@ begin
|
|||||||
StopDegres:=-StopDegres;
|
StopDegres:=-StopDegres;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
StartDegres:=StartDegres*pisur180; //+3*pi/4;
|
StartDegres:=StartDegres*pisur180;
|
||||||
StopDegres:=StartDegres+StopDegres*pisur180;
|
StopDegres:=StartDegres+StopDegres*pisur180;
|
||||||
a:=startDegres;
|
a:=startDegres;
|
||||||
repeat
|
repeat
|
||||||
@@ -954,12 +955,12 @@ begin
|
|||||||
yArc:=CentreY-round(rayon*sinA);
|
yArc:=CentreY-round(rayon*sinA);
|
||||||
|
|
||||||
trouve:=(abs(x-xArc)<precision_clic) and (abs(y-yArc)<precision_clic);
|
trouve:=(abs(x-xArc)<precision_clic) and (abs(y-yArc)<precision_clic);
|
||||||
if deb then
|
if deb then
|
||||||
begin
|
begin
|
||||||
Affiche(intToSTR(x-xArc)+' / '+intToSTR(y-yARc),clyellow);
|
Affiche(intToSTR(x-xArc)+' / '+intToSTR(y-yARc),clyellow);
|
||||||
canvas.Pen.Color:=clred;
|
canvas.Pen.Color:=clred;
|
||||||
canvas.MoveTo(xArc,yArc);Canvas.LineTo(Xarc+3,yArc+3);
|
canvas.MoveTo(xArc,yArc);Canvas.LineTo(Xarc+3,yArc+3);
|
||||||
end;
|
end;
|
||||||
a:=a+0.02;
|
a:=a+0.02;
|
||||||
until (trouve) or (a>StopDegres);
|
until (trouve) or (a>StopDegres);
|
||||||
result:=trouve;
|
result:=trouve;
|
||||||
@@ -1068,9 +1069,10 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
// trace une ligne en coordonnées CDM
|
||||||
procedure ligneCDM(canvas: Tcanvas;x1,y1,x2,y2 : integer);
|
procedure ligneCDM(canvas: Tcanvas;x1,y1,x2,y2 : integer);
|
||||||
begin
|
begin
|
||||||
coords(x1,y1);
|
coords(x1,y1); // transforme en coordonnées fenêtre
|
||||||
coords(x2,y2);
|
coords(x2,y2);
|
||||||
with canvas do
|
with canvas do
|
||||||
begin
|
begin
|
||||||
|
|||||||
+4
-1
@@ -330,6 +330,7 @@ begin
|
|||||||
DrawMinSteps;
|
DrawMinSteps;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
// sur la fermeture de SC, l'horloge provoque une exception
|
||||||
procedure calcul_pos_horloge;
|
procedure calcul_pos_horloge;
|
||||||
begin
|
begin
|
||||||
if not assigned(formclock) or (formclock=nil) or fermeSC then exit;
|
if not assigned(formclock) or (formclock=nil) or fermeSC then exit;
|
||||||
@@ -341,7 +342,9 @@ begin
|
|||||||
formclock.height:=HauteurFC;
|
formclock.height:=HauteurFC;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
OffsetYFC:=(formprinc.top+formPrinc.height)-FormClock.height-28;
|
try OffsetYFC:=(formprinc.top+formPrinc.height)-FormClock.height-28;
|
||||||
|
except exit;
|
||||||
|
end;
|
||||||
OffsetXFC:=(formprinc.left+formPrinc.width)-formClock.width;
|
OffsetXFC:=(formprinc.left+formPrinc.width)-formClock.width;
|
||||||
|
|
||||||
// écart entre fenetre principale et clock
|
// écart entre fenetre principale et clock
|
||||||
|
|||||||
+1
-1
@@ -683,7 +683,7 @@ object FormConfig: TFormConfig
|
|||||||
Top = 8
|
Top = 8
|
||||||
Width = 633
|
Width = 633
|
||||||
Height = 505
|
Height = 505
|
||||||
ActivePage = TabSheetFonctions
|
ActivePage = TabAvance
|
||||||
Font.Charset = DEFAULT_CHARSET
|
Font.Charset = DEFAULT_CHARSET
|
||||||
Font.Color = clBlack
|
Font.Color = clBlack
|
||||||
Font.Height = -11
|
Font.Height = -11
|
||||||
|
|||||||
+18
-19
@@ -707,14 +707,14 @@ type
|
|||||||
procedure tbCde_onchange(Sender : Tobject);
|
procedure tbCde_onchange(Sender : Tobject);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Tliste = record
|
Tliste = record // liste des paramètres avancés de la ValueListEditor
|
||||||
Nom : string;
|
Nom : string; // Nom de la variable
|
||||||
aide : string;
|
aide : string; // pour le hint
|
||||||
typ : (Simple,PickList,titre);
|
typ : (Simple,PickList,titre); // type d'entrée : simple=entier picklist=combobox titre=texte sans variable associée
|
||||||
masque : string;
|
masque : string; // masque de saisie des entiers
|
||||||
variable : pointer;
|
variable : pointer; // pointeur sur la variable à modifier
|
||||||
typeVar : (rien3,entier,bool,chaine);
|
typeVar : (rien3,entier,bool,chaine); // type de la variable à modifier
|
||||||
textePL1,textePL2 : string;
|
textePL1,textePL2 : string; // texte des comboBox si typ est picklist
|
||||||
end;
|
end;
|
||||||
|
|
||||||
const
|
const
|
||||||
@@ -2554,17 +2554,18 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
// trier les aiguillages par adresses croissantes
|
// trier les aiguillages par adresses croissantes
|
||||||
// et complète les aiguillages triples
|
// et complète les aiguillages triples (créée aiguillahe homologue)
|
||||||
procedure trier_aig;
|
procedure trier_aig;
|
||||||
var i,j,adr : integer;
|
var i,j,adr : integer;
|
||||||
temp : TAiguillage;
|
temp : TAiguillage;
|
||||||
s : string;
|
s : string;
|
||||||
begin
|
begin
|
||||||
// trouve les aig triple
|
|
||||||
// attribue les index
|
// attribue les index
|
||||||
i:=1;
|
i:=1;
|
||||||
while (i<MaxAiguillage) do
|
while (i<MaxAiguillage) do
|
||||||
begin
|
begin
|
||||||
|
// trouve les aiguillages triples
|
||||||
if aiguillage[i].modele=triple then
|
if aiguillage[i].modele=triple then
|
||||||
begin
|
begin
|
||||||
j:=index_aig(aiguillage[i].adrTriple); // adresse de l'aiguillage homologue triple
|
j:=index_aig(aiguillage[i].adrTriple); // adresse de l'aiguillage homologue triple
|
||||||
@@ -2589,6 +2590,7 @@ begin
|
|||||||
inc(i);
|
inc(i);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
// tri du tableau d'aiguillages
|
||||||
for i:=1 to MaxAiguillage-1 do
|
for i:=1 to MaxAiguillage-1 do
|
||||||
begin
|
begin
|
||||||
for j:=i+1 to MaxAiguillage do
|
for j:=i+1 to MaxAiguillage do
|
||||||
@@ -2685,7 +2687,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// trouve les id des routes des trains
|
// trouve les id des routesPref des trains et le stocke dedans
|
||||||
procedure compile_id_routes;
|
procedure compile_id_routes;
|
||||||
var t1,t2,r1,r2,Id,nr : integer;
|
var t1,t2,r1,r2,Id,nr : integer;
|
||||||
route1 : tUneroute;
|
route1 : tUneroute;
|
||||||
@@ -6756,7 +6758,7 @@ begin
|
|||||||
'3 pour les petits réseaux jusque 5 ou 6 pour les grands' ;
|
'3 pour les petits réseaux jusque 5 ou 6 pour les grands' ;
|
||||||
|
|
||||||
typ:= Simple ;
|
typ:= Simple ;
|
||||||
masque:= '0';
|
masque:= '0'; // 1 chiffre
|
||||||
variable:=@Nb_Det_Dist;
|
variable:=@Nb_Det_Dist;
|
||||||
typeVar:=entier;
|
typeVar:=entier;
|
||||||
end;
|
end;
|
||||||
@@ -7812,7 +7814,7 @@ begin
|
|||||||
comboBoxNation.Items.add('Française');
|
comboBoxNation.Items.add('Française');
|
||||||
comboBoxNation.Items.add('Belge');
|
comboBoxNation.Items.add('Belge');
|
||||||
|
|
||||||
// actionneurs actions
|
// actions
|
||||||
ListBoxActions.Clear;
|
ListBoxActions.Clear;
|
||||||
longestLength:=0;
|
longestLength:=0;
|
||||||
for i:=1 to maxTablo_act do
|
for i:=1 to maxTablo_act do
|
||||||
@@ -7935,12 +7937,6 @@ begin
|
|||||||
// Styles (Embarcadero Dephi11)
|
// Styles (Embarcadero Dephi11)
|
||||||
|
|
||||||
// remplir la combobox avec les styles disponibles
|
// remplir la combobox avec les styles disponibles
|
||||||
{for s in TStyleManager.StyleNames do
|
|
||||||
begin
|
|
||||||
cs:=lowercase(s);
|
|
||||||
ComboStyle.Items.Add(s);
|
|
||||||
end; }
|
|
||||||
|
|
||||||
for i:=0 to nombreStyles do
|
for i:=0 to nombreStyles do
|
||||||
begin
|
begin
|
||||||
ComboStyle.Items.Add(Style[i].NomStyle);
|
ComboStyle.Items.Add(Style[i].NomStyle);
|
||||||
@@ -7989,6 +7985,7 @@ begin
|
|||||||
|
|
||||||
PageControl.ActivePage:=Formconfig.TabSheetCDM; // force le premier onglet sur la page
|
PageControl.ActivePage:=Formconfig.TabSheetCDM; // force le premier onglet sur la page
|
||||||
couleurs_config;
|
couleurs_config;
|
||||||
|
formconfig.LabelInfo.Caption:='';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// décode un morceau d'une chaine d'aiguillage ('P5S')
|
// décode un morceau d'une chaine d'aiguillage ('P5S')
|
||||||
@@ -15731,6 +15728,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
// et DCC
|
// et DCC
|
||||||
|
{
|
||||||
i:=1;
|
i:=1;
|
||||||
RichCdeDCCpp.clear;
|
RichCdeDCCpp.clear;
|
||||||
repeat
|
repeat
|
||||||
@@ -15741,6 +15739,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
inc(i);
|
inc(i);
|
||||||
until (CdeDccpp[i]='') or (i>MaxCdeDccpp);
|
until (CdeDccpp[i]='') or (i>MaxCdeDccpp);
|
||||||
|
}
|
||||||
|
|
||||||
// trains
|
// trains
|
||||||
with ListBoxTrains do
|
with ListBoxTrains do
|
||||||
|
|||||||
@@ -662,7 +662,7 @@ object FormConfCellTCO: TFormConfCellTCO
|
|||||||
object ImageListIcones: TImageList
|
object ImageListIcones: TImageList
|
||||||
Left = 160
|
Left = 160
|
||||||
Bitmap = {
|
Bitmap = {
|
||||||
494C010121002200040010001000FFFFFFFFFF00FFFFFFFFFFFFFFFF424D3600
|
494C010121002200040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
|
||||||
0000000000003600000028000000400000009000000001002000000000000090
|
0000000000003600000028000000400000009000000001002000000000000090
|
||||||
0000000000000000000000000000000000000000000000000000000000000000
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
0000000000000000000000000000000000000000000000000000000000000000
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
@@ -1854,6 +1854,7 @@ object FormConfCellTCO: TFormConfCellTCO
|
|||||||
000000000000F56F000000000000F56F000000000000F54F000000000000FB6F
|
000000000000F56F000000000000F56F000000000000F54F000000000000FB6F
|
||||||
000000000000FFFF000000000000000000000000000000000000000000000000
|
000000000000FFFF000000000000000000000000000000000000000000000000
|
||||||
0000000000000000000000000000000000000000000000000000000000000000
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
00000000000000000000000000000000}
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
000000000000}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -254,6 +254,7 @@ begin
|
|||||||
with formConfCellTCO do
|
with formConfCellTCO do
|
||||||
begin
|
begin
|
||||||
// ramener la coordonnée cliquée à l'origine du canton
|
// ramener la coordonnée cliquée à l'origine du canton
|
||||||
|
{
|
||||||
if (Bimage>=Id_cantonH) and (Bimage<=Id_cantonH+9) then
|
if (Bimage>=Id_cantonH) and (Bimage<=Id_cantonH+9) then
|
||||||
begin
|
begin
|
||||||
H:=true;
|
H:=true;
|
||||||
@@ -266,7 +267,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
XclicCell[indexTCO]:=XclicC;
|
XclicCell[indexTCO]:=XclicC;
|
||||||
YclicCell[indexTCO]:=YclicC;
|
YclicCell[indexTCO]:=YclicC;
|
||||||
|
}
|
||||||
idCanton:=index_canton(indexTCO,xclicC,yclicC);
|
idCanton:=index_canton(indexTCO,xclicC,yclicC);
|
||||||
|
|
||||||
GroupBoxOrientation.visible:=false;
|
GroupBoxOrientation.visible:=false;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
object FormFicheHoraire: TFormFicheHoraire
|
object FormFicheHoraire: TFormFicheHoraire
|
||||||
Left = 358
|
Left = 358
|
||||||
Top = 169
|
Top = 169
|
||||||
Width = 617
|
Width = 623
|
||||||
Height = 377
|
Height = 377
|
||||||
Caption = 'Fiche horaire'
|
Caption = 'Fiche horaire'
|
||||||
Color = clBtnFace
|
Color = clBtnFace
|
||||||
@@ -15,8 +15,8 @@ object FormFicheHoraire: TFormFicheHoraire
|
|||||||
OnActivate = FormActivate
|
OnActivate = FormActivate
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
DesignSize = (
|
DesignSize = (
|
||||||
609
|
607
|
||||||
346)
|
321)
|
||||||
PixelsPerInch = 96
|
PixelsPerInch = 96
|
||||||
TextHeight = 13
|
TextHeight = 13
|
||||||
object Label1: TLabel
|
object Label1: TLabel
|
||||||
@@ -60,7 +60,7 @@ object FormFicheHoraire: TFormFicheHoraire
|
|||||||
object StringGridFO: TStringGrid
|
object StringGridFO: TStringGrid
|
||||||
Left = 8
|
Left = 8
|
||||||
Top = 16
|
Top = 16
|
||||||
Width = 593
|
Width = 601
|
||||||
Height = 233
|
Height = 233
|
||||||
ColCount = 4
|
ColCount = 4
|
||||||
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goEditing]
|
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goEditing]
|
||||||
|
|||||||
+29
-29
@@ -120,9 +120,8 @@ end;
|
|||||||
procedure TFormFicheHoraire.FormCreate(Sender: TObject);
|
procedure TFormFicheHoraire.FormCreate(Sender: TObject);
|
||||||
var i,champ,ligne,col,erreur : integer;
|
var i,champ,ligne,col,erreur : integer;
|
||||||
f : textFile ;
|
f : textFile ;
|
||||||
s,ss,v : string;
|
s,ss,v,nomTrain : string;
|
||||||
ver : single;
|
ver : single;
|
||||||
MRect : Trect;
|
|
||||||
begin
|
begin
|
||||||
// cells[colonne,ligne]
|
// cells[colonne,ligne]
|
||||||
with stringGridFO do
|
with stringGridFO do
|
||||||
@@ -143,7 +142,7 @@ begin
|
|||||||
ColWidths[ColRoute]:=100;
|
ColWidths[ColRoute]:=100;
|
||||||
ColWidths[ColHDep]:=60;
|
ColWidths[ColHDep]:=60;
|
||||||
ColWidths[ColVitDem]:=60;
|
ColWidths[ColVitDem]:=60;
|
||||||
ColWidths[ColSens]:=50;
|
ColWidths[ColSens]:=60;
|
||||||
ColWidths[ColArret]:=60;
|
ColWidths[ColArret]:=60;
|
||||||
|
|
||||||
Cells[ColLigne,0]:='Ligne';
|
Cells[ColLigne,0]:='Ligne';
|
||||||
@@ -154,7 +153,7 @@ begin
|
|||||||
Cells[ColSens,0]:='Sens'+#13+'(N/R)';
|
Cells[ColSens,0]:='Sens'+#13+'(N/R)';
|
||||||
Cells[ColArret,0]:='Forcer arrêt'+#13+'O/N';
|
Cells[ColArret,0]:='Forcer arrêt'+#13+'O/N';
|
||||||
|
|
||||||
RowHeights[0]:=22;
|
RowHeights[0]:=30;
|
||||||
|
|
||||||
// numéroter les lignes et fixer la hauteur des lignes
|
// numéroter les lignes et fixer la hauteur des lignes
|
||||||
for i:=1 to RowCount-1 do
|
for i:=1 to RowCount-1 do
|
||||||
@@ -199,9 +198,9 @@ begin
|
|||||||
if col=ColTrain then // nom du train
|
if col=ColTrain then // nom du train
|
||||||
begin
|
begin
|
||||||
if champ=0 then begin affiche('Erreur 17',clred);closefile(f);end;
|
if champ=0 then begin affiche('Erreur 17',clred);closefile(f);end;
|
||||||
ss:=copy(s,1,champ-1);
|
NomTrain:=copy(s,1,champ-1);
|
||||||
stringGridFO.Cells[col,ligne]:=ss;
|
stringGridFO.Cells[col,ligne]:=NomTrain;
|
||||||
grilleHoraire[ligne].NomTrain:=ss;
|
grilleHoraire[ligne].NomTrain:=NomTrain;
|
||||||
if champ<>0 then delete(s,1,champ);
|
if champ<>0 then delete(s,1,champ);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -260,8 +259,8 @@ begin
|
|||||||
inc(ligne);
|
inc(ligne);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
until eof(f) or (ligne>MaxHoraire);
|
until eof(f) or (nomTrain='') or (ligne>MaxHoraire);
|
||||||
Nombre_horaires:=ligne-1;
|
Nombre_horaires:=ligne-2;
|
||||||
|
|
||||||
closefile(f);
|
closefile(f);
|
||||||
couleurs_Fiche;
|
couleurs_Fiche;
|
||||||
@@ -337,29 +336,30 @@ begin
|
|||||||
{$IF CompilerVersion >= 28.0}
|
{$IF CompilerVersion >= 28.0}
|
||||||
d12:=true;
|
d12:=true;
|
||||||
{$IFEND}
|
{$IFEND}
|
||||||
|
//Affiche(intToSTR(arow)+' '+intToSTR(aCol),clYellow);
|
||||||
// couleur de fond
|
// couleur de fond
|
||||||
couleur:=$E0E0E0;
|
if Arow=0 then
|
||||||
if d12 then couleur:=canvas.Pixels[1,1];
|
|
||||||
with grid.canvas do
|
|
||||||
begin
|
begin
|
||||||
Brush.Color := couleur;
|
if d12 then couleur:=grid.canvas.Pixels[35,6] else couleur:=$E0E0E0;
|
||||||
inc(Rect.top); inc(Rect.left); // rend visible les quadrillages
|
with grid.canvas do
|
||||||
FillRect(Rect);
|
begin
|
||||||
end;
|
Brush.Color := couleur;
|
||||||
|
inc(Rect.top); inc(Rect.left); // rend visible les quadrillages
|
||||||
|
FillRect(Rect);
|
||||||
|
end;
|
||||||
|
|
||||||
DRect:=Rect;
|
DRect:=Rect;
|
||||||
// calcule, ajuste et positionne la ligne de l'espace vertical nécessaire
|
// calcule, ajuste et positionne la ligne de l'espace vertical nécessaire
|
||||||
DrawText(Grid.Canvas.Handle,Pchar(S),Length(S),DRect,DT_CALCRECT or DT_CENTER);
|
DrawText(Grid.Canvas.Handle,Pchar(S),Length(S),DRect,DT_CALCRECT or DT_CENTER);
|
||||||
// if the text height is greater than the row height, increase the row height
|
// si la hauteur du texte est plus grande que la hauteur de la ligne, augmenter la hauteur de la ligne
|
||||||
|
if (DRect.Bottom-DRect.Top)>Grid.RowHeights[ARow] then Grid.RowHeights[ARow]:=DRect.Bottom-DRect.Top
|
||||||
if (DRect.Bottom - DRect.Top) > Grid.RowHeights[ARow] then Grid.RowHeights[ARow]:=DRect.Bottom - DRect.Top
|
// changer la hauteur de la cellule provoque son redessinage
|
||||||
// changer la hauteur de la cellule provoque son redessinage
|
else
|
||||||
else
|
begin
|
||||||
begin
|
DRect.Right:=Rect.Right;
|
||||||
DRect.Right:=Rect.Right;
|
Grid.Canvas.FillRect(DRect);
|
||||||
Grid.Canvas.FillRect(DRect);
|
DrawText(Grid.Canvas.Handle, Pchar(S), Length(S), DRect, DT_CENTER);
|
||||||
DrawText(Grid.Canvas.Handle, Pchar(S), Length(S), DRect, DT_CENTER);
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -352,7 +352,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TFormModifAction.ComboBoxFamilleChange(Sender: TObject);
|
procedure TFormModifAction.ComboBoxFamilleChange(Sender: TObject);
|
||||||
var i,n,famille : integer;
|
var i,famille : integer;
|
||||||
s : string;
|
s : string;
|
||||||
begin
|
begin
|
||||||
ListBoxOper.Clear;
|
ListBoxOper.Clear;
|
||||||
@@ -1711,7 +1711,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TFormModifAction.SpinEditEtatopChange(Sender: TObject);
|
procedure TFormModifAction.SpinEditEtatopChange(Sender: TObject);
|
||||||
var i,o,erreur,op : integer;
|
var i,erreur,op : integer;
|
||||||
begin
|
begin
|
||||||
if (ligneclicAct<0) or clicliste then exit;
|
if (ligneclicAct<0) or clicliste then exit;
|
||||||
val(SpinEditEtatop.text,i,erreur);
|
val(SpinEditEtatop.text,i,erreur);
|
||||||
|
|||||||
+193
-131
@@ -1481,7 +1481,7 @@ var path,ext : string;
|
|||||||
DirList : TStrings;
|
DirList : TStrings;
|
||||||
ok : boolean;
|
ok : boolean;
|
||||||
Sr : TSearchRec;
|
Sr : TSearchRec;
|
||||||
commande,chem,s : string;
|
chem,s : string;
|
||||||
nombre,i,j : integer;
|
nombre,i,j : integer;
|
||||||
Style1 : tStyle;
|
Style1 : tStyle;
|
||||||
{$IF CompilerVersion >= 28.0}
|
{$IF CompilerVersion >= 28.0}
|
||||||
@@ -1863,6 +1863,186 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function GetMACAdress: tstrings;
|
||||||
|
var
|
||||||
|
NCB: PNCB;
|
||||||
|
Adapter: PAdapterStatus;
|
||||||
|
RetCode: Ansichar;
|
||||||
|
s : tstrings;
|
||||||
|
I: integer;
|
||||||
|
Lenum: PlanaEnum;
|
||||||
|
_SystemID: string;
|
||||||
|
begin
|
||||||
|
Result:=nil;
|
||||||
|
_SystemID:='';
|
||||||
|
Getmem(NCB,SizeOf(TNCB));
|
||||||
|
Fillchar(NCB^,SizeOf(TNCB),0);
|
||||||
|
|
||||||
|
Getmem(Lenum,SizeOf(TLanaEnum));
|
||||||
|
Fillchar(Lenum^,SizeOf(TLanaEnum),0);
|
||||||
|
|
||||||
|
Getmem(Adapter,SizeOf(TAdapterStatus));
|
||||||
|
Fillchar(Adapter^,SizeOf(TAdapterStatus),0);
|
||||||
|
|
||||||
|
Lenum.Length := chr(0);
|
||||||
|
NCB.ncb_command := chr(NCBENUM);
|
||||||
|
NCB.ncb_buffer := Pointer(Lenum);
|
||||||
|
NCB.ncb_length := SizeOf(Lenum);
|
||||||
|
RetCode := Netbios(NCB);
|
||||||
|
|
||||||
|
s:=TstringList.Create;
|
||||||
|
i:=0;
|
||||||
|
repeat
|
||||||
|
Fillchar(NCB^,SizeOf(TNCB), 0);
|
||||||
|
Ncb.ncb_command:=chr(NCBRESET);
|
||||||
|
Ncb.ncb_lana_num:=lenum.lana[I];
|
||||||
|
RetCode:=Netbios(Ncb);
|
||||||
|
|
||||||
|
Fillchar(NCB^,SizeOf(TNCB), 0);
|
||||||
|
Ncb.ncb_command:=chr(NCBASTAT);
|
||||||
|
Ncb.ncb_lana_num:=lenum.lana[I];
|
||||||
|
// Must be 16
|
||||||
|
Ncb.ncb_callname:='* ';
|
||||||
|
|
||||||
|
Ncb.ncb_buffer:=Pointer(Adapter);
|
||||||
|
|
||||||
|
Ncb.ncb_length:=SizeOf(TAdapterStatus);
|
||||||
|
RetCode:=Netbios(Ncb);
|
||||||
|
//---- calc _systemId de la mac-address[2-5] XOR mac-address[1]...
|
||||||
|
if (RetCode=chr(0)) or (RetCode=chr(6)) then
|
||||||
|
begin
|
||||||
|
_SystemId := IntToHex(Ord(Adapter.adapter_address[0]), 2) + '-' +
|
||||||
|
IntToHex(Ord(Adapter.adapter_address[1]),2) + '-' +
|
||||||
|
IntToHex(Ord(Adapter.adapter_address[2]),2) + '-' +
|
||||||
|
IntToHex(Ord(Adapter.adapter_address[3]),2) + '-' +
|
||||||
|
IntToHex(Ord(Adapter.adapter_address[4]),2) + '-' +
|
||||||
|
IntToHex(Ord(Adapter.adapter_address[5]),2);
|
||||||
|
s.add(_SystemID);
|
||||||
|
//Affiche(_systemID,clYellow);
|
||||||
|
end;
|
||||||
|
Inc(i);
|
||||||
|
until (i>=Ord(Lenum.Length)) ;//or (_SystemID<>'00-00-00-00-00-00');
|
||||||
|
FreeMem(NCB);
|
||||||
|
FreeMem(Adapter);
|
||||||
|
FreeMem(Lenum);
|
||||||
|
result:=s;
|
||||||
|
end;
|
||||||
|
|
||||||
|
// ex2
|
||||||
|
function GetAdapterInfo(Lana: AnsiChar): String;
|
||||||
|
var
|
||||||
|
Adapter: TAdapterStatus;
|
||||||
|
Ncb: Tncb;
|
||||||
|
begin
|
||||||
|
FillChar(Ncb,SizeOf(Ncb),0);
|
||||||
|
Ncb.ncb_command:=Char(NCBRESET);
|
||||||
|
Ncb.ncb_lana_num:=Lana;
|
||||||
|
if Netbios(@Ncb)<>Char(NRC_GOODRET) then
|
||||||
|
begin
|
||||||
|
Result:='mac non trouvée';
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
FillChar(NCB,SizeOf(Ncb), 0);
|
||||||
|
NCB.ncb_command:=Char(NCBASTAT);
|
||||||
|
NCB.ncb_lana_num:=Lana;
|
||||||
|
NCB.ncb_callname:='*';
|
||||||
|
|
||||||
|
FillChar(Adapter,SizeOf(Adapter), 0);
|
||||||
|
NCB.ncb_buffer:=@Adapter;
|
||||||
|
NCB.ncb_length:=SizeOf(Adapter);
|
||||||
|
if Netbios(@Ncb)<>Char(NRC_GOODRET) then
|
||||||
|
begin
|
||||||
|
Result:='mac non trouvée';
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
Result:=
|
||||||
|
IntToHex(Byte(Adapter.adapter_address[0]),2) + '-' +
|
||||||
|
IntToHex(Byte(Adapter.adapter_address[1]),2) + '-' +
|
||||||
|
IntToHex(Byte(Adapter.adapter_address[2]),2) + '-' +
|
||||||
|
IntToHex(Byte(Adapter.adapter_address[3]),2) + '-' +
|
||||||
|
IntToHex(Byte(Adapter.adapter_address[4]),2) + '-' +
|
||||||
|
IntToHex(Byte(Adapter.adapter_address[5]),2);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function GetMACAddress: string;
|
||||||
|
var
|
||||||
|
AdapterList: TLanaEnum;
|
||||||
|
Ncb: Tncb;
|
||||||
|
begin
|
||||||
|
FillChar(Ncb,SizeOf(NCB),0);
|
||||||
|
NCB.ncb_command:=Char(NCBENUM);
|
||||||
|
NCB.ncb_buffer:=@AdapterList;
|
||||||
|
NCB.ncb_length:=SizeOf(AdapterList);
|
||||||
|
Netbios(@NCB);
|
||||||
|
if Byte(AdapterList.length)>0 then
|
||||||
|
Result:=GetAdapterInfo(AdapterList.lana[0])
|
||||||
|
else
|
||||||
|
Result:='mac non trouvée';
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure envoie_infos;
|
||||||
|
var ts : tstrings;
|
||||||
|
s,cmd : string;
|
||||||
|
retour,i,erreur : integer;
|
||||||
|
f : textFile;
|
||||||
|
begin
|
||||||
|
s:='';
|
||||||
|
cmd:='/c vol c: >vol.txt'; // /c ferme la fenetre en fin d'exec /k ne ferme pas
|
||||||
|
// si on fait un runas au lieu de open, çà ouvre une fenetre de demande admin sur les postes non admin
|
||||||
|
// ou dont le niveau d'utilisateur est bas dans le profil
|
||||||
|
retour:=ShellExecute(formprinc.Handle,pchar('open'),pchar('cmd.Exe'),PChar(cmd),nil,SW_SHOWNORMAL);
|
||||||
|
if retour<=32 then
|
||||||
|
begin
|
||||||
|
ShowMessage(SysErrorMessage(GetLastError));
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
assignfile(f,'vol.txt');
|
||||||
|
{$I-}
|
||||||
|
reset(f);
|
||||||
|
erreur:=IoResult;
|
||||||
|
{$I+}
|
||||||
|
if erreur=0 then
|
||||||
|
begin
|
||||||
|
readln(f,s);
|
||||||
|
readln(f,s);
|
||||||
|
closefile(f);
|
||||||
|
i:=pos('-',s);
|
||||||
|
if i>4 then
|
||||||
|
begin
|
||||||
|
i:=i-4;
|
||||||
|
s:=copy(s,i,9)+' ';
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
ts:=GetMACAdress;
|
||||||
|
for i:=0 to ts.Count-1 do
|
||||||
|
begin
|
||||||
|
s:=s+ts[i]+' ';
|
||||||
|
end;
|
||||||
|
Affiche(s,clyellow);
|
||||||
|
s:=DateToStr(date)+' '+TimeToStr(Time)+' V'+versionSC;
|
||||||
|
Affiche(s,clyellow);
|
||||||
|
|
||||||
|
//Affiche(GetCurrentDir,clyellow);
|
||||||
|
|
||||||
|
s:='NbreTCO='+intToSTR(nbreTCO);
|
||||||
|
s:=s+' Nbrecantons='+intToSTR(ncantons);
|
||||||
|
s:=s+' NbreTrains='+intToSTR(n_trains);
|
||||||
|
s:=s+' NbreHoraires='+intToSTR(Nombre_horaires);
|
||||||
|
s:=s+' NbreAig='+intToSTR(maxaiguillage);
|
||||||
|
s:=s+' NbreSignaux='+intToSTR(NbreSignaux);
|
||||||
|
s:=s+' NbreActions='+intToSTR(maxTablo_act);
|
||||||
|
s:=s+' NbrePN='+intToSTR(NbrePN);
|
||||||
|
|
||||||
|
s:=s+' Nbrefonctions='+intToSTR(NbreFL);
|
||||||
|
s:=s+' NbrePeriph='+intToSTR(NbPeriph);
|
||||||
|
|
||||||
|
Affiche(s,clyellow);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure fin_preliminaire;
|
procedure fin_preliminaire;
|
||||||
var i,j : integer;
|
var i,j : integer;
|
||||||
@@ -1907,24 +2087,15 @@ begin
|
|||||||
|
|
||||||
interface_ou_cdm; // démarrer l'interface , génère les evts détecteurs ; ou cdm
|
interface_ou_cdm; // démarrer l'interface , génère les evts détecteurs ; ou cdm
|
||||||
|
|
||||||
|
|
||||||
|
//envoie_infos;
|
||||||
|
|
||||||
formprinc.SetFocus;
|
formprinc.SetFocus;
|
||||||
s:='Fin du préliminaire';
|
s:='Fin du préliminaire';
|
||||||
procetape(s);
|
procetape(s);
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// envoi une chaine à un périphérique COM/USB en fonction de l'interface
|
|
||||||
// non utilisé
|
|
||||||
{
|
|
||||||
procedure envoi_usb(interf : Tinterface;s : string);
|
|
||||||
begin
|
|
||||||
case interf of
|
|
||||||
_interface : MSCommUSBInterface.Output:=s;
|
|
||||||
periph1 : MSCommCde1.Output:=s;
|
|
||||||
periph2 : MSCommCde2.Output:=s;
|
|
||||||
end;
|
|
||||||
end; }
|
|
||||||
|
|
||||||
// renvoie une chaine ASCI Hexa affichable à partir d'une chaîne
|
// renvoie une chaine ASCI Hexa affichable à partir d'une chaîne
|
||||||
function chaine_HEX(s: string) : string;
|
function chaine_HEX(s: string) : string;
|
||||||
var i : integer;
|
var i : integer;
|
||||||
@@ -4856,7 +5027,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
if (aspect=rappel_60) then // rappel 60
|
if (aspect=rappel_60) then // rappel 60
|
||||||
begin
|
begin
|
||||||
Signaux[i].EtatSignal:=Signaux[i].EtatSignal and not($1Cff); // cas du rappel 60: efface les bits 0 1 2 3 4 5 6 7 10 11 et 12 1 1100 1111 0000
|
Signaux[i].EtatSignal:=Signaux[i].EtatSignal and not($1cff); // cas du rappel 60: efface les bits 0 1 2 3 4 5 6 7 10 11 et 12 1 1100 1111 0000
|
||||||
end;
|
end;
|
||||||
if (aspect=aspect8) then // ral_60_jaune_cli décodeur LDT
|
if (aspect=aspect8) then // ral_60_jaune_cli décodeur LDT
|
||||||
begin
|
begin
|
||||||
@@ -17625,7 +17796,7 @@ begin
|
|||||||
//Affiche(repertoire,clorange);
|
//Affiche(repertoire,clorange);
|
||||||
retour:=ShellExecute(Formprinc.Handle,'open',
|
retour:=ShellExecute(Formprinc.Handle,'open',
|
||||||
Pchar('cdr.exe'),
|
Pchar('cdr.exe'),
|
||||||
Pchar(s), // paramètre
|
Pchar(s), // paramètre : -f armentieres.lay -COMIPC
|
||||||
PChar(repertoire) // répertoire
|
PChar(repertoire) // répertoire
|
||||||
,SW_SHOWNORMAL);
|
,SW_SHOWNORMAL);
|
||||||
if retour>32 then
|
if retour>32 then
|
||||||
@@ -18028,122 +18199,9 @@ begin
|
|||||||
Maj_Signaux(false);
|
Maj_Signaux(false);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// renvoyer date heure, MAC, version SC , verif_version, avec_roulage
|
|
||||||
|
|
||||||
// ex 1
|
// renvoyer date heure, MAC, version SC , verif_version
|
||||||
function GetMACAdress: string;
|
// ex 1 ... renvoie celui de la virtual box
|
||||||
var
|
|
||||||
NCB: PNCB;
|
|
||||||
Adapter: PAdapterStatus;
|
|
||||||
RetCode: Ansichar;
|
|
||||||
I: integer;
|
|
||||||
Lenum: PlanaEnum;
|
|
||||||
_SystemID: string;
|
|
||||||
begin
|
|
||||||
Result:='';
|
|
||||||
_SystemID:='';
|
|
||||||
Getmem(NCB,SizeOf(TNCB));
|
|
||||||
Fillchar(NCB^,SizeOf(TNCB),0);
|
|
||||||
|
|
||||||
Getmem(Lenum,SizeOf(TLanaEnum));
|
|
||||||
Fillchar(Lenum^,SizeOf(TLanaEnum),0);
|
|
||||||
|
|
||||||
Getmem(Adapter,SizeOf(TAdapterStatus));
|
|
||||||
Fillchar(Adapter^,SizeOf(TAdapterStatus),0);
|
|
||||||
|
|
||||||
Lenum.Length := chr(0);
|
|
||||||
NCB.ncb_command := chr(NCBENUM);
|
|
||||||
NCB.ncb_buffer := Pointer(Lenum);
|
|
||||||
NCB.ncb_length := SizeOf(Lenum);
|
|
||||||
RetCode := Netbios(NCB);
|
|
||||||
|
|
||||||
i:=0;
|
|
||||||
repeat
|
|
||||||
Fillchar(NCB^,SizeOf(TNCB), 0);
|
|
||||||
Ncb.ncb_command:=chr(NCBRESET);
|
|
||||||
Ncb.ncb_lana_num:=lenum.lana[I];
|
|
||||||
RetCode:=Netbios(Ncb);
|
|
||||||
|
|
||||||
Fillchar(NCB^,SizeOf(TNCB), 0);
|
|
||||||
Ncb.ncb_command:=chr(NCBASTAT);
|
|
||||||
Ncb.ncb_lana_num:=lenum.lana[I];
|
|
||||||
// Must be 16
|
|
||||||
Ncb.ncb_callname:='* ';
|
|
||||||
|
|
||||||
Ncb.ncb_buffer:=Pointer(Adapter);
|
|
||||||
|
|
||||||
Ncb.ncb_length:=SizeOf(TAdapterStatus);
|
|
||||||
RetCode:=Netbios(Ncb);
|
|
||||||
//---- calc _systemId de la mac-address[2-5] XOR mac-address[1]...
|
|
||||||
if (RetCode=chr(0)) or (RetCode=chr(6)) then
|
|
||||||
begin
|
|
||||||
_SystemId := IntToHex(Ord(Adapter.adapter_address[0]), 2) + '-' +
|
|
||||||
IntToHex(Ord(Adapter.adapter_address[1]),2) + '-' +
|
|
||||||
IntToHex(Ord(Adapter.adapter_address[2]),2) + '-' +
|
|
||||||
IntToHex(Ord(Adapter.adapter_address[3]),2) + '-' +
|
|
||||||
IntToHex(Ord(Adapter.adapter_address[4]),2) + '-' +
|
|
||||||
IntToHex(Ord(Adapter.adapter_address[5]),2);
|
|
||||||
end;
|
|
||||||
Inc(i);
|
|
||||||
until (i>=Ord(Lenum.Length)) or (_SystemID<>'00-00-00-00-00-00');
|
|
||||||
FreeMem(NCB);
|
|
||||||
FreeMem(Adapter);
|
|
||||||
FreeMem(Lenum);
|
|
||||||
GetMacAdress:=_SystemID;
|
|
||||||
end;
|
|
||||||
|
|
||||||
// ex2
|
|
||||||
function GetAdapterInfo(Lana: AnsiChar): String;
|
|
||||||
var
|
|
||||||
Adapter: TAdapterStatus;
|
|
||||||
Ncb: Tncb;
|
|
||||||
begin
|
|
||||||
FillChar(Ncb,SizeOf(Ncb),0);
|
|
||||||
Ncb.ncb_command:=Char(NCBRESET);
|
|
||||||
Ncb.ncb_lana_num:=Lana;
|
|
||||||
if Netbios(@Ncb)<>Char(NRC_GOODRET) then
|
|
||||||
begin
|
|
||||||
Result:='mac non trouvée';
|
|
||||||
Exit;
|
|
||||||
end;
|
|
||||||
|
|
||||||
FillChar(NCB,SizeOf(Ncb), 0);
|
|
||||||
NCB.ncb_command:=Char(NCBASTAT);
|
|
||||||
NCB.ncb_lana_num:=Lana;
|
|
||||||
NCB.ncb_callname:='*';
|
|
||||||
|
|
||||||
FillChar(Adapter,SizeOf(Adapter), 0);
|
|
||||||
NCB.ncb_buffer:=@Adapter;
|
|
||||||
NCB.ncb_length:=SizeOf(Adapter);
|
|
||||||
if Netbios(@Ncb)<>Char(NRC_GOODRET) then
|
|
||||||
begin
|
|
||||||
Result:='mac non trouvée';
|
|
||||||
Exit;
|
|
||||||
end;
|
|
||||||
Result:=
|
|
||||||
IntToHex(Byte(Adapter.adapter_address[0]),2) + '-' +
|
|
||||||
IntToHex(Byte(Adapter.adapter_address[1]),2) + '-' +
|
|
||||||
IntToHex(Byte(Adapter.adapter_address[2]),2) + '-' +
|
|
||||||
IntToHex(Byte(Adapter.adapter_address[3]),2) + '-' +
|
|
||||||
IntToHex(Byte(Adapter.adapter_address[4]),2) + '-' +
|
|
||||||
IntToHex(Byte(Adapter.adapter_address[5]),2);
|
|
||||||
end;
|
|
||||||
|
|
||||||
function GetMACAddress: string;
|
|
||||||
var
|
|
||||||
AdapterList: TLanaEnum;
|
|
||||||
Ncb: Tncb;
|
|
||||||
begin
|
|
||||||
FillChar(Ncb,SizeOf(NCB),0);
|
|
||||||
NCB.ncb_command:=Char(NCBENUM);
|
|
||||||
NCB.ncb_buffer:=@AdapterList;
|
|
||||||
NCB.ncb_length:=SizeOf(AdapterList);
|
|
||||||
Netbios(@NCB);
|
|
||||||
if Byte(AdapterList.length)>0 then
|
|
||||||
Result:=GetAdapterInfo(AdapterList.lana[0])
|
|
||||||
else
|
|
||||||
Result:='mac non trouvée';
|
|
||||||
end;
|
|
||||||
|
|
||||||
// positionne les composants de la fenêtre principale
|
// positionne les composants de la fenêtre principale
|
||||||
// i : position X du splitter
|
// i : position X du splitter
|
||||||
@@ -19047,6 +19105,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
|
// composant TclientSocket
|
||||||
ClientSocketInterface:=tClientSocket.Create(nil);
|
ClientSocketInterface:=tClientSocket.Create(nil);
|
||||||
ClientSocketInterface.OnRead:=ClientSocketInterfaceRead;
|
ClientSocketInterface.OnRead:=ClientSocketInterfaceRead;
|
||||||
ClientSocketInterface.onConnect:=ClientSocketInterfaceConnect;
|
ClientSocketInterface.onConnect:=ClientSocketInterfaceConnect;
|
||||||
@@ -19341,6 +19400,7 @@ begin
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
procetape('Fin des initialisations');
|
procetape('Fin des initialisations');
|
||||||
|
|
||||||
// vérifier si le fichier de segments existe
|
// vérifier si le fichier de segments existe
|
||||||
@@ -19354,7 +19414,7 @@ begin
|
|||||||
end
|
end
|
||||||
else Affiche_fenetre_CDM.Enabled:=false;
|
else Affiche_fenetre_CDM.Enabled:=false;
|
||||||
|
|
||||||
//Affiche(GetMACAddress,clred);
|
|
||||||
//formPrinc.left:=-1000;
|
//formPrinc.left:=-1000;
|
||||||
ConfCellTCO:=false;
|
ConfCellTCO:=false;
|
||||||
if debug=1 then Affiche('Fini',clLime);
|
if debug=1 then Affiche('Fini',clLime);
|
||||||
@@ -21988,6 +22048,8 @@ begin
|
|||||||
Affiche('Taille des actionneurs PN: '+intToSTR(SizeOf(Tablo_PN) )+' octets',clorange);
|
Affiche('Taille des actionneurs PN: '+intToSTR(SizeOf(Tablo_PN) )+' octets',clorange);
|
||||||
Affiche('Taille du tableau d''évènements détecteurs '+intToSTR(SizeOf(event_det) )+' octets',clorange);
|
Affiche('Taille du tableau d''évènements détecteurs '+intToSTR(SizeOf(event_det) )+' octets',clorange);
|
||||||
Affiche(' ',clyellow);
|
Affiche(' ',clyellow);
|
||||||
|
|
||||||
|
envoie_infos;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// cliqué droit sur un signal puis sur le menu propriétés
|
// cliqué droit sur un signal puis sur le menu propriétés
|
||||||
|
|||||||
+2
-2
@@ -24,8 +24,8 @@ object FormTCO: TFormTCO
|
|||||||
OnKeyPress = FormKeyPress
|
OnKeyPress = FormKeyPress
|
||||||
OnMouseWheel = FormMouseWheel
|
OnMouseWheel = FormMouseWheel
|
||||||
DesignSize = (
|
DesignSize = (
|
||||||
1005
|
997
|
||||||
556)
|
549)
|
||||||
PixelsPerInch = 96
|
PixelsPerInch = 96
|
||||||
TextHeight = 13
|
TextHeight = 13
|
||||||
object LabelZoom: TLabel
|
object LabelZoom: TLabel
|
||||||
|
|||||||
+118
-51
@@ -1448,7 +1448,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// remplit la base des cantons avec les éléments adjacents, et des détecteurs adjacents
|
// remplit les informations du canton avec les éléments adjacents, et des détecteurs adjacents
|
||||||
|
// et vérifie si le canton ne contient pas de case incorrecte
|
||||||
// Cantons uniquement TCO1
|
// Cantons uniquement TCO1
|
||||||
// i : indexCanton
|
// i : indexCanton
|
||||||
// remplit les champs horizontal, el1,el2,typ1,typ2,sens1,sens2 de canton[]
|
// remplit les champs horizontal, el1,el2,typ1,typ2,sens1,sens2 de canton[]
|
||||||
@@ -1514,6 +1515,36 @@ begin
|
|||||||
Affiche('Erreur 210 : Le canton '+intToSTR(canton[i].numero)+' dans le tco '+intToSTR(t)+' dispose de deux détecteurs contigus d''adresses identiques: '+intToSTR(canton[i].el1),clred);
|
Affiche('Erreur 210 : Le canton '+intToSTR(canton[i].numero)+' dans le tco '+intToSTR(t)+' dispose de deux détecteurs contigus d''adresses identiques: '+intToSTR(canton[i].el1),clred);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
// vérifie si le canton a une case incorrecte
|
||||||
|
if horz then
|
||||||
|
begin
|
||||||
|
t:=Id_cantonH;
|
||||||
|
for j:=x to x+n-1 do
|
||||||
|
begin
|
||||||
|
if not iscantonH(tco[indexTCO,j,y].BImage) then
|
||||||
|
begin
|
||||||
|
Affiche('Correction canton '+intToSTR(canton[i].numero)+' en x='+intToSTR(j),clCyan);
|
||||||
|
tco[indexTCO,j,y].BImage:=t;
|
||||||
|
TCO_modifie:=true;
|
||||||
|
end;
|
||||||
|
inc(t);
|
||||||
|
end;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
t:=Id_cantonV;
|
||||||
|
for j:=y to y+n-1 do
|
||||||
|
begin
|
||||||
|
if not iscantonV(tco[indexTCO,x,j].BImage) then
|
||||||
|
begin
|
||||||
|
Affiche('Correction canton '+intToSTR(canton[i].numero)+' en y='+intToSTR(j),clCyan);
|
||||||
|
tco[indexTCO,x,j].BImage:=t;
|
||||||
|
TCO_modifie:=true;
|
||||||
|
end;
|
||||||
|
inc(t);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
//Affiche(intToSTR(xCanton)+' '+intToStr(yCanton),clyellow);
|
//Affiche(intToSTR(xCanton)+' '+intToStr(yCanton),clyellow);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -1820,7 +1851,9 @@ var fichier : textfile;
|
|||||||
Bim,nv,x,y,i,j,m,adresse,valeur,erreur,FeuOriente,PiedFeu,tailleFont,e,NPar : integer;
|
Bim,nv,x,y,i,j,m,adresse,valeur,erreur,FeuOriente,PiedFeu,tailleFont,e,NPar : integer;
|
||||||
trouve_CoulFond,trouve_clVoies,trouve_clAllume,trouve_clGrille,trouve_clCanton,
|
trouve_CoulFond,trouve_clVoies,trouve_clAllume,trouve_clGrille,trouve_clCanton,
|
||||||
trouve_clTexte,trouve_clQuai,trouve_matrice,trouve_ratio,trouve_ModeCanton,
|
trouve_clTexte,trouve_clQuai,trouve_matrice,trouve_ratio,trouve_ModeCanton,
|
||||||
trouve_AvecGrille,trouve_clPiedSignal,cuc,trouve_clCantonOccupe,trouve_clCantonLibre : boolean;
|
trouve_AvecGrille,trouve_clPiedSignal,cuc,trouve_clCantonOccupe,trouve_clCantonLibre,
|
||||||
|
LecCanton : boolean;
|
||||||
|
|
||||||
function lit_ligne : string ;
|
function lit_ligne : string ;
|
||||||
var c : char;
|
var c : char;
|
||||||
begin
|
begin
|
||||||
@@ -2198,7 +2231,8 @@ begin
|
|||||||
// 3 Bimage
|
// 3 Bimage
|
||||||
i:=pos(',',s);
|
i:=pos(',',s);
|
||||||
if i=0 then begin Affiche('ETCO6',clred);closefile(fichier);exit;end;
|
if i=0 then begin Affiche('ETCO6',clred);closefile(fichier);exit;end;
|
||||||
val(copy(s,1,i-1),valeur,erreur);if erreur<>0 then begin Affiche('ETCO7',clred);closefile(fichier);exit;end;
|
val(copy(s,1,i-1),valeur,erreur);
|
||||||
|
if erreur<>0 then begin Affiche('ETCO7',clred);closefile(fichier);exit;end;
|
||||||
// anciens id
|
// anciens id
|
||||||
if valeur=30 then begin valeur:=Id_signal;sauve_tco:=true;end;
|
if valeur=30 then begin valeur:=Id_signal;sauve_tco:=true;end;
|
||||||
if valeur=31 then begin valeur:=id_Quai;sauve_tco:=true;end;
|
if valeur=31 then begin valeur:=id_Quai;sauve_tco:=true;end;
|
||||||
@@ -2206,11 +2240,14 @@ begin
|
|||||||
if valeur<=34 then tco[indexTCO,x,y].liaisons:=liaisons[valeur] else tco[indexTCO,x,y].liaisons:=0;
|
if valeur<=34 then tco[indexTCO,x,y].liaisons:=liaisons[valeur] else tco[indexTCO,x,y].liaisons:=0;
|
||||||
Bim:=valeur;
|
Bim:=valeur;
|
||||||
cuc:=false;
|
cuc:=false;
|
||||||
|
|
||||||
|
// cantons
|
||||||
if (valeur=Id_CantonH) or (valeur=Id_CantonV) then
|
if (valeur=Id_CantonH) or (valeur=Id_CantonV) then
|
||||||
begin
|
begin
|
||||||
if ncantons<MaxCantons then
|
if ncantons<MaxCantons then
|
||||||
begin
|
begin
|
||||||
cuc:=true; // id canton
|
cuc:=true; // mémo id canton
|
||||||
|
LecCanton:=true; // mis à 1, et mis à 0 quand on a trouvé la fin de canton
|
||||||
inc(nCantons);
|
inc(nCantons);
|
||||||
// le numéro de canton est lu plus loin
|
// le numéro de canton est lu plus loin
|
||||||
canton[ncantons].x:=x;
|
canton[ncantons].x:=x;
|
||||||
@@ -2255,7 +2292,10 @@ begin
|
|||||||
// affiche(inttostr(piedfeu),clyellow);
|
// affiche(inttostr(piedfeu),clyellow);
|
||||||
//Affiche('indexcanton='+intToSTR(ncantons)+' numcanton lu='+intToSTR(piedFeu),clOrange);
|
//Affiche('indexcanton='+intToSTR(ncantons)+' numcanton lu='+intToSTR(piedFeu),clOrange);
|
||||||
tco[indexTCO,x,y].NumCanton:=PiedFeu;
|
tco[indexTCO,x,y].NumCanton:=PiedFeu;
|
||||||
if cuc then canton[ncantons].numero:=piedFeu;
|
if cuc then
|
||||||
|
begin
|
||||||
|
canton[ncantons].numero:=piedFeu;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// si c'est un signal, remplir les paramètres du signal
|
// si c'est un signal, remplir les paramètres du signal
|
||||||
@@ -2283,10 +2323,10 @@ begin
|
|||||||
tco[indexTCO,x,y].FeuOriente:=FeuOriente; // paramètre de l'action
|
tco[indexTCO,x,y].FeuOriente:=FeuOriente; // paramètre de l'action
|
||||||
if PiedFeu=AcBouton_bistable then
|
if PiedFeu=AcBouton_bistable then
|
||||||
begin
|
begin
|
||||||
BoutonTCO[Adresse].existe:=true;
|
BoutonTCO[adresse].existe:=true;
|
||||||
BoutonTCO[Adresse].idtco:=IndexTCO;
|
BoutonTCO[adresse].idtco:=IndexTCO;
|
||||||
BoutonTCO[Adresse].x:=x;
|
BoutonTCO[adresse].x:=x;
|
||||||
BoutonTCO[Adresse].y:=y;
|
BoutonTCO[adresse].y:=y;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -2546,6 +2586,15 @@ begin
|
|||||||
//Affiche(intToSTR(LargeurCell[indexTCO])+' '+intToSTR(epaisseur),clyellow);
|
//Affiche(intToSTR(LargeurCell[indexTCO])+' '+intToSTR(epaisseur),clyellow);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure affiche_info(id,x,y : integer;s : string);
|
||||||
|
begin
|
||||||
|
FormInfo.LabelInfo.caption:=s;
|
||||||
|
FormInfo.Top:=FormTCO[id].top+y-FormTCO[id].ScrollBox.vertScrollBar.Position+20;
|
||||||
|
FormInfo.Left:=FormTCO[id].left+x-FormTCO[id].ScrollBox.HorzScrollBar.Position+50;
|
||||||
|
if formInfo.left+formInfo.Width>formTCO[id].Left+formTCO[id].Width then
|
||||||
|
formInfo.left:=formTCO[id].Width-formInfo.Width;
|
||||||
|
FormInfo.Show;
|
||||||
|
end;
|
||||||
|
|
||||||
// renvoie la position de l'aiguillage en position x,y du tco indextco
|
// renvoie la position de l'aiguillage en position x,y du tco indextco
|
||||||
function positionTCO(indexTCO,x,y : integer) : integer;
|
function positionTCO(indexTCO,x,y : integer) : integer;
|
||||||
@@ -2825,8 +2874,15 @@ begin
|
|||||||
style:=fs;
|
style:=fs;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function Taille_Fonte(tf : integer) : integer;
|
||||||
|
var Larg : integer;
|
||||||
|
begin
|
||||||
|
Larg:=LargeurCell[indexTCOCourant];
|
||||||
|
result:=((Larg*tf) div 40)+1;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure affiche_texte(indextco,x,y : integer);
|
procedure affiche_texte(indextco,x,y : integer);
|
||||||
var b,x0,y0,xt,yt,repr,taillefont,largCell,hautCell,tf : integer;
|
var b,x0,y0,xt,yt,repr,largCell,hautCell,tf,tailleFont : integer;
|
||||||
ss,s,nf : string;
|
ss,s,nf : string;
|
||||||
c : Tcanvas;
|
c : Tcanvas;
|
||||||
r : Trect;
|
r : Trect;
|
||||||
@@ -2866,13 +2922,15 @@ begin
|
|||||||
c.Font.Style:=style(ss);
|
c.Font.Style:=style(ss);
|
||||||
|
|
||||||
repr:=tco[indextco,x,y].repr;
|
repr:=tco[indextco,x,y].repr;
|
||||||
taillefont:=tco[indextco,x,y].TailleFonte;
|
|
||||||
|
|
||||||
xt:=round(5*frXGlob[indexTCO]);yt:=0;
|
xt:=round(5*frXGlob[indexTCO]);yt:=0;
|
||||||
|
|
||||||
|
taillefont:=tco[indextco,x,y].TailleFonte;
|
||||||
if taillefont=0 then taillefont:=8;
|
if taillefont=0 then taillefont:=8;
|
||||||
tf:=(taillefont*LargeurCell[indexTCO]) div 40;
|
tf:=(taillefont*LargeurCell[indexTCO]) div 40;
|
||||||
c.font.Size:=tf;
|
c.font.Size:=tf;
|
||||||
|
//c.font.Size:=taille_fonte(tco[indextco,x,y].TailleFonte);
|
||||||
|
|
||||||
if b=id_action then c.Brush.Color:=couleurAction;
|
if b=id_action then c.Brush.Color:=couleurAction;
|
||||||
|
|
||||||
if b=Id_cantonH then
|
if b=Id_cantonH then
|
||||||
@@ -2893,9 +2951,9 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
case repr of
|
case repr of
|
||||||
0,1 : yt:=(hauteurCell[indexTCO] div 2)-round(tailleFont*fryGlob[indexTCO]); // au milieu
|
0,1 : yt:=(hauteurCell[indexTCO] div 2)-(round(c.textHeight(s) div 2)); // au milieu Y
|
||||||
2 : yt:=1; // haut
|
2 : yt:=1; // haut
|
||||||
3 : yt:=hauteurCell[indexTCO]-round(2*TailleFont*fryGlob[indexTCO]); // bas
|
3 : yt:=hauteurCell[indexTCO]-round(2*c.textWidth(s)); // bas
|
||||||
5 : begin // double centré XY
|
5 : begin // double centré XY
|
||||||
r.Left:=x0;
|
r.Left:=x0;
|
||||||
r.Top:=y0+3;
|
r.Top:=y0+3;
|
||||||
@@ -2914,9 +2972,12 @@ begin
|
|||||||
if b=Id_Quai then xt:=6;
|
if b=Id_Quai then xt:=6;
|
||||||
if (b<>Id_Quai) and (b<>Id_action) then s:=s+' ';
|
if (b<>Id_Quai) and (b<>Id_action) then s:=s+' ';
|
||||||
|
|
||||||
if repr=4 then texte_reparti(s,indextco,x,y,tf) else
|
//c.pen.color:=clLime;c.Moveto(X0,y0);c.lineto(x0,y0+c.textHeight(s));
|
||||||
|
|
||||||
|
if repr=4 then texte_reparti(s,indextco,x,y,c.font.size) else
|
||||||
c.Textout(x0+xt,y0+yt,s);
|
c.Textout(x0+xt,y0+yt,s);
|
||||||
|
|
||||||
|
|
||||||
// texte encadré
|
// texte encadré
|
||||||
if tco[indextco,x,y].buttoir=1 then
|
if tco[indextco,x,y].buttoir=1 then
|
||||||
begin
|
begin
|
||||||
@@ -11218,6 +11279,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// affiche la cellule x et y en cases
|
// affiche la cellule x et y en cases
|
||||||
// index est utilisé pour accéder au tableau du tracé de la fonction zone_tco
|
// index est utilisé pour accéder au tableau du tracé de la fonction zone_tco
|
||||||
procedure affiche_cellule(indexTCO,x,y : integer);
|
procedure affiche_cellule(indexTCO,x,y : integer);
|
||||||
@@ -11479,7 +11542,7 @@ begin
|
|||||||
s:=s+' '+format('%d',[adrTr]);
|
s:=s+' '+format('%d',[adrTr]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
PCanvasTCO[indexTCO].font.Size:=PCanvasTCO[indexTCO].font.Size+1;
|
//PCanvasTCO[indexTCO].font.Size:=taille_fonte(; //PCanvasTCO[indexTCO].font.Size+1;
|
||||||
xt:=Xorg-1;
|
xt:=Xorg-1;
|
||||||
yt:=yOrg+HautCell-round(2*fryGlob[indexTCO]);
|
yt:=yOrg+HautCell-round(2*fryGlob[indexTCO]);
|
||||||
{$IF CompilerVersion >= 28.0}
|
{$IF CompilerVersion >= 28.0}
|
||||||
@@ -14750,18 +14813,19 @@ end;
|
|||||||
|
|
||||||
// pour avoir les evts keydown, il faut dévalider les propriétés tabstop des boutons de la form.
|
// pour avoir les evts keydown, il faut dévalider les propriétés tabstop des boutons de la form.
|
||||||
procedure TFormTCO.FormKeyDown(Sender: TObject; var Key: Word;Shift: TShiftState);
|
procedure TFormTCO.FormKeyDown(Sender: TObject; var Key: Word;Shift: TShiftState);
|
||||||
var s,d,indexTCO,x,y : integer;
|
var s,d,indexTCO : integer;
|
||||||
procede : boolean;
|
procede : boolean;
|
||||||
begin
|
begin
|
||||||
if affevt then Affiche('TCO.FormKeyDown',clOrange);
|
if affevt then Affiche('TCO.FormKeyDown',clOrange);
|
||||||
|
|
||||||
indexTCO:=index_TCO(Sender);
|
indexTCO:=index_TCO(Sender);
|
||||||
|
//Affiche('Avant xClicCell='+intToSTR(XClicCell[indexTCO]),clCyan);
|
||||||
|
|
||||||
if (RadioGroupSel.ItemIndex=1) and (Key=Vk_Escape) then
|
if (RadioGroupSel.ItemIndex=1) and (Key=Vk_Escape) then
|
||||||
begin
|
begin
|
||||||
if Rect_select.NumTCO=indexTCO then affiche_rectangle(IndexTCO,Rect_select);
|
if Rect_select.NumTCO=indexTCO then affiche_rectangle(IndexTCO,Rect_select);
|
||||||
Rect_select.NumTCO:=0;
|
Rect_select.NumTCO:=0;
|
||||||
selectionAffichee[indexTCO]:=false;
|
selectionAffichee[indexTCO]:=false;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if not(auto_tcurs) or (RadioGroupSel.ItemIndex=1) then exit;
|
if not(auto_tcurs) or (RadioGroupSel.ItemIndex=1) then exit;
|
||||||
@@ -14769,9 +14833,6 @@ begin
|
|||||||
procede:=false; // indicateur on a tapé une touche de curseur
|
procede:=false; // indicateur on a tapé une touche de curseur
|
||||||
//Affiche(intToSTR(key),clyellow);
|
//Affiche(intToSTR(key),clyellow);
|
||||||
|
|
||||||
x:=XClicCell[indexTCO];
|
|
||||||
y:=YClicCell[indexTCO];
|
|
||||||
|
|
||||||
with formTCO[indexTCO] do
|
with formTCO[indexTCO] do
|
||||||
begin
|
begin
|
||||||
if not(ssShift in Shift) then
|
if not(ssShift in Shift) then
|
||||||
@@ -14779,6 +14840,7 @@ begin
|
|||||||
VK_right : if x<NbreCellX[indexTCO] then
|
VK_right : if x<NbreCellX[indexTCO] then
|
||||||
begin
|
begin
|
||||||
inc(XClicCell[indexTCO]);
|
inc(XClicCell[indexTCO]);
|
||||||
|
// Affiche('Incrémente',clLime);
|
||||||
d:=(xClicCell[indexTCO]+1)*LargeurCell[indexTCO];
|
d:=(xClicCell[indexTCO]+1)*LargeurCell[indexTCO];
|
||||||
s:=scrollBox.HorzScrollBar.Position;
|
s:=scrollBox.HorzScrollBar.Position;
|
||||||
if d-s>ScrollBox.Width then scrollBox.HorzScrollBar.Position:=s+LargeurCell[indexTCO];
|
if d-s>ScrollBox.Width then scrollBox.HorzScrollBar.Position:=s+LargeurCell[indexTCO];
|
||||||
@@ -14904,10 +14966,11 @@ begin
|
|||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//VK_delete : affiche('delete',clorange);
|
//VK_delete : affiche('delete',clorange);
|
||||||
if procede then
|
if procede then
|
||||||
begin
|
begin
|
||||||
_entoure_cell_clic(indexTCO);
|
_entoure_cell_clic(indexTCO);
|
||||||
|
//Affiche('xClicCell='+intToSTR(XClicCell[indexTCO]),clYellow);
|
||||||
clicTCO:=true;
|
clicTCO:=true;
|
||||||
formTCO[indexTCO].EditAdrElement.Text:=IntToSTR(tco[indextco,XClicCell[indexTCO],YClicCell[indexTCO]].Adresse);
|
formTCO[indexTCO].EditAdrElement.Text:=IntToSTR(tco[indextco,XClicCell[indexTCO],YClicCell[indexTCO]].Adresse);
|
||||||
actualise(indexTCO);
|
actualise(indexTCO);
|
||||||
@@ -15052,7 +15115,7 @@ indexTCO,i,xclic,Yclic,bim,nc,maxi,libre : integer;
|
|||||||
begin
|
begin
|
||||||
if not(Target is TImage) then exit;
|
if not(Target is TImage) then exit;
|
||||||
s:=(Target as TImage).Name;
|
s:=(Target as TImage).Name;
|
||||||
if copy(s,1,8)<>'ImageTCO' then exit;
|
if copy(s,1,8)<>'ImageTCO' then exit; // si le composant de destination n'est pas ImageTCO, sortir
|
||||||
if (x=0) and (y=0) then exit;
|
if (x=0) and (y=0) then exit;
|
||||||
drag:=0;
|
drag:=0;
|
||||||
indexTCO:=Index_tco(sender);
|
indexTCO:=Index_tco(sender);
|
||||||
@@ -15065,7 +15128,7 @@ begin
|
|||||||
Yclic:=Y div hauteurCell[indexTCO] +1;
|
Yclic:=Y div hauteurCell[indexTCO] +1;
|
||||||
XclicCell[indexTCO]:=Xclic;
|
XclicCell[indexTCO]:=Xclic;
|
||||||
YClicCell[indexTCO]:=Yclic;
|
YClicCell[indexTCO]:=Yclic;
|
||||||
|
//Affiche('XXX='+intToSTR(x),clyellow);
|
||||||
//if not(verif_cellule(indexTCO,Xclic,Yclic,icone)) then exit;
|
//if not(verif_cellule(indexTCO,Xclic,Yclic,icone)) then exit;
|
||||||
// interdit de déposer sur un canton
|
// interdit de déposer sur un canton
|
||||||
if isCanton(tco[IndexTCO,Xclic,Yclic].BImage) then exit;
|
if isCanton(tco[IndexTCO,Xclic,Yclic].BImage) then exit;
|
||||||
@@ -15119,10 +15182,7 @@ begin
|
|||||||
s:='Un canton doit être déposé sur un élément horizontal ou vertical d''au moins 3 cases';
|
s:='Un canton doit être déposé sur un élément horizontal ou vertical d''au moins 3 cases';
|
||||||
formTCO[indexTCO].Caption:=s;
|
formTCO[indexTCO].Caption:=s;
|
||||||
Affiche_TCO(indexTCO);
|
Affiche_TCO(indexTCO);
|
||||||
FormInfo.LabelInfo.caption:=s;
|
Affiche_info(indexTCO,x,y,s);
|
||||||
FormInfo.Top:=Y+20;
|
|
||||||
FormInfo.Left:=X+50;
|
|
||||||
FormInfo.Show;
|
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -15135,10 +15195,7 @@ begin
|
|||||||
s:='Un canton doit être déposé sur un élément horizontal ou vertical d''au moins 3 cases';
|
s:='Un canton doit être déposé sur un élément horizontal ou vertical d''au moins 3 cases';
|
||||||
formTCO[indexTCO].Caption:=s;
|
formTCO[indexTCO].Caption:=s;
|
||||||
Affiche_TCO(indexTCO);
|
Affiche_TCO(indexTCO);
|
||||||
FormInfo.LabelInfo.caption:=s;
|
Affiche_info(indexTCO,x,y,s);
|
||||||
FormInfo.Top:=Y+20;
|
|
||||||
FormInfo.Left:=X+50;
|
|
||||||
FormInfo.Show;
|
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@@ -15149,10 +15206,7 @@ begin
|
|||||||
s:='Un canton doit être déposé sur un élément horizontal ou vertical d''au moins 3 cases';
|
s:='Un canton doit être déposé sur un élément horizontal ou vertical d''au moins 3 cases';
|
||||||
formTCO[indexTCO].Caption:=s;
|
formTCO[indexTCO].Caption:=s;
|
||||||
Affiche_TCO(indexTCO);
|
Affiche_TCO(indexTCO);
|
||||||
FormInfo.LabelInfo.caption:=s;
|
Affiche_info(indexTCO,x,y,s);
|
||||||
FormInfo.Top:=Y+20;
|
|
||||||
FormInfo.Left:=X+50;
|
|
||||||
FormInfo.Show;
|
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@@ -15169,10 +15223,7 @@ begin
|
|||||||
s:='Un canton doit avoir un détecteur comme élément adjacent';
|
s:='Un canton doit avoir un détecteur comme élément adjacent';
|
||||||
formTCO[indexTCO].Caption:=s;
|
formTCO[indexTCO].Caption:=s;
|
||||||
Affiche_TCO(indexTCO);
|
Affiche_TCO(indexTCO);
|
||||||
FormInfo.LabelInfo.caption:=s;
|
Affiche_info(indexTCO,x,y,s);
|
||||||
FormInfo.Top:=Y+20;
|
|
||||||
FormInfo.Left:=X+50;
|
|
||||||
FormInfo.Show;
|
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -16054,7 +16105,7 @@ end;
|
|||||||
// évènement qui se produit quand on clique gauche ou droit
|
// évènement qui se produit quand on clique gauche ou droit
|
||||||
procedure TFormTCO.ImageTCOMouseDown(Sender: TObject; Button: TMouseButton;Shift: TShiftState; X, Y: Integer);
|
procedure TFormTCO.ImageTCOMouseDown(Sender: TObject; Button: TMouseButton;Shift: TShiftState; X, Y: Integer);
|
||||||
var position : Tpoint;
|
var position : Tpoint;
|
||||||
Numcanton,xt,yt,bt,indexTCO,i,n,adresse,Bimage,xf,yf,xclic,yclic,el1,el2,senscanton,larg,haut,
|
Numcanton,xt,yt,bt,indexTCO,i,j,n,adresse,Bimage,xf,yf,xclic,yclic,el1,el2,senscanton,larg,haut,
|
||||||
indexTrain,idcantonOrg,idcantonDest,AdrTrain,sens,etat : integer;
|
indexTrain,idcantonOrg,idcantonDest,AdrTrain,sens,etat : integer;
|
||||||
tel1,tel2 : tequipement;
|
tel1,tel2 : tequipement;
|
||||||
s : string;
|
s : string;
|
||||||
@@ -16344,7 +16395,7 @@ begin
|
|||||||
// action
|
// action
|
||||||
if (Bimage=id_action) and not(ConfCellTCO) then
|
if (Bimage=id_action) and not(ConfCellTCO) then
|
||||||
begin
|
begin
|
||||||
i:=tco[indextco,xclic,yclic].piedfeu;
|
i:=tco[indextco,xclic,yclic].piedfeu; // type d'action
|
||||||
n:=tco[indextco,xclic,yclic].feuoriente;
|
n:=tco[indextco,xclic,yclic].feuoriente;
|
||||||
//Affiche('Clic bouton action i='+intToSTR(i)+' n='+intToSTR(n),clYellow);
|
//Affiche('Clic bouton action i='+intToSTR(i)+' n='+intToSTR(n),clYellow);
|
||||||
case i of
|
case i of
|
||||||
@@ -16391,11 +16442,30 @@ begin
|
|||||||
boutonTCO[adresse].etat:=etat;
|
boutonTCO[adresse].etat:=etat;
|
||||||
|
|
||||||
dessin_Action(indexTCO,pcanvasTCO[indextco],xclic,yclic);
|
dessin_Action(indexTCO,pcanvasTCO[indextco],xclic,yclic);
|
||||||
|
// explorer tous les tco pour voir s'il y un autre bouton tco avec la même adresse
|
||||||
|
for i:=1 to NbreTCO do
|
||||||
|
for y:=1 to NbreCellY[i] do
|
||||||
|
for x:=1 to NbreCellX[i] do
|
||||||
|
begin
|
||||||
|
if tco[i,x,y].BImage=Id_Action then
|
||||||
|
begin
|
||||||
|
if tco[i,x,y].PiedFeu=acBouton_bistable then
|
||||||
|
begin
|
||||||
|
j:=tco[indextco,xclic,yclic].Adresse;
|
||||||
|
if j=adresse then
|
||||||
|
begin
|
||||||
|
dessin_Action(i,pcanvasTCO[i],x,y);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TempoSouris:=2 ; // démarre la tempo souris
|
TempoSouris:=2 ; // démarre la tempo clic souris
|
||||||
|
|
||||||
// clic en mode dessin
|
// clic en mode dessin
|
||||||
if modeTrace[indexTCO] then
|
if modeTrace[indexTCO] then
|
||||||
@@ -18370,7 +18440,6 @@ begin
|
|||||||
change_couleur_fond(index_tco(sender));
|
change_couleur_fond(index_tco(sender));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TFormTCO.FormKeyPress(Sender: TObject; var Key: Char);
|
procedure TFormTCO.FormKeyPress(Sender: TObject; var Key: Char);
|
||||||
begin
|
begin
|
||||||
if affevt then Affiche('TCO.FormKeyPress',clOrange);
|
if affevt then Affiche('TCO.FormKeyPress',clOrange);
|
||||||
@@ -18957,10 +19026,7 @@ begin
|
|||||||
//Affiche(intToSTR(ypix),clred);
|
//Affiche(intToSTR(ypix),clred);
|
||||||
Affiche_TCO(indexTCO);
|
Affiche_TCO(indexTCO);
|
||||||
FormInfo.LabelInfo.caption:=s;
|
FormInfo.LabelInfo.caption:=s;
|
||||||
FormInfo.Top:=Ypix-ScrollBox.VertScrollBar.Position;
|
Affiche_info(indexTCO,xpix,ypix,s);
|
||||||
FormInfo.Left:=Xpix-ScrollBox.HorzScrollBar.Position;
|
|
||||||
|
|
||||||
FormInfo.Show;
|
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -19070,3 +19136,4 @@ end;
|
|||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|
||||||
+31
-11
@@ -26,7 +26,7 @@ var
|
|||||||
f : text;
|
f : text;
|
||||||
|
|
||||||
Const
|
Const
|
||||||
VersionSC ='9.71'; // sert à la comparaison de la version publiée
|
VersionSC ='9.74'; // sert à la comparaison de la version publiée
|
||||||
SousVersion=' '; // A B C ... en cas d'absence de sous version mettre un espace
|
SousVersion=' '; // A B C ... en cas d'absence de sous version mettre un espace
|
||||||
// pour unzip
|
// pour unzip
|
||||||
SHCONTCH_NOPROGRESSBOX=4;
|
SHCONTCH_NOPROGRESSBOX=4;
|
||||||
@@ -83,6 +83,7 @@ var
|
|||||||
begin
|
begin
|
||||||
Result:=False;
|
Result:=False;
|
||||||
t:=0;
|
t:=0;
|
||||||
|
// l'utilisation de TfileStream.Create inplique que le répertoire de destination soit libre de droits
|
||||||
Try Fs:=TFileStream.Create(s,fmCreate);
|
Try Fs:=TFileStream.Create(s,fmCreate);
|
||||||
//hSession := InternetOpen('MyApp', INTERNET_OPEN_TYPE_PRECONFIG, nil, nil, 0);
|
//hSession := InternetOpen('MyApp', INTERNET_OPEN_TYPE_PRECONFIG, nil, nil, 0);
|
||||||
if DebugVV then Affiche('TFileStream.Create ok',clLime);
|
if DebugVV then Affiche('TFileStream.Create ok',clLime);
|
||||||
@@ -121,9 +122,13 @@ begin
|
|||||||
finally
|
finally
|
||||||
InternetCloseHandle(hSession);
|
InternetCloseHandle(hSession);
|
||||||
end;
|
end;
|
||||||
finally
|
except
|
||||||
fs.Free;
|
begin
|
||||||
|
Affiche('Le fichier de vérification des versions n''a pas pu être créé car le répertoire ',clred);
|
||||||
|
Affiche(ExtractFilePath(s)+' n''a pas les droits requis',clred);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
fs.Free;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure log(s : string;couleur : Tcolor);
|
procedure log(s : string;couleur : Tcolor);
|
||||||
@@ -214,7 +219,7 @@ end;
|
|||||||
// renvoie le numéro de version depuis le site github, et télécharge... etc
|
// renvoie le numéro de version depuis le site github, et télécharge... etc
|
||||||
function verifie_version : real;
|
function verifie_version : real;
|
||||||
var description,s,s2,s3,Version_p,Url,LocalFile,nomfichier,date_creation_ang : string;
|
var description,s,s2,s3,Version_p,Url,LocalFile,nomfichier,date_creation_ang : string;
|
||||||
trouve_version,trouve_zip,zone_comm,LocZip : boolean;
|
faire,trouve_version,trouve_zip,zone_comm,LocZip : boolean;
|
||||||
fichier : text;
|
fichier : text;
|
||||||
i,j,erreur,Ncomm,i2,l : integer;
|
i,j,erreur,Ncomm,i2,l : integer;
|
||||||
V_utile,V_publie : real;
|
V_utile,V_publie : real;
|
||||||
@@ -272,20 +277,37 @@ var description,s,s2,s3,Version_p,Url,LocalFile,nomfichier,date_creation_ang : s
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
//Affiche('vérifie version',clLime);
|
//Affiche('vérifie version',clLime);
|
||||||
|
// URL de l'API github des dernières releases
|
||||||
Url:='https://api.github.com/repos/f1iwq2/signaux_complexes_gl/releases/latest';
|
Url:='https://api.github.com/repos/f1iwq2/signaux_complexes_gl/releases/latest';
|
||||||
LocalFile:='page.txt';
|
|
||||||
|
// l'utilisation de TfileStream.Create inplique que le répertoire de destination soit libre de droits,
|
||||||
|
// ce qui ne marche pas pour c:\program files (x64)\signaux_complexes.
|
||||||
|
// Le fichier page.txt est donc mis dans C:\Users\moi\AppData\Roaming\signaux_complexes qui lui a tous les droits
|
||||||
|
// fabrication du nom de fichier destinataire et son chemin
|
||||||
|
LocalFile:=SysUtils.GetEnvironmentVariable('APPDATA');
|
||||||
|
if LocalFile<>'' then LocalFile:=IncludeTrailingPathDelimiter(LocalFile)+'Signaux_complexes';
|
||||||
|
if not(directoryExists(LocalFile)) then MkDir(LocalFile);
|
||||||
|
LocalFile:=LocalFile+'\page.txt';
|
||||||
|
if Debug=1 then Affiche('fichier page: '+LocalFile,clOrange);
|
||||||
|
|
||||||
|
//
|
||||||
trouve_version:=false;
|
trouve_version:=false;
|
||||||
DebugVV:=false;
|
DebugVV:=false;
|
||||||
trouve_zip:=false;
|
trouve_zip:=false;
|
||||||
zone_comm:=false;
|
zone_comm:=false;
|
||||||
|
essai:=false;
|
||||||
Ncomm:=0;
|
Ncomm:=0;
|
||||||
if DebugVV then Affiche('Lancement DownloadURL_NOCache',clYellow);
|
if DebugVV then Affiche('Lancement DownloadURL_NOCache',clYellow);
|
||||||
if DownloadURL_NOCache(Url,localFile,taille) then
|
faire:=essai;
|
||||||
//if true then
|
if not(essai) then
|
||||||
|
begin
|
||||||
|
faire:=DownloadURL_NOCache(Url,localFile,taille);
|
||||||
|
end;
|
||||||
|
if faire then
|
||||||
begin
|
begin
|
||||||
if not(FileExists(localfile)) then
|
if not(FileExists(localfile)) then
|
||||||
begin
|
begin
|
||||||
Affiche('Erreur fichier dépot non écrit. Vérifiez les droits du répertoire ',clred);
|
Affiche('Erreur fichier dépot absent. Vérifiez les droits du répertoire ',clred);
|
||||||
Affiche(GetCurrentDir,clred);
|
Affiche(GetCurrentDir,clred);
|
||||||
Affiche('Voir la notice page 9 : Refus de modification des fichiers du dossier par Windows',clred);
|
Affiche('Voir la notice page 9 : Refus de modification des fichiers du dossier par Windows',clred);
|
||||||
result:=0;
|
result:=0;
|
||||||
@@ -395,7 +417,7 @@ begin
|
|||||||
V_Publie:=StrToFloat(s,FormatSettings);
|
V_Publie:=StrToFloat(s,FormatSettings);
|
||||||
V_utile:=StrToFloat(s2,FormatSettings);
|
V_utile:=StrToFloat(s2,FormatSettings);
|
||||||
|
|
||||||
if (V_utile<V_publie) or ((V_utile=V_publie) and (SousVersion<SV_publie)) then
|
if essai or (V_utile<V_publie) or ((V_utile=V_publie) and (SousVersion<SV_publie)) then
|
||||||
begin
|
begin
|
||||||
FormVersion.Top:=10;
|
FormVersion.Top:=10;
|
||||||
FormVersion.Left:=10;
|
FormVersion.Left:=10;
|
||||||
@@ -413,8 +435,6 @@ begin
|
|||||||
// récupérer depuis la variable d'environnement windows USERPROFILE le repertoire de la session ouverte
|
// récupérer depuis la variable d'environnement windows USERPROFILE le repertoire de la session ouverte
|
||||||
s:=GetCurrentProcessEnvVar('USERPROFILE')+'\Downloads\'+Nomfichier;
|
s:=GetCurrentProcessEnvVar('USERPROFILE')+'\Downloads\'+Nomfichier;
|
||||||
|
|
||||||
essai:=false;
|
|
||||||
|
|
||||||
// s3=url complete avecnom de fichier ex : 'https://github.com/f1iwq2/Signaux_complexes_GL/releases/download/V8.51/signaux_complexes_V8.51.zip'
|
// s3=url complete avecnom de fichier ex : 'https://github.com/f1iwq2/Signaux_complexes_GL/releases/download/V8.51/signaux_complexes_V8.51.zip'
|
||||||
// s=répertoire+fichier de téléchargement ex : 'C:\Users\moi\Downloads\signaux_complexes_V8.51.zip'
|
// s=répertoire+fichier de téléchargement ex : 'C:\Users\moi\Downloads\signaux_complexes_V8.51.zip'
|
||||||
if not(essai) then
|
if not(essai) then
|
||||||
|
|||||||
@@ -297,6 +297,14 @@ version 9.7 : Boutons dans le TCO int
|
|||||||
Correction bug PN sur mémoires de zones.
|
Correction bug PN sur mémoires de zones.
|
||||||
version 9.71 : Nouveaux styles d'affichages pour les versions D12.
|
version 9.71 : Nouveaux styles d'affichages pour les versions D12.
|
||||||
Création des opérateurs NonOU et NonET dans les fonctions
|
Création des opérateurs NonOU et NonET dans les fonctions
|
||||||
|
version 9.72 : Correction de l'affichage de la fiche horaire.
|
||||||
|
Nouvel installeur
|
||||||
|
version 9.73 : Changement de l'algorithme du fichier de vérification de versions.
|
||||||
|
Nouvel installeur
|
||||||
|
version 9.74 : Correction suppression routes préférentielles des trains
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Reference in new issue
Block a user