Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/develop' into PATErrors
Browse files Browse the repository at this point in the history
  • Loading branch information
macumber committed Feb 18, 2015
2 parents f5e0847 + f2c750d commit 53bd09c
Show file tree
Hide file tree
Showing 61 changed files with 6,290 additions and 702 deletions.
8 changes: 4 additions & 4 deletions developer/ruby/GenerateClass.rb
Original file line number Diff line number Diff line change
Expand Up @@ -357,14 +357,14 @@
hpp << "\n"
hpp << " /** Get the impl pointer */\n"
hpp << " template<typename T>\n"
hpp << " boost::shared_ptr<T> getImpl() const {\n"
hpp << " std::shared_ptr<T> getImpl() const {\n"
hpp << " return boost::dynamic_pointer_cast<T>(m_impl);\n"
hpp << " }\n"
hpp << "\n"
hpp << " /** Cast to type T. Throws std::bad_cast if object is not a T. */\n"
hpp << " template<typename T>\n"
hpp << " T cast() const {\n"
hpp << " boost::shared_ptr<typename T::ImplType> impl = this->getImpl<typename T::ImplType>();\n"
hpp << " std::shared_ptr<typename T::ImplType> impl = this->getImpl<typename T::ImplType>();\n"
hpp << " if (!impl) {\n"
hpp << " throw(std::bad_cast());\n"
hpp << " }\n"
Expand All @@ -376,7 +376,7 @@
hpp << " template<typename T>\n"
hpp << " boost::optional<T> optionalCast() const{\n"
hpp << " boost::optional<T> result;\n"
hpp << " boost::shared_ptr<typename T::ImplType> impl = this->getImpl<typename T::ImplType>();\n"
hpp << " std::shared_ptr<typename T::ImplType> impl = this->getImpl<typename T::ImplType>();\n"
hpp << " if (impl){\n"
hpp << " result = T(impl);\n"
hpp << " }\n"
Expand Down Expand Up @@ -435,7 +435,7 @@
implHpp << " private:" << "\n"

if baseClassName.empty?
hpp << " boost::shared_ptr<detail::" << className << "_Impl> m_impl;\n\n"
hpp << " std::shared_ptr<detail::" << className << "_Impl> m_impl;\n\n"
end
end

Expand Down
9 changes: 1 addition & 8 deletions openstudiocore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -357,14 +357,7 @@ endif()
set(RUBY_MODULE_DIR "Ruby")

set(RUBY_MODULE_ARCH_DIR "Ruby/openstudio")

if(WIN32)
if(NOT "${RUBY_VERSION_MAJOR}" EQUAL "2")
message(SEND_ERROR "64bit Windows support requires Ruby >= 2.0.0")
endif()
endif()



#We want to use the site_ruby folder if this is intended for /usr/local install
#If it is intended for /usr install, we want to use the main ruby module folder
if(${CMAKE_INSTALL_PREFIX} STREQUAL "/usr" AND RUBY_ARCH_DIR MATCHES "^/usr/lib.*/.*")
Expand Down
180 changes: 180 additions & 0 deletions openstudiocore/resources/model/OpenStudio.idd
Original file line number Diff line number Diff line change
Expand Up @@ -4317,6 +4317,7 @@ OS:ScheduleTypeLimits,
\note Pressure (Pa or psi)
\note Solar Energy (Wh/m2)
\note Availability (0-Off or 1-On)
\note Linear Power Density (W/m or W/ft)
\type choice
\default Dimensionless
\key Dimensionless
Expand All @@ -4338,6 +4339,7 @@ OS:ScheduleTypeLimits,
\key Availability
\key Percent
\key ControlMode
\key LinearPowerDensity

\group OpenStudio Geometry

Expand Down Expand Up @@ -4956,6 +4958,184 @@ OS:ShadingControl,
\type real
\ip-units unknown

