Example #1
0
    /**
     * Read out any saved measurements for the given MeasurementType.
     * Return null if no measurements found.
     **/
    public List <Points> GetSortedMeasurementListByType(MeasurementType measurementType)
    {
        /*
         * Task<List<GrowthMeasurement>> thread = new Task<List<GrowthMeasurement>>(() =>
         * {
         *  return Measurements.GetSortedMeasurementList(measurementType);
         * });
         * thread.Start();
         * return await thread;
         */
        List <GrowthMeasurement> measurements = Measurements.GetSortedMeasurementList(measurementType);

        if (measurements == null)
        {
            return(null);
        }
        List <Points> series = new List <Points>();

        foreach (GrowthMeasurement measurement in measurements)
        {
            series.Add(new Points(GetMeasurementAge(measurement), measurement.Value));
        }
        return(series);
    }