Example #1
0
 def transition(self, core_object, dependent_objects):  # pragma no cover
     original_idf_fields = core_object.fields
     new_idf_fields = original_idf_fields
     new_idf_fields.insert(2, "")
     new_coil_object = IDFObject(["Coil:Heating:Fuel"] + new_idf_fields)
     # return a list since some transitions may split/add new objects
     return TransitionReturn([new_coil_object])
Example #2
0
 def transition(self, core_object, dependent_objects):  # pragma no cover
     daylight_ref_pts = build_ref_pt_list(dependent_objects["DAYLIGHTING:DELIGHT:REFERENCEPOINT"],
                                          dependent_objects["DAYLIGHTING:DELIGHT:CONTROLS"])
     original_idf_fields = core_object.fields
     new_idf_fields = list()
     new_idf_fields.append("Daylighting:Controls")
     new_idf_fields.append(original_idf_fields[0])  # 0
     new_idf_fields.append(original_idf_fields[1])  # 1
     new_idf_fields.append("DElight")  # 2
     new_idf_fields.append("")  # 3
     if original_idf_fields[4] == "1":
         new_idf_fields.append("Continuous")  # 4
     elif original_idf_fields[4] == "2":
         new_idf_fields.append("Stepped")  # 4
     elif original_idf_fields[4] == "3":
         new_idf_fields.append("ContinuousOff")  # 4
     else:
         new_idf_fields.append("Continuous")  # 4
     new_idf_fields.append(original_idf_fields[3])  # 5
     new_idf_fields.append(original_idf_fields[4])  # 6
     if original_idf_fields[5] == "0":
         new_idf_fields.append("")  # 7
     else:
         new_idf_fields.append(original_idf_fields[5])  # 7
     new_idf_fields.append(original_idf_fields[6])  # 8
     new_idf_fields.append("")  # 9
     new_idf_fields.append("0")  # 10
     new_idf_fields.append("")  # 11
     new_idf_fields.append(original_idf_fields[7])  # 12
     for ref_pt in daylight_ref_pts:
         if ref_pt.control_name.upper() == original_idf_fields[0].upper():
             new_idf_fields.append(ref_pt.ref_pt_name)
             new_idf_fields.append(ref_pt.frac_zone)
             new_idf_fields.append(ref_pt.illum_set_pt)
     return TransitionReturn([IDFObject(new_idf_fields)])
Example #3
0
 def transition(self, core_object, dependent_objects):  # pragma no cover
     # remove F2 and F3 [2] and [3] :  "Control Variable" and "Schedule Name"
     new_idf_fields = core_object.fields
     del new_idf_fields[1]  # remove F2, which is index 1
     del new_idf_fields[1]  # remove F3, which is index 1 since F2 was already removed
     new_object = IDFObject([core_object.object_name] + new_idf_fields)
     return TransitionReturn([new_object])
Example #4
0
 def transition(self, core_object, dependent_objects):  # pragma no cover
     original_idf_fields = core_object.fields
     new_object_name = "AirTerminal:SingleDuct:Mixer"
     new_idf_fields = original_idf_fields
     new_idf_fields.insert(6, "InletSide")
     new_mixer_object = IDFObject([new_object_name] + new_idf_fields)
     # return a list since some transitions may split/add new objects
     return TransitionReturn([new_mixer_object])
 def transition(self, core_object, dependent_objects):  # pragma no cover
     original_idf_fields = core_object.fields
     # need to just add a new field F2, (index 1 here), blank
     new_idf_fields = original_idf_fields
     new_idf_fields.insert(1, "")
     new_equip_object = IDFObject([core_object.object_name] +
                                  new_idf_fields)
     # return a list since some transitions may split/add new objects
     return TransitionReturn([new_equip_object])
Example #6
0
 def transition(self, core_object, dependent_objects):  # pragma no cover
     original_idf_fields = core_object.fields
     new_idf_fields = original_idf_fields
     if new_idf_fields[2].upper() in [
             "AIRTERMINAL:SINGLEDUCT:INLETSIDEMIXER",
             "AIRTERMINAL:SINGLEDUCT:SUPPLYSIDEMIXER"
     ]:
         new_idf_fields[2] = "AirTerminal:SingleDuct:Mixer"
     new_unit_object = IDFObject([core_object.object_name] + new_idf_fields)
     # return a list since some transitions may split/add new objects
     return TransitionReturn([new_unit_object])
