//TODO private void Export2Excel_Clicked(object sender, EventArgs e) { var dc = DataContext as IDendritiRecord <ObservationSeries>; if (dc != null && dc.Children.Count == 0) { SaveFileDialog dlg = new SaveFileDialog(); dlg.Filter = "csv file|*.csv"; dlg.FileName = dc.Name + ".csv"; if (dlg.ShowDialog() == DialogResult.OK) { var qc = new QueryCriteria() { SiteID = dc.Value.SiteID, VariableID = dc.Value.VariableID, AllTime = true }; var ts = ODMSource.GetTimeSeries(qc); if (ts != null) { CSVFileStream csvf = new CSVFileStream(dlg.FileName); csvf.Save(ts); } } } }
private void Plot(object sender, EventArgs e) { var dc = DataContext as IDendritiRecord <ObservationSeries>; if (dc != null && dc.Children.Count == 0) { var qc = new QueryCriteria() { SiteID = dc.Value.SiteID, VariableID = dc.Value.VariableID, AllTime = true }; var ts = ODMSource.GetTimeSeries(qc); if (ts != null) { ShellService.ShowChildWindow(ChildWindowNames.WinChartView); ShellService.WinChart.Plot(ts.DateTimes, ts[0, ":", "0"], qc.VariableName, System.Windows.Forms.DataVisualization.Charting.SeriesChartType.FastLine); } } }