public static FormViewMeasure getFormForMeasure(MeasureData data) { FormViewMeasure form = new FormViewMeasure(data); form.Text = "Просмотр измерения: " + data.ToString() + (data.ID != -1 ? "" : " * "); form.ShowReport(); form.Show(); return(form); }
private void buttonMiddle_Click(object sender, EventArgs e) { try { Dictionary <MeasureData, double> _measures = new Dictionary <MeasureData, double>(); Mask _mask = comboBoxMasks.SelectedItem as Mask; foreach (object o in listBoxMeasures.Items) { if (multiGraph.Plotters.ContainsKey(o as MeasureData)) { _measures.Add(o as MeasureData, (multiGraph.Plotters[o as MeasureData] as MovableGraph).Correcture); } } if (_measures.Count < 3) { MessageBox.Show("Недостаточно измерений:\r\nнеобходимо не менее трёх измерения для расчёта среднего."); return; } double _maxlen = double.MaxValue; foreach (MeasureData data in _measures.Keys) { _maxlen = Math.Min(_maxlen, data.FullMeasureLength); } if (_maxlen < 1d) { MessageBox.Show("Самое короткое измерение имеет продолжительность менее секунды."); return; } string s = FormStringRequest.GetString("Введите название измерения"); MeasureData result = null; if (s != null) { result = AlgsList.reliableMiddle(_measures, s, _mask, _maxlen); FormViewMeasure.getFormForMeasure(result); } } catch (Exception ex) { MessageBox.Show("Ошибка:\r\n" + ex.Message); } }
private void загрузитьИзXMLToolStripMenuItem_Click(object sender, EventArgs e) { openFileDialog.Filter = "XML файлы|*.xml"; if (openFileDialog.ShowDialog() == DialogResult.OK) { MeasureData m = null; try { m = MeasureData.fromXML(File.ReadAllText(openFileDialog.FileName), Program.DataProvider.Masks, Program.DataProvider.SensorList); } catch (Exception ex) { Error.Log(ex); MeasureData.message = ex.Message; } if (m != null) { FormViewMeasure.getFormForMeasure(m); } else { MessageBox.Show("Ошибка чтения измерения: " + MeasureData.message); } } }
private void buttonOpen_Click(object sender, EventArgs e) { FormViewMeasure.getFormForMeasure(measureData); }