//Others Classes.RaceTab ReadRaceTabFromForm() { Classes.RaceTab rt = new RaceTab(); rt.SeasonTrackIndex = cBoxNextRacingTrack.SelectedIndex; int tempVar; if (!int.TryParse(txtRaceLaps1.Text.ToString(), out tempVar)) { tempVar = 0; } rt.CustomLap1 = tempVar; if (!int.TryParse(txtRaceLaps2.Text.ToString(), out tempVar)) { tempVar = 0; } rt.CustomLap2 = tempVar; rt.Compound = cBoxRaceCompound.SelectedIndex; if (!int.TryParse(txtRaceCt.Text.ToString(), out tempVar)) { tempVar = 0; } rt.CT = tempVar; if (!int.TryParse(txtRaceTemp.Text.ToString(), out tempVar)) { tempVar = 0; } rt.Temp = tempVar; if (!int.TryParse(txtRaceHum.Text.ToString(), out tempVar)) { tempVar = 0; } rt.Hum = tempVar; rt.Rain = rBttRain.Checked; return(rt); }
SeasonPlannerFullLine GetInitialSpFull() { SeasonPlannerFullLine spFull = new SeasonPlannerFullLine(); SeasonPlannerDecision[] spDecisions = DB.SeasonPlannerTab.ReadSpDecisionsFromDB(0); SeasonPlannerForOptimizer spOptimizer = new SeasonPlannerForOptimizer(); RaceTab rTab = DB.RaceTab.ReadRaceTabFromDB(); spOptimizer.raceTab = rTab; SeasonPlannerTab spTab = DB.SeasonPlannerTab.ReadSeasonPlannerTabFromDB(); spOptimizer.spTab = spTab; StaffFacilities sf = DB.StaffFacilities.ReadStaffFacilitiesFromDB(); spOptimizer.staffFacilities = sf; TechnicalDirector td = DB.TechnicalDirector.ReadTdFromDB(); spOptimizer.technicalDirector = td; Driver driver = DB.Driver.ReadDriverFromDB(); spOptimizer.driver = driver; Car car = DB.Car.ReadCarFromDB(); spOptimizer.car = car; SeasonPlannerForDataTable spTable = new SeasonPlannerForDataTable(); spTable.BalanceAfterRaceM = spTab.StartingBalanceM; spFull.spTable = spTable; spFull.spOptimizer = spOptimizer; spFull.spTab = spTab; spFull.spDecisions = spDecisions[0]; return(spFull); }