-
Notifications
You must be signed in to change notification settings - Fork 473
Fix #10944: unused EMS actuator warning never fires #11525
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
7c0eee9
repro #10944: unused actuator warning never fires
brianlball e91fc19
fix #10944: add wasActuated flag on ActuatorUsedType
brianlball ce2d864
#10944 use static Erl SET scan for unused-actuator check
brianlball cc9bca0
#10944 remove truly-unused actuators from test IDFs
brianlball 0c0130a
#10944 fix CI: remove misplaced Python test, drop redundant stream cl…
brianlball File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3019,3 +3019,50 @@ TEST_F(EnergyPlusFixture, EMSManager_Sensor_On_ScheduleConstant) | |
| EXPECT_FALSE(schedDirect->EMSActuatedOn); | ||
| EXPECT_EQ(0.0, schedDirect->EMSVal); | ||
| } | ||
|
|
||
| TEST_F(EnergyPlusFixture, UnusedActuatorWarning) | ||
| { | ||
| // Issue #10944: user declares actuator A1, typos it as Al in the program. | ||
| // Al becomes a fresh local Erl variable; A1 is never assigned. | ||
| // End-of-sim check must warn about unused actuator A1. | ||
| std::string const idf_objects = delimited_string({ | ||
|
|
||
| "OutdoorAir:Node, Test node;", | ||
|
|
||
| "EnergyManagementSystem:Actuator,", | ||
| "A1, !- Name", | ||
| "Test node, !- Actuated Component Unique Name", | ||
| "System Node Setpoint, !- Actuated Component Type", | ||
| "Temperature Setpoint; !- Actuated Component Control Type", | ||
|
|
||
| "EnergyManagementSystem:ProgramCallingManager,", | ||
| "Typo Test Manager, !- Name", | ||
| "BeginTimestepBeforePredictor, !- EnergyPlus Model Calling Point", | ||
| "TypoProgram; !- Program Name 1", | ||
|
|
||
| "EnergyManagementSystem:Program,", | ||
| "TypoProgram,", | ||
| "Set Al = 2;", | ||
|
|
||
| }); | ||
|
|
||
| ASSERT_TRUE(process_idf(idf_objects)); | ||
| state->init_state(*state); | ||
|
|
||
| OutAirNodeManager::SetOutAirNodes(*state); | ||
|
|
||
| EMSManager::CheckIfAnyEMS(*state); | ||
|
|
||
| state->dataEMSMgr->FinishProcessingUserInput = true; | ||
|
|
||
| bool anyRan; | ||
| EMSManager::ManageEMS(*state, EMSManager::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); | ||
| EMSManager::ManageEMS(*state, EMSManager::EMSCallFrom::BeginTimestepBeforePredictor, anyRan, ObjexxFCL::Optional_int_const()); | ||
|
|
||
| compare_err_stream(""); // drop any setup chatter | ||
|
Member
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. Good unit test. I'm not sure this call to compare_err_stream is needed since you are properly using the compare_err_stream_substring function below. The err stream does not need to be cleared of any chatter. It's not harming anything, but not necessary in the future. |
||
|
|
||
| EMSManager::checkForUnusedActuatorsAtEnd(*state); | ||
|
|
||
| EXPECT_TRUE(compare_err_stream_substring("Unused EMS Actuator detected", false)); | ||
| EXPECT_TRUE(compare_err_stream_substring("A1", true)); | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Adding a flag here seems quite reasonable.