Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into ems-enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
brianlball committed Apr 25, 2018
2 parents 61bab97 + 81b82a4 commit 7e23793
Show file tree
Hide file tree
Showing 11 changed files with 60 additions and 16 deletions.
2 changes: 1 addition & 1 deletion dependencies/ruby/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ source "http://rubygems.org"
gem 'openstudio-workflow', '= 1.3.2'
#gem 'openstudio-workflow', :github => 'NREL/OpenStudio-workflow-gem', :ref => 'c2ad7e012bc8a4b4de071a0cd752e84babdf1ee5'

gem 'openstudio-standards', '= 0.2.0'
gem 'openstudio-standards', '= 0.2.1'
#gem 'openstudio-standards', :github => 'NREL/openstudio-standards', :ref => '1a6a81d242f1783ace78c737059d2ef6121e5675'

gem 'rspec', '= 3.5.0'
Expand Down
6 changes: 3 additions & 3 deletions dependencies/ruby/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ GEM
builder
minitest (>= 2.12, < 5.0)
powerbar
openstudio-standards (0.2.0)
openstudio-standards (0.2.1)
openstudio-workflow (1.3.2)
parallel (1.10.0)
powerbar (1.0.18)
powerbar (2.0.1)
hashie (>= 1.1.0)
rspec (3.5.0)
rspec-core (~> 3.5.0)
Expand All @@ -38,7 +38,7 @@ PLATFORMS
DEPENDENCIES
bundler (= 1.14.4)
minitest-reporters (= 0.14.24)
openstudio-standards (= 0.2.0)
openstudio-standards (= 0.2.1)
openstudio-workflow (= 1.3.2)
parallel (= 1.10.0)
rspec (= 3.5.0)
Expand Down
4 changes: 2 additions & 2 deletions openstudiocore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -583,8 +583,8 @@ endif()
# to update the openstudio gems, you must first update the gems specified in the \dependencies\ruby\Gemfile file
# next, build the openstudio-gems target of the OpenStudio super-build project (CMakeLists.txt one directory above this)
# upload the openstudio-gems-DATE.tar.gz to the dependencies location on s3, then update the MD5sum and url below
set(OPENSTUDIO_GEMS_ZIP_FILENAME "openstudio-gems-20180325.tar.gz")
set(OPENSTUDIO_GEMS_ZIP_EXPECTED_MD5 "ac9e76129679612a4761fb47b3a9a127")
set(OPENSTUDIO_GEMS_ZIP_FILENAME "openstudio-gems-20180419.tar.gz")
set(OPENSTUDIO_GEMS_ZIP_EXPECTED_MD5 "67062b8ddc985bd9ac54640b31bba983")

set(OPENSTUDIO_GEMS_ZIP_LOCAL_PATH "${CMAKE_BINARY_DIR}/${OPENSTUDIO_GEMS_ZIP_FILENAME}")
if(EXISTS "${OPENSTUDIO_GEMS_ZIP_LOCAL_PATH}")
Expand Down
39 changes: 39 additions & 0 deletions openstudiocore/src/cli/embedded_help.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,45 @@ def load_resource_relative(path, mode='r')
return result
end

# Finds files relative to a given location whose names
# (not including file extension) match the regex
# and whose extension matches the specified extension.
# Recursively includes files in subdirectories below the given location.
#
# @param path [String] the directory to search relative to the current file.
# Use ./ for the current directory
# @param file_name_regexp [Regexp] the Ruby regular expression to match the file name
# (including the file extension).
# @return [Array<String>] an array of absolute file paths matching the specified string
def embedded_files_relative(path, file_name_regexp)

# Resolve the absolute path to the caller location
absolute_path = File.dirname(caller_locations(1,1)[0].path) + '/' + path
if absolute_path.chars.first == ':'
absolute_path[0] = ''
absolute_path = File.expand_path absolute_path

# strip Windows drive letters
if /[A-Z]\:/.match(absolute_path)
absolute_path = absolute_path[2..-1]
end
absolute_path = ':' + absolute_path
end

