public PCars2Connector() : base(PCars2Executables) { _sharedMemory = new MappedBuffer <PCars2SharedMemory>(SharedMemoryName); _pCars2DataConvertor = new PCars2DataConvertor(); _lastRawPCars2SessionType = PCars2SessionType.SessionInvalid; _lastSessionType = SessionType.Na; _stopwatch = new Stopwatch(); }
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); }
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); }
protected override void ResetConnector() { _stopwatch.Restart(); _lastRawPCars2SessionType = PCars2SessionType.SessionInvalid; _lastSessionType = SessionType.Na; }