예제 #1
0
    def test_create_schedulecompact(self):

        pyidf.validation_level = ValidationLevel.error

        obj = ScheduleCompact()
        # alpha
        var_name = "Name"
        obj.name = var_name
        # object-list
        var_schedule_type_limits_name = "object-list|Schedule Type Limits Name"
        obj.schedule_type_limits_name = var_schedule_type_limits_name
        paras = []
        var_field = "Field"
        paras.append(var_field)
        obj.add_extensible(*paras)

        idf = IDF()
        idf.add(obj)
        idf.save(self.path, check=False)

        with open(self.path, mode='r') as f:
            for line in f:
                log.debug(line.strip())

        idf2 = IDF(self.path)
        self.assertEqual(idf2.schedulecompacts[0].name, var_name)
        self.assertEqual(idf2.schedulecompacts[0].schedule_type_limits_name,
                         var_schedule_type_limits_name)
        index = obj.extensible_field_index("Field")
        self.assertEqual(idf2.schedulecompacts[0].extensibles[0][index],
                         var_field)
예제 #2
0
    def test_create_schedulecompact(self):

        pyidf.validation_level = ValidationLevel.error

        obj = ScheduleCompact()
        # alpha
        var_name = "Name"
        obj.name = var_name
        # object-list
        var_schedule_type_limits_name = "object-list|Schedule Type Limits Name"
        obj.schedule_type_limits_name = var_schedule_type_limits_name
        paras = []
        var_field = "Field"
        paras.append(var_field)
        obj.add_extensible(*paras)
        

        idf = IDF()
        idf.add(obj)
        idf.save(self.path, check=False)

        with open(self.path, mode='r') as f:
            for line in f:
                log.debug(line.strip())

        idf2 = IDF(self.path)
        self.assertEqual(idf2.schedulecompacts[0].name, var_name)
        self.assertEqual(idf2.schedulecompacts[0].schedule_type_limits_name, var_schedule_type_limits_name)
        index = obj.extensible_field_index("Field")
        self.assertEqual(idf2.schedulecompacts[0].extensibles[0][index], var_field)
예제 #3
0
    obj30.outside_boundary_condition_object = None
    obj30.sun_exposure = "SunExposed"
    obj30.wind_exposure = "WindExposed"
    obj30.view_factor_to_ground = 0.0
    obj30.number_of_vertices = 4.0
    obj30.add_extensible(0.0, 6.0, 2.7)
    obj30.add_extensible(0.0, 0.0, 2.7)
    obj30.add_extensible(8.0, 0.0, 2.7)
    obj30.add_extensible(8.0, 6.0, 2.7)
    idf.add(obj30)

    obj31 = ScheduleTypeLimits()
    obj31.name = "Any Number"
    idf.add(obj31)

    obj32 = ScheduleCompact()
    obj32.name = "ALWAYS 4"
    obj32.schedule_type_limits_name = "Any Number"
    obj32.add_extensible("Through: 12/31")
    obj32.add_extensible("For: AllDays")
    obj32.add_extensible("Until: 24:00")
    obj32.add_extensible("4")
    idf.add(obj32)

    obj33 = ScheduleCompact()
    obj33.name = "ALWAYS 20"
    obj33.schedule_type_limits_name = "Any Number"
    obj33.add_extensible("Through: 12/31")
    obj33.add_extensible("For: AllDays")
    obj33.add_extensible("Until: 24:00")
    obj33.add_extensible("20")
예제 #4
0
    obj30.outside_boundary_condition_object = None
    obj30.sun_exposure = "SunExposed"
    obj30.wind_exposure = "WindExposed"
    obj30.view_factor_to_ground = 0.0
    obj30.number_of_vertices = 4.0
    obj30.add_extensible(0.0, 6.0, 2.7)
    obj30.add_extensible(0.0, 0.0, 2.7)
    obj30.add_extensible(8.0, 0.0, 2.7)
    obj30.add_extensible(8.0, 6.0, 2.7)
    idf.add(obj30)

    obj31 = ScheduleTypeLimits()
    obj31.name = "Any Number"
    idf.add(obj31)

    obj32 = ScheduleCompact()
    obj32.name = "ALWAYS 4"
    obj32.schedule_type_limits_name = "Any Number"
    obj32.add_extensible("Through: 12/31")
    obj32.add_extensible("For: AllDays")
    obj32.add_extensible("Until: 24:00")
    obj32.add_extensible("4")
    idf.add(obj32)

    obj33 = ScheduleCompact()
    obj33.name = "ALWAYS 20"
    obj33.schedule_type_limits_name = "Any Number"
    obj33.add_extensible("Through: 12/31")
    obj33.add_extensible("For: AllDays")
    obj33.add_extensible("Until: 24:00")
    obj33.add_extensible("20")