Example #7
0
 def transition(self, core_object, dependent_objects):  # pragma no cover
     # if F2 is Gas, change to "NaturalGas";   if F2 is LPG, change to "PropaneGas"
     original_idf_fields = core_object.fields
     new_idf_fields = original_idf_fields
     if original_idf_fields[1].upper() == "GAS":
         new_idf_fields[1] = "NaturalGas"
     elif original_idf_fields[1].upper() == "PROPANEGAS":
         new_idf_fields[1] = "PropaneGas"
     new_equip_object = IDFObject([core_object.object_name] + new_idf_fields)
     # return a list since some transitions may split/add new objects
     return TransitionReturn([new_equip_object])
Example #8
0
 def transition(self, core_object, dependent_objects):  # pragma no cover
     # F4: Outdoor Air Dryblub Temperature, Outdoor Air Wetblub Temperature; correct spelling from "blub" to "bulb"
     original_idf_fields = core_object.fields
     new_idf_fields = original_idf_fields
     if original_idf_fields[3].upper() == "OUTDOOR AIR DRYBLUB TEMPERATURE":
         new_idf_fields[3] = "Outdoor Air Drybulb Temperature"
     elif original_idf_fields[3].upper(
     ) == "OUTDOOR AIR WETBLUB TEMPERATURE":
         new_idf_fields[3] = "Outdoor Air Wetbulb Temperature"
     new_equip_object = IDFObject([core_object.object_name] +
                                  new_idf_fields)
     return TransitionReturn([new_equip_object])
Example #9
0
 def transition(self, core_object, dependent_objects):  # pragma no cover
     daylight_ref_pts = build_ref_pt_list(dependent_objects["DAYLIGHTING:DELIGHT:REFERENCEPOINT"],
                                          dependent_objects["DAYLIGHTING:DELIGHT:CONTROLS"])
     original_idf_fields = core_object.fields
     new_idf_fields = list()
     new_idf_fields.append("Daylighting:ReferencePoint")
     new_idf_fields.append(original_idf_fields[0])  # 0
     for ref_pt in daylight_ref_pts:
         if ref_pt.control_name.upper() == original_idf_fields[1].upper():
             new_idf_fields.append(ref_pt.zone_name)
             break
     new_idf_fields.append(original_idf_fields[2])
     new_idf_fields.append(original_idf_fields[3])
     new_idf_fields.append(original_idf_fields[4])
     return TransitionReturn([IDFObject(new_idf_fields)])
Example #10
0
 def transition(self, core_object, dependent_objects):  # pragma no cover
     original_idf_fields = core_object.fields
     new_idf_fields = [original_idf_fields[0]]
     old_field_2 = original_idf_fields[1]
     old_d_empd = float(original_idf_fields[1])
     old_a = float(original_idf_fields[2])
     old_b = float(original_idf_fields[3])
     old_c = float(original_idf_fields[4])
     old_d = float(original_idf_fields[5])
     empd_material_name = original_idf_fields[0]
     material = [x for x in dependent_objects["MATERIAL"] if x.fields[0].upper() == empd_material_name.upper()][0]
     old_density_material = float(material.fields[4])
     new_mu = self.calculate_mu_empd(old_d_empd, old_a, old_b, old_c, old_d, old_density_material)
     new_idf_fields.append(str(new_mu))
     new_idf_fields.extend(original_idf_fields[2:6])
     new_idf_fields.append(old_field_2)
     new_idf_fields.extend(["0.0"] * 3)
     new_empd_object = IDFObject([core_object.object_name] + new_idf_fields)
     # return a list since some transitions may split/add new objects
     return TransitionReturn([new_empd_object])
Example #11
0
 def transition(self, core_object, dependent_objects):  # pragma no cover
     original_idf_fields = core_object.fields
     # we need to remove F2, F8, F13, F18, ....
     # these would be, zero based, 1, 7, 12, 17, 22, ....
     indeces_to_remove = [1]
     num_fields = len(core_object.fields)
     i_to_remove = 2
     while True:
         i_to_remove += 5
         if i_to_remove < num_fields:  # pragma no cover
             indeces_to_remove.append(i_to_remove)
         else:
             break
     new_idf_fields = [
         i for j, i in enumerate(original_idf_fields)
         if j not in indeces_to_remove
     ]
     new_branch_object = IDFObject([core_object.object_name] +
                                   new_idf_fields)
     # return a list since some transitions may split/add new objects
     return TransitionReturn([new_branch_object])
    def transition(self, core_object, dependent_objects):  # pragma no cover
        # If F16 is "Reverse" and both F17 and F18 (N7 and N8) are blank, do nothing.
        # If F16 is "reverse" and either F17 or F18 is not blank, replace "Reverse" with" ReverseWithLimits".
        original_idf_fields = core_object.fields
        original_f16 = original_idf_fields[15]
        try:
            original_f17 = original_idf_fields[16]
        except IndexError:
            original_f17 = ""
        try:
            original_f18 = original_idf_fields[17]
        except IndexError:
            original_f18 = ""
        new_idf_fields = original_idf_fields

        if original_f16.upper() == "REVERSE":
            if original_f17 == "" and original_f18 == "":
                # do nothing
                pass
            else:
                new_idf_fields[15] = "ReverseWithLimits"
        new_terminal_object = IDFObject([core_object.object_name] +
                                        new_idf_fields)
        return TransitionReturn([new_terminal_object])
