-
Notifications
You must be signed in to change notification settings - Fork 397
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
Fix #10857 - Report System Summary:Thermostat Schedules depends on order of ZoneControl:Thermostat control types #10861
base: develop
Are you sure you want to change the base?
Changes from all commits
cf934f5
f823493
74dca14
8015564
f6c38b8
15fc6e5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,6 +47,7 @@ | |
|
||
// C++ Headers | ||
#include <cmath> | ||
#include <numeric> | ||
#include <string> | ||
|
||
// ObjexxFCL Headers | ||
|
@@ -546,7 +547,7 @@ void GetZoneAirSetPoints(EnergyPlusData &state) | |
} | ||
} | ||
} // NumTStatStatements | ||
} // Check on number of TempControlledZones | ||
} // Check on number of TempControlledZones | ||
|
||
cCurrentModuleObject = ValidControlTypesUC[static_cast<int>(HVAC::ThermostatType::SingleHeating)]; | ||
state.dataZoneTempPredictorCorrector->NumSingleTempHeatingControls = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); | ||
|
@@ -2050,9 +2051,9 @@ void GetZoneAirSetPoints(EnergyPlusData &state) | |
OutputProcessor::StoreType::Average, | ||
state.dataHeatBal->Zone(TempControlledZone.ActualZoneNum).Name); | ||
} // TStat Objects Loop | ||
} // found thermostat reference | ||
} // loop over NumOpTempControlledZones | ||
} // NumOpTempControlledZones > 0 | ||
} // found thermostat reference | ||
} // loop over NumOpTempControlledZones | ||
} // NumOpTempControlledZones > 0 | ||
|
||
// Overcool dehumidification GetInput starts here | ||
cCurrentModuleObject = cZControlTypes(static_cast<int>(ZoneControlTypes::TandHStat)); | ||
|
@@ -2248,9 +2249,9 @@ void GetZoneAirSetPoints(EnergyPlusData &state) | |
} | ||
|
||
} // TStat Objects Loop | ||
} // found thermostat reference | ||
} // loop over NumTempAndHumidityControlledZones | ||
} // NumTempAndHumidityControlledZones > 0 | ||
} // found thermostat reference | ||
} // loop over NumTempAndHumidityControlledZones | ||
} // NumTempAndHumidityControlledZones > 0 | ||
|
||
// Staged thermostat control inputs start | ||
cCurrentModuleObject = cZControlTypes(static_cast<int>(ZoneControlTypes::StagedDual)); | ||
|
@@ -7021,35 +7022,77 @@ void FillPredefinedTableOnThermostatSchedules(EnergyPlusData &state) | |
// J.Glazer - March 2024 | ||
using OutputReportPredefined::PreDefTableEntry; | ||
auto &orp = state.dataOutRptPredefined; | ||
|
||
// Helper struct so we can sort to ensure a consistent order. | ||
// No matter the order in which the multiple Field Sets (Control Object Type, Control Name), the same thing is reported to the tabular outputs | ||
struct ControlTypeInfo | ||
{ | ||
// HVAC::ThermostatType tType = HVAC::ThermostatType::Invalid; | ||
std::string thermostatType; | ||
std::string controlTypeName; | ||
std::string heatSchName; | ||
std::string coolSchName; | ||
|
||
// Only need the operator<, and we use C++17 so I can't use a defaulted 3-way operator<=> | ||
bool operator<(const ControlTypeInfo &other) const | ||
{ | ||
return std::tie(this->thermostatType, this->controlTypeName, this->heatSchName, this->coolSchName) < | ||
std::tie(other.thermostatType, other.controlTypeName, other.heatSchName, other.coolSchName); | ||
} | ||
}; | ||
using ControlTypeInfoMemPtr = std::string ControlTypeInfo::*; | ||
|
||
auto joinStrings = [](const std::vector<ControlTypeInfo> &infos, ControlTypeInfoMemPtr memPtr) -> std::string { | ||
std::vector<std::string> result; | ||
result.reserve(infos.size()); | ||
for (const auto &info : infos) { | ||
std::string val = info.*memPtr; | ||
if (val.empty()) { | ||
continue; | ||
} | ||
result.emplace_back(std::move(val)); | ||
} | ||
return fmt::format("{}", fmt::join(result, ", ")); | ||
}; | ||
Comment on lines
+7043
to
+7056
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some shenanigans with a Pointer to member to collect and join. |
||
|
||
for (int idx = 1; idx <= state.dataZoneCtrls->NumTempControlledZones; ++idx) { | ||
auto &tcz = state.dataZoneCtrls->TempControlledZone(idx); | ||
PreDefTableEntry(state, orp->pdchStatName, tcz.ZoneName, tcz.Name); | ||
PreDefTableEntry(state, orp->pdchStatCtrlTypeSchd, tcz.ZoneName, tcz.ControlTypeSchedName); | ||
|
||
std::vector<ControlTypeInfo> infos; | ||
infos.reserve(tcz.NumControlTypes); | ||
for (int ctInx = 1; ctInx <= tcz.NumControlTypes; ++ctInx) { | ||
PreDefTableEntry(state, orp->pdchStatSchdType1, tcz.ZoneName, HVAC::thermostatTypeNames[(int)tcz.ControlTypeEnum(ctInx)]); | ||
PreDefTableEntry(state, orp->pdchStatSchdTypeName1, tcz.ZoneName, tcz.ControlTypeName(1)); | ||
ControlTypeInfo info; | ||
info.thermostatType = HVAC::thermostatTypeNames[(int)tcz.ControlTypeEnum(ctInx)]; | ||
info.controlTypeName = tcz.ControlTypeName(ctInx); | ||
switch (tcz.ControlTypeEnum(ctInx)) { | ||
case HVAC::ThermostatType::DualSetPointWithDeadBand: | ||
PreDefTableEntry( | ||
state, orp->pdchStatSchdHeatName, tcz.ZoneName, ScheduleManager::GetScheduleName(state, tcz.SchIndx_DualSetPointWDeadBandHeat)); | ||
PreDefTableEntry( | ||
state, orp->pdchStatSchdCoolName, tcz.ZoneName, ScheduleManager::GetScheduleName(state, tcz.SchIndx_DualSetPointWDeadBandCool)); | ||
info.coolSchName = ScheduleManager::GetScheduleName(state, tcz.SchIndx_DualSetPointWDeadBandCool); | ||
info.heatSchName = ScheduleManager::GetScheduleName(state, tcz.SchIndx_DualSetPointWDeadBandHeat); | ||
break; | ||
case HVAC::ThermostatType::SingleHeatCool: | ||
PreDefTableEntry( | ||
state, orp->pdchStatSchdHeatName, tcz.ZoneName, ScheduleManager::GetScheduleName(state, tcz.SchIndx_SingleHeatCoolSetPoint)); | ||
PreDefTableEntry( | ||
state, orp->pdchStatSchdCoolName, tcz.ZoneName, ScheduleManager::GetScheduleName(state, tcz.SchIndx_SingleHeatCoolSetPoint)); | ||
info.coolSchName = ScheduleManager::GetScheduleName(state, tcz.SchIndx_SingleHeatCoolSetPoint); | ||
info.heatSchName = ScheduleManager::GetScheduleName(state, tcz.SchIndx_SingleHeatCoolSetPoint); | ||
break; | ||
case HVAC::ThermostatType::SingleCooling: | ||
PreDefTableEntry( | ||
state, orp->pdchStatSchdHeatName, tcz.ZoneName, ScheduleManager::GetScheduleName(state, tcz.SchIndx_SingleCoolSetPoint)); | ||
info.coolSchName = ScheduleManager::GetScheduleName(state, tcz.SchIndx_SingleCoolSetPoint); | ||
break; | ||
case HVAC::ThermostatType::SingleHeating: | ||
PreDefTableEntry( | ||
state, orp->pdchStatSchdCoolName, tcz.ZoneName, ScheduleManager::GetScheduleName(state, tcz.SchIndx_SingleHeatSetPoint)); | ||
info.heatSchName = ScheduleManager::GetScheduleName(state, tcz.SchIndx_SingleHeatSetPoint); | ||
break; | ||
} | ||
infos.emplace_back(std::move(info)); | ||
} | ||
Comment on lines
+7063
to
+7086
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alright, collect the Control Type infos. |
||
std::sort(infos.begin(), infos.end()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sort them |
||
|
||
PreDefTableEntry(state, orp->pdchStatSchdType1, tcz.ZoneName, joinStrings(infos, &ControlTypeInfo::thermostatType)); | ||
PreDefTableEntry(state, orp->pdchStatSchdTypeName1, tcz.ZoneName, joinStrings(infos, &ControlTypeInfo::controlTypeName)); | ||
if (auto heatSchNames = joinStrings(infos, &ControlTypeInfo::heatSchName); !heatSchNames.empty()) { | ||
PreDefTableEntry(state, orp->pdchStatSchdHeatName, tcz.ZoneName, heatSchNames); | ||
} | ||
if (auto coolSchNames = joinStrings(infos, &ControlTypeInfo::coolSchName); !coolSchNames.empty()) { | ||
PreDefTableEntry(state, orp->pdchStatSchdCoolName, tcz.ZoneName, coolSchNames); | ||
Comment on lines
+7089
to
+7095
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Then join them with ", ". For HeatSchNames / CoolSchNames, it's possible it's empty, and writing a |
||
} | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1792,6 +1792,17 @@ TEST_F(EnergyPlusFixture, FillPredefinedTableOnThermostatSchedules_Test) | |
using namespace EnergyPlus::OutputReportPredefined; | ||
|
||
state->dataScheduleMgr->Schedule.allocate(5); | ||
constexpr int SingleHeatingSchIndex = 1; | ||
constexpr int SingleCoolingSchIndex = 2; | ||
constexpr int SingleHeatCoolSchIndex = 3; | ||
constexpr int DualSetPointWDeadBandHeatSchIndex = 4; | ||
constexpr int DualSetPointWDeadBandCoolSchIndex = 5; | ||
state->dataScheduleMgr->Schedule(SingleHeatingSchIndex).Name = "SINGLEHEATINGSCH"; | ||
state->dataScheduleMgr->Schedule(SingleCoolingSchIndex).Name = "SINGLECOOLINGSCH"; | ||
state->dataScheduleMgr->Schedule(SingleHeatCoolSchIndex).Name = "SINGLEHEATCOOLSCH"; | ||
state->dataScheduleMgr->Schedule(DualSetPointWDeadBandHeatSchIndex).Name = "DUALSETPOINTWDEADBANDHEATSCH"; | ||
state->dataScheduleMgr->Schedule(DualSetPointWDeadBandCoolSchIndex).Name = "DUALSETPOINTWDEADBANDCOOLSCH"; | ||
|
||
state->dataScheduleMgr->ScheduleInputProcessed = true; | ||
|
||
auto &orp = *state->dataOutRptPredefined; | ||
|
@@ -1810,8 +1821,7 @@ TEST_F(EnergyPlusFixture, FillPredefinedTableOnThermostatSchedules_Test) | |
dzc.TempControlledZone(1).ControlTypeName.allocate(dzc.TempControlledZone(1).NumControlTypes); | ||
dzc.TempControlledZone(1).ControlTypeEnum(1) = HVAC::ThermostatType::SingleHeating; | ||
dzc.TempControlledZone(1).ControlTypeName(1) = "control A"; | ||
dzc.TempControlledZone(1).SchIndx_SingleHeatSetPoint = 1; | ||
state->dataScheduleMgr->Schedule(1).Name = "schA"; | ||
dzc.TempControlledZone(1).SchIndx_SingleHeatSetPoint = SingleHeatingSchIndex; | ||
|
||
dzc.TempControlledZone(2).ZoneName = "zoneB"; | ||
dzc.TempControlledZone(2).Name = "stat B"; | ||
|
@@ -1821,8 +1831,7 @@ TEST_F(EnergyPlusFixture, FillPredefinedTableOnThermostatSchedules_Test) | |
dzc.TempControlledZone(2).ControlTypeName.allocate(dzc.TempControlledZone(1).NumControlTypes); | ||
dzc.TempControlledZone(2).ControlTypeEnum(1) = HVAC::ThermostatType::SingleCooling; | ||
dzc.TempControlledZone(2).ControlTypeName(1) = "control B"; | ||
dzc.TempControlledZone(2).SchIndx_SingleCoolSetPoint = 2; | ||
state->dataScheduleMgr->Schedule(2).Name = "schB"; | ||
dzc.TempControlledZone(2).SchIndx_SingleCoolSetPoint = SingleCoolingSchIndex; | ||
|
||
dzc.TempControlledZone(3).ZoneName = "zoneC"; | ||
dzc.TempControlledZone(3).Name = "stat C"; | ||
|
@@ -1832,8 +1841,7 @@ TEST_F(EnergyPlusFixture, FillPredefinedTableOnThermostatSchedules_Test) | |
dzc.TempControlledZone(3).ControlTypeName.allocate(dzc.TempControlledZone(1).NumControlTypes); | ||
dzc.TempControlledZone(3).ControlTypeEnum(1) = HVAC::ThermostatType::SingleHeatCool; | ||
dzc.TempControlledZone(3).ControlTypeName(1) = "control C"; | ||
dzc.TempControlledZone(3).SchIndx_SingleHeatCoolSetPoint = 3; | ||
state->dataScheduleMgr->Schedule(3).Name = "schC"; | ||
dzc.TempControlledZone(3).SchIndx_SingleHeatCoolSetPoint = SingleHeatCoolSchIndex; | ||
|
||
dzc.TempControlledZone(4).ZoneName = "zoneD"; | ||
dzc.TempControlledZone(4).Name = "stat D"; | ||
|
@@ -1843,38 +1851,123 @@ TEST_F(EnergyPlusFixture, FillPredefinedTableOnThermostatSchedules_Test) | |
dzc.TempControlledZone(4).ControlTypeName.allocate(dzc.TempControlledZone(1).NumControlTypes); | ||
dzc.TempControlledZone(4).ControlTypeEnum(1) = HVAC::ThermostatType::DualSetPointWithDeadBand; | ||
dzc.TempControlledZone(4).ControlTypeName(1) = "control D"; | ||
dzc.TempControlledZone(4).SchIndx_DualSetPointWDeadBandHeat = 4; | ||
dzc.TempControlledZone(4).SchIndx_DualSetPointWDeadBandCool = 5; | ||
state->dataScheduleMgr->Schedule(4).Name = "schD"; | ||
state->dataScheduleMgr->Schedule(5).Name = "schE"; | ||
dzc.TempControlledZone(4).SchIndx_DualSetPointWDeadBandHeat = DualSetPointWDeadBandHeatSchIndex; | ||
dzc.TempControlledZone(4).SchIndx_DualSetPointWDeadBandCool = DualSetPointWDeadBandCoolSchIndex; | ||
|
||
FillPredefinedTableOnThermostatSchedules(*state); | ||
|
||
EXPECT_EQ("stat A", RetrievePreDefTableEntry(*state, orp.pdchStatName, "zoneA")); | ||
EXPECT_EQ("control schedule A", RetrievePreDefTableEntry(*state, orp.pdchStatCtrlTypeSchd, "zoneA")); | ||
EXPECT_EQ("SingleHeating", RetrievePreDefTableEntry(*state, orp.pdchStatSchdType1, "zoneA")); | ||
EXPECT_EQ("control A", RetrievePreDefTableEntry(*state, orp.pdchStatSchdTypeName1, "zoneA")); | ||
EXPECT_EQ("schA", RetrievePreDefTableEntry(*state, orp.pdchStatSchdCoolName, "zoneA")); | ||
EXPECT_EQ("NOT FOUND", RetrievePreDefTableEntry(*state, orp.pdchStatSchdHeatName, "zoneA")); | ||
EXPECT_EQ("SINGLEHEATINGSCH", RetrievePreDefTableEntry(*state, orp.pdchStatSchdHeatName, "zoneA")); | ||
EXPECT_EQ("NOT FOUND", RetrievePreDefTableEntry(*state, orp.pdchStatSchdCoolName, "zoneA")); | ||
Comment on lines
+1863
to
+1864
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Existing test was incorrect, cf #10857 (comment) |
||
|
||
EXPECT_EQ("stat B", RetrievePreDefTableEntry(*state, orp.pdchStatName, "zoneB")); | ||
EXPECT_EQ("control schedule B", RetrievePreDefTableEntry(*state, orp.pdchStatCtrlTypeSchd, "zoneB")); | ||
EXPECT_EQ("SingleCooling", RetrievePreDefTableEntry(*state, orp.pdchStatSchdType1, "zoneB")); | ||
EXPECT_EQ("control B", RetrievePreDefTableEntry(*state, orp.pdchStatSchdTypeName1, "zoneB")); | ||
EXPECT_EQ("NOT FOUND", RetrievePreDefTableEntry(*state, orp.pdchStatSchdCoolName, "zoneB")); | ||
EXPECT_EQ("schB", RetrievePreDefTableEntry(*state, orp.pdchStatSchdHeatName, "zoneB")); | ||
EXPECT_EQ("NOT FOUND", RetrievePreDefTableEntry(*state, orp.pdchStatSchdHeatName, "zoneB")); | ||
EXPECT_EQ("SINGLECOOLINGSCH", RetrievePreDefTableEntry(*state, orp.pdchStatSchdCoolName, "zoneB")); | ||
Comment on lines
+1870
to
+1871
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same |
||
|
||
EXPECT_EQ("stat C", RetrievePreDefTableEntry(*state, orp.pdchStatName, "zoneC")); | ||
EXPECT_EQ("control schedule C", RetrievePreDefTableEntry(*state, orp.pdchStatCtrlTypeSchd, "zoneC")); | ||
EXPECT_EQ("SingleHeatCool", RetrievePreDefTableEntry(*state, orp.pdchStatSchdType1, "zoneC")); | ||
EXPECT_EQ("control C", RetrievePreDefTableEntry(*state, orp.pdchStatSchdTypeName1, "zoneC")); | ||
EXPECT_EQ("schC", RetrievePreDefTableEntry(*state, orp.pdchStatSchdCoolName, "zoneC")); | ||
EXPECT_EQ("schC", RetrievePreDefTableEntry(*state, orp.pdchStatSchdHeatName, "zoneC")); | ||
EXPECT_EQ("SINGLEHEATCOOLSCH", RetrievePreDefTableEntry(*state, orp.pdchStatSchdHeatName, "zoneC")); | ||
EXPECT_EQ("SINGLEHEATCOOLSCH", RetrievePreDefTableEntry(*state, orp.pdchStatSchdCoolName, "zoneC")); | ||
|
||
EXPECT_EQ("stat D", RetrievePreDefTableEntry(*state, orp.pdchStatName, "zoneD")); | ||
EXPECT_EQ("control schedule D", RetrievePreDefTableEntry(*state, orp.pdchStatCtrlTypeSchd, "zoneD")); | ||
EXPECT_EQ("DualSetPointWithDeadBand", RetrievePreDefTableEntry(*state, orp.pdchStatSchdType1, "zoneD")); | ||
EXPECT_EQ("control D", RetrievePreDefTableEntry(*state, orp.pdchStatSchdTypeName1, "zoneD")); | ||
EXPECT_EQ("schE", RetrievePreDefTableEntry(*state, orp.pdchStatSchdCoolName, "zoneD")); | ||
EXPECT_EQ("schD", RetrievePreDefTableEntry(*state, orp.pdchStatSchdHeatName, "zoneD")); | ||
EXPECT_EQ("DUALSETPOINTWDEADBANDHEATSCH", RetrievePreDefTableEntry(*state, orp.pdchStatSchdHeatName, "zoneD")); | ||
EXPECT_EQ("DUALSETPOINTWDEADBANDCOOLSCH", RetrievePreDefTableEntry(*state, orp.pdchStatSchdCoolName, "zoneD")); | ||
} | ||
|
||
TEST_F(EnergyPlusFixture, FillPredefinedTableOnThermostatSchedules_MultipleControls) | ||
{ | ||
using namespace EnergyPlus::OutputReportPredefined; | ||
|
||
state->dataScheduleMgr->Schedule.allocate(6); | ||
constexpr int SingleHeatingSchIndex = 1; | ||
constexpr int SingleCoolingSchIndex = 2; | ||
constexpr int SingleHeatCoolSchIndex = 3; | ||
constexpr int DualSetPointWDeadBandHeatSchIndex = 4; | ||
constexpr int DualSetPointWDeadBandCoolSchIndex = 5; | ||
constexpr int CTSchedIndex = 6; | ||
state->dataScheduleMgr->Schedule(SingleHeatingSchIndex).Name = "SINGLEHEATINGSCH"; | ||
state->dataScheduleMgr->Schedule(SingleCoolingSchIndex).Name = "SINGLECOOLINGSCH"; | ||
state->dataScheduleMgr->Schedule(SingleHeatCoolSchIndex).Name = "SINGLEHEATCOOLSCH"; | ||
state->dataScheduleMgr->Schedule(DualSetPointWDeadBandHeatSchIndex).Name = "DUALSETPOINTWDEADBANDHEATSCH"; | ||
state->dataScheduleMgr->Schedule(DualSetPointWDeadBandCoolSchIndex).Name = "DUALSETPOINTWDEADBANDCOOLSCH"; | ||
state->dataScheduleMgr->Schedule(CTSchedIndex).Name = "CONTROL SCHEDULE"; | ||
|
||
state->dataScheduleMgr->ScheduleInputProcessed = true; | ||
|
||
auto &orp = *state->dataOutRptPredefined; | ||
auto &dzc = *state->dataZoneCtrls; | ||
|
||
SetPredefinedTables(*state); | ||
|
||
constexpr int NumControlTypes = 4; | ||
dzc.NumTempControlledZones = NumControlTypes; | ||
dzc.TempControlledZone.allocate(dzc.NumTempControlledZones); | ||
|
||
// [1, 2, 3, 4] | ||
std::vector<int> order(NumControlTypes); | ||
std::iota(order.begin(), order.end(), 1); | ||
for (size_t i = 0; i < order.size(); ++i) { | ||
char zoneLetter = char(int('A') + i); | ||
// Simple left rotate: [2, 3, 4, 1], etc | ||
std::rotate(order.begin(), std::next(order.begin()), order.end()); | ||
auto &tcz = dzc.TempControlledZone(i + 1); | ||
|
||
const std::string ZoneName = fmt::format("ZONE {}", zoneLetter); | ||
tcz.ZoneName = ZoneName; | ||
tcz.Name = fmt::format("TSTAT {}", zoneLetter); | ||
tcz.ControlTypeSchedName = state->dataScheduleMgr->Schedule(CTSchedIndex).Name; | ||
tcz.CTSchedIndex = CTSchedIndex; | ||
tcz.NumControlTypes = NumControlTypes; | ||
tcz.ControlTypeEnum.allocate(NumControlTypes); | ||
tcz.ControlTypeName.allocate(NumControlTypes); | ||
|
||
tcz.ControlTypeEnum(order.at(0)) = HVAC::ThermostatType::SingleHeating; | ||
tcz.ControlTypeName(order.at(0)) = "SINGLEHEATING CTRL"; | ||
tcz.SchIndx_SingleHeatSetPoint = SingleHeatingSchIndex; | ||
|
||
tcz.ControlTypeEnum(order.at(1)) = HVAC::ThermostatType::SingleCooling; | ||
tcz.ControlTypeName(order.at(1)) = "SINGLECOOLING CTRL"; | ||
tcz.SchIndx_SingleCoolSetPoint = SingleCoolingSchIndex; | ||
|
||
tcz.ControlTypeEnum(order.at(2)) = HVAC::ThermostatType::SingleHeatCool; | ||
tcz.ControlTypeName(order.at(2)) = "SINGLEHEATCOOL CTRL"; | ||
tcz.SchIndx_SingleHeatCoolSetPoint = SingleHeatCoolSchIndex; | ||
|
||
tcz.ControlTypeEnum(order.at(3)) = HVAC::ThermostatType::DualSetPointWithDeadBand; | ||
tcz.ControlTypeName(order.at(3)) = "DUALSETPOINTWITHDEADBAND CTRL"; | ||
tcz.SchIndx_DualSetPointWDeadBandHeat = DualSetPointWDeadBandHeatSchIndex; | ||
tcz.SchIndx_DualSetPointWDeadBandCool = DualSetPointWDeadBandCoolSchIndex; | ||
} | ||
|
||
FillPredefinedTableOnThermostatSchedules(*state); | ||
Comment on lines
+1887
to
+1953
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New unit test. I define ZoneControlThermostats with each having all of these:
I test 4 different orders of declaration (I use a left rotate), since it seems the wanted feature on the #10857 was it shouldn't differ no matter in which order the control types were defined.
|
||
|
||
for (size_t i = 0; i < order.size(); ++i) { | ||
char zoneLetter = char(int('A') + i); | ||
const std::string ZoneName = fmt::format("ZONE {}", zoneLetter); | ||
EXPECT_EQ(fmt::format("TSTAT {}", zoneLetter), RetrievePreDefTableEntry(*state, orp.pdchStatName, ZoneName)) << "Failed for " << ZoneName; | ||
EXPECT_EQ("CONTROL SCHEDULE", RetrievePreDefTableEntry(*state, orp.pdchStatCtrlTypeSchd, ZoneName)) << "Failed for " << ZoneName; | ||
EXPECT_EQ("DualSetPointWithDeadBand, SingleCooling, SingleHeatCool, SingleHeating", | ||
RetrievePreDefTableEntry(*state, orp.pdchStatSchdType1, ZoneName)) | ||
<< "Failed for " << ZoneName; | ||
EXPECT_EQ("DUALSETPOINTWITHDEADBAND CTRL, SINGLECOOLING CTRL, SINGLEHEATCOOL CTRL, SINGLEHEATING CTRL", | ||
RetrievePreDefTableEntry(*state, orp.pdchStatSchdTypeName1, ZoneName)) | ||
<< "Failed for " << ZoneName; | ||
EXPECT_EQ("DUALSETPOINTWDEADBANDHEATSCH, SINGLEHEATCOOLSCH, SINGLEHEATINGSCH", | ||
RetrievePreDefTableEntry(*state, orp.pdchStatSchdHeatName, ZoneName)) | ||
<< "Failed for " << ZoneName; | ||
EXPECT_EQ("DUALSETPOINTWDEADBANDCOOLSCH, SINGLECOOLINGSCH, SINGLEHEATCOOLSCH", | ||
RetrievePreDefTableEntry(*state, orp.pdchStatSchdCoolName, ZoneName)) | ||
<< "Failed for " << ZoneName; | ||
} | ||
Comment on lines
+1955
to
+1972
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Order stays the same. I join the names when multiple found with a ", " |
||
} |
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.
A struct so we can collect the multiple control types, and sort them, so the order doesn't matter.