MatlabStartup() public static method

Starts with Program, either connects to COM-Enabled Matlab or starts a Matlab File.
The call "enableservice('AutomationServer',true);" COM-enables Matlab and ensures it doesn't close with the program.
public static MatlabStartup ( ) : void
return void
Beispiel #1
0
 //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;
     }
 }
Beispiel #2
0
 /// <summary>
 /// Starts up the Desktop Matlab or attaches to COM-Enabled Matlab.
 /// to Com-Enable Matlab use [ enableservice('AutomationServer',true);]
 /// </summary>
 public MainControl()
 {
     // Matlab Startup and Connection to Desktop
     MatlabAccess.MatlabStartup();
     checkedMatlab = false;
 }