private void ExportHighFuncToCall(object context) { //Open file save dialog and save csv file Microsoft.Win32.SaveFileDialog dialog = new Microsoft.Win32.SaveFileDialog(); dialog.Filter = "CSV|*.csv"; if (dialog.ShowDialog() == true) { List <CSVInstanceObject> testObjects = CSVModel.populateInstanceObjects(); var longCsv = CreateCSVFromList.CreateCSV(testObjects); File.WriteAllText(dialog.FileName, longCsv.ToString()); } }
private void ExportGraphFuncToCall(object context) { //write CSV files locally in order to export them to excell string fullFilepath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"Data\\100Hz.csv"); string sampledFilepath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"Data\\10Hz.csv"); List <CSVInstanceObject> testObjects = CSVModel.populateInstanceObjects(); var csvFull = CreateCSVFromList.CreateCSV(testObjects); File.WriteAllText(fullFilepath, csvFull.ToString()); List <CSVInstanceObject> reducedSampleRateObjects = SampleRateConverter.ConvertSampleRate(testObjects); var shortCsv = CreateCSVFromList.CreateCSV(reducedSampleRateObjects); File.WriteAllText(sampledFilepath, shortCsv.ToString()); AddExcelGraph.exportGraph(sampledFilepath, fullFilepath, reducedSampleRateObjects.Count, testObjects.Count); }