-
Notifications
You must be signed in to change notification settings - Fork 25
Attempting to address 153, by allowing user to specifically import 99%,99.6%, 0.4%,1% and 2% annual design days #791
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
Thanks @antonszilasi! I think the first thing to do is to create a mockup of the UI that we want to make, the unmethours post suggested this from Trace: Once we have the mockup, we can create the widget to match it. |
Marking the PR as non-draft because I want a CI run on it. @antonszilasi I fixed up the clang format and the cppcheck thingy quickly. |
|
||
std::vector<model::DesignDay> filterDesignDays(const std::vector<model::DesignDay>& designDays, const std::string& dayType, | ||
const std::string& percentage, const std::string& humidityConditionType = "") { | ||
std::vector<model::DesignDay> filteredDesignDays; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably reserve first.
I think you could just do it in place instead of copying around though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dialog.accept(); | ||
}); | ||
|
||
// Populate table for Heating and Cooling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd expect a check to not include the checkboxes if the design days aren't in the DDY file to begin with.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
connect(checkBox, &QCheckBox::toggled, [=, &designDaysToInsert](bool checked) { | ||
if (checked) { | ||
std::string dayType = (row == 0) ? "WinterDesignDay" : "SummerDesignDay"; | ||
std::vector<model::DesignDay> filteredDays = filterDesignDays(allDesignDays, dayType, percentages[col]); | ||
designDaysToInsert.insert(designDaysToInsert.end(), filteredDays.begin(), filteredDays.end()); | ||
} else { | ||
// Remove unchecked design days | ||
std::string dayType = (row == 0) ? "WinterDesignDay" : "SummerDesignDay"; | ||
std::vector<model::DesignDay> filteredDays = filterDesignDays(allDesignDays, dayType, percentages[col]); | ||
for (const auto& day : filteredDays) { | ||
auto it = std::find(designDaysToInsert.begin(), designDaysToInsert.end(), day); | ||
if (it != designDaysToInsert.end()) { | ||
designDaysToInsert.erase(it); | ||
} | ||
} | ||
} | ||
okButton->setEnabled(!designDaysToInsert.empty()); | ||
}); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could avoid constantly refiltering, delaying the filtering until the "Ok" button is clicked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I started a test bed here in case it's useful: https://godbolt.org/z/rxern817h |
I have read the CLA Document and I hereby sign the CLA |
Importing design days appears to be working
3e269fe
to
a5263ba
Compare
{ | ||
return false; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Importing ddy which is missing 0.4% design days |
…levels, add a gtest
… instead, attempt to fix the Mac CI issue. Really want NREL/OpenStudio#5229 to be fixed as the root cause
I think your interface is nice as is @macumber. I was originally thinking we've do something fancier/more explicitly per this link I started, but I don't know if it's worth overdoing it. std::vector<std::string> heatingPercentages = {"99.6%", "99%"};
std::vector<std::string> coolingPercentages = {"2%", "1%", ".4%"};
std::vector<DesignDayInfo> designDayTypes = {
// Heating
{.day_type = DesignDayInfo::DayType::Heating, .lookup_string = "DB", .name = "Heating", .tooltip = "Sizing heating equipment"},
{.day_type = DesignDayInfo::DayType::Heating, .lookup_string = "WS=>MCDB", .name = "Heating Windy", .tooltip = "Used for sizing based on infiltration"},
{.day_type = DesignDayInfo::DayType::Heating, .lookup_string = "DP=>MCDB", .name = "Heating Humid", .tooltip = "Used for sizing dehumidification systems"},
// Cooling
{.day_type = DesignDayInfo::DayType::Cooling, .lookup_string = "DB=>MWB", .name = "Cooling", .tooltip = "Sizing Chillers or air-conditioning units"},
{.day_type = DesignDayInfo::DayType::Cooling, .lookup_string = "WB=>MDB", .name = "Cooling Latent", .tooltip = "Used to size cooling towers, evap-coolers, and fresh-air ventilation systems"},
{.day_type = DesignDayInfo::DayType::Cooling, .lookup_string = "DP=>MDB", .name = "Cooling Dehum", .tooltip = "Used for sizing dehumidification systems"},
{.day_type = DesignDayInfo::DayType::Cooling, .lookup_string = "Enth=>MDB", .name = "Cooling Enthalpy", .tooltip = "Used for sizing based on infiltration and/or ventilation"},
}; It would look kinda like your mockup but with extra rows for the cooling ones and tooltips |
…objects are deleted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR aims to address issue 153 by allowing users to selectively import design days with specific percentages (99%, 99.6%, 0.4%, 1%, and 2%) to better refine annual design day selections.
- Added grid cell selection signal emissions in OSObjectSelector.
- Introduced style updating and header/visibility properties in OSCellWrapper.
- Implemented a dialog in LocationTabView for selecting design days and updated associated test cases.
Reviewed Changes
Copilot reviewed 11 out of 23 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
src/shared_gui_components/OSObjectSelector.cpp | Emits grid row selection changes after updating cell info. |
src/shared_gui_components/OSCellWrapper.hpp & OSCellWrapper.cpp | Adds updateStyle functionality and new member variables to control style. |
src/openstudio_lib/LocationTabView.hpp & LocationTabView.cpp | Introduces design day selection dialog, SortableDesignDay helper, and modifies design day insertion/removal logic. |
src/openstudio_lib/test/LocationTab_GTest.cpp | Updates test cases for SortableDesignDay behavior. |
.github/workflows/app_build.yml | Updates Conan install flags for improved compatibility with recent Clang. |
Files not reviewed (12)
- src/openstudio_lib/CMakeLists.txt: Language not supported
- translations/OpenStudioApp_ar.ts: Language not supported
- translations/OpenStudioApp_ca.ts: Language not supported
- translations/OpenStudioApp_de.ts: Language not supported
- translations/OpenStudioApp_el.ts: Language not supported
- translations/OpenStudioApp_es.ts: Language not supported
- translations/OpenStudioApp_fa.ts: Language not supported
- translations/OpenStudioApp_fr.ts: Language not supported
- translations/OpenStudioApp_he.ts: Language not supported
- translations/OpenStudioApp_hi.ts: Language not supported
- translations/OpenStudioApp_it.ts: Language not supported
- translations/OpenStudioApp_ja.ts: Language not supported
Comments suppressed due to low confidence (1)
src/shared_gui_components/OSCellWrapper.cpp:585
- [nitpick] Consider adding inline comments to clarify the bit ordering in the 'style' bitset to help future maintainers understand how the style string is constructed.
std::bitset<2> style;
QPushButton* cancelButton = new QPushButton(tr("Cancel"), &dialog); | ||
connect(cancelButton, &QPushButton::clicked, &dialog, &QDialog::reject); | ||
|
||
// import all imports everythig |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in comment: 'everythig' should be corrected to 'everything'.
// import all imports everythig | |
// import all imports everything |
Copilot uses AI. Check for mistakes.
WIP to address issue 153 and sketching out some ideas