private void _finalizeTrackInfo(TrackInfo trackInfo, DbRecord record, int SegmentCount) { trackInfo.OdometerEnd = record.GetDouble("Odometer"); trackInfo.ActualEndEnergy = record.GetDouble("Bat_Energy"); trackInfo.EstimatedEndEnergy = record.GetDouble("DrvEst_Eea"); trackInfo.ActualEndTime = record.GetDateTime("TimeStamp"); trackInfo.SegmentCount = SegmentCount; }
private TrackInfo _initializeTrackInfo(DbRecord record) { var newTrackInfo = new TrackInfo(); newTrackInfo.ActivityId = record.GetString("ActivityId"); newTrackInfo.VehicleKey = record.GetString("VehicleKey"); newTrackInfo.DriverId = record.GetString("DriverId"); newTrackInfo.BatteryKey = record.GetString("BatteryKey"); newTrackInfo.OdometerStart = record.GetDouble("Odometer"); newTrackInfo.ActualStartEnergy = record.GetDouble("Bat_Energy"); newTrackInfo.ActualStartTime = record.GetDateTime("TimeStamp"); var estimations = record.GetString("EndEstimations"); _extractEstimations(newTrackInfo, estimations); return newTrackInfo; }
private void _aggregateTrackInfo(TrackInfo trackInfo, DbRecord record) { var length = record.GetDouble("Seg_Length"); trackInfo.TrackDistance += length; if (!(record.IsNull("Seg_Slope"))) { var slope = record.GetDouble("Seg_Slope"); var index = (int)(Math.Round(Math.Atan(slope).ToDegrees().Limit(-10, 10) / 1.0)) + 10; trackInfo.Elevations[index] += length; } }