-
Notifications
You must be signed in to change notification settings - Fork 25
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
Attempting to address 153, by allowing user to specifically import 99%,99.6%, 0.4%,1% and 2% annual design days #791
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 |
@@ -794,7 +794,7 @@ void InspectorGadget::layoutComboBox(QVBoxLayout* layout, QWidget* parent, opens | |||
idx = 0; | |||
combo->insertItem(idx, QPixmap(":/images/alert_image.png"), curVal.c_str(), "Invalid"); | |||
|
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.
Not sure what happened here, theres no change
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's a white space change on line 797, I bet your editor is set to automatically update the indents. You can just git checkout origin/develop -- src/model_editor/InspectorGadget.cpp
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 applied that fix and oddly this still shows up here, that is weird.
…levels, add a gtest
… instead, attempt to fix the Mac CI issue. Really want NREL/OpenStudio#5229 to be fixed as the root cause
|
||
static QString key(const QString& type, int sortablePermil); | ||
|
||
QString type() const; |
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.
@jmarrec it might be useful to add this interface directly to the SDK DesignDay object, basically it would just parse this information out of the DesignDay name. What do you think? Is that useful enough I should make a PR to the SDK?
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
setStyleSheet("QWidget#OSCellWrapper { border: none; border-right: 1px solid gray; border-bottom: 1px solid gray; }" | ||
"QWidget#OSCellWrapper[header=\"true\"]{ border: none; border-top: 1px solid black; border-right: 1px solid gray; border-bottom: 1px " | ||
"solid black; }"); | ||
setStyleSheet( |
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.
@antonszilasi These border lines in the stylesheet were what remained when we hid the cells
WIP to address issue 153 and sketching out some ideas