public MainWindow() { InitializeComponent(); Library = LibraryDefaults.getHardCodedDefaultLib(); ErrorTextBox.Text = "Default Library generated" + Library.TimeStamp; }
public static Library ImportLibrary(string folderPath) { Library lib = LibraryDefaults.getHardCodedDefaultLib(); //Schedules List <DaySchedule> inDaySchedules = readDayCSV(folderPath + @"\DaySchedules.csv"); lib.DaySchedules = inDaySchedules; List <YearSchedule> inYearSchedules = readYearCSV(folderPath + @"\YearSchedules.csv", inDaySchedules); lib.YearSchedules = inYearSchedules; List <ScheduleArray> inArraySchedules = readArrayScheduleCSV(folderPath + @"\ArraySchedules.csv"); lib.ArraySchedules = inArraySchedules; //Material Construction List <OpaqueMaterial> inOMat = readLibCSV <OpaqueMaterial>(folderPath + @"\OpaqueMaterials.csv"); lib.OpaqueMaterials = inOMat; List <OpaqueConstruction> inOpaqueConstructions = readOpaqueConstructionsCSV(folderPath + @"\OpaqueConstructions.csv", inOMat); lib.OpaqueConstructions = inOpaqueConstructions; //Glazing List <GlazingMaterial> inGMat = readLibCSV <GlazingMaterial>(folderPath + @"\GlazingMaterials.csv"); lib.GlazingMaterials = inGMat; List <GlazingConstruction> inGlazingConstructions = readGlazingConstructionsCSV(folderPath + @"\GlazingConstructions.csv", lib.GlazingMaterials.ToList(), lib.GasMaterials.ToList()); lib.GlazingConstructions = inGlazingConstructions; List <GlazingConstructionSimple> inGlazingConstructionSimple = readLibCSV <GlazingConstructionSimple>(folderPath + @"\GlazingConstructionSimple.csv"); lib.GlazingConstructionsSimple = inGlazingConstructionSimple; //Settings List <WindowSettings> inWindowSettings = readLibCSV <WindowSettings>(folderPath + @"\WindowSettings.csv"); lib.WindowSettings = inWindowSettings; List <ZoneVentilation> inZoneVentilation = readLibCSV <ZoneVentilation>(folderPath + @"\ZoneVentilations.csv"); lib.ZoneVentilations = inZoneVentilation; List <ZoneConditioning> inZoneConditioning = readLibCSV <ZoneConditioning>(folderPath + @"\ZoneConditioning.csv"); lib.ZoneConditionings = inZoneConditioning; List <ZoneConstruction> inZoneConstruction = readLibCSV <ZoneConstruction>(folderPath + @"\ZoneConstruction.csv"); lib.ZoneConstructions = inZoneConstruction; List <ZoneLoad> inZoneLoad = readLibCSV <ZoneLoad>(folderPath + @"\ZoneLoad.csv"); lib.ZoneLoads = inZoneLoad; List <DomHotWater> inDomHotWater = readLibCSV <DomHotWater>(folderPath + @"\DomHotWater.csv"); lib.DomHotWaters = inDomHotWater; //List<ZoneDefinition> inZoneDefinition = readLibCSV<ZoneDefinition>(folderPath + @"\ZoneDefinition.csv"); //lib.ZoneDefinitions = inZoneDefinition; List <ZoneDefinition> inZoneDefinition = readZoneDefCSV(folderPath + @"\ZoneDefinition.csv", lib); lib.ZoneDefinitions = inZoneDefinition; var defaultLib = LibraryDefaults.getHardCodedDefaultLib(); defaultLib.Merge(lib); return(lib); }