diff --git a/MSCommLib_TLB.dcu b/MSCommLib_TLB.dcu new file mode 100644 index 0000000..dd6f44c Binary files /dev/null and b/MSCommLib_TLB.dcu differ diff --git a/MSCommLib_TLB.pas b/MSCommLib_TLB.pas new file mode 100644 index 0000000..60dc90f --- /dev/null +++ b/MSCommLib_TLB.pas @@ -0,0 +1,443 @@ +unit MSCommLib_TLB; + +// ************************************************************************ // +// AVERTISSEMENT +// ------- +// Les types déclarés dans ce fichier ont été générés à partir de données lues +// depuis la bibliothèque de types. Si cette dernière (via une autre bibliothèque de types +// s'y référant) est explicitement ou indirectement ré-importée, ou la commande "Rafraîchir" +// de l'éditeur de bibliothèque de types est activée lors de la modification de la bibliothèque +// de types, le contenu de ce fichier sera régénéré et toutes les modifications +// manuellement apportées seront perdues. +// ************************************************************************ // + +// PASTLWTR : 1.2 +// Fichier généré le 04/03/2024 11:09:38 depuis la bibliothèque de types ci-dessous. + +// ************************************************************************ // +// Bibl. types : C:\Windows\SysWow64\mscomm32.ocx (1) +// LIBID: {648A5603-2C6E-101B-82B6-000000000014} +// LCID: 0 +// Fichier d'aide : C:\Windows\SysWow64\COMM98.CHM +// Chaîne d'aide : Microsoft Comm Control 6.0 +// DepndLst: +// (1) v2.0 stdole, (C:\Windows\SysWOW64\stdole2.tlb) +// ************************************************************************ // +{$TYPEDADDRESS OFF} // L'unité doit être compilée sans pointeur à type contrôlé. +{$WARN SYMBOL_PLATFORM OFF} +{$WRITEABLECONST ON} +{$VARPROPSETTER ON} +interface + +uses Windows, ActiveX, Classes, Graphics, OleCtrls, OleServer, StdVCL, Variants; + +// *********************************************************************// +// GUIDS déclarés dans la bibliothèque de types. Préfixes utilisés : +// Bibliothèques de types : LIBID_xxxx +// CoClasses : CLASS_xxxx +// DISPInterfaces : DIID_xxxx +// Non-DISP interfaces : IID_xxxx +// *********************************************************************// +const + // Versions majeure et mineure de la bibliothèque de types + MSCommLibMajorVersion = 1; + MSCommLibMinorVersion = 1; + + LIBID_MSCommLib: TGUID = '{648A5603-2C6E-101B-82B6-000000000014}'; + + IID_IMSComm: TGUID = '{E6E17E90-DF38-11CF-8E74-00A0C90F26F8}'; + DIID_DMSCommEvents: TGUID = '{648A5602-2C6E-101B-82B6-000000000014}'; + CLASS_MSComm: TGUID = '{648A5600-2C6E-101B-82B6-000000000014}'; + +// *********************************************************************// +// Déclaration d'énumérations définies dans la bibliothèque de types +// *********************************************************************// +// Constantes pour enum HandshakingConstants +type + HandshakingConstants = TOleEnum; +const + NoHandshaking = $00000000; + XonXoff = $00000001; + RtsCts = $00000002; + XonXoffAndRtsCts = $00000003; + +// Constantes pour enum HandshakeConstants +type + HandshakeConstants = TOleEnum; +const + comNone = $00000000; + comXOnXoff = $00000001; + comRTS = $00000002; + comRTSXOnXOff = $00000003; + +// Constantes pour enum ErrorConstants +type + ErrorConstants = TOleEnum; +const + comInvalidPropertyValue = $0000017C; + comGetNotSupported = $0000018A; + comSetNotSupported = $0000017F; + comPortInvalid = $00001F42; + comPortAlreadyOpen = $00001F45; + comPortOpen = $00001F40; + comNoOpen = $00001F4C; + comSetCommStateFailed = $00001F4F; + comPortNotOpen = $00001F52; + comReadError = $00001F54; + comDCBError = $00001F55; + comBreak = $000003E9; + comCTSTO = $000003EA; + comDSRTO = $000003EB; + comFrame = $000003EC; + comOverrun = $000003EE; + comCDTO = $000003EF; + comRxOver = $000003F0; + comRxParity = $000003F1; + comTxFull = $000003F2; + comDCB = $000003F3; + +// Constantes pour enum CommEventConstants +type + CommEventConstants = TOleEnum; +const + comEventBreak = $000003E9; + comEventCTSTO = $000003EA; + comEventDSRTO = $000003EB; + comEventFrame = $000003EC; + comEventOverrun = $000003EE; + comEventCDTO = $000003EF; + comEventRxOver = $000003F0; + comEventRxParity = $000003F1; + comEventTxFull = $000003F2; + comEventDCB = $000003F3; + +// Constantes pour enum OnCommConstants +type + OnCommConstants = TOleEnum; +const + comEvSend = $00000001; + comEvReceive = $00000002; + comEvCTS = $00000003; + comEvDSR = $00000004; + comEvCD = $00000005; + comEvRing = $00000006; + comEvEOF = $00000007; + +// Constantes pour enum InputModeConstants +type + InputModeConstants = TOleEnum; +const + comInputModeText = $00000000; + comInputModeBinary = $00000001; + +type + +// *********************************************************************// +// Déclaration Forward des types définis dans la bibliothèque de types +// *********************************************************************// + IMSComm = interface; + IMSCommDisp = dispinterface; + DMSCommEvents = dispinterface; + +// *********************************************************************// +// Déclaration de CoClasses définies dans la bibliothèque de types +// (REMARQUE: On affecte chaque CoClasse à son Interface par défaut) +// *********************************************************************// + MSComm = IMSComm; + + +// *********************************************************************// +// Interface : IMSComm +// Indicateurs : (4560) Hidden Dual NonExtensible OleAutomation Dispatchable +// GUID : {E6E17E90-DF38-11CF-8E74-00A0C90F26F8} +// *********************************************************************// + IMSComm = interface(IDispatch) + ['{E6E17E90-DF38-11CF-8E74-00A0C90F26F8}'] + procedure Set_CDHolding(pfCDHolding: WordBool); safecall; + function Get_CDHolding: WordBool; safecall; + procedure Set_CDTimeout(plCDTimeout: Integer); safecall; + function Get_CDTimeout: Integer; safecall; + procedure Set_CommID(plCommID: Integer); safecall; + function Get_CommID: Integer; safecall; + procedure Set_CommPort(psCommPort: Smallint); safecall; + function Get_CommPort: Smallint; safecall; + procedure Set__CommPort(psCommPort: Smallint); safecall; + function Get__CommPort: Smallint; safecall; + procedure Set_CTSHolding(pfCTSHolding: WordBool); safecall; + function Get_CTSHolding: WordBool; safecall; + procedure Set_CTSTimeout(plCTSTimeout: Integer); safecall; + function Get_CTSTimeout: Integer; safecall; + procedure Set_DSRHolding(pfDSRHolding: WordBool); safecall; + function Get_DSRHolding: WordBool; safecall; + procedure Set_DSRTimeout(plDSRTimeout: Integer); safecall; + function Get_DSRTimeout: Integer; safecall; + procedure Set_DTREnable(pfDTREnable: WordBool); safecall; + function Get_DTREnable: WordBool; safecall; + procedure Set_Handshaking(phandshake: HandshakeConstants); safecall; + function Get_Handshaking: HandshakeConstants; safecall; + procedure Set_InBufferSize(psInBufferSize: Smallint); safecall; + function Get_InBufferSize: Smallint; safecall; + procedure Set_InBufferCount(psInBufferCount: Smallint); safecall; + function Get_InBufferCount: Smallint; safecall; + procedure Set_Break(pfBreak: WordBool); safecall; + function Get_Break: WordBool; safecall; + procedure Set_InputLen(psInputLen: Smallint); safecall; + function Get_InputLen: Smallint; safecall; + procedure Set_Interval(plInterval: Integer); safecall; + function Get_Interval: Integer; safecall; + procedure Set_NullDiscard(pfNullDiscard: WordBool); safecall; + function Get_NullDiscard: WordBool; safecall; + procedure Set_OutBufferSize(psOutBufferSize: Smallint); safecall; + function Get_OutBufferSize: Smallint; safecall; + procedure Set_OutBufferCount(psOutBufferCount: Smallint); safecall; + function Get_OutBufferCount: Smallint; safecall; + procedure Set_ParityReplace(const pbstrParityReplace: WideString); safecall; + function Get_ParityReplace: WideString; safecall; + procedure Set_PortOpen(pfPortOpen: WordBool); safecall; + function Get_PortOpen: WordBool; safecall; + procedure Set_RThreshold(psRThreshold: Smallint); safecall; + function Get_RThreshold: Smallint; safecall; + procedure Set_RTSEnable(pfRTSEnable: WordBool); safecall; + function Get_RTSEnable: WordBool; safecall; + procedure Set_Settings(const pbstrSettings: WideString); safecall; + function Get_Settings: WideString; safecall; + procedure Set_SThreshold(psSThreshold: Smallint); safecall; + function Get_SThreshold: Smallint; safecall; + procedure Set_Output(pvarOutput: OleVariant); safecall; + function Get_Output: OleVariant; safecall; + procedure Set_Input(pvarInput: OleVariant); safecall; + function Get_Input: OleVariant; safecall; + procedure Set_CommEvent(psCommEvent: Smallint); safecall; + function Get_CommEvent: Smallint; safecall; + procedure Set_EOFEnable(pfEOFEnable: WordBool); safecall; + function Get_EOFEnable: WordBool; safecall; + procedure Set_InputMode(InputMode: InputModeConstants); safecall; + function Get_InputMode: InputModeConstants; safecall; + procedure AboutBox; stdcall; + property CDHolding: WordBool read Get_CDHolding write Set_CDHolding; + property CDTimeout: Integer read Get_CDTimeout write Set_CDTimeout; + property CommID: Integer read Get_CommID write Set_CommID; + property CommPort: Smallint read Get_CommPort write Set_CommPort; + property _CommPort: Smallint read Get__CommPort write Set__CommPort; + property CTSHolding: WordBool read Get_CTSHolding write Set_CTSHolding; + property CTSTimeout: Integer read Get_CTSTimeout write Set_CTSTimeout; + property DSRHolding: WordBool read Get_DSRHolding write Set_DSRHolding; + property DSRTimeout: Integer read Get_DSRTimeout write Set_DSRTimeout; + property DTREnable: WordBool read Get_DTREnable write Set_DTREnable; + property Handshaking: HandshakeConstants read Get_Handshaking write Set_Handshaking; + property InBufferSize: Smallint read Get_InBufferSize write Set_InBufferSize; + property InBufferCount: Smallint read Get_InBufferCount write Set_InBufferCount; + property Break: WordBool read Get_Break write Set_Break; + property InputLen: Smallint read Get_InputLen write Set_InputLen; + property Interval: Integer read Get_Interval write Set_Interval; + property NullDiscard: WordBool read Get_NullDiscard write Set_NullDiscard; + property OutBufferSize: Smallint read Get_OutBufferSize write Set_OutBufferSize; + property OutBufferCount: Smallint read Get_OutBufferCount write Set_OutBufferCount; + property ParityReplace: WideString read Get_ParityReplace write Set_ParityReplace; + property PortOpen: WordBool read Get_PortOpen write Set_PortOpen; + property RThreshold: Smallint read Get_RThreshold write Set_RThreshold; + property RTSEnable: WordBool read Get_RTSEnable write Set_RTSEnable; + property Settings: WideString read Get_Settings write Set_Settings; + property SThreshold: Smallint read Get_SThreshold write Set_SThreshold; + property Output: OleVariant read Get_Output write Set_Output; + property Input: OleVariant read Get_Input write Set_Input; + property CommEvent: Smallint read Get_CommEvent write Set_CommEvent; + property EOFEnable: WordBool read Get_EOFEnable write Set_EOFEnable; + property InputMode: InputModeConstants read Get_InputMode write Set_InputMode; + end; + +// *********************************************************************// +// DispIntf : IMSCommDisp +// Flags : (4560) Hidden Dual NonExtensible OleAutomation Dispatchable +// GUID : {E6E17E90-DF38-11CF-8E74-00A0C90F26F8} +// *********************************************************************// + IMSCommDisp = dispinterface + ['{E6E17E90-DF38-11CF-8E74-00A0C90F26F8}'] + property CDHolding: WordBool dispid 1; + property CDTimeout: Integer dispid 2; + property CommID: Integer dispid 3; + property CommPort: Smallint dispid 4; + property _CommPort: Smallint dispid 0; + property CTSHolding: WordBool dispid 5; + property CTSTimeout: Integer dispid 6; + property DSRHolding: WordBool dispid 7; + property DSRTimeout: Integer dispid 8; + property DTREnable: WordBool dispid 9; + property Handshaking: HandshakeConstants dispid 10; + property InBufferSize: Smallint dispid 11; + property InBufferCount: Smallint dispid 12; + property Break: WordBool dispid 13; + property InputLen: Smallint dispid 14; + property Interval: Integer dispid 15; + property NullDiscard: WordBool dispid 16; + property OutBufferSize: Smallint dispid 17; + property OutBufferCount: Smallint dispid 18; + property ParityReplace: WideString dispid 19; + property PortOpen: WordBool dispid 20; + property RThreshold: Smallint dispid 21; + property RTSEnable: WordBool dispid 22; + property Settings: WideString dispid 23; + property SThreshold: Smallint dispid 24; + property Output: OleVariant dispid 25; + property Input: OleVariant dispid 26; + property CommEvent: Smallint dispid 27; + property EOFEnable: WordBool dispid 28; + property InputMode: InputModeConstants dispid 29; + procedure AboutBox; dispid -552; + end; + +// *********************************************************************// +// DispIntf : DMSCommEvents +// Flags : (4112) Hidden Dispatchable +// GUID : {648A5602-2C6E-101B-82B6-000000000014} +// *********************************************************************// + DMSCommEvents = dispinterface + ['{648A5602-2C6E-101B-82B6-000000000014}'] + procedure OnComm; dispid 1; + end; + + +// *********************************************************************// +// Déclaration de classe proxy de contrôle OLE +// Nom du contrôle : TMSComm +// Chaîne d'aide : Microsoft Comm Control 6.0 +// Interface par défaut : IMSComm +// DISP Int. Déf. ? : No +// Interface événements : DMSCommEvents +// TypeFlags : (38) CanCreate Licensed Control +// *********************************************************************// + TMSComm = class(TOleControl) + private + FOnComm: TNotifyEvent; + FIntf: IMSComm; + function GetControlInterface: IMSComm; + protected + procedure CreateControl; + procedure InitControlData; override; + procedure Set_Output(pvarOutput: OleVariant); + function Get_Output: OleVariant; + procedure Set_Input(pvarInput: OleVariant); + function Get_Input: OleVariant; + public + procedure AboutBox; + property ControlInterface: IMSComm read GetControlInterface; + property DefaultInterface: IMSComm read GetControlInterface; + property CDTimeout: Integer index 2 read GetIntegerProp write SetIntegerProp; + property _CommPort: Smallint index 0 read GetSmallintProp write SetSmallintProp; + property CTSTimeout: Integer index 6 read GetIntegerProp write SetIntegerProp; + property DSRTimeout: Integer index 8 read GetIntegerProp write SetIntegerProp; + property Interval: Integer index 15 read GetIntegerProp write SetIntegerProp; + property Output: OleVariant index 25 read GetOleVariantProp write SetOleVariantProp; + property Input: OleVariant index 26 read GetOleVariantProp write SetOleVariantProp; + published + property Anchors; + property CDHolding: WordBool index 1 read GetWordBoolProp write SetWordBoolProp stored False; + property CommID: Integer index 3 read GetIntegerProp write SetIntegerProp stored False; + property CommPort: Smallint index 4 read GetSmallintProp write SetSmallintProp stored False; + property CTSHolding: WordBool index 5 read GetWordBoolProp write SetWordBoolProp stored False; + property DSRHolding: WordBool index 7 read GetWordBoolProp write SetWordBoolProp stored False; + property DTREnable: WordBool index 9 read GetWordBoolProp write SetWordBoolProp stored False; + property Handshaking: TOleEnum index 10 read GetTOleEnumProp write SetTOleEnumProp stored False; + property InBufferSize: Smallint index 11 read GetSmallintProp write SetSmallintProp stored False; + property InBufferCount: Smallint index 12 read GetSmallintProp write SetSmallintProp stored False; + property Break: WordBool index 13 read GetWordBoolProp write SetWordBoolProp stored False; + property InputLen: Smallint index 14 read GetSmallintProp write SetSmallintProp stored False; + property NullDiscard: WordBool index 16 read GetWordBoolProp write SetWordBoolProp stored False; + property OutBufferSize: Smallint index 17 read GetSmallintProp write SetSmallintProp stored False; + property OutBufferCount: Smallint index 18 read GetSmallintProp write SetSmallintProp stored False; + property ParityReplace: WideString index 19 read GetWideStringProp write SetWideStringProp stored False; + property PortOpen: WordBool index 20 read GetWordBoolProp write SetWordBoolProp stored False; + property RThreshold: Smallint index 21 read GetSmallintProp write SetSmallintProp stored False; + property RTSEnable: WordBool index 22 read GetWordBoolProp write SetWordBoolProp stored False; + property Settings: WideString index 23 read GetWideStringProp write SetWideStringProp stored False; + property SThreshold: Smallint index 24 read GetSmallintProp write SetSmallintProp stored False; + property CommEvent: Smallint index 27 read GetSmallintProp write SetSmallintProp stored False; + property EOFEnable: WordBool index 28 read GetWordBoolProp write SetWordBoolProp stored False; + property InputMode: TOleEnum index 29 read GetTOleEnumProp write SetTOleEnumProp stored False; + property OnComm: TNotifyEvent read FOnComm write FOnComm; + end; + +procedure Register; + +resourcestring + dtlServerPage = 'ActiveX'; + + dtlOcxPage = 'ActiveX'; + +implementation + +uses ComObj; + +procedure TMSComm.InitControlData; +const + CEventDispIDs: array [0..0] of DWORD = ( + $00000001); + CLicenseKey: array[0..19] of Word = ( $0043, $006F, $0070, $0079, $0072, $0069, $0067, $0068, $0074, $0020, $0028 + , $0063, $0029, $0020, $0031, $0039, $0039, $0034, $0020, $0000); + CControlData: TControlData2 = ( + ClassID: '{648A5600-2C6E-101B-82B6-000000000014}'; + EventIID: '{648A5602-2C6E-101B-82B6-000000000014}'; + EventCount: 1; + EventDispIDs: @CEventDispIDs; + LicenseKey: @CLicenseKey; + Flags: $00000000; + Version: 401); +begin + ControlData := @CControlData; + TControlData2(CControlData).FirstEventOfs := Cardinal(@@FOnComm) - Cardinal(Self); +end; + +procedure TMSComm.CreateControl; + + procedure DoCreate; + begin + FIntf := IUnknown(OleObject) as IMSComm; + end; + +begin + if FIntf = nil then DoCreate; +end; + +function TMSComm.GetControlInterface: IMSComm; +begin + CreateControl; + Result := FIntf; +end; + +procedure TMSComm.Set_Output(pvarOutput: OleVariant); +begin + DefaultInterface.Set_Output(pvarOutput); +end; + +function TMSComm.Get_Output: OleVariant; +var + InterfaceVariant : OleVariant; +begin + InterfaceVariant := DefaultInterface; + Result := InterfaceVariant.Output; +end; + +procedure TMSComm.Set_Input(pvarInput: OleVariant); +begin + DefaultInterface.Set_Input(pvarInput); +end; + +function TMSComm.Get_Input: OleVariant; +var + InterfaceVariant : OleVariant; +begin + InterfaceVariant := DefaultInterface; + Result := InterfaceVariant.Input; +end; + +procedure TMSComm.AboutBox; +begin + DefaultInterface.AboutBox; +end; + +procedure Register; +begin + RegisterComponents(dtlOcxPage, [TMSComm]); +end; + +end. diff --git a/Notice d'utilisation des signaux_complexes_GL_V8.52.pdf b/Notice d'utilisation des signaux_complexes_GL_V8.6.pdf similarity index 74% rename from Notice d'utilisation des signaux_complexes_GL_V8.52.pdf rename to Notice d'utilisation des signaux_complexes_GL_V8.6.pdf index 5628a6b..932de91 100644 Binary files a/Notice d'utilisation des signaux_complexes_GL_V8.52.pdf and b/Notice d'utilisation des signaux_complexes_GL_V8.6.pdf differ diff --git a/Signaux_complexes_GL.dpr b/Signaux_complexes_GL.dpr index b9019a7..f042365 100644 --- a/Signaux_complexes_GL.dpr +++ b/Signaux_complexes_GL.dpr @@ -18,7 +18,10 @@ uses UnitPareFeu in 'UnitPareFeu.pas', UnitAnalyseSegCDM in 'UnitAnalyseSegCDM.pas' {FormAnalyseCDM}, Importation in 'Importation.pas' {FormImportation}, - MSCommLib_TLB in 'MSCommLib_TLB.pas'; + MSCommLib_TLB in 'MSCommLib_TLB.pas', + UnitHorloge in 'UnitHorloge.pas' {FormHorloge}, + UnitFicheHoraire in 'UnitFicheHoraire.pas' {FormFicheHoraire}, + UnitClock in 'UnitClock.pas' {FormClock}; {$R *.res} @@ -28,7 +31,6 @@ begin Application.Title := 'Signaux complexes GL'; Application.CreateForm(TFormPrinc, FormPrinc); Application.CreateForm(TFormDebug, FormDebug); - Application.CreateForm(TFormVersion, FormVersion); Application.CreateForm(TFormPilote, FormPilote); Application.CreateForm(TFormSimulation, FormSimulation); Application.CreateForm(TFormConfig, FormConfig); @@ -40,9 +42,10 @@ begin Application.CreateForm(TFormPlace, FormPlace); Application.CreateForm(TFormAnalyseCDM, FormAnalyseCDM); Application.CreateForm(TFormImportation, FormImportation); - {$IF CompilerVersion >= 28.0} - //https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Compiler_Versions - change_style; - {$IFEND} + Application.CreateForm(TFormFicheHoraire, FormFicheHoraire); + Application.CreateForm(TFormVersion, FormVersion); + Application.CreateForm(TFormClock, FormClock); + Application.CreateForm(TFormHorloge, FormHorloge); + fin_preliminaire; Application.Run; end. diff --git a/Signaux_complexes_GL.map b/Signaux_complexes_GL.map index 49fcdd9..17e2dfb 100644 --- a/Signaux_complexes_GL.map +++ b/Signaux_complexes_GL.map @@ -1,104 +1,108 @@ Start Length Name Class - 0001:00000000 0017FCFCH .text CODE - 0002:00000000 00002CA0H .data DATA - 0002:00002CA0 045F6E41H .bss BSS + 0001:00000000 00186E4CH .text CODE + 0002:00000000 00002D10H .data DATA + 0002:00002D10 045EDA31H .bss BSS Detailed map of segments - 0001:00000000 00005F07 C=CODE S=.text G=(none) M=System ACBP=A9 - 0001:00005F08 00000140 C=CODE S=.text G=(none) M=SysInit ACBP=A9 - 0001:00006048 00000108 C=CODE S=.text G=(none) M=Types ACBP=A9 - 0001:00006150 00000F38 C=CODE S=.text G=(none) M=Windows ACBP=A9 - 0001:00007088 00000038 C=CODE S=.text G=(none) M=Messages ACBP=A9 - 0001:000070C0 00000338 C=CODE S=.text G=(none) M=SysConst ACBP=A9 - 0001:000073F8 00006F8C C=CODE S=.text G=(none) M=SysUtils ACBP=A9 - 0001:0000E384 0000081B C=CODE S=.text G=(none) M=VarUtils ACBP=A9 - 0001:0000EBA0 0000804E C=CODE S=.text G=(none) M=Variants ACBP=A9 - 0001:00016BF0 000001A0 C=CODE S=.text G=(none) M=RTLConsts ACBP=A9 - 0001:00016D90 0000083C C=CODE S=.text G=(none) M=TypInfo ACBP=A9 - 0001:000175CC 00000358 C=CODE S=.text G=(none) M=ActiveX ACBP=A9 - 0001:00017924 0000A7EA C=CODE S=.text G=(none) M=Classes ACBP=A9 - 0001:00022110 00000370 C=CODE S=.text G=(none) M=Consts ACBP=A9 - 0001:00022480 00009BFB C=CODE S=.text G=(none) M=Graphics ACBP=A9 - 0001:0002C07C 00000124 C=CODE S=.text G=(none) M=Math ACBP=A9 - 0001:0002C1A0 000002B8 C=CODE S=.text G=(none) M=Contnrs ACBP=A9 - 0001:0002C458 00000198 C=CODE S=.text G=(none) M=CommCtrl ACBP=A9 - 0001:0002C5F0 00000787 C=CODE S=.text G=(none) M=MultiMon ACBP=A9 - 0001:0002CD78 00000038 C=CODE S=.text G=(none) M=Imm ACBP=A9 - 0001:0002CDB0 00000FF8 C=CODE S=.text G=(none) M=HelpIntfs ACBP=A9 - 0001:0002DDA8 00000058 C=CODE S=.text G=(none) M=WinSpool ACBP=A9 - 0001:0002DE00 000010C8 C=CODE S=.text G=(none) M=Printers ACBP=A9 - 0001:0002EEC8 0000031F C=CODE S=.text G=(none) M=FlatSB ACBP=A9 - 0001:0002F1E8 000003F0 C=CODE S=.text G=(none) M=SyncObjs ACBP=A9 - 0001:0002F5D8 000009BB C=CODE S=.text G=(none) M=UxTheme ACBP=A9 - 0001:0002FF94 00000038 C=CODE S=.text G=(none) M=RichEdit ACBP=A9 - 0001:0002FFCC 00000038 C=CODE S=.text G=(none) M=ToolWin ACBP=A9 - 0001:00030004 00000040 C=CODE S=.text G=(none) M=ShellAPI ACBP=A9 - 0001:00030044 00000038 C=CODE S=.text G=(none) M=RegStr ACBP=A9 - 0001:0003007C 00000058 C=CODE S=.text G=(none) M=WinInet ACBP=A9 - 0001:000300D4 00000038 C=CODE S=.text G=(none) M=UrlMon ACBP=A9 - 0001:0003010C 0000006C C=CODE S=.text G=(none) M=ShlObj ACBP=A9 - 0001:00030178 00000060 C=CODE S=.text G=(none) M=CommDlg ACBP=A9 - 0001:000301D8 00000038 C=CODE S=.text G=(none) M=Dlgs ACBP=A9 - 0001:00030210 000036D1 C=CODE S=.text G=(none) M=Dialogs ACBP=A9 - 0001:000338E4 00004ADA C=CODE S=.text G=(none) M=ExtCtrls ACBP=A9 - 0001:000383C0 00000090 C=CODE S=.text G=(none) M=ComStrs ACBP=A9 - 0001:00038450 000007A0 C=CODE S=.text G=(none) M=Clipbrd ACBP=A9 - 0001:00038BF0 00000128 C=CODE S=.text G=(none) M=StrUtils ACBP=A9 - 0001:00038D18 00003821 C=CODE S=.text G=(none) M=Buttons ACBP=A9 - 0001:0003C53C 00000038 C=CODE S=.text G=(none) M=ExtDlgs ACBP=A9 - 0001:0003C574 00000068 C=CODE S=.text G=(none) M=IniFiles ACBP=A9 - 0001:0003C5DC 00000068 C=CODE S=.text G=(none) M=Registry ACBP=A9 - 0001:0003C644 0000006C C=CODE S=.text G=(none) M=Mapi ACBP=A9 - 0001:0003C6B0 00000058 C=CODE S=.text G=(none) M=ExtActns ACBP=A9 - 0001:0003C708 00000038 C=CODE S=.text G=(none) M=ListActns ACBP=A9 - 0001:0003C740 00009948 C=CODE S=.text G=(none) M=ComCtrls ACBP=A9 - 0001:00046088 00000EA0 C=CODE S=.text G=(none) M=Themes ACBP=A9 - 0001:00046F28 0000C698 C=CODE S=.text G=(none) M=StdCtrls ACBP=A9 - 0001:000535C0 00000168 C=CODE S=.text G=(none) M=StdActns ACBP=A9 - 0001:00053728 00000D1F C=CODE S=.text G=(none) M=WinHelpViewer ACBP=A9 - 0001:00054448 00011403 C=CODE S=.text G=(none) M=Controls ACBP=A9 - 0001:0006584C 00001292 C=CODE S=.text G=(none) M=ActnList ACBP=A9 - 0001:00066AE0 00001B9C C=CODE S=.text G=(none) M=ImgList ACBP=A9 - 0001:0006867C 000066E1 C=CODE S=.text G=(none) M=Menus ACBP=A9 - 0001:0006ED60 0000CF8C C=CODE S=.text G=(none) M=Forms ACBP=A9 - 0001:0007BCEC 00000050 C=CODE S=.text G=(none) M=JConsts ACBP=A9 - 0001:0007BD3C 000133EC C=CODE S=.text G=(none) M=jpeg ACBP=A9 - 0001:0008F128 00000060 C=CODE S=.text G=(none) M=ComConst ACBP=A9 - 0001:0008F188 00001259 C=CODE S=.text G=(none) M=ComObj ACBP=A9 - 0001:000903E4 00000038 C=CODE S=.text G=(none) M=StdVCL ACBP=A9 - 0001:0009041C 00001793 C=CODE S=.text G=(none) M=AxCtrls ACBP=A9 - 0001:00091BB0 00000060 C=CODE S=.text G=(none) M=OleConst ACBP=A9 - 0001:00091C10 00003519 C=CODE S=.text G=(none) M=OleCtrls ACBP=A9 - 0001:0009512C 00000314 C=CODE S=.text G=(none) M=TlHelp32 ACBP=A9 - 0001:00095440 00000128 C=CODE S=.text G=(none) M=WinSock ACBP=A9 - 0001:00095568 00003A78 C=CODE S=.text G=(none) M=ScktComp ACBP=A9 - 0001:00098FE0 000008EA C=CODE S=.text G=(none) M=OleServer ACBP=A9 - 0001:000998CC 00000598 C=CODE S=.text G=(none) M=MSCommLib_TLB ACBP=A9 - 0001:00099E64 00000040 C=CODE S=.text G=(none) M=MMSystem ACBP=A9 - 0001:00099EA4 00000038 C=CODE S=.text G=(none) M=Nb30 ACBP=A9 - 0001:00099EDC 00000A18 C=CODE S=.text G=(none) M=MaskUtils ACBP=A9 - 0001:0009A8F4 00002108 C=CODE S=.text G=(none) M=Mask ACBP=A9 - 0001:0009C9FC 0000924C C=CODE S=.text G=(none) M=Grids ACBP=A9 - 0001:000A5C48 00001820 C=CODE S=.text G=(none) M=UnitPilote ACBP=A9 - 0001:000A7468 0000057C C=CODE S=.text G=(none) M=Importation ACBP=A9 - 0001:000A79E4 000147DC C=CODE S=.text G=(none) M=UnitAnalyseSegCDM ACBP=A9 - 0001:000BC1C0 0000289B C=CODE S=.text G=(none) M=UnitConfigTCO ACBP=A9 - 0001:000BEA5C 00000C64 C=CODE S=.text G=(none) M=Unit_Pilote_aig ACBP=A9 - 0001:000BF6C0 00003D24 C=CODE S=.text G=(none) M=UnitConfigCellTCO ACBP=A9 - 0001:000C33E4 000320D4 C=CODE S=.text G=(none) M=UnitTCO ACBP=A9 - 0001:000F54B8 00003410 C=CODE S=.text G=(none) M=UnitSR ACBP=A9 - 0001:000F88C8 000027B4 C=CODE S=.text G=(none) M=UnitCDF ACBP=A9 - 0001:000FB07C 00002667 C=CODE S=.text G=(none) M=verif_version ACBP=A9 - 0001:000FD6E4 000011D0 C=CODE S=.text G=(none) M=UnitPareFeu ACBP=A9 - 0001:000FE8B4 00000DDC C=CODE S=.text G=(none) M=UnitSimule ACBP=A9 - 0001:000FF690 00002850 C=CODE S=.text G=(none) M=Unitplace ACBP=A9 - 0001:00101EE0 0003D627 C=CODE S=.text G=(none) M=UnitPrinc ACBP=A9 - 0001:0013F508 0003D4BC C=CODE S=.text G=(none) M=UnitConfig ACBP=A9 - 0001:0017C9C4 00002E78 C=CODE S=.text G=(none) M=UnitDebug ACBP=A9 - 0001:0017F83C 000004C0 C=CODE S=.text G=(none) M=Signaux_complexes_GL ACBP=A9 + 0001:00000000 00005EFF C=CODE S=.text G=(none) M=System ACBP=A9 + 0001:00005F00 00000140 C=CODE S=.text G=(none) M=SysInit ACBP=A9 + 0001:00006040 00000108 C=CODE S=.text G=(none) M=Types ACBP=A9 + 0001:00006148 00000F20 C=CODE S=.text G=(none) M=Windows ACBP=A9 + 0001:00007068 00000038 C=CODE S=.text G=(none) M=Messages ACBP=A9 + 0001:000070A0 00000338 C=CODE S=.text G=(none) M=SysConst ACBP=A9 + 0001:000073D8 00006F74 C=CODE S=.text G=(none) M=SysUtils ACBP=A9 + 0001:0000E34C 0000081B C=CODE S=.text G=(none) M=VarUtils ACBP=A9 + 0001:0000EB68 0000804E C=CODE S=.text G=(none) M=Variants ACBP=A9 + 0001:00016BB8 000001A0 C=CODE S=.text G=(none) M=RTLConsts ACBP=A9 + 0001:00016D58 0000083C C=CODE S=.text G=(none) M=TypInfo ACBP=A9 + 0001:00017594 00000358 C=CODE S=.text G=(none) M=ActiveX ACBP=A9 + 0001:000178EC 0000A7EA C=CODE S=.text G=(none) M=Classes ACBP=A9 + 0001:000220D8 00000370 C=CODE S=.text G=(none) M=Consts ACBP=A9 + 0001:00022448 00009BFB C=CODE S=.text G=(none) M=Graphics ACBP=A9 + 0001:0002C044 00000124 C=CODE S=.text G=(none) M=Math ACBP=A9 + 0001:0002C168 000002B8 C=CODE S=.text G=(none) M=Contnrs ACBP=A9 + 0001:0002C420 00000198 C=CODE S=.text G=(none) M=CommCtrl ACBP=A9 + 0001:0002C5B8 00000787 C=CODE S=.text G=(none) M=MultiMon ACBP=A9 + 0001:0002CD40 00000038 C=CODE S=.text G=(none) M=Imm ACBP=A9 + 0001:0002CD78 00000FF8 C=CODE S=.text G=(none) M=HelpIntfs ACBP=A9 + 0001:0002DD70 00000058 C=CODE S=.text G=(none) M=WinSpool ACBP=A9 + 0001:0002DDC8 000010C8 C=CODE S=.text G=(none) M=Printers ACBP=A9 + 0001:0002EE90 0000031F C=CODE S=.text G=(none) M=FlatSB ACBP=A9 + 0001:0002F1B0 000003F0 C=CODE S=.text G=(none) M=SyncObjs ACBP=A9 + 0001:0002F5A0 000009BB C=CODE S=.text G=(none) M=UxTheme ACBP=A9 + 0001:0002FF5C 00000038 C=CODE S=.text G=(none) M=RichEdit ACBP=A9 + 0001:0002FF94 00000038 C=CODE S=.text G=(none) M=ToolWin ACBP=A9 + 0001:0002FFCC 00000040 C=CODE S=.text G=(none) M=ShellAPI ACBP=A9 + 0001:0003000C 00000038 C=CODE S=.text G=(none) M=RegStr ACBP=A9 + 0001:00030044 00000058 C=CODE S=.text G=(none) M=WinInet ACBP=A9 + 0001:0003009C 00000038 C=CODE S=.text G=(none) M=UrlMon ACBP=A9 + 0001:000300D4 0000006C C=CODE S=.text G=(none) M=ShlObj ACBP=A9 + 0001:00030140 00000060 C=CODE S=.text G=(none) M=CommDlg ACBP=A9 + 0001:000301A0 00000038 C=CODE S=.text G=(none) M=Dlgs ACBP=A9 + 0001:000301D8 000036D1 C=CODE S=.text G=(none) M=Dialogs ACBP=A9 + 0001:000338AC 00004ADA C=CODE S=.text G=(none) M=ExtCtrls ACBP=A9 + 0001:00038388 00000090 C=CODE S=.text G=(none) M=ComStrs ACBP=A9 + 0001:00038418 000007A0 C=CODE S=.text G=(none) M=Clipbrd ACBP=A9 + 0001:00038BB8 00000128 C=CODE S=.text G=(none) M=StrUtils ACBP=A9 + 0001:00038CE0 00003821 C=CODE S=.text G=(none) M=Buttons ACBP=A9 + 0001:0003C504 00000038 C=CODE S=.text G=(none) M=ExtDlgs ACBP=A9 + 0001:0003C53C 00000068 C=CODE S=.text G=(none) M=IniFiles ACBP=A9 + 0001:0003C5A4 00000068 C=CODE S=.text G=(none) M=Registry ACBP=A9 + 0001:0003C60C 0000006C C=CODE S=.text G=(none) M=Mapi ACBP=A9 + 0001:0003C678 00000058 C=CODE S=.text G=(none) M=ExtActns ACBP=A9 + 0001:0003C6D0 00000038 C=CODE S=.text G=(none) M=ListActns ACBP=A9 + 0001:0003C708 00009948 C=CODE S=.text G=(none) M=ComCtrls ACBP=A9 + 0001:00046050 00000EA0 C=CODE S=.text G=(none) M=Themes ACBP=A9 + 0001:00046EF0 0000C698 C=CODE S=.text G=(none) M=StdCtrls ACBP=A9 + 0001:00053588 00000168 C=CODE S=.text G=(none) M=StdActns ACBP=A9 + 0001:000536F0 00000D1F C=CODE S=.text G=(none) M=WinHelpViewer ACBP=A9 + 0001:00054410 00011403 C=CODE S=.text G=(none) M=Controls ACBP=A9 + 0001:00065814 00001292 C=CODE S=.text G=(none) M=ActnList ACBP=A9 + 0001:00066AA8 00001C04 C=CODE S=.text G=(none) M=ImgList ACBP=A9 + 0001:000686AC 000066E1 C=CODE S=.text G=(none) M=Menus ACBP=A9 + 0001:0006ED90 0000CF8C C=CODE S=.text G=(none) M=Forms ACBP=A9 + 0001:0007BD1C 00000050 C=CODE S=.text G=(none) M=JConsts ACBP=A9 + 0001:0007BD6C 000133EC C=CODE S=.text G=(none) M=jpeg ACBP=A9 + 0001:0008F158 00000060 C=CODE S=.text G=(none) M=ComConst ACBP=A9 + 0001:0008F1B8 00001259 C=CODE S=.text G=(none) M=ComObj ACBP=A9 + 0001:00090414 00000038 C=CODE S=.text G=(none) M=StdVCL ACBP=A9 + 0001:0009044C 00001793 C=CODE S=.text G=(none) M=AxCtrls ACBP=A9 + 0001:00091BE0 00000060 C=CODE S=.text G=(none) M=OleConst ACBP=A9 + 0001:00091C40 00003519 C=CODE S=.text G=(none) M=OleCtrls ACBP=A9 + 0001:0009515C 00000314 C=CODE S=.text G=(none) M=TlHelp32 ACBP=A9 + 0001:00095470 00000128 C=CODE S=.text G=(none) M=WinSock ACBP=A9 + 0001:00095598 00003A78 C=CODE S=.text G=(none) M=ScktComp ACBP=A9 + 0001:00099010 000008EA C=CODE S=.text G=(none) M=OleServer ACBP=A9 + 0001:000998FC 00000598 C=CODE S=.text G=(none) M=MSCommLib_TLB ACBP=A9 + 0001:00099E94 00000040 C=CODE S=.text G=(none) M=MMSystem ACBP=A9 + 0001:00099ED4 00000038 C=CODE S=.text G=(none) M=Nb30 ACBP=A9 + 0001:00099F0C 00000038 C=CODE S=.text G=(none) M=DateUtils ACBP=A9 + 0001:00099F44 00000A18 C=CODE S=.text G=(none) M=MaskUtils ACBP=A9 + 0001:0009A95C 00002108 C=CODE S=.text G=(none) M=Mask ACBP=A9 + 0001:0009CA64 000092A4 C=CODE S=.text G=(none) M=Grids ACBP=A9 + 0001:000A5D08 00001820 C=CODE S=.text G=(none) M=UnitPilote ACBP=A9 + 0001:000A7528 0000057C C=CODE S=.text G=(none) M=Importation ACBP=A9 + 0001:000A7AA4 000147B4 C=CODE S=.text G=(none) M=UnitAnalyseSegCDM ACBP=A9 + 0001:000BC258 000028F7 C=CODE S=.text G=(none) M=UnitConfigTCO ACBP=A9 + 0001:000BEB50 00000C64 C=CODE S=.text G=(none) M=Unit_Pilote_aig ACBP=A9 + 0001:000BF7B4 000041E0 C=CODE S=.text G=(none) M=UnitConfigCellTCO ACBP=A9 + 0001:000C3994 00001050 C=CODE S=.text G=(none) M=UnitFicheHoraire ACBP=A9 + 0001:000C49E4 00001548 C=CODE S=.text G=(none) M=UnitClock ACBP=A9 + 0001:000C5F2C 00032638 C=CODE S=.text G=(none) M=UnitTCO ACBP=A9 + 0001:000F8564 00003410 C=CODE S=.text G=(none) M=UnitSR ACBP=A9 + 0001:000FB974 000027BC C=CODE S=.text G=(none) M=UnitCDF ACBP=A9 + 0001:000FE130 00000E5C C=CODE S=.text G=(none) M=UnitHorloge ACBP=A9 + 0001:000FEF8C 0000233F C=CODE S=.text G=(none) M=verif_version ACBP=A9 + 0001:001012CC 000011D0 C=CODE S=.text G=(none) M=UnitPareFeu ACBP=A9 + 0001:0010249C 00000DC8 C=CODE S=.text G=(none) M=UnitSimule ACBP=A9 + 0001:00103264 00002A50 C=CODE S=.text G=(none) M=Unitplace ACBP=A9 + 0001:00105CB4 0003E8A8 C=CODE S=.text G=(none) M=UnitPrinc ACBP=A9 + 0001:0014455C 0003F6BC C=CODE S=.text G=(none) M=UnitConfig ACBP=A9 + 0001:00183C18 00002D08 C=CODE S=.text G=(none) M=UnitDebug ACBP=A9 + 0001:00186920 0000052C C=CODE S=.text G=(none) M=Signaux_complexes_GL ACBP=A9 0002:00000000 000000CC C=DATA S=.data G=DGROUP M=System ACBP=A9 0002:000000CC 00000020 C=DATA S=.data G=DGROUP M=SysInit ACBP=A9 0002:000000EC 00000254 C=DATA S=.data G=DGROUP M=SysUtils ACBP=A9 @@ -203,25 +207,29 @@ Detailed map of segments 0002:00003E4C 00000004 C=BSS S=.bss G=DGROUP M=MSCommLib_TLB ACBP=A9 0002:00003E50 00000004 C=BSS S=.bss G=DGROUP M=MMSystem ACBP=A9 0002:00003E54 00000004 C=BSS S=.bss G=DGROUP M=Nb30 ACBP=A9 - 0002:00003E58 00000004 C=BSS S=.bss G=DGROUP M=MaskUtils ACBP=A9 - 0002:00003E5C 00000004 C=BSS S=.bss G=DGROUP M=Mask ACBP=A9 - 0002:00003E60 00000004 C=BSS S=.bss G=DGROUP M=Grids ACBP=A9 - 0002:00003E64 00000010 C=BSS S=.bss G=DGROUP M=UnitPilote ACBP=A9 - 0002:00003E74 00000010 C=BSS S=.bss G=DGROUP M=Importation ACBP=A9 - 0002:00003E84 000148B0 C=BSS S=.bss G=DGROUP M=UnitAnalyseSegCDM ACBP=A9 - 0002:00018734 00000014 C=BSS S=.bss G=DGROUP M=UnitConfigTCO ACBP=A9 - 0002:00018748 00000014 C=BSS S=.bss G=DGROUP M=Unit_Pilote_aig ACBP=A9 - 0002:0001875C 00000014 C=BSS S=.bss G=DGROUP M=UnitConfigCellTCO ACBP=A9 - 0002:00018770 00418704 C=BSS S=.bss G=DGROUP M=UnitTCO ACBP=A9 - 0002:00430E74 00000010 C=BSS S=.bss G=DGROUP M=UnitSR ACBP=A9 - 0002:00430E84 00000014 C=BSS S=.bss G=DGROUP M=UnitCDF ACBP=A9 - 0002:00430E98 000001EC C=BSS S=.bss G=DGROUP M=verif_version ACBP=A9 - 0002:00431084 00000004 C=BSS S=.bss G=DGROUP M=UnitPareFeu ACBP=A9 - 0002:00431088 0000000C C=BSS S=.bss G=DGROUP M=UnitSimule ACBP=A9 - 0002:00431094 00000008 C=BSS S=.bss G=DGROUP M=Unitplace ACBP=A9 - 0002:0043109C 041C8808 C=BSS S=.bss G=DGROUP M=UnitPrinc ACBP=A9 - 0002:045F98A4 00000570 C=BSS S=.bss G=DGROUP M=UnitConfig ACBP=A9 - 0002:045F9E14 0000002C C=BSS S=.bss G=DGROUP M=UnitDebug ACBP=A9 + 0002:00003E58 00000004 C=BSS S=.bss G=DGROUP M=DateUtils ACBP=A9 + 0002:00003E5C 00000004 C=BSS S=.bss G=DGROUP M=MaskUtils ACBP=A9 + 0002:00003E60 00000004 C=BSS S=.bss G=DGROUP M=Mask ACBP=A9 + 0002:00003E64 00000004 C=BSS S=.bss G=DGROUP M=Grids ACBP=A9 + 0002:00003E68 00000010 C=BSS S=.bss G=DGROUP M=UnitPilote ACBP=A9 + 0002:00003E78 00000010 C=BSS S=.bss G=DGROUP M=Importation ACBP=A9 + 0002:00003E88 000148B0 C=BSS S=.bss G=DGROUP M=UnitAnalyseSegCDM ACBP=A9 + 0002:00018738 00000014 C=BSS S=.bss G=DGROUP M=UnitConfigTCO ACBP=A9 + 0002:0001874C 00000014 C=BSS S=.bss G=DGROUP M=Unit_Pilote_aig ACBP=A9 + 0002:00018760 00000020 C=BSS S=.bss G=DGROUP M=UnitConfigCellTCO ACBP=A9 + 0002:00018780 00000288 C=BSS S=.bss G=DGROUP M=UnitFicheHoraire ACBP=A9 + 0002:00018A08 00000034 C=BSS S=.bss G=DGROUP M=UnitClock ACBP=A9 + 0002:00018A3C 0041870C C=BSS S=.bss G=DGROUP M=UnitTCO ACBP=A9 + 0002:00431148 00000010 C=BSS S=.bss G=DGROUP M=UnitSR ACBP=A9 + 0002:00431158 00000014 C=BSS S=.bss G=DGROUP M=UnitCDF ACBP=A9 + 0002:0043116C 00000038 C=BSS S=.bss G=DGROUP M=UnitHorloge ACBP=A9 + 0002:004311A4 000001EC C=BSS S=.bss G=DGROUP M=verif_version ACBP=A9 + 0002:00431390 00000004 C=BSS S=.bss G=DGROUP M=UnitPareFeu ACBP=A9 + 0002:00431394 0000000C C=BSS S=.bss G=DGROUP M=UnitSimule ACBP=A9 + 0002:004313A0 00000008 C=BSS S=.bss G=DGROUP M=Unitplace ACBP=A9 + 0002:004313A8 041BF0E0 C=BSS S=.bss G=DGROUP M=UnitPrinc ACBP=A9 + 0002:045F0488 0000057C C=BSS S=.bss G=DGROUP M=UnitConfig ACBP=A9 + 0002:045F0A04 0000002C C=BSS S=.bss G=DGROUP M=UnitDebug ACBP=A9 Bound resource files @@ -234,9 +242,12 @@ UnitAnalyseSegCDM.dfm UnitConfigTCO.dfm Unit_Pilote_aig.dfm UnitConfigCellTCO.dfm +UnitFicheHoraire.dfm +UnitClock.dfm UnitTCO.dfm UnitSR.dfm UnitCDF.dfm +UnitHorloge.dfm verif_version.dfm UnitSimule.dfm Unitplace.dfm @@ -247,4 +258,4 @@ Signaux_complexes_GL.res Signaux_complexes_GL.drf -Program entry point at 0001:0017FB4C +Program entry point at 0001:00186C50 diff --git a/UnitAnalyseSegCDM.pas b/UnitAnalyseSegCDM.pas index eab0888..e956774 100644 --- a/UnitAnalyseSegCDM.pas +++ b/UnitAnalyseSegCDM.pas @@ -2734,14 +2734,6 @@ begin end; end; -// vérifier si un détecteur est dans le champ d'une ligne -// exemple s='A21,533,568,566' det=533 résultat vrai -function presence_detecteur(s : string;det : integer) : boolean; -begin - result:=pos(','+intToSTR(det),s)<>0; -end; - - // renvoie le dernier champ d'une chaine séparés par des virgules // s='aa,bb,ccc,ddd,ee' : renvoie ee function dernier_champ(s : string) : string; @@ -2766,6 +2758,23 @@ begin exit; end; +// vérifier si un détecteur est le dernier d'une branche +// exemple s='A21,568,533' det=533 résultat vrai +function presence_detecteur_Fin(s : string;det : integer) : boolean; +var i,erreur : integer; +begin + s:=dernier_champ(s); + val(s,i,erreur); + result:=(erreur=0) and (i=det); +end; + +// vérifier si un détecteur est dans le champ d'une ligne +// exemple s='A21,533,568,566' det=533 résultat vrai +function presence_detecteur(s : string;det : integer) : boolean; +begin + result:=pos(','+intToSTR(det),s)<>0; +end; + // créée la branche depuis un aiguillage dont un des ports est un détecteur // indexSeg,port : index du segment et port de départ (0=pointe,1=droit,2=dévié) @@ -2940,10 +2949,10 @@ begin for j:=1 to nb_det do begin - // vérifier si le détecteur est déja dans la branche + // vérifier si le détecteur est déja en fin de branche // nouveau détecteur doublon detecteur:=sDetect[j].adresse; - doublon:=presence_detecteur(sbranche,detecteur); + doublon:=presence_detecteur_fin(sbranche,detecteur); if not(doublon) then begin sbranche:=sbranche+','+intToSTR(detecteur); @@ -2970,6 +2979,8 @@ begin end; end; + nb_det:=0; + // préparer le suivant , variables : indexSeg et IndexPort indexSeg:=indexSegSuivant; @@ -3658,6 +3669,9 @@ begin Aiguillage[i].DDevieB:=Aig_CDM[i].DDevieB; Aiguillage[i].EtatTJD:=Aig_CDM[i].EtatTJD; Aiguillage[i].AdrCDM:=aig_cdm[i].adrCDM; + Aiguillage[i].Adevie2:=Aig_CDM[i].Adevie2; + Aiguillage[i].Adevie2B:=Aig_CDM[i].Adevie2B; + Aiguillage[i].posInit:=9; aiguillage[i].InversionCDM:=0; diff --git a/UnitCDF.dfm b/UnitCDF.dfm index 34013ab..40c70a8 100644 --- a/UnitCDF.dfm +++ b/UnitCDF.dfm @@ -219,9 +219,9 @@ object FormCDF: TFormCDF ParentFont = False end object Label24: TLabel - Left = 56 + Left = 48 Top = 124 - Width = 24 + Width = 121 Height = 13 Caption = '1 '#224' 4' end diff --git a/UnitCDF.pas b/UnitCDF.pas index 95bd0e5..e0668eb 100644 --- a/UnitCDF.pas +++ b/UnitCDF.pas @@ -128,13 +128,13 @@ begin begin caption:='Configuration du décodeur Digikeijs'; label20.caption:='Tables d''aspects du signal en fonction du motif envoyé au décodeur Digikeijs'; - label24.Caption:='1 à 5 - Aspects de 0 à 255'; + label24.Caption:='1 à 5 - motifs de 0 à 255'; end; if erreur=2 then begin caption:='Configuration du décodeur CDF'; label20.Caption:='Tables d''aspects du signal en fonction du motif envoyé au décodeur CDF'; - label24.Caption:='1 à 4 - Aspects de 0 à 255'; + label24.Caption:='1 à 4 - motifs de 0 à 255'; end; Label1.caption:=etats[1]; diff --git a/UnitClock.dfm b/UnitClock.dfm new file mode 100644 index 0000000..6df4325 --- /dev/null +++ b/UnitClock.dfm @@ -0,0 +1,240 @@ +object FormClock: TFormClock + Left = 965 + Top = 184 + Width = 291 + Height = 293 + Caption = 'Horloge' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + PopupMenu = PopupMenuH + OnCreate = FormCreate + OnResize = FormResize + DesignSize = ( + 275 + 254) + PixelsPerInch = 96 + TextHeight = 13 + object BitBtnMarHor: TBitBtn + Left = 10 + Top = 230 + Width = 25 + Height = 25 + Hint = 'Lance l'#39'horloge' + Anchors = [akLeft, akBottom] + ParentShowHint = False + ShowHint = True + TabOrder = 0 + OnClick = BitBtnMarHrClick + end + object BitBtnArrHorl: TBitBtn + Left = 40 + Top = 230 + Width = 25 + Height = 25 + Hint = 'Arr'#234'te l'#39'horloge' + Anchors = [akLeft, akBottom] + ParentShowHint = False + ShowHint = True + TabOrder = 1 + OnClick = BitBtnArrHorlClick + end + object BitBtnInitHor: TBitBtn + Left = 72 + Top = 230 + Width = 25 + Height = 25 + Hint = 'Initialiser l'#39'horloge' + Anchors = [akLeft, akBottom] + ParentShowHint = False + ShowHint = True + TabOrder = 2 + OnClick = BitBtnInitHorClick + end + object ButtonParametres: TButton + Left = 102 + Top = 230 + Width = 25 + Height = 25 + Hint = 'Param'#233'trage' + Anchors = [akLeft, akBottom] + Caption = 'P' + ParentShowHint = False + ShowHint = True + TabOrder = 3 + OnClick = ButtonParametresClick + end + object ButtonGH: TButton + Left = 134 + Top = 230 + Width = 25 + Height = 25 + Hint = 'Grille horaire' + Anchors = [akLeft, akBottom] + Caption = 'G' + ParentShowHint = False + ShowHint = True + TabOrder = 4 + OnClick = ButtonGHClick + end + object ImageList24x24: TImageList + Left = 208 + Top = 48 + Bitmap = { + 494C010103000400040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000001000000001002000000000000010 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080000000800000008000000080000000800000008000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000FF000000FF000000FF000000FF000000FF000000FF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF00000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000080 + 0000008000000080000000800000008000000080000000800000008000000080 + 0000008000000000000000000000000000000000000000000000000000000000 + FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000 + FF000000FF00000000000000000000000000000000000000000000000000FFFF + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF + 0000FFFF00000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008000000080 + 0000008000000080000000800000008000000080000000800000008000000080 + 00000080000000800000000000000000000000000000000000000000FF000000 + FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000 + FF000000FF000000FF0000000000000000000000000000000000FFFF0000FFFF + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF + 0000FFFF0000FFFF000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008000000080 + 0000008000000080000000800000008000000080000000800000008000000080 + 00000080000000800000000000000000000000000000000000000000FF000000 + FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000 + FF000000FF000000FF0000000000000000000000000000000000FFFF0000FFFF + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF + 0000FFFF0000FFFF000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000800000008000000080 + 0000008000000080000000800000008000000080000000000000000000000080 + 000000800000008000000080000000000000000000000000FF000000FF000000 + FF000000FF000000FF000000FF000000FF000000FF0000000000000000000000 + FF000000FF000000FF000000FF000000000000000000FFFF0000FFFF0000FFFF + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF00000000000000000000FFFF + 0000FFFF0000FFFF0000FFFF0000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000800000008000000080 + 0000008000000080000000800000008000000080000000000000008000000080 + 000000800000008000000080000000000000000000000000FF000000FF000000 + FF000000FF000000FF000000FF000000FF000000FF00000000000000FF000000 + FF000000FF000000FF000000FF000000000000000000FFFF0000FFFF0000FFFF + 0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF000000000000FFFF0000FFFF + 0000FFFF0000FFFF0000FFFF0000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000800000008000000080 + 0000008000000080000000800000000000000000000000800000008000000080 + 000000800000008000000080000000000000000000000000FF000000FF000000 + FF000000FF000000FF000000FF0000000000000000000000FF000000FF000000 + FF000000FF000000FF000000FF000000000000000000FFFF0000FFFF0000FFFF + 0000FFFF0000FFFF0000FFFF00000000000000000000FFFF0000FFFF0000FFFF + 0000FFFF000000000000FFFF0000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000800000008000000080 + 0000008000000080000000800000000000000000000000800000008000000080 + 000000800000008000000080000000000000000000000000FF000000FF000000 + FF000000FF000000FF000000FF0000000000000000000000FF000000FF000000 + FF000000FF000000FF000000FF000000000000000000FFFF0000FFFF0000FFFF + 0000FFFF0000FFFF0000FFFF00000000000000000000FFFF0000FFFF0000FFFF + 0000FFFF000000000000FFFF0000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000800000008000000080 + 0000008000000080000000800000000000000000000000800000008000000080 + 000000800000008000000080000000000000000000000000FF000000FF000000 + FF000000FF000000FF000000FF0000000000000000000000FF000000FF000000 + FF000000FF000000FF000000FF000000000000000000FFFF0000FFFF0000FFFF + 0000FFFF0000FFFF0000FFFF00000000000000000000FFFF0000FFFF0000FFFF + 0000FFFF000000000000FFFF0000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000800000008000000080 + 0000008000000080000000800000000000000000000000800000008000000080 + 000000800000008000000080000000000000000000000000FF000000FF000000 + FF000000FF000000FF000000FF0000000000000000000000FF000000FF000000 + FF000000FF000000FF000000FF000000000000000000FFFF0000FFFF0000FFFF + 0000FFFF0000FFFF0000FFFF00000000000000000000FFFF0000FFFF0000FFFF + 0000FFFF000000000000FFFF0000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008000000080 + 0000008000000080000000800000000000000000000000800000008000000080 + 00000080000000800000000000000000000000000000000000000000FF000000 + FF000000FF000000FF000000FF0000000000000000000000FF000000FF000000 + FF000000FF000000FF0000000000000000000000000000000000FFFF0000FFFF + 0000FFFF0000FFFF0000FFFF00000000000000000000FFFF0000FFFF0000FFFF + 0000FFFF0000FFFF000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000008000000080 + 0000008000000080000000800000000000000000000000800000008000000080 + 00000080000000800000000000000000000000000000000000000000FF000000 + FF000000FF000000FF000000FF0000000000000000000000FF000000FF000000 + FF000000FF000000FF0000000000000000000000000000000000FFFF0000FFFF + 0000FFFF0000FFFF0000FFFF00000000000000000000FFFF0000000000000000 + 000000000000FFFF000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000080 + 0000008000000080000000800000000000000000000000800000008000000080 + 0000008000000000000000000000000000000000000000000000000000000000 + FF000000FF000000FF000000FF0000000000000000000000FF000000FF000000 + FF000000FF00000000000000000000000000000000000000000000000000FFFF + 0000FFFF0000FFFF0000FFFF0000000000000000000000000000000000000000 + 0000FFFF00000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000080000000800000000000000000000000800000008000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000FF000000FF0000000000000000000000FF000000FF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FFFF0000FFFF00000000000000000000FFFF0000FFFF00000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000424D3E000000000000003E000000 + 2800000040000000100000000100010000000000800000000000000000000000 + 000000000000000000000000FFFFFF00FFFFFFFFFFFF0000F81FF81FF81F0000 + E007E007E0070000C003C003C0030000C003C003C00300008001800180010000 + 8001800180010000800180018001000080018001800100008001800180010000 + 8001800180010000C003C003C0030000C003C003C0030000E007E007E0070000 + F81FF81FF81F0000FFFFFFFFFFFF000000000000000000000000000000000000 + 000000000000} + end + object PopupMenuH: TPopupMenu + OwnerDraw = True + Left = 216 + Top = 96 + object TjsDev: TMenuItem + Caption = ' Verrouiller devant' + OnClick = TjsVerClick + end + object Dverrouiller1: TMenuItem + Caption = ' D'#233'verrouiller' + OnClick = Dverrouiller1Click + end + end +end diff --git a/UnitClock.pas b/UnitClock.pas new file mode 100644 index 0000000..63e4449 --- /dev/null +++ b/UnitClock.pas @@ -0,0 +1,471 @@ +unit UnitClock; + +{ FBitMap est le Bitmap d'arrière plan et contient le tour de l'horloge + il est créé au démarrage. + + ABitMap contient les aiguilles + + DrawArrow dessine les aiguilles dans ABitmap: + - le crée, dessine + Abitmap.canvas.copyrect( + - copie dans horloge : canvas.draw(0,0,ABitMap) + +} +interface +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, ExtCtrls,Math , UnitHorloge, StdCtrls, Buttons, ImgList, Menus; + +const pisur180=pi/180; + pisur360=pi/360; + pisur6=pi/6; +type + TFormClock = class(TForm) + BitBtnMarHor: TBitBtn; + ImageList24x24: TImageList; + BitBtnArrHorl: TBitBtn; + BitBtnInitHor: TBitBtn; + ButtonParametres: TButton; + PopupMenuH: TPopupMenu; + TjsDev: TMenuItem; + Dverrouiller1: TMenuItem; + ButtonGH: TButton; + procedure FormCreate(Sender: TObject); + procedure FormResize(Sender: TObject); + procedure BitBtnMarHrClick(Sender: TObject); + procedure BitBtnArrHorlClick(Sender: TObject); + procedure BitBtnInitHorClick(Sender: TObject); + procedure ButtonParametresClick(Sender: TObject); + procedure TjsVerClick(Sender: TObject); + procedure Dverrouiller1Click(Sender: TObject); + procedure ButtonGHClick(Sender: TObject); + + private + procedure WMGetMinMaxInfo(var Message: TWMGetMinMaxInfo); message WM_GETMINMAXINFO; + public + end; + + TClock = class(TGraphicControl) + private + Ticker : TTimer; + + FPen: TPen; // couleur de crayon + FBitMap : TBitMap; // arrière plan + // Clock variables + CenterPoint : TPoint; // Centre des aiguilles + Radius : integer; // rayon d'horloge + LapStepW : integer; // espacement des maqueurs minutes + ShowSecond : boolean; // Affiche ou non l'aiguille des seondes + FArrowColor : TColor; // couleur des aiguilles + FFaceColor : TColor; // Couleur d'horloge + + procedure SetFaceColor( Value : TColor); + procedure SetArrowColor( Value : TColor); + procedure SetShowSecond( Value : boolean); + function HourAngle( Hou, Min : word) : real; // Hour arrow angle + procedure CalcClockSettings; + procedure DrawClockBkg; // Draw clock background on FBitMap + + protected + procedure Paint; override; + + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + procedure tickercall; + procedure DrawArrows; // Draw clock arrows + + published + property Align; + property Enabled; + property ParentShowHint; + property ShowHint; + property Visible; + property ClkArrowColor : TColor read FArrowColor write SetArrowColor default clBlack; + property ClkFaceColor : TColor read FFaceColor write SetFaceColor default clBtnFace; + property SecArrow : boolean read ShowSecond write SetShowSecond; + end; + +var FormClock: TFormClock; + clock : Tclock; + FormClockInit,Verrouille : boolean; + SecThick,MinThick,HouThick,DeltaFPCX,DeltaFPCY,largeurFC,hauteurFC,OffsetXFC,OffsetYFC : integer; + +procedure affiche_horloge; +procedure calcul_pos_horloge; + +implementation + +uses UnitConfigCellTCO, UnitPrinc, UnitFicheHoraire; +{$R *.dfm} + +const + SecScale=1; // longueur de l'aiguille des secondes + MinScale=0.95; // longueur de l'aiguille des minutes + HouScale=0.60; // longueur de l'aiguille des heures + offsetx=20; // décalage x du bitmap l'horloge par rapport à la fenetre + offsety=60; // y + +constructor TClock.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + FormClockInit:=false; + // taille de l'horloge + Width:=(AOwner as Tform).Width-offsetx; + Height:=(AOwner as Tform).Height-offsety; + + FFaceColor:=clBtnFace; + FArrowColor:=clBlack; + ShowSecond:=true; + + // Crée le crayon horloge pour le bitmap + FPen:=TPen.Create; + // Crée le bitmap d'arrière plan + FBitMap:=TBitMap.Create; + FBitMap.Width:=Width; + FBitMap.Height:=Height; +end; + +procedure TClock.SetFaceColor( Value : TColor); +begin FFaceColor:=Value; invalidate; end; + +procedure TClock.SetArrowColor( Value : TColor); +begin FArrowColor := Value; invalidate; end; + +procedure TClock.SetShowSecond( Value : boolean); +begin + ShowSecond := Value; + Invalidate; +end; + +procedure TClock.Paint; +begin + CalcClockSettings; + DrawClockBkg; + DrawArrows; +end; + +destructor TClock.Destroy; +begin + FPen.Free; + FBitMap.Free; + Ticker.Free; + inherited Destroy; +end; + +function TClock.HourAngle( Hou, Min : word) : real; +begin + HourAngle:=(Hou MOD 12) * pisur6 + (Min*pisur360); +end; + +procedure Tclock.TickerCall; +begin + // ne rien faire pendant la création + //if (csDesigning in ComponentState) or + //Affiche('Ticker Call',clLime); + if (formClock=nil) or not(FormclockInit) then exit; + if not(assigned(formclock)) then exit; + if not(ShowSecond) then exit; + DrawArrows; +end; + +// dessine les flèches dans A bitmap et le copie dans le canvas de l'horloge +procedure TClock.DrawArrows; +var + ABitMap : TBitMap; + sin,cos :extended; + + // Dessine les flèches dans le bitmap hors écran + procedure DrawArrow( Angle, Scale : real; AWidth : integer); + var SR : real; + begin + with ABitMap.Canvas do + begin + Pen.Width:=AWidth; + MoveTo(CenterPoint.X, CenterPoint.Y); + SR:=Scale*Radius; + sincos(Angle,sin,cos); + LineTo(round(SR*sin)+ CenterPoint.X, + round(-SR*cos)+ CenterPoint.Y); + end; + end; + +begin + // Crée le bitmap AbitMap hors écran + ABitMap:=TBitMap.Create; + FPen.Color:=ClkArrowColor; + try + // dessine les aiguilles sur l'image hors écran + // Attributs du bitmap hors écran + ABitMap.Width:=Width; + ABitMap.Height:=Height; + with ABitMap.Canvas do + begin + Pen:=FPen; + Brush.Color:=clred; + end; + // Copie l'image de fond du bitmap dans le bitmap hors écran + ABitMap.Canvas.CopyMode:=cmSrcCopy; + ABitMap.Canvas.CopyRect(ABitMap.Canvas.ClipRect,FBitMap.Canvas,FBitMap.Canvas.ClipRect); + // Dessine les nouvelles aiguilles dans le bitmap hors écran + if ShowSecond then DrawArrow( seconde*pi/30, SecScale, SecThick); // seconde + DrawArrow(minute*pi/30,MinScale, MinThick); // minute + DrawArrow(HourAngle(heure,minute),HouScale,HouThick); // heure + + // Dessine le bitmap hors écran dans l'horloge + Canvas.CopyMode:=cmSrcCopy; + Canvas.Draw(0,0,ABitMap); + formclock.Caption:=format('%.2dh%.2d:%.2d',[heure,minute,seconde] ); + finally + ABitMap.Free; + end; +end; + +procedure TClock.CalcClockSettings; +begin + //Créer une nouvelle image de fond dans Fbitmap + FBitMap.Free; + FBitMap:=TBitMap.Create; + FBitMap.Width:=Width; + FBitMap.Height:=Height; + // calcule le centre de l'horloge + CenterPoint:=Point(Width div 2,Height div 2); + // Calcule le rayon de l'horloge + with CenterPoint do + if x<=y then Radius:=x + else Radius:=y; + + LapStepW:=Radius div 8; + if LapStepW<6 then LapStepW:=6; + + dec(Radius,LapStepW+2); +end; + +// Dessine le fond (le tour) de l'horloge sur FbitMap +procedure TClock.DrawClockBkg; + + // Dessine les tirets minute sur FBitMap + procedure DrawMinSteps; + const EpGd=2; // epaisseurs des aiguilles + LgGd=25; + EpPt=1; + LgPt=7; + var + ep,lg,OfsX : integer; + Angle : word; + SR : real; + sin, cos : extended; + x1,y1,x2,y2,x3,y3,x4,y4 : integer; + begin + OfsX := LapStepW DIV 2; + Angle:=0; + FBitMap.Canvas.Pen.color:=ClkArrowColor; + Fbitmap.canvas.Brush.Color:=clkArrowColor; + while Angle<360 do + begin + if Angle mod 15 = 0 then + begin + // grands marqueurs + ep:=EpGd; + lg:=LgGd; + end + else + begin + ep:=EpPt; + lg:=LgPt; + end; + + sr:=Radius + OfsX; + sincos((Angle+Ep)*pisur180,sin,cos); + x1:=round(sr*sin)+centerPoint.X; y1:=round(sr*cos)+centerPoint.y; + + sincos((Angle-Ep)*pisur180,sin,cos); + x2:=round(sr*sin)+centerPoint.X; y2:=round(sr*cos)+centerPoint.y; + + // marqueurs des 3 heures + if Angle=0 then //6h + begin + inc(x2); + x3:=x2;y3:=y2-lg; + x4:=x1;y4:=y1-lg; + end + else + if Angle=90 then //3h + begin + inc(y1); + x3:=x2-lg;y3:=y2; + x4:=x1-lg;y4:=y1; + end + else + if Angle=180 then //0h + begin + inc(x1); + x3:=x2;y3:=y2+lg; + x4:=x1;y4:=y1+lg; + end + else + if Angle=270 then //9h + begin + inc(y2); + x3:=x2+lg;y3:=y2; + x4:=x1+lg;y4:=y1; + end + else + begin + sr:=(Radius-lg) + OfsX; + sincos((Angle-Ep)*pisur180,sin,cos); + x3:=round(sr*sin)+centerPoint.X; y3:=round(sr*cos)+centerPoint.y; + + sincos((Angle+Ep)*pisur180,sin,cos); + x4:=round(sr*sin)+centerPoint.X; y4:=round(sr*cos)+centerPoint.y; + end; + + Fbitmap.canvas.polygon([point(x1,y1),point(x2,y2),point(x3,y3),point(x4,y4)]); + + inc(Angle,6); + end; + end; // DrawMinSteps + +begin + with FBitMap.Canvas do + begin + Brush.Style:=bsSolid; + Brush.Color:=ClkFaceColor; + FillRect( ClipRect); + end; + DrawMinSteps; +end; + +procedure calcul_pos_horloge; +begin + if LargeurFC<150 then + begin + LargeurFC:=250; + HauteurFC:=250; + OffsetXFC:=(formprinc.top+formPrinc.height)-FormClock.height-20; + OffsetYFC:=(formprinc.left+formPrinc.width)-formClock.width; + end; + formclock.top:=OffsetYFC; + formclock.left:=OffsetXFC; + formclock.width:=LargeurFC; + formclock.height:=HauteurFC; + // écart entre fenetre principale et clock + DeltaFPCY:=OffsetYFC-formprinc.top; + DeltaFPCX:=OffsetXFC-formprinc.left; +end; + +procedure TFormClock.FormCreate(Sender: TObject); +begin + // inits +// Affiche('FormClock create',clYellow); + if formClock<>nil then + begin + SetWindowPos(FormClock.Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NoMove or SWP_NoSize); + Verrouille:=true; + + + clock:=tClock.Create(formClock); + clock.Parent:=formclock; + + clock.CalcClockSettings; + clock.DrawClockBkg; + clock.ClkFaceColor:=$e0e0e0; + clock.ClkArrowColor:=clBlack; + + ImageList24x24.GetBitmap(0,BitBtnMarHor.Glyph); + BitBtnMarHor.Height:=26; + BitBtnMarHor.Width:=26; + + ImageList24x24.GetBitmap(1,BitBtnArrHorl.Glyph); + BitBtnMarHor.Height:=26; + BitBtnMarHor.Width:=26; + + ImageList24x24.GetBitmap(2,BitBtnInitHor.Glyph); + BitBtnMarHor.Height:=26; + BitBtnMarHor.Width:=26; + + color:=clock.ClkFaceColor; + SecThick:=2; MinThick:=10; + HouThick:=12; + + FormClockInit:=true; + end; +end; + +// fixer les valeurs maxi et mini de la taille de la fenetre +procedure TFormClock.WMGetMinMaxInfo(var Message: TWMGetMinMaxInfo); +var MinMaxInfo : PMinMaxInfo; +begin + inherited; + MinMaxInfo:=Message.MinMaxInfo; + MinMaxInfo^.ptMaxTrackSize.X:=400; // Maximum Width + MinMaxInfo^.ptMaxTrackSize.Y:=400; // Maximum Height + MinMaxInfo^.ptMinTrackSize.X:=150; // Minimum Width + MinMaxInfo^.ptMinTrackSize.Y:=150; // Minimum Height +end; + +procedure TFormClock.FormResize(Sender: TObject); +begin + if (csDesigning in ComponentState) or (formClock=nil) or not(FormClockInit) then exit; + clock.Width:=formClock.Width-offsetx; + clock.Height:=formClock.Height-offsety; + HouThick:=round(12*width/250); + MinThick:=round(10*width/250); + SecThick:=round(2*width/250); +end; + +procedure TFormClock.BitBtnMarHrClick(Sender: TObject); +begin + Demarre_horloge; +end; + +procedure TFormClock.BitBtnArrHorlClick(Sender: TObject); +begin + horloge:=false; +end; + +procedure TFormClock.BitBtnInitHorClick(Sender: TObject); +begin + init_horloge; +end; + +procedure TFormClock.ButtonParametresClick(Sender: TObject); +begin + if formHorloge<>nil then formHorloge.showModal; +end; + +procedure TFormClock.TjsVerClick(Sender: TObject); +begin + SetWindowPos(Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NoMove or SWP_NoSize); + // le checked ne fonctionne pas sous D7, fonctionne sous D11. + TjsDev.Checked:=true; + Dverrouiller1.Checked:=false; + Verrouille:=true; +end; + +procedure TFormClock.Dverrouiller1Click(Sender: TObject); +begin + SetWindowPos(Handle, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NoMove or SWP_NoSize); + TjsDev.Checked:=false; + Dverrouiller1.Checked:=true; + Verrouille:=false; +end; + + +procedure affiche_horloge; +begin + if (formClock<>nil) then + begin + FormClock.Show; + formClock.BringToFront; + end; +end; + + +procedure TFormClock.ButtonGHClick(Sender: TObject); +begin + formFicheHoraire.showModal; +end; + +end. + diff --git a/UnitConfig.dfm b/UnitConfig.dfm index 4d52e4c..293f578 100644 --- a/UnitConfig.dfm +++ b/UnitConfig.dfm @@ -1,6 +1,6 @@ object FormConfig: TFormConfig - Left = 246 - Top = 114 + Left = 258 + Top = 206 Hint = 'Modifie la configuration selon les s'#233'lections choisies' BorderStyle = bsDialog Caption = 'Configuration g'#233'n'#233'rale' @@ -681,7 +681,7 @@ object FormConfig: TFormConfig Top = 8 Width = 633 Height = 505 - ActivePage = TabSheetAig + ActivePage = TabSheetAct Font.Charset = DEFAULT_CHARSET Font.Color = clBlack Font.Height = -11 @@ -737,7 +737,10 @@ object FormConfig: TFormConfig Width = 57 Height = 21 TabStop = False + BiDiMode = bdLeftToRight + ParentBiDiMode = False TabOrder = 1 + Text = '123' end object ButtonPFCDM: TButton Left = 16 @@ -857,7 +860,7 @@ object FormConfig: TFormConfig Left = 312 Top = 8 Width = 297 - Height = 121 + Height = 105 Caption = 'Au d'#233'marrage de CDM Rail : serveur' TabOrder = 2 object RadioButtonSS: TRadioButton @@ -885,16 +888,16 @@ object FormConfig: TFormConfig TabOrder = 2 end object RadioButtonSP: TRadioButton - Left = 8 + Left = 192 Top = 64 - Width = 249 + Width = 81 Height = 17 Caption = 'Sprog' TabOrder = 3 end object RadioButtonFIS: TRadioButton Left = 8 - Top = 80 + Top = 64 Width = 177 Height = 17 Caption = 'FIS88/HSI88/HSI88-USB' @@ -910,7 +913,7 @@ object FormConfig: TFormConfig end object RadioButtonRS: TRadioButton Left = 8 - Top = 96 + Top = 80 Width = 177 Height = 17 Caption = 'RS2PC (Rs FeedBack interface)' @@ -935,7 +938,7 @@ object FormConfig: TFormConfig end object GroupBox7: TGroupBox Left = 312 - Top = 136 + Top = 114 Width = 297 Height = 81 Caption = 'Au d'#233'marrage de CDM Rail : interface LENZ / XpressNet' @@ -1059,9 +1062,9 @@ object FormConfig: TFormConfig end object GroupBoxDivers: TGroupBox Left = 312 - Top = 224 + Top = 200 Width = 297 - Height = 161 + Height = 177 Caption = 'Divers' TabOrder = 5 object Label41: TLabel @@ -1108,7 +1111,7 @@ object FormConfig: TFormConfig end object CheckBoxVerifXpressNet: TCheckBox Left = 8 - Top = 102 + Top = 98 Width = 233 Height = 17 Hint = @@ -1147,7 +1150,7 @@ object FormConfig: TFormConfig end object ButtonCouleur: TButton Left = 144 - Top = 122 + Top = 124 Width = 25 Height = 17 Caption = '...' @@ -1975,7 +1978,7 @@ object FormConfig: TFormConfig OnClick = BoutSupAigClick end object ButtonAjSup: TButton - Left = 152 + Left = 144 Top = 32 Width = 121 Height = 17 @@ -2366,7 +2369,7 @@ object FormConfig: TFormConfig Width = 137 Height = 21 Style = csDropDownList - ItemHeight = 13 + ItemHeight = 0 TabOrder = 1 OnChange = ComboBoxDecChange end @@ -2473,7 +2476,7 @@ object FormConfig: TFormConfig Width = 137 Height = 21 Style = csDropDownList - ItemHeight = 13 + ItemHeight = 0 TabOrder = 2 OnChange = ComboBoxAspChange end @@ -2766,7 +2769,7 @@ object FormConfig: TFormConfig Top = 56 Width = 193 Height = 21 - ItemHeight = 13 + ItemHeight = 0 TabOrder = 0 OnChange = ComboBoxDecodeurPersoChange end @@ -2785,7 +2788,7 @@ object FormConfig: TFormConfig Width = 145 Height = 21 Style = csDropDownList - ItemHeight = 13 + ItemHeight = 0 TabOrder = 2 OnChange = ComboBoxNationChange end @@ -2831,7 +2834,7 @@ object FormConfig: TFormConfig Width = 193 Height = 21 Style = csDropDownList - ItemHeight = 13 + ItemHeight = 0 TabOrder = 6 OnChange = ComboBoxDecCdeChange end @@ -2842,7 +2845,7 @@ object FormConfig: TFormConfig ImageIndex = 5 object Label16: TLabel Left = 0 - Top = 8 + Top = 4 Width = 562 Height = 13 Caption = @@ -2857,16 +2860,16 @@ object FormConfig: TFormConfig end object GroupBox13: TGroupBox Left = 352 - Top = 32 + Top = 24 Width = 265 - Height = 433 + Height = 441 Caption = 'Description de l'#39'action' TabOrder = 0 object GroupBoxRadio: TGroupBox Left = 8 Top = 16 Width = 249 - Height = 89 + Height = 105 Caption = 'Type d'#39'action' TabOrder = 0 object RadioButtonLoc: TRadioButton @@ -2905,10 +2908,19 @@ object FormConfig: TFormConfig TabOrder = 3 OnClick = RadioButtonCdeClick end + object RadioButtonVit: TRadioButton + Left = 24 + Top = 80 + Width = 145 + Height = 17 + Caption = 'Vitesse de locomotive' + TabOrder = 4 + OnClick = RadioButtonVitClick + end end object GroupBoxAct: TGroupBox Left = 8 - Top = 112 + Top = 120 Width = 249 Height = 321 Caption = 'Action fonction de locomotive ' @@ -2917,12 +2929,12 @@ object FormConfig: TFormConfig Left = 8 Top = 16 Width = 233 - Height = 161 + Height = 145 Caption = 'D'#233'clencheur ' TabOrder = 0 object LabelActionneur: TLabel Left = 8 - Top = 96 + Top = 88 Width = 54 Height = 26 Caption = 'Actionneur D'#233'tecteur' @@ -2930,21 +2942,21 @@ object FormConfig: TFormConfig end object Label30: TLabel Left = 168 - Top = 104 + Top = 96 Width = 6 Height = 13 Caption = #224 end object LabelTrain: TLabel Left = 8 - Top = 126 + Top = 118 Width = 60 Height = 13 Caption = 'Train(s) D'#233'cl' end object EditAct: TEdit Left = 72 - Top = 100 + Top = 92 Width = 41 Height = 21 ParentShowHint = False @@ -2954,7 +2966,7 @@ object FormConfig: TFormConfig end object EditEtatActionneur: TEdit Left = 184 - Top = 100 + Top = 92 Width = 17 Height = 21 Hint = 'Etat '#224' ou 1' @@ -2965,7 +2977,7 @@ object FormConfig: TFormConfig end object EditTrainDecl: TEdit Left = 72 - Top = 124 + Top = 116 Width = 153 Height = 21 Hint = @@ -2977,53 +2989,56 @@ object FormConfig: TFormConfig TabOrder = 2 OnChange = EditTrainDeclChange end - object RadioGroupDecl: TRadioGroup - Left = 8 - Top = 16 - Width = 217 - Height = 73 - Caption = 'Type de d'#233'clenchement' - TabOrder = 3 - end object RadioButtonActDet: TRadioButton - Left = 32 - Top = 32 + Left = 16 + Top = 16 Width = 161 Height = 17 Caption = 'Actionneur/D'#233'tecteur' - TabOrder = 4 + TabOrder = 3 OnClick = RadioButtonActDetClick end object RadioButtonZones: TRadioButton - Left = 32 - Top = 48 + Left = 16 + Top = 32 Width = 161 Height = 17 Caption = 'Zones de d'#233'tection' - TabOrder = 5 + TabOrder = 4 OnClick = RadioButtonZonesClick end object EditAct2: TEdit Left = 120 - Top = 100 + Top = 92 Width = 41 Height = 21 - TabOrder = 6 + ParentShowHint = False + ShowHint = True + TabOrder = 5 OnChange = EditAct2Change end object RadioButtonAig: TRadioButton - Left = 32 - Top = 64 + Left = 16 + Top = 48 Width = 145 Height = 17 Caption = 'Ev'#232'nement aiguillage' - TabOrder = 7 + TabOrder = 6 OnClick = RadioButtonAigClick end + object RadioButtonHorl: TRadioButton + Left = 16 + Top = 64 + Width = 113 + Height = 17 + Caption = 'Horloge' + TabOrder = 7 + OnClick = RadioButtonHorlClick + end end object GroupBox19: TGroupBox - Left = 24 - Top = 152 + Left = 8 + Top = 168 Width = 233 Height = 137 Caption = 'Destinataire de l'#39'action ' @@ -3045,7 +3060,7 @@ object FormConfig: TFormConfig ParentBiDiMode = False end object Labela: TLabel - Left = 144 + Left = 152 Top = 20 Width = 6 Height = 13 @@ -3164,7 +3179,7 @@ object FormConfig: TFormConfig end object CheckRAZ: TCheckBox Left = 40 - Top = 48 + Top = 56 Width = 145 Height = 17 Caption = 'Remise '#224' 0 apr'#232's pilotage' @@ -3174,7 +3189,7 @@ object FormConfig: TFormConfig object EditFonctionAccess: TEdit Left = 112 Top = 14 - Width = 25 + Width = 33 Height = 21 Hint = 'Num'#233'ro de fonction du d'#233'codeur du train (0 '#224' 12 ou 28)' ParentShowHint = False @@ -3183,7 +3198,7 @@ object FormConfig: TFormConfig OnChange = EditFonctionAccessChange end object EditEtatFoncSortie: TEdit - Left = 160 + Left = 168 Top = 14 Width = 25 Height = 21 @@ -3210,8 +3225,8 @@ object FormConfig: TFormConfig OnChange = EditTrainDestChange end object ComboBoxAccComUSB: TComboBox - Left = 24 - Top = 64 + Left = 16 + Top = 80 Width = 201 Height = 21 Hint = 'Nom de l'#39'accessoire d'#233'fini dans l'#39'onglet "p'#233'riph'#233'riques COM/USB"' @@ -3237,24 +3252,24 @@ object FormConfig: TFormConfig end end object GroupBoxPNA: TGroupBox - Left = 32 - Top = 40 + Left = 96 + Top = 64 Width = 169 Height = 121 Caption = 'Actionneurs PN simples' TabOrder = 2 end object GroupBoxPNZ: TGroupBox - Left = 72 - Top = 368 + Left = 192 + Top = 88 Width = 169 Height = 65 Caption = 'Zones de d'#233'tection' TabOrder = 3 end object GroupBoxPN: TGroupBox - Left = 24 - Top = 32 + Left = 144 + Top = 24 Width = 249 Height = 193 Caption = 'Action gestion passage '#224' niveau' @@ -3407,9 +3422,9 @@ object FormConfig: TFormConfig end object GroupBox14: TGroupBox Left = 0 - Top = 32 + Top = 24 Width = 345 - Height = 225 + Height = 233 Caption = 'Actionneurs/d'#233'tecteurs locomotives ou accessoires' TabOrder = 1 object ButtonNouvAcc: TButton diff --git a/UnitConfig.pas b/UnitConfig.pas index 04ec292..0045f65 100644 --- a/UnitConfig.pas +++ b/UnitConfig.pas @@ -6,7 +6,7 @@ uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls , jpeg, ComCtrls ,StrUtils, Unitprinc, MMSystem, Buttons , UnitPareFeu, verif_version, Menus, ClipBrd, - Grids + Grids , unitHorloge {$IF CompilerVersion >= 28.0} ,Vcl.Themes @@ -211,7 +211,6 @@ type Label35: TLabel; Label36: TLabel; ButtonTestAct: TButton; - RadioGroupDecl: TRadioGroup; RadioButtonActDet: TRadioButton; RadioButtonZones: TRadioButton; EditAct2: TEdit; @@ -358,6 +357,8 @@ type Label31: TLabel; Label39: TLabel; CheckBoxMsgAigInc: TCheckBox; + RadioButtonHorl: TRadioButton; + RadioButtonVit: TRadioButton; procedure ButtonAppliquerEtFermerClick(Sender: TObject); procedure FormCreate(Sender: TObject); procedure ListBoxAigMouseDown(Sender: TObject; Button: TMouseButton; @@ -543,6 +544,8 @@ type procedure EditAdrAigExit(Sender: TObject); procedure EditAdrAigChange(Sender: TObject); procedure FormActivate(Sender: TObject); + procedure RadioButtonHorlClick(Sender: TObject); + procedure RadioButtonVitClick(Sender: TObject); private { Déclarations privées } @@ -584,6 +587,7 @@ retro_ch='retro'; Ecran_ch='Ecran'; Z21_ch='Z21'; Init_aig_ch='Init_Aig'; +PilotageTrainsCDM_ch='PilotageTrainsCDMNom'; LAY_ch='Lay'; Init_dem_aig_ch='Init_Dem_Aig'; Init_dem_interfaceUSBCOM_ch='Init_demUSBCOM'; @@ -621,11 +625,25 @@ Periph_ch='Periph'; comm_ch='Commande'; nom_dec_pers_ch='Nom_dec_pers'; Nom_fich_TCO_ch='Nom_fichier_TCO'; -LargeurF_ch='LargeurF'; +LargeurF_ch='LargeurF'; // largeur de la fenêtre principale HauteurF_ch='HauteurF'; -OffsetXF_ch='OffsetX'; +OffsetXF_ch='OffsetX'; // .Left de la fenêtre principale OffsetYF_ch='OffsetY'; +LargeurFC_ch='LargeurFC'; // largeur de la fenêtre clock +HauteurFC_ch='HauteurFC'; +OffsetXFC_ch='OffsetXC'; // .Left de la fenêtre clock +OffsetYFC_ch='OffsetYC'; + PosSplitter_ch='Splitter'; +horlogeInterne_ch='HorlogeInterne'; +LanceHorl_ch='LanceHorl'; +AffHorl_ch='AffHorl'; +HeureInit_ch='HeureInit'; +MinuteInit_ch='MinuteInit'; +RetourHeure_ch='RetourHeure'; +RetourMinute_ch='RetourMinute'; +DureeMinute_ch='DureeMinute'; +relanceHorl_init_ch='relanceHorl_init'; // sections de config section_aig_ch='[section_aig]'; @@ -638,10 +656,11 @@ section_trains_ch='[section_trains]'; section_placement_ch='[section_placement]'; section_DecPers_ch='[section_decodeurs]'; section_accCOM_ch='[section_accCOMUSB]'; +section_horloge_ch='[section horloge]'; var FormConfig: TFormConfig; - AdresseIPCDM,AdresseIP,PortCom,recuCDM,residuCDM : string; //,trainsauve : string; + AdresseIPCDM,AdresseIP,PortCom,recuCDM,residuCDM,RepConfig : string; //,trainsauve : string; portCDM,TempoOctet,TimoutMaxInterface,Valeur_entete,PortInterface,prot_serie,NumPort,debug, LigneCliqueePN,AncLigneCliqueePN,clicMemo,Nb_cantons_Sig,protocole,Port,PortServeur, @@ -653,7 +672,8 @@ var ack_cdm,clicliste,config_modifie,clicproprietes,confasauver,trouve_MaxPort,fermeSC, modif_branches,ConfigPrete,trouve_section_dccpp,trouve_section_trains,trouve_section_acccomusb, - trouveAvecVerifIconesTCO,Affiche_avert,activ,trouve_section_dec_pers,Z21,AffAigND : boolean; + trouveAvecVerifIconesTCO,Affiche_avert,activ,trouve_section_dec_pers,Z21,AffAigND, + PilotageTrainsCDMNom,LanceHorl : boolean; fichier : text; @@ -671,7 +691,7 @@ var EditZdet1V4F,EditZdet2V4F,EditZdet1V4O,EditZdet2V4O, EditZdet1V5F,EditZdet2V5F,EditZdet1V5O,EditZdet2V5O,EditOuvreEcran, EditNbDetDist,EditNbCantons,EditFiltrDet,EditAlgo, - EditMaxSignalSens,EditnCantonsRes,EditAntiTO : Tedit; + EditMaxSignalSens,EditnCantonsRes,EditAntiTO,EditRep : Tedit; EditT : Array[1..10] of Tedit; TextBoxCde : array[1..19] of Tedit; @@ -681,7 +701,7 @@ var LabelStyle,LabelOuvreEcran,LabelAvance1,LabelAvance2,LabelAntiTO, LabelTD,LabelNC,LabelFiltre,LabelAlgo,LabelNbSignBS,LabelnCantonsRes : Tlabel; - RadioReserve,RadioServeurCDM : TradioGroup; + RadioReserve,RadioServeurCDM,rgPilTrains : TradioGroup; LabelDecCde : array[1..19] of TLabel; @@ -694,9 +714,7 @@ var ComboStyle : TcomboBox; function config_com(s : string) : boolean; -function envoi_CDM(s : string) : boolean; function connecte_CDM : boolean; -function place_id(s : string) : string; procedure decodeAig(s : string;var adr : integer;var B : char); function sauve_config : boolean; procedure lit_config; @@ -714,40 +732,10 @@ procedure couleurs_config; implementation -uses UnitDebug,UnitTCO, UnitSR, UnitCDF,UnitAnalyseSegCDM, unitPilote; +uses UnitDebug,UnitTCO, UnitSR, UnitCDF,UnitAnalyseSegCDM, unitPilote, unitclock; {$R *.dfm} -// envoi d'une chaîne Com_IPC à CDM par socket, puis attend l'ack ou le nack -function envoi_CDM(s : string) : boolean; -var temps : integer; -begin - if CDM_connecte=false then begin envoi_CDM:=false;exit;end; - if traceTrames then afficheDebug(s,clLime); - Formprinc.ClientSocketCDM.Socket.SendText(s); - // attend l'ack - ackCDM:=false;nackCDM:=false; - temps:=0; - repeat - inc(temps);Sleep(100); - Application.processMessages; - until fermeSC or ackCDM or nackCDM or (temps>30); // CDM répond < 1s - - if not(ackCDM) or nack then - begin - Affiche('Pas de réponse de CDM Rail',clRed); - end; - - envoi_CDM:=ackCDM; -end; - -// insère l'id pour le serveur CDM dans une chaîne -function place_id(s : string) : string; -begin - delete(s,5,2); - insert(id_cdm,s,5); - place_id:=s; -end; procedure Maj_Hint_Signal(indexSignal : integer); var s : string; @@ -807,7 +795,7 @@ end; function connecte_CDM : boolean; var s : string; - i : integer; + i,erreur : integer; begin result:=false; // déconnexion de l'ancienne liaison éventuelle @@ -841,23 +829,39 @@ begin begin ack_cdm:=false; Id_CDM:=copy(recuCDM,5,2); // récupère l'ID reçu de CDM, à utiliser dans toutes les futures trames - recucdm:=''; - s:='Connecté au serveur CDM rail avec l''ID='+Id_CDM; + val(id_CDM,i,erreur); + if (i>0) and (erreur=0) then + begin + recucdm:=''; + s:='Connecté au serveur CDM rail avec l''ID='+Id_CDM; - Affiche(s,clYellow); - CDM_connecte:=true; + Affiche(s,clYellow); + CDM_connecte:=true; - // demande des services - services_CDM; - // demande la description des trains - s:=place_id('C-C-01-0002-DSCTRN-DLOAD|000|'); - ntrains_cdm:=0; - envoi_CDM(s); - sleep(10); - Application.ProcessMessages; - SauvefiltrageDet0:=filtrageDet0; - filtrageDet0:=0; - result:=true; + // demande des services + services_CDM; + // demande la description des trains + s:=place_id('C-C-01-0002-DSCTRN-DLOAD|000|'); + ntrains_cdm:=0; + envoi_CDM(s); + sleep(10); + Application.ProcessMessages; + SauvefiltrageDet0:=filtrageDet0; // en mode cdm,filtrage détecteur à 0 + filtrageDet0:=0; + result:=true; + end + else + begin + Affiche('Erreur ID ',clred); + cdm_connecte:=false; + result:=false; + end; + end + else + begin + Affiche('Pas de réponse de CDM',clred); + cdm_connecte:=false; + result:=false; end; end; end @@ -865,6 +869,8 @@ begin begin if adresseIPCDM='0' then Affiche('La connexion à CDM n''est pas demandée car l''adresse IP est nulle dans '+NomConfig,clcyan); if not(IpOk(AdresseIPCDM)) then Affiche('Adresse IP CDM incorrecte : '+AdresseIPCDM,clcyan); + cdm_connecte:=false; + result:=false; end; end; @@ -1283,19 +1289,19 @@ begin val(sa,l,erreur); // nombre de feux du signal directionnel if l>6 then begin - Affiche('Erreur 672.1 ligne '+chaine_signal+' 6 feux maximum pour un panneau directionnel',clred); + Affiche('Erreur 672.1 : '+chaine_signal+' 6 feux maximum pour un panneau directionnel',clred); exit; end; if l<3 then begin - Affiche('Erreur 672.2 ligne '+chaine_signal+' 3 feux minimum pour un panneau directionnel',clred); + Affiche('Erreur 672.2 : '+chaine_signal+' 3 feux minimum pour un panneau directionnel',clred); exit; end; Signaux[i].aspect:=l+10;Delete(s,1,j); // décodeur val(s,adr,erreur); Signaux[i].decodeur:=adr; - if (adr>NbDecodeur-1) then Affiche('Erreur 673 ligne '+chaine_signal+' : erreur décodeur inconnu',clred); + if (adr>NbDecodeur-1) then Affiche('Erreur 673 : '+chaine_signal+' : erreur décodeur inconnu',clred); j:=pos(',',s);Delete(s,1,j); // liste des aiguillages k:=1; // numéro de feux directionnels @@ -1304,7 +1310,7 @@ begin delete(s,1,1); // supprimer ( ou le , j:=1; // Nombre de descriptions d'aiguillages dans le signal repeat - if s[1]<>'A' then begin Affiche('Erreur 674 ligne '+chaine_signal,clred);exit;end; + if s[1]<>'A' then begin Affiche('Erreur 674 - manque liste d''aiguillage(s) '+chaine_signal,clred);exit;end; delete(s,1,1); val(s,adr,erreur); // adresse c:=#0; @@ -1342,7 +1348,7 @@ begin j:=pos(',',s); val(s,Signaux[i].decodeur,erreur); - if (Signaux[i].decodeur>NbDecodeurdeBase+NbreDecPers-1) then Affiche('Erreur 677 Ligne '+chaine_signal+' : erreur décodeur inconnu: '+intToSTR(Signaux[i].decodeur),clred); + if (Signaux[i].decodeur>NbDecodeurdeBase+NbreDecPers-1) then Affiche('Erreur 677 : '+chaine_signal+' : erreur décodeur inconnu: '+intToSTR(Signaux[i].decodeur),clred); if j<>0 then delete(s,1,j); Signaux[i].Adr_el_suiv1:=0;Signaux[i].Adr_el_suiv2:=0;Signaux[i].Adr_el_suiv3:=0;Signaux[i].Adr_el_suiv4:=0; Signaux[i].Btype_Suiv1:=rien;Signaux[i].Btype_Suiv2:=rien;Signaux[i].Btype_Suiv3:=rien;Signaux[i].Btype_Suiv4:=rien; @@ -1365,7 +1371,7 @@ begin Delete(s,1,k); if Adr>NbMaxDet then begin - Affiche('Erreur 677A : ligne '+chaine_signal+' : adresse détecteur trop grand: '+intToSTR(adr),clred); + Affiche('Erreur 677A : '+chaine_signal+' : adresse détecteur trop grand: '+intToSTR(adr),clred); Adr:=NbMaxDet; end; end; @@ -1393,7 +1399,7 @@ begin Val(s,adr,erreur); if Adr>NbMaxDet then begin - Affiche('Erreur 677B : ligne '+chaine_signal+' : adresse élément trop grand: '+intToSTR(adr),clred); + Affiche('Erreur 677B : '+chaine_signal+' : adresse élément trop grand: '+intToSTR(adr),clred); Adr:=NbMaxDet; end; if (j=1) then Signaux[i].Adr_el_suiv1:=Adr; @@ -1483,7 +1489,7 @@ begin delete(s,1,erreur); if k=0 then begin - if Signaux[i].decodeur=6 then begin Affiche('Erreur 680 Ligne '+chaine_signal+' Manque définition décodeur UniSemaf signal '+intToSTR(adresse),clred);end; + if Signaux[i].decodeur=6 then begin Affiche('Erreur 680 : '+chaine_signal+' Manque définition décodeur UniSemaf signal '+intToSTR(adresse),clred);end; end else begin @@ -1491,10 +1497,10 @@ begin if Signaux[i].decodeur=6 then begin erreur:=verif_UniSemaf(adresse,k); - if erreur=1 then begin Affiche('Erreur 681 Ligne '+chaine_signal+' Erreur code Unisemaf',clred);end; + if erreur=1 then begin Affiche('Erreur 681 : '+chaine_signal+' Erreur code Unisemaf',clred);end; if erreur=2 then begin - Affiche('Erreur 682 Ligne '+chaine_signal+' Erreur cohérence signal (Adresse='+intToSTR(adresse)+' Aspect='+intToSTR(asp)+' et code Unisemaf=('+intToSTR(k)+')',clred); + Affiche('Erreur 682 : '+chaine_signal+' Erreur cohérence signal (Adresse='+intToSTR(adresse)+' Aspect='+intToSTR(asp)+' et code Unisemaf=('+intToSTR(k)+')',clred); end; end; end; @@ -1624,24 +1630,28 @@ begin end; end; -// transforme l'actionneur type loco ou actionneur ou son du tableau en texte +// transforme l'actionneur type loco ou actionneur ou son ou vitesse du tableau en texte // paramètre d'entrée : index function encode_act_loc_son(i : integer): string; var s : string; - adresse : integer; + adresse,adresse2 : integer; begin // adresse adresse:=Tablo_Actionneur[i].adresse; + adresse2:=Tablo_Actionneur[i].adresse2; // type déclencheur case Tablo_Actionneur[i].typdeclenche of 0 : s:=IntToSTR(adresse);// if tablo_actionneur[i].det then s:=s+'Z'; - // type mémoire de zone - 3 : s:='Mem['+IntToSTR(adresse)+','+IntToSTR(Tablo_Actionneur[i].adresse2)+']'; + // horloge + 1 : S:='H'+IntToSTR(adresse)+'h'+IntToSTR(adresse2); // type aiguillage 2 : s:='A'+IntToSTR(adresse); + // type mémoire de zone + 3 : s:='Mem['+IntToSTR(adresse)+','+IntToSTR(Tablo_Actionneur[i].adresse2)+']'; end; + // type d'action if Tablo_Actionneur[i].loco then s:=s+','+IntToSTR(Tablo_Actionneur[i].Etat)+','+Tablo_Actionneur[i].trainDecl+',F'+ IntToSTR(Tablo_Actionneur[i].fonction)+','+intToSTR(Tablo_Actionneur[i].tempo)+ @@ -1660,6 +1670,10 @@ begin if Tablo_Actionneur[i].periph then s:=s+','+IntToSTR(Tablo_Actionneur[i].Etat)+','+Tablo_Actionneur[i].trainDecl+',ACC'+IntToSTR(Tablo_Actionneur[i].fonction)+','+Tablo_Actionneur[i].trainDest; + if Tablo_Actionneur[i].vit then + s:=s+','+IntToSTR(Tablo_Actionneur[i].Etat)+','+Tablo_Actionneur[i].trainDecl+',V'+IntToSTR(Tablo_Actionneur[i].fonction)+','+Tablo_Actionneur[i].trainDest; + + encode_act_loc_son:=s; end; @@ -1675,7 +1689,7 @@ begin s:=''; // par actionneur - if tablo_PN[i].Voie[1].ActFerme<>0 then + if tablo_pn[i].actionneur then begin for voie:=1 to NbVoies do begin @@ -1685,7 +1699,7 @@ begin end else - // par détecteur + // par zones de détecteur begin s:=''; for voie:=1 to NbVoies do @@ -1736,12 +1750,18 @@ begin // entête // copie_commentaire; - s:='/ Fichier de configuration de signaux_complexes_GL version '+version+sousversion; + s:='/ Fichier de configuration de signaux_complexes_GL version '+versionSC+sousversion; writeln(fichierN,s); writeln(fichierN,largeurF_ch+'=',largeurF); writeln(fichierN,hauteurF_ch+'=',hauteurF); writeln(fichierN,OffsetXF_ch+'=',OffsetXF); writeln(fichierN,OffsetYF_ch+'=',OffsetYF); + + writeln(fichierN,largeurFC_ch+'=',largeurFC); + writeln(fichierN,hauteurFC_ch+'=',hauteurFC); + writeln(fichierN,OffsetXFC_ch+'=',OffsetXFC); + writeln(fichierN,OffsetYFC_ch+'=',OffsetYFC); + writeln(fichierN,PosSplitter_ch+'=',PosSplitter); writeln(fichierN,AvecVerifIconesTCO_ch+'=',AvecVerifIconesTCO); @@ -1800,6 +1820,10 @@ begin if AvecInitAiguillages then s:='1' else s:='0'; writeln(fichierN,Init_Aig_ch+'='+s); + // avec ou sans initialisation des aiguillages + if PilotageTrainsCDMNom then s:='1' else s:='0'; + writeln(fichierN,PilotageTrainsCDM_ch+'='+s); + // avec ou sans demande de la position des aiguillages en mode autonome if AvecDemandeAiguillages then s:='1' else s:='0'; writeln(fichierN,Init_dem_aig_ch+'='+s); @@ -2040,6 +2064,37 @@ begin writeln(fichierN,s); end; writeln(fichierN,'0'); + + // horloge + writeln(fichierN,'/------------'); + writeln(fichierN,section_horloge_ch); + s:=horlogeInterne_ch+'='; + if horlogeInterne then s:=s+'1' else s:=s+'0'; + writeln(fichierN,s); + s:=LanceHorl_ch+'='; + if LanceHorl then s:=s+'1' else s:=s+'0'; + writeln(fichierN,s); + s:=AffHorl_ch+'='; + if AffHorl then s:=s+'1' else s:=s+'0'; + writeln(fichierN,s); + + s:=relanceHorl_init_ch+'='; + if relanceHorl_init then s:=s+'1' else s:=s+'0'; + writeln(fichierN,s); + + s:=HeureInit_ch+'='+intToSTR(HeureInit); + writeln(fichierN,s); + s:=MinuteInit_ch+'='+intToSTR(MinuteInit); + writeln(fichierN,s); + s:=RetourHeure_ch+'='+intToSTR(RetourHeure); + writeln(fichierN,s); + s:=RetourMinute_ch+'='+intToSTR(RetourMinute); + writeln(fichierN,s); + + s:=DureeMinute_ch+'='+intToSTR(DureeMinute); + writeln(fichierN,s); + writeln(fichierN,'0'); + closefile(fichierN); end; @@ -2271,6 +2326,24 @@ var s,sa,SOrigine: string; // Aaiguillage = aiguillage s:=sOrigine; // travailler en min/maj + // évènement actionneur par horloge + if (upcase(s[1])='H') then + begin + Tablo_actionneur[maxtablo_act].typdeclenche:=1; // type horloge + Delete(s,1,1); + val(s,j,erreur); + Tablo_actionneur[maxtablo_act].adresse:=j; //heure + delete(s,1,erreur); + val(s,j,erreur); + Tablo_actionneur[maxtablo_act].adresse2:=j; // minute + delete(s,1,erreur); + i:=pos(',',s); + delete(s,1,i); + i:=pos(',',s); + delete(s,1,i); + end + else + // évènement actionneur par aiguillage if (upcase(s[1])='A') then begin @@ -2332,6 +2405,7 @@ var s,sa,SOrigine: string; Tablo_actionneur[maxtablo_act].loco:=true; Tablo_actionneur[maxtablo_act].son:=false; Tablo_actionneur[maxtablo_act].periph:=false; + Tablo_actionneur[maxtablo_act].vit:=false; delete(s,1,1); val(s,j,erreur); @@ -2343,10 +2417,33 @@ var s,sa,SOrigine: string; Delete(s,1,erreur); Tablo_actionneur[maxTablo_act].trainDest:=s; - s:=''; inc(maxTablo_act); - end; + end + else + + if upcase(s[1])='V' then + begin + // -----------------vitesse + Tablo_actionneur[maxtablo_act].act:=false; + Tablo_actionneur[maxtablo_act].loco:=false; + Tablo_actionneur[maxtablo_act].son:=false; + Tablo_actionneur[maxtablo_act].periph:=false; + Tablo_actionneur[maxtablo_act].vit:=true; + + delete(s,1,1); + i:=pos(',',s); + if i=0 then sa:=s; + sa:=copy(s,1,i-1); + val(sa,j,erreur); + Tablo_actionneur[maxTablo_act].fonction:=j; + Delete(s,1,i); + + Tablo_actionneur[maxTablo_act].trainDest:=s; + + inc(maxTablo_act); + end + else if uppercase(copy(s,1,3))='ACC' then begin @@ -2355,6 +2452,7 @@ var s,sa,SOrigine: string; Tablo_actionneur[maxtablo_act].loco:=false; Tablo_actionneur[maxtablo_act].son:=false; Tablo_actionneur[maxtablo_act].periph:=true; + Tablo_actionneur[maxtablo_act].vit:=false; delete(s,1,3); val(s,j,erreur); @@ -2376,13 +2474,14 @@ var s,sa,SOrigine: string; end else - if length(s)>0 then if s[1]='"' then + if s[1]='"' then begin // -----------------son Tablo_actionneur[maxtablo_act].act:=false; Tablo_actionneur[maxtablo_act].son:=true; Tablo_actionneur[maxtablo_act].loco:=false; Tablo_actionneur[maxtablo_act].periph:=false; + Tablo_actionneur[maxtablo_act].vit:=false; delete(s,1,1); i:=pos('"',s); s:=copy(s,1,i-1); @@ -2392,12 +2491,14 @@ var s,sa,SOrigine: string; inc(maxTablo_act); end else + // périphérique if length(s)>0 then if (upcase(s[1])='A') and (upcase(s[2])<>'C') then begin Tablo_actionneur[maxtablo_act].act:=true; Tablo_actionneur[maxtablo_act].son:=false; Tablo_actionneur[maxtablo_act].loco:=false; Tablo_actionneur[maxtablo_act].periph:=false; + Tablo_actionneur[maxtablo_act].vit:=false; delete(s,1,1); val(s,j,erreur); @@ -2430,6 +2531,7 @@ var s,sa,SOrigine: string; if (i0) then begin // zone de détection + Tablo_PN[NbrePN].actionneur:=false; val(s,j,erreur); Tablo_PN[NbrePN].voie[NbreVoies].detZ1F:=j; delete(s,1,erreur); @@ -2448,6 +2550,7 @@ var s,sa,SOrigine: string; else begin // actionneurs + Tablo_PN[NbrePN].actionneur:=true; val(s,j,erreur); Tablo_PN[NbrePN].voie[NbreVoies].ActFerme:=j; // Affiche('Ferme='+intToSTR(j),clyellow); @@ -3052,39 +3155,134 @@ var s,sa,SOrigine: string; i:=pos(',',sa);Delete(sa,1,i); val(sa,i,erreur); - if (i<2) and (upcase(sa[1])<>'C') then // adresse ip ou Com + // si pas de protocole + if sa<>'' then begin - val(sa,i,erreur); - Tablo_periph[NbPeriph].dtr:=i=1; - i:=pos(',',sa);Delete(sa,1,i); + if (i<2) and (upcase(sa[1])<>'C') then // adresse ip ou Com + begin + val(sa,i,erreur); + Tablo_periph[NbPeriph].dtr:=i=1; + i:=pos(',',sa);Delete(sa,1,i); - val(sa,i,erreur); - Tablo_periph[NbPeriph].rts:=i=1; - i:=pos(',',sa);Delete(sa,1,i); - end; + val(sa,i,erreur); + Tablo_periph[NbPeriph].rts:=i=1; + i:=pos(',',sa);Delete(sa,1,i); + end; - Tablo_periph[NbPeriph].protocole:=uppercase(sa); - i:=com_socket(NbPeriph); - if i=1 then - begin - inc(NbPeriph_COMUSB); - Tablo_periph[NbPeriph].numComposant:=NbPeriph_COMUSB; - end; - if i=2 then - begin - inc(NbPeriph_socket); - Tablo_periph[NbPeriph].numComposant:=NbPeriph_socket; - end; - if i=0 then Affiche('Erreur 96 : le périphérique '+Tablo_periph[NbPeriph].nom+' n''est pas reconnu comme COM/USB ou socket',clred); + Tablo_periph[NbPeriph].protocole:=uppercase(sa); + i:=com_socket(NbPeriph); + if i=1 then + begin + inc(NbPeriph_COMUSB); + Tablo_periph[NbPeriph].numComposant:=NbPeriph_COMUSB; + end; + if i=2 then + begin + inc(NbPeriph_socket); + Tablo_periph[NbPeriph].numComposant:=NbPeriph_socket; + end; + if i=0 then Affiche('Erreur 96 : le périphérique '+Tablo_periph[NbPeriph].nom+' n''est pas reconnu comme COM/USB ou socket',clred); - // extraire le numéro de com5:9600,n,8,1 - i:=extract_int(sa); - if i=0 then Affiche('Erreur 97 - Port COM nul : '+sOrigine,clred); - Tablo_periph[NbPeriph].NumCom:=i; + // extraire le numéro de com5:9600,n,8,1 + i:=extract_int(sa); + if i=0 then Affiche('Erreur 97 - Port COM nul : '+sOrigine,clred); + Tablo_periph[NbPeriph].NumCom:=i; + end; end; until (sOrigine='0') or (NbPeriph>=NbMaxi_Periph); end; + procedure compile_horloge; + begin + repeat + lit_ligne; + if s<>'0' then + begin + sa:=uppercase(horlogeInterne_ch); + i:=pos(sa,s); + if i=1 then + begin + inc(nv); + delete(s,i,length(sa)+1); + horlogeInterne:=s[1]='1'; + end; + + sa:=uppercase(LanceHorl_ch); + i:=pos(sa,s); + if i=1 then + begin + inc(nv); + delete(s,i,length(sa)+1); + LanceHorl:=s[1]='1'; + end; + + sa:=uppercase(AffHorl_ch); + i:=pos(sa,s); + if i=1 then + begin + inc(nv); + delete(s,i,length(sa)+1); + AffHorl:=s[1]='1'; + end; + + sa:=uppercase(relanceHorl_init_ch); + i:=pos(sa,s); + if i=1 then + begin + inc(nv); + delete(s,i,length(sa)+1); + relanceHorl_init:=s[1]='1'; + end; + + sa:=uppercase(RetourHeure_ch); + i:=pos(sa,s); + if i=1 then + begin + inc(nv); + delete(s,i,length(sa)+1); + val(s,RetourHeure,erreur); + end; + + sa:=uppercase(RetourMinute_ch); + i:=pos(sa,s); + if i=1 then + begin + inc(nv); + delete(s,i,length(sa)+1); + val(s,RetourMinute,erreur); + end; + + sa:=uppercase(HeureInit_ch); + i:=pos(sa,s); + if i=1 then + begin + inc(nv); + delete(s,i,length(sa)+1); + val(s,HeureInit,erreur); + end; + + sa:=uppercase(MinuteInit_ch); + i:=pos(sa,s); + if i=1 then + begin + inc(nv); + delete(s,i,length(sa)+1); + val(s,MinuteInit,erreur); + end; + + sa:=uppercase(DureeMinute_ch); + i:=pos(sa,s); + if i=1 then + begin + inc(nv); + delete(s,i,length(sa)+1); + val(s,DureeMinute,erreur); + end; + + end; + until (sOrigine='0') or (s=''); + end; + procedure lit_flux; label ici1,ici2,ici3,ici4 ; @@ -3196,6 +3394,39 @@ var s,sa,SOrigine: string; val(s,OffsetYF,erreur); end; + sa:=uppercase(LargeurFC_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + delete(s,i,length(sa)); + val(s,LargeurFC,erreur); + end; + + sa:=uppercase(HauteurFC_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + delete(s,i,length(sa)); + val(s,HauteurFC,erreur); + end; + + sa:=uppercase(OffsetXFC_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + delete(s,i,length(sa)); + val(s,OffsetXFC,erreur); + end; + + sa:=uppercase(OffsetYFC_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + delete(s,i,length(sa)); + val(s,OffsetYFC,erreur); + end; + + sa:=uppercase(PosSplitter_ch)+'='; i:=pos(sa,s); if i=1 then @@ -3419,6 +3650,16 @@ var s,sa,SOrigine: string; AvecInitAiguillages:=s='1'; end; + // avec ou sans initialisation des aiguillages + sa:=uppercase(PilotageTrainsCDM_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + inc(nv); + delete(s,i,length(sa)); + PilotageTrainsCDMNom:=s='1'; + end; + // avec demande de position des aiguillages en mode autonome au démarrage sa:=uppercase(Init_dem_aig_ch)+'='; i:=pos(sa,s); @@ -3811,6 +4052,14 @@ var s,sa,SOrigine: string; compile_periph; end; + // section horloge + sa:=uppercase(section_horloge_ch); + if pos(sa,s)<>0 then + begin + compile_horloge; + end; + + inc(it); until (eof(fichier)); @@ -3890,7 +4139,11 @@ begin Detecteur[i].IndexTrain:=0; Ancien_detecteur[i]:=false; end; - //Affiche('Lecture du fichier de configuration '+NomConfig,clyellow); + + GetDir(0,s); + Affiche('Lecture du fichier de configuration du répertoire',clYellow); + Affiche(s,clyellow); + try assignFile(fichier,NomConfig); reset(fichier); @@ -3911,6 +4164,7 @@ begin Srvc_tdcc:=false; TimoutMaxInterface:=7; AvecInitAiguillages:=true; + PilotageTrainsCDMNom:=true; AvecDemandeInterfaceUSB:=true; AvecDemandeInterfaceEth:=true; lay:=''; @@ -4177,6 +4431,7 @@ begin Raz_Acc_signaux:=CheckBoxRazSignaux.checked; AffAigND:=CheckBoxMsgAigInc.checked; AvecInitAiguillages:=CheckBoxInitAig.Checked; + PilotageTrainsCDMNom:=rgPilTrains.ItemIndex=1; AvecDemandeAiguillages:=checkPosAig.checked; AvecDemandeInterfaceUSB:=CheckBoxDemarUSB.checked; AvecDemandeInterfaceEth:=CheckBoxDemarEth.checked; @@ -4261,7 +4516,6 @@ begin end; - procedure champs_dec_centrale; var i,nombre : integer; begin @@ -4286,8 +4540,8 @@ begin ComboL2[i].Visible:=false; ShapeT[i].Visible:=false; end; - - with FormConfig do + + with FormConfig do begin ComboBoxDecCde.Visible:=false; LabelTypCde.Visible:=false; @@ -4506,10 +4760,20 @@ procedure maj_champs_combos(i: integer); var j,n : integer; s : string; begin - j:=com_socket(i); s:=Tablo_periph[i].nom; + j:=com_socket(i); + if (j<1) or (j>2) then + begin + Affiche('Erreur 170 : type périphérique inconnu='+intToSTR(j),clred); + exit; + end; + if i>NbMaxi_Periph then + begin + Affiche('Erreur 171 : index périphérique dépassé='+intToSTR(i),clred); + exit; + end; if j=1 then s:=s+' (COM'+intToSTR(Tablo_periph[i].NumCom)+')'; - if j=2 then s:=s+Tablo_periph[i].nom+' ('+Tablo_periph[i].protocole+')'; + if j=2 then s:=s+' ('+Tablo_periph[i].protocole+')'; with formconfig do begin n:=comboBoxACCComUSB.Items.Count; @@ -4793,6 +5057,24 @@ begin visible:=true; end; + {$IFDEF CompilerVersion < 28.0}} //- Delphi7 ----------------------------------------- + labelD11.Visible:=false; + {$ENDIF} + + rgPilTrains:=TRadioGroup.Create(FormConfig.TabSheetPeriph); + with rgPilTrains do + begin + Left:=GroupBoxDivers.Left;Top:=GroupBoxDivers.top+GroupBoxDivers.Height+10;width:=GroupBoxDivers.width;Height:=55; + caption:='Méthode de pilotage des trains vers CDM Rail'; + name:='gbPilTrains'; + parent:=TabSheetCDM; + hint:='Choix du mode de pilotage des trains'+#13+ + 'par adresse ou par nom'; + ShowHint:=true; + items.Add('par adresse de train'); + items.Add('par nom de train'); + end; + // création des champs dynamiques de l'onglet décodeurs for i:=1 to 10 do begin @@ -5126,7 +5408,7 @@ begin parent:=GroupBoxPNZ; end; - LbZPnVoie1:=Tlabel.create(formconfig.GroupBoxPNA); + LbZPnVoie1:=Tlabel.create(formconfig.GroupBoxPNZ); with LbZPnVoie1 do begin Left:=10;Top:=50;Width:=50;Height:=12; @@ -5134,7 +5416,7 @@ begin name:='LbZPnVoie1'; parent:=GroupBoxPNZ; end; - EditZDet1V1F:=TEdit.create(FormConfig.GroupBoxPNA); + EditZDet1V1F:=TEdit.create(FormConfig.GroupBoxPNZ); with EditZDet1V1F do begin Name:='EditZDet1V1F'; @@ -5145,7 +5427,7 @@ begin parent:=GroupBoxPNZ; onChange:=formConfig.modif_editT; end; - EditZDet2V1F:=TEdit.create(FormConfig.GroupBoxPNA); + EditZDet2V1F:=TEdit.create(FormConfig.GroupBoxPNZ); with EditZDet2V1F do begin Name:='EditZDet2V1F'; @@ -5156,7 +5438,7 @@ begin parent:=GroupBoxPNZ; onChange:=formConfig.modif_editT; end; - EditZDet1V1O:=TEdit.create(FormConfig.GroupBoxPNA); + EditZDet1V1O:=TEdit.create(FormConfig.GroupBoxPNZ); with EditZDet1V1O do begin Name:='EditZDet1V1O'; @@ -5167,7 +5449,7 @@ begin parent:=GroupBoxPNZ; onChange:=formConfig.modif_editT; end; - EditZDet2V1O:=TEdit.create(FormConfig.GroupBoxPNA); + EditZDet2V1O:=TEdit.create(FormConfig.GroupBoxPNZ); with EditZDet2V1O do begin Name:='EditZDet2V1O'; @@ -5179,7 +5461,7 @@ begin onChange:=formConfig.modif_editT; end; - LbZPnVoie2:=Tlabel.create(formconfig.GroupBoxPNA); + LbZPnVoie2:=Tlabel.create(formconfig.GroupBoxPNZ); with LbZPnVoie2 do begin Left:=10;Top:=74;Width:=40;Height:=12; @@ -5187,7 +5469,7 @@ begin name:='LbZPnVoie2'; parent:=GroupBoxPNZ; end; - EditZDet1V2F:=TEdit.create(FormConfig.GroupBoxPNA); + EditZDet1V2F:=TEdit.create(FormConfig.GroupBoxPNZ); with EditZDet1V2F do begin Name:='EditZDet1V2F'; @@ -5198,7 +5480,7 @@ begin parent:=GroupBoxPNZ; onChange:=formConfig.modif_editT; end; - EditZDet2V2F:=TEdit.create(FormConfig.GroupBoxPNA); + EditZDet2V2F:=TEdit.create(FormConfig.GroupBoxPNZ); with EditZDet2V2F do begin Name:='EditZDet2V2F'; @@ -5209,7 +5491,7 @@ begin parent:=GroupBoxPNZ; onChange:=formConfig.modif_editT; end; - EditZDet1V2O:=TEdit.create(FormConfig.GroupBoxPNA); + EditZDet1V2O:=TEdit.create(FormConfig.GroupBoxPNZ); with EditZDet1V2O do begin Name:='EditZDet1V2O'; @@ -5220,7 +5502,7 @@ begin parent:=GroupBoxPNZ; onChange:=formConfig.modif_editT; end; - EditZDet2V2O:=TEdit.create(FormConfig.GroupBoxPNA); + EditZDet2V2O:=TEdit.create(FormConfig.GroupBoxPNZ); with EditZDet2V2O do begin Name:='EditZDet2V2O'; @@ -5233,7 +5515,7 @@ begin end; // voie 3 - LbZPnVoie3:=Tlabel.create(formconfig.GroupBoxPNA); + LbZPnVoie3:=Tlabel.create(formconfig.GroupBoxPNZ); with LbZPnVoie3 do begin Left:=10;Top:=98;Width:=50;Height:=12; @@ -5241,7 +5523,7 @@ begin name:='LbZPnVoie3'; parent:=GroupBoxPNZ; end; - EditZDet1V3F:=TEdit.create(FormConfig.GroupBoxPNA); + EditZDet1V3F:=TEdit.create(FormConfig.GroupBoxPNZ); with EditZDet1V3F do begin Name:='EditZDet1V3F'; @@ -5252,7 +5534,7 @@ begin parent:=GroupBoxPNZ; onChange:=formConfig.modif_editT; end; - EditZDet2V3F:=TEdit.create(FormConfig.GroupBoxPNA); + EditZDet2V3F:=TEdit.create(FormConfig.GroupBoxPNZ); with EditZDet2V3F do begin Name:='EditZDet2V3F'; @@ -5263,7 +5545,7 @@ begin parent:=GroupBoxPNZ; onChange:=formConfig.modif_editT; end; - EditZDet1V3O:=TEdit.create(FormConfig.GroupBoxPNA); + EditZDet1V3O:=TEdit.create(FormConfig.GroupBoxPNZ); with EditZDet1V3O do begin Name:='EditZDet1V3O'; @@ -5274,7 +5556,7 @@ begin showhint:=true; onChange:=formConfig.modif_editT; end; - EditZDet2V3O:=TEdit.create(FormConfig.GroupBoxPNA); + EditZDet2V3O:=TEdit.create(FormConfig.GroupBoxPNZ); with EditZDet2V3O do begin Name:='EditZDet2V3O'; @@ -5286,7 +5568,7 @@ begin onChange:=formConfig.modif_editT; end; // voie 4 - LbZPnVoie4:=Tlabel.create(formconfig.GroupBoxPNA); + LbZPnVoie4:=Tlabel.create(formconfig.GroupBoxPNZ); with LbZPnVoie4 do begin Left:=10;Top:=122;Width:=50;Height:=12; @@ -5294,7 +5576,7 @@ begin name:='LbZPnVoie4'; parent:=GroupBoxPNZ; end; - EditZDet1V4F:=TEdit.create(FormConfig.GroupBoxPNA); + EditZDet1V4F:=TEdit.create(FormConfig.GroupBoxPNZ); with EditZDet1V4F do begin Name:='EditZDet1V4F'; @@ -5305,7 +5587,7 @@ begin parent:=GroupBoxPNZ; onChange:=formConfig.modif_editT; end; - EditZDet2V4F:=TEdit.create(FormConfig.GroupBoxPNA); + EditZDet2V4F:=TEdit.create(FormConfig.GroupBoxPNZ); with EditZDet2V4F do begin Name:='EditZDet2V4F'; @@ -5316,7 +5598,7 @@ begin parent:=GroupBoxPNZ; onChange:=formConfig.modif_editT; end; - EditZDet1V4O:=TEdit.create(FormConfig.GroupBoxPNA); + EditZDet1V4O:=TEdit.create(FormConfig.GroupBoxPNZ); with EditZDet1V4O do begin Name:='EditZDet1V4O'; @@ -5327,7 +5609,7 @@ begin showhint:=true; onChange:=formConfig.modif_editT; end; - EditZDet2V4O:=TEdit.create(FormConfig.GroupBoxPNA); + EditZDet2V4O:=TEdit.create(FormConfig.GroupBoxPNZ); with EditZDet2V4O do begin Name:='EditZDet2V4O'; @@ -5339,7 +5621,7 @@ begin onChange:=formConfig.modif_editT; end; // voie 5 - LbZPnVoie5:=Tlabel.create(formconfig.GroupBoxPNA); + LbZPnVoie5:=Tlabel.create(formconfig.GroupBoxPNZ); with LbZPnVoie5 do begin Left:=10;Top:=146;Width:=50;Height:=12; @@ -5347,7 +5629,7 @@ begin name:='LbZPnVoie5'; parent:=GroupBoxPNZ; end; - EditZDet1V5F:=TEdit.create(FormConfig.GroupBoxPNA); + EditZDet1V5F:=TEdit.create(FormConfig.GroupBoxPNZ); with EditZDet1V5F do begin Name:='EditZDet1V5F'; @@ -5358,7 +5640,7 @@ begin showhint:=true; onChange:=formConfig.modif_editT; end; - EditZDet2V5F:=TEdit.create(FormConfig.GroupBoxPNA); + EditZDet2V5F:=TEdit.create(FormConfig.GroupBoxPNZ); with EditZDet2V5F do begin Name:='EditZDet2V5F'; @@ -5369,7 +5651,7 @@ begin showhint:=true; onChange:=formConfig.modif_editT; end; - EditZDet1V5O:=TEdit.create(FormConfig.GroupBoxPNA); + EditZDet1V5O:=TEdit.create(FormConfig.GroupBoxPNZ); with EditZDet1V5O do begin Name:='EditZDet1V5O'; @@ -5380,7 +5662,7 @@ begin showhint:=true; onChange:=formConfig.modif_editT; end; - EditZDet2V5O:=TEdit.create(FormConfig.GroupBoxPNA); + EditZDet2V5O:=TEdit.create(FormConfig.GroupBoxPNZ); with EditZDet2V5O do begin Name:='EditZDet2V5O'; @@ -5719,7 +6001,7 @@ begin Left:=200;Top:=cbDTR.top+20;Width:=100;Height:=17; caption:='RTS'; name:='cbRTS'; - hint:='COM/USB uniquement : mise à 0 ou 1 de ligne RTS'; + hint:='COM/USB uniquement : mise à 0 ou 1 de la ligne RTS'; ShowHint:=true; onclick:=formconfig.cb_onclick; end; @@ -5762,17 +6044,14 @@ begin ComboStyle.itemIndex:=Style_Aff; CheckBoxSombre.Visible:=false; ButtonCouleur.Visible:=false; - - {$ELSE} //- Delphi7 ----------------------------------------- - labelD11.Visible:=false; - GroupBoxDivers.Height:=180; {$IFEND} + // onglet avancé LabelAvance1:=TLabel.Create(FormConfig.TabAvance); with LabelAvance1 do begin - Left:=10;Top:=10;Width:=180;Height:=12; + Left:=10;Top:=10;Width:=208;Height:=12; caption:='Paramètres avancés et experts'; name:='LabelAvance1'; Font.Style:=[fsBold]; @@ -5789,7 +6068,7 @@ begin parent:=TabAvance; end; - x:=GroupBoxAvance.width-50; + x:=GroupBoxAvance.width-40; LabelTD:=TLabel.Create(FormConfig.TabAvance); with LabelTD do begin @@ -5835,7 +6114,7 @@ begin with LabelFiltre do begin Left:=10;Top:=70;Width:=170;Height:=12; - caption:='Filtrage des détecteurs (x100 ms)'; + caption:='Filtrage des détecteurs (x100 ms) - Mode autonome'; name:='LabelFiltre'; parent:=GroupBoxAvance; end; @@ -5846,7 +6125,7 @@ begin name:='EditFiltrDet'; text:=''; parent:=GroupBoxAvance; - hint:='Temps de filtrage des détecteurs qui passent à 0'; + hint:='Temps de filtrage des détecteurs qui passent à 0'+#13+'Mode autonome uniquement'; ShowHint:=true; end; @@ -6430,12 +6709,48 @@ begin GroupBox19.Height:=96; ButtonTestAct.Top:=GroupBox19.Top+GroupBox19.Height+8; - with RadioGroupDecl do - begin - top:=GroupBox18.Top; - Width:=GroupBox18.width-15; - Height:=74; - end; + end; +end; + +procedure champs_type_vit; +begin + with formconfig do + begin + positionne; + CheckRaz.Visible:=false; + ComboBoxAccComUSB.Visible:=false; + GroupBoxAct.Caption:='Action pour vitesse locomotive'; + + editTrainDest.Hint:='Train(s) destinataire(s) de la vitesse'; + LabelTempo.Visible:=true; EditTempo.visible:=true; editEtatFoncSortie.visible:=false;LabelA.Visible:=false; + LabelFonction.visible:=true; + LabelFonction.caption:='Vitesse'; + EditFonctionAccess.Hint:='Une vitesse positive ou négative contrôle le sens'+#13+ + 'Une vitesse nulle arrête le train'; + + RadioButtonLoc.Checked:=false; + RadioButtonAccess.Checked:=false; + RadioButtonSon.Checked:=false; + RadioButtonCde.Checked:=false; + RadioButtonVit.Checked:=true; + + EditFonctionAccess.Top:=14; + LabelFonction.Top:=18; + + editTempo.Visible:=false; + labelTempo.visible:=false; + GroupBoxAct.Visible:=true; + GroupBoxPN.Visible:=false; + GroupBoxPNA.Visible:=false; + GroupBoxPNZ.Visible:=false; + EditSon.Visible:=false; + SpeedButtonJoue.Visible:=false; + SpeedButtonCharger.Visible:=false; + EditFonctionAccess.Visible:=true; + LabelNomSon.Visible:=false; + editTrainDest.Visible:=true; + label42.Visible:=true; + Label42.caption:='Train dest'; end; end; @@ -6456,6 +6771,7 @@ begin RadioButtonAccess.Checked:=false; RadioButtonSon.Checked:=false; RadioButtonCde.Checked:=false; + RadioButtonVit.Checked:=false; EditFonctionAccess.Top:=14; LabelFonction.Top:=18; @@ -6494,6 +6810,7 @@ begin RadioButtonAccess.Checked:=false; RadioButtonSon.Checked:=false; RadioButtonCde.Checked:=true; + RadioButtonVit.Checked:=false; GroupBoxAct.Visible:=true; GroupBoxPN.Visible:=false; GroupBoxPNA.Visible:=false; @@ -6526,10 +6843,12 @@ begin RadioButtonLoc.Checked:=false; RadioButtonSon.checked:=false; RadioButtonAccess.Checked:=true; + RadioButtonVit.Checked:=false; GroupBoxAct.Visible:=true; GroupBoxPN.Visible:=false; GroupBoxPNA.Visible:=false; GroupBoxPNZ.Visible:=false; + EditFonctionAccess.Top:=14; LabelFonction.Top:=18; EditSon.Visible:=false; @@ -6567,6 +6886,7 @@ begin RadioButtonAccess.Checked:=false; RadioButtonSon.checked:=true; RadioButtonCde.Checked:=false; + RadioButtonVit.Checked:=false; GroupBoxAct.Visible:=true; GroupBoxPN.Visible:=false; @@ -6577,6 +6897,26 @@ begin end; end; +procedure champs_decl_horloge; +begin + with formconfig do + begin + EditTrainDecl.Visible:=false; + LabelTrain.Visible:=true; + radioButtonActDet.Checked:=false; + radioButtonZones.Checked:=false; + radioButtonAig.Checked:=false; + radioButtonHorl.Checked:=true; + editact2.Visible:=true; + LabelActionneur.Caption:='Heure'+#13+'Minute'; + EditEtatActionneur.visible:=false; + EditAct.Hint:='Heure '; + EditAct2.Hint:='Minute'; + Label30.visible:=false; + LabelTrain.Visible:=false; + end; +end; + procedure champs_decl_actdet; begin with formconfig do @@ -6586,6 +6926,7 @@ begin radioButtonActDet.Checked:=true; radioButtonZones.Checked:=false; radioButtonAig.Checked:=false; + radioButtonHorl.Checked:=false; editact2.Visible:=false; LabelActionneur.Caption:='Actionneur Détecteur'; EditEtatActionneur.Hint:='0 ou 1'; @@ -6600,6 +6941,7 @@ begin radioButtonActDet.Checked:=false; radioButtonZones.Checked:=true; radioButtonAig.Checked:=false; + radioButtonHorl.Checked:=false; EditTrainDecl.Visible:=false; LabelTrain.Visible:=false; editact2.Visible:=true; @@ -6616,9 +6958,11 @@ begin radioButtonActDet.Checked:=false; radioButtonZones.Checked:=false; radioButtonAig.Checked:=true; + radioButtonHorl.Checked:=false; EditAct2.Visible:=false; EditTrainDecl.Visible:=false; LabelTrain.Visible:=false; + editEtatActionneur.Visible:=true; editact2.Visible:=false; LabelActionneur.Caption:='Aiguillage'; EditEtatActionneur.Hint:='1 ou S=dévié 2 ou D=droit'; @@ -6672,10 +7016,12 @@ begin ComboBoxDec.ItemIndex:=Signaux[index].decodeur; decodeur:=Signaux[index].decodeur; + d:=Signaux[index].aspect; ButtonConfigSR.Visible:=false; case decodeur of - 2,7 : ButtonConfigSR.Visible:=true; + 2 : if not(isDirectionnel(index)) then ButtonConfigSR.Visible:=true; //cdf + 7 : ButtonConfigSR.Visible:=true; 5 : ButtonConfigSR.Visible:=true ; // digikeijs 6 : begin EditSpecUni.Visible:=true; @@ -6706,7 +7052,7 @@ begin // plus tard !! if decodeur>=11 then ButtonConfigSR.Visible:=true; - d:=Signaux[index].aspect; + case d of 2 : ComboBoxAsp.ItemIndex:=0; 3 : ComboBoxAsp.ItemIndex:=1; @@ -6889,7 +7235,7 @@ end; // mise à jour des champs graphiques des actionneurs d'après l'index du tableau Procedure aff_champs_act(i : integer); -var j,etatact, adresse,sortie,fonction,tempo,access,typ : integer; +var j,adresse,sortie,fonction,tempo,access,typ : integer; trainDecl,s,s2,adr : string; begin if affevt then affiche('Aff_champs_act('+intToSTR(i)+')',clyellow); @@ -6910,7 +7256,7 @@ begin with formconfig do begin case typ of - 0 : + 0 : // act det begin champs_decl_actdet; editAct.Text:=intToSTR(Tablo_actionneur[i].adresse); @@ -6918,14 +7264,17 @@ begin editEtatFoncSortie.Text:=intToSTR(Tablo_actionneur[i].sortie); EditTrainDecl.Text:=TrainDecl; end; - 3 : - begin - champs_decl_zones; - end; - 2 : - begin - champs_decl_aig; - end; + 1 : begin + champs_decl_horloge; + EditAct.text:=intToSTR(tablo_actionneur[i].adresse); + EditAct2.text:=intToSTR(tablo_actionneur[i].adresse2); + end; + 3 : champs_decl_zones; + 2 : begin + editEtatActionneur.Text:=intToSTR(Tablo_actionneur[i].etat); + editAct.text:=intToSTR(Tablo_actionneur[i].adresse); + champs_decl_aig; + end; end; end; @@ -6938,7 +7287,6 @@ begin champs_type_loco; formconfig.editAct2.Text:=IntToSTR(Tablo_actionneur[i].adresse2); - etatAct:=Tablo_actionneur[i].etat; Adresse:=Tablo_actionneur[i].adresse; //s2:=Tablo_actionneur[i].trainDecl; //trainsauve:=s2; @@ -6950,8 +7298,7 @@ begin adr:=IntToSTR(Adresse); //if det then adr:=adr+'Z'; EditAct.text:=adr; EditAct2.Text:=inttostr(Tablo_actionneur[i].adresse2); - editEtatActionneur.Text:=IntToSTR(etatAct); - //EditTrainDecl.Text:=s2; + editEtatActionneur.Text:=IntToSTR(Tablo_actionneur[i].etat); EditTrainDecl.Text:=trainDecl; EditTrainDest.Text:=Tablo_actionneur[i].trainDest; editFonctionAccess.Text:=intToSTR(fonction); @@ -6963,7 +7310,6 @@ begin if Tablo_actionneur[i].act then begin champs_type_act; - etatAct:=Tablo_actionneur[i].etat ; Adresse:=Tablo_actionneur[i].adresse; sortie:=Tablo_actionneur[i].sortie; //s2:=Tablo_actionneur[i].trainDecl; @@ -6977,7 +7323,7 @@ begin CheckRaz.Checked:=Tablo_actionneur[i].Raz; //EditTrainDecl.Text:=s2; EditTrainDecl.Text:=trainDecl; - EditEtatActionneur.Text:=IntToSTR(etatAct); + EditEtatActionneur.Text:=IntToSTR(Tablo_actionneur[i].etat); editFonctionAccess.Text:=intToSTR(Access); editEtatFoncSortie.Text:=intToSTR(sortie); editTempo.Text:=intToSTR(tempo); @@ -7003,7 +7349,6 @@ begin LabelActionneur.Caption:='Mémoire de Zone'; end; - etatAct:=Tablo_actionneur[i].etat ; Adresse:=Tablo_actionneur[i].adresse; s2:=Tablo_actionneur[i].trainDecl; //trainsauve:=s2; @@ -7017,22 +7362,38 @@ begin //EditTrainDecl.Text:=s2; EditTrainDecl.Text:=trainDecl; EditSon.Text:=s; - EditEtatActionneur.Text:=IntToSTR(etatAct); + EditEtatActionneur.Text:=IntToSTR(Tablo_actionneur[i].etat); end; end; + // périphérique if Tablo_actionneur[i].periph then begin champs_type_periph; with formConfig do begin ComboBoxAccComUSB.ItemIndex:=Tablo_actionneur[i].fonction-1; + EditAct.text:=inttostr(Tablo_actionneur[i].adresse); + EditAct2.Text:=inttostr(Tablo_actionneur[i].adresse2); EditEtatFoncSortie.Text:=intToSTR(Tablo_actionneur[i].etat); EditTrainDest.text:=Tablo_actionneur[i].TrainDest; EditTrainDecl.Text:=trainDecl; end; end; + // vitesse + if Tablo_actionneur[i].vit then + begin + champs_type_vit; + with formConfig do + begin + // EditAct.text:=inttostr(Tablo_actionneur[i].adresse); + // EditTrainDecl.Text:=trainDecl; + EditTrainDest.Text:=Tablo_actionneur[i].trainDest; + editFonctionAccess.Text:=intToSTR(fonction); + end; + end; + end; procedure raz_champs_pn; @@ -7120,10 +7481,19 @@ var erreur,j,v,periph : integer; trouve : boolean; s : string; begin + if affevt then affiche('Aff_champs_PN('+intToSTR(i)+')',clyellow); - if i<1 then exit; + if i<1 then + begin + clicliste:=false; + exit; + end; s:=Uppercase(FormConfig.ListBoxPN.items[i-1]); - if s='' then exit; + if s='' then + begin + clicliste:=false; + exit; + end; with formconfig do begin @@ -7158,10 +7528,12 @@ begin CheckPnPulse.Checked:=trouve; // par actionneur - if Tablo_PN[i].voie[1].detZ2F=0 then + if Tablo_PN[i].actionneur then begin RadioButtonSimple.Checked:=true; RadioButtonZone.Checked:=false; + GroupBoxPNA.Visible:=true; + GroupBoxPNZ.Visible:=false; EditV1F.text:=intToSTR(Tablo_PN[i].voie[1].ActFerme); EditV1O.text:=intToSTR(Tablo_PN[i].voie[1].ActOuvre); v:=Tablo_PN[i].nbvoies; @@ -7192,6 +7564,8 @@ begin // par zone de détecteurs RadioButtonSimple.Checked:=false; RadioButtonZone.Checked:=true; + GroupBoxPNA.Visible:=false; + GroupBoxPNZ.Visible:=true; v:=Tablo_PN[i].nbvoies; j:=Tablo_PN[i].voie[1].detZ1F;if j<>0 then begin @@ -7229,8 +7603,9 @@ begin end; end; end; - end; - end + end; + end; + clicliste:=false; end; procedure raz_champs_act; @@ -7846,7 +8221,7 @@ begin // digital bahn 1: if aspect=20 then begin result:=false;if aff then Affiche('Erreur 340 : Signal '+intToSTR(Adr)+': Combinaison décodeur '+decodeur[dec]+' et aspect '+aspects[indexAspect]+' incompatibles',clred);end; // cdf - 2: if (aspect>10) and (aspect<20) then begin result:=false;if aff then Affiche('Erreur 341 : Signal '+intToSTR(Adr)+': Combinaison décodeur '+decodeur[dec]+' et aspect '+aspects[indexAspect]+' incompatibles',clred);end; + 2: if (aspect>=20) then begin result:=false;if aff then Affiche('Erreur 341 : Signal '+intToSTR(Adr)+': Combinaison décodeur '+decodeur[dec]+' et aspect '+aspects[indexAspect]+' incompatibles',clred);end; // ls dec sncf 3 : if (aspect>10) then begin result:=false;if aff then Affiche('Erreur 342 : Signal '+intToSTR(Adr)+': Combinaison décodeur '+decodeur[dec]+' et aspect '+aspects[indexAspect]+' incompatibles',clred);end; // LEB @@ -8284,7 +8659,7 @@ end; procedure TFormConfig.EditActChange(Sender: TObject); var s,s2 : string; - act,erreur,det2,suiv : integer; + typ,act,erreur,det2,suiv : integer; elsuiv : tEquipement; de : boolean; begin @@ -8295,26 +8670,39 @@ begin with Formconfig do begin s:=EditAct.Text; - if radioButtonLoc.Checked or RadioButtonAccess.Checked or RadioButtonSon.Checked or radioButtonCde.checked then + if radioButtonLoc.Checked or RadioButtonAccess.Checked or RadioButtonSon.Checked or radioButtonCde.checked or RadioButtonVit.checked then begin Val(s,act,erreur); if (s='') or (act<1) then exit; + typ:=Tablo_Actionneur[ligneClicAct+1].typdeclenche; - // 0=actionneur/détecteur 2=evt aig 3=MemZone - if (Tablo_Actionneur[ligneClicAct+1].typdeclenche=3) or (Tablo_Actionneur[ligneClicAct+1].typdeclenche=0) then - s2:='Actionneur/Détecteur '; - if (Tablo_Actionneur[ligneClicAct+1].typdeclenche=2) then s2:='Aiguillage '; + // 0=actionneur/détecteur 1=horloge 2=evt aig 3=MemZone + if (typ=3) or (typ=0) then s2:='Actionneur/Détecteur '; + if (typ=2) then s2:='Aiguillage '; + if (typ=1) then s2:='heure '; EditAct.Hint:=s2+intToSTR(act); + if typ=1 then + begin + if (act<0) or (act>23) or (erreur<>0) then + begin + LabelInfo.caption:='Erreur heure'; + exit; + end; + end; + de:=pos('Z',s)<>0; // si détecteur if de then delete(s,erreur,1); Val(s,act,erreur); if erreur<>0 then begin - LabelInfo.caption:='Erreur adresse actionneur';exit - end else LabelInfo.caption:=' '; + LabelInfo.caption:='Erreur adresse actionneur'; + exit; + end; + + LabelInfo.caption:=' '; tablo_actionneur[ligneClicAct+1].adresse:=act; s:=encode_act_loc_son(ligneClicAct+1); ListBoxAct.Items[ligneClicAct]:=s; @@ -8346,26 +8734,40 @@ begin with Formconfig do begin s:=EditAct2.Text; - if radioButtonLoc.Checked or RadioButtonAccess.Checked or RadioButtonSon.Checked then + //if radioButtonLoc.Checked or RadioButtonAccess.Checked or RadioButtonSon.Checked then begin Val(s,det2,erreur); if (s='') or (det2<1) then exit; + + if tablo_actionneur[ligneClicAct+1].typdeclenche=1 then + begin + if (det2<0) or (det2>60) or (erreur<>0) then + begin + LabelInfo.caption:='Erreur minute'; + exit; + end; + end; + if erreur<>0 then begin - LabelInfo.caption:='Erreur adresse détecteur';exit - end else LabelInfo.caption:=' '; + LabelInfo.caption:='Erreur adresse détecteur'; + exit + end; + LabelInfo.caption:=' '; tablo_actionneur[ligneClicAct+1].adresse2:=det2; s:=encode_act_loc_son(ligneClicAct+1); ListBoxAct.Items[ligneClicAct]:=s; - // vérifier si les détecteurs sont contigus - Val(EditAct.Text,det1,erreur); - if (erreur<>0) or (det1<1) then exit; - det_contigu(det1,det2,suiv,elSuiv); - if (suiv=0) or (suiv>9995) then LabelInfo.Caption:='Les détecteurs '+intToSTR(det1)+' et '+intToSTR(det2)+' ne sont pas contigus' - else LabelInfo.Caption:=''; - + // vérifier si les détecteurs sont contigus si on est en zone + if Tablo_Actionneur[ligneClicAct+1].typdeclenche=3 then + begin + Val(EditAct.Text,det1,erreur); + if (erreur<>0) or (det1<1) then exit; + det_contigu(det1,det2,suiv,elSuiv); + if (suiv=0) or (suiv>9995) then LabelInfo.Caption:='Les détecteurs '+intToSTR(det1)+' et '+intToSTR(det2)+' ne sont pas contigus' + else LabelInfo.Caption:=''; + end; end; end; end; @@ -8398,12 +8800,12 @@ var s : string; etat,erreur,typ : integer; begin if clicliste then exit; - if affevt then affiche('Evt EditActionneur Change',clyellow); + if affevt then affiche('Evt EditEtatActionneur Change',clyellow); if FormConfig.PageControl.ActivePage=FormConfig.TabSheetAct then with Formconfig do begin s:=upperCase(EditEtatActionneur.Text); - if radioButtonLoc.Checked or RadioButtonAccess.Checked or RadioButtonSon.Checked or RadioButtonCde.Checked then + if radioButtonLoc.Checked or RadioButtonAccess.Checked or RadioButtonSon.Checked or RadioButtonCde.Checked or RadioButtonVit.checked then begin typ:=tablo_actionneur[ligneClicAct+1].typdeclenche; if (typ=2) and (s<>'') then // aiguillage @@ -8470,7 +8872,7 @@ begin if FormConfig.PageControl.ActivePage=FormConfig.TabSheetAct then with Formconfig do begin - if radioButtonLoc.Checked or RadioButtonCde.Checked then + if radioButtonLoc.Checked or RadioButtonCde.Checked or RadioButtonVit.checked then begin train:=EditTrainDest.Text; if train='' then @@ -8523,15 +8925,24 @@ begin with Formconfig do begin s:=EditFonctionAccess.Text; - if radioButtonLoc.Checked or RadioButtonAccess.Checked or RadioButtonCde.Checked then + if radioButtonLoc.Checked or RadioButtonAccess.Checked or RadioButtonCde.Checked or RadioButtonVit.checked then begin + LabelInfo.caption:=' '; Val(s,fonction,erreur); + if RadioButtonVit.checked then + begin + if (erreur<>0) or (abs(fonction)>127) then + begin + LabelInfo.caption:='Erreur vitesse';exit; + end; + end + else if (erreur<>0) or (fonction<1) then begin LabelInfo.caption:='Erreur fonction actionneur';exit - end else LabelInfo.caption:=' '; + end; - if radioButtonLoc.Checked then tablo_actionneur[ligneClicAct+1].fonction:=fonction; + if radioButtonLoc.Checked or RadioButtonVit.checked then tablo_actionneur[ligneClicAct+1].fonction:=fonction; if RadioButtonAccess.Checked then Tablo_Actionneur[ligneClicAct+1].accessoire:=fonction; s:=encode_act_loc_son(ligneClicAct+1); @@ -8743,6 +9154,7 @@ begin Tablo_Actionneur[i].Act:=false; Tablo_Actionneur[i].Son:=false; Tablo_Actionneur[i].periph:=false; + Tablo_Actionneur[i].vit:=false; champs_type_loco; val(editact.Text,champ,erreur); @@ -8777,6 +9189,7 @@ begin Tablo_Actionneur[i].Act:=true; Tablo_Actionneur[i].Son:=false; Tablo_Actionneur[i].periph:=false; + Tablo_Actionneur[i].vit:=false; champs_type_act; val(editact.Text,champ,erreur); @@ -8812,6 +9225,7 @@ begin Tablo_Actionneur[i].Act:=false; Tablo_Actionneur[i].Son:=true; Tablo_Actionneur[i].periph:=false; + Tablo_Actionneur[i].vit:=false; champs_type_son; @@ -8845,6 +9259,8 @@ begin Tablo_Actionneur[i].Act:=false; Tablo_Actionneur[i].Son:=false; Tablo_Actionneur[i].periph:=true; + Tablo_Actionneur[i].vit:=false; + champs_type_periph; val(editact.Text,champ,erreur); @@ -8870,6 +9286,41 @@ begin ListBoxAct.Selected[ligneClicAct]:=true; end; +procedure TFormConfig.RadioButtonVitClick(Sender: TObject); +var j,champ,i,erreur : integer; + s,train : string; +begin + if clicListe or (ligneclicAct<0) then exit; + i:=ligneClicAct+1; + if AffEvt then Affiche('RadioVit '+IntToSTR(i),clyellow); + Tablo_Actionneur[i].loco:=false; + Tablo_Actionneur[i].Act:=false; + Tablo_Actionneur[i].Son:=false; + Tablo_Actionneur[i].periph:=false; + Tablo_Actionneur[i].vit:=true; + + champs_type_vit; + + val(editact.Text,champ,erreur); + Tablo_actionneur[i].adresse:=champ ; + val(editEtatActionneur.Text,champ,erreur); + Tablo_actionneur[i].etat:=champ; + train:=EditTrainDecl.Text; + for j:=1 to length(train) do if train[j]=',' then train[j]:='+'; + tablo_actionneur[i].TrainDecl:=train; + + + val(editFonctionAccess.Text,champ,erreur); // vitesse + Tablo_actionneur[i].fonction:=champ; + tablo_actionneur[i].TrainDest:=editTrainDest.Text; + + s:=encode_act_loc_son(i); + ListBoxAct.Items[ligneClicAct]:=s; + ListBoxAct.Selected[ligneClicAct]:=true; + +end; + + procedure TFormConfig.RichPNMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); var ligne : integer; @@ -9849,7 +10300,7 @@ begin ok:=false; end; end; - if nc=2 then // cdf + if (nc=2) and not(isDirectionnel(j)) then // cdf begin if Signaux[j].Na=0 then begin @@ -10262,7 +10713,7 @@ begin model:=BrancheN[i][j].BType; // 1= détecteur 2= aiguillage 4=Buttoir trouvePrec:=false; - if (model=aig) or (model=Tjd) or (model=Tjs) then + if (model=aig) then begin k:=index_aig(detect); // comparer au précédent @@ -10277,6 +10728,19 @@ begin if aiguillage[k].ADevie=AncAdr then trouvePrec:=true; if aiguillage[k].APointe=AncAdr then trouvePrec:=true; end; + if aiguillage[k].modele=crois then + begin + if aiguillage[k].ADroit=AncAdr then trouvePrec:=true; + if aiguillage[k].ADevie=AncAdr then trouvePrec:=true; + if aiguillage[k].Ddroit=AncAdr then trouvePrec:=true; + if aiguillage[k].Ddevie=AncAdr then trouvePrec:=true; + end; + if aiguillage[k].modele=triple then + begin + if aiguillage[k].ADroit=AncAdr then trouvePrec:=true; + if aiguillage[k].ADevie=AncAdr then trouvePrec:=true; + if aiguillage[k].Adevie2=AncAdr then trouvePrec:=true; + end; if (aiguillage[k].modele=Tjd) or (aiguillage[k].modele=TjS) then begin if aiguillage[k].EtatTJD=2 then @@ -10297,13 +10761,6 @@ begin if aiguillage[l].Ddevie=AncAdr then trouvePrec:=true; end; end; - if aiguillage[k].modele=crois then - begin - if aiguillage[k].ADroit=AncAdr then trouvePrec:=true; - if aiguillage[k].ADevie=AncAdr then trouvePrec:=true; - if aiguillage[k].Ddroit=AncAdr then trouvePrec:=true; - if aiguillage[k].Ddevie=AncAdr then trouvePrec:=true; - end; if not(trouvePrec) then begin @@ -10322,6 +10779,13 @@ begin if aiguillage[k].ADevie=SuivAdr then trouveSuiv:=true; if aiguillage[k].APointe=SuivAdr then trouveSuiv:=true; end; + if aiguillage[k].modele=Triple then + begin + if aiguillage[k].ADroit=SuivAdr then trouveSuiv:=true; + if aiguillage[k].ADevie=SuivAdr then trouveSuiv:=true; + if aiguillage[k].APointe=SuivAdr then trouveSuiv:=true; + if aiguillage[k].ADevie2=SuivAdr then trouveSuiv:=true; + end; if (aiguillage[k].modele=Tjd) or (aiguillage[k].modele=TjS) then begin if aiguillage[k].EtatTJD=2 then @@ -11831,7 +12295,7 @@ begin val(EditAct.Text,Adr,erreur); val(EditAct2.Text,Adr2,erreur); Ancien_actionneur[adr]:=0; - Event_act(adr,adr2,etat,''); + Event_act(adr,adr2,etat,'',false); end; procedure TFormConfig.RadioButtonActDetClick(Sender: TObject); @@ -11842,6 +12306,8 @@ begin i:=ligneClicAct+1; if AffEvt then Affiche('RadioBoutonActDet '+IntToSTR(i),clyellow); Tablo_Actionneur[i].typdeclenche:=0; + Label30.Visible:=true; + EditEtatActionneur.Visible:=true; LabelActionneur.Caption:='Actionneur Détecteur'; editAct2.Visible:=false; EditTrainDecl.Visible:=true; @@ -11884,6 +12350,8 @@ begin i:=ligneClicAct+1; if AffEvt then Affiche('RadioBoutonZones '+IntToSTR(i),clyellow); Tablo_Actionneur[i].typdeclenche:=3; + Label30.Visible:=true; + EditEtatActionneur.Visible:=true; LabelActionneur.Caption:='Mémoire de Zone'; EditTrainDecl.Visible:=false; LabelTrain.Visible:=false; @@ -11923,6 +12391,8 @@ begin EditTrainDecl.Visible:=false; LabelTrain.Visible:=false; editAct2.Visible:=false; + Label30.Visible:=true; + EditEtatActionneur.Visible:=true; //editact.Text:=intToSTR(Tablo_actionneur[i].adresse2); EditEtatActionneur.Hint:='1 ou S=dévié 2 ou D=droit'; @@ -11944,6 +12414,42 @@ begin EditAct.Hint:='Aiguillage '+intToSTR(Tablo_actionneur[i].adresse); end; +procedure TFormConfig.RadioButtonHorlClick(Sender: TObject); +var i,champ,erreur : integer; + s : string; +begin + if clicListe or (ligneclicAct<0) then exit; + i:=ligneClicAct+1; + if AffEvt then Affiche('RadioBoutonHorl '+IntToSTR(i),clyellow); + Tablo_Actionneur[i].typdeclenche:=1; + LabelActionneur.Caption:='Heure'+#13+'Minute'; + EditTrainDecl.Visible:=false; + LabelTrain.Visible:=false; + editAct2.Visible:=true; + Label30.Visible:=false; + EditEtatActionneur.Visible:=false; + + //editact.Text:=intToSTR(Tablo_actionneur[i].adresse2); + + //EditEtatActionneur.Hint:='1 ou S=dévié 2 ou D=droit'; + //Tablo_actionneur[i].trainDecl:='X'; + val(editact.Text,champ,erreur); + Tablo_actionneur[i].adresse:=champ ; + val(editEtatActionneur.Text,champ,erreur); + Tablo_actionneur[i].etat:=champ; + val(editFonctionAccess.Text,champ,erreur); + Tablo_actionneur[i].fonction:=champ; + val(editEtatFoncSortie.Text,champ,erreur); + Tablo_actionneur[i].sortie:=champ; + val(editTempo.Text,champ,erreur); + Tablo_actionneur[i].tempo:=champ; + tablo_actionneur[i].Raz:=checkRaz.checked; + s:=encode_act_loc_son(i); + ListBoxAct.Items[ligneClicAct]:=s; + ListBoxAct.Selected[ligneClicAct]:=true; + EditAct.Hint:='heure'; + EditAct2.Hint:='minute'; +end; procedure TFormConfig.SpeedButtonChargerClick(Sender: TObject); var s: string; @@ -12778,6 +13284,42 @@ begin end; end; +// vérifie si une voie d'un PN actionneurs est nulle +function ligne_vide_actPN(voie : integer) : boolean; +var s : string; + t1,t2 : tedit; + v1,v2,erreur : integer; +begin + s:='EditV'+intToSTR(voie)+'F'; + t1:=FormConfig.GroupBoxPNA.findComponent(s) as tedit; + s:='EditV'+intToSTR(voie)+'O'; + t2:=FormConfig.GroupBoxPNA.findComponent(s) as tedit; + val(t1.Text,v1,erreur); + val(t2.Text,v2,erreur); + result:=(v1=0) and (v2=0); +end; + +// vérifie si une voie d'un PN zones de détection est nulle +function ligne_vide_ZonesPN(voie : integer) : boolean; +var s : string; + t1,t2,t3,t4 : tedit; + v1,v2,v3,v4,erreur : integer; +begin + s:='EditZDet1V'+intToSTR(voie)+'F'; + t1:=FormConfig.GroupBoxPNZ.findComponent(s) as tedit; + s:='EditZDet2V'+intToSTR(voie)+'F'; + t2:=FormConfig.findComponent(s) as tedit; + s:='EditZDet1V'+intToSTR(voie)+'O'; + t3:=FormConfig.findComponent(s) as tedit; + s:='EditZDet2V'+intToSTR(voie)+'O'; + t4:=FormConfig.findComponent(s) as tedit; + val(t1.Text,v1,erreur); + val(t2.Text,v2,erreur); + val(t3.Text,v3,erreur); + val(t4.Text,v4,erreur); + result:=(v1=0) and (v2=0) and (v3=0) and (v4=0); +end; + // modif editT procedure Tformconfig.modif_editT(Sender : TObject); var te : tEdit; @@ -12785,7 +13327,6 @@ var te : tEdit; ouvre,ferme,v2Valide,v3valide,v4valide,v5valide : boolean; s,sb : string; begin - if deccourant=0 then exit; te:=Sender as Tedit; s:=lowercase(te.Name); sb:=te.Text; @@ -12805,6 +13346,7 @@ begin if pos('editdecalt',s)<>0 then begin + if deccourant<1 then exit; adr:=extract_int(s); val(sb,i,erreur); if (erreur<>0) or (i<0) then @@ -12817,7 +13359,7 @@ begin exit; end; - // passage à niveau + // passage à niveau - actionneurs if pos('editv',s)<>0 then begin i:=lignecliqueePN+1; @@ -12830,13 +13372,14 @@ begin with Formconfig do begin Val(sb,act,erreur); - if (erreur<>0) or (act<=0) then + if ((erreur<>0) or (act<=0)) and (sb<>'') then begin LabelInfo.caption:='Erreur adresse actionneur'; if ferme then tablo_PN[i].voie[voie].ActFerme:=0; if ouvre then tablo_PN[i].voie[voie].ActOuvre:=0; exit; - end else LabelInfo.caption:=' '; + end + else LabelInfo.caption:=' '; if ferme then tablo_PN[i].voie[voie].ActFerme:=act; if ouvre then tablo_PN[i].voie[voie].ActOuvre:=act; NbVoies:=tablo_PN[i].NbVoies; @@ -12869,10 +13412,18 @@ begin if not(V5Valide) then tablo_PN[i].NbVoies:=4; end; + // corriger le nombre de voies + if ligne_vide_actPN(5) then tablo_PN[i].NbVoies:=4; + if ligne_vide_actPN(4) then tablo_PN[i].NbVoies:=3; + if ligne_vide_actPN(3) then tablo_PN[i].NbVoies:=2; + if ligne_vide_actPN(2) then tablo_PN[i].NbVoies:=1; + if ligne_vide_actPN(1) then tablo_PN[i].NbVoies:=0; + s:=encode_act_PN(i); ListBoxPN.items[lignecliqueePN]:=s; ListBoxPN.Selected[lignecliqueePN]:=true; end; + exit; end; @@ -12893,7 +13444,7 @@ begin s:=te.Text; Val(s,det,erreur); - if (erreur<>0) or (det<=0) then + if ((erreur<>0) or (det<=0)) and (s<>'') then begin LabelInfo.caption:='Erreur adresse détecteur';exit end else LabelInfo.caption:=' '; @@ -12932,12 +13483,18 @@ begin if not(V5Valide) then tablo_PN[i].NbVoies:=4; end; + // corriger le nombre de voies + if ligne_vide_zonesPN(5) then tablo_PN[i].NbVoies:=4; + if ligne_vide_zonesPN(4) then tablo_PN[i].NbVoies:=3; + if ligne_vide_zonesPN(3) then tablo_PN[i].NbVoies:=2; + if ligne_vide_zonesPN(2) then tablo_PN[i].NbVoies:=1; + if ligne_vide_zonesPN(1) then tablo_PN[i].NbVoies:=0; + s:=encode_act_PN(i); ListBoxPN.items[lignecliqueePN]:=s; ListBoxPN.Selected[lignecliqueePN]:=true; end; end; - end; // changement combobox choix sorties 1 ou 2 @@ -13372,7 +13929,7 @@ begin if lignecliqueePN<0 then exit; // désactiver la ligne act - if maxtablo_act<1 then exit; + if NbrePN<1 then exit; Aff_champs_PN(lignecliqueePN+1); clicliste:=false; end; @@ -13380,7 +13937,7 @@ end; procedure TFormConfig.ListBoxPNKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); begin - if key=VK_delete then supprime_act; + if key=VK_delete then supprime_act; if ord(Key)=VK_UP then begin @@ -13758,14 +14315,22 @@ end; procedure TFormConfig.RadioButtonSimpleClick(Sender: TObject); begin + if clicliste then exit; + if affevt then Affiche('Evt RadioButtonSimple',clyellow); GroupBoxPNA.Visible:=true; GroupBoxPNZ.Visible:=false; + if lignecliqueePN<0 then exit; + tablo_pn[lignecliqueePN+1].actionneur:=true; end; procedure TFormConfig.RadioButtonZoneClick(Sender: TObject); begin + if clicliste then exit; + if affevt then Affiche('Evt RadioButtonZone',clyellow); GroupBoxPNA.Visible:=false; GroupBoxPNZ.Visible:=true; + if lignecliqueePN<0 then exit; + tablo_pn[lignecliqueePN+1].actionneur:=false; end; @@ -14399,6 +14964,7 @@ begin EditFiltrDet.text:=intToSTR(filtrageDet0); EditnCantonsRes.Text:=intToSTR(nCantonsRes); EditAntiTO.Text:=intToSTR(AntiTimeoutEthLenz); + EditRep.Text:=RepConfig; {$IF CompilerVersion >= 28.0} ComboStyle.itemIndex:=Style_Aff; @@ -14456,6 +15022,7 @@ begin CheckBoxRazSignaux.checked:=Raz_Acc_signaux; CheckBoxMsgAigInc.checked:=AffAigND; CheckBoxInitAig.checked:=AvecInitAiguillages; + if PilotageTrainsCDMNom then rgPilTrains.ItemIndex:=1 else rgPilTrains.ItemIndex:=0; CheckPosAig.checked:=AvecDemandeAiguillages; CheckBoxDemarUSB.checked:=AvecDemandeInterfaceUSB; CheckBoxDemarEth.checked:=AvecDemandeInterfaceEth; @@ -14495,9 +15062,19 @@ begin editAlgo.Text:=intToSTR(Algo_localisation); EditMaxSignalSens.Text:=intToSTR(Max_Signal_Sens); + // trains + with ListBoxTrains do + begin + clear; + for i:=1 to ntrains do items.Add(Train_tablo(i)); + end; + end; -end. + + + + end. diff --git a/UnitConfigCellTCO.dfm b/UnitConfigCellTCO.dfm index b26adae..c4944f7 100644 --- a/UnitConfigCellTCO.dfm +++ b/UnitConfigCellTCO.dfm @@ -1,10 +1,10 @@ object FormConfCellTCO: TFormConfCellTCO - Left = 477 - Top = 168 + Left = 570 + Top = 171 BorderStyle = bsDialog Caption = 'FormConfCellTCO' - ClientHeight = 430 - ClientWidth = 284 + ClientHeight = 473 + ClientWidth = 311 Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText @@ -22,7 +22,7 @@ object FormConfCellTCO: TFormConfCellTCO object GroupBox1: TGroupBox Left = 8 Top = 304 - Width = 265 + Width = 289 Height = 97 Caption = 'Texte' Font.Charset = DEFAULT_CHARSET @@ -63,7 +63,7 @@ object FormConfCellTCO: TFormConfCellTCO 'Centr'#233) end object ButtonFonte: TButton - Left = 160 + Left = 184 Top = 56 Width = 81 Height = 25 @@ -74,7 +74,7 @@ object FormConfCellTCO: TFormConfCellTCO object EditTexteCCTCO: TEdit Left = 8 Top = 16 - Width = 241 + Width = 265 Height = 24 TabOrder = 2 OnChange = EditTexteCCTCOChange @@ -83,7 +83,7 @@ object FormConfCellTCO: TFormConfCellTCO object GroupBox2: TGroupBox Left = 8 Top = 8 - Width = 265 + Width = 289 Height = 297 Caption = 'El'#233'ment' Font.Charset = DEFAULT_CHARSET @@ -145,8 +145,8 @@ object FormConfCellTCO: TFormConfCellTCO end object GroupBoxOrientation: TGroupBox Left = 8 - Top = 152 - Width = 249 + Top = 144 + Width = 273 Height = 57 Caption = 'Orientation du signal' Font.Charset = DEFAULT_CHARSET @@ -213,8 +213,8 @@ object FormConfCellTCO: TFormConfCellTCO end object GroupBoxImplantation: TGroupBox Left = 8 - Top = 224 - Width = 249 + Top = 216 + Width = 273 Height = 57 Caption = 'Implantation du signal' Font.Charset = DEFAULT_CHARSET @@ -268,8 +268,8 @@ object FormConfCellTCO: TFormConfCellTCO end object ButtonFond: TButton Left = 8 - Top = 104 - Width = 89 + Top = 96 + Width = 97 Height = 33 Caption = 'Couleur de fond de la cellule' Font.Charset = ANSI_CHARSET @@ -283,8 +283,8 @@ object FormConfCellTCO: TFormConfCellTCO OnClick = ButtonFondClick end object RadioGroupSel: TRadioGroup - Left = 104 - Top = 88 + Left = 120 + Top = 80 Width = 153 Height = 57 Caption = 'S'#233'lection clic ic'#244'ne ci-dessus' @@ -299,112 +299,6 @@ object FormConfCellTCO: TFormConfCellTCO ParentFont = False TabOrder = 5 end - object GroupBoxAction: TGroupBox - Left = 16 - Top = 144 - Width = 249 - Height = 129 - Caption = 'Action' - Font.Charset = DEFAULT_CHARSET - Font.Color = clWindowText - Font.Height = -12 - Font.Name = 'MS Sans Serif' - Font.Style = [] - ParentFont = False - TabOrder = 6 - object Label3: TLabel - Left = 104 - Top = 73 - Width = 38 - Height = 13 - Caption = 'Adresse' - end - object Labela: TLabel - Left = 192 - Top = 73 - Width = 6 - Height = 13 - Caption = #224 - end - object RadioButtonAffTCO: TRadioButton - Left = 8 - Top = 24 - Width = 97 - Height = 17 - Caption = 'Afficher TCO n'#176 - TabOrder = 0 - OnClick = RadioButtonAffTCOClick - end - object EditNumTCO: TEdit - Left = 104 - Top = 20 - Width = 25 - Height = 21 - TabOrder = 1 - OnChange = EditNumTCOChange - end - object RadioButtonSC: TRadioButton - Left = 8 - Top = 40 - Width = 169 - Height = 17 - Caption = 'Afficher Signaux complexes' - TabOrder = 2 - OnClick = RadioButtonSCClick - end - object RadioButtonCDM: TRadioButton - Left = 8 - Top = 56 - Width = 113 - Height = 17 - Caption = 'Afficher CDM rail' - TabOrder = 3 - OnClick = RadioButtonCDMClick - end - object RadioButtonAction: TRadioButton - Left = 8 - Top = 72 - Width = 89 - Height = 17 - Hint = 'Active un accessoire de fa'#231'on impulsionelle' - Caption = 'Activer sortie' - ParentShowHint = False - ShowHint = True - TabOrder = 4 - OnClick = RadioButtonActionClick - end - object EditAdrSortie: TEdit - Left = 152 - Top = 70 - Width = 33 - Height = 21 - TabOrder = 5 - OnChange = EditAdrSortieChange - end - object EditEtat: TEdit - Left = 208 - Top = 70 - Width = 17 - Height = 21 - Hint = '1 ou 2' - ParentShowHint = False - ShowHint = True - TabOrder = 6 - OnChange = EditEtatChange - end - object RadioButtonStop: TRadioButton - Left = 8 - Top = 88 - Width = 137 - Height = 17 - Hint = 'Arr'#234'te tous les trains (mode autonome et CDM)' - Caption = 'Arr'#234'ter tous les trains' - ParentShowHint = False - ShowHint = True - TabOrder = 7 - OnClick = RadioButtonStopClick - end - end end object CheckPinv: TCheckBox Left = 8 @@ -424,13 +318,484 @@ object FormConfCellTCO: TFormConfCellTCO TabOrder = 2 OnClick = CheckPinvClick end + object GroupBoxAction: TGroupBox + Left = 16 + Top = 152 + Width = 273 + Height = 145 + Caption = 'Actions' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ParentFont = False + TabOrder = 3 + object Label3: TLabel + Left = 16 + Top = 122 + Width = 110 + Height = 13 + Caption = 'Param'#232'tres de l'#39'action :' + end + object ListBoxAction: TListBox + Left = 8 + Top = 16 + Width = 257 + Height = 97 + Style = lbOwnerDrawVariable + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ItemHeight = 13 + ParentFont = False + TabOrder = 0 + OnDrawItem = ListBoxActionDrawItem + OnKeyDown = ListBoxActionKeyDown + OnMouseDown = ListBoxActionMouseDown + end + object EditParam1: TEdit + Left = 144 + Top = 118 + Width = 33 + Height = 21 + TabOrder = 1 + OnChange = EditParam1Change + end + object EditParam2: TEdit + Left = 184 + Top = 118 + Width = 33 + Height = 21 + TabOrder = 2 + OnChange = EditParam2Change + end + end object BitBtnOk: TBitBtn - Left = 168 - Top = 400 + Left = 216 + Top = 440 Width = 75 Height = 25 - TabOrder = 3 + TabOrder = 4 OnClick = BitBtnOkClick Kind = bkOK end + object BitBtnAnnule: TBitBtn + Left = 16 + Top = 440 + Width = 75 + Height = 25 + Caption = 'Annule' + TabOrder = 5 + OnClick = BitBtnAnnuleClick + end + object ImageListIcones: TImageList + Left = 160 + Top = 8 + Bitmap = { + 494C010108000900040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000003000000001002000000000000030 + 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 + 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 + 00000000000000000000FF000000FF000000FF000000FF000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FF000000FF000000FF000000FF000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000FF000000FF000000FF000000FF000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FF000000FF00000000800000008000000080000000800000FF000000FF00 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FF000000FF0000000000FF000000FF000000FF000000FF00FF000000FF00 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FF000000FF0000000000FF000000FF000000FF000000FF00FF000000FF00 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000000000000000000000000FF00 + 0000008000000080000000800000008000000080000000800000008000000080 + 0000FF000000000000000000000000000000000000000000000000000000FF00 + 00000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000 + FF00FF000000000000000000000000000000000000000000000000000000FF00 + 00000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000 + FF00FF0000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000FF0000000080 + 0000008000000080000000800000008000000080000000800000008000000080 + 000000800000FF00000000000000000000000000000000000000FF0000000000 + FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000 + FF000000FF00FF00000000000000000000000000000000000000FF0000000000 + FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000 + FF000000FF00FF00000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FF000000008000000080 + 0000008000000080000000800000008000000080000000000000008000000080 + 000000800000FF000000000000000000000000000000FF0000000000FF000000 + FF000000FF000000FF000000FF000000FF000000FF00000000000000FF000000 + FF000000FF00FF000000000000000000000000000000FF0000000000FF000000 + FF000000FF000000FF000000FF000000FF000000FF00000000000000FF000000 + FF000000FF00FF00000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FF000000008000000080 + 0000008000000080000000800000008000000000000000800000008000000080 + 00000080000000800000FF0000000000000000000000FF0000000000FF000000 + FF000000FF000000FF000000FF000000FF00000000000000FF000000FF000000 + FF000000FF000000FF00FF0000000000000000000000FF0000000000FF000000 + FF000000FF000000FF000000FF000000FF00000000000000FF0000FFFF000000 + FF000000FF000000FF00FF000000000000000000FF000000FF000000FF000000 + FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000 + FF000000FF000000FF000000FF000000FF0000000000FF000000008000000080 + 0000008000000080000000800000000000000080000000800000008000000080 + 00000080000000800000FF0000000000000000000000FF0000000000FF000000 + FF000000FF000000FF000000FF00000000000000FF000000FF000000FF000000 + FF000000FF000000FF00FF0000000000000000000000FF0000000000FF000000 + FF000000FF000000FF000000FF00000000000000FF000000FF000000FF0000FF + FF000000FF000000FF00FF000000000000000000FF0000000000000000000000 + FF000000FF00000000000000FF000000FF0000000000000000000000FF000000 + FF00000000000000FF000000FF000000FF0000000000FF000000008000000080 + 0000008000000080000000800000000000000080000000800000008000000080 + 00000080000000800000FF0000000000000000000000FF0000000000FF000000 + FF000000FF000000FF000000FF00000000000000FF000000FF000000FF000000 + FF000000FF000000FF00FF0000000000000000000000FF0000000000FF000000 + FF000000FF000000FF000000FF00000000000000FF000000FF000000FF0000FF + FF000000FF000000FF00FF00000000000000000000000000FF000000FF000000 + 00000000FF00000000000000FF00000000000000FF000000FF00000000000000 + FF00000000000000FF000000FF000000FF0000000000FF000000008000000080 + 0000008000000080000000800000000000000080000000800000008000000080 + 00000080000000800000FF0000000000000000000000FF0000000000FF000000 + FF000000FF000000FF000000FF00000000000000FF000000FF000000FF000000 + FF000000FF000000FF00FF0000000000000000000000FF0000000000FF000000 + FF000000FF000000FF000000FF00000000000000FF000000FF000000FF0000FF + FF000000FF000000FF00FF000000000000000000FF000000FF000000FF000000 + 00000000FF00000000000000FF00000000000000FF000000FF00000000000000 + FF00000000000000FF000000FF000000FF0000000000FF000000008000000080 + 0000008000000080000000800000000000000080000000800000008000000080 + 000000800000FF000000000000000000000000000000FF0000000000FF000000 + FF000000FF000000FF000000FF00000000000000FF000000FF000000FF000000 + FF000000FF00FF000000000000000000000000000000FF0000000000FF000000 + FF000000FF000000FF000000FF00000000000000FF000000FF000000FF0000FF + FF000000FF00FF00000000000000000000000000FF0000000000000000000000 + FF000000FF00000000000000FF00000000000000FF000000FF00000000000000 + FF000000000000000000000000000000FF000000000000000000FF0000000080 + 0000008000000080000000800000000000000080000000800000008000000080 + 000000800000FF00000000000000000000000000000000000000FF0000000000 + FF000000FF000000FF000000FF00000000000000FF000000FF000000FF000000 + FF000000FF00FF00000000000000000000000000000000000000FF0000000000 + FF000000FF000000FF000000FF00000000000000FF000000FF0000FFFF000000 + FF000000FF00FF0000000000000000000000000000000000FF000000FF000000 + FF000000FF00000000000000FF00000000000000FF000000FF00000000000000 + FF00000000000000FF000000FF0000000000000000000000000000000000FF00 + 0000008000000080000000800000000000000080000000800000008000000080 + 0000FF000000000000000000000000000000000000000000000000000000FF00 + 00000000FF000000FF000000FF00000000000000FF000000FF000000FF000000 + FF00FF000000000000000000000000000000000000000000000000000000FF00 + 00000000FF000000FF000000FF000000000000FFFF0000FFFF000000FF000000 + FF00FF000000000000000000000000000000000000000000FF000000FF000000 + 00000000FF00000000000000FF00000000000000FF000000FF00000000000000 + FF00000000000000FF000000FF00000000000000000000000000000000000000 + 0000FF000000008000000080000000800000008000000080000000800000FF00 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FF0000000000FF000000FF000000FF000000FF000000FF000000FF00FF00 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000FF0000000000FF000000FF000000FF000000FF000000FF000000FF00FF00 + 0000000000000000000000000000000000000000FF0000000000000000000000 + FF000000000000000000000000000000FF0000000000000000000000FF000000 + FF000000000000000000000000000000FF000000000000000000000000000000 + 000000000000FF000000FF000000FF000000FF000000FF000000FF0000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FF000000FF000000FF000000FF000000FF000000FF0000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000FF000000FF000000FF000000FF000000FF000000FF0000000000 + 0000000000000000000000000000000000000000FF000000FF000000FF000000 + FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000 + FF000000FF000000FF000000FF000000FF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000080000000800000008000C0C0 + C00000008000000080000000800000008000000080000000800000008000C0C0 + C000000080000000800000008000000080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000080000000800000008000C0C0 + C00000008000000080000000800000008000000080000000800000008000C0C0 + C000000080000000800000008000000080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000800000000000000000000000800000000000000080000000 + 800000008000000000000000000000000000000080000000800000008000C0C0 + C00000008000000080000000800000008000000080000000800000008000C0C0 + C000000080000000800000008000000080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000080000000000000008000000000000000800000000000000000000000 + 800000000000000000000000000000000000000080000000800000008000C0C0 + C00000008000000080000000800000008000000080000000800000008000C0C0 + C000000080000000800000008000000080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000080000000000000008000000000000000800000000000000000000000 + 800000000000000000000000000000000000000080000000800000008000C0C0 + C00000008000000080000000800000008000000080000000800000008000C0C0 + C000000080000000800000008000000080000000000000000000008000000080 + 00000080000000800000C0C0C000000000000000000000000000808080000080 + 0000008000000080000080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000080000000000000008000000000000000800000000000000080000000 + 800000000000000000000000000000000000C0C0C000C0C0C000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000C0C0C0000000000080808000808080000000 + 0000000000008080800000800000C0C0C0000000000000FF0000008000008080 + 8000000000000000000080808000C0C0C0000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000800000000000000000000000800000000000000000000000 + 800000000000000000000000000000000000000080000000800000008000C0C0 + C00000008000000080000000800000008000000080000000800000008000C0C0 + C000000080000000800000008000000080000000000000000000000000000000 + 000000000000C0C0C0000080000080808000C0C0C0000080000000FF00000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000000080000000800000008000C0C0 + C00000008000000080000000800000008000000080000000800000008000C0C0 + C000000080000000800000008000000080000000000000000000000000000000 + 0000000000000080000000800000808080008080800000800000808080000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 000080800000808000008080000080800000000080000000800000008000C0C0 + C00000008000000080000000800000008000000080000000800000008000C0C0 + C000000080000000800000008000000080000000000000000000C0C0C0000080 + 0000008000000080000000800000000000008080800000800000808080000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 00008080000080800000808000008080000000FFFF0000FFFF0000FFFF0000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF0000000000C0C0C000008000000080 + 0000008000000000000000000000000000008080800000800000808080000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008080000000000000000000000000 + 0000808000008080000080800000000000000000000000000000808000008080 + 000000000000000000000000000080800000000080000000800000008000C0C0 + C0000000800000008000000080000000800000FFFF000000800000008000C0C0 + C0000000800000008000000080000000800000000000C0C0C000008000008080 + 800000000000000000000000000000000000C0C0C00000800000008000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008080000000000000808000008080 + 0000000000008080000000000000808000008080000080800000808000000000 + 000080800000808000008080000080800000000080000000800000008000C0C0 + C000000080000000800000008000000080000000800000FFFF0000008000C0C0 + C0000000800000008000000080000000800000000000C0C0C000008000000080 + 0000000000000000000000FF0000C0C0C0000000000080808000008000008080 + 8000000000000000000080808000C0C0C0000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008080000000000000808000008080 + 0000000000008080000000000000808000008080000080800000808000000000 + 000080800000808000008080000080800000000080000000800000008000C0C0 + C00000008000000080000000800000008000000080000000800000FFFF0000FF + FF00000080000000800000008000000080000000000000000000C0C0C0000080 + 0000008000000080000080808000000000000000000000000000C0C0C0000080 + 0000008000000080000080808000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008080000000000000808000008080 + 0000000000008080000000000000808000008080000080800000808000000000 + 000080800000808000008080000080800000C0C0C000C0C0C000C0C0C000C0C0 + C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 + C00000FFFF00C0C0C000C0C0C000C0C0C0000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008080000000000000000000000000 + 0000808000008080000080800000000000000000000000000000808000008080 + 000000000000000000000000000080800000000080000000800000008000C0C0 + C00000008000000080000000800000008000000080000000800000008000C0C0 + C0000000800000FFFF0000008000000080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 000080800000808000008080000080800000000080000000800000008000C0C0 + C00000008000000080000000800000008000000080000000800000008000C0C0 + C000000080000000800000FFFF00000080000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000008080000080800000808000008080 + 0000808000008080000080800000808000008080000080800000808000008080 + 000080800000808000008080000080800000424D3E000000000000003E000000 + 2800000040000000300000000100010000000000800100000000000000000000 + 000000000000000000000000FFFFFF0000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFC3FFC3FFC3F + FFFFF00FF00FF00FFFFFE007E007E007FFFFC003C003C003FFFF800380038003 + FFFF800180018001000080018001800100008001800180010000800180018001 + 00008003800380030000C003C003C0030000E007E007E0070000F00FF00FF00F + 0000F81FF81FF81F0000FFFFFFFFFFFF0000FFFFFFFFFFFF0000FFFFFFFFFB47 + 0000FFFFF7DFF56F0000FFFFC007F56F0000C1C1C007F54F0000988CF7DFFB6F + 0000F81FF7DFFFFF0000F81FC00700000000C11FC00700000000871FF7DF0000 + 00008F1FF7DF000000008C8CC00700000000C1C1C00700000000FFFFF7DF0000 + 0000FFFFFFFF00000000FFFFFFFF000000000000000000000000000000000000 + 000000000000} + end end diff --git a/UnitConfigCellTCO.pas b/UnitConfigCellTCO.pas index 3b79d4b..59cc547 100644 --- a/UnitConfigCellTCO.pas +++ b/UnitConfigCellTCO.pas @@ -5,7 +5,8 @@ interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, - Buttons; + Buttons, + ImgList; type TFormConfCellTCO = class(TForm) @@ -28,21 +29,17 @@ type RadioButtonD: TRadioButton; EditAdrElement: TEdit; ButtonFond: TButton; - BitBtnOk: TBitBtn; ImagePaletteCC: TImage; RadioGroupSel: TRadioGroup; - GroupBoxAction: TGroupBox; - RadioButtonAffTCO: TRadioButton; - EditNumTCO: TEdit; - RadioButtonSC: TRadioButton; - RadioButtonCDM: TRadioButton; - RadioButtonAction: TRadioButton; - Label3: TLabel; - EditAdrSortie: TEdit; - EditEtat: TEdit; - Labela: TLabel; RadioButtonV180: TRadioButton; - RadioButtonStop: TRadioButton; + GroupBoxAction: TGroupBox; + ListBoxAction: TListBox; + EditParam1: TEdit; + EditParam2: TEdit; + Label3: TLabel; + ImageListIcones: TImageList; + BitBtnOk: TBitBtn; + BitBtnAnnule: TBitBtn; procedure EditAdrElementChange(Sender: TObject); procedure EditTexteCCTCOChange(Sender: TObject); procedure ButtonFonteClick(Sender: TObject); @@ -61,26 +58,39 @@ type procedure EditTypeImageChange(Sender: TObject); procedure ImagePaletteCCMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); - procedure RadioButtonAffTCOClick(Sender: TObject); - procedure EditNumTCOChange(Sender: TObject); procedure FormHide(Sender: TObject); - procedure RadioButtonSCClick(Sender: TObject); - procedure RadioButtonCDMClick(Sender: TObject); - procedure EditAdrSortieChange(Sender: TObject); - procedure EditEtatChange(Sender: TObject); - procedure RadioButtonActionClick(Sender: TObject); procedure RadioButtonV180Click(Sender: TObject); - procedure RadioButtonStopClick(Sender: TObject); + procedure ListBoxActionMouseDown(Sender: TObject; Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); + procedure EditParam1Change(Sender: TObject); + procedure EditParam2Change(Sender: TObject); + procedure ListBoxActionDrawItem(Control: TWinControl; Index: Integer; + Rect: TRect; State: TOwnerDrawState); + procedure BitBtnAnnuleClick(Sender: TObject); + procedure ListBoxActionKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); private { Déclarations privées } public - { Déclarations publiques } end; +const + // liste des actions + AcChangeTCO=1; + AcAffSC=2; + AcAffCDM=3; + AcActSortie=4; + AcStopTrains=5; + AcMarche_Horloge=6; + AcArret_horloge=7; + AcInit_horloge=8; + AcAff_horloge=9; + + var FormConfCellTCO: TFormConfCellTCO; actualize,ConfCellTCO : boolean; - IconeX,IconeY : integer; + IconeX,IconeY,ligneclicAction,XclicC,yClicC : integer; procedure actualise(indexTCO : integer); @@ -90,9 +100,156 @@ uses UnitPrinc,UnitAnalyseSegCDM,UnitConfigTCO,UnitTCO; {$R *.dfm} +//https://codes-sources.commentcamarche.net/forum/affich-1015879-ajouter-un-icon-dans-un-listbox + + + +// procédure qui met la bd à jour, et réactualise la cellule, ce qui appelle "select elements" +procedure stocke_bd; +var x,y,act : integer; +begin + act:=ligneclicAction+1; + + x:=XClicCell[IndexTCOCourant]; + y:=yClicCell[IndexTCOCourant]; + tco[IndexTCOCourant,X,Y].PiedFeu:=act; + efface_cellule(indexTCOCourant,PCanvasTCO[indexTCOcourant],x,y,pmcopy); + affiche_cellule(IndexTCOCourant,x,Y); + actualise(indexTCOCourant); + + + {case act of + // affiche TCO + ChangeTCO : + begin + x:=XClicCell[IndexTCOCourant]; + y:=yClicCell[IndexTCOCourant]; + tco[IndexTCOCourant,X,Y].PiedFeu:=ChangeTCO; + efface_cellule(indexTCOCourant,PCanvasTCO[indexTCOcourant],x,y,pmcopy); + affiche_cellule(IndexTCOCourant,x,Y); + actualise(indexTCOCourant); + end; + // affiche SC + AffSC : begin + x:=XClicCell[IndexTCOCourant]; + y:=yClicCell[IndexTCOCourant]; + tco[IndexTCOCourant,X,Y].PiedFeu:=AffSC; + efface_cellule(indexTCOCourant,PCanvasTCO[indexTCOcourant],x,y,pmcopy); + affiche_cellule(IndexTCOCourant,x,Y); + actualise(indexTCOCourant); + end; + // affiche CDM + AffCDM : begin + x:=XClicCell[IndexTCOCourant]; + y:=yClicCell[IndexTCOCourant]; + tco[IndexTCOCourant,X,Y].PiedFeu:=AffCDM; + efface_cellule(indexTCOCourant,PCanvasTCO[indexTCOcourant],x,y,pmcopy); + affiche_cellule(IndexTCOCourant,x,Y); + actualise(indexTCOCourant); + end; + + // activer sortie + ActSortie : + begin + x:=XClicCell[IndexTCOCourant]; + y:=yClicCell[IndexTCOCourant]; + tco[IndexTCOCourant,x,y].PiedFeu:=ActSortie; + efface_cellule(indexTCOCourant,PCanvasTCO[indexTCOcourant],x,y,pmcopy); + affiche_cellule(IndexTCOCourant,x,y); + actualise(indexTCOCourant); + end; + + StopTrains : // Arret des trains + begin + x:=XClicCell[IndexTCOCourant]; + y:=yClicCell[IndexTCOCourant]; + tco[IndexTCOCourant,x,y].PiedFeu:=StopTrains; + efface_cellule(indexTCOCourant,PCanvasTCO[indexTCOcourant],x,y,pmcopy); + affiche_cellule(IndexTCOCourant,x,y); + actualise(indexTCOCourant); + end; + + Marche_Horloge : // démarre horloge + begin + x:=XClicCell[IndexTCOCourant]; + y:=yClicCell[IndexTCOCourant]; + tco[IndexTCOCourant,x,y].PiedFeu:=Marche_Horloge; + efface_cellule(indexTCOCourant,PCanvasTCO[indexTCOcourant],x,y,pmcopy); + affiche_cellule(IndexTCOCourant,x,y); + actualise(indexTCOCourant); + end; + + end; } + +end; + +// affiche les élements de l'index dans la fenetre +procedure select_elements(indexTCO : integer); +var act : integer; +begin + act:=ligneclicAction+1; + + with formConfCellTCO do + case act of + // afficher TCO + AcChangeTCO : + begin + EditParam1.Visible:=true; + EditParam1.Hint:='Numéro du TCO à afficher'; + EditParam1.ShowHint:=true; + EditParam2.Visible:=false; + EditParam1.Text:=IntToSTR(tco[indexTCO,XclicC,YclicC].FeuOriente); + end; + // Afficher SC + AcAffSC : + begin + EditParam1.Visible:=false; + EditParam2.Visible:=false; + end; + // afficher CDM + AcAffCDM : + begin + EditParam1.Visible:=false; + EditParam2.Visible:=false; + end; + // activer sortie + AcActSortie : + begin + EditParam1.Visible:=true; EditParam2.Visible:=true; + EditParam1.Text:=intToSTR(tco[indexTCO,XclicC,YclicC].Adresse); + EditParam2.Text:=intToSTR(tco[indexTCO,XclicC,YclicC].sortie); + EditParam1.Hint:='Adresse de la sortie'; + EditParam1.ShowHint:=true; + EditParam2.Hint:='Valeur de la sortie (0-1-2)'; + EditParam2.ShowHint:=true; + end; + // arret des trains + AcStopTrains : + begin + EditParam1.Visible:=false; EditParam2.Visible:=false; + end; + // démarrer horloge + AcMarche_horloge : + begin + EditParam1.Visible:=false; EditParam2.Visible:=false; + end; + // arreter horloge + AcArret_horloge : + begin + EditParam1.Visible:=false; EditParam2.Visible:=false; + end; + // initialiser horloge + AcInit_horloge : + begin + EditParam1.Visible:=false; + EditParam2.Visible:=false; + end; + end; +end; + // actualise le contenu de la fenetre et de la zone tco procedure actualise(indexTCO : integer); -var Bimage,oriente,piedFeu,xclic,yclic : integer; +var Bimage,oriente,piedFeu,act : integer; s : string; ip : Timage; r : trect; @@ -100,8 +257,8 @@ begin if (indexTCO=0) or (formConfCellTCO=nil) then exit; if affevt then affiche('FormConfigCellTCO actualise',clyellow); - xclic:=XclicCell[indexTCO]; - yclic:=YclicCell[indexTCO]; + xclicC:=XclicCell[indexTCO]; + yclicC:=YclicCell[indexTCO]; //with FormConfCellTCO.ImagePaletteCC.Picture.Bitmap do with FormConfCellTCO.ImagePaletteCC do @@ -135,26 +292,19 @@ begin with GroupBoxAction do begin visible:=true; + left:=16; top:=152; - left:=8; - width:=249; - RadioButtonAffTCO.Checked:=tco[indexTCO,Xclic,Yclic].PiedFeu=1; - RadioButtonSC.Checked:=tco[indexTCO,Xclic,Yclic].PiedFeu=2; - RadioButtonCDM.Checked:=tco[indexTCO,Xclic,Yclic].PiedFeu=3; - RadioButtonAction.Checked:=tco[indexTCO,Xclic,Yclic].PiedFeu=4; - RadioButtonStop.Checked:=tco[indexTCO,Xclic,Yclic].PiedFeu=5; - - editNumTCO.Text:=intToSTR(tco[indexTCO,Xclic,Yclic].FeuOriente); - if RadioButtonAction.Checked then + width:=273; + height:=145; + act:=tco[indexTCO,XclicC,YclicC].PiedFeu; + if (act<0) or (act-1>ListBoxAction.Count) then begin - EditAdrSortie.Text:=intToSTR(tco[indexTCO,Xclic,Yclic].Adresse); - EditEtat.Text:=intToSTR(tco[indexTCO,Xclic,Yclic].sortie); - end - else - begin - EditAdrSortie.Text:=''; - EditEtat.Text:=''; + Affiche('Erreur 29 ',clred); + exit; end; + ListBoxAction.ItemIndex:=act-1; + ligneclicAction:=act-1; + select_elements(indexTCO); end; end; end @@ -233,7 +383,7 @@ begin formTCO[indexTCO].comboRepr.Enabled:=false; end; - s:=IntToSTR(Xclic)+','+intToSTR(yClic); + s:=IntToSTR(XclicC)+','+intToSTR(yClicC); FormTCO[indexTCO].GroupBox1.Caption:='Configuration cellule '+s; XclicCellInserer:=XclicCell[indexTCO]; YclicCellInserer:=YclicCell[indexTCO]; @@ -496,6 +646,18 @@ begin end; end; + // une imagelist c'est 24x24 maxi + ListBoxAction.Items.Add(Format('%d%s', [0, 'Afficher TCO'])); // valeur d'index de l'icone dans la ImagelistIcones + ListBoxAction.Items.Add(Format('%d%s', [1, 'Afficher Signaux Complexes'])); + ListBoxAction.Items.Add(Format('%d%s', [2, 'Afficher CDM Rail'])); + ListBoxAction.Items.Add(Format('%d%s', [3, 'Activer/désactiver sortie'])); + ListBoxAction.Items.Add(Format('%d%s', [4, 'Arrêter les trains'])); + ListBoxAction.Items.Add(Format('%d%s', [5, 'Démarrer l''horloge'])); + ListBoxAction.Items.Add(Format('%d%s', [6, 'Arrêter l''horloge'])); + ListBoxAction.Items.Add(Format('%d%s', [7, 'Initialiser l''horloge'])); + ListBoxAction.Items.Add(Format('%d%s', [8, 'Afficher l''horloge'])); + + // dessine les composants - non utilisé { i:=1; @@ -608,6 +770,13 @@ end; procedure TFormConfCellTCO.BitBtnOkClick(Sender: TObject); begin if affevt then Affiche('BitBtnOk',clyellow); + stocke_bd; + ConfCellTCO:=false; + close; +end; + +procedure TFormConfCellTCO.BitBtnAnnuleClick(Sender: TObject); +begin ConfCellTCO:=false; close; end; @@ -673,8 +842,7 @@ end; procedure TFormConfCellTCO.ImagePaletteCCMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); -var c,x0,y0,xc,yc,xf,yf,element,i,j,erreur,x1,y1,c1,c2,c3,c4, - Xclic,Yclic : integer; +var c,x0,y0,xc,yc,xf,yf,element,i,j,erreur,x1,y1,c1,c2,c3,c4 : integer; crois,IconeBut : boolean; begin x0:=0; // x origine @@ -683,8 +851,8 @@ begin xc:=x0+(iconeX div 2); // x centre xf:=x0+iconeX; // x fin yf:=y0+iconeY; // y fin - Xclic:=XclicCell[indexTCOCourant]; - Yclic:=YclicCell[indexTCOCourant]; + XclicC:=XclicCell[indexTCOCourant]; + YclicC:=YclicCell[indexTCOCourant]; //Affiche(IntToSTR(x)+' '+IntToSTR(y),clyellow); val(editTypeImage.text,element,erreur); @@ -731,7 +899,7 @@ begin begin // si élément à 2 connexions, allumer les deux bits case Element of - 1 : tco[IndexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]].epaisseurs:=$88; + 1 : tco[IndexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]].epaisseurs:=$88; 6 : tco[IndexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]].epaisseurs:=$09; 7 : tco[IndexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]].epaisseurs:=$84; 8 : tco[IndexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]].epaisseurs:=$90; @@ -765,12 +933,12 @@ begin if not(testbit(tco[IndexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]].buttoir,c)) then begin // mise à 1 du bit si pas buttoir et sélection sur buttoir - tco[IndexTCOCourant,Xclic,Yclic].buttoir:=0; - tco[IndexTCOCourant,Xclic,Yclic].buttoir:=setbit(tco[IndexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]].buttoir,c) + tco[IndexTCOCourant,XclicC,YclicC].buttoir:=0; + tco[IndexTCOCourant,XclicC,YclicC].buttoir:=setbit(tco[IndexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]].buttoir,c) end else begin - tco[IndexTCOCourant,Xclic,Yclic].buttoir:=0; + tco[IndexTCOCourant,XclicC,YclicC].buttoir:=0; end; end; @@ -779,15 +947,15 @@ begin begin efface_entoure(IndexTCOCourant); // si pas croisement et sélection sur épaisseurs - if not(testbit(tco[IndexTCOCourant,Xclic,Yclic].pont,c)) then + if not(testbit(tco[IndexTCOCourant,XclicC,YclicC].pont,c)) then begin - tco[IndexTCOCourant,Xclic,Yclic].pont:=0; // raz de tous les autres - tco[IndexTCOCourant,Xclic,Yclic].pont:=setbit(tco[IndexTCOCourant,Xclic,Yclic].pont,c); + tco[IndexTCOCourant,XclicC,YclicC].pont:=0; // raz de tous les autres + tco[IndexTCOCourant,XclicC,YclicC].pont:=setbit(tco[IndexTCOCourant,Xclic,Yclic].pont,c); end else begin // la raz du bit c doit mettre à 0 le bit opposé aussi - tco[IndexTCOCourant,Xclic,Yclic].pont:=Razbit(tco[IndexTCOCourant,Xclic,Yclic].pont,c); + tco[IndexTCOCourant,XclicC,YclicC].pont:=Razbit(tco[IndexTCOCourant,Xclic,Yclic].pont,c); case c of 0 : j:=4; 1 : j:=5; @@ -798,62 +966,17 @@ begin 6 : j:=2; 7 : j:=3; end; - tco[IndexTCOCourant,Xclic,Yclic].pont:=Razbit(tco[IndexTCOCourant,Xclic,Yclic].pont,j); + tco[IndexTCOCourant,XclicC,YclicC].pont:=Razbit(tco[IndexTCOCourant,XclicC,YclicC].pont,j); end; end; - efface_cellule(IndexTCOCourant,PCanvasTCO[IndexTCOCourant],Xclic,Yclic,PmCopy); - dessine_icone(IndexTCOCourant,PCanvasTCO[IndexTCOCourant],element,Xclic,Yclic,0); + efface_cellule(IndexTCOCourant,PCanvasTCO[IndexTCOCourant],XclicC,YclicC,PmCopy); + dessine_icone(IndexTCOCourant,PCanvasTCO[IndexTCOCourant],element,XclicC,YclicC,0); copie_cellule(IndexTCOCourant); end; end; end; end; -procedure TFormConfCellTCO.RadioButtonAffTCOClick(Sender: TObject); -var x,y : integer; -begin - if clicTCO or actualize then exit; - if RadioButtonAffTCO.Checked then - begin - x:=XClicCell[IndexTCOCourant]; - y:=yClicCell[IndexTCOCourant]; - tco[IndexTCOCourant,X,Y].PiedFeu:=1; - efface_cellule(indexTCOCourant,PCanvasTCO[indexTCOcourant],x,y,pmcopy); - affiche_cellule(IndexTCOCourant,x,Y); - actualise(indexTCOCourant); - end; -end; - -procedure TFormConfCellTCO.RadioButtonSCClick(Sender: TObject); -var x,y : integer; -begin - if clicTCO or actualize then exit; - if RadioButtonSC.Checked then - begin - x:=XClicCell[IndexTCOCourant]; - y:=yClicCell[IndexTCOCourant]; - tco[IndexTCOCourant,X,Y].PiedFeu:=2; - efface_cellule(indexTCOCourant,PCanvasTCO[indexTCOcourant],x,y,pmcopy); - affiche_cellule(IndexTCOCourant,x,Y); - actualise(indexTCOCourant); - end; -end; - -procedure TFormConfCellTCO.EditNumTCOChange(Sender: TObject); -var i,erreur : integer; -begin - if clicTCO then exit; - - val(EditNumTCO.Text,i,erreur); - if erreur<>0 then exit; - if (i>NbreTCO) or (i<1) then - begin - EditNumTCO.Text:=intToSTR(NbreTCO); - i:=NbreTCO; - end; - tco[IndexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]].FeuOriente:=i; - Affiche_cellule(IndexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]); -end; procedure TFormConfCellTCO.FormHide(Sender: TObject); @@ -862,79 +985,111 @@ begin ConfCellTCO:=false; end; -procedure TFormConfCellTCO.RadioButtonCDMClick(Sender: TObject); -var x,y : integer; + + +procedure TFormConfCellTCO.ListBoxActionMouseDown(Sender: TObject; + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin - if clicTCO or actualize then exit; - if RadioButtonCDM.Checked then + if affevt then Affiche('TFormConfCellTCO.ListBoxActionMouseDown',clyellow); + ligneclicAction:=listBoxAction.ItemIndex; + select_elements(indexTCOCourant); +end; + +procedure TFormConfCellTCO.ListBoxActionKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); +begin + if affevt then Affiche('TFormConfCellTCO.ListBoxActionKeyDown',clyellow); + if (ord(Key)=VK_UP) and (ligneclicAction>0) then begin - x:=XClicCell[IndexTCOCourant]; - y:=yClicCell[IndexTCOCourant]; - tco[IndexTCOCourant,x,y].PiedFeu:=3; - efface_cellule(indexTCOCourant,PCanvasTCO[indexTCOcourant],x,y,pmcopy); - affiche_cellule(IndexTCOCourant,x,y); - actualise(indexTCOCourant); + dec(ligneclicAction); + select_elements(indexTCOCourant); + end; + if (ord(Key)=VK_DOWN) and (ligneclicAction<7) then + begin + inc(ligneclicAction); + select_elements(indexTCOCourant); end; end; +procedure TFormConfCellTCO.EditParam1Change(Sender: TObject); +var i,erreur,act : integer; +begin + act:=ligneclicAction+1; + case act of + AcChangeTCO : // afficher TCO n + begin + if clicTCO then exit; -procedure TFormConfCellTCO.EditAdrSortieChange(Sender: TObject); -var i,erreur : integer; + val(EditParam1.Text,i,erreur); + if erreur<>0 then exit; + if (i>NbreTCO) or (i<1) then + begin + EditParam1.Text:=intToSTR(NbreTCO); + i:=NbreTCO; + end; + tco[IndexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]].FeuOriente:=i; + Affiche_cellule(IndexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]); + end; + + + //sortie + AcActSortie : + begin + if clicTCO then exit; + val(EditParam1.Text,i,erreur); + if erreur<>0 then exit; + tco[IndexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]].adresse:=i; + Affiche_cellule(IndexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]); + end; + + end; + +end; + +procedure TFormConfCellTCO.EditParam2Change(Sender: TObject); +var i,erreur,act : integer; begin if clicTCO then exit; - val(EditAdrSortie.Text,i,erreur); - if erreur<>0 then exit; + act:=ligneclicAction+1; - tco[IndexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]].adresse:=i; - Affiche_cellule(IndexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]); -end; - -procedure TFormConfCellTCO.EditEtatChange(Sender: TObject); -var i,erreur : integer; -begin - if clicTCO then exit; - - val(EditEtat.Text,i,erreur); - if erreur<>0 then exit; - - tco[IndexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]].sortie:=i; - Affiche_cellule(IndexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]); -end; - - -procedure TFormConfCellTCO.RadioButtonActionClick(Sender: TObject); -var x,y : integer; -begin - if clicTCO or actualize then exit; - if RadioButtonAction.Checked then + case act of + AcActSortie : begin - x:=XClicCell[IndexTCOCourant]; - y:=yClicCell[IndexTCOCourant]; - tco[IndexTCOCourant,x,y].PiedFeu:=4; - efface_cellule(indexTCOCourant,PCanvasTCO[indexTCOcourant],x,y,pmcopy); - affiche_cellule(IndexTCOCourant,x,y); - actualise(indexTCOCourant); + val(EditParam2.Text,i,erreur); + if erreur<>0 then exit; + tco[IndexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]].sortie:=i; + Affiche_cellule(IndexTCOCourant,XclicCell[indexTCOCourant],YclicCell[indexTCOCourant]); + end; + + end; end; -procedure TFormConfCellTCO.RadioButtonStopClick(Sender: TObject); -var x,y : integer; + +// dessine les icones et le texte dans la listbox +procedure TFormConfCellTCO.ListBoxActionDrawItem(Control: TWinControl; + Index: Integer; Rect: TRect; State: TOwnerDrawState); +var + IcoIndex: Integer; + ItemText: string; begin - if clicTCO or actualize then exit; - if RadioButtonStop.Checked then + with ListBoxAction do begin - x:=XClicCell[IndexTCOCourant]; - y:=yClicCell[IndexTCOCourant]; - tco[IndexTCOCourant,x,y].PiedFeu:=5; - efface_cellule(indexTCOCourant,PCanvasTCO[indexTCOcourant],x,y,pmcopy); - affiche_cellule(IndexTCOCourant,x,y); - actualise(indexTCOCourant); + IcoIndex:=StrToIntDef(Items[Index][1], 0); + ItemText:=Items[Index]; + Delete(ItemText,1,1); + Canvas.Fillrect(Rect); + ImageListIcones.Draw(Canvas, Rect.Left, Rect.Top, IcoIndex); + Canvas.Textout(Rect.Left + ImageListIcones.Width + 2, Rect.Top, ItemText); end; end; -begin + + + + + end. diff --git a/UnitConfigTCO.pas b/UnitConfigTCO.pas index 6daf7f0..3144319 100644 --- a/UnitConfigTCO.pas +++ b/UnitConfigTCO.pas @@ -297,6 +297,7 @@ end; procedure TFormConfigTCO.FormActivate(Sender: TObject); var s: string; i : integer; + GridRect: TGridRect; begin clicConf:=true; s:='Configuration du tco '+inttostr(indextcocourant)+' - Fichier '+NomFichierTCO[indextcocourant]; @@ -327,7 +328,15 @@ begin if i<=nbreTCO then stringGridTCO.Cells[2,i]:='X' else stringGridTCO.Cells[2,i]:=' '; end; // stringGridTCO.canvas.Font.Style:=[fsBOld]; - clicConf:=false; + + // selection + GridRect.Top:= indextcocourant; + GridRect.Left:= 1; + GridRect.Right:= 1; + GridRect.Bottom:= indextcocourant; + StringGridTCO.Selection:= GridRect; + + clicConf:=false; end; @@ -589,7 +598,7 @@ begin config_modifie:=true; s:=stringGridTCO.Cells[1,i]; // on peut vérifier le .cfg mais bon - Affiche('Le nom du fichier '+NomFichierTCO[i]+' sera sauvegardé en '+s,clyellow); + Affiche('Le nom du fichier '+NomFichierTCO[i]+' du TCO'+intToSTR(i)+' sera sauvegardé en '+s,clyellow); NomFichierTCO[i]:=s; end else diff --git a/UnitDebug.pas b/UnitDebug.pas index b4cf1db..c64519a 100644 --- a/UnitDebug.pas +++ b/UnitDebug.pas @@ -512,14 +512,14 @@ procedure TFormDebug.ButtonSimuAct1Click(Sender: TObject); var det,erreur : integer; begin val(EditSimuDet.Text,det,erreur); - if (erreur=0) and (det>0) then Event_Act(det,0,1,''); + if (erreur=0) and (det>0) then Event_Act(det,0,1,'',false); end; procedure TFormDebug.ButtonSimuAct0Click(Sender: TObject); var det,erreur : integer; begin val(EditSimuDet.Text,det,erreur); - if (erreur=0) and (det>0) then Event_Act(det,0,0,''); + if (erreur=0) and (det>0) then Event_Act(det,0,0,'',false); end; procedure TFormDebug.ButtonRazToutClick(Sender: TObject); diff --git a/UnitFicheHoraire.dfm b/UnitFicheHoraire.dfm new file mode 100644 index 0000000..e1e607b --- /dev/null +++ b/UnitFicheHoraire.dfm @@ -0,0 +1,56 @@ +object FormFicheHoraire: TFormFicheHoraire + Left = 358 + Top = 169 + BorderStyle = bsDialog + Caption = 'Fiche horaire' + ClientHeight = 346 + ClientWidth = 527 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + OnActivate = FormActivate + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object Label1: TLabel + Left = 24 + Top = 272 + Width = 310 + Height = 13 + Caption = + 'Le nom des trains doit respecter l'#39#233'criture d'#233'clar'#233'e dans CDM Ra' + + 'il' + end + object LabelErreur: TLabel + Left = 136 + Top = 304 + Width = 3 + Height = 13 + end + object ButtonOk: TButton + Left = 16 + Top = 304 + Width = 75 + Height = 25 + Hint = 'Sauvegarde la fiche et ferme la fen'#234'tre' + Caption = 'Ok' + ParentShowHint = False + ShowHint = True + TabOrder = 0 + OnClick = ButtonOkClick + end + object StringGridFO: TStringGrid + Left = 8 + Top = 16 + Width = 505 + Height = 233 + ColCount = 4 + Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goEditing] + TabOrder = 1 + OnDrawCell = StringGridFODrawCell + end +end diff --git a/UnitFicheHoraire.pas b/UnitFicheHoraire.pas new file mode 100644 index 0000000..e93f660 --- /dev/null +++ b/UnitFicheHoraire.pas @@ -0,0 +1,312 @@ +unit UnitFicheHoraire; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, StdCtrls, Grids , UnitPrinc ,StrUtils; + +type + TFormFicheHoraire = class(TForm) + ButtonOk: TButton; + StringGridFO: TStringGrid; + Label1: TLabel; + LabelErreur: TLabel; + procedure ButtonOkClick(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure FormActivate(Sender: TObject); + procedure StringGridFODrawCell(Sender: TObject; ACol, ARow: Integer; + Rect: TRect; State: TGridDrawState); + private + { Déclarations privées } + public + { Déclarations publiques } + end; + +const + MaxHoraire=20; + +var + FormFicheHoraire: TFormFicheHoraire; + + GrilleHoraire : Array[1..MaxHoraire] of record + NomTrain : string ; + Adresse : integer; + vitesse : integer; + sens : boolean; + arretDepart : boolean; // arret du train au démarrage de l'horloge + heure,minute : integer; + detecteur,actionneur : integer; + end; + +implementation + +{$R *.dfm} + +procedure TFormFicheHoraire.ButtonOkClick(Sender: TObject); +var f : textfile; + ligne,col,n,i,erreur : integer; + s : string; +begin + assignFile(f,'FicheHoraire.txt'); + rewrite(f); + writeln(f,'/ Fichier horaire'); + n:=stringGridFO.RowCount-1; + if n>MaxHoraire then n:=MaxHoraire; + for ligne:=1 to n do + begin + grilleHoraire[ligne].NomTrain:=stringGridFO.Cells[1,ligne]; + + s:=stringGridFO.Cells[2,ligne]; // heure de démarrage + val(s,i,erreur); + grilleHoraire[ligne].heure:=i; + delete(s,1,erreur); + val(s,i,erreur); + grilleHoraire[ligne].minute:=i; + + s:=''; + for col:=1 to stringGridFO.ColCount-1 do + begin + s:=s+stringGridFO.Cells[col,ligne]+','; + end; + writeln(f,s); + end; + closefile(f); + close; +end; + +procedure couleurs_fiche; +var c : tcomponent; + i : integer; + fond,texte : tColor; +begin + if sombre then + begin + fond:=couleurFond; + texte:=couleurTexte; + + formFichehoraire.Color:=fond; + for i:=0 to formFichehoraire.ComponentCount-1 do + begin + c:=formFichehoraire.Components[i]; + //Affiche(c.Name,clyellow); + composant(c,fond,texte); + end; + end; +end; + +procedure TFormFicheHoraire.FormCreate(Sender: TObject); +var i,champ,ligne,col,erreur : integer; + f : textFile ; + s,ss : string; +begin + // cells[colonne,ligne] + with stringGridFO do + begin + Hint:='Grille horaire'; + ShowHint:=true; + ColCount:=6; + RowCount:=14; + Options := stringGridFO.Options + [goEditing]; + ColWidths[0]:=30; + ColWidths[1]:=200; + ColWidths[2]:=60; + ColWidths[3]:=60; + ColWidths[4]:=50; + ColWidths[5]:=60; + + Cells[0,0]:='Ligne'; + Cells[1,0]:='Nom train'; + Cells[2,0]:='Départ'; + Cells[3,0]:='Vitesse'+#13+'démarrage'; + Cells[4,0]:='Sens'+#13+'(N/R)'; + Cells[5,0]:='Forcer arrêt'+#13+'O/N'; + + RowHeights[0]:=22; + + for i:=1 to RowCount-1 do + begin + if i>0 then Cells[0,i]:=intToSTR(i); + RowHeights[i]:=16; + end; + font.Color:=clBlack; + end; + + try + assignFile(f,'FicheHoraire.txt'); + reset(f); + except + //Affiche('Fichier horaire inexistant',clYellow); + exit; + end; + + ligne:=1; + repeat + readln(f,s); + if s<>'' then + begin + col:=1; + if s[1]<>'/' then + begin + col:=1; + repeat // lecture de la ligne + champ:=pos(',',s); + if col=1 then // nom du train + begin + if champ=0 then begin affiche('Erreur 17',clred);closefile(f);end; + ss:=copy(s,1,champ-1); + stringGridFO.Cells[col,ligne]:=ss; + grilleHoraire[ligne].NomTrain:=ss; + if champ<>0 then delete(s,1,champ); + end; + + if col=2 then // heure + begin + ss:=s; + if champ<>0 then ss:=copy(s,1,champ-1); + stringGridFO.Cells[col,ligne]:=ss; + val(ss,i,erreur); + grilleHoraire[ligne].heure:=i; + delete(ss,1,erreur); + val(ss,i,erreur); + grilleHoraire[ligne].minute:=i; + if champ<>0 then delete(s,1,champ); + end; + + if col=3 then // vitesse + begin + ss:=copy(s,1,champ-1); + val(ss,i,erreur); + grilleHoraire[ligne].vitesse:=i; + stringGridFO.Cells[col,ligne]:=ss; + if champ<>0 then delete(s,1,champ); + end; + + if col=4 then // sens + begin + ss:=copy(s,1,champ-1); + grilleHoraire[ligne].sens:=ss='N'; + if grilleHoraire[ligne].sens then ss:='N' else ss:='R'; + stringGridFO.Cells[col,ligne]:=ss; + if champ<>0 then delete(s,1,champ); + end; + + if col=5 then // arret du train au démarrage de l'horloge + begin + ss:=copy(s,1,champ-1); + grilleHoraire[ligne].arretDepart:=ss='O'; + if grilleHoraire[ligne].arretDepart then ss:='O' else ss:='N'; + stringGridFO.Cells[col,ligne]:=ss; + if champ<>0 then delete(s,1,champ); + end; + + + inc(col); + until (col>stringGridFO.ColCount-1) or (pos(',',s)=0); + + inc(ligne); + end; + end; + until eof(f) or (ligne>MaxHoraire); + + closefile(f); + couleurs_Fiche; + StringGridFO.Selection:=tGridRect(rect(0,0,0,0)); + +end; + + + +procedure TFormFicheHoraire.FormActivate(Sender: TObject); +begin + if FormFicheHoraire=nil then exit; +end; + +// apellée sur dessin d'une cellule. +procedure TFormFicheHoraire.StringGridFODrawCell(Sender: TObject; ACol, + ARow: Integer; Rect: TRect; State: TGridDrawState); +var + s,sM: string; + i,erreur : integer; + DRect: TRect; + couleur : tColor; + Grid: TStringGrid; + d11 : boolean; +begin + Grid:=Sender as TStringGrid; + + s:=Grid.Cells[ACol,ARow]; + sM:=uppercase(s); + if (Acol=2) and (Arow>0) and (s<>'') then + begin + if pos('H',sM)=0 then LabelErreur.caption:='Erreur : l''heure doit être au format HHhMM' + else labelErreur.Caption:=''; + end; + + if (Acol=3) and (Arow>0) and (s<>'') then + begin + val(s,i,erreur); + if (i<0) or (i>120) or (erreur<>0) then LabelErreur.caption:='Erreur : la vitesse doit être comprise entre 0 et 120' + else labelErreur.Caption:=''; + end; + + + if (Acol=4) and (Arow>0) and (s<>'') then + begin + if (sM<>'N') and (sM<>'R') then LabelErreur.caption:='Erreur : le sens doit être N(direct) ou R(recul)' + else labelErreur.Caption:=''; + end; + + if (Acol=5) and (Arow>0) and (s<>'') then + begin + if (sM<>'O') and (sM<>'N') then LabelErreur.caption:='Erreur : la demande d''arrêt doit être N(non) ou O(oui)' + else labelErreur.Caption:=''; + end; + + + // pour écrire sur 2 lignes dans une stringGrid + { + if Length(s)>0 then + begin + if Arow=0 then + begin + Grid.Canvas.Font.Color:=clBlue; + // Grid.Font.style:=[fsBold]; + end + else + begin + Grid.Canvas.Font.Color:=clBlack; +// Grid.Font.style:=[]; si on valide sans style, créée evts continus!! + end; + end; } + + + d11:=false; + {$IF CompilerVersion >= 28.0} + d11:=true; + {$IFEND} + + couleur:=$E0E0E0; + if d11 then couleur:=$505050; + with grid.canvas do + begin + Brush.Color := couleur; + FillRect(Rect); + end; + + DRect:=Rect; + // calcule, ajuste et positionne la ligne de l'espace vertical nécessaire + DrawText(Grid.Canvas.Handle,Pchar(S),Length(S),DRect,DT_CALCRECT or DT_CENTER); + // if the text height is greater than the row height, increase the row height + if (DRect.Bottom - DRect.Top) > Grid.RowHeights[ARow] then Grid.RowHeights[ARow]:=DRect.Bottom - DRect.Top + // changer la hauteur de la cellule provoque son redessinage + else + begin + DRect.Right:=Rect.Right; + Grid.Canvas.FillRect(DRect); + DrawText(Grid.Canvas.Handle, Pchar(S), Length(S), DRect, DT_CENTER); + end; +end; + +end. + diff --git a/UnitHorloge.dfm b/UnitHorloge.dfm new file mode 100644 index 0000000..4d65fae --- /dev/null +++ b/UnitHorloge.dfm @@ -0,0 +1,591 @@ +object FormHorloge: TFormHorloge + Left = 198 + Top = 125 + BorderStyle = bsDialog + Caption = 'D'#233'finition de l'#39'horloge' + ClientHeight = 365 + ClientWidth = 423 + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + OnActivate = FormActivate + OnCreate = FormCreate + PixelsPerInch = 96 + TextHeight = 13 + object ImageHorloge: TImage + Left = 288 + Top = 24 + Width = 129 + Height = 129 + Picture.Data = { + 0A544A504547496D616765BF290000FFD8FFE000104A46494600010101006000 + 600000FFE100644578696600004D4D002A000000080005011200030000000100 + 01000001310002000000110000004A5110000100000001010000005111000400 + 000001000000005112000400000001000000000000000041646F626520496D61 + 676552656164790000FFDB004300020101020101020202020202020203050303 + 0303030604040305070607070706070708090B0908080A0807070A0D0A0A0B0C + 0C0C0C07090E0F0D0C0E0B0C0C0CFFDB004301020202030303060303060C0807 + 080C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C + 0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0CFFC00011080082008203012200 + 021101031101FFC4001F00000105010101010101000000000000000001020304 + 05060708090A0BFFC400B5100002010303020403050504040000017D01020300 + 041105122131410613516107227114328191A1082342B1C11552D1F024336272 + 82090A161718191A25262728292A3435363738393A434445464748494A535455 + 565758595A636465666768696A737475767778797A838485868788898A929394 + 95969798999AA2A3A4A5A6A7A8A9AAB2B3B4B5B6B7B8B9BAC2C3C4C5C6C7C8C9 + CAD2D3D4D5D6D7D8D9DAE1E2E3E4E5E6E7E8E9EAF1F2F3F4F5F6F7F8F9FAFFC4 + 001F0100030101010101010101010000000000000102030405060708090A0BFF + C400B51100020102040403040705040400010277000102031104052131061241 + 510761711322328108144291A1B1C109233352F0156272D10A162434E125F117 + 18191A262728292A35363738393A434445464748494A535455565758595A6364 + 65666768696A737475767778797A82838485868788898A92939495969798999A + A2A3A4A5A6A7A8A9AAB2B3B4B5B6B7B8B9BAC2C3C4C5C6C7C8C9CAD2D3D4D5D6 + D7D8D9DAE2E3E4E5E6E7E8E9EAF2F3F4F5F6F7F8F9FAFFDA000C030100021103 + 11003F00FDFCA28A2800A28AF8F7F6F8FF0082BA784FF6506BEF0EF86A3B5F16 + 78E2D548B88FCEDBA768C71FF2F32AF571FF003C93E6F52B401F5878B3C61A4F + 80F41B8D535BD4AC348D32D5774D777B70B04310FF006998802BE3DF8F1FF05D + 0F845F0C1E6B6F0BC5AB78FAF21E3CCB1416B600FF00D7C4B8DC3DD1587BD7E3 + B7EDCFFB7AFC5CF8E3F08F52F8B9AA59EBDE38F07E9BAB0D153573887C3FA75E + B024410C2A71C700BED382541724815F3A6A1ADB37ED77F0CF49F1AF8824F107 + C2DF89DA7D95C58DE853671C706A50BDAF9C551BE596CAF8BAB02C46EB539C83 + 8AF36B66D8682972CB99C79B48D9BBC55DC7B2959DECECEC68A9C9FF005DCFD4 + 7F8D9FF072E78B2D279A3D261F877E128C1F904CF2EA572A3DCEE44CFF00C06B + C52F3FE0E0CF8E1E34F17E93A2E93E39D4E7D63C44633A569FA57846069B5212 + 644660431334A188214AE73838CE2BF37FC13E0BBE83F66EFDA1BC03AE5B85F1 + 37C3FD434CF11B2BA6658A4B2BE934CBE507AEDDB7A8C4743E583DABDD3F6309 + 1B5AFDB33FE09F3AD659BCE09A3339EED63AD5FA05FF0080C72C42BCBCCB889E + 1E8D5AB4E29F2735B5DED4BDAA7E8ED634851BB49F5B7E763E9E6FF8382BE3CF + 82BC5BAB68BA878EF54875AF0E798755D3F54F08C0B369A232048678C44AD185 + C80C5B18DC33D6BD43E11FFC1D09F102DA78D756B2F877E31878DC2332E9770C + 3D88674CFF00C06BE14FDB261974FF00DB57FE0A0BAC44ADBE249346461C7CF7 + DAD58215CFBC714A2BC4BC61F0A6F27FD997F67FF02E9D12B7893C79A96A9E23 + 11C2A04B349797916996285BAEDDB64EC0741E613DE8CB7885E268D2AB522973 + F2DF5DAF49556FD16C13A366D2FEB5B1FD0F7ECFDFF07187C17F897716F65E34 + B3D6FE1BDF4D8066BD4179A767FEBE21CED1EEE8A3DEBEE7F87FF13BC3DF15BC + 376DAC786B5AD2F5ED26F143417761729710CA3D994915FC986A1E0AD2B5BFDA + D3E22683E11D59BC3BF0CFE1AE9F7935FEA6AAD76AD069B02DBBDC6D66F9A4BC + BD54555C805AE8630062BB0FD933F694F8F5FB2BFC2FB5F8D5E091E24F08F836 + 7D54E8F3EA910136877F78A01304F031DAD9CE03ED1C820302315EAD1CD70F51 + 479A5CAE5CBA4B4779ABA8F672B2D96A652A7247F579457E6F7FC1307FE0E0DF + 05FED75A869FE0BF8851D97823E215C622B6FDF674CD71B1FF002ED2B7DD73FF + 003C9CEEFEE96AFD1DB6B98EEE1592365756E8457A2412514514005145140051 + 457827EDD1FB454FF0AFC10741D0EE96DFC45ADC2D9B80D83A6DB7479B3D98F2 + 17D0E4FF000D007CFDFF00054FFF008298FF00C2B2D075BF097837598F498F4D + 89D7C45E244902FD8063E6B7B76FF9EBD99C7DDCE07CDC8FC1FF00DA1BF68FD4 + 92EBC0BE34B8F0E5A789BE09EBD7B3453DB437CDBB5578D992E6CEEA5421EDAF + 021132231C90F1BFCE3701D87FC1403F6B09353F889E1DB8D4FC0D71E2AF803A + 835DD84332DDB5BC7E259959A29E682EA22443770302F12CA0F38778D91C5791 + 699A6DBFECBD6B2EA366D75F173F665F8AAEB63A818945BDD472A659239D3E61 + 61ADD9E4BC6C7E495776D32432301E0E63987FCBAA3ADEEB476E6DD4A11927EE + D45BA4ED76AC9EEE3B53A7D5FF00C379FA1F4DFF00C135FC53E19F81DF197C41 + FB34F8EB577F12FECE3FB54697E6784B5D9C04513C994B6B8C1E21B94917ECF3 + 2646CB8810F4C13F2EFED73F0BEE7F66DF0078B3E03FC42BA92CFE207C16F15B + 4FE12B9F25C8D6349D439B948D80C22878EDEEE32C40CCB3A8F98E2B82F1A78B + 2EBC33E13D5BE1AE87E21B7F12F8134BF12FF6EF873599AC1ADB50B49366D335 + B863BADBCE51179D1F2A5E0461D031FAFF00FE0A13FB40FC39FDBD7F601F863F + 1835BF11687A67ED05E09957C1BE21D2E571F6EF145B20DC97688064EDC89379 + C005E55CE4283F1B1CB71380CDE962DA72A5889454DA5AAA915EE556ADA73C2F + 4EAAB593B3D3A757B48CE9B8F55B7A755E767AA3E53F1BFED4DAA78D3E3A78CB + C75A5E876B6337C45F0C3E83E22B7BE632437735C59C50DEDD205DA43493C5F6 + 85073B5CF3BB9CFA77FC12BBC55A96B5FB7C7ECC1E1BBFBA4BAD2BC1FE350FA5 + C62154680DDCC259F2C39605D0100F4E71D6BE5F7D726BB7DB6D6ECDEEDFE15B + 7F0EFC59E33F869E37D27C4DE19D4AE341F1068772B79A75FDB051359CCBF764 + 5DC08C8F706BED31F9252AB80A984A09272838A6F5B7BAE2BCF44DAEF6396355 + A9F33EF7FC6E7D1FFF000547F897AB7863F6FAFDA73C31633C71E91E2DF1A336 + A719894BCC6D6632C186EAB8772481D78CF4AF3DF01FED7B75E18F8E5E0AF1BE + A9A3DB5DDC7C3AF0E47A1F87ED2D1BCA8ADA6B7B49A2B3B97DDBB714B897ED0E + 063730E36F18F34F889AFF008D3E29F8DF56F147893549B5CF106BB72D79A8DF + DD05335E4CDF79DF000C9E3A015CF491DE591FF48B56C7F793FC28C064746960 + 29612BC537182836B4BFB8A0DFCD24BBD82555B9B92EF7FD4FA53F659F87975F + B417C3BF0CFC10F87F7525F7C44F8D5E2B43E269BCA70348D2AC70D6E9239186 + 5691E7BB90A923F71003CF15F50FFC149F5FF0F7C59F8ADE18FD967E1FEB03C3 + 7F00FF00665D30DCF8C75F41BA213C5817774C0712CFBDFC98939F32E676038E + 4703FF0004E5FDA23E1F7FC13F3F60CF8A3F1A34DF12687AB7C7EF14CA7C1BE1 + 6D1564DD7BE1A8241B9EF648D86406C17DE32A7CA8D3396603E45F04FC59BAF1 + 5784ACFE1AEB5E22B3F0AF84FC49E254D6BC4BAFB5A49717776E176A4B75B097 + 9D20CCAF1C4001E64CEC792197E35E5F88C766D571514D52C3C9A8B92D5D4925 + CF512B7BDECE16A74F477777AEE74F3C614D47ACBF2E8BE6F567477B633FC5AB + 9F885E3AF08F86AD7C1FF0CFC292432241757E545906658ED6D5267399AFE50A + 65289C92B2B808A057EB2FFC1097FE0BFF00773EBDA3FC1BF8D1AD7DAE4BC65B + 3F0D7896F24F9AE5BA2D9DD39FF96BD9243F7FEE9F9B04FE656A96363FB4DE8B + 0CBE75E7C29FD977E15CED6F6B733C626BED4EEE400C8C91E40BED6EEC282403 + E5DBC7B4332449F379778E344BAF8D6BE28F1A7807E1F49E13F873E09B6B6B59 + 5D2E8C8B62A18242D717721513EA1331DEC220189C948D5138FAFCB7307FC2AB + A2565ABF876518CA4DFBD525BB4AF6BD9BD9CB9AA53EABFAFF00807F697A7EA1 + 16A96893C2C1E39064115357E47FFC1B67FF00058B97F6AFF86727C2DF1EEA82 + E3E20782E0455B999FE7D66C7EEC771EF229C2498EFB5BF8ABF5C15B70C8E95E + F9885145140143C53E25B3F07786EFF56D4265B7B1D36DDEEAE2563C22229663 + F90AFC38FF008298FF00C1463C2D3F8F749D2FC777DE20B3D0FE25EA462D79F4 + 3C1D4B4DD0D410CB0E4FCACC364791C80D21009C57E867FC16C3F6905F829FB3 + 2586810CFE4DF78E750168D86C116B08F367FC0E235FF81D7E0AF8DFC5FF0018 + 3C51AC7883C79A4FC3FD27E25FC31D6F643776171A641AFDAA456ECE8A664818 + DDD84A099087530B61C1C904579D9AD650C3CA2E5CAE5A2F7945DDFF002B774A + 56D579A2E9C6F23D5AFBFE097FE27F839E02D6BE207ECBBE2AD17F698F803E24 + 01B5FF0005DD27DA2778D46425D5A02AC678C6764F0F957319190319CFC4FF00 + 133C5BA1F83351D7347F86771E33F0DF853C556B0A7883C35ACB83259DC45297 + 169238C7DA52175568E6748E4018A9507716F48F879FB527877E01EA775E3FF8 + 27E27F1F7C17F889A794F3BC34D2FF006CE8BAB0DE03C497076C8AA012DE55DC + 720C29025CE2BD93F682FF00828EFC07FDBE3E00789352F8D5F0CA7F0AFC79D2 + 74B77D17C53E0E510DBF896EC0C4715D21CED05882C5F780A0ED653853F0597C + 736C06214B154A588A4DA4E4928D45B59D487C153974FDE537756D568CEC9FB3 + 9AF75D9F6E9F27BAF467C0BA9EA82C902A7CD337DD1FE34FD0FC1D26A928B9BC + 27E6F5F4A7F83B406D464FB65D0DC5B902BD32CFE14F89AFBE185E78D2DFC3DA + BCDE0FD2EF574CBBD663B566B1B5B965DEB13C806158A9079C0E40EA40AFD2AA + 56853B3A8D2BBB2BBB6AF65EAFA238526F6399B4D320B140238D571DF15609DA + 29ACF516E35A087B354722ACA30CA08F4345359F140191ACF83ADEF8F991810C + C070C2B92D46C26D32731CCB83D8F66AF4167AEEFF0067EFD897E257EDC3E246 + D07E1BF84353F125E46C167BC44F2EC74FCF1BA7B86C4718F62DB8F606B9F178 + CA185A4EBE266A108EEE4D24BD5BD0A8C5C9DA3B9E7BF0AFC79A2F89759D0748 + F89575E39F12784BC2D6F70341F0CE8930125DDCCB287FB1C6CD9FB324D23334 + 92C6924842E15492A57EF2D17FE09A5E2EF8C7F0F346F889FB5778AB41FD97FF + 0067DF0C82FE1EF05DAAFD9EE5636C1296B664B309E418DF3CDE6DCC84E48C63 + 163C5BFB427C31FF00820E471F81FC1DF084F88BF6A7B3D3E23E20F1778B0FDA + B4DD1269630DBF4D1B57CD85810C8C8B1E470EC58328F91FE25FED6DE1AFDA17 + 53B5F889F1D3C51F113E387C48D41DFC9F0BACBFD8BA1E8EBBC848DEE46E9195 + 800DE559C51F0C01977671F9A56AF9966F3589CBE0E8E1DFC352CA55249DDB95 + 285F929A96BFBDA8EED3D16A8EE8F253F767ACBB74F9BDDDBB239DD33F69FF00 + 0BFEC61FF05125F891F022EBC46FE05F0DEB5E6E9106AFFBBBEBAD3582ACF6F3 + 00790CBBF696E78424020D7F5E7FB1FF00ED09A4FED2FF00023C3DE2CD1EEA3B + CB1D62C62BB865539DE8E8194FE46BF916FDA37C09F183E29FC1983C4DAE7C34 + D17E18FC35F0CAB5C68F61069507876D4994A2B1812E185E6A12B6172ECD3310 + A4E4006BF613FE0D13FDB2A4F197ECFDA97C34D4AE9A4BAF05DF35B5B076C9FB + 2CDFBD8BF052645FA28AFD0F2BACA7878C54B99C747EF293BAFE66ACB9ADACBC + D9C551599FB6D451457A041F863FF073E7C7DB83FB4EE93E1BB79D961F09F84C + 4AC99E04F7933927EBE5C51D7E63783FC15F0E22D62DF59F02FC7ED5FC07E244 + 0195BC45A05EE952C4F8C90B7DA7BDC0DB9E01655C8EA057D83FF05F3D4756F1 + E7FC155FC71A4E93A637887586BDD134AD3F4AF27CF1A8CBF6580C76FE5820B8 + 76936ED0467711915E5727EC7BF1935966FED9FD80C49B8FCEDA3C5ACE90E7E8 + 12EDE35FC12BE6788732A387E5A756A725D3D39A92BFAAABBAF43A28D36F54BF + 07FA1F3D7ED71F11BC71E23D4F47D2FC6BE32F04FC449ED6137769E21D0E6B4B + E9EE637CA6CB8BC8A349A423667CBB8CB2E73FC593E2373136A5A9DBDA8E771D + CFFD2BEA5F899FF04BCF8FDE25F174F79E17FD987E28784B47911047A63A4DA9 + 18580C3113C815D831E70471D326BE7ED4BE1B6B9F0BBE2BEB5E1EF146937DA1 + 788741945ADFE9F7B1F9771672850C51D7B1C303F8D756498EC055A2A8612A42 + 4D2BB5171D2FDD45B4BE4ED726B4269DE49FE269C102DA5A2C6985DAB81C74AF + DC8FF8227FFC144BE02FC4DFD9DF41FD9FE7D174DF037892DED1ACE6D135864B + 8B1F18C92733CD1CAE36CD2CAD92D0C8038180BB940C7E1BB3D47246B2EDCE77 + 2B0756070C8C0E410472083C823915E4F1C705E1B89701F53AF5254DC5F34651 + 7B496CDAD9FE7D9A34C2E2A5427CC95CFD7EFF008298FF00C1BA047F6878D7F6 + 7987691BAE2F7C0F3CD81EA4E9F2B9E3BFEE2438EC8C385AFC8DD7B44BEF0AEB + B79A5EA96379A5EA9A74CD6F7767770B43716B229C323A300CAC3D08AFD20FF8 + 267FFC1C31E27F80034EF057C719352F1B782630B6F69E248C19B5AD1578004E + 3ADDC2BEBFEB94777C62BEFDFDB5FF0060BF827FF0569F82F63E36F0EDE68B73 + ABEA90A2E95E3BD002DC5C6D1F72398290268C1F91A393122678284115F93E5B + C6D9FF000762619571741D5A0DDA15E3ABF2E6EFE8FDF5FDED0F42785A38A4EA + 61DD9F547F3A8CF5DF7ECE1FB29FC46FDAFBC683C3FF000DFC23AB78A2F95809 + DEDE3DB6B620FF0014F3B623897FDE607D01AFD32F81FF00F0408F857FB2DE87 + 79E3AFDA93E28E87368BA3CDC69D6574FA769728CE6312CEF89E5775E7C9882B + 738CB553FDA3FF00E0E19F08FC09F05FFC2BEFD94FE1FE8FA1E8B62A61875BBE + D356D6CE3EDBEDAC5705D8E33E64E413D4A1AFB2AFE23D7CCEA3C2708E19E224 + B4756578518FAB76727E4ADE4D9CAB02A9FBD89972F975353E06FF00C1057E11 + FEC75E0687E217ED65F113456B5B6C48745B7BD6B3D2830C1F29E5E27BB7EDE5 + C2AA0FFB42B0FF0069CFF838AB44F857E10FF8407F659F01E93E17D034F5305B + EB7A869A96F044071BAD6C17033C677CE493D4A57E66FC72FDA07C6DFB4B78E6 + 5F12FC40F14EB3E2DD6E4CE2E350B8320817FB912709127FB28AA3DAB8D77AAC + 2786B3C75658DE2CC43C5D45AA87C3463E905F17ACB7EA8258EE45C9875CABBF + 5FBCABFB557C5AF177C7EF8933F8CBC6DE22D5BC53E21D4808EE2FF509BCC919 + 573B1076545190A8A0281D00ADAFD8EFE2378F3C2DABEB3A5F817C6DE06F86F7 + 17900BBBBF116BD359E9F716B1A61365BDECB1BCF1962F931DBE1DB19FE1C8C6 + FF008573AF7C5FD7B4BF0D785F47BEF1078935ABA5B6D3B4DB28FCCB8BC94E4E + C45EED804E3DABD4FE19FF00C128FF00688F0DF8D2DEFBC55FB2BFC56F1868B0 + A38934A449B4BF3D8AE10F9F186750A79200F9BA6457DC66988CB70987FAA569 + D382B7BB19722565B5A3269595B4E872D38CE4F995FF001394F1DF81BE17DE6A + F75AC7C40FDA2759F881E23983173E1AF0EDF6AF34CF8E035F6A4F6CBB73C12A + AD81D01E2BDF7FE0D9BF8DD37C27FF008288BE93E6F976DE26D288233C192095 + 597FF1D77A887EC53F1AF4497FE247FF0004EE58761CA3EB50EB9AC38FF7835E + 246DF8A5791FFC133E5D67E187FC159FC2B67AC68FFF0008CEB56BADDFD86A3A + 4880DB8D2E6092F996DE5924A08D94AED24E36819358E419951C4B953A5579EC + 97DAA4ECBC9536ECBD42B41C756BF3FD4FEC6EC7565B8B2864FEFA2B7E628AE1 + 7C35E262FE1CD3DB79E6DA33FF008E8A2BE90C4FE79FFE0BE579AB7803FE0AEF + E3ABED2756FF008477594BED1355D3B5333183FB3A5FB2C023B832609408D1EE + DC01C6DCE0D79FC9FB65FC66D219BFB63F6FE8E1DBC3268F36B3ABB7FC04A59A + 46DF83D7D01FF0762FC2D97C1DFB71F877C4EB1EDB5F1A784D22DF8E0CD673B2 + B0FAF972C75F01F83BE217C35B9D66DB45F00FECFF00AC7C40F1248AAAA3C43E + 20BDD5A495F1C95B1D392DC6DCF20333607526BE678832DA38871A956973D93F + B349DBD5D5D97A7CCE8A3371D13FCFF43B0F897FF054DF8FDE15F164F67E19FD + A7BE2878B7488D10C7A9B34DA619D88CB8104859D429E01279EB815E0D79F117 + 5CF8B7F11F5CF13789B56BED7BC43AE4DF6ABFD46F24F32E2F24DA177BB776C2 + 81F80AEBFF006C2F0178E7C2DAA68FAA78EBC1BE07F877737709B4B4F0EE8515 + 9D8DC5B46997DF7165148F3C64EFC79971876C63F8703CABC1D7DE56B186E3CC + 5C0AEAC970380A54557C253845B566E2A3AFCE2927F256B9356736ED26FF00AF + 53B327151B3D233F34C2735EE188ACDB857DCBF09FFE0B53A87ECD1FB26F82FC + 23F0CFC1361E1FF1D68F0B5A6BBAA0291E91ACC4AE7CB91ED107EF2E5E3203CC + C54EE04FCD9E3E19A466DB5E2E77C3B97E6F0852CC69F3C612E649B76BDADAA5 + BAD767A5EC6B46B4E9BBC1D8FD5BFDA73FE0AEBE13F8A1FF00048AF105CE8FE1 + 59BC41E36F1F6B30F85B5AB5D7ACE3BAB4F0D5E7D8C1FB60500A2AB43116B6D8 + 1732F987831915F94284A44AA5892A3049EF5E97FB317C4DD1FC25E2ED4BC37E + 2E99A3F00FC40B41A27885C2EE3A70DE1EDB5141FF003D2D270928EE53CD4E8E + 6B8EF8A3F0DB58F839F11B5AF0A6BD0A43AC787EEDECEE446DBA3908E5648DBF + 8A3914ABA30E191D4F7AF1784F8770590CEBE03089A5397B45777BA76565FE0B + 5BD1C5BD59AE26B4AB5A72F430CBD368EF52476324832DFBB5F7EB5F68729466 + F8A1AF7C1DF10695E25F0AEB17DE1FF1268B72B73A76A3652797716728C8DE8D + D9B05867DEBD5BE15FFC157FF68AF16F8CEDEC7C51FB547C55F07E8B2A399756 + 579B53F2182E50791195760C78CA9F97AE0D781FC49BA8DAF63B75F9BCBF9989 + FCABD07F639F87FE3CF156B3AD6A9E03F04F817E245CD9C02CEEFC39AFC3677F + 71771BFCFBEDECA591279586CC192DF2EB9C7F160F8B9D607035693AD8BA7093 + 4AC9CD474BF6724D2D7BAB5CD69CE69DA2DFCBFE01F4847FB687C6AD6255FEC6 + FF0082882CCCC7091EB33EB7A3B7FC08BD9BC6BF8BD7867FC13BEFB59F885FF0 + 564F0F6A3ACEB1FF000926B336B77B7B7FAAACFF00685D4A76493CCB91210378 + 9198B6E20677670338AA7E3BF885F0C2C359BAD17E217ECEBAD7C3DF12C61848 + 3C35E22BED22585F1C16B1D4A3B85DB9E48565C8E8457A57FC1BF3F096E3E20F + FC14060D4BCB6922D2EDBAE380D2C8A07E3B55AB9720CB68E19CA74A9725D2D7 + 9692BFA3A7BAF52AB5472D1BFCFF0053FA9EF0AD9483C31A6FCBFF002EB17FE8 + 028AEDF43F0C8B7D16CE3DA7E48117F251457D2181F9B1FF00075CFECC337C54 + FD84F4EF885A7DB99B50F85BAA2DFCE5572C2C271E45C7E0A4C4E7D90D7E18FC + 0DF1C7C5AF891F0AEEFC33A2FC4BD17E19FC36F0D858B56BFB8D561D02D8F9AC + ECA266B75179A84AD86C20599B0A060002BFAEEF8EDF09F49F8E7F08BC45E12D + 72D23BED27C4161369F77038C8962950A38FC4135FC7FF00C44FD99BC37FB0A7 + FC14926F863F1DACFC4175E04F0BEB822D4A6D25BCBBED43497CB4171031EBB9 + 0A6E00824ABA820E2BCFCD28A9E1E52E5E671D57BAA4EEBF953B2E6B68AFD4D2 + 9CAD2B1D07C31FD93FC3DFB456AB79F0F7E04F84FE207C6CF8897EC9F68F15CB + 1FF62E89A30DE0B4A96C77395600AF9B792A70C488B762BDB3E3DFFC13E3F67B + FF0082707C0AF11587C66F8A175E34FDA1352D35D346F0BF82DC496BE17BB201 + 8E4BB76C6E01861849B72A5B6A31C30EC7C4BFF0530F18FC6CF86FAC7807F65F + F0E683FB2CFECEBE19C43AFF008C6E1BECF70118100DC5DA8676B9946765BDBF + 99732671BB1923E0AF8B1E02D1FC6575E20D7BE18697E38D6BC17E0DB6B75F10 + 789F5FDA25BEBA9A5282EA541F2DB79CEC163B72F2C9B50B3313BB6FC0E01E6D + 8FC4258BAB2C3D24D3714D4AA37A72AA93F829F3696A54D5DDF57AB3AA7ECE11 + BC5733EFD3E4BADBBB23D1B535D5B4F8E65232C3E603B1EF56ABCE340F1449A0 + DDEE5CB42DF7D73FA8AEDF4ED7ADF56895A29158919DB9E457E9C70979DF8E2B + D2975BF82EA837681F149982A647F6BD8A866D8DBFFE589C02FB08EB85041C9E + 6BCD62B392E3B6D5F535661D3A38B96F98FE9401E87A66A5F0567F0DC6977E1D + F8AADAC7951091EDF58B0FB26F1FEB48568776D3FC209C8CF24E39F4C3F08BFE + 1B07F678D27C53FDB1E1DF0B6ADF0FF504F063EA7E2BD5E2D36DFC41A7323CBA + 747F6861B64BCB58D4C0E00C184DBB1202D7CEA4855C7DD5F4AF52F871F193C0 + F75F0697C07F11B42F166A1A2E9BAD4BAF6957FE19BDB7B7BFB696786286E609 + 12E11A292391208486E1E364E370622BC5CEA8D69429D5C3A7CF09277493693D + 2564DA4EEB46AFE7BA46D45ABB52D8E0FE227C39D5FE0EF8E354F0D78834E934 + BD734798DBDDDB3B2B146C020865255959486565255958104822B93F11EB89A3 + 69D24CECBB80F941F5AF68FF00828B6BB0E9FF00B45DE6B10FD9FF00E116D734 + 9D3AEFC23342CCD1DD68696B1DBD91DCDF334A91C3E54B9E44D14A0E315F27F8 + 9FC4F2F882EB736444A7E55FEA6BB32CC4CB1184A75E7BCA29BB6C9DB55F27A5 + B75B19D48A8C9A47DFDF017FE09DFF00B3E7FC14B3E03F876C3E0E7C54BAF057 + ED17A6E9CA9ACF85BC6AE22B3F145D004BBDA3AE76827E55F2CBE142EE4072C7 + C27E29FEC93E1DFD9BB54B4F877F1F3C27F10FE07FC44B0693ECFE2C863FEDBD + 0F595F318A4AF6C36B855042F9B672BF0A098B7673E57F0AFC07A37842FF00C3 + BAFF00C50D33C75A27823C5D0DCA683E26D0957CDB3BB864086EA256C2DC081C + 11240248A4C30656076EEFBDBC3FFF00053DF197C0DF867A3F803F6A6F0D7877 + F6ADFD9B3C4C7C9F0FF8CADDBED173B14609B7BB60B22DCC431BEDEE3CBB98F1 + 8DD8C13F078EFED6C0576B0956588A4DB6A0DA8D44F5BAA73F82A72EBFBBA8AE + ADA3D15BB21ECE71F7972BFC3E6B75EA8F93FE33F8A3E32782FE19D9784756F8 + 9BA2FC51F863E27478F4BD42DB5683C436A82128EC20370A6F74F99772651961 + 6C3118209AFD2FFF00835BFF0064A91357BCF165C5BFFC84AE7CD562BFF2CD3E + 54FF00D98FE35F9C8BF01FC0BE35FDA3B5CB7F843A7F88ADBC0FE23D502F87A3 + D6D849A8C36385C34A4723277B007242940493935FD337FC121BF65583F679FD + 9E74B5FB2AC134902803182A31C57DD65945430F1972F2B96AFDD51777FCC95D + 7374979F6392A4AF23EBC8E311C6ABFDD18A29D457A04057E48FFC1CE1FF0004 + 859FF6C0F83D0FC52F0269A27F88DE05B776F2214FDE6B561F7E4B6F7914E5E3 + CF7DCBFC75FADD55B57D2A1D6B4F96DAE11648E552A411401FC4B7C31F1CAFC6 + 8B9F0AF82FE24FC42D43C2FF000EFC1305D4F044B66D70D6432D24B15ADAA00A + F7D3B9D81E5239C6F70898AF58D32FE1FDAD34E786E229BE137ECBFF00092417 + 3716968FF69B879E5042297207F686BB7814A8761B625DC408E18C83F7F7FC1C + 31FF0006FF00EA5E1CF17EB1F1ABE0CE8ED71F6C66BCF11787ECE3E676EAD776 + CA3FE5A7778C7DEFBC3E6C83F95FF0FBE2EFFC2EC5F877F0DBC69E25B2F02FC3 + FF000BDCCA259E0D3C88ED4C8CCF757B245182D717CEAA22567E7E58932AA0D7 + 879865EFF8B4B4B5DE8BE1DDCA518A5AD47B26EF6BDD7552DA13E8FF00E1FF00 + E00FF1D7C1DB8F19784754F89FA2E8163E0DF05EB9E253A1F86BC3E6F64BABDB + B936EE686DB702D38814C42595881E64E8A064ED1F62FF00C1423E02F80BFE09 + ADFF0004FAF85FF06EF7C3BA1EA5FB4378D275F1AF89F599630D7BE17B770152 + CD1C72036D11EC3953E5CAD8CB291DA7FC134FC3DE1BF8D9F18BC49FB517C40D + 1DBC33FB3AFECB3A5883C21A04ADBE313C597B4B604F135C191BCF99F9F32E67 + 4CF1803E55FDAE3E29DD7ED19F0E7C59F1E3E225AC97DF10FE3678B1A1F095BF + 9CF8D1B49D3F8B978D01C329792DECE30C08FDCCEC3E619AF8D58FC463F36A58 + 46DAA587927249EAEA497B94DBBFBDECE17A953577765AF5E8E48C29B9757F97 + 57F37A23C3EC3E27CD08DB347E67FB43FC2BA8F8717DA87C5FF1DE8FE17F0D69 + 37BAD78935FBA4B2D3B4FB65066BD9DBEEC68090371F722B43E23FEC7B7BE1AF + 8F1E35F02697AD5ADD5C7C37F0C49AF788EEEF17C986D26B6B38A6BDB54D9BB7 + 18E797ECE84E3738E76F38EF7FE094BF0DF59F0CFF00C1433F657F145E5B470E + 8BE30F1CAA6972F9CACF39B498453E5072A15DD4027EF738E95F698ECEA952C0 + 54C5D169B8C1C927A5FDD725F7A4DF7B1CF0A4DCD45F7FD4F2EF8A17BA87C20F + 1DEB1E17F136957BA2F89340B96B2D474EB95C4D673AFDE8DC0246E1EC4D717A + AFC519AE14ADBC7E583DDBFC2BE82FF82B17C32D6BC4FF00F050EFDAA7C53636 + D1CDA2F83FC70CBAAC86655783ED7318A0C21E5833A1048E9C67AD79CFC3CFD8 + E6EFC4DF1EFC0BE04D5B5BB5B3B8F899E198F5EF0EDDD98F3A2B99EE6D2696CA + D5F76D2AD25C442DDC8CED6271BB8C981CE2955C053C5D669394149A5ADBDD52 + 7F7277EF609526A6E2BBDBF43EB8FF0082757C36F0A7FC150BFE09E1F11BF67D + 7D374DB5F8EDE00697C63E02D55F3F68D62DC333CDA7866276A6F770634C2E67 + 4908CAB31F89BC0BF0B2FF00C19E0DB6F8A1A978774BF18785FC27E288F45F14 + F86A7B99ADEEAC988CA4778102BC315C6D9A38E5563896165600E15BD27F650F + 89B79FB3F7C30F0CFC77F8736ADA6FC4CF813E2F4FF849E1F35CAEB3A45FE16D + DE44270A8B2C73D9C814018B9809F98E6BEB0FF829EE8FE1EF841F167C23FB5E + 7C33D1E3F127ECFF00FB50698D69E37F0E83B617B894037B67211C4533321962 + 93AC7756E5874C1F8DFAE56CBF36AB85836E96224DC537B558ABCE9A77F77DAC + 2D529EAAD2BED7B1D1CAA74D49EEBF2E8FE4F467CBBA8EAF63FB2F682B77A6DA + DD7C56FD94FE2F5C193FB32FE6115E6997B12FCF034AA08B1D6ED15B0B328D97 + 111562B244EC8BC43CD1FC27D7BC51E17F00FC44BCF147C25F185B5B5CDC40F6 + A6DFFB446449141796AE0AC77B6EE363BC44E39D9214722B9CF127C478FE07EA + DF11BC07E03F1647E30F865E3030C3E65E581C6A11AB2CD6B398641986FA1C98 + CC89C8265552C8DCFDBBFF000483FF00824DF89BF692F1BE97AE78834D9AD74C + 85D64B5B378C8118EA24907F7BD14F4EA79AFB2C0607FE5E54D53B3D57C5B38C + A516B49C766D6F64DF451E79CFA2FEBFE01F507FC10AFF00E09CFA87C4AF1A5A + F8C35FB178E3CABC71BA71120E40FAF73F80ED5FBEFE1DD0E1F0DE8D6F656E8B + 1C56E814003D2B83FD997F677D23F679F87B67A4E9D6F1C6D14603B05E49AF4A + AF68C428A28A0028A28A00A3E22F0E59F8AB4B92CEF6159A1941521866BF197F + E0B25FF06D0687F1EF53D4BC7DF0B7ECFE17F185C6E9AE2348BFD07546EBFBE8 + D7EEB9FF009E8BCFA86AFDA8A6CB0ACF195750CADC1045007F14FF001E66F8FF + 00FB217C2CD43E05F8F26F13787FC0B71AB0D5C68F31DFA55CDE20204F148061 + B3C12A1864AA92B9031B9E04FDA53C17F14FF6BFF85FABF8A2287C33F0DFE18E + 9B6505968F3C86E49834D81EE84059546F96F6F83966C01BAE8E70066BFACAFD + A7BFE09F9F0F3F6A4F0CDDE9BE22D074DBE8AED4ABA4F6EB246DF504115F913F + B667FC1A3BE1BD56EEEB52F87B79A8F86E4725D6081BED16D9FF00AE6FC81ECA + C0579F5B2CC3CD4B963CAE5CDAAD1DE4ACE5DB9ACB77ADB4348D4923F297C07E + 3EBDBFFD993F68AF889AD5DACBE24F885A8697E1BDE641E64D25F5F49AA5F301 + D76EDB14524703CC03BD7BD7EC565B45FDB53FE09DFA1ED64F2847AD3A11D1AF + B5BBF70DFF00028A288D727F19BFE0DD9FDA07E125EC8BA68D3B5C86324020C9 + 6CF8FA1057FF001EAF2D6FD81FF6A7F86BE31D1F58B2D17C516BAD7867CB1A4E + A167AAAADC6982324C7E449BC34614962A148C64E319AF2F32C83EB346AD2849 + 2E7E6B69B5E97B24BD15EE694EB59A6FCBF3B9EF5FB6DBBEB7FB6C7FC1447425 + 56669924D69100EAF63ADE9EE5BFE0314B31CD7CF3F10BC797969FB2E7ECEBF1 + 0F45BC11789BE1DEA5AA786848241E6C0F657B16AB62E57AEDC5F48A09E0F964 + 76A75DFEC33FB4F7C40F186B3ACEA5A3F89EE35CF12F98BAB6A179AA06B9D4C4 + 841904F26F2D28620160C4E70339C576DF0C7FE0843F1CBE23DDC6B796B6BA64 + 6E707024B8603E8005FD6AB2DC87EAD429529C93E4E5BE9BDA92A6D7A3B5C53A + D76DAEBFE7738BF1FF00ED2FE0DF85BFB64FC4CF10785EDA3F137C35F8A1A6DE + 43A8E8D0C86DBF71AA5BADCBDA86653B64B2BE64646DA46FB452320E6B86F85B + E36F8D7F1EBE0CDBFC15F0BEA7E22D4BE1FA6AC7596D1237DBA7477AC0299E46 + C7078C8524807240C926BF53BF64CFF8355EE353BDB5BAF1635F6A9C8664B83E + 5423FE00BD7E849AFD65FD90FF00E08CBF0F7F673D36D14E9766CD6E06C89225 + 545C7A01C57A7472DC3C1479A3CCE3CBABD5DE2ACA5DB9ACF75A99BA8D9F923F + F049AFF8375750D675DD3BC49E33B7FB65D232C8A648C882DBFDC53D4FFB479F + 402BF7E3F671FD98BC3FFB3B7842DF4FD26CE18DE34019C28C935DE7877C2D63 + E14B04B6B0B68ADE18C60045C568577901451450014514500145145001451450 + 01411B873CD14500739E2CD1ECEE6DDBCCB5B693239DD129FE95E4DE2AF07E93 + 24877697A6B7D6D93FC28A2803334CF05E8EB7031A4E99D47FCBAA7F857A5F82 + 7C39A7DB94F2EC2CA3E9F76051FD28A2803BFB681214C222A8F403152D145001 + 451450014514500145145007FFD9} + end + object LabelErreur: TLabel + Left = 288 + Top = 192 + Width = 3 + Height = 13 + Caption = '.' + end + object GroupBox1: TGroupBox + Left = 16 + Top = 8 + Width = 265 + Height = 97 + Caption = 'Horloge' + TabOrder = 0 + object RadioButtonHS: TRadioButton + Left = 32 + Top = 24 + Width = 113 + Height = 17 + Hint = 'Horloge window, non comprimable' + Caption = 'Horloge syst'#232'me' + ParentShowHint = False + ShowHint = True + TabOrder = 0 + OnClick = RadioButtonHSClick + end + object RadioButtonHI: TRadioButton + Left = 32 + Top = 40 + Width = 113 + Height = 17 + Hint = 'Horloge de Signaux_Complexes, comprimable' + Caption = 'Horloge interne' + ParentShowHint = False + ShowHint = True + TabOrder = 1 + OnClick = RadioButtonHIClick + end + object CheckBoxLanceHorl: TCheckBox + Left = 32 + Top = 56 + Width = 217 + Height = 17 + Caption = 'Lancer l'#39'horloge au d'#233'marrage de SC' + TabOrder = 2 + OnClick = CheckBoxLanceHorlClick + end + object CheckBoxAffiche: TCheckBox + Left = 32 + Top = 72 + Width = 193 + Height = 17 + Caption = 'Afficher l'#39'horloge au d'#233'marage de SC' + TabOrder = 3 + OnClick = CheckBoxAfficheClick + end + end + object GroupBox2: TGroupBox + Left = 16 + Top = 240 + Width = 265 + Height = 81 + Caption = 'Temps comprim'#233 + TabOrder = 1 + object Label1: TLabel + Left = 8 + Top = 56 + Width = 162 + Height = 13 + Caption = 'Une minute horloge dure en r'#233'alit'#233 + end + object Label2: TLabel + Left = 192 + Top = 56 + Width = 5 + Height = 13 + Caption = 's' + end + object LabelDuree: TLabel + Left = 176 + Top = 56 + Width = 10 + Height = 13 + Caption = 'xx' + end + object TrackBarTemps: TTrackBar + Left = 16 + Top = 16 + Width = 233 + Height = 33 + Min = 1 + Position = 1 + TabOrder = 0 + OnChange = TrackBarTempsChange + end + end + object ButtonOk: TButton + Left = 16 + Top = 336 + Width = 75 + Height = 25 + Caption = 'Ok' + TabOrder = 2 + OnClick = ButtonOkClick + end + object GroupBox3: TGroupBox + Left = 16 + Top = 112 + Width = 265 + Height = 121 + Caption = 'Initialisation de l'#39'horloge interne' + TabOrder = 3 + object Label3: TLabel + Left = 70 + Top = 28 + Width = 49 + Height = 13 + Caption = 'Initialiser '#224 + end + object Label4: TLabel + Left = 152 + Top = 26 + Width = 6 + Height = 13 + Caption = 'h' + end + object Label5: TLabel + Left = 8 + Top = 58 + Width = 110 + Height = 13 + Caption = 'Retour '#224' l'#39'initialisation '#224 + end + object Label6: TLabel + Left = 152 + Top = 58 + Width = 6 + Height = 13 + Caption = 'h' + end + object EditHInit: TEdit + Left = 128 + Top = 24 + Width = 25 + Height = 21 + Hint = 'Heure de d'#233'marrage de l'#39'horloge interne' + ParentShowHint = False + ShowHint = True + TabOrder = 0 + Text = '00' + OnChange = EditHInithange + end + object EditMInit: TEdit + Left = 160 + Top = 24 + Width = 25 + Height = 21 + Hint = 'Heure de d'#233'marrage de l'#39'horloge interne' + ParentShowHint = False + ShowHint = True + TabOrder = 1 + Text = '00' + OnChange = EditMInitChange + end + object ButtonInit: TButton + Left = 192 + Top = 22 + Width = 59 + Height = 25 + Caption = 'Initialiser' + TabOrder = 2 + OnClick = ButtonInitClick + end + object EditRetourHeure: TEdit + Left = 128 + Top = 56 + Width = 25 + Height = 21 + Hint = 'Heure '#224' laquelle l'#39'horloge reprend sa valeur initiale' + ParentShowHint = False + ShowHint = True + TabOrder = 3 + Text = '00' + OnChange = EditRetourHeureChange + end + object EditRetourMinute: TEdit + Left = 160 + Top = 56 + Width = 25 + Height = 21 + Hint = 'Heure '#224' laquelle l'#39'horloge reprend sa valeur initiale' + ParentShowHint = False + ShowHint = True + TabOrder = 4 + Text = '00' + OnChange = EditRetourMinuteChange + end + object CheckBoxRedemarre: TCheckBox + Left = 8 + Top = 88 + Width = 241 + Height = 17 + Caption = 'Red'#233'marrer l'#39'horloge au retour '#224' l'#39'initialisation' + TabOrder = 5 + OnClick = CheckBoxRedemarreClick + end + end + object ButtonS: TButton + Left = 206 + Top = 336 + Width = 75 + Height = 25 + Hint = 'Sauvegarde toute la configuration' + Caption = 'Sauvegarder' + ParentShowHint = False + ShowHint = True + TabOrder = 4 + OnClick = ButtonSClick + end + object ButtonAh: TButton + Left = 312 + Top = 200 + Width = 75 + Height = 33 + Caption = 'Afficher l'#39'horloge' + TabOrder = 5 + WordWrap = True + OnClick = ButtonAhClick + end +end diff --git a/UnitHorloge.pas b/UnitHorloge.pas new file mode 100644 index 0000000..f1fb81e --- /dev/null +++ b/UnitHorloge.pas @@ -0,0 +1,298 @@ +unit UnitHorloge; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, StdCtrls,unitPrinc, ComCtrls, jpeg, ExtCtrls ; + +type + TFormHorloge = class(TForm) + GroupBox1: TGroupBox; + RadioButtonHS: TRadioButton; + RadioButtonHI: TRadioButton; + GroupBox2: TGroupBox; + Label1: TLabel; + Label2: TLabel; + ButtonOk: TButton; + GroupBox3: TGroupBox; + Label3: TLabel; + EditHInit: TEdit; + EditMInit: TEdit; + Label4: TLabel; + TrackBarTemps: TTrackBar; + LabelDuree: TLabel; + ImageHorloge: TImage; + ButtonInit: TButton; + LabelErreur: TLabel; + Label5: TLabel; + EditRetourHeure: TEdit; + EditRetourMinute: TEdit; + Label6: TLabel; + ButtonS: TButton; + CheckBoxLanceHorl: TCheckBox; + CheckBoxRedemarre: TCheckBox; + ButtonAh: TButton; + CheckBoxAffiche: TCheckBox; + procedure ButtonOkClick(Sender: TObject); + procedure FormActivate(Sender: TObject); + procedure TrackBarTempsChange(Sender: TObject); + procedure ButtonInitClick(Sender: TObject); + procedure EditHInithange(Sender: TObject); + procedure EditMInitChange(Sender: TObject); + procedure RadioButtonHSClick(Sender: TObject); + procedure RadioButtonHIClick(Sender: TObject); + procedure EditRetourHeureChange(Sender: TObject); + procedure EditRetourMinuteChange(Sender: TObject); + procedure ButtonSClick(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure CheckBoxLanceHorlClick(Sender: TObject); + procedure CheckBoxRedemarreClick(Sender: TObject); + procedure ButtonAhClick(Sender: TObject); + procedure CheckBoxAfficheClick(Sender: TObject); + private + { Déclarations privées } + public + { Déclarations publiques } + end; + +var + FormHorloge: TFormHorloge; + heure,minute,seconde,comptsec,DureeMinute,CompteurDixiemes,HeureInit,MinuteInit, + RetourHeure,RetourMinute,Asec : integer; + horlogeInterne,horloge,relanceHorl_init,AffHorl : boolean; + +procedure Init_Horloge; +procedure Demarre_horloge; + +implementation + +uses unitconfig, UnitClock; + +{$R *.dfm} + +procedure valide_hi; +begin + with formHorloge do + begin + GroupBox3.Enabled:=true; + GroupBox2.Enabled:=true; + editHinit.Enabled:=true; + editMinit.Enabled:=true; + ButtonInit.Enabled:=true; + TrackBarTemps.Enabled:=true; + EditRetourHeure.Enabled:=true; + EditRetourMinute.Enabled:=true; + end; +end; + +procedure devalide_hi; +begin + with formHorloge do + begin + GroupBox3.Enabled:=false; + GroupBox2.Enabled:=false; + editHinit.Enabled:=false; + editMinit.Enabled:=false; + ButtonInit.Enabled:=false; + TrackBarTemps.Enabled:=false; + EditRetourHeure.Enabled:=false; + EditRetourMinute.Enabled:=false; + end; +end; + +procedure TFormHorloge.ButtonOkClick(Sender: TObject); +begin + close; +end; + +// démarre l'horloge de façon synchrone à l'horloge windows +procedure Demarre_horloge; +var h,m,sec,ms : word; +begin + decodeTime(GetTime,h,m,sec,ms); + //Affiche(intToSTR(ms),clwhite); + comptSec:=ms div 100; + horloge:=true; +end; + +procedure TFormHorloge.FormActivate(Sender: TObject); +begin + if formHorloge=nil then exit; + + if horlogeinterne then + begin + valide_hi; + end + else + begin + devalide_hi; + end; +end; + + +procedure TFormHorloge.TrackBarTempsChange(Sender: TObject); +begin + //DureeMinute:=TrackBarTemps.position; + //if (DureeMinute<1) or (DureeMinute>60) then DureeMinute:=30; + //LabelDuree.caption:=intToSTR(6*(DureeMinute*5) div 30); + + CompteurDixiemes:=TrackBarTemps.position; + + DureeMinute:=CompteurDixiemes; // variable de sauvegarde + LabelDuree.caption:=intToSTR(6*CompteurDixiemes); +end; + +procedure Init_Horloge; +begin + heure:=HeureInit; + minute:=MinuteInit; + seconde:=0; + if clock<>nil then clock.DrawArrows; + FormPrinc.labelClock.Caption:=format('%.2dh%.2d:%.2d',[heure,minute,seconde] ); +end; + +procedure TFormHorloge.ButtonInitClick(Sender: TObject); +begin + init_horloge; +end; + +procedure TFormHorloge.EditHInithange(Sender: TObject); +var i,erreur : integer; +begin + val(editHInit.Text,i,erreur); + if (erreur<>0) or (i<0) or (i>23) then + begin + LabelErreur.Caption:='Erreur heure'; + exit; + end; + LabelErreur.Caption:=''; + HeureInit:=i; + config_modifie:=true; +end; + +procedure TFormHorloge.EditMInitChange(Sender: TObject); +var i,erreur : integer; +begin + val(editMInit.Text,i,erreur); + if (erreur<>0) or (i<0) or (i>60) then + begin + LabelErreur.Caption:='Erreur minute'; + exit; + end; + LabelErreur.Caption:=''; + MinuteInit:=i; + config_modifie:=true; +end; + +procedure TFormHorloge.RadioButtonHSClick(Sender: TObject); +begin + horlogeInterne:=false; + devalide_hi; + config_modifie:=true; +end; + +procedure TFormHorloge.RadioButtonHIClick(Sender: TObject); +begin + horlogeInterne:=true; + valide_hi; + config_modifie:=true; +end; + +procedure TFormHorloge.EditRetourHeureChange(Sender: TObject); +var i,erreur : integer; +begin + val(editRetourHeure.Text,i,erreur); + if (erreur<>0) or (i<0) or (i>23) then + begin + LabelErreur.Caption:='Erreur heure init'; + exit; + end; + LabelErreur.Caption:=''; + RetourHeure:=i; + config_modifie:=true; +end; + +procedure TFormHorloge.EditRetourMinuteChange(Sender: TObject); +var i,erreur : integer; +begin + val(editRetourMinute.Text,i,erreur); + if (erreur<>0) or (i<0) or (i>60) then + begin + LabelErreur.Caption:='Erreur retour minute'; + exit; + end; + LabelErreur.Caption:=''; + RetourMinute:=i; + config_modifie:=true; +end; + +procedure TFormHorloge.ButtonSClick(Sender: TObject); +begin + sauve_config; +end; + +procedure couleurs_horloge; +var c : tcomponent; + i : integer; + fond,texte : tColor; +begin + if sombre then + begin + fond:=couleurFond; + texte:=couleurTexte; + + formHorloge.Color:=fond; + for i:=0 to formHorloge.ComponentCount-1 do + begin + c:=formHorloge.Components[i]; + //Affiche(c.Name,clyellow); + composant(c,fond,texte); + end; + end; +end; + +procedure TFormHorloge.FormCreate(Sender: TObject); +begin + CompteurDixiemes:=DureeMinute; + couleurs_horloge; + TrackBarTemps.position:=DureeMinute; + + RadioButtonHI.Checked:=horlogeInterne; + RadioButtonHS.Checked:=not(horlogeInterne); + CheckBoxLanceHorl.Checked:=LanceHorl; + CheckBoxAffiche.checked:=AffHorl; + CheckBoxRedemarre.Checked:=relanceHorl_init; + TrackBarTemps.position:=DureeMinute; + EditHInit.Text:=intToSTR(HeureInit); + EditMInit.Text:=intToSTR(MinuteInit); + EditRetourHeure.Text:=intToSTR(RetourHeure); + EditRetourMinute.Text:=intToSTR(RetourMinute); + LabelDuree.caption:=intToSTR(6*CompteurDixiemes); + config_modifie:=false; + +end; + +procedure TFormHorloge.CheckBoxLanceHorlClick(Sender: TObject); +begin + LanceHorl:=CheckBoxLanceHorl.Checked; + config_modifie:=true; +end; + +procedure TFormHorloge.CheckBoxRedemarreClick(Sender: TObject); +begin + relanceHorl_init:=CheckBoxRedemarre.checked; + config_modifie:=true; +end; + +procedure TFormHorloge.ButtonAhClick(Sender: TObject); +begin + formClock.Show; +end; + +procedure TFormHorloge.CheckBoxAfficheClick(Sender: TObject); +begin + AffHorl:=CheckBoxAffiche.checked; +end; + +end. diff --git a/UnitPilote.pas b/UnitPilote.pas index 421fec4..692e59c 100644 --- a/UnitPilote.pas +++ b/UnitPilote.pas @@ -81,6 +81,7 @@ vert_cli =4 ; vert_cli_F=16; violet =5 ; violet_F=32; blanc =6 ; blanc_F=64; blanc_cli =7 ; blanc_cli_F=128; + jaune =8 ; jaune_F=256; jaune_cli =9 ; jaune_cli_F=512; ral_30 =10; ral_30_F=1024; diff --git a/UnitPrinc.dfm b/UnitPrinc.dfm index 54c0760..862ad16 100644 --- a/UnitPrinc.dfm +++ b/UnitPrinc.dfm @@ -1,8 +1,8 @@ object FormPrinc: TFormPrinc - Left = 134 - Top = 180 + Left = 128 + Top = 170 Width = 1148 - Height = 618 + Height = 624 Anchors = [akLeft, akTop, akRight] Caption = 'SIgnaux complexes' Color = clBtnFace @@ -20,8 +20,8 @@ object FormPrinc: TFormPrinc OnCreate = FormCreate OnResize = FormResize DesignSize = ( - 1140 - 567) + 1132 + 565) PixelsPerInch = 96 TextHeight = 13 object LabelTitre: TLabel @@ -38,8 +38,8 @@ object FormPrinc: TFormPrinc ParentFont = False end object Image9feux: TImage - Left = 1064 - Top = 8 + Left = 1072 + Top = 32 Width = 57 Height = 105 Picture.Data = { @@ -669,8 +669,8 @@ object FormPrinc: TFormPrinc Visible = False end object Image2feux: TImage - Left = 1064 - Top = 112 + Left = 1072 + Top = 144 Width = 33 Height = 57 Picture.Data = { @@ -1082,8 +1082,8 @@ object FormPrinc: TFormPrinc Visible = False end object Image6Dir: TImage - Left = 960 - Top = 8 + Left = 928 + Top = 16 Width = 81 Height = 25 Picture.Data = { @@ -1428,10 +1428,25 @@ object FormPrinc: TFormPrinc FCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFC000000} Visible = False end + object LabelClock: TLabel + Left = 936 + Top = 0 + Width = 85 + Height = 22 + Alignment = taCenter + Anchors = [akTop, akRight] + Caption = '00h00:00' + Font.Charset = ANSI_CHARSET + Font.Color = clWindowText + Font.Height = -19 + Font.Name = 'Arial' + Font.Style = [fsBold] + ParentFont = False + end object StatusBar1: TStatusBar Left = 0 - Top = 545 - Width = 1140 + Top = 543 + Width = 1132 Height = 22 Panels = < item @@ -1458,7 +1473,7 @@ object FormPrinc: TFormPrinc OnDrawPanel = StatusBar1DrawPanel end object Button1: TButton - Left = 751 + Left = 919 Top = 16 Width = 75 Height = 25 @@ -1470,13 +1485,13 @@ object FormPrinc: TFormPrinc end object GrandPanel: TPanel Left = 8 - Top = 56 + Top = 48 Width = 1057 - Height = 476 + Height = 484 TabOrder = 2 DesignSize = ( 1057 - 476) + 484) object SplitterV: TSplitter Left = 1 Top = 1 @@ -1824,14 +1839,14 @@ object FormPrinc: TFormPrinc end end object Panel1: TPanel - Left = 761 + Left = 768 Top = -3 - Width = 288 + Width = 281 Height = 180 Anchors = [akTop, akRight] TabOrder = 4 DesignSize = ( - 288 + 281 180) object Label1: TLabel Left = 152 @@ -1950,7 +1965,7 @@ object FormPrinc: TFormPrinc OnClick = ButtonCDMClick end object EditEnvoi: TEdit - Left = -1 + Left = -8 Top = 127 Width = 121 Height = 21 @@ -1959,7 +1974,7 @@ object FormPrinc: TFormPrinc Text = '<1>' end object ButtonEnv: TButton - Left = 8 + Left = 1 Top = 88 Width = 88 Height = 33 @@ -1971,8 +1986,8 @@ object FormPrinc: TFormPrinc end end object GroupBoxCV: TGroupBox - Left = 665 - Top = -24 + Left = 513 + Top = 120 Width = 265 Height = 129 Anchors = [akTop, akRight] @@ -2060,7 +2075,9 @@ object FormPrinc: TFormPrinc end object Sauvegarderla1: TMenuItem Caption = 'Sauvegarder la configuration de la fen'#234'tre' - Hint = 'Sauvegarde la position de la fen'#234'tre et du splitter' + Hint = + 'Sauvegarde la position de la fen'#234'tre principale, de l'#39'horloge et' + + ' du splitter' OnClick = Sauvegarderla1Click end object N14: TMenuItem @@ -2182,6 +2199,32 @@ object FormPrinc: TFormPrinc OnClick = DeconnecterCDMRailClick end end + object Horaires1: TMenuItem + Caption = 'Horaires' + object Ficheshoraires1: TMenuItem + Caption = 'Fiche horaire' + OnClick = Ficheshoraires1Click + end + object Afficherlhorloge1: TMenuItem + Caption = 'Afficher l'#39'horloge' + OnClick = Afficherlhorloge1Click + end + object N16: TMenuItem + Caption = '-' + end + object Horloge1: TMenuItem + Caption = 'Param'#233'trer l'#39'horloge' + OnClick = Horloge1Click + end + object Validationdeshoraires1: TMenuItem + Caption = 'Lancer / arr'#234'ter l'#39'horloge' + OnClick = Validationdeshoraires1Click + end + object Ini1: TMenuItem + Caption = 'Initialisation de l'#39'horloge' + OnClick = Ini1Click + end + end object Divers1: TMenuItem Caption = 'Divers' object Config: TMenuItem diff --git a/UnitPrinc.pas b/UnitPrinc.pas index 9c3c8ca..d8bc35b 100644 --- a/UnitPrinc.pas +++ b/UnitPrinc.pas @@ -1,5 +1,5 @@ Unit UnitPrinc; -// 04/3 20h +// 12/03/24 (******************************************** Programme signaux complexes Graphique Lenz Delphi 7 + activeX Tmscomm + clientSocket @@ -37,6 +37,8 @@ Unit UnitPrinc; // En mode RUN: // CDM renvoie le nom des trains sur les actionneurs à 1, jamais à 0 // et quelquefois (pas toujours!) sur les détecteurs à 1, jamais à 0 +// Au début du RUN, CDM renvoie les états des détecteurs et en mélangé les aiguillages et on en reçoit les états. +// Puis on reçoit la position des trains qui bougent. Si un train parqué ne bouge pas, on ne reçoit rien de ce train. // // En simulation: // CDM Rail ne renvoie pas les états des aiguillages en début de simu @@ -65,7 +67,7 @@ uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, OleCtrls, ExtCtrls, jpeg, ComCtrls, ShellAPI, TlHelp32, ImgList, ScktComp, StrUtils, Menus, ActnList, MSCommLib_TLB, MMSystem , - Buttons, NB30, comObj, activeX + Buttons, NB30, comObj, activeX ,DateUtils {$IF CompilerVersion >= 28.0} // si delphi>=11 ,Vcl.Themes {$IFEND} @@ -230,6 +232,14 @@ type Copierltatdesaiguillageseninitialisation1: TMenuItem; ServerSocket: TServerSocket; Listedesclientsconnects1: TMenuItem; + Horaires1: TMenuItem; + Horloge1: TMenuItem; + Ficheshoraires1: TMenuItem; + Validationdeshoraires1: TMenuItem; + LabelClock: TLabel; + Ini1: TMenuItem; + N16: TMenuItem; + Afficherlhorloge1: TMenuItem; procedure FormCreate(Sender: TObject); procedure RecuInterface(Sender: TObject); procedure RecuPeriph1(Sender: TObject); @@ -370,9 +380,15 @@ type procedure ServerSocketClientDisconnect(Sender: TObject; Socket: TCustomWinSocket); procedure Listedesclientsconnects1Click(Sender: TObject); - private + procedure Horloge1Click(Sender: TObject); + procedure Ficheshoraires1Click(Sender: TObject); + procedure Validationdeshoraires1Click(Sender: TObject); + procedure Ini1Click(Sender: TObject); + procedure Afficherlhorloge1Click(Sender: TObject); + private { Déclarations privées } procedure DoHint(Sender : Tobject); + procedure WindowPosChanging(var Msg: TWMWindowPosMsg); message WM_WINDOWPOSCHANGING; public { Déclarations publiques des composants dynamiques} Procedure ImageOnClick(Sender : TObject); @@ -490,8 +506,8 @@ Taiguillage = record DDevieB : char ; tjsint : integer; // pour TJS tjsintb : char ; - // éléments connectés sur la branche déviée 2 (cas d'un aiguillage triple) - Adevie2 : integer; + // éléments connectés sur la branche déviée 2 (cas d'un aiguillage triple) + Adevie2 : integer; // aiguilage triple Adevie2B : char ; // états d'une TJD (2 ou 4, 4 par défaut) EtatTJD : integer; @@ -576,7 +592,7 @@ var etape,idEl,avecRoulage,intervalle_courant,filtrageDet0,SauvefiltrageDet0, TpsTimeoutSL,formatY,OsBits,NbreDecPers,NbDecodeur,NbDecodeurdeBase, LargeurF,HauteurF,OffsetXF,OffsetYF,PosSplitter,NbPeriph,NbPeriph_COMUSB,NbPeriph_Socket, - AigMal : integer; + AigMal,AncMinute,axFP,ayFP : integer; ack,portCommOuvert,traceTrames,AffMem,CDM_connecte,dupliqueEvt,affiche_retour_dcc, Raz_Acc_signaux,AvecInit,AvecTCO,terminal,Srvc_Aig,Srvc_Det,Srvc_Act,MasqueBandeauTCO, @@ -587,7 +603,7 @@ var AvecDemandeInterfaceUSB,AvecDemandeInterfaceEth,aff_acc,affiche_aigdcc,modeStkRetro, retEtatDet,roulage,init_aig_cours,affevt,placeAffiche,clicComboTrain,clicAdrTrain, fichier_module_cdm,Diffusion,cdmDevant,avecRESA,serveurIPCDM_Touche, - sombre,serveur_ouvert,pasChgTBV : boolean; + sombre,serveur_ouvert,pasChgTBV,FpBouge,debugPN : boolean; tick,Premier_tick : longint; @@ -660,13 +676,13 @@ var Tablo_actionneur : array[0..Max_actionneurs] of record - loco,act,son,periph : boolean; // destinataire loco acessoire son ou périphérique - adresse,adresse2, // adresse: adresse de base ; adresse2=cas d'une Zone + loco,act,son,periph,vit : boolean; // destinataire loco acessoire son ou périphérique ou vitesse train + adresse,adresse2, // adresse: adresse de base ou heure ; adresse2=cas d'une Zone ou minute etat, - fonction, // fonction F de train ou périphérique + fonction, // fonction F de train ou périphérique ou vitesse train tempo,TempoCourante, accessoire,sortie, - typdeclenche : integer; // déclencheur: 0=actionneur/détecteur 2=evt aig 3=MemZone + typdeclenche : integer; // déclencheur: 0=actionneur/détecteur 1=Horloge 2=evt aig 3=MemZone Raz : boolean; FichierSon,trainDecl, TrainDest, // train destinataire ou Commande au périphérique @@ -701,9 +717,10 @@ var commandeOuvre : integer; // commande d'ouverture (1 ou 2) NbVoies : integer; // Nombre de voies du PN Pulse : integer; // 0=commande maintenue 1=Impulsionnel - TypeCde : integer; // 0=par accessoire / 1=par COMUSB/sockets - commandeF,CommandeO : string; + TypeCde : integer; // 0=par accessoire / 1=par COMUSB ou sockets + commandeF,CommandeO : string; // commande pour com/usb ou socket compteur : integer; // comptage actionneurs fermeture et décomptage actionneurs ouverture + actionneur : boolean; // =vrai par actionneur sinon pae zone Voie : array [1..5] of record ActFerme,ActOuvre : integer ; // actionneurs provoquant la fermeture et l'ouverture detZ1F,detZ2F,detZ1O,detZ2O : integer; // Zones de détection @@ -714,7 +731,7 @@ var record tick : longint; modele : Tequipement; - Adresse,Adresse2,etat : integer ; + Adresse,etat : integer ; train : string; end; @@ -731,21 +748,24 @@ var Signaux : array[0..NbreMaxiSignaux] of TSignal; CdeDccpp : array[1..MaxCdeDccpp] of string; + trains_cdm : array[1..Max_Trains] of record nom_train : string; adresse,vitmax : integer; end; // trains en roulage sur le réseau et de la base de données [section_trains] - trains : array[1..Max_Trains] of record + trains : array[0..Max_Trains] of record nom_train : string; adresse,vitmax,VitNominale,VitRalenti : integer; vitesse : integer; // vitesse actuelle de pilotage - sens : boolean; + sens : boolean; // sens de déplacement compteur_consigne : integer; // compteur de consigne pour envoyer deux fois la vitesse en 10eme de s TempoArret : integer; // tempo d'arret pour le timer - TempoDemarre : integer; + TempoDemarre : integer; // tempo de démarrage index_event_det_train : integer; // index du train en cours de roulage du tableau event_det_train + roulage : boolean; // train en roulage + //----------------------------------- SbitMap : TBitmap ; // pointeur sur tampon sous l'icone de déplacement du train en page CDM ax,ay,x,y : integer; // coordonnées du train (anciennes et nouvelles) en points windows x0,y0,x1,y1 : integer; // ancien contour du tampon, pour l'animation dans la fenêtre cdm @@ -827,7 +847,7 @@ function PresTrainPrec(Adresse,NbCtSig : integer;detect : boolean;var AdrTr,voie function cond_carre(adresse : integer) : boolean; function carre_signal(adresse,TrainReserve : integer;var reserveTrainTiers : boolean;Var AdrTrain : integer) : integer; procedure Event_Detecteur(Adresse : integer;etat : boolean;train : string); -procedure Event_act(adr,adr2,etat : integer;trainDecl : string); +procedure Event_act(adr,adr2,etat : integer;trainDecl : string;hor : boolean); function verif_UniSemaf(adresse,UniSem : integer) : integer; function Select_dessin_Signal(TypeSignal : integer) : TBitmap; procedure cree_image(rang : integer); @@ -842,7 +862,7 @@ procedure init_dccpp; procedure init_aiguillages; function index_adresse_detecteur(de : integer) : integer; function index_train_adresse(adr : integer) : integer; -procedure vitesse_loco(nom_train :string;index : integer;adr_loco : integer;vitesse : integer;sens : boolean;repetition : boolean); +procedure vitesse_loco(nom_train :string;index : integer;adr_loco : integer;vitesse : integer;repetition : boolean); procedure Maj_Signaux(detect : boolean); procedure Det_Adj(adresse : integer); procedure reserve_canton(detecteur1,detecteur2,adrtrain,NumTrain,NCantons : integer); @@ -877,13 +897,15 @@ procedure change_style; function isDirectionnel(index : integer) : boolean; procedure stop_trains; function Aiguille_deviee(adresse : integer) : integer ; +function envoi_CDM(s : string) : boolean; +function place_id(s : string) : string; +procedure fin_preliminaire; implementation uses UnitDebug, UnitPilote, UnitSimule, UnitTCO, UnitConfig, Unitplace, verif_version , UnitCDF, UnitAnalyseSegCDM, UnitConfigCellTCO, - UnitConfigTCO, - UnitSR; + UnitConfigTCO,UnitSR, UnitHorloge, UnitFicheHoraire, UnitClock; { procedure menu_interface(MA : TMA); @@ -904,7 +926,7 @@ end; // Cette procédure doit être appellée depuis le module principal UnitPrinc sinon exception violation procedure change_style; var i : integer; -begin +begin {$IF CompilerVersion >= 28.0} if Ancien_Style<>Style_Aff then begin @@ -931,6 +953,104 @@ begin {$IFEND} end; +procedure positionne_principal; +begin +// positionnement de la fenêtre principale + with formprinc do + begin + position:=poDefault; + + if AffMemoFenetre=1 then + begin + if largeurF>0 then formPrinc.width:=LargeurF; + if HauteurF>0 then formPrinc.Height:=hauteurF; + formPrinc.left:=offsetXF; + formPrinc.top:=offsetYF; + + if (PosSplitter>0) and (PosSPlitter0) and (PosSPlitter= 28.0} + // en D11, obligé de positionner la fenêtre principale après avoir fixé le style + positionne_principal; + {$IFEND} + + calcul_pos_horloge; + if (versionSC<>'8.53') then + begin + if AffHorl then Affiche_horloge; + if LanceHorl then Demarre_horloge; + end; + formprinc.SetFocus; +end; + // envoi une chaine à un périphérique COM/USB en fonction de l'interface // non utilisé procedure envoi_usb(interf : Tinterface;s : string); @@ -2723,6 +2843,14 @@ begin envoi:=ack; end; +// insère l'id pour le serveur CDM dans une chaîne +function place_id(s : string) : string; +begin + delete(s,5,2); + insert(id_cdm,s,5); + place_id:=s; +end; + // chaîne pour une fonction F à un train via CDM Function chaine_CDM_Func(fonction,etat : integer;train : string) : string; var so,sx,s : string; @@ -3049,9 +3177,12 @@ begin end; // envoie une vitesse à une loco par XpressNet/Dcc++ ou par CDM +// index=index du train dans le tableau trains[] +// vitesse positive ou négative // répétition=avec répétition de la commande dans 1s -procedure vitesse_loco(nom_train :string;index : integer;adr_loco : integer;vitesse : integer;sens,repetition : boolean); +procedure vitesse_loco(nom_train :string;index : integer;adr_loco : integer;vitesse : integer;repetition : boolean); var s : string; + sens : boolean; v,erreur : integer; begin if not(hors_tension) and ((portCommOuvert or parSocketLenz)) then @@ -3069,6 +3200,7 @@ begin if protocole=1 then begin //AfficheDebug('X9 train '+inttostr(loco)+' '+inttostr(vitesse),clOrange); + sens:=vitesse>0; vitesse:=abs(vitesse); if vitesse>127 then vitesse:=127; v:=vitesse; @@ -3088,17 +3220,21 @@ begin if cdm_connecte then begin // il faut qu'on soit en RUN pour que les vitesses trains soient prises en compte - s:=chaine_CDM_vitesseST(vitesse,nom_train); // par nom du train - //s:=chaine_CDM_vitesseINT(vitesse,adr_loco); // par adresse du train + if PilotageTrainsCDMNom then + s:=chaine_CDM_vitesseST(vitesse,nom_train) // par nom du train + else + s:=chaine_CDM_vitesseINT(vitesse,adr_loco); // par adresse du train envoi_CDM(s); //affiche(s,clLime); end; // répétition de la consigne dans 1 s - if (index<>0) and repetition then + if repetition then begin + // trains[index].nom_train:=Nom_train; + // trains[index].adresse:=adr_loco; trains[index].vitesse:=vitesse; - trains[index].sens:=sens; + // trains[index].sens:=sens; trains[index].compteur_consigne:=10; end; @@ -3169,7 +3305,8 @@ begin end; if (aspect=jaune_cli) then // jaune clignotant begin - Signaux[i].EtatSignal:=RazBit(Signaux[i].EtatSignal,jaune); // cas du jaunecli: efface le bit du jaune (bit 8) + Signaux[i].EtatSignal:=RazBit(Signaux[i].EtatSignal,jaune); // efface le bit du jaune (bit 8) + Signaux[i].EtatSignal:=RazBit(Signaux[i].EtatSignal,ral_30); // efface ral 30 Signaux[i].EtatSignal:=Signaux[i].EtatSignal and $FF00; // et effacer les bits 0 à 7 end; if (aspect=ral_30) then // ralentissement 30 @@ -5156,6 +5293,7 @@ begin end else + // signal directionel begin pilote_direction(Adr,Signaux[i].etatSignal) end; @@ -6022,8 +6160,8 @@ begin end; // cas 2 TJD - if (aiguillage[index].position=const_devie) - and (aiguillage[index2].position=const_droit) and tjdC then + if (aiguillage[index].position=const_devie) and + (aiguillage[index2].position=const_droit) and tjdC then begin if (alg and 8)=8 then begin @@ -9831,7 +9969,7 @@ end; // it : numéro du train du réseau (pour la couleur) procedure pilote_train(det1,det2,AdrTrain,it : integer); var entree_signal,jauneC,rappel30C,rappel60C,rouge : boolean; - i,index_train,adresse,adresse2,Etat,voie,i2 : integer; + i,index_train,adresse,adresse2,Etat,voie,i2,vitesse : integer; couleur : TColor; s : string; begin @@ -9887,7 +10025,12 @@ begin if traceliste then affichedebug(s,Cllime); end; end; - if (index_train<>0) and (index_train0) and (index_train0) and (index_train0) and (index_train0) and (index_train0) and (index_train0) and (index_train0) and (index_train0) and (index_trainnil then @@ -10166,7 +10337,7 @@ begin end; pilote_train(det1,det3,adrtrainLoc,i); // pilote le train sur det3 - event_act(det1,det3,1,''); // activation zone + event_act(det1,det3,1,'',false); // activation zone - 2 maj_signaux(false); // actualiser le signal du det3 j:=signal_detecteur(det3); @@ -10291,8 +10462,8 @@ begin end; end; - event_act(det2,det3,0,''); // désactivation zone - event_act(det3,AdrSuiv,1,''); // activation zone + event_act(det2,det3,0,'',false); // désactivation zone + event_act(det3,AdrSuiv,1,'',false); // activation zone end else begin @@ -10303,7 +10474,7 @@ begin Affiche(s,clred); end; - // supprimer le 1er evt et décaler + // supprimer le 1er evt et décaler with event_det_train[i] do begin det[1].adresse:=event_det_train[i].det[2].adresse; @@ -10334,11 +10505,12 @@ begin Affiche_Evt('1.Tampon train '+intToStr(i)+' '+event_det_train[i].nom_train+'--------',couleur); Affiche_Evt(intToSTR(event_det_train[i].det[1].adresse),couleur); Affiche_Evt(intToStr(event_det_train[i].det[2].adresse),couleur); - if TraceListe or dupliqueEvt then + if TraceListe then begin AfficheDebug(intToSTR(event_det_train[i].det[1].adresse),couleur); AfficheDebug(intToSTR(event_det_train[i].det[2].adresse),couleur); end; + for tco:=1 to nbreTCO do begin if PcanvasTCO[tco]<>nil then @@ -10370,6 +10542,7 @@ begin s:='7. Rebond dét. '+intToSTR(det3)+' déjà affecté au train '+IntToSTR(i); FormDebug.MemoEvtDet.lines.add(s); if dupliqueEvt then AfficheDebug(s,clyellow); + if dupliqueEvt then Affiche(s,clyellow); end; end; end; @@ -10492,11 +10665,12 @@ begin if etat then begin + { inutile Maj_Signaux(false); // les autres signaux , avec détecteurs - // mettre à jour le feu du détecteur + // mettre à jour le signal du détecteur i2:=signal_detecteur(det3); // trouve le signal associé au detecteur2 if i2<>0 then Maj_Signal_P(i2,false); // avec détecteur - + } for i:=1 to N_trains do begin i2:=event_det_train[i].Suivant; @@ -10608,8 +10782,8 @@ begin Affiche_evt(s,CouleurTrain[id_couleur]); if dupliqueEvt then begin - AfficheDebug('0-0 Création train '+intToStr(N_trains)+' '+detecteur[det3].train+'--------',clyellow); - AfficheDebug(s,clyellow); + Affiche('0-0 Création train '+intToStr(N_trains)+' '+detecteur[det3].train+'--------',clyellow); + Affiche(s,clyellow); end; if TraceListe or ProcPrinc then begin @@ -10921,14 +11095,22 @@ end; // traitement des évènements actionneurs (detecteurs aussi) // adr adr2 : pour mémoire de zone // trainDecl : composé de X, d'un train ou de plusieurs, séparés par + -procedure Event_act(adr,adr2,etat : integer;trainDecl : string); +// hor : si évt horaire +procedure Event_act(adr,adr2,etat : integer;trainDecl : string;hor : boolean); var typ,i,v,etatAct,Af,Ao,Access,sortie,dZ1F,dZ2F,dZ1O,dZ2O : integer; sDecl,st,trainDest : string; fm,fd,adresseOk,etatvalide : boolean; Ts : TAccessoire; begin if adr<=0 then exit; - //Affiche(intToSTR(adr)+'/'+intToSTR(adr2)+' '+intToSTR(etat),clyellow); + if debugPN then + begin + if (adr=539) and (adr2=529) then + affiche('CAS OUVRE',clred); + if (adr=528) and (adr2=522) then + affiche('CAS FERME',clred); + end; + if debugPN then Affiche(intToSTR(adr)+'/'+intToSTR(adr2)+' '+intToSTR(etat)+' '+TrainDecl,clyellow); if adr>1024 then begin @@ -10946,13 +11128,16 @@ begin // 1 0 FD // 2 0 FD - fd:=(Ancien_actionneur[adr]>0) and (etat=0); // front descendant (FD) - fm:=(Ancien_actionneur[adr]<>etat) and (etat<>0); // front montant (FM) + if not(hor) and (adr2=0) then + begin + fd:=(Ancien_actionneur[adr]>0) and (etat=0); // front descendant (FD) + fm:=(Ancien_actionneur[adr]<>etat) and (etat<>0); // front montant (FM) - ancien_actionneur[adr]:=etat; - if not(fd) and not(fm) then exit; + ancien_actionneur[adr]:=etat; + if not(fd) and not(fm) then exit; + end; - if AffAigDet then AfficheDebug('Tick='+IntToSTR(tick)+' Evt Act='+intToSTR(Adr)+'/'+intToSTR(Adr2)+'='+intToSTR(etat)+' Train='+trainDecl,clyellow); + if AffAigDet and (adr2=0) then AfficheDebug('Tick='+IntToSTR(tick)+' Evt Act='+intToSTR(Adr)+'='+intToSTR(etat)+' Train='+trainDecl,clyellow); // vérifier si l'actionneur en évènement a été déclaré pour réagir // dans tableau des actionneurs for i:=1 to maxTablo_act do @@ -10965,6 +11150,11 @@ begin begin st:='Détecteur/actionneur '+intToSTR(adr); end; + if typ=1 then + begin + st:='Horaire '+format('%.2dh%.2d',[adr,adr2]); + etatvalide:=true; // valider systématiquement l'état valide en actionneur horaire + end; if typ=2 then begin st:='Aiguillage '+intToSTR(adr); @@ -10976,7 +11166,8 @@ begin end; adresseok:=( ((Tablo_actionneur[i].adresse=adr) and (adr2=0) ) and ((typ=0) or (typ=2)) ) or - ( ((Tablo_actionneur[i].adresse=adr) and (Tablo_actionneur[i].adresse2=adr2) ) and (typ=1) ); + ( ((Tablo_actionneur[i].adresse=adr) and (Tablo_actionneur[i].adresse2=adr2) and ((typ=3) or (typ=1))) ) ; + // actionneur pour fonction train if adresseOk and (Tablo_actionneur[i].loco) and ( test_train_decl(sDecl,trainDecl) or (sDecl='X') or (trainDecl='X') or (trainDecl='')) and (etatValide) then @@ -10991,6 +11182,19 @@ begin tablo_actionneur[i].TempoCourante:=tablo_actionneur[i].Tempo div 100; end; + // pour vitesse + if adresseOk and (Tablo_actionneur[i].vit) and ( test_train_decl(sDecl,trainDecl) or (sDecl='X') or (trainDecl='X') or (trainDecl='')) and (etatValide) then + begin + trainDest:=Tablo_actionneur[i].trainDest; + // exécution de la fonction F vers CDM + if (trainDest='X') or (trainDest='') then traindest:=traindecl; + //if (trainDest='X') then traindest:=sDecl; + Affiche(st+' TrainDecl='+trainDecl+' TrainDest='+trainDest+' V'+IntToSTR(Tablo_actionneur[i].fonction),clyellow); + + vitesse_loco(trainDest,0,0,Tablo_actionneur[i].fonction,true); + end; + + // actionneur pour accessoire if adresseOk and (Tablo_actionneur[i].act) and ( test_train_decl(sDecl,trainDecl) or (sDecl='X') or (trainDecl='X') or (trainDecl='')) and (etatValide) then begin @@ -11004,8 +11208,7 @@ begin end; // actionneur pour son - if adresseOk and (Tablo_actionneur[i].Son) and ( test_train_decl(sDecl,trainDecl) or (sDecl='X') or (trainDecl='X') or (trainDecl='')) and (etatValide) - then + if adresseOk and (Tablo_actionneur[i].Son) and ( test_train_decl(sDecl,trainDecl) or (sDecl='X') or (trainDecl='X') or (trainDecl='')) and (etatValide) then begin if typ<>2 then st:=st+' Train='+trainDecl; Affiche(st+' son '+Tablo_actionneur[i].FichierSon,clyellow); @@ -11038,9 +11241,10 @@ begin if (aO=adr) and (fd) then // actionneur d'ouverture sur front descendant begin + if DebugPN then Affiche('Compteur PN'+intToSTR(i)+'='+intToSTR(tablo_pn[i].compteur),clwhite); if tablo_pn[i].compteur=1 then // compteur du nombre de trains sur le PN begin - Affiche('Ouverture PN'+intToSTR(i)+' par act '+intToSTr(adr)+' (train voie '+IntToSTR(v)+')',clOrange); + Affiche('Ouverture PN'+intToSTR(i)+' par act '+intToSTr(adr)+' (voie '+IntToSTR(v)+')',clwhite); if tablo_pn[i].TypeCde=0 then begin if Tablo_PN[i].pulse=1 then ts:=aigP else ts:=signal; @@ -11054,17 +11258,22 @@ begin if typ=2 then ouvre_pn_socket(i); end; end; - if tablo_pn[i].compteur>0 then dec(tablo_pn[i].compteur); + if tablo_pn[i].compteur>0 then + begin + dec(tablo_pn[i].compteur); + if debugPN then Affiche('Compteur PN'+intToSTR(i)+'='+intToSTR(tablo_pn[i].compteur),clwhite); + end; end; if (aF=adr) and (fm) then // actionneur de fermeture sur front montant begin inc(tablo_pn[i].compteur); + if DebugPN then Affiche('Compteur PN'+intToSTR(i)+'='+intToSTR(tablo_pn[i].compteur),clwhite); if tablo_pn[i].compteur=1 then begin sDecl:='Fermeture PN'+IntToSTR(i)+' par act '+intToSTr(adr)+' (train voie '+IntToSTR(v)+')'; - Affiche(sDecl,clOrange); - if tablo_pn[i].TypeCde=0 then + Affiche(sDecl,clwhite); + if tablo_pn[i].TypeCde=0 then // par accessoire begin if Tablo_PN[i].pulse=1 then ts:=aigP else ts:=signal; pilote_acc(Tablo_PN[i].AdresseFerme,Tablo_PN[i].CommandeFerme,ts); @@ -11081,6 +11290,7 @@ begin end end else + if (adr2<>0) then begin // PN par zone de détection // Affiche(intToSTR(adr)+'/'+intToSTR(adr2)+' '+intToSTR(etat),clyellow); @@ -11091,14 +11301,14 @@ begin dZ2F:=Tablo_PN[i].voie[v].detZ2F; dZ1O:=Tablo_PN[i].voie[v].detZ1O; dZ2O:=Tablo_PN[i].voie[v].detZ2O; - if (dZ1O=adr) and (dZ2O=adr2) and (fd) then // zone d'ouverture + if debugPN then Affiche('test ouvre '+intToSTR(Adr)+' '+intToSTR(adr2)+' '+intToSTR(etat),clwhite); + if (dZ1O =adr) and (dZ2O=adr2) and (etat=0) then // zone d'ouverture begin if Tablo_PN[i].compteur=1 then begin sDecl:='Ouverture PN'+intToSTR(i)+' par zone '+intToSTr(adr)+' '+intToSTR(adr2); - Affiche(sDecl,clorange); - //if AffAigDet then AfficheDebug(s,clorange); - if tablo_pn[i].TypeCde=0 then + Affiche(sDecl,clwhite); + if tablo_pn[i].TypeCde=0 then // par accessoire begin if Tablo_PN[i].pulse=1 then ts:=aigP else ts:=signal; pilote_acc(Tablo_PN[i].AdresseOuvre,Tablo_PN[i].CommandeOuvre,ts); @@ -11106,22 +11316,28 @@ begin else begin typ:=Tablo_PN[i].AdresseFerme; // numéro accessoire - typ:=com_socket(v); + typ:=com_socket(typ); if typ=1 then ouvre_pn_usb(i); if typ=2 then ouvre_pn_socket(i); end; - if tablo_pn[i].compteur>0 then dec(tablo_pn[i].compteur); + end; + if tablo_pn[i].compteur>0 then + begin + dec(tablo_pn[i].compteur); + if debugPN then Affiche('Compteur PN'+intToSTR(i)+'='+intToSTR(tablo_pn[i].compteur),clwhite); end; end; - if (dZ1F=adr) and (dZ2F=adr2) and (fm) then // zone de fermeture + if debugPN then Affiche('test ferme '+intToSTR(Adr)+' '+intToSTR(adr2)+' '+intToSTR(etat),clwhite); + if (dZ1F=adr) and (dZ2F=adr2) and (etat=1) then // zone de fermeture begin inc(Tablo_PN[i].compteur); + if debugPN then Affiche('Compteur PN'+intToSTR(i)+'='+intToSTR(tablo_pn[i].compteur),clwhite); if tablo_pn[i].compteur=1 then begin sDecl:='Fermeture PN'+IntToSTR(i)+' par zone '+intToSTr(adr)+' '+intToSTR(adr2)+' (train voie '+IntToSTR(v)+')'; - affiche(sDecl,clorange); - if tablo_pn[i].TypeCde=0 then + affiche(sDecl,clwhite); + if tablo_pn[i].TypeCde=0 then // par accessoire begin if Tablo_PN[i].pulse=1 then ts:=aigP else ts:=signal; pilote_acc(Tablo_PN[i].AdresseFerme,Tablo_PN[i].CommandeFerme,ts); @@ -11129,7 +11345,7 @@ begin else begin typ:=Tablo_PN[i].AdresseFerme; // numéro accessoire - typ:=com_socket(v); + typ:=com_socket(typ); if typ=1 then ferme_pn_usb(i); if typ=2 then ferme_pn_socket(i); end; @@ -11211,10 +11427,11 @@ begin dr:=detecteur[adresse].tempo0; if (detecteur[Adresse].etat and not(etat)) and (dr=0) then begin - if dr<>0 then exit; + // init de la tempo detecteur[adresse].tempo0:=filtrageDet0; exit; end; + // si tempo échue (99) if dr=99 then detecteur[adresse].tempo0:=0; // si détecteur passe à 1 et qu'un filtrage à 0 est en cours, annuler le 0 @@ -11302,7 +11519,7 @@ begin begin If traceListe then AfficheDebug('Le signal '+IntToSTR(AdrSignal)+' est précédé d''un buttoir',clyellow); MemZone[0,AdrDetSignal].etat:=true; - event_act(0,AdrDetSignal,1,''); // activation zone + event_act(0,AdrDetSignal,1,'',false); // activation zone Maj_Signal_P(AdrSignal,false); end; end; @@ -11310,8 +11527,8 @@ begin // gérer l'évènement actionneur pour action if etat then i:=1 else i:=0; - event_act(Adresse,0,i,''); if not(confignulle) then calcul_zones(adresse,true); + event_act(Adresse,0,i,'',false); end; // détection fronts descendants @@ -11345,8 +11562,8 @@ begin // gérer l'évènement detecteur pour action if etat then i:=1 else i:=0; - event_act(Adresse,0,i,train); if not(confignulle) then calcul_zones(adresse,false); + event_act(Adresse,0,i,train,false); end; end; @@ -11410,7 +11627,7 @@ var s: string; faire_event,inv,bjd : boolean; prov,index,i,id,etatact,typ,adr : integer; begin - if AffAigDet then AfficheDebug('Tick='+IntToSTR(tick)+' Event Aig '+intToSTR(adresse)+'='+intToSTR(pos),clorange); + //if AffAigDet then Affiche('Tick='+IntToSTR(tick)+' Event Aig '+intToSTR(adresse)+'='+intToSTR(pos),clorange); index:=index_aig(adresse); if index<>0 then begin @@ -11470,7 +11687,7 @@ begin etatAct:=Tablo_actionneur[i].etat ; adr:=Tablo_actionneur[i].adresse; typ:=Tablo_actionneur[i].typdeclenche; - if (typ=2) and (Adr=adresse) then event_act(Adresse,0,pos,''); // évent aig + if (typ=2) and (Adr=adresse) then event_act(Adresse,0,pos,'',false); // évent aig end; // pour périphériques @@ -11555,6 +11772,32 @@ begin end; end; +// envoi d'une chaîne Com_IPC à CDM par socket, puis attend l'ack ou le nack +function envoi_CDM(s : string) : boolean; +var temps : integer; +begin + if CDM_connecte=false then begin envoi_CDM:=false;exit;end; + if traceTrames then afficheDebug(s,clLime); + Formprinc.ClientSocketCDM.Socket.SendText(s); + // attend l'ack + ackCDM:=false;nackCDM:=false; + temps:=0; + + repeat + inc(temps); + Sleep(50); + Application.processMessages; + until fermeSC or ackCDM or nackCDM or (temps>20); // CDM répond < 1s + //Affiche(intToSTR(temps),clred); + if not(ackCDM) or nack then + begin + Affiche('Pas de réponse de CDM Rail',clRed); + end; + + envoi_CDM:=ackCDM; +end; + + // pilotage d'un accessoire (décodeur d'aiguillage, de signal) et génère l'event aig // par CDM ou interface // octet = 1 (dévié) ou 2 (droit) si 0 on ne traite pas @@ -11599,12 +11842,14 @@ begin begin //AfficheDebug(intToSTR(adresse),clred); if debug_dec_sig and (acc=signal) then AfficheDebug('Tick='+IntToSTR(Tick)+' signal '+intToSTR(adresse)+' '+intToSTR(pilotage),clorange); - if aff_acc then Affiche('Accessoire '+intToSTR(adresse)+' à '+intToSTR(pilotage),clorange); + //if aff_acc then + Affiche('Accessoire '+intToSTR(adresse)+' à '+intToSTR(pilotage),clorange); if pilotage=1 then pilotageCDM:=1; // 3 = wrong state or value if pilotage=2 then pilotageCDM:=2; s:=chaine_CDM_Acc(adresse,pilotageCDM); envoi_CDM(s); + event_aig(adresse,pilotage); result:=true; exit; @@ -13537,6 +13782,7 @@ procedure positionne_elements(i : integer); begin with formprinc do begin + LabelClock.Left:=width-120; GroupBoxAcc.Left:=i+12; GroupBoxCV.Left:=i+12; GroupBoxTrains.Left:=i+12; @@ -13715,7 +13961,7 @@ var n,t,i,index,OrgMilieu : integer; Sr : TSearchRec; tmP,tmA : tMenuItem; begin - af:='Client TCP-IP ou USB CDM Rail - système XpressNet DCC++ Version '+Version+sousVersion; + af:='Client TCP-IP ou USB CDM Rail - système XpressNet DCC++ Version '+VersionSC+sousVersion; {$IF CompilerVersion >= 28.0} af:=af+' D11'; {$IFEND} @@ -13724,6 +13970,7 @@ begin formTCO[index]:=nil; end; + BorderStyle:=bsSizeable; Caption:=af; TraceSign:=True; @@ -13731,6 +13978,7 @@ begin PremierFD:=false; sauve_tco:=false; pasChgTBV:=false; + horloge:=false; ntrains:=0; mode_reserve:=0; // mode_reserve 0 = par canton - 1=par détecteurs @@ -13745,7 +13993,7 @@ begin Srvc_Aig:=true; Srvc_Det:=true; Srvc_Act:=true; - Srvc_Pos:=false; + Srvc_Pos:=true; Srvc_sig:=false; Z21:=false; @@ -13774,6 +14022,8 @@ begin ncrois:=0; EnvAigDccpp:=0; debugtrames:=false; + horlogeInterne:=true; + DureeMinute:=60; ProcPrinc:=false; algo_Unisemaf:=1; NbPeriph:=0; @@ -13782,6 +14032,9 @@ begin espY:=15; etat_init_interface:=0; debug:=0; + heure:=0; + minute:=0; + seconde:=0; etape:=1; affevt:=false; EvtClicDet:=false; @@ -13795,6 +14048,7 @@ begin formatY:=-1; avecResa:=false; // réservation des aiguillages en mode normal serveurIPCDM_Touche:=false; + debugPN:=false; sombre:=false; AvecInit:=true; // &&&& avec initialisation des aiguillages ou pas Diffusion:=AvecInit; // mode diffusion publique + debug mise au point etc @@ -13807,6 +14061,12 @@ begin Decodeur[5]:='Digikeijs 4018';Decodeur[6]:='Unisemaf Paco';Decodeur[7]:='Stéphane Ravaut';Decodeur[8]:='Arcomora'; Decodeur[9]:='LS-DEC-NMBS';Decodeur[10]:='B-models'; + if versionSC='8.53' then + begin + Horaires1.enabled:=false; + LabelClock.Visible:=false; + end; + OsBits:=0; if IsWow64Process then begin @@ -13837,15 +14097,14 @@ begin Affiche(s,clred); end; // création des composants MSCom (USB COM) ----------------- - // interface centrale - try - MSCommUSBInterface:=TMSComm.Create(formprinc); + // interface centrale - provoque l'apparition de la fenêtre "préparation de l'installation" + + try MSCommUSBInterface:=TMSComm.Create(formprinc); except s:='Erreur 6000 : Composant Interface non créé'; AfficheDebug(s,clred); Affiche(s,clred); end; - if MSCommUSBInterface<>nil then MSCommUSBInterface.onComm:=RecuInterface; // pour deux périphériques COM/USB @@ -13940,6 +14199,11 @@ begin // lecture fichiers de configuration procetape('Lecture de la configuration'); lit_config; + {$IF CompilerVersion >= 28.0} + //https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Compiler_Versions + change_style; + {$IFEND} + init_horloge; // identifier les écrans n:=Screen.MonitorCount-1; @@ -14021,81 +14285,11 @@ begin //Panels[3].Style:=psOwnerDraw; // pour déclencher l'évenement onDraw end; - // positionnement de la fenêtre principale - position:=poDefault; + {$IF CompilerVersion < 28.0} + positionne_principal; + {$IFEND} - if AffMemoFenetre=1 then - begin - if largeurF>0 then formPrinc.width:=LargeurF; - if HauteurF>0 then formPrinc.Height:=hauteurF; - formPrinc.left:=offsetXF; - formPrinc.top:=offsetYF; - - if (PosSplitter>0) and (PosSPlitter0) and (PosSPlitter0 then + for i:=1 to MaxHoraire do + begin + if (grilleHoraire[i].NomTrain=train) and (grilleHoraire[i].arretDepart) then + begin + if ( (grilleHoraire[i].heureminute)) + ) and (seconde<10) then + begin + Affiche('Arrêt du train '+Train+' hors horaire',clOrange); + sens:=true; + vitesse_loco(train,i,adresse,0,true); + end; + + end; + end; +end; + +// appelé par le timer, si l'horloge tourne +procedure gestion_horaire; +var i,indexTrain,vitesse : integer; + traite : boolean; + train : string; +begin + // démarrage des trains à l'horaire + for i:=1 to MaxHoraire do + begin + if (grilleHoraire[i].heure=heure) and (grilleHoraire[i].minute=minute) then + begin + train:=grilleHoraire[i].NomTrain; + + traite:=true; + if roulage then + begin + indexTrain:=index_train_nom(train); + traite:=trains[indexTrain].roulage; + end; + + if traite then + begin + vitesse:=grilleHoraire[i].vitesse; + if not(grilleHoraire[i].sens) then vitesse:=-vitesse; + Affiche('Démarrage train '+train+' à l''horaire '+format('%.2dh%.2d',[heure,minute]),clyellow); + Demarre_index_train(index_train_nom(train)); + //vitesse_loco(train,0,adr,vitesse,true); + end; + end; + + end; + + // évènements actionneurs horaires + for i:=1 to maxTablo_act do + begin + if Tablo_actionneur[i].typdeclenche=1 then + begin +// affiche(intToSTR(Tablo_Actionneur[i].adresse)+' '+Tablo_Actionneur[i].,clLime); + if (Tablo_Actionneur[i].adresse=heure) and (Tablo_Actionneur[i].adresse2=minute) then + begin + event_act(heure,minute,1,'',true); + end; + end; + end; +end; + // timer à 100 ms procedure TFormPrinc.Timer1Timer(Sender: TObject); -var i,a,adresse,TailleX,TailleY,orientation,indexTCO,x,y,Bimage,aspect : integer; +var vitesse,i,a,adresse,TailleX,TailleY,orientation,indexTCO,x,y,Bimage,aspect : integer; imageSignal : Timage; frx,fry : real; faire : boolean; - s : string; + h,m,sec,ms : word; + s : string; begin inc(tick); + // --- horloge système + if horloge then + begin + inc(comptSec); + if not(horlogeInterne) then + begin + if ComptSec=9 then + begin + comptSec:=0; + decodeTime(GetTime,h,m,sec,ms); + heure:=h;minute:=m;seconde:=sec; + //if seconde-Asec<>1 then Affiche('Erreur s - Ecart='+intToSTR(seconde-Asec),clred); + Asec:=seconde; + labelClock.Caption:=format('%.2dh%.2d:%.2d',[heure,minute,seconde] ); + Clock.tickercall; + if minute<>AncMinute then gestion_horaire; + AncMinute:=minute; + end; + end; + + // --- horloge de signaux complexes + if horlogeInterne then + begin + //if comptSec>=(DureeMinute*5) div 30 then + if comptSec>=CompteurDixiemes then + begin + comptSec:=0; + inc(seconde); + //if seconde>=DureeMinute then + if seconde=60 then + begin + seconde:=0; + inc(minute); + if minute=60 then + begin + minute:=0; + inc(heure); + if heure=24 then heure:=0; + end; + gestion_horaire; // au chgt minute + if (heure=RetourHeure) and (minute=RetourMinute) then + begin + heure:=heureinit;Minute:=minuteInit; + Affiche('Horloge en initialisation',clyellow); + if not(relanceHorl_init) then + begin + horloge:=false; + Affiche('Arrêt horloge',clyellow); + end; + end; + end; + labelClock.Caption:=format('%.2dh%.2d:%.2d',[heure,minute,seconde] ); + Clock.tickercall; + end + end; + end; + if (tick=30) or (tick=100) then begin // raz du flag "fenetre confcellTCO affichée" @@ -14532,6 +14853,7 @@ begin // arret loco sur n secondes // démarrage loco temporisé // renvoi de la consigne + // l'index de train 0 est le train courant for i:=1 to ntrains do begin a:=trains[i].TempoArret; @@ -14539,8 +14861,15 @@ begin begin dec(a); trains[i].TempoArret:=a; - if a=0 then vitesse_loco('',i,trains[i].adresse,0,true,false) else - if (a mod 10)=0 then vitesse_loco('',i,trains[i].adresse,trains[i].VitRalenti div 2,not(placement[i].inverse),false); + if a=0 then vitesse_loco(trains[i].nom_train,i,trains[i].adresse,0,false) else + if (a mod 10)=0 then + begin + vitesse:=trains[i].VitRalenti div 2; + if (placement[i].inverse) then vitesse:=-vitesse; + //Affiche('train'+intToSTR(i)+' '+intToSTR(vitesse),clred); + vitesse_loco(trains[i].nom_train,i,trains[i].adresse,vitesse,false); + end; + end; a:=trains[i].TempoDemarre; @@ -14550,8 +14879,9 @@ begin trains[i].TempoDemarre:=a; if a=0 then begin - //Affiche('Démarrage train @'+intToSTR(trains[i].Adresse),clLime); - vitesse_loco('',i,trains[i].Adresse,trains[i].VitNominale,not(placement[i].inverse),false); + vitesse:=trains[i].VitNominale; + if (placement[i].inverse) then vitesse:=-vitesse; + vitesse_loco(trains[i].nom_train,i,trains[i].adresse,vitesse,false); end; end; @@ -14562,9 +14892,11 @@ begin trains[i].compteur_consigne:=a; if a=0 then begin - vitesse_loco(trains[i].nom_train,i,trains[i].adresse,trains[i].vitesse,trains[i].sens,false); - //Affiche('vitesse ' +intToSTR(i)+' '+intToSTR(trains[i].vitesse),clred); + vitesse:=trains[i].Vitesse; + if (placement[i].inverse) then vitesse:=-vitesse; + vitesse_loco(trains[i].nom_train,i,trains[i].adresse,vitesse,false); end; + //Affiche('vitesse ' +intToSTR(i)+' '+intToSTR(trains[i].vitesse),clred); end; end; @@ -14595,7 +14927,7 @@ begin if Tablo_simule[I_simule].modele=act then begin s:='Simu '+intToSTR(I_simule)+' Tick='+IntToSTR(tick)+' act='+intToSTR(Tablo_simule[i_simule].adresse)+'='+IntToSTR(Tablo_simule[i_simule].etat); - Event_Act(Tablo_simule[i_simule].adresse,Tablo_simule[i_simule].adresse2,Tablo_simule[i_simule].etat, Tablo_simule[i_simule].train); + Event_Act(Tablo_simule[i_simule].adresse,0,Tablo_simule[i_simule].etat, Tablo_simule[i_simule].train,false); StatusBar1.Panels[1].text:=s; //Affiche(s,clyellow); end; @@ -14633,7 +14965,7 @@ begin detecteur[i].tempo0:=a; if (a=0) then begin - detecteur[i].tempo0:=99; + detecteur[i].tempo0:=99; // indicateur tempo échue event_detecteur(i,false,detecteur[i].train); end; end; @@ -15125,6 +15457,10 @@ begin DeConnecterCDMRail.enabled:=true; end; + + + + // décodage d'une trame CDM au protocole IPC // la trame_CDM peut contenir 2000 caractères à l'initialisation du RUN. procedure Interprete_trameCDM(trame_CDM:string); @@ -15187,12 +15523,23 @@ begin begin //fin de la description des trains FormPrinc.ComboTrains.Items.Clear; - for i:=1 to ntrains_cdm do Formprinc.ComboTrains.Items.Add(trains_cdm[i].nom_train); + + // on remplace les trains du combo et de la base (non stockée) + for i:=1 to ntrains_cdm do + begin + Formprinc.ComboTrains.Items.Add(trains_cdm[i].nom_train); + Trains[i].nom_train:=trains_cdm[i].nom_train; + Trains[i].adresse:=Trains_cdm[i].adresse; + Trains[i].vitmax:=Trains_cdm[i].vitmax; + end; + ntrains:=ntrains_cdm; with formprinc do begin ComboTrains.ItemIndex:=0; editadrtrain.Text:=inttostr(trains_cdm[1].adresse); end; + + end; delete(trame_cdm,1,j); goto reprise; @@ -15254,7 +15601,7 @@ begin else if pos('ERR=500',commandeCDM)<>0 then s:='Erreur CDM : serveur DCC non lancé ' else - if pos('ERR=300',commandeCDM)<>0 then s:='Erreur CDM : train non trouvé ' + if pos('ERR=300',commandeCDM)<>0 then s:='Erreur CDM : RUN non lancé ou train non trouvé ' else begin j:=pos('MSG=',commandeCDM); @@ -15276,8 +15623,6 @@ begin begin ss:=copy(commandeCDM,i+5,l-i-5); trains_cdm[ntrains_cdm].nom_train:=ss; - val(ss,adr,erreur); - //s:='NAME='+IntToSTR(adr); Delete(commandeCDM,i,l-i+1); end; @@ -15286,7 +15631,6 @@ begin begin ss:=copy(commandeCDM,i+3,l-i-3); val(ss,trains_cdm[ntrains_cdm].adresse,erreur); - //s:='AD='+IntToSTR(adr); Delete(commandeCDM,i,l-i+1); end; @@ -15583,7 +15927,7 @@ begin end; if AffAigDet then AfficheDebug('Actionneur AD='+intToSTR(adr)+' Nom='+nom+' Train='+train+' Etat='+IntToSTR(etat),clyellow); - Event_act(adr,0,etat,train); // déclenche évent actionneur + Event_act(adr,0,etat,train,false); // déclenche évent actionneur end; // évènement position des trains @@ -15607,7 +15951,7 @@ begin train:=copy(commandeCDM,i+5,l-i-5); s:=s+' '+train; Delete(commandeCDM,i,l-i+1); - end; + end; i:=posEx('SPEED=',commandeCDM,1);l:=posEx(';',commandeCDM,i); if (i<>0) and (l<>0) then @@ -15626,7 +15970,7 @@ begin s:=s+' X='+IntTostr(x); Delete(commandeCDM,i,l-i+1); end; - + i:=posEx('Y=',commandeCDM,1);l:=posEx(';',commandeCDM,i); if (i<>0) and (l<>0) then begin @@ -15644,7 +15988,7 @@ begin s:=s+' X2='+IntTostr(x2); Delete(commandeCDM,i,l-i+1); end; - + if (i<>0) and (l<>0) then begin i:=posEx('Y2=',commandeCDM,1);l:=posEx(';',commandeCDM,i); @@ -15653,6 +15997,7 @@ begin s:=s+' Y2='+IntTostr(y2); Delete(commandeCDM,i,l-i+1); end; + if horloge then verifie_train_horaire(adr,train,vitesse); // fait bouger le train dans la fenetre cdm if fichier_module_CDM then Aff_train(adr,train,x,y,x2,y2); if afftiers then afficheDebug(s,clAqua); @@ -16287,7 +16632,6 @@ end; procedure TFormPrinc.locoClick(Sender: TObject); var i,adr,vit,erreur : integer; s : string; - sens : boolean; begin // vitesse et direction 18 pas s:=editAdrTrain.Text; @@ -16304,8 +16648,7 @@ begin i:=index_train_nom(s); end; Affiche('Commande vitesse train '+s+' ('+intToSTR(adr)+') à '+IntToSTR(vit)+'%',cllime); - sens:=vit>0; - vitesse_loco(s,i,adr,vit,sens,true); + vitesse_loco(s,i,adr,vit,true); if s='' then s:=intToSTR(adr); end; @@ -16425,7 +16768,7 @@ var i,t,t1 : integer; s: string; begin Affiche(' ',clyellow); - s:='Signaux complexes GL version '+version+sousVersion; + s:='Signaux complexes GL version '+versionSC+sousVersion; {$IF CompilerVersion >= 28.0} s:=s+' D11'; {$IFEND} @@ -16678,6 +17021,7 @@ begin clicComboTrain:=true; i:=ComboTrains.itemIndex+1; if (i<>0) and (i0 then begin Affiche('Arrêt train @'+intToSTR(adr)+' '+Trains[i].nom_train,clyellow); - vitesse_loco('',i,adr,0,not(placement[i].inverse),true); + vitesse_loco('',i,adr,0,true); end; end; end; @@ -17099,10 +17447,10 @@ begin str(v_publie:2:2,s); if v_publie>0 then begin - val(version,V_utile,erreur); + val(versionSC,V_utile,erreur); Affiche('Nt='+nombre_tel,clLime); - if V_utile=V_publie then Affiche('Votre version '+Version+SousVersion+' publiée le '+date_creation+' est à jour',clLime); - if V_utile>V_publie then Affiche('Votre version '+version+SousVersion+' est plus récente que la version publiée '+s,clLime); + if V_utile=V_publie then Affiche('Votre version '+VersionSC+SousVersion+' publiée le '+date_creation+' est à jour',clLime); + if V_utile>V_publie then Affiche('Votre version '+versionSC+SousVersion+' est plus récente que la version publiée '+s,clLime); end end; @@ -17984,14 +18332,34 @@ begin FenRich.Width:=GrandPanel.Width-Panel1.Width-GroupBoxAcc.Width-25; splitterV.Left:=FenRich.left+FenRich.Width-5; positionne_elements(splitterV.Left); + FormClock.Width:=250; + FormClock.Height:=250; + OffsetYFC:=(formprinc.top+formPrinc.height)-250-20; + OffsetXFC:=(formprinc.left+formPrinc.width)-250; + FormClock.top:=OffsetYFC; + FormClock.left:=OffsetXFC; + DeltaFPCY:=OffsetYFC-formprinc.top; + DeltaFPCX:=OffsetXFC-formprinc.left; end; procedure TFormPrinc.Sauvegarderla1Click(Sender: TObject); begin + // fenêtre principale LargeurF:=width; HauteurF:=Height; OffsetXF:=left; OffsetYF:=top; + // fenêtre clock + LargeurFC:=formClock.width; + HauteurFC:=formClock.Height; + OffsetXFC:=formClock.left; + OffsetYFC:=formClock.top; + + // écart entre fenetre principale et clock , pour procédure formprinc WindowPosChanging + DeltaFPCY:=OffsetYFC-formprinc.top; + DeltaFPCX:=OffsetXFC-formprinc.left; + + PosSplitter:=splitterV.Left; AffMemoFenetre:=1; sauve_config; @@ -18263,13 +18631,57 @@ begin if n>1 then affiche(intToSTR(n)+' clients connectés',clyellow); end; - +procedure TFormPrinc.Horloge1Click(Sender: TObject); begin - + if formHorloge<>nil then formHorloge.showModal; +end; + +procedure TFormPrinc.Ficheshoraires1Click(Sender: TObject); +begin + if formFicheHoraire<>nil then formFicheHoraire.showModal; +end; + +procedure TFormPrinc.Validationdeshoraires1Click(Sender: TObject); +begin + if not(horloge) then Demarre_horloge + else horloge:=false; + + if horloge then Affiche('Horloge validée',clWhite) + else Affiche('Horloge dévalidée',clWhite); +end; + +procedure TFormPrinc.Ini1Click(Sender: TObject); +begin + Init_Horloge; +end; + +procedure TFormPrinc.Afficherlhorloge1Click(Sender: TObject); + begin + affiche_horloge; +end; + +procedure TFormPrinc.WindowPosChanging(var Msg: TWMWindowPosMsg); +begin + if not(Verrouille) then exit; + if (formclock<>nil) and not(FermeSC) then + begin + if (axFP<>left) or (ayFP<>top) then + begin + if affEvt then Affiche('FenPrinc bouge',clYellow); + formclock.top:=top+DeltaFPCY; + formclock.left:=left+DeltaFPCX; + // formclock.Top:=top+height-Formclock.Height-20; + // formclock.Left:=left+width-Formclock.width; + end; + axFP:=left; + ayFP:=top; + + end; + inherited; +end; - end. diff --git a/UnitSimule.pas b/UnitSimule.pas index 7d7e2eb..7f86f48 100644 --- a/UnitSimule.pas +++ b/UnitSimule.pas @@ -100,7 +100,6 @@ begin i:=pos('/',s); if i<>0 then delete(s,1,i); val(s,k,erreur); - Tablo_simule[index_simule].adresse2:=k; i:=pos('=',s); if i<>0 then delete(s,1,i); diff --git a/UnitTCO.dfm b/UnitTCO.dfm index be4632f..38677cc 100644 --- a/UnitTCO.dfm +++ b/UnitTCO.dfm @@ -1,7 +1,7 @@ object FormTCO: TFormTCO - Left = 113 - Top = 72 - Width = 1218 + Left = 58 + Top = 115 + Width = 1220 Height = 594 VertScrollBar.Visible = False Caption = 'c' @@ -24,12 +24,12 @@ object FormTCO: TFormTCO OnKeyPress = FormKeyPress OnMouseWheel = FormMouseWheel DesignSize = ( - 1210 + 1212 543) PixelsPerInch = 96 TextHeight = 13 object LabelZoom: TLabel - Left = 1168 + Left = 1170 Top = 0 Width = 32 Height = 13 @@ -43,14 +43,14 @@ object FormTCO: TFormTCO ParentFont = False end object ImageTemp: TImage - Left = 1021 + Left = 1023 Top = 0 Width = 121 Height = 121 Anchors = [akTop, akRight] end object ImageTemp2: TImage - Left = 1020 + Left = 1022 Top = 129 Width = 121 Height = 121 @@ -59,7 +59,7 @@ object FormTCO: TFormTCO object ScrollBox: TScrollBox Left = 8 Top = 12 - Width = 690 + Width = 692 Height = 347 HorzScrollBar.Smooth = True HorzScrollBar.Tracking = True @@ -71,12 +71,12 @@ object FormTCO: TFormTCO ParentColor = False TabOrder = 1 DesignSize = ( - 686 + 688 343) object ImageTCO: TImage Left = 120 Top = 41 - Width = 489 + Width = 491 Height = 257 Anchors = [akLeft, akTop, akRight, akBottom] AutoSize = True @@ -91,7 +91,7 @@ object FormTCO: TFormTCO end end object TrackBarZoom: TTrackBar - Left = 1166 + Left = 1168 Top = 15 Width = 41 Height = 311 @@ -110,7 +110,7 @@ object FormTCO: TFormTCO object PanelBas: TPanel Left = 0 Top = 395 - Width = 1202 + Width = 1204 Height = 140 Anchors = [akLeft, akRight, akBottom] Color = clActiveBorder @@ -123,7 +123,7 @@ object FormTCO: TFormTCO TabOrder = 2 OnDragOver = PanelBasDragOver DesignSize = ( - 1202 + 1204 140) object Label1: TLabel Left = 240 @@ -906,7 +906,7 @@ object FormTCO: TFormTCO ParentFont = False end object ButtonSauveTCO: TButton - Left = 1093 + Left = 1095 Top = 8 Width = 96 Height = 33 @@ -918,7 +918,7 @@ object FormTCO: TFormTCO OnClick = ButtonSauveTCOClick end object ButtonConfigTCO: TButton - Left = 1093 + Left = 1095 Top = 48 Width = 96 Height = 33 @@ -929,7 +929,7 @@ object FormTCO: TFormTCO OnClick = ButtonConfigTCOClick end object ButtonSimu: TButton - Left = 881 + Left = 883 Top = 80 Width = 113 Height = 25 @@ -1122,7 +1122,7 @@ object FormTCO: TFormTCO end end object buttonRaz: TButton - Left = 1094 + Left = 1096 Top = 88 Width = 97 Height = 33 @@ -1134,7 +1134,7 @@ object FormTCO: TFormTCO OnClick = buttonRazClick end object ButtonCalibrage: TButton - Left = 921 + Left = 923 Top = 56 Width = 75 Height = 25 @@ -1145,7 +1145,7 @@ object FormTCO: TFormTCO OnClick = ButtonCalibrageClick end object ButtonDessiner: TButton - Left = 990 + Left = 992 Top = 48 Width = 97 Height = 33 @@ -1161,7 +1161,7 @@ object FormTCO: TFormTCO OnClick = ButtonDessinerClick end object ButtonAffSC: TButton - Left = 990 + Left = 992 Top = 8 Width = 97 Height = 33 @@ -1173,7 +1173,7 @@ object FormTCO: TFormTCO OnClick = ButtonAffSCClick end object RadioGroupSel: TRadioGroup - Left = 842 + Left = 844 Top = 8 Width = 138 Height = 49 diff --git a/UnitTCO.pas b/UnitTCO.pas index 2acb3e9..3dba802 100644 --- a/UnitTCO.pas +++ b/UnitTCO.pas @@ -5,7 +5,9 @@ interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Grids , UnitPrinc, StdCtrls, ExtCtrls, Menus, UnitPilote, UnitDebug, - ComCtrls ,StrUtils, math, unitconfig, UnitAnalyseSegCDM, Buttons , verif_version ; + ComCtrls ,StrUtils, math, unitconfig, UnitAnalyseSegCDM, Buttons , verif_version, + UnitHorloge, + ImgList ; type TFormTCO = class(TForm) @@ -504,8 +506,6 @@ type var couleurAdresse,cltexte,CoulFonte : Tcolor; - formTCO : array[1..10] of TformTCO; // pointeur vers forms - TamponAffecte,TCO_modifie,clicsouris,prise_N, clicTCO,piloteAig,BandeauMasque,eval_format,sauve_tco,prise_droit,prise_haut, prise_bas,prise_gauche,prise_NE,prise_NO,prise_SE,prise_SO,ligneAffiche,colonneAffiche, @@ -565,6 +565,7 @@ var largeurCelld2,HauteurCelld2,NbCellulesTCO,NbreCellX,NbreCellY,LargeurCell,HauteurCell, Xentoure,Yentoure,XclicCell,YclicCell,EcranTCO,clGrille,clFond,ClAllume,ClVoies, ClCanton,clPiedSignal,ClQuai,ClBarriere,ZoomInit,Xinit,Yinit : array[1..10] of integer; + formTCO : array[1..10] of TformTCO; // pointeur vers forms PcanvasTCO : array[1..10] of Tcanvas; PBitMapTCO : array[1..10] of TbitMap; PImageTCO,PImageTemp : array[1..10] of Timage; @@ -609,7 +610,7 @@ procedure encadre_colonne; implementation -uses UnitConfigTCO, Unit_Pilote_aig, UnitConfigCellTCO ; +uses UnitConfigTCO, Unit_Pilote_aig, UnitConfigCellTCO, UnitClock ; {$R *.dfm} @@ -1853,6 +1854,7 @@ procedure affiche_texte(indextco,x,y : integer); var b,x0,y0,xt,yt,repr,taillefont,tf : integer; ss,s,nf : string; c : Tcanvas; + r : Trect; begin c:=PcanvasTCO[indextco]; if c=nil then exit; @@ -1890,11 +1892,22 @@ begin 2 : yt:=1; // haut 3 : yt:=hauteurCell[indexTCO]-round(2*TailleFont*fryGlob[indexTCO]); // bas 5 : begin // double centré XY - xt:=(largeurCell[indexTCO] div 2)-(round(length(s)*(taillefont)*frxGlob[indexTCO]) div 2)-1; - yt:=(hauteurCell[indexTCO] div 2)-round(tailleFont*fryGlob[indexTCO]); // texte centré + r.Left:=x0; + r.Top:=y0+3; + r.Right:=x0+largeurCell[indexTCO]; + r.bottom:=y0+hauteurCell[indexTCO]; + // centrage et positionnement: DT_TOP or DT_CENTER or DT_VCENTER or DT_CENTER + // césures de mots : DT_SINGLELINE DT_WORDBREAK + // ? : dt_noclip + //DrawText(PcanvasTCO[indexTCO].Handle,PChar(s), -1, R,DT_VCENTER or DT_CENTER or DT_SINGLELINE ); + //s:='yat'+#13+'bot'; + DrawText(PcanvasTCO[indexTCO].Handle,PChar(s), -1, R,DT_VCENTER or DT_CENTER or dt_wordbreak ); + + exit; end; end; + if b=Id_Quai then xt:=6; if (b<>Id_Quai) and (b<>Id_action) then s:=s+' '; @@ -2169,7 +2182,7 @@ var x0,y0,xc,yc,jy1,xf,yf,position,ep : integer; begin if testbit(ep,7) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; pen.color:=couleur; - moveto(x0,yc);lineto(xc,yc); + moveto(x0,yc);lineto(xc,yc); if testbit(ep,3) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; lineto(xf,yc); end; @@ -2533,7 +2546,7 @@ var x0,y0,xc,yc,xf,yf,x1,y1,x2,y2,x3,y3,x4,y4,position,ep : integer; begin pen.color:=couleur; if testbit(ep,7) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; - moveto(x0,yc);lineto(xc,yc); + moveto(x0,yc);lineto(xc,yc); if testbit(ep,3) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; lineto(xf,yc); end; @@ -3149,7 +3162,7 @@ begin MoveTo(x0,y0+hauteurCell[indexTCO]);lineto(xc,yc); if testbit(ep,3) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; LineTo(x0+LargeurCell[indexTCO],yc); - + end; end; @@ -3188,7 +3201,7 @@ begin pen.color:=Couleur; Pen.Mode:=pmCopy; if testbit(ep,6) or testbit(ep,3) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; - + canvas.Arc(x1,y1,x2,y2,x3,y3,x4,y4); end; end; @@ -3420,21 +3433,30 @@ begin Pen.Width:=1; Brush.Color:=fond; Pen.Color:=fond; - //r:=Rect(x0,y0,xf,yf); - //FillRect(r); // efface la cellule - Pen.Width:=epaisseur; Brush.Color:=clVoies[indexTCO]; Pen.Color:=clVoies[indexTCO]; Pen.Mode:=pmCopy; - if (position=const_Devie) or (position=const_inconnu) then + if mode>0 then begin - trajet_devie; // affiche la position de la branche déviée - end; + if (position=const_Devie) or (position=const_inconnu) then + begin + trajet_droit; + trajet_devie; // affiche la position de la branche déviée + end; + + if (position=const_droit) then + begin + trajet_devie; + trajet_droit; + end; + end + + else - if (position=const_droit) or (position=const_inconnu) then begin + trajet_devie; trajet_droit; end; @@ -3668,13 +3690,24 @@ begin Pen.Color:=clVoies[indexTCO]; Pen.Mode:=pmCopy; - if (position=const_Devie) or (position=const_inconnu) then + if mode>0 then begin - trajet_devie; // affiche la position de la branche déviée - end; + if (position=const_Devie) or (position=const_inconnu) then + begin + trajet_droit; + trajet_devie; + end; - if (position=const_droit) or (position=const_inconnu) then + if (position=const_droit) then + begin + trajet_devie; + trajet_droit; + end; + end + + else begin + trajet_devie; trajet_droit; end; @@ -3696,8 +3729,8 @@ begin pen.color:=fond; Brush.Color:=fond; pen.width:=1; - x1:=xc-(epaisseur div 2)+1;y1:=yc-(epaisseur div 2)-1; - x2:=x1-epaisseur-1; + x1:=xc-round(0.4*epaisseur);y1:=yc-(epaisseur div 2); + x2:=x1-epaisseur; x3:=x2-epaisseur;y3:=yc+(epaisseur div 2)+1; x4:=x1-epaisseur-1; polygon([point(x1,y1),point(x2,y1),point(x3,y3),point(x4,y3)]); @@ -5064,16 +5097,21 @@ end; // action procedure dessin_Action(indexTCO : integer;Canvas : Tcanvas;x,y,mode: integer); -var x0,y0,xf,yf,act : integer; +var x0,y0,xf,yf,act,larg,haut : integer; r : Trect; + frX,frY : real; s : string; begin if PcanvasTCO[indexTCO]=nil then exit; - x0:=(x-1)*LargeurCell[indexTCO]+2; - y0:=(y-1)*hauteurCell[indexTCO]+2; - xf:=x0+LargeurCell[indexTCO]-4; - yf:=y0+HauteurCell[indexTCO]-4; + larg:=LargeurCell[indexTCO]; + haut:=hauteurCell[indexTCO]; + + x0:=(x-1)*Larg+2; + y0:=(y-1)*haut+2; + xf:=x0+Larg-4; + yf:=y0+Haut-4; + with canvas do begin @@ -5091,41 +5129,78 @@ begin s:=''; if s='' then tco[indexTCO,x,y].repr:=5; // centré en X et Y act:=tco[indexTCO,x,y].PiedFeu; - if act=1 then + case act of + AcChangeTCO : begin if s='' then s:='TCO'+intToSTR(tco[indexTCO,x,y].FeuOriente); // feuoriente contient le numéro du TCO tco[indexTCO,x,y].texte:=s; tco[indexTCO,x,y].TailleFonte:=8; tco[indexTCO,x,y].FontStyle:='G'; end; - if act=2 then + AcAffSC : begin if s='' then s:='SC'; tco[indexTCO,x,y].texte:=s; tco[indexTCO,x,y].TailleFonte:=8; tco[indexTCO,x,y].FontStyle:='G'; + tco[indextco,x,y].repr:=5; end; - if act=3 then + AcAffCDM : begin if s='' then s:='CDM'; tco[indexTCO,x,y].texte:=s; tco[indexTCO,x,y].TailleFonte:=8; tco[indexTCO,x,y].FontStyle:='G'; + tco[indextco,x,y].repr:=5; // centré end; - if act=4 then + AcActSortie : begin if s='' then s:=intToSTR(tco[indexTCO,x,y].adresse); tco[indexTCO,x,y].texte:=s; tco[indexTCO,x,y].TailleFonte:=8; tco[indexTCO,x,y].FontStyle:='G'; end; - if act=5 then + AcStopTrains : begin if s='' then s:='STOP'; tco[indexTCO,x,y].texte:=s; tco[indexTCO,x,y].TailleFonte:=8; tco[indexTCO,x,y].FontStyle:='G'; end; + + AcMarche_Horloge : + begin + if s='' then s:='MA'+#13+'horl'; + tco[indexTCO,x,y].texte:=s; + tco[indexTCO,x,y].TailleFonte:=8; + tco[indexTCO,x,y].FontStyle:='G'; + end; + + AcArret_Horloge : + begin + if s='' then s:='AR'+#13+'horl'; + tco[indexTCO,x,y].texte:=s; + tco[indexTCO,x,y].TailleFonte:=8; + tco[indexTCO,x,y].FontStyle:='G'; + end; + + AcInit_Horloge : + begin + if s='' then s:='Init'+#13+'horl'; + tco[indexTCO,x,y].texte:=s; + tco[indexTCO,x,y].TailleFonte:=8; + tco[indexTCO,x,y].FontStyle:='G'; + end; + + AcAff_horloge : + begin + if s='' then s:='Aff'+#13+'horl'; + tco[indexTCO,x,y].texte:=s; + tco[indexTCO,x,y].TailleFonte:=8; + tco[indexTCO,x,y].FontStyle:='G'; + end; + end; + //tf:=(tco[indexTCO,x,y].TailleFonte*LargeurCell[indexTCO]) div 40; //tf:=(8*LargeurCell[indexTCO]) div 40;; @@ -5134,6 +5209,16 @@ begin //texte_reparti(s,indexTCO,x,y,tf); affiche_texte(indextco,x,y); end; + + // copier imagelist dans imagetemp2 + { formTCO[indexTCO].ImageListTCO.GetBitmap (0, formTCO[indexTCO].ImageTemp2.Picture.Bitmap); + + StretchBlt(pcanvasTCO[indexTCO].Handle,x0,y0,LargeurCell[indexTCO],hauteurCell[indexTCO], // destination avec mise à l'échelle + FormTCO[indexTCO].ImageTemp2.Canvas.Handle,0,0,24,24,srccopy); + + + formTCO[indexTCO].ImageTemp2.Picture.Bitmap.Modified:=true; + } end; // Element 24 @@ -6264,7 +6349,7 @@ var x0,y0,jx2,jy2,jx3,jy3,xc,yc,jx1,jy1,xf,yf,position,ep : integer; begin if testbit(ep,1) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; pen.color:=couleur; - moveto(xc,y0);lineto(xc,yc); + moveto(xc,y0);lineto(xc,yc); if testbit(ep,5) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; lineto(xc,yf); end; @@ -6286,7 +6371,7 @@ var x0,y0,jx2,jy2,jx3,jy3,xc,yc,jx1,jy1,xf,yf,position,ep : integer; begin pen.color:=couleur; if testbit(ep,1) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; - moveto(xc,y0);lineto(xc,yc); + moveto(xc,y0);lineto(xc,yc); if testbit(ep,4) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; lineTo(xf,yf); end; @@ -6309,21 +6394,28 @@ begin Pen.Width:=1; Brush.Color:=fond; Pen.Color:=Fond;; - //r:=Rect(x0,y0,xf,yf); - //FillRect(r); // efface la cellule - Pen.Width:=epaisseur; Brush.Color:=clVoies[indexTCO]; Pen.Color:=clVoies[indexTCO]; Pen.Mode:=pmCopy; - if (position=const_Devie) or (position=const_inconnu) then + if mode>0 then begin - trajet_devie; // affiche la position de la branche déviée - end; + if (position=const_Devie) or (position=const_inconnu) then + begin + trajet_droit; + trajet_devie; // affiche la position de la branche déviée + end; - if (position=const_droit) or (position=const_inconnu) then + if (position=const_droit) then + begin + trajet_devie; + trajet_droit; + end; + end + else begin + trajet_devie; trajet_droit; end; @@ -6346,7 +6438,7 @@ begin pen.color:=fond; Brush.Color:=fond; pen.Width:=1; - jx1:=xc+(Epaisseur div 2)+1; + jx1:=xc+(Epaisseur div 2); r:=rect(jx1,yc-3*epaisseur,jx1+Epaisseur,yf); FillRect(r); end; @@ -6503,7 +6595,7 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; begin if testbit(ep,0) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; pen.color:=couleur; - moveto(x0,y0);lineto(xc,yc); + moveto(x0,y0);lineto(xc,yc); if testbit(ep,4) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; lineto(xf,yf); end; @@ -6527,7 +6619,7 @@ var x0,y0,xc,yc,xf,yf,x1,x2,y1,y2,x3,y3,x4,y4,position,ep : integer; if testbit(ep,0) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; moveto(x0,y0);lineto(xc,yc); if testbit(ep,5) then pen.Width:=epaisseur div 2 else pen.Width:=epaisseur; - lineto(xc,yf); + lineto(xc,yf); end; end; @@ -6548,23 +6640,32 @@ begin Pen.Width:=1; Brush.Color:=fond; Pen.Color:=fond; - //r:=Rect(x0,y0,xf,yf); - //FillRect(r); // efface la cellule - Pen.Width:=epaisseur; Brush.Color:=clVoies[indexTCO]; Pen.Color:=clVoies[indexTCO]; Pen.Mode:=pmCopy; - if (position=const_Devie) or (position=const_inconnu) then + if mode>0 then begin - trajet_devie; // affiche la position de la branche déviée - end; + if (position=const_Devie) or (position=const_inconnu) then + begin + trajet_droit; + trajet_devie; // affiche la position de la branche déviée + end; + + if (position=const_droit) then + begin + trajet_devie; + trajet_droit; + end; + end + + else - if (position=const_droit) or (position=const_inconnu) then begin + trajet_devie; trajet_droit; - end; + end; if (position=const_Devie) then begin @@ -6787,9 +6888,6 @@ begin Pen.Width:=1; Brush.Color:=fond; Pen.Color:=fond; - //r:=Rect(x0,y0,xf,yf); - //FillRect(r); // efface la cellule - Pen.Width:=epaisseur; Brush.Color:=clVoies[indexTCO]; Pen.Color:=clVoies[indexTCO]; @@ -6817,12 +6915,12 @@ begin if (position=const_Devie) then begin - // effacement du morceau + // effacement du morceau pen.color:=fond; Brush.Color:=fond; pen.width:=1; - x1:=xc-2*epaisseur-5;y1:=yc+(epaisseur div 2)+1; - x2:=xc+epaisseur+10;y2:=y1+epaisseur; + x1:=xc-round(1.5*epaisseur);y1:=yc-(epaisseur)+1; + x2:=xc-(epaisseur div 2);y2:=y1+4*epaisseur; r:=rect(x1,y1,x2,y2); rectangle(r); end; @@ -6833,10 +6931,10 @@ begin pen.color:=fond; Brush.Color:=fond; pen.width:=1; - x1:=xc-(epaisseur div 2)+1;y1:=yc-(epaisseur div 2)-1; - x2:=x1-epaisseur-1; - x3:=x2-epaisseur;y3:=yc+(epaisseur div 2)+1; - x4:=x1-epaisseur-1; + x1:=xc+round(0.9*epaisseur);y1:=yc; + x2:=x1+round(1.0*epaisseur); + x3:=xc-round(0.5*epaisseur);y3:=y1+round(2.2*epaisseur); + x4:=x3-round(0.9*epaisseur); polygon([point(x1,y1),point(x2,y1),point(x3,y3),point(x4,y3)]); end; end; @@ -7291,21 +7389,28 @@ begin Pen.Width:=1; Brush.Color:=fond; Pen.Color:=fond; - //r:=Rect(x0,y0,xf,yf); - //FillRect(r); // efface la cellule - Pen.Width:=epaisseur; Brush.Color:=clVoies[indexTCO]; Pen.Color:=clVoies[indexTCO]; Pen.Mode:=pmCopy; - if (position=const_Devie) or (position=const_inconnu) then + if mode>0 then begin - trajet_devie; // affiche la position de la branche déviée - end; + if (position=const_Devie) or (position=const_inconnu) then + begin + trajet_droit; + trajet_devie; // affiche la position de la branche déviée + end; - if (position=const_droit) or (position=const_inconnu) then + if (position=const_droit) then + begin + trajet_devie; + trajet_droit; + end; + end + else begin + trajet_devie; trajet_droit; end; @@ -8383,6 +8488,11 @@ var i,index,repr,Xorg,Yorg,xt,yt,mode,adresse,Bimage,aspect,oriente,pied,AdrTr : s : string; begin if indexTCO=0 then exit; + if indexTCO>nbreTCO then + begin + Affiche('Erreur 269',clred); + exit; + end; if PcanvasTCO[indexTCO]=nil then exit; if tco[indextco,x,y].BImage=0 then exit; //Affiche('Affiche_cellule',clLime); @@ -8437,10 +8547,10 @@ begin Font.Style:=style(tco[indextco,x,y].FontStyle); xt:=0;yt:=0; if Bimage=2 then begin xt:=LargeurCell[indexTCO] div 2;yt:=1;end; - if Bimage=3 then begin xt:=3;yt:=hauteurCell[indexTCO]-round(20*fryGlob[indexTCO]);end; + if Bimage=3 then begin xt:=3;yt:=hauteurCell[indexTCO]-round(18*fryGlob[indexTCO]);end; if Bimage=4 then begin xt:=3;yt:=1;end; - if Bimage=5 then begin xt:=3;yt:=hauteurCell[indexTCO]-round(20*fryGlob[indexTCO]);end; - if Bimage=12 then begin xt:=1;yt:=hauteurCell[indexTCO]-round(15*fryGlob[indexTCO]);end; + if Bimage=5 then begin xt:=3;yt:=hauteurCell[indexTCO]-round(18*fryGlob[indexTCO]);end; + if Bimage=12 then begin xt:=3;yt:=hauteurCell[indexTCO]-round(18*fryGlob[indexTCO]);end; if Bimage=13 then begin xt:=LargeurCell[indexTCO]-round(30*frxGlob[indexTCO]);yt:=hauteurCell[indexTCO]-round(15*fryGlob[indexTCO]);end; if Bimage=14 then begin xt:=LargeurCell[indexTCO]-round(30*frxGlob[indexTCO]);yt:=1;end; if Bimage=15 then begin xt:=3;yt:=1;end; @@ -8449,12 +8559,12 @@ begin if Bimage=23 then begin xt:=round(33*frxGlob[indexTCO]);yt:=round(35*fryGlob[indexTCO]);end; if Bimage=24 then begin xt:=LargeurCell[indexTCO]-round(20*frxGlob[indexTCO]);yt:=hauteurCell[indexTCO]-round(15*fryGlob[indexTCO]);end; if Bimage=25 then begin xt:=round(34*frxGlob[indexTCO]);yt:=round(8*fryGlob[indexTCO]);end; - if Bimage=26 then begin xt:=1;yt:=hauteurCell[indexTCO]-round(15*fryGlob[indexTCO]);end; - if Bimage=27 then begin xt:=1;yt:=1;end; - if Bimage=28 then begin xt:=1;yt:=1;end; + if Bimage=26 then begin xt:=3;yt:=hauteurCell[indexTCO]-round(15*fryGlob[indexTCO]);end; + if Bimage=27 then begin xt:=3;yt:=1;end; + if Bimage=28 then begin xt:=3;yt:=1;end; if Bimage=29 then begin xt:=LargeurCell[indexTCO] div 2;yt:=1;end; - if Bimage=32 then begin xt:=1;yt:=1;end; - if Bimage=33 then begin xt:=1;yt:=hauteurCell[indexTCO]-round(15*fryGlob[indexTCO]);end; + if Bimage=32 then begin xt:=3;yt:=1;end; + if Bimage=33 then begin xt:=3;yt:=hauteurCell[indexTCO]-round(15*fryGlob[indexTCO]);end; if Bimage=34 then begin xt:=LargeurCell[indexTCO]-round(30*frxGlob[indexTCO]);yt:=hauteurCell[indexTCO]-round(15*fryGlob[indexTCO]);end; TextOut(xOrg+xt,yOrg+yt,s); end; @@ -8727,6 +8837,11 @@ var x,y,x1,y1,DimX,DimY : integer; r : Trect; begin if affevt then affiche('Affiche_tco',clLime); + if indexTCO>nbreTCO then + begin + Affiche('Erreur 267',clred); + exit; + end; if pImageTCO[indexTCO]=nil then exit; DimX:=LargeurCell[indexTCO]*NbreCellX[indexTCO]; DimY:=hauteurCell[indexTCO]*NbreCellY[indexTCO]; @@ -11853,28 +11968,41 @@ begin i:=tco[indextco,xclic,yclic].piedfeu; n:=tco[indextco,xclic,yclic].feuoriente; //Affiche('Clic bouton action i='+intToSTR(i)+' n='+intToSTR(n),clYellow); - if i=1 then Affiche_fenetre_TCO(n,true); // affiche le TCO n°n - if i=2 then with formprinc do // afficher signaux complexes + case i of + AcChangeTCO : Affiche_fenetre_TCO(n,true); // affiche le TCO n°n + AcAffSC : with formprinc do // afficher signaux complexes begin windowState:=wsNormal; //Maximized; show; BringToFront; end; - if (i=3) and (CDMhd<>0) then - begin // afficher CDM rail - ShowWindow(CDMhd,SW_MAXIMIZE); - SetForegroundWindow(CDMhd); // met CDM en premier plan - SetActiveWindow(CdmHd); + AcAffCDM : + begin + if CDMhd<>0 then + begin // afficher CDM rail + ShowWindow(CDMhd,SW_MAXIMIZE); + SetForegroundWindow(CDMhd); // met CDM en premier plan + SetActiveWindow(CdmHd); + end; end; - if i=4 then // action accessoire + AcActSortie : // action accessoire begin // pilotage impulsionnel pilote_acc(tco[indextco,xclic,yclic].Adresse,tco[indextco,xclic,yclic].sortie,AigP); end; - if i=5 then + AcStopTrains : begin stop_trains; end; + AcMarche_Horloge : Demarre_horloge; + AcArret_horloge : horloge:=false; + AcInit_horloge : + begin + Init_Horloge; + end; + AcAff_horloge : affiche_horloge; + + end; end; TempoSouris:=2 ; // démarre la tempo souris @@ -12409,6 +12537,11 @@ end; procedure Maj_TCO(indexTCO,Adresse : integer); var x,y: integer; begin + if indexTCO>nbreTCO then + begin + Affiche('Erreur 268',clred); + exit; + end; if PcanvasTCO[indexTCO]=nil then exit; for y:=1 to NbreCellY[indexTCO] do @@ -12608,7 +12741,7 @@ begin c:=c.GetParentComponent; // scrollBox c:=c.GetParentComponent; // formTCO indexTCO:=index_tco(c); - tourne90G(indextco); + tourne90G(indextco); end; procedure tourne90D(indexTCO : integer); @@ -13647,21 +13780,29 @@ begin LineTo( round((x+LargeurCell[indexTCO])),round(y+hauteurCell[indexTCO]*ratioC/10) ); end; Affiche(formatfloat('0.000000',frxGlob[indexTCO]),clyellow); + dessin_Action(1,PcanvasTCO[1],3,3,1); end; procedure change_couleur_fond(indexTCO : integer); var cs : string; x,y,xmini,ymini,xmaxi,ymaxi : integer; - modeselection : boolean; begin xmini:=XminiSel; ymini:=YminiSel; xmaxi:=XmaxiSel; ymaxi:=YmaxiSel; - modeSelection:=xmini0 then + begin + id:=index_Signal(AdrSignal); + a:=Signaux[id].EtatSignal; + // si signal n'est pas rouge, ok + rouge:=(a=semaphore_F) or (a=carre_F) and (a=violet_F); + if rouge then + begin + Affiche('Le signal '+intToSTR(AdrSignal)+' étant rouge, le train '+train+' @'+intToSTR(AdrTrain)+' ne démarre pas',clyellow); + result:=false; + exit; + end; + end; + end; + + vitesse:=trains[indexTrain].VitNominale; + if roulage then + begin + // trouver le train dans le tableau de placement des trains + indexPlace:=1; + trouve:=false; + while (indexPlace<6) and not(trouve)do + begin + trouve:=placement[indexPlace].train=train; + inc(indexPlace); + end; + if not(trouve) then + begin + Affiche('Erreur 280 : Train '+train+' non trouvé en placement',clred); + result:=false; + exit; + end; + dec(indexPlace); + if (placement[indexPlace].inverse) then vitesse:=-vitesse; + end; + + if horloge then + begin + // trouver le train dans la grille horaire + i:=1; + trouve:=false; + while (i0 then s:=s+' depuis détecteur '+intToSTR(Det); + Affiche(s,clYellow); + if traceListe then AfficheDebug(s,clyellow); + if roulage then reserve_canton(Det,placement[indexPlace].detdir,adrtrain,0,nCantonsRes); +end; + + +procedure TFormPlace.ButtonLanceRoutageClick(Sender: TObject); +var vitesse,a,i,j,id,adrDet,AdrTrain : integer; + trouve,demarre : boolean; var s: string; begin if cdm_connecte then begin - Affiche('Placement des trains incompatible en mode CDM rail',clOrange); + Affiche('Le placement des trains incompatible en mode CDM rail',clOrange); exit; end; + + trouve:=false; // explorer les détecteurs pour lancer les trains si le détecteur est affecté à un train for i:=1 to NDetecteurs do begin adrDet:=Adresse_detecteur[i]; + AdrTrain:=detecteur[AdrDet].AdrTrain; + j:=index_train_adresse(AdrTrain); + if Detecteur[adrDet].etat and (detecteur[adrDet].train<>'') then begin - rouge:=false; trouve:=true; roulage:=true; avecResa:=false; // pour adrTrain ou NumTrain - AdrTrain:=detecteur[AdrDet].AdrTrain; - AdrSignal:=signal_detecteur(AdrDet); // trouve l'adresse du signal correspondant au détecteur - // si il y a un signal sur le détecteur de démarrage du train est il au rouge? - if AdrSignal<>0 then - begin - id:=index_Signal(AdrSignal); - a:=Signaux[id].EtatSignal; - if ((a=semaphore_F) or (a=carre_F) or (a=violet_F)) then rouge:=true; - end; - if not(rouge) then - begin - j:=index_train_adresse(AdrTrain); - vitesse_loco('',adrTrain,j,trains[j].VitNominale,not(placement[j].inverse),true); + trains[j].roulage:=true; - Maj_Signaux(true); // avec détecteurs - s:='Lancement du train '+detecteur[adrDet].train+' depuis détecteur '+intToSTR(adrDet); - Affiche(s,clYellow); - if traceListe then AfficheDebug(s,clyellow); - reserve_canton(AdrDet,placement[j].detdir,adrtrain,0,nCantonsRes); - - end - Else Affiche('Le signal '+intToSTR(AdrSignal)+' étant rouge, le train '+detecteur[adrDet].train+' @'+intToSTR(AdrTrain)+' ne démarre pas',clyellow); - end; + demarre:=demarre_index_train(j); + end + else + trains[j].roulage:=false; end; // au moins un train démarre @@ -437,7 +513,7 @@ begin Affiche('Arrêt du roulage de tous les trains',clorange); Formprinc.LabelTitre.caption:=titre+' '; for i:=1 to ntrains do - vitesse_loco('',i,trains[i].adresse,0,true,true); + vitesse_loco('',i,trains[i].adresse,0,true); end; procedure TFormPlace.CheckInverse1Click(Sender: TObject); @@ -591,7 +667,7 @@ begin Affiche('Arrêt du roulage de tous les trains et libération des aiguillages',clorange); Formprinc.LabelTitre.caption:=titre+' '; for i:=1 to ntrains do - vitesse_loco('',i,trains[i].adresse,0,true,true); + vitesse_loco('',i,trains[i].adresse,0,true); raz_tout; end; diff --git a/verif_version.dfm b/verif_version.dfm index 8883191..4bfcb63 100644 --- a/verif_version.dfm +++ b/verif_version.dfm @@ -30,7 +30,4 @@ object FormVersion: TFormVersion ParentFont = False TabOrder = 0 end - object TimerVerif: TTimer - OnTimer = TimerVerifTimer - end end diff --git a/verif_version.pas b/verif_version.pas index 2ae4b99..8a8c990 100644 --- a/verif_version.pas +++ b/verif_version.pas @@ -10,7 +10,6 @@ uses type TFormVersion = class(TForm) - TimerVerif: TTimer; Memo1: TMemo; procedure FormCreate(Sender: TObject); procedure TimerVerifTimer(Sender: TObject); @@ -27,7 +26,7 @@ var chemin_Dest,chemin_src,date_creation,nombre_tel : string; f : text; -Const Version='8.53'; // sert à la comparaison de la version publiée +Const VersionSC ='8.6'; // 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; @@ -149,7 +148,7 @@ end; // dézipe copie les fichiers et lance la nouvelle version // s : chemin et fichier à déziper -procedure dezipe_copie(s : string); +procedure dezipe_copie_lance(s : string); var fichier,nomPDF : string; dirList : tStrings; SR : TSearchRec; @@ -189,82 +188,17 @@ begin exit; end; - // remplit dirlist avec les noms de fichiers du chemin dest - nombre:=0; - DirList:=TStringList.Create; - if FindFirst(chemin_dest+ '*.*', faAnyFile, SR) = 0 then - begin - repeat - s:=sr.Name; - if (s<>'.') and (s<>'..') then - begin - DirList.Add(SR.Name); //Fill the list - inc(nombre); - end; - until FindNext(SR) <> 0; - FindClose(SR); - end; - - // supprimer les fichiers versions.txt copie_sc.exe et pdf - nomPdf:=''; - for i:=0 to nombre-1 do - begin - s:=DirList.Strings[i]; - s:=lowercase(s); - pdf:=pos('.pdf',s)<>0; - if pdf then nomPDF:=s; - - //Affiche(s,clyellow); - // fichiers à supprimer dans répertoire destination - if (s='versions.txt') or pdf then - begin - fichier:=chemin_dest+s; - if sysutils.FileExists(fichier) then - begin - log('Suppression de '+fichier,clorange); - Attributes:=FileGetAttr(pchar(fichier)); - Attributes := Attributes and not (faReadOnly or faHidden); - SetFileAttributes(pchar(fichier),Attributes); - ok:=sysutils.DeleteFile(pchar(fichier)); - if not(OK) then log('Erreur : Pas réussi à supprimer '+fichier,clred); - end; - end; - end; - - // copie les fichiers du répertoire zip vers le rep installé - - copie_fichier('versions.txt'); - - // trouver du nom du pdf dans le chemin source - nombre:=0; - // remplit dirlist avec les noms de fichiers du chemin src - if FindFirst(chemin_src+ '*.*', faAnyFile, SR) = 0 then - begin - repeat - s:=sr.Name; - if (s<>'.') and (s<>'..') then - begin - DirList.Add(SR.Name); //Fill the list - if pos('.pdf',sr.Name)<>0 then NomPdf:=sr.name; - inc(nombre); - end; - until FindNext(SR) <> 0; - FindClose(SR); - end; - DirList.Destroy; - - if nomPdf<>'' then copie_fichier(nomPdf); - + // Lancer le fichier installeur.exe du dossier décomprimé // lancer copie_sc.exe qui copie les exe et crée les raccourcis et lance SC chdir(chemin_src); - s:='"'+chemin_dest+'" "'+chemin_src+'"'; - log('exécution de copie_sc.exe '+s,clyellow); + //s:='"'+chemin_dest+'" "'+chemin_src+'"'; + //log('exécution de copie_sc.exe '+s,clyellow); close(f); - Affiche('Lancement de la nouvelle version',clyellow); + Affiche('Installation de la nouvelle version',clyellow); Sleep(2000); i:=ShellExecute(Formprinc.Handle,'open', - Pchar('copie_sc.exe'), - Pchar(s), // paramètre + Pchar('installeur.exe'), + Pchar(''), // paramètre PChar('') // répertoire ,SW_SHOWNORMAL); if i>32 then @@ -427,7 +361,7 @@ begin // changer le . en , s:=Version_p; // i:=pos('.',s);if i<>0 then s[i]:=','; - s2:=version; + s2:=versionSC; // i:=pos('.',s2);if i<>0 then s2[i]:=','; s:=AnsiUppercase(s); @@ -435,9 +369,18 @@ begin SV_publie:=s[l]; if Sv_publie in ['0'..'9'] then Sv_Publie:=' ' else begin s:=copy(s,1,l-1);Version_P:=s;end; val(s,V_publie,erreur); - if erreur<>0 then exit; + if erreur<>0 then + begin + Affiche('Erreur 701',clred); + exit; + end; val(s2,V_utile,erreur); - if erreur<>0 then exit; + if erreur<>0 then + begin + Affiche('Erreur 702',clred); + exit; + end; + // if (V_utile700000 then begin - dezipe_copie(s); // dézipe et lance et termine le programme. + dezipe_copie_lance(s); // dézipe et lance et termine le programme. end else Aff('Echec 2 de téléchargement - taille invalide'); end @@ -507,11 +450,25 @@ end; procedure TFormVersion.FormCreate(Sender: TObject); +var V_utile,V_publie : real; + erreur: integer; + s : string; begin if debug=1 then Affiche('Création fenêtre version',clLime); - Timerverif.Interval:=1000; // timer à 1 seconde - Lance_verif:=2; // lancer la vérification de version dans 3s if debug=1 then Affiche('Fin création fenêtre version',clLime); + + if not(AvecInit) then exit; + if not(verifVersion) then exit; + if debug=1 then Affiche('Vérification version en ligne',clLime); + V_publie:=verifie_version; + if notificationVersion and (v_publie>0) then + begin + val(version,V_utile,erreur); + str(v_publie:2:2,s); + if V_utile=V_publie then Affiche('Votre version '+Version+SousVersion+' est à jour',clLime); + if V_utile>V_publie then Affiche('Votre version '+version+SousVersion+' est plus récente que la version publiée '+s,clLime); + end; + end; procedure TFormVersion.TimerVerifTimer(Sender: TObject); @@ -522,7 +479,6 @@ begin if lance_verif>0 then dec(lance_verif); if lance_verif=0 then begin - timerVerif.Enabled:=false; if not(AvecInit) then exit; if not(verifVersion) then exit; if debug=1 then Affiche('Vérification version en ligne',clLime); diff --git a/versions.txt b/versions.txt index 6bf2596..f53f20e 100644 --- a/versions.txt +++ b/versions.txt @@ -244,10 +244,9 @@ version 8.51 : Am version 8.52 : Amélioration de l'installeur automatique. version 8.53 : Prise en compte des actionneurs dans le simulateur. Correction d'un bug sur l'affichage des TCO en mode exploitation. - - - - - +version 8.54 : Ajout du choix de pilotage des trains par CDM par adresse ou par nom. +version 8.6 : Gestion des démarrages des trains sur horaire, en fonction d'une horloge paramétrable. + Amélioration de l'importation du réseau depuis CDM Rail. + Création d'actionneurs "horloge" et "vitesse train".