Beispiel #1
0
 public TcAdsSyncPort(AmsAddress addr, TcLocalSystem localSystem, INotificationReceiver iNoteReceiver, bool clientCycle, bool synchronize)
 {
     object[] args = new object[] { this._id, addr };
     using (new MethodTrace("Id: {0:d}, Address = {1}", args))
     {
         this._localSystem   = localSystem;
         this._iNoteReceiver = iNoteReceiver;
         if (!base.IsLocalNetId(addr.netId, localSystem.NetId))
         {
             base.address = addr.Clone();
         }
         else
         {
             base.address = new AmsAddress(localSystem.NetId, addr.port);
             this._bLocal = true;
         }
         this._bSynchronize        = synchronize;
         this._bClientCycle        = clientCycle;
         this._adsStateHandle      = 0;
         this._symbolVersionHandle = 0;
         this._symbolTable         = new SymbolTable(this);
         if (synchronize)
         {
             this._routerSyncWindow = new SyncWindow(this);
         }
     }
 }
Beispiel #2
0
 protected override void Dispose(bool disposing)
 {
     if (!base._disposed)
     {
         Module.Trace.TraceVerbose($"TcAdsSyncPort.Dispose({this._id:d}); disposing={disposing.ToString()}");
         if (disposing)
         {
             if (this._notificationMngt != null)
             {
                 this._notificationMngt.Dispose();
                 this._notificationMngt = null;
             }
             if (this._routerSyncWindow != null)
             {
                 this._routerSyncWindow.Dispose();
                 this._routerSyncWindow = null;
             }
             if (this._symbolTable != null)
             {
                 this._symbolTable.Dispose();
                 this._symbolTable = null;
             }
         }
         AdsErrorCode code = this.OnClosePort();
         base.Dispose(disposing);
     }
 }