/// <summary> /// called when chunk button is pressed /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ChunkDataButton_Click(object sender, EventArgs e) { if (dw1 == null || dw2 == null) { MessageBox.Show("Error: Please load both files", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } int numberOfChunks = 0; int length = 0; try { numberOfChunks = Convert.ToInt32(ChunkSizeBox.Text); //we need to see if they are of different lengths //if they are the final selection box if (dw1.GetFullData().DataEuro.Count == dw2.GetFullData().DataEuro.Count) { length = dw1.GetFullData().DataEuro.Count; } else if (dw1.GetFullData().DataEuro.Count > dw2.GetFullData().DataEuro.Count) { length = dw2.GetFullData().DataEuro.Count; } else if (dw1.GetFullData().DataEuro.Count < dw2.GetFullData().DataEuro.Count) { length = dw1.GetFullData().DataEuro.Count; } int chunkSize = length / numberOfChunks; file1.ChunkData(chunkSize, numberOfChunks); file2.ChunkData(chunkSize, numberOfChunks); chunkSelectionBox.Items.Clear(); chunkSelectionBox.Items.Add("Full Data"); for (int i = 1; i <= numberOfChunks; i++) { chunkSelectionBox.Items.Add("" + i + "/" + numberOfChunks); } } catch (Exception e1) { MessageBox.Show("Error: Number of Chunks wrong value" + e1.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
/// <summary> /// Constructor /// </summary> /// <param name="dv">reference to the dataview for this file</param> /// <param name="cyMain">refrenec to the main window</param> /// <param name="file">file, file 1 or file 2</param> public ComparrisonControl(DataViewImproved dv, CyclingMain cyMain, string file) { InitializeComponent(); this.dv = dv; this.hrData = dv.GetFullData(); this.cyMain = cyMain; unit = false; this.file = file; groupBox1.Text = file; chunks = new List <DateTime[]>(); data[0] = hrData.DataEuro; data[1] = hrData.DataUS; UpdateSummaryNoDate(); FullDataNoDate(); //just set the data in the view now }