예제 #1
0
        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);
            }
        }
예제 #2
0
        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);
            }
        }
예제 #3
0
 public TireReading Read(VehicleTireReading ParentReading)
 {
     TireReading currentReading = new TireReading(ParentReading, this);
     return currentReading;
 }
예제 #4
0
        public TireReading Read(VehicleTireReading ParentReading)
        {
            TireReading currentReading = new TireReading(ParentReading, this);

            return(currentReading);
        }