lib/files/Honeybee.rb in honeybee-openstudio-2.6.9 vs lib/files/Honeybee.rb in honeybee-openstudio-2.7.0
- old
+ new
@@ -1,9 +1,9 @@
# *******************************************************************************
-# Honeybee OpenStudio Gem, Copyright (c) 2020, Alliance for Sustainable
+# Honeybee OpenStudio Gem, Copyright (c) 2020, Alliance for Sustainable
# Energy, LLC, Ladybug Tools LLC and other contributors. All rights reserved.
-#
+#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# (1) Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
@@ -47,11 +47,11 @@
def initialize()
# do initialization of class variables in thread safe way
@@instance_lock.synchronize do
if @@osw.nil?
-
+
# load the OSW for this class
osw_path = File.join(File.dirname(__FILE__), 'honeybee_workflow.osw')
File.open(osw_path, 'r') do |file|
@@osw = JSON.parse(file.read, symbolize_names: true)
end
@@ -72,32 +72,32 @@
feature_id = feature.id
feature_type = feature.type
feature_name = feature.name
if feature_names.size == 1
feature_name = feature_names[0]
- end
+ end
# deep clone of @@osw before we configure it
osw = Marshal.load(Marshal.dump(@@osw))
# set the name and description of the OSW to reference this particular feature
osw[:name] = feature_name
osw[:description] = feature_name
if feature_type == 'Building'
- # set the honeybee JSON key to the from_honeybee_model measure
+ # set the honeybee JSON key to the honeybee_model measure
OpenStudio::Extension.set_measure_argument(
osw, 'from_honeybee_model', 'model_json', feature.detailed_model_filename)
# check if there is a HVAC key in the feature JSON properties
building_hash = feature.to_hash
if building_hash.key?(:system_type)
# assume the typical building measure is in the OSW and add the system type
OpenStudio::Extension.set_measure_argument(
osw, 'create_typical_building_from_model', 'system_type', system_type)
end
-
+
# add the feature id and name to the reporting measure
OpenStudio::Extension.set_measure_argument(
osw, 'default_feature_reports', 'feature_id', feature_id)
OpenStudio::Extension.set_measure_argument(
osw, 'default_feature_reports', 'feature_name', feature_name)
@@ -105,9 +105,9 @@
osw, 'default_feature_reports', 'feature_type', feature_type)
end
return osw
end
-
+
end #HoneybeeMapper
end #Scenario
end #URBANopt
\ No newline at end of file