public void NewMeasurement(string station, System.DateTime dateTime, string actual) { int acctual = int.Parse(actual); iceCreamMonitor.AddMeasurement(station, dateTime, acctual); view.SetActual(actual); view.SetStation(station); view.SetDate(dateTime); }
// TODO // Implement the missing parts of the presenter public void ChangeStation(string stationId) { foreach (Measurement measurement in iceCreamMonitor.GetMeasurements()) { if (measurement.StationId.Equals(stationId)) { view.SetStation(stationId); view.SetDate(measurement.Date); view.SetActual(measurement.Actual.ToString()); VarianceRange varianceRange = VarianceRange.normal; view.SetVarianceColor(Color.FromRgb(200, 0, 0)); view.SetVariance(iceCreamMonitor.CalculateVariance(measurement.Actual, out varianceRange).ToString()); } } }