OS:WindowProperty:FrameAndDivider,
\memo Specifies the dimensions of a window frame, dividers, and reveal surfaces.
\memo Referenced by the sub surface objects for exterior windows and glass doors
\min-fields 20
A1 , \field Handle
\type handle
\required-field
A2 , \field Name
\required-field
\type alpha
\reference WindowFrameAndDividerNames
\note Referenced by surfaces that are exterior windows
\note Not used by interzone windows
N1 , \field Frame Width
\units m
\type real
\minimum 0.0
\maximum 1.0
\default 0.0
\note Width of frame in plane of window
\note Frame width assumed the same on all sides of window
N2 , \field Frame Outside Projection
\units m
\type real
\minimum 0.0
\maximum 0.5
\default 0.0
\note Amount that frame projects outward from the outside face of the glazing
N3 , \field Frame Inside Projection
\units m
\type real
\minimum 0.0
\maximum 0.5
\default 0.0
\note Amount that frame projects inward from the inside face of the glazing
N4 , \field Frame Conductance
\units W/m2-K
\type real
\minimum 0.0
\note Effective conductance of frame
\note Excludes air films
\note Obtained from WINDOW 5 or other 2-D calculation
N5 , \field Ratio of Frame-Edge Glass Conductance to Center-Of-Glass Conductance
\type real
\minimum> 0.0
\maximum 4.0
\default 1.0
\note Excludes air films; applies only to multipane windows
\note Obtained from WINDOW 5 or other 2-D calculation
N6 , \field Frame Solar Absorptance
\type real
\minimum 0.0
\maximum 1.0
\default 0.7
\note Assumed same on outside and inside of frame
N7 , \field Frame Visible Absorptance
\type real
\minimum 0.0
\maximum 1.0
\default 0.7
\note Assumed same on outside and inside of frame
N8 , \field Frame Thermal Hemispherical Emissivity
\type real
\minimum> 0.0
\default 0.9
\note Assumed same on outside and inside of frame
A3 , \field Divider Type
\type choice
\key DividedLite
\key Suspended
\default DividedLite
N9 , \field Divider Width
\units m
\type real
\minimum 0.0
\maximum 0.5
\default 0.0
\note Width of dividers in plane of window
\note Width assumed the same for all dividers
N10, \field Number of Horizontal Dividers
\type real
\minimum 0
\default 0
\note "Horizontal" means parallel to local window X-axis
N11, \field Number of Vertical Dividers
\type real
\minimum 0
\default 0
\note "Vertical" means parallel to local window Y-axis
N12, \field Divider Outside Projection
\units m
\type real
\minimum 0.0
\maximum 0.5
\default 0.0
\note Amount that divider projects outward from the outside face of the glazing
\note Outside projection assumed the same for all divider elements
N13, \field Divider Inside Projection
\units m
\type real
\minimum 0.0
\maximum 0.5
\default 0.0
\note Amount that divider projects inward from the inside face of the glazing
\note Inside projection assumed the same for all divider elements
N14, \field Divider Conductance
\units W/m2-K
\type real
\minimum 0.0
\default 0.0
\note Effective conductance of divider
\note Excludes air films
\note Obtained from WINDOW 5 or other 2-D calculation
N15, \field Ratio of Divider-Edge Glass Conductance to Center-Of-Glass Conductance
\type real
\minimum> 0.0
\maximum 4.0
\default 1.0
\note Excludes air films
\note Obtained from WINDOW 5 or other 2-D calculation
N16, \field Divider Solar Absorptance
\type real
\minimum 0.0
\maximum 1.0
\default 0.0
\note Assumed same on outside and inside of divider
N17, \field Divider Visible Absorptance
\type real
\minimum 0.0
\maximum 1.0
\default 0.0
\note Assumed same on outside and inside of divider
N18, \field Divider Thermal Hemispherical Emissivity
\type real
\minimum> 0.0
\maximum< 1.0
\default 0.9
\note Assumed same on outside and inside of divider
N19, \field Outside Reveal Depth
\note On translation to EnergyPlus, sub surfaces are offset from their base surface by this amount
\units m
\type real
\minimum 0.0
\maximum 2.0
\default 0.0
N20, \field Outside Reveal Solar Absorptance
\type real
\minimum 0.0
\maximum 1.0
\default 0.0
N21, \field Inside Sill Depth
\units m
\type real
\minimum 0.0
\maximum 2.0
\default 0.0
N22, \field Inside Sill Solar Absorptance
\type real
\minimum 0.0
\maximum 1.0
\default 0.0
N23, \field Inside Reveal Depth
\note Distance from plane of inside surface of glazing
\note to plane of inside surface of wall.
\note Outside reveal depth is determined from the geometry
\note of the window and the wall it is on; it is non-zero if the plane of
\note the outside surface of the glazing is set back from the plane of the
\note outside surface of the wall.
\units m
\minimum 0.0
\maximum 2.0
\default 0.0
N24; \field Inside Reveal Solar Absorptance
\type real
\minimum 0.0
\maximum 1.0
\default 0.0

\group OpenStudio Space Loads

OS:InternalMass,
Expand Down
2 changes: 2 additions & 0 deletions openstudiocore/ruby/openstudio/energyplus/find_energyplus.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ def build_version(f)
# find_energyplus(5, 0, 16) # only build 16
#
def find_energyplus(major_version, minor_version, build_version = '.*')

warn "[DEPRECATION] `find_energyplus` is deprecated. Please use `OpenStudio::Runmanager::ConfigOptions` instead."

# version matches either internal or official releases
# prior to version 8.2.0 we assume the least signficant version number (third digit) is 0
Expand Down
35 changes: 20 additions & 15 deletions openstudiocore/ruby/openstudio/radiance/DaylightCalculations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
######################################################################

require 'openstudio'
require 'openstudio/energyplus/find_energyplus'
require 'fileutils'

require 'optparse'
Expand Down Expand Up @@ -81,7 +80,7 @@ def self.parse(args)
# No argument, shows at tail. This will print an options summary.
opts.on_tail("-h", "--help", "Show this message") do
puts opts
exit false
exit
end
end
opts.parse!(args)
Expand All @@ -99,6 +98,7 @@ def self.parse(args)
#
# utility functions
#

