//Matlab /// <summary> /// Checks to see if Matlab is still open and asks to Reload the logged data and reopens matlab. /// </summary> /// <param name="showDialog"> Whether to show a dialog with yes or no.</param> public void checkMatlab(bool showDialog) { if (showDialog) { bool hasMatlab = MatlabAccess.isMatlabOpen(); if (!hasMatlab && !checkedMatlab) { DialogResult result1 = MessageBox.Show(" Matlab has been closed. Do you want to reopen Matlab and load with Logged inputs? To start with an empty workspace, click No.", "Matlab has Closed", MessageBoxButtons.YesNoCancel); if (result1 == DialogResult.Yes) { MatlabAccess.MatlabStartup(); LogSystem.SaveLog("temp.txt"); LogSystem.Clear(); importLog("temp.txt"); checkedMatlab = false; } else if (result1 == DialogResult.No) { MatlabAccess.MatlabStartup(); } else { checkedMatlab = true; } } } else { MatlabAccess.MatlabStartup(); LogSystem.SaveLog("temp.txt"); LogSystem.Clear(); importLog("temp.txt"); checkedMatlab = false; } }
// Save Logs /// <summary> /// Calls the LogSystem.Save method. /// </summary> /// <param name="filePath">The path to where the file will be written.</param> public void saveCurrentLog(string filePath) { LogSystem.SaveLog(filePath); }