Example #1
0
        /// <summary>
        /// Gets the current mileage of the vehicle
        /// </summary>
        public int GetMileage()
        {
            int milage = 0;

            VehicleStatusReport.VehicleStatus odometerMiles = VehicleStatusRaw.vehicleStatus.First(status => status.key == "ODOMETER_MILES");
            milage = Convert.ToInt32(odometerMiles.value);

            if (milage == 0)
            {
                VehicleStatusReport.VehicleStatus odometerMetre = VehicleStatusRaw.vehicleStatus.First(status => status.key == "ODOMETER_METER");
                milage = (int)(Convert.ToInt32(odometerMetre.value) / 1000 / 1.609);
            }

            return(milage);
        }
Example #2
0
 /// <summary>
 /// Returns the remaining run time left for remote climate
 /// </summary>
 /// <returns></returns>
 public int GetRemainingClimateRunTime()
 {
     VehicleStatusReport.VehicleStatus remainingRunTime = VehicleStatusRaw.vehicleStatus.First(status => status.key == "CLIMATE_STATUS_REMAINING_RUNTIME");
     return(Convert.ToInt32(remainingRunTime.value));
 }
Example #3
0
 public override int GetDistanceUntilEmpty()
 {
     VehicleStatusReport.VehicleStatus remainingFuel = VehicleStatusRaw.vehicleStatus.First(status => status.key == "DISTANCE_TO_EMPTY_FUEL");
     return(Convert.ToInt32(Convert.ToDouble(remainingFuel.value) / 1.609));
 }
Example #4
0
 /// <summary>
 /// Retrieves the next service due in miles
 /// </summary>
 public int GetServiceDueInMiles()
 {
     VehicleStatusReport.VehicleStatus odometerReading = VehicleStatusRaw.vehicleStatus.First(status => status.key == "EXT_KILOMETERS_TO_SERVICE");
     return(Convert.ToInt32(Convert.ToDouble(odometerReading.value) / 1.609));
 }
Example #5
0
 /// <summary>
 /// Retrieves the fuel level as a percentage
 /// </summary>
 /// <returns></returns>
 public int GetFuelLevelPercentage()
 {
     VehicleStatusReport.VehicleStatus odometerReading = VehicleStatusRaw.vehicleStatus.First(status => status.key == "FUEL_LEVEL_PERC");
     return(Convert.ToInt32(odometerReading.value));
 }