Skip to content

Commit a64e47b

Browse files
macumberjmarrec
andauthored
Merge for RC2 (#827)
* #816 - Add new images for ZoneHVAC:EvaporativeCoolerUnit * #816 - Add library entry ZoneHVAC:EvaporativeCoolerUnit * #816 - Add ZoneHVAC:EvaporativeCoolerUnit to hvac_library (+ delete Always On) * #816 - Policy for ZoneHVAC:EvaporativeCoolerUnit * Unrelated but remove ZoneHVAC entries in Facility and Spaces tab, they make no sense * FIx #815 - Add OutputControl:ResilienceSummaries to OS App * #799 - Add Support for AlmaLinux9 * Revert changes to BuildingComponentDialogCentralWidget from PR #795, fixes #823, reopens #166 * Bump to 1.10.0-rc2 * #825 - Expose Terrain, Elevation and Keep Site Location Information on the Site Tab (#826) * #825 - Rough QComboBox implementation * Use an OSComboBox2 * Expose Elevation and Keep Site Location Information * Smart detect if Elevation is actually from WeatherFile or not * Also reset Elevation to Weather File's * Shush cppcheck * Minor tweak to show type as Unknown if not found for component or measure * Tweak/hack to force the defaulted style to update, default style is now based on the keep site information switch * Add method to force restyling of combo box even if value stays the same, fix bug when setting combo box to current defaulted value --------- Co-authored-by: Dan Macumber <dan.macumber@gmail.com> --------- Co-authored-by: Julien Marrec <julien.marrec@gmail.com>
1 parent 71e3cf8 commit a64e47b

24 files changed

+340
-127
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ endif()
272272

273273
# TODO: Modify the more specific variables as needed to indicate prerelease, etc
274274
# Keep in beta in-between release cycles. Set to empty string (or comment out) for official)
275-
set(PROJECT_VERSION_PRERELEASE "rc1")
275+
set(PROJECT_VERSION_PRERELEASE "rc2")
276276

277277
# OpenStudio version: Only include Major.Minor.Patch, eg "3.0.0", even if you have a prerelease tag
278278
set(OPENSTUDIOAPPLICATION_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")

FindOpenStudioSDK.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ elseif(UNIX)
3737
else()
3838
set(OPENSTUDIO_EXPECTED_HASH 209820bd2f9b487f0d0f4d4df311753f)
3939
endif()
40+
elseif(LSB_RELEASE_ID_SHORT MATCHES "AlmaLinux")
41+
if (ARCH MATCHES "arm64")
42+
message(FATAL_ERROR "OpenStudio SDK for AlmaLinux is only built for x86_64")
43+
endif()
44+
set(OPENSTUDIO_EXPECTED_HASH 7ed93ad951b654cc6466803e365ddc17)
4045
else()
4146
message(FATAL_ERROR "OpenStudio SDK no longer provides packages for Ubuntu 20.04 or older")
4247
endif()

ruby/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ if(BUILD_TESTING)
147147
"/usr/share/rvm/rubies/ruby-3.2.2/bin/"
148148
"$ENV{HOME}/.rvm/rubies/ruby-3.2.2/bin/"
149149
"$ENV{HOME}/.rbenv/versions/3.2.2/bin/"
150+
"/opt/rbenv/versions/3.2.2/bin/"
150151

151152
"C:/Ruby32-x64/bin/"
152153

src/openstudio_app/Resources/default/hvac_library.osm

Lines changed: 64 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13068,7 +13068,7 @@ OS:Fan:ConstantVolume,
1306813068
OS:Coil:Heating:Gas:MultiStage,
1306913069
{3b1fedfa-eb94-4c41-9ff0-eb695f74535d}, !- Handle
1307013070
Multi Speed HP Gas Htg Coil, !- Name
13071-
{1540674d-a780-43fe-a8dd-b0b23e85b39e}, !- Availability Schedule
13071+
{9f54092d-a4a8-41b8-a381-c4c332ecb843}, !- Availability Schedule
1307213072
, !- Air Inlet Node
1307313073
, !- Air Outlet Node
1307413074
, !- Part Load Fraction Correlation Curve
@@ -13317,7 +13317,7 @@ OS:AirLoopHVAC:UnitaryHeatPump:AirToAir:MultiSpeed,
1331713317
, !- Controlling Zone or Thermostat Location
1331813318
{0f1dd656-a681-48a5-839e-80d7417180c6}, !- Supply Air Fan
1331913319
DrawThrough, !- Supply Air Fan Placement
13320-
{1540674d-a780-43fe-a8dd-b0b23e85b39e}, !- Supply Air Fan Operating Mode Schedule
13320+
{9f54092d-a4a8-41b8-a381-c4c332ecb843}, !- Supply Air Fan Operating Mode Schedule
1332113321
{3b1fedfa-eb94-4c41-9ff0-eb695f74535d}, !- Heating Coil
1332213322
-8, !- Minimum Outdoor Dry-Bulb Temperature for Compressor Operation {C}
1332313323
{a76a42fb-2594-4514-afb9-fd45a05494fc}, !- Cooling Coil
@@ -13342,20 +13342,6 @@ OS:AirLoopHVAC:UnitaryHeatPump:AirToAir:MultiSpeed,
1334213342
autosize, !- Speed 3 Supply Air Flow Rate During Cooling Operation {m3/s}
1334313343
autosize; !- Speed 4 Supply Air Flow Rate During Cooling Operation {m3/s}
1334413344

13345-
OS:Schedule:Constant,
13346-
{1540674d-a780-43fe-a8dd-b0b23e85b39e}, !- Handle
13347-
Always On Discrete, !- Name
13348-
{0dd600d4-b8cb-4c84-8eb6-780de152cd00}, !- Schedule Type Limits Name
13349-
1; !- Value
13350-
13351-
OS:ScheduleTypeLimits,
13352-
{0dd600d4-b8cb-4c84-8eb6-780de152cd00}, !- Handle
13353-
OnOff 1, !- Name
13354-
0, !- Lower Limit Value
13355-
1, !- Upper Limit Value
13356-
Discrete, !- Numeric Type
13357-
Availability; !- Unit Type
13358-
1335913345
OS:Coil:Cooling:DX:VariableSpeed,
1336013346
{3ef4dbff-bbcf-4645-93ab-fcd09507f984}, !- Handle
1336113347
Coil Cooling DX Variable Speed - Two Speeds, !- Name
@@ -13607,3 +13593,65 @@ OS:Schedule:Day,
1360713593
0, !- Minute 1
1360813594
27; !- Value Until Time 1
1360913595

13596+
OS:ZoneHVAC:EvaporativeCoolerUnit,
13597+
{d2f28626-5582-4e24-82ed-dfab77b63326}, !- Handle
13598+
Zone HVAC Evaporative Cooler Unit, !- Name
13599+
{9f54092d-a4a8-41b8-a381-c4c332ecb843}, !- Availability Schedule Name
13600+
, !- Availability Manager List Name
13601+
, !- Outdoor Air Inlet Node Name
13602+
, !- Cooler Outlet Node Name
13603+
, !- Zone Relief Air Node Name
13604+
{3247e7b6-3164-4d86-8f4e-a8238615ac29}, !- Supply Air Fan Name
13605+
autosize, !- Design Supply Air Flow Rate {m3/s}
13606+
BlowThrough, !- Fan Placement
13607+
ZoneTemperatureDeadbandOnOffCycling, !- Cooler Unit Control Method
13608+
1, !- Throttling Range Temperature Difference {deltaC}
13609+
100, !- Cooling Load Control Threshold Heat Transfer Rate {W}
13610+
{5e5b2500-4e30-4444-914c-39676a69a23b}, !- First Evaporative Cooler
13611+
, !- Second Evaporative Cooler
13612+
, !- Design Specification ZoneHVAC Sizing
13613+
100; !- Shut Off Relative Humidity {percent}
13614+
13615+
OS:Fan:SystemModel,
13616+
{3247e7b6-3164-4d86-8f4e-a8238615ac29}, !- Handle
13617+
Zone HVAC Evaporative Cooler Unit FanSystemModel, !- Name
13618+
{9f54092d-a4a8-41b8-a381-c4c332ecb843}, !- Availability Schedule Name
13619+
, !- Air Inlet Node Name
13620+
, !- Air Outlet Node Name
13621+
autosize, !- Design Maximum Air Flow Rate {m3/s}
13622+
Discrete, !- Speed Control Method
13623+
0.2, !- Electric Power Minimum Flow Rate Fraction
13624+
500, !- Design Pressure Rise {Pa}
13625+
0.9, !- Motor Efficiency
13626+
1, !- Motor In Air Stream Fraction
13627+
autosize, !- Design Electric Power Consumption {W}
13628+
PowerPerFlowPerPressure, !- Design Power Sizing Method
13629+
840, !- Electric Power Per Unit Flow Rate {W/(m3/s)}
13630+
1.66667, !- Electric Power Per Unit Flow Rate Per Unit Pressure {W-s/m3-Pa}
13631+
0.7, !- Fan Total Efficiency
13632+
, !- Electric Power Function of Flow Fraction Curve Name
13633+
, !- Night Ventilation Mode Pressure Rise {Pa}
13634+
, !- Night Ventilation Mode Flow Fraction
13635+
, !- Motor Loss Zone Name
13636+
0, !- Motor Loss Radiative Fraction
13637+
General; !- End-Use Subcategory
13638+
13639+
OS:EvaporativeCooler:Direct:ResearchSpecial,
13640+
{5e5b2500-4e30-4444-914c-39676a69a23b}, !- Handle
13641+
Zone HVAC Evaporative Cooler Unit First Evap Cooler, !- Name
13642+
{9f54092d-a4a8-41b8-a381-c4c332ecb843}, !- Availability Schedule Name
13643+
1, !- Cooler Design Effectiveness
13644+
0, !- Recirculating Water Pump Power Consumption {W}
13645+
, !- Primary Air Design Flow Rate {m3/s}
13646+
, !- Air Inlet Node Name
13647+
, !- Air Outlet Node Name
13648+
, !- Sensor Node Name
13649+
0, !- Drift Loss Fraction
13650+
0, !- Blowdown Concentration Ratio
13651+
, !- Effectiveness Flow Ratio Modifier Curve Name
13652+
0.1, !- Water Pump Power Sizing Factor {W/(m3/s)}
13653+
, !- Water Pump Power Modifier Curve Name
13654+
16, !- Evaporative Operation Minimum Drybulb Temperature
13655+
24, !- Evaporative Operation Maximum Limit Wetbulb Temperature
13656+
28; !- Evaporative Operation Maximum Limit Drybulb Temperature
13657+

src/openstudio_lib/IconLibrary.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,8 @@ IconLibrary::IconLibrary() {
230230
m_icons[openstudio::IddObjectType(openstudio::IddObjectType::OS_ZoneHVAC_Dehumidifier_DX).value()] = new QPixmap(":/images/dehumidifier_dx.png");
231231
m_icons[openstudio::IddObjectType(openstudio::IddObjectType::OS_ZoneHVAC_EnergyRecoveryVentilator).value()] =
232232
new QPixmap(":/images/energy_recov_vent.png");
233+
m_icons[openstudio::IddObjectType(openstudio::IddObjectType::OS_ZoneHVAC_EvaporativeCoolerUnit).value()] =
234+
new QPixmap(":/images/zonehvac_evaporativecoolerunit.png");
233235
m_icons[openstudio::IddObjectType(openstudio::IddObjectType::OS_Coil_Heating_Water_Baseboard).value()] =
234236
new QPixmap(":/images/coilheatingwater_baseboard.png");
235237
m_icons[openstudio::IddObjectType(openstudio::IddObjectType::OS_Coil_Heating_Water_Baseboard_Radiant).value()] =
@@ -701,6 +703,8 @@ IconLibrary::IconLibrary() {
701703
new QPixmap(":/images/mini_icons/coilheatingwater_baseboard_mini.png");
702704
m_miniIcons[openstudio::IddObjectType(openstudio::IddObjectType::OS_Coil_Heating_Water_Baseboard_Radiant).value()] =
703705
new QPixmap(":/images/mini_icons/Coil_Heating_Water_Baseboard_Radiant.png");
706+
m_miniIcons[openstudio::IddObjectType(openstudio::IddObjectType::OS_ZoneHVAC_EvaporativeCoolerUnit).value()] =
707+
new QPixmap(":/images/mini_icons/zonehvac_evaporativecoolerunit.png");
704708
m_miniIcons[openstudio::IddObjectType(openstudio::IddObjectType::OS_ZoneHVAC_FourPipeFanCoil).value()] =
705709
new QPixmap(":/images/mini_single_ducts_constant_vol_4pipe.png");
706710
m_miniIcons[openstudio::IddObjectType(openstudio::IddObjectType::OS_ZoneHVAC_HighTemperatureRadiant).value()] =

src/openstudio_lib/LocationTabView.cpp

Lines changed: 129 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313
#include "OSItemSelectorButtons.hpp"
1414
#include "SchedulesTabController.hpp"
1515

16+
#include "../shared_gui_components/OSComboBox.hpp"
1617
#include "../shared_gui_components/OSGridView.hpp"
18+
#include "../shared_gui_components/OSQuantityEdit.hpp"
19+
#include "../shared_gui_components/OSSwitch.hpp"
1720

1821
#include "../openstudio_app/OpenStudioApp.hpp"
1922

@@ -70,6 +73,7 @@
7073
#include <QCoreApplication>
7174
#include <QObject>
7275
#include <QPushButton>
76+
#include <span>
7377

7478
static constexpr auto NAME("Name: ");
7579
static constexpr auto LATITUDE("Latitude: ");
@@ -174,6 +178,11 @@ LocationView::LocationView(bool isIP, const model::Model& model, const QString&
174178
weatherFileGridLayout->setContentsMargins(7, 3, 7, 7);
175179
weatherFileGridLayout->setSpacing(7);
176180

181+
// ***** Measure Tags GridLayout *****
182+
auto* siteInfoGridLayout = new QGridLayout();
183+
siteInfoGridLayout->setContentsMargins(7, 7, 7, 7);
184+
siteInfoGridLayout->setSpacing(7);
185+
177186
// ***** Measure Tags GridLayout *****
178187
auto* measureTagsGridLayout = new QGridLayout();
179188
measureTagsGridLayout->setContentsMargins(7, 7, 7, 7);
@@ -236,16 +245,13 @@ LocationView::LocationView(bool isIP, const model::Model& model, const QString&
236245

237246
weatherFileGridLayout->addLayout(hLayout, i++, 0);
238247

239-
m_latitudeLbl = new QLabel(tr("Latitude: "));
248+
m_latitudeLbl = new QLabel(tr(LATITUDE));
240249
weatherFileGridLayout->addWidget(m_latitudeLbl, i++, 0);
241250

242-
m_longitudeLbl = new QLabel(tr("Longitude: "));
251+
m_longitudeLbl = new QLabel(tr(LONGITUDE));
243252
weatherFileGridLayout->addWidget(m_longitudeLbl, i++, 0);
244253

245-
m_elevationLbl = new QLabel(tr("Elevation: "));
246-
weatherFileGridLayout->addWidget(m_elevationLbl, i++, 0);
247-
248-
m_timeZoneLbl = new QLabel(tr("Time Zone: "));
254+
m_timeZoneLbl = new QLabel(tr(TIME_ZONE));
249255
weatherFileGridLayout->addWidget(m_timeZoneLbl, i++, 0);
250256

251257
// ***** Weather File Download Location *****
@@ -258,6 +264,91 @@ LocationView::LocationView(bool isIP, const model::Model& model, const QString&
258264
leftVLayout->addLayout(weatherFileGridLayout);
259265
leftVLayout->addStretch();
260266

267+
// Site Information
268+
{
269+
label = new QLabel(tr("Site Information:"));
270+
label->setObjectName("H2");
271+
leftVLayout->addWidget(label);
272+
273+
i = 0;
274+
275+
{
276+
label = new QLabel(tr("Keep Site Location Information"));
277+
label->setToolTip(tr("If enabled, this will write the Site:Location object that will keep the Elevation change for example."));
278+
279+
m_keepSiteLocationInfo = new OSSwitch2();
280+
281+
m_keepSiteLocationInfo->bind(*m_site, BoolGetter([this] { return m_site->keepSiteLocationInformation(); }),
282+
boost::optional<BoolSetter>([this](bool b) {
283+
bool result = m_site->setKeepSiteLocationInformation(b);
284+
285+
if (result) {
286+
287+
// force the style to update
288+
m_elevation->clearCachedText();
289+
290+
if (b) {
291+
// set elevation if turning on
292+
if (m_site->isElevationDefaulted()) {
293+
m_site->setElevation(m_weatherFileElevation);
294+
} else {
295+
m_site->setElevation(m_site->elevation());
296+
}
297+
} else {
298+
// reset elevation if turning off
299+
if (std::abs(m_weatherFileElevation) > 0.01) {
300+
m_site->setElevation(m_weatherFileElevation);
301+
} else {
302+
m_site->resetElevation();
303+
}
304+
}
305+
}
306+
return result;
307+
}),
308+
boost::optional<NoFailAction>([this] { m_site->resetKeepSiteLocationInformation(); }),
309+
boost::optional<BasicQuery>([this] { return m_site->isKeepSiteLocationInformationDefaulted(); }));
310+
311+
siteInfoGridLayout->addWidget(label, i, 0);
312+
siteInfoGridLayout->addWidget(m_keepSiteLocationInfo, i++, 1);
313+
}
314+
{
315+
label = new QLabel(tr(ELEVATION));
316+
label->setToolTip(tr("Elevation affects the wind speed at the site, and is defaulted to the Weather File's elevation"));
317+
318+
m_elevation = new OSQuantityEdit2("m", "m", "ft", m_isIP);
319+
connect(this, &LocationView::toggleUnitsClicked, m_elevation, &OSQuantityEdit2::onUnitSystemChange);
320+
321+
// Bind is delayed until after update() is called, so that the weatherFileElevation is set correctly.
322+
323+
m_elevation->setFixedWidth(200);
324+
325+
siteInfoGridLayout->addWidget(label, i, 0);
326+
siteInfoGridLayout->addWidget(m_elevation, i++, 1);
327+
}
328+
// Terrain
329+
{
330+
label = new QLabel(tr("Terrain"));
331+
label->setToolTip(tr("Terrain affects the wind speed at the site."));
332+
333+
m_terrain = new OSComboBox2();
334+
m_terrain->bind<std::string>(*m_site, static_cast<std::string (*)(const std::string&)>(&openstudio::toString), &model::Site::validTerrainValues,
335+
std::bind(&model::Site::terrain, m_site.get_ptr()),
336+
std::bind(&model::Site::setTerrain, m_site.get_ptr(), std::placeholders::_1),
337+
boost::optional<NoFailAction>(std::bind(&model::Site::resetTerrain, m_site.get_ptr())),
338+
boost::optional<BasicQuery>(std::bind(&model::Site::isTerrainDefaulted, m_site.get_ptr())));
339+
340+
m_terrain->setFixedWidth(200);
341+
342+
siteInfoGridLayout->addWidget(label, i, 0);
343+
siteInfoGridLayout->addWidget(m_terrain, i++, 1);
344+
}
345+
346+
// ***** Site Info GridLayout *****
347+
siteInfoGridLayout->setColumnStretch(++i, 10);
348+
leftVLayout->addLayout(siteInfoGridLayout);
349+
leftVLayout->addStretch();
350+
}
351+
261352
// ***** Climate Zones *****
262353
label = new QLabel(tr("Measure Tags (Optional):"));
263354
label->setObjectName("H2");
@@ -400,11 +491,37 @@ LocationView::LocationView(bool isIP, const model::Model& model, const QString&
400491
connect(m_itemSelectorButtons, &OSItemSelectorButtons::purgeClicked, m_designDaysGridView, &DesignDayGridView::onPurgeClicked);
401492

402493
update();
494+
{
495+
m_elevation->bind(m_isIP, *m_site, DoubleGetter([this] { return m_site->elevation(); }), boost::optional<DoubleSetter>([this](double d) {
496+
// turn keep site info on
497+
m_site->setKeepSiteLocationInformation(true);
498+
return m_site->setElevation(d);
499+
}),
500+
boost::optional<NoFailAction>([this] {
501+
// turn keep site info off
502+
m_site->setKeepSiteLocationInformation(false);
503+
504+
// force the style to update
505+
m_elevation->clearCachedText();
506+
507+
if (std::abs(m_weatherFileElevation) > 0.01) {
508+
m_site->setElevation(m_weatherFileElevation);
509+
} else {
510+
m_site->resetElevation();
511+
}
512+
}),
513+
boost::none, // autosize
514+
boost::none, // autocalculate
515+
boost::optional<BasicQuery>([this] { //
516+
return (m_site->isElevationDefaulted() || !m_site->keepSiteLocationInformation());
517+
}));
518+
}
403519

404520
onSelectItem();
405521
}
406522

407523
LocationView::~LocationView() {
524+
// m_terrain->unbind(); // NOTE: I don't think this is necessary
408525
saveQSettings();
409526
}
410527

@@ -496,6 +613,7 @@ void LocationView::update() {
496613

497614
if (fileExists) {
498615
m_weatherFileBtn->setText(tr("Change Weather File"));
616+
m_weatherFileElevation = weatherFile->elevation();
499617
setSiteInfo();
500618
} else {
501619
m_weatherFileBtn->setText(tr("Set Weather File"));
@@ -526,11 +644,6 @@ void LocationView::setSiteInfo() {
526644
info += temp;
527645
m_longitudeLbl->setText(info);
528646

529-
info = tr(ELEVATION);
530-
temp.setNum(m_site->elevation());
531-
info += temp;
532-
m_elevationLbl->setText(info);
533-
534647
info = tr(TIME_ZONE);
535648
temp.setNum(m_site->timeZone());
536649
info += temp;
@@ -544,9 +657,9 @@ void LocationView::clearSiteInfo() {
544657

545658
m_longitudeLbl->setText(tr(LONGITUDE));
546659

547-
m_elevationLbl->setText(tr(ELEVATION));
548-
549660
m_timeZoneLbl->setText(tr(TIME_ZONE));
661+
662+
m_weatherFileElevation = 0.0;
550663
}
551664

552665
// ***** SLOTS *****
@@ -637,7 +750,10 @@ void LocationView::onWeatherFileBtnClicked() {
637750
m_site->setName(weatherFile->city());
638751
m_site->setLatitude(weatherFile->latitude());
639752
m_site->setLongitude(weatherFile->longitude());
753+
m_weatherFileElevation = weatherFile->elevation();
754+
m_site->setKeepSiteLocationInformation(false);
640755
m_site->setElevation(weatherFile->elevation());
756+
m_site->resetTerrain();
641757
m_site->setTimeZone(weatherFile->timeZone());
642758

643759
m_lastEpwPathOpened = QFileInfo(fileName).absoluteFilePath();

0 commit comments

Comments
 (0)