/// <summary> /// Called when load file two dialog is file ok /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void file2Dialog_FileOk(object sender, CancelEventArgs e) { if (file2Dialog.FileName != null && !file2Dialog.FileName.Equals("")) { polar2 = new Polar(); polar2.LoadData(file2Dialog.FileName); dw2 = new DataViewImproved(polar2.GetUnit(), polar2.GetHrData(), polar2.GetSMODE(), this.polar2, this, polar2.GetRideInfo()); //dw1.AddRideInfo(polar.GetRideInfo()); dw2.AddFullData(); dw2.SetFTP(ftp); dw2.Dock = DockStyle.Fill; if (dw2.GetInterval() != dw1.GetInterval()) { MessageBox.Show("Error: Please load a file with the same recording interval", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); dw2 = null; return; } //singleView.Controls.Clear(); //singleView.Controls.Add(dw2); //enterMaximumHeartRateToolStripMenuItem.ShowDropDown(); // ftpMenu.ShowDropDown(); //menuStrip3.Hide(); file2 = new ComparrisonControl(dw2, this, "file2"); AddComparison(); } }
/// <summary> /// Constructor /// </summary> /// <param name="data">The list of data, used to create the markers</param> /// <param name="dv">a reference to the corrsiponding data view</param> /// <param name="Unit">the unit the chunks will be in US or Euro</param> /// <param name="interval">the recording interval</param> public MultipleSummaries(List <HrDataSingle>[] data, DataViewImproved dv, bool Unit, int interval) { InitializeComponent(); this.data = data; this.dv = dv; this.interval = interval; this.markers = new List <Marker>(); }
/// <summary> /// Constructor for this class /// </summary> public CyclingMain() { InitializeComponent(); ftp = 0.0; maxHr = 0; enterMaximumHeartRateToolStripMenuItem.HideDropDown(); ftpMenu.HideDropDown(); this.Invalidate(); dw1 = null; chunkSelectionBox.Text = "Full Data"; }
/// <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 }
/// <summary> /// Constuctor /// </summary> /// <param name="marker">what index the marker is</param> /// <param name="dv">a reference to the data view</param> /// <param name="start">start time</param> /// <param name="end">end time</param> /// <param name="data">the data of this section</param> /// <param name="unit">the unit in this file</param> /// <param name="interval">the recording interval</param> /// <param name="type">true if marker is used for the chunks of data, false if user selection</param> public UserMarkerControl(int marker, DataViewImproved dv, DateTime start, DateTime end, List <HrDataSingle>[] data, bool unit, int interval, bool type) { InitializeComponent(); this.markerIndex = marker; this.dv = dv; this.start = start; this.end = end; startTime.Text = start.ToLongTimeString(); endTime.Text = end.ToLongTimeString(); Console.WriteLine("Length of data in marker: " + data[0].Count); this.data = data; this.unit = unit; this.interval = interval; this.type = type; //chunkData.Hide(); if (type) { loadSectionLink.Hide(); chunkData.Hide(); } }
/// <summary> /// Event called when ok is pressed on the fileopendialog /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void FileOk(object sender, CancelEventArgs e) { if (fileDialog.FileName != null || !fileDialog.FileName.Equals("")) { polar = new Polar(); polar.LoadData(fileDialog.FileName); dw1 = new DataViewImproved(polar.GetUnit(), polar.GetHrData(), polar.GetSMODE(), this.polar, this, polar.GetRideInfo()); //dw1.AddRideInfo(polar.GetRideInfo()); dw1.AddFullData(); dw1.SetFTP(ftp); dw1.Dock = DockStyle.Fill; singleView.Controls.Clear(); singleView.Controls.Add(dw1); enterMaximumHeartRateToolStripMenuItem.ShowDropDown(); ftpMenu.ShowDropDown(); //menuStrip3.Hide(); file1 = new ComparrisonControl(dw1, this, "file1"); AddComparison(); } }