This commit is contained in:
f1iwq2
2025-03-01 13:42:15 +01:00
parent 3d109c0b3c
commit 662da541c0
21 changed files with 14472 additions and 529 deletions
+3 -1
View File
@@ -183,6 +183,9 @@ procedure D_Arc(Canvas: TCanvas; CenterX,CenterY: integer;
function point_Sur_Segment(x,y,x1,y1,x2,y2 : integer): Boolean;
function explore_port_det(seg,port : integer) : integer;
function index_segment_act(Adresse : integer;var TabloDetSeg : TdetSeg;var nombre : integer) : boolean;
function XForm_Rotation(Angle : Single;Centre : TPoint) : TXForm;
function XForm_Echelle(const AZoomX : Single;const AZoomY : Single;const centre: TPoint) : TXForm;
function XForm_Translation(const ADistX : Integer;const ADistY : Integer) : TXForm;
implementation
@@ -1498,7 +1501,6 @@ begin
if i>0 then peindre(i,x1,y1,zom);
end;
// Affiche le réseau CDM
procedure affichage(imprime : boolean);
const LargeurMaxi=3000;
+22 -7
View File
@@ -88,15 +88,15 @@ type
var FormClock: TFormClock;
clock : Tclock;
FormClockInit,Verrouille : boolean;
FormClockInit,VerrouilleClock : boolean;
SecThick,MinThick,HouThick,DeltaFPCX,DeltaFPCY,largeurFC,hauteurFC,OffsetXFC,OffsetYFC : integer;
procedure affiche_horloge;
procedure calcul_pos_horloge;
procedure calcul_pos_horloge_compt;
implementation
uses UnitConfigCellTCO, UnitPrinc, UnitFicheHoraire;
uses UnitConfigCellTCO, UnitPrinc, UnitFicheHoraire, UnitCompteur;
{$R *.dfm}
const
@@ -331,7 +331,7 @@ begin
end;
// sur la fermeture de SC, l'horloge provoque une exception
procedure calcul_pos_horloge;
procedure calcul_pos_horloge_compt;
begin
if not assigned(formclock) or (formclock=nil) or fermeSC then exit;
if LargeurFC<150 then
@@ -354,6 +354,21 @@ begin
formclock.top:=OffsetYFC;
formclock.left:=OffsetXFC;
// compteur
position_compteur;
{
if (formCompteur[1]<>nil) and Verrouillecompteur then
begin
with formCompteur[1] do
begin
Left:=formprinc.Left+formprinc.Width-width;
end;
if FormClock.Showing then
with formCompteur[1] do
begin
top:=formclock.top-height;
end;
end; }
end;
@@ -365,7 +380,7 @@ begin
if formClock<>nil then
begin
SetWindowPos(FormClock.Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NoMove or SWP_NoSize);
Verrouille:=true;
VerrouilleClock:=true;
clock:=tClock.Create(formClock);
clock.Parent:=formclock;
@@ -474,7 +489,7 @@ begin
// le checked ne fonctionne pas sous D7, fonctionne sous D12.
TjsDev.Checked:=true;
Dverrouiller1.Checked:=false;
Verrouille:=true;
VerrouilleClock:=true;
end;
procedure TFormClock.Dverrouiller1Click(Sender: TObject);
@@ -482,7 +497,7 @@ begin
SetWindowPos(Handle,HWND_NOTOPMOST,0,0,0,0,SWP_NoMove or SWP_NoSize);
TjsDev.Checked:=false;
Dverrouiller1.Checked:=true;
Verrouille:=false;
VerrouilleClock:=false;
end;
procedure affiche_horloge;
+463
View File
@@ -0,0 +1,463 @@
object FormCompteur: TFormCompteur
Left = 555
Top = 218
Width = 222
Height = 262
BorderStyle = bsSizeToolWin
Caption = 'Compteur'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
FormStyle = fsStayOnTop
OldCreateOrder = False
OnActivate = FormActivate
OnClose = FormClose
DesignSize = (
214
231)
PixelsPerInch = 96
TextHeight = 13
object ImageCompteur: TImage
Left = 0
Top = 0
Width = 180
Height = 128
PopupMenu = PopupMenu1
end
object LabelTrain: TLabel
Left = 0
Top = 128
Width = 34
Height = 19
Alignment = taCenter
Anchors = [akLeft, akTop, akRight]
Caption = 'train'
Color = clBtnFace
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -16
Font.Name = 'Arial'
Font.Style = [fsBold]
ParentColor = False
ParentFont = False
end
object ImageTachro: TImage
Left = 80
Top = 152
Width = 106
Height = 37
Picture.Data = {
07544269746D6170762E0000424D762E00000000000036000000280000006A00
0000250000000100180000000000402E00000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000
0000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000
0000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000
0000000000FFFFFFFFFFFFFFFFFF000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000FFFFFFFFFFFFFFFFFF000000
0000000000FFFFFFFFFFFFFFFFFF000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000FFFFFFFFFFFFFFFFFF000000
0000000000FFFFFFFFFFFFFFFFFF000000000000000000000000000000000000
FFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000FFFFFFFFFFFFFFFF
FFFFFFFF00000000000000000000000000000000000000000000000000000000
0000000000FFFFFFFFFFFFFFFFFF000000000000000000000000FFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000FFFF
FFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000000FFFFFFFF
FFFFFFFFFFFFFFFF000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF
000000000000000000000000000000000000FFFFFFFFFFFFFFFFFF0000000000
00000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFF000000000000000000FFFFFFFFFFFFFFFFFF000000
0000000000FFFFFFFFFFFFFFFFFF000000000000000000000000000000000000
FFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000FFFFFFFFFFFFFFFF
FFFFFFFF00000000000000000000000000000000000000000000000000000000
0000000000FFFFFFFFFFFFFFFFFF000000000000000000000000FFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000FFFF
FFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000000FFFFFFFF
FFFFFFFFFFFFFFFF000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF
000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF0000000000
00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000FFFFFFFFFFFFFFFFFF000000
0000000000FFFFFFFFFFFFFFFFFF000000000000000000000000000000000000
FFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000FFFFFFFFFFFFFFFF
FFFFFFFFFFFFFF00000000000000000000000000000000000000000000000000
0000FFFFFFFFFFFFFFFFFFFFFFFF000000000000000000FFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000FFFF
FFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000000FFFFFFFF
FFFFFFFFFFFFFFFF000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF
000000000000000000000000000000FFFFFFFFFFFFFFFFFF0000000000000000
00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000FFFFFFFFFFFFFFFFFF000000
0000000000FFFFFFFFFFFFFFFFFF000000000000000000000000000000000000
FFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000000000FFFFFFFFFF
FFFFFFFFFFFFFF00000000000000000000000000000000000000000000000000
0000FFFFFFFFFFFFFFFFFF000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000FFFF
FFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000000FFFFFFFF
FFFFFFFFFFFFFFFF000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF
000000000000000000000000FFFFFFFFFFFFFFFFFF0000000000000000000000
00000000FFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000
0000000000FFFFFFFFFFFFFFFFFF000000000000FFFFFFFFFFFFFFFFFF000000
0000000000FFFFFFFFFFFFFFFFFF000000000000000000000000000000000000
FFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000000000FFFFFFFFFF
FFFFFFFFFFFFFF000000000000000000000000000000000000000000000000FF
FFFFFFFFFFFFFFFFFFFFFF000000000000000000FFFFFFFFFFFFFFFFFF000000
000000000000000000000000000000FFFFFFFFFFFF000000000000000000FFFF
FFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000000FFFFFFFF
FFFFFFFFFFFFFFFF000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000
00000000FFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000
0000000000FFFFFFFFFFFFFFFFFF000000000000FFFFFFFFFFFFFFFFFF000000
0000000000FFFFFFFFFFFFFFFFFF000000000000000000000000000000000000
FFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000000FFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFF000000000000000000000000FFFFFFFFFFFFFFFFFF000000
000000000000000000000000000000000000FFFFFF000000000000000000FFFF
FFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000000FFFFFFFF
FFFFFFFFFFFFFFFF000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000
00000000FFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000
0000000000FFFFFFFFFFFFFFFFFF000000000000FFFFFFFFFFFFFFFFFF000000
0000000000FFFFFFFFFFFFFFFFFF000000000000000000000000000000000000
FFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000000FFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFF000000000000000000000000FFFFFFFFFFFFFFFFFF000000
000000000000000000000000000000000000FFFFFF000000000000000000FFFF
FFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000000FFFFFFFF
FFFFFFFFFFFFFFFF000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000
00000000FFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000
0000000000FFFFFFFFFFFFFFFFFF000000000000FFFFFFFFFFFFFFFFFF000000
0000000000FFFFFFFFFFFFFFFFFF000000000000000000000000000000000000
FFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000000FFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFF000000000000000000000000000000FFFFFFFFFFFFFFFFFF000000
000000000000000000000000000000000000000000000000000000000000FFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFF000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000
00000000FFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000
0000000000FFFFFFFFFFFFFFFFFF000000000000FFFFFFFFFFFFFFFFFF000000
0000000000FFFFFFFFFFFFFFFFFF000000000000000000000000000000000000
FFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000000FFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFF000000000000000000000000000000FFFFFFFFFFFFFFFFFF000000
000000000000000000000000000000000000000000000000000000000000FFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFF000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF
000000000000000000000000000000FFFFFFFFFFFFFFFFFF0000000000000000
00000000FFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000
0000FFFFFFFFFFFFFFFFFFFFFFFF000000000000FFFFFFFFFFFFFFFFFF000000
0000000000FFFFFFFFFFFFFFFFFF000000000000000000000000000000000000
FFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000
00FFFFFFFFFFFFFFFFFF000000000000000000000000000000FFFFFFFFFFFFFF
FFFFFFFFFF000000000000000000000000000000FFFFFFFFFFFFFFFFFF000000
000000000000000000000000000000000000000000000000000000000000FFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFF000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF
000000000000000000000000000000FFFFFFFFFFFFFFFFFF0000000000000000
00000000FFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000
0000FFFFFFFFFFFFFFFFFFFFFFFF000000000000FFFFFFFFFFFFFFFFFF000000
0000000000FFFFFFFFFFFFFFFFFF000000000000000000000000000000000000
FFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000
00FFFFFFFFFFFFFFFFFF000000000000000000000000000000FFFFFFFFFFFFFF
FFFF000000000000000000000000000000000000FFFFFFFFFFFFFFFFFF000000
000000000000000000000000000000000000000000000000000000000000FFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFF000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF
000000000000000000000000000000FFFFFFFFFFFFFFFFFF0000000000000000
00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFF000000000000000000FFFFFFFFFFFFFFFFFF000000
0000000000FFFFFFFFFFFFFFFFFF000000000000FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000
00000000FFFFFFFFFFFF000000000000000000000000000000FFFFFFFFFFFFFF
FFFF000000000000000000000000000000000000FFFFFFFFFFFFFFFFFF000000
000000000000000000000000000000000000000000000000000000000000FFFF
FFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000000FFFFFFFF
FFFFFFFFFFFFFFFF000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF
000000000000000000000000000000FFFFFFFFFFFFFFFFFF0000000000000000
00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFF000000000000000000FFFFFFFFFFFFFFFFFF000000
0000000000FFFFFFFFFFFFFFFFFF000000000000FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000
00000000FFFFFFFFFFFFFFFFFF000000000000000000FFFFFFFFFFFFFFFFFF00
0000000000000000000000000000000000000000FFFFFFFFFFFFFFFFFF000000
000000000000000000000000000000000000000000000000000000000000FFFF
FFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000000FFFFFFFF
FFFFFFFFFFFFFFFF000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF
000000000000000000000000000000FFFFFFFFFFFFFFFFFF0000000000000000
00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFF000000000000000000000000FFFFFFFFFFFFFFFFFF000000
0000000000FFFFFFFFFFFFFFFFFF000000000000000000000000FFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000
00000000FFFFFFFFFFFFFFFFFF000000000000000000FFFFFFFFFFFFFFFFFF00
0000000000000000000000000000000000000000FFFFFFFFFFFFFFFFFF000000
000000000000000000000000000000000000000000000000000000000000FFFF
FFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000000FFFFFFFF
FFFFFFFFFFFFFFFF000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF
000000000000000000000000000000FFFFFFFFFFFFFFFFFF0000000000000000
00000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFF000000000000000000000000000000FFFFFFFFFFFFFFFFFF000000
0000000000FFFFFFFFFFFFFFFFFF000000000000000000000000000000000000
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000
00000000000000FFFFFFFFFFFF000000000000000000FFFFFFFFFFFFFFFFFF00
0000000000000000000000000000000000000000FFFFFFFFFFFFFFFFFF000000
000000000000000000000000000000000000000000000000000000000000FFFF
FFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000000FFFFFFFF
FFFFFFFFFFFFFFFF000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF
000000000000000000000000000000FFFFFFFFFFFFFFFFFF0000000000000000
00000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000
0000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF000000
0000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000
000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FF000000000000FFFFFFFFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFF00000000
0000000000000000000000000000000000000000FFFFFFFFFFFFFFFFFF000000
000000000000000000000000000000000000000000000000000000000000FFFF
FFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000000FFFFFFFF
FFFFFFFFFFFFFFFF000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF
000000000000000000000000000000FFFFFFFFFFFFFFFFFF0000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000
0000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFF000000000000000000000000000000000000000000FFFFFFFFFFFFFFFF
FF000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000
0000000000000000000000000000000000000000FFFFFFFFFFFFFFFFFF000000
000000000000000000000000000000FFFFFFFFFFFF000000000000000000FFFF
FFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000000FFFFFFFF
FFFFFFFFFFFFFFFF000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF
000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF0000000000000000
00000000000000000000000000000000000000000000000000000000FFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000
0000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000
00000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000
0000000000000000000000000000000000000000FFFFFFFFFFFFFFFFFF000000
000000000000000000000000000000FFFFFFFFFFFF000000000000000000FFFF
FFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000000FFFFFFFF
FFFFFFFFFFFFFFFF000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF
000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF0000000000000000
00000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000000000
0000000000000000000000000000000000000000000000000000FFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000
00000000000000000000000000FFFFFFFFFFFFFFFFFF00000000000000000000
0000000000000000000000000000000000000000FFFFFFFFFFFFFFFFFF000000
000000000000000000000000000000FFFFFFFFFFFF000000000000000000FFFF
FFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000000FFFFFFFF
FFFFFFFFFFFFFFFF000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000
00000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFF000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FF000000000000000000000000000000FFFFFF00000000000000000000000000
0000000000000000000000000000000000000000FFFFFFFFFFFFFFFFFF000000
000000000000000000000000000000FFFFFFFFFFFF000000000000000000FFFF
FFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000000FFFFFFFF
FFFFFFFFFFFFFFFF000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000000000FFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000000000
0000000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000FFFF
FFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000000FFFFFFFF
FFFFFFFFFFFFFFFF000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFF000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000
0000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000FFFF
FFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000000FFFFFFFF
FFFFFFFFFFFFFFFF000000000000000000000000000000000000000000000000
000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFF000000000000000000000000000000000000000000FFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000000000FFFF
FFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000FFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000FFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFF0000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000FF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000}
Visible = False
end
object TrackBar1: TTrackBar
Left = 0
Top = 40
Width = 129
Height = 21
TabOrder = 0
Visible = False
end
object PopupMenu1: TPopupMenu
Left = 112
Top = 8
object Verrouillerdevant1: TMenuItem
Caption = 'Verrouiller devant'
OnClick = Verrouillerdevant1Click
end
object Dverrouiller1: TMenuItem
Caption = 'D'#233'verrouiller'
OnClick = Dverrouiller1Click
end
object N1: TMenuItem
Caption = '-'
end
object Compteurdevitesse11: TMenuItem
Caption = 'Compteur de vitesse 1'
OnClick = Compteurdevitesse11Click
end
object Compteurdevitesse21: TMenuItem
Caption = 'Compteur de vitesse 2'
OnClick = Compteurdevitesse21Click
end
object Compteurtachro1: TMenuItem
Caption = 'Compteur tachro'
OnClick = Compteurtachro1Click
end
end
end
+507
View File
@@ -0,0 +1,507 @@
unit UnitCompteur;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, math, ComCtrls, Menus;
const
pisur180=pi/180;
NbreCompteurs=10;
type
TFormCompteur = class(TForm)
ImageCompteur: TImage;
TrackBar1: TTrackBar;
LabelTrain: TLabel;
PopupMenu1: TPopupMenu;
Verrouillerdevant1: TMenuItem;
Dverrouiller1: TMenuItem;
N1: TMenuItem;
Compteurdevitesse11: TMenuItem;
Compteurdevitesse21: TMenuItem;
Compteurtachro1: TMenuItem;
ImageTachro: TImage;
procedure FormActivate(Sender: TObject);
procedure Dverrouiller1Click(Sender: TObject);
procedure Verrouillerdevant1Click(Sender: TObject);
procedure Compteurdevitesse11Click(Sender: TObject);
procedure Compteurdevitesse21Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure Compteurtachro1Click(Sender: TObject);
private
{ Déclarations privées }
protected
procedure WMExitSizeMove(var Message: TMessage); message WM_EXITSIZEMOVE; // détecte fin de redimensionnement fenêtre
public
{ Déclarations publiques }
end;
var
formCompteur : array[1..10] of TformCompteur;
AigCX,AigCY,Raig,Rav : array[1..NbreCompteurs] of integer;
redX,redY,ComptA,ComptB : array[1..NbreCompteurs] of single;
FCBitMap : array[1..NbreCompteurs] of tBitmap;
VerrouilleCompteur : boolean;
LargeurCompteurs,HauteurCompteurs : integer;
Procedure Init_compteur(i : integer);
procedure aiguille_compteur_l(id,idTrain : integer);
procedure position_compteur;
procedure affiche_train_compteur(c : integer);
implementation
uses UnitPrinc, UnitTCO, UnitClock;
{$R *.dfm}
// event fin de redimmensionnement
procedure TFormCompteur.WMExitSizeMove(var Message: TMessage);
begin
inherited;
// Affiche(IntToSTR(Message.Msg)+' '+inTtOstr(message.WParam)+' '+intToSTR(message.LParam)+' '+intToSTR(message.WParamLo),clred);
LargeurCompteurs:=formCompteur[1].Width; // nouvelle largeur
init_compteur(1);
end;
// affiche le nom du train
procedure affiche_train_compteur(c : integer);
var s : string;
begin
s:=trains[IdTrainClic].nom_train;
FormCompteur[c].caption:=s;
with FormCompteur[c].labelTrain do
begin
caption:=s;
Width:=FormCompteur[c].Width-5;
end;
end;
procedure aiguille_compteur_l(id,idTrain : integer);
var x1,y1,x2,y2,x3,y3,x4,y4,vitesse,vitesseFin,lim,him : integer;
angleDeb,AngleFin,sinD,cosD,sinF,cosF : extended ;
begin
if compteur<1 then exit;
if idTrain<>0 then
begin
vitesse:=abs(trains[idTrain].VitesseCompteur);
vitesseFin:=abs(trains[idTrain].vitesseCons);
end
else
begin
vitesse:=0;VitesseFin:=0;
end;
// convertir les vitesses instantanées et fin en angles par
// la formule angle=A.vitesse+b
angleDeb:=comptA[id]*vitesse+comptB[id];
angleFin:=ComptA[id]*vitesseFin+comptB[id];
sincos(angleDeb*pisur180,sinD,cosD);
with formCompteur[id].ImageCompteur do
begin
lim:=width;
him:=Height;
end;
with formCompteur[id].ImageCompteur.Canvas do
begin
copyrect(rect(0,0,lim,him),FcBitMap[id].canvas,rect(0,0,lim,him));
// afficher l'arc vert
if (vitesse<>0) and (angleDeb<>angleFin) then
begin
x1:=AigCX[id] - rav[id];
y1:=AigCY[id] - rav[id];
x2:=AigCX[id] + rav[id];
y2:=AigCY[id] + rav[id];
x3:=AigCX[id] + Round(rav[id]*sinD);
y3:=AigCY[id] - Round(rav[id]*cosD);
sincos(AngleFin*pisur180,sinF,cosF); // paramètres d'angleFin
x4:=AigCX[id] + Round(rav[id]*sinF);
y4:=AigCY[id] - Round(rav[id]*cosF);
pen.color:=clLime;
moveTo(X3,y3);LineTo(x3+2,y3+2);
if angleDeb>angleFin then setArcDirection(Handle,AD_COUNTERCLOCKWISE) else setArcDirection(Handle,AD_CLOCKWISE) ;
Arc(x1,y1,x2,y2,x3,y3,x4,y4);
end;
// Afficher l'aiguille (angleDeb)
if compteur=3 then Pen.color:=$ffa0a0 else Pen.color:=clred;
MoveTo(AigCX[id],AigCY[id]);
LineTo(round(rAig[id]*sinD)+AigCX[id],round(-rAig[id]*cosD)+AigCY[id]);
end;
formCompteur[id].ImageCompteur.Repaint;
end;
procedure compteur_tachro;
var l,av,n,v,rayon2,rayon3,rayon4,x1,y1,x2,y2,xt,yt,lim,him,rg : integer;
angle,angleFin,incr,r,a : single;
s : string;
begin
angle:=-40; // angle début des graduations
angleFin:=220; // angle fin des graduations
incr:=2.5; // incrément d'angle en ° des graduations
n:=0;
v:=0;
lim:=fcbitmap[1].Width;
him:=fcbitmap[1].height;
with fcBitmap[1] do
begin
AigCX[1]:=width div 2; // centre aiguille
AigCY[1]:=AigCX[1];
r:=width/400; // réduction
//Raig[1]:=(Lim div 2)-round(10*r); // rayon
rg:=round(AigCX[1]/1.05); // rayon des graduations
rayon2:=Rg-round(10*r); // rayon de fin des graduations
rayon3:=Rg-round(20*r);
rayon4:=Rg-round(20*r); // chiffres
with fcBitmap[1].Canvas do
begin
pen.width:=1;
pen.Color:=clWhite;
Brush.Color:=clBlack;
Brush.Style:=bsSolid;
FillRect(Rect(0,0,lim,him));
Cercle(fcBitmap[1].Canvas,AigCX[1],AigCY[1],round(130*r),clGray,clblack);
Cercle(fcBitmap[1].Canvas,AigCX[1],AigCY[1],round(10*r),clwhite,clWhite);
font.Name:='Arial';
brush.color:=clBlack;
pen.color:=clwhite;
font.color:=clWhite;
font.size:=round(r*20);
//Affiche(intToSTR(font.size),clred);
font.style:=[fsbold];
end;
end;
// dessine le cadran
repeat
// affiche les chiffres
if n mod 10=0 then
begin
s:=intToSTR(round(v));
// pour centrer le chiffre de vitesse sur l'axe de la graduation
a:=(fcBitmap[1].canvas.TextWidth(s) div 2)/rayon4;
if abs(a)>1 then a:=1;
a:=arcSin(a);
l:=round(a*180/pi);
//Affiche(intToSTR(l),clYellow);
xt:=round(cos((angle+180-l)*pisur180)*rayon4)+AigCX[1];
yt:=round(sin((angle+180-l)*pisur180)*rayon4)+AigCY[1];
// affiche les chiffres
{$IF CompilerVersion >= 28.0}
av:=round(90-angle)*10;
fcBitmap[1].canvas.font.orientation:=av;
fcBitmap[1].canvas.Textout(xt,yt,s);
{$ELSE}
av:=10+round(90-angle)*10;
AffTexteIncliBordeTexture(fcBitmap[1].canvas,xt,yt,fcBitmap[1].canvas.font,clYellow,0,pmcopy,s,av);
{$IFEND}
inc(v,20);
end;
x1:=round(cos((angle+180)*pisur180)*Rg)+AigCX[1];
y1:=round(sin((angle+180)*pisur180)*Rg)+AigCY[1];
// gros traits
if n mod 5 = 0 then
begin
fcBitmap[1].canvas.pen.Width:=round(4*r);
x2:=round(cos((angle+180)*pisur180)*rayon3)+AigCX[1];
y2:=round(sin((angle+180)*pisur180)*rayon3)+AigCY[1];
end
else
begin
// traits fins
fcBitmap[1].canvas.pen.Width:=round(2*r);
x2:=round(cos((angle+180)*pisur180)*rayon2)+AigCX[1];
y2:=round(sin((angle+180)*pisur180)*rayon2)+AigCY[1];
end;
with fcBitmap[1].canvas do
begin
MoveTo(x1,y1);
lineTo(x2,y2);
end;
inc(n);
angle:=angle+incr; // 18
until angle>AngleFin+incr;
lim:=formCompteur[1].ImageTachro.width;
him:=formCompteur[1].ImageTachro.height;
// copie l'image tachro mise à l'échelle
StretchBlt(fcBitmap[1].canvas.Handle,round(145*r),round(85*r),round(lim*r),round(him*r),
FormCompteur[1].ImageTachro.canvas.Handle,0,0,lim,him,srcCopy);
end;
Procedure Init_compteur(i : integer);
const ofs=20; // décalage entre la taille de l'image et de la fenetre
var l,h,lim,him,hfen,mini,maxi,vmax : integer;
begin
if i<1 then exit;
//Affiche('Init compteur de vitesse',clYellow);
// fixer la largeur de la fenêtre
formCompteur[i].Width:=LargeurCompteurs;
Lim:=LargeurCompteurs-ofs;
formCompteur[i].ImageCompteur.width:=Lim;
case compteur of
1 :
begin
mini:=-135;
maxi:=152;
vmax:=127;
l:=formPrinc.ImageCompteur1.width;
h:=formPrinc.ImageCompteur1.height;
end;
2 :
begin
mini:=-81; // le 0 est à mini degrés
maxi:=82; // le vmax est à max degrés
vmax:=160; // vmax du compteur
l:=formPrinc.ImageCompteur2.width;
h:=formPrinc.ImageCompteur2.height;
end;
3 :
begin
mini:=-130; // le 0 est à mini degrés
maxi:=132; // le vmax est à max degrés
vmax:=210; // vmax du compteur
l:=400;
h:=340;
end;
end;
ComptA[i]:=(maxi-mini)/vmax; // pente de conversion vitesse en degrés compteur
ComptB[i]:=mini; // coordonnées origine conversion
if l>=h then
begin
him:=round(lim*h/l); // hauteur image
//Affiche('Lim him = '+IntToSTR(lim)+' '+intToSTR(him),clLime);
//Affiche('L h = '+IntToSTR(l)+' '+intToSTR(h),clLime);
end
else
begin
him:=round(h*largeurCompteurs/l); // a revoir
end;
redX[i]:=Lim/l;
redY[i]:=Him/h;
case compteur of
1 : rav[i]:=round(70*redx[i]); // rayon de l'arc vert
2 : rav[i]:=round(100*redx[i]);
3 : rav[i]:=round(122*redx[i]);
end;
with formCompteur[i] do
begin
if VerrouilleCompteur then Left:=formprinc.Left+formprinc.Width-width;
// ajuster hauteur de la fenetre
hfen:=him+LabelTrain.Height+40; //formCompteur[i].TrackBar1.height+48;//+10;
height:=hfen;
with constraints do
begin
MaxWidth:=400;
MinWidth:=200;
MaxHeight:=450;
MinHeight:=100;
end;
ImageCompteur.Width:=Lim;
ImageCompteur.Height:=Him;
ImageCompteur.Picture.Bitmap.Width:=Lim;
ImageCompteur.Picture.Bitmap.Height:=Him;
trackBar1.top:=ImageCompteur.Height+8;
trackBar1.width:=LargeurCompteurs-5;
LabelTrain.top:=ImageCompteur.top+ImageCompteur.Height; //trackBar1.top+formCompteur[i].trackBar1.height;
LabelTrain.Width:=Lim-2;
end;
// imageC <-- FCBitMap (on écrit les vitesses) <- ImageCompteur2 (grande)
// créer un bitmap réduit qui sert de référence
FCBitMap[i].Free;
FCBitMap[i]:=TBitMap.Create;
FCBitMap[i].Width:=lim;
FCBitMap[i].Height:=him;
with FCBitMap[i].Canvas do
begin
Brush.Style:=bsSolid;
Brush.Color:=$141414; //$e0e0e0;
if compteur=1 then StretchDraw(rect(0,0,Lim,Him),Formprinc.ImageCompteur1.Picture.Bitmap);
if compteur=2 then StretchDraw(rect(0,0,Lim,Him),Formprinc.ImageCompteur2.Picture.Bitmap);
font.name:='arial';
font.Style:=[fsBold];
// les compteurs 1 et 2 proviennent de bitmaps
// le compteur 3 (tachro) est dessiné par "compteur_tachro"
case compteur of
1 : begin
Brush.Style:=bsSolid;
Brush.Color:=$1F1A17;
font.color:=clwhite;
font.size:=round(redx[i]*10);
TextOut(round(50*redX[i]),round(128*redY[i]),'0');
TextOut(round(36*redX[i]),round(90*redY[i]),'20');
TextOut(round(50*redX[i]),round(54*redY[i]),'40');
TextOut(round(90*redX[i]),round(36*redY[i]),'60');
TextOut(round(129*redX[i]),round(53*redY[i]),'80');
TextOut(round(137*redX[i]),round(91*redY[i]),'100');
TextOut(round(126*redX[i]),round(126*redY[i]),'120');
// centre de l'aiguille
AigCX[i]:=round(98*redX[i]);
AigCY[i]:=round(96*redY[i]);
rAig[i]:=round(AigCX[i] / 1.5);
end;
2 : begin
font.color:=clblue;
Brush.Style:=bsSolid;
Brush.Color:=clWhite;
font.size:=round(redx[i]*22);
TextOut(round(47*redX[i]),round(167*redY[i]),'0');
TextOut(round(58*redX[i]),round(118*redY[i]),'20');
TextOut(round(89*redX[i]),round(80*redY[i]),'40');
TextOut(round(133*redX[i]),round(50*redY[i]),'60');
TextOut(round(190*redX[i]),round(40*redY[i]),'80');
TextOut(round(232*redX[i]),round(50*redY[i]),'100');
TextOut(round(274*redX[i]),round(80*redY[i]),'120');
TextOut(round(306*redX[i]),round(118*redY[i]),'140');
TextOut(round(324*redX[i]),round(168*redY[i]),'160');
// centre de l'aiguille et longueur
AigCX[i]:=round(204*redX[i]);
AigCY[i]:=round(207*redY[i]);
rAig[i]:=round(AigCX[i]/1.05);
end;
3 : begin
// centre de l'aiguille et longueur
AigCX[i]:=lim div 2;
AigCY[i]:=him div 2;
rAig[i]:=round(AigCX[i]/1.07);
compteur_tachro;
end;
end;
end;
// ajuste la taille
with FormCompteur[i].ImageCompteur do
begin
canvas.pen.color:=clRed;
canvas.pen.width:=3; // épaisseur aiguille
end;
//formprinc.DoubleBuffered:=true;
Aiguille_compteur_l(i,IdTrainClic);
end;
procedure position_compteur;
begin
if not(Verrouillecompteur) then exit;
if formCompteur[1]=nil then exit;
with formCompteur[1] do
begin
Left:=formprinc.Left+formprinc.Width-width-2;
//left:=0;
end;
if (formClock<>nil) and not(fermeSC) then
begin
if FormClock.Showing then
formCompteur[1].top:=formclock.top-formCompteur[1].height
else
formCompteur[1].top:=FormPrinc.top+formprinc.PageControl.top+100;
end;
//Affiche(intToSTR(formCompteur[1].top),clYellow);
end;
procedure TFormCompteur.FormActivate(Sender: TObject);
begin
//Affiche('FormCompteur activate',clyellow);
if VerrouilleCompteur then position_compteur;
end;
procedure TFormCompteur.Dverrouiller1Click(Sender: TObject);
begin
SetWindowPos(Handle,HWND_NOTOPMOST,0,0,0,0,SWP_NoMove or SWP_NoSize);
Verrouillerdevant1.Checked:=false;
Dverrouiller1.Checked:=true;
VerrouilleCompteur:=false;
end;
procedure TFormCompteur.Verrouillerdevant1Click(Sender: TObject);
begin
SetWindowPos(Handle,HWND_TOPMOST,0,0,0,0,SWP_NoMove or SWP_NoSize);
Verrouillerdevant1.Checked:=true;
Dverrouiller1.Checked:=false;
VerrouilleCompteur:=true;
end;
procedure TFormCompteur.Compteurdevitesse11Click(Sender: TObject);
begin
Compteurdevitesse11.checked:=true;
Compteurdevitesse21.checked:=false;
Compteurtachro1.checked:=false;
compteur:=1;
init_compteur(1);
affiche_train_compteur(1);
aiguille_compteur_l(1,idTrainClic);
end;
procedure TFormCompteur.Compteurdevitesse21Click(Sender: TObject);
begin
Compteurdevitesse11.checked:=false;
Compteurdevitesse21.checked:=true;
Compteurtachro1.checked:=false;
compteur:=2;
init_compteur(1);
affiche_train_compteur(1);
aiguille_compteur_l(1,idTrainClic);
end;
procedure TFormCompteur.Compteurtachro1Click(Sender: TObject);
begin
Compteurdevitesse11.checked:=false;
Compteurdevitesse21.checked:=false;
Compteurtachro1.checked:=true;
compteur:=3;
init_compteur(1);
affiche_train_compteur(1);
aiguille_compteur_l(1,idTrainClic);
end;
procedure TFormCompteur.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
AffCompteur:=false;
end;
begin
LargeurCompteurs:=200;
HauteurCompteurs:=200;
end.
+15 -5
View File
@@ -670,7 +670,7 @@ object FormConfig: TFormConfig
Top = 8
Width = 633
Height = 505
ActivePage = TabSheetBouton
ActivePage = TabSheetTrains
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack
Font.Height = -11
@@ -1080,6 +1080,16 @@ object FormConfig: TFormConfig
Caption = 'Signaux (non utilis'#233')'
TabOrder = 4
end
object CheckBoxSrvTdcc: TCheckBox
Left = 120
Top = 72
Width = 145
Height = 17
Caption = 'Vitesses trains (non utilis'#233')'
ParentShowHint = False
ShowHint = False
TabOrder = 5
end
end
object GroupBoxDivers: TGroupBox
Left = 312
@@ -3187,7 +3197,7 @@ object FormConfig: TFormConfig
Left = 240
Top = 19
Width = 33
Height = 21
Height = 22
MaxValue = 2
MinValue = 0
TabOrder = 2
@@ -4093,7 +4103,7 @@ object FormConfig: TFormConfig
end
object ImageTrain: TImage
Left = 16
Top = 400
Top = 392
Width = 257
Height = 49
end
@@ -4139,7 +4149,7 @@ object FormConfig: TFormConfig
Top = 16
Width = 337
Height = 457
ActivePage = TtabSheetEt
ActivePage = TabSheetTrGen
TabOrder = 3
object TabSheetTrGen: TTabSheet
Caption = 'G'#233'n'#233'ral'
@@ -5140,7 +5150,7 @@ object FormConfig: TFormConfig
Width = 153
Height = 21
Style = csDropDownList
ItemHeight = 13
ItemHeight = 0
TabOrder = 7
OnChange = ComboBoxUSBTrChange
end
+129 -60
View File
@@ -467,6 +467,7 @@ type
Label74: TLabel;
LabelId: TLabel;
LabeledEditFn: TLabeledEdit;
CheckBoxSrvTdcc: TCheckBox;
procedure ButtonAppliquerEtFermerClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure ListBoxAigMouseDown(Sender: TObject; Button: TMouseButton;
@@ -851,6 +852,10 @@ RetourHeure_ch='RetourHeure';
RetourMinute_ch='RetourMinute';
DureeMinute_ch='DureeMinute';
relanceHorl_init_ch='relanceHorl_init';
compteur_ch='compteur';
Affcompteur_ch='AffCompteur';
LargCompteur_ch='LargCompteur';
VerrouCompteur_ch='VerrouCompteur';
// sections de config
section_aig_ch='[section_aig]';
@@ -873,7 +878,7 @@ section_blocs_USB_ch='[section_blocs_USB]';
rep_icones='icones';
// indice des icones donc des fonctions
// indice des icones donc des fonctions logiques
FoncVAR=0;
//--------
OpET=1;
@@ -981,7 +986,7 @@ procedure clic_BRM;
implementation
uses UnitDebug,UnitTCO, UnitSR, UnitCDF,UnitAnalyseSegCDM, unitPilote, unitclock,
UnitModifAction,UnitConfigCellTCO, UnitRouteTrains;
UnitModifAction,UnitConfigCellTCO, UnitRouteTrains,UnitCompteur;
{$R *.dfm}
@@ -1011,7 +1016,7 @@ begin
if Srvc_Det then begin s:=s+'SRV=ADET;';inc(i);end; // service détecteurs
if Srvc_Pos then begin s:=s+'SRV=TSXY;';inc(i);end; // service position et vitesses des trains
if Srvc_Sig then begin s:=s+'SRV=ASIG;';inc(i);end; // service signaux
if Srvc_tdcc then begin s:=s+'SRV=TDCC;';inc(i);end; // service info train (si chgt vitesse)
if Srvc_tspd then begin s:=s+'SRV=TSPD;';inc(i);end; // service info train (si chgt vitesse)
// insère le nombre de paramètres
ss:=format('%.*d',[2,i]) ;
@@ -1034,6 +1039,7 @@ begin
if Srvc_Det then s:=s+'- détecteurs ';
if Srvc_Pos then s:=s+'- position des trains ';
if Srvc_sig then s:=s+'- état des signaux ';
if Srvc_tspd then s:=s+'- chgt vitesse trains ';
Affiche(s,clYellow);
end;
services_CDM:=ack_cdm;
@@ -1332,16 +1338,15 @@ end;
// renvoie un A si BT est un aiguillage (aig, tjd, tjs tri)
function TypeEl_to_char(BT : TEquipement) : string;
begin
case BT of // 1=détecteur 2=aig ou TJD ou TJS 4=tri
det : TypeEl_to_char:='';
aig,tjd,tjs,triple : TypeEl_to_char:='A';
end;
if (bt=aig) or (bt=tjd) or (bt=tjs) or (bt=triple) then result:='A'
else result:='';
end;
function TypeElAIg_to_char(adr : integer;c : char) : string;
// renvoie un texte pour le hint de l'aiguillage adr extrémité c
function TypeElAig_to_char(adr : integer;c : char) : string;
var s: string;
begin
if (adr=0) and (c<>'D') and (c<>'S') and (c<>'P') then s:='Buttoir';
if (adr=0) and (c<>'D') and (c<>'S') and (c<>'P') then s:='Buttoir';
if adr<>0 then
begin
@@ -1962,6 +1967,7 @@ begin
DeclArretTrain : s:=s+intToSTR(Tablo_Action[i].adresse)+','+Tablo_Action[i].trainDecl+',';
DeclSignal : s:=s+intToSTR(Tablo_Action[i].adresse)+','+intToSTR(Tablo_Action[i].etat)+',';
DeclFonction : s:=s+intToSTR(Tablo_Action[i].adresse)+',';
DeclClavier : s:=s+intToSTR(Tablo_Action[i].adresse)+',';
end;
// conditions
@@ -2104,7 +2110,7 @@ begin
result:=s;
end;
// modifie le fichier de config en fonction du paramétrage
// écrit le fichier de config en fonction du paramétrage
procedure genere_config;
var s: string;
fichierN : text;
@@ -2168,6 +2174,7 @@ begin
if Srvc_Det then i:=setbit(i,2);
if Srvc_Pos then i:=setbit(i,3);
if Srvc_Sig then i:=setbit(i,4);
if Srvc_tspd then i:=setbit(i,5);
writeln(fichierN,ServicesCDM_ch+'=',i);
// adresse ip interface XpressNet
@@ -2202,6 +2209,13 @@ begin
writeln(fichierN,MaxParcours_ch+'=',IntToSTR(MaxParcours));
writeln(fichierN,MaxRoutes_ch+'=',IntToSTR(MaxRoutes));
writeln(fichierN,compteur_ch+'=',IntToSTR(compteur));
writeln(fichierN,LargCompteur_ch+'=',IntToSTR(LargeurCompteurs));
if VerrouilleCompteur then s:='1' else s:='0';
writeln(fichierN,VerrouCompteur_ch+'=',s);
if AffCompteur then s:='1' else s:='0';
writeln(fichierN,AffCompteur_ch+'=',s);
// connexion de l'interface en COM/USB
if AvecDemandeInterfaceUSB then s:='1' else s:='0';
@@ -3585,6 +3599,11 @@ const LessThanValue=-1;
Val(s,i,erreur);Delete(s,1,erreur); // adresse
Tablo_Action[maxtablo_act].adresse:=i;
end;
DeclClavier :
begin
Val(s,i,erreur);Delete(s,1,erreur); // adresse
Tablo_Action[maxtablo_act].adresse:=i;
end;
end;
@@ -4850,6 +4869,7 @@ const LessThanValue=-1;
ss:=copy(s,1,j-1);
blocUSB[i].AffTrain:=ss;delete(s,1,j);
delete(s,1,2); // supprime BR
val(s,j,erreur);delete(s,1,erreur);
blocUsb[i].rotatifM:=j;
@@ -5314,7 +5334,7 @@ const LessThanValue=-1;
Srvc_det:=testbit(i,2);
Srvc_pos:=testbit(i,3);
Srvc_sig:=testbit(i,4);
Srvc_tdcc:=false;
Srvc_tspd:=testbit(i,5);
end;
// adresse ip et port de la centrale
@@ -5537,6 +5557,45 @@ const LessThanValue=-1;
val(s,Tempo_Aig,erreur);
end;
sa:=uppercase(compteur_ch)+'=';
i:=pos(sa,s);
if i=1 then
begin
inc(nv);
delete(s,i,length(sa));
val(s,compteur,erreur);
end;
sa:=uppercase(LargCompteur_ch)+'=';
i:=pos(sa,s);
if i=1 then
begin
inc(nv);
delete(s,i,length(sa));
val(s,LargeurCompteurs,erreur);
end;
sa:=uppercase(AffCompteur_ch)+'=';
i:=pos(sa,s);
if i=1 then
begin
inc(nv);
delete(s,i,length(sa));
val(s,i,erreur);
AffCompteur:=i=1;
end;
sa:=uppercase(VerrouCompteur_ch)+'=';
i:=pos(sa,s);
if i=1 then
begin
inc(nv);
delete(s,i,length(sa));
val(s,i,erreur);
VerrouilleCompteur:=i=1;
end;
sa:=uppercase(MaxParcours_ch)+'=';
i:=pos(sa,s);
if i=1 then
@@ -6024,7 +6083,7 @@ begin
Srvc_Det:=true;
Srvc_Pos:=true;
Srvc_Sig:=false;
Srvc_tdcc:=false;
Srvc_tspd:=false;
TimoutMaxInterface:=7;
AvecInitAiguillages:=false;
PilotageTrainsCDMNom:=true;
@@ -6258,12 +6317,15 @@ begin
change_srv:=Srvc_Act<>CheckBoxServAct.checked or change_srv;
change_srv:=Srvc_Pos<>CheckServPosTrains.checked or change_srv;
change_srv:=Srvc_Sig<>CheckBoxSrvSig.checked or change_srv;
change_srv:=Srvc_tspd<>CheckBoxSrvTdcc.checked or change_srv;
Srvc_Aig:=CheckBoxServAig.checked;
Srvc_Det:=CheckBoxServDet.checked;
Srvc_Act:=CheckBoxServAct.checked;
Srvc_Pos:=CheckServPosTrains.checked;
Srvc_Sig:=CheckBoxSrvSig.checked;
Srvc_tspd:=CheckBoxSrvTdcc.checked;
Raz_Acc_signaux:=CheckBoxRazSignaux.checked;
AffAigND:=CheckBoxMsgAigInc.checked;
AvecInitAiguillages:=CheckBoxInitAig.Checked;
@@ -6844,6 +6906,7 @@ begin
end;
end;
// déploye tout le treeview courant
Procedure tout_deployer;
var i : integer;
begin
@@ -6860,7 +6923,7 @@ var n,niveau,niveauPrec,j,i,idVar,typ : integer;
node,nodePrec : Ttreenode;
s : string;
begin
if (k=0) or (k>NbreFL) then exit;
if (k<1) or (k>NbreFL) then exit;
formConfig.TreeViewL.Items.Clear;
nodePrec:=formConfig.TreeViewL.Items.add(nil,texte_tv(k,0)); // Node origine
// niv 0
@@ -6914,6 +6977,7 @@ begin
formconfig.ButtonAjOpEnfant.enabled:=false;
end;
// si pas trouvé renvoie -1
function trouve_index_style : integer;
var i : integer;
trouve : boolean;
@@ -8264,7 +8328,9 @@ begin
ComboStyle.Items.Add(Style[i].NomStyle);
end;
ComboStyle.ItemIndex:=trouve_index_style;
i:=trouve_index_style;
if i=-1 then i:=0;
ComboStyle.ItemIndex:=i;
CheckBoxSombre.Visible:=false;
ButtonCouleur.Visible:=false;
@@ -11934,17 +12000,17 @@ begin
end;
end;
if isAigTCO(i) then
if IsAigTJDCroiTCO(i) then
begin
adr:=TCO[indexTCO,x,y].adresse;
if (index_aig(adr)=0) and (adr<>0) then
begin
Affiche('Un aiguillage '+IntToSTR(adr)+' est déclaré dans le TCO'+intToSTR(indexTCO)+' ['+intToSTR(x)+','+intToSTR(y)+'] mais absent de la configuration',clred);
ok:=false;
end;
end;
if (i=1) or (i=6) or (i=7) or (i=8) or (i=9) or (i=16) or (i=17) or (i=18) or (i=19) or (i=20) or (i=10) or (i=11) then
// élément de voie linéaire
if (i=1) or (i=6) or (i=7) or (i=8) or (i=9) or (i=10) or (i=11) or (i=16) or (i=17) or (i=18) or (i=19) or (i=20) then
begin
adr:=TCO[indexTCO,x,y].adresse;
if adr<>0 then
@@ -12063,8 +12129,6 @@ begin
val(copy(portcom,i+1,j-i),vitesse,l);
if (protocole=2) and (vitesse<>115200) then Affiche('La vitesse COM/USB en procotole DCC++ doit être de 115200 bauds',clred);
// si xpressnet, pas d'accesoires interférant avec les détecteurs
AdrOk:=True;
if Verif_AdrXpressNet=1 then
@@ -14024,7 +14088,6 @@ begin
LabeledEditCV3.Text:='';
LabeledEditCV4.Text:='';
LabeledEditCrans.Text:='';
end;
// suppression
@@ -14145,6 +14208,7 @@ begin
clicListe:=false;
end;
// affiche l'état de la règle "nom" du parefeu du chemin du programme avec exe
procedure regle(nom,chemin : string);
var i : integer;
s : string;
@@ -14243,10 +14307,8 @@ begin
begin
RichCdeDccpp.SelectAll;
end;
end;
procedure TFormConfig.CheckBoxVersContrevoieClick(Sender: TObject);
var s : string;
begin
@@ -14904,7 +14966,6 @@ begin
end;
clicListe:=false;
end;
procedure TFormConfig.ListBoxPNMouseDown(Sender: TObject;
@@ -15529,7 +15590,6 @@ begin
Aff_champs_PN(lignecliqueePN+1);
config_modifie:=true;
end;
@@ -15990,6 +16050,8 @@ begin
CheckBoxServAct.checked:=Srvc_Act;
CheckServPosTrains.checked:=Srvc_Pos;
CheckBoxSrvSig.Checked:=Srvc_Sig;
CheckBoxSrvTdcc.Checked:=Srvc_tspd;
CheckBoxRazSignaux.checked:=Raz_Acc_signaux;
CheckBoxMsgAigInc.checked:=AffAigND;
@@ -17537,7 +17599,6 @@ begin
inode:=node.AbsoluteIndex;
Fnode:=node.ImageIndex;
// si le node est un opérateur ET OU NON
//if (Fnode>=OpET) and (Fnode<=OpNON) and (i>=OpET) and (i<=OpNON) then
if isOperateur(Fnode) and (isOperateur(i)) then
begin
fonction[foncCourante,inode].typ:=i;
@@ -17663,12 +17724,12 @@ begin
// s'assurer que le suivant est un node frère
if nodeA.GetNextSibling <> nil then
// si oui le descendre
// naAdd, naAddFirst, naAddChild, naAddChildFirst, naInsert
// naAdd The new or relocated node becomes the last sibling of the other node.
// naAddFirst The new or relocated node becomes the first sibling of the other node.
// naInsert The new or relocated node becomes the sibling immediately before the other node.
// naAddChild The new or relocated node becomes the last child of the other node.
// naAddChildFirst The new or relocated node becomes the first child of the other node. Non reconnu en D7
// naAdd, naAddFirst, naAddChild, naAddChildFirst, naInsert :
// naAdd Le nouveau node ou le node déplacé devient le dernier frère de lautre node.
// naAddFirst Le nouveau node ou le node déplacé devient le 1er frère de lautre node.
// naInsert Le nouveau node ou le node déplacé devient le node frère immédiatement avant l'autre node
// naAddChild Le nouveau node ou le node déplacé devient le dernier enfant de l'autre node.
// naAddChildFirst Le nouveau node ou le node déplacé devient le premier enfant de l'autre node. Non reconnu en D7
begin
nodeB:=nodeA.GetNextSibling;
{$IF CompilerVersion >= 28.0} // si delphi>=11
@@ -17711,7 +17772,6 @@ begin
fonction[foncCourante,idB].niveau:=TreeViewL.items[idB].Level+1;
// ajuster le parent
fonction[foncCourante,idB].Indexprec:=TreeViewL.items[idB].Parent.AbsoluteIndex;
end;
end;
@@ -17744,7 +17804,6 @@ begin
end;
end;
// trouve le parent d'un opérateur
procedure trouve_parent_OP(k,idNode : integer);
var j,niveau : integer;
@@ -17791,7 +17850,6 @@ begin
begin
if not(diffusion) then Affiche('Insersion en '+inttoSTR(inode),clyellow);
insersion(fonccourante,inode,node.level+1,opET);
end
else
begin // ajout en fin
@@ -17804,7 +17862,6 @@ begin
fonction[foncCourante,0].adresse:=TreeViewL.Items.Count;
trouve_parent_OP(FoncCOurante,inode);
end;
procedure supprime_fonction(n : integer);
@@ -17827,8 +17884,6 @@ begin
Affiche('Erreur de suppression',clred);
end;
// supprime un élément du treeview et de fonction[]
// la suppression peut changer les niveaux
procedure supprime_node;
@@ -17884,6 +17939,7 @@ begin
if fonction[foncCourante,0].adresse=0 then supprime_fonction(foncCourante);
end;
// supprime fonction logique;
procedure TFormConfig.ButtonSupLogClick(Sender: TObject);
begin
supprime_node;
@@ -17938,12 +17994,11 @@ begin
// remonter au niveau précédent pour trouver le parent
j:=iNode;
repeat
dec(j);
dec(j);
until (j=0) or (fonction[foncCourante,j].niveau+1=niveau);
fonction[foncCourante,iNode].Indexprec:=j;
fonction[foncCourante,0].adresse:=TreeViewL.Items.Count;
end;
procedure TFormConfig.ComboBoxOperateurDrawItem(Control: TWinControl;
@@ -17954,10 +18009,8 @@ begin
// Affiche l'image dans la comboboc
imagelistLogic.Draw(ComboBoxOperateur.Canvas,rect.left,rect.top,Index+1); //+1 car on commence à 1
if index=2 then
SetTextColor(Canvas.Handle, clBlack)
else
SetTextColor(Canvas.Handle, clGray);
if index=2 then SetTextColor(Canvas.Handle, clBlack)
else SetTextColor(Canvas.Handle, clGray);
// écrit le texte
ComboBoxOperateur.canvas.textout(rect.left+imagelistLogic.width+2,rect.top,
@@ -17965,7 +18018,6 @@ begin
end;
// Nouvelle fonction
procedure TFormConfig.ButtonNouvFLClick(Sender: TObject);
begin
@@ -17983,15 +18035,12 @@ begin
ButtonAjOpEnfant.enabled:=false;
ButtonAjoutevar.enabled:=false;
treeViewL.items.Clear;
TreeViewL.Items.add(nil,texte_tv(foncCourante,0));
LabeledEditNumFonc.Text:=intToSTR(fonction[FoncCourante,0].niveau);
end;
procedure ComboBoxFL_mizajour;
var i : integer;
begin
@@ -18069,8 +18118,6 @@ begin
end;
exit;
end;
end;
// donne le suivant de même niveau de même index précédent
@@ -18087,7 +18134,6 @@ begin
until trouve or (i>=n-1);
if trouve then result:=i else result:=-1;
end;
// évalue en récursif une branche d'opérateur de fonction
@@ -18113,7 +18159,6 @@ begin
if compteur=0 then
begin
resultat:=etat_variable(k,i);
//if (typOP=opNonET) or (typOP=opNonOU) then resultat:=not(resultat); // inversion en cas d'une seule variable
end
else // ************1er état de la variable
begin
@@ -18140,7 +18185,14 @@ begin
niv:=fonction[k,i].niveau;
end;
// on sort car on vient de rencontrer un niveau différent
if (compteur=1) and ((typOP=opNonET) or (typOP=opNonOU)) then resultat:=not(resultat); // inversion en cas d'une seule variable
{if (compteur=1) and ((typOP=opNonET) or (typOP=opNonOU)) then
begin
resultat:=not(resultat); // inversion en cas d'une seule variable
if debugFonction then
begin
if resultat then affiche('inversion R=1',clOrange) else affiche('inversion R=0',clOrange);
end;
end; }
if niv<niveau then
begin
@@ -18160,7 +18212,7 @@ begin
fonction[k,i].traite:=true;
inc(i);
resultatOP:=evalue_operateur(k,i,0,formule); //***********************
resultatOP:=evalue_operateur(k,i,0,formule); //entrée récursive ***********************
dec(i);
if debugFonction then
@@ -18173,13 +18225,16 @@ begin
typ:=fonction[k,parent].typ;
if compteur=0 then resultat:=resultatOP else
begin
if debugfonction then Affiche('Passage0 1 variable',clWhite);
if typ=opET then resultat:=resultat and resultatOP;
if typ=opOU then resultat:=resultat or resultatOP;
if typOP=opNonEt then resultat:=not(resultat and resultatOP);
if typOP=opNonOu then resultat:=not(resultat or resultatOP);
end;
inc(compteur);
if debugFonction then
begin
if resultat then s:=s+'résultat chainé R= 1' else s:=s+'résultat chainé R= 0';
if resultat then s:=s+'résultat chainé R=1' else s:=s+'résultat chainé R=0';
Affiche(s,clYellow);
end;
@@ -18242,6 +18297,12 @@ begin
// Affiche(s+vf,clLime);
LabelFonction.caption:=formule+' = '+vf;
//affiche(formule,clorange);
{ a:=aiguillage[1].position=const_devie;
b:=aiguillage[2].position=const_devie;
r:=not(a and not(b and b));
if r then Affiche('oui',clYellow) else affiche('non',clYellow); }
end;
// menu
@@ -18392,7 +18453,6 @@ begin
15 : begin
boolean(p^):=s=lowercase(liste[Arow].textePL1); // PilotageTrainsCDMNom
end;
17 : begin
//AffSig:=s=lowercase(oui);
boolean(p^):=s=lowercase(liste[Arow].textePL1);
@@ -18438,7 +18498,6 @@ begin
ValueListEditor.hint:=Liste[y].aide;
end;
procedure TFormConfig.RadioGroupOPClick(Sender: TObject);
var node : tTreeNode;
i : integer;
@@ -18503,7 +18562,6 @@ begin
end;
procedure TFormConfig.ButtonlCV3Click(Sender: TObject);
var valeur : integer;
begin
@@ -18756,18 +18814,29 @@ begin
end;
procedure TFormConfig.ComboBoxUSBTrChange(Sender: TObject);
var i : integer;
var i,j : integer;
s,sb : string;
begin
i:=ComboBoxUSBTr.ItemIndex;
sb:='Bloc USB '+intToSTR(NumBlocUSB);
for j:=1 to ntrains do
begin
if labelBlocUSB[j].Caption=sb then labelBlocUSB[j].Caption:=''; // libère l'affectation
end;
if i=0 then
begin
blocUSB[NumBlocUSB].AffTrain:='Pas d''affectation';
Label72.Caption:='La sélection du train est celle de la page principale';
LabelBlocUSB[i].caption:='';
end
else
begin
blocUSB[NumBlocUSB].AffTrain:=trains[i].nom_train;
s:=trains[i].nom_train;
blocUSB[NumBlocUSB].AffTrain:=s;
Label72.Caption:=trains[i].nom_train+' sélectionné pour le bloc USB '+intToSTR(NumBlocUSB);
LabelBlocUSB[i].caption:=sb;
end;
end;
@@ -18775,7 +18844,7 @@ procedure TFormConfig.LabeledEditFnChange(Sender: TObject);
var i,erreur :integer;
begin
val(LabeledEditFn.Text,i,erreur);
if (erreur<>0) or (i<0) or (i>30) then exit;
if (erreur<>0) or (i<0) or (i>1) then exit;
case boutonbloc of
1 : blocUSB[NumBlocUSB].Fnp1:=i;
2 : blocUSB[NumBlocUSB].Fnp2:=i;
+164 -33
View File
@@ -643,7 +643,7 @@ object FormConfCellTCO: TFormConfCellTCO
Top = 24
Width = 281
Height = 121
Caption = 'Options d'#39'arr'#234't des trains sur le d'#233'tecteur'
Caption = 'Visu options d'#39'arr'#234't des trains sur le d'#233'tecteur'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -12
@@ -662,8 +662,8 @@ object FormConfCellTCO: TFormConfCellTCO
object ImageListIcones: TImageList
Left = 160
Bitmap = {
494C010121002200040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
0000000000003600000028000000400000009000000001002000000000000090
494C010122002700040010001000FFFFFFFFFF00FFFFFFFFFFFFFFFF424D3600
000000000000360000002800000040000000A0000000010020000000000000A0
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
@@ -728,67 +728,195 @@ object FormConfCellTCO: TFormConfCellTCO
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000045454500454545004545
4500454545004545450045454500454545004545450045454500454545004545
4500454545004545450045454500000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000454545004545
4500454545004545450045454500454545004545450045454500454545004545
4500454545004545450000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000045454500000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000045454500000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000045454500000000004545
4500454545004545450045454500454545004545450045454500454545004545
4500454545000000000045454500000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000045454500000000004545
4500FFFFFF00454545004545450045454500454545004545450045454500FFFF
FF00454545000000000045454500000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000045454500000000004545
4500FFFFFF00454545004545450045454500454545004545450045454500FFFF
FF00454545000000000045454500000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000045454500000000004545
450045454500FFFFFF0045454500454545004545450045454500FFFFFF004545
4500454545000000000045454500000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000080E0000080E0000080E0000080
E0000080E0000080E0000080E0000080E0000080E0000080E0000080E0000080
E0000080E0000080E0000080E0000080E0000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
E0000080E0000080E0000080E0000080E0000000000045454500000000004545
450045454500FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF004545
4500454545000000000045454500000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000080E0000080E0000080E0000080
E0000080E0000080E0000080E00000000000000000000080E0000080E0000080
E0000080E0000080E0000080E0000080E0000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
E0000080E0000080E0000080E0000080E0000000000045454500000000004545
45004545450045454500FFFFFF004545450045454500FFFFFF00454545004545
4500454545000000000045454500000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000080E0000080E0000080E0000080
E0000080E0000080E00000000000000000000080E0000080E0000080E0000080
E0000080E0000080E0000080E0000080E0000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
E0000080E0000080E0000080E0000080E0000000000045454500000000004545
45004545450045454500FFFFFF004545450045454500FFFFFF00454545004545
4500454545000000000045454500000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000080E0000080E0000080E0000080
E0000080E00000000000000000000080E0000080E0000080E0000080E0000080
E0000080E0000080E0000080E0000080E0000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
E0000080E0000080E0000080E0000080E0000000000045454500000000004545
45004545450045454500FFFFFF004545450045454500FFFFFF00454545004545
4500454545000000000045454500000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000080E0000080E0000080E0000080
E00000000000000000000080E0000080E0000080E0000080E0000080E0000080
E0000080E0000080E0000080E0000080E0000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
E0000080E0000080E0000080E0000080E0000000000045454500000000004545
4500454545004545450045454500FFFFFF00FFFFFF0045454500454545004545
4500454545000000000045454500000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000080E0000080E0000080E0000080
E0000080E00000000000000000000080E0000080E0000080E0000080E0000080
E0000080E0000080E0000080E0000080E0000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
E0000080E0000080E0000080E0000080E000FFFFFF0000000000000000004545
4500454545004545450045454500FFFFFF00FFFFFF0045454500454545004545
4500454545000000000000000000FFFFFF000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000080E0000080E0000080E0000080
E0000080E0000080E00000000000000000000080E0000080E0000080E0000080
E0000080E0000080E0000080E0000080E0000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
E0000080E0000080E0000080E0000080E000FFFFFF00FFFFFF00000000004545
4500454545004545450045454500454545004545450045454500454545004545
45004545450000000000FFFFFF00FFFFFF000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000080E0000080E0000080E0000080
E0000080E0000080E0000080E00000000000000000000080E0000080E0000080
E0000080E0000080E0000080E0000080E0000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
E0000080E0000080E0000080E0000080E000FFFFFF00FFFFFF00000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000FFFFFF00FFFFFF000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
@@ -1817,12 +1945,16 @@ object FormConfCellTCO: TFormConfCellTCO
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080000080800000808000008080
0000808000008080000080800000808000008080000080800000808000008080
000080800000808000008080000080800000424D3E000000000000003E000000
2800000040000000900000000100010000000000800400000000000000000000
000000000000000000000000FFFFFF00FFFF000000000000742E000000000000
75EE000000000000546A00000000000025E4000000000000742E000000000000
FFFF000000000000FFFF00000000000000000000000000000000000000000000
2800000040000000A00000000100010000000000000500000000000000000000
000000000000000000000000FFFFFF0000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000FFFFFFFFFFFFFFFF742E742E742E742E
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000FFFFFFFF00000000742E800100000000
75EEC00300000000546ABFFD0000000025E4A00500000000742EA00500000000
FFFFA00500000000FFFFA005000000000000A005000000000000A00500000000
0000A005000000000000A005000000000000A005000000000000600600000000
000020040000000000003FFC00000000FFFFFFFFFFFFFFFF742E742E742E742E
75EE75EE75EE75EE546A546A546A546A25E425E425E425E4742E742E742E742E
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
@@ -1854,7 +1986,6 @@ object FormConfCellTCO: TFormConfCellTCO
000000000000F56F000000000000F56F000000000000F54F000000000000FB6F
000000000000FFFF000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000}
00000000000000000000000000000000}
end
end
+4 -3
View File
@@ -401,15 +401,16 @@ begin
formTCO[indexTCO].EditAdrElement.enabled:=true;
end;
Adr:=tco[indexTCO,XClicC,YClicC].Adresse;
With formConfCellTCO do
begin
GroupBoxOrientation.Visible:=false;
GroupBoxImplantation.Visible:=false;
GroupBoxCanton.Visible:=false;
GroupBoxDet.visible:=true;
if Adr<>0 then GroupBoxDet.visible:=true else GroupBoxDet.visible:=false;
GroupBoxAction.visible:=false;
end;
Adr:=tco[indexTCO,XClicC,YClicC].Adresse;
with formConfCellTCO.StringGridDet do
begin
@@ -623,7 +624,7 @@ begin
end;
// aiguillage ou TJD
if IsAigTCO(Bimage) then
if IsAigTJDCroiTCO(Bimage) then
formConfCellTCO.checkPinv.Enabled:=true
else formConfCellTCO.checkPinv.Enabled:=false;
+2 -2
View File
@@ -516,7 +516,7 @@ object FormModifAction: TFormModifAction
Top = 32
Width = 217
Height = 21
ItemHeight = 13
ItemHeight = 0
TabOrder = 0
OnChange = ComboBoxFamilleChange
end
@@ -720,7 +720,7 @@ object FormModifAction: TFormModifAction
Height = 21
Hint = 'Nom du p'#233'riph'#233'rique d'#233'fini dans l'#39'onglet "p'#233'riph'#233'riques COM/USB"'
Style = csDropDownList
ItemHeight = 13
ItemHeight = 0
ParentShowHint = False
ShowHint = True
TabOrder = 4
+26 -1
View File
@@ -213,7 +213,7 @@ begin
checkBoxRaz.Visible:=false;
GroupBoxParam.Visible:=true;
labelEtatOp.Visible:=false;
RichEditInf.clear;
//RichEditInf.clear;
ComboBoxAccComUSB.visible:=false;
end;
end;
@@ -250,6 +250,7 @@ begin
DeclArretTrain : icone:=IconeArretTrain;
DeclSignal : icone:=IconeSignal;
DeclFonction : icone:=IconeFonction;
DeclClavier : icone:=IconeBoutonClavier;
end;
ListBoxDeclench.Items.Add(Format('%d%s', [icone, declencheurs[i].nom])); // valeur d'index de l'icone dans la ImagelistIcones
ListBoxDeclench.itemHeight:=16;
@@ -416,6 +417,7 @@ begin
begin
s:=s+'Fonction logique '+intToSTR(tablo_action[i].adresse);
end;
DeclClavier : s:=s+'Touche du clavier et/ou bloc USB '+intToSTR(tablo_action[i].adresse);
end;
// conditions
@@ -502,6 +504,7 @@ begin
formModifAction.listBoxOperations.Selected[indexaction-1]:=true;
end;
// formModifAction.RichEditInf.clear;
efface_champs_operations;
if Nb>=indexAction then
@@ -694,6 +697,7 @@ begin
end;
FormModifAction.LabeledEditNomAct.Text:=Tablo_Action[index].NomAction;
FormModifAction.RichEditInf.Clear;
// ListBox opérations
@@ -958,6 +962,19 @@ begin
else LabelInfoFonc.Caption:='';
end;
DeclClavier :
begin
LabelAdresse.Visible:=true; // numéro de fonction
LabelAdresse.caption:='Code de touche';
ButtonFonction.Visible:=false;
EditAdr.Text:=IntToSTR(tablo_action[index].adresse);
EditAdr.Visible:=true;
ImageIcone.Picture:=nil;
formConfCellTCO.ImageListIcones.GetBitmap(IconeBoutonClavier,ImageIcone.Picture.Bitmap);
ImageIcone.repaint;
RichEditInf.Lines.Add('Déclenchement touche de clavier ou bloc usb');
end;
end;
// conditions
@@ -1278,6 +1295,14 @@ begin
if (i>23) then exit;
Tablo_Action[index].heure:=i;
end
else
if decl=DeclClavier then
begin
LabelHeure.Visible:=true;
if (i<0) or (i>255) then exit;
LabelHeure.Caption:=char(i);
Tablo_Action[index].adresse:=i;
end
else Tablo_Action[index].adresse:=i;
maj_combocactions(ligneclicAct);
end;
+1 -1
View File
@@ -33,7 +33,7 @@ var
s,fichier : string;
r : boolean;
begin
fichier:=CheminProgrammes+chemin; //'\CDM-Rail\cdr.exe';
fichier:=CheminProgrammes+chemin;
// Crée l'objet FwPolicy2
fwPolicy2:=CreateOleObject('HNetCfg.FwPolicy2');
+12122 -28
View File
File diff suppressed because it is too large Load Diff
+908 -317
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -120,7 +120,7 @@ begin
for y:=1 to NbreCellY[nti] do
for x:=1 to NbreCellX[nti] do
begin
if isAigTCO(tco[nti,x,y].BImage) then
if IsAigTJDCroiTCO(tco[nti,x,y].BImage) then
begin
affiche_cellule(nti,x,y);
// entoure_cell_grille(indexTCO,x,y);
+1 -21
View File
@@ -505,27 +505,7 @@ begin
position:=poMainFormCenter;
{
for i:=1 to 16 do
begin
ComboBoxAdr1.items.add('');
ComboBoxAdr2.items.add('');
ComboBoxAdr3.items.add('');
ComboBoxAdr4.items.add('');
ComboBoxAdr5.items.add('');
ComboBoxAdr6.items.add('');
ComboBoxAdr7.items.add('');
ComboBoxAdr8.items.add('');
ComboBoxAdr9.items.add('');
ComboBoxAdr10.items.add('');
ComboBoxAdr11.items.add('');
ComboBoxAdr12.items.add('');
ComboBoxAdr13.items.add('');
ComboBoxAdr14.items.add('');
ComboBoxAdr15.items.add('');
ComboBoxAdr16.items.add('');
}
for i:=0 to 19 do
begin
ComboBoxAdr1.items.add(etats[i]);
+8 -1
View File
@@ -1478,7 +1478,14 @@ object FormTCO: TFormTCO
Caption = 'Button1'
TabOrder = 9
Visible = False
OnClick = Button1Click
end
object Button2: TButton
Left = 848
Top = 96
Width = 75
Height = 25
Caption = 'Button2'
TabOrder = 10
end
end
object PopupMenu1: TPopupMenu
+80 -36
View File
@@ -166,6 +166,7 @@ type
ImageBt0Bistable: TImage;
ImageBt1Bistable: TImage;
Mmoiredezone1: TMenuItem;
Button2: TButton;
//TimerTCO: TTimer;
procedure FormCreate(Sender: TObject);
procedure FormActivate(Sender: TObject);
@@ -210,7 +211,6 @@ type
procedure MenuCollerClick(Sender: TObject);
procedure ButtonRedessineClick(Sender: TObject);
procedure EditAdrElementChange(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure ImagePalette10EndDrag(Sender, Target: TObject; X, Y: Integer);
procedure ImagePalette10MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
@@ -399,7 +399,6 @@ type
procedure ImagePalette53EndDrag(Sender, Target: TObject; X, Y: Integer);
procedure ImageTCOEndDrag(Sender, Target: TObject; X, Y: Integer);
procedure AffRoutesClick(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Optiondesroutes1Click(Sender: TObject);
procedure Trouverunlment1Click(Sender: TObject);
{ Déclarations privées }
@@ -674,7 +673,7 @@ procedure dessine_icones(indexTCO : integer);
procedure echange(var a,b : integer);
procedure Efface_Cellule(indextco : integer;Canvas : Tcanvas;x,y : integer;Mode : TPenMode);
procedure dessine_icone(indexTCO : integer;PCanvasTCO : tcanvas;Bimage,X,Y,mode : integer);
function IsAigTCO(i : integer) : boolean;
function IsAigTJDCroiTCO(i : integer) : boolean;
function index_TCO(t : Tobject) : integer;
procedure Init_TCO(indexTCO : integer);
procedure init_tampon_copiercoller;
@@ -1311,9 +1310,9 @@ begin
ok:=( (Bim=1) or (Bim=0) or ((Bim>=Id_cantonH) and (bim<=Id_cantonH+9)) or ((Bim>=Id_cantonV) and (bim<=Id_cantonV+9)));
ok:=ok and (x<canton[indexCanton].maxi); // empeche d'aller à droite
if not(ok) then begin
if not(ok) then
begin
result:=true;
//Affiche('Haaaa',clred);
exit;
end;
@@ -1427,7 +1426,7 @@ begin
repeat
inc(xc);
b:=tco[indextco,xc,yc].Bimage;
if isAigTCO(b) then tq:=aig else tq:=det;
if IsAigTJDCroiTCO(b) then tq:=aig else tq:=det;
if b=id_signal then tq:=sig;
if tco[indextco,xc,yc].buttoir<>0 then tq:=buttoir;
@@ -2804,7 +2803,7 @@ begin
end;
// renvoie vrai si l'élément i est un aiguillage ou une TJD/S ou un croisement
function IsAigTCO(i : integer) : boolean;
function IsAigTJDCroiTCO(i : integer) : boolean;
begin
result:=((i=2) or (i=3) or (i=4) or (i=5) or (i=12) or (i=13) or (i=14) or (i=15) or
((i>=21) and (i<=34) )) ;
@@ -7049,7 +7048,7 @@ begin
1 : couleur:=clLime;
2 : couleur:=clAqua;
end;
if bouton<=2 then cercle(PcanvasTCO[indexTCO],xCentre,ycentre,r,couleur)
if bouton<=2 then cercle(PcanvasTCO[indexTCO],xCentre,ycentre,r,couleur,couleur)
else
begin
if bouton=3 then
@@ -7099,6 +7098,11 @@ begin
offsetY:=(haut div 2)-(hautDest div 2)+1; // centrer l'icone au centre Y
sens:=canton[i].SensLoco;
if (sens<>SensGauche) and (sens<>SensDroit) and (sens<>0) then
begin
Sens:=SensGauche;
Affiche('Anomalie sens train canton '+intToSTR(canton[i].numero)+' incohérent ; repositionné à gauche',clOrange);
end;
case sens of
0,sensGauche : begin
xi:=x0+OffsetX;
@@ -7265,7 +7269,7 @@ begin
1 : couleur:=clLime;
2 : couleur:=ClAqua;
end;
if bouton<=2 then cercle(PcanvasTCO[indexTCO],xCentre,ycentre,r,couleur)
if bouton<=2 then cercle(PcanvasTCO[indexTCO],xCentre,ycentre,r,couleur,couleur)
else
begin
if bouton=3 then // drapeau vert
@@ -7328,6 +7332,11 @@ begin
end;
sens:=canton[i].SensLoco;
if (sens<>SensHaut) and (sens<>SensBas) and (sens<>0) then
begin
Sens:=SensHaut;
Affiche('Anomalie sens train canton '+intToSTR(canton[i].numero)+' incohérent ; repositionné en haut',clOrange);
end;
case sens of
0,sensHaut : begin
yi:=y0+10;
@@ -7360,7 +7369,7 @@ begin
Canton[i].Licone:=LargDest;
Canton[i].Hicone:=HautDest;
if canton[i].SensLoco=SensHaut then
if sens=SensHaut then
begin
with FormTCO[indexTCO].ImageTemp2.Canvas do
begin
@@ -7420,7 +7429,7 @@ begin
end
else
begin
// bas
// Sens loco bas
// matrice de copie à 90°G sans mise à l'échelle dans l'image provisoire
p[0].X:=HautSrc; //90;
p[0].Y:=0; //0;
@@ -11344,7 +11353,7 @@ begin
s:=format('%d',[adresse]);
// affiche le texte des aiguillages
if IsAigTCO(Bimage) and (adresse<>0) then
if IsAigTJDCroiTCO(Bimage) and (adresse<>0) then
begin
if adresse<>0 then s:='A'+s+' ' else s:=' ';
with PCanvasTCO[indexTCO] do
@@ -12075,7 +12084,7 @@ begin
x:=Trace_Train[t].train[train].route[i].x;
y:=Trace_Train[t].train[train].route[i].y;
Bimage:=tco[t,x,y].BImage;
trouve:=isAigTCO(Bimage);
trouve:=IsAigTJDCroiTCO(Bimage);
dec(i);
until trouve or (i=0);
@@ -13827,13 +13836,13 @@ begin
begin
MemTrouve:=true;
Xcanton:=adresse;
if isAigTCO(Bimage) then Tel1:=aig else tel1:=det;
if IsAigTJDCroiTCO(Bimage) then Tel1:=aig else tel1:=det;
if but<>0 then tel1:=Buttoir;
end;
if ((mode=12) or (mode=13)) and (adresse<>det1) then
begin
Xcanton:=adresse;
if isAigTCO(Bimage) then Tel1:=aig else tel1:=det;
if IsAigTJDCroiTCO(Bimage) then Tel1:=aig else tel1:=det;
Memtrouve:=true;
end;
@@ -14350,6 +14359,14 @@ procedure supprime_remplace_canton(index : integer);
var el,i,n,xc,yc,idT : integer;
begin
if (index<1) or (index>ncantons) then exit;
// désaffecter le train du canton
i:=canton[index].indexTrain;
if i<>0 then
begin
affecte_Train_canton(0,index,0);
end;
n:=canton[index].Nelements;
xc:=canton[index].x;
yc:=canton[index].y;
@@ -16701,7 +16718,7 @@ begin
ImageTCO.Hint:=s;
end
else
if IsAigTCO(Bimage) then
if IsAigTJDCroiTCO(Bimage) then
begin
adresse:=tco[IndexTCO,xClic,yClic].Adresse;
if adresse=0 then s:='Aiguillage sans adresse'
@@ -17166,7 +17183,7 @@ begin
for y:=1 to NbreCellY[indexTCO] do
for x:=1 to NbreCellX[indexTCO] do
begin
if IsAigTCO(tco[indextco,x,y].Bimage) then
if IsAigTJDCroiTCO(tco[indextco,x,y].Bimage) then
begin
affiche_cellule(indexTCO,x,y);
end;
@@ -17186,23 +17203,16 @@ begin
for x:=1 to NbreCellX[ntco] do
begin
Bim:=TCO[ntco,x,y].Bimage;
//if IsAigTCO(Bim) then
if TCO[ntco,x,y].Adresse=adresse then
begin
if TCO[ntco,x,y].Adresse=adresse then
begin
affiche_cellule(ntco,x,y);
end;
affiche_cellule(ntco,x,y);
end;
end;
end;
end;
end;
procedure TFormTCO.Button2Click(Sender: TObject);
begin
Detecteur[569].etat:=false;
Maj_tco(index_TCO(sender),569);
end;
procedure TFormTCO.ImagePalette10EndDrag(Sender, Target: TObject; X, Y: Integer);
begin
@@ -17584,7 +17594,7 @@ begin
indexTCO:=index_TCO(sender);
if (xClicCell[indexTCO]=0) or (xClicCell[indexTCO]>NbreCellX[indexTCO]) or (yClicCell[indexTCO]=0) or (yClicCell[indexTCO]>NbreCelly[indexTCO]) then exit;
Bimage:=tco[indextco,xClicCell[indexTCO],yClicCell[indexTCO]].Bimage;
if IsAIgTCO(Bimage) then
if IsAigTJDCroiTCO(Bimage) then
begin
tco[indextco,xClicCell[indexTCO],yClicCell[indexTCO]].inverse:=CheckPinv.checked;
TCO_modifie:=true;
@@ -17642,7 +17652,7 @@ begin
end;
// commande aiguillage
if isAigTCO(Bimage) or TJDc then
if IsAigTJDCroiTCO(Bimage) or TJDc then
begin
aiguille:=Adresse;
i:=Index_aig(Adresse);
@@ -18939,7 +18949,6 @@ begin
supprime_remplace_canton(index);
tco_modifie:=true;
Affiche_tco(indexTCO);
end;
procedure TFormTCO.Affecterlocomotiveaucanton1Click(Sender: TObject);
@@ -19184,14 +19193,49 @@ begin
end;
end;
procedure TFormTCO.Button1Click(Sender: TObject);
begin
zone_tco(1,523,518,1,0,1,false,false);
end;
procedure TFormTCO.Optiondesroutes1Click(Sender: TObject);
var GMode,l2,h2 : integer;
XFormScale,XFormRot,XFormOld,XFormXLat,xform : TXForm;
angle,Zoom : single;
recta : trect;
begin
formRoute.Show;
{ angle:=5;
Zoom:=2;
l2:=trains[1].icone.picture.width div 2;
h2:=trains[1].icone.picture.height div 2;
GMode:=SetGraphicsMode(PCanvasTCO[1].Handle, GM_ADVANCED);
if GetWorldTransform(PCanvasTCO[1].Handle, XFormOld) then // renvoie la matrice courante dans XformOld
begin
// faire les 3 transformations
XFormRot:=XForm_Rotation(Angle,Point(l2,h2)); // rotation autour du centre
XFormScale:=XForm_Echelle(Zoom,Zoom,point(l2,h2)); // Zoom au point central
XFormXLat:=XForm_Translation(x-l2,y-h2); // décalage
// Combiner les 3 transformations
CombineTransform(XForm,XFormRot,XFormScale); // Xform<-- f(XformRot,XformScale)
CombineTransform(XForm,XForm,XFormXLat); // Xform<-- f(Xform,XformScale)
if not(premaff) then recta:=rect(trains[1].x0,trains[1].y0,trains[1].x1,trains[1].y1);
premaff:=false;
PCanvasTCO[1].CopyRect(recta,trains[1].SBitmap.canvas,rect(0,0,trains[1].x1-trains[1].x0,trains[1].y1-trains[1].y0)); // copie dans Acanvas <-- SbitMap.canvas
// sauvegarder à la nouvelle position avant d'afficher la nouvelle position
recta:=rect(x0,y0,x1,y1);
trains[IndexTrain].sbitmap.canvas.CopyRect(rect(0,0,larg,haut),Acanvas,recta); // copie dans sbitmap.canvas <-- Acanvas
//FormAnalyseCDM.Image1.Canvas.CopyRect(rect(0,0,larg,haut),Acanvas,recta );
trains[IndexTrain].x0:=x0;
trains[IndexTrain].y0:=y0;
trains[IndexTrain].x1:=x1;
trains[IndexTrain].y1:=y1;
// appliquer les transformations dans le canvas et afficher l'icône du train
SetWorldTransform(ACanvas.Handle,XForm); // mettre dans le canvas
ACanvas.Draw(0,0,FWICImage); // afficher le bitmap
SetWorldTransform(ACanvas.Handle,XFormOld);
end; }
end;
procedure TFormTCO.Trouverunlment1Click(Sender: TObject);
+10 -9
View File
@@ -275,6 +275,14 @@ begin
canton[Idcanton].indexTrain:=9999;
canton[IdCanton].adresseTrain:=0;
end;
// affecte le canton avec l'id du train, même si nul
t:=canton[IdCanton].Ntco;
if (t>0) and (t<=nbreTCO) then
begin
TCO[t,canton[idCanton].x,canton[idCanton].y].train:=idTrain;
end;
if AdrTrain=0 then
begin
idTrain:=0;
@@ -284,26 +292,19 @@ begin
// a revoir IDTrain=0 !!!! Maj_icone_train(Image_Train[idTrain],idTrain,clWhite);
end;
// affecte le canton avec l'id du train, même si nul
t:=canton[IdCanton].Ntco;
if (t>0) and (t<=nbreTCO) then
begin
TCO[t,canton[idCanton].x,canton[idCanton].y].train:=idTrain;
end;
// si l'un des deux éléments adjacents au canton est un détecteur à 1, affecter la loco au détecteur
el1:=canton[IdCanton].el1;t1:=canton[IdCanton].typ1;
el2:=canton[IdCanton].el2;t2:=canton[IdCanton].typ2;
if (t1=det) and detecteur[el1].Etat then
begin
detecteur[el1].AdrTrain:=AdrTrain;
detecteur[el1].Train:=trains[idTrain].nom_train;
if idTrain<>0 then detecteur[el1].Train:=trains[idTrain].nom_train;
Maj_detecteurs_canton(idCanton,AdrTrain,el1);
end;
if (t2=det) and detecteur[el2].Etat then
begin
detecteur[el2].AdrTrain:=AdrTrain;
detecteur[el2].Train:=trains[idTrain].nom_train;
if idTrain<>0 then detecteur[el2].Train:=trains[idTrain].nom_train;
Maj_detecteurs_canton(idCanton,AdrTrain,el2);
end;
end;
+2 -3
View File
@@ -26,7 +26,7 @@ var
f : text;
Const
VersionSC = '9.8'; // sert à la comparaison de la version publiée
VersionSC = '10.0'; // sert à la comparaison de la version publiée
SousVersion=' '; // A B C ... en cas d'absence de sous version mettre un espace
// pour unzip
SHCONTCH_NOPROGRESSBOX=4;
@@ -178,7 +178,6 @@ var
shellobj,srcfldr, destfldr, shellfldritems,repertoire: Olevariant;
filtre: string;
i : integer;
erreur : integer;
begin
result:=false;
filtre:='';
@@ -294,7 +293,7 @@ function verifie_version : real;
var description,s,s2,s3,Version_p,Url,LocalFile,nomfichier,date_creation_ang : string;
faire,trouve_version,trouve_zip,zone_comm,LocZip : boolean;
fichier : text;
i,j,erreur,Ncomm,i2,l : integer;
i,j,Ncomm,i2,l : integer;
V_utile,V_publie : real;
SV_publie : char;
taille : longint;
+4
View File
@@ -312,6 +312,10 @@ version 9.77 : Am
version 9.78 : Correction du déclencheur "démarrage train"
version 9.79 : Corrections et améliorations diverses.
version 9.8 : Intégration des claviers et boutons rotatifs USB
version 9.9 : Correction évalution fonctions logiques sur opérateur NONET NONOU
version 10.0 : Création de 3 compteurs de vitesse de trains utilisables en mode autonome ou CDM.
Création de déclencheurs depuis appui sur touches de clavier ou blocs USB.