public void DisplayChartStatistics(ChartStat stats) { txtStartTimeVal.Text = stats.StartTime; txtStopTimeVal.Text = stats.StopTime; txtDurationVal.Text = stats.Duration; txtHighPeak.Text = stats.HighestPeak + " V"; txtLowPeak.Text = stats.LowestPeak + " V"; txtAvePeak.Text = stats.AveragePeak + " V"; txtLongInterval.Text = stats.LongestInterval + " s"; txtShortInterval.Text = stats.ShortestInterval + " s"; txtAveInterval.Text = stats.AverageInterval + " s"; }
public void LoadChartStatistics() { // todo // cliService.GetBehaviorStatistics( statService = statService ?? new StatisticsServiceOld(contents); // Time string startTime = behaviorGraph.StartTime.ToString("HH:mm:ss tt"); string stopTime = behaviorGraph.StopTime.ToString("HH:mm:ss tt"); string duration = (behaviorGraph.StopTime - behaviorGraph.StartTime).ToString("g"); /* * // max voltage * List <BasicEntry> maxVoltages = statService.GetMaxVoltages(); * string maxValue = maxVoltages.ToFormattedString(); * * // min voltage * List<BasicEntry> minVoltages = statService.GetMinVoltages(); * string minValue = minVoltages.ToFormattedString(); * * // average voltage * string aveValue= statService.GetAverageVoltage().ToString(CultureInfo.InvariantCulture); */ ChartStat stats = new ChartStat() { StartTime = startTime, StopTime = stopTime, Duration = duration, HighestPeak = statService.GetHighestPeak().ToString(), LowestPeak = statService.GetLowestPeak().ToString(), AveragePeak = statService.GetAveragePeak().ToString(), LongestInterval = statService.GetLongestInterval().ToString(), ShortestInterval = statService.GetShortestInterval().ToString(), AverageInterval = statService.GetAverageInterval().ToString(), }; view.DisplayChartStatistics(stats); // save memory? kasi tapos mo na basahin ung file eh. contents = null; }