public RealTimeInfoViewEntity(EGPSCurrentInfo eGPSCurrentInfo,EBaseVehicle vehicleInfo)
 {
     this.CurrentGPSInfo = eGPSCurrentInfo;
     this.VehicleInfo = vehicleInfo;
 }
示例#2
0
        private string GetOilValue(EBaseVehicle vehicleInfo, EGPSCurrentInfo currentInfo, EGPSInstallationInfo installationInfo)
        {
            try
            {
                string oilValue = string.Empty;

                if (installationInfo != null)
                {
                    if (GPSTypeHelper.IsSupportOil(installationInfo))
                    {
                        double oliValue = CalculateOilValue.GetOilValue(vehicleInfo, installationInfo, Convert.ToDouble(currentInfo.OilBearing));
                        return oliValue.ToString("0.00");
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
            }

            return "0";
        }
示例#3
0
 private void SetDriverInfo(EBaseVehicle vehicleInfo, VRealTimeInfo realTimeInfoViewEntity, IList<EDriver> ltDriver)
 {
     try
     {
         if (vehicleInfo.DefaultDriverCode != null)
         {
             EDriver driver = ltDriver.SingleOrDefault(s => s.RecordID == vehicleInfo.DefaultDriverCode);
             if (driver != null)
             {
                 realTimeInfoViewEntity.DriverMobile = driver.Mobile;
                 realTimeInfoViewEntity.DriverName = driver.Name;
             }
         }
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
     }
 }
示例#4
0
 private void SetOilValue(EBaseVehicle vehicleInfo, VRealTimeInfo realTimeInfoViewEntity, EGPSCurrentInfo currentInfo, EGPSInstallationInfo installationInfo, bool isNotCalcOil)
 {
     if (!isNotCalcOil)      //isNotCalcOil 为真时,不取油耗数据
     {
         try
         {
             realTimeInfoViewEntity.OilValue = GetOilValue(vehicleInfo, currentInfo, installationInfo);
         }
         catch (Exception ex)
         {
             Logger.Error(ex);
         }
     }
 }
示例#5
0
 private void SetVehicleType(EBaseVehicle vehicleInfo, VRealTimeInfo realTimeInfoViewEntity, IList<VehicleType> ltVehicleType)
 {
     try
     {
         if (vehicleInfo.TypeCode != null)
         {
             VehicleType vehicleType = ltVehicleType.SingleOrDefault(s => s.RecordID == vehicleInfo.TypeCode.Value);
             if (vehicleType != null) realTimeInfoViewEntity.VehicleType = vehicleType.Name;
         }
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
     }
 }