# print statement and execute as system call
def exec_statement(s)
if /mswin/.match(RUBY_PLATFORM) or /mingw/.match(RUBY_PLATFORM)
Expand All @@ -110,10 +110,7 @@ def exec_statement(s)
return result
end

#
# extract arguments
#

modelPath = ""
if ARGV[0]
if File::file?(ARGV[0])
Expand All @@ -139,7 +136,6 @@ def exec_statement(s)
exit false
end


sqlPath = ""
if ARGV[2]
if File::file?(ARGV[2]) or File::directory?(ARGV[2])
Expand All @@ -151,21 +147,22 @@ def exec_statement(s)
end

path = OpenStudio::Path.new(radiancePath).to_s
raypath = (OpenStudio::Path.new(radiancePath).parent_path() / OpenStudio::Path.new('lib')).to_s()
raypath = (OpenStudio::Path.new(radiancePath).parent_path() /
OpenStudio::Path.new('lib')).to_s()

epw2weapath = (OpenStudio::Path.new(radiancePath) / OpenStudio::Path.new('epw2wea')).to_s
if Dir.glob(epw2weapath + '*').empty?
puts "Cannot find epw2wea tool in radiance installation at '#{radiancePath}'. You may need to install a newer version of radiance."
exit false
end
ENV["EPW2WEAPATH"] = epw2weapath

ENV["EPW2WEAPATH"] = epw2weapath
programExtension = ''
if /mswin/.match(RUBY_PLATFORM) or /mingw/.match(RUBY_PLATFORM)
programExtension = ".exe"
perlpath = ""
if OpenStudio::applicationIsRunningFromBuildDirectory()
perlpath = OpenStudio::getApplicationRunDirectory().parent_path().parent_path() / OpenStudio::Path.new("strawberry-perl-5.16.2.1-32bit-portable-reduced/perl/bin")
perlpath = OpenStudio::getApplicationRunDirectory().parent_path().parent_path() /
OpenStudio::Path.new("strawberry-perl-5.16.2.1-32bit-portable-reduced/perl/bin")
else
perlpath = OpenStudio::getApplicationRunDirectory().parent_path() / OpenStudio::Path.new("strawberry-perl-5.16.2.1-32bit-portable-reduced/perl/bin")
perlpath = OpenStudio::getApplicationRunDirectory().parent_path() /
OpenStudio::Path.new("strawberry-perl-5.16.2.1-32bit-portable-reduced/perl/bin")
end
puts "Adding path for local perl: " + perlpath.to_s
ENV["PATH"] = ENV["PATH"] + ";" + path + ";" + perlpath.to_s
Expand All @@ -175,6 +172,13 @@ def exec_statement(s)
ENV["RAYPATH"] = path + ":" + raypath + ":."
end

if Dir.glob(epw2weapath + programExtension).empty?
puts "(test) Cannot find epw2wea tool in radiance installation at '#{radiancePath}'. \
You may need to install a newer version of Radiance."
exit false
end
ENV["EPW2WEAPATH"] = epw2weapath

puts "Setting RAYPATH: " + raypath + ", " + path + ", '.'"
puts "Appending PATH: " + path + ", '.'"

Expand Down Expand Up @@ -205,7 +209,8 @@ def exec_statement(s)
end

modelPathObj = OpenStudio::Path.new(modelPath)
outPath = modelPathObj.parent_path / OpenStudio::Path.new(modelPathObj.stem) / OpenStudio::Path.new("model") / OpenStudio::Path.new("radiance")
outPath = modelPathObj.parent_path / OpenStudio::Path.new(modelPathObj.stem) /
OpenStudio::Path.new("model") / OpenStudio::Path.new("radiance")

daylightsimOpts = "--x"
File.open("#{outPath}/options/daylightsim.opt", "r") do |file|
Expand Down
2 changes: 1 addition & 1 deletion openstudiocore/ruby/openstudio/radiance/DaylightMetrics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def writeTimeSeriesToSql(sqlfile, simDateTimes, illum, space_name, ts_name, ts_u
if map_value > 0 and map_value < daylightSetpoint
num_cda += map_value / daylightSetpoint
end
if map_value > 100 and map_value < 2000
if map_value > 100 and map_value < 3000
num_udi += 1
end
end
Expand Down
Loading

5 comments on commit 53bd09c

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PATErrors (macumber) - x86_64-Linux-Ubuntu-14.04-clang-3.5: OK (2082 of 2204 tests passed)

Build Badge Test Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PATErrors (macumber) - x86_64-Linux-Ubuntu-14.04-cppcheck-1.61: OK (0 of 0 tests passed)

Build Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PATErrors (macumber) - x86_64-MacOS-10.9-clang: Tests Failed

Build Badge Test Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PATErrors (macumber) - i386-Windows-7-VisualStudio-12: Tests Failed

Build Badge Test Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PATErrors (macumber) - Win64-Windows-7-VisualStudio-12: Tests Failed

Build Badge Test Badge

Please sign in to comment.