# Loop through all the files in the embedded system
matches = []
EmbeddedScripting.allFileNamesAsString.split(';').each do |file|
# Skip files outside of the specified directory
next unless file.include?(absolute_path)
# Skip files that don't match the file_name_pattern criterion
next unless File.basename(file).match(file_name_regexp)
# If here, found a match
matches << file
end

return matches
end

end

$autoload_hash = {}
Expand Down
3 changes: 2 additions & 1 deletion openstudiocore/src/cli/openstudio_cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,8 @@ def parse_main_args(main_args)
# find all the embedded gems
begin
EmbeddedScripting::allFileNamesAsString().split(';').each do |f|
if md = /specifications\/.*\.gemspec$/.match(f)
if md = /specifications\/.*\.gemspec$/.match(f) ||
md = /bundler\/.*\.gemspec$/.match(f)
begin
spec = EmbeddedScripting::getFileAsString(f)
s = eval(spec)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ boost::optional<IdfObject> ForwardTranslator::translateThermalZone( ThermalZone

if (outdoorAirFlowperPerson > 0){

// todo: improve this?
// TODO: improve this?
// find first people schedule
std::vector<People> allPeople;
for (People people : spaces[0].people()){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ TEST_F(EnergyPlusFixture, ForwardTranslatorTest_MultiThreadedLogMessages) {
}
};

Logger::instance().standardOutLogger().enable();
// Logger::instance().standardOutLogger().enable();

Model model;
Space space(model); // not in thermal zone will generate a warning
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ using namespace openstudio::model;
using namespace openstudio;

TEST_F(EnergyPlusFixture, ForwardTranslator_SurfacePropertyConvectionCoefficients_InternalMass) {
openstudio::Logger::instance().standardOutLogger().enable();
openstudio::Logger::instance().standardOutLogger().setLogLevel(Debug);
// openstudio::Logger::instance().standardOutLogger().enable();
// openstudio::Logger::instance().standardOutLogger().setLogLevel(Debug);
Model model;
ThermalZone zone(model);
Space space(model);
Expand Down Expand Up @@ -133,8 +133,8 @@ TEST_F(EnergyPlusFixture, ForwardTranslator_SurfacePropertyConvectionCoefficient
}

TEST_F(EnergyPlusFixture, ForwardTranslator_SurfacePropertyConvectionCoefficients_Surface) {
openstudio::Logger::instance().standardOutLogger().enable();
openstudio::Logger::instance().standardOutLogger().setLogLevel(Debug);
// openstudio::Logger::instance().standardOutLogger().enable();
// openstudio::Logger::instance().standardOutLogger().setLogLevel(Debug);
Model model;
ThermalZone zone(model);
Space space(model);
Expand Down
4 changes: 4 additions & 0 deletions openstudiocore/src/model/ModelObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,10 @@ namespace detail {
boost::replace_all(sqlObjectType, "OS:", "");

// Special logic to deal with EnergyPlus inconsistencies
if (sqlObjectType == "Coil:Heating:Gas") {
sqlObjectType = "Coil:Heating:Fuel";
}

if (sqlObjectType == "CoilPerformance:DX:Cooling") {
// Get the parent object
boost::optional<CoilCoolingDXTwoStageWithHumidityControlMode> parentCoil;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ using namespace openstudio::model;

TEST_F(ModelFixture, AirflowNetwork_DuctViewFactors_Basic)
{
openstudio::Logger::instance().standardOutLogger().enable();
openstudio::Logger::instance().standardOutLogger().setLogLevel(Info);
// openstudio::Logger::instance().standardOutLogger().enable();
// openstudio::Logger::instance().standardOutLogger().setLogLevel(Info);
Model model;
Point3dVector points;

Expand Down
2 changes: 1 addition & 1 deletion openstudiocore/src/openstudio_lib/LightsInspectorView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ void LightsDefinitionInspectorView::attach(openstudio::model::LightsDefinition &
);

// m_returnAirFractionEdit->bind(lightsDefinition,"returnAirFraction",m_isIP);
m_fractionVisibleEdit->bind(
m_returnAirFractionEdit->bind(
m_isIP,
*m_lightsDefinition,
OptionalDoubleGetter(std::bind(&model::LightsDefinition::returnAirFraction, m_lightsDefinition.get_ptr())),
Expand Down

0 comments on commit 7e23793

Please sign in to comment.