Example #13
0
 def transition(self, core_object, dependent_objects):  # pragma no cover
     # remove F33 = [32] : Chiller Flow Mode
     new_idf_fields = core_object.fields
     del new_idf_fields[32]
     new_object = IDFObject([core_object.object_name] + new_idf_fields)
     return TransitionReturn([new_object])
 def transition(self, core_object, dependent_objects):  # pragma no cover
     new_idf_fields = core_object.fields
     del new_idf_fields[self.field_to_remove]
     new_object = IDFObject([core_object.object_name] + new_idf_fields)
     return TransitionReturn([new_object])
Example #15
0
    def transition(self, core_object, dependent_objects):  # pragma no cover
        original_idf_fields = core_object.fields
        new_idf_fields = list()
        new_idf_fields.append(original_idf_fields[0] + "_DaylCtrl")  # 0
        new_idf_fields.append(original_idf_fields[0])  # 1
        new_idf_fields.append("SplitFlux")  # 2
        try:
            new_idf_fields.append(original_idf_fields[19])  # 3
        except IndexError:
            new_idf_fields.append("")
        if original_idf_fields[12] == "1":
            new_idf_fields.append("Continuous")  # 4
        elif original_idf_fields[12] == "2":
            new_idf_fields.append("Stepped")  # 4
        elif original_idf_fields[12] == "3":
            new_idf_fields.append("ContinuousOff")  # 4
        else:
            new_idf_fields.append("Continuous")  # 4
        new_idf_fields.append(original_idf_fields[15])  # 5
        new_idf_fields.append(original_idf_fields[16])  # 6
        if original_idf_fields[17] == "0":
            new_idf_fields.append("")  # 7
        else:
            new_idf_fields.append(original_idf_fields[17])  # 7
        new_idf_fields.append(original_idf_fields[18])  # 8
        new_idf_fields.append(original_idf_fields[0] + "_DaylRefPt1")  # 9
        new_idf_fields.append(original_idf_fields[13])  # 10
        new_idf_fields.append(original_idf_fields[14])  # 11
        new_idf_fields.append("")  # 12
        new_idf_fields.append(original_idf_fields[0] + "_DaylRefPt1")  # 13
        new_idf_fields.append(original_idf_fields[8])  # 14
        new_idf_fields.append(original_idf_fields[10])  # 15
        if original_idf_fields[1] == "2":
            new_idf_fields.append(original_idf_fields[0] + "_DaylRefPt2")  # 16
            new_idf_fields.append(original_idf_fields[9])  # 17
            new_idf_fields.append(original_idf_fields[11])  # 18
        new_control_object = IDFObject([core_object.object_name] + new_idf_fields)
        objects_to_write = [new_control_object]

        ref_pt_fields = list()
        ref_pt_fields.append("Daylighting:ReferencePoint")
        ref_pt_fields.append(original_idf_fields[0] + "_DaylRefPt1")
        ref_pt_fields.append(original_idf_fields[0])
        ref_pt_fields.append(original_idf_fields[2])
        ref_pt_fields.append(original_idf_fields[3])
        ref_pt_fields.append(original_idf_fields[4])
        ref_pt_object_1 = IDFObject(ref_pt_fields)
        objects_to_write.append(ref_pt_object_1)

        if original_idf_fields[1] == "2":
            ref_pt_fields = list()
            ref_pt_fields.append("Daylighting:ReferencePoint")
            ref_pt_fields.append(original_idf_fields[0] + "_DaylRefPt2")
            ref_pt_fields.append(original_idf_fields[0])
            ref_pt_fields.append(original_idf_fields[5])
            ref_pt_fields.append(original_idf_fields[6])
            ref_pt_fields.append(original_idf_fields[7])
            ref_pt_object_1 = IDFObject(ref_pt_fields)
            objects_to_write.append(ref_pt_object_1)

        return TransitionReturn(objects_to_write)