コード例 #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));
            }
        }
コード例 #2
0
        public IEnumerable <PsaTraceInfo> Retrieve()
        {
            DirectoryInfo di = new DirectoryInfo(filesPath);

            foreach (FileInfo xmlFile in di.EnumerateFiles(starXml))
            {
                string csvFileName = xmlFile.FullName.Replace(dotXml, dotCsv);
                CitroenGraphPsaTraceFactory factory =
                    new CitroenGraphPsaTraceFactory(xmlFile.FullName, csvFileName);
                PsaTrace createdTrace = null;
                try
                {
                    createdTrace = factory.Create();
                }
                catch (InvalidOperationException e)
                {
                    Log.Error(e, String.Format("Cannot create a trace from {0}.", xmlFile.FullName));
                    continue;
                }
                PsaTraceMetadata md = new PsaTraceMetadata
                {
                    SourceXmlPath = xmlFile.FullName,
                    Connector     = DiagnosticSystemType.Lexia,
                    Subtype       = PsaConnectorSubtype.Graph
                };
                md.AdditionalFilePaths.Add(csvFileName);
                yield return(new PsaTraceInfo(createdTrace, md));
            }
        }
コード例 #3
0
ファイル: LexiaConnector.cs プロジェクト: shukanov-artyom/VTS
        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));
            }
        }
コード例 #4
0
        public IEnumerable <PsaTraceInfo> Retrieve()
        {
            DirectoryInfo dataDirectory = new DirectoryInfo(dataPath);

            foreach (FileInfo traceFile in dataDirectory.EnumerateFiles("*.xml"))
            {
                CitroenTracePsaTraceFactory factory =
                    new CitroenTracePsaTraceFactory(traceFile.FullName);
                PsaTrace result = factory.Create();
                UnrecognizedDataKeeper.AnalyseTrace(result, traceFile.FullName);
                PsaTraceMetadata md = new PsaTraceMetadata
                {
                    SourceXmlPath = traceFile.FullName,
                    Connector     = DiagnosticSystemType.Lexia,
                    Subtype       = PsaConnectorSubtype.Trace
                };
                foreach (string add in GetAdditionalFilePaths(dataDirectory, traceFile.FullName))
                {
                    md.AdditionalFilePaths.Add(add);
                }
                yield return(new PsaTraceInfo(result, md));
            }
        }
コード例 #5
0
        public override IEnumerable <PsaTraceInfo> GetAllTraces()
        {
            // Trace session will be mapped to dataset?
            foreach (DiagBoxTraceSession session in GetTraceSessions())
            {
                PsaTrace trace = new PsaTrace();
                trace.Manufacturer     = session.Manufacturer;
                trace.Date             = session.Date;
                trace.Mileage          = session.Mileage;
                trace.VehicleModelName = session.VehicleName;
                trace.Vin = session.Vin;
                foreach (LexiaGraphSessionRawData rawData in session.Data)
                {
                    PsaTrace lexiaStyleTrace = LexiaGraphSessionToPsaTraceConverter.Convert(rawData);
                    foreach (PsaParametersSet set in lexiaStyleTrace.ParametersSets)
                    {
                        trace.ParametersSets.Add(set);
                    }
                }
                PsaTraceMetadata traceMetadata = new PsaTraceMetadata();
                traceMetadata.Connector     = Type;
                traceMetadata.Subtype       = PsaConnectorSubtype.Graph;
                traceMetadata.SourceXmlPath = session.TraceSessionMainFilePath;
                foreach (string path in session.AdditionalFilePaths)
                {
                    traceMetadata.AdditionalFilePaths.Add(path);
                }

                // TODO : implement persistency for these
                // traceMetadata.Mileage =
                // traceMetadata.Hidden = false;
                // traceMetadata.IsSynchronized = false;

                PsaTraceInfo traceInfo = new PsaTraceInfo(trace, traceMetadata);
                yield return(traceInfo);
            }
        }