-
Martin Christoph Hierholzer authored
Unfortunatly this currently breaks the ServerHistory module, as it relies on slashes in accessor names. The MicroDAQ module had the same issue but has already been fixed. This fix can be adopted to the ServerHistory module as well.
Martin Christoph Hierholzer authoredUnfortunatly this currently breaks the ServerHistory module, as it relies on slashes in accessor names. The MicroDAQ module had the same issue but has already been fixed. This fix can be adopted to the ServerHistory module as well.
ControlSystemModule.cc 1.71 KiB
/*
* ControlSystemModule.cc
*
* Created on: Jun 28, 2016
* Author: Martin Hierholzer
*/
#include "Application.h"
#include "ControlSystemModule.h"
namespace ChimeraTK {
ControlSystemModule::ControlSystemModule(const std::string& _variableNamePrefix)
: Module(&(Application::getInstance()),
_variableNamePrefix.empty() ? "<ControlSystem>"
: _variableNamePrefix.substr(_variableNamePrefix.find_last_of("/")+1),
""),
variableNamePrefix(_variableNamePrefix)
{}
/*********************************************************************************************************************/
VariableNetworkNode ControlSystemModule::operator()(const std::string& variableName, const std::type_info &valueType,
size_t nElements) const {
assert(variableName.find_first_of("/") == std::string::npos);
if(variables.count(variableName) == 0) {
variables[variableName] = {variableNamePrefix/variableName, VariableDirection::invalid, valueType, nElements};
}
return variables[variableName];
}
/*********************************************************************************************************************/
Module& ControlSystemModule::operator[](const std::string& moduleName) const {
assert(moduleName.find_first_of("/") == std::string::npos);
if(subModules.count(moduleName) == 0) {
subModules[moduleName] = {variableNamePrefix/moduleName};
}
return subModules[moduleName];
}
/*********************************************************************************************************************/
const Module& ControlSystemModule::virtualise() const {
return *this;
}
}