コード例 #1
0
        public void Process(DataSample data, TimeSpan relativeTime)
        {
            var camDriver = CreateCamDriver(data, relativeTime);

            if (camDriver != null)
            {
                if (lastCamDriver == null ||
                    lastCamDriver.UserName != camDriver.CurrentDriver.UserName ||
                    lastCamDriver.Position != camDriver.CurrentDriver.Position)
                {
                    var position = camDriver.CurrentDriver.Position != null?camDriver.CurrentDriver.Position.Value.ToString() : "";

                    var indicator = camDriver.CurrentDriver.Position != null?camDriver.CurrentDriver.Position.Value.Ordinal() : "";

                    TraceInfo.WriteLine("{0} Camera on {1} {2} in position {3}{4}",
                                        data.Telemetry.SessionTimeSpan,
                                        camDriver.CurrentDriver.UserName,
                                        camDriver.CurrentDriver.CarNumber,
                                        position, indicator);

                    lastCamDriver = camDriver.CurrentDriver;
                }
                overlayData.CamDrivers.Add(camDriver);
            }
        }
コード例 #2
0
        static OverlayData.Driver GetCurrentDriverDetails(DataSample data)
        {
            if (data.Telemetry.CamCar == null)
            {
                return(null);
            }

            var car = data.Telemetry.CamCar;

            var position = GetPositionFor(data, car.Details);

            var driver = new OverlayData.Driver
            {
                CarIdx       = car.CarIdx,
                CarNumber    = car.Details.CarNumberDisplay,
                UserName     = car.Details.UserName,
                Position     = position,
                PitStopCount = car.PitStopCount
            };

            return(driver);
        }
コード例 #3
0
        public void Process(DataSample data, TimeSpan relativeTime)
        {
            var camDriver = CreateCamDriver(data, relativeTime);
            if (camDriver != null)
            {
                if (lastCamDriver == null || 
                    lastCamDriver.UserName != camDriver.CurrentDriver.UserName ||
                    lastCamDriver.Position != camDriver.CurrentDriver.Position)
                {
                    var position = camDriver.CurrentDriver.Position != null ? camDriver.CurrentDriver.Position.Value.ToString() : "";
                    var indicator = camDriver.CurrentDriver.Position != null ? camDriver.CurrentDriver.Position.Value.Ordinal() : "";

                    TraceInfo.WriteLine("{0} Camera on {1} {2} in position {3}{4}",
                        data.Telemetry.SessionTimeSpan,
                        camDriver.CurrentDriver.UserName,
                        camDriver.CurrentDriver.CarNumber,
                        position, indicator);

                    lastCamDriver = camDriver.CurrentDriver;
                }
                overlayData.CamDrivers.Add(camDriver);
            }
        }
コード例 #4
0
        static OverlayData.Driver GetCurrentDriverDetails(DataSample data)
        {
            if (data.Telemetry.CamCar == null)
                return null;

            var car = data.Telemetry.CamCar;

            var position = GetPositionFor(data, car.Details);

            var driver = new OverlayData.Driver
            {
                CarIdx = car.CarIdx,
                CarNumber = car.Details.CarNumberDisplay,
                UserName = car.Details.UserName,
                Position = position,
                PitStopCount = car.PitStopCount
            };

            return driver;
        }