anchor.diff:  
         if (Self.fstaveni.SenderPnl <> nil) and (Self.fstaveni.SenderOR <> nil) then
           ORTCPServer.Potvr(Self.fstaveni.SenderPnl, Self.NC_PS_Callback, Self.fstaveni.SenderOR as TOR,
  -          str, TBlky.GetBlksList(Navestidlo, Blk), Self.BarieryNCToPotvr(Self.fstaveni.ncBariery));
  +          str, TBlky.GetBlksList(Navestidlo, lastUsek), Self.BarieryNCToPotvr(Self.fstaveni.ncBariery));
        end;
       Self.fstaveni.ncBarieryCntLast := Self.fstaveni.ncBariery.Count;
   
       // nastavovani smeru trati:
       if (Self.fproperties.Trat > -1) then
        begin
  -      Blky.GetBlkByID(Self.fproperties.Trat, Blk);
  -      Blky.GetBlkByID(Self.fproperties.Useky[Self.fproperties.Useky.Count-1], Blk2);
  -
  -      if (((Blk as TBlkTrat).GetSettings.zabzar = TTratZZ.bezsouhas) and (not (blk as TBlkTrat).ZAK) and
  -        (not (blk as TBlkTrat).Zaver) and ((blk2 as TBlkTU).sectReady) and (not (blk as TBlkTrat).Zadost) and
  -        ((Blk as TBlkTrat).Smer <> Self.fproperties.TratSmer)) then
  +      Blky.GetBlkByID(Self.fproperties.Trat, TBlk(trat));
  +      Blky.GetBlkByID(Self.fproperties.Useky[Self.fproperties.Useky.Count-1], TBlk(tu));
  +
  +      if ((trat.GetSettings.zabzar = TTratZZ.bezsouhas) and (not trat.ZAK) and
  +        (not trat.Zaver) and (tu.sectReady) and (not trat.Zadost) and
  +        (trat.Smer <> Self.fproperties.TratSmer)) then
            begin
             writelog('Krok 101: trat: nastaven smer', WR_VC);
  -          (Blk as TBlkTrat).Smer := Self.fproperties.TratSmer;
  +          trat.Smer := Self.fproperties.TratSmer;
            end;
   
         // pokud v trati neni zavedena blokova podminka, zavedeme ji
  -      if ((Self.fproperties.TypCesty = TJCType.vlak) and ((Blk as TBlkTrat).Smer = Self.data.TratSmer) and (not (Blk as TBlkTrat).BP)) then
  -        (Blk as TBlkTrat).BP := true;
  +      if ((Self.fproperties.TypCesty = TJCType.vlak) and (trat.Smer = Self.data.TratSmer) and (not trat.BP)) then
  +        trat.BP := true;
   
         // posledni blok posunove cesty je trat = posun mezi dopravnami -> zavedeme zakaz odjezdu do trati
  -      if ((Self.fproperties.TypCesty = TJCType.posun) and (TBlkTrat(Blk).Smer = Self.fproperties.TratSmer)) then
  +      if ((Self.fproperties.TypCesty = TJCType.posun) and (trat.Smer = Self.fproperties.TratSmer)) then
          begin
           case (Self.fproperties.TratSmer) of
  -         TTratSmer.AtoB : if (not TBlkUvazka(TBlkTrat(Blk).uvazkaA).ZAK) then TBlkUvazka(TBlkTrat(Blk).uvazkaA).ZAK := true;
  -         TTratSmer.BtoA : if (not TBlkUvazka(TBlkTrat(Blk).uvazkaB).ZAK) then TBlkUvazka(TBlkTrat(Blk).uvazkaB).ZAK := true;
  +         TTratSmer.AtoB : if (not TBlkUvazka(trat.uvazkaA).ZAK) then TBlkUvazka(trat.uvazkaA).ZAK := true;
  +         TTratSmer.BtoA : if (not TBlkUvazka(trat.uvazkaB).ZAK) then TBlkUvazka(trat.uvazkaB).ZAK := true;
           end;
          end;
        end;
  
positive.code:            // vlakova cesta:
             for uzavBlok in prjZaver.uzaviraci do
              begin
               Blky.GetBlkByID(uzavBlok, Blk2);
               if ((Blk2 as TBlkUsek).Obsazeno = TusekStav.obsazeno) then
                begin
                 writelog('Krok 12 : prejezd '+Blk.name+' - aktivacni usek '+Blk2.name+' obsazen - uzaviram', WR_VC);
  
                 Blky.GetBlkByID(prjZaver.Prejezd, Blk);
                 TBlkPrejezd(Blk).Zaver := true;
  
                 // pridani zruseni redukce, tim se prejezd automaticky otevre po zruseni zaveru bloku pod nim
                 Blky.GetBlkByID(prjZaver.oteviraci, Blk);
                 TBlkUsek(Blk).AddChangeEvent(TBlkUsek(Blk).EventsOnZaverReleaseOrAB,
                   CreateChangeEvent(ceCaller.NullPrejezdZaver, prjZaver.Prejezd));
  
                 uzavren := true;
  
negative.code: 
      if (Self.fproperties.TypCesty = TJCType.vlak) then
       begin
        usek := navestidlo.UsekPred as TBlkUsek;
        Blky.GetBlkByID(Self.fproperties.Useky[Self.fproperties.Useky.Count-1], TBlk(lastUsek));
        spri := Self.GetSoupravaIndex(Navestidlo, usek);
  
        // a)
        if ((lastUsek.typ = _BLK_USEK) and (lastUsek.Stav.stanicni_kolej) and
            (not lastUsek.SoupravyFull())) then
         begin
          if (usek.IsSouprava()) then
           begin
            if ((usek.typ = _BLK_TU) and (TBlkTU(usek).InTrat > -1)) then
             begin
              Blky.GetBlkByID((usek as TBlkTU).InTrat, TBlk(trat));
              trat.RemoveSpr(spri);
             end;
  
            // na dopravni kolej vlozime soupravu blize vjezdovemu navestidlu
            if (navestidlo.Smer = THVStanoviste.lichy) then
              lastUsek.AddSoupravaL(spri)
            else
              lastUsek.AddSoupravaS(spri);
  
            usek.RemoveSouprava(spri);
           end;
          Self.fstaveni.RozpadBlok := -6;
         end;
  
        // b)
        if ((lastUsek.typ = _BLK_TU) and ((lastUsek as TBlkTU).InTrat > -1)) then
          Blky.GetBlkByID((lastUsek as TBlkTU).InTrat, TBlk(trat))
        else
          trat := nil;
  
        if ((trat <> nil) and (usek.IsSouprava()) and (not lastUsek.IsSouprava()) and
            (lastUsek.typ = _BLK_TU) and ((lastUsek as TBlkTU).InTrat = Self.data.Trat) and
            (trat.Smer = Self.data.TratSmer) and (trat.BP)) then
         begin
          trat.AddSpr(TBlkTratSouprava.Create(spri));
          (lastUsek as TBlkTU).poruchaBP := true;
          trat.Change();
  
          lastUsek.AddSoupravaL(spri); // tady je jedno jestli zavolat L nebo S
                                       // v trati muze byt na jednom useku vzdy jen jedna souprava
                                       // kontrolovano vyse
          usek.RemoveSouprava(spri);
         end;
       end;//if typcesty = vlak
  
  