예제 #1
0
 public VehiclePerformanceEventModel(VehiclePerformanceEvent item, string provider)
 {
     id                      = item.Id;
     providerId              = provider;
     serverTime              = DateTimeOffset.UtcNow;
     eventStart              = item.eventStart;
     eventEnd                = item.eventEnd;
     vehicleId               = item.vehicleId;
     eventComment            = item.eventComment;
     hours                   = item.hours;
     odometerEnd             = item.odometerEnd;
     odometerStart           = item.odometerStart;
     engineTime              = item.engineTime;
     movingTime              = item.movingTime;
     startFuel               = item.startFuel;
     endFuel                 = item.endFuel;
     brakeApplications       = item.brakeApplications;
     engineLoadStopped       = item.engineLoadStopped;
     engineLoadMoving        = item.engineLoadMoving;
     headlightTime           = item.headlightTime;
     speedGovernorValue      = item.speedGovernorValue;
     overRpmTime             = item.overRpmTime;
     overSpeedTime           = item.overSpeedTime;
     excessSpeedTime         = item.excessSpeedTime;
     longIdleTime            = item.longIdleTime;
     shortIdleCount          = item.shortIdleCount;
     shortIdleTime           = item.shortIdleTime;
     longIdleFuel            = item.longIdleFuel;
     shortIdleFuel           = item.shortIdleFuel;
     cruiseEvents            = item.cruiseEvents;
     cruiseTime              = item.cruiseTime;
     cruiseFuel              = item.cruiseFuel;
     cruiseDistance          = item.cruiseDistance;
     topGearValue            = item.topGearValue;
     topGearTime             = item.topGearTime;
     topGearValue            = item.topGearValue;
     topGearDistance         = item.topGearDistance;
     ptoFuel                 = item.ptoFuel;
     ptoTime                 = item.ptoTime;
     seatBeltTime            = item.seatBeltTime;
     particulateFilterStatus = item.particulateFilterStatus;
     exhaustFluidLevel       = item.exhaustFluidLevel;
     overspeedLowThrottle    = item.overspeedLowThrottle;
     overspeedHiThrottle     = item.overspeedHiThrottle;
     overrpmLowThrottle      = item.overrpmLowThrottle;
     overrpmHiThrottle       = item.overrpmHiThrottle;
     lkaDisable              = item.lkaDisable;
     lkaActive               = item.lkaActive;
     ldwActive               = item.ldwActive;
     ldwDisable              = item.ldwDisable;
     if (item.thresholds != null)
     {
         thresholds = new VehiclePerformanceThresholdModel(item.thresholds, provider);
     }
 }
예제 #2
0
 public ActionResult <VehiclePerformanceEventModel> PerformanceEvent(string id)
 {
     if (Guid.TryParse(id, out var guid))
     {
         VehiclePerformanceEvent data = m_Context.VehiclePerformanceEvent.FirstOrDefault(c => c.Id == guid);
         if (data != null)
         {
             if (data.performanceThresholdId != null)
             {
                 VehiclePerformanceThreshold threshold = m_Context.VehiclePerformanceThreshold.FirstOrDefault(c => c.Id == data.performanceThresholdId);
                 data.thresholds = threshold;
             }
             return(new VehiclePerformanceEventModel(data, m_appSettings.ProviderId));
         }
         else
         {
             return(NotFound("id Not Found"));
         }
     }
     return(BadRequest("Invalid id"));
 }