Esempio n. 1
0
 void ConnectToServer()
 {
     if (md == null)
     {
         md = new LiveModel(this.ModelName, serverPort, serverName);
     }
     if (!md.IsConnected)
     {
         md.Connect();
     }
 }
Esempio n. 2
0
        private void btnStartServer_Click(object sender, EventArgs e)
        {
            if (md != null)
            {
                if (md.PortNumber == this.ServerPort)
                {
                    if (md.ModelName != this.ModelName)
                    {
                        md.ShutdownModel();
                        md.Dispose();
                        md = null;
                    }
                    else
                    {
                        return;
                    }
                }
                else
                {
                    // we are going to start the model on a different port number.
                    md = null;
                }
            }

            if (md == null)
            {
                md = new LiveModel(this.ModelName, serverPort);
            }
            md.StartModel(true);
            commandLine = md.CommandLine;
            if (minimizeServerWindow)
            {
                md.MinimizeServerWindow();
            }

            if (!md.IsConnected)
            {
                md.Connect();
            }
            if (startWithTracing)
            {
                md.SetTracing(true);
            }
        }
Esempio n. 3
0
 private void btnStopServer_Click(object sender, EventArgs e)
 {
     if ((md != null) && md.IsConnected)
     {
         md.ShutdownModel();
     }
     else
     {
         if (md != null)
         {
             md.Dispose();
         }
         md = new LiveModel(null, serverPort, serverName);
         md.Connect();
     }
     md.ShutdownModel();
     md.Dispose();
     md = null;
 }
Esempio n. 4
0
 public VariableListView(LiveModel md)
 {
     InitializeComponent();
     liveModel = md;
 }