First time here? Check out the Help page!
1 | initial version |
Found the bug, I'll add update to this as soon as I test and post. It was a type when I copied and pasted code for electrical equipment to lighting. " instance.designLevel.get > 0" should be " instance.lightingLevel.get > 0"
instances = spaceType.lights
instances.each do |instance|
def_display = instance.definition.name
if instance.lightingLevel.is_initialized and instance.designLevel.get > 0
def_value = instance.designLevel.get
def_value_neat = OpenStudio::toNeatString(def_value,0,true)
def_units = "W"
elsif instance.powerPerFloorArea.is_initialized and instance.powerPerFloorArea.get > 0
def_value = instance.powerPerFloorArea.get / OpenStudio::convert(1,"m^2","ft^2").get
def_value_neat = OpenStudio::toNeatString(def_value,4,true)
def_units = "W/ft^2"
elsif instance.powerPerPerson .is_initialized and instance.powerPerPerson .get > 0
def_value = OpenStudio::convert(instance.powerPerPerson .get,"m^2","ft^2").get
def_value_neat = OpenStudio::toNeatString(def_value,0,true)
def_units = "W/person"
end
count = instance.multiplier
@output_data_space_type_details[:data] << [def_display,def_value_neat,def_units,count]
end
For reference on how to trace these down. The screenshot below shows how to find the errors in the tree, and then where the error is in the stderr file. In "Apply Measures Now" and in PAT measure warnings and errors are much easier to see.
2 | No.2 Revision |
Found the bug, I'll add update to this as soon as I test and post. It was a type when I copied and pasted code for electrical equipment to lighting. " instance.designLevel.get > 0" should be " instance.lightingLevel.get > 0"
instances = spaceType.lights
instances.each do |instance|
def_display = instance.definition.name
if instance.lightingLevel.is_initialized and instance.designLevel.get > 0
def_value = instance.designLevel.get
def_value_neat = OpenStudio::toNeatString(def_value,0,true)
def_units = "W"
elsif instance.powerPerFloorArea.is_initialized and instance.powerPerFloorArea.get > 0
def_value = instance.powerPerFloorArea.get / OpenStudio::convert(1,"m^2","ft^2").get
def_value_neat = OpenStudio::toNeatString(def_value,4,true)
def_units = "W/ft^2"
elsif instance.powerPerPerson .is_initialized and instance.powerPerPerson .get > 0
def_value = OpenStudio::convert(instance.powerPerPerson .get,"m^2","ft^2").get
def_value_neat = OpenStudio::toNeatString(def_value,0,true)
def_units = "W/person"
end
count = instance.multiplier
@output_data_space_type_details[:data] << [def_display,def_value_neat,def_units,count]
end
Update: Updated Measure is online
For reference on how to trace these down. The screenshot below shows how to find the errors in the tree, and then where the error is in the stderr file. In "Apply Measures Now" and in PAT measure warnings and errors are much easier to see.