// create or close gnuplot window void OnPlotActionActivated(object sender, System.EventArgs e) { var table = CurrentTable; if (table == null) { return; } try { // gnuplot process itself can be slow to startup // so this does not prevent closing it immediatly when pressed twice //plotExternalAction.Sensitive = false; GnuPlot.ToggleGnuPlot(table); } catch (GnuPlotProcessException ex) { Console.Error.WriteLine(ex); ErrorMsg("Error launching gnuplot!", ex.Message + "\n\nHave you installed gnuplot?" + "\nYou also may need to edit file '" + MainClass.AssemblyPath + ".exe.config'." + "\nCurrent platform-ID is '" + System.Environment.OSVersion.Platform.ToString() + "'." + "\nSee 'README.txt' for details."); } catch (GnuPlotException ex) { Console.Error.WriteLine(ex); ErrorMsg("Error launching gnuplot!", ex.Message); } catch (System.IO.FileNotFoundException ex) { Console.Error.WriteLine(ex); ErrorMsg("Error using gnuplot!", ex.Message + "\nFile: " + ex.FileName); } }
// create or close gnuplot window void OnPlotActionActivated(object sender, System.EventArgs e) { try { // gnuplot process itself can be slow to startup // so this does not prevent closing it immediatly when pressed twice //plotExternalAction.Sensitive = false; switch (CurrentUI) { case ActiveUI.View2D: Table2D table2D = dataView2DGtk.Selected; if (table2D != null) { GnuPlot.ToggleGnuPlot(table2D); } break; case ActiveUI.View3D: Table3D table3D = dataView3DGtk.Selected; if (table3D != null) { GnuPlot.ToggleGnuPlot(table3D); } break; } } catch (GnuPlotProcessException ex) { Console.Error.WriteLine(ex); ErrorMsg("Error launching gnuplot!", ex.Message + "\n\nHave you installed gnuplot?" + "\nYou also may need to edit file '" + appName + ".exe.config'." + "\nCurrent platform-ID is '" + System.Environment.OSVersion.Platform.ToString() + "'." + "\nSee 'README.txt' for details."); } catch (GnuPlotException ex) { Console.Error.WriteLine(ex); ErrorMsg("Error launching gnuplot!", ex.Message); } }