private void AttemptSeparatorConnection()
        {
            try
            {
                // Initialise the Separator connection
                mySeparatorGateway.InitialiseConnection(myCultureInfo);

                mySeparator = SeparatorGateway.GetInstance().ControlApi;
                myEventSink = SeparatorGateway.GetInstance().EventsApi;

                if (myEventSink != null)
                {
                    myEventSink.ReportInstrumentInformation += new Tesla.Separator.ReportInstrumentInfoDelegate(AtReportInstrumentInformation);
                }

                // Actually connect the UI to the Separator server
                mySeparatorGateway.Connect(true);
            }


            catch (ApplicationException /*aex*/)
            {
                // Allow application exceptions to propagate upwards.  That is, if the
                // InitialiseConnection times out, we use the generated ApplicationException
                // to trigger application shutdown.
            }
            catch (Exception ex)
            {
                LogFile.LogException(System.Diagnostics.TraceLevel.Error, ex);
            }
        }
Esempio n. 2
0
        public PauseResumeDialog(SeparatorEventSink eventSink)
            : base(RoboSep_UserConsole.getInstance(), GUI_Controls.MessageIcon.MBICON_INFORMATION, "", "")
        {
            // This call is required by the Windows Form Designer.
            InitializeComponent();

            // Keep a reference to the given event sink so we can register locally for
            // separator events.
            myEventSink = eventSink;

            // configure the timeout timer
            timerPausingTimeout.Interval = defaultPauseTimeout;


            LogFile.AddMessage(System.Diagnostics.TraceLevel.Info, "PauseResumeDialog form created");
        }