/// <summary> /// 获取车辆状态,“行驶”“停车熄火”“停车未熄火”“离线”"报警", 离线 优先于 报警 ,报警优先于其他 /// </summary> public static EnumVehicleState GetVehicleFullState(VCurrentInfo info) { EnumOnLineState state = GetOnLineState(info.ReportTime); if (state == EnumOnLineState.OffLine) return EnumVehicleState.OffLine; if (info.IsWarning) return EnumVehicleState.Warning; if (info.Speed > 0) return EnumVehicleState.Run; return EnumVehicleState.Stop; }
public VCurrentInfo GetSingleCurrentInfoList(Guid vehicleCode, EnumMapType mapType) { var vehicleDetailInfo = DACFacade.Movo.VehicleDAC.Select(vehicleCode, mapType); VCurrentInfo vm = new VCurrentInfo(); vm.LicenceNumber = vehicleDetailInfo.LicenceNumber; vm.Direction = vehicleDetailInfo.Direction; vm.Latitude = vehicleDetailInfo.Lat; vm.Longitude = vehicleDetailInfo.Lng; vm.ReportTime = vehicleDetailInfo.ReportTime; vm.VehicleCode = vehicleCode; vm.GPSCode = vehicleDetailInfo.GPSCode; vm.Speed = vehicleDetailInfo.Speed; if (vehicleDetailInfo.ReportTime.HasValue) { vm.RunningOrOffTime = DACFacade.Gps.GPSHistoryDAC.GetRunngingOrOffTime(vehicleCode, vehicleDetailInfo.ReportTime.Value, vehicleDetailInfo.Acc); } vm.Acc = vehicleDetailInfo.Acc; DateTime endTime = vehicleDetailInfo.ReportTime.Value; DateTime beginTime = new DateTime(endTime.Year, endTime.Month, 1); EMileage em = ModelFacade.Report.ReportSummaryModel.GetTimeSpanMileageReportList(vehicleCode, beginTime, endTime, false); vm.TotalMileage = (double)em.TotalMileage; vm.Location = vehicleDetailInfo.Location; vm.RoadName = vehicleDetailInfo.RoadName; vm.City = vehicleDetailInfo.City; vm.GPSTypeName = vehicleDetailInfo.GPSTypeName; vm.IsStop = vehicleDetailInfo.IsStop; vm.IsOverdue = vehicleDetailInfo.IsOverdue; vm.IsWarning = vehicleDetailInfo.IsWarning; if (vm.GPSTypeName.Contains("GT06")) { if (vm.Acc == 1) { vm.ACCState = "点火"; } else { vm.ACCState = "熄火"; } } else { vm.ACCState = "-"; } return vm; }
/// <summary> /// 获取车辆状态,“行驶”“停车熄火”“停车未熄火”“离线”"报警", 离线 优先于 报警 ,报警优先于其他 /// </summary> public static string GetVehicleFullStateStr(VCurrentInfo info) { EnumVehicleState state = GetVehicleFullState(info); return EnumVehicleStateStringHelper.GetString(state); }
public VCurrentInfo GetSingleCurrentInfoList(Guid vehicleCode, EnumMapType mapType) { VMonitorVehicle vehicleDetailInfo = DACFacade.Movo.VehicleDAC.Select(vehicleCode, mapType); VCurrentInfo vm = new VCurrentInfo(); vm.LicenceNumber = vehicleDetailInfo.LicenceNumber; vm.Direction = vehicleDetailInfo.Direction; vm.Latitude = vehicleDetailInfo.Lat; vm.Longitude = vehicleDetailInfo.Lng; vm.ReportTime = vehicleDetailInfo.ReportTime; vm.VehicleCode = vehicleCode; vm.GPSCode = vehicleDetailInfo.GPSCode; vm.Speed = vehicleDetailInfo.Speed; if (vehicleDetailInfo.ReportTime.HasValue) { vm.RunningOrOffTime = DACFacade.Gps.GPSHistoryDAC.GetRunngingOrOffTime(vehicleCode, vehicleDetailInfo.ReportTime.Value, vehicleDetailInfo.Acc); } vm.Acc = vehicleDetailInfo.Acc; vm.TotalMileage = GetTotalMileage(vehicleCode, vehicleDetailInfo.ReportTime.Value); vm.Location = vehicleDetailInfo.Location; vm.RoadName = vehicleDetailInfo.RoadName; vm.City = vehicleDetailInfo.City; vm.GPSTypeName = vehicleDetailInfo.GPSTypeName; vm.IsStop = vehicleDetailInfo.IsStop; vm.IsOverdue = vehicleDetailInfo.IsOverdue; vm.IsWarning = vehicleDetailInfo.IsWarning; if (vm.GPSTypeName.Contains("GT06") || vm.GPSTypeName.Contains("BuBiao") || vm.GPSTypeName.Contains("MOVO HB A5")) { if (vm.Acc == 1) { vm.ACCState = "点火"; } else { vm.ACCState = "熄火"; } } else { vm.ACCState = "-"; } return vm; }