-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding powermeter interface to DcSupplySimulator
Signed-off-by: Sebastian Lukas <sebastian.lukas@pionix.de>
- Loading branch information
Showing
12 changed files
with
177 additions
and
45 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 |
---|---|---|
@@ -1,17 +1,19 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Copyright (C) 2023 chargebyte GmbH | ||
// Copyright (C) 2023 Contributors to EVerest | ||
// Copyright chargebyte GmbH | ||
// Copyright Pionix GmbH and Contributors to EVerest | ||
|
||
#include "DCSupplySimulator.hpp" | ||
|
||
namespace module { | ||
|
||
void DCSupplySimulator::init() { | ||
invoke_init(*p_main); | ||
invoke_init(*p_powermeter); | ||
} | ||
|
||
void DCSupplySimulator::ready() { | ||
invoke_ready(*p_main); | ||
invoke_ready(*p_powermeter); | ||
} | ||
|
||
} // namespace module |
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
28 changes: 28 additions & 0 deletions
28
modules/simulation/DCSupplySimulator/powermeter/powermeterImpl.cpp
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,28 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Copyright Pionix GmbH and Contributors to EVerest | ||
|
||
#include "powermeterImpl.hpp" | ||
|
||
namespace module { | ||
namespace powermeter { | ||
|
||
void powermeterImpl::init() { | ||
} | ||
|
||
void powermeterImpl::ready() { | ||
} | ||
|
||
types::powermeter::TransactionStartResponse | ||
powermeterImpl::handle_start_transaction(types::powermeter::TransactionReq& value) { | ||
return {types::powermeter::TransactionRequestStatus::OK}; | ||
} | ||
|
||
types::powermeter::TransactionStopResponse powermeterImpl::handle_stop_transaction(std::string& transaction_id) { | ||
return {types::powermeter::TransactionRequestStatus::NOT_SUPPORTED, | ||
{}, | ||
{}, | ||
"DcSupplySimulator does not support stop transaction request."}; | ||
} | ||
|
||
} // namespace powermeter | ||
} // namespace module |
63 changes: 63 additions & 0 deletions
63
modules/simulation/DCSupplySimulator/powermeter/powermeterImpl.hpp
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,63 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Copyright Pionix GmbH and Contributors to EVerest | ||
#ifndef POWERMETER_POWERMETER_IMPL_HPP | ||
#define POWERMETER_POWERMETER_IMPL_HPP | ||
|
||
// | ||
// AUTO GENERATED - MARKED REGIONS WILL BE KEPT | ||
// template version 3 | ||
// | ||
|
||
#include <generated/interfaces/powermeter/Implementation.hpp> | ||
|
||
#include "../DCSupplySimulator.hpp" | ||
|
||
// ev@75ac1216-19eb-4182-a85c-820f1fc2c091:v1 | ||
// insert your custom include headers here | ||
// ev@75ac1216-19eb-4182-a85c-820f1fc2c091:v1 | ||
|
||
namespace module { | ||
namespace powermeter { | ||
|
||
struct Conf {}; | ||
|
||
class powermeterImpl : public powermeterImplBase { | ||
public: | ||
powermeterImpl() = delete; | ||
powermeterImpl(Everest::ModuleAdapter* ev, const Everest::PtrContainer<DCSupplySimulator>& mod, Conf& config) : | ||
powermeterImplBase(ev, "powermeter"), mod(mod), config(config){}; | ||
|
||
// ev@8ea32d28-373f-4c90-ae5e-b4fcc74e2a61:v1 | ||
// insert your public definitions here | ||
// ev@8ea32d28-373f-4c90-ae5e-b4fcc74e2a61:v1 | ||
|
||
protected: | ||
// command handler functions (virtual) | ||
virtual types::powermeter::TransactionStartResponse | ||
handle_start_transaction(types::powermeter::TransactionReq& value) override; | ||
virtual types::powermeter::TransactionStopResponse handle_stop_transaction(std::string& transaction_id) override; | ||
|
||
// ev@d2d1847a-7b88-41dd-ad07-92785f06f5c4:v1 | ||
// insert your protected definitions here | ||
// ev@d2d1847a-7b88-41dd-ad07-92785f06f5c4:v1 | ||
|
||
private: | ||
const Everest::PtrContainer<DCSupplySimulator>& mod; | ||
const Conf& config; | ||
|
||
virtual void init() override; | ||
virtual void ready() override; | ||
|
||
// ev@3370e4dd-95f4-47a9-aaec-ea76f34a66c9:v1 | ||
// insert your private definitions here | ||
// ev@3370e4dd-95f4-47a9-aaec-ea76f34a66c9:v1 | ||
}; | ||
|
||
// ev@3d7da0ad-02c2-493d-9920-0bbbd56b9876:v1 | ||
// insert other definitions here | ||
// ev@3d7da0ad-02c2-493d-9920-0bbbd56b9876:v1 | ||
|
||
} // namespace powermeter | ||
} // namespace module | ||
|
||
#endif // POWERMETER_POWERMETER_IMPL_HPP |