Exemple #1
0
        private List <CSVFile> ReadCSVFiles(GenerationOrLoad generationOrLoad, [NotNull] DirectoryInfo di)
        {
            Info("Reading " + di.FullName);
            string filepattern = "*." + generationOrLoad + ".csv";
            var    csvfiles    = di.GetFiles(filepattern);

            if (csvfiles.Length == 0)
            {
                throw new FlaException("No exported files found in: " + di.FullName + " for file pattern " + filepattern);
            }

            var csvs        = new List <CSVFile>();
            var activeFiles = new List <CSVFile>();

            foreach (var info in csvfiles)
            {
                var cs = new CSVFile(generationOrLoad, info.Name);
                csvs.Add(cs);
                cs.MyThread = ThreadProvider.Get().MakeThreadAndStart(() => { cs.Read(info); }, "CSVProfileVisualizer");
                activeFiles.Add(cs);
                WaitForJoining(activeFiles, 8);
            }

            WaitForJoining(activeFiles, 0);
            if (csvs.Count != csvfiles.Length)
            {
                throw new FlaException("Missing files");
            }

            Info("Read " + csvs.Count + " for " + generationOrLoad);
            return(csvs);
        }
Exemple #2
0
        public Prosumer([JetBrains.Annotations.NotNull] string houseGuid,
                        [JetBrains.Annotations.NotNull] string name,
                        HouseComponentType houseComponentType,
                        [CanBeNull] string sourceGuid,
                        long isn,
                        [JetBrains.Annotations.NotNull] string hausanschlussGuid,
                        [JetBrains.Annotations.NotNull] string hausanschlussKey,
                        GenerationOrLoad generationOrLoad,
                        [JetBrains.Annotations.NotNull] string trafoKreis,
                        [JetBrains.Annotations.NotNull] string providerName,
                        [JetBrains.Annotations.NotNull] string profileSourceName)
        {
            HouseGuid          = houseGuid;
            Name               = name;
            HouseComponentType = houseComponentType;
            SourceGuid         = sourceGuid;
            Isn = isn;
            HausanschlussGuid = hausanschlussGuid;
            HausanschlussKey  = hausanschlussKey;
            GenerationOrLoad  = generationOrLoad;

            TrafoKreis        = trafoKreis;
            ProviderName      = providerName;
            ProfileSourceName = profileSourceName;
        }
Exemple #3
0
 public ArchiveEntry([NotNull] string name, AnalysisKey key, [NotNull] Profile profile, GenerationOrLoad generationOrLoad, [NotNull] string trafokreis)
 {
     Name             = name;
     Key              = key;
     Profile          = profile;
     GenerationOrLoad = generationOrLoad;
     Trafokreis       = trafokreis;
 }
Exemple #4
0
        private static void SaveCityProfile([JetBrains.Annotations.NotNull] ChangableProfile cityload,
                                            [JetBrains.Annotations.NotNull] SaveableEntry <ArchiveEntry> saArchiveEntry,
                                            SummedLoadType name,
                                            GenerationOrLoad generationOrLoad)
        {
            AnalysisKey  key1 = new AnalysisKey(null, null, SumType.ByCity, generationOrLoad, null, name.ToString(), null);
            ArchiveEntry ae1  = new ArchiveEntry(name.ToString(), key1, cityload.ToProfile(), generationOrLoad, "City");

            saArchiveEntry.AddRow(ae1);
        }
 public AnalysisKey([CanBeNull] string trafokreis,
                    [CanBeNull] string providerType,
                    SumType sumType,
                    GenerationOrLoad generationOrLoad,
                    [CanBeNull] string houseName,
                    [CanBeNull] string profileSource,
                    [CanBeNull] string houseComponentType)
 {
     Trafokreis         = trafokreis;
     ProviderType       = providerType;
     SumType            = sumType;
     GenerationOrLoad   = generationOrLoad;
     HouseName          = houseName;
     ProfileSource      = profileSource;
     HouseComponentType = houseComponentType;
 }
Exemple #6
0
 public CSVFile(GenerationOrLoad generationOrLoad, [CanBeNull] string fileName)
 {
     GenerationOrLoad = generationOrLoad;
     FileName         = fileName;
 }
        private void WriteSumLineToCsv([NotNull] Prosumer p, [NotNull] string trafokreis, GenerationOrLoad generationOrLoad)
        {
            string       tkFileName            = FilenameHelpers.CleanFileName(trafokreis);
            var          csvFileNameGeneration = Path.Combine(_processingResultPathForProfiles, tkFileName + "." + generationOrLoad + ".csv");
            StreamWriter sw = new StreamWriter(csvFileNameGeneration, true);

            sw.WriteLine(p.GetCSVLine());
            sw.Close();
        }