public MainWindow() { InitializeComponent(); Library = LibraryDefaults.GetDefaultLibrary(); ErrorTextBox.Text = "Default Library generated" + Library.TimeStamp; }
public void InitializeOrClear() { var culture = Thread.CurrentThread.CurrentCulture; Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US"); // use US culture var fullDefault = LibraryDefaults.GetDefaultLibrary(); DefaultLibraries = new List <CSLibrary>(); UserLibraries = new List <CSLibrary>(); DefaultLibraries.Add(fullDefault); //add hardcoded minimum default lib UserLibraries.Add(new CSLibrary()); //add blank user library Library = new CSLibrary(); Library.Append(fullDefault); Thread.CurrentThread.CurrentCulture = culture; // set it back }
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); }