Skip to content

Commit

Permalink
A few cases that didn't pass visual code inspection
Browse files Browse the repository at this point in the history
  • Loading branch information
amirroth committed Dec 23, 2024
1 parent c6833bb commit d26c66d
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 30 deletions.
55 changes: 28 additions & 27 deletions src/EnergyPlus/DemandManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -357,44 +357,45 @@ void GetDemandManagerListInput(EnergyPlusData &state)
ShowContinueError(state, format("Entered in {} = {}", cCurrentModuleObject, thisDemandMgrList.Name));
ErrorsFound = true;

} else if ((state.dataOutputProcessor->meters[thisDemandMgrList.Meter]->resource == Constant::eResource::Electricity) ||
(state.dataOutputProcessor->meters[thisDemandMgrList.Meter]->resource == Constant::eResource::ElectricityNet)) {
} else {
if ((state.dataOutputProcessor->meters[thisDemandMgrList.Meter]->resource == Constant::eResource::Electricity) ||
(state.dataOutputProcessor->meters[thisDemandMgrList.Meter]->resource == Constant::eResource::ElectricityNet)) {
} else {
ShowSevereError(state,
format("{} = \"{}\" invalid value {} = \"{}\".",
cCurrentModuleObject,
thisDemandMgrList.Name,
s_ipsc->cAlphaFieldNames(2),
s_ipsc->cAlphaArgs(2)));
ShowContinueError(state, "Only Electricity and ElectricityNet meters are currently allowed.");
ErrorsFound = true;
}
ShowSevereError(state,
format("{} = \"{}\" invalid value {} = \"{}\".",
cCurrentModuleObject,
thisDemandMgrList.Name,
s_ipsc->cAlphaFieldNames(2),
s_ipsc->cAlphaArgs(2)));
ShowContinueError(state, "Only Electricity and ElectricityNet meters are currently allowed.");
ErrorsFound = true;
}

// Further checking for conflicting DEMAND MANAGER LISTs

