-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: EnergyManager to select limit taking into account time (#610)
* fix: EnergyManager to select limit taking into account time EnergyManager calculates a list of optimised values and previously selected the 1st item to set the root side limit. Instead EnergyManager now traverses the list to find the applicable limit based on the current time. (the list can include schedules that have expired) * fix: clang format * fix: added additional boundary tests Signed-off-by: James Chapman <[email protected]>
- Loading branch information
Showing
8 changed files
with
1,097 additions
and
16 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
set(TEST_TARGET_NAME ${PROJECT_NAME}_EnergyManager_tests) | ||
add_executable(${TEST_TARGET_NAME}) | ||
|
||
add_dependencies(${TEST_TARGET_NAME} ${MODULE_NAME}) | ||
|
||
get_target_property(GENERATED_INCLUDE_DIR generate_cpp_files EVEREST_GENERATED_INCLUDE_DIR) | ||
|
||
target_include_directories(${TEST_TARGET_NAME} PRIVATE | ||
. .. | ||
${GENERATED_INCLUDE_DIR} | ||
${CMAKE_BINARY_DIR}/generated/modules/${MODULE_NAME} | ||
) | ||
|
||
target_sources(${TEST_TARGET_NAME} PRIVATE | ||
EnergyManagerTest.cpp | ||
../Broker.cpp | ||
../BrokerFastCharging.cpp | ||
../EnergyManager.cpp | ||
../Market.cpp | ||
../Offer.cpp | ||
) | ||
|
||
target_compile_definitions(${TEST_TARGET_NAME} PRIVATE | ||
BUILD_TESTING_MODULE_ENERGY_MANAGER | ||
) | ||
|
||
target_link_libraries(${TEST_TARGET_NAME} PRIVATE | ||
GTest::gmock | ||
GTest::gtest_main | ||
everest::log | ||
everest::framework | ||
) | ||
|
||
add_test(${TEST_TARGET_NAME} ${TEST_TARGET_NAME}) |
This file contains 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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Copyright Pionix GmbH and Contributors to EVerest | ||
|
||
#ifndef ENERGYMANAGERSTUB_H_ | ||
#define ENERGYMANAGERSTUB_H_ | ||
|
||
#include <generated/interfaces/energy_manager/Implementation.hpp> | ||
|
||
//----------------------------------------------------------------------------- | ||
namespace module::stub { | ||
|
||
struct energy_managerImplStub : public energy_managerImplBase { | ||
energy_managerImplStub() : energy_managerImplBase(nullptr, "manager") { | ||
} | ||
virtual void init() { | ||
} | ||
virtual void ready() { | ||
} | ||
}; | ||
|
||
} // namespace module::stub | ||
|
||
#endif |
Oops, something went wrong.