// "2013::MediumOffice::OpenOffice"
        public static (ProgramTypeAbridged programType, IEnumerable <ScheduleRulesetAbridged> schedules) GetStandardProgramTypeByIdentifier(string standardProgramType)
        {
            var year = standardProgramType.Split(':').First();

            if (string.IsNullOrEmpty(year))
            {
                throw new ArgumentException($"Invalid {standardProgramType}");
            }


            var found = StandardsProgramTypes.TryGetValue(standardProgramType, out ProgramTypeAbridged programType);

            if (!found)
            {
                throw new ArgumentException($"Cannot find {standardProgramType}");
            }

            var scheduleNames = new List <string>()
            {
                programType.People?.ActivitySchedule,
                programType.People?.OccupancySchedule,
                programType.Lighting?.Schedule,
                programType.ElectricEquipment?.Schedule,
                programType.GasEquipment?.Schedule,
                programType.Ventilation?.Schedule,
                programType.Infiltration?.Schedule,
                programType.Setpoint?.CoolingSchedule,
                programType.Setpoint?.HeatingSchedule,
                programType.Setpoint?.DehumidifyingSchedule,
                programType.Setpoint?.HumidifyingSchedule,
                programType.ServiceHotWater?.Schedule
            };

            scheduleNames.RemoveAll(string.IsNullOrWhiteSpace);

            var sches = scheduleNames.Select(_ => StandardsSchedules[_]).ToList();

            return(programType, sches);
        }
Пример #2
0
        // "2013::MediumOffice::OpenOffice"
        public static (ProgramTypeAbridged programType, IEnumerable <ScheduleRulesetAbridged> schedules) GetStandardProgramTypeByIdentifier(string standardProgramType)
        {
            var year = standardProgramType.Split(':').First();

            if (string.IsNullOrEmpty(year))
            {
                throw new ArgumentException($"Invalid {standardProgramType}");
            }


            var found = StandardsProgramTypes.TryGetValue(standardProgramType, out ProgramTypeAbridged programType);

            if (!found)
            {
                throw new ArgumentException($"Cannot find {standardProgramType}");
            }

            var scheduleNames = programType.GetAllSchedules();
            var sches         = scheduleNames.Select(_ => StandardsSchedules[_]).ToList();

            return(programType, sches);
        }