Skip to content
Snippets Groups Projects
Commit 3e45171a authored by Martin Christoph Hierholzer's avatar Martin Christoph Hierholzer
Browse files

fixed connectTo() for direct device to control system connections when using...

fixed connectTo() for direct device to control system connections when using the [] operator on the device module
parent 6328a57f
No related branches found
No related tags found
No related merge requests found
......@@ -50,8 +50,8 @@ namespace ChimeraTK {
const std::unordered_set<std::string> &tags={});
/** Constructor for a Device node */
VariableNetworkNode(const std::string &deviceAlias, const std::string &registerName, UpdateMode mode,
VariableDirection direction, const std::type_info &valTyp=typeid(AnyType), size_t nElements=0);
VariableNetworkNode(const std::string &name, const std::string &deviceAlias, const std::string &registerName,
UpdateMode mode, VariableDirection direction, const std::type_info &valTyp=typeid(AnyType), size_t nElements=0);
/** Constructor for a ControlSystem node */
VariableNetworkNode(std::string publicName, VariableDirection direction,
......
......@@ -23,7 +23,7 @@ namespace ChimeraTK {
VariableNetworkNode DeviceModule::operator()(const std::string& registerName, UpdateMode mode,
const std::type_info &valueType, size_t nElements) const {
return {deviceAliasOrURI, registerNamePrefix/registerName, mode, VariableDirection::invalid, valueType, nElements};
return {registerName, deviceAliasOrURI, registerNamePrefix/registerName, mode, VariableDirection::invalid, valueType, nElements};
}
/*********************************************************************************************************************/
......@@ -130,8 +130,9 @@ namespace ChimeraTK {
valTyp = &typeid(std::string);
}
VariableNetworkNode node(deviceAliasOrURI, reg.getRegisterName(), updateMode, direction, *valTyp,
reg.getNumberOfElements());
auto name = std::string(reg.getRegisterName()).substr(prefixLength);
VariableNetworkNode node(name, deviceAliasOrURI, reg.getRegisterName(), updateMode,
direction, *valTyp, reg.getNumberOfElements());
virtualisedModuleFromCatalog.getAccessorList().push_back(node);
}
......
......@@ -53,10 +53,11 @@ namespace ChimeraTK {
/*********************************************************************************************************************/
VariableNetworkNode::VariableNetworkNode(const std::string &devAlias, const std::string &regName, UpdateMode mode,
VariableDirection dir, const std::type_info &valTyp, size_t nElements)
VariableNetworkNode::VariableNetworkNode(const std::string &name, const std::string &devAlias,
const std::string &regName, UpdateMode mode, VariableDirection dir, const std::type_info &valTyp, size_t nElements)
: pdata(boost::make_shared<VariableNetworkNode_data>())
{
pdata->name = name;
pdata->type = NodeType::Device;
pdata->mode = mode;
pdata->direction = dir;
......@@ -72,6 +73,7 @@ namespace ChimeraTK {
size_t nElements)
: pdata(boost::make_shared<VariableNetworkNode_data>())
{
pdata->name = pubName;
pdata->type = NodeType::ControlSystem;
pdata->mode = UpdateMode::push;
pdata->direction = dir;
......@@ -289,15 +291,7 @@ namespace ChimeraTK {
/*********************************************************************************************************************/
std::string VariableNetworkNode::getName() const {
if(pdata->type == NodeType::ControlSystem) {
return pdata->publicName;
}
else if(pdata->type == NodeType::Device) {
return pdata->registerName;
}
else {
return pdata->name;
}
return pdata->name;
}
/*********************************************************************************************************************/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment