public async Task <List <DataPoint> > FetchData(bool applyTimeShift) { List <DataPoint> dataPoints; // Decide if we want display time shift TimeShift timeShift = null; if (applyTimeShift && DisplayTimeShift.IsTimeShiftZero() == false) { timeShift = DisplayTimeShift; } dataPoints = await Measurement.FetchDataAsync(null); // Handling timeshift here instead of the measurement to achieve modularity if (timeShift != null) { //todo complete this // find the shifting in double value double shiftForDateTime = timeShift.ToDoubleForDateTime(); for (int dataPntIter = 0; dataPntIter < dataPoints.Count; dataPntIter++) { double newX = dataPoints[dataPntIter].X + shiftForDateTime; dataPoints[dataPntIter] = new DataPoint(newX, dataPoints[dataPntIter].Y); } } return(dataPoints); }
public LineSeriesConfig Clone() { LineSeriesConfig config = new LineSeriesConfig { Name = Name, Appearance = Appearance.Clone(), Measurement = Measurement.Clone(), DisplayTimeShift = DisplayTimeShift.Clone() }; return(config); }