private string BuildHistory(TheFixedQueue <MeasurementDetails> queueCollection) { //Loop through the collection and build a string of collected historical values StringBuilder buildString = new StringBuilder(); int counter = 0; foreach (var i in queueCollection.queue) { //If the user selected metric, return the metric value along with the date time //otherwise return the imperial value along with the date time if (unitsToUse == Units.Metric) { buildString.AppendLine($"{MetricValue(i.Measurement)} cm {i.DateTime}"); } else { buildString.AppendLine($"{ImperialValue(i.Measurement)} in {i.DateTime}"); } //Populate dataCaptured array for raw data dataCaptured[counter] = i.Measurement; counter++; } return(buildString.ToString()); }
public MeasureLengthDevice() { device = new Device(); queue = new TheFixedQueue <MeasurementDetails>(); queue.Limit = 10; mostRecentMeasure = Measurement; unitsToUse = Units.Imperial; dataCaptured = new int[10]; }