-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
append orphan to provide a fallback when family device is unknown fro…
…m cxx lib
- Loading branch information
Rodriguez
committed
Oct 13, 2023
1 parent
5615c3f
commit d8f8098
Showing
6 changed files
with
64 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#include "orphan.hxx" | ||
|
||
using namespace pza; | ||
|
||
orphan::orphan(const std::string &group, const std::string &name) | ||
: device(group, name) | ||
{ | ||
|
||
} | ||
|
||
int orphan::_register_interfaces(const std::map<std::string, std::string> &map) | ||
{ | ||
// int ret; | ||
|
||
// ret = grouped_interface::register_interfaces<bps_channel>(this, "channel", map, channel); | ||
// if (ret < 0) | ||
// return ret; | ||
|
||
// for (auto &chan : channel) { | ||
// register_interface(chan->voltmeter); | ||
// register_interface(chan->ampermeter); | ||
// register_interface(chan->ctrl); | ||
// } | ||
return 0; | ||
} |
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 @@ | ||
#pragma once | ||
|
||
#include <pza/core/device.hxx> | ||
#include <pza/core/grouped_interface.hxx> | ||
|
||
|
||
#include <pza/utils/string.hxx> | ||
|
||
namespace pza | ||
{ | ||
|
||
class orphan : public device | ||
{ | ||
public: | ||
using ptr = std::shared_ptr<orphan>; | ||
|
||
explicit orphan(const std::string &group, const std::string &name); | ||
|
||
const std::string &get_family() override { return _family; }; | ||
// size_t get_num_channels() { return channel.size(); } | ||
// std::vector<bps_channel::ptr> channel; | ||
|
||
private: | ||
int _register_interfaces(const std::map<std::string, std::string> &map) override; | ||
|
||
std::string _family = "orphan"; | ||
}; | ||
}; |