2018-12-10 20:17:00 +00:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
|
using System.Data;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Windows.Forms;
|
2018-12-19 11:23:41 +00:00
|
|
|
|
using System.Windows.Forms.DataVisualization.Charting;
|
|
|
|
|
|
using Results.Entities;
|
2018-12-10 20:17:00 +00:00
|
|
|
|
|
|
|
|
|
|
namespace Statistics.UserControls
|
|
|
|
|
|
{
|
|
|
|
|
|
public partial class StatisticsCtrl : UserControl
|
|
|
|
|
|
{
|
|
|
|
|
|
public int Id; /// Index of the tab page
|
|
|
|
|
|
public MidOrWaterMetersCtrl BenchesCtrl; /// Reference to the parent control
|
|
|
|
|
|
|
|
|
|
|
|
public StatisticsCtrl()
|
|
|
|
|
|
{
|
|
|
|
|
|
InitializeComponent();
|
2018-12-19 11:23:41 +00:00
|
|
|
|
chart1.ChartAreas[0].AxisX.LabelStyle.Format = "dd.MM.yy";
|
|
|
|
|
|
chart1.ChartAreas[0].AxisX.Interval = 1;
|
|
|
|
|
|
chart1.ChartAreas[0].AxisX.IntervalType = DateTimeIntervalType.Days;
|
2018-12-10 20:17:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void updateButton_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
2018-12-19 11:23:41 +00:00
|
|
|
|
if (BenchesCtrl != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
IList<TestRslt> results = BenchesCtrl.UpdateRequest(Id);
|
|
|
|
|
|
|
|
|
|
|
|
if (results != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
foreach (var r in results)
|
|
|
|
|
|
{
|
|
|
|
|
|
chart1.Series["Error"].Points.AddXY(r.StartTime, r.ErrorMaster);
|
|
|
|
|
|
}
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
chart1.Series["Error"].Points.Clear();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void exportButton_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
2018-12-10 20:17:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|