void standingsGridDoubleClick(object sender, MouseButtonEventArgs e) { if (standingsGrid.SelectedItem != null) { Sessions.SessionInfo.StandingsItem driver = (Sessions.SessionInfo.StandingsItem)standingsGrid.SelectedItem; API.sdk.BroadcastMessage(iRSDKSharp.BroadcastMessageTypes.CamSwitchNum, padCarNum(driver.Driver.NumberPlate), -1); SharedData.updateControls = true; } }
public webtimingDriver(Sessions.SessionInfo.StandingsItem driver, Sessions.SessionInfo session) { position = driver.Position.ToString(); name = driver.Driver.Name; number = driver.Driver.NumberPlate; lap = driver.CurrentLap.LapNum.ToString(); fastestlap = iRTVO.Overlay.floatTime2String(driver.FastestLap, 3, false); previouslap = iRTVO.Overlay.floatTime2String(driver.PreviousLap.LapTime, 3, false); pit = driver.PitStops.ToString(); lapsled = driver.LapsLed.ToString(); sectors = new string[0]; classid = driver.Driver.CarClass.ToString(); classname = driver.Driver.CarClassName; classposition = session.getClassPosition(driver.Driver).ToString(); classgap = driver.ClassGapLive_HR; classinterval = driver.ClassIntervalLive_HR; Sessions.SessionInfo.StandingsItem leader = SharedData.Sessions.CurrentSession.FindPosition(1, dataorder.position); Sessions.SessionInfo.StandingsItem infront; if (driver.Position <= 1) { infront = new Sessions.SessionInfo.StandingsItem(); } else { infront = SharedData.Sessions.CurrentSession.FindPosition(driver.Position - 1, dataorder.position); } if (SharedData.Sessions.CurrentSession.Type == Sessions.SessionInfo.sessionType.race /* && (driver.Finished == true || driver.Sector == 0) */) { if (infront.PreviousLap.GapLaps > driver.PreviousLap.GapLaps) { interval = (infront.FindLap(driver.PreviousLap.LapNum).LapNum - driver.PreviousLap.LapNum) + " L"; } else { interval = iRTVO.Overlay.floatTime2String((driver.PreviousLap.Gap - infront.FindLap(driver.PreviousLap.LapNum).Gap), 3, false); } if (driver.PreviousLap.GapLaps > 0) { gap = driver.PreviousLap.GapLaps + " L"; } else { gap = iRTVO.Overlay.floatTime2String(driver.PreviousLap.Gap, 3, false); } } else { interval = iRTVO.Overlay.floatTime2String((driver.FastestLap - infront.FastestLap), 3, false); gap = iRTVO.Overlay.floatTime2String((driver.FastestLap - leader.FastestLap), 3, false); } if (SharedData.SelectedSectors.Count > 0) { sectors = new string[SharedData.SelectedSectors.Count]; for (int i = 0; i < SharedData.SelectedSectors.Count; i++) { if (driver.Sector <= 0) // first sector, show previous lap times { if (i < driver.PreviousLap.SectorTimes.Count) { iRTVO.LapInfo.Sector sector = driver.PreviousLap.SectorTimes.Find(s => s.Num.Equals(i)); if (sector != null) { sectors[i] = iRTVO.Overlay.floatTime2String(sector.Time, 1, false); } else { sectors[i] = "-.--"; } } else { sectors[i] = "-.--"; } } else { if (i < driver.CurrentLap.SectorTimes.Count) { iRTVO.LapInfo.Sector sector = driver.CurrentLap.SectorTimes.Find(s => s.Num.Equals(i)); if (sector != null) { sectors[i] = iRTVO.Overlay.floatTime2String(sector.Time, 1, false); } else { sectors[i] = "-.--"; } } else { sectors[i] = "-.--"; } } } } if (SharedData.Sessions.CurrentSession.Type == Sessions.SessionInfo.sessionType.race && driver.TrackSurface == Sessions.SessionInfo.StandingsItem.SurfaceType.NotInWorld && SharedData.allowRetire && (SharedData.Sessions.CurrentSession.Time - driver.OffTrackSince) > 1) { retired = true; if (infront.CurrentLap.LapNum > driver.CurrentLap.LapNum) { interval = (infront.CurrentLap.LapNum - driver.CurrentLap.LapNum) + " L"; } else { interval = iRTVO.Overlay.floatTime2String((driver.PreviousLap.Gap - infront.PreviousLap.Gap), 3, false); } if ((leader.CurrentLap.LapNum - driver.CurrentLap.LapNum) > 0) { gap = leader.CurrentLap.LapNum - driver.CurrentLap.LapNum + " L"; } else { gap = iRTVO.Overlay.floatTime2String(driver.PreviousLap.Gap, 3, false); } } else { retired = false; } }
public String getDriverInfo(String script, String method, Sessions.SessionInfo.StandingsItem standing, Sessions.SessionInfo session, Int32 rounding) { return(scripts[script].DriverInfo(method, standing, session, rounding)); }