private void LoadFirstApplication()
        {
            var sel = _applicationReference.First();

            try
            {
                _app = AppLocator.GetApplicationConnection(sel);
                if (_app == null)
                {
                    Logger.Error("Please start the instrument software first.");
                    Environment.Exit(-1);
                }
            }
            catch (Exception e)
            {
                Logger.Error(e);
                throw;
            }

            Logger.Info($"Successfully load {sel.AppType.ToString()}");

            try
            {
                // Initializing client
                if (!CreateTcpChannel())
                {
                    Logger.Error("Failed to create tcp channel.");
                    Environment.Exit(-1);
                }

                _client = new AutoChemClient(_config);
                _app.RegisterClient(_client);
                _liveExperiment = _app.NewExperimentWithWizard("", "");
                _liveExperiment.RegisterClient(_client);
            }
            catch (Exception e)
            {
                Logger.Error(e);
                throw;
            }
        }
Example #2
0
 public void DocumentClosed(IApplicationConnection application, IDocumentConnection document)
 {
     Logger.Info($"Document {document.DocumentName} closed");
 }