public VehicleTireReading(IVehicle CurrentVehicle) { Id = Guid.NewGuid(); CurrentTires = CurrentVehicle.Tires; ReadingTimeStamp = DateTime.UtcNow; CurrrentDistanceTraveled = CurrentVehicle.OdometerInMiles; ReadingId = createReadingHashKey(ReadingTimeStamp, CurrentVehicle.Id); VehicleId = CurrentVehicle.Id; TypeOfCar = CurrentVehicle.VehicleType; Readings = new List<TireReading>(); int maxSpeed = 0; int lastSpeed = 0; foreach (CarTire ct in CurrentTires) { TireReading currentReading = new TireReading(this, ct); lastSpeed = ct.GetCurrentSpeed(); //Capture the last speed if (lastSpeed > CurrentSpeed) { CurrentSpeed = lastSpeed; } maxSpeed = ct.MaxSpeedRating; Readings.Add(currentReading); } }
public VehicleTireReading(IVehicle CurrentVehicle) { Id = Guid.NewGuid(); CurrentTires = CurrentVehicle.Tires; ReadingTimeStamp = DateTime.UtcNow; CurrrentDistanceTraveled = CurrentVehicle.OdometerInMiles; ReadingId = createReadingHashKey(ReadingTimeStamp, CurrentVehicle.Id); VehicleId = CurrentVehicle.Id; TypeOfCar = CurrentVehicle.VehicleType; Readings = new List <TireReading>(); int maxSpeed = 0; int lastSpeed = 0; foreach (CarTire ct in CurrentTires) { TireReading currentReading = new TireReading(this, ct); lastSpeed = ct.GetCurrentSpeed(); //Capture the last speed if (lastSpeed > CurrentSpeed) { CurrentSpeed = lastSpeed; } maxSpeed = ct.MaxSpeedRating; Readings.Add(currentReading); } }
public TireReading Read(VehicleTireReading ParentReading) { TireReading currentReading = new TireReading(ParentReading, this); return currentReading; }
public TireReading Read(VehicleTireReading ParentReading) { TireReading currentReading = new TireReading(ParentReading, this); return(currentReading); }