Esempio n. 1
0
        public PCars2Connector()
            : base(PCars2Executables)
        {
            _sharedMemory = new MappedBuffer <PCars2SharedMemory>(SharedMemoryName);

            _pCars2DataConvertor      = new PCars2DataConvertor();
            _lastRawPCars2SessionType = PCars2SessionType.SessionInvalid;
            _lastSessionType          = SessionType.Na;
            _stopwatch = new Stopwatch();
        }
Esempio n. 2
0
        private bool CheckSessionStarted(PCars2SharedMemory rawData, SimulatorDataSet dataSet)
        {
            if (_lastRawPCars2SessionType != (PCars2SessionType)rawData.mSessionState || _lastSessionType != dataSet.SessionInfo.SessionType)
            {
                _lastSessionType          = dataSet.SessionInfo.SessionType;
                _lastRawPCars2SessionType = (PCars2SessionType)rawData.mSessionState;
                return(true);
            }

            return(false);
        }
Esempio n. 3
0
        private bool CheckSessionStarted(PCars2SharedMemory rawData, SimulatorDataSet dataSet)
        {
            if (_lastRawPCars2SessionType != (PCars2SessionType)rawData.mSessionState || _lastSessionType != dataSet.SessionInfo.SessionType)
            {
                Logger.Info($"Session doesn match, last packet session: {_lastSessionType}, current session: {dataSet.SessionInfo.SessionType} ");
                _lastSessionType          = dataSet.SessionInfo.SessionType;
                _lastRawPCars2SessionType = (PCars2SessionType)rawData.mSessionState;
                return(true);
            }

            return(false);
        }
Esempio n. 4
0
 protected override void ResetConnector()
 {
     _stopwatch.Restart();
     _lastRawPCars2SessionType = PCars2SessionType.SessionInvalid;
     _lastSessionType          = SessionType.Na;
 }