diff --git a/Notice avancée pour les signaux complexes GL.pdf b/Notice avancée pour les signaux complexes GL.pdf index 1243a70..4ef8cf0 100644 Binary files a/Notice avancée pour les signaux complexes GL.pdf and b/Notice avancée pour les signaux complexes GL.pdf differ diff --git a/Notice d'utilisation des signaux_complexes_GL_V4.72.pdf b/Notice d'utilisation des signaux_complexes_GL_V4.73.pdf similarity index 78% rename from Notice d'utilisation des signaux_complexes_GL_V4.72.pdf rename to Notice d'utilisation des signaux_complexes_GL_V4.73.pdf index 88187fb..b8839d9 100644 Binary files a/Notice d'utilisation des signaux_complexes_GL_V4.72.pdf and b/Notice d'utilisation des signaux_complexes_GL_V4.73.pdf differ diff --git a/Signaux_complexes_GL.cfg b/Signaux_complexes_GL.cfg index acb7715..69e7fa7 100644 --- a/Signaux_complexes_GL.cfg +++ b/Signaux_complexes_GL.cfg @@ -14,8 +14,8 @@ -$N+ -$O+ -$P+ --$Q+ --$R+ +-$Q- +-$R- -$S- -$T- -$U- diff --git a/Signaux_complexes_GL.dof b/Signaux_complexes_GL.dof index d5ff374..5573344 100644 --- a/Signaux_complexes_GL.dof +++ b/Signaux_complexes_GL.dof @@ -17,8 +17,8 @@ M=0 N=1 O=1 P=1 -Q=1 -R=1 +Q=0 +R=0 S=0 T=0 U=0 diff --git a/UnitConfig.dcu b/UnitConfig.dcu index 06d25bc..a2b6a55 100644 Binary files a/UnitConfig.dcu and b/UnitConfig.dcu differ diff --git a/UnitConfig.dfm b/UnitConfig.dfm index 5e48d27..1206cd4 100644 --- a/UnitConfig.dfm +++ b/UnitConfig.dfm @@ -1580,7 +1580,7 @@ object FormConfig: TFormConfig Top = 8 Width = 633 Height = 497 - ActivePage = TabSheetCDM + ActivePage = TabSheetSig Font.Charset = DEFAULT_CHARSET Font.Color = clBlack Font.Height = -11 @@ -1593,7 +1593,7 @@ object FormConfig: TFormConfig Caption = 'CDM Rail' object Label36: TLabel Left = 24 - Top = 432 + Top = 440 Width = 369 Height = 13 Caption = @@ -1645,9 +1645,16 @@ object FormConfig: TFormConfig Left = 16 Top = 96 Width = 273 - Height = 169 + Height = 193 Caption = 'Au d'#233'marrage de Signaux_Complexes ' TabOrder = 1 + object Label13: TLabel + Left = 8 + Top = 144 + Width = 242 + Height = 13 + Caption = 'Nom du fichier LAY '#224' utiliser au d'#233'marrage de CDM' + end object CheckVerifVersion: TCheckBox Left = 8 Top = 48 @@ -1666,7 +1673,7 @@ object FormConfig: TFormConfig end object CheckLanceCDM: TCheckBox Left = 8 - Top = 136 + Top = 120 Width = 241 Height = 25 Caption = 'Lancer et connecter CDM Rail au d'#233'marrage' @@ -1675,7 +1682,7 @@ object FormConfig: TFormConfig end object CheckAvecTCO: TCheckBox Left = 8 - Top = 96 + Top = 80 Width = 89 Height = 17 Hint = 'Affiche le TCO au d'#233'marrage' @@ -1697,7 +1704,7 @@ object FormConfig: TFormConfig end object CheckBandeauTCO: TCheckBox Left = 8 - Top = 112 + Top = 96 Width = 129 Height = 17 Hint = 'Masque le bandeau de param'#233'trage du TCO au d'#233'marrage' @@ -1706,6 +1713,17 @@ object FormConfig: TFormConfig ShowHint = True TabOrder = 5 end + object EditLAY: TEdit + Left = 8 + Top = 160 + Width = 249 + Height = 21 + Hint = 'Nom du LAY avec .lay' + ParentShowHint = False + ShowHint = True + TabOrder = 6 + Text = 'Nom du fichier LAY avec .lay' + end end object GroupBox6: TGroupBox Left = 312 @@ -1845,7 +1863,7 @@ object FormConfig: TFormConfig end object GroupBox8: TGroupBox Left = 16 - Top = 272 + Top = 296 Width = 273 Height = 137 Caption = 'Services CommIP CDM Rail' @@ -2986,7 +3004,7 @@ object FormConfig: TFormConfig Width = 129 Height = 21 Style = csDropDownList - ItemHeight = 0 + ItemHeight = 13 TabOrder = 1 OnChange = ComboBoxDecChange end @@ -3230,9 +3248,9 @@ object FormConfig: TFormConfig end object GroupBox13: TGroupBox Left = 352 - Top = 40 + Top = 32 Width = 257 - Height = 433 + Height = 441 Caption = 'Description de l'#39'action' TabOrder = 0 object Label40: TLabel @@ -3248,22 +3266,22 @@ object FormConfig: TFormConfig object GroupBoxPN: TGroupBox Left = 8 Top = 16 - Width = 225 - Height = 345 + Width = 233 + Height = 353 Caption = 'Action gestion passage '#224' niveau' ParentShowHint = False ShowHint = False TabOrder = 2 object Label21: TLabel Left = 8 - Top = 28 + Top = 20 Width = 100 Height = 13 Caption = 'Adresse de fermeture' end object Label22: TLabel Left = 8 - Top = 52 + Top = 44 Width = 94 Height = 13 Caption = 'Adresse d'#39'ouverture' @@ -3352,7 +3370,7 @@ object FormConfig: TFormConfig end object EditAdrFerme: TEdit Left = 120 - Top = 24 + Top = 16 Width = 41 Height = 21 TabOrder = 0 @@ -3360,7 +3378,7 @@ object FormConfig: TFormConfig end object EditAdrOuvre: TEdit Left = 120 - Top = 48 + Top = 40 Width = 41 Height = 21 TabOrder = 1 @@ -3368,17 +3386,23 @@ object FormConfig: TFormConfig end object EditCmdFerme: TEdit Left = 168 - Top = 24 + Top = 16 Width = 25 Height = 21 + Hint = 'Commande de fermeture (0 '#224' 2)' + ParentShowHint = False + ShowHint = True TabOrder = 2 OnChange = EditCmdFermeChange end object EditCdeOuvre: TEdit Left = 168 - Top = 48 + Top = 40 Width = 25 Height = 21 + Hint = 'Commande d'#39'ouverture (0 '#224' 2)' + ParentShowHint = False + ShowHint = True TabOrder = 3 OnChange = EditCdeOuvreChange end @@ -3608,10 +3632,48 @@ object FormConfig: TFormConfig TabOrder = 29 OnChange = EditZdet2V4OChange end + object Button1: TButton + Left = 200 + Top = 16 + Width = 27 + Height = 21 + Hint = 'Test de fermeture (mode CDM ou connect'#233' '#224' l'#39'interface)' + Caption = 'test' + ParentShowHint = False + ShowHint = True + TabOrder = 30 + OnClick = Button1Click + end + object Button3: TButton + Left = 200 + Top = 40 + Width = 27 + Height = 21 + Hint = 'Test d'#39'ouverture (mode CDM ou connect'#233' '#224' l'#39'interface)' + Caption = 'test' + ParentShowHint = False + ShowHint = True + TabOrder = 31 + OnClick = Button3Click + end + object CheckPnPulse: TCheckBox + Left = 8 + Top = 64 + Width = 97 + Height = 17 + Hint = + 'Sortie impulsionnelle ou continue (attention peut d'#233'truire les m' + + 'oteurs '#224' bobine)' + Caption = 'Impulsionnel' + ParentShowHint = False + ShowHint = True + TabOrder = 32 + OnClick = CheckPnPulseClick + end end object GroupBoxRadio: TGroupBox - Left = 32 - Top = 24 + Left = 16 + Top = 128 Width = 225 Height = 73 Caption = 'Type d'#39'action' @@ -3645,8 +3707,8 @@ object FormConfig: TFormConfig end end object GroupBoxAct: TGroupBox - Left = 24 - Top = 92 + Left = 8 + Top = 148 Width = 225 Height = 293 Caption = 'Action fonction de locomotive ' diff --git a/UnitConfig.pas b/UnitConfig.pas index 31d6be0..4e0cda9 100644 --- a/UnitConfig.pas +++ b/UnitConfig.pas @@ -281,6 +281,11 @@ type CheckBoxDemarUSB: TCheckBox; CheckBoxDemarEth: TCheckBox; Memo5: TMemo; + EditLAY: TEdit; + Label13: TLabel; + Button1: TButton; + Button3: TButton; + CheckPnPulse: TCheckBox; procedure ButtonAppliquerEtFermerClick(Sender: TObject); procedure FormActivate(Sender: TObject); procedure FormCreate(Sender: TObject); @@ -403,6 +408,9 @@ type procedure EditZdet2V4FChange(Sender: TObject); procedure EditZdet1V4OChange(Sender: TObject); procedure EditZdet2V4OChange(Sender: TObject); + procedure Button1Click(Sender: TObject); + procedure Button3Click(Sender: TObject); + procedure CheckPnPulseClick(Sender: TObject); private { Déclarations privées } public @@ -416,6 +424,7 @@ nb_det_dist_ch='nb_det_dist'; IpV4_PC_ch='IpV4_PC'; retro_ch='retro'; Init_aig_ch='Init_Aig'; +LAY_ch='Lay'; Init_dem_aig_ch='Init_Dem_Aig'; Init_dem_interfaceUSBCOM_ch='Init_demUSBCOM'; Init_dem_interfaceEth_ch='Init_demETH'; @@ -867,7 +876,7 @@ begin // feux directionnels begin NfeuxDir:=aspect-10; - for j:=1 to NfeuxDir+1 do + for j:=1 to NfeuxDir+1 do begin s:=s+'('; for k:=1 to Length(feux[i].AigDirection[j])-1 do @@ -1170,7 +1179,7 @@ begin begin NbVoies:=Tablo_PN[i].NbVoies; s:=''; - + // par actionneur if tablo_PN[i].Voie[1].ActFerme<>0 then begin @@ -1179,10 +1188,10 @@ begin s:=s+'('+intToSTR(tablo_PN[i].Voie[voie].ActFerme)+','+intToSTR(tablo_PN[i].Voie[voie].ActOuvre)+')'; if voie0 then + begin + // champ impulsion nouvelle syntaxe + if s[1]=',' then delete(s,1,1); + val(s,i,erreur); + Tablo_PN[NbrePN].Pulse:=i; + end; + end; if pos('PN',s)<>0 then i:=0; until (s='0'); @@ -2217,6 +2256,16 @@ begin LanceCDM:=i=1; end; + sa:=uppercase(LAY_ch)+'='; + i:=pos(sa,s); + if i=1 then + begin + inc(nv); + trouve_lay:=true; + delete(s,i,length(sa)); + lay:=s; + end; + sa:=uppercase(SERVEUR_INTERFACE_ch)+'='; i:=pos(sa,s); if i=1 then @@ -2317,6 +2366,7 @@ begin trouve_Tempo_maxi:=false; trouve_PROTOCOLE_SERIE:=false; trouve_TCO:=false; + trouve_LAY:=false; trouve_Serveur_interface:=false; trouve_cdm:=false; trouve_NOTIF_VERSION:=false; @@ -2391,6 +2441,7 @@ begin if not(trouve_INTER_CAR) then s:=INTER_CAR_ch; if not(trouve_Tempo_maxi) then s:=Tempo_maxi_ch; if not(trouve_Entete) then s:=Entete_ch; + if not(trouve_LAY) then s:=s+LAY_ch; if not(trouve_TCO) then s:=TCO_ch; if not(trouve_CDM) then s:=CDM_ch; if not(trouve_Serveur_interface) then s:=Serveur_interface_ch; @@ -2548,7 +2599,7 @@ begin AvecTCO:=CheckAvecTCO.checked; MasqueBandeauTCO:=CheckBandeauTCO.checked; - + lay:=editLay.Text; if RadioButton4.Checked then ServeurInterfaceCDM:=0; if RadioButton5.Checked then ServeurInterfaceCDM:=1; if RadioButton6.Checked then ServeurInterfaceCDM:=2; @@ -2646,7 +2697,7 @@ begin Aig_supprime.Adresse:=0; Feu_Supprime.Adresse:=0; Feu_sauve.adresse:=0; - + clicListe:=false; Edit_HG.Visible:=false; labelHG.Visible:=false; @@ -2704,6 +2755,7 @@ begin CheckLanceCDM.Checked:=LanceCDM; CheckAvecTCO.checked:=avecTCO; CheckBandeauTCO.Checked:=MasqueBandeauTCO; + editLAY.Text:=lay; RadioButton4.Checked:=ServeurInterfaceCDM=0; RadioButton5.Checked:=ServeurInterfaceCDM=1; RadioButton6.Checked:=ServeurInterfaceCDM=2; @@ -3279,7 +3331,7 @@ begin ButtonConfigSR.Visible:=true else ButtonConfigSR.Visible:=false; if feux[i].decodeur=6 then - begin + begin EditSpecUni.Visible:=true;LabelUni.Visible:=true; EditSpecUni.Text:=IntToSTR(feux[i].Unisemaf); end @@ -3571,10 +3623,10 @@ begin begin EditAdrFerme.text:=IntToSTR(Tablo_PN[i].AdresseFerme); EditAdrOuvre.text:=IntToSTR(Tablo_PN[i].AdresseOuvre); - if Tablo_PN[i].CommandeFerme=2 then s:='+' else s:='-'; - EditCmdFerme.text:=s; - if Tablo_PN[i].CommandeOuvre=2 then s:='+' else s:='-'; - EditCdeOuvre.text:=s; + EditCmdFerme.text:=intToSTR(Tablo_PN[i].CommandeFerme); + EditCdeOuvre.text:=intToSTR(Tablo_PN[i].CommandeOuvre); + if Tablo_PN[i].Pulse=1 then trouve:=true else trouve:=false; + CheckPnPulse.Checked:=trouve; // par actionneur if Tablo_PN[i].voie[1].ActFerme<>0 then @@ -4858,7 +4910,7 @@ begin RichSig.Lines[ligneClicSig]:=s; Maj_Hint_feu(ligneClicSig+1); end; -end; +end; procedure TFormConfig.EditAdrAigChange(Sender: TObject); @@ -5026,7 +5078,7 @@ begin Feux[index].Img.picture.Bitmap:=Select_dessin_feu(feux[index].aspect); dessine_feu_mx(Feux[index].Img.Canvas,0,0,1,1,feux[index].adresse,1); // dessine les feux du signal clicListe:=false; - end; + end; end; procedure TFormConfig.RadioButtonLocClick(Sender: TObject); @@ -5139,21 +5191,21 @@ begin EditZdet1V3O.text:='';EditZdet2V3O.text:=''; EditZdet1V4F.text:='';EditZdet2V4F.text:=''; EditZdet1V4O.text:='';EditZdet2V4O.text:=''; - + editAdrFerme.Text:='';EditCmdFerme.text:=''; editAdrOuvre.Text:='';EditCdeOuvre.text:=''; // désactive la sélection des actionneurs RE_ColorLine(Formconfig.RichAct,ligneclicAct,ClAqua); ligneclicAct:=-1; - + with RichPN do begin i:=Selstart; ligne:=Perform(EM_LINEFROMCHAR,i,0); // numéro de la lignée cliquée if ligne-1 then RE_ColorLine(RichPN,AncligneCliqueePN,ClAqua); + if AncLigneCliqueePN<>-1 then RE_ColorLine(RichPN,AncligneCliqueePN,ClAqua); AncLigneCliqueePN:=Ligne; ligneCliqueePN:=ligne; RE_ColorLine(RichPN,LigneCliqueePN,ClYellow); @@ -5192,7 +5244,7 @@ end; procedure TFormConfig.EditCmdFermeChange(Sender: TObject); var s : string; - act : integer; + i,erreur : integer; begin if clicliste then exit; if affevt then affiche('Evt EditCmdFerme Change',clyellow); @@ -5200,6 +5252,7 @@ begin with Formconfig do begin s:=EditCmdFerme.Text; + { if (s='+') or (s='-') then begin if s='-' then act:=1 else act:=2; @@ -5208,8 +5261,13 @@ begin s:=encode_act_PN(lignecliqueePN+1); RichPN.Lines[lignecliqueePN]:=s; end - else - LabelInfo.caption:='Erreur Commande ferme actionneur';exit + } + val(s,i,erreur); + if (i<0) or (i>2) or (erreur<>0) then begin LabelInfo.caption:='Erreur Commande ferme actionneur';exit;end; + LabelInfo.caption:=' '; + tablo_PN[lignecliqueePN+1].CommandeFerme:=i; + s:=encode_act_PN(lignecliqueePN+1); + RichPN.Lines[lignecliqueePN]:=s; end; end; @@ -5221,7 +5279,7 @@ begin if affevt then affiche('Evt EditAdrOuvre Change',clyellow); if FormConfig.PageControl.ActivePage=FormConfig.TabSheetAct then with Formconfig do - begin + begin s:=EditAdrOuvre.Text; Val(s,act,erreur); if erreur<>0 then @@ -5236,15 +5294,21 @@ end; procedure TFormConfig.EditCdeOuvreChange(Sender: TObject); var s : string; - act : integer; + i,erreur : integer; begin if clicliste then exit; if affevt then affiche('Evt EditCmdOuvre Change',clyellow); if FormConfig.PageControl.ActivePage=FormConfig.TabSheetAct then with Formconfig do - begin + begin s:=EditCdeOuvre.Text; - if (s='+') or (s='-') then + val(s,i,erreur); + if (i<0) or (i>2) or (erreur<>0) then begin LabelInfo.caption:='Erreur Commande ferme actionneur';exit;end; + LabelInfo.caption:=' '; + tablo_PN[lignecliqueePN+1].CommandeOuvre:=i; + s:=encode_act_PN(lignecliqueePN+1); + RichPN.Lines[lignecliqueePN]:=s; + {if (s='+') or (s='-') then begin if s='-' then act:=1 else act:=2; LabelInfo.caption:=' '; @@ -5252,8 +5316,9 @@ begin s:=encode_act_PN(lignecliqueePN+1); RichPN.Lines[lignecliqueePN]:=s; end - else - LabelInfo.caption:='Erreur Commande ouvre actionneur';exit + else + LabelInfo.caption:='Erreur Commande ouvre actionneur';exit } + end; end; @@ -5289,7 +5354,7 @@ begin if affevt then affiche('Evt EditV1O Change',clyellow); if FormConfig.PageControl.ActivePage=FormConfig.TabSheetAct then with Formconfig do - begin + begin s:=EditV1O.Text; Val(s,act,erreur); if erreur<>0 then @@ -5311,7 +5376,7 @@ begin if affevt then affiche('Evt EditV2F Change',clyellow); if FormConfig.PageControl.ActivePage=FormConfig.TabSheetAct then with Formconfig do - begin + begin s:=EditV2F.Text; Val(s,act,erreur); if (erreur<>0) and (s<>'') then @@ -5489,13 +5554,14 @@ begin EditZdet1V3O.text:='';EditZdet2V3O.text:=''; EditZdet1V4F.text:='';EditZdet2V4F.text:=''; EditZdet1V4O.text:='';EditZdet2V4O.text:=''; - + GroupBoxRadio.Visible:=false; LabelInfo.caption:=''; LigneCliqueePN:=i-1; AncLigneCliqueePN:=LigneCliqueePN; + tablo_PN[lignecliqueePN+1].Pulse:=1; Aff_champs_PN(nbrePN-1); - clicliste:=false; + clicliste:=false; config_modifie:=true; end; @@ -5553,27 +5619,28 @@ begin pn:=false; adr:=tablo_PN[index].voie[1].ActFerme; ac:=adr<>0 ; // type actionneur - if adr=0 then + if adr=0 then begin adr:=tablo_PN[index].voie[1].DetZ1F; pn:=adr<>0; - end; - + end; + if not(ac) and not(pn) then ac:=true; + if ac then s:='Voulez-vous supprimer l''actionneur '+IntToSTR(adr)+'?'; if pn then s:='Voulez-vous supprimer l''actionneur de zone '+IntToSTR(adr)+'-'+inttostr(tablo_PN[index].voie[1].DetZ1O)+'?'; if Application.MessageBox(pchar(s),pchar('confirm'), MB_YESNO or MB_DEFBUTTON2 or MB_ICONQUESTION)=idNo then exit; Affiche('Suppression de l''actionneur index='+IntToSTR(index)+' adresse='+IntToSTR(adr),clOrange); - + clicliste:=true; - + // supprime l'actionneur du tableau dec(nbrePN); for i:=index to nbrePN do begin tablo_PN[i]:=tablo_PN[i+1]; end; - - clicliste:=false; + + clicliste:=false; config_modifie:=true; RichPN.Clear; @@ -8309,9 +8376,49 @@ begin end; end; +procedure TFormConfig.Button1Click(Sender: TObject); +var adr,cmd,erreur : integer; + ts : Taccessoire; begin + val(editAdrFerme.Text,adr,erreur);if erreur<>0 then exit; + val(editCmdFerme.Text,cmd,erreur);if erreur<>0 then exit; + if ligneCliqueePN=-1 then exit; + aff_acc:=true; + if Tablo_PN[ligneCliqueePN+1].pulse=1 then ts:=aigP else ts:=feu; + pilote_acc(adr,cmd,ts); + aff_acc:=false; +end; +procedure TFormConfig.Button3Click(Sender: TObject); +var adr,cmd,erreur : integer; + ts : Taccessoire; +begin + val(editAdrOuvre.Text,adr,erreur);if erreur<>0 then exit; + val(editCdeOuvre.Text,cmd,erreur);if erreur<>0 then exit; + if ligneCliqueePN=-1 then exit; + aff_acc:=true; + if Tablo_PN[ligneCliqueePN+1].pulse=1 then ts:=aigP else ts:=feu; + pilote_acc(adr,cmd,ts); + aff_acc:=false; +end; +procedure TFormConfig.CheckPnPulseClick(Sender: TObject); +var i : integer; + s : string; +begin + if clicliste then exit; + if affevt then affiche('Evt CheckPnPulse Change',clyellow); + if FormConfig.PageControl.ActivePage=FormConfig.TabSheetAct then + with Formconfig do + begin + if CheckPnPulse.Checked then i:=1 else i:=0; + tablo_PN[lignecliqueePN+1].Pulse:=i; + s:=encode_act_PN(lignecliqueePN+1); + RichPN.Lines[lignecliqueePN]:=s; + end; +end; + +begin end. diff --git a/UnitConfigCellTCO.dcu b/UnitConfigCellTCO.dcu index eb1084d..29ed918 100644 Binary files a/UnitConfigCellTCO.dcu and b/UnitConfigCellTCO.dcu differ diff --git a/UnitConfigTCO.dcu b/UnitConfigTCO.dcu index 857d8c7..9c15510 100644 Binary files a/UnitConfigTCO.dcu and b/UnitConfigTCO.dcu differ diff --git a/UnitDebug.dcu b/UnitDebug.dcu index b46acea..a0456f6 100644 Binary files a/UnitDebug.dcu and b/UnitDebug.dcu differ diff --git a/UnitDebug.pas b/UnitDebug.pas index 61486ff..5fd829c 100644 --- a/UnitDebug.pas +++ b/UnitDebug.pas @@ -176,7 +176,6 @@ begin s:=SaveDialog.FileName; assignFile(fte,s); rewrite(fte); - writeln(fte,s); with RichDebug do for i:=0 to Lines.Count do begin diff --git a/UnitPilote.dcu b/UnitPilote.dcu index 1053f29..7c3a89e 100644 Binary files a/UnitPilote.dcu and b/UnitPilote.dcu differ diff --git a/UnitPrinc.dcu b/UnitPrinc.dcu index f864be3..d87f961 100644 Binary files a/UnitPrinc.dcu and b/UnitPrinc.dcu differ diff --git a/UnitPrinc.dfm b/UnitPrinc.dfm index 91ed877..6a6cffd 100644 --- a/UnitPrinc.dfm +++ b/UnitPrinc.dfm @@ -667,8 +667,8 @@ object FormPrinc: TFormPrinc Visible = False end object Image2feux: TImage - Left = 984 - Top = 128 + Left = 888 + Top = 88 Width = 33 Height = 57 Picture.Data = { @@ -1765,8 +1765,8 @@ object FormPrinc: TFormPrinc Left = 352 end object OpenDialog: TOpenDialog - Left = 888 - Top = 152 + Left = 944 + Top = 65528 end object SaveDialog: TSaveDialog Left = 888 diff --git a/UnitPrinc.pas b/UnitPrinc.pas index a5bfdc0..8b8cb35 100644 --- a/UnitPrinc.pas +++ b/UnitPrinc.pas @@ -319,8 +319,8 @@ TFeu = record EtatSignal : word ; // état du signal AncienEtat : word ; // ancien état du signal UniSemaf : integer ; // définition supplémentaire de la cible pour les décodeurs UNISEMAF - AigDirection : array[1..6] of array of record // pour les signaux directionnels : contient la liste des aiguillages associés - Adresse : integer; // 6 feux max associés à un tableau dynamique décrivant les aiguillages + AigDirection : array[1..7] of array of record // pour les signaux directionnels : contient la liste des aiguillages associés + Adresse : integer; // 6 feux max associés à un tableau dynamique décrivant les aiguillages +1 position 0 posAig : char; end; CondCarre : array[1..6] of array of record // conditions supplémentaires d'aiguillages en position pour le carré @@ -346,11 +346,11 @@ var ack,portCommOuvert,traceTrames,AffMem,CDM_connecte,dupliqueEvt, Raz_Acc_signaux,AvecInit,AvecTCO,terminal,Srvc_Aig,Srvc_Det,Srvc_Act,MasqueBandeauTCO, - Srvc_PosTrain,Srvc_Sig,debugtrames, + Srvc_PosTrain,Srvc_Sig,debugtrames,LayParParam, Hors_tension2,traceSign,TraceZone,Ferme,parSocketLenz,ackCdm,PremierFD,doubleclic, NackCDM,MsgSim,succes,recu_cv,AffAigDet,Option_demarrage,AffTiers,AvecDemandeAiguillages, TraceListe,clignotant,nack,Maj_feux_cours,configNulle,LanceCDM,AvecInitAiguillages, - AvecDemandeInterfaceUSB,AvecDemandeInterfaceEth : boolean; + AvecDemandeInterfaceUSB,AvecDemandeInterfaceEth,aff_acc : boolean; tick,Premier_tick : longint; @@ -360,7 +360,7 @@ var tablo : array of byte; // tableau rx usb - Enregistrement,chaine_Envoi,chaine_recue,Id_CDM,Af,version_Interface,entete,suffixe + Enregistrement,chaine_Envoi,chaine_recue,Id_CDM,Af,version_Interface,entete,suffixe,Lay : string; Ancien_detecteur : array[0..NbMemZone] of boolean; // anciens état des détecteurs et adresses des détecteurs et leur état @@ -427,6 +427,7 @@ var AdresseOuvre : integer; // adresse de pilotage DCC pour l'ouverture commandeOuvre : integer; // commande d'ouverture (1 ou 2) NbVoies : integer; // Nombre de voies du PN + Pulse : integer; // 0=commande maintenue 1=Impulsionnel Voie : array [1..10] of record ActFerme,ActOuvre : integer ; // actionneurs provoquant la fermeture et l'ouverture detZ1F,detZ2F,detZ1O,detZ2O : integer; // Zones de détection @@ -543,7 +544,7 @@ begin SetBit:=n or (1 shl position); end; -// renvoie le 1er numéro de bit à 1 +// renvoie le 1er numéro de bit à 1 du mot // PremBitNum(1)=0 // PremBitNum(4)=2 // si pas de bit à 1, renvoie -1 @@ -566,45 +567,46 @@ end; // Combine = code de la signalisation combinée // Exemple code_to_aspect(10001000000000) renvoie premierBit=jaune_cli (9) et Combine=rappel 60 (13) // si pas de combinaison, renvoie -1 -procedure code_to_aspect(codebin : word;var premierbit,combine : integer) ; +procedure code_to_aspect(codebin : word;var aspect,combine : integer) ; begin - premierBit:=PremBitNum(CodeBin and $3ff); + aspect:=PremBitNum(CodeBin and $3ff); combine:=PremBitNum(CodeBin and $fc00); end; -// conversion d'un état signal binaire en état unique +// conversion d'un état signal binaire en état unique de 1 à 19 // exemple code_to_etat(10001000000000) (jaune_cli et rappel 60) renvoie 19 function code_to_etat(code : word) : integer; var aspect,combine : integer; begin code_to_aspect(code,aspect,combine); result:=9999; - if aspect=0 then result:=1; // carré - if aspect=1 then result:=2; // sémaphore - if aspect=2 then result:=3; // sémaphore cli - if aspect=3 then result:=4; // vert - if aspect=4 then result:=5; // vert cli - if aspect=5 then result:=6; // violet - if aspect=6 then result:=7; // blanc - if aspect=7 then result:=8; // blanc cli - if aspect=8 then result:=9; // jaune - if aspect=9 then result:=10; // jaune cli - - if aspect=16 then + if combine=-1 then + begin + if aspect=0 then result:=1; // carré + if aspect=1 then result:=2; // sémaphore + if aspect=2 then result:=3; // sémaphore cli + if aspect=3 then result:=4; // vert + if aspect=4 then result:=5; // vert cli + if aspect=5 then result:=6; // violet + if aspect=6 then result:=7; // blanc + if aspect=7 then result:=8; // blanc cli + if aspect=8 then result:=9; // jaune + if aspect=9 then result:=10; // jaune cli + end; + if aspect=-1 then begin if combine=10 then result:=11; // ralen 30 if combine=11 then result:=12; // ralen 60 if combine=12 then result:=14; // rappel 30 if combine=13 then result:=15; // rappel 60 - end - else - begin - if (aspect=9) and (combine=11) then result:=13; //ralen 60 + jaune cli - if (aspect=8) and (combine=12) then result:=16; //rappel 30 + jaune - if (aspect=9) and (combine=12) then result:=17; //rappel 30 + jaune cli - if (aspect=8) and (combine=13) then result:=18; //rappel 60 + jaune - if (aspect=9) and (combine=13) then result:=19; //rappel 60 + jaune cli end; + + if (aspect=9) and (combine=11) then result:=13; //ralen 60 + jaune cli + if (aspect=8) and (combine=12) then result:=16; //rappel 30 + jaune + if (aspect=9) and (combine=12) then result:=17; //rappel 30 + jaune cli + if (aspect=8) and (combine=13) then result:=18; //rappel 60 + jaune + if (aspect=9) and (combine=13) then result:=19; //rappel 60 + jaune cli + code_to_etat:=result; {'Non commandé','carré','sémaphore','sémaphore cli','vert','vert cli','violet', 'blanc','blanc cli','jaune','jaune cli','ralen 30','ralen 60','ralen 60 + jaune cli','rappel 30','rappel 60', @@ -816,7 +818,7 @@ begin Temp:=HtImage-ySem;YSem:=XSem;XSem:=Temp; Temp:=HtImage-yvert;Yvert:=Xvert;Xvert:=Temp; end; - + if (orientation=3) then begin //rotation 90° vers la droite des feux @@ -888,7 +890,7 @@ begin Temp:=HtImage-ySem;YSem:=XSem;XSem:=Temp; Temp:=HtImage-yvert;Yvert:=Xvert;Xvert:=Temp; end; - + if (orientation=3) then begin //rotation 90° vers la droite des feux @@ -1152,7 +1154,7 @@ begin if N>4 then cercle(ACanvas,x5,y5,rayon,GrisF); if N>5 then cercle(ACanvas,x6,y6,rayon,GrisF); end; - if EtatSignal=4 then + if EtatSignal=4 then begin cercle(ACanvas,x1,y1,rayon,clWhite); cercle(ACanvas,x2,y2,rayon,clWhite); @@ -1800,7 +1802,7 @@ begin if (aspect=16) then s:='' else begin if aspect<>-1 then s:=etatSign[aspect];end; if combine<>16 then begin - if (aspect<>16) and (combine<>-1) then + if (aspect<>16) and (combine<>-1) then begin if aspect<>-1 then s:=s+'+'; s:=s+etatSign[combine]; @@ -1999,10 +2001,10 @@ begin if (aspect=vert) then pilote_acc(adresse+1,1,feu) ; if (aspect=jaune) then pilote_acc(adresse+1,2,feu); // signalisation non combinée rappel 30 seul - if (aspect=rappel_30) then pilote_acc(adresse+1,1,feu); - + if (combine=rappel_30) then pilote_acc(adresse+1,1,feu); + // signalisation combinée - rappel 30 + avertissement - à tester...... - if (Combine=0) then pilote_acc(adresse+2,1,feu) ; // éteindre rappel 30 + if (Combine=-1) then pilote_acc(adresse+2,1,feu) ; // éteindre rappel 30 if (Combine=rappel_30) then pilote_acc(adresse+2,2,feu) ; // allumer rappel 30 end; end; @@ -2040,7 +2042,7 @@ begin begin //affiche('trouvé en sortie1 index '+IntToSTR(i),clyellow); Pilote_acc(adresse+i-1,2,feu); - end; + end; if (feux[index].SR[i].sortie0=etat) then begin //affiche('trouvé en sortie0 index '+IntToSTR(i),clyellow); @@ -2086,7 +2088,7 @@ begin Sleep(60); // si le feu se positionne à la suite d'un positionnement d'aiguillage, on peut avoir le message station occupée //Affiche(IntToSTR(aspect)+' '+inttoSTR(combine),clOrange); - if (Combine=16) then + if (aspect<>-1) and (combine=-1) then begin if (aspect=carre) then envoi5_LEB(0); if (aspect=violet) then envoi5_LEB(1); @@ -2103,7 +2105,7 @@ begin if (aspect=ral_30) then envoi5_LEB(9); if (aspect=ral_60) then envoi5_LEB($b); end; - if (aspect=16) then + if (combine<>-1) and (aspect=-1) then begin if (Combine=rappel_30) then envoi5_LEB(6); if (Combine=rappel_60) then envoi5_LEB(7); @@ -2350,7 +2352,7 @@ begin // 93=VJR + carré + ral30 + rappel 30 if modele=93 then begin - if combine=16 then //pas de sig combinée + if combine=-1 then //pas de sig combinée begin if aspect=vert then pilote_acc(adresse,1,feu); if aspect=vert_cli then pilote_acc(adresse,1,feu); @@ -2368,7 +2370,7 @@ begin // 94=VJR + carré + ral60 + rappel60 if modele=94 then begin - if combine=16 then + if combine=-1 then begin if aspect=vert then pilote_acc(adresse,1,feu); if aspect=vert_cli then pilote_acc(adresse,1,feu); @@ -2386,7 +2388,7 @@ begin // 95=VJR + carré + ral30 + rappel 60 if modele=95 then begin - if combine=16 then + if combine=-1 then begin if aspect=vert then pilote_acc(adresse,1,feu); if aspect=vert_cli then pilote_acc(adresse,1,feu); @@ -2403,7 +2405,7 @@ begin // 96=VJR + blanc + carré + ral30 + rappel30 if modele=96 then begin - if combine=16 then + if combine=-1 then begin if aspect=vert then pilote_acc(adresse,1,feu); if aspect=vert_cli then pilote_acc(adresse,1,feu); @@ -2423,7 +2425,7 @@ begin // 97=VJR + blanc + carré + ral30 + rappel60 if modele=97 then begin - if combine=16 then + if combine=-1 then begin if aspect=vert then pilote_acc(adresse,1,feu); if aspect=vert_cli then pilote_acc(adresse,1,feu); @@ -2443,7 +2445,7 @@ begin // 98=VJR + blanc + violet + ral30 + rappel30 if modele=98 then begin - if combine=16 then + if combine=-1 then begin if aspect=vert then pilote_acc(adresse,1,feu); if aspect=vert_cli then pilote_acc(adresse,1,feu); @@ -2463,7 +2465,7 @@ begin // 99=VJR + blanc + violet + ral30 + rappel60 if modele=99 then begin - if combine=16 then + if combine=-1 then begin if aspect=vert then pilote_acc(adresse,1,feu); if aspect=vert_cli then pilote_acc(adresse,1,feu); @@ -2743,7 +2745,8 @@ begin if (aspect=blanc) then begin pilote_acc(adresse+2,2,feu);sleep(tempo_Feu);pilote_acc(adresse,2,feu);end; if (aspect=semaphore) then begin pilote_acc(adresse+2,2,feu);sleep(tempo_Feu);pilote_acc(adresse+1,1,feu);end; if (combine=aspect8) then begin pilote_acc(adresse+2,2,feu);sleep(tempo_Feu);pilote_acc(adresse+1,2,feu);end; - if (combine=ral_60_jaune_cli) then begin pilote_acc(adresse+3,1,feu);sleep(tempo_Feu);pilote_acc(adresse,1,feu);end; // demande groupe 3 + if (combine=ral_60) and (aspect=jaune_cli) + then begin pilote_acc(adresse+3,1,feu);sleep(tempo_Feu);pilote_acc(adresse,1,feu);end; // demande groupe 3 if (aspect=vert_cli) then begin pilote_acc(adresse+3,1,feu);sleep(tempo_Feu);pilote_acc(adresse,2,feu);end; // demande groupe 3 if (combine=Disque_D) then begin pilote_acc(adresse+3,1,feu);sleep(tempo_Feu);pilote_acc(adresse+1,1,feu);end;// demande groupe 3 if (aspect=jaune_cli) then begin pilote_acc(adresse+3,1,feu);sleep(tempo_Feu);pilote_acc(adresse+1,2,feu);end; @@ -2820,10 +2823,10 @@ begin sleep(40); // les commandes entre 2 feux successifs doivent être séparées au minimum de 100 ms // affichage du premier aspect du signal(1er bit à 1 dans codebin - if aspect<>16 then pilote_acc(adresse+aspect,2,feu) ; + if aspect<>-1 then pilote_acc(adresse+aspect,2,feu) ; - // affichage de la signalisation combinée (2ème bit à 1 dans codebin) - if (Combine<>16) then + // affichage de la signalisation combinée + if (Combine<>-1) then begin sleep(40); pilote_ACC(adresse+Combine,2,feu) ; @@ -3336,7 +3339,7 @@ begin s:='134.2 - Aiguillage '+IntToSTR(adr)+' non résolu car position inconnue'; AfficheDebug(s,clOrange); Affiche(s,clOrange); - end; + end; typeGen:=rien; suivant_alg3:=9996; exit; @@ -5230,7 +5233,7 @@ begin if i>1 then positionok:=((position=const_droit) and (posAigFeu='D')) or ((position<>const_droit) and (posAigFeu='S')) and positionok; end; inc(i); - until (i>NFeuxDir+1) or positionok; + until (i>NFeuxDir+1) or positionok; if positionok then begin @@ -6120,7 +6123,7 @@ begin AfficheDebug(s,clyellow); AfficheDebug(intToSTR(event_det_train[N_Trains].det[1]),clyellow); AfficheDebug(intToSTR(event_det_train[N_Trains].det[2]),clyellow); - end; + end; end else begin @@ -6212,13 +6215,13 @@ begin begin adresseok:=adresseOk and (Tablo_actionneur[i].adresse2=adr2); st:='Mémoire de zone '+intToSTR(adr)+' '+intToStr(adr2); - end; + end; end - else + else begin st:='Actionneur '+intToSTR(adr); - end; - + end; + // actionneur pour fonction train if adresseOk and (Tablo_actionneur[i].loco) and ((s=trainDecl) or (s='X') or (trainDecl='X') or (trainDecl='')) and (etatAct=etat) then begin @@ -6230,7 +6233,7 @@ begin envoie_fonction_CDM(Tablo_actionneur[i].fonction,etat,trainDest); tablo_actionneur[i].TrainCourant:=trainDest; // pour mémoriser le train pour la retombée de la fonction tablo_actionneur[i].TempoCourante:=tablo_actionneur[i].Tempo div 100; - end; + end; // actionneur pour accessoire if adresseOk and (Tablo_actionneur[i].act) and ((s=trainDecl) or (s='X') or (trainDecl='X') or (trainDecl='')) and (etatAct=etat) then @@ -6276,16 +6279,18 @@ begin if not(presTrain_PN) then begin Affiche('Ouverture PN'+intToSTR(i)+' par act '+intToSTr(adr)+' (train voie '+IntToSTR(v)+')',clOrange); - pilote_acc(Tablo_PN[i].AdresseOuvre,Tablo_PN[i].CommandeOuvre,AigP); + if Tablo_PN[i].pulse=1 then ts:=aigP else ts:=feu; + pilote_acc(Tablo_PN[i].AdresseOuvre,Tablo_PN[i].CommandeOuvre,ts); end; end; - + if (aF=adr) and (etat=1) then // actionneur de fermeture begin Tablo_PN[i].voie[v].PresTrain:=true; s:='Fermeture PN'+IntToSTR(i)+' par act '+intToSTr(adr)+' (train voie '+IntToSTR(v)+')'; Affiche(s,clOrange); - pilote_acc(Tablo_PN[i].AdresseFerme,Tablo_PN[i].CommandeFerme,AigP); + if Tablo_PN[i].pulse=1 then ts:=aigP else ts:=feu; + pilote_acc(Tablo_PN[i].AdresseFerme,Tablo_PN[i].CommandeFerme,ts); end; end end @@ -6313,7 +6318,8 @@ begin s:='Ouverture PN'+intToSTR(i)+' par zone '+intToSTr(adr)+' '+intToSTR(adr2); Affiche(s,clorange); //if AffAigDet then AfficheDebug(s,clorange); - pilote_acc(Tablo_PN[i].AdresseOuvre,Tablo_PN[i].CommandeOuvre,AigP); + if Tablo_PN[i].pulse=1 then ts:=aigP else ts:=feu; + pilote_acc(Tablo_PN[i].AdresseOuvre,Tablo_PN[i].CommandeOuvre,ts); end; end; @@ -6323,9 +6329,10 @@ begin s:='Fermeture PN'+IntToSTR(i)+' par zone '+intToSTr(adr)+' '+intToSTR(adr2)+' (train voie '+IntToSTR(v)+')'; affiche(s,clorange); //if AffAigDet then AfficheDebug(s,clorange); - pilote_acc(Tablo_PN[i].AdresseFerme,Tablo_PN[i].CommandeFerme,AigP); - end; - end; + if Tablo_PN[i].pulse=1 then ts:=aigP else ts:=feu; + pilote_acc(Tablo_PN[i].AdresseFerme,Tablo_PN[i].CommandeFerme,ts); + end; + end; end; end; end; @@ -6343,7 +6350,7 @@ begin begin Maj_feux; // on ne traite pas les calculs si CDM en envoie plusieurs end; -end; +end; // traitement des évènements détecteurs procedure Event_Detecteur(Adresse : integer;etat : boolean;train : string); @@ -6489,7 +6496,7 @@ begin // si l'aiguillage est inversé dans CDM et qu'on est en mode autonome ou CDM, inverser sa position inv:=false; if (aiguillage[index].inversionCDM=1) and (portCommOuvert or parSocketLenz) then - begin + begin prov:=pos; inv:=true; if prov=const_droit then pos:=const_devie else pos:=const_droit; @@ -6520,7 +6527,7 @@ begin FormDebug.MemoEvtDet.lines.add(s) ; end; - + if (n_Event_tick mod 10) =0 then affiche_memoire; inc(N_Event_tick); event_det_tick[N_event_tick].tick:=tick; @@ -6535,7 +6542,7 @@ begin if faire_event and not(confignulle) then evalue; end; -// pilote une sortie à 0 dont l'adresse est à octet +// pilote une sortie à 0 à l'interface en Xpressnet dont l'adresse est à octet procedure Pilote_acc0_X(adresse : integer;octet : byte); var groupe : integer ; fonction : byte; @@ -6546,10 +6553,11 @@ begin fonction:=((adresse-1) mod 4)*2 + (octet-1); s:=#$52+Char(groupe)+char(fonction or $80); // désactiver la sortie s:=checksum(s); - envoi(s); // envoi de la trame et attente Ack + envoi(s); // envoi de la trame à l'interface et attente Ack end; // pilotage d'un accessoire (décodeur d'aiguillage, de signal) +// par CDM ou interface // octet = 1 (dévié) ou 2 (droit) // la sortie "octet" est mise à 1 puis à 0 // acc = aig ou feu @@ -6577,11 +6585,14 @@ begin begin //AfficheDebug(intToSTR(adresse),clred); if debug_dec_sig and (acc=feu) then AfficheDebug('Tick='+IntToSTR(Tick)+' signal '+intToSTR(adresse)+' '+intToSTR(pilotage),clorange); + if aff_acc then Affiche('Accessoire '+intToSTR(adresse)+' à '+intToSTR(pilotage),clorange); s:=chaine_CDM_Acc(adresse,pilotage); envoi_CDM(s); if (acc=feu) and not(Raz_Acc_signaux) then exit; - if debug_dec_sig and (acc=feu) then AfficheDebug('Tick='+IntToSTR(Tick)+' signal '+intToSTR(adresse)+' 0',clorange); + sleep(50); + if debug_dec_sig and (acc=feu) then AfficheDebug('Tick='+IntToSTR(Tick)+' signal '+intToSTR(adresse)+' 0',clorange); + if aff_acc then Affiche('Accessoire '+intToSTR(adresse)+' à 0',clorange); s:=chaine_CDM_Acc(adresse,0); envoi_CDM(s); event_aig(adresse,pilotage); @@ -7048,7 +7059,7 @@ begin repeat sleep(100); inc(temp); - // Application.processmessages; // provoque violation + Application.processmessages; // provoque violation until (version_Interface<>'') or (temp>2); if (temp>2) then @@ -7206,7 +7217,7 @@ end; procedure SendKey(Wnd,VK : Cardinal; Ctrl,Alt,Shift : Boolean); var MC,MA,MS : Boolean; begin - // Etats des touches spéciales + // Etats des touches spéciales MC:=Hi(GetAsyncKeyState(VK_CONTROL))>127; MA:=Hi(GetAsyncKeyState(VK_MENU))>127; MS:=Hi(GetAsyncKeyState(VK_SHIFT))>127; @@ -7233,7 +7244,7 @@ end; // 112=F1 .. 135=F20 136 à 143 rien 145 à 159 : spécifique ou non utilisé // $A0 .. $B0 : contrôles curseur // $BA : spécifique au pays -// $6A à $6F * + espace - . / +// $6A à $6F * + espace - . / // BB à BE + - . attention la description diffère function convert_VK(LAY : string) : string; var i : integer; @@ -7247,10 +7258,10 @@ begin '1' : s:=s+'a'; '2' : s:=s+'b'; '3' : s:=s+'c'; - '4' : s:=s+'d'; + '4' : s:=s+'d'; '5' : s:=s+'e'; '6' : s:=s+'f'; - '7' : s:=s+'g'; + '7' : s:=s+'g'; '8' : s:=s+'h'; '9' : s:=s+'i'; '*' : s:=s+#$6a; @@ -7269,15 +7280,15 @@ begin convert_VK:=s; end; -// Lance et connecte CDM rail. en sortie si CDM est lancé Lance_CDM=true, +// Lance et connecte CDM rail. en sortie si CDM est lancé Lance_CDM=true, function Lance_CDM : boolean; var i,retour,retour2 : integer; s : string; cdm_lanceLoc : boolean; begin s:='CDR'; - if (ProcessRunning(s)) then - begin + if (ProcessRunning(s)) then + begin // CDM déja lancé; Affiche('CDM déjà lancé',clOrange); Lance_CDM:=true; @@ -7285,15 +7296,16 @@ begin deconnecte_USB; connecte_CDM; exit; - end; + end; + + if lay<>'' then s:='-f '+lay else s:=''; + //s:=''; - //if lay<>'' then s:='-f '+lay else s:=''; - s:=''; - cdm_lanceLoc:=false; // lancement depuis le répertoire 32 bits d'un OS64 - - retour:=ShellExecute(Formprinc.Handle,'open',PChar('C:\Program Files (x86)\CDM-Rail\cdr.exe'), + + retour:=ShellExecute(Formprinc.Handle,'open', + Pchar('cdr.exe'), Pchar(s), // paramètre PChar('C:\Program Files (x86)\CDM-Rail\') // répertoire ,SW_SHOWNORMAL); @@ -7306,8 +7318,8 @@ begin if not(cdm_lanceLoc) then begin // si çà marche pas essayer depuis le répertoire de base sur un OS32 - retour2:=ShellExecute(Formprinc.Handle, - 'open',PChar('C:\Program Files\CDM-Rail\cdr.exe'), + retour2:=ShellExecute(Formprinc.Handle,'open', + PChar('cdr.exe'), Pchar(s), // paramètre PChar('C:\Program Files\CDM-Rail\') // répertoire ,SW_SHOWNORMAL); @@ -7322,7 +7334,7 @@ begin if cdm_lanceLoc then begin - Formprinc.caption:=af; + Formprinc.caption:=af+' - '+lay; // On a lancé CDM, déconnecter l'USB deconnecte_USB; Affiche('lance les fonctions automatiques de CDM',clyellow); @@ -7331,23 +7343,26 @@ begin SetForegroundWindow(CDMhd); Application.ProcessMessages; - // démarre le serveur IP ------------------------------------ + // démarre le serveur IP : il faut avoir chargé un réseau sinon le permier menu est fermé------------------------------------ + // prépare le tableau pour sendinput KeybdInput(VK_MENU,0); // enfonce Alt KeybdInput(Ord('C'),0); // enfonce C - KeybdInput(Ord('C'),KEYEVENTF_KEYUP); // relache C + KeybdInput(Ord('C'),KEYEVENTF_KEYUP); // relache C pointe premier menu "Configuration train" KeybdInput(VK_MENU,KEYEVENTF_KEYUP); // relache ALT KeybdInput(Ord('C'),0); - KeybdInput(Ord('C'),KEYEVENTF_KEYUP); + KeybdInput(Ord('C'),KEYEVENTF_KEYUP); // pointe sur 2eme menu "comm ip" - KeybdInput(VK_RETURN,0); + KeybdInput(VK_RETURN,0); // valide démarrer comm ip KeybdInput(VK_RETURN,KEYEVENTF_KEYUP); KeybdInput(VK_RETURN,0); KeybdInput(VK_RETURN,KEYEVENTF_KEYUP); + // envoie les touches i:=SendInput(Length(KeyInputs),KeyInputs[0],SizeOf(KeyInputs[0]));SetLength(KeyInputs,0); // la fenetre serveur démarré est affichée Sleep(300); + Application.ProcessMessages; KeybdInput(VK_RETURN,0); KeybdInput(VK_RETURN,KEYEVENTF_KEYUP); @@ -7389,7 +7404,7 @@ begin KeybdInput(VK_SPACE, 0);KeybdInput(VK_SPACE, KEYEVENTF_KEYUP); SendInput(Length(KeyInputs), KeyInputs[0], SizeOf(KeyInputs[0]));SetLength(KeyInputs,0); Sleep(200); - + // Interface if (ServeurInterfaceCDM=1) or (ServeurInterfaceCDM=7) then begin @@ -7961,6 +7976,7 @@ end; procedure TFormPrinc.BoutonRafClick(Sender: TObject); begin Maj_feux; + Signal_direction(372); end; // erreur sur socket Lenz (interface XpressNet) @@ -9592,5 +9608,7 @@ begin if (e=0) and (i>=0) and (i<=100) then TrackBarVit.position:=i; end; + + end. diff --git a/UnitSR.dcu b/UnitSR.dcu index a898380..6806ee0 100644 Binary files a/UnitSR.dcu and b/UnitSR.dcu differ diff --git a/UnitSimule.dcu b/UnitSimule.dcu index 0d7f306..eb67930 100644 Binary files a/UnitSimule.dcu and b/UnitSimule.dcu differ diff --git a/UnitTCO.dcu b/UnitTCO.dcu index d005370..e7b1459 100644 Binary files a/UnitTCO.dcu and b/UnitTCO.dcu differ diff --git a/Unit_Pilote_aig.dcu b/Unit_Pilote_aig.dcu index 5bad6e3..394d057 100644 Binary files a/Unit_Pilote_aig.dcu and b/Unit_Pilote_aig.dcu differ diff --git a/verif_version.dcu b/verif_version.dcu index a69e0e2..7354b43 100644 Binary files a/verif_version.dcu and b/verif_version.dcu differ diff --git a/verif_version.pas b/verif_version.pas index b7f0b96..42f8c3f 100644 --- a/verif_version.pas +++ b/verif_version.pas @@ -23,8 +23,8 @@ var Lance_verif : integer; verifVersion,notificationVersion : boolean; -Const Version='4.72'; // sert à la comparaison de la version publiée - SousVersion=' '; // en cas d'absence de sous version mettre un espace +Const Version='4.73'; // sert à la comparaison de la version publiée + SousVersion='C'; // en cas d'absence de sous version mettre un espace implementation @@ -184,7 +184,7 @@ begin i:=pos('version ',s2); delete(s2,1,i+7); j:=pos(' ',s2); - Version_p:=copy(s2,1,j-1); // version dans version_p + Version_p:=copy(s2,1,j-1); // version dans version_p Exemple V4.73b // isoler l'url du zip i:=pos('href="',s3); delete(s3,1,i+5); @@ -203,7 +203,7 @@ begin s:=AnsiUppercase(s); l:=length(s); SV_publie:=s[l]; - if Sv_publie in ['0'..'9'] then Sv_Publie:=' ' else s:=copy(s,1,l-1); + 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; @@ -213,7 +213,7 @@ begin if (V_utile0 then dec(lance_verif); - if lance_verif=1 then verifie_version; + if lance_verif=1 then begin lance_verif:=0;verifie_version;end; end; end. diff --git a/versions.txt b/versions.txt index ea409bd..151703d 100644 --- a/versions.txt +++ b/versions.txt @@ -122,6 +122,8 @@ version 4.7 : R Amélioration du séquenceur de connexion à l'interface. version 4.71 : Correction bug décodage trame actionneur de CDM version 4.72 : Renforcement de la vérification de la configuration. +version 4.73 : Pilotage des PN en impulsionnel ou non +