Example #1
0
        public override IEnumerable <PsaTraceInfo> GetAllTraces()
        {
            LexiaTracesData tracesData = GetAllTraceData();

            foreach (LexiaTrace t in tracesData.Traces)
            {
                LexiaTraceToPsaTraceConverter converter =
                    new LexiaTraceToPsaTraceConverter(t);
                PsaTrace         trace = converter.Convert();
                PsaTraceMetadata md    = new PsaTraceMetadata();
                md.Subtype       = PsaConnectorSubtype.Trace;
                md.Connector     = DiagnosticSystemType.PP2000;
                md.SourceXmlPath = t.SourceFilePath;
                if (String.IsNullOrEmpty(md.SourceXmlPath))
                {
                    throw new Exception("input file not defined!");
                }
                PeugeotAdditionalFilePathSearcher searcher =
                    new PeugeotAdditionalFilePathSearcher(
                        PsaConnectorSubtype.Trace, md.SourceXmlPath);
                foreach (string filePath in searcher.Search())
                {
                    md.AdditionalFilePaths.Add(filePath);
                }
                yield return(new PsaTraceInfo(trace, md));
            }
        }
Example #2
0
        public override IEnumerable <PsaTraceInfo> GetAllTraces()
        {
            // 2. Use converter to convert LexiaTracesData to
            // new-style PSA TracesData
            foreach (LexiaTrace lTrace in GetTraces())
            {
                LexiaTraceToPsaTraceConverter converter
                    = new LexiaTraceToPsaTraceConverter(lTrace);
                PsaTrace         trace    = converter.Convert();
                PsaTraceMetadata metadata = new PsaTraceMetadata();

                metadata.Connector     = DiagnosticSystemType.Lexia;
                metadata.SourceXmlPath = lTrace.SourceFilePath;
                metadata.Subtype       = PsaConnectorSubtype.Trace;
                LexiaAdditionalFilePathSearcher searcher
                    = new LexiaAdditionalFilePathSearcher(metadata.Subtype,
                                                          lTrace.SourceFilePath);
                foreach (string path in searcher.Search())
                {
                    metadata.AdditionalFilePaths.Add(path);
                }
                PsaTraceInfo info = new PsaTraceInfo(trace, metadata);
                yield return(info);
            }

            // 3. Get LexiaGrapsData
            // 4. Convert it to PsaTrace
            foreach (LexiaGraphSession session in GetGraphsData().Sessions)
            {
                LexiaGraphToPsaTraceConverter converter =
                    new LexiaGraphToPsaTraceConverter(session);
                PsaTrace         trace    = converter.Convert();
                PsaTraceMetadata metadata = new PsaTraceMetadata();
                metadata.Connector     = DiagnosticSystemType.Lexia;
                metadata.SourceXmlPath = session.SourceFileName;
                metadata.Subtype       = PsaConnectorSubtype.Graph;
                LexiaAdditionalFilePathSearcher searcher
                    = new LexiaAdditionalFilePathSearcher(metadata.Subtype,
                                                          metadata.SourceXmlPath);
                foreach (string path in searcher.Search())
                {
                    metadata
                    .AdditionalFilePaths.Add(path);
                }
                yield return(new PsaTraceInfo(trace, metadata));
            }
        }