/// <summary>
        /// Initialize service
        /// </summary>
        /// <returns>ITask enumerator</returns>
        private IEnumerator <ITask> Initialize()
        {
            if (this.serviceState == null)
            {
                this.serviceState = new DssLogAnalyzerState();
                this.serviceState.LogFilesFolder = string.Empty;
                this.serviceState.Envelopes      = new List <EnvelopeList>();
            }

            if (this.serviceState.Headless == false)
            {
                this.wpfServicePort = ccrwpf.WpfAdapter.Create(TaskQueue);
                var runWindow = this.wpfServicePort.RunWindow(() => new UserInterface(this));
                yield return((Choice)runWindow);

                var exception = (Exception)runWindow;
                if (exception != null)
                {
                    LogError(exception);
                    StartFailed();
                    yield break;
                }

                this.userInterface = (UserInterface)runWindow;
            }

            this.Load();
        }
Пример #2
0
        /// <summary>
        /// ITask enumerator interface for processing loaded log files
        /// </summary>
        /// <param name="logFilesLoaded">Which log files have been loaded</param>
        /// <returns>
        /// ITask enumerator
        /// </returns>
        public IEnumerator <ITask> LogFilesLoaded(loganalyzer.LogFilesLoaded logFilesLoaded)
        {
            if (this.wpfServicePort == null)
            {
                this.wpfServicePort = ccrwpf.WpfAdapter.Create(TaskQueue);
                var runWindow = this.wpfServicePort.RunWindow(() => new RawViewerPluginUi(this));
                yield return((Choice)runWindow);

                var exception = (Exception)runWindow;
                if (exception != null)
                {
                    LogError(exception);
                    StartFailed();
                    yield break;
                }

                this.userInterface = (RawViewerPluginUi)runWindow;
            }

            var get = new loganalyzer.Get();

            this.logAnalyzer.Post(get);

            loganalyzer.DssLogAnalyzerState logAnalyzerState = null;

            yield return(get.ResponsePort.Choice(
                             state => logAnalyzerState = state,
                             fault => LogError(fault)));

            if (logAnalyzerState == null)
            {
                yield break;
            }

            var listOfEnvelopes = logAnalyzerState.Envelopes;

            yield return(new IterativeTask(() => this.UpdateUiFromListsOfEnvelopes(listOfEnvelopes)));

            yield break;
        }
Пример #3
0
        /// <summary>
        /// ITask enumerator interface for processing selected envelopes
        /// </summary>
        /// <param name="envelopesSelected">Envelopes selected</param>
        /// <returns>
        /// ITask enumerator
        /// </returns>
        public IEnumerator <ITask> EnvelopesSelected(loganalyzer.EnvelopesSelected envelopesSelected)
        {
            var get = new loganalyzer.Get();

            this.logAnalyzer.Post(get);

            loganalyzer.DssLogAnalyzerState logAnalyzerState = null;

            yield return(get.ResponsePort.Choice(
                             state => logAnalyzerState = state,
                             fault => LogError(fault)));

            if (logAnalyzerState == null)
            {
                yield break;
            }

            var envelopes = logAnalyzerState.CurrentSelectedEnvelopes;

            yield return(new IterativeTask(() => this.UpdateUiFromListsOfEnvelopes(new List <loganalyzer.EnvelopeList> {
                envelopes
            })));
        }