Beispiel #1
0
        public IEnumerable <string> GetUnsupportedFileNames()
        {
            if (Directory.Exists(dataDirectory.FullName))
            {
                IEnumerable <FileInfo> xmlFiles =
                    dataDirectory.EnumerateFiles("*.xml");
                foreach (FileInfo xmlFile in xmlFiles)
                {
                    // collecting unsupported graphical data
                    string csvFileName =
                        xmlFile.FullName.Replace(".xml", ".csv");
                    LexiaGraphSessionRawData data =
                        LexiaScanDataFactory.CreateWithCsv(
                            xmlFile.FullName, csvFileName);
                    foreach (LexiaChannelRawData lcrData in data.Channels)
                    {
                        if (LexiaChannelDataTypeMapper.
                            GetTypeEnum(lcrData.Header.Mnemocode) ==
                            LexiaChannelType.NOT_SUPPORTED)
                        {
                            yield return(xmlFile.FullName);

                            yield return(csvFileName);
                        }
                    }
                }
            }

            if (Directory.Exists(lexiaInstallationDisk + tracesDataDirectory))
            {
                LexiaPointTypeDataRetriever retr =
                    new LexiaPointTypeDataRetriever(
                        lexiaInstallationDisk + tracesDataDirectory);
                foreach (FileInfo traceFile in retr.GetTraceFiles())
                {
                    TraceFactory factory = new TraceFactory(traceFile);
                    LexiaTrace   trace   = factory.Create();
                    trace.SourceFilePath = traceFile.FullName;
                    if (trace.ParameterSets.Any(ps => ps.Parameters.
                                                Any(p => p.Type == PsaParameterType.Unsupported)) ||
                        trace.ParameterSets.
                        Any(ps => ps.Name == CodeBehindStringResolver.
                            Resolve("UnsupportedDataSet")))
                    {
                        yield return(traceFile.FullName);

                        foreach (string additionalFileName in
                                 retr.GetAdditionalTraceTxtData(traceFile.FullName))
                        {
                            yield return(additionalFileName);
                        }
                    }
                }
            }
        }
        private LexiaTracesData GetAllTraceData()
        {
            LexiaTracesData        result = new LexiaTracesData();
            IEnumerable <FileInfo> files  = GetAllTraceXmlFiles();

            if (files.ToList().Count == 0)
            {
                return(null);
            }

            foreach (FileInfo file in files)
            {
                PeugeotTraceFactory factory =
                    new PeugeotTraceFactory(file);
                LexiaTrace trace = factory.Generate();
                trace.SourceFilePath = file.FullName;
                if (trace != null)
                {
                    result.Traces.Add(trace);
                }
            }
            return(result);
        }