if (!s_ipsc->lAlphaFieldBlanks(3)) {
if ((thisDemandMgrList.limitSched = Sched::GetSchedule(state, s_ipsc->cAlphaArgs(3))) == nullptr) {
ShowSevereItemNotFound(state, eoh, s_ipsc->cAlphaFieldNames(3), s_ipsc->cAlphaArgs(3));
ErrorsFound = true;
}
if (s_ipsc->lAlphaFieldBlanks(3)) {
ShowSevereEmptyField(state, eoh, s_ipsc->cAlphaFieldNames(3));
ErrorsFound = true;
} else if ((thisDemandMgrList.limitSched = Sched::GetSchedule(state, s_ipsc->cAlphaArgs(3))) == nullptr) {
ShowSevereItemNotFound(state, eoh, s_ipsc->cAlphaFieldNames(3), s_ipsc->cAlphaArgs(3));
ErrorsFound = true;
}

thisDemandMgrList.SafetyFraction = s_ipsc->rNumericArgs(1);

if (!s_ipsc->lAlphaFieldBlanks(4)) {
if ((thisDemandMgrList.billingSched = Sched::GetSchedule(state, s_ipsc->cAlphaArgs(4))) == nullptr) {
ShowSevereItemNotFound(state, eoh, s_ipsc->cAlphaFieldNames(4), s_ipsc->cAlphaArgs(4));
ErrorsFound = true;
}
if (s_ipsc->lAlphaFieldBlanks(4)) {
ShowSevereEmptyField(state, eoh, s_ipsc->cAlphaFieldNames(4));
ErrorsFound = true;
} else if ((thisDemandMgrList.billingSched = Sched::GetSchedule(state, s_ipsc->cAlphaArgs(4))) == nullptr) {
ShowSevereItemNotFound(state, eoh, s_ipsc->cAlphaFieldNames(4), s_ipsc->cAlphaArgs(4));
ErrorsFound = true;
}

if (!s_ipsc->lAlphaFieldBlanks(5)) {
if ((thisDemandMgrList.peakSched = Sched::GetSchedule(state, s_ipsc->cAlphaArgs(5))) == nullptr) {
ShowSevereItemNotFound(state, eoh, s_ipsc->cAlphaFieldNames(5), s_ipsc->cAlphaArgs(5));
ErrorsFound = true;
}
if (s_ipsc->lAlphaFieldBlanks(5)) {
ShowSevereEmptyField(state, eoh, s_ipsc->cAlphaFieldNames(5));
ErrorsFound = true;
} else if ((thisDemandMgrList.peakSched = Sched::GetSchedule(state, s_ipsc->cAlphaArgs(5))) == nullptr) {
ShowSevereItemNotFound(state, eoh, s_ipsc->cAlphaFieldNames(5), s_ipsc->cAlphaArgs(5));
ErrorsFound = true;
}

thisDemandMgrList.AveragingWindow = max(int(s_ipsc->rNumericArgs(2) / state.dataGlobal->MinutesInTimeStep), 1);
Expand Down
4 changes: 2 additions & 2 deletions src/EnergyPlus/Fans.cc
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ void GetFanInput(EnergyPlusData &state)
BranchNodeConnections::TestCompSet(state, cCurrentModuleObject, cAlphaArgs(1), cAlphaArgs(2), cAlphaArgs(3), "Air Nodes");

if (lAlphaFieldBlanks(4)) {
fan->availSched = nullptr;
fan->availSched = Sched::GetScheduleAlwaysOn(state);
} else if ((fan->availSched = Sched::GetSchedule(state, cAlphaArgs(4))) == nullptr) {
ShowSevereItemNotFound(state, eoh, cAlphaFieldNames(4), cAlphaArgs(4));
ErrorsFound = true;
Expand Down Expand Up @@ -862,7 +862,7 @@ void GetFanInput(EnergyPlusData &state)
fan->type = HVAC::FanType::SystemModel;

if (lAlphaFieldBlanks(2)) {
fan->availSched = Sched::GetScheduleAlwaysOn(state);
fan->availSched = Sched::GetScheduleAlwaysOn(state); // nullptr
} else if ((fan->availSched = Sched::GetSchedule(state, cAlphaArgs(2))) == nullptr) {
ShowSevereItemNotFound(state, eoh, cAlphaFieldNames(2), cAlphaArgs(2));
ErrorsFound = true;
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/RefrigeratedCase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2242,7 +2242,7 @@ void GetRefrigerationInput(EnergyPlusData &state)
}

++AlphaNum; // A6
if (lAlphaBlanks(AlphaNum)) {
if (!lAlphaBlanks(AlphaNum)) {
WarehouseCoil(CoilID).heaterAvailSched = Sched::GetScheduleAlwaysOn(state);
} else if ((WarehouseCoil(CoilID).heaterAvailSched = Sched::GetSchedule(state, Alphas(AlphaNum))) == nullptr) {
ShowSevereItemNotFound(state, eoh, cAlphaFieldNames(AlphaNum), Alphas(AlphaNum));
Expand Down

3 comments on commit d26c66d

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ScheduleAPI (amirroth) - x86_64-Linux-Ubuntu-24.04-gcc-13.3: OK (2910 of 2918 tests passed, 0 test warnings)

Failures:\n

EnergyPlusFixture Test Summary

  • Passed: 1604
  • Failed: 1

integration Test Summary

  • Passed: 794
  • Failed: 7

Build Badge Test Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ScheduleAPI (amirroth) - x86_64-Linux-Ubuntu-24.04-gcc-13.3-UnitTestsCoverage-RelWithDebInfo: OK (2099 of 2100 tests passed, 0 test warnings)

Failures:\n

EnergyPlusFixture Test Summary

  • Passed: 1604
  • Failed: 1

Build Badge Test Badge Coverage Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ScheduleAPI (amirroth) - x86_64-Linux-Ubuntu-24.04-gcc-13.3-IntegrationCoverage-RelWithDebInfo: OK (794 of 801 tests passed, 0 test warnings)

Failures:\n

integration Test Summary

  • Passed: 794
  • Failed: 7

Build Badge Test Badge Coverage Badge

Please sign in to comment.