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);
            }
        }
Esempio n. 3
0
 public TireReading Read(VehicleTireReading ParentReading)
 {
     TireReading currentReading = new TireReading(ParentReading, this);
     return currentReading;
 }
Esempio n. 4
0
        public TireReading Read(VehicleTireReading ParentReading)
        {
            TireReading currentReading = new TireReading(ParentReading, this);

            return(currentReading);
        }