From d246776d2b1feadb0f21d719a23ff4b9c28399f0 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Thu, 12 Apr 2018 15:53:16 +0200 Subject: [PATCH 1/8] Fix #3096 --- openstudiocore/src/openstudio_lib/LightsInspectorView.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openstudiocore/src/openstudio_lib/LightsInspectorView.cpp b/openstudiocore/src/openstudio_lib/LightsInspectorView.cpp index 697f87545dc..b51a28788f0 100644 --- a/openstudiocore/src/openstudio_lib/LightsInspectorView.cpp +++ b/openstudiocore/src/openstudio_lib/LightsInspectorView.cpp @@ -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())), From 9a5b0e60d37c3eccaa303c91bfaf8fc30a57d94c Mon Sep 17 00:00:00 2001 From: Dan Macumber Date: Sat, 14 Apr 2018 15:59:02 -0600 Subject: [PATCH 2/8] Also load gemspecs under bundler which is where github gems end up --- openstudiocore/src/cli/openstudio_cli.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openstudiocore/src/cli/openstudio_cli.rb b/openstudiocore/src/cli/openstudio_cli.rb index 04496a1128a..26ad253c6da 100644 --- a/openstudiocore/src/cli/openstudio_cli.rb +++ b/openstudiocore/src/cli/openstudio_cli.rb @@ -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) From 9ef716b7bb588bc21a4854c5c7c7f027c0c1ae3d Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Wed, 18 Apr 2018 17:21:43 +0200 Subject: [PATCH 3/8] Turn Off standardOutLogger or it'll affect ALL subsequent tests. The Model/EnergyPlusFixture redirects them to a log file for a reason! Three tests were responsible for an output that was unreadable. --- .../ForwardTranslator/ForwardTranslateThermalZone.cpp | 2 +- .../src/energyplus/Test/ForwardTranslator_GTest.cpp | 2 +- .../Test/SurfacePropertyConvectionCoefficients.cpp | 8 ++++---- .../model/test/AirflowNetworkDuctViewFactors_GTest.cpp | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/openstudiocore/src/energyplus/ForwardTranslator/ForwardTranslateThermalZone.cpp b/openstudiocore/src/energyplus/ForwardTranslator/ForwardTranslateThermalZone.cpp index d36dc79fc8b..f55a8b98470 100644 --- a/openstudiocore/src/energyplus/ForwardTranslator/ForwardTranslateThermalZone.cpp +++ b/openstudiocore/src/energyplus/ForwardTranslator/ForwardTranslateThermalZone.cpp @@ -819,7 +819,7 @@ boost::optional ForwardTranslator::translateThermalZone( ThermalZone if (outdoorAirFlowperPerson > 0){ - // todo: improve this? + // TODO: improve this? // find first people schedule std::vector allPeople; for (People people : spaces[0].people()){ diff --git a/openstudiocore/src/energyplus/Test/ForwardTranslator_GTest.cpp b/openstudiocore/src/energyplus/Test/ForwardTranslator_GTest.cpp index ab29e072adb..cf8e20e08b5 100644 --- a/openstudiocore/src/energyplus/Test/ForwardTranslator_GTest.cpp +++ b/openstudiocore/src/energyplus/Test/ForwardTranslator_GTest.cpp @@ -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 diff --git a/openstudiocore/src/energyplus/Test/SurfacePropertyConvectionCoefficients.cpp b/openstudiocore/src/energyplus/Test/SurfacePropertyConvectionCoefficients.cpp index 30bdf630c8a..f1e604a4b1e 100644 --- a/openstudiocore/src/energyplus/Test/SurfacePropertyConvectionCoefficients.cpp +++ b/openstudiocore/src/energyplus/Test/SurfacePropertyConvectionCoefficients.cpp @@ -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); @@ -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); diff --git a/openstudiocore/src/model/test/AirflowNetworkDuctViewFactors_GTest.cpp b/openstudiocore/src/model/test/AirflowNetworkDuctViewFactors_GTest.cpp index 23bf1ce9c40..ce18cc5f72d 100644 --- a/openstudiocore/src/model/test/AirflowNetworkDuctViewFactors_GTest.cpp +++ b/openstudiocore/src/model/test/AirflowNetworkDuctViewFactors_GTest.cpp @@ -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; From dc258763e27b4afa6b153f65eecf6763958cee77 Mon Sep 17 00:00:00 2001 From: Andrew Parker Date: Wed, 18 Apr 2018 13:28:05 -0600 Subject: [PATCH 4/8] Fixes #2963 Coil:Heating:Gas autosizedNominalCapacity() --- openstudiocore/src/model/ModelObject.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openstudiocore/src/model/ModelObject.cpp b/openstudiocore/src/model/ModelObject.cpp index f95969e57ef..ab1d4584aba 100644 --- a/openstudiocore/src/model/ModelObject.cpp +++ b/openstudiocore/src/model/ModelObject.cpp @@ -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 parentCoil; From 4b5c7d05ab8a112709d874c3f98e8481c5cb38bd Mon Sep 17 00:00:00 2001 From: Andrew Parker Date: Wed, 18 Apr 2018 21:09:26 -0600 Subject: [PATCH 5/8] Adds method to embedded_help to be used in openstudio-standards gem to find files relative to file in embedded system --- openstudiocore/src/cli/embedded_help.rb | 39 +++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/openstudiocore/src/cli/embedded_help.rb b/openstudiocore/src/cli/embedded_help.rb index be439883f39..dad2872339f 100644 --- a/openstudiocore/src/cli/embedded_help.rb +++ b/openstudiocore/src/cli/embedded_help.rb @@ -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] 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 = {} From e8c597b1250017dfdaaca052c55eb17cf217bb5a Mon Sep 17 00:00:00 2001 From: Andrew Parker Date: Thu, 19 Apr 2018 14:55:01 -0600 Subject: [PATCH 6/8] Updates openstudio-standards to 0.2.1 to handle running from OS CLI --- dependencies/ruby/Gemfile | 2 +- dependencies/ruby/Gemfile.lock | 6 +++--- openstudiocore/CMakeLists.txt | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dependencies/ruby/Gemfile b/dependencies/ruby/Gemfile index 0716ed91f90..eb16bb41acf 100644 --- a/dependencies/ruby/Gemfile +++ b/dependencies/ruby/Gemfile @@ -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' diff --git a/dependencies/ruby/Gemfile.lock b/dependencies/ruby/Gemfile.lock index f49b7474e78..d6fa1d704de 100644 --- a/dependencies/ruby/Gemfile.lock +++ b/dependencies/ruby/Gemfile.lock @@ -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) @@ -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) diff --git a/openstudiocore/CMakeLists.txt b/openstudiocore/CMakeLists.txt index c2e9ce8f6e0..0a3b828745a 100644 --- a/openstudiocore/CMakeLists.txt +++ b/openstudiocore/CMakeLists.txt @@ -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}") From 333c951537da1eb8a3f6c6f0c1b225c27550d658 Mon Sep 17 00:00:00 2001 From: evanweaver Date: Fri, 20 Apr 2018 11:16:10 -0600 Subject: [PATCH 7/8] Update .gitlab-ci.yml --- .gitlab-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c6bb373dc7e..1609e8a1255 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -173,7 +173,7 @@ build_deploy_all_others:windows: cache: key: openstudio_windows untracked: true - policy: pull + #policy: push # NOTE: use default pull-push policy paths: - build @@ -212,7 +212,7 @@ build_deploy_all_others:mac: cache: key: openstudio_mac untracked: true - policy: pull + #policy: push # NOTE: use default pull-push policy paths: - build @@ -252,7 +252,7 @@ build_deploy_all_others:ubuntu: cache: key: openstudio_ubuntu untracked: true - policy: pull + #policy: push # NOTE: use default pull-push policy paths: - build From 37c475a58518cf8f3a9e1db6be9b32d477941aab Mon Sep 17 00:00:00 2001 From: bball Date: Mon, 23 Apr 2018 09:07:09 -0600 Subject: [PATCH 8/8] update test for clone --- .../model/test/PlantComponentUserDefined_GTest.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/openstudiocore/src/model/test/PlantComponentUserDefined_GTest.cpp b/openstudiocore/src/model/test/PlantComponentUserDefined_GTest.cpp index ffe49ff64be..d8b282a83cf 100644 --- a/openstudiocore/src/model/test/PlantComponentUserDefined_GTest.cpp +++ b/openstudiocore/src/model/test/PlantComponentUserDefined_GTest.cpp @@ -108,21 +108,15 @@ TEST_F(ModelFixture, PlantComponentUserDefined_addToNode) { EXPECT_EQ((unsigned)7, plantLoop.demandComponents().size()); m.save(toPath("./PlantComponentUserDefinedTestBefore.osm"), true); + EXPECT_EQ((unsigned)7, plantLoop.demandComponents().size()); EnergyManagementSystemActuator actuator = testObject.designVolumeFlowRateActuator().get(); - PlantComponentUserDefined testObjectClone = testObject.clone(m).cast(); EXPECT_TRUE(testObject.designVolumeFlowRateActuator()); EXPECT_TRUE(testObjectClone.designVolumeFlowRateActuator()); EXPECT_TRUE(testObjectClone.designVolumeFlowRateActuator().get().actuatedComponent()); - //EXPECT_EQ(testObjectClone.designVolumeFlowRateActuator().get().actuatedComponent().get().handle(), testObjectClone.handle()); - EXPECT_EQ(testObjectClone.designVolumeFlowRateActuator().get().actuatedComponent().get().handle(), testObject.handle()); - m.save(toPath("./PlantComponentUserDefinedTest.osm"), true); - supplyOutletNode = plantLoop.supplyOutletNode(); - m.save(toPath("./PlantComponentUserDefinedTestAfter.osm"), true); - EXPECT_TRUE(testObjectClone.addToNode(supplyOutletNode)); - EXPECT_EQ((unsigned)7, plantLoop.supplyComponents().size()); - EXPECT_EQ((unsigned)7, plantLoop.demandComponents().size()); + EXPECT_EQ(testObjectClone.designVolumeFlowRateActuator().get().actuatedComponent().get().handle(), testObjectClone.handle()); + m.save(toPath("./PlantComponentUserDefinedTestClone.osm"), true); } TEST_F(ModelFixture, PlantComponentUserDefined_remove) {