RFID.RFIDInterface.LakeChabotReader.ClearSession C# (CSharp) Méthode

ClearSession() public méthode

public ClearSession ( ) : void
Résultat void
        public void ClearSession( )
        {
            PacketLogger.Clear( );

#pragma warning disable 420 // reference to a volatile field is valid for Interlocked call
            System.Threading.Interlocked.Exchange( ref _commonRequestIndex, -1 );
            System.Threading.Interlocked.Exchange( ref _commonBadIndex, -1 );

            System.Threading.Interlocked.Exchange( ref _rawPacketCount, 0 );
            System.Threading.Interlocked.Exchange( ref _rawCommandCount, 0 );
            System.Threading.Interlocked.Exchange( ref _rawAntennaCycleCount, 0 );
            System.Threading.Interlocked.Exchange( ref _rawAntennaCount, 0 );
            System.Threading.Interlocked.Exchange( ref _rawInventoryCycleCount, 0 );
            System.Threading.Interlocked.Exchange( ref _rawRoundCount, 0 );
            System.Threading.Interlocked.Exchange( ref _rawInventoryCount, 0 );
            System.Threading.Interlocked.Exchange( ref _commonAccessCount, 0 );
            System.Threading.Interlocked.Exchange( ref _cRCErrors, 0 );

            System.Threading.Interlocked.Exchange( ref _processedPacketIndex, -1 );
            System.Threading.Interlocked.Exchange( ref _processedCommandIndex, -1 );
            System.Threading.Interlocked.Exchange( ref _processedAntennaCycleIndex, -1 );
            System.Threading.Interlocked.Exchange( ref _processedAntennaIndex, -1 );
            System.Threading.Interlocked.Exchange( ref _processedInventoryCycleIndex, -1 );
            System.Threading.Interlocked.Exchange( ref _processedRoundIndex, -1 );
            // System.Threading.Interlocked.Exchange(ref _processedEndRoundIndex, -1);

            System.Threading.Interlocked.Exchange( ref _processedInventoryIndex, -1 );
            System.Threading.Interlocked.Exchange( ref _processedCmdReadCount, 0 );
            System.Threading.Interlocked.Exchange( ref _maxQueueSize, -1 );
#pragma warning restore 420

            // _stopwatch.Reset();
            // _stopwatch.Start();
            DateTime temp = DateTime.UtcNow;
            _sessionStartMS = HighResolutionTimer.Milliseconds;
            // _sessionStart = new DateTime( temp.Year, temp.Month,  temp.Day,
            //                               temp.Hour, temp.Minute, temp.Second,
            //                               (int)_stopwatch.ElapsedMilliseconds,
            //                               DateTimeKind.Utc );

            _sessionStart = new DateTime( temp.Year, temp.Month, temp.Day,
                                          temp.Hour, temp.Minute, temp.Second,
                                          Math.Min( 999, ( int ) ElapsedMilliseconds ),
                                          DateTimeKind.Utc );

            _inventoryMatrix.Clear( );

            _sessionTagList.Clear( );
            _requestTagList.Clear( );
            _periodTagList.Clear( );
            _commandTagList.Clear( );
            _antennaCycleTagList.Clear( );
            _antennaTagList.Clear( );
            _inventoryCycleTagList.Clear( );
            _inventoryRoundTagList.Clear( );

            LastUsedAntenna = null;
            LastCommandResult = null;

            RecentPacketList.Clear( );

            PropertyBagData.Clear( );
            ReaderRequestData.Clear( );
            PacketStreamData.Clear( );
            ReaderCommandData.Clear( );
            ReaderAntennaCycleData.Clear( );
            AntennaCycleData.Clear( );
            TagInventoryData.Clear( );
            InventoryRoundData.Clear( );
            InventoryCycleData.Clear( );
            TagReadData.Clear( );
            ReadRateData.Clear( );
            BadPacketData.Clear( );

            if ( _fileHandler != null ) _fileHandler.Close( );
            _fileHandler